query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
I have accepted the cost that this pact will have on me. My search for power lead me down a path I did not think possible before, and even if I did, never would I have deemed it necessary
public function applyAlwaysOnAbilityOverrides (): self { $class = new ReflectionClass($this->getItem()->getBaseItem()); if (is_iterable($this->getItem()->getItemAbilities())) { foreach ($this->getItem()->getItemAbilities() as $itemAbility) { if ($itemAbility->isAlwaysOn() && $this->attunedLevel >= $itemAbility->getAttunementLevelRequired()) { foreach ($itemAbility->getAbility()->getAbilityPartial() as $abilityPartial) { if ($abilityPartial instanceof AbilityOverride) { try { $key = Tools::snakeCaseToCamelCase($abilityPartial->getOverrideKey(), false); $property = $class->getProperty($key); $property->setAccessible(true); if ($abilityPartial->isAppend()) { $property->setValue($this->getItem()->getBaseItem(), Tools::append($property->getValue($this->getItem()->getBaseItem()), $abilityPartial->getValue())); } else { $property->setValue($this->getItem()->getBaseItem(), $abilityPartial->getValue()); } /** TODO Unset the ability partial */ } catch (\Exception $exception) { continue; } } } } } } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasPrecost(){\n return $this->_has(25);\n }", "function reduce_woocommerce_min_strength_requirement( $strength ) {\n return 2;\n}", "public function cost(){\n\t\t\n\t\treturn 200;\n\t}", "function isPowerOverloaded($extra_consumption = 0)\n{\n global $game;\n\n // Calculate buildings energy consumption\n $buildings = $game->planet['building_1'] +\n $game->planet['building_2'] + \n $game->planet['building_3'] + \n $game->planet['building_4'] + \n $game->planet['building_10'] + \n $game->planet['building_6'] + \n $game->planet['building_7'] + \n $game->planet['building_8'] +\n $game->planet['building_9'] + \n $game->planet['building_11'] + \n $game->planet['building_12'] +\n $game->planet['building_13'];\n\n // Consider extra consumption from queued buildings\n $buildings += $extra_consumption;\n\n // Check if the active planet is the user's capital\n if ($game->player['user_capital']==$game->planet['planet_id'])\n $available_power = $game->planet['building_5']*11+14;\n else\n $available_power = $game->planet['building_5']*15+3;\n\n return ($buildings >= $available_power);\n}", "public function promotional();", "private static function getCost(){\n\t $timeTarget = 0.2;\n\n\t\t\t$cost = 9;\n\t\t\tdo {\n\t\t\t\t$cost++;\n\t\t\t\t$start = microtime(true);\n\t\t\t\tpassword_hash(\"test\", PASSWORD_DEFAULT, [\"cost\" => $cost]);\n\t\t\t\t$end = microtime(true);\n\t\t\t}while(($end - $start) < $timeTarget);\n\n\t return [\"cost\" => $cost];\n\t }", "function algorithmic_cost()\r\n{\r\n return ['cost' => 10];\r\n}", "function interceptions() {\n\t\t$interceptions_calc = $this->_interceptions/$this->_attempts;\n\t\t// Other NFL QBR specific manipulations\n\t\t$interceptions_calc *= 25;\n\t\tif (2.375 - $interceptions_calc < 0) {\n\t\t\t$interceptions_calc = 0;\n\t\t} else {\n\t\t\t$interceptions_calc = 2.375 - $interceptions_calc;\n\t\t}\n\t\treturn $interceptions_calc;\n\t}", "function getUVSpotCost (&$rawCost, $totalSheets) {\n\tif($_POST[\"uvSpot\"] == \"uvSpot\") {\n\t\t$uvSpotCost = UVSPOTSETUP;\n\t\t$uvSpotCost += ($totalSheets * UVSPOTCOST);\n\t}\nelse {\n\t$uvSpotCost = 0;\n\t}\n$rawCost += $uvSpotCost;\n}", "private function _optimize() {}", "function getWhiteCost ($totalSheets, &$rawCost) {\n\tif ($_POST[\"white\"] == \"white\"){\n\t\t$whiteCost = 0;\n\t\t$whiteCost += ($totalSheets * WHITECOST);\n\t}\nelse {\n\t$whiteCost = 0;\n\t}\n$rawCost += $whiteCost;\n\n}", "public function releaseRefPointsOnEveryShoping()\n {\n \t//More you pay less you release.\n \t//Get the points for other shops.\n }", "function killpointsFromDueling() {\n\tglobal $target_level,$attacker_level,$starting_target_health,$killpoints,$duel;\n\n\t$levelDifference = ($target_level-$attacker_level);\n\n\tif ($levelDifference > 10) {\n\t\t$levelDifferenceMultiplier = 5;\n\t} else if ($levelDifference > 0) {\n\t\t$levelDifferenceMultiplier = ceil($levelDifference/2); //killpoint return of half the level difference.\n\t} else {\n\t\t$levelDifferenceMultiplier = 0;\n\t}\n\n\t$killpoints = 1+$levelDifferenceMultiplier;\n}", "function GetSpeedIncreaseClay(&$wg_buildings){\n\tglobal $db;\n\t$sum=0;$i=0;\n\tif($wg_buildings)\n\t{\n\t\tforeach ($wg_buildings as $ptu)\n\t\t{\n\t\t\tif($ptu->index<19)\n\t\t\t{\n\t\t\t\tif($ptu->type_id==4)\n\t\t\t\t{\n\t\t\t\t\t$sum=$sum+$ptu->product_hour;\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\tif($i==19){break;}\n\t\t}\n\t\treturn $sum;\n\t}\n\telse\n\t{\n\t\theader(\"Location:logout.php\");\n\t\texit();\n\t}\n}", "public function testProductionSpeed(): void\n {\n $t750 = new TerminatorT750(5);\n $numberOfRepetitions = 2001;\n\n $startProductionClones = \\hrtime(true);\n for ($i = 1; $i <= $numberOfRepetitions; $i++) {\n clone $t750;\n }\n $endProductionClones = \\hrtime(true);\n\n $startProductionObjects = \\hrtime(true);\n for ($i = 1; $i <= $numberOfRepetitions; $i++) {\n new TerminatorT750(5);\n }\n $endProductionObjects = \\hrtime(true);\n\n $productionTimeOfClones = $endProductionClones - $startProductionClones;\n $productionTimeOfObjects = $endProductionObjects - $startProductionObjects;\n\n $this->assertGreaterThan($productionTimeOfClones, $productionTimeOfObjects);\n }", "function getSaddleCost (&$labor, &$rawCost, $quantity) {\nif ($_POST[\"saddle\"] == \"saddle\") {\n\t$saddleLabor = (($quantity/SADDLEPERHOUR) * HOUR);\n\t$saddleCost = ($quantity * STAPLE);\n\t}\nelse {\n\t$saddleLabor = 0;\n\t$saddleCost = 0;\n\t}\n$labor += $saddleLabor;\n$rawCost += $saddleCost;\n}", "public function testWeaklingsCauseBounty()\n {\n if (!(defined('DEBUG') && DEBUG)) {\n $this->markTestSkipped(); // No merchant2 in non-debug scenarios for now.\n } else {\n $merchant = new Npc('merchant2');\n $this->assertGreaterThan(0, $merchant->bountyMod());\n $villager = new Npc('peasant2');\n $this->assertGreaterThan(0, $villager->bountyMod());\n }\n }", "function getSpiralCost (&$labor, &$rawCost, $quantity) {\nif ($_POST[\"spiral\"] == \"spiral\") {\n\t\t$spiralLabor = (HOUR * .08333) * $quantity;\n\t\t$spiralCost = ( $quantity * SPIRALCOST);\n\t}\nelse {\n\t$spiralLabor = 0;\n\t$spiralCost = 0;\n\t}\n$labor += $spiralLabor;\n$rawCost += $spiralCost;\n}", "function implement_card_effect($game_id, $turn, $card, &$currencies, &$producers, &$player_data) {\n global $CONST;\n\n if ($card['type'] == 0) {\n // All players with the least ... lose random building\n\n $res_min = get_currency_production_proper($player_data[0]['resources'], $producers[$card['data']['industry']]);\n foreach ($player_data as $player) {\n $res_min = min($res_min, get_currency_production_proper($player['resources'], $producers[$card['data']['industry']]));\n }\n\n foreach ($player_data as &$player) {\n if (abs($res_min - get_currency_production_proper($player['resources'], $producers[$card['data']['industry']])) < $CONST['EPS']) {\n $building_count = 0;\n foreach ($currencies as $currency) {\n foreach ($producers[$currency['id']] as $producer) {\n $building_count += json_value($player['resources'], 'producer_'.$currency['id'].'_'.$producer['level']);\n }\n }\n if ($building_count > 0) {\n $building_count = rand(1, $building_count);\n $destroyed = false;\n foreach ($currencies as $currency) {\n foreach ($producers[$currency['id']] as $producer) {\n $building_count -= json_value($player['resources'], 'producer_'.$currency['id'].'_'.$producer['level']);\n if (!$destroyed && $building_count <= 0) {\n $player['resources']['producer_'.$currency['id'].'_'.$producer['level']] = json_value($player['resources'], 'producer_'.$currency['id'].'_'.$producer['level']) - 1;\n // building_lost to log\n perform_query(\"INSERT INTO logs (game_id, turn, type, data) VALUES (\".$game_id.\", \".$turn.\", 'building_lost', '{\\\"who\\\": \".$player['internal_id'].\", \\\"what\\\": \".$producer['id'].\"}')\");\n $destroyed = true;\n }\n }\n }\n }\n else {\n // building_none to log\n perform_query(\"INSERT INTO logs (game_id, turn, type, data) VALUES (\".$game_id.\", \".$turn.\", 'building_none', '{\\\"who\\\": \".$player['internal_id'].\"}')\");\n }\n }\n }\n unset($player);\n }\n if ($card['type'] == 1) {\n // All players with the most ... get two 0th\n\n $res_max = get_currency_production_proper($player_data[0]['resources'], $producers[$card['data']['industry']]);\n foreach ($player_data as $player) {\n $res_max = max($res_max, get_currency_production_proper($player['resources'], $producers[$card['data']['industry']]));\n }\n\n foreach ($player_data as &$player) {\n if (abs(get_currency_production_proper($player['resources'], $producers[$card['data']['industry']]) - $res_max) < $CONST['EPS']) {\n $player['resources']['producer_'.$card['data']['industry'].'_0'] = json_value($player['resources'], 'producer_'.$card['data']['industry'].'_0') + 2;\n // building_gained x2 to log\n perform_query(\"INSERT INTO logs (game_id, turn, type, data) VALUES (\".$game_id.\", \".$turn.\", 'building_gained', '{\\\"who\\\": \".$player['internal_id'].\", \\\"what\\\": \".$producers[$card['data']['industry']][0]['id'].\"}')\");\n perform_query(\"INSERT INTO logs (game_id, turn, type, data) VALUES (\".$game_id.\", \".$turn.\", 'building_gained', '{\\\"who\\\": \".$player['internal_id'].\", \\\"what\\\": \".$producers[$card['data']['industry']][0]['id'].\"}')\");\n }\n }\n unset($player);\n }\n if ($card['type'] == 2) {\n // All players lose all banked ...\n\n foreach ($player_data as &$player) {\n $player['resources']['currency_'.$card['data']['industry']] = 0;\n }\n unset($player);\n }\n if ($card['type'] == 3) {\n // All players gain ... 3\n\n foreach ($player_data as &$player) {\n $player['resources']['currency_'.$card['data']['industry']] = json_value($player['resources'], 'currency_'.$card['data']['industry']) + 3;\n }\n unset($player);\n }\n if ($card['type'] == 4) {\n // All players' money are doubled\n\n foreach ($player_data as &$player) {\n $player['resources']['money'] = json_value($player['resources'], 'money') * 2;\n }\n unset($player);\n }\n if ($card['type'] == 5) {\n // All ... building costs are reset for all players\n\n foreach ($player_data as &$player) {\n foreach ($producers[$card['data']['industry']] as $producer) {\n $player['resources']['bought_'.$producer['currency_id'].'_'.$producer['level']] = 0;\n }\n }\n unset($player);\n }\n if ($card['type'] == 6) {\n // 0th produce ... 1 more for all players\n\n // No effect\n }\n\n if ($card['type'] == 7) {\n // All players with the most money gain 3 VP\n\n $res_max = json_value($player_data[0]['resources'], 'money');\n foreach ($player_data as $player) {\n $res_max = max($res_max, json_value($player['resources'], 'money'));\n }\n\n foreach ($player_data as &$player) {\n if (abs(json_value($player['resources'], 'money') - $res_max) < $CONST['EPS']) {\n $player['vp'] += 3;\n // vp_gained(3) to log\n perform_query(\"INSERT INTO logs (game_id, turn, type, data) VALUES (\".$game_id.\", \".$turn.\", 'vp_gained', '{\\\"who\\\": \".$player['internal_id'].\", \\\"amount\\\": 3}')\");\n }\n }\n unset($player);\n }\n if ($card['type'] == 8) {\n // All players with the most ... gain 2 VP\n\n $res_max = get_currency_production_proper($player_data[0]['resources'], $producers[$card['data']['industry']]);\n foreach ($player_data as $player) {\n $res_max = max($res_max, get_currency_production_proper($player['resources'], $producers[$card['data']['industry']]));\n }\n\n foreach ($player_data as &$player) {\n if (abs(get_currency_production_proper($player['resources'], $producers[$card['data']['industry']]) - $res_max) < $CONST['EPS']) {\n $player['vp'] += 2;\n // vp_gained(2) to log\n perform_query(\"INSERT INTO logs (game_id, turn, type, data) VALUES (\".$game_id.\", \".$turn.\", 'vp_gained', '{\\\"who\\\": \".$player['internal_id'].\", \\\"amount\\\": 2}')\");\n }\n }\n unset($player);\n }\n if ($card['type'] == 9) {\n // Everything related to ... is reset. Players retain VP earned through ... All players gain ... 3\n\n foreach ($player_data as &$player) {\n $player['resources']['currency_'.$card['data']['industry']] = 3;\n $player['resources']['vp_'.$card['data']['industry']] = 0;\n //$player['resources']['rvp_'.$card['data']['industry']] = 0;\n foreach ($producers[$card['data']['industry']] as $producer) {\n $player['resources']['producer_'.$producer['currency_id'].'_'.$producer['level']] = 0;\n $player['resources']['bought_'.$producer['currency_id'].'_'.$producer['level']] = 0;\n }\n }\n unset($player);\n }\n if ($card['type'] == 10) {\n // All future VP income from ... is doubled for all players\n\n // No effect\n }\n if ($card['type'] == 11) {\n // All cards' permanent effects from previous rounds are disabled\n\n // No effect\n }\n if ($card['type'] == 12) {\n // All players with the most VP sell all their currencies for money\n\n $res_max = $player_data[0]['vp'];\n foreach ($player_data as $player) {\n $res_max = max($res_max, $player['vp']);\n }\n\n foreach ($player_data as &$player) {\n if (abs($player['vp'] - $res_max) < $CONST['EPS']) {\n $total_sold = 0;\n foreach ($currencies as $currency) {\n $total_sold += json_value($player['resources'], 'currency_'.$currency['id']);\n $player['resources']['currency_'.$currency['id']] = 0;\n }\n // currencies_sold to log\n perform_query(\"INSERT INTO logs (game_id, turn, type, data) VALUES (\".$game_id.\", \".$turn.\", 'currencies_sold', '{\\\"who\\\": \".$player['internal_id'].\", \\\"amount\\\": \".$total_sold.\"}')\");\n }\n }\n unset($player);\n }\n if ($card['type'] == 13) {\n // ... buildings do not produce anything in the end of this round\n\n // No effect\n } \n}", "public static function getBestCost(): int\n {\n $timeTarget = 0.05; // 50 milliseconds\n $cost = 8;\n\n do {\n $cost++;\n $start = microtime(true);\n password_hash(\"test\", PASSWORD_BCRYPT, [\"cost\" => $cost]);\n $end = microtime(true);\n } while (($end - $start) < $timeTarget);\n\n return $cost;\n }", "function getUVFloodCost (&$rawCost, $totalSheets) {\n\tif ($_POST[\"uvFlood\"] == \"uvFlood\") {\n\t\t$itemUVFlood = 1;\n\t\t$uvFloodCost = UVFLOODSETUP;\n\t\t$uvFloodCost += ($totalSheets * UVFLOODCOST);\n\t}\nelse {\n\t$uvFloodCost = 0;\n\t}\n\n$rawCost += $uvFloodCost;\n}", "public static function getBestCost()\n {\n $timeTarget = 0.05;\n\n $cost = 8;\n do {\n $cost++;\n $start = microtime(true);\n password_hash(\"test\", PASSWORD_BCRYPT, [\"cost\" => $cost]);\n $end = microtime(true);\n } while (($end - $start) < $timeTarget);\n\n echo \"Best cost for this server is : \" . $cost . \"\\n\";\n }", "function calculateEnergyUse(){\n $this->boilerEnergy = $this->outletSteam->energyFlow + $this->blowdown->energyFlow - $this->feedwater->energyFlow;\n $this->fuelEnergy = $this->boilerEnergy / $this->boilerEff; \n $this->checkWarnings();\n }", "function calc_required_en(){\r\n\tif(strpos($this->Tactics['spec'],'DoubleStrike') !== false) $this->Eq['A']['enc'] *= 2;\r\n\tif(strpos($this->Tactics['spec'],'TripleStrike') !== false) $this->Eq['A']['enc'] *= 3;\r\n\t$MSEnCpos = strpos($this->MS['spec'],'CostEN');\r\n\tif($MSEnCpos !== false) {\r\n\t\t$temp = array();\r\n\t\tpreg_match('/CostEN<([0-9.]+)>/',$this->MS['spec'],$temp,0,$MSEnCpos);\r\n\t\t$MSEnC = floatval($temp[1]);\r\n\t\tif($MSEnC < 1) $MSEnC = floor($this->Player['enmax'] * $MSEnC);\r\n\t\t$this->Eq['A']['enc'] += $MSEnC;\r\n\t}\r\n\t$this->RequireEN = ($this->Eq['A']['enc'] + $this->Eq['D']['enc'] + $this->Eq['E']['enc']);\r\n}", "function spectra_money_supply ()\n\t{\n\t\tif (system_flag_get (\"balance_rebuild\") > 0)\n\t\t{\n\t\t\treturn \"Re-Balancing\";\n\t\t}\n\t\t\n\t\t$response = $GLOBALS[\"db\"][\"obj\"]->query (\"SELECT SUM(`balance`) AS `supply` FROM `\".$GLOBALS[\"tables\"][\"ledger\"].\"`\");\n\t\t$result = $response->fetch_assoc ();\n\t\t\n\t\tif (!isset ($result[\"supply\"]))\n\t\t{\n\t\t\treturn \"Unavailable\";\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\treturn $result[\"supply\"];\n\t\t}\n\t}", "public function testIncorrectCanBuyWithOneALotShortMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(9);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock, 10);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(false,$result);\n\t\t}", "function getLamCost ($totalSheets, &$rawCost, &$labor, $quantity, $Nup) {\n\tif ($_POST[\"lam\"] == \"lam\") {\n\t\t$lamCost = 0;\n\t\t$lamCost += ($totalSheets * LAMCOST);\n\t}\n\telse {\n\t\t$lamCost = 0;\n\t\t}\n$rawCost += $lamCost;\n\n\n// if booklet + lam\n\tif ($_POST[\"lamcover\"] == \"lamcover\") {\n\t\t$lamCoverLabor = 0;\n\t\t$lamCoverLabor += (( $quantity / $Nup ) * LAMTIME * HOUR );\n\t\t$lamCoverCost = 0;\n\t\t$lamCoverCost += ($quantity * LAMCOST);\n\t}\n\telse {\n\t\t$lamCoverLabor = 0;\n\t\t$lamCoverCost = 0;\n\t}\n$labor += $lamCoverLabor;\n$rawCost += $lamCoverCost;\n\n\n//Determine Lam Labor\n\tif ($_POST[\"lam\"] == \"lam\") {\n\t\t$lamLabor = 0;\n\t\t$lamLabor += ((($totalSheets/4) * LAMTIME) * HOUR);\n\t}\n\telse {\n\t\t$lamLabor = 0;\n\t}\n$labor += $lamLabor;\n}", "private function passTime()\n {\n // guys in bathroom lose pee equal to peeSpeed\n // guys at bar gain pee equal to drinkSpeed\n // guys in bathroom with pee == 0 return to bar\n }", "public function benchThisWillBeSkipped()\n {\n }", "public function testIncorrectCanBuyWithOneShortMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(99);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$c->buyStock(NULL, 0);\n\t\t\t$c->sellStock(NULL, 0);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(false,$result);\n\t\t}", "function cheepestCost($n, $m){\n\t\t\t\treturn cost($n,$m);\n\t\t\t}", "function calculateBuyPriceOfAssetUnitUsingRealBuyPriceOfAssetAndTransactedAmount($realBuyPriceOfAsset, $transactedAmount)\n\t{\n\t\t/*\n\t\tCalculation process\t- Patent Specifics - Determining Cost Basis Inline Calculations v2 p 4\n\t\t\t\n\t\tCalculated Buy Price for Asset Unit = Real Buy Price of Asset / Transacted Amount\n\t\t\n\t\tAssuming Real Buy Price of Asset = 4768.8822860148 and Transacted Amount = 0.7452\n\t\t\n\t\tCalculated Buy Price for Asset Unit = 4768.8822860148 / 0.7452 = 6399.466299\n\t\t\n\t\tNote - we have to ensure that this process does not run if the transacted amount is zero\n\t\t*/\t\n\t\t\n\t\t$calculatedBuyPriceOfAssetUnit\t\t= 0;\n\t\t\n\t\tif ($transactedAmount > 0)\n\t\t{\n\t\t\t$calculatedBuyPriceOfAssetUnit\t= $realBuyPriceOfAsset / $transactedAmount;\n\t\t}\n\n\t\treturn $calculatedBuyPriceOfAssetUnit;\t\n\t}", "public function tellNotEnoughMoneyInAccount()\n {\n }", "public function getCost();", "private static function lowPass()\n {\n }", "function GetFuturePts($t)\n{\n global $game, $NUM_BUILDING;\n $_planet_points = 10;\n\n // Sum all points of the planet, $game->planet contains values\n // actualized with the queued buildings\n for($b = 1; $b <= $NUM_BUILDING; $b++)\n $_planet_points += pow($game->planet['building_'.$b],1.5);\n /* \n for($r = 1; $r <= 5; $r++)\n $_planet_points += pow($game->planet['research_'.$r],1.5);\n */\n $_planet_points = round($_planet_points);\n\n // Calculate points of the required building\n $_points = round(pow($game->planet['building_'.($t+1)]+1,1.5)-pow($game->planet['building_'.($t+1)],1.5));\n\n // Sum up all the points\n $_total = $_points + $_planet_points;\n\n return($_total);\n}", "function calculate_delivery_cost($volume,$location_distance,$quantity){\n $total_volume = $volume * $quantity;\n // assume that the volume of space available in a motocycle is 500\n $motocycle_vol = 500;\n // assume that the volume of space available in a motocycle is 1000\n $cab_volume = 1000;\n if($total_volume <= $motocycle_vol){\n $means = 1; // 1 for motocycle ans 2 for cab\n }elseif ($total_volume <= $cab_volume && $total_volume > $motocycle_vol){\n $means = 2;\n }\n $cost_per_dist = ($means == 1)? 100 : 70;\n $total_cost = $cost_per_dist * $location_distance; // assume location distance is in km\n return $total_cost;\n}", "function mainreset()\r\n{\r\n\tglobal $db;\r\n\tglobal $arrLanguage;\r\n\r\n\tstart();\r\n\t/// Add player's age. Decrement account freezing count (timeshift must be greater than 180, which is limit for \"active players, currently logged in\").\r\n\t$db -> Execute('UPDATE `players` SET `age`=`age`+1, `houserest`=\\'N\\'');\r\n\t$db -> Execute('UPDATE `players` SET `freeze`=`freeze`-1, `lpv`='.(time() - 200).' WHERE `freeze`>0');\r\n\r\n\t/// Pay for troops in outposts.\r\n\t$arrCosts = $db -> GetAll('SELECT `id`, `warriors`, `catapults`, `barricades`, `archers`, `gold`, `bcost`, `size`, `owner` FROM `outposts`');\r\n\t$arrMultipliers = array(9,3,1,9); // cost of one unit of troop type\r\n\tfor ($i = 0, $intMax = count($arrCosts); $i < $intMax; ++$i)\r\n\t{\r\n\t\t$cost = 3 * (($arrCosts[$i][1] + $arrCosts[$i][4]) * 3 + $arrCosts[$i][2]) + $arrCosts[$i][3];\r\n\t\t$result = $db -> GetRow('SELECT count(*) FROM `outpost_monsters` WHERE `outpost`='.$arrCosts[$i][0]);\r\n\t\t$cost += $result[0] * 50;\r\n\t\t$result = $db -> GetRow('SELECT count(*) FROM `outpost_veterans` WHERE `outpost`='.$arrCosts[$i][0]);\r\n\t\t$cost += $result[0] * 50;\r\n\t\t$cost *= 1 - $arrCosts[$i][6] / 100;\t// Cost reduction based on bonus skill.\r\n\t\tif ($arrCosts[$i][5] >= $cost)\t\t // There is enough gold to pay in treasury.\r\n\t\t\t$tax = $cost;\r\n\t\telse\r\n\t\t{\r\n\t\t\t$tax = $arrCosts[$i][5];\t// Take all gold...\r\n\t\t\t$cost -= $arrCosts[$i][5]; // ...and use it to pay as much as possible.\r\n\t\t\t// Dismissal order: warriors - catapults - barricades - archers.\r\n\t\t\t// Reason: lefts something for defense till the very end. Soldiers must stay in outpost or it's size degrades.\r\n\t\t\tfor ($j = 0;$j < 4; ++$j)\r\n\t\t\t{\r\n\t\t\t\tif ($cost <= $arrCosts[$i][$j+1] * $arrMultipliers[$j]) // If remaining cost can be \"paid\" by part of \"this\" army...\r\n\t\t\t\t{\r\n\t\t\t\t\t$arrCosts[$i][$j+1] -= $cost / $arrMultipliers[$j]; // Units that can't be paid - leave.\r\n\t\t\t\t\t$cost = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$arrCosts[$i][1] = 0;\t\t // All units of this type leave.\r\n\t\t\t\t\t$cost -= $arrCosts[$i][1] * $arrMultipliers[$j];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$db -> Execute('INSERT INTO `log` (`owner`, `log`, `czas`) VALUES('.$arrCosts[$i][8].', \\'Twoja strażnica niszczeje, a nie opłacani żołnierze opuszczają Cię!\\', '.$db -> DBDate(date(\"y-m-d H:i:s\")).')');\r\n\t\t}\r\n\t\t$strQuery = 'UPDATE `outposts` SET `warriors`='.$arrCosts[$i][1].', `archers`='.$arrCosts[$i][4].', `catapults`='.$arrCosts[$i][2].',`barricades`='.$arrCosts[$i][3].', `gold`=`gold`-'.$tax;\r\n\t\tif ($arrCosts[$i][1] + $arrCosts[$i][4] < 1)\t// No soldiers left.\r\n\t\t\t$strQuery .= ' ,`size`='.--$arrCosts[$i][7];\r\n\t\tif(!$arrCosts[$i][7]) // Size = 0.\r\n\t\t{\r\n\t\t\t$db -> Execute('DELETE FROM `outposts` WHERE `id`='.$arrCosts[$i][0]);\r\n\t\t\t$db -> Execute('DELETE FROM `outpost_monster` WHERE `outpost`='.$arrCosts[$i][0]);\r\n\t\t\t$db -> Execute('DELETE FROM `outpost_veterans` WHERE `outpost`='.$arrCosts[$i][0]);\r\n\t\t}\r\n\t\telse\r\n\t\t\t$db -> Execute($strQuery.' WHERE `id`='.$arrCosts[$i][0]);\r\n\t}\r\n\tunset($arrCosts);\r\n\r\n\t/// Lenght of poll.\r\n\t$arrPolls = $db -> GetAll('SELECT `id`, `days` FROM `polls` WHERE `votes`=-1 AND `days`>1');\r\n\tfor ($i = 0, $intMax = count($arrPolls); $i < $intMax; ++$i)\r\n\t{\r\n\t\tif($arrPolls[$i][1] == 1)\r\n\t\t{\r\n\t\t\t$db -> Execute('UPDATE `polls` SET `members`=(SELECT count(*) FROM `players`) WHERE `id`='.$arrPolls[$i][0]);\r\n\t\t\t$db -> Execute('UPDATE `settings` SET `value`=\\'N\\' WHERE `setting`=\\'poll\\'');\r\n\t\t}\r\n\t}\r\n\t$db -> Execute('UPDATE `polls` SET `days`=`days`-1 WHERE `days`>1');\r\n\tunset($arrPolls);\r\n/**\r\n * Warehouse actions.\r\n * 1) Every 10th day there is a chance for caravan that buys goods.\r\n */\r\n\t$arrItems = array('copperore', 'zincore', 'tinore', 'ironore', 'copper', 'bronze', 'brass', 'iron', 'steel', 'coal', 'adamantium', 'meteor', 'crystal', 'pine', 'hazel', 'yew', 'elm', 'mithril', 'illani', 'illanias', 'nutari', 'dynallca', 'illani_seeds', 'illanias_seeds', 'nutari_seeds', 'dynallca_seeds');\r\n\t$arrTest = $db -> GetRow('SELECT `reset` FROM `warehouse` WHERE `reset`=10 LIMIT 1');\r\n\tif (!empty($arrTest))\r\n\t{\r\n\t\t$arrCaravanday = $db -> GetRow('SELECT `value` FROM `settings` WHERE `setting`=\\'day\\'');\r\n\t\t$strCaravan = 'N';\r\n\t\tif ($arrCaravanday[0] % 10 == 0 && rand(1, 10) == 10)\r\n\t\t{\r\n\t\t\tforeach ($arrItems as $strItem)\r\n\t\t\t{\r\n\t\t\t\t$intPercent = rand(1, 100) / 100;\r\n\t\t\t\t$db -> Execute('UPDATE `warehouse` SET `buy`=`buy`+`amount`*'.$intPercent.', `amount`=`amount`*'.(1 - $intPercent).' WHERE `mineral`=\\''.$strItem.'\\' AND `reset`=1');\r\n\t\t\t}\r\n\t\t\t$strCaravan = 'Y';\r\n\t\t}\r\n\t\t$db -> Execute('UPDATE `settings` SET `value`=\\''.$strCaravan.'\\' WHERE `setting`=\\'caravan\\'');\r\n/**\r\n * 2) Count prices in warehouse.\r\n * Variant 1: when there's full warehouse history available.\r\n */\r\n\t\t$arrPrice = array(0.14, 0.13, 0.12, 0.11, 0.1, 0.1, 0.09, 0.08, 0.07, 0.06);\r\n\t\tfor ($i = 0; $i < 26; ++$i)\r\n\t\t{\r\n\t\t\t$arrMineral = $db -> GetAll('SELECT `cost`, `sell`, `buy`, `amount` FROM `warehouse` WHERE `mineral`=\\''.$arrItems[$i].'\\' ORDER BY `reset` ASC');\r\n\t\t\t$intTotal = 0;\r\n\t\t\tfor ($j = 0; $j < 10; ++$j)\r\n\t\t\t\t$intTotal += $arrMineral[$j][1] + $arrMineral[$j][2];\r\n\t\t\tif (!$intTotal)\r\n\t\t\t\t$intTotal = 1;\r\n\t\t\t$intPrice = 0;\r\n\t\t\tfor ($j = 0; $j < 10; ++$j)\r\n\t\t\t\t$intPrice += (($arrMineral[$j][2] - $arrMineral[$j][1]) / $intTotal + 1) * $arrMineral[$j][0] * $arrPrice[$j];\r\n\t\t\t// If \"today\" amount == 0...\r\n\t\t // echo('<p>'.$arrItems[$i].'. Cena wyliczana wzorkiem: '.$intPrice.'<br />');\r\n\t\t\tif ($arrMineral[0][3] < 1)\r\n\t\t\t{// ...find out how long the warehouse is empty, and increment price a bit more.\r\n\t\t\t\t$arrTest = $db -> GetRow('SELECT `value` FROM `settings` WHERE `setting`=\\''.$arrItems[$i].'\\'');\r\n\t\t\t\tif ($arrTest[0] > 4)\r\n\t\t\t\t\t$intPrice = $arrMineral[0][0] + pow(2, floor($arrTest[0] / 5) - 1);\r\n\t\t\t // echo('Zero od '.$arrTest[0].' dni, po dodaniu bonusu: '.$intPrice);\r\n\t\t\t\t$db -> Execute('UPDATE `settings` SET `value`=`value`+1 WHERE `setting`=\\''.$arrItems[$i].'\\'');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$db -> Execute('UPDATE `settings` SET `value`=0 WHERE `setting`=\\''.$arrItems[$i].'\\'');\r\n\t\t\t$db -> Execute('DELETE FROM `warehouse` WHERE `mineral`=\\''.$arrItems[$i].'\\' AND `reset`=10');\r\n\t\t\t$db -> Execute('UPDATE `warehouse` SET `reset`=`reset`+1 WHERE `mineral`=\\''.$arrItems[$i].'\\'');\r\n\t\t\t$db -> Execute('INSERT INTO `warehouse` (`reset`, `mineral`, `cost`, `amount`) VALUES (1, \\''.$arrItems[$i].'\\', '.$intPrice.', '.$arrMineral[0][3].')');\r\n\t\t // echo '</p>';\r\n\t\t}\r\n\t}\r\n/// Variant 2: Not enough data. Add new reset copying the amount from old one (if it's day 1 of new era, use base values).\r\n\telse\r\n\t{\r\n\t$arrStartPrices = array(2,4,6,9,7,18,22,35,50,1,15,150,20,7,12,20,40,20,15,25,40,50,50,100,140,180);\r\n\t$arrStartAmount = array(50000,0,0,0,10000,0,0,0,0,100000,2000,500,2000,20000,0,0,0,10000,2000,2000,2000,2000,0,0,0,0);\r\n\t$strQuery = 'INSERT INTO `warehouse` (`reset`, `mineral`, `cost`, `amount`) VALUES (1, \\'';\r\n\t\tfor ($i = 0; $i < 26; ++$i)\r\n\t\t{\r\n\t\t\t$arrReset = $db -> GetRow('SELECT `amount`, `cost` FROM `warehouse` WHERE `mineral`=\\''.$arrItems[$i].'\\' AND `reset`=1');\r\n\t\t\tif (!empty($arrReset))\r\n\t\t\t{\r\n\t\t\t\t$db -> Execute('UPDATE `warehouse` SET `reset`=`reset`+1 WHERE `mineral`=\\''.$arrItems[$i].'\\'');\r\n\t\t\t\t$db -> Execute($strQuery.$arrItems[$i].'\\', '.$arrReset[1].', '.$arrReset[0].')');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$db -> Execute($strQuery.$arrItems[$i].'\\', '.$arrStartPrices[$i].', '.$arrStartAmount[$i].')');\r\n\t\t}\r\n\t}\r\n\t/// Add game age.\r\n\t$db -> Execute('UPDATE `settings` SET `value`=`value`+1 WHERE `setting`=\\'day\\'');\r\n\t/// Count amount of minerals in mines.\r\n\t$db -> Execute('UPDATE `mines_search` SET `days`=`days`-1');\r\n\t$arrSearchmin = $db -> GetAll('SELECT `player`, `mineral`, `searchdays` FROM `mines_search` WHERE `days`=0');\r\n\t$arrMinerals = array('coal' => 0.75,\r\n\t\t\t\t\t\t 'copper' => 1,\r\n\t\t\t\t\t\t 'zinc' => 2,\r\n\t\t\t\t\t\t 'tin' => 3,\r\n\t\t\t\t\t\t 'iron' => 4);\r\n\t$arrMaxDeposit = array(500,1500,3000); // max amount of ore based on day 1,2 or 3.\r\n\tfor ($i = 0, $intMax = count($arrSearchmin); $i < $intMax; ++$i)\r\n\t{\r\n\t\t$strMineral = $arrSearchmin[$i][1];\r\n\t\t$intAmount = ceil(rand(1, 10) * $arrMaxDeposit[$arrSearchmin[$i][2] - 1] / $arrMinerals[$strMineral]);\r\n\t\t$arrTest = $db -> GetRow('SELECT `owner` FROM `mines` WHERE `owner`='.$arrSearchmin[$i][0]);\r\n\t\tif (!empty($arrTest))\r\n\t\t\t$db -> Execute('UPDATE `mines` SET `'.$strMineral.\"`=`\".$strMineral.\"`+\".$intAmount.\" WHERE `owner`=\".$arrSearchmin[$i][0]);\r\n\t\telse\r\n\t\t\t$db -> Execute('INSERT INTO `mines` (`owner`,`'.$strMineral.'`) VALUES('.$arrSearchmin[$i][0].', '.$intAmount.')');\r\n\t}\r\n\t$db -> Execute('DELETE FROM `mines_search` WHERE `days`=0');\r\n\tunset($arrSearchmin, $arrMinerals, $arrMaxDeposit, $arrTest);\r\n\t/// Show new news (player's gossips).\r\n\t$db -> Execute('UPDATE `news` SET `show`=\\'Y\\' WHERE `show`=\\'N\\' AND `added`=\\'Y\\' ORDER BY `id` ASC LIMIT 1');\r\n\t/// Check construction of Astral Machine.\r\n\t$arrTest = $db -> GetRow('SELECT `value` FROM `settings` WHERE `setting`=\\'tribe\\'');\r\n\tif ($arrTest[0] == '')\r\n\t{\r\n\t\t$arrAstral = $db -> GetAll('SELECT `owner`, `used`, `directed` FROM `astral_machine` WHERE `aviable`=\\'Y\\'');\r\n\t\t$blnBreak = false;\r\n\t\tfor ($i = 0, $intMax = count($arrAstral); $i < $intMax; ++$i)\r\n\t\t{\r\n\t\t\tif ($arrAstral[$i][1] + $arrAstral[$i][2] >= 20000)\r\n\t\t\t{\r\n\t\t\t\t$arrName = $db -> GetRow('SELECT `name` FROM `tribes` WHERE `id`='.$arrAstral[$i][0]);\r\n\t\t\t\t$time = date(\"y-m-d H:i:s\");\r\n\t\t\t\tforeach ($arrLanguage as $strLanguage) // Prepare the news.\r\n\t\t\t\t{\r\n\t\t\t\t\trequire_once('languages/'.$strLanguage.'/resets.php');\r\n\t\t\t\t\t$strDate = $db -> DBDate($time);\r\n\t\t\t\t\t$db -> Execute('INSERT INTO `updates` (`starter`, `title`, `updates`, `lang`, `time`) VALUES(\\'(Herold)\\',\\''.U_TITLE.'\\',\\''.U_TEXT.$gamename.U_TEXT2.$gamename.U_TEXT3.$time.U_TEXT4.$arrName[0].U_TEXT5.'\\',\\''.$strLanguage.'\\', '.$strDate.')');\r\n\t\t\t\t}\r\n\t\t\t\t$db -> Execute('UPDATE `settings` SET `value`='.$arrAstral[$i][0].' WHERE `setting`=\\'tribe\\'');\r\n\r\n\t\t\t\t$arrComponents = array('C', 'O', 'T'); // Delete components used to build AM.\r\n\t\t\t\t$arrAmount = array(array(8, 8, 6, 6, 4, 4, 2),\r\n\t\t\t\t\t\t\t\t array(10, 8, 6, 4, 2),\r\n\t\t\t\t\t\t\t\t array(10, 8, 6, 4, 2));\r\n\t\t\t\tfor ($j = 0, $k=0; $j < 3; ++$j, $k=0)\r\n\t\t\t\t\tforeach ($arrAmount[$i] as $intAmount)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$strName = $arrComponents[$j].$k;\r\n\t\t\t\t\t\t$arrAmount = $db -> GetRow('SELECT `amount` FROM `astral` WHERE `owner`='.$arrAstral[$i][0].' AND `type`=\\''.$strName.'\\' AND `number`=0 AND `location`=\\'C\\'');\r\n\t\t\t\t\t\tif ($arrAmount[0] == $intAmount)\r\n\t\t\t\t\t\t\t$db -> Execute('DELETE FROM `astral` WHERE `owner`='.$arrAstral[$i][0].' AND `type`=\\''.$strName.'\\' AND `number`=0 AND `location`=\\'C\\'');\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$db -> Execute('UPDATE `astral` SET `amount`=`amount`-'.$intAmount.' WHERE `owner`='.$arrAstral[$i][0].' AND `type`=\\''.$strName.'\\' AND `number`=0 AND `location`=\\'C\\'');\r\n\t\t\t\t\t\t$k++;\r\n\t\t\t\t\t}\r\n\t\t\t\t$blnBreak = true;\r\n\t\t\t}\r\n\t\t\t$db -> Execute('UPDATE `astral_machine` SET `used`='.$arrAstral[$i][1] + $arrAstral[$i][2].', `directed`=0 WHERE `owner`='.$arrAstral[$i][0]);\r\n\t\t\tif ($blnBreak)\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tunset($arrTest, $arrAstral);\r\n\tstop();\r\n\t// Clear selected caches.\r\n\trequire_once 'libs/Smarty.class.php';\r\n\t$smarty = new Smarty;\r\n\t$smarty -> template_dir = './templates/';\r\n\t$smarty -> compile_dir = './templates_c/';\r\n\t$smarty -> cache_dir = './cache/';\r\n\t$smarty -> clear_cache('warehouse.tpl', 'Altara');\r\n\t$smarty -> clear_cache('warehouse.tpl', 'Ardulith');\r\n\tfor ($i=0; $i < 26; ++$i)\r\n\t\t$smarty -> clear_cache('warehouse.tpl', 'h|'.$i);\r\n\r\n\t//cores\r\n\t$db -> Execute('UPDATE `coresplayers` SET `age` = `age` + 1');\r\n\t$db -> Execute('UPDATE `coresplayers` SET `rest` = `rest` - 1 WHERE `rest` > 0');\r\n\r\n}", "function getRawMatCost ($totalSheets, $price, $clickCost) {\n\t$rawCost = (($totalSheets * $price) + $clickCost);\n\treturn $rawCost;\n}", "public function passes();", "function getWinProb($n){\n return 1 / (1 + pow(10,((-1*$n)/400)));\n}", "function getScoreCost (&$labor, $quantity) {\n\tif ($_POST[\"score\"] == \"score\") {\n\t\t$scoreLabor = (HOUR * .16);\n\t\t$scoreLabor += (($quantity * .000833) * HOUR);\n\t}\nelse {\n\t$scoreLabor = 0;\n\t}\n$labor += $scoreLabor;\n}", "function totp($secret, $timecounter = null);", "function calculateActualCost($product_price,$product_cost,$netamount,$othercost,$quantity)\n\t{\n\t\t//product_price = original purchase price\n\t\t//othercost = duty fee + shipping cost + other charges\n\n\t\t$actual_cost = 0;\n\t\t$price_percentage = 0;\n\t\t$other_charges_bypercentage = 0;\n\t\t$product_cost = floatval(str_replace(\",\",\"\",$product_cost));\n\t\t$netamount = floatval(str_replace(\",\",\"\",$netamount));\n\t\t$othercost = floatval(str_replace(\",\",\"\",$othercost));\n\t\t$product_price = floatval(str_replace(\",\",\"\",$product_price));\n\t\t$actual_cost += $product_price; //original purchase price \n\t\tif($netamount!=0 && $netamount!=''){\n\t\t\t$price_percentage = (((100/$netamount)*$product_cost)/100);\n\t\t}\n\t\t//calculation on other charges\n\t\tif($quantity && $quantity!=0){\n\t\t\t$other_charges_bypercentage = ($othercost/$quantity) * $price_percentage ;\n\t\t}\n\t\t$actual_cost += $other_charges_bypercentage;\n\t\treturn $actual_cost;\n\t}", "function isExpensive() {\n\t\treturn true;\n\t}", "abstract function is_premium();", "function getFoldCost ($quantity, &$labor) {\n\tif ($_POST[\"fold\"] == \"fold\"){\n\t\t$foldLabor = HOUR * FOLDSETUP;\n\t\t$foldLabor += (($quantity * FOLDTIME) * HOUR);\n\t}\nelse {\n\t$foldLabor = 0;\n\t}\n$labor += $foldLabor;\n}", "protected function computeAllowed() {\n\t\tif($this->tees) {\n\t\t\t$this->exact_handicap = $this->player->handicap;\n\t\t\t$a = $this->player->allowed($this->tees);\n\t\t\t$this->handicap = array_sum($a); // playing handicap\n\t\t\t$this->save();\n\t\t\tif($this->hasDetails()) {\t\t\t\t\n\t\t\t\t$i = 0;\n\t\t\t\tforeach($this->getScoreWithHoles()->each() as $score) {\n\t\t\t\t\t$score->allowed = $a[$i++];\n\t\t\t\t\t$score->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t}", "function touchdowns() {\n\t\t$touchdowns_calc = $this->_touchdowns/$this->_attempts;\n\t\t// Other NFL QBR specific manipulations\n\t\tif ($touchdowns_calc * 20 < 0) {\n\t\t\t$touchdowns_calc = 20;\n\t\t} elseif ($touchdowns_calc * 20 > 2.375) {\n\t\t\t$touchdowns_calc = 2.375;\n\t\t} else {\n\t\t\t$touchdowns_calc *= 20;\n\t\t}\n\t\treturn $touchdowns_calc;\n\t}", "public function getTotalSupply()\n {\n //XXX mutable supply\n return 290888;\n }", "private function compute($base){\n\t\t$amount = \n\t\t $this->getSkillPercent($this->miningSkill) *\n\t\t $this->getSkillPercent($this->astroSkill) *\n\t\t $this->getSkillPercent($this->frigateSkill) *\n\t\t $this->getSkillPercent($this->upgradeLaser)\t\t\n\t\t;\n\t\treturn $base * $amount * $this->getVentureBonus();\n\t}", "function doAlgorythmStuff(array &$transporters, array &$hardware) {\n\n\n sortHardwareByEfficiency($hardware);\n\n\n //Fill the transporters with the most efficient hardware\n /** @var Transporter $transporter */\n foreach($transporters as $transporter) {\n\n /** @var Hardware $item */\n foreach($hardware as $item) {\n\n if($item->getRequirement() == 0) continue; //item is already completely loaded and not required anymore -> skip it\n if($item->getWeight() >= $transporter->getCurrentCapacity()) continue; //one item is already to heavy for the transporter -> skip it\n\n\n $maximumAmountByTransporter = (int)($transporter->getCurrentCapacity() / $item->getWeight());\n $maximumAmountByItemStock = $item->getRequirement();\n //get the maximum amount, limited by the resulting stock and the transporter capacity\n $totalMaximumAmount = min($maximumAmountByItemStock, $maximumAmountByTransporter);\n\n //add this amount from this hardware to the transporter\n $transporter->addHardware($item, $totalMaximumAmount);\n\n }\n\n }\n\n\n\n\n //check, if an inefficient, loaded item can be swapped with a slightly more inefficient, but more valuable item\n //repeat this, until there is no improvement done\n do {\n $changesMade = false;\n\n\n\n foreach($transporters as $transporter) {\n\n //the currently loaded cargo\n $cargo = $transporter->getCurrentCargoRaw();\n\n //gather the possible swaps in this array\n $possibleSwaps = [];\n\n\n /** @var Hardware $cargoItem */\n foreach($cargo as $cargoItem) {\n\n //the criteria for a rational swap:\n // 1) the capacity after the element is removed, has to be enough for the new item\n $capacityWhenRemoved = $transporter->getCurrentCapacity() + $cargoItem->getWeight();\n // 2) the value of the new item has to be bigger than the old item\n $itemValue = $cargoItem->getValue();\n\n\n //check the required hardware items by the given criteria\n /** @var Hardware $item */\n foreach($hardware as $item) {\n\n //check the criteria for this one hardware item\n if(\n $item->getValue() > $itemValue &&\n $item->getWeight() <= $capacityWhenRemoved &&\n $item->getRequirement() > 0\n ) {\n //this item would be good to swap, so add it to the array\n $possibleSwaps[$cargoItem->getName()] = [$item->getName(), $item->getValue() - $itemValue];\n\n\n }\n else {\n\n //start a second loop, to check for a combination from the two hardware items\n /** @var Hardware $itemSec */\n foreach ($hardware as $itemSec) {\n\n $value = $item->getValue() + $itemSec->getValue();\n $weight = $item->getWeight() + $itemSec->getWeight();\n\n //if both items are the same, then the requirement is \"at least two of them\", else \"at least one of each\"\n if($item->getName() == $itemSec->getName()) {\n $requirement = $itemSec->getRequirement();\n }\n else {\n $requirement = ($item->getRequirement() > 0) + ($itemSec->getRequirement() > 0);\n }\n\n\n\n //check the criteria for this two hardware items\n if(\n $value > $itemValue &&\n $weight <= $capacityWhenRemoved &&\n $requirement >= 2\n ) {\n //this items would be good to swap, so add them to the array\n $possibleSwaps[$cargoItem->getName()] = [\n [$item->getName(), $itemSec->getName()],\n $value - $itemValue];\n }\n }\n\n }\n\n\n }\n\n }\n\n\n\n if(count($possibleSwaps) >= 1) {\n\n //sort the possible swaps by the most profitable (best swap = first element in the array)\n uasort($possibleSwaps, function($a, $b) {\n return $b[1] - $a[1];\n });\n\n\n\n //this foreach loop is just used to get the associated index, so break from it after the first element\n foreach($possibleSwaps as $cargoItemName => $swap) {\n //swap the items\n $transporter->removeHardware($hardware[$cargoItemName], 1);\n\n if(is_array($swap[0])) {\n $transporter->addHardware($hardware[$swap[0][0]], 1);\n $transporter->addHardware($hardware[$swap[0][1]], 1);\n }\n else {\n $transporter->addHardware($hardware[$swap[0]], 1);\n }\n\n\n\n break;\n }\n\n $changesMade = true;\n\n }\n\n }\n\n }\n while($changesMade);\n\n}", "function getGameProgression()\n { \n // Start or end of game\n $current_state = $this->gamestate->state();\n switch($current_state['name']) {\n case 'gameSetup':\n case 'turn0':\n return 0;\n case 'whoBegins':\n return 1;\n case 'justBeforeGameEnd':\n case 'gameEnd':\n return 100;\n }\n // For other states (all included in player action)\n $players = self::loadPlayersBasicInfos();\n \n // The total progression is a mix of:\n // -the progression of the decreasing number of cards in deck (end of game by score)\n // -the progression of each player in terms of the achievements they get\n \n // Progression in cards\n // Hypothesis: a card of age 9 is drawn three times quicker than a card of age 1. Cards of age 10 are worth six times a card of age 1 because if there are none left it is the end of the game\n $weight = 0;\n $total_weight = 0;\n \n $number_of_cards_in_decks = self::countCardsInLocation(0, 'deck', true);\n for($age=1; $age<=10; $age++) {\n $n = $number_of_cards_in_decks[$age];\n switch($age) {\n case 1:\n $n_max = 14 - 2 * count($players); // number of cards in the deck at the beginning: 14 (15 minus one taken for achievement) minus the cards dealt to the players at the beginning\n $w = 1; // weight for cards of age 1: 1\n break;\n case 10:\n $n++; // one more \"virtual\" card because the game is not over where the tenth age 10 card is drawn (but quite...)\n $n_max = 11; // number of cards in the deck at the beginning: 10, +1 one more \"virtual\" card because the game is not over when the last is drawn\n $w = 6; // weight for cards of age 10: 6\n break;\n default:\n $n_max = 9; // number of cards in the deck at the beginning: 9 (10 minus one taken for achievement)\n $w = ($age-1) / 4 + 1; // weight between 1.25 (for age 2) and 3 (for age 9)\n break;\n };\n $weight += ($n_max - $n) * $w; // What is really important are the cards already drawn\n $total_weight += $n_max * $w;\n }\n $progression_in_cards = $weight/$total_weight;\n \n // Progression of players\n // This is the ratio between the number of achievements the player have got so far and the number of achievements needed to win the game\n $progression_of_players = array();\n $n_max = self::getGameStateValue('number_of_achievements_needed_to_win');\n foreach($players as $player_id=>$player) {\n $n = self::getPlayerNumberOfAchievements($player_id);\n $progression_of_players[] = $n/$n_max;\n }\n \n // If any of the above progression was 100%, the game would be over. So, 100% is a kind of \"absorbing\" element. So,the method is to multiply the complements of the progression.\n // A complement is defined as 100% - progression\n $complement = 1 - $progression_in_cards;\n foreach($progression_of_players as $progression) {\n $complement *= 1 - $progression;\n }\n $final_progression = 1 - $complement;\n \n // Convert the final result in percentage\n $percentage = intval(100 * $final_progression);\n $percentage = min(max(1, $percentage), 99); // Set that progression between 1% and 99%\n return $percentage;\n }", "private function Benchmark()\r\n\t{\t\t\r\n\t}", "public function totalCost(): float;", "function reduce_min_strength_password_requirement( $strength ) {\n return 2; \n}", "public function profit() : void {\n\t\techo ($this->price - $this->cost);\n\t}", "public function getCostFactor() : int\n {\n return $this->cost;\n }", "function exp_required_for_ranking($rank)\n{\n // exp constant (ranks 1-130)\n $exp_req = [\n 0,\n 1,\n 38,\n 47,\n 59,\n 73,\n 92,\n 114,\n 143,\n 179,\n 224,\n 279,\n 349,\n 437,\n 546,\n 682,\n 853,\n 1066,\n 1332,\n 1665,\n 2082,\n 2602,\n 3253,\n 4066,\n 5082,\n 6353,\n 7941,\n 9926,\n 12408,\n 15510,\n 19387,\n 24234,\n 30292,\n 37865,\n 47332,\n 59165,\n 73956,\n 92445,\n 115556,\n 144445,\n 180556,\n 225695,\n 282119,\n 352648,\n 440810,\n 551013,\n 688766,\n 860958,\n 1076197,\n 1345247,\n 1681558,\n 2101948,\n 2627435,\n 3284293,\n 4105367,\n 5131708,\n 6414635,\n 8018294,\n 10022868,\n 12528585,\n 15660731,\n 19575913,\n 24469892,\n 30587365,\n 38234206,\n 47792757,\n 59740947,\n 74676183,\n 93345229,\n 116681536,\n 145851921,\n 182314901,\n 227893626,\n 284867032,\n 356083790,\n 445104738,\n 556380923,\n 695476153,\n 869345192,\n 1086681489,\n 1358351862,\n 1697939827,\n 2122424784,\n 2653030980,\n 3316288725,\n 4145360906,\n 5181701133,\n 6477126416,\n 8096408020,\n 10120510026,\n 12650637532,\n 15813296915,\n 19766621144,\n 24708276429,\n 30885345537,\n 38606681921,\n 48258352401,\n 60322940502,\n 75403675627,\n 94254594534,\n 117818243167,\n 147272803959,\n 184091004949,\n 230113756186,\n 287642195232,\n 359552744040,\n 449440930050,\n 561801162563,\n 702251453204,\n 877814316505,\n 1097267895631,\n 1371584869539,\n 1714481086923,\n 2143101358654,\n 2678876698318,\n 3348595872897,\n 4185744841122,\n 5232181051402,\n 6540226314253,\n 8175282892816,\n 10219103616020,\n 12773879520025,\n 15967349400031,\n 19959186750038,\n 24948983437548,\n 31186229296935,\n 38982786621168,\n 48728483276461,\n 60910604095576,\n 76138255119470,\n 95172818899337\n ];\n\n if (!is_numeric($rank) || $rank < 0 || $rank >= count($exp_req)) {\n $rank = count($exp_req) - 1;\n }\n\n return $exp_req[$rank];\n}", "function getPromo()\n {\n return 3.50;\n }", "abstract function is_only_premium();", "function GetSpeedIncreaseLumber(&$wg_buildings){\n\tglobal $db;\n\t$sum=0;$i=0;\n\tif($wg_buildings)\n\t{\n\t\tforeach ($wg_buildings as $ptu)\n\t\t{\n\t\t\tif($ptu->index<19)\n\t\t\t{\n\t\t\t\tif($ptu->type_id==1)\n\t\t\t\t{\n\t\t\t\t\t$sum=$sum+$ptu->product_hour;\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\tif($i==19){break;}\n\t\t}\n\t\treturn $sum;\n\t}\n\telse\n\t{\n\t\theader(\"Location:logout.php\");\n\t\texit();\n\t}\n}", "public function highspeed()\n\t{\n\t\t//Old Dad uppt In ihrem Haus DVD Ripp AC3 German Xvid [01/31] - \"In ihrem Haus.par2\" yEnc\n\t\t//Old Dad uppt Eine offene Rechnung XviD German DVd Rip[02/41] - \"Eine offene Rechnung.part01.rar\" yEnc\n\t\t//Old Dad uppMiss Marple: Der Wachsblumenstrauß , Wunschpost Xvid German10/29] - \"Miss Marple Der Wachsblumenstrauß.part09.rar\" yEnc\n\t\tif (preg_match('/^Old\\s+Dad\\s+uppt? ?(.+?)( mp4| )?\\[?\\d+\\/\\d+\\] - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//[03/61] - \"www.realmom.info - xvid - xf-fatalmovecd1.r00\" - 773,34 MB - yEnc\n\t\t//[40/54] - \"Mankind.Die.Geschichte.der.Menschheit.S01E12.Das.Ende.der.Reise.GERMAN.DUBBED.DL.DOKU.1080p.BluRay.x264-TVP.part39.rar\" - 4,79 GB yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' - \\d+[,.]\\d+ [mMkKgG][bB]( -)? yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[02/10] - \"Fast.And.Furious.6 (2013).German.720p.CAM.MD-MW upp.by soV1-soko.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\] - \"(.+?) upp.by.+?' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //>ghost-of-usenet.org>The A-Team S01-S05(Folgen einzelnd ladbar)<Sponsored by Astinews< (1930/3217) \"isd-ateamxvid-s04e21.r19\" yEnc\n\t\tif (preg_match('/^>ghost-of-usenet\\.org>(.+?)\\(.+?\\).+? \\(\\d+\\/\\d+\\) \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //www.usenet-town.com [Sponsored by Astinews] (103/103) \"Intimate.Enemies.German.2007.AC3.[passwort protect].vol60+21.PAR2\" yEnc\n\t\tif (preg_match('/^www\\..+? \\[Sponsored.+?\\] \\(\\d+\\/\\d+\\) \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Das.Schwergewicht.German.DL.720p.BluRay.x264-ETM - \"etm-schwergewicht-720p.part20.rar\" yEnc\n\t\tif (preg_match('/^([A-Za-z0-9][a-zA-Z0-9.-]{6,})\\s+- \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[ TiMnZb ] [ www.binnfo.in ] [REPOST] [01/46] - \"Columbo - S07 E05 - Des sourires et des armes.nfo\" yEnc\n\t\tif (preg_match('/^\\[ .+? \\] \\[ www\\..+? \\]( \\[.+?\\])? \\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //< \"Burn.Notice.S04E17.Out.of.the.Fire.GERMAN.DUBBED.DL.720p.WebHD.x264-TVP.par2\" >< 01/17 (1.54 GB) >< 11.62 kB > yEnc\n\t\tif (preg_match('/^< \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' >< \\d+\\/\\d+ \\(.+?\\) >< .+? > yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Batman postet 30 Nights of Paranormal Activity with the Devil Inside AC3 XviD German [01/24] - \"30 Nights of Paranormal Activity with the Devil Inside.par2\" yEnc\n\t\tif (preg_match('/^[A-Za-z0-9]+ postet (.+?) \\[\\d+\\/\\d+\\] - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[04/20 Geroellheimer - S03E19 - Freudige ?berraschung Geroellheimer - S03E19 - Freudige ?berraschung.mp4.004\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+ (.+?)(\\.(part\\d*|rar|avi|iso|mp4|mkv|mpg))?(\\d{1,3}\\.rev\"|\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\"|\") yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn implode(' ',\n\t\t\t\t\t\t array_intersect_key(explode(' ', $match[1]),\n\t\t\t\t\t\t\t\t\t\t\t array_unique(array_map('strtolower',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t explode(' ', $match[1])))));\n\t\t} //\"Homeland.S01.Complete.German.WS.DVDRiP.XViD-ETM.part001.rar\" yEnc\n\t\tif (preg_match('/^\"(.+?)(\\.(part\\d*|rar|avi|mp4|mkv|mpg))?(\\d{1,3}\\.rev\"|\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\"|\") yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\tif (strlen($match[1]) > 7 && !preg_match('/\\.vol.+/', $match[1])) {\n\t\t\t\treturn $match[1];\n\t\t\t} else {\n\t\t\t\treturn array(\n\t\t\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject),\n\t\t\t\t\t\"properlynamed\" => false\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "function policy_totally_frozen($dreamid) {\n #return in_array($dreamid, array(1049, 1053, 1050, 363, 826, 1051, 1052, 856, 811, 975, 996, 984, 1030,\n # 837, 1071, 1074, 1077, 1079, 1080));\n return false;\n}", "public function getSparePower() {\r\n return $this->getMaxPower() - $this->getUsedPower();\r\n }", "function compute_money_total($available, $frozen, $investment, $loaned, $interest, $owned, $fine)\n{\n return ($available + $frozen + $investment - ($loaned + $interest + $owned + $fine));\n}", "function show_memory_points()\n{\n\t@header('Content-type: text/plain; charset='.get_charset());\n\n\t@ini_set('ocproducts.xss_detect','0');\n\n\t$GLOBALS['SCREEN_TEMPLATE_CALLED']='';\n\n\tglobal $MEMORY_POINTS;\n\t$before=mixed();\n\tforeach ($MEMORY_POINTS as $point)\n\t{\n\t\tlist($memory,$name)=$point;\n\t\techo 'Memory at '.$name.' is'.\"\\t\".integer_format($memory).' (growth of '.(is_null($before)?'N/A':integer_format($memory-$before)).')'.\"\\n\";\n\t\t$before=$memory;\n\t}\n\texit();\n}", "function checkEntropy($data)\r\n {\r\n $score = 0;\r\n\r\n $len = strlen($data);\r\n\r\n if ($len > 0) {\r\n\r\n // remove spaces\r\n $data = str_replace(\" \", \"\", $data);\r\n\r\n\r\n // Compression test\r\n $compression = ((double)strlen(gzcompress($data)) - 9) / $len;\r\n if ($compression >= .80) {\r\n $score += .25;\r\n }\r\n if ($compression >= .85) {\r\n $score += .75;\r\n }\r\n if ($compression >= .90) {\r\n $score += .5;\r\n }\r\n if ($compression >= .95) {\r\n $score += .5;\r\n }\r\n if ($compression <= .50) {\r\n $score -= 1;\r\n }\r\n\r\n\r\n // Number of character sets\r\n $lower = preg_match_all('/[a-z]/', $data, $matches);\r\n $upper = preg_match_all('/[A-Z]/', $data, $matches);\r\n $num = preg_match_all('/[0-9]/', $data, $matches);\r\n $special = preg_match_all('/[^a-zA-Z0-9]/', $data, $matches);\r\n $charsets = ($lower >= 1) + ($upper >= 1) + ($num >= 1) + ($special >= 1);\r\n $score += ($charsets / 6);\r\n\r\n\r\n // Sequences from same charset\r\n $lower_seq = preg_match_all('/[a-z]{3}/', $data, $matches);\r\n $upper_seq = preg_match_all('/[A-Z]{3}/', $data, $matches);\r\n $num_seq = preg_match_all('/[0-9]{3}/', $data, $matches);\r\n $special_seq = preg_match_all('/[^a-zA-Z0-9]{3}/', $data, $matches);\r\n $total_seq = $lower_seq + $upper_seq + $num_seq + $special_seq;\r\n $score -= .25 * (int)$total_seq;\r\n if ($total_seq == 0) {\r\n $score += .25;\r\n }\r\n\r\n\r\n // Small bonus for uppercase in the middle of word\r\n $middleupper = preg_match_all('/[a-z0-9A-Z]{1,}[A-Z]/', $data, $matches);\r\n if ($middleupper) {\r\n $score .= .25;\r\n }\r\n\r\n\r\n // Four or more lowercase\r\n $lower_seq = preg_match_all('/[a-z]{4}/', $data, $matches);\r\n $score -= .25 * (int)$lower_seq;\r\n\r\n\r\n // But all numeric and hex and all uppercase sequences can still be random\r\n if (is_numeric($data)) {\r\n $score += .25 + (strlen($data) / 10);\r\n }\r\n if (preg_match('/^[abcdef01234567890]+$/i', $data, $matches)) {\r\n $score += 1;\r\n }\r\n if (preg_match('/^[A-Z]+$/i', $data, $matches)) {\r\n $score += .25;\r\n }\r\n\r\n\r\n // Single repeated characters\r\n $repeated = preg_match_all('/(.)\\1/', $data, $matches);\r\n $score -= .5 * (int)$repeated;\r\n\r\n\r\n // Single character repeated 3 times penalty\r\n $repeated = preg_match_all('/(.)\\1\\1/', $data, $matches);\r\n if ($total_seq <> 0) {\r\n $score -= 1.5 * $repeated;\r\n }\r\n\r\n\r\n // Trigraphs and common digraphs in the English language\r\n $trigraphs = preg_match_all(\r\n '/the|and|tha|ent|ion|tio|for|nde|has|nce|tis|oft|men|wor|row|qwe|123|234|345|456|567|678|789|890|abc|def|rty|asd|zxc|jkl|uio|321/',\r\n $data,\r\n $matches\r\n );\r\n $score -= ($trigraphs * 1.25);\r\n\r\n $digraphs = preg_match_all(\r\n '/th|he|an|in|er|on|re|ed|nd|ha|at|en|es|of|nt|ea|ti|to|io|le|is|ou|ar|as|ss|ee|tt|ff|ll|mm|oo|ng|99|00/',\r\n $data,\r\n $matches\r\n );\r\n $score -= ($digraphs * .25);\r\n\r\n\r\n if ($trigraphs + $digraphs + $repeated == 0) {\r\n $score += .5;\r\n }\r\n\r\n // Consonant, vowel, consonant\r\n $cvc = preg_match_all('/[bcdfghjklmnpqrstvwxy][aeiouy][bcdfghjklmnpqrstvwxy]/', $data, $matches);\r\n $score -= .25 * (int)$cvc;\r\n\r\n // consecutive character sets\r\n //preg_match_all('/(?:[a-z]){4,}(?:[0-9]){4,}|((?:[0-9]){4,}(?:[a-z]){4,})/', $data, $matches);\r\n //$score -= 1.5;\r\n\r\n\r\n // Vowels vs consonants\r\n $v = preg_match_all('/[aeiouy]/i', $data, $matches);\r\n $c = preg_match_all('/[bcdfghjklmnpqrstvwxy]/i', $data, $matches);\r\n if ($c == 0) {\r\n $vc_ratio = 1;\r\n } else {\r\n $vc_ratio = $v / $c;\r\n }\r\n if ((double)$vc_ratio < .5) {\r\n $score += .75;\r\n }\r\n\r\n\r\n if ($score >= 1.9) {\r\n $score = 1.9;\r\n }\r\n if ($score < 0) {\r\n $score = 0;\r\n }\r\n\r\n $score = round($score / 1.9, 2);\r\n\r\n return $score;\r\n }\r\n\r\n return true;\r\n }", "public function testProfilePrototypeCountQuarantines()\n {\n\n }", "function capability_prohibits($capability, $context, $sum='', $array='') {\n global $USER;\n\n // caching, mainly to save unnecessary sqls\n static $prohibits; //[capability][contextid]\n if (isset($prohibits[$capability][$context->id])) {\n return $prohibits[$capability][$context->id];\n }\n \n if (empty($context->id)) {\n $prohibits[$capability][$context->id] = false;\n return false;\n }\n\n if (empty($capability)) {\n $prohibits[$capability][$context->id] = false;\n return false;\n }\n\n if ($sum < (CAP_PROHIBIT/2)) {\n // If this capability is set to prohibit.\n $prohibits[$capability][$context->id] = true;\n return true;\n }\n\n if (!empty($array)) {\n if (isset($array[$context->id][$capability])\n && $array[$context->id][$capability] < (CAP_PROHIBIT/2)) {\n $prohibits[$capability][$context->id] = true;\n return true;\n }\n } else {\n // Else if set in session.\n if (isset($USER->capabilities[$context->id][$capability])\n && $USER->capabilities[$context->id][$capability] < (CAP_PROHIBIT/2)) {\n $prohibits[$capability][$context->id] = true;\n return true;\n }\n }\n switch ($context->contextlevel) {\n\n case CONTEXT_SYSTEM:\n // By now it's a definite an inherit.\n return 0;\n break;\n\n case CONTEXT_PERSONAL:\n $parent = get_context_instance(CONTEXT_SYSTEM);\n $prohibits[$capability][$context->id] = capability_prohibits($capability, $parent);\n return $prohibits[$capability][$context->id];\n break;\n\n case CONTEXT_USER:\n $parent = get_context_instance(CONTEXT_SYSTEM);\n $prohibits[$capability][$context->id] = capability_prohibits($capability, $parent);\n return $prohibits[$capability][$context->id];\n break;\n\n case CONTEXT_COURSECAT:\n case CONTEXT_COURSE:\n $parents = get_parent_cats($context); // cached internally\n // no workaround for recursion now - it needs some more work and maybe fixing\n\n if (empty($parents)) {\n // system context - this is either top category or frontpage course\n $parent = get_context_instance(CONTEXT_SYSTEM);\n } else {\n // parent context - recursion\n $parentid = array_pop($parents);\n $parent = get_context_instance_by_id($parentid);\n }\n $prohibits[$capability][$context->id] = capability_prohibits($capability, $parent);\n return $prohibits[$capability][$context->id];\n break;\n\n case CONTEXT_GROUP:\n // 1 to 1 to course.\n if (!$courseid = groups_get_course($context->instanceid)) {\n $prohibits[$capability][$context->id] = false;\n return false;\n }\n $parent = get_context_instance(CONTEXT_COURSE, $courseid);\n $prohibits[$capability][$context->id] = capability_prohibits($capability, $parent);\n return $prohibits[$capability][$context->id];\n break;\n\n case CONTEXT_MODULE:\n // 1 to 1 to course.\n if (!$cm = get_record('course_modules','id',$context->instanceid)) {\n $prohibits[$capability][$context->id] = false;\n return false;\n }\n $parent = get_context_instance(CONTEXT_COURSE, $cm->course);\n $prohibits[$capability][$context->id] = capability_prohibits($capability, $parent);\n return $prohibits[$capability][$context->id];\n break;\n\n case CONTEXT_BLOCK:\n // 1 to 1 to course.\n if (!$block = get_record('block_instance','id',$context->instanceid)) {\n $prohibits[$capability][$context->id] = false;\n return false;\n }\n if ($block->pagetype == 'course-view') {\n $parent = get_context_instance(CONTEXT_COURSE, $block->pageid); // needs check\n } else {\n $parent = get_context_instance(CONTEXT_SYSTEM); \n } \n $prohibits[$capability][$context->id] = capability_prohibits($capability, $parent);\n return $prohibits[$capability][$context->id];\n break;\n\n default:\n print_error('unknowncontext');\n return false;\n }\n}", "public function toPot();", "protected function giveCost()\n\t{\n\t\t$solarSaving = 2;\n\t\t$this->valueNow = 210.54 / $solarSaving;\n\t\treturn $this->valueNow;\n\t}", "function getExtensionCost($game_id, $company_id, $round_number){\t\t\t\r\n\t\t\t$capacity=new Model_DbTable_Decisions_Pr_Capacity();\r\n\t\t\t$production=new Model_DbTable_Decisions_Production();\r\n\t\t\t$factories=$production->getFactories($game_id, $company_id, $round_number);\r\n\t\t\t$factory_number=1;\r\n\t\t\tif($factories!=null){\r\n\t\t\t\tforeach ($factories as $counterfactories){\r\n\t\t\t\t\t$region[$factory_number]=$factories['factory_number_'.$factory_number];\r\n\t\t\t\t\t$factory_number++;\r\n\t\t\t\t}\r\n\t\t\t\t$factory_number_aux=1;\r\n\t\t\t\tif($factory_number_aux<=$factory_number)\r\n\t\t\t\tforeach ($factories as $factory){\r\n\t\t\t\t\t$extension_factory=$capacity->getExtensionWasCreated($game_id, $company_id, $factory_number_aux);\r\n\t\t\t\t\tfor ($round = 1; $round <= $round_number; $round++) {\r\n\t\t\t\t\t\t$round_created[$round]=$extension_factory['factory_number_'.$factory_number_aux]['round_number_created_'.$round];\r\n\t\t\t\t\t\tfor ($round_aux = 1; $round_aux <= $round; $round_aux++) {\r\n\t\t\t\t\t\t\tif($round>=$round_created[$round_aux]){\r\n\t\t\t\t\t\t\t\t$extension[$round]=$extension_factory['factory_number_'.$factory_number_aux]['capacity_'.$round_aux];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t$extension[$round_aux]=0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$cost_aux=$this->getProductionCost($game_id, $round_number, $region[$factory_number_aux], 'fixed');\r\n\t\t\t\t\t\t\t$machines=$this->getOrganizationParam($game_id, 'machines');\r\n\t\t\t\t\t\t\t$cost['factory_number_'.$factory_number_aux][$round]=($extension[$round]*($cost_aux/$machines))*0.7;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$factory_number_aux++;\r\n\t\t\t\t}\r\n\t\t\t\tforeach ($factories as $factory) {\r\n\t\t\t\t\t//$result+=$cost['factory_number_'.$factory['factory_number']][$round_number];\r\n\t\t\t\t\t$result+=$cost['factory_number_'.$factory][$round_number];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$result=0;\r\n\t\t\t}\r\n\t\t\treturn $result;\t\t\t\r\n\t\t}", "function calculateBuyPriceOfAssetUnitFromOutboundTransactionUsingSpotPriceAndTransactedAmountAndFeePercentageExtendedCalculation($spotPrice, $transactedAmount, $feePercentage)\n\t{\t\n\t\t\n\t\t$calculatedBuyPriceOfAssetUnit\t\t= 0;\n\t\t\n\t\tif ($feePercentage >= 1)\n\t\t{\n\t\t\t$feePercentage \t\t\t\t\t= $feePercentage / 100;\n\t\t}\n\t\t\n\t\tif ($transactedAmount > 0)\n\t\t{\n\t\t\t$calculatedBuyPriceOfAssetUnit\t= (($spotPrice * $transactedAmount) + ($spotPrice * $transactedAmount * $feePercentage)) / $transactedAmount;\n\t\t}\n\n\t\treturn $calculatedBuyPriceOfAssetUnit;\t\n\t}", "function spectra_money_top1000 ()\n\t{\n\t\tif (system_flag_get (\"balance_rebuild\") > 0)\n\t\t{\n\t\t\t$balance_calc[\"total\"] = \"Re-Balancing\";\n\t\t\t$balance_calc[\"percent\"] = \"0.00\";\n\t\t\n\t\t\treturn $balance_calc;\n\t\t}\n\t\t\n\t\t$accounts = mysqli_getset ($GLOBALS[\"tables\"][\"ledger\"], \"1 ORDER BY `balance` DESC LIMIT 1000 OFFSET 100\");\n\n\t\tif ($accounts[\"success\"] < 1 || $accounts[\"data\"] == \"\")\n\t\t{\n\t\t\t$balance_calc[\"total\"] = \"Unavailable\";\n\t\t\t$balance_calc[\"percent\"] = \"0.00\";\n\t\t\n\t\t\treturn $balance_calc;\n\t\t}\n\t\t\n\t//\tInitialize Calculation Result\n\t\t$sum_balances = 0;\n\t\t\n\t\tforeach ($accounts[\"data\"] as $account)\n\t\t{\n\t\t\t$sum_balances = bcadd ($sum_balances, $account[\"balance\"], 8);\n\t\t}\n\t\t\n\t\t$calc_perc = bcdiv ($sum_balances, spectra_money_supply (), 8);\n\t\n\t\t$balance_calc[\"total\"] = $sum_balances;\n\t\t$balance_calc[\"percent\"] = ($calc_perc * 100);\n\t\t\n\t\treturn $balance_calc;\n\t}", "function warp1($c)\n{\n if($c > 10.3148)\n {\n return pow((561 + 40*$c)/10761, 2.4);\n }\n else\n {\n return $c / 3294.6;\n }\n}", "function spectra_money_top100 ()\n\t{\n\t\tif (system_flag_get (\"balance_rebuild\") > 0)\n\t\t{\n\t\t\t$balance_calc[\"total\"] = \"Re-Balancing\";\n\t\t\t$balance_calc[\"percent\"] = \"0.00\";\n\t\t\n\t\t\treturn $balance_calc;\n\t\t}\n\t\t\n\t\t$accounts = mysqli_getset ($GLOBALS[\"tables\"][\"ledger\"], \"1 ORDER BY `balance` DESC LIMIT 90 OFFSET 10\");\n\n\t\tif ($accounts[\"success\"] < 1 || $accounts[\"data\"] == \"\")\n\t\t{\n\t\t\t$balance_calc[\"total\"] = \"Unavailable\";\n\t\t\t$balance_calc[\"percent\"] = \"0.00\";\n\t\t\n\t\t\treturn $balance_calc;\n\t\t}\n\t\t\n\t//\tInitialize Calculation Result\n\t\t$sum_balances = 0;\n\t\t\n\t\tforeach ($accounts[\"data\"] as $account)\n\t\t{\n\t\t\t$sum_balances = bcadd ($sum_balances, $account[\"balance\"], 8);\n\t\t}\n\t\t\n\t\t$calc_perc = bcdiv ($sum_balances, spectra_money_supply (), 8);\n\t\n\t\t$balance_calc[\"total\"] = $sum_balances;\n\t\t$balance_calc[\"percent\"] = ($calc_perc * 100);\n\t\t\n\t\treturn $balance_calc;\n\t}", "public function accelerate()\n {\n }", "function calc_value_potion ($level, $alch_perk, $phys_perk, $bene_perk, $pois_perk, $pure_perk) {\n\t\tdb_CRUD::select('ingredient_effect', 'eid, iid, magnitude_modifier, gold_modifier', \"iid in (select iid from effect where specials = 'y')\", 'eid');\n\t\t$nonStandard_data = db_CRUD::get_result();\n\t\t$cost_arr = array();\n\t\tforeach($this->temp_potion as $potion) {\n\t\t\t$cost_arr = array();\n\t\t\t//for each effect in potion: calculate price of effect\n\t\t\tforeach($potion->effect as $eff) {\n\t\t\t\t$select = \"eid, base_cost, base_magnitude, base_duration, poison, specials\";\n\t\t\t\t$where = \"eid = $eff\";\n\t\t\t\tdb_CRUD::select('effect', $select, $where);\n\t\t\t\t$result = db_CRUD::get_result();\n\t\t\t\t$mag_mod = 0;\n\t\t\t\t$gold_mod = 0;\n\t\t\t\t//if ingredient includes special variants: check if ingredient used is non-standard\n\t\t\t\tif($result[5] == 'y') {\n\t\t\t\t\tforeach($nonStandard_data as $nsd) {\n\t\t\t\t\t\tif($potion->ingredient1 == $nsd[1] && $eff == $nsd[0]) {\n\t\t\t\t\t\t\tif(($nsd[2] * $nsd[3]) > ($mag_mod * $gold_mod)) {\n\t\t\t\t\t\t\t\t$mag_mod = $nsd[2];\n\t\t\t\t\t\t\t\t$gold_mod = $nsd[3];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if($potion->ingredient2 == $nsd[1] && $eff == $nsd[0]) {\n\t\t\t\t\t\t\tif(($nsd[2] * $nsd[3]) > ($mag_mod * $gold_mod)) {\n\t\t\t\t\t\t\t\t$mag_mod = $nsd[2];\n\t\t\t\t\t\t\t\t$gold_mod = $nsd[3];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if($potion->ingredient_cnt == 3 && $potion->ingredient3 == $nsd[1] && $eff == $nsd[0]) {\n\t\t\t\t\t\t\tif(($nsd[2] * $nsd[3]) > ($mag_mod * $gold_mod)) {\n\t\t\t\t\t\t\t\t$mag_mod = $nsd[2];\n\t\t\t\t\t\t\t\t$gold_mod = $nsd[3];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$mag_mod = 1;\n\t\t\t\t\t$gold_mod = 1;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//specialized effect magnitude formulas\n\t\t\t\tif($eff != 30 && $eff != 34 && $eff != 50 && $eff != 49) {\n\t\t\t\t\t$mag = $result[2] * $mag_mod * 4 * pow(1.5, $level/100) * (1 + $alch_perk/100);\n\t\t\t\t\tif($eff == 46 || $eff == 47 || $eff || 48)\n\t\t\t\t\t\t$mag *= (1 + $phys_perk/100);\n\t\t\t\t\tif($result[5] == 'y')\n\t\t\t\t\t\t$mag *= (1 + $pois_perk/100);\n\t\t\t\t\telse\n\t\t\t\t\t\t$mag *= (1 + $bene_perk/100);\n\t\t\t\t\t$dur = $result[3];\n\t\t\t\t}\n\t\t\t\t//common effect duration formulas\n\t\t\t\telse {\n\t\t\t\t\t$dur = $result[3] * 4 * pow(1.5, $level/100) * (1 + $alch_perk/100);\n\t\t\t\t\tif($result[5] == 'y')\n\t\t\t\t\t\t$dur *= (1 + $pois_perk/100);\n\t\t\t\t\telse\n\t\t\t\t\t\t$mag *= (1 + $bene_perk/100);\n\t\t\t\t\t$mag = $result[2];\n\t\t\t\t}\n\t\t\t\tif($mag != 0 && $dur != 0) \n\t\t\t\t\t$eff_cost = floor($result[1] * $gold_mod * pow($mag, 1.1) * 0.0794328 * pow($dur, 1.1));\n\t\t\t\telse if($mag == 0)\n\t\t\t\t\t$eff_cost = floor($result[1] * $gold_mod * 0.0794328 * pow($dur, 1.1));\n\t\t\t\telse\n\t\t\t\t\t$eff_cost = floor($result[1] * pow($mag, 1.1));\n\t\t\t\t$cost_arr[] = array($eff_cost, $result[4]);\n\t\t\t} //end foreach $eff\n\t\t\t//if purity perk is active: find most valuable effect to decide potion/poison\n\t\t\tif($pure_perk == 'y') {\n\t\t\t\t$max = 0;\n\t\t\t\t$x = 0;\n\t\t\t\tforeach($cost_arr as $i => $cost) {\n\t\t\t\t\tif($cost[0] > $max) {\n\t\t\t\t\t\t$max = $cost[0];\n\t\t\t\t\t\t$x = $i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$potion->poison = $cost_arr[$x][1];\n\t\t\t\t$total = 0;\n\t\t\t\tforeach($cost_arr as $cost) {\n\t\t\t\t\tif($cost[1] == $cost_arr[$x][1]) {\n\t\t\t\t\t\t$total += $cost[0];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if no purity perk, sum all effect values\n\t\t\telse {\n\t\t\t\t$total = 0;\n\t\t\t\tforeach($cost_arr as $cost) {\n\t\t\t\t\t$total += $cost[0];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$potion->value = $total;\n\t\t} //end foreach $potion\n\t}", "public function testGetPremiumBvn()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function startPowerUnits() {\n\t\t\n\t}", "public function evaluateWealth() : float;", "function generateSpecialAbilityPool(){\r\n\t$this->Specs = $this->Player['spec'].\"\\n\".$this->MS['spec'].\"\\n\".$this->Eq['A']['spec'].\"\\n\".$this->Tactics['spec'];\r\n\tif ($this->Eq['D']['spec'])\t\t\t$this->Specs .= \"\\n\".$this->Eq['D']['spec'];\r\n\tif ($this->Eq['E']['spec'])\t\t\t$this->Specs .= \"\\n\".$this->Eq['E']['spec'];\r\n\tif ($this->Tactics['spec'] == 'AllWepStirke')\t$this->Specs .= \"\\n\".$this->Eq['B']['spec'].\"\\n\".$this->Eq['C']['spec'];\r\n\r\n}", "public function cost() {\n $cost = $this->beverage->cost();\n switch ($this->beverage->getSize()) {\n case 'tall':\n $cost += 1;\n break;\n case 'grande':\n $cost += 3;\n break;\n case 'venti':\n $cost += 6;\n break;\n }\n return $cost;\n }", "function Tn_eco_cra($level,$MBn) // CT dung\n{\n\treturn round((2000+350*($level-1)+pow(2*($level-1),3))*$MBn/2);\n}", "private function tryState()\n\t{\n\t\t$key = array_rand($this->weights);\n\n\t\t$this->workingOnSolution[$key] = !$this->workingOnSolution[$key]; // neighbour\n\t\tlist($better, $price) = $this->check();\n\t\tif ($better) {\n\t\t\t$this->maxPrice = $price;\n\t\t\t$this->solution = $this->workingOnSolution;\n\t\t\treturn;\n\t\t}\n\n\t\t// delta magic\n\t\t$delta = ($price - $this->maxPrice);\n\t\t$x = mt_rand() / mt_getrandmax();\n\t\tif (!($x < exp($delta / $this->temp))) {\n\t\t\t$this->workingOnSolution[$key] = !$this->workingOnSolution[$key];\n\t\t\t// return new\n\t\t}\n\t\t// else return state\n\t}", "protected function cost()\n {\n return $this->rounds;\n }", "function set_op_vars()\n{\n global $opname, $action, $basecost;\n\n $action[1] = \"recon\";\n $opname[1] = \"Recon\";\n $basecost[1] = 1;\n\n $action[2] = \"sneak\";\n $opname[2] = \"Sneak\";\n $basecost[2] = 1;\n\n $action[3] = \"intercept\";\n $opname[3] = \"Intercept\";\n $basecost[3] = 1;\n\n $action[4] = \"bribe\";\n $opname[4] = \"Bribe Accountant\";\n $basecost[4] = 1;\n\n $action[5] = \"truth\";\n $opname[5] = \"Truth's Eye\";\n $basecost[5] = 1;\n\n $action[6] = \"farm\";\n $opname[6] = \"Weather's Light\";\n $basecost[6] = 0;\n\n $action[7] = \"poison\";\n $opname[7] = \"Poison Water\";\n $basecost[7] = 14;\n\n $action[8] = \"money\";\n $opname[8] = \"Templu Amplo\";\n $basecost[8] = 0;\n\n $action[9] = \"arson\";\n $opname[9] = \"Arson\";\n $basecost[9] = 20;\n\n $action[10] = \"trap\";\n $opname[10] = \"Thieves Trap (SELF)\";\n $basecost[10] = 4;\n\n $action[11] = \"boze\";\n $opname[11] = \"Boze\";\n $basecost[11] = 20;\n\n $action[12] = \"monitoring\";\n $opname[12] = \"Monitoring\";\n $basecost[12] = 12;\n\n $action[13] = \"tunneling\";\n $opname[13] = \"Tunneling (WAR ONLY)\";\n $basecost[13] = 10;\n\n $action[14] = \"rebellion\";\n $opname[14] = \"Thieves Rebellion\";\n $basecost[14] = 10;\n\n $action[15] = \"raid\";\n $opname[15] = \"Hwighton Raid\";\n $basecost[15] = 20;\n\n $action[16] = \"research\";\n $opname[16] = \"Napanometry\";\n $basecost[16] = 0;\n \n $action[17] = \"ambush\";\n $opname[17] = \"Ambush\";\n $basecost[17] = 280;\n\n}", "abstract function can_use_premium_code();", "public function testPoolQ(): bool\n {\n $teamsQty = $this->scheduler->teamsQty;\n\n # G = (T*T) - T\n $exp = pow($teamsQty, 2) - $teamsQty;\n $act = count($this->scheduler->getGamesPool());\n if ($exp !== $act) {\n $this->failedValidations[] = sprintf(self::ERR_INVALID_GAMES_IN_POOL_QTY, $act, $exp);\n return false;\n }\n\n # M = T!\n $exp = 1;\n for ($f = 1; $f <= $teamsQty; $f++) {\n $exp = $exp * $f;\n }\n $act = count($this->scheduler->getMatchdaysPool());\n if ($exp !== $act) {\n $this->failedValidations[] = sprintf(self::ERR_INVALID_MATCHDAYS_IN_POOL_QTY, $act, $exp);\n return false;\n }\n\n # L = ?\n $exp = 0;\n switch ($teamsQty) {\n case 2:\n $exp = 2;\n break;\n case 4:\n $exp = 3072;\n break;\n case 6:\n// $exp = ;\n break;\n case 8:\n// $exp = ;\n break;\n }\n $act = count($this->scheduler->getLapsPool());\n if ($exp !== $act) {\n $this->failedValidations[] = sprintf(self::ERR_INVALID_LAPS_IN_POOL_QTY, $act, $exp);\n return false;\n }\n\n return true;\n }", "function hotp($secret, $counter);", "function apply_condition_bonus(){\r\n\t$Bonus_Rand = mt_rand(75,150) * 1000;\r\n\r\n\tif($this->Eq['A']['exp'] < 0){\r\n\t\t$i = (10000+$this->Eq['A']['exp'])/10000;\r\n\t\t$this->Eq['A']['atk'] = floor($this->Eq['A']['atk'] * $i);\r\n\t\t$i = 1 + abs($this->Eq['A']['exp'])/10000;\r\n\t}else\t$i = 1 - $this->Eq['A']['exp']/$Bonus_Rand;\r\n\t$this->Eq['A']['enc'] = floor($this->Eq['A']['enc'] * $i);\r\n\r\n\tif($this->Eq['D']['exp'] < 0)\t$i = ($this->Eq['D']['exp'])/-5000;\r\n\telse\t\t\t\t$i = 1 - $this->Eq['D']['exp']/$Bonus_Rand;\r\n\t$this->Eq['D']['enc'] = floor($this->Eq['D']['enc'] * $i);\r\n\r\n\tif($this->Eq['E']['exp'] < 0)\t$i = ($this->Eq['E']['exp'])/-5000;\r\n\telse\t\t\t\t$i = 1 - $this->Eq['E']['exp']/$Bonus_Rand;\r\n\t$this->Eq['E']['enc'] = floor($this->Eq['E']['enc'] * $i);\r\n\r\n}", "public function computePriceProvider(){\n\n /*Price once a child is < 4 years full day 0€*/\n yield [Booking::TYPE_DAY, '2019-01-01' , false, 0];\n /*Price once a child is < 4 years full day \"reduce\" 0€*/\n yield [Booking::TYPE_DAY, '2019-01-01', true, 0];\n /*Price once a child is < 4 years half day 0€*/\n yield [Booking::TYPE_HALF_DAY, '2019-01-01', false, 0];\n /*Price once a child is < 4 years half day \"reduce\" 0€*/\n yield [Booking::TYPE_HALF_DAY, '2019-01-01', true, 0];\n\n\n /*Price once a child is 4 - 12 years full day 8€*/\n yield [Booking::TYPE_DAY, '2014-01-01', false, 8];\n /*Price once a child is 4 - 12 years full day \"reduce\" 8€*/\n yield [Booking::TYPE_DAY, '2014-01-01', true, 8];\n /*Price once a child is 4 - 12 years half day 4€*/\n yield [Booking::TYPE_HALF_DAY, '2014-01-01', false, 4];\n /*Price once a child is 4 - 12 years half day \"reduce\" 4€*/\n yield [Booking::TYPE_HALF_DAY, '2014-01-01', true, 4];\n\n\n /*Price normal full day 16€*/\n yield [Booking::TYPE_DAY, '1980-01-01', false, 16];\n /*Price normal full day \"reduce\" 10€*/\n yield [Booking::TYPE_DAY, '1980-01-01', true, 10];\n /*Price normal half day 8€*/\n yield [Booking::TYPE_HALF_DAY, '1980-01-01', false, 8];\n /*Price normal half day \"reduce\" 5€*/\n yield [Booking::TYPE_HALF_DAY, '1980-01-01', true, 5];\n\n\n /*Price senior >60 years full day 12€*/\n yield [Booking::TYPE_DAY, '1955-01-01', false, 12];\n /*Price senior >60 years full day \"reduce\" 10€*/\n yield [Booking::TYPE_DAY, '1955-01-01', true, 10];\n /*Price senior >60 years half day 6€*/\n yield [Booking::TYPE_HALF_DAY, '1955-01-01', false, 6];\n /*Price senior >60 years half day \"reduce\" 5€*/\n yield [Booking::TYPE_HALF_DAY, '1955-01-01', true, 5];\n\n }", "private function countConsumedMoneyByKilowatt()\n {\n if( $this -> charging_powers === null )\n {\n return 0;\n }\n\n $chargingPricesSum = $this \n -> charging_powers\n -> reduce(function($carry, $chargingPower) {\n return $carry + $chargingPower -> getIntervalPrice();\n });\n\n return $chargingPricesSum;\n }", "public function testDestiny2ReportOffensivePostGameCarnageReportPlayer()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function get_penalty_types() {\n\t$array = array(\n\t\t\t\"Abuse of officials\" \t=> 2,\n\t\t\t\"Aggressor penalty\"\t\t=> 2,\n\t\t\t\"Attempt to injure\"\t\t=> 2,\n\t\t\t\"Biting\"\t\t\t\t=> 2,\n\t\t\t\"Boarding\"\t\t\t\t=> 2,\n\t\t\t\"Butt-ending\"\t\t\t=> 2,\n\t\t\t\"Broken stick\"\t\t\t=> 2,\n\t\t\t\"Charging\"\t\t\t\t=> 2,\n\t\t\t\"Checking from behind\"\t=> 2,\n\t\t\t\"Illegal check to the head\" => 2,\n\t\t\t\"Clipping\" \t\t\t\t=> 2,\n\t\t\t\"Cross-checking\" \t\t=> 2,\n\t\t\t\"Delay of game\" \t\t=> 2,\n\t\t\t\"Diving\"\t\t\t\t=> 2,\n\t\t\t\"Elbowing\"\t\t\t\t=> 2,\n\t\t\t\"Eye-gouging\"\t\t\t=> 2,\n\t\t\t\"Fighting\"\t\t\t\t=> 5,\n\t\t\t\"Goaltender Interference\" => 2,\n\t\t\t\"Goaltender Leaving Crease\" => 2,\n\t\t\t\"Head-butting\" => 2,\n\t\t\t\"High-sticking (2 min)\" => 2,\n\t\t\t\"High-sticking (4 min)\" => 2,\n\t\t\t\"Holding\" => 2,\n\t\t\t\"Holding the stick\" => 2,\n\t\t\t\"Illegal Equipment\" => 2,\n\t\t\t\"Instigator penalty\" => 2,\n\t\t\t\"Interference\" => 2,\n\t\t\t\"Joining a fight\" => 10,\n\t\t\t\"Kicking\" => 5,\n\t\t\t\"Kneeing\" => 2,\n\t\t\t\"Leaving the Penalty Bench\" => 2,\n\t\t\t\"Playing with Too Many Sticks\" => 2,\n\t\t\t\"Roughing\" => 2,\n\t\t\t\"Secondary Altercation\" => 2,\n\t\t\t\"Slashing\" => 2,\n\t\t\t\"Slew Footing\" => 2,\n\t\t\t\"Spearing\" => 2,\n\t\t\t\"Starting the wrong lineup\" => 2,\n\t\t\t\"Substitution infraction (Illegal Substitution)\" => 2,\n\t\t\t\"Throwing Equipment\" => 2,\n\t\t\t\"Too many men on the ice\" => 2,\n\t\t\t\"Tripping\" => 2, \n\t\t\t\"Unsportsmanlike conduct\" => 2\n\t\t);\n\n\treturn $array;\n}", "function get_cost() {\n\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"Calulating bill for cr $this->id\", \"\", \"\", 0, 0, 0);\n\t\t$cr_appliance_id = $this->appliance_id;\n\t\t$app_id_arr = explode(\",\", $cr_appliance_id);\n\t\t$cr_costs_final = 0;\n\t\tforeach ($app_id_arr as $app_id) {\n\t\t\t$cloud_app = new cloudappliance();\n\t\t\t$cloud_app->get_instance_by_appliance_id($app_id);\n\t\t\t// check state, only bill if active\n\t\t\tif ($cloud_app->state == 1) {\n\t\t\t\t// basic cost\n\t\t\t\t$cr_costs = 0;\n\t\t\t\t// + per cpu\n\t\t\t\t$cr_costs = $cr_costs + $this->cpu_req;\n\t\t\t\t// + per nic\n\t\t\t\t$cr_costs = $cr_costs + $this->network_req;\n\t\t\t\t// ha cost double\n\t\t\t\tif (!strcmp($this->ha_req, '1')) {\n\t\t\t\t\t$cr_costs = $cr_costs * 2;\n\t\t\t\t}\n\t\t\t\t// TODO : disk costs\n\t\t\t\t// TODO : network-traffic costs\n\n\t\t\t\t// sum\n\t\t\t\t$cr_costs_final = $cr_costs_final + $cr_costs;\n\t\t\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Billing active appliance $app_id (cr $this->id) = $cr_costs CC-units\", \"\", \"\", 0, 0, 0);\n\t\t\t} else {\n\t\t\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Not billing paused appliance $app_id (cr $this->id)\", \"\", \"\", 0, 0, 0);\n\t\t\t}\n\t\t}\n\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Final bill for cr $this->id = $cr_costs_final CC-units\", \"\", \"\", 0, 0, 0);\n\t\treturn $cr_costs_final;\n\t}", "public function getLifeStyleMultiplier() {\r\n\r\n\t\t//Get the latest iFOCUS results. If there are none, return the sedentary value\r\n\t\t$reports = $this->getCompleted();\r\n\t\tif ($reports) {\r\n\t\t\t$this->retrieve($this->id, false, $reports[0]['value']);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn (1.2);\r\n\t\t}\r\n\r\n\t\t$ndays = 0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Number of days of exercise\r\n\t\tif ($this->data['physical_activity']['q24']) {\t\t\t\t//Moderate activity level\r\n\t\t\t$q24 = $this->data['physical_activity']['q24'];\r\n\t\t\tif ($q24 == 1) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//None\r\n\t\t\t\t$ndays += 0;\r\n\t\t\t}\r\n\t\t\telse if ($q24 == 2) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//1 day/week\r\n\t\t\t\t$ndays += 1;\r\n\t\t\t}\r\n\t\t\telse if ($q24 == 3) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//2 days/week\r\n\t\t\t\t$ndays += 2;\r\n\t\t\t}\r\n\t\t\telse if ($q24 == 4) {\r\n\t\t\t\t$ndays += 3;\r\n\t\t\t}\r\n\t\t\telse if ($q24 == 5) {\r\n\t\t\t\t$ndays += 4;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($this->data['physical_activity']['q25']) {\t\t\t\t//Strength training\r\n\t\t\t$q25 = $this->data['physical_activity']['q25'];\r\n\t\t\tif ($q25 == 1) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//None\r\n\t\t\t\t$ndays += 0;\r\n\t\t\t}\r\n\t\t\telse if ($q25 == 2) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//1 day/week\r\n\t\t\t\t$ndays += 1;\r\n\t\t\t}\r\n\t\t\telse if ($q25 == 3) {\r\n\t\t\t\t$ndays += 2;\r\n\t\t\t}\r\n\t\t\telse if ($q25 == 4) {\r\n\t\t\t\t$ndays += 3;\r\n\t\t\t}\r\n\t\t\telse if ($q25 == 5) {\r\n\t\t\t\t$ndays += 4;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($this->data['physical_activity']['q26']) {\t\t\t\t//Stretching\r\n\t\t\t$q26 = $this->data['physical_activity']['q26'];\r\n\t\t\tif ($q26 == 1) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//None\r\n\t\t\t\t$ndays == 0;\r\n\t\t\t}\r\n\t\t\telse if ($q26 == 2) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//1 day/week\r\n\t\t\t\t$ndays += 1;\r\n\t\t\t}\r\n\t\t\telse if ($q26 == 3) {\r\n\t\t\t\t$ndays += 2;\r\n\t\t\t}\r\n\t\t\telse if ($q26 == 4) {\r\n\t\t\t\t$ndays += 3;\r\n\t\t\t}\r\n\t\t\telse if ($q26 == 5) {\r\n\t\t\t\t$ndays += 4;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($ndays == 0) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Sedentary\r\n\t\t\t$ret = 1.2;\r\n\t\t}\r\n\t\telse if (($ndays >= 1) && ($ndays <= 2)) {\t\t\t\t\t\t//Light activity\r\n\t\t\t$ret = 1.375;\r\n\t\t}\r\n\t\telse if (($ndays >= 3) && ($ndays <= 5)) {\t\t\t\t\t\t//Moderate activity\r\n\t\t\t$ret = 1.55;\r\n\t\t}\r\n\t\telse if ($ndays > 5) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Very active\r\n\t\t\t$ret = 1.725;\r\n\t\t}\r\n\r\n\t\treturn $ret;\r\n\t}", "public function getBaseUsedCredit(){\n $usedCredit = $this->cart->getQuote()->getBaseCreditAmount() * 1;\n $usedCredit = abs($usedCredit);\n return $usedCredit?$usedCredit:\"\";\n }", "function craft($item,$qty,$ft){\r\n\tglobal $recipe,$fuel;\r\n\t$items=Array();\r\n\t$itemsq=Array();\r\n\t$nitems=Array();\r\n\t$nitemsq=Array();\r\n\t$items[0]=$item;\r\n\t$itemsq[0]=$qty;\r\n\tdo{\r\n\t\t$allend=0;\r\n\t\tforeach($items as $k=>$v){\r\n\t\t\tif(!isset($recipe[$v])) echo('Error processing item: <b>'.$v.'</b>. Please report this to [email protected]<br>');\r\n\t\t\telse{\r\n\t\t\t\tif($recipe[$v]!='end'){\r\n\t\t\t\t\t$allend+=1;\r\n\t\t\t\t\t$tmp=explode(',',$recipe[$v]);\r\n\t\t\t\t\tforeach($tmp as $t){\r\n\t\t\t\t\t\t$t2=explode(':',$t);\r\n\t\t\t\t\t\t$nitems[count($nitems)]=$t2[0];\r\n\t\t\t\t\t\t$nitemsq[count($nitemsq)]=($t2[1]*$itemsq[$k]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if($v=='fuel'){\r\n\t\t\t\t\t$allend+=1;\r\n\t\t\t\t\t$nitems[count($nitems)]=$ft;\r\n\t\t\t\t\t$nitemsq[count($nitemsq)]=($itemsq[$k]/$fuel[$ft]);\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$nitems[count($nitems)]=$v;\r\n\t\t\t\t\t$nitemsq[count($nitemsq)]=$itemsq[$k];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$items=$nitems;\r\n\t\t$itemsq=$nitemsq;\r\n\t\t$nitems=Array();\r\n\t\t$nitemsq=Array();\r\n\t}while($allend!=0);\r\n\tforeach($items as $key=>$val){\r\n\t\t$re[$val]+=$itemsq[$key];\r\n\t}\r\n\treturn $re;\r\n}", "public function hasPower(){\n return $this->_has(4);\n }" ]
[ "0.57405835", "0.57033587", "0.5655516", "0.5583838", "0.5497094", "0.5445773", "0.5403922", "0.5327728", "0.5311983", "0.53050745", "0.5264904", "0.52633363", "0.5204975", "0.5202033", "0.52019393", "0.5188607", "0.5187021", "0.5185876", "0.51723284", "0.5151267", "0.5142136", "0.5100249", "0.50970864", "0.5080321", "0.5072534", "0.50708133", "0.5062044", "0.5051828", "0.50499105", "0.5034279", "0.50295573", "0.5014503", "0.49931547", "0.49927717", "0.49874797", "0.49723062", "0.49708563", "0.49697533", "0.49619862", "0.49492872", "0.49485224", "0.4943977", "0.49399146", "0.49278954", "0.49239233", "0.49222434", "0.49186084", "0.49158195", "0.49153093", "0.49044174", "0.4888657", "0.48830682", "0.48734677", "0.4865732", "0.48591113", "0.4854883", "0.4845919", "0.48249212", "0.4818811", "0.48150048", "0.4812412", "0.48094824", "0.480445", "0.4804205", "0.47932947", "0.47913146", "0.47904685", "0.4786833", "0.47775745", "0.47736087", "0.47734886", "0.47725472", "0.47708508", "0.4757576", "0.4755875", "0.47549722", "0.47546944", "0.47544584", "0.47407576", "0.47389713", "0.47377768", "0.47361", "0.47343025", "0.47221068", "0.47181863", "0.47180948", "0.47124273", "0.47106674", "0.47087234", "0.4703365", "0.47024664", "0.47006726", "0.4699873", "0.46984848", "0.4697047", "0.4695023", "0.46924037", "0.4687171", "0.46846038", "0.46778247", "0.46661723" ]
0.0
-1
Once again, I'm complaining about the black magiks I applied in this method. But hey, pretty serialization is pretty serialization, and if it costs my soul, so be it
public function applyAbilityOverrides () { $class = new ReflectionClass($this->getItem()->getBaseItem()); $baseItem = $class->newInstance(); if (is_iterable($this->getItem()->getItemAbilities())) { foreach ($this->getItem()->getItemAbilities() as $itemAbility) { if ($this->attunedLevel >= $itemAbility->getAttunementLevelRequired()) { foreach ($itemAbility->getAbility()->getAbilityPartial() as $abilityPartial) { if ($abilityPartial instanceof AbilityOverride) { try { $key = Tools::snakeCaseToCamelCase($abilityPartial->getOverrideKey(), false); $property = $baseItem->getProperty($key); $property->setAccessible(true); if ($abilityPartial->isAppend()) { $property->setValue($this->getItem()->getBaseItem(), Tools::append($property->getValue(), $abilityPartial->getValue())); } else { $property->setValue($this->getItem()->getBaseItem(), $abilityPartial->getValue()); } unset ($abilityPartial); } catch (\Exception $exception) { continue; } } } } } } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function serialize();", "abstract public function serialize();", "public abstract function serialize();", "abstract protected function serializeData();", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize();", "public function serialize();", "public function serialize();", "public function binarySerialize();", "public function serialize()\n {\n }", "public function serialize()\n {\n }", "abstract public function serialize($data);", "function _serialize( &$data ) {\n\t\t$serial = serialize( $data );\n\t\tif( function_exists( 'gzdeflate' ) ) {\n\t\t\treturn gzdeflate( $serial );\n\t\t} else {\n\t\t\treturn $serial;\n\t\t}\n\t}", "public function serialize(){ }", "function maybe_serialize($data)\n {\n }", "public function serialize()\n {\n // TODO: Implement serialize() method.\n }", "abstract protected function serializeData($unSerializedData);", "public function serialize($data)\n {\n }", "public function SerializeObject () {\n return serialize ($this);\n }", "final public function jsonSerialize() {}", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function serialize($data);", "function serialize()\r\n {\r\n $owner=$this->readOwner();\r\n\r\n if ($owner!=null)\r\n {\r\n\r\n $_SESSION['insession.'.$this->readNamePath()]=1;\r\n\r\n //$this->newserialize();\r\n\r\n $refclass=new ReflectionClass($this->ClassName());\r\n $methods=$refclass->getMethods();\r\n\r\n reset($methods);\r\n\r\n while (list($k,$method)=each($methods))\r\n {\r\n $methodname=$method->name;\r\n if ($methodname[0] == 's' && $methodname[1] == 'e' && $methodname[2] == 't') // fast check of: substr($methodname,0,3)=='set'\r\n {\r\n $propname=substr($methodname, 3);\r\n\r\n if($propname=='Name')\r\n $propvalue = $this->_name;\r\n else\r\n $propvalue=$this->$propname;\r\n\r\n if (is_object($propvalue))\r\n {\r\n if ($propvalue->inheritsFrom('Component'))\r\n {\r\n $apropvalue='';\r\n $aowner=$propvalue->readOwner();\r\n if ($aowner!=null) $apropvalue=$aowner->getName().'.';\r\n $apropvalue.=$propvalue->getName();\r\n $propvalue=$apropvalue;\r\n }\r\n else if ($propvalue->inheritsFrom('Persistent'))\r\n {\r\n $propvalue->serialize();\r\n }\r\n }\r\n\r\n if ((!is_object($propvalue)) && ($this->allowserialize($propname)))\r\n {\r\n $defmethod='default'.$propname;\r\n\r\n if (method_exists($this,$defmethod))\r\n {\r\n $defvalue=$this->$defmethod();\r\n\r\n if (typesafeequal($defvalue,$propvalue))\r\n {\r\n unset($_SESSION[$this->readNamePath().\".\".$propname]);\r\n continue;\r\n }\r\n }\r\n\r\n //TODO: Optimize this\r\n $_SESSION[$this->readNamePath().\".\".$propname]=$propvalue;\r\n }\r\n }\r\n }\r\n\r\n\r\n if ($this->inheritsFrom('Component')) $this->serializeChildren();\r\n }\r\n else\r\n {\r\n global $exceptions_enabled;\r\n\r\n if ($exceptions_enabled)\r\n {\r\n throw new Exception('Cannot serialize a component without an owner');\r\n }\r\n }\r\n }", "function maybe_unserialize($data)\n {\n }", "public function _jsonSerialize();", "public function jsonSerialize():mixed\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[ReturnTypeWillChange]\n public function __serialize()\n {\n return $this->toArray();\n }", "function my_serialize($data, $base64 = false)\n{\n $output = \"\";\n if(is_array($data)) {\n $type = 'array';\n } elseif(is_int($data)) {\n $type = 'int';\n } elseif(is_float($data)) {\n $type = 'float';\n } else {\n $type = 'string';\n }\n switch($type) {\n case 'array':\n $output .= 'a:' . count($data) . ':{';\n foreach($data as $key => $value) {\n $output .= my_serialize($key, $base64);\n $output .= my_serialize($value, $base64);\n }\n $output .= '}';\n break;\n case 'int':\n $output .= 'i:';\n $output .= intval($data);\n $output .= ';';\n break;\n case 'float':\n $output .= 'd:';\n $output .= str_replace(',', '.', (string)floatval($data));\n $output .= ';';\n break;\n case 'string':\n $data = $base64 ? base64_encode($data) : $data;\n $output .= 's:' . strlen($data) . ':\"';\n $output .= (string)$data;\n $output .= '\";';\n break;\n }\n return $output;\n}", "function serialise(): string;", "public function serializer() {\n }", "function jsonSerialize();", "public function __toString()\n {\n //if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n // return json_encode(\n // ObjectSerializer::sanitizeForSerialization($this),\n // JSON_PRETTY_PRINT\n // );\n //}\n\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n $jsonString = json_encode(\n ObjectSerializer::sanitizeForSerialization($this),\n JSON_PRETTY_PRINT\n );\nreturn \"$jsonString\";\n }\n\n $jsonString = json_encode(ObjectSerializer::sanitizeForSerialization($this));\nreturn \"$jsonString\";\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }" ]
[ "0.7651464", "0.7651464", "0.7561082", "0.7483263", "0.7284427", "0.7284427", "0.7284427", "0.7284427", "0.7284427", "0.7284427", "0.7283874", "0.7283874", "0.71980834", "0.71980834", "0.71980834", "0.6978929", "0.6925858", "0.6925858", "0.69000506", "0.68088394", "0.67988974", "0.6669196", "0.66284406", "0.65680295", "0.6496991", "0.64651966", "0.64635897", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.6461182", "0.636896", "0.6363723", "0.6354177", "0.63416463", "0.63248026", "0.6298816", "0.62950534", "0.6226036", "0.6183253", "0.61734706", "0.61722475", "0.61716044", "0.616319", "0.616319", "0.616319", "0.616319", "0.616319", "0.616319", "0.616319", "0.616319", "0.616319", "0.616319", "0.616319", "0.616319", "0.616319", "0.616319", "0.616319", "0.616319", "0.616319", "0.616319", "0.616319", "0.616319", "0.616319", "0.616319", "0.616319", "0.616319", "0.616319" ]
0.0
-1
Display a listing of the resource.
public function index(Request $request) { //$request->user()->authorizeRoles('admin'); $About = About::paginate(5); return view('about.indexabout',compact('About')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { return view('about.createabout'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $this->validate($request, [ 'titulo' => 'required', 'descripcion' => 'required', 'imagen' => 'sometimes|required' ]); if($request->file('imagen')){ $file = $request->file('imagen'); $extension = $file->getClientOriginalExtension(); $imagen = Image::make($file); $nom = str_replace(':','-',str_replace(' ','-',Carbon::now()->toDateTimeString().'.'.$extension)); $path = 'imagenes/about'; if (!file_exists($path)) { mkdir($path, 0777, true); } $img = $path.'/'.$nom; if($imagen->save($img)) { $requestData = $request->all(); $requestData['imagen'] = $img; $about = new About; $about->titulo=$request->titulo; $about->descripcion=$request->descripcion; $about->imagen=$img; $about->save(); // About::create($requestData); $mensaje = "Registrado correctamente"; }else{ $mensaje = "Error al guardar la imagen"; } } return redirect()->route('about.index')->with('success','Item creado Exitosamente!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { $About = About::findOrFail($id); return view('about.showabout',compact('About')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $About = About::findOrFail($id); return view('about.editabout',compact('About')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.7855196", "0.76957726", "0.7273917", "0.7241426", "0.71717227", "0.7064183", "0.70528984", "0.69836885", "0.694763", "0.69469565", "0.6941572", "0.69301945", "0.6903868", "0.68989486", "0.68989486", "0.68787694", "0.68641657", "0.6860115", "0.6857286", "0.68464494", "0.6834566", "0.68116575", "0.68075293", "0.6805924", "0.6801357", "0.6796291", "0.67915684", "0.67915684", "0.67874014", "0.678544", "0.67787844", "0.6777662", "0.67675763", "0.676299", "0.6746726", "0.6745706", "0.67450166", "0.67450166", "0.6739429", "0.6734577", "0.6725992", "0.67127997", "0.6694406", "0.6692487", "0.6689421", "0.66884303", "0.6687299", "0.6685663", "0.6682167", "0.66701853", "0.66697115", "0.6666091", "0.6666091", "0.66627705", "0.6661716", "0.6661522", "0.6657919", "0.6656454", "0.6653187", "0.6642113", "0.66332614", "0.66324973", "0.66275465", "0.66275465", "0.6619777", "0.6619387", "0.6617973", "0.66154003", "0.66110945", "0.6607966", "0.66065043", "0.6596376", "0.65953517", "0.65941286", "0.6591486", "0.6590759", "0.6588404", "0.658161", "0.6580548", "0.6579757", "0.6577171", "0.65761065", "0.657386", "0.65686774", "0.6567784", "0.65672046", "0.6566417", "0.65615803", "0.65615714", "0.65615714", "0.65592474", "0.65586483", "0.65568006", "0.6556628", "0.65564895", "0.6555322", "0.65551996", "0.6555016", "0.654888", "0.65477645", "0.65451735" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { // $About = About::findOrFail($id); // $About->titulo = $request->titulo; // $About->descripcion = $request->descripcion; // // $Abouts->imagen = $request->imagen; // if($request->file('imagen')){ // $path = Storage::disk('public_uploads')->put('about', $request->file('imagen')); // $request->imagen ='uploads/'.$path; // } // $About->imagen = $request->imagen; // $About->save(); // return redirect()->route('about.index')->with('success','Item Actualizado Exitosamente!'); $this->validate($request, [ 'titulo' => 'required', 'descripcion' => 'required', 'imagen' => 'sometimes|required' ]); if($request->file('imagen')){ $file = $request->file('imagen'); $extension = $file->getClientOriginalExtension(); $imagen = Image::make($file); $nom = str_replace(':','-',str_replace(' ','-',Carbon::now()->toDateTimeString().'.'.$extension)); $path = 'imagenes/about'; if (!file_exists($path)) { mkdir($path, 0777, true); } $img = $path.'/'.$nom; if($imagen->save($img)) { $requestData = $request->all(); $requestData['imagen'] = $img; $about = new About; $about->titulo=$request->titulo; $about->descripcion=$request->descripcion; $about->imagen=$img; $about = About::findOrFail($id); $archivo_antiguo = $about->imagen; $about->update($requestData); if (File::delete($archivo_antiguo)) { $mensaje = "Actualizado correctamente :3"; }else{ $mensaje = "Actualizado.. Error al eliminar la imagen"; } }else{ $mensaje = "Error al guardar la imagen"; } }else{ $requestData = $request->all(); $about = About::findOrFail($id); $about->update($requestData); } return redirect()->route('about.index')->with('success','Item Actualizado Exitosamente!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $About = About::findOrFail($id); $About->delete(); return redirect()->route('about.index')->with('success','Item Eliminado Exitosamente!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Bootstrap any application services.
public function boot() { $this->bootingDomain(); $this->registerCommands(); $this->registerListeners(); $this->registerPolicies(); $this->registerRoutes(); $this->registerBladeComponents(); $this->registerLivewireComponents(); $this->registerSpotlightCommands(); $this->bootedDomain(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function bootstrap(): void\n {\n if (! $this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrappers());\n }\n\n $this->app->loadDeferredProviders();\n }", "public function boot()\n {\n // Boot here application\n }", "public function bootstrap()\n {\n if (!$this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrapperList);\n }\n\n $this->app->loadDeferredProviders();\n }", "public function boot()\r\n {\r\n // Publishing is only necessary when using the CLI.\r\n if ($this->app->runningInConsole()) {\r\n $this->bootForConsole();\r\n }\r\n }", "public function boot()\n {\n $this->app->bind(IUserService::class, UserService::class);\n $this->app->bind(ISeminarService::class, SeminarService::class);\n $this->app->bind(IOrganizationService::class, OrganizationService::class);\n $this->app->bind(ISocialActivityService::class, SocialActivityService::class);\n }", "public function boot()\n {\n if ($this->booted) {\n return;\n }\n\n array_walk($this->loadedServices, function ($s) {\n $this->bootService($s);\n });\n\n $this->booted = true;\n }", "public function boot()\n {\n\n $this->app->bind(FileUploaderServiceInterface::class,FileUploaderService::class);\n $this->app->bind(ShopServiceInterface::class,ShopService::class);\n $this->app->bind(CategoryServiceInterface::class,CategoryService::class);\n $this->app->bind(ProductServiceInterface::class,ProductService::class);\n $this->app->bind(ShopSettingsServiceInterface::class,ShopSettingsService::class);\n $this->app->bind(FeedbackServiceInterface::class,FeedbackService::class);\n $this->app->bind(UserServiceInterface::class,UserService::class);\n $this->app->bind(ShoppingCartServiceInterface::class,ShoppingCartService::class);\n $this->app->bind(WishlistServiceInterface::class,WishlistService::class);\n $this->app->bind(NewPostApiServiceInterface::class,NewPostApiService::class);\n $this->app->bind(DeliveryAddressServiceInterface::class,DeliveryAddressService::class);\n $this->app->bind(StripeServiceInterface::class,StripeService::class);\n $this->app->bind(OrderServiceInterface::class,OrderService::class);\n $this->app->bind(MailSenderServiceInterface::class,MailSenderSenderService::class);\n }", "public function boot()\n {\n $this->setupConfig('delta_service');\n $this->setupMigrations();\n $this->setupConnection('delta_service', 'delta_service.connection');\n }", "public function boot()\n {\n $configuration = [];\n\n if (file_exists($file = getcwd() . '/kaleo.config.php')) {\n $configuration = include_once $file;\n }\n\n $this->app->singleton('kaleo', function () use ($configuration) {\n return new KaleoService($configuration);\n });\n }", "public function boot()\n {\n $this->shareResources();\n $this->mergeConfigFrom(self::CONFIG_PATH, 'amocrm-api');\n }", "public function boot(): void\n {\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n {\n // Ports\n $this->app->bind(\n IAuthenticationService::class,\n AuthenticationService::class\n );\n $this->app->bind(\n IBeerService::class,\n BeerService::class\n );\n\n // Adapters\n $this->app->bind(\n IUserRepository::class,\n UserEloquentRepository::class\n );\n $this->app->bind(\n IBeerRepository::class,\n BeerEloquentRepository::class\n );\n }", "public function boot()\n {\n $this->setupConfig($this->app);\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->loadMigrations();\n }\n if(config($this->vendorNamespace. '::config.enabled')){\n Livewire::component($this->vendorNamespace . '::login-form', LoginForm::class);\n $this->loadRoutes();\n $this->loadViews();\n $this->loadMiddlewares();\n $this->loadTranslations();\n }\n }", "public function boot()\n {\n $source = dirname(__DIR__, 3) . '/config/config.php';\n\n if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {\n $this->publishes([$source => config_path('dubbo_cli.php')]);\n } elseif ($this->app instanceof LumenApplication) {\n $this->app->configure('dubbo_cli');\n }\n\n $this->mergeConfigFrom($source, 'dubbo_cli');\n }", "public function boot()\n {\n $this->package('domain/app');\n\n $this->setApplication();\n }", "public function boot()\n {\n $this->setUpConfig();\n $this->setUpConsoleCommands();\n }", "public function boot()\n {\n $this->strapRoutes();\n $this->strapViews();\n $this->strapMigrations();\n $this->strapCommands();\n\n $this->registerPolicies();\n }", "public function boot()\n {\n $this->app->singleton('LaraCurlService', function ($app) {\n return new LaraCurlService();\n });\n\n $this->loadRoutesFrom(__DIR__.'/routes/web.php');\n }", "public function boot()\n {\n $providers = $this->make('config')->get('app.console_providers', array());\n foreach ($providers as $provider) {\n $provider = $this->make($provider);\n if ($provider && method_exists($provider, 'boot')) {\n $provider->boot();\n }\n }\n }", "public function boot()\n {\n foreach (glob(app_path('/Api/config/*.php')) as $path) {\n $path = realpath($path);\n $this->mergeConfigFrom($path, basename($path, '.php'));\n }\n\n // 引入自定义函数\n foreach (glob(app_path('/Helpers/*.php')) as $helper) {\n require_once $helper;\n }\n // 引入 api 版本路由\n $this->loadRoutesFrom(app_path('/Api/Routes/base.php'));\n\n }", "public function bootstrap()\n {\n if (!$this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrappers());\n }\n\n //$this->app->loadDeferredProviders();\n\n if (!$this->commandsLoaded) {\n //$this->commands();\n\n $this->commandsLoaded = true;\n }\n }", "protected function boot()\n\t{\n\t\tforeach ($this->serviceProviders as $provider)\n\t\t{\n\t\t\t$provider->boot($this);\n\t\t}\n\n\t\t$this->booted = true;\n\t}", "public function boot()\n {\n $this->setupConfig();\n //register rotating daily monolog provider\n $this->app->register(MonologProvider::class);\n $this->app->register(CircuitBreakerServiceProvider::class);\n $this->app->register(CurlServiceProvider::class);\n }", "public function boot(): void\n {\n if ($this->booted) {\n return;\n }\n\n array_walk($this->services, function ($service) {\n $this->bootServices($service);\n });\n\n $this->booted = true;\n }", "public static function boot() {\n\t\tstatic::container()->boot();\n\t}", "public function boot()\n {\n include_once('ComposerDependancies\\Global.php');\n //---------------------------------------------\n include_once('ComposerDependancies\\League.php');\n include_once('ComposerDependancies\\Team.php');\n include_once('ComposerDependancies\\Matchup.php');\n include_once('ComposerDependancies\\Player.php');\n include_once('ComposerDependancies\\Trade.php');\n include_once('ComposerDependancies\\Draft.php');\n include_once('ComposerDependancies\\Message.php');\n include_once('ComposerDependancies\\Poll.php');\n include_once('ComposerDependancies\\Chat.php');\n include_once('ComposerDependancies\\Rule.php');\n\n \n include_once('ComposerDependancies\\Admin\\Users.php');\n\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n if ($this->app instanceof LaravelApplication) {\n $this->publishes([\n __DIR__.'/../config/state-machine.php' => config_path('state-machine.php'),\n ], 'config');\n } elseif ($this->app instanceof LumenApplication) {\n $this->app->configure('state-machine');\n }\n }\n }", "public function boot()\n {\n $this->bootEvents();\n\n $this->bootPublishes();\n\n $this->bootTypes();\n\n $this->bootSchemas();\n\n $this->bootRouter();\n\n $this->bootViews();\n \n $this->bootSecurity();\n }", "public function boot()\n {\n //\n Configuration::environment(\"sandbox\");\n Configuration::merchantId(\"cmpss9trsxsr4538\");\n Configuration::publicKey(\"zy3x5mb5jwkcrxgr\");\n Configuration::privateKey(\"4d63c8b2c340daaa353be453b46f6ac2\");\n\n\n $modules = Directory::listDirectories(app_path('Modules'));\n\n foreach ($modules as $module)\n {\n $routesPath = app_path('Modules/' . $module . '/routes.php');\n $viewsPath = app_path('Modules/' . $module . '/Views');\n\n if (file_exists($routesPath))\n {\n require $routesPath;\n }\n\n if (file_exists($viewsPath))\n {\n $this->app->view->addLocation($viewsPath);\n }\n }\n }", "public function boot()\n {\n resolve(EngineManager::class)->extend('elastic', function () {\n return new ElasticScoutEngine(\n ElasticBuilder::create()\n ->setHosts(config('scout.elastic.hosts'))\n ->build()\n );\n });\n }", "public function boot(): void\n {\n try {\n // Just check if we have DB connection! This is to avoid\n // exceptions on new projects before configuring database options\n // @TODO: refcator the whole accessareas retrieval to be file-based, instead of db based\n DB::connection()->getPdo();\n\n if (Schema::hasTable(config('cortex.foundation.tables.accessareas'))) {\n // Register accessareas into service container, early before booting any module service providers!\n $this->app->singleton('accessareas', fn () => app('cortex.foundation.accessarea')->where('is_active', true)->get());\n }\n } catch (Exception $e) {\n // Be quiet! Do not do or say anything!!\n }\n\n $this->bootstrapModules();\n }", "public function boot()\n {\n $this->app->register(UserServiceProvider::class);\n $this->app->register(DashboardServiceProvider::class);\n $this->app->register(CoreServiceProvider::class);\n $this->app->register(InstitutionalVideoServiceProvider::class);\n $this->app->register(InstitutionalServiceProvider::class);\n $this->app->register(TrainingServiceProvider::class);\n $this->app->register(CompanyServiceProvider::class);\n $this->app->register(LearningUnitServiceProvider::class);\n $this->app->register(PublicationServiceProvider::class);\n }", "public function boot()\n {\n Schema::defaultStringLength(191);\n\n $this->app->bindMethod([SendMailPasswordReset::class, 'handle'], function ($job, $app) {\n return $job->handle($app->make(MailService::class));\n });\n\n $this->app->bindMethod([ClearTokenPasswordReset::class, 'handle'], function ($job, $app) {\n return $job->handle($app->make(PasswordResetRepository::class));\n });\n\n $this->app->bind(AuthService::class, function ($app) {\n return new AuthService($app->make(HttpService::class));\n });\n }", "public function boot()\n {\n $this->makeRepositories();\n }", "public function boot(): void\n {\n $this->loadMiddlewares();\n }", "public function boot()\n {\n $this->app->when(ChatAPIChannel::class)\n ->needs(ChatAPI::class)\n ->give(function () {\n $config = config('services.chatapi');\n return new ChatAPI(\n $config['token'],\n $config['api_url']\n );\n });\n }", "public function boot() {\r\n\t\t$hosting_service = HostResolver::get_host_service();\r\n\r\n\t\tif ( ! empty( $hosting_service ) ) {\r\n\t\t\t$this->provides[] = $hosting_service;\r\n\t\t}\r\n\t}", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n require(__DIR__ . '/../routes/console.php');\n } else {\n // Menus for BPM are done through middleware. \n Route::pushMiddlewareToGroup('web', AddToMenus::class);\n \n // Assigning to the web middleware will ensure all other middleware assigned to 'web'\n // will execute. If you wish to extend the user interface, you'll use the web middleware\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(__DIR__ . '/../routes/web.php');\n \n // If you wish to extend the api, be sure to utilize the api middleware. In your api \n // Routes file, you should prefix your routes with api/1.0\n Route::middleware('api')\n ->namespace($this->namespace)\n ->prefix('api/1.0')\n ->group(__DIR__ . '/../routes/api.php');\n \n Event::listen(ScreenBuilderStarting::class, function($event) {\n $event->manager->addScript(mix('js/screen-builder-extend.js', 'vendor/api-connector'));\n $event->manager->addScript(mix('js/screen-renderer-extend.js', 'vendor/api-connector'));\n });\n }\n\n // load migrations\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n\n // Load our views\n $this->loadViewsFrom(__DIR__.'/../resources/views/', 'api-connector');\n\n // Load our translations\n $this->loadTranslationsFrom(__DIR__.'/../lang', 'api-connector');\n\n $this->publishes([\n __DIR__.'/../public' => public_path('vendor/api-connector'),\n ], 'api-connector');\n\n $this->publishes([\n __DIR__ . '/../database/seeds' => database_path('seeds'),\n ], 'api-connector');\n\n $this->app['events']->listen(PackageEvent::class, PackageListener::class);\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->bindCommands();\n $this->registerCommands();\n $this->app->bind(InstallerContract::class, Installer::class);\n\n $this->publishes([\n __DIR__.'/../config/exceptionlive.php' => base_path('config/exceptionlive.php'),\n ], 'config');\n }\n\n $this->registerMacros();\n }", "public function boot(){\r\n $this->app->configure('sdk');\r\n $this->publishes([\r\n __DIR__.'/../../resources/config/sdk.php' => config_path('sdk.php')\r\n ]);\r\n $this->mergeConfigFrom(__DIR__.'/../../resources/config/sdk.php','sdk');\r\n\r\n $api = config('sdk.api');\r\n foreach($api as $key => $value){\r\n $this->app->singleton($key,$value);\r\n }\r\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n EnvironmentCommand::class,\n EventGenerateCommand::class,\n EventMakeCommand::class,\n JobMakeCommand::class,\n KeyGenerateCommand::class,\n MailMakeCommand::class,\n ModelMakeCommand::class,\n NotificationMakeCommand::class,\n PolicyMakeCommand::class,\n ProviderMakeCommand::class,\n RequestMakeCommand::class,\n ResourceMakeCommand::class,\n RuleMakeCommand::class,\n ServeCommand::class,\n StorageLinkCommand::class,\n TestMakeCommand::class,\n ]);\n }\n }", "public function boot()\n {\n $this->app->bind(WeatherInterface::class, OpenWeatherMapService::class);\n $this->app->bind(OrderRepositoryInterface::class, EloquentOrderRepository::class);\n $this->app->bind(NotifyInterface::class, EmailNotifyService::class);\n }", "public function boot()\n {\n $this->app->bind(DateService::class,DateServiceImpl::class);\n $this->app->bind(DisasterEventQueryBuilder::class,DisasterEventQueryBuilderImpl::class);\n $this->app->bind(MedicalFacilityQueryBuilder::class,MedicalFacilityQueryBuilderImpl::class);\n $this->app->bind(RefugeCampQueryBuilder::class,RefugeCampQueryBuilderImpl::class);\n $this->app->bind(VictimQueryBuilder::class,VictimQueryBuilderImpl::class);\n $this->app->bind(VillageQueryBuilder::class,VillageQueryBuilderImpl::class);\n }", "public function boot()\n {\n\t\tif ( $this->app->runningInConsole() ) {\n\t\t\t$this->loadMigrationsFrom(__DIR__.'/migrations');\n\n//\t\t\t$this->publishes([\n//\t\t\t\t__DIR__.'/config/scheduler.php' => config_path('scheduler.php'),\n//\t\t\t\t__DIR__.'/console/CronTasksList.php' => app_path('Console/CronTasksList.php'),\n//\t\t\t\t__DIR__.'/views' => resource_path('views/vendor/scheduler'),\n//\t\t\t]);\n\n//\t\t\tapp('Revolta77\\ScheduleMonitor\\Conntroller\\CreateController')->index();\n\n//\t\t\t$this->commands([\n//\t\t\t\tConsole\\Commands\\CreateController::class,\n//\t\t\t]);\n\t\t}\n\t\t$this->loadRoutesFrom(__DIR__.'/routes/web.php');\n }", "public function boot()\n {\n $this->bootPackages();\n }", "public function boot(): void\n {\n if ($this->app->runningInConsole()) {\n $this->commands($this->load(__DIR__.'/../Console', Command::class));\n }\n }", "public function boot(): void\n {\n $this->publishes(\n [\n __DIR__ . '/../config/laravel_entity_services.php' =>\n $this->app->make('path.config') . DIRECTORY_SEPARATOR . 'laravel_entity_services.php',\n ],\n 'laravel_repositories'\n );\n $this->mergeConfigFrom(__DIR__ . '/../config/laravel_entity_services.php', 'laravel_entity_services');\n\n $this->registerCustomBindings();\n }", "public function boot()\n {\n // DEFAULT STRING LENGTH\n Schema::defaultStringLength(191);\n\n // PASSPORT\n Passport::routes(function (RouteRegistrar $router)\n {\n $router->forAccessTokens();\n });\n Passport::tokensExpireIn(now()->addDays(1));\n\n // SERVICES, REPOSITORIES, CONTRACTS BINDING\n $this->app->bind('App\\Contracts\\IUser', 'App\\Repositories\\UserRepository');\n $this->app->bind('App\\Contracts\\IUserType', 'App\\Repositories\\UserTypeRepository');\n $this->app->bind('App\\Contracts\\IApiToken', 'App\\Services\\ApiTokenService');\n $this->app->bind('App\\Contracts\\IModule', 'App\\Repositories\\ModuleRepository');\n $this->app->bind('App\\Contracts\\IModuleAction', 'App\\Repositories\\ModuleActionRepository');\n }", "public function bootstrap(): void\n {\n $globalConfigurationBuilder = (new GlobalConfigurationBuilder())->withEnvironmentVariables()\n ->withPhpFileConfigurationSource(__DIR__ . '/../config.php');\n (new BootstrapperCollection())->addMany([\n new DotEnvBootstrapper(__DIR__ . '/../.env'),\n new ConfigurationBootstrapper($globalConfigurationBuilder),\n new GlobalExceptionHandlerBootstrapper($this->container)\n ])->bootstrapAll();\n }", "public function boot()\n {\n // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'deniskisel');\n // $this->loadViewsFrom(__DIR__.'/../resources/views', 'deniskisel');\n// $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n // $this->loadRoutesFrom(__DIR__.'/routes.php');\n\n // Publishing is only necessary when using the CLI.\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->registerMigrations();\n $this->registerMigrationFolder();\n $this->registerConfig();\n }\n }", "public function boot()\n {\n $this->bootModulesMenu();\n $this->bootSkinComposer();\n $this->bootCustomBladeDirectives();\n }", "public function boot(): void\n {\n $this->app->bind(Telegram::class, static function () {\n return new Telegram(\n config('services.telegram-bot-api.token'),\n new HttpClient()\n );\n });\n }", "public function boot()\n {\n\n if (! config('app.installed')) {\n return;\n }\n\n $this->loadRoutesFrom(__DIR__ . '/Routes/admin.php');\n $this->loadRoutesFrom(__DIR__ . '/Routes/public.php');\n\n $this->loadMigrationsFrom(__DIR__ . '/Database/Migrations');\n\n// $this->loadViewsFrom(__DIR__ . '/Resources/Views', 'portfolio');\n\n $this->loadTranslationsFrom(__DIR__ . '/Resources/Lang/', 'contact');\n\n //Add menu to admin panel\n $this->adminMenu();\n\n }", "public function boot()\n {\n if (! config('app.installed')) {\n return;\n }\n\n $this->app['config']->set([\n 'scout' => [\n 'driver' => setting('search_engine', 'mysql'),\n 'algolia' => [\n 'id' => setting('algolia_app_id'),\n 'secret' => setting('algolia_secret'),\n ],\n ],\n ]);\n }", "protected function bootServiceProviders()\n {\n foreach($this->activeProviders as $provider)\n {\n // check if the service provider has a boot method.\n if (method_exists($provider, 'boot')) {\n $provider->boot();\n }\n }\n }", "public function boot(): void\n {\n // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'imc');\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n $this->loadViewsFrom(__DIR__.'/../resources/views', 'imc');\n $this->registerPackageRoutes();\n\n // Publishing is only necessary when using the CLI.\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n {\n // Larapex Livewire\n $this->mergeConfigFrom(__DIR__ . '/../configs/larapex-livewire.php', 'larapex-livewire');\n\n $this->loadViewsFrom(__DIR__ . '/../resources/views', 'larapex-livewire');\n\n $this->registerBladeDirectives();\n\n if ($this->app->runningInConsole()) {\n $this->registerCommands();\n $this->publishResources();\n }\n }", "public function boot()\n {\n // Bootstrap code here.\n $this->app->singleton(L9SmsApiChannel::class, function () {\n $config = config('l9smsapi');\n if (empty($config['token']) || empty($config['service'])) {\n throw new \\Exception('L9SmsApi missing token and service in config');\n }\n\n return new L9SmsApiChannel($config['token'], $config['service']);\n });\n\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/l9smsapi.php' => config_path('l9smsapi.php'),\n ], 'config');\n }\n }", "public function boot()\n\t{\n\t\t$this->bindRepositories();\n\t}", "public function boot()\n {\n if (!$this->app->runningInConsole()) {\n return;\n }\n\n $this->commands([\n ListenCommand::class,\n InstallCommand::class,\n EventsListCommand::class,\n ObserverMakeCommand::class,\n ]);\n\n foreach ($this->listen as $event => $listeners) {\n foreach ($listeners as $listener) {\n RabbitEvents::listen($event, $listener);\n }\n }\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n MultiAuthInstallCommand::class,\n ]);\n }\n }", "public function boot() {\n\n\t\t$this->registerProviders();\n\t\t$this->bootProviders();\n\t\t$this->registerProxies();\n\t}", "public function boot(): void\n {\n // routes\n $this->loadRoutes();\n // assets\n $this->loadAssets('assets');\n // configuration\n $this->loadConfig('configs');\n // views\n $this->loadViews('views');\n // view extends\n $this->extendViews();\n // translations\n $this->loadTranslates('views');\n // adminer\n $this->loadAdminer('adminer');\n // commands\n $this->loadCommands();\n // gates\n $this->registerGates();\n // listeners\n $this->registerListeners();\n // settings\n $this->applySettings();\n }", "public function boot()\n {\n $this->setupFacades();\n $this->setupViews();\n $this->setupBlades();\n }", "public function boot()\n {\n\n $this->app->translate_manager->addTranslateProvider(TranslateMenu::class);\n\n\n\n $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');\n $this->loadMigrationsFrom(__DIR__ . '/../migrations/');\n\n\n\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../config/larkeauth-rbac-model.conf' => config_path('larkeauth-rbac-model.conf.larkeauth'),\n __DIR__ . '/../config/larkeauth.php' => config_path('larkeauth.php.larkeauth')\n ], 'larke-auth-config');\n\n $this->commands([\n Commands\\Install::class,\n Commands\\GroupAdd::class,\n Commands\\PolicyAdd::class,\n Commands\\RoleAssign::class,\n ]);\n }\n\n $this->mergeConfigFrom(__DIR__ . '/../config/larkeauth.php', 'larkeauth');\n\n $this->bootObserver();\n }", "public function boot(): void\n {\n $this->app\n ->when(RocketChatWebhookChannel::class)\n ->needs(RocketChat::class)\n ->give(function () {\n return new RocketChat(\n new HttpClient(),\n Config::get('services.rocketchat.url'),\n Config::get('services.rocketchat.token'),\n Config::get('services.rocketchat.channel')\n );\n });\n }", "public function boot()\n {\n if ($this->booted) {\n return;\n }\n\n $this->app->registerConfiguredProvidersInRequest();\n\n $this->fireAppCallbacks($this->bootingCallbacks);\n\n /** array_walk\n * If when a provider booting, it reg some other providers,\n * then the new providers added to $this->serviceProviders\n * then array_walk will loop the new ones and boot them. // pingpong/modules 2.0 use this feature\n */\n array_walk($this->serviceProviders, function ($p) {\n $this->bootProvider($p);\n });\n\n $this->booted = true;\n\n $this->fireAppCallbacks($this->bootedCallbacks);\n }", "public function boot()\n {\n $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n\t{\n\t\t$this->package('atlantis/admin');\n\n\t\t#i: Set the locale\n\t\t$this->setLocale();\n\n $this->registerServiceAdminValidator();\n $this->registerServiceAdminFactory();\n $this->registerServiceAdminDataTable();\n $this->registerServiceModules();\n\n\t\t#i: Include our filters, view composers, and routes\n\t\tinclude __DIR__.'/../../filters.php';\n\t\tinclude __DIR__.'/../../views.php';\n\t\tinclude __DIR__.'/../../routes.php';\n\n\t\t$this->app['events']->fire('admin.ready');\n\t}", "public function boot()\n {\n $this->app->booted(function () {\n $this->callMethodIfExists('jobs');\n });\n }", "public function boot()\n {\n $this->bootSetTimeLocale();\n $this->bootBladeHotelRole();\n $this->bootBladeHotelGuest();\n $this->bootBladeIcon();\n }", "public function boot(): void\n {\n $this->registerRoutes();\n $this->registerResources();\n $this->registerMixins();\n\n if ($this->app->runningInConsole()) {\n $this->offerPublishing();\n $this->registerMigrations();\n }\n }", "public function boot()\n {\n $this->dispatch(new SetCoreConnection());\n $this->dispatch(new ConfigureCommandBus());\n $this->dispatch(new ConfigureTranslator());\n $this->dispatch(new LoadStreamsConfiguration());\n\n $this->dispatch(new InitializeApplication());\n $this->dispatch(new AutoloadEntryModels());\n $this->dispatch(new AddAssetNamespaces());\n $this->dispatch(new AddImageNamespaces());\n $this->dispatch(new AddViewNamespaces());\n $this->dispatch(new AddTwigExtensions());\n $this->dispatch(new RegisterAddons());\n }", "public function boot(): void\n {\n $this->loadViews();\n $this->loadTranslations();\n\n if ($this->app->runningInConsole()) {\n $this->publishMultipleConfig();\n $this->publishViews(false);\n $this->publishTranslations(false);\n }\n }", "public function boot()\n {\n $this->bootForConsole();\n $this->loadRoutesFrom(__DIR__ . '/routes/web.php');\n $this->loadViewsFrom(__DIR__ . '/./../resources/views', 'bakerysoft');\n }", "public function boot()\n {\n $this->app->booted(function () {\n $this->defineRoutes();\n });\n $this->defineResources();\n $this->registerDependencies();\n }", "public function boot()\n {\n $this->app->bind(CustomersRepositoryInterface::class, CustomersRepository::class);\n $this->app->bind(CountryToCodeMapperInterface::class, CountryToCodeMapper::class);\n $this->app->bind(PhoneNumbersValidatorInterface::class, PhoneNumbersRegexValidator::class);\n $this->app->bind(CustomersFilterServiceInterface::class, CustomersFilterService::class);\n $this->app->bind(CacheInterface::class, CacheAdapter::class);\n\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([$this->configPath() => config_path('oauth.php')], 'oauth');\n }\n\n app()->bind(ClientToken::class, function () {\n return new ClientToken();\n });\n\n app()->bind(TokenParser::class, function () {\n return new TokenParser(\n app()->get(Request::class)\n );\n });\n\n app()->bind(OAuthClient::class, function () {\n return new OAuthClient(\n app()->get(Request::class),\n app()->get(ClientToken::class)\n );\n });\n\n app()->bind(AccountService::class, function () {\n return new AccountService(app()->get(OAuthClient::class));\n });\n }", "public function boot()\n {\n Client::observe(ClientObserver::class);\n $this->app->bind(ClientRepositoryInterface::class, function ($app) {\n return new ClientRepository(Client::class);\n });\n $this->app->bind(UserRepositoryInterface::class, function ($app) {\n return new UserRepository(User::class);\n });\n }", "public function boot()\n {\n $this->setupFacades(); \n //$this->setupConfigs(); \n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n //\n }\n\n $this->loadRoutesFrom(__DIR__ . '/routes.php');\n }", "public function boot()\n {\n $path = __DIR__.'/../..';\n\n $this->package('clumsy/cms', 'clumsy', $path);\n\n $this->registerAuthRoutes();\n $this->registerBackEndRoutes();\n\n require $path.'/helpers.php';\n require $path.'/errors.php';\n require $path.'/filters.php';\n\n if ($this->app->runningInConsole()) {\n $this->app->make('Clumsy\\CMS\\Clumsy');\n }\n\n }", "public function boot()\n {\n $this->mergeConfigFrom(__DIR__ . '/../../config/bs4.php', 'bs4');\n $this->loadViewsFrom(__DIR__ . '/../../resources/views', 'bs');\n $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'bs');\n\n if ($this->app->runningInConsole())\n {\n $this->publishes([\n __DIR__ . '/../../resources/views' => resource_path('views/vendor/bs'),\n ], 'views');\n\n $this->publishes([\n __DIR__ . '/../../resources/lang' => resource_path('lang/vendor/bs'),\n ], 'lang');\n\n $this->publishes([\n __DIR__ . '/../../config' => config_path(),\n ], 'config');\n }\n }", "public function boot()\n {\n $this->client = new HttpClient([\n 'base_uri' => 'https://api.ipfinder.io/v1/',\n 'headers' => [\n 'User-Agent' => 'Laravel-GeoIP-Torann',\n ],\n 'query' => [\n 'token' => $this->config('key'),\n ],\n ]);\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n Check::class,\n Clear::class,\n Fix::class,\n Fresh::class,\n Foo::class,\n Ide::class,\n MakeDatabase::class,\n Ping::class,\n Version::class,\n ]);\n }\n }", "public function boot()\n {\n $app = $this->app;\n\n if (!$app->runningInConsole()) {\n return;\n }\n\n $source = realpath(__DIR__ . '/config/config.php');\n\n if (class_exists('Illuminate\\Foundation\\Application', false)) {\n // L5\n $this->publishes([$source => config_path('sniffer-rules.php')]);\n $this->mergeConfigFrom($source, 'sniffer-rules');\n } elseif (class_exists('Laravel\\Lumen\\Application', false)) {\n // Lumen\n $app->configure('sniffer-rules');\n $this->mergeConfigFrom($source, 'sniffer-rules');\n } else {\n // L4\n $this->package('chefsplate/sniffer-rules', null, __DIR__);\n }\n }", "public function boot()\r\n\t{\r\n\t\t$this->package('estey/hipsupport');\r\n\t\t$this->registerHipSupport();\r\n\t\t$this->registerHipSupportOnlineCommand();\r\n\t\t$this->registerHipSupportOfflineCommand();\r\n\r\n\t\t$this->registerCommands();\r\n\t}", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n ControllerMakeCommand::class,\n ServiceMakeCommand::class,\n RepositoryMakeCommand::class,\n ModelMakeCommand::class,\n RequestRuleMakeCommand::class,\n ]);\n }\n }", "public function boot() {\n $srcDir = __DIR__ . '/../';\n \n $this->package('baseline/baseline', 'baseline', $srcDir);\n \n include $srcDir . 'Http/routes.php';\n include $srcDir . 'Http/filters.php';\n }", "public function boot()\n {\n $this->app->bind('App\\Services\\ProviderAccountService', function() {\n return new ProviderAccountService;\n });\n }", "public function boot()\n {\n $this->loadViewsFrom(__DIR__ . '/resources/views', 'Counters');\n\n $this->loadTranslationsFrom(__DIR__ . '/resources/lang', 'Counters');\n\n\n //To load migration files directly from the package\n// $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n\n\n $this->app->booted(function () {\n $loader = AliasLoader::getInstance();\n $loader->alias('Counters', Counters::class);\n\n });\n\n $this->publishes([\n __DIR__ . '/../config/counter.php' => config_path('counter.php'),\n ], 'config');\n\n\n\n $this->publishes([\n __DIR__.'/../database/migrations/0000_00_00_000000_create_counters_tables.php' => $this->app->databasePath().\"/migrations/0000_00_00_000000_create_counters_tables.php\",\n ], 'migrations');\n\n\n if ($this->app->runningInConsole()) {\n $this->commands([\\Maher\\Counters\\Commands\\MakeCounter::class]);\n }\n\n\n }", "public function boot(Application $app)\n {\n\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }" ]
[ "0.7344842", "0.7212776", "0.7207748", "0.7123287", "0.7109729", "0.70822036", "0.7076881", "0.70718396", "0.7051853", "0.7025475", "0.7011949", "0.70043486", "0.6955807", "0.69322443", "0.69319373", "0.69272774", "0.6911386", "0.69069713", "0.6898877", "0.6898432", "0.6896597", "0.6889767", "0.6886577", "0.6880688", "0.6875815", "0.6874972", "0.68696195", "0.6864291", "0.6864246", "0.68631536", "0.68599164", "0.6857919", "0.685537", "0.68552583", "0.68522125", "0.6839775", "0.683261", "0.6831196", "0.68272495", "0.68250644", "0.68241394", "0.68181944", "0.68132496", "0.68117976", "0.6811785", "0.6808445", "0.68066794", "0.680175", "0.68005246", "0.67994386", "0.67969066", "0.67884964", "0.678574", "0.678558", "0.6783794", "0.67782456", "0.6773669", "0.6766658", "0.6766194", "0.67617613", "0.67611295", "0.6758855", "0.6756636", "0.6754412", "0.6751842", "0.6747439", "0.6744991", "0.67441815", "0.6743506", "0.67400324", "0.6739403", "0.6738356", "0.6738189", "0.6731425", "0.6730627", "0.67293024", "0.6726232", "0.67261064", "0.67192256", "0.6716676", "0.6716229", "0.671442", "0.6713091", "0.6702467", "0.66990495", "0.66913867", "0.6689953", "0.66861963", "0.66840357", "0.66826946", "0.6681548", "0.6680455", "0.6676407", "0.6675645", "0.6672465", "0.66722375", "0.66722375", "0.66722375", "0.66722375", "0.66722375" ]
0.67912513
51
Register any application services.
public function register() { $this->registeringDomain(); $this->registerMorphMaps(); $this->registerResponsables(); $this->registeredDomain(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register()\n {\n $this->registerServices();\n }", "public function register()\n {\n $this->registerAssets();\n $this->registerServices();\n }", "public function register()\n\t{\n\n $this->registerUserService();\n $this->registerCountryService();\n $this->registerMetaService();\n $this->registerLabelService();\n $this->registerTypeService();\n $this->registerGroupeService();\n $this->registerActiviteService();\n $this->registerRiiinglinkService();\n $this->registerInviteService();\n $this->registerTagService();\n $this->registerAuthService();\n $this->registerChangeService();\n $this->registerRevisionService();\n $this->registerUploadService();\n //$this->registerTransformerService();\n }", "public function register()\n { \n // User Repository\n $this->app->bind('App\\Contracts\\Repository\\User', 'App\\Repositories\\User');\n \n // JWT Token Repository\n $this->app->bind('App\\Contracts\\Repository\\JSONWebToken', 'App\\Repositories\\JSONWebToken');\n \n $this->registerClearSettleApiLogin();\n \n $this->registerClearSettleApiClients();\n \n \n }", "public function register()\n {\n $this->registerRequestHandler();\n $this->registerAuthorizationService();\n $this->registerServices();\n }", "public function register()\n {\n $this->app->bind(\n PegawaiServiceContract::class,\n PegawaiService::class \n );\n\n $this->app->bind(\n RiwayatPendidikanServiceContract::class,\n RiwayatPendidikanService::class \n );\n\n $this->app->bind(\n ProductionHouseServiceContract::class,\n ProductionHouseService::class\n );\n\n $this->app->bind(\n MovieServiceContract::class,\n MovieService::class\n );\n\n $this->app->bind(\n PangkatServiceContract::class,\n PangkatService::class \n );\n\n }", "public function register()\n {\n // $this->app->bind('AuthService', AuthService::class);\n }", "public function register()\n {\n $this->registerServiceProviders();\n $this->registerSettingsService();\n $this->registerHelpers();\n }", "public function register()\n {\n $this->registerAccountService();\n\n $this->registerCurrentAccount();\n\n //$this->registerMenuService();\n\n //$this->registerReplyService();\n }", "public function register()\n {\n $this->registerRepositories();\n }", "public function register()\n {\n $this->registerFacades();\n $this->registerRespository();\n }", "public function register()\n {\n $this->app->bind('App\\Services\\UserService');\n $this->app->bind('App\\Services\\PostService');\n $this->app->bind('App\\Services\\MyPickService');\n $this->app->bind('App\\Services\\FacebookService');\n $this->app->bind('App\\Services\\LikeService');\n }", "public function register()\n {\n // service 由各个应用在 AppServiceProvider 单独绑定对应实现\n }", "public function register()\n {\n //\n if ($this->app->environment() !== 'production') {\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n }\n\n\n\n\n $this->app->register(ResponseMacroServiceProvider::class);\n $this->app->register(TwitterServiceProvider::class);\n }", "public function register()\n {\n $this->registerGraphQL();\n\n $this->registerConsole();\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n\n $this->registerCommand();\n $this->registerSchedule();\n $this->registerDev();\n\n }", "public function register()\n {\n $this->mergeConfigFrom(\n __DIR__.'/../config/telescope-error-service-client.php', 'telescope-error-service-client'\n );\n\n $this->registerStorageDriver();\n\n $this->commands([\n Console\\InstallCommand::class,\n Console\\PublishCommand::class,\n ]);\n }", "public function register()\n\t{\n\t\t$this->registerPasswordBroker();\n\n\t\t$this->registerTokenRepository();\n\t}", "public function register()\n {\n $this->registerConfig();\n\n $this->app->register('Arcanedev\\\\LogViewer\\\\Providers\\\\UtilitiesServiceProvider');\n $this->registerLogViewer();\n $this->app->register('Arcanedev\\\\LogViewer\\\\Providers\\\\CommandsServiceProvider');\n }", "public function register() {\n $this->registerProviders();\n $this->registerFacades();\n }", "public function register()\n {\n // $this->app->make('CheckStructureService');\n }", "public function register()\n\t{\n\t\t$this->app->bind(\n\t\t\t'Illuminate\\Contracts\\Auth\\Registrar',\n\t\t\t'APIcoLAB\\Services\\Registrar'\n\t\t);\n\n $this->app->bind(\n 'APIcoLAB\\Repositories\\Flight\\FlightRepository',\n 'APIcoLAB\\Repositories\\Flight\\SkyScannerFlightRepository'\n );\n\n $this->app->bind(\n 'APIcoLAB\\Repositories\\Place\\PlaceRepository',\n 'APIcoLAB\\Repositories\\Place\\SkyScannerPlaceRepository'\n );\n\t}", "public function register()\n {\n $this->app->register(\\Maatwebsite\\Excel\\ExcelServiceProvider::class);\n $this->app->register(\\Intervention\\Image\\ImageServiceProvider::class);\n $this->app->register(\\Rap2hpoutre\\LaravelLogViewer\\LaravelLogViewerServiceProvider::class);\n $this->app->register(\\Yajra\\Datatables\\DatatablesServiceProvider::class);\n $this->app->register(\\Yajra\\Datatables\\ButtonsServiceProvider::class);\n\n $loader = null;\n if (class_exists('Illuminate\\Foundation\\AliasLoader')) {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n }\n\n // Facades\n if ($loader != null) {\n $loader->alias('Image', \\Intervention\\Image\\Facades\\Image::class);\n $loader->alias('Excel', \\Maatwebsite\\Excel\\Facades\\Excel::class);\n\n }\n\n if (app()->environment() != 'production') {\n // Service Providers\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n $this->app->register(\\Barryvdh\\Debugbar\\ServiceProvider::class);\n\n // Facades\n if ($loader != null) {\n $loader->alias('Debugbar', \\Barryvdh\\Debugbar\\Facade::class);\n }\n }\n\n if ($this->app->environment('local', 'testing')) {\n $this->app->register(\\Laravel\\Dusk\\DuskServiceProvider::class);\n }\n }", "public function register()\n {\n $this->registerInertia();\n $this->registerLengthAwarePaginator();\n }", "public function register()\n {\n $this->registerFlareFacade();\n $this->registerServiceProviders();\n $this->registerBindings();\n }", "public function register()\n {\n $this->app->bind(\n 'Toyopecas\\Repositories\\TopoRepository',\n 'Toyopecas\\Repositories\\TopoRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Toyopecas\\Repositories\\ServicesRepository',\n 'Toyopecas\\Repositories\\ServicesRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Toyopecas\\Repositories\\SobreRepository',\n 'Toyopecas\\Repositories\\SobreRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Toyopecas\\Repositories\\ProdutosRepository',\n 'Toyopecas\\Repositories\\ProdutosRepositoryEloquent'\n );\n }", "public function register()\r\n {\r\n Passport::ignoreMigrations();\r\n\r\n $this->app->singleton(\r\n CityRepositoryInterface::class,\r\n CityRepository::class\r\n );\r\n\r\n $this->app->singleton(\r\n BarangayRepositoryInterface::class,\r\n BarangayRepository::class\r\n );\r\n }", "public function register()\n {\n $this->registerRepositories();\n\n $this->pushMiddleware();\n }", "public function register()\r\n {\r\n $this->mergeConfigFrom(__DIR__ . '/../config/laravel-base.php', 'laravel-base');\r\n\r\n $this->app->bind(UuidGenerator::class, UuidGeneratorService::class);\r\n\r\n }", "public function register()\n {\n\n $this->app->register(RepositoryServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind(\n 'Uhmane\\Repositories\\ContatosRepository', \n 'Uhmane\\Repositories\\ContatosRepositoryEloquent'\n );\n }", "public function register()\r\n {\r\n $this->app->bind(\r\n ViberServiceInterface::class,\r\n ViberService::class\r\n );\r\n\r\n $this->app->bind(\r\n ApplicantServiceInterface::class,\r\n ApplicantService::class\r\n );\r\n }", "public function register()\n {\n $this->app->register('ProAI\\Datamapper\\Providers\\MetadataServiceProvider');\n\n $this->app->register('ProAI\\Datamapper\\Presenter\\Providers\\MetadataServiceProvider');\n\n $this->registerScanner();\n\n $this->registerCommands();\n }", "public function register()\n {\n $this->app->bind(\n 'Larafolio\\Http\\HttpValidator\\HttpValidator',\n 'Larafolio\\Http\\HttpValidator\\CurlValidator'\n );\n\n $this->app->register(ImageServiceProvider::class);\n }", "public function register()\n {\n // Register all repositories\n foreach ($this->repositories as $repository) {\n $this->app->bind(\"App\\Repository\\Contracts\\I{$repository}\",\n \"App\\Repository\\Repositories\\\\{$repository}\");\n }\n\n // Register all services\n foreach ($this->services as $service) {\n $this->app->bind(\"App\\Service\\Contracts\\I{$service}\", \n \"App\\Service\\Modules\\\\{$service}\");\n }\n }", "public function register()\n {\n $this->registerAdapterFactory();\n $this->registerDigitalOceanFactory();\n $this->registerManager();\n $this->registerBindings();\n }", "public function register()\n {\n // Only Environment local\n if ($this->app->environment() !== 'production') {\n foreach ($this->services as $serviceClass) {\n $this->registerClass($serviceClass);\n }\n }\n\n // Register Aliases\n $this->registerAliases();\n }", "public function register()\n {\n $this->app->bind(\n 'App\\Contracts\\UsersInterface',\n 'App\\Services\\UsersService'\n );\n $this->app->bind(\n 'App\\Contracts\\CallsInterface',\n 'App\\Services\\CallsService'\n );\n $this->app->bind(\n 'App\\Contracts\\ContactsInterface',\n 'App\\Services\\ContactsService'\n );\n $this->app->bind(\n 'App\\Contracts\\EmailsInterface',\n 'App\\Services\\EmailsService'\n );\n $this->app->bind(\n 'App\\Contracts\\PhoneNumbersInterface',\n 'App\\Services\\PhoneNumbersService'\n );\n $this->app->bind(\n 'App\\Contracts\\NumbersInterface',\n 'App\\Services\\NumbersService'\n );\n $this->app->bind(\n 'App\\Contracts\\UserNumbersInterface',\n 'App\\Services\\UserNumbersService'\n );\n }", "public function register()\n {\n //\n if (env('APP_DEBUG', false) && $this->app->isLocal()) {\n $this->app->register(\\Laravel\\Telescope\\TelescopeServiceProvider::class);\n $this->app->register(TelescopeServiceProvider::class);\n }\n }", "public function register()\n {\n $this->registerBrowser();\n\n $this->registerViewFinder();\n }", "public function register()\n {\n $this->registerFriendsLog();\n $this->registerNotifications();\n $this->registerAPI();\n $this->registerMailChimpIntegration();\n }", "public function register()\n {\n $this->mergeConfigFrom(__DIR__.'/../config/awesio-auth.php', 'awesio-auth');\n\n $this->app->singleton(AuthContract::class, Auth::class);\n\n $this->registerRepositories();\n\n $this->registerServices();\n\n $this->registerHelpers();\n }", "public function register()\n {\n $this->registerRepository();\n $this->registerMigrator();\n $this->registerArtisanCommands();\n }", "public function register()\n {\n $this->mergeConfigFrom(\n __DIR__.'/../config/services.php', 'services'\n );\n }", "public function register()\n {\n $this->registerRateLimiting();\n\n $this->registerHttpValidation();\n\n $this->registerHttpParsers();\n\n $this->registerResponseFactory();\n\n $this->registerMiddleware();\n }", "public function register()\n {\n $this->registerConfig();\n $this->registerView();\n $this->registerMessage();\n $this->registerMenu();\n $this->registerOutput();\n $this->registerCommands();\n require __DIR__ . '/Service/ServiceProvider.php';\n require __DIR__ . '/Service/RegisterRepoInterface.php';\n require __DIR__ . '/Service/ErrorHandling.php';\n $this->registerExportDompdf();\n $this->registerExtjs();\n }", "public function register()\n {\n $this->registerRepository();\n $this->registerParser();\n }", "public function register()\n {\n $this->registerOtherProviders()->registerAliases();\n $this->loadViewsFrom(__DIR__.'/../../resources/views', 'jarvisPlatform');\n $this->app->bind('jarvis.auth.provider', AppAuthenticationProvider::class);\n $this->loadRoutes();\n }", "public function register()\n {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n\n $loader->alias('Laratrust', 'Laratrust\\LaratrustFacade');\n $loader->alias('Form', 'Collective\\Html\\FormFacade');\n $loader->alias('Html', 'Collective\\Html\\HtmlFacade');\n $loader->alias('Markdown', 'BrianFaust\\Parsedown\\Facades\\Parsedown');\n\n $this->app->register('Baum\\Providers\\BaumServiceProvider');\n $this->app->register('BrianFaust\\Parsedown\\ServiceProvider');\n $this->app->register('Collective\\Html\\HtmlServiceProvider');\n $this->app->register('Laravel\\Scout\\ScoutServiceProvider');\n $this->app->register('Laratrust\\LaratrustServiceProvider');\n\n $this->app->register('Christhompsontldr\\Laraboard\\Providers\\AuthServiceProvider');\n $this->app->register('Christhompsontldr\\Laraboard\\Providers\\EventServiceProvider');\n $this->app->register('Christhompsontldr\\Laraboard\\Providers\\ViewServiceProvider');\n\n $this->registerCommands();\n }", "public function register()\n {\n $this->registerGuard();\n $this->registerBladeDirectives();\n }", "public function register()\n {\n $this->registerConfig();\n\n $this->app->register(Providers\\ManagerServiceProvider::class);\n $this->app->register(Providers\\ValidationServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind(ReviewService::class, function ($app) {\n return new ReviewService();\n });\n }", "public function register()\n {\n $this->app->bind(\n Services\\UserService::class,\n Services\\Implementations\\UserServiceImplementation::class\n );\n $this->app->bind(\n Services\\FamilyCardService::class,\n Services\\Implementations\\FamilyCardServiceImplementation::class\n );\n }", "public function register()\n {\n // register its dependencies\n $this->app->register(\\Cviebrock\\EloquentSluggable\\ServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind('gameService', 'App\\Service\\GameService');\n }", "public function register()\n {\n $this->app->bind(VehicleRepository::class, GuzzleVehicleRepository::class);\n }", "public function register()\n {\n $this->app->bindShared(ElasticsearchNedvizhimostsObserver::class, function($app){\n return new ElasticsearchNedvizhimostsObserver(new Client());\n });\n\n // $this->app->bindShared(ElasticsearchNedvizhimostsObserver::class, function()\n // {\n // return new ElasticsearchNedvizhimostsObserver(new Client());\n // });\n }", "public function register()\n {\n // Register the app\n $this->registerApp();\n\n // Register Commands\n $this->registerCommands();\n }", "public function register()\n {\n $this->registerGeography();\n\n $this->registerCommands();\n\n $this->mergeConfig();\n\n $this->countriesCache();\n }", "public function register()\n {\n $this->app->bind(CertificationService::class, function($app){\n return new CertificationService();\n });\n }", "public function register()\n\t{\n\t\t$this->app->bind(\n\t\t\t'Illuminate\\Contracts\\Auth\\Registrar',\n\t\t\t'App\\Services\\Registrar'\n\t\t);\n \n $this->app->bind(\"App\\\\Services\\\\ILoginService\",\"App\\\\Services\\\\LoginService\");\n \n $this->app->bind(\"App\\\\Repositories\\\\IItemRepository\",\"App\\\\Repositories\\\\ItemRepository\");\n $this->app->bind(\"App\\\\Repositories\\\\IOutletRepository\",\"App\\\\Repositories\\\\OutletRepository\");\n $this->app->bind(\"App\\\\Repositories\\\\IInventoryRepository\",\"App\\\\Repositories\\\\InventoryRepository\");\n\t}", "public function register()\n {\n $this->registerRollbar();\n }", "public function register()\n {\n $this->app->bind('activity', function () {\n return new ActivityService(\n $this->app->make(Activity::class),\n $this->app->make(PermissionService::class)\n );\n });\n\n $this->app->bind('views', function () {\n return new ViewService(\n $this->app->make(View::class),\n $this->app->make(PermissionService::class)\n );\n });\n\n $this->app->bind('setting', function () {\n return new SettingService(\n $this->app->make(Setting::class),\n $this->app->make(Repository::class)\n );\n });\n\n $this->app->bind('images', function () {\n return new ImageService(\n $this->app->make(Image::class),\n $this->app->make(ImageManager::class),\n $this->app->make(Factory::class),\n $this->app->make(Repository::class)\n );\n });\n }", "public function register()\n {\n App::bind('CreateTagService', function($app) {\n return new CreateTagService;\n });\n\n App::bind('UpdateTagService', function($app) {\n return new UpdateTagService;\n });\n }", "public function register()\n {\n $this->registerDomainLocalization();\n $this->registerDomainLocaleFilter();\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(MailConfigServiceProvider::class);\n }", "public function register()\n {\n $this->registerUserProvider();\n $this->registerGroupProvider();\n $this->registerNeo();\n\n $this->registerCommands();\n\n $this->app->booting(function()\n {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n $loader->alias('Neo', 'Wetcat\\Neo\\Facades\\Neo');\n });\n }", "public function register()\n {\n //\n $this->app->bind(\n 'App\\Repositories\\Interfaces\\CompanyInterface', \n 'App\\Repositories\\CompanyRepo'\n );\n $this->app->bind(\n 'App\\Repositories\\Interfaces\\UtilityInterface', \n 'App\\Repositories\\UtilityRepo'\n );\n }", "public function register()\n {\n $this->registerPayment();\n\n $this->app->alias('image', 'App\\Framework\\Image\\ImageService');\n }", "public function register()\n {\n $this->app->bind(AttributeServiceInterface::class,AttributeService::class);\n $this->app->bind(ProductServiceIntarface::class,ProductService::class);\n\n\n }", "public function register()\n {\n App::bind('App\\Repositories\\UserRepositoryInterface','App\\Repositories\\UserRepository');\n App::bind('App\\Repositories\\AnimalRepositoryInterface','App\\Repositories\\AnimalRepository');\n App::bind('App\\Repositories\\DonationTypeRepositoryInterface','App\\Repositories\\DonationTypeRepository');\n App::bind('App\\Repositories\\NewsAniRepositoryInterface','App\\Repositories\\NewsAniRepository');\n App::bind('App\\Repositories\\DonationRepositoryInterface','App\\Repositories\\DonationRepository');\n App::bind('App\\Repositories\\ProductRepositoryInterface','App\\Repositories\\ProductRepository');\n App::bind('App\\Repositories\\CategoryRepositoryInterface','App\\Repositories\\CategoryRepository');\n App::bind('App\\Repositories\\TransferMoneyRepositoryInterface','App\\Repositories\\TransferMoneyRepository');\n App::bind('App\\Repositories\\ShippingRepositoryInterface','App\\Repositories\\ShippingRepository');\n App::bind('App\\Repositories\\ReserveProductRepositoryInterface','App\\Repositories\\ReserveProductRepository');\n App::bind('App\\Repositories\\Product_reserveRepositoryInterface','App\\Repositories\\Product_reserveRepository');\n App::bind('App\\Repositories\\Ordering_productRepositoryInterface','App\\Repositories\\Ordering_productRepository');\n App::bind('App\\Repositories\\OrderingRepositoryInterface','App\\Repositories\\OrderingRepository');\n App::bind('App\\Repositories\\UserUpdateSlipRepositoryInterface','App\\Repositories\\UserUpdateSlipRepository');\n }", "public function register()\n {\n if ($this->app->runningInConsole()) {\n $this->registerPublishing();\n }\n }", "public function register()\n {\n $this->app->bind(HttpClient::class, function ($app) {\n return new HttpClient();\n });\n\n $this->app->bind(SeasonService::class, function ($app) {\n return new SeasonService($app->make(HttpClient::class));\n });\n\n $this->app->bind(MatchListingController::class, function ($app) {\n return new MatchListingController($app->make(SeasonService::class));\n });\n\n }", "public function register()\n {\n $this->setupConfig();\n\n $this->bindServices();\n }", "public function register()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n Console\\MakeEndpointCommand::class,\n Console\\MakeControllerCommand::class,\n Console\\MakeRepositoryCommand::class,\n Console\\MakeTransformerCommand::class,\n Console\\MakeModelCommand::class,\n ]);\n }\n\n $this->registerFractal();\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(AuthServiceProvider::class);\n }", "public function register()\n {\n\n $config = $this->app['config']['cors'];\n\n $this->app->bind('Yocome\\Cors\\CorsService', function() use ($config){\n return new CorsService($config);\n });\n\n }", "public function register()\n {\n // Bind facade\n\n $this->registerRepositoryBibdings();\n $this->registerFacades();\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(\\Laravel\\Socialite\\SocialiteServiceProvider::class);\n }", "public function register()\n {\n\n\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\UserRepository',\n 'Onlinecorrection\\Repositories\\UserRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\ClientRepository',\n 'Onlinecorrection\\Repositories\\ClientRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\ProjectRepository',\n 'Onlinecorrection\\Repositories\\ProjectRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\DocumentRepository',\n 'Onlinecorrection\\Repositories\\DocumentRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\OrderRepository',\n 'Onlinecorrection\\Repositories\\OrderRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\OrderItemRepository',\n 'Onlinecorrection\\Repositories\\OrderItemRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\DocumentImageRepository',\n 'Onlinecorrection\\Repositories\\DocumentImageRepositoryEloquent'\n );\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\PackageRepository',\n 'Onlinecorrection\\Repositories\\PackageRepositoryEloquent'\n );\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\StatusRepository',\n 'Onlinecorrection\\Repositories\\StatusRepositoryEloquent'\n );\n\n }", "public function register()\n {\n $this->registerConfig();\n\n $this->registerDataStore();\n\n $this->registerStorageFactory();\n\n $this->registerStorageManager();\n\n $this->registerSimplePhoto();\n }", "public function register()\n {\n // Default configuration file\n $this->mergeConfigFrom(\n __DIR__.'/Config/auzo_tools.php', 'auzoTools'\n );\n\n $this->registerModelBindings();\n $this->registerFacadesAliases();\n }", "public function register()\n {\n $this->app->bind(\\Cookiesoft\\Repositories\\CategoryRepository::class, \\Cookiesoft\\Repositories\\CategoryRepositoryEloquent::class);\n $this->app->bind(\\Cookiesoft\\Repositories\\BillpayRepository::class, \\Cookiesoft\\Repositories\\BillpayRepositoryEloquent::class);\n $this->app->bind(\\Cookiesoft\\Repositories\\UserRepository::class, \\Cookiesoft\\Repositories\\UserRepositoryEloquent::class);\n //:end-bindings:\n }", "public function register()\n {\n $this->app->singleton(ThirdPartyAuthService::class, function ($app) {\n return new ThirdPartyAuthService(\n config('settings.authentication_services'),\n $app['Laravel\\Socialite\\Contracts\\Factory'],\n $app['Illuminate\\Contracts\\Auth\\Factory']\n );\n });\n\n $this->app->singleton(ImageValidator::class, function ($app) {\n return new ImageValidator(\n config('settings.image.max_filesize'),\n config('settings.image.mime_types'),\n $app['Intervention\\Image\\ImageManager']\n );\n });\n\n $this->app->singleton(ImageService::class, function ($app) {\n return new ImageService(\n config('settings.image.max_width'),\n config('settings.image.max_height'),\n config('settings.image.folder')\n );\n });\n\n $this->app->singleton(RandomWordService::class, function ($app) {\n return new RandomWordService(\n $app['App\\Repositories\\WordRepository'],\n $app['Illuminate\\Session\\SessionManager'],\n config('settings.number_of_words_to_remember')\n );\n });\n\n $this->app->singleton(WordRepository::class, function ($app) {\n return new WordRepository(config('settings.min_number_of_chars_per_one_mistake_in_search'));\n });\n\n $this->app->singleton(CheckAnswerService::class, function ($app) {\n return new CheckAnswerService(\n $app['Illuminate\\Session\\SessionManager'],\n config('settings.min_number_of_chars_per_one_mistake')\n );\n });\n\n if ($this->app->environment() !== 'production') {\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n }\n }", "public function register()\n {\n $this->registerJWT();\n $this->registerJWSProxy();\n $this->registerJWTAlgoFactory();\n $this->registerPayload();\n $this->registerPayloadValidator();\n $this->registerPayloadUtilities();\n\n // use this if your package has a config file\n // config([\n // 'config/JWT.php',\n // ]);\n }", "public function register()\n {\n $this->registerManager();\n $this->registerConnection();\n $this->registerWorker();\n $this->registerListener();\n $this->registerFailedJobServices();\n $this->registerOpisSecurityKey();\n }", "public function register()\n {\n $this->app->register(RouterServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind('App\\Services\\TripService.php', function ($app) {\n return new TripService();\n });\n }", "public function register()\n {\n $this->registerUserComponent();\n $this->registerLocationComponent();\n\n }", "public function register()\n {\n $this->app->bind(\n \\App\\Services\\UserCertificate\\IUserCertificateService::class,\n \\App\\Services\\UserCertificate\\UserCertificateService::class\n );\n }", "public function register()\n {\n $this->app->bind(FacebookMarketingContract::class,FacebookMarketingService::class);\n }", "public function register()\n {\n /**\n * Register additional service\n * providers if they exist.\n */\n foreach ($this->providers as $provider) {\n if (class_exists($provider)) {\n $this->app->register($provider);\n }\n }\n }", "public function register()\n {\n $this->app->singleton('composer', function($app)\n {\n return new Composer($app['files'], $app['path.base']);\n });\n\n $this->app->singleton('forge', function($app)\n {\n return new Forge($app);\n });\n\n // Register the additional service providers.\n $this->app->register('Nova\\Console\\ScheduleServiceProvider');\n $this->app->register('Nova\\Queue\\ConsoleServiceProvider');\n }", "public function register()\n {\n\n\n\n $this->mergeConfigFrom(__DIR__ . '/../config/counter.php', 'counter');\n\n $this->app->register(RouteServiceProvider::class);\n\n\n }", "public function register()\r\n {\r\n $this->mergeConfigFrom(__DIR__.'/../config/colissimo.php', 'colissimo');\r\n $this->mergeConfigFrom(__DIR__.'/../config/rules.php', 'colissimo.rules');\r\n $this->mergeConfigFrom(__DIR__.'/../config/prices.php', 'colissimo.prices');\r\n $this->mergeConfigFrom(__DIR__.'/../config/zones.php', 'colissimo.zones');\r\n $this->mergeConfigFrom(__DIR__.'/../config/insurances.php', 'colissimo.insurances');\r\n $this->mergeConfigFrom(__DIR__.'/../config/supplements.php', 'colissimo.supplements');\r\n // Register the service the package provides.\r\n $this->app->singleton('colissimo', function ($app) {\r\n return new Colissimo;\r\n });\r\n }", "public function register(){\n $this->registerDependencies();\n $this->registerAlias();\n $this->registerServiceCommands();\n }", "public function register()\n {\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyService::class,\n \\App\\Services\\Survey\\SurveyService::class\n );\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyQuestionService::class,\n \\App\\Services\\Survey\\SurveyQuestionService::class\n );\n\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyAttemptService::class,\n \\App\\Services\\Survey\\SurveyAttemptService::class\n );\n\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyAttemptDataService::class,\n \\App\\Services\\Survey\\SurveyAttemptDataService::class\n );\n }", "public function register()\n {\n $this->mergeConfigFrom(\n __DIR__ . '/../config/atlas.php', 'atlas'\n );\n \n $this->app->singleton(CoreContract::class, Core::class);\n \n $this->registerFacades([\n 'Atlas' => 'Atlas\\Facades\\Atlas',\n ]);\n }", "public function register()\n {\n $this->app->bind(TelescopeRouteServiceContract::class, TelescopeRouteService::class);\n }", "public function register()\n {\n $this->registerRepositoryBindings();\n\n $this->registerInterfaceBindings();\n\n $this->registerAuthorizationServer();\n\n $this->registerResourceServer();\n\n $this->registerFilterBindings();\n\n $this->registerCommands();\n }", "public function register()\n {\n $this->mergeConfigFrom(__DIR__.'/../config/faithgen-events.php', 'faithgen-events');\n\n $this->app->singleton(EventsService::class);\n $this->app->singleton(GuestService::class);\n }", "public function register()\n {\n $this->registerAliases();\n $this->registerFormBuilder();\n\n // Register package commands\n $this->commands([\n 'CoreDbCommand',\n 'CoreSetupCommand',\n 'CoreSeedCommand',\n 'EventEndCommand',\n 'ArchiveMaxAttempts',\n 'CronCommand',\n 'ExpireInstructors',\n 'SetTestLock',\n 'StudentArchiveTraining',\n 'TestBuildCommand',\n 'TestPublishCommand',\n ]);\n\n // Merge package config with one in outer app \n // the app-level config will override the base package config\n $this->mergeConfigFrom(\n __DIR__.'/../config/core.php', 'core'\n );\n\n // Bind our 'Flash' class\n $this->app->bindShared('flash', function () {\n return $this->app->make('Hdmaster\\Core\\Notifications\\FlashNotifier');\n });\n\n // Register package dependencies\n $this->app->register('Collective\\Html\\HtmlServiceProvider');\n $this->app->register('Bootstrapper\\BootstrapperL5ServiceProvider');\n $this->app->register('Codesleeve\\LaravelStapler\\Providers\\L5ServiceProvider');\n $this->app->register('PragmaRX\\ZipCode\\Vendor\\Laravel\\ServiceProvider');\n $this->app->register('Rap2hpoutre\\LaravelLogViewer\\LaravelLogViewerServiceProvider');\n\n $this->app->register('Zizaco\\Confide\\ServiceProvider');\n $this->app->register('Zizaco\\Entrust\\EntrustServiceProvider');\n }" ]
[ "0.7879658", "0.7600202", "0.74930716", "0.73852855", "0.736794", "0.7306089", "0.7291359", "0.72896826", "0.72802424", "0.7268026", "0.7267702", "0.72658145", "0.7249053", "0.72171587", "0.7208486", "0.7198799", "0.7196415", "0.719478", "0.7176513", "0.7176227", "0.7164647", "0.71484524", "0.71337837", "0.7129424", "0.71231985", "0.7120174", "0.7103653", "0.71020955", "0.70977163", "0.7094701", "0.7092148", "0.70914364", "0.7088618", "0.7087278", "0.70827085", "0.70756096", "0.7075115", "0.70741326", "0.7071857", "0.707093", "0.7070619", "0.7067406", "0.7066438", "0.7061766", "0.70562875", "0.7051525", "0.7049684", "0.70467263", "0.7043264", "0.7043229", "0.70429426", "0.7042174", "0.7038729", "0.70384216", "0.70348704", "0.7034105", "0.70324445", "0.70282733", "0.7025024", "0.702349", "0.7023382", "0.702262", "0.7022583", "0.7022161", "0.702139", "0.7021084", "0.7020801", "0.7019928", "0.70180106", "0.7017351", "0.7011482", "0.7008627", "0.7007786", "0.70065045", "0.7006424", "0.70060986", "0.69992065", "0.699874", "0.69980377", "0.69980335", "0.6997871", "0.6996457", "0.69961494", "0.6994749", "0.6991596", "0.699025", "0.6988414", "0.6987274", "0.69865865", "0.69862866", "0.69848233", "0.6978736", "0.69779474", "0.6977697", "0.6976002", "0.69734764", "0.6972392", "0.69721776", "0.6970663", "0.6968296", "0.696758" ]
0.0
-1
Allow a domain service provider to specify additional actions to run before the boot process starts.
protected function bootingDomain() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function bootedDomain()\n {\n }", "protected function _before(){\n $this->startApplication();\n }", "protected function _before() {\n\t\tparent::_before ();\n\t\t$this->_startServices ( true );\n\t\t$this->startup = new Startup ();\n\t\tEventsManager::start ();\n\t\tTranslatorManager::start ( 'fr_FR', 'en' );\n\t\t$this->_initRequest ( 'RestApiController', 'GET' );\n\t}", "public function before_run(){}", "public function before_run() {}", "public function beforeStart()\n {\n }", "public function beforeStart () {\n }", "public function _before_init(){}", "public function beforeSetup()\n {\n }", "private function setup_actions() {\r\n\t\tadd_action( 'init', array( $this, 'is_edd_activated' ), 1 );\r\n\r\n\t\tadd_filter( 'template_include', array( $this, 'template_loader' ) );\r\n\t\tadd_action( 'init', array( $this, 'endpoints' ) );\r\n\t\t\r\n\t\tdo_action( 'atcf_setup_actions' );\r\n\r\n\t\t$this->load_textdomain();\r\n\t}", "public function beforeInstall()\n\t{}", "protected function onBoot() {}", "abstract protected static function boot();", "abstract public function boot();", "abstract public function boot();", "abstract public function boot();", "abstract public function boot();", "public static function boot() {\n $controller = Router::getController();\n\n // todo: perhaps transfer here some server, get, post and cookie parameters as context?\n if ($controller instanceof Controller) $controller->run(Tools::get('action','string',''));\n }", "protected abstract function before();", "protected function before(){}", "public function boot()\n {\n Event::listen(ServingNova::class, function () {\n Nova::script('awesome-nova-tool-actions', dirname(__DIR__) . '/dist/js/actions.js');\n });\n }", "public function boot() {\n\t\t// no-op\n\t}", "public function boot() : void;", "public function boot()\n {\n // no-op\n }", "protected function boot()\n {\n //Nothing to do here, but you can override this function in child classes.\n }", "function before_enable() { }", "public function boot() {\n\n\t\tadd_action( 'init', array( $this, 'hook_init' ) );\n\n\t}", "public static function boot() \n\t{\n parent::boot();\n \n // AuthorizedEmployee::observe(new AuthorizedEmployeeObserver());\n }", "public function boot() {\n\t\tparent::boot();\n\n\t\t$this->allow_pass_through_requests();\n\t}", "protected static function booted()\n {\n //\n }", "protected static function booted()\n {\n //\n }", "private function booted()\n {\n }", "public function boot()\n {\n $this->bootingDomain();\n\n $this->registerCommands();\n $this->registerListeners();\n $this->registerPolicies();\n $this->registerRoutes();\n $this->registerBladeComponents();\n $this->registerLivewireComponents();\n $this->registerSpotlightCommands();\n\n $this->bootedDomain();\n }", "public function boot(): void\n {\n //\n }", "public function boot(): void\n {\n //\n }", "public function boot(): void\n {\n //\n }", "public function boot(): void\n {\n //\n }", "abstract protected function before();", "public function bootstrapSystem() {}", "public function bootstrapSystem() {}", "public function boot() {\r\n\t\t$hosting_service = HostResolver::get_host_service();\r\n\r\n\t\tif ( ! empty( $hosting_service ) ) {\r\n\t\t\t$this->provides[] = $hosting_service;\r\n\t\t}\r\n\t}", "public function boot();", "public function boot();", "public function boot();", "public function boot();", "public function setup_actions() {}", "public function hooks() {\n $service = new Service($this->license_base);\n add_action('admin_menu', array($this, 'register_license_page'));\n add_action('admin_enqueue_scripts', array($this, 'admin_scripts'), 10);\n // Validate service\n add_action('wp_ajax_validate_service', array($service, 'validate_service'), 10);\n }", "public function boot()\n {}", "public function boot()\n {}", "abstract function before();", "public static function boot()\n {\n $hooks = config('hooks');\n $actions = $hooks['actions'];\n $filters = $hooks['filters'];\n\n foreach ($actions as $action) {\n add_action($action[0], $action[1]);\n }\n\n foreach ($filters as $event => $callback) {\n add_filter($event, $callback);\n }\n }", "public function boot(){}", "public function boot()\n\t{\n\t\t\n\t}", "public function boot()\n\t{\n\t\t\n\t}", "protected function beforeProcess() {\n }", "public function boot():void\n {\n //\n }", "public function boot(): void\n {\n\n }", "public static function boot();", "public function boot()\n\t{\t\n\t}", "public static function boot()\n {\n parent::boot();\n self::observe(DistributionTargetObserver::class);\n }", "protected function _beforeInit() {\n\t}", "public function boot()\n {\n //Send Menu to wordpress actions hook\n if (is_admin()) {\n $this->app['wp.admin.menu']->send();\n }\n }", "public function runAtBoot() {\n\t\tLogger::getRootLogger()->info('Init IPSec');\n\t\tif((string)$this->data['enable'] == 'true'){\n\t\t\t$configured = $this->configure();\n\t\t\tif($configured){\n\t\t\t\t$this->start();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tLogger::getRootLogger()->info('IPSec not started');\n\t\t\t}\n\t\t}\n\t}", "protected function setStartupModule() {}", "public function boot()\n {\n //\n Item :: observe (ItemObserver :: class); \n }", "protected function _before() {\n\t\tparent::_before ();\n\t\t$this->_startServices ();\n\t\tStartup::setConfig ( $this->config );\n\t\t$adminController = new Admin ();\n\t\tStartup::injectDependencies ( $adminController );\n\t\t$this->scaffoldController = new AdminScaffoldController ( $adminController, $adminController->jquery );\n\t}", "public function boot(): void\n {\n }", "public function boot(): void\n {\n }", "protected static function booting()\n {\n //\n }", "public function boot()\n {\n // Nothing to boot\n }", "protected static function boot()\n {\n }", "public function init()\n {\n $this->addAction('doStuff', 'performThingA');\n $this->addAction('doMoreStuff', 'performThingB');\n }", "public function preStartPageHook() {}", "public function preStartPageHook() {}", "public function boot()\r\n\t{\r\n\t\t\r\n\t}", "public function boot(): void;", "public function boot()\n\t{\n\n\t}", "public function boot()\n\t{\n\n\t}", "public function boot()\n\t{\n\n\t}", "protected static function boot()\n {\n static::addGlobalScope(new EventScope);\n static::addGlobalScope(new ApprovedEventScope);\n parent::boot();\n }", "public function before() {}", "public function before() {}", "protected function beforeAction () {\n\t}", "public function onAfterInitialise()\n\t{\n\t\t$this->call(array('System\\\\Command', 'execute'));\n\n\t\tif ($this->params->get('tranAlias', 1))\n\t\t{\n\t\t\t$this->call(array('Article\\\\Translate', 'translateAlias'), $this);\n\t\t}\n\n\t\tif ($this->params->get('languageOrphan', 0))\n\t\t{\n\t\t\t$this->call(array('System\\\\Language', 'orphan'));\n\t\t}\n\n\t\t@include $this->includeEvent(__FUNCTION__);\n\t}", "public function startup(): void\n {\n $this->handleOnBootListeners();\n $this->initialize();\n $this->handleOnRunListeners();\n }", "public function startup(): void\n {\n $this->handleOnBootListeners();\n $this->initialize();\n $this->handleOnRunListeners();\n }", "public function _postSetup()\n {\n }", "public static function boot() \n\t{\n parent::boot();\n \n // Career::observe(new CareerObserver());\n }", "public function preOrderDomain()\n {\n throw new Exception('@preOrderDomain is not yet implemented!');\n }", "protected function _before() {\n\t\tparent::_before ();\n\t\tStartup::setConfig ( $this->config );\n\t\t$this->_startCache ();\n\t\t$this->yumlModelsCreator = new YumlModelsCreator ();\n\t}", "function charity_before() {\n do_action('charity_before');\n}", "public function onModuleBoot()\n {\n }", "public function boot(): void\n {\n $this->registerPublishing();\n $this->registerCommands();\n }", "public static function boot()\n {\n parent::boot();\n self::observe(OfficerObserver::class);\n }", "public function boot()\n {\n if (!$this->isEnabled()) return;\n\n parent::boot();\n }", "public function before()\r\n {\r\n \t// Profile the loader\r\n \t\\Profiler::mark('Start of loader\\'s before() function');\r\n \t\\Profiler::mark_memory($this, 'Start of loader\\'s before() function');\r\n \t\r\n // Set the environment\r\n parent::before();\r\n \r\n // Load the config for Segment so we can process analytics data.\r\n \\Config::load('segment', true);\r\n \r\n // Load the config file for event names. Having events names in one place keeps things synchronized.\r\n \\Config::load('analyticsstrings', true);\r\n \r\n // Engine configuration\r\n \\Config::load('engine', true);\r\n\t\t\r\n\t\t// Load the package configuration file.\r\n\t\t\\Config::load('tiers', true);\r\n\t\t\r\n\t\t// Soccket connection configuration\r\n\t\t\\Config::load('socket', true);\r\n \r\n /**\r\n * Ensure that all user language strings are appropriately translated.\r\n * \r\n * @link https://github.com/fuel/core/issues/1860#issuecomment-92022320\r\n */\r\n if (is_string(\\Input::post('language', false))) {\r\n \t\\Environment::set_language(\\Input::post('language', 'en'));\r\n }\r\n \r\n // Load the error strings.\r\n \\Lang::load('errors', true);\r\n }", "public function boot()\n\t{\n\t\t//\n\t}", "public function boot()\n\t{\n\t\t//\n\t}", "public function boot()\n\t{\n\t\t//\n\t}", "public function boot()\n\t{\n\t\t//\n\t}" ]
[ "0.6492616", "0.6054468", "0.6052125", "0.6007984", "0.5992672", "0.593295", "0.5928086", "0.58971274", "0.5858215", "0.5838992", "0.58240974", "0.5816585", "0.58067745", "0.5784869", "0.5784869", "0.5784869", "0.5784869", "0.5751236", "0.5741555", "0.5739451", "0.57261634", "0.5718043", "0.5699377", "0.569867", "0.5689004", "0.5688643", "0.5686877", "0.56841564", "0.5683605", "0.5673542", "0.5673542", "0.56667805", "0.56648123", "0.5644983", "0.5644983", "0.5644983", "0.5644983", "0.5634741", "0.5625037", "0.5624936", "0.5620341", "0.56030756", "0.56030756", "0.56030756", "0.56030756", "0.559951", "0.55914605", "0.5576891", "0.5576891", "0.5574507", "0.55670494", "0.55579334", "0.5556035", "0.5556035", "0.5554073", "0.555102", "0.5544025", "0.55405885", "0.5527165", "0.551916", "0.55171824", "0.5514847", "0.5514706", "0.5513799", "0.55091274", "0.55063325", "0.5499973", "0.5499973", "0.54981136", "0.54939014", "0.5492833", "0.5474662", "0.5469871", "0.5469871", "0.545714", "0.5456821", "0.545509", "0.545509", "0.545509", "0.5451754", "0.544944", "0.544944", "0.5447143", "0.54460984", "0.5445165", "0.5445165", "0.5434773", "0.543317", "0.5428849", "0.5412957", "0.54027057", "0.5395608", "0.5391913", "0.5389817", "0.53864646", "0.5376564", "0.53735036", "0.53735036", "0.53735036", "0.53735036" ]
0.6484385
1
Allow a domain service provider to specify additional actions to run after the boot process runs.
protected function bootedDomain() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function bootingDomain()\n {\n }", "public function boot()\n {\n $this->bootingDomain();\n\n $this->registerCommands();\n $this->registerListeners();\n $this->registerPolicies();\n $this->registerRoutes();\n $this->registerBladeComponents();\n $this->registerLivewireComponents();\n $this->registerSpotlightCommands();\n\n $this->bootedDomain();\n }", "public static function boot() {\n $controller = Router::getController();\n\n // todo: perhaps transfer here some server, get, post and cookie parameters as context?\n if ($controller instanceof Controller) $controller->run(Tools::get('action','string',''));\n }", "public function boot()\n {\n //Send Menu to wordpress actions hook\n if (is_admin()) {\n $this->app['wp.admin.menu']->send();\n }\n }", "public function onAfterInitialise()\n\t{\n\t\t$this->call(array('System\\\\Command', 'execute'));\n\n\t\tif ($this->params->get('tranAlias', 1))\n\t\t{\n\t\t\t$this->call(array('Article\\\\Translate', 'translateAlias'), $this);\n\t\t}\n\n\t\tif ($this->params->get('languageOrphan', 0))\n\t\t{\n\t\t\t$this->call(array('System\\\\Language', 'orphan'));\n\t\t}\n\n\t\t@include $this->includeEvent(__FUNCTION__);\n\t}", "public function boot()\n {\n Event::listen(ServingNova::class, function () {\n Nova::script('awesome-nova-tool-actions', dirname(__DIR__) . '/dist/js/actions.js');\n });\n }", "protected function afterAction() {\n\n }", "public function boot() {\r\n\t\t$hosting_service = HostResolver::get_host_service();\r\n\r\n\t\tif ( ! empty( $hosting_service ) ) {\r\n\t\t\t$this->provides[] = $hosting_service;\r\n\t\t}\r\n\t}", "protected function afterAction () {\n\t}", "public function boot()\n {\n // no-op\n }", "public function boot() {\n\n\t\tadd_action( 'init', array( $this, 'hook_init' ) );\n\n\t}", "protected function onBoot() {}", "public function afterAction() {\n }", "public static function boot()\n {\n $hooks = config('hooks');\n $actions = $hooks['actions'];\n $filters = $hooks['filters'];\n\n foreach ($actions as $action) {\n add_action($action[0], $action[1]);\n }\n\n foreach ($filters as $event => $callback) {\n add_filter($event, $callback);\n }\n }", "public function boot() {\n\t\t// no-op\n\t}", "public function boot() : void;", "public static function boot()\n {\n parent::boot();\n\n static::creating(function (LdapDomain $domain) {\n $domain->token = Str::random(40);\n });\n\n static::deleting(function(LdapDomain $domain) {\n // Delete any scans that have been performed.\n $domain->scans()->delete();\n\n // Delete any LDAP notifiers.\n $domain->notifiers()->each(function (LdapNotifier $notifier) {\n $notifier->delete();\n });\n\n // The domain may have a large amount of objects. We\n // will chunk our results to keep memory usage low\n // and so object deletion events are fired.\n $domain->objects()->chunk(500, function ($objects) {\n /** @var LdapObject $object */\n foreach ($objects as $object) {\n $object->forceDelete();\n }\n });\n });\n }", "public function boot()\n\t{\n\t\t\n\t}", "public function boot()\n\t{\n\t\t\n\t}", "protected function boot()\n {\n //Nothing to do here, but you can override this function in child classes.\n }", "public function boot()\n\t{\t\n\t}", "public function boot(): void\n {\n //\n }", "public function boot(): void\n {\n //\n }", "public function boot(): void\n {\n //\n }", "public function boot(): void\n {\n //\n }", "public function boot(): void\n {\n $this->registerPublishing();\n $this->registerCommands();\n }", "public function boot()\r\n\t{\r\n\t\t\r\n\t}", "public function _postSetup()\n {\n }", "public function boot() {\n\n\t\t$this->registerProviders();\n\t\t$this->bootProviders();\n\t\t$this->registerProxies();\n\t}", "public function boot()\n\t{\n\n\t}", "public function boot()\n\t{\n\n\t}", "public function boot()\n\t{\n\n\t}", "public static function boot() \n\t{\n parent::boot();\n \n // AuthorizedEmployee::observe(new AuthorizedEmployeeObserver());\n }", "public function hooks() {\n $service = new Service($this->license_base);\n add_action('admin_menu', array($this, 'register_license_page'));\n add_action('admin_enqueue_scripts', array($this, 'admin_scripts'), 10);\n // Validate service\n add_action('wp_ajax_validate_service', array($service, 'validate_service'), 10);\n }", "protected static function booted()\n {\n //\n }", "protected static function booted()\n {\n //\n }", "public function boot()\n\t{\n\t\t$ext_translate = new Classes\\Translate();\n\t\t$ext_translate->menu();\n\t}", "public function afterSetup()\n {\n }", "public function boot()\n\t{\n\t\t//\n\t}", "public function boot()\n\t{\n\t\t//\n\t}", "public function boot()\n\t{\n\t\t//\n\t}", "public function boot()\n\t{\n\t\t//\n\t}", "public function boot()\n\t{\n\t\t//\n\t}", "public function boot()\n\t{\n\t\t//\n\t}", "public function boot()\n\t{\n\t\t//\n\t}", "public function boot()\n\t{\n\t\t//\n\t}", "public function boot()\n\t{\n\t\t//\n\t}", "public function boot()\n\t{\n\t\t//\n\t}", "public function boot()\n\t{\n\t\t//\n\t}", "public function boot()\n\t{\n\t\t//\n\t}", "public function boot()\n\t{\n\t\t//\n\t}", "public function boot()\n\t{\n\t\t//\n\t}", "private function booted()\n {\n }", "public function boot() {\n\n\t\t$this->register_cli_commands();\n\n\t\t$this->register_routes();\n\n\t\t$this->apply_sitemap_optimisations();\n\n\t}", "public function boot()\n\t{\n\t\t$this->publishConfig();\n\n\t\t$this->commands($this->commands);\n\n\t\t$facade = 'Cerbero\\Workflow\\Facades\\Workflow';\n\n\t\tAliasLoader::getInstance()->alias('Workflow', $facade);\n\t}", "public function boot()\n {\n $this->commands(\n array_merge(\n $this->routingCommands(),\n $this->packageCommands(),\n $this->databaseCommands(),\n $this->standardCommands(),\n $this->foundationCommands(),\n $this->packageInternalCommands()\n )\n );\n }", "private function setup_actions() {\r\n\t\tadd_action( 'init', array( $this, 'is_edd_activated' ), 1 );\r\n\r\n\t\tadd_filter( 'template_include', array( $this, 'template_loader' ) );\r\n\t\tadd_action( 'init', array( $this, 'endpoints' ) );\r\n\t\t\r\n\t\tdo_action( 'atcf_setup_actions' );\r\n\r\n\t\t$this->load_textdomain();\r\n\t}", "public function boot() {\n\t\tparent::boot();\n\n\t\t$this->allow_pass_through_requests();\n\t}", "abstract public function boot();", "abstract public function boot();", "abstract public function boot();", "abstract public function boot();", "public function boot()\n {\n // Call pblish redources function\n $this->publishResources();\n }", "protected function after(){}", "protected function after(){}", "protected function after(){}", "public function boot(): void\n {\n\n }", "function afterAction()\n {\n }", "public function boot(){}", "abstract public function postConfigure();", "public function boot()\n {}", "public function boot()\n {}", "public function boot()\n {\n //\n Item :: observe (ItemObserver :: class); \n }", "public function after_run() {}", "public function boot()\n {\n // registered and the CMS is booting.\n }", "public function boot() {\n\t\t//\n\t}", "public function boot() {\n\t\t//\n\t}", "public function boot():void\n {\n //\n }", "public static function boot()\n {\n parent::boot();\n\n // Create uid when creating automation.\n static::creating(function ($event) {\n // Create new uid\n $event->createUid();\n\n // Update custom order\n $event->createCustomOrder();\n });\n\n // Create first campaign when auto event created.\n static::created(function ($event) {\n // Create first campaign\n $event->createFirstCampaign();\n });\n\n // when auto event is deleted\n static::deleting(function ($event) {\n // Update auto campaign series\n $next_event = $event->nextEvent;\n if(is_object($next_event)) {\n $next_event->previous_event_id = $event->previous_event_id;\n $next_event->save();\n }\n\n // Delete all campaigns\n $event->campaigns()->delete();\n });\n }", "protected function boot()\n\t{\n\t\tforeach ($this->serviceProviders as $provider)\n\t\t{\n\t\t\t$provider->boot($this);\n\t\t}\n\n\t\t$this->booted = true;\n\t}", "public function boot();", "public function boot();", "public function boot();", "public function boot();", "public function boot()\n {\n if ($this->booted) {\n return;\n }\n\n $this->app->registerConfiguredProvidersInRequest();\n\n $this->fireAppCallbacks($this->bootingCallbacks);\n\n /** array_walk\n * If when a provider booting, it reg some other providers,\n * then the new providers added to $this->serviceProviders\n * then array_walk will loop the new ones and boot them. // pingpong/modules 2.0 use this feature\n */\n array_walk($this->serviceProviders, function ($p) {\n $this->bootProvider($p);\n });\n\n $this->booted = true;\n\n $this->fireAppCallbacks($this->bootedCallbacks);\n }", "public function after_run(){}", "public static function boot()\n {\n parent::boot();\n self::observe(DistributionTargetObserver::class);\n }", "public function boot(): void\n {\n }", "public function boot(): void\n {\n }", "public function postInstallCmd(){\n\n \\Disco\\manage\\Manager::install();\n\n }", "public function boot()\n {\n\t\t//\n }", "abstract protected static function boot();", "public function boot()\n {\n// foreach (get_class_methods(new UserPolicy()) as $method)\n// {\n// $gate->define($method, \"AnimalProject\\\\Modules\\\\User\\\\Policies\\\\UserPolicy@{$method}\");\n// }\n//\n// $gate->policy(User::class, UserPolicy::class);\n }", "public function boot()\n {\n $this->registerPolicies();\n\n Gate::define('actionsThatRequireUserId',function($user,$id)\n {\n return $user->id == $id;\n });\n\n Gate::define('actionsThatRequireAccountLogin',function($user,$login)\n {\n $account = Account::find($login);\n if(!is_null($account))\n {\n return $user->id == $account->getUser->id;\n //return true;\n }\n\n return false;\n });\n\n //caution, it works on 'EVERY' authorization, some function on 'adminLTE template' can now be seen\n // like \" 'can' => 'manage-blog' \" on default settings in 'config\\adminlte.php'\n Gate::before(function($user)\n {\n if($user->isAdmin())\n {\n return true;\n }\n });\n }", "public function boot()\n {\n $providers = $this->make('config')->get('app.console_providers', array());\n foreach ($providers as $provider) {\n $provider = $this->make($provider);\n if ($provider && method_exists($provider, 'boot')) {\n $provider->boot();\n }\n }\n }", "protected static function boot()\n {\n }", "public function boot()\n {\n // Nothing to boot\n }", "public function boot() {\n\t}", "public function boot() {\n\t}", "public function boot()\n {\n /**\n * 申请办卡 队列执行\n */\n BankCardOrder::observe(BankCardOrderObserver::class);\n }" ]
[ "0.65681833", "0.599234", "0.59274167", "0.5851133", "0.5809211", "0.58059484", "0.5792705", "0.57758963", "0.5738833", "0.5731251", "0.5719974", "0.5714943", "0.5713465", "0.5706746", "0.56962454", "0.5690795", "0.5689715", "0.5677159", "0.5677159", "0.56764716", "0.5660376", "0.56244594", "0.56244594", "0.56244594", "0.56244594", "0.56125677", "0.55852973", "0.5578336", "0.5572406", "0.557062", "0.557062", "0.557062", "0.55692023", "0.55680496", "0.5561881", "0.5561881", "0.55538756", "0.5551984", "0.55500853", "0.55500853", "0.55500853", "0.55500853", "0.55500853", "0.55500853", "0.55500853", "0.55500853", "0.55500853", "0.55500853", "0.55500853", "0.55500853", "0.55500853", "0.55500853", "0.55432636", "0.5542405", "0.5537314", "0.5537121", "0.5534513", "0.55316913", "0.5521544", "0.5521544", "0.5521544", "0.5521544", "0.55146474", "0.55129427", "0.55129427", "0.55129427", "0.55124015", "0.55122", "0.55118996", "0.55072683", "0.5505362", "0.5505362", "0.54935247", "0.5487561", "0.54874194", "0.54839957", "0.54839957", "0.5478164", "0.5472754", "0.5469153", "0.546507", "0.546507", "0.546507", "0.546507", "0.54622185", "0.54562116", "0.545554", "0.54540217", "0.54540217", "0.54490227", "0.54427135", "0.5442553", "0.5434401", "0.5430713", "0.5420179", "0.5414116", "0.54129463", "0.54065067", "0.54065067", "0.53936756" ]
0.6610115
0
Allow a domain service provider to specify additional actions to run before the register process starts.
protected function registeringDomain() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register(): void {\n\t\tif ( false !== static::REGISTRATION_ACTION ) {\n\t\t\tadd_action(\n\t\t\t\tstatic::REGISTRATION_ACTION,\n\t\t\t\t[ $this, 'register_services' ]\n\t\t\t);\n\t\t} else {\n\t\t\t$this->register_services();\n\t\t}\n\t}", "public function register() {\n\t\tadd_action( 'bp_loaded', [ $this, 'registerServices' ] );\n\t}", "protected function registeredDomain()\n {\n }", "public function register()\n {\n //$_SESSION['prov'] = 'this will be called at bootstrapping application, before EventServicesProvider';\n }", "public function hooks() {\n $service = new Service($this->license_base);\n add_action('admin_menu', array($this, 'register_license_page'));\n add_action('admin_enqueue_scripts', array($this, 'admin_scripts'), 10);\n // Validate service\n add_action('wp_ajax_validate_service', array($service, 'validate_service'), 10);\n }", "public function register_actions() {\n\t\t}", "function before_enable() { }", "private function registerAppCommands()\n {\n }", "public function register_hooks() {\n\t\tif ( $this->page_helper->get_current_yoast_seo_page() === 'wpseo_dashboard' ) {\n\t\t\t\\add_action( 'admin_init', [ $this, 'maybe_cleanup_notification' ] );\n\t\t}\n\n\t\tif ( $this->indexing_helper->has_reason() ) {\n\t\t\t\\add_action( 'admin_init', [ $this, 'maybe_create_notification' ] );\n\t\t}\n\n\t\t\\add_action( self::NOTIFICATION_ID, [ $this, 'maybe_create_notification' ] );\n\t}", "protected function registered()\n {\n //\n }", "protected static function register() {}", "public function register(){}", "public function beforeInstall()\n\t{}", "protected function registerSystem() { }", "function before_create() {}", "public function setup_actions() {}", "private function setup_actions() {\r\n\t\tadd_action( 'init', array( $this, 'is_edd_activated' ), 1 );\r\n\r\n\t\tadd_filter( 'template_include', array( $this, 'template_loader' ) );\r\n\t\tadd_action( 'init', array( $this, 'endpoints' ) );\r\n\t\t\r\n\t\tdo_action( 'atcf_setup_actions' );\r\n\r\n\t\t$this->load_textdomain();\r\n\t}", "public function before_run(){}", "public function registerByAccessibility()\n {\n switch ($this->getArgument('accessibility')) {\n case 'unauthorized':\n $this->registerAsUnauthorized();\n break;\n\n case 'authorized':\n $this->registerAsAuthorized();\n break;\n\n default:\n $this->registerAsUnauthorized();\n $this->registerAsAuthorized();\n break;\n }\n }", "public function register() {}", "abstract protected function register_hook_callbacks();", "abstract public function register();", "abstract public function register();", "abstract public function register();", "public function registerServices(){\n }", "protected abstract function before();", "public function before_run() {}", "public function register() {\n\t\tadd_action( 'admin_init', [ $this, 'schedule_event' ] );\n\t\tadd_action( $this->get_event_name(), [ $this, 'process' ] );\n\n\t\t$this->plugin_file = plugin_basename( dirname( dirname( __DIR__ ) ) . '/amp.php' );\n\t\tadd_action( \"network_admin_plugin_action_links_{$this->plugin_file}\", [ $this, 'add_warning_sign_to_network_deactivate_action' ], 10, 1 );\n\t\tadd_action( 'plugin_row_meta', [ $this, 'add_warning_to_plugin_meta' ], 10, 2 );\n\t}", "public function register(): void;", "abstract public function onRegister(): void;", "abstract public function register_hook_callbacks();", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "private function setup_actions() {\n\n\t\t\t// Register managers, sections, settings, and controls.\n\t\t\tadd_action( 'butterbean_register', array( $this, 'register' ), 10, 2 );\n\t\t}", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "function charity_before() {\n do_action('charity_before');\n}", "public function register() {\n\t\t// Nothing to do here, we're after the (de)activation hook.\n\t}", "protected function before(){}", "public function register(): void\n {\n\n }", "public function register() {\n\t\tadd_action( 'plugins_loaded', [ $this, 'register_services' ] );\n\t\tadd_action( 'init', [ $this, 'register_assets_handler' ] );\n\t}", "private function setup_hooks() {\n\t\tadd_action( 'bp_register_admin_settings', array( $this, 'register_settings' ) );\n\t}", "public function register_hooks() {\n\t\tadd_action( 'admin_init', [ $this, 'admin_init' ] );\n\t}", "public function onRegister();", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "function iarb_extauth()\n{\n\tglobal $context, $modSettings;\n\n\tif (empty($modSettings['extauth_master']))\n\t{\n\t\treturn;\n\t}\n\n\t// Registration Screen ?\n\tif ((!empty($context['site_action']) && $context['site_action'] === 'register')\n\t\t&& (isset($_GET['action']) && $_GET['action'] === 'register'))\n\t{\n\t\t// Load the enabled providers\n\t\trequire_once(SUBSDIR . '/Extauth.subs.php');\n\t\t$context['enabled_providers'] = extauth_enabled_providers();\n\n\t\tif ($modSettings['requireAgreement'] && empty($_POST['accept_agreement']))\n\t\t{\n\t\t\tTemplate_Layers::instance()->addBegin('extauth_register');\n\t\t}\n\t}\n}", "protected function _before() {\n\t\tparent::_before ();\n\t\t$this->_startServices ( true );\n\t\t$this->startup = new Startup ();\n\t\tEventsManager::start ();\n\t\tTranslatorManager::start ( 'fr_FR', 'en' );\n\t\t$this->_initRequest ( 'RestApiController', 'GET' );\n\t}", "abstract protected function before();", "protected function registerActionChain()\n\t{\n\t\t$this->actions['adapter'] = 'adapterAction';\n\t\t$this->actions['class'] = 'classLoaderAction';\n\t\t$this->actions['security'] = 'securityAction';\n\t\t$this->actions['exec'] = 'executionAction';\n\t}", "public function register()\n {\n // maybe something, one day\n }", "public function beforeSetup()\n {\n }", "public function hookActionDispatcherBefore()\n {\n AlternativeDescription::addToProductDefinition();\n }", "public static function init() {\n\t\tadd_action( 'user_register', array( __CLASS__, 'user_register' ) );\n\t}", "protected function bootingDomain()\n {\n }", "public function register_hooks() {\n\t\t\\add_action( 'admin_action_duplicate_post_check_changes', [ $this, 'check_changes_action_handler' ] );\n\t}", "public function register(Doku_Event_Handler $controller) {\n $controller->register_hook('ACTION_ACT_PREPROCESS', 'BEFORE', $this, 'handle_export_action');\n }", "private function run_actions() {\n\t\tadd_action( 'admin_menu', [ $this, 'register' ] );\n\t\tadd_action( 'admin_enqueue_scripts', [ $this, 'enqueue' ] );\n\t\tadd_action( 'init', array( $this, 'register_settings' ) );\n\t}", "public function register_hooks() {\n\t\tadd_filter( 'pre_update_option_block_lab_license_key', array( $this, 'save_license_key' ) );\n\t}", "public function register_hooks() {\n\t\tadd_action( 'admin_init', [ $this, 'intercept_save_update_notification' ] );\n\t}", "public function _register()\n {\n }", "public function register_hooks() {\n\t\t// Needs the lower than default priority so other plugins can hook underneath it without issue.\n\t\tadd_action( 'network_admin_menu', array( $this, 'register_settings_page' ), 5 );\n\t}", "public function register()\n {\n $this->registration->execute([],$this);\n }", "private function hooks() {\n\t\t\t// check for EDD when plugin is activated\n\t\t\tadd_action( 'admin_init', array( $this, 'activation' ), 1 );\n\t\t\t\n\t\t\t// plugin meta\n\t\t\tadd_filter( 'plugin_row_meta', array( $this, 'plugin_meta' ), null, 2 );\n\n\t\t\t// settings link on plugin page\n\t\t\tadd_filter( 'plugin_action_links_' . $this->basename, array( $this, 'settings_link' ), 10, 2 );\n\t\t\t\n\t\t\t// insert actions\n\t\t\tdo_action( 'edd_sd_setup_actions' );\n\t\t}", "public function registerOn(Environment $workflowEnv)\n {\n //Nothing to do for this plugin\n }", "abstract public function register ( );", "protected function bootedDomain()\n {\n }", "function beforeFilter() {\r\n $this->Auth->mapActions(\r\n array(\r\n 'create' => array('index', 'save_api', 'setGeneralOption'),\r\n )\r\n );\r\n parent::beforeFilter();\r\n }", "protected function register_actions(){\n\t\tadd_action(\"tha_html_before\", array($this, \"action_single_remove_author_box\"));\n\t}", "public function postInstallCmd(){\n\n \\Disco\\manage\\Manager::install();\n\n }", "public function registerHooks()\n {\n add_action('wp_enqueue_scripts', [$this, 'load_scripts_n_styles']);\n add_action('after_setup_theme', [$this, 'add_theme_support']);\n add_action('widgets_init', [$this, 'tf_widgets_init']);\n add_action('after_setup_theme', [$this, 'register_menus']);\n\n if( function_exists('acf_add_options_page') ) {\n acf_add_options_page();\n }\n }", "public static function enableIntegration(\\pm_Domain $domain)\n {\n $source = \\Phlesk\\Context::getModuleId();\n\n \\pm_Log::debug(\"Triggering event 'enable_domain'\");\n \\pm_ActionLog::submit('enable_domain', $domain->getId(), [], [$source]);\n }", "public function _setup()\n {\n add_action('admin_init', array($this, 'register'));\n add_action('plugin_action_links_' . CD_SLL_NAME, array($this, 'link'));\n }", "public function customize_register()\n {\n }", "public function customize_register()\n {\n }", "public function reg(){\n\t\tServer::getInstance()->getCommandMap()->register($this->getPlugin()->getName(), $this);\n\t}", "protected function beforeAction () {\n\t}", "abstract function before();", "public function register() {\n\n $dg = strtoupper( $this->app->request->input('dg') );\n if($dg) {\n // multi-tenant\n $path = config_path('churches/'. $dg .'.php');\n }\n else {\n // single tenant\n $path = config_path('mp.php');\n }\n $this->app['config']->set('mp', require $path);\n\n $this->_registerMinistryPlatform();\n\n }", "function setup()\n{\n add_action('init', 'ywig_register_location_taxonomy');\n add_action('location_add_form_fields', 'ywig_add_location_social_meta');\n add_action('location_edit_form_fields', 'ywig_edit_location_social_meta');\n add_action('create_location', 'ywig_save_location_social_meta');\n add_action('edit_location', 'ywig_save_location_social_meta');\n}", "private function registerPermissions(): void\n {\n Gate::before(static function (Authorizable $user, string $ability) {\n if (method_exists($user, 'checkPermissionTo')) {\n return $user->checkPermissionTo($ability) ?: NULL;\n }\n });\n }", "public function register()\n {\n Permission::register('plugins', 'plugin', [\n 'change_status',\n 'list',\n 'view_settings',\n ]);\n }", "public function setup_actions() {\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'register_scripts' ) );\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );\n\t\t\n\t\t/** Dequeue GMAP Script */\n\t\tadd_filter( 'facetwp_assets', array( $this, 'dequeue_gmap' ) );\n\n\t\t/** Theme Support */\n\t\tadd_action( 'after_setup_theme', array( $this, 'add_theme_support' ) );\n\t}", "protected function beforeProcess() {\n }", "public function _before_init(){}", "function bp_register_activity_actions() {\n\tdo_action( 'bp_register_activity_actions' );\n}", "public function addSearch(string $domain): void {}", "function _elggx_lists_init() {\n\telgg_register_plugin_hook_handler('elggx_lists:can', 'all', '_elggx_list_perms_handler');\n\t\n\telgg_register_plugin_hook_handler('unit_test', 'system', '_elggx_lists_test');\n\n\tforeach (array('add_item', 'remove_item', 'rearrange_items') as $action) {\n\t\telgg_register_action(\n\t\t\t\"elggx_lists/$action\",\n\t\t\tdirname(__FILE__) . \"/actions/elggx_lists/$action.php\"\n\t\t);\n\t}\n}" ]
[ "0.6277676", "0.59795636", "0.59727204", "0.5918401", "0.57780457", "0.57421964", "0.56657875", "0.562709", "0.55771416", "0.55427754", "0.5493059", "0.5488814", "0.5484971", "0.54732245", "0.54472697", "0.5435085", "0.5428474", "0.54283655", "0.5421114", "0.5411487", "0.54021835", "0.5370223", "0.5370223", "0.5370223", "0.53609395", "0.5359755", "0.5350986", "0.5341503", "0.53404695", "0.5329698", "0.5328457", "0.53225756", "0.53225756", "0.53225756", "0.53225756", "0.53225756", "0.532221", "0.53161603", "0.53161603", "0.53161603", "0.53161603", "0.53161603", "0.53161603", "0.53161603", "0.53161603", "0.5304143", "0.5303633", "0.53031075", "0.5302559", "0.5297468", "0.52970904", "0.5286198", "0.52832466", "0.52824575", "0.52824575", "0.52824575", "0.52824575", "0.52824575", "0.52770424", "0.5266719", "0.5260231", "0.52567077", "0.52487737", "0.5247836", "0.52455497", "0.524501", "0.5242364", "0.524105", "0.5214328", "0.52107537", "0.5206716", "0.5206651", "0.5206475", "0.52029425", "0.52011293", "0.52002233", "0.51944965", "0.51854676", "0.51797634", "0.5177267", "0.5174765", "0.51637626", "0.51441", "0.5139236", "0.51366323", "0.5133266", "0.5133266", "0.51298267", "0.512622", "0.51183516", "0.511672", "0.51075757", "0.51010233", "0.50937015", "0.50899225", "0.50887877", "0.50882673", "0.5085878", "0.5083803", "0.5077705" ]
0.604839
1
Allow a domain service provider to specify additional actions to run after the register process runs.
protected function registeredDomain() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register(): void {\n\t\tif ( false !== static::REGISTRATION_ACTION ) {\n\t\t\tadd_action(\n\t\t\t\tstatic::REGISTRATION_ACTION,\n\t\t\t\t[ $this, 'register_services' ]\n\t\t\t);\n\t\t} else {\n\t\t\t$this->register_services();\n\t\t}\n\t}", "protected function registeringDomain()\n {\n }", "public function register() {\n\t\tadd_action( 'bp_loaded', [ $this, 'registerServices' ] );\n\t}", "public function register()\n {\n //$_SESSION['prov'] = 'this will be called at bootstrapping application, before EventServicesProvider';\n }", "public function register_actions() {\n\t\t}", "public function hooks() {\n $service = new Service($this->license_base);\n add_action('admin_menu', array($this, 'register_license_page'));\n add_action('admin_enqueue_scripts', array($this, 'admin_scripts'), 10);\n // Validate service\n add_action('wp_ajax_validate_service', array($service, 'validate_service'), 10);\n }", "private function registerAppCommands()\n {\n }", "public function afterRegistry()\n {\n // parent::afterRegistry();\n }", "public function register(){}", "protected function registered()\n {\n //\n }", "public function register()\n {\n $this->registration->execute([],$this);\n }", "abstract public function onRegister(): void;", "public function register() {\n\t\tadd_action( 'admin_init', [ $this, 'schedule_event' ] );\n\t\tadd_action( $this->get_event_name(), [ $this, 'process' ] );\n\n\t\t$this->plugin_file = plugin_basename( dirname( dirname( __DIR__ ) ) . '/amp.php' );\n\t\tadd_action( \"network_admin_plugin_action_links_{$this->plugin_file}\", [ $this, 'add_warning_sign_to_network_deactivate_action' ], 10, 1 );\n\t\tadd_action( 'plugin_row_meta', [ $this, 'add_warning_to_plugin_meta' ], 10, 2 );\n\t}", "public function register_hooks() {\n\t\tif ( $this->page_helper->get_current_yoast_seo_page() === 'wpseo_dashboard' ) {\n\t\t\t\\add_action( 'admin_init', [ $this, 'maybe_cleanup_notification' ] );\n\t\t}\n\n\t\tif ( $this->indexing_helper->has_reason() ) {\n\t\t\t\\add_action( 'admin_init', [ $this, 'maybe_create_notification' ] );\n\t\t}\n\n\t\t\\add_action( self::NOTIFICATION_ID, [ $this, 'maybe_create_notification' ] );\n\t}", "public function onRegister();", "public function register()\n {\n // maybe something, one day\n }", "public function register() {\n\t\t// Nothing to do here, we're after the (de)activation hook.\n\t}", "public function register(): void;", "public function registerByAccessibility()\n {\n switch ($this->getArgument('accessibility')) {\n case 'unauthorized':\n $this->registerAsUnauthorized();\n break;\n\n case 'authorized':\n $this->registerAsAuthorized();\n break;\n\n default:\n $this->registerAsUnauthorized();\n $this->registerAsAuthorized();\n break;\n }\n }", "protected function afterAdd() {\n\t}", "protected function afterAction() {\n\n }", "public function registerServices(){\n }", "public function register(){\n $this->registration->execute([], $this);\n }", "public function reg(){\n\t\tServer::getInstance()->getCommandMap()->register($this->getPlugin()->getName(), $this);\n\t}", "public function register() {}", "public function afterAction() {\n }", "abstract public function register();", "abstract public function register();", "abstract public function register();", "protected function afterAction () {\n\t}", "public function onAfterInitialise()\n\t{\n\t\t$this->call(array('System\\\\Command', 'execute'));\n\n\t\tif ($this->params->get('tranAlias', 1))\n\t\t{\n\t\t\t$this->call(array('Article\\\\Translate', 'translateAlias'), $this);\n\t\t}\n\n\t\tif ($this->params->get('languageOrphan', 0))\n\t\t{\n\t\t\t$this->call(array('System\\\\Language', 'orphan'));\n\t\t}\n\n\t\t@include $this->includeEvent(__FUNCTION__);\n\t}", "public function register(): void\n {\n\n }", "public function postInstallCmd(){\n\n \\Disco\\manage\\Manager::install();\n\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register() {\n\t\tadd_action( 'plugins_loaded', [ $this, 'register_services' ] );\n\t\tadd_action( 'init', [ $this, 'register_assets_handler' ] );\n\t}", "protected static function register() {}", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register_hooks() {\n\t\t\\add_action( 'admin_action_duplicate_post_check_changes', [ $this, 'check_changes_action_handler' ] );\n\t}", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "abstract public function register ( );", "protected function registerSystem() { }", "public function register_hooks() {\n\t\t\\add_action( 'edited_term', array( $this, 'save_meta' ), PHP_INT_MAX, 3 );\n\t\t\\add_action( 'delete_term', array( $this, 'delete_meta' ), PHP_INT_MAX, 3 );\n\t}", "abstract protected function register_hook_callbacks();", "protected function registerActionChain()\n\t{\n\t\t$this->actions['adapter'] = 'adapterAction';\n\t\t$this->actions['class'] = 'classLoaderAction';\n\t\t$this->actions['security'] = 'securityAction';\n\t\t$this->actions['exec'] = 'executionAction';\n\t}", "public function _register()\n {\n }", "protected function register_plugin_actions() {\r\n\t\t/**\r\n\t\t * Registers a Hub api action and callback for it\r\n\t\t *\r\n\t\t * @param $action\r\n\t\t * @param callable $callback The name of the function you wish to be called.\r\n\t\t */\r\n\t\t$actions = apply_filters( 'wdp_register_hub_action', array() );\r\n\t\tforeach ( $actions as $action => $callback ) {\r\n\t\t\t//check action is not already registered and valid\r\n\t\t\tif ( ! isset( $this->actions[ $action ] ) && is_callable( $callback ) ) {\r\n\t\t\t\t$this->register_action( $action, $callback );\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function main()\n {\n $useOAuthSignup = $this->getSiteConfiguration()->getUseOAuthSignup();\n if (!$this->getSiteConfiguration()->isRegistrationAllowed()) {\n throw new AccessDeniedException($this->getSecurityManager(), $this->getDomainAccessManager());\n }\n\n // Dual-mode page\n if (WebRequest::wasPosted()) {\n $this->validateCSRFToken();\n\n try {\n $this->handlePost($useOAuthSignup);\n }\n catch (ApplicationLogicException $ex) {\n SessionAlert::error($ex->getMessage());\n\n $this->getDatabase()->rollBack();\n\n $this->assignCSRFToken();\n $this->assign(\"useOAuthSignup\", $useOAuthSignup);\n $this->applyErrorValues();\n $this->setTemplate($this->getRegistrationTemplate());\n $this->addJs(\"/vendor/dropbox/zxcvbn/dist/zxcvbn.js\");\n }\n }\n else {\n $domain = WebRequest::getString('d');\n if ($domain === null) {\n throw new ApplicationLogicException(\"No domain specified.\");\n }\n\n /** @var Domain|false $domainObject */\n $domainObject = Domain::getByShortName($domain, $this->getDatabase());\n if ($domainObject === false || !$domainObject->isEnabled()) {\n throw new ApplicationLogicException(\"Unknown domain or domain not enabled.\");\n }\n\n $this->assign('localDocumentation', $domainObject->getLocalDocumentation());\n\n $this->assignCSRFToken();\n $this->assign(\"useOAuthSignup\", $useOAuthSignup);\n $this->setTemplate($this->getRegistrationTemplate());\n $this->addJs(\"/vendor/dropbox/zxcvbn/dist/zxcvbn.js\");\n }\n }", "protected function register_actions(){\n\t\tadd_action(\"tha_html_before\", array($this, \"action_single_remove_author_box\"));\n\t}", "private function run_actions() {\n\t\tadd_action( 'admin_menu', [ $this, 'register' ] );\n\t\tadd_action( 'admin_enqueue_scripts', [ $this, 'enqueue' ] );\n\t\tadd_action( 'init', array( $this, 'register_settings' ) );\n\t}", "function subsite_manager_action_register_hook($hook_name, $entity_type, $return_value, $parameters){\n\n\t\telgg_make_sticky_form('register');\n\t\telgg_make_sticky_form('profile_manager_register');\n\n\t\t$required_fields = array();\n\n\t\t// new\n\t\tif($fields = subsite_manager_get_main_profile_fields_configuration(true)){\n\t\t\tforeach($fields as $field_name => $field_config){\n\t\t\t\tif($field_config[\"mandatory\"] == \"yes\"){\n\t\t\t\t\t$required_fields[] = $field_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($required_fields){\n\n\t\t\t$custom_profile_fields = array();\n\n\t\t\tforeach($_POST as $key => $value){\n\t\t\t\tif(strpos($key, \"custom_profile_fields_\") == 0){\n\t\t\t\t\t$key = substr($key, 22);\n\t\t\t\t\t$custom_profile_fields[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach($required_fields as $field_name){\n\n\t\t\t\t$passed_value = $custom_profile_fields[$field_name];\n\n\t\t\t\tif(empty($passed_value)){\n\t\t\t\t\tregister_error(elgg_echo(\"profile_manager:register_pre_check:missing\", array(elgg_echo(\"profile:\" . $field_name))));\n\t\t\t\t\tforward(REFERER);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function setup_actions() {\n\n\t\t\t// Register managers, sections, settings, and controls.\n\t\t\tadd_action( 'butterbean_register', array( $this, 'register' ), 10, 2 );\n\t\t}", "function iarb_extauth()\n{\n\tglobal $context, $modSettings;\n\n\tif (empty($modSettings['extauth_master']))\n\t{\n\t\treturn;\n\t}\n\n\t// Registration Screen ?\n\tif ((!empty($context['site_action']) && $context['site_action'] === 'register')\n\t\t&& (isset($_GET['action']) && $_GET['action'] === 'register'))\n\t{\n\t\t// Load the enabled providers\n\t\trequire_once(SUBSDIR . '/Extauth.subs.php');\n\t\t$context['enabled_providers'] = extauth_enabled_providers();\n\n\t\tif ($modSettings['requireAgreement'] && empty($_POST['accept_agreement']))\n\t\t{\n\t\t\tTemplate_Layers::instance()->addBegin('extauth_register');\n\t\t}\n\t}\n}", "abstract public function register_hook_callbacks();", "function afterAction()\n {\n }", "public function register_hooks() {\n\t\tadd_action( 'admin_init', [ $this, 'intercept_save_update_notification' ] );\n\t}", "public function registerActions() {\n $this->addAction('wp_footer', array('Chayka\\\\LinkedIn\\\\HtmlHelper', 'renderJsInit'));\n \t/* chayka: registerActions */\n }", "protected function registerLdapEvents()\r\n\t{\r\n\t\t$app = $this->app;\r\n\r\n\t\t$app->after(function($request, $response) use ($app)\r\n\t\t{\r\n\t\t\tif (isset($app['ldap.loaded']))\r\n\t\t\t{\r\n\t\t\t\tforeach ($app['ldap']->getQueuedCookies() as $cookie)\r\n\t\t\t\t{\r\n\t\t\t\t\t$response->headers->setCookie($cookie);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}", "function setup()\n{\n add_action('init', 'ywig_register_location_taxonomy');\n add_action('location_add_form_fields', 'ywig_add_location_social_meta');\n add_action('location_edit_form_fields', 'ywig_edit_location_social_meta');\n add_action('create_location', 'ywig_save_location_social_meta');\n add_action('edit_location', 'ywig_save_location_social_meta');\n}", "function bp_register_activity_actions() {\n\tdo_action( 'bp_register_activity_actions' );\n}", "protected function bootingDomain()\n {\n }", "function actions(){\n \tadd_action( 'consume_token_response', array( $this, 'consume_token'), 1, 2 );\n \t// add_action( 'consume_identity_response', array( $this, 'consume_identity'), 1, 2 );\n }", "public function afterRegistry()\n {\n parent::afterRegistry();\n\n if ($this->showForRespondents && is_bool($this->showForRespondents)) {\n $this->showForRespondents = $this->_('Respondents');\n }\n if ($this->showForStaff && is_bool($this->showForStaff)) {\n $this->showForStaff = $this->_('Staff');\n }\n if ($this->showForTracks && is_bool($this->showForTracks)) {\n $this->showForTracks = $this->_('Tracks');\n }\n if ($this->showTitle && is_bool($this->showTitle)) {\n $this->showTitle = $this->_('Add');\n }\n }", "public final function afterRegister(){\n if(method_exists($this,'boot')){\n $this->app->call([$this,'boot']);\n }\n }", "function after_create() {}", "protected function bootedDomain()\n {\n }", "protected function after(){}", "protected function after(){}", "protected function after(){}", "private function hooks() {\n\t\t\t// check for EDD when plugin is activated\n\t\t\tadd_action( 'admin_init', array( $this, 'activation' ), 1 );\n\t\t\t\n\t\t\t// plugin meta\n\t\t\tadd_filter( 'plugin_row_meta', array( $this, 'plugin_meta' ), null, 2 );\n\n\t\t\t// settings link on plugin page\n\t\t\tadd_filter( 'plugin_action_links_' . $this->basename, array( $this, 'settings_link' ), 10, 2 );\n\t\t\t\n\t\t\t// insert actions\n\t\t\tdo_action( 'edd_sd_setup_actions' );\n\t\t}", "public function register(){\n $this->registerDependencies();\n $this->registerAlias();\n $this->registerServiceCommands();\n }", "public function despatch_actions()\n {\n// add_action('admin_init', [$addressbook, 'form_handler']);\n// add_action('admin_post_nj_ac_delete_address', [$addressbook, 'delete_address']);\n }", "public function customize_register()\n {\n }", "public function customize_register()\n {\n }", "public function registerAction($action){\r\n\t\t\t\t\r\n\t\t\t$this->_actions[] = $action;\r\n\t\t}", "function register() {\n // Para el back-end\n add_action('admin_enqueue_scripts', array($this, 'put_in_queue'));\n // Para el front-end\n add_action('wp_enqueue_scripts', array($this, 'put_in_queue'));\n // Generar nuestro custom post type\n add_action('init', array($this, 'custom_post_type'));\n\n // Añadir una metabox a nuestro custom post type backend\n add_action('add_meta_boxes', array($this, 'reviews_meta_box'));\n // Guardar los cambios que hagamos en los custom post type backend\n add_action('save_post', array($this, 'save_review'));\n\n // Crear un enlace para los settings del plugin en el admin area\n add_action('admin_menu', array($this, 'add_admin_pages'));\n }", "public function _postSetup()\n {\n }", "public function register(): void\n {\n $response = $this->signedPostRequest('acme/new-acct', [\n 'termsOfServiceAgreed' => true,\n ], true);\n $this->kid = $response->getHeader('Location')[0];\n }", "public function onRegistration(): void\n { exit;\n }", "function registerHooks($action, $avaiableActions=array()) {\n\t\tadd_filter('user_contactmethods', array($this, 'additionalProfileFields'), 10, 1);\n\n\t\t// Additional actions for edit/show user profile\n\t\tadd_action('show_user_profile', array($this, 'userProfileImageField'));\n\t\tadd_action('edit_user_profile', array($this, 'userProfileImageField'));\n\n\t\t// Save/edit user profile image\n\t\tadd_action('personal_options_update', array($this, 'saveUserProfileImageField'));\n\t\tadd_action('edit_user_profile_update', array($this, 'saveUserProfileImageField'));\n\t}", "public function register ( $dtor, $name, $cb, $pnames )\n\t{\n\t\txmlrpc_server_register_method( $this->sh, $name, array( &$this, 'call' ) );\n\t\t$this->ft[$name] = array( 'd' => $dtor, 'f' => $cb, 'p' => $pnames );\n\t}", "abstract protected function registerCallback();", "protected function postApply(): void {\n\t\t// re-register events\n\t\telgg_register_event_handler('create', 'metadata', '\\ColdTrick\\TagTools\\Rules::applyRules', 1);\n\t\telgg_register_event_handler('create', 'metadata', '\\ColdTrick\\TagTools\\Enqueue::createMetadata');\n\t}", "function Doku_Event_Handler() {\n\n // load action plugins\n $plugin = NULL;\n $pluginlist = plugin_list('action');\n\n foreach ($pluginlist as $plugin_name) {\n $plugin =& plugin_load('action',$plugin_name);\n\n if ($plugin !== NULL) $plugin->register($this);\n }\n }", "abstract protected function after();", "public function addSearch(string $domain): void {}" ]
[ "0.6350838", "0.616889", "0.60427505", "0.5913878", "0.5889714", "0.5709446", "0.56871736", "0.56684434", "0.56188136", "0.5608972", "0.5607045", "0.5576264", "0.5550387", "0.5543195", "0.5503731", "0.5488566", "0.54839534", "0.5482635", "0.5475993", "0.54666394", "0.54574865", "0.5456215", "0.5452104", "0.54495174", "0.54493695", "0.5430148", "0.5423724", "0.5423724", "0.5423724", "0.5409733", "0.5408008", "0.5399733", "0.5387731", "0.5383501", "0.5383501", "0.5383501", "0.5383501", "0.5383501", "0.5365629", "0.53547853", "0.5353685", "0.5353685", "0.5353685", "0.5353685", "0.5353685", "0.5348725", "0.5338866", "0.5338866", "0.5338866", "0.5338866", "0.5338866", "0.5338866", "0.5338866", "0.5338866", "0.53087455", "0.53045344", "0.5302792", "0.5298831", "0.5270909", "0.52696", "0.52360845", "0.5229263", "0.52292335", "0.52257615", "0.5225362", "0.5219811", "0.52118635", "0.5211084", "0.5207672", "0.51876414", "0.5179832", "0.5176566", "0.51643807", "0.5152446", "0.5151522", "0.5150787", "0.5146297", "0.514463", "0.51422614", "0.51337755", "0.51320165", "0.51320165", "0.51320165", "0.51313007", "0.5115807", "0.51149493", "0.511263", "0.511263", "0.510544", "0.51023144", "0.510166", "0.5099587", "0.50938123", "0.5092627", "0.5090008", "0.508473", "0.50846857", "0.50844324", "0.50823134", "0.50802183" ]
0.61827433
1
Add or update a repo
public function addBundle($fullName, $updateRepo = true) { list($username, $bundleName) = explode('/', $fullName); $user = $this->users->getOrCreate($username); if (!isset($this->bundles[strtolower($fullName)])) { $bundle = new Bundle($fullName); $this->em->persist($bundle); $user->addBundle($bundle); $this->bundles[strtolower($fullName)] = $bundle; } else { $bundle = $this->bundles[strtolower($fullName)]; } $this->em->flush(); if ($updateRepo) { $this->updateRepo($bundle); } return $bundle; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gitUpdate()\n{\n \n $config = json_decode(file_get_contents(\"/app/config.json\"), true);\n\n $git = $config['git'];\n $remote = \"https://\" . $git['user'] . \":\" . $git['token'] . \"@github.com/\" . $git['git_dir'];\n exec(\"cd \" . $config['project_dir'] . \" && git init && git pull $remote \" . $git['branch']);\n exec(\"cd \" . $config['project_dir'] . \" && composer update\");\n}", "public function set_needed_repos(): void {}", "public function set_needed_repos(): void {}", "function pkg_switch_repo($repo_path, $repo_name) {\n\tglobal $g, $config;\n\n\tsafe_mkdir(\"/usr/local/etc/pkg/repos\");\n\t@unlink(\"/usr/local/etc/pkg/repos/{$g['product_name']}.conf\");\n\t$repo = \"{$repo_path}/{$g['product_name']}-repo-{$repo_name}.conf\";\n\t@symlink($repo, \"/usr/local/etc/pkg/repos/{$g['product_name']}.conf\");\n\n\t/* Do not fetch new settings, only setup the repo pkg.conf. */\n\tmwexec(\"/usr/local/sbin/{$g['product_name']}-repo-setup -U\");\n\n\t/* Update pfSense_version cache */\n\tmwexec_bg(\"/etc/rc.update_pkg_metadata now\");\n\treturn;\n}", "public function updateRepositories() {\n $projects = $this->loadProjects();\n if (!$projects)\n return;\n\n $this->m_authors = $this->loadAuthors();\n\n foreach ($projects as $project)\n $this->updateProject($project);\n }", "function rinstall() {\n\t\t$versionPath = $this->getVersionPath();\n//\t\tdebug($versionPath);\n\t\t/** @var Repo $repo */\n\t\tforeach ($this->repos as $repo) {\n\t\t\techo BR, '## ', $repo->path(), BR;\n\t\t\tif ($this->rexists($repo->path())) {\n\t\t\t\t$deployPath = $versionPath . '/' . $repo->path();\n\t\t\t\t$cmd = 'cd ' . $deployPath . ' && hg update -r ' . $repo->getHash();\n\t\t\t\t$this->ssh_exec($cmd);\n\t\t\t} else {\n\t\t\t\techo 'Error: '.$repo->path.' is not on the server. Maybe do rdeploy?', BR;\n\t\t\t}\n\t\t}\n\t}", "function git_update($path) {\n\t$status = GitUtil::update($path);\n}", "function runUpdate($repo)\n{\n $updNoodle = new Noodle();\n $updNoodle->noodleID = 17;\n $updNoodle->brand = 'FLAVOURS OF THE SUN';\n $updNoodle->flavour = 'COSMIC DUST';\n $updNoodle->instant = 1;\n $updNoodle->nationality = 'OUT OF THIS WORLD';\n $repo->update($updNoodle);\n}", "function saveRepo($name) {\n\tglobal $repos, $counter;\n\t$counter++;\n\tif(!array_key_exists($name, $repos)) {\n\t\t$repos[$name] = $name;\n\t\tfile_put_contents('repos.txt', implode(\"\\r\\n\",$repos));\n\t\t//echo sizeof($repos).\"/$counter\\n\";\n\t}\n}", "public function init_repo() {\n\n\t\t\t// we don't need to maintain local repos for slim deploys\n\t\t\tif ( SLIM ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// if the repo is already initialised, we don't need to\n\t\t\tif ( is_dir( \"wpd-repos/{$this->config->repo[ 'name' ]}/.git\" ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// store the directory we're in right now, so we can come back\n\t\t\t$original_dir = getcwd();\n\n\t\t\t// switch the repo's directory\n\t\t\tchdir( \"wpd-repos/{$this->config->repo[ 'name' ]}\" );\n\n\t\t\t// initialise git\n\t\t\texec( 'git init' );\n\n\t\t\t// add the remote repo as a remote called origin\n\t\t\texec( \"git remote add origin \" . $this->config->repo[ 'git_url' ] );\n\n\t\t\t// switch back to the original directory\n\t\t\tchdir( $original_dir );\n\t\t}", "public function repo($dir, $remote);", "public static function addRepository(IOInterface $io, RepositoryManager $rm, array &$repos, $name, array $repoConfig, Pool $pool = null)\n {\n $repoConfig['name'] = $name;\n $repo = $rm->createRepository($repoConfig['type'], $repoConfig);\n\n return static::addRepositoryInstance($io, $rm, $repos, $name, $repo, $pool);\n }", "function target_gitup()\n{\n\t// git remote add upstream git://github.com/<user>/<repo>.git\n\tsystem('git fetch upstream');\n\tsystem('git merge upstream/master');\n}", "public function load_repository(&$repo, $name) {\n // First determine if the class file exisits\n $path = @$repo['path'];\n $conf = array();\n\n if (file_exists($path . '/settings.php')) {\n // Override with repository specific data\n include($path . '/settings.php');\n }\n\n $repo = array_merge($conf, $repo);\n if (!isset($repos['data'])||!is_object($repo['data'])) $repo['data'] = $this->load_provider($repo, $path, $name);\n\n }", "public function gitAdd($path)\n\t{\n\t\t// #TODO: Doesn't support adding new directories along with files.\n\t\t// this only supports adding a single file at a time.\n\t\t$WorkingCopy = $this->gitWrapper->workingCopy($this->getPath()); // This \n\t\treturn $WorkingCopy->add($path);\n\t}", "public function createRepo(string $repo = null)\n {\n $end = $this->getVendorType() === 'org'\n ? '/orgs/' . $this->getVendor() . '/repos'\n : '/user/repos';\n $res = $this->request('POST', $end, [\n 'name' => $this->getName(),\n 'description' => $this->getDescription(),\n ]);\n if (Helper::isResponseOk($res)) {\n echo \"\\ngit remote add origin [email protected]:{$this->getFullName()}.git\\n\";\n echo \"git push -u origin master\\n\";\n }\n\n return $res;\n }", "protected static function writeAddRepository(IOInterface $io, $name)\n {\n if ($io->isVerbose()) {\n $io->write('Adding VCS repository <info>'.$name.'</info>');\n }\n }", "public function pushRepository($dir, $target_project);", "public function update() {\n\t\t$webhook_secret = $this->config->item ( 'github_webhook_secret' );\n\t\t$client_id = $this->config->item ( 'github_client_id' );\n\t\t$client_secret = $this->config->item ( 'github_client_secret' );\n\t\t\n\t\tif (! isset ( $_SERVER ['HTTP_X_HUB_SIGNATURE'] )) {\n\t\t\tthrow new \\Exception ( \"HTTP header 'X-Hub-Signature' is missing.\" );\n\t\t} elseif (! extension_loaded ( 'hash' )) {\n\t\t\tthrow new \\Exception ( \"Missing 'hash' extension to check the secret code validity.\" );\n\t\t}\n\t\t\n\t\tlist ( $algo, $hash ) = explode ( '=', $_SERVER ['HTTP_X_HUB_SIGNATURE'], 2 ) + array (\n\t\t\t\t'',\n\t\t\t\t'' \n\t\t);\n\t\tif (! in_array ( $algo, hash_algos (), TRUE )) {\n\t\t\tthrow new \\Exception ( \"Hash algorithm '$algo' is not supported.\" );\n\t\t}\n\t\t$rawPost = file_get_contents ( 'php://input' );\n\t\tif ($hash !== hash_hmac ( $algo, $rawPost, $webhook_secret )) {\n\t\t\tthrow new \\Exception ( 'Hook secret does not match.' );\n\t\t}\n\t\t\n\t\t$url = \"https://api.github.com/users/UoLCompSoc/repos?per_page=10&client_id=\" . $client_id . \"&client_secret=\" . $client_secret;\n\t\t\n\t\t$decoded = json_decode ( $this->_getContent ( $url ) );\n\t\t\n\t\t$github_data = array ();\n\t\t\n\t\tforeach ( $decoded as $repo ) {\n\t\t\tif ($repo->fork === TRUE) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$collaborators = json_decode ( $this->_getContent ( $repo->contributors_url ) );\n\t\t\t$repo->collaborator_count = sizeof ( $collaborators );\n\t\t\t\n\t\t\tarray_push ( $github_data, $repo );\n\t\t}\n\t\t\n\t\t$filepath = APPPATH . 'cache/repocache.json';\n\t\t\n\t\tif (! write_file ( $filepath, json_encode ( $github_data ), 'w' )) {\n\t\t\tlog_message ( 'error', 'Cannot write to github cache file at ' . $filepath );\n\t\t}\n\t\t\n\t\t// $this->load->view ( 'admin' );\n\t}", "public function update(RepoRequest $request, Repo $repo)\n {\n $repo->fill($request->all());\n if (!$request->auto_deploy)\n {\n $repo->auto_deploy = 0;\n }\n $repo->save();\n\n return redirect()->back();\n }", "public static function &create($repo_path, $source = null) {\n\t\t\treturn GitRepo::create_new($repo_path, $source);\n\t\t}", "public static function addRepositoryInstance(IOInterface $io, RepositoryManager $rm, array &$repos, $name, RepositoryInterface $repo, Pool $pool = null)\n {\n $notAddedRepo = null;\n\n if (!isset($repos[$name])) {\n static::writeAddRepository($io, $name);\n $notAddedRepo = $repo;\n $repos[$name] = $repo;\n $rm->addRepository($repo);\n\n if (null !== $pool) {\n $pool->addRepository($repo);\n $notAddedRepo = null;\n }\n }\n\n return $notAddedRepo;\n }", "public function gitCloneRepositories() {\n\t\t$count = 0;\n\n\t\t$packages = $this->Package->find('list');\n\t\tforeach ($packages as $id => $name) {\n\t\t\t$this->out(sprintf(__(\"* Downloading package %s\"), $name));\n\t\t\tif ($this->Package->setupRepository($id)); {\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t\t$this->out(sprintf(__('* Downloaded %s of %s repositories'), $count, count($packages)));\n\t}", "public function cloneGitRepo($repo, $dir);", "private function syncRepository()\n {\n $cwd = '/tmp/'.$this->migrationId;\n (new ProcessBuilder(['mkdir']))->add('-p')->add($cwd)->getProcess()->mustRun();\n\n $cloneSourceCommandBuilder = new ProcessBuilder(['git', 'clone', $this->sourceProject->getSshUrlToRepo(), '.']);\n $cloneSourceCommandBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $addNewRemoteBuilder = new ProcessBuilder(['git', 'remote', 'add', 'new']);\n $addNewRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->add($this->targetProject->getSshUrlToRepo())\n ->getProcess()\n ->mustRun();\n\n $pushToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--all']);\n $pushToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $pushTagsToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--tags']);\n $pushTagsToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n }", "function do_clone_or_pull($key, $url, $path, $operation) {\n // Already a git repo there. Do a pull.\n if ((is_dir($path)) && (file_exists($path . \"/.git\"))) {\n\tif($operation==\"TAG\"){\n\t\treturn do_fetch($key,$url,$path);\n\t}\n\telse{\n\t\treturn do_pull($key,$url,$path);\n\t}\n }\n \n // Try a clone\n $out = do_clone($key,$url,$path);\n if (!is_dir($path)) {\n $out .= \"\\nClone appeared to fail.\\n\";\n }\n return $out;\n}", "private function saveUpdateRepos()\n {\n $success = false;\n\n // Get the repos from Github\n $result = $this->getPHPRepos();\n\n // If something was returned, save it\n if ($result) {\n $success = $this->saveRepos();\n }\n\n return $success;\n }", "function _versioncontrol_git_log_update_repository(&$repository) {\n $root = escapeshellcmd($repository['root']);\n $chdir_ok = @chdir($root); // Set working directory to root.\n if ($chdir_ok === FALSE) {\n return FALSE;\n }\n if ($repository['git_specific']['locked'] == TRUE) {\n drupal_set_message(t('This repository is locked, there is already a fetch in progress. If this is not the case, press the clear lock button.'), 'error');\n return FALSE;\n }\n db_query('UPDATE {versioncontrol_git_repositories}\n SET locked = 1 WHERE repo_id = %d', $repository['repo_id']);\n\n // Get the list of current branches from Git.\n $branch_list = _versioncontrol_git_log_get_branches();\n $add_branch_label = array(\n 'name' => '', //filled later\n 'type' => VERSIONCONTROL_OPERATION_BRANCH,\n 'action' => VERSIONCONTROL_ACTION_MODIFIED\n );\n $branches = array();\n foreach ($branch_list as $branch_name) {\n $add_branch_label['name'] = $branch_name;\n $label_ret = versioncontrol_ensure_label($repository, $add_branch_label);\n $branches[$branch_name] = $label_ret;\n }\n //jpetso and me (corni) came to the conclusion that we will not delete branches.\n // TODO: revisit this!\n // Record new commits.\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_COMMIT),\n 'branches' => array() // used in the loop\n );\n $branches_per_commit = array();\n $existing_revs = array();\n // Get the existing revisions from the cache.\n $cache_object = cache_get('versioncontrol_git_rev_cache');\n // Check wether the cache object exists or not.\n if (is_object($cache_object)) {\n $existing_revs = $cache_object->data;\n }\n // Get the list of current branches from Git.\n // Generate the range per branch with which git shall be called.\n foreach ($branches as $branch_name => $label) {\n if (is_object($cache_object)) {\n // We get all commits we have in this branch to not process them later.\n $constraints['branches'] = array($branch_name);\n $latest_commit_date = 0;\n $commit_op = versioncontrol_get_operations($constraints);\n $latest_commit = FALSE;\n foreach ($commit_op as $vc_op_id => $c_op) {\n if ($latest_commit_date < $c_op['date']) {\n $latest_commit = $c_op['revision'];\n $latest_commit_date = $c_op['date'];\n $existing_revs[$branch_name][$latest_commit] = TRUE;\n }\n }\n }\n // No way to free the damned mysql result!!\n unset($commit_op);\n\n $commits_in_branch = _versioncontrol_git_log_get_commits_in_branch($repository, escapeshellarg($branch_name));\n foreach ($commits_in_branch as $i => $commit) {\n if (!isset($existing_revs[$branch_name][$commit])) {\n if (!isset($branches_per_commit[$commit]) || !is_array($branches_per_commit[$commit])) {\n $branches_per_commit[$commit] = array($label);\n }\n else {\n $branches_per_commit[$commit][] = $label;\n }\n }\n }\n }\n // This uses an extra loop on purpose!\n // Process all commits on a per-branch base.\n foreach ($branches_per_commit as $revision => $branch) {\n // Update commits from Git.\n _versioncontrol_git_process_commits($repository, $revision, $branches_per_commit, $existing_revs);\n }\n // Check tags.\n $tags = _versioncontrol_git_log_get_tags(); //Now we have the current list of tags as array of strings.\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_TAG)\n );\n $existing_tag_ops = versioncontrol_get_operations($constraints);\n $existing_tags = array();\n foreach ($existing_tag_ops as $tag_op) {\n if (!in_array($tag_op['labels'][0]['name'], $existing_tags)) {\n $existing_tags[] = $tag_op['labels'][0]['name'];\n }\n }\n // Deleting tags is *not* supported. Read the manual if you want to know why...\n // Check for new tags.\n $new_tags = array_diff($tags, $existing_tags);\n if (!empty($new_tags)) {\n _versioncontrol_git_process_tags($repository, $new_tags);\n }\n\n // Update repository updated field. Displayed on administration interface for documentation purposes.\n $repository['git_specific']['updated'] = time();\n db_query('UPDATE {versioncontrol_git_repositories}\n SET updated = %d, locked = 0 WHERE repo_id = %d',\n $repository['git_specific']['updated'], $repository['repo_id']);\n\n // Write back the cache.\n cache_set('versioncontrol_git_rev_cache', $existing_revs);\n return TRUE;\n}", "function cvs_add_repository($cvs_user, $cvs_pass, $cvs_project) {\r\n global $cvs_root, $cvs_cmd;\r\n\r\n $cvs_dir = $cvs_root.\"/\".$cvs_project;\r\n\r\n exec($cvs_cmd.\" -d \".$cvs_dir.\" init\");\r\n\r\n cvs_add_user($cvs_user, $cvs_pass, $cvs_project);\r\n}", "public function store()\n {\n $validated = request()->validate([\n 'name' => ['required', 'regex:/^[A-Za-z0-9_]*$/']\n ]);\n\n $repository = new Repository();\n $repository->name = $validated['name'];\n\n chdir('D:\\repositories');\n// file_put_contents('conf/gitolite.conf', $lines);// insert gitolite.conf\n// shell_exec('git config user.email tarc@admin');\n// shell_exec('git config user.name TARC_Admin');\n// shell_exec('git add conf/gitolite.conf');\n// shell_exec('git commit -m '.Staff::where('user_id', Auth::user()->id)->first()->staff_id);\n// shell_exec('git pull');\n// shell_exec('git push');\n shell_exec('git clone '. config('gitolite.git_server_url') .':' . $repository->name);\n// $output = shell_exec('rm -rf '.escapeshellarg($repository->name));\n// dd($output);\n return redirect('repositories')->with('success', 'Your '.$repository->name . ' repository has been created.');;\n }", "public function gitPull ()\n {\n\n $this->updates[ ] = Hallmark_Misc::shell ( 'git pull ' . Hallmark_Misc::removeQuotes ( Hallmark_Misc::args () ) );\n\n }", "function rpull() {\n\t\t$this->checkOnce();\n\t\t$versionPath = $this->getVersionPath();\n\t\t/** @var Repo $repo */\n\t\tforeach ($this->repos as $repo) {\n\t\t\techo BR, '## ', $repo->path, BR;\n\t\t\t$deployPath = $versionPath . '/' . $repo->path();\n\t\t\ttry {\n\t\t\t\t$exists = $this->rexists($deployPath);\n\t\t\t\tif ($exists) {\n\t\t\t\t\t$remoteCmd = 'cd ' . $deployPath . ' && hg pull';\n\t\t\t\t\t$this->ssh_exec($remoteCmd);\n\t\t\t\t} else {\n\t\t\t\t\techo TAB, '*** path ', $deployPath, ' does not exist', BR;\n\t\t\t\t}\n\t\t\t} catch (\\SystemCommandException $e) {\n\t\t\t\techo 'Error: '.$e, BR;\n\t\t\t}\n\t\t}\n\t}", "protected function createRepository()\n {\n $repositoryOptions = [\n 'repository' => $this->info['repositoryName'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'parent',\n 'uploads',\n 'data',\n 'int',\n 'float',\n 'bool',\n ]);\n\n $this->call('engez:repository', array_merge($repositoryOptions, $options));\n }", "public function updateRepository() {\n $scheduledFile = __DIR__ . '/scheduled.txt';\n if (!file_exists($scheduledFile))\n return;\n\n $requested = file_get_contents($scheduledFile);\n if (!unlink($scheduledFile))\n return;\n\n if ((time() - intval(trim($requested))) > 600)\n return;\n\n $commands = [\n // Updates the local copy of the repository with the most recent remote changes.\n 'git fetch --all',\n\n // Resets the repository to the state the remote currently is in.\n 'git reset --hard origin/master',\n\n // Remove any left-over files that are not part of the checkout, and not in .gitignore.\n 'git clean -f -d',\n\n // Write the latest commit SHA to the VERSION file.\n 'git rev-parse HEAD > VERSION',\n ];\n\n $directory = realpath(__DIR__ . '/../../../');\n\n foreach ($commands as $command)\n Info(trim(shell_exec('cd ' . $directory . ' && ' . $command . ' 2>&1')));\n\n Info('AutoDeploy: Updated to revision ' . file_get_contents(__DIR__ . '/../../../VERSION') . '.');\n }", "public function setRepo($user, $repo)\n {\n $this->apibase = \"https://api.github.com/repos/$user/$repo/\";\n }", "protected function utilGitPull()\n {\n foreach (File::directories(plugins_path()) as $authorDir) {\n foreach (File::directories($authorDir) as $pluginDir) {\n if (!File::isDirectory($pluginDir.'/.git')) {\n continue;\n }\n\n $exec = 'cd ' . $pluginDir . ' && ';\n $exec .= 'git pull 2>&1';\n echo 'Updating plugin: '. basename(dirname($pluginDir)) .'.'. basename($pluginDir) . PHP_EOL;\n echo shell_exec($exec);\n }\n }\n\n foreach (File::directories(themes_path()) as $themeDir) {\n if (!File::isDirectory($themeDir.'/.git')) {\n continue;\n }\n\n $exec = 'cd ' . $themeDir . ' && ';\n $exec .= 'git pull 2>&1';\n echo 'Updating theme: '. basename($themeDir) . PHP_EOL;\n echo shell_exec($exec);\n }\n }", "public function remoteAdd($name = 'joomla', $url = '[email protected]:joomla/joomla-platform.git')\n\t{\n\t\t// Initialize variables.\n\t\t$out = array();\n\t\t$return = null;\n\n\t\t// Ensure that the remote doesn't already exist.\n\t\tif (in_array($name, $this->_getRemotes()))\n\t\t{\n\t\t\tthrow new InvalidArgumentException('The remote ' . $name . ' already exists.');\n\t\t}\n\n\t\t// Execute the command.\n\t\t$wd = getcwd();\n\t\tchdir($this->_root);\n\t\texec('git remote add ' . escapeshellarg($name) . ' ' . escapeshellarg($url), $out, $return);\n\t\tchdir($wd);\n\n\t\t// Validate the response.\n\t\tif ($return !== 0)\n\t\t{\n\t\t\tthrow new RuntimeException(\n\t\t\t\tsprintf('The remote %s could not be added from %s with code %d and message %s.', $name, $url, $return, implode(\"\\n\", $out))\n\t\t\t);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function update(Request $request, Repository $repository)\n {\n //\n }", "public function set_repo_path($repo_path, $create_new = false, $_init = true) {\n\t\t\tif (is_string($repo_path)) {\n\t\t\t\tif ($new_path = realpath($repo_path)) {\n\t\t\t\t\t$repo_path = $new_path;\n\t\t\t\t\tif (is_dir($repo_path)) {\n\t\t\t\t\t\t// Is this a work tree?\n\t\t\t\t\t\tif (file_exists($repo_path.\"/.git\") && is_dir($repo_path.\"/.git\")) {\n\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\t$this->bare = false;\n\n\t\t\t\t\t\t\tif (!is_writable($repo_path.\"/.git\")) {\n\t\t\t\t\t\t\t\t$user_info = posix_getpwuid(fileowner($repo_path.\"/.git\"));\n\t\t\t\t\t\t\t\t$file_owner = $user_info['name'];\n\t\t\t\t\t\t\t\t$this->command_prefix = 'sudo -u '.$file_owner.' ';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Is this a bare repo?\n\t\t\t\t\t\t} else if (is_file($repo_path.\"/config\")) {\n\t\t\t\t\t\t\t$parse_ini = parse_ini_file($repo_path.\"/config\");\n\t\t\t\t\t\t\tif ($parse_ini['bare']) {\n\t\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\t\t$this->bare = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($create_new) {\n\t\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\t\tif ($_init) {\n\t\t\t\t\t\t\t\t\t$this->run('init');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthrow new Exception('\"'.$repo_path.'\" is not a git repository');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception('\"'.$repo_path.'\" is not a directory');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($create_new) {\n\t\t\t\t\t\tif ($parent = realpath(dirname($repo_path))) {\n\t\t\t\t\t\t\tmkdir($repo_path);\n\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\tif ($_init) $this->run('init');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new Exception('cannot create repository in non-existent directory');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception('\"'.$repo_path.'\" does not exist');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function git_clone($repo, $path, $initSubModules = false) {\n\tGitUtil::cloneRepo($repo, $path, $initSubModules);\n}", "public function update($usename, $repo, $id, $title = null, $key = null)\n {\n return $this->_update(\"repos/$username/$repo/keys/$id\", $title, $key);\n }", "public function github(){\n\n\t\t$user = '';\n\t\tif(isset($this->request->get['user'])){\n\t\t\t$user = $this->request->get['user'];\n\t\t}\n\t\t$repo = '';\n\t\tif(isset($this->request->get['repo'])){\n\t\t\t$repo = $this->request->get['repo'];\n\t\t}\n\t\t$branch = '';\n\t\tif(isset($this->request->get['branch'])){\n\t\t\t$branch = $this->request->get['branch'];\n\t\t}\n\t\tnew d_shopunity\\GitHub($user, $repo, str_replace(\"catalog/\", \"\", DIR_APPLICATION), $branch );\n\t}", "protected function initRepository()\n {\n $this->repository = new Repository([\n 'name' => 'vendor/name',\n 'description' => '✈️The package is a ThinkSNS+ package.',\n 'type' => 'library',\n 'license' => 'MIT',\n 'require' => [\n 'php' => '>=7.1.3',\n ],\n 'autoload' => [],\n 'config' => [\n 'sort-packages' => true,\n ],\n ]);\n }", "function plugin_initconfig_repository()\n{\n global $_CONF;\n\n $c = config::get_instance();\n if (!$c->group_exists('repository')) {\n $c->add('sg_main', NULL, 'subgroup', 0, 0, NULL, 0, true, 'repository');\n $c->add('fs_main', NULL, 'fieldset', 0, 0, NULL, 0, true, 'repository');\n $c->add('repository_moderated', 1,\n 'select', 0, 0, 0, 10, true, 'repository');\n $c->add('max_pluginpatch_upload', 2000000, \n 'text', 0, 0, 0, 60, true, 'repository'); // 2 MB\n }\n\n return true;\n}", "public function actionUpdate(): int\n {\n try {\n GithubCache::flush();\n\n $service = GithubService::getInstance();\n $service->saveCache();\n } catch (Exception $e) {\n throw $e;\n }\n\n return ExitCode::OK;\n }", "public function install() {\n $strReturn = \"\";\n\n $strReturn .= \"Creating picture upload folder\\n\";\n if(!is_dir(_realpath_._filespath_.\"/images/upload\"))\n mkdir(_realpath_._filespath_.\"/images/upload\", 0777, true);\n\n $strReturn .= \"Creating new picture repository\\n\";\n $objRepo = new class_module_mediamanager_repo();\n\n if($this->strContentLanguage == \"de\")\n $objRepo->setStrTitle(\"Hochgeladene Bilder\");\n else\n $objRepo->setStrTitle(\"Picture uploads\");\n\n $objRepo->setStrPath(_filespath_.\"/images/upload\");\n $objRepo->setStrUploadFilter(\".jpg,.png,.gif,.jpeg\");\n $objRepo->setStrViewFilter(\".jpg,.png,.gif,.jpeg\");\n $objRepo->updateObjectToDb();\n $objRepo->syncRepo();\n\n $strReturn .= \"ID of new repo: \".$objRepo->getSystemid().\"\\n\";\n\n $strReturn .= \"Setting the repository as the default images repository\\n\";\n $objSetting = class_module_system_setting::getConfigByName(\"_mediamanager_default_imagesrepoid_\");\n $objSetting->setStrValue($objRepo->getSystemid());\n $objSetting->updateObjectToDb();\n\n $strReturn .= \"Creating file upload folder\\n\";\n if(!is_dir(_realpath_._filespath_.\"/public\"))\n mkdir(_realpath_._filespath_.\"/public\", 0777, true);\n\n $strReturn .= \"Creating new file repository\\n\";\n $objRepo = new class_module_mediamanager_repo();\n\n if($this->strContentLanguage == \"de\")\n $objRepo->setStrTitle(\"Hochgeladene Dateien\");\n else\n $objRepo->setStrTitle(\"File uploads\");\n\n $objRepo->setStrPath(_filespath_.\"/downloads\");\n $objRepo->setStrUploadFilter(\".zip,.pdf,.txt\");\n $objRepo->setStrViewFilter(\".zip,.pdf,.txt\");\n $objRepo->updateObjectToDb();\n $objRepo->syncRepo();\n $strReturn .= \"ID of new repo: \".$objRepo->getSystemid().\"\\n\";\n\n $strReturn .= \"Setting the repository as the default files repository\\n\";\n $objSetting = class_module_system_setting::getConfigByName(\"_mediamanager_default_filesrepoid_\");\n $objSetting->setStrValue($objRepo->getSystemid());\n $objSetting->updateObjectToDb();\n\n\n return $strReturn;\n }", "public static function open($repo_path) {\n\t\t\treturn new GitRepo($repo_path);\n\t\t}", "public function repository()\n {\n return new Eadrax\\Repository\\Project\\Add;\n }", "function SVNRepoManager() {\n\tloadTemplate('SVNRepoManager');\n}", "public function edit(Repository $repository)\n {\n //\n }", "function git_update_submodules($path) {\n\t$status = GitUtil::updateExternals($path);\n}", "protected function pullRepo()\n {\n assert(valid_num_args());\n\n $pull = new GitHubPullProcess($this->config, $this->env, $this->output);\n $pull->execute();\n }", "public static function addClassesRepository($in_repos_path)\n\t{\n\t\tif (! array_key_exists($in_repos_path, self::$__CLASS_REPOS))\n\t\t{ self::$__CLASS_REPOS[$in_repos_path] = null; } \n\t}", "public function gitPull() {\n $current_branch = exec('git rev-parse --abbrev-ref HEAD');\n\n $collection = $this->collectionBuilder();\n $collection->taskGitStack()\n ->pull()\n ->run();\n\n $name = $this->confirm(\"Run Composer Install?\");\n if ($name) {\n $this->composerInstall();\n }\n\n $name = $this->confirm(\"Run Config Import?\");\n if ($name) {\n $this->drushCim();\n }\n }", "public function updateCommand() {\n\t\t$this->browser->setRequestEngine($this->browserRequestEngine);\n\t\t$flowPackages = array();\n\n\t\tforeach ($this->repositories as $baseUrl => $repository) {\n\t\t\t$domain = parse_url($repository, PHP_URL_HOST);\n\t\t\t#$baseUrl = dirname($repository) . '/';\n\t\t\t$basePath = FLOW_PATH_DATA . 'Packages/' . $domain;\n\n\t\t\tif (!is_dir(FLOW_PATH_DATA . 'Packages/')) {\n\t\t\t\tmkdir(FLOW_PATH_DATA . 'Packages/');\n\t\t\t}\n\n\t\t\tif (!is_dir(FLOW_PATH_DATA . 'Packages/' . $domain)) {\n\t\t\t\tmkdir(FLOW_PATH_DATA . 'Packages/' . $domain);\n\t\t\t}\n\n\t\t\t$response = $this->browser->request($repository);\n\t\t\t$packagesFile = $basePath . '/packages.json';\n\t\t\tfile_put_contents($packagesFile, $response->getContent());\n\t\t\t$packageList = json_decode($response->getContent());\n\n\t\t\tif (isset($packageList->includes)) {\n\t\t\t\t$includes = get_object_vars($packageList->includes);\n\t\t\t\tif (!empty($includes)) {\n\t\t\t\t\tforeach ($includes as $file => $meta) {\n\t\t\t\t\t\t$packagesFile = $basePath . '/' . $file;\n\t\t\t\t\t\tif (file_exists($packagesFile) && sha1_file($packagesFile) == $meta->sha1) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!is_dir(dirname(($packagesFile)))) {\n\t\t\t\t\t\t\t\\TYPO3\\Flow\\Utility\\Files::createDirectoryRecursively(dirname($packagesFile));\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t$response = $this->browser->request($baseUrl . $file);\n\t\t\t\t\t\t\tfile_put_contents($packagesFile, $response->getContent());\n\t\t\t\t\t\t} catch(\\Exception $e) {\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($packageList->providers)) {\n\t\t\t\t$providers = get_object_vars($packageList->providers);\n\t\t\t\tif (!empty($providers)) {\n\t\t\t\t\tforeach ($providers as $file => $meta) {\n\t\t\t\t\t\t$packagesFile = $basePath . '/' . $file;\n\t\t\t\t\t\tif (file_exists($packagesFile) && sha1_file($packagesFile) == $meta->sha1) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!is_dir(dirname(($packagesFile)))) {\n\t\t\t\t\t\t\t\\TYPO3\\Flow\\Utility\\Files::createDirectoryRecursively(dirname($packagesFile));\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t$response = $this->browser->request($baseUrl . $file);\n\t\t\t\t\t\t\tfile_put_contents($packagesFile, $response->getContent());\n\t\t\t\t\t\t} catch(\\Exception $e) {\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$files = \\TYPO3\\Flow\\Utility\\Files::readDirectoryRecursively($basePath, '.json');\n\t\t\tforeach ($files as $file) {\n\t\t\t\t$packagesObject = json_decode(file_get_contents($file));\n\t\t\t\t$flowPackages = array_merge($flowPackages, $this->filterFlowPackages($packagesObject->packages));\n\t\t\t}\n\t\t}\n\t\t$flowPackagesFile = FLOW_PATH_DATA . 'Packages/packages-typo3-flow.json';\n\t\tfile_put_contents($flowPackagesFile, json_encode($flowPackages));\n\t\t$this->checkForNewPackages($flowPackages);\n\t}", "private function createRepository()\n {\n $this->output->write('Creating repository... ');\n\n try {\n $versionControlRepository = ($this->config->scm->type == 'gitlab') ?\n new VersionControlRepositoryGitLab($this->config) : new VersionControlRepositoryGitHub($this->config);\n $versionControlRepository->create($this->project);\n\n $this->output->writeln('<info>OK</info>');\n } catch (\\Exception $e) {\n $message = 'Error: '. $e->getMessage();\n $this->output->writeln('<error>'. $message .'</error>');\n throw new \\RuntimeException($message);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model=new Repository;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Repository']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Repository'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('admin'));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function commitAndPush()\n {\n try {\n // Add files to git index, commit and push to client remote\n $this->git->add()->all()->execute();\n $this->git->commit()->message($this->commit_msg)->execute();\n $this->git->push()->execute($this->client_remote, $this->branch);\n } catch (GitException $e) {\n $this->logger->error('Failed to commit to Git repository. Error: '\n . $e->getMessage());\n }\n }", "public function update($path = null)\n {\n $this->executeNpm(array('update'), $path);\n }", "public function create()\n {\n $form = $this->form(\n 'App\\Forms\\RepoForm',\n [\n 'method' => 'POST',\n 'url' => route('repos.store'),\n ]\n );\n\n return view('repos.create', compact('form'));\n\n }", "public function setRepository($var)\n {\n GPBUtil::checkString($var, True);\n $this->repository = $var;\n\n return $this;\n }", "public function setUpRepository($repository) {\n $path = $this->getGitRootPath().DIRECTORY_SEPARATOR.$repository->getPath();\n $this->getDriver()->activateHook('post-update', $path);\n $this->deployPostReceive($path);\n $id = $this->getDao()->save($repository);\n $repository->setId($id);\n $this->setUpMailingHook($repository);\n $this->changeRepositoryAccess($repository);\n $this->setRepositoryPermissions($repository);\n return true;\n }", "function add($repo_id,$arch_name){\n $this->layout = 'ajax';\n //Get the Arch ID for $arch_name\n $arch_ret = $this->Architecture->find('first',array('conditions'=>array('Architecture.name' =>$arch_name),'fields'=>array('Architecture.id')));\n $arch_id = $arch_ret['Architecture']['id'];\n\n //Get the name of the repository\n $repo_ret = $this->Repository->find('first',array('conditions'=>array('Repository.id' =>$repo_id),'fields'=>array('Repository.name')));\n $repo_name = $repo_ret['Repository']['name'];\n\n //Build the data structure\n $repoArch = array();\n $repoArch['Repoarch']['id'] = '';\n $repoArch['Repoarch']['repository_id'] = $repo_id;\n $repoArch['Repoarch']['architecture_id'] = $arch_id;\n\n $this->Repoarch->save($repoArch);\n $repoArch_id = $this->Repoarch->id;\n\n $this->Reprepro->archAdd($repo_name,$arch_name);\n\n $json_return['json']['status'] = 'ok';\n $json_return['repoarch']['id'] = $repoArch_id;\n\n $this->set('json_return',$json_return);\n }", "function git_is_repo($path) {\n\treturn GitUtil::isRepo($path);\n}", "public function actionUpdate($id)\n\t{\n $model=$this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if(isset($_POST['Repository']))\n {\n $model->attributes=$_POST['Repository'];\n if($model->save())\n $this->redirect(array('admin'));\n }\n\n $this->render('update',array(\n 'model'=>$model,\n ));\n\t}", "function rupdate() {\n\t\t$this->checkOnce();\n\t\t$deployPath = $this->getVersionPath();\n\t\t$branch = $this->branch ?: 'default';\n\t\t$remoteCmd = 'cd '.$deployPath.' && hg update -r '.$branch;\n\t\t$this->ssh_exec($remoteCmd);\n\t}", "private function importRepo( $repoName, $start = null, $cacheSize = 0 ) {\n\t\tglobal $wgCodeReviewImportBatchSize;\n\t\tstatic $adaptorReported = false;\n\n\t\t$repo = CodeRepository::newFromName( $repoName );\n\n\t\tif ( !$repo ) {\n\t\t\t$this->error( \"Invalid repo $repoName\" );\n\t\t\treturn;\n\t\t}\n\n\t\t$svn = SubversionAdaptor::newFromRepo( $repo->getPath() );\n\t\tif ( !$adaptorReported ) {\n\t\t\t$this->output( \"Using \" . get_class($svn). \" adaptor\\n\" );\n\t\t\t$adaptorReported = true;\n\t\t}\n\n\t\t$this->output( \"IMPORT FROM REPO: $repoName\\n\" );\n\t\t$lastStoredRev = $repo->getLastStoredRev();\n\t\t$this->output( \"Last stored revision: $lastStoredRev\\n\" );\n\n\t\t$chunkSize = $wgCodeReviewImportBatchSize;\n\n\t\t$startTime = microtime( true );\n\t\t$revCount = 0;\n\t\t$start = ( $start !== null ) ? intval( $start ) : $lastStoredRev + 1;\n\n\t\t/*\n\t\t * FIXME: when importing only a part of a repository, the given path\n\t\t * might not have been created with revision 1. For example, the\n\t\t * mediawiki '/trunk/phase3' got created with r1284.\n\t\t */\n\t\tif ( $start > ( $lastStoredRev + 1 ) ) {\n\t\t\t$this->error( \"Invalid starting point. r{$start} is beyond last stored revision: r\" . ($lastStoredRev + 1) );\n\t\t\treturn;\n\t\t}\n\n\t\t$this->output( \"Syncing from r$start to HEAD...\\n\" );\n\n\t\tif ( !$svn->canConnect() ) {\n\t\t\t$this->error( \"Unable to connect to repository.\" );\n\t\t\treturn;\n\t\t}\n\n\t\twhile ( true ) {\n\t\t\t$log = $svn->getLog( '', $start, $start + $chunkSize - 1 );\n\t\t\tif ( empty( $log ) ) {\n\t\t\t\t# Repo seems to give a blank when max rev is invalid, which\n\t\t\t\t# stops new revisions from being added. Try to avoid this\n\t\t\t\t# by trying less at a time from the last point.\n\t\t\t\tif ( $chunkSize <= 1 ) {\n\t\t\t\t\tbreak; // done!\n\t\t\t\t}\n\t\t\t\t$chunkSize = max( 1, floor( $chunkSize / 4 ) );\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t$start += $chunkSize;\n\t\t\t}\n\t\t\tif ( !is_array( $log ) ) {\n\t\t\t\tvar_dump( $log ); // @TODO: cleanup :)\n\t\t\t\t$this->error( 'Log entry is not an array! See content above.', true );\n\t\t\t}\n\t\t\tforeach ( $log as $data ) {\n\t\t\t\t$revCount++;\n\t\t\t\t$delta = microtime( true ) - $startTime;\n\t\t\t\t$revSpeed = $revCount / $delta;\n\n\t\t\t\t$codeRev = CodeRevision::newFromSvn( $repo, $data );\n\t\t\t\t$codeRev->save();\n\n\t\t\t\t$this->output( sprintf( \"%d %s %s (%0.1f revs/sec)\\n\",\n\t\t\t\t\t$codeRev->getId(),\n\t\t\t\t\twfTimestamp( TS_DB, $codeRev->getTimestamp() ),\n\t\t\t\t\t$codeRev->getAuthor(),\n\t\t\t\t\t$revSpeed ) );\n\t\t\t}\n\t\t\twfWaitForSlaves( 5 );\n\t\t}\n\n\t\tif ( $cacheSize !== 0 ) {\n\t\t\t$dbw = wfGetDB( DB_MASTER );\n\t\t\t$options = array( 'ORDER BY' => 'cr_id DESC' );\n\n\t\t\tif ( $cacheSize == \"all\" ) {\n\t\t\t\t$this->output( \"Pre-caching all uncached diffs...\\n\" );\n\t\t\t} else {\n\t\t\t\tif ( $cacheSize == 1 ) {\n\t\t\t\t\t$this->output( \"Pre-caching the latest diff...\\n\" );\n\t\t\t\t} else {\n\t\t\t\t\t$this->output( \"Pre-caching the latest $cacheSize diffs...\\n\" );\n\t\t\t\t}\n\t\t\t\t$options['LIMIT'] = $cacheSize;\n\t\t\t}\n\n\t\t\t// Get all rows for this repository that don't already have a diff filled in.\n\t\t\t// This is LIMITed according to the $cacheSize setting, above, so only the\n\t\t\t// rows that we plan to pre-cache are returned.\n\t\t\t// TODO: This was optimised in order to skip rows that already have a diff,\n\t\t\t//\t\t which is mostly what is required, but there may be situations where\n\t\t\t//\t\t you want to re-calculate diffs (e.g. if $wgCodeReviewMaxDiffPaths\n\t\t\t//\t\t changes). If these situations arise we will either want to revert\n\t\t\t//\t\t this behaviour, or add a --force flag or something.\n\t\t\t$res = $dbw->select( 'code_rev', 'cr_id',\n\t\t\t\tarray( 'cr_repo_id' => $repo->getId(), 'cr_diff IS NULL OR cr_diff = \"\"' ),\n\t\t\t\t__METHOD__,\n\t\t\t\t$options\n\t\t\t);\n\t\t\tforeach ( $res as $row ) {\n\t\t\t\t$repo->getRevision( $row->cr_id );\n\t\t\t\t$diff = $repo->getDiff( $row->cr_id ); // trigger caching\n\t\t\t\t$msg = \"Diff r{$row->cr_id} \";\n\t\t\t\tif ( is_integer( $diff ) ) {\n\t\t\t\t\t$msg .= \"Skipped: \" . CodeRepository::getDiffErrorMessage( $diff );\n\t\t\t\t} else {\n\t\t\t\t\t$msg .= \"done\";\n\t\t\t\t}\n\t\t\t\t$this->output( $msg . \"\\n\" );\n\t\t\t}\n\t\t} else {\n\t\t\t$this->output( \"Pre-caching skipped.\\n\" );\n\t\t}\n\t\t$this->output( \"Done!\\n\" );\n\t}", "function updateSourceBranching() {\n if ($this->isModuleInstalled('source')) {\n try {\n $source_commits_table = TABLE_PREFIX . 'source_commits';\n $commit_project_objects_table = TABLE_PREFIX . 'commit_project_objects';\n $source_repositories_table = TABLE_PREFIX . 'source_repositories';\n\n DB::execute(\"ALTER TABLE $source_commits_table ADD branch_name VARCHAR(255) DEFAULT '' AFTER commited_by_email\");\n DB::execute(\"ALTER TABLE $commit_project_objects_table ADD branch_name VARCHAR(255) DEFAULT '' AFTER revision\");\n\n // Add default branch for existing data\n\n DB::execute(\"UPDATE $source_commits_table SET branch_name = 'master' WHERE type = 'GitCommit'\");\n DB::execute(\"UPDATE $source_commits_table SET branch_name = 'default' WHERE type = 'MercurialCommit'\");\n\n $commit_project_objects = DB::execute(\"\n SELECT $commit_project_objects_table.id, $source_repositories_table.type\n FROM $commit_project_objects_table, $source_repositories_table\n WHERE $commit_project_objects_table.repository_id = $source_repositories_table.id\"\n );\n\n if (is_foreachable($commit_project_objects)) {\n foreach ($commit_project_objects as $commit_project_object) {\n if ($commit_project_object['type'] == 'GitRepository') {\n DB::execute(\"UPDATE $commit_project_objects_table SET branch_name = 'master' WHERE id = ?\", $commit_project_object['id']);\n } //if\n if ($commit_project_object['type'] == 'MercurialRepository') {\n DB::execute(\"UPDATE $commit_project_objects_table SET branch_name = 'default' WHERE id = ?\", $commit_project_object['id']);\n } //if\n } //foreach\n } //if\n\n DB::execute('INSERT INTO ' . TABLE_PREFIX . \"config_options (name, module, value) VALUES ('default_source_branch', 'source', 'N;')\");\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n } //if\n return true;\n }", "public function getRepos()\n {\n $success = true;\n\n // Check the DB to see if the repos already exist.\n $stmt = Db::$pdo->query(\"SELECT updated FROM config where item = 'lastRepoUpdate' LIMIT 1\");\n $logExists = $stmt->rowCount();\n $result = $stmt->fetch();\n\n // Use PHP time instead of MySQL so that we ensure the\n // timezone is consistent throughout the app.\n $nowDt = new \\DateTimeImmutable('now');\n $now = $nowDt->format('Y-m-d H:i:s');\n\n // If there is no log entry\n if (!$logExists) {\n\n // Update the repos\n $success = $this->saveUpdateRepos();\n if ($success) {\n // If they were saved properly,\n // insert a new entry for the time for the last repo update\n $stmt = Db::$pdo->prepare(\"INSERT INTO config\n (item, updated)\n VALUES ('lastRepoUpdate', :now )\");\n $stmt->bindParam(':now', $now);\n $stmt->execute();\n }\n\n } else { // There is a log entry\n\n // We're only going to update the repos every 15 min.\n // So lets check to see if they need to be updated.\n $lastUpdateDt = new \\DateTime($result['updated']);\n // go back 15 min\n $timeToUpdateDt = $nowDt->modify('-15 minutes');\n\n // Check to see if we need to update\n if ($lastUpdateDt < $timeToUpdateDt) {\n\n // Update the repos\n $success = $this->saveUpdateRepos();\n if ($success) {\n // If they were updated properly,\n // Update the time for the last repo update\n $stmt = Db::$pdo->prepare(\"UPDATE config\n SET updated = :now\n WHERE item = 'lastRepoUpdate' \");\n $stmt->bindParam(':now', $now);\n $stmt->execute();\n }\n }\n }\n\n // If there was a problem, return error\n if (!$success) {\n return [\n 'status' => 'error',\n 'message' => $this->error\n ];\n }\n\n // Get the total count from the db\n $stmt = Db::$pdo->prepare(\"SELECT amount FROM config\n WHERE item = 'totalRepos' LIMIT 1 \");\n $stmt->execute();\n\n $total = $stmt->fetch();\n $total = $total['amount'];\n\n\n // Get the repo info from the db\n $stmt = Db::$pdo->prepare(\"SELECT * FROM repos\");\n $stmt->execute();\n\n $items = $stmt->fetchAll();\n\n\n return [\n 'status' => 'success',\n 'total' => $total,\n 'items' => $items\n ];\n }", "abstract function is_org_repo_compliant();", "public static function updateExternals($path) {\n\t\tif (!file_exists($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path does not exist.\");\n\t\t}\n\n\t\tif (!is_dir($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a directory.\");\n\t\t}\n\n\t\tif (!self::isRepo($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a git repository.\");\n\t\t}\n\n\t\t$origCwd = getcwd();\n\t\tchdir($path);\n\n\t\t$updateCmd = sprintf(self::UPDATE_SUBMODULES_CMD);\n\t\tpassthru($updateCmd);\n\n\t\tchdir($origCwd);\n\t}", "public function getRepo()\n {\n return $this->repo;\n }", "private function _fetchGitRepository($url, $ref = 'master')\n\t{\n\t\t// Create a Git repository object within the system tmp folder for the url.\n\t\t$root = sys_get_temp_dir() . md5($url);\n\n\t\t// If the folder doesn't exist attempt to create it.\n\t\tif (!is_dir($root))\n\t\t{\n\t\t\tmkdir($root, 0777, true);\n\t\t}\n\n\t\t// Instantiate the repository object.\n\t\t$repo = new PackagerGitRepository($root);\n\n\t\t// Only clone the repository if it doesn't exist.\n\t\tif (!$repo->exists())\n\t\t{\n\t\t\t$repo->create();\n\t\t}\n\n\t\t// Get a clean checkout of the branch/tag required.\n\t\t$repo->fetch()\n\t\t\t->branchCheckout($ref)\n\t\t\t->clean();\n\n\t\treturn $root;\n\t}", "abstract public function repository();", "function devshop_project_create_step_git($form, $form_state) {\n $project = &$form_state['project'];\n \n drupal_add_js(drupal_get_path('module', 'devshop_projects') . '/inc/create/create.js');\n \n if ($project->verify_error) {\n $form['note'] = array(\n '#markup' => t('We were unable to connect to your git repository. Check the messages, edit your settings, and try again.'),\n '#prefix' => '<div class=\"alert alert-danger\">',\n '#suffix' => '</div>',\n );\n $form['error'] = array(\n '#markup' => $project->verify_error,\n );\n \n // Check for \"host key\"\n if (strpos($project->verify_error, 'Host key verification failed')) {\n $form['help'] = array(\n '#markup' => t('Looks like you need to authorize this host. SSH into the server as <code>aegir</code> user and run the command <code>git ls-remote !repo</code>. <hr />Add <code>StrictHostKeyChecking no</code> to your <code>~/.ssh/config</code> file to avoid this for all domains in the future.', array(\n '!repo' => $project->git_url,\n )),\n '#prefix' => '<div class=\"alert alert-warning\">',\n '#suffix' => '</div>',\n );\n }\n }\n \n if (empty($project->name)) {\n $form['title'] = array(\n '#type' => 'textfield',\n '#title' => t('Project Code Name'),\n '#required' => TRUE,\n '#suffix' => '<p>' . t('Choose a unique name for your project. Only letters and numbers are allowed.') . '</p>',\n '#size' => 40,\n '#maxlength' => 255,\n );\n }\n else {\n $form['title'] = array(\n '#type' => 'value',\n '#value' => $project->name,\n );\n $form['title_display'] = array(\n '#type' => 'item',\n '#title' => t('Project Code Name'),\n '#markup' => $project->name,\n );\n }\n \n $username = variable_get('aegir_user', 'aegir');\n \n $tips[] = t('Use the \"ssh\" url whenever possible. For example: <code>[email protected]:opendevshop/repo.git</code>');\n $tips[] = t('You can use a repository with a full Drupal stack committed, but using composer is recommended.');\n $tips[] = t('Use the !link project as a starting point for Composer based projects.', [\n '!link' => l(t('DevShop Composer Template'), 'https://github.com/opendevshop/devshop-composer-template'),\n ]);\n $tips[] = t('If a composer.json file is found in the root of the project, <code>composer install</code> will be run automatically.');\n $tips = theme('item_list', array('items' => $tips));\n \n $form['git_url'] = array(\n '#type' => 'textfield',\n '#required' => 1,\n '#title' => t('Git URL'),\n '#suffix' => '<p>' . t('Enter the Git URL for your project') . '</p>' . $tips,\n '#default_value' => $project->git_url,\n '#maxlength' => 1024,\n );\n\n//\n// // Project code path.\n// $form['code_path'] = array(\n// '#type' => variable_get('devshop_projects_allow_custom_code_path', FALSE) ? 'textfield' : 'value',\n// '#title' => t('Code path'),\n// '#description' => t('The absolute path on the filesystem that will be used to create all platforms within this project. There must not be a file or directory at this path.'),\n// '#required' => variable_get('devshop_projects_allow_custom_code_path', FALSE),\n// '#size' => 40,\n// '#default_value' => $project->code_path,\n// '#maxlength' => 255,\n// '#attributes' => array(\n// 'data-base_path' => variable_get('devshop_project_base_path', '/var/aegir/projects'),\n// ),\n// );\n//\n// // Project base url\n// $form['base_url'] = array(\n// '#type' => variable_get('devshop_projects_allow_custom_base_url', FALSE) ? 'textfield' : 'value',\n// '#title' => t('Base URL'),\n// '#description' => t('All sites will be under a subdomain of this domain.'),\n// '#required' => variable_get('devshop_projects_allow_custom_base_url', FALSE),\n// '#size' => 40,\n// '#default_value' => $project->base_url,\n// '#maxlength' => 255,\n// '#attributes' => array(\n// 'data-base_url' => devshop_projects_url($project->name, ''),\n// ),\n// );\n \n // Display helpful tips for connecting.\n $pubkey = variable_get('devshop_public_key', '');\n \n // If we don't yet have the server's public key saved as a variable...\n if (empty($pubkey)) {\n $output = t(\"This DevShop doesn't yet know your server's public SSH key. To import it, run the following command on your server as <code>aegir</code> user:\");\n $command = 'drush @hostmaster vset devshop_public_key \"$(cat ~/.ssh/id_rsa.pub)\" --yes';\n $output .= \"<div class='command'><input size='160' value='$command' onclick='this.select()' /></div>\";\n }\n else {\n // @TODO: Make this Translatable\n $output = <<<HTML\n <div class=\"empty-message\">If you haven't granted this server access to your Git repository, you should do so now using it's public SSH key.</div>\n <textarea id=\"rsa\" onclick='this.select()'>$pubkey</textarea>\nHTML;\n }\n \n // Add info about connecting to Repo\n $form['connect'] = array(\n '#type' => 'fieldset',\n '#title' => t('Repository Access'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n $form['connect']['public_key'] = array(\n '#markup' => $output,\n );\n return $form;\n}", "public function createGit()\n {\n if($GLOBALS['TL_CONFIG']['bx_git_path'])\n {\n $gitPath = TL_ROOT.$GLOBALS['TL_CONFIG']['bx_git_path'];\n }else{\n $gitPath = TL_ROOT.\"/\";\n }\n\n $git = new GitPhp\\GitRepository($gitPath);\n $git->init()->execute();\n \n //Set Remote\n $url = explode(\"://\", $GLOBALS['TL_CONFIG']['bx_git_host_url']);\n $git->remote()->setUrl('origin', $url[0].\"://\".$GLOBALS['TL_CONFIG']['bx_git_host_user'].\":\".$GLOBALS['TL_CONFIG']['bx_git_host_pass'].\"@\".$url[1]);\n }", "public function updateRepository($reset = true)\n\t{\n\t\t$this->command->info('Pulling changes');\n\t\t$tasks = array($this->scm->update());\n\n\t\t// Reset if requested\n\t\tif ($reset) {\n\t\t\tarray_unshift($tasks, $this->scm->reset());\n\t\t}\n\n\t\treturn $this->runForCurrentRelease($tasks);\n\t}", "private function oembed_github_repo ( $owner, $repository ) {\n\t\t$repo = $this->api->get_repo( $owner, $repository );\n\t\t$commits =$this->api->get_repo_commits( $owner, $repository );\n\n\t\t$response = new stdClass();\n\t\t$response->type = 'rich';\n\t\t$response->width = '10';\n\t\t$response->height = '10';\n\t\t$response->version = '1.0';\n\t\t$response->title = $repo->description;\n\n\t\t// @TODO This should all be templated\n\t\t$response->html = '<div class=\"github-embed github-embed-repository\">';\n\t\t$response->html .= '<p><a href=\"' . esc_attr( $repo->html_url ) . '\" target=\"_blank\"><strong>' . esc_html( $repo->description ) . '</strong></a><br/>';\n\t\t$response->html .= '<a href=\"' . esc_attr( $repo->html_url ) . '\" target=\"_blank\">' . esc_html( $repo->html_url ) . '</a><br/>';\n\t\t$response->html .= '<a href=\"' . esc_attr( $repo->html_url . '/network' ) . '\" target=\"_blank\">' . esc_html( number_format_i18n( $repo->forks_count ) ) . '</a> forks.<br/>';\n\t\t$response->html .= '<a href=\"' . esc_attr( $repo->html_url . '/stargazers' ) . '\" target=\"_blank\">' . esc_html( number_format_i18n( $repo->stargazers_count ) ) . '</a> stars.<br/>';\n\t\t$response->html .= '<a href=\"' . esc_attr( $repo->html_url . '/issues' ) . '\" target=\"_blank\">' . esc_html( number_format_i18n( $repo->open_issues_count ) ) . '</a> open issues.<br/>';\n\n\t\tif ( count( $commits ) ) {\n\t\t\t$cnt = 0;\n\t\t\t$response->html .= 'Recent commits:';\n\t\t\t$response->html .= '<ul class=\"github_commits\">';\n\t\t\tforeach ( $commits as $commit ) {\n\t\t\t\tif ( $cnt > 4 ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$response->html .= '<li class=\"github_commit\">';\n\t\t\t\t$response->html .= '<a href=\"https://github.com/' . $owner . '/' . $repository . '/commit/' . esc_attr( $commit->sha ) . '\" target=\"_blank\">' . esc_html( $commit->commit->message ) . '</a>, ';\n\t\t\t\t$response->html .= esc_html( $commit->commit->committer->name );\n\t\t\t\t$response->html .= '</li>';\n\t\t\t\t$cnt++;\n\t\t\t}\n\t\t\t$response->html .= '</ul>';\n\t\t}\n\t\t$response->html .= '</p>';\n\t\t$response->html .= '</div>';\n\t\theader( 'Content-Type: application/json' );\n\t\techo json_encode( $response );\n\t\tdie();\n\t}", "public function addFromRepository($name, $repository = 'default', array $vars = array())\n\t{\n\t\t// Load the Repository if necessary\n\t\tif (!($repository instanceof Repository))\n\t\t{\n\t\t\tif (!$this->repositories->exists($repository))\n\t\t\t{\n\t\t\t\tthrow new InvalidArgumentException(\"Repository '\" . $repository . \"' does not exist\");\n\t\t\t}\n\n\t\t\t$repository = $this->repositories->get($repository);\n\t\t}\n\n\t\t// Get the BBCode/tag config from the repository\n\t\t$config = $repository->get($name, $vars);\n\t\t$bbcodeName = $config['name'];\n\t\t$bbcode = $config['bbcode'];\n\t\t$tag = $config['tag'];\n\n\t\t// If the BBCode doesn't specify a tag name, it's the same as the BBCode\n\t\tif (!isset($bbcode->tagName))\n\t\t{\n\t\t\t$bbcode->tagName = $bbcodeName;\n\t\t}\n\n\t\tif ($this->collection->exists($bbcodeName))\n\t\t{\n\t\t\tthrow new RuntimeException(\"BBCode '\" . $bbcodeName . \"' already exists\");\n\t\t}\n\n\t\tif ($this->configurator->tags->exists($bbcode->tagName))\n\t\t{\n\t\t\tthrow new RuntimeException(\"Tag '\" . $bbcode->tagName . \"' already exists\");\n\t\t}\n\n\t\t// Add our BBCode then its tag\n\t\t$this->collection->add($bbcodeName, $bbcode);\n\t\t$this->configurator->tags->add($bbcode->tagName, $tag);\n\n\t\treturn $bbcode;\n\t}", "public function store(RepoRequest $request)\n {\n $repo = Repo::create($request->all());\n\n return redirect()->route('repos.show', $repo->id);\n }", "public function saveRepository($repositoryObject, $update = false)\n {\n // TODO: Implement saveRepository() method.\n }", "public function get_repo_data(){\n\n\t\t\treturn $this->get_repo();\n\n\t\t}", "function UpdateSVNRepoMember($repo, $user, $pass, $remove)\n{\n\tglobal $modSettings;\n\t\n\t$passwd_file = $modSettings['svnRoot'] . $repo . '/conf/passwd';\n\n\tif (!file_exists($passwd_file))\n\t\treturn false;\n\t\n\t// Grab all our users\n\t$data = parse_ini_file($passwd_file);\n\n\tif ($remove) // remove user\n\t{\n\t\tif (!isset($data[$user])) // TODO: Something other than returning false. Maybe split this function into Add/Remove\n\t\t\treturn false;\n\t\t\n\t\tunset($data[$user]); \n\t}\n\telse // add user\n\t{\n\t\t$data[$user] = $pass;\t\n\t}\n\t\n\t// Regenerate users file with new data\n\t$fp = fopen($passwd_file, \"w\");\n\tfwrite($fp, \"# Regenerated by PHP on \" . date('Y-m-d') . \"\\n\");\n\tfwrite($fp, \"[users]\\n\");\n\t\n\tforeach ($data as $u => $p)\n\t{\n\t\tfwrite($fp, $u . \"=\" . $p . \"\\n\");\n\t}\n\t\n\tfclose($fp);\n\t\n\treturn true;\n}", "function changeBranch(){\r\n\t\t// $gitpss = isset($_COOKIE['gitpss']) ? $_COOKIE['gitpss'] : '';\r\n\t\t// $repo = 'https://'.$gitusr.':'.$gitpss.'@github.com/nelsoft/nelsoft_inventory.git';\r\n\t\tchdir($_POST['path']);\r\n\t\texec('git clean -df');\r\n\t\texec('git checkout -- .');\r\n\t\t// exec('git fetch '.$repo);\r\n\t\texec('git checkout '.$_POST['branch'], $data);\r\n\t\t// exec('git pull '.$repo.' '.$_POST['branch'], $data);\r\n\r\n\t\t$return['version'] = '0.00';\r\n\t\t$return['version'] = getversion($_POST['path'], 'version');\t\r\n\t\t$return['data'] = $data;\r\n\r\n\t\tjdie($return);\r\n}", "protected function setupGitRepo()\n {\n $td = $this->getTestDir();\n\n $this->fs->removeDirectory($td);\n $this->fs->ensureDirectoryExists($td);\n\n $currentWorkDir = getcwd();\n chdir($td);\n\n $result = $this->process->execute(\"git init -q\");\n if ($result > 0) {\n throw new \\RuntimeException(\n \"Could not init: \" . $this->process->getErrorOutput());\n }\n $result = file_put_contents('b', 'a');\n if (false === $result) {\n throw new \\RuntimeException(\"Could not save file.\");\n }\n $result = $this->process->execute(\"git add b && git commit -m 'commit b' -q\");\n if ($result > 0) {\n throw new \\RuntimeException(\n \"Could not init: \" . $this->process->getErrorOutput());\n }\n chdir($currentWorkDir);\n }", "public static function update($path, $remote = 'origin', $branch = 'master') {\n\t\tif (!file_exists($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path does not exist.\");\n\t\t}\n\n\t\tif (!is_dir($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a directory.\");\n\t\t}\n\n\t\tif (!self::isRepo($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a git repository.\");\n\t\t}\n\n\t\t$origCwd = getcwd();\n\t\tchdir($path);\n\n\t\t$fetchCmd = sprintf(self::FETCH_CMD_TMPL, $remote);\n\t\tpassthru($fetchCmd);\n\n\t\t$mergeCmd = sprintf(self::MERGE_CMD_TMPL, $remote, $branch);\n\t\tpassthru($mergeCmd);\n\n\t\tchdir($origCwd);\n\t}", "function repositoryCustom()\n {\n }", "public static function is_repo($var) {\n\t\t\treturn (get_class($var) == 'GitRepo');\n\t\t}", "function attach_repository_id(&$value, $key, $id){\n $value['repo_id'] = $id;\n}", "function prueba_git ()\r\n{\r\n\t/* Aqui estaria el codigo de la funcion */\r\n\r\n}", "protected function pull()\n {\n $local_repo = $this->getLocalRepoPath();\n if (!is_dir($local_repo))\n {\n if(!mkdir($local_repo, 0777, true))\n {\n throw new Exception('Could not create directory '.$local_repo);\n }\n $this->execute('clone', array($this->getRemoteScmUrl(), $local_repo));\n }\n else\n {\n $cwd = getcwd();\n chdir($local_repo);\n $this->execute('pull', array(), array());\n chdir($cwd);\n }\n }", "protected function makeRepository()\n {\n if ($this->files->exists($path = $this->getRepositoryPath())) {\n return $this->error($this->className . ' already exists!');\n }\n $this->makeDirectory($path);\n $this->files->put($path, $this->compileRepositoryStub());\n $this->info('Repository created successfully.');\n }", "public function update(\n InstalledRepositoryInterface $repo,\n PackageInterface $initial,\n PackageInterface $target\n ) {\n parent::update($repo, $initial, $target);\n $this->pluginManager->removePlugin($initial);\n $this->pluginManager->addPlugin($target);\n $this->pluginManager->exportPlugins($this->filesystem);\n }", "private function do_commit_post()\n {\n // so will re-run 'porcelain' to get a list of files. We'll only 'git add'\n // any files supplied by the user that are in the list we get from porcelain\n // we'll then go ahead and commit them with the message supplied\n require_once 'Git-php-lib';\n $repo = Git::open('.');\n $status = $repo->porcelain();\n $git_files = array();\n foreach($status as $item) {\n $git_files[$item['file']] = $item['y'];\n }\n\n $to_add = array();\n $to_rm = array();\n foreach($_REQUEST['file'] as $requested_file) {\n if(array_key_exists($requested_file, $git_files)) {\n if($git_files[$requested_file] == 'D') {\n $to_rm[] = $requested_file;\n } else {\n $to_add[] = $requested_file;\n }\n }\n }\n\n $add_output = '';\n if(count($to_add) > 0) {\n try {\n $add_output = $repo->add($to_add);\n }\n catch(Exception $e) {\n $add_output = 'Failed to run git-add: ' . $e->getMessage();\n }\n }\n #$add_output = preg_replace('/\\r?\\n\\r?/', \"<br>\\n\", $add_output);\n if(count($to_rm) > 0) {\n $rm_output = '';\n try {\n $rm_output = $repo->rm($to_rm);\n }\n catch(Exception $e) {\n $rm_output = 'Failed to run git-rm: ' . $e->getMessage();\n }\n }\n\n $commit_output = '';\n try {\n $commit_output = $repo->commit($_REQUEST['message'], false);\n }\n catch(Exception $e) {\n $commit_output = 'Failed to run git-commit: ' . $e->getMessage();\n }\n #$commit_output = preg_replace('/\\r?\\n\\r?/', \"<br>\\n\", $add_output);\n\n if(file_exists('./plugins/pico_edit/commitresponse.html')) {\n $loader = new Twig_Loader_Filesystem('./plugins/pico_edit');\n $twig = new Twig_Environment($loader, array('cache' => null));\n $twig->addExtension(new Twig_Extension_Debug());\n $twig_vars = array(\n 'add' => $add_output,\n 'rm' => $rm_output,\n 'commit' => $commit_output,\n );\n $content = $twig->render('commitresponse.html', $twig_vars);\n die($content);\n } else {\n die('Sorry, commitresponse.html was not found in the backend plugin. This is an installation problem.');\n }\n }", "function store_on_db($repos){\r\n\r\n global $dbh;\r\n\r\n try {\r\n\r\n foreach($repos['items'] as $item){\r\n $item['owner']['full_name'] = isset($item['owner']['full_name']) ? $item['owner']['full_name'] : '';\r\n $item['owner']['email'] = isset($item['owner']['email']) ? $item['owner']['email'] : '';\r\n \r\n $sth = $dbh->prepare(\"INSERT INTO repositories (repository_id, username,fullname,email,repository_name,repository_description,repository_creation_date,repository_stars,repository_watchers,repository_forks) \r\n VALUES (:id,:owner_login,:owner_fullname,:owner_email,:repository_name,:repository_description,:repository_creation_date,:repository_stars,:repository_watchers,:repository_forks)\r\n ON DUPLICATE KEY UPDATE username = :owner_login, fullname = :owner_fullname,email = :owner_email,repository_name = :repository_name,repository_description = :repository_description,repository_creation_date = :repository_creation_date,repository_stars = :repository_stars,repository_watchers = :repository_watchers,repository_forks = :repository_forks ;\");\r\n \r\n $sth->bindParam(':id', $item['id']);\r\n $sth->bindParam(':owner_login', $item['owner']['login']);\r\n $sth->bindParam(':owner_fullname', $item['owner']['full_name']);\r\n $sth->bindParam(':owner_email', $item['owner']['email']);\r\n $sth->bindParam(':repository_name', $item['name']);\r\n $sth->bindParam(':repository_description', $item['description']);\r\n $sth->bindParam(':repository_creation_date', $item['created_at']);\r\n $sth->bindParam(':repository_stars', $item['stargazers_count']);\r\n $sth->bindParam(':repository_watchers', $item['watchers']);\r\n $sth->bindParam(':repository_forks', $item['forks']);\r\n \r\n $sth->execute();\r\n }\r\n \r\n return true;\r\n \r\n } catch (PDOException $e) {\r\n print \"Error!: \" . $e->getMessage() . \"<br/>\";\r\n die();\r\n return false;\r\n }\r\n \r\n}", "public function init_repo() {\n\n\t\t\t// include the repository configuration\n\t\t\t$repos = include_once(CONFIGPATH . 'repositories.php' );\n\n\t\t\t// the $_GET['deploy'] parameter from request\n\t\t\t$requested_deploy = filter_input( \\INPUT_GET, 'deploy', \\FILTER_SANITIZE_STRING );\n\n\t\t\t// assume that no repository is selected for deployment\n\t\t\t$selected = false;\n\n\t\t\t// if no deploy param was found, maybe pick up the first (and often, only) repository config\n\t\t\tif ( empty( $requested_deploy ) ) {\n\n\t\t\t\t$selected = $this->maybe_select_deploy( $repos[ 0 ], $requested_deploy );\n\n\t\t\t// otherwise, loop through repositories to select the requested one\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tforeach ( $repos as $deploy_config ) {\n\n\t\t\t\t\t$selected = $this->maybe_select_deploy( $deploy_config, $requested_deploy );\n\n\t\t\t\t\t// if we found one, break the loop\n\t\t\t\t\tif ( $selected === true ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// we didn't find any, throw an error\n\t\t\tif ( $selected === false ) {\n\t\t\t\terror(\n\t\t\t\t\t'501 Not Implemented', 'Configuration not found for the requested deploy'\n\t\t\t\t);\n\t\t\t}\n\t\t}", "public static function commit($repo, $msg) {\n\t\t$cmds =[\n\t\t\tString(self::ADD_ALL),\n\t\t\tString(self::COMMIT_CMD)->format($msg)\n\t\t];\n\n\t\treturn self::doInDir($repo, $cmds);\n\t}", "public function testGitHubRemoteRepository(): void\n {\n $repo = new GitHubRemoteRepository('r/r', './');\n $this->assertEquals('https://github.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "private function get_repository_info() {\n if ( is_null( $this->github_response ) ) {\n $request_uri = sprintf( 'https://api.github.com/repos/%s/%s/releases', $this->username, $this->repository );\n\n $response = json_decode( wp_remote_retrieve_body( wp_remote_get( $request_uri ) ), true );\n if( is_array( $response ) ) {\n $response = current( $response );\n }\n $this->github_response = $response;\n }\n }", "function do_pull($key,$url,$path) {\n $cmd = \"ssh-agent bash -c 'cd $path; ssh-add $key; git reset --hard; git pull' 2>&1\";\n _log(\"Exec command: $cmd\\n\");\n return shell_exec($cmd);\n}", "abstract protected function getRepoReleaseInfo();" ]
[ "0.6129277", "0.5973852", "0.5973852", "0.597261", "0.59263825", "0.5919797", "0.5918633", "0.5891231", "0.5827638", "0.5812186", "0.56793404", "0.5644102", "0.56429356", "0.5636921", "0.5635098", "0.56200767", "0.5596069", "0.5589346", "0.54708105", "0.54492444", "0.544648", "0.53748864", "0.5374616", "0.53484017", "0.5323291", "0.53117144", "0.5298578", "0.5288763", "0.52845275", "0.5260711", "0.52594376", "0.5255987", "0.5242402", "0.5235921", "0.52234286", "0.5200231", "0.5178956", "0.5176211", "0.5170299", "0.51594335", "0.5159088", "0.5153679", "0.51471823", "0.5140355", "0.51307607", "0.51257896", "0.51157254", "0.5106034", "0.5100726", "0.5083295", "0.5083109", "0.5070614", "0.5066138", "0.504775", "0.5038684", "0.5017552", "0.501395", "0.50046533", "0.5003637", "0.49993613", "0.49943092", "0.4981391", "0.49791235", "0.49759722", "0.49700728", "0.49671784", "0.49665794", "0.49513698", "0.49405175", "0.4935235", "0.49257076", "0.49169135", "0.4905776", "0.4888644", "0.48661906", "0.48572254", "0.48447782", "0.48426506", "0.48246193", "0.482457", "0.4816368", "0.48022205", "0.48017704", "0.47804993", "0.47758776", "0.47604126", "0.4751", "0.47471395", "0.4744329", "0.47317913", "0.4720261", "0.46980444", "0.46957758", "0.46955064", "0.46820268", "0.46675935", "0.4666863", "0.4659918", "0.46584165", "0.46322405", "0.46288383" ]
0.0
-1
Create a Message object
public function updateRepo(Bundle $bundle) { $message = array('bundle_id' => $bundle->getId()); if ($this->bundleUpdateProducer) { // RabbitMQ, publish my message! $this->bundleUpdateProducer->publish(json_encode($message)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createMessage()\n {\n $message = new Message(new Swift_Message);\n\n\n // If a global from address has been specified we will set it on every message\n // instances so the developer does not have to repeat themselves every time\n // they create a new message. We will just go ahead and push the address.\n if (isset($this->from['address'])) {\n $message->from($this->from['address'], $this->from['name']);\n }\n\n return $message;\n }", "protected function createMessage() {\n $config = $this->messageConfig;\n if (!array_key_exists('class', $config)) {\n $config['class'] = $this->messageClass;\n }\n $config['smser'] = $this;\n return Yii::createObject($config);\n }", "public function createMessage(): MessageInterface;", "protected function createMessage()\n\t{\n\t\t$config = $this->messageConfig;\n\t\tif (!array_key_exists('class', $config)) {\n\t\t\t$config['class'] = $this->messageClass;\n\t\t}\n\t\t$config['mailer'] = $this;\n\n\t\treturn Yii::createObject($config);\n\t}", "private function newMessage()\n {\n /* @var $config ModuleOptions */\n $config = $this->serviceLocator->get('EscoMail\\Options');\n\n $this->message = new Message();\n $this->message->setFrom($config->getMailSendFrom(), $config->getMailSendFromName());\n\n return $this->message;\n }", "public function create()\n {\n //\n $this->message->sendMessage();\n }", "public function createMailMessage();", "protected static function newMessage()\n {\n self::$message = \\Swift_Message::newInstance();\n }", "public function create(string $message = ''): BusMessageInterface;", "public function createMessage(string $typeName): MessageInterface;", "function createMessage($object) {\n\tglobal $USER;\n\t\n\t$message = new \\core\\message\\message();\n\t$message->component = 'local_littlehelpers';\n\t$message->name = 'paragraph52notification';\n\t$message->userfrom = $USER;\n\t\n\t// Get user\n\t$message->userto = core_user::get_user($object->useridto);\n\t\n\t// force email sending\n\t$message->userto->emailstop = 0;\n\t\n\t$message->subject = $object->subject;\n\t$message->fullmessage = $object->fullmessage;\n\t$message->fullmessageformat = FORMAT_MARKDOWN;\n\t$message->fullmessagehtml = $object->fullmessagehtml;\n\t$message->smallmessage = $object->smallmessage;\n\t$message->notification = '0';\n\t\n\t$message->contexturl = 'https://moodle.tu-darmstadt.de/local/littlehelpers/paragraph52';\n\t$message->contexturlname = 'Paragraph52';\n\t$message->replyto = \"[email protected]\";\n\n\treturn $message;\n}", "public function createMessage(array $parameters = []);", "public static function init( $_id )\n {\n $message = new Message();\n $message->get( $_id );\n return $message;\n }", "private function createMessageObject(string $type, string $message): Notification\n {\n $msg = new Notification();\n\n $msg->setType($type);\n $msg->setMessage($message);\n\n $this->handler->add($msg);\n\n return $msg;\n }", "public function user_message_create() {\n\t\t$this->onDebug ( __METHOD__, 1 );\n\t\tif ($this->valide_userid () == false) {\n\t\t\treturn $this;\n\t\t}\n\t\t$message_created = $this->getObjetO365Wsclient ()\n\t\t\t->jsonPostMethod ( '/users/' . $this->getUserId () . '/messages', $this->getEmailContent () );\n\t\t$this->onDebug ( $message_created, 2 );\n\t\tif (isset ( $message_created->id ) && ! empty ( $message_created->id )) {\n\t\t\treturn $this->setO356MessageRef ( $message_created )\n\t\t\t\t->setMessageId ( $message_created->id );\n\t\t}\n\t\treturn $this->onError ( 'Pas d\\'ID durant la creation du message de O365', $message_created, 1 );\n\t}", "public static function createInstance()\n {\n return new MailMessage('[email protected]');\n }", "public function createMimeMessage();", "function createMessage($email) {\n $message = new Google_Service_Gmail_Message();\n $message->setRaw(base64_encode($email));\n return $message;\n}", "public function createMessage($content, $options = array('content_type' => 'application/json', 'delivery_mode' => 2))\n {\n if (!empty($options['content_type']) && $options['content_type'] == 'application/json')\n $content = json_encode($content);\n return new AMQPMessage($content, $options);\n }", "public function initMessage() {}", "public static function createFromArray($fields) \n\t{\n\t\t$message = new Message();\n\t\tself::populate($message,$fields);\n\t\treturn $message;\n\t}", "public function addMessage()\n {\n if(null === $this->obj_message) {\n $this->obj_message = new Message();\n }\n return $this->obj_message;\n }", "public function message(mixed $data = null)\n {\n $message = new Message((string) $data);\n\n return $message;\n }", "public function createInstance()\n {\n $mock = $this->mock(static::TEST_SUBJECT_CLASSNAME)\n ->getMessage();\n\n return $mock->new();\n }", "static public function factory($messageType = 3) {\n\t\treturn new self($messageType);\n\t}", "protected function createMessage(Swift_Message $message)\n {\n $mimeEntity = new Swift_Message('', $message->getBody(), $message->getContentType(), $message->getCharset());\n $mimeEntity->setChildren($message->getChildren());\n\n $messageHeaders = $mimeEntity->getHeaders();\n $messageHeaders->remove('Message-ID');\n $messageHeaders->remove('Date');\n $messageHeaders->remove('Subject');\n $messageHeaders->remove('MIME-Version');\n $messageHeaders->remove('To');\n $messageHeaders->remove('From');\n\n return $mimeEntity;\n }", "public static function create( $msg, $code = null, array $data = null ) {\n\t\tif ( $msg instanceof IApiMessage ) {\n\t\t\treturn $msg;\n\t\t} elseif ( $msg instanceof RawMessage ) {\n\t\t\treturn new ApiRawMessage( $msg, $code, $data );\n\t\t} else {\n\t\t\treturn new ApiMessage( $msg, $code, $data );\n\t\t}\n\t}", "private function newMessage(array $data)\n {\n\n $message = Message::create([\n 'channel_id' => $data['channel_id'],\n 'user_id' => Auth::guard()->user()->id,\n 'message' => $data['message']\n ]);\n if ($message) {\n $this->notifyChannelUsers($data['channel_id']);\n }\n return $message;\n }", "public function testConstructorAndGetters() \r\n \t{\r\n \t\t// create a message with complete constructor args\r\n \t\t$message = new Message( Message::NORMAL, \r\n \t\t\t\t\t\t\t\t(object)array( 'testProp' => 'testval' ),\r\n \t\t\t\t\t\t\t\tsimplexml_load_string('<testMessage testAtt=\"Hello\" testAtt2=\"world\"/>'),\r\n \t\t\t\t\t\t\t\tMessage::PRIORITY_HIGH);\r\n \t\t\r\n \t\t// test assertions\r\n \t\t$this->assertTrue( $message instanceof Message, \"Expecting \\$message is Message\" );\r\n \t\t$this->assertTrue( $message->getType() == Message::NORMAL, \"Expecting \\$message->getType() == Message::NORMAL\" );\r\n \t\t$this->assertTrue( $message->getHeader()->testProp == 'testval', \"Expecting \\$message->getHeader()->testProp == 'testval'\" );\r\n \t\t$this->assertTrue( $message->getBody()->attributes()->testAtt == 'Hello', \"Expecting \\$message->getBody()->attributes()->testAtt == 'Hello'\" );\r\n \t\t$this->assertTrue( $message->getPriority() == Message::PRIORITY_HIGH, \"Expecting \\$message->getPriority() == Message::PRIORITY_HIGH\" );\r\n \t\t\r\n \t}", "protected function getMessage()\n {\n //return new \\Swift_Message('Test subject', 'Test body.');\n }", "public static function createFromString($raw)\n {\n $message = new self(array('raw' => $raw));\n return $message;\n }", "public function testCreateMessage()\n {\n $config = new Configuration();\n// $config->setHost(\"http://127.0.0.1:8080\");\n $apiInstance = new DaDaPushMessageApi(\n // If you want use custom http client, pass your client which implements `GuzzleHttp\\ClientInterface`.\n // This is optional, `GuzzleHttp\\Client` will be used as default.\n new \\GuzzleHttp\\Client(),\n $config\n );\n\n $actions = [\n new Action($data = array(\"name\" => \"view\", \"url\" => \"https://www.dadapush.com/\", \"type\" => \"link\"))\n ];\n\n $body = new MessagePushRequest($data = array(\"title\" => \"Good News!\",\n \"content\" => \"Good News! DaDaPush releasing new version\",\n \"need_push\" => true,\n \"actions\" => $actions\n ));\n\n $channel_token = 'ctb3lwO6AeiZOwqZgp8BE8980FdNgp0cp6MCf';\n\n $result = $apiInstance->createMessage($body, $channel_token);\n print_r($result);\n self::assertTrue($result->getCode()==0);\n }", "private function createMessage(InputInterface $input)\n {\n $message = new \\Swift_Message(\n $input->getOption('subject'),\n $input->getOption('body'),\n $input->getOption('content-type'),\n $input->getOption('charset')\n );\n $message->setFrom($input->getOption('from'));\n $message->setTo($input->getOption('to'));\n\n return $message;\n }", "public function getMessage($id = 1)\n {\n return new $this->_messageClass(array('handler' => $this, 'id' => $id, 'headers' => $this->_raw,\n 'noToplines' => true));\n }", "public function __construct(Message $message)\n {\n $this->message = $message;\n }", "public function __construct(Message $message)\n {\n $this->message = $message;\n }", "public function __construct(Message $message)\n {\n $this->message = $message;\n }", "public function __construct(Message $message)\n {\n $this->message = $message;\n }", "public function __construct(Message $message)\n {\n $this->message = $message;\n }", "protected static function newFactory()\n {\n return MessageFactory::new();\n }", "public static function create(string $text = null): GoogleChatMessage\n {\n $message = new static;\n\n if ($text) {\n $message->text($text);\n }\n\n return $message;\n }", "public function create() {\n\t\t$user = $this->current_user();\n\t\t$message = $this->discussion->create_message($this->message_data() + ['creator' => ['id' => $user->_id, 'name' => $user->name]]);\n\n\t\tif ($this->discussion->push_message($message)) {\n\t\t\treturn $this->redirect(['Discussions::show', 'id' => $this->discussion->_id, 'project_id' => $this->discussion->project_id]);\n\t\t}\n\n\t\treturn compact('message');\n\t}", "public function __construct($msg)\n {\n $this->message = $msg;\n }", "function message(Message $message);", "static function ArrayToMessage($array = array())\r\n {\r\n if ($array === null)\r\n {\r\n return null;\r\n }\r\n\r\n $Message = new Message($array['id'], \r\n $array['contest'], \r\n $array['idUserFrom'], \r\n $array['idUserTo'], \r\n $array['seen'], \r\n $array['received'], \r\n $array['time']);\r\n\r\n return $Message;\r\n }", "public function __construct($message) {\n $this->message= $message;\n }", "protected function createDocument(\\TYPO3\\Jobqueue\\Common\\Queue\\Message $message) {\n\t\t$properties = ObjectAccess::getGettableProperties($message);\n\t\t$messageDocument = new Message($message->getPayload(), $message->getIdentifier());\n\n\t\tforeach ($properties as $propertyName => $propertyValue) {\n\t\t\tObjectAccess::setProperty($messageDocument, $propertyName, $propertyValue);\n\t\t}\n\n\t\treturn $messageDocument;\n\t}", "private function get_message()\n {\n switch (self::$requestType) {\n case 'payRequest':\n self::$msg = sha1(self::$mid . self::$amount . self::$cac . self::$MsTxnId . self::$firstName . self::$familyName . self::$timeStamp, true);\n break;\n case 'payNote':\n self::$msg = sha1(self::$mid . self::$amount . self::$cac . self::$PspTxnId . self::$MsTxnId . self::$timeStamp . self::$Result, true);\n break;\n }\n }", "public static function create($message, $type = '', $title = '', $icon = '')\n {\n return new self($message, $type, $title, $icon);\n }", "public function getGeneratedMessage()\n {\n # Force the template to render\n (string) $this->prepareTemplate();\n\n $m = $this->template->__message;\n\n if (!$m->getFrom()) {\n trigger_error(\"You should add 'from' information.\", E_USER_WARNING);\n }\n\n if (!$m->getSubject()) {\n trigger_error(\"You should add 'subject'.\", E_USER_WARNING);\n }\n\n if (!$m->getHeader('To')) {\n trigger_error(\"You should add recipients.\", E_USER_WARNING);\n }\n\n foreach ($this->attachments as $attachment) {\n list($filename, $content, $type) = $attachment;\n $m->addAttachment($filename, $content, $type);\n }\n\n return $m;\n }", "abstract public function messageObject(BCTObject $to, array $message);", "protected abstract function _message();", "public function testCreateWithoutId()\n {\n $faker = Factory::create();\n $messageAttributes = [\n 'body' => $faker->sentence(15),\n 'subject' => $faker->sentence(5),\n 'name' => $faker->name(),\n 'email' => $faker->email(),\n 'custom_info' => $faker->sentence(3)\n\n ];\n $response = $this->client->messages()->create($messageAttributes);\n $this->assertEquals($messageAttributes['body'], $response['message']['body']);\n $this->assertEquals($messageAttributes['subject'], $response['message']['subject']);\n\n return $response;\n }", "public function __construct($message)\r\n {\r\n $this->message = $message;\r\n\r\n }", "public function __construct($message)\n {\n // $this->message = $message;\n }", "public function __construct($message = null) {}", "public static function createMessage(array $parameters)\n {\n $missing = [];\n foreach (self::$required as $required) {\n if (in_array($required, $parameters)) {\n continue;\n }\n $missing[] = $required;\n }\n if (!empty($missing)) {\n $plural = count($missing) > 1 ? 's' : '';\n $missingStr = implode(', ', $missing);\n $message = sprintf(\n 'Cannot create message: Missing parameter%s: %s',\n $plural,\n $missingStr\n );\n throw new \\Exception($message);\n }\n $name = isset($parameters['queue_name']) ? $parameters['queue_name'] : self::NAME;\n return new PlainMessage($name, $parameters);\n }", "public function test_message_can_be_created() {\n\n $this->assertInstanceOf(Message::class, $this->message);\n $this->assertDatabaseHasMessageWithPublicId($this->message->getPublicId());\n\n }", "abstract public function get_message();", "protected function render(): Message\n {\n $headers = '';\n foreach ($this->buildHeaders() as $header => $value) {\n $headers .= \"{$header}: {$value}\" . self::CRLF;\n }\n $message = implode(self::CRLF, $this->buildMessage());\n\n return new Message($headers, $message);\n }", "public static function create(string $text, User $author, ?Message $parent = null): Message {\n $message = new Message;\n $message->setText($text);\n $message->setAuthor($author);\n $message->setPublicId(Message::generatePublicId());\n if ($parent) {\n $depth = Message::getDepthOfMessage($parent) + 1;\n $message->setParentMessage($parent);\n $limit = (int) getenv('message_reply_limit');\n if ($depth > $limit) {\n throw new ReplyDepthException(sprintf('message was posted as a reply at a greater depth \"%d\" than allowed \"%d\"', $depth, $limit));\n }\n }\n $message->store();\n return $message;\n }", "public function __construct($data)\n {\n $this->message = $data;\n }", "public function __construct($data)\n {\n $this->message = $data;\n }", "public function __construct($message, $type)\n\t{\n\t\t$this->message = $message;\n\t\t$this->type = $type;\n\t}", "public static function obtainFromJSON($json) {\n $msgJSONDecode = json_decode( stripslashes($json) );\n \n $issue = $msgJSONDecode->issue;\n $message = $msgJSONDecode->message;\n $email = $msgJSONDecode->email;\n \n return new Message($issue, $message, $email); \n }", "protected function _createMessage($messageKey, $value)\n {\n\n return $value;\n }", "public function __construct($message='1111222333',$type='2222')\n {\n $this->type = $type;\n $this->message = $message;\n }", "function constructMessage($data, $length) {\n\n $command[0] = 2;\n $command[1] = 2;\n $command[2] = 6;\n\n $isResponse = 0;\n\n $msg[0] = $length % 256;\n $msg[1] = (int) ($length / 256);\n $msg[2] = 0;\n $msg[3] = 0;\n $msg[4] = 1; // group address. kokeilisko 1\n $msg[5] = 1; // unit address. kokeilisko 1\n $msg[6] = $this->sequence % 256;\n $msg[7] = (int) ($this->sequence / 256);\n $msg[8] = $command[0];\n $msg[9] = $command[1];\n $msg[10] = $command[2];\n $msg[11] = $isResponse;\n\n for ($i = 12; $i < 12 + strlen($data); $i++) {\n $msg[$i] = ord($data[$i - 12]);\n }\n\n $sum = array_sum($msg);\n $checksum1 = $sum % 256;\n $checksum2 = (int) ($sum / 256);\n\n $this->sequence++;\n\n for ($i = 0; $i < count($msg); $i++) {\n $chrMsg = $chrMsg . chr($msg[$i]);\n }\n\n $message = 'U' . chr(0xa7) . chr($checksum1) . chr($checksum2) . $chrMsg;\n\n return $message;\n }", "public static function createMessage(array $parameters)\n {\n $missing = [];\n foreach (self::$required as $required) {\n if (in_array($required, $parameters)) {\n continue;\n }\n $missing[] = $required;\n }\n if (!empty($missing)) {\n $plural = count($missing) > 1 ? 's' : '';\n $missingStr = implode(', ', $missing);\n $message = sprintf(\n 'Cannot create message: Missing parameter%s: %s',\n $plural,\n $missingStr\n );\n throw new \\Exception($message);\n }\n\n if (array_key_exists('queue_name', $parameters)) {\n $name = $parameters['queue_name'];\n } else {\n $queue_config = Config::getInstance()->load('queue');\n $name = $queue_config['ctest_submission_queue'];\n }\n return new PlainMessage($name, $parameters);\n }", "public function __construct(Message $message)\n {\n parent::__construct($message);\n }", "public function testSendMessageRequiredParams()\n {\n // Configure HTTP basic authorization: basicAuth\n $config = Configuration::getDefaultConfiguration()\n ->setUsername('YOUR_USERNAME')\n ->setPassword('YOUR_PASSWORD');\n\n $expected_code = 202;\n // Create a mock response\n $expected = new \\Karix\\Model\\MessageCreatedResponse();\n // Create a mock handler\n $mock = new \\GuzzleHttp\\Handler\\MockHandler([\n new \\GuzzleHttp\\Psr7\\Response($expected_code, [], $expected),\n ]);\n $handler = \\GuzzleHttp\\HandlerStack::create($mock);\n $client = new \\GuzzleHttp\\Client(['handler' => $handler]);\n\n $apiInstance = new Api\\MessageApi(\n $client,\n $config\n );\n $message = new \\Karix\\Model\\CreateMessage();\n\n $_tempVal = $message;\n $message = null;\n try {\n $result = $apiInstance->sendMessage($message);\n $this->fail(\"No exception when calling MessageApi->sendMessage with null message\");\n } catch (\\InvalidArgumentException $e) {\n $this->assertEquals('Missing the required parameter $message when calling sendMessage', $e->getMessage());\n }\n $message = $_tempVal;\n }", "public function actionCreate() {\n if (isset($_POST['Message'])) {\n $resp = array(\n 'color' => '#FF6600',\n 'background_color' => '#FFFFCC',\n 'position' => 'top',\n 'removebutton' => 0,\n 'translation' => $_POST['Message']['translation']\n );\n $model = new Message();\n $model->setAttributes($_POST['Message']);\n if ($model->save()) {\n $resp['message'] = Yii::t('translate', 'Message successfully saved');\n $resp['id'] = $model->id;\n } else {\n $errors = $this->errors($model);\n $resp['message'] = Yii::t('translate', '<p>Unable to save the message. Something went wrong!<p/>' . implode('<br/>', $errors));\n }\n echo $this->je($resp);\n Yii::app()->end();\n }\n $id = (int)Yii::app()->request->getParam('id');\n $lang = Yii::app()->request->getParam('lang');\n if ($id && $lang) {\n $model = MessageSource::model()->findByPk($id);\n if ($model) {\n $message = $model->loadMessage();\n $message->id = $model->id;\n $message->language = $lang;\n $this->renderPartial('form', array(\n 'model' => $message\n ));\n } else throw new CHttpException(400);\n } else throw new CHttpException(404, 'The requested page does not exist.');\n }", "public static function factory($raw_message = null, $class_name = null) {}", "public function __construct($message = '', $type = 'info') {\n $this->message = $message;\n }", "public static function createFromFile(string $path) : CommitMessage\n {\n if (!file_exists($path)) {\n throw new \\RuntimeException('Commit message file not found');\n }\n return new CommitMessage(file_get_contents($path));\n }", "public function createMessageRequest($parameters): MessageRequest\n {\n $messageRequest = new MessageRequest();\n $messageRequest->setSensorAlternateId($parameters->getOnboardResponse()->getSensorAlternateId());\n $messageRequest->setCapabilityAlternateId($parameters->getOnboardResponse()->getCapabilityAlternateId());\n\n $messages = [];\n foreach ($parameters->getEncodedMessages() as $encodedMessage) {\n $message = new Message();\n $message->setContent($encodedMessage);\n $message->setTimestamp(UtcDataService::nowAsUnixTimestamp());\n array_push($messages, $message);\n }\n $messageRequest->setMessages($messages);\n return $messageRequest;\n }", "public function __construct($message)\n {\n $this->message = $message;\n }", "public function __construct($message)\n {\n $this->message = $message;\n }", "public function __construct($message)\n {\n $this->message = $message;\n }", "public function __construct($message)\n {\n $this->message = $message;\n }", "public function __construct($message)\n {\n $this->message = $message;\n }", "public function __construct($message)\n {\n $this->message = $message;\n }", "public function __construct(MimeMessage $message = null) {\n $this->htmlBody = new MimePart();\n $this->htmlBody->type = Mime::TYPE_HTML;\n $this->htmlBody->charset = 'utf-8';\n $this->htmlBody->encoding = Mime::ENCODING_QUOTEDPRINTABLE;\n\n $this->textBody = new MimePart();\n $this->textBody->type = Mime::TYPE_TEXT;\n $this->textBody->charset = 'utf-8';\n $this->textBody->encoding = Mime::ENCODING_QUOTEDPRINTABLE;\n }", "protected function createMessage(array $parameters): MessageInterface\n {\n // Expect a transaction status message if the txaction parameter is present.\n if (isset($parameters['txaction'])) {\n return $this->createTransactionStatusMessage($parameters);\n }\n\n throw new ProcessorException(\"Failed notification processing, cannot create notification message from parameters.\");\n }", "public function testAddMessage()\n {\n $message1 = new Hostingcheck_Message('Foo message');\n $result = new Hostingcheck_Result_Info();\n $result->addMessage($message1);\n $this->assertEquals(array($message1), $result->messages());\n\n $message2 = new Hostingcheck_Message('Bar message');\n $result->addMessage($message2);\n $this->assertEquals(array($message1, $message2), $result->messages());\n\n $this->assertTrue($result->hasMessages());\n }", "public function actionCreate()\n {\n $model = new Message();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n return view('materialadmin::message.create');\n }", "public function create(array $options = array())\n {\n $body = (isset($options['body']) ? $options['body'] : array());\n\n $response = $this->client->post('/users/'.rawurlencode($this->user_id).'/messages', $body, $options);\n\n return $response;\n }", "public function testCreateMethodReturnsNewInstance(): void\n {\n $message = DiscordMessage::create();\n $this->assertInstanceOf(DiscordMessage::class, $message);\n }", "public static function getInstance($context=null) {\n return new Messages($context);\n }", "public function __construct($messageDefinition)\n {\n $this->messageDefintion = $messageDefinition;\n }", "public function compose() {\n return $this->createMessage();\n }", "public function __construct(Message $message, User $user)\n {\n $this->message = $message;\n $this->user = $user;\n }", "function createMessage( $message=null ){\n global $mysqli;\n $msg = (object) $message;\n $command = $mysqli->real_escape_string($msg->command);\n $category = $mysqli->real_escape_string($msg->category);\n $bindings = $mysqli->real_escape_string($msg->bindings);\n $block_index = $mysqli->real_escape_string($msg->block_index);\n $message_index = $mysqli->real_escape_string($msg->message_index);\n $timestamp = $mysqli->real_escape_string($msg->timestamp);\n $results = $mysqli->query(\"SELECT message_index FROM messages WHERE `message_index`='{$message_index}' LIMIT 1\");\n if($results){\n if($results->num_rows==0){\n $sql = \"INSERT INTO messages (message_index, block_index, command, category, bindings, timestamp) values ('{$message_index}','{$block_index}','{$command}','{$category}','{$bindings}','{$timestamp}')\";\n } else {\n $sql = \"UPDATE messages SET block_index='{$block_index}', command='{$command}', category='{$category}', bindings='{$bindings}', timestamp='{$timestamp}' WHERE message_index='{$message_index}'\";\n }\n $results = $mysqli->query($sql);\n if(!$results){\n byeLog('Error while trying to create or update record in messages table');\n }\n } else {\n byeLog('Error while trying to lookup record in messages table');\n }\n}", "public function toMessageTypeObject() {}", "public function makeBusMessage(Envelope $envelope): BusMessageInterface;", "public function getFirstMessageObj()\r\n {\r\n $tMsg = new TicketMessage($this->messages[0]);\r\n \r\n if($tMsg->isValid())\r\n {\r\n throw new Exception(__METHOD__.\" unable to get ticket\");\r\n }\r\n \r\n return $tMsg;\r\n }", "public static function getMessage(ConfigObject $config)\n {\n $message = new Message();\n\n $message->setCharset($config->get('CharacterSet', 'utf-8'));\n $message->setMaxLineLength($config->get('MaxLineLength', 78));\n\n if ($config->get('Priority', false)) {\n $message->setPriority($config->get('Priority', 3));\n }\n\n if ($config->get('Sender', false)) {\n $message->setSender($config->get('Sender.Email', 'me@localhost'), $config->get('Sender.Name', null));\n\n // Fix/Hack (wasn't in headers before)\n $message->setFrom($config->get('Sender.Email', 'me@localhost'), $config->get('Sender.Name', null));\n }\n\n return $message;\n }", "public function message( $msg ) {\n $this->message = $msg;\n return $this;\n }", "public function newMessage(Request $request)\n {\n\n if ($this->user_id != $request['shop_owner_id']) {\n\n $conversation = Conversation::firstOrCreate([\n \"user_id\" => $this->user_id,\n \"shop_owner_id\" => $request['shop_owner_id']\n ]);\n\n $conversation->update([\n \"last_sender_id\" => $this->user_id,\n \"last_message\" => $request['text']\n ]);\n\n $msg = Message::create([\n \"conversation_id\" => $conversation->id,\n \"sender_id\" => $this->user_id,\n \"text\" => $request['text']\n ]);\n\n return response()->json($msg, 200);\n }\n\n return response()->json(\"User can not start a conversation with itself\", 401);\n }", "public function mailChatNewMessage(Request $request)\n {\n $user = new User(['firstname' => 'Max', 'lastname' => 'Mustermann']);\n $chat_message = new ChatMessage(['chat_id' => 1, 'message' => 'MESSAGE']);\n \n $mail = new Mail\\ChatNewMessage($user, $chat_message, \"TITLE\");\n \n return $mail;\n }" ]
[ "0.8263152", "0.80850446", "0.79337305", "0.7672611", "0.763888", "0.73682535", "0.7334351", "0.7306845", "0.7219514", "0.7120448", "0.7018389", "0.7007606", "0.69043875", "0.68629056", "0.6835611", "0.6792952", "0.6777523", "0.67773926", "0.6759404", "0.6746609", "0.6714611", "0.66818273", "0.66461164", "0.66348773", "0.65924966", "0.65194166", "0.6514719", "0.65122914", "0.6501767", "0.64739347", "0.6363707", "0.63305515", "0.6304893", "0.63028", "0.62887645", "0.62887645", "0.62887645", "0.62887645", "0.62887645", "0.628097", "0.62529737", "0.6240276", "0.61857826", "0.6112642", "0.61033154", "0.6086474", "0.6082725", "0.60796565", "0.6069413", "0.6066264", "0.6062332", "0.60583925", "0.6055893", "0.60547674", "0.60544926", "0.60395575", "0.60221934", "0.60063195", "0.5982527", "0.5963576", "0.5953318", "0.5950246", "0.5950246", "0.59468585", "0.5943905", "0.5921418", "0.5920097", "0.59186214", "0.59107965", "0.59005415", "0.5897881", "0.5888427", "0.58806986", "0.58713686", "0.58651644", "0.5864404", "0.58637196", "0.58637196", "0.58637196", "0.58637196", "0.58637196", "0.58637196", "0.58595324", "0.5849959", "0.58415395", "0.58068854", "0.5804672", "0.5801823", "0.5795983", "0.578697", "0.57771844", "0.57730764", "0.57638884", "0.5763304", "0.57626426", "0.57615113", "0.575294", "0.5739053", "0.57291275", "0.57259136", "0.57155114" ]
0.0
-1
Transforms first column of query result to PHP array (with keys 0, 1, 2, ...)
static function result2Array(&$result) { $return_array = array(); if (@mysql_num_rows($result) != 0) { while ($row = mysql_fetch_assoc($result)) { $keys = array_keys($row); $return_array[] = $row[$keys[0]]; } mysql_free_result($result); } return $return_array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function db_result_to_array($result) {\n $res_array = array();\n \n for ($count=0; $row = $result->fetch_assoc(); $count++) {\n $res_array[$count] = $row;\n }\n \n return $res_array;\n }", "function db_result_to_array($result) {\r\n $res_array = array();\r\n\r\n for ($count = 0; $row = $result->fetch_assoc(); $count++) {\r\n $res_array[$count] = $row;\r\n }\r\n return $res_array;\r\n }", "function convertToArray( $result ){\n $resultArray = array();\n\n for( $count=0; $row = $result->fetch_assoc(); $count++ ) {\n $resultArray[$count] = $row;\n }\n\n return $resultArray;\n }", "function sqlToArray($sqlResult){\n $arr = [];\n while ($line = mysqli_fetch_array($sqlResult)) {\n $arr [] = $line[0];\n }\n return $arr;\n}", "function db_result_to_array($result) {\n $res_array = array();\n\n for ($count=0; $row = $result->fetch_assoc(); $count++) {\n $res_array[$count] = $row;\n }\n\n return $res_array;\n}", "function sql_new_fetch_into_array($query) {\n\treturn sql_fetch_column($query);\n}", "function db_result_to_array($result){\n\t\t\t\t\t\t\t$res_array = array();\n\n\t\t\t\t\t\t\tfor($count=0; $row= @mysql_fetch_array($result); $count++)\n\t\t\t\t\t\t\t\t$res_array[$count] = $row;\n\t\t\t\t\t\t\treturn $res_array;\n\t\t\t\t\t\t}", "function resultSet2array($myrst) {\n $resultset = null;\n $row = 0;\n while ($myrow = mysql_fetch_array($myrst)) {\n $col = 0;\n foreach ($myrow as $column) {\n $resultset[$row][$col]=$myrow[$col++];\n }\n $row++;\n }\n return $resultset;\n}", "function resultToArray($result) {\n $rows = array();\n while($row = $result->fetch_assoc()) {\n $rows[] = $row;\n }\n return $rows;\n }", "function resultToArray($result) {\n\t\t$rows = array();\n\t\twhile($row = $result->fetch_assoc()) {\n\t\t\t$rows[] = $row;\n\t\t}\n\t\treturn $rows;\n\t}", "function mysql_fetch_array_1d($res) {\n\twhile($row=mysql_fetch_array($res)) {\n\t\tif (!(empty($row[0]))){\n\t\t\t$return[] = $row[0];\n\t\t}\n }\n return $return;\n}", "public function scalarArray()\n {\n if($this->result_array) {\n $arr = array();\n $keys = array_keys($this->result_array[0]);\n foreach($this->result_array as $v) {\n $arr[] = $v[$keys[0]];\n }\n return $arr;\n }\n return [];\n }", "public function fetchColumn() {\r\n\t\t$result = array();\r\n\r\n\t\twhile ($data = $this->fetch()) {\r\n\t\t\t$result[] = current($data);\r\n\t\t}\r\n\r\n\t\t$this->freeResult();\r\n\r\n\t\treturn $result;\r\n\t}", "public function toColumn(): array\n {\n return $this->pdoStatement->fetchAll(\\PDO::FETCH_COLUMN, 0);\n }", "function result_to_array($results) {\n $items = [];\n while ($item = mysqli_fetch_array($results)) {\n $items[] = $item;\n }\n return $items; \n }", "function dbgetarray() {\n\t$output = array();\n\t\n\t$args = func_get_args();\n\t$result = call_user_func_array('dbquery', $args);\n\t$query = array_shift($args);\n\n\t// this only applies to SELECT queries!\n\tif (preg_match('/^SELECT/i', $query)) {\n\t\twhile ($result && $row = dbfetch($result, DB_NUM)) {\n\t\t\tif (count($row) == 1) { // use integer keys\n\t\t\t\t$output[] = $row[0];\n\t\t\t} else if (count($row) == 2) { // use first column keys\n\t\t\t\t$output[$row[0]] = $row[1];\n\t\t\t} else { // use integer keys and array values\n\t\t\t\t$output[] = $row;\n\t\t\t}\n\t\t}\n\t\tdbfree($result);\n\t} else {\n\t\tEWarning(EC_REALS_DATABASE, \"dbgetarray called with non-SELECT query!\", \"Non-select query\");\n\t}\n\n\treturn $output;\n}", "public function getToArray()\n {\n $row = [];\n foreach (array_keys($this->columns) as $column) {\n $row[$column] = trim($this->getColumnValue($column));\n }\n return $row;\n }", "private function sqlResToArray($res) { //appends sql query result to php array\n\t\t$phpArray = array();\n\t\t$res->data_seek(0);\n while ($row = $res->fetch_assoc()) {\n $phpArray[] = $row;\n }\n\t\treturn $phpArray;\n\t}", "public function fetch_array()\n\t{\n\t\t$array = array();\n\t\tif (current($this->result)) {\n\t\t\tforeach (current($this->result) AS $value) {\n\t\t\t\t$array[] = $value;\n\t\t\t}\n\t\t\tforeach (current($this->result) AS $key => $value) {\n\t\t\t\t$array[$key] = $value;\n\t\t\t}\n\t\t}else {\n\t\t\t$array = FALSE;\n\t\t}\n\t\tnext($this->result);\n\t\treturn $array;\n\t}", "function sql_fetch_array($res)\n {\n $results = array();\n if ($res)\n $results = $res->fetch(PDO::FETCH_BOTH);\n return $results;\n }", "function getRowAsArray($query) {\n\t\topenDatabaseConnection();\n\t\t$result = mysql_query($query) or die(\"Invalid query: \" . mysql_error());\n\t\t# turn the result into an array\n\t\treturn mysql_fetch_assoc($result);\n\t}", "function obtenerArray(){\r\n\t\treturn mysql_fetch_array( $this->rs() );\r\n\t}", "public function sql_fetch_array($result) {\n return @mysql_fetch_array($result);\n }", "public function result_column($column)\n {\n $output = array();\n\n if (is_bool($this->result))\n {\n return $output;\n }\n\n while ($row = $this->result->fetch_assoc())\n {\n $output[] = $row[$column];\n }\n\n $this->free_result();\n\n return $output;\n }", "function res2array($res) {\n if(!$res) return array();\n while($row=mysql_fetch_assoc($res)){\n $array[] = $row;\n }\n return $array;\n}", "function resultToArray($result,$fields,$encoding='')\r\n\t{\r\n\t\t$result_array = array();\r\n\t\twhile ($one_row=mysql_fetch_assoc($result))\r\n\t\t\t\t$result_array[]=$one_row;\r\n\t\treturn $result_array;\r\n\t}", "private function queryFetchAsValues(mysqli_result $result)\n\t{\n\t\t$column = $result->field_count - 1;\n\t\t$values = [];\n\t\twhile ($element = $result->fetch_row()) {\n\t\t\tif (isset($element['id'])) {\n\t\t\t\t$values[$element['id']] = $element[$column];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$values[] = $element[$column];\n\t\t\t}\n\t\t}\n\t\treturn $values;\n\t}", "private function resultToArray($res) {\r\n\r\n $lista = array();\r\n $i = 0;\r\n\r\n\t\t\tif($this->response) {\r\n\r\n\t while ($fila = mysql_fetch_assoc($this->response)) {\r\n\t $lista[$i] = $fila;\r\n\t $i = $i + 1;\r\n\t }\r\n\r\n\t\t\t}\r\n\r\n return $lista;\r\n\r\n }", "public function result_array()\n {\n $output = array();\n\n if (is_bool($this->result))\n {\n return $output;\n }\n\n while ($row = $this->result->fetch_assoc())\n {\n $output[] = $row;\n }\n\n $this->free_result();\n\n return $output;\n }", "public function toArray(){\n\t\treturn json_decode(json_encode($this->rows), true);\n\t}", "public static function toArray() {\n $str = \"\n SELECT id, firstName, lastName, email, password\n FROM indPrj_persons\";\n \n // Obtain an array of persons records.\n $records = Database::query($str);\n \n // Push each row into a new array to be outputted.\n $x = 0;\n $output = array();\n while($row = mysql_fetch_array($records)){\n $output[$x]['id'] = $row['id'];\n $output[$x]['firstName'] = $row['firstName'];\n $output[$x]['lastName'] = $row['lastName'];\n $output[$x]['email'] = $row['email'];\n $output[$x]['password'] = $row['password'];\n $x++;\n }\n \n return $output;\n }", "private function mysql_fetch_full_result_array($result)\n {\n $table_result=array();\n $r=0;\n while($row = mysql_fetch_assoc($result)){\n $arr_row=array();\n $c=0;\n while ($c < mysql_num_fields($result)) { \n $col = mysql_fetch_field($result, $c); \n $arr_row[$col -> name] = $row[$col -> name]; \n $c++;\n } \n $table_result[$r] = $arr_row;\n $r++;\n } \n return $table_result;\n }", "public function fetchArray() {\n return mysqli_fetch_array($this->result);\n }", "public function toArray(): array\n {\n return (array) $this->result();\n }", "function db_fetch_array($db_query) {\n return mysql_fetch_array($db_query, MYSQL_ASSOC);\n }", "public static function toArray($result) { \n $data = array();\n while ($row = $result->current()) {\n if (!empty($row)) {\n $data[] = (array) $row;\n }\n $result->next();\n }\n return $data;\n }", "public function getArray()\n {\n return mysqli_fetch_array($this->resulset);\n }", "public function convertArray($PDOResult)\n {\n while ($row = $PDOResult->fetch(PDO::FETCH_ASSOC)) {\n $this->array[] = $row;\n }\n return $this->array;\n }", "public function GetSingleRow() : ARRAY\r\n {\r\n return($this->preparedStatement->fetch(\\PDO::FETCH_ASSOC));\r\n }", "abstract public function getRowAsArray();", "public function toArray() {\n\t\tforeach($this->_rows as $i => $row) {\n\t\t\t$this->_data[$i] = $row->toArray();\n\t\t}\t\n\t\treturn $this->_data;\n\t}", "function id_name_to_array($result) {\n $res = $result->fetch_all();\n $rows = $result->num_rows;\n\n $return_array = array();\n\n for($i = 0; $i < $rows; $i++) {\n $id = $res[$i][0];\n $name = $res[$i][1];\n array_push($return_array, [$id, $name]);\n }\n\n return $return_array;\n }", "public function fetch_array()\n\t{\n\t\tif($this->num_rows() < 1)\n\t\t\treturn false;\n\n\t\t$data = $this->result_metadata();\n\t\t$fields = array();\n\t\t$out = array();\n\n\t\t$fields[0] = &$this;\n\t\t$count = 0;\n\n\t\twhile($field = $data->fetch_field()) {\n\t\t\t$fields[$count] = &$out[$field->name];\n\t\t\t$count++;\n\t\t}\n\n\t\tcall_user_func_array(array($this, 'bind_result'), $fields);\n\n\t\treturn ($this->fetch()) ? $out : false;\n }", "public static function getSingleColumnAsArray($connection, $sql_query, $data = null) {\n\t\tif (! $sql_query) {\n\t\t\tthrow new Exception ( \"No SQL query!\" );\n\t\t}\n\t\t$sth = $connection->prepare ( $sql_query );\n\t\t$sth->execute ( $data );\n\t\t$rows = $sth->fetchAll ();\n\t\t$column_array = array_map ( 'current', $rows );\n\t\treturn $column_array;\n\t}", "function getData($result) {\r\n\t\t$data = array();\r\n\t\t$i = 0;\r\n\t\twhile ($row = $result->fetch_assoc()) {\r\n\t\t\tforeach ($row as $key => $value) {\r\n\t\t\t\t$data[$i][$key] = $value;\t\t\r\n\t\t\t}\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\treturn $data;\r\n\t}", "public function arrayResult(){\n\t\t$this->arrayedResult = mysqli_fetch_assoc($this->result) or die (mysql_error($this->databaseLink));\n\t\treturn $this->arrayedResult;\n\t}", "public function fetchArray($query){\n return mysql_fetch_array($query);\n }", "public function result_array($result)\n\t{\n\t\t$data = array();\n\t\twhile ($row = $result->fetch_assoc()) {\n\t\t\t$data[] = $row;\n\t\t}\n\n\t\treturn $data;\n\t}", "function db_to_arr($column_name)\n{\n\t$i = 0;\t//count lines\n\t$db_handle = mysql_query(\"SELECT {$column_name} FROM intro \");\n\t\n\twhile($row = mysql_fetch_array($db_handle))\n\t{\n\t\tif($row[$column_name] && $row[$column_name] != \"0000\")\t//if not null, 0000 is default for year\n\t\t{\n\t\t\t\n\t\t\tif(strrpos($row[$column_name], \",\")) //if field is seperated by commas\n\t\t\t{\n\t\t\t\t$data_csv = explode(\",\" , $row[$column_name]);\n\t\t\t\tfor($s = 0; $s < sizeof($data_csv)-1; $s++)\n\t\t\t\t{\n\t\t\t\t\techo \"\\\"\" . addslashes(trim($data_csv[$s])) . \"\\\", \";\n\t\t\t\t}\n\t\t\t\techo \"\\\"\" . addslashes(trim($data_csv[$s])) . \"\\\"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"\\\"\" . addslashes(trim($row[$column_name])) . \"\\\"\";\n\t\t\t}\n\t\t\t$i++;\n\t\t\tif($i < mysql_num_rows($db_handle))\t//if not last field\n\t\t\t{\t\t\t\t\n\t\t\t\techo \",\";\n\t\t\t}\n\t\t}\n\t}\n}", "function FetchArray() {\n\t\t\t$this->ConnectServer();\n\t\t\t$array = pg_fetch_array($this->result, NULL, PGSQL_ASSOC);\n\t\t\t$this->DisconnectServer();\n\t\t\treturn $array;\n\t\t}", "function fetchQueryToArray($sql, $link = 0) {\n $this->link = $link ? $link : $this->link;\n $q = $this->query($sql, $this->link);\n $array = array();\n while ($row = $this->fetchArray($q)) $array[] = $row;\n $this->freeResult($q);\n return $array;\n }", "function getArrayResult($sql) {\n\t\tif ((! $res = $this->goSQL ( $sql )) || ($res->num_rows == 0))\n\t\t\treturn false;\n\t\tif ($res->num_rows == 1) {\n\t\t\treturn $res->fetch_assoc ();\n\t\t}\n\t\twhile ( $item = $res->fetch_assoc () ) {\n\t\t\t$items [] = $item;\n\t\t}\n\t\treturn $items;\n\t}", "function getArrayFromSQL( $sql ) {\r\n\t\tif($resID = $this->query( $sql ))\r\n\t\t\treturn $this->getArray( $resID );\r\n\t\telse\r\n\t\t\treturn array();\r\n\t\r\n\t}", "public function fetch_array(&$result){\r\n\t\t$ADODB_FETCH_MODE = ADODB_FETCH_BOTH;\r\n\t\tif(!$result->EOF){\r\n\t\t \t$rs = $result->fields;\r\n\t\t \t$result->MoveNext(); \r\n\t\t \treturn $rs;\r\n\t\t} \r\n\t}", "function ConvertirArray($result){\n\t\t \t$arreglo = array(); \n\t\t \tforeach ($result as $row){\n\t\t\t\t$arreglo[] = $row;\n\t\t \t}\n\t\t \treturn $arreglo;\n\t\t}", "function sql_fetch_array_r($result)\t{\n\t\t$row_counter = 0;\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result) ) {\n\t\t\t$whole_result[$row_counter] = $row;\n\t\t\t$row_counter++;\n\t\t}\n\t\treturn $whole_result;\n\t}", "public function dbarray($result) {\n \t$row = $result->fetch_assoc();\n \treturn $row;\n }", "public function fetchIndexArray() {\n return mysqli_fetch_row ( $this->result );\n }", "public function getRowsAsArray(){\n $fieldNames=$this->getFieldNames();\n $result=[];\n if (!empty($this->valuesRows)){\n foreach($this->valuesRows as $valuesRow){\n $rowArr=[];\n foreach($fieldNames as $i=>$fieldName){\n if (isset($valuesRow[$i])){\n $rowArr[$fieldName]=$valuesRow[$i];\n }\n }\n $result[]=$rowArr;\n }\n }\n return $result;\n }", "public function fetch_all_array(){\n $data = array();\n while( ($r = oci_fetch_assoc($this->result)) != false ){\n $data[] = $r;\n }\n return $data;\n }", "public function getResultArray(): array\n {\n if (! empty($this->resultArray)) {\n return $this->resultArray;\n }\n\n // In the event that query caching is on, the result_id variable\n // will not be a valid resource so we'll simply return an empty\n // array.\n if (! $this->isValidResultId()) {\n return [];\n }\n\n if ($this->resultObject) {\n foreach ($this->resultObject as $row) {\n $this->resultArray[] = (array) $row;\n }\n\n return $this->resultArray;\n }\n\n if ($this->rowData !== null) {\n $this->dataSeek();\n }\n\n while ($row = $this->fetchAssoc()) {\n $this->resultArray[] = $row;\n }\n\n return $this->resultArray;\n }", "function get_col($query=null,$x=0)\n\t\t{\n\n\t\t\t$new_array = array();\n\n\t\t\t// If there is a query then perform it if not then use cached results..\n\t\t\tif ( $query )\n\t\t\t{\n\t\t\t\t$this->query($query);\n\t\t\t}\n\n\t\t\t// Extract the column values\n\t\t\tfor ( $i=0; is_array($this->last_result) && $i < count($this->last_result); $i++ )\n\t\t\t{\n\t\t\t\t$new_array[$i] = $this->get_var(null,$x,$i);\n\t\t\t}\n\n\t\t\treturn $new_array;\n\t\t}", "public function asArray() {\n\t\treturn $this->_sth->fetchAll(PDO::FETCH_ASSOC);\n\t}", "function fetchResult() {\n\t\tif ($row = sqlite_fetch_array($this->results, SQLITE_ASSOC)) {\n\t\t\t$resultRow = array();\n\t\t\t$i = 0;\n\n\t\t\tforeach ($row as $index => $field) {\n\t\t\t\tif (strpos($index, '.')) {\n\t\t\t\t\tlist($table, $column) = explode('.', str_replace('\"', '', $index));\n\t\t\t\t\t$resultRow[$table][$column] = $row[$index];\n\t\t\t\t} else {\n\t\t\t\t\t$resultRow[0][str_replace('\"', '', $index)] = $row[$index];\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\treturn $resultRow;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function loadResultArray($numinarray = 0) {\n\t\tif (!($cur = $this->query())) {\n\t\t\treturn null;\n\t\t}\n\t\t$array = array();\n\t\twhile ($row = mysql_fetch_row( $cur )) {\n\t\t\t$array[] = $row[$numinarray];\n\t\t}\n\t\tmysql_free_result( $cur );\n\t\treturn $array;\n\t}", "public function valuesFlat($column)\n {\n $data = $this->query->select(\n $this->filter,\n $this->order,\n [$column],\n $this->limitOffset,\n PDO::FETCH_NUM\n );\n\n foreach ($data as &$item) {\n $item = $item[0];\n }\n unset($item);\n\n return $data;\n }", "public static function col($query = null , $x = 0) {\n $query && self::query($query);\n $new_array = array();\n // Extract the column values\n for ( $i=0; $i < count(self::$last_result); $i++ ) {\n $new_array[$i] = self::value(null, $x, $i);\n }\n return $new_array;\n }", "function mysql06($campo,$tabla){\n $query1=\"SELECT \".$campo.\" FROM \".$tabla;\n $query2=mysql_query($query1);\n $i = 0;\n while( $rec = mysql_fetch_row($query2) ){\n $array[$i] = $rec[0];\n $i++;\n }\n return $array;\n}", "private static function makeArrayFromDataQuery($data)\n { \n $result = [];\n \n while ($row = $data->fetch(PDO::FETCH_ASSOC) ) {\n $result[] = $row;\n }\n \n return $result;\n }", "public function getArrayValues($sql,$params = null){\n $result = $this->getResult($sql,$params);\n $arr = [];\n while ($row = $result->fetch_row()) {\n $arr[] = $row[0];\n }\n\n $result->close();\n\n return $arr;\n }", "public function get_array_of($result, $field ){\n\t\t\t$arr = array();\n\t\t\tif(is_array($field)) {\n\t\t\t\twhile($row = mysql_fetch_array($result)){\n\t\t\t\t\t$temp_arr = array();\n\t\t\t\t\tforeach($field as $temp_field){\n\t\t\t\t\t\t//array_push($temp_arr, $row[$temp_field]);\n\t\t\t\t\t\t$temp_arr[$temp_field] = $row[$temp_field];\n\t\t\t\t\t}\n\t\t\t\t\tarray_push($arr, $temp_arr);\n\t\t\t\t}\n\t\t\t\treturn $arr;\n\t\t\t}else {\n\t\t\t\twhile($row = mysql_fetch_array($result)){\n\t\t\t\t\tarray_push($arr, $row[$field]);\n\t\t\t\t}\n\t\t\t\treturn $arr;\n\t\t\t}\n\t\t}", "public function fetch_array() {\n\t\treturn $this->FetchArray();\n\t}", "public static function select_column($query)\n {\n $column = array();\n $rs = self::query($query);\n while (true)\n {\n $values = Db::fetch_row($rs);\n if ($values === false)\n break;\n array_push($column, $values[0]);\n }\n Db::free_result($rs);\n return $column;\n }", "public function resultToArray() {\n $array = array();\n\n if (is_array($this->_result)) {\n foreach ($this->_result as $res) {\n if (is_array($res)) {\n $array[] = $res;\n } else {\n $array[] = $this->fromObjectToArray($res);\n }\n }\n } else {\n $array[] = $this->fromObjectToArray($this->_result);\n }\n\n return $array;\n }", "function sqlArray ($query)\r\n {\r\n $result = mysql_query($query);\r\n $array = mysql_fetch_array($result);\r\n return $array;\r\n }", "function show_query_result_array($conn, $sql, $getheader=false, $tablename=\"\\$tablename\"){\r\n\t$result = $conn->query($sql);\r\n\t$gh = $getheader;\r\n\t\r\n\tif ($result->num_rows > 0) {\r\n\t// not empty result.\r\n\t\t$toReturn = array();\r\n\t\twhile($row = $result->fetch_assoc()) {\r\n\t\t\tif ($gh and $getheader){\r\n\t\t\t\tarray_push($toReturn, array_keys($row));\r\n\t\t\t\t$gh = false;\r\n\t\t\t}\r\n\t\t\tarray_push($toReturn, array_values($row));\r\n\t\t}\r\n\t\treturn $toReturn;\r\n\t}else{\r\n\t\treturn array(array());\r\n\t}\t\r\n\r\n}", "public function toArray() {\n\t\ttry {\n\t\t\t// Setup\n\t\t\t$result = array();\n\t\t\t\n\t\t\tforeach($this->_columns as $column) {\n\t\t\t\t$result[$column->name] = $this->_data[$column->name];\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('There was a problem converting the Record to an array.');\n\t\t}\n\t}", "public function fetchArray() : array\n\t{\n\t\treturn $this->handle->fetchArray($this->result);\n\t}", "function dbResultArray($query) {\n\t$result = dbQuery($query);\n\tif($result === false) { return(false); }\n\twhile($row = mysqli_fetch_assoc($result)) {\n\t\t$output[] = $row;\n\t}\n\treturn($output);\n}", "function sql2arr2($results){\n while ($row = $results->fetchArray(SQLITE3_ASSOC)) {\n $arrayResult[]=$row;\n }\n if ($arrayResult) {\n return $arrayResult;\n } else {\n return false;\n }\n}", "public function result_array()\n\t{\n\t\tif (count($this->result_array) > 0)\n\t\t{\n\t\t\treturn $this->result_array;\n\t\t}\n\t\telseif (count($this->result_object) > 0)\n\t\t{\n\t\t\tfor ($i = 0, $c = count($this->result_object); $i < $c; $i++)\n\t\t\t{\n\t\t\t\t$this->result_array[$i] = (array) $this->result_object[$i];\n\t\t\t}\n\n\t\t\treturn $this->result_array;\n\t\t}\n\t\telseif (is_array($this->row_data))\n\t\t{\n\t\t\tif (count($this->row_data) === 0)\n\t\t\t{\n\t\t\t\treturn $this->result_array;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$row_index = count($this->row_data);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$row_index = 0;\n\t\t\t$this->row_data = array();\n\t\t}\n\n\t\t$row = NULL;\n\t\twhile ($row = $this->_fetch_assoc())\n\t\t{\n\t\t\t$this->row_data[$row_index++] = $row;\n\t\t}\n\n\t\t// Un-comment the following line, in case it becomes needed\n\t\t// $this->_data_seek();\n\t\treturn $this->result_array = $this->row_data;\n\t}", "function sql_result($res, $row = 0, $col = 0)\n {\n $results = array();\n if (intval($row) < 1) {\n $results = $res->fetch(PDO::FETCH_BOTH);\n return $results[$col];\n }\n else {\n for ($i = 0; $i < intval($row); $i++) {\n $results = $res->fetch(PDO::FETCH_BOTH);\n }\n $results = $res->fetch(PDO::FETCH_BOTH);\n return $results[$col];\n }\n }", "public function getFieldData(): array\n {\n return array_map(fn ($fieldIndex) => (object) [\n 'name' => oci_field_name($this->resultID, $fieldIndex),\n 'type' => oci_field_type($this->resultID, $fieldIndex),\n 'max_length' => oci_field_size($this->resultID, $fieldIndex),\n ], range(1, $this->getFieldCount()));\n }", "function get_col($query=null,$x=0, $use_prepare=false)\n\t\t{\n\n\t\t\t$new_array = array();\n\n\t\t\t// If there is a query then perform it if not then use cached results..\n\t\t\tif ( $query )\n\t\t\t{\n\t\t\t\t$this->query($query, $use_prepare);\n\t\t\t}\n\n\t\t\t// Extract the column values\n\t\t\t$j = count($this->last_result);\n\t\t\tfor ( $i=0; $i < $j; $i++ )\n\t\t\t{\n\t\t\t\t$new_array[$i] = $this->get_var(null,$x,$i);\n\t\t\t}\n\n\t\t\treturn $new_array;\n\t\t}", "public function query_select_single($sql) {\r\n\t\t$tmp = $this->query_select ( $sql, \"num\" );\r\n\t\t$ans = array ();\r\n\t\tforeach ( $tmp as $item ) {\r\n\t\t\t$ans [] = $item [0];\r\n\t\t}\r\n\t\treturn $ans;\r\n\t}", "function res2keyarray($res,$key) {\n if(!$res) return array();\n while($row=mysql_fetch_assoc($res)){\n $array[$row[$key]] = $row;\n }\n return $array;\n}", "public function fetch_array_assoc(&$result){\r\n\t\t$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;\r\n\t\tif(!$result->EOF){\r\n\t\t \t$rs = $result->fields;\r\n\t\t \t$result->MoveNext(); \r\n\t\t \treturn $rs;\r\n\t\t}\r\n\t}", "function db_select_into_array( $statement ) {\n\n $this->db_run_query( $statement );\n\n if( ! is_object( $this->dataset_obj )) return NULL;\n\n while( $this->db_fetch_next_row() ) {\n $this->dataset_array[] = $this->curr_row_array;\n }\n\n $this->dataset_obj->free(); # We don't need this any more as we have all the same data in an array\n\n return $this->dataset_array;\n }", "function db_fetch_array($db_query) {\n\treturn mysql_fetch_array($db_query, MYSQL_ASSOC);\n}", "private static function resultToArray($result){\n\t\t$list = array();\n\t\twhile($row = mysqli_fetch_array($result)){\n\t\t\tarray_push($list, MovimentoDao::rowToObject($row));\t\t\t \n\t\t}\n\t\treturn $list;\n\t}", "public function fetchArray($result)\n {\n return @mysqli_fetch_assoc($result);\n }", "static function resultToArray($result)\n\t{\n\t\t$arrTmp = array();\n\t\tforeach($result as $key => $value)\n\t\t{\n\t\t\t$arrTmp[$value['id']] = $value['name'];\n\t\t}\n\t\treturn $arrTmp;\n\t}", "public function fetchArray($result)\n {\n return $result->fetch(PDO::FETCH_ASSOC);\n }", "function result2bigarray($result) {\n\t\t$return = array();\n\t\twhile($row = mysql_fetch_assoc($result)) {\n\t\t\t$return[] = $this->TranslateArray($row);\n\t\t}\n\t\treturn $return;\n\t}", "public function resultsToArray($results) {\n $allitems = array();\n foreach ($results as $row) {\n $item = array();\n foreach (array_keys($row) as $key) {\n if (gettype($key) != \"integer\") {\n $item[$key] = $row[$key];\n }\n }\n array_push($allitems, $item);\n }\n return($allitems);\n }", "static function result2Array2D(&$result) {\n $resultArray = array(); // beginnen met lege array\n if (@mysql_num_rows($result) != 0) {\n mysql_data_seek($result, 0);\n $mysqlResultRow = mysql_fetch_assoc($result);\n $keys = array_keys($mysqlResultRow); // eenmalig kolomnamen uitlezen\n mysql_data_seek($result, 0); // weer terug naar eerste resultaat, om hieronder in while ALLE resultaatrijen mee te nemen\n\n // rij voor rij alle waarden toevoegen aan $resultArray\n while ($mysqlResultRow = mysql_fetch_assoc($result)) {\n $row_arr = array();\n for ($k = 0; $k < count($keys); $k++) {\n $row_arr[$keys[$k]] = $mysqlResultRow[$keys[$k]];\n }\n array_push($resultArray, $row_arr);\n }\n\n //mysql_free_result($result);\n }\n\n return $resultArray;\n }", "public function query_array($query){\n\n\t\tmysql_data_seek($query,0);\n\t\t\n\t\t$numero_record=$this->conta($query);\n\t\t\n\t\tfor($i=0;$i<$numero_record;$i++){\n\t\t\t$array[]=mysql_fetch_assoc($query);\n\t\t}\n\t\t\n\t\treturn $array;\n\n\t}", "public function fetchArray()\n {\n if (!empty($this->prepare)) {\n return $this->prepare->fetch(PDO::FETCH_NUM);\n }\n return array();\n }", "function query_result_to_array($array_array,$value,$key=false) {\n\tif (!is_array($array_array)) return array();\n\tif ($key!==false) foreach ($array_array as $array) $temp[$array[$key]]=$array[$value];\n\telse foreach ($array_array as $array) $temp[]=$array[$value];\n\treturn $temp;\n}", "public function GetAllRows() : ARRAY\r\n {\r\n return($this->preparedStatement->fetchAll(\\PDO::FETCH_ASSOC));\r\n }" ]
[ "0.7349777", "0.72998106", "0.729965", "0.72984976", "0.714555", "0.7089626", "0.70484126", "0.7000926", "0.6980251", "0.6865612", "0.67850703", "0.6772592", "0.6770953", "0.6719784", "0.6691024", "0.6683834", "0.6668936", "0.66626936", "0.66280866", "0.6620318", "0.6583763", "0.65774393", "0.6549775", "0.6536782", "0.6519211", "0.6485046", "0.6467794", "0.64564365", "0.64546496", "0.6448533", "0.64152557", "0.6413738", "0.64028263", "0.6401164", "0.63899636", "0.63884914", "0.6367196", "0.6355268", "0.6349874", "0.6339968", "0.6327203", "0.6319456", "0.6304074", "0.62989056", "0.62964886", "0.6293665", "0.62884057", "0.62516403", "0.62495667", "0.624921", "0.62489855", "0.62482554", "0.62477696", "0.6247639", "0.62360185", "0.6234588", "0.6228613", "0.62242085", "0.6215394", "0.6215026", "0.6205456", "0.6199012", "0.6196854", "0.61962056", "0.61935633", "0.6193126", "0.61851877", "0.6184763", "0.6180897", "0.6175442", "0.61698633", "0.6166866", "0.615546", "0.61550254", "0.61511624", "0.6149287", "0.6138941", "0.61375195", "0.61234224", "0.6111947", "0.61003226", "0.6096751", "0.60920954", "0.6088703", "0.60874414", "0.6083466", "0.60820675", "0.6081912", "0.60798407", "0.60725963", "0.6072585", "0.6072125", "0.6050702", "0.60489434", "0.60429335", "0.60252374", "0.60247785", "0.60215807", "0.6021346", "0.60185647" ]
0.729231
4
Transforms MySQL result to 2D PHP array
static function result2Array2D(&$result) { $resultArray = array(); // beginnen met lege array if (@mysql_num_rows($result) != 0) { mysql_data_seek($result, 0); $mysqlResultRow = mysql_fetch_assoc($result); $keys = array_keys($mysqlResultRow); // eenmalig kolomnamen uitlezen mysql_data_seek($result, 0); // weer terug naar eerste resultaat, om hieronder in while ALLE resultaatrijen mee te nemen // rij voor rij alle waarden toevoegen aan $resultArray while ($mysqlResultRow = mysql_fetch_assoc($result)) { $row_arr = array(); for ($k = 0; $k < count($keys); $k++) { $row_arr[$keys[$k]] = $mysqlResultRow[$keys[$k]]; } array_push($resultArray, $row_arr); } //mysql_free_result($result); } return $resultArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function db_result_to_array($result) {\n $res_array = array();\n \n for ($count=0; $row = $result->fetch_assoc(); $count++) {\n $res_array[$count] = $row;\n }\n \n return $res_array;\n }", "function db_result_to_array($result) {\r\n $res_array = array();\r\n\r\n for ($count = 0; $row = $result->fetch_assoc(); $count++) {\r\n $res_array[$count] = $row;\r\n }\r\n return $res_array;\r\n }", "function resultSet2array($myrst) {\n $resultset = null;\n $row = 0;\n while ($myrow = mysql_fetch_array($myrst)) {\n $col = 0;\n foreach ($myrow as $column) {\n $resultset[$row][$col]=$myrow[$col++];\n }\n $row++;\n }\n return $resultset;\n}", "function db_result_to_array($result){\n\t\t\t\t\t\t\t$res_array = array();\n\n\t\t\t\t\t\t\tfor($count=0; $row= @mysql_fetch_array($result); $count++)\n\t\t\t\t\t\t\t\t$res_array[$count] = $row;\n\t\t\t\t\t\t\treturn $res_array;\n\t\t\t\t\t\t}", "static function result2Array(&$result) {\n $return_array = array();\n if (@mysql_num_rows($result) != 0) {\n while ($row = mysql_fetch_assoc($result)) {\n $keys = array_keys($row);\n $return_array[] = $row[$keys[0]];\n }\n mysql_free_result($result);\n }\n return $return_array;\n }", "function resultToArray($result) {\n $rows = array();\n while($row = $result->fetch_assoc()) {\n $rows[] = $row;\n }\n return $rows;\n }", "function convertToArray( $result ){\n $resultArray = array();\n\n for( $count=0; $row = $result->fetch_assoc(); $count++ ) {\n $resultArray[$count] = $row;\n }\n\n return $resultArray;\n }", "function db_result_to_array($result) {\n $res_array = array();\n\n for ($count=0; $row = $result->fetch_assoc(); $count++) {\n $res_array[$count] = $row;\n }\n\n return $res_array;\n}", "function resultToArray($result) {\n\t\t$rows = array();\n\t\twhile($row = $result->fetch_assoc()) {\n\t\t\t$rows[] = $row;\n\t\t}\n\t\treturn $rows;\n\t}", "function result_to_array($results) {\n $items = [];\n while ($item = mysqli_fetch_array($results)) {\n $items[] = $item;\n }\n return $items; \n }", "private function mysql_fetch_full_result_array($result)\n {\n $table_result=array();\n $r=0;\n while($row = mysql_fetch_assoc($result)){\n $arr_row=array();\n $c=0;\n while ($c < mysql_num_fields($result)) { \n $col = mysql_fetch_field($result, $c); \n $arr_row[$col -> name] = $row[$col -> name]; \n $c++;\n } \n $table_result[$r] = $arr_row;\n $r++;\n } \n return $table_result;\n }", "public function result_array()\n {\n $output = array();\n\n if (is_bool($this->result))\n {\n return $output;\n }\n\n while ($row = $this->result->fetch_assoc())\n {\n $output[] = $row;\n }\n\n $this->free_result();\n\n return $output;\n }", "public function arrayResult(){\n\t\t$this->arrayedResult = mysqli_fetch_assoc($this->result) or die (mysql_error($this->databaseLink));\n\t\treturn $this->arrayedResult;\n\t}", "function res2array($res) {\n if(!$res) return array();\n while($row=mysql_fetch_assoc($res)){\n $array[] = $row;\n }\n return $array;\n}", "function obtenerArray(){\r\n\t\treturn mysql_fetch_array( $this->rs() );\r\n\t}", "public static function toArray($result) { \n $data = array();\n while ($row = $result->current()) {\n if (!empty($row)) {\n $data[] = (array) $row;\n }\n $result->next();\n }\n return $data;\n }", "function sqlToArray($sqlResult){\n $arr = [];\n while ($line = mysqli_fetch_array($sqlResult)) {\n $arr [] = $line[0];\n }\n return $arr;\n}", "function getData($result) {\r\n\t\t$data = array();\r\n\t\t$i = 0;\r\n\t\twhile ($row = $result->fetch_assoc()) {\r\n\t\t\tforeach ($row as $key => $value) {\r\n\t\t\t\t$data[$i][$key] = $value;\t\t\r\n\t\t\t}\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\treturn $data;\r\n\t}", "function sql_fetch_array_r($result)\t{\n\t\t$row_counter = 0;\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result) ) {\n\t\t\t$whole_result[$row_counter] = $row;\n\t\t\t$row_counter++;\n\t\t}\n\t\treturn $whole_result;\n\t}", "public function getArray()\n {\n return mysqli_fetch_array($this->resulset);\n }", "public function result_array($result)\n\t{\n\t\t$data = array();\n\t\twhile ($row = $result->fetch_assoc()) {\n\t\t\t$data[] = $row;\n\t\t}\n\n\t\treturn $data;\n\t}", "public function fetch_array()\n\t{\n\t\t$array = array();\n\t\tif (current($this->result)) {\n\t\t\tforeach (current($this->result) AS $value) {\n\t\t\t\t$array[] = $value;\n\t\t\t}\n\t\t\tforeach (current($this->result) AS $key => $value) {\n\t\t\t\t$array[$key] = $value;\n\t\t\t}\n\t\t}else {\n\t\t\t$array = FALSE;\n\t\t}\n\t\tnext($this->result);\n\t\treturn $array;\n\t}", "public function fetchArray() {\n return mysqli_fetch_array($this->result);\n }", "public function getResultArray(): array\n {\n if (! empty($this->resultArray)) {\n return $this->resultArray;\n }\n\n // In the event that query caching is on, the result_id variable\n // will not be a valid resource so we'll simply return an empty\n // array.\n if (! $this->isValidResultId()) {\n return [];\n }\n\n if ($this->resultObject) {\n foreach ($this->resultObject as $row) {\n $this->resultArray[] = (array) $row;\n }\n\n return $this->resultArray;\n }\n\n if ($this->rowData !== null) {\n $this->dataSeek();\n }\n\n while ($row = $this->fetchAssoc()) {\n $this->resultArray[] = $row;\n }\n\n return $this->resultArray;\n }", "function ConvertirArray($result){\n\t\t \t$arreglo = array(); \n\t\t \tforeach ($result as $row){\n\t\t\t\t$arreglo[] = $row;\n\t\t \t}\n\t\t \treturn $arreglo;\n\t\t}", "public function result_array()\n\t{\n\t\tif (count($this->result_array) > 0)\n\t\t{\n\t\t\treturn $this->result_array;\n\t\t}\n\t\telseif (count($this->result_object) > 0)\n\t\t{\n\t\t\tfor ($i = 0, $c = count($this->result_object); $i < $c; $i++)\n\t\t\t{\n\t\t\t\t$this->result_array[$i] = (array) $this->result_object[$i];\n\t\t\t}\n\n\t\t\treturn $this->result_array;\n\t\t}\n\t\telseif (is_array($this->row_data))\n\t\t{\n\t\t\tif (count($this->row_data) === 0)\n\t\t\t{\n\t\t\t\treturn $this->result_array;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$row_index = count($this->row_data);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$row_index = 0;\n\t\t\t$this->row_data = array();\n\t\t}\n\n\t\t$row = NULL;\n\t\twhile ($row = $this->_fetch_assoc())\n\t\t{\n\t\t\t$this->row_data[$row_index++] = $row;\n\t\t}\n\n\t\t// Un-comment the following line, in case it becomes needed\n\t\t// $this->_data_seek();\n\t\treturn $this->result_array = $this->row_data;\n\t}", "public function resultToArray() {\n $array = array();\n\n if (is_array($this->_result)) {\n foreach ($this->_result as $res) {\n if (is_array($res)) {\n $array[] = $res;\n } else {\n $array[] = $this->fromObjectToArray($res);\n }\n }\n } else {\n $array[] = $this->fromObjectToArray($this->_result);\n }\n\n return $array;\n }", "function dbResultArray($query) {\n\t$result = dbQuery($query);\n\tif($result === false) { return(false); }\n\twhile($row = mysqli_fetch_assoc($result)) {\n\t\t$output[] = $row;\n\t}\n\treturn($output);\n}", "function sql_fetch_array($res)\n {\n $results = array();\n if ($res)\n $results = $res->fetch(PDO::FETCH_BOTH);\n return $results;\n }", "function returnArrays()\r\n\t\t{\r\n\t\tif (mysql_num_rows($this->result) > 0)\r\n\t\t\t{\r\n\t\t\twhile($row=mysql_fetch_assoc($this->result))\r\n\t\t\t\t{\r\n\t\t\t\t$arrays[]=$row;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\treturn $arrays;\r\n\t\t}", "public function sql_fetch_array($result) {\n return @mysql_fetch_array($result);\n }", "public static function toArray() {\n $str = \"\n SELECT id, firstName, lastName, email, password\n FROM indPrj_persons\";\n \n // Obtain an array of persons records.\n $records = Database::query($str);\n \n // Push each row into a new array to be outputted.\n $x = 0;\n $output = array();\n while($row = mysql_fetch_array($records)){\n $output[$x]['id'] = $row['id'];\n $output[$x]['firstName'] = $row['firstName'];\n $output[$x]['lastName'] = $row['lastName'];\n $output[$x]['email'] = $row['email'];\n $output[$x]['password'] = $row['password'];\n $x++;\n }\n \n return $output;\n }", "function resultToArray($result,$fields,$encoding='')\r\n\t{\r\n\t\t$result_array = array();\r\n\t\twhile ($one_row=mysql_fetch_assoc($result))\r\n\t\t\t\t$result_array[]=$one_row;\r\n\t\treturn $result_array;\r\n\t}", "static function result2IndexedArray2D(&$result, $colName) {\n $resultArray = array(); // beginnen met lege array\n\n if (@mysql_num_rows($result) != 0) {\n $mysqlResultRow = mysql_fetch_assoc($result);\n $keys = array_keys($mysqlResultRow); // eenmalig kolomnamen uitlezen\n mysql_data_seek($result, 0); // weer terug naar eerste resultaat, om hieronder in while ALLE resultaatrijen mee te nemen\n\n // rij voor rij alle waarden toevoegen aan $resultArray\n while ($mysqlResultRow = mysql_fetch_assoc($result)) {\n $row_arr = array();\n for ($k = 0; $k < count($keys); $k++) {\n $row_arr[$keys[$k]] = $mysqlResultRow[$keys[$k]];\n }\n $resultArray[$row_arr[$colName]] = $row_arr;\n }\n\n //mysql_free_result($result);\n }\n\n return $resultArray;\n }", "private function resultToArray($res) {\r\n\r\n $lista = array();\r\n $i = 0;\r\n\r\n\t\t\tif($this->response) {\r\n\r\n\t while ($fila = mysql_fetch_assoc($this->response)) {\r\n\t $lista[$i] = $fila;\r\n\t $i = $i + 1;\r\n\t }\r\n\r\n\t\t\t}\r\n\r\n return $lista;\r\n\r\n }", "public function toArray(){\n\t\treturn json_decode(json_encode($this->rows), true);\n\t}", "public function toArray() {\n\t\tforeach($this->_rows as $i => $row) {\n\t\t\t$this->_data[$i] = $row->toArray();\n\t\t}\t\n\t\treturn $this->_data;\n\t}", "function result2bigarray($result) {\n\t\t$return = array();\n\t\twhile($row = mysql_fetch_assoc($result)) {\n\t\t\t$return[] = $this->TranslateArray($row);\n\t\t}\n\t\treturn $return;\n\t}", "private function sqlResToArray($res) { //appends sql query result to php array\n\t\t$phpArray = array();\n\t\t$res->data_seek(0);\n while ($row = $res->fetch_assoc()) {\n $phpArray[] = $row;\n }\n\t\treturn $phpArray;\n\t}", "function sql2arr2($results){\n while ($row = $results->fetchArray(SQLITE3_ASSOC)) {\n $arrayResult[]=$row;\n }\n if ($arrayResult) {\n return $arrayResult;\n } else {\n return false;\n }\n}", "function mysql_fetch_array_1d($res) {\n\twhile($row=mysql_fetch_array($res)) {\n\t\tif (!(empty($row[0]))){\n\t\t\t$return[] = $row[0];\n\t\t}\n }\n return $return;\n}", "public static function getMySqlResultAsArray($mysql_result)\n {\n $result = [];\n while ($row = $mysql_result->fetch_assoc()) {\n $result[] = $row;\n }\n\n return $result;\n }", "function getResult() {\n $rows = array();\n while ($row = mysqli_fetch_assoc($this->theResult)) {\n $rows[] = $row;\n }\n return $rows;\n }", "function FetchArray() {\n\t\t\t$this->ConnectServer();\n\t\t\t$array = pg_fetch_array($this->result, NULL, PGSQL_ASSOC);\n\t\t\t$this->DisconnectServer();\n\t\t\treturn $array;\n\t\t}", "private static function resultToArray($result){\n\t\t$list = array();\n\t\twhile($row = mysqli_fetch_array($result)){\n\t\t\tarray_push($list, MovimentoDao::rowToObject($row));\t\t\t \n\t\t}\n\t\treturn $list;\n\t}", "public function fetch_array()\n\t{\n\t\tif($this->num_rows() < 1)\n\t\t\treturn false;\n\n\t\t$data = $this->result_metadata();\n\t\t$fields = array();\n\t\t$out = array();\n\n\t\t$fields[0] = &$this;\n\t\t$count = 0;\n\n\t\twhile($field = $data->fetch_field()) {\n\t\t\t$fields[$count] = &$out[$field->name];\n\t\t\t$count++;\n\t\t}\n\n\t\tcall_user_func_array(array($this, 'bind_result'), $fields);\n\n\t\treturn ($this->fetch()) ? $out : false;\n }", "abstract public function getRowAsArray();", "public function getMultipleRecords() {\n $i = 0;\n $output = [];\n $_this = $this;\n while($row = $_this->fetchAssoc()){\n $output[\"data\"][$i] = $row;\n $i++;\n }\n return $output;\n }", "public function fetchArray($result)\n\t{\n\t\treturn mysqli_fetch_array($result);\n\t}", "public function dbarray($result) {\n \t$row = $result->fetch_assoc();\n \treturn $row;\n }", "public function getAllResult() {\n $rowsArray = array();\n while($row = mysql_fetch_array($this->result)) {\n $rowsArray[] = $row;\n }\n return $rowsArray;\n }", "function getResultArray($sql) {\n require_once(\"Y_DB_MySQL.class.php\");\n $db = new My();\n $array = array();\n $db->Query($sql);\n \n while ($db->NextRecord()) {\n array_push($array, $db->Record);\n }\n \n $db->Close();\n return $array;\n }", "public function fetchArray() : array\n\t{\n\t\treturn $this->handle->fetchArray($this->result);\n\t}", "public function convertArray($PDOResult)\n {\n while ($row = $PDOResult->fetch(PDO::FETCH_ASSOC)) {\n $this->array[] = $row;\n }\n return $this->array;\n }", "private function queryFetchAsValues(mysqli_result $result)\n\t{\n\t\t$column = $result->field_count - 1;\n\t\t$values = [];\n\t\twhile ($element = $result->fetch_row()) {\n\t\t\tif (isset($element['id'])) {\n\t\t\t\t$values[$element['id']] = $element[$column];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$values[] = $element[$column];\n\t\t\t}\n\t\t}\n\t\treturn $values;\n\t}", "private function getResultArray($result)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$resultArray = array();\n\t\t\t$arrayIndex = 0;\n\t\n\t\t\t// Store results in multi dimentional array\n\t\t\twhile( $row = mysqli_fetch_array($result) )\n\t\t\t{\n\t\t\t\t$resultArray[$arrayIndex] = array_map('htmlentities', $row);\n\t\t\t\t$arrayIndex++;\n\t\t\t}\n\t\t\t\n\t\t\treturn $resultArray;\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\ttrigger_error($e->message, E_USER_ERROR);\n\t\t}\n\t}", "function dbgetarray() {\n\t$output = array();\n\t\n\t$args = func_get_args();\n\t$result = call_user_func_array('dbquery', $args);\n\t$query = array_shift($args);\n\n\t// this only applies to SELECT queries!\n\tif (preg_match('/^SELECT/i', $query)) {\n\t\twhile ($result && $row = dbfetch($result, DB_NUM)) {\n\t\t\tif (count($row) == 1) { // use integer keys\n\t\t\t\t$output[] = $row[0];\n\t\t\t} else if (count($row) == 2) { // use first column keys\n\t\t\t\t$output[$row[0]] = $row[1];\n\t\t\t} else { // use integer keys and array values\n\t\t\t\t$output[] = $row;\n\t\t\t}\n\t\t}\n\t\tdbfree($result);\n\t} else {\n\t\tEWarning(EC_REALS_DATABASE, \"dbgetarray called with non-SELECT query!\", \"Non-select query\");\n\t}\n\n\treturn $output;\n}", "function getArrayResult($sql) {\n\t\tif ((! $res = $this->goSQL ( $sql )) || ($res->num_rows == 0))\n\t\t\treturn false;\n\t\tif ($res->num_rows == 1) {\n\t\t\treturn $res->fetch_assoc ();\n\t\t}\n\t\twhile ( $item = $res->fetch_assoc () ) {\n\t\t\t$items [] = $item;\n\t\t}\n\t\treturn $items;\n\t}", "final public function makeArray ($rs) {\n if (!$rs) {\n return false;\n } else {\n $rsArray = array();\n while ($row = $this->getRow($rs)) {\n $rsArray[] = $row;\n }\n return $rsArray;\n }\n }", "function sqlArray ($query)\r\n {\r\n $result = mysql_query($query);\r\n $array = mysql_fetch_array($result);\r\n return $array;\r\n }", "function getRowAsArray($query) {\n\t\topenDatabaseConnection();\n\t\t$result = mysql_query($query) or die(\"Invalid query: \" . mysql_error());\n\t\t# turn the result into an array\n\t\treturn mysql_fetch_assoc($result);\n\t}", "public function toArray(): array\n {\n return (array) $this->result();\n }", "function selectResultArr ($stmt, $dxml) {\n\t\n\t$options = $stmt->get_result();\n\t$new_column = \"column\";\n\t$new_row = \"row\";\n\t$end_row = \"end_row\"; \n\t\n\twhile ($entry = $options->fetch_array(MYSQLI_NUM)) {\n\t\t\n\t\t/*Hide and store the flight ID for more efficiently referring to this flight in other\n\t\tcalls to the database*/\n\t\t$dxml->addChild($new_row, $entry[0]);\t\t\n\t\t\t\n\t\tfor($i = 1; $i < count($entry); $i++) {\n\t\t\t$dxml->addChild($new_column, $entry[$i]);\t\t\n\t\t}\n\t\t\n\t\t$dxml->addChild($end_row, \"\");\t\t\n\t}\t\n}", "public function fetchArray($query){\n return mysql_fetch_array($query);\n }", "public function resultArray($recordset)\n {\n \n// $result = array();\n// while ($row = mysql_fetch_assoc($recordset))\n// {\n// $result[] = $row; // Inside while loop\n// }\n// return $result;\n $result = $this->sqlAssoc;\n return $result;\n }", "public function GetAllRows() : ARRAY\r\n {\r\n return($this->preparedStatement->fetchAll(\\PDO::FETCH_ASSOC));\r\n }", "public function fetchArray($result)\n {\n return @mysqli_fetch_assoc($result);\n }", "public function fetch(){\n\n $rows = [];\n\n while($row = $this->result->fetch(PDO::FETCH_ASSOC)) {\n $rows[]=$row;\n }\n\n $this->result=null;\n\n return $rows;\n\n }", "function fetchResult() {\n\t\tif ($row = mysql_fetch_row($this->results)) {\n\t\t\t$resultRow = array();\n\t\t\t$i = 0;\n\t\t\tforeach ($row as $index => $field) {\n\t\t\t\tlist($table, $column) = $this->map[$index];\n\t\t\t\t$resultRow[$table][$column] = $row[$index];\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\treturn $resultRow;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function fetchArray($result = false){\n $this->resCalc($result);\n return mysql_fetch_array($result);\n }", "public function fetchArray($result)\n {\n return $result->fetch(PDO::FETCH_ASSOC);\n }", "public function fetch_array(&$result){\r\n\t\t$ADODB_FETCH_MODE = ADODB_FETCH_BOTH;\r\n\t\tif(!$result->EOF){\r\n\t\t \t$rs = $result->fields;\r\n\t\t \t$result->MoveNext(); \r\n\t\t \treturn $rs;\r\n\t\t} \r\n\t}", "public function toArray(): array\n {\n $this->initialize();\n return $this->rows;\n }", "function db_fetch_array($db_query) {\n return mysql_fetch_array($db_query, MYSQL_ASSOC);\n }", "function sql_new_fetch_into_array($query) {\n\treturn sql_fetch_column($query);\n}", "function getArraySQL($sql){\n //Creamos la conexión\n $conexion = $this->conectarBD();\n //generamos la consulta\n if(!$result = mysqli_query($conexion, $sql)) die();\n\n $rawdata = array();\n //guardamos en un array multidimensional todos los datos de la consulta\n $i=0;\n while($row = mysqli_fetch_array($result))\n {\n //guardamos en rawdata todos los vectores/filas que nos devuelve la consulta\n $rawdata[$i] = $row;\n $i++;\n }\n //Cerramos la base de datos\n $this->desconectarBD($conexion);\n //devolvemos rawdata\n return $rawdata;\n }", "public function fetch_all_array(){\n $data = array();\n while( ($r = oci_fetch_assoc($this->result)) != false ){\n $data[] = $r;\n }\n return $data;\n }", "public function asArray() {\n\t\treturn $this->_sth->fetchAll(PDO::FETCH_ASSOC);\n\t}", "public function fetch_arrays($query);", "public function fetch_array($result_set){\n return mysql_fetch_array($result_set);\n \n }", "public function results()\n {\n //by default data get as array/stdclasses\n\n // to trunit to arrays of arrays\n // return json_decode(json_encode($this->_results), true);\n return $this->_results;\n // gives array data with column name and itsvalue not index array\n }", "function loadResultArray($numinarray = 0) {\n\t\tif (!($cur = $this->query())) {\n\t\t\treturn null;\n\t\t}\n\t\t$array = array();\n\t\twhile ($row = mysql_fetch_row( $cur )) {\n\t\t\t$array[] = $row[$numinarray];\n\t\t}\n\t\tmysql_free_result( $cur );\n\t\treturn $array;\n\t}", "public function fetch_array() {\n\t\treturn $this->FetchArray();\n\t}", "public function get_array_of($result, $field ){\n\t\t\t$arr = array();\n\t\t\tif(is_array($field)) {\n\t\t\t\twhile($row = mysql_fetch_array($result)){\n\t\t\t\t\t$temp_arr = array();\n\t\t\t\t\tforeach($field as $temp_field){\n\t\t\t\t\t\t//array_push($temp_arr, $row[$temp_field]);\n\t\t\t\t\t\t$temp_arr[$temp_field] = $row[$temp_field];\n\t\t\t\t\t}\n\t\t\t\t\tarray_push($arr, $temp_arr);\n\t\t\t\t}\n\t\t\t\treturn $arr;\n\t\t\t}else {\n\t\t\t\twhile($row = mysql_fetch_array($result)){\n\t\t\t\t\tarray_push($arr, $row[$field]);\n\t\t\t\t}\n\t\t\t\treturn $arr;\n\t\t\t}\n\t\t}", "function db_select_into_array( $statement ) {\n\n $this->db_run_query( $statement );\n\n if( ! is_object( $this->dataset_obj )) return NULL;\n\n while( $this->db_fetch_next_row() ) {\n $this->dataset_array[] = $this->curr_row_array;\n }\n\n $this->dataset_obj->free(); # We don't need this any more as we have all the same data in an array\n\n return $this->dataset_array;\n }", "private function to_array(Result $result) : array {\n $res = [];\n foreach ($result as $key => $val) {\n if (is_array($val))\n $val = implode(\"\\n\", $val);\n $res[$key] = $val;\n }\n return $res;\n }", "function getArrayFromSQL( $sql ) {\r\n\t\tif($resID = $this->query( $sql ))\r\n\t\t\treturn $this->getArray( $resID );\r\n\t\telse\r\n\t\t\treturn array();\r\n\t\r\n\t}", "private function sql_resToRows( $res )\n {\n $rows = array();\n\n // Get the field label of the uid\n $uidField = $this->sql_filterFields[ $this->curr_tableField ][ 'uid' ];\n\n // LOOP build the rows\n while ( $row = $GLOBALS[ 'TYPO3_DB' ]->sql_fetch_assoc( $res ) )\n {\n//var_dump( __METHOD__, __LINE__, $row, $uidField );\n $rows[ ( string ) $row[ $uidField ] ] = $row;\n }\n // LOOP build the rows\n // Free SQL result\n // #42302, dwildt, 1-\n //$GLOBALS['TYPO3_DB']->sql_free_result( $this->res );\n // #42302, dwildt, 1+\n $GLOBALS[ 'TYPO3_DB' ]->sql_free_result( $res );\n\n // RETURN rows\n return $rows;\n }", "private function createAssocArrayOfResult(mysqli_stmt $statement)\r\n\t{\r\n\t\t$statement->store_result();\r\n\t\t\r\n\t\tif($statement->num_rows <= 0)\r\n\t\t{\r\n\t\t\treturn array();\r\n\t\t}\r\n\t\t\r\n\t\t$meta = $statement->result_metadata();\r\n\r\n\t\twhile ($field = $meta->fetch_field()) { \r\n\t\t\t$params[] = &$row[$field->name]; \r\n\t\t}\r\n\t\t\r\n\t\tcall_user_func_array(array($statement, 'bind_result'), $params); \r\n\t\t\r\n\t\tif($statement->num_rows === 1)\r\n\t\t{\r\n\t\t\t$statement->fetch();\r\n\t\t\tforeach($row as $key => $val) \r\n\t\t\t{ \r\n\t\t\t\t$result[$key] = $val; \r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\twhile ($statement->fetch()) { \r\n\t\t\tforeach($row as $key => $val) \r\n\t\t\t{ \r\n\t\t\t\t$c[$key] = $val; \r\n\t\t\t} \r\n\t\t\t$result[] = $c; \r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "public function query_array($query){\n\n\t\tmysql_data_seek($query,0);\n\t\t\n\t\t$numero_record=$this->conta($query);\n\t\t\n\t\tfor($i=0;$i<$numero_record;$i++){\n\t\t\t$array[]=mysql_fetch_assoc($query);\n\t\t}\n\t\t\n\t\treturn $array;\n\n\t}", "function fetch($result)\n{ \n// This function will turn mysqli results into an array\n\n $array = array();\n\n if($result instanceof mysqli_stmt)\n {\n $result->store_result();\n\n $variables = array();\n $data = array();\n $meta = $result->result_metadata();\n\n while($field = $meta->fetch_field())\n $variables[] = &$data[$field->name];\n\n call_user_func_array(array($result, 'bind_result'), $variables);\n\n $i=0;\n while($result->fetch())\n {\n $array[$i] = array();\n foreach($data as $k=>$v)\n $array[$i][$k] = $v;\n $i++;\n }\n }\n elseif($result instanceof mysqli_result)\n {\n while($row = $result->fetch_assoc())\n $array[] = $row;\n }\n\n return $array;\n}", "public function fetch_array($sql, $param = null) {\r\n\t$stmt = $this->query($sql, $param);\r\n\r\n\t$out = [];\r\n\t\r\n\t$result = $this->fetch($stmt);\r\n//\techo '<br/>Result:<br/>' . PHP_EOL;\r\n//\tvar_dump($result);\r\n\twhile (!empty($result)) {\r\n\t $out[] = $result;\r\n\t $result = $this->fetch($stmt);\r\n\t}\r\n\r\n\t$this->free_result($stmt);\r\n\treturn $out;\r\n }", "private function set_response_rows($result) { \n $rows = [];\n foreach ($result as $r) {\n $cell = [];\n foreach ($r as $column => $value) {\n $cell[] = call_user_func($this->format, $column, $value, $r);\n }\n\n $rows[] = [\n 'id' => $r->id,\n 'cell' => $cell\n ];\n }\n return $rows;\n }", "function res2keyarray($res,$key) {\n if(!$res) return array();\n while($row=mysql_fetch_assoc($res)){\n $array[$row[$key]] = $row;\n }\n return $array;\n}", "public function FetchArray()\n\t{\n\t\tif (!$this->Result){\t//check if we have a valid result set\n\t\t\treturn false;\n\t\t}\n\n\t\t$row = mysqli_fetch_array($this->Result);\n\n\t\tif (!$row){\t//if last row, free the result set\n\t\t\tmysqli_free_result($this->Result);\n\t\t}\n\n\t\treturn $row;\n\t}", "function mysql_fetch_multi($result) {\r\n\t$row = mysql_fetch_row($result);\r\n\r\n\tif(!$row) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tforeach ($row as $offset => $value) {\r\n\t\t$return[mysql_field_table($result, $offset)][mysql_field_name($result, $offset)] = $value;\r\n\r\n\t}\r\n\r\n\treturn $return;\r\n\r\n}", "function get_sql_array($sql) {\n global $link;\n $results =mysqli_query($link,$sql);\n $array = array();\n \n if($results){\n \n while($row = mysqli_fetch_row($results)){\n $array[] = $row;\n }\n \n }\n \n return $array;\n}", "public function fetchAllToArray()\n {\n $resultSet = $this->getDbTable()->fetchAll()->toArray();\n return $resultSet;\n }", "private static function makeArrayFromDataQuery($data)\n { \n $result = [];\n \n while ($row = $data->fetch(PDO::FETCH_ASSOC) ) {\n $result[] = $row;\n }\n \n return $result;\n }", "function getArrayOfRows($dbQuery) {\n return mysqli_fetch_array($dbQuery, MYSQL_ASSOC);\n}" ]
[ "0.76110697", "0.75810367", "0.7573899", "0.7525402", "0.7455517", "0.74301004", "0.7417074", "0.7378244", "0.7306235", "0.7207647", "0.719117", "0.71891814", "0.71394897", "0.71036476", "0.70699984", "0.7064557", "0.7017603", "0.69999224", "0.6992793", "0.6989289", "0.6973738", "0.6943359", "0.6937071", "0.6888629", "0.6874881", "0.68683773", "0.6850609", "0.68463135", "0.68335074", "0.68243366", "0.6817776", "0.6810647", "0.6809663", "0.68043524", "0.6779594", "0.6763803", "0.67631966", "0.6755117", "0.6754627", "0.6753352", "0.6733634", "0.6717081", "0.6711234", "0.67085844", "0.6705324", "0.6645479", "0.6644441", "0.66184616", "0.6616861", "0.6612815", "0.66124123", "0.6581399", "0.6578714", "0.6569859", "0.6559427", "0.65515375", "0.65490186", "0.6547277", "0.65394825", "0.6534061", "0.652208", "0.6520254", "0.6503376", "0.65009445", "0.6483333", "0.6474423", "0.64660656", "0.6457731", "0.6452815", "0.6443086", "0.6399236", "0.6391807", "0.6390021", "0.63877237", "0.63742286", "0.6369516", "0.6367912", "0.63581526", "0.63536173", "0.6347936", "0.6344575", "0.6336725", "0.63325614", "0.63014704", "0.62865496", "0.6282523", "0.62745255", "0.62741286", "0.62516093", "0.62405354", "0.62377506", "0.6237039", "0.6234071", "0.62277085", "0.6226801", "0.6224299", "0.62114954", "0.62061936", "0.62032664", "0.6201798" ]
0.7592935
1
Transforms MySQL result to indexed 2D PHP array waarde van betreffende resultaatrij in kolom $colName wordt gebruikt als index van resultaat array
static function result2IndexedArray2D(&$result, $colName) { $resultArray = array(); // beginnen met lege array if (@mysql_num_rows($result) != 0) { $mysqlResultRow = mysql_fetch_assoc($result); $keys = array_keys($mysqlResultRow); // eenmalig kolomnamen uitlezen mysql_data_seek($result, 0); // weer terug naar eerste resultaat, om hieronder in while ALLE resultaatrijen mee te nemen // rij voor rij alle waarden toevoegen aan $resultArray while ($mysqlResultRow = mysql_fetch_assoc($result)) { $row_arr = array(); for ($k = 0; $k < count($keys); $k++) { $row_arr[$keys[$k]] = $mysqlResultRow[$keys[$k]]; } $resultArray[$row_arr[$colName]] = $row_arr; } //mysql_free_result($result); } return $resultArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resultSet2array($myrst) {\n $resultset = null;\n $row = 0;\n while ($myrow = mysql_fetch_array($myrst)) {\n $col = 0;\n foreach ($myrow as $column) {\n $resultset[$row][$col]=$myrow[$col++];\n }\n $row++;\n }\n return $resultset;\n}", "static function result2Array2D(&$result) {\n $resultArray = array(); // beginnen met lege array\n if (@mysql_num_rows($result) != 0) {\n mysql_data_seek($result, 0);\n $mysqlResultRow = mysql_fetch_assoc($result);\n $keys = array_keys($mysqlResultRow); // eenmalig kolomnamen uitlezen\n mysql_data_seek($result, 0); // weer terug naar eerste resultaat, om hieronder in while ALLE resultaatrijen mee te nemen\n\n // rij voor rij alle waarden toevoegen aan $resultArray\n while ($mysqlResultRow = mysql_fetch_assoc($result)) {\n $row_arr = array();\n for ($k = 0; $k < count($keys); $k++) {\n $row_arr[$keys[$k]] = $mysqlResultRow[$keys[$k]];\n }\n array_push($resultArray, $row_arr);\n }\n\n //mysql_free_result($result);\n }\n\n return $resultArray;\n }", "public function db_index_array($sql,$id_field)\n\t{\n\t\tif ($qry=$this->db_query($sql))\n\t\t\twhile ($row=$this->fetch_array($qry))\n\t\t\t\t$result[$row[$id_field]]=$row;\n\t\t\n\t\tif (is_resource($qry))\n\t\t\tmysql_free_result($qry);\t\t\n\t\t\n\t\tif (!empty($result)) return $result;\t\t\n\t\telse return null;\n\t}", "function sql_new_fetch_into_array($query) {\n\treturn sql_fetch_column($query);\n}", "private function mysql_fetch_full_result_array($result)\n {\n $table_result=array();\n $r=0;\n while($row = mysql_fetch_assoc($result)){\n $arr_row=array();\n $c=0;\n while ($c < mysql_num_fields($result)) { \n $col = mysql_fetch_field($result, $c); \n $arr_row[$col -> name] = $row[$col -> name]; \n $c++;\n } \n $table_result[$r] = $arr_row;\n $r++;\n } \n return $table_result;\n }", "static function result2Array(&$result) {\n $return_array = array();\n if (@mysql_num_rows($result) != 0) {\n while ($row = mysql_fetch_assoc($result)) {\n $keys = array_keys($row);\n $return_array[] = $row[$keys[0]];\n }\n mysql_free_result($result);\n }\n return $return_array;\n }", "function sql_result($res, $row = 0, $col = 0)\n {\n $results = array();\n if (intval($row) < 1) {\n $results = $res->fetch(PDO::FETCH_BOTH);\n return $results[$col];\n }\n else {\n for ($i = 0; $i < intval($row); $i++) {\n $results = $res->fetch(PDO::FETCH_BOTH);\n }\n $results = $res->fetch(PDO::FETCH_BOTH);\n return $results[$col];\n }\n }", "public function fetchColumn() {\r\n\t\t$result = array();\r\n\r\n\t\twhile ($data = $this->fetch()) {\r\n\t\t\t$result[] = current($data);\r\n\t\t}\r\n\r\n\t\t$this->freeResult();\r\n\r\n\t\treturn $result;\r\n\t}", "public static function queryColWithIndex($sql)\n\t{\n\t\t$tempResults = self::$link->query($sql);\n\t\t\n\t\tif(!$tempResults)\n\t\t{\n\t\t\tself::handleError($sql);\n //TODO should probably return here\n\t\t}\n\t\t\n\t\t$column = array();\n\t\t\n\t\twhile(!is_null($row = $tempResults->fetch_row()))\n\t\t{\n\t\t\t$column[$row[0]] = $row[1];\n\t\t}\n\t\t\n\t\t$tempResults->close();\n\t\t\n\t\t//return $tempResults->fetchCol();\n\t\treturn $column;\n\t}", "function res2keyarray($res,$key) {\n if(!$res) return array();\n while($row=mysql_fetch_assoc($res)){\n $array[$row[$key]] = $row;\n }\n return $array;\n}", "public function get_array_of($result, $field ){\n\t\t\t$arr = array();\n\t\t\tif(is_array($field)) {\n\t\t\t\twhile($row = mysql_fetch_array($result)){\n\t\t\t\t\t$temp_arr = array();\n\t\t\t\t\tforeach($field as $temp_field){\n\t\t\t\t\t\t//array_push($temp_arr, $row[$temp_field]);\n\t\t\t\t\t\t$temp_arr[$temp_field] = $row[$temp_field];\n\t\t\t\t\t}\n\t\t\t\t\tarray_push($arr, $temp_arr);\n\t\t\t\t}\n\t\t\t\treturn $arr;\n\t\t\t}else {\n\t\t\t\twhile($row = mysql_fetch_array($result)){\n\t\t\t\t\tarray_push($arr, $row[$field]);\n\t\t\t\t}\n\t\t\t\treturn $arr;\n\t\t\t}\n\t\t}", "public function column($colName = 'ID')\n {\n $result = array();\n foreach ($this->lists as $list) {\n $result = array_merge($result, $list->column($colName));\n }\n return $result;\n }", "public static function col($query = null , $x = 0) {\n $query && self::query($query);\n $new_array = array();\n // Extract the column values\n for ( $i=0; $i < count(self::$last_result); $i++ ) {\n $new_array[$i] = self::value(null, $x, $i);\n }\n return $new_array;\n }", "private function get_columns(&$result)\n\t{\n\t\t$i = 0; \n\t\twhile ($result->columnName($i)) {\n\t\t\t$columns[] = $result->columnName($i);\n\t\t\t$i++;\n\t\t}\n\t\treturn $columns;\n\t}", "function selectResultArr ($stmt, $dxml) {\n\t\n\t$options = $stmt->get_result();\n\t$new_column = \"column\";\n\t$new_row = \"row\";\n\t$end_row = \"end_row\"; \n\t\n\twhile ($entry = $options->fetch_array(MYSQLI_NUM)) {\n\t\t\n\t\t/*Hide and store the flight ID for more efficiently referring to this flight in other\n\t\tcalls to the database*/\n\t\t$dxml->addChild($new_row, $entry[0]);\t\t\n\t\t\t\n\t\tfor($i = 1; $i < count($entry); $i++) {\n\t\t\t$dxml->addChild($new_column, $entry[$i]);\t\t\n\t\t}\n\t\t\n\t\t$dxml->addChild($end_row, \"\");\t\t\n\t}\t\n}", "function db_result_to_array($result){\n\t\t\t\t\t\t\t$res_array = array();\n\n\t\t\t\t\t\t\tfor($count=0; $row= @mysql_fetch_array($result); $count++)\n\t\t\t\t\t\t\t\t$res_array[$count] = $row;\n\t\t\t\t\t\t\treturn $res_array;\n\t\t\t\t\t\t}", "function db_to_arr($column_name)\n{\n\t$i = 0;\t//count lines\n\t$db_handle = mysql_query(\"SELECT {$column_name} FROM intro \");\n\t\n\twhile($row = mysql_fetch_array($db_handle))\n\t{\n\t\tif($row[$column_name] && $row[$column_name] != \"0000\")\t//if not null, 0000 is default for year\n\t\t{\n\t\t\t\n\t\t\tif(strrpos($row[$column_name], \",\")) //if field is seperated by commas\n\t\t\t{\n\t\t\t\t$data_csv = explode(\",\" , $row[$column_name]);\n\t\t\t\tfor($s = 0; $s < sizeof($data_csv)-1; $s++)\n\t\t\t\t{\n\t\t\t\t\techo \"\\\"\" . addslashes(trim($data_csv[$s])) . \"\\\", \";\n\t\t\t\t}\n\t\t\t\techo \"\\\"\" . addslashes(trim($data_csv[$s])) . \"\\\"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"\\\"\" . addslashes(trim($row[$column_name])) . \"\\\"\";\n\t\t\t}\n\t\t\t$i++;\n\t\t\tif($i < mysql_num_rows($db_handle))\t//if not last field\n\t\t\t{\t\t\t\t\n\t\t\t\techo \",\";\n\t\t\t}\n\t\t}\n\t}\n}", "function fetchResult() {\n\t\tif ($row = mysql_fetch_row($this->results)) {\n\t\t\t$resultRow = array();\n\t\t\t$i = 0;\n\t\t\tforeach ($row as $index => $field) {\n\t\t\t\tlist($table, $column) = $this->map[$index];\n\t\t\t\t$resultRow[$table][$column] = $row[$index];\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\treturn $resultRow;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function get_col($query=null,$x=0)\n\t\t{\n\n\t\t\t$new_array = array();\n\n\t\t\t// If there is a query then perform it if not then use cached results..\n\t\t\tif ( $query )\n\t\t\t{\n\t\t\t\t$this->query($query);\n\t\t\t}\n\n\t\t\t// Extract the column values\n\t\t\tfor ( $i=0; is_array($this->last_result) && $i < count($this->last_result); $i++ )\n\t\t\t{\n\t\t\t\t$new_array[$i] = $this->get_var(null,$x,$i);\n\t\t\t}\n\n\t\t\treturn $new_array;\n\t\t}", "function generate2dArrayFromDB($tableName, $columnNames, $where) {\n\n //creates a connection with the Database\n $conn = connect();\n\n //Generates SELECT sql part\n $commaSeperatedcolumnNames = $columnNames[0];\n for ($i=1; $i<count($columnNames); $i++) {\n $commaSeperatedcolumnNames .= \", \" . $columnNames[$i];\n }\n\n //combines SELECT $tableName and WHERE parts to form sql query\n $sql = \"SELECT $commaSeperatedcolumnNames\n FROM $tableName\n $where\";\n\n //saves query results\n $result = $conn->query($sql);\n //if there are result continue\n if ($result !== FALSE) {\n if ($result->num_rows > 0) {\n return TRUE;\n } else {\n return FALSE;\n }\n } else {\n return 'Fout in programmatuur';\n }\n $conn->close();\n}", "function bi_column($con, $query, &$arr_data){\r\n\r\n\t$arr_data = array();\r\n\r\n\t$res = $con->query($query);\r\n\t$arr = $res->fetchAll(2);\r\n\r\n\tif(FALSE && count($arr) > 0){\r\n\t\t$a = $arr[0][\"a\"];\r\n\t\t// Verifica se \"a\" esta no formato: \"99 - 99\" (hora em hora)\r\n\t\tif(substr($a, -1) == \"h\" && !is_null(value_numeric(substr($a, 0, (strlen($a) - 1))))){\r\n\t\t\t// Preenche os valores restantes, para ir de 00 ate 23\r\n\t\t\tfor($i = 0; $i <= 23; $i++){\r\n\t\t\t\t$achou = false;\r\n\t\t\t\tforeach($arr as $row){\r\n\t\t\t\t\tif($i == (float) substr($row[\"a\"], 0, (strlen($row[\"a\"]) - 1))){\r\n\t\t\t\t\t\t$achou = TRUE;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(!$achou){\r\n\t\t\t\t\t$arr[] = array(\r\n\t\t\t\t\t\t\"a\" => str_pad($i, 2, \"0\", STR_PAD_LEFT).\"h\",\r\n\t\t\t\t\t\t\"y\" => 0\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Reordena o array\r\n\t\t\t$arr_aux = array();\r\n\t\t\tforeach($arr as $row){\r\n\t\t\t\t$arr_aux[$row[\"a\"]] = $row;\r\n\t\t\t}\r\n\t\t\tksort($arr_aux);\r\n\t\t\t$arr = array();\r\n\t\t\tforeach($arr_aux as $row){\r\n\t\t\t\t$arr[] = $row;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tforeach($arr as $row){\r\n\t\t$arr_data[] = array(\r\n\t\t\t\"label\" => $row[\"a\"],\r\n\t\t\t\"value\" => $row[\"y\"]\r\n\t\t);\r\n\t}\r\n}", "function GetOldData($TableName,$FieldNames) {\n $Query = \"SELECT * FROM `\".$TableName.\"`;\";\n $Result = mysql_query($Query) or die(\"Error in query: $query \".mysql_error());\n $NumResults = mysql_num_rows($Result);\n if ($NumResults > 0) {\n while ($row = mysql_fetch_array($Result,MYSQL_ASSOC)) {\n foreach ($FieldNames as $FieldName) {\n $array[$row[DmrID]][$FieldName] = $row[$FieldName]; //AM I OVERTHINKING THIS?\n }\n }\n }\n if (is_null($array))\n {\n return array();\n }\n else\n {\n return $array;\n }\n}", "function db_result_to_array($result) {\r\n $res_array = array();\r\n\r\n for ($count = 0; $row = $result->fetch_assoc(); $count++) {\r\n $res_array[$count] = $row;\r\n }\r\n return $res_array;\r\n }", "public function getCol() : array\n\t{\n\t\treturn $this->fetchAllFromColumn();\n\t}", "function get_col($query=null,$x=0, $use_prepare=false)\n\t\t{\n\n\t\t\t$new_array = array();\n\n\t\t\t// If there is a query then perform it if not then use cached results..\n\t\t\tif ( $query )\n\t\t\t{\n\t\t\t\t$this->query($query, $use_prepare);\n\t\t\t}\n\n\t\t\t// Extract the column values\n\t\t\t$j = count($this->last_result);\n\t\t\tfor ( $i=0; $i < $j; $i++ )\n\t\t\t{\n\t\t\t\t$new_array[$i] = $this->get_var(null,$x,$i);\n\t\t\t}\n\n\t\t\treturn $new_array;\n\t\t}", "function db_result_to_array($result) {\n $res_array = array();\n \n for ($count=0; $row = $result->fetch_assoc(); $count++) {\n $res_array[$count] = $row;\n }\n \n return $res_array;\n }", "public static function queryCol($sql)\n\t{\n\t\t$tempResults = self::$link->query($sql);\n\t\t\n\t\tif(!$tempResults)\n\t\t{\n\t\t\tself::handleError($sql);\n //TODO should probably return here\n\t\t}\n\t\t\n\t\t$column = array();\n\t\t\n\t\twhile(!is_null($row = $tempResults->fetch_row()))\n\t\t{\n\t\t\t$column[] = $row[0];\n\t\t}\n\t\t\n\t\t$tempResults->close();\n\t\t\n\t\t//return $tempResults->fetchCol();\n\t\treturn $column;\n\t}", "function sqlToArray($sqlResult){\n $arr = [];\n while ($line = mysqli_fetch_array($sqlResult)) {\n $arr [] = $line[0];\n }\n return $arr;\n}", "private static function getResultColumn($result, $index=0)\n\t{\n\t $rows = array();\n\t while($row = is_numeric($index) ? $result->fetch_row() : $result->fetch_assoc())\n\t $rows[] = $row[$index];\n\t\t$result->free();\n\t return $rows;\n\t}", "private function queryFetchAsValues(mysqli_result $result)\n\t{\n\t\t$column = $result->field_count - 1;\n\t\t$values = [];\n\t\twhile ($element = $result->fetch_row()) {\n\t\t\tif (isset($element['id'])) {\n\t\t\t\t$values[$element['id']] = $element[$column];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$values[] = $element[$column];\n\t\t\t}\n\t\t}\n\t\treturn $values;\n\t}", "function db_result_to_array($result) {\n $res_array = array();\n\n for ($count=0; $row = $result->fetch_assoc(); $count++) {\n $res_array[$count] = $row;\n }\n\n return $res_array;\n}", "function get_col($query=null,$x=0) {\n\n\t\t\t// If there is a query then perform it if not then use cached results..\n\t\t\tif ( $query ) {\n\t\t\t\t$this->query($query);\n\t\t\t}\n\n\t\t\t// Extract the column values\n\t\t\tfor ( $i=0; $i < count($this->last_result); $i++ ) {\n\t\t\t\t$new_array[$i] = $this->get_var(null,$x,$i);\n\t\t\t}\n\n\t\t\treturn $new_array;\n\t\t}", "function id_name_to_array($result) {\n $res = $result->fetch_all();\n $rows = $result->num_rows;\n\n $return_array = array();\n\n for($i = 0; $i < $rows; $i++) {\n $id = $res[$i][0];\n $name = $res[$i][1];\n array_push($return_array, [$id, $name]);\n }\n\n return $return_array;\n }", "public function result_column($column)\n {\n $output = array();\n\n if (is_bool($this->result))\n {\n return $output;\n }\n\n while ($row = $this->result->fetch_assoc())\n {\n $output[] = $row[$column];\n }\n\n $this->free_result();\n\n return $output;\n }", "function mysql_fetch_multi($result) {\r\n\t$row = mysql_fetch_row($result);\r\n\r\n\tif(!$row) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tforeach ($row as $offset => $value) {\r\n\t\t$return[mysql_field_table($result, $offset)][mysql_field_name($result, $offset)] = $value;\r\n\r\n\t}\r\n\r\n\treturn $return;\r\n\r\n}", "function mysql06($campo,$tabla){\n $query1=\"SELECT \".$campo.\" FROM \".$tabla;\n $query2=mysql_query($query1);\n $i = 0;\n while( $rec = mysql_fetch_row($query2) ){\n $array[$i] = $rec[0];\n $i++;\n }\n return $array;\n}", "function array_column(&$arr, $col) {\n $column = array();\n foreach ($arr as $row) {\n $column[] = $row[$col];\n }\n return $column;\n}", "function get_col( $query = null , $x = 0 ) {\n\t\tif ( $query )\n\t\t\t$this->dbcr_query( $query );\n\n\t\t$new_array = array();\n\t\t// Extract the column values\n\t\tfor ( $i = 0, $j = count( $this->dbcr_wpdb->last_result ); $i < $j; $i++ ) {\n\t\t\t$new_array[$i] = $this->get_var( null, $x, $i );\n\t\t}\n\t\treturn $new_array;\n\t}", "public function toColumn(): array\n {\n return $this->pdoStatement->fetchAll(\\PDO::FETCH_COLUMN, 0);\n }", "public static function prepareQueryResult($res) {\r\n $keys = call_user_func(array(get_called_class(), 'getKeys'));\r\n //identify all parameters with \"colname\" set\r\n $column_keys = array();\r\n foreach ($keys as $key => $val) {\r\n if (isset($val['colname']) && $val['colname'] != null)\r\n $column_keys[$key] = $val['colname'];\r\n }\r\n\r\n //for all items\r\n $ret = array();\r\n foreach ($res as $row) {\r\n $ret_row = array();\r\n //for the identified parameters\r\n foreach ($column_keys as $key => $val)\r\n //execute $row->get<ParameterColname>\r\n $ret_row[$key] = call_user_func(array($row, \"get\" . $val));\r\n $ret[] = $ret_row;\r\n }\r\n return $ret;\r\n }", "function resultSet($results) {\n $this->map = array();\n $numFields = $results->columnCount();\n $index = 0;\n $j = 0;\n\n while ($j < $numFields) {\n $column = $results->getColumnMeta($index);\n if (!empty($column['table'])) {\n $this->map[$index++] = array($column['table'], $column['name']);\n } else {\n if (strpos($column['name'], '__')) {\n $parts = explode('__', $column['name']);\n $this->map[$index++] = array($parts[0], $parts[1]);\n } else {\n $this->map[$index++] = array(0, $column['name']);\n }\n }\n $j++;\n }\n\n }", "function show_query_result_array($conn, $sql, $getheader=false, $tablename=\"\\$tablename\"){\r\n\t$result = $conn->query($sql);\r\n\t$gh = $getheader;\r\n\t\r\n\tif ($result->num_rows > 0) {\r\n\t// not empty result.\r\n\t\t$toReturn = array();\r\n\t\twhile($row = $result->fetch_assoc()) {\r\n\t\t\tif ($gh and $getheader){\r\n\t\t\t\tarray_push($toReturn, array_keys($row));\r\n\t\t\t\t$gh = false;\r\n\t\t\t}\r\n\t\t\tarray_push($toReturn, array_values($row));\r\n\t\t}\r\n\t\treturn $toReturn;\r\n\t}else{\r\n\t\treturn array(array());\r\n\t}\t\r\n\r\n}", "public function toArray($renameColumns=null){ }", "function mysql_fetch_array_1d($res) {\n\twhile($row=mysql_fetch_array($res)) {\n\t\tif (!(empty($row[0]))){\n\t\t\t$return[] = $row[0];\n\t\t}\n }\n return $return;\n}", "function sql_fetch_array_r($result)\t{\n\t\t$row_counter = 0;\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result) ) {\n\t\t\t$whole_result[$row_counter] = $row;\n\t\t\t$row_counter++;\n\t\t}\n\t\treturn $whole_result;\n\t}", "function convertToArray( $result ){\n $resultArray = array();\n\n for( $count=0; $row = $result->fetch_assoc(); $count++ ) {\n $resultArray[$count] = $row;\n }\n\n return $resultArray;\n }", "public function sql_fetch_array($result) {\n return @mysql_fetch_array($result);\n }", "abstract protected function _getColumnNames($rs);", "public function fetchIndexArray() {\n return mysqli_fetch_row ( $this->result );\n }", "function getcolumnNames($tableName) {\n\n //Gets column names from the database\n $conn = connect();\n $sql = \"SHOW COLUMNS FROM \" . $tableName;\n $result = $conn->query($sql);\n\n //Outputs data if information was found\n $colArray = array();\n if ($result->num_rows > 0) {\n $i = 0;\n\n //writes names 1 by 1 into the variable $colarray\n while($row = $result->fetch_assoc()) {\n $colArray[$i] = $row['Field'];\n $i++;\n }\n\n $conn->close();\n return $colArray;\n }\n}", "function get($table,$col){\n $array=array();\n $conn=connectDB();\n $query=\"SELECT * FROM $table\";\n foreach ($conn->query($query)as $row){\n array_push($array,$row[$col]);\n }\n return $array;\n }", "function dbgetarray() {\n\t$output = array();\n\t\n\t$args = func_get_args();\n\t$result = call_user_func_array('dbquery', $args);\n\t$query = array_shift($args);\n\n\t// this only applies to SELECT queries!\n\tif (preg_match('/^SELECT/i', $query)) {\n\t\twhile ($result && $row = dbfetch($result, DB_NUM)) {\n\t\t\tif (count($row) == 1) { // use integer keys\n\t\t\t\t$output[] = $row[0];\n\t\t\t} else if (count($row) == 2) { // use first column keys\n\t\t\t\t$output[$row[0]] = $row[1];\n\t\t\t} else { // use integer keys and array values\n\t\t\t\t$output[] = $row;\n\t\t\t}\n\t\t}\n\t\tdbfree($result);\n\t} else {\n\t\tEWarning(EC_REALS_DATABASE, \"dbgetarray called with non-SELECT query!\", \"Non-select query\");\n\t}\n\n\treturn $output;\n}", "private function _merge_column_data($result_set)\n\t{\n\t\t$data = $result_set->data;\n\t\t$columns = $result_set->columns;\n\t\t$array = array();\n\t\tforeach ($data as $key=>$row)\n\t\t{\n\t\t\t$array[$key] = array_combine($columns, $row);\n\t\t}\n\t\treturn $array;\n\t}", "abstract protected function columns(): array;", "private function getFieldsOnTable()\n{\n\n $returnArray=array(); \n foreach ($this->tableStructure as $ind => $fieldArray) { \n $returnArray[$fieldArray['columnName']]=$fieldArray['columnName'];\n }\n \n return $returnArray; \n}", "function query_array($sql, $primary_key = null) {\r\n\r\n\t\t$this->query($sql);\r\n\r\n\t\t$return = array();\r\n\r\n\t\twhile ($row = mysql_fetch_assoc($this->result)) {\r\n\t\t\tif (isset($primary_key) && key_exists($primary_key, $row)) {\r\n\t\t\t\t$return[$row[$primary_key]] = $row;\r\n\t\t\t} else {\r\n\t\t\t\t$return[] = $row;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $return;\r\n\t}", "function fn_fetch_array($table,$name){\r\n\t\t\t$query = $this->query(\"select $name from $table where 1 \");\r\n\t\t\t$row = $this->fetch_array($query);\r\n\t\t\treturn $row;\r\n\t\t}", "private function _getColDataIndex($cols,$filterData) {\n $arr = array();\n foreach ($cols as $col) {\n foreach ($filterData as $key => $value) {\n if($key == $col['mapped']) {\n $dataIndex = $col['dataIndex'];\n $jsonCol = array('property' => $dataIndex,'value' => $value);\n $arr[] = $jsonCol;\n }\n }\n }\n return json_encode($arr); \n }", "function getData($result) {\r\n\t\t$data = array();\r\n\t\t$i = 0;\r\n\t\twhile ($row = $result->fetch_assoc()) {\r\n\t\t\tforeach ($row as $key => $value) {\r\n\t\t\t\t$data[$i][$key] = $value;\t\t\r\n\t\t\t}\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\treturn $data;\r\n\t}", "function getColumn($arr, $x){\n\treturn array_map(function($y)use($x){ return $y[$x]; }, $arr);\n}", "function DBfetchArrayAssoc($cursor, $field) {\n\t$result = array();\n\twhile ($row = DBfetch($cursor)) {\n\t\t$result[$row[$field]] = $row;\n\t}\n\treturn $result;\n}", "function sql_fetch_array($res)\n {\n $results = array();\n if ($res)\n $results = $res->fetch(PDO::FETCH_BOTH);\n return $results;\n }", "public function fetchAndReindex($sql)\n {\n $query = $this->query($sql);\n if (!$query) {\n return false;\n }\n $result = [];\n while ($row = $query->fetch_assoc()) {\n $key = reset($row);\n $value = count($row) == 2 ? next($row) : $row;\n if (count($row) > 2) {\n array_shift($value);\n }\n if (isset($result[$key])) {\n if (is_array($value)) {\n if (!is_array(reset($result[$key]))) {\n $result[$key] = [$result[$key]];\n }\n $result[$key] [] = $value;\n } else {\n $result[$key] = array_merge((array) $result[$key], (array) $value);\n }\n } else {\n $result[$key] = $value;\n }\n }\n return $result;\n }", "function slice_array($arr, $column) {\n $output = array();\n foreach ($arr as $row) {\n $output[$row[$column]][] = $row;\n }\n return $output;\n}", "public function fetchCol($columnName);", "function sql_fetch_field($res,$offset = 0)\n {\n $results = array();\n $obj = NULL;\n $results = $res->getColumnMeta($offset);\n foreach($results as $key=>$value) {\n $obj->$key = $value;\n }\n return $obj;\n }", "public function arrayResult(){\n\t\t$this->arrayedResult = mysqli_fetch_assoc($this->result) or die (mysql_error($this->databaseLink));\n\t\treturn $this->arrayedResult;\n\t}", "abstract protected function getColumns(): array;", "function pluck($col, $array)\n{\n $res = array();\n foreach ($array as $k => $row) {\n $res[$k] = $row[$col];\n }\n return $res;\n}", "private function initColumnArrays()\n {\n foreach ($this->columns as $key => $column) {\n $dql = $this->accessor->getValue($column, 'dql');\n $data = $this->accessor->getValue($column, 'data');\n\n $currentPart = $this->entityShortName;\n $currentAlias = $currentPart;\n $metadata = $this->metadata;\n\n if (true === $this->accessor->getValue($column, 'customDql')) {\n $columnAlias = str_replace('.', '_', $data);\n\n // Select\n $selectDql = preg_replace('/\\{([\\w]+)\\}/', '$1', $dql);\n $this->addSelectColumn(null, $selectDql.' '.$columnAlias);\n // Order on alias column name\n $this->addOrderColumn($column, null, $columnAlias);\n // Fix subqueries alias duplication\n $searchDql = preg_replace('/\\{([\\w]+)\\}/', '$1_search', $dql);\n $this->addSearchColumn($column, null, $searchDql);\n } elseif (true === $this->accessor->getValue($column, 'selectColumn')) {\n $parts = explode('.', $dql);\n\n while (count($parts) > 1) {\n $previousPart = $currentPart;\n $previousAlias = $currentAlias;\n\n $currentPart = array_shift($parts);\n $currentAlias = ($previousPart === $this->entityShortName ? '' : $previousPart.'_').$currentPart;\n\n if (!array_key_exists($previousAlias.'.'.$currentPart, $this->joins)) {\n $this->addJoin($previousAlias.'.'.$currentPart, $currentAlias, $this->accessor->getValue($column, 'joinType'));\n }\n\n $metadata = $this->setIdentifierFromAssociation($currentAlias, $currentPart, $metadata);\n }\n\n $this->addSelectColumn($currentAlias, $this->getIdentifier($metadata));\n $this->addSelectColumn($currentAlias, $parts[0]);\n $this->addSearchOrderColumn($column, $currentAlias, $parts[0]);\n } else {\n // Add Order-Field for VirtualColumn\n if ($this->accessor->isReadable($column, 'orderColumn') && true === $this->accessor->getValue($column, 'orderable')) {\n $orderColumn = $this->accessor->getValue($column, 'orderColumn');\n $orderParts = explode('.', $orderColumn);\n if (count($orderParts) < 2) {\n $orderColumn = $this->entityShortName.'.'.$orderColumn;\n }\n $this->orderColumns[] = $orderColumn;\n } else {\n $this->orderColumns[] = null;\n }\n\n // Add Search-Field for VirtualColumn\n if ($this->accessor->isReadable($column, 'searchColumn') && true === $this->accessor->getValue($column, 'searchable')) {\n $searchColumn = $this->accessor->getValue($column, 'searchColumn');\n $searchParts = explode('.', $searchColumn);\n if (count($searchParts) < 2) {\n $searchColumn = $this->entityShortName.'.'.$searchColumn;\n }\n $this->searchColumns[] = $searchColumn;\n } else {\n $this->searchColumns[] = null;\n }\n }\n }\n\n return $this;\n }", "static function resultToArray($result)\n\t{\n\t\t$arrTmp = array();\n\t\tforeach($result as $key => $value)\n\t\t{\n\t\t\t$arrTmp[$value['id']] = $value['name'];\n\t\t}\n\t\treturn $arrTmp;\n\t}", "function fetchResult() {\n\t\tif ($row = sqlite_fetch_array($this->results, SQLITE_ASSOC)) {\n\t\t\t$resultRow = array();\n\t\t\t$i = 0;\n\n\t\t\tforeach ($row as $index => $field) {\n\t\t\t\tif (strpos($index, '.')) {\n\t\t\t\t\tlist($table, $column) = explode('.', str_replace('\"', '', $index));\n\t\t\t\t\t$resultRow[$table][$column] = $row[$index];\n\t\t\t\t} else {\n\t\t\t\t\t$resultRow[0][str_replace('\"', '', $index)] = $row[$index];\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\treturn $resultRow;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function obtenerArray(){\r\n\t\treturn mysql_fetch_array( $this->rs() );\r\n\t}", "function getArraySQL($sql){\n //Creamos la conexión\n $conexion = $this->conectarBD();\n //generamos la consulta\n if(!$result = mysqli_query($conexion, $sql)) die();\n\n $rawdata = array();\n //guardamos en un array multidimensional todos los datos de la consulta\n $i=0;\n while($row = mysqli_fetch_array($result))\n {\n //guardamos en rawdata todos los vectores/filas que nos devuelve la consulta\n $rawdata[$i] = $row;\n $i++;\n }\n //Cerramos la base de datos\n $this->desconectarBD($conexion);\n //devolvemos rawdata\n return $rawdata;\n }", "function query_result_to_array($array_array,$value,$key=false) {\n\tif (!is_array($array_array)) return array();\n\tif ($key!==false) foreach ($array_array as $array) $temp[$array[$key]]=$array[$value];\n\telse foreach ($array_array as $array) $temp[]=$array[$value];\n\treturn $temp;\n}", "public function processColumnListing($results): array\n {\n return array_map(fn ($result) => ((object) $result)->column_name, $results);\n }", "public function arrayResultsWithKey($key='id'){\n\t\tif(isset($this->arrayedResult)){\n\t\t\tunset($this->arrayedResult);\n\t\t}\n\t\t$this->arrayedResult = array();\n\t\twhile($row = mysqli_fetch_assoc($this->result)){\n\t\t\tforeach($row as $theKey => $theValue){\n\t\t\t\t$this->arrayedResult[$row[$key]][$theKey] = $theValue;\n\t\t\t}\n\t\t}\n\t\treturn $this->arrayedResult;\n\t}", "function construct_common_array($stmt, $rowName)\n {\n $arr = [];\n while($row = $stmt -> fetch()): $arr[] = $row[$rowName]; endwhile;\n return $arr;\n }", "public function getColumns(): array;", "public function getColumn($query, $col = 0) {\n\t\t$return = array();\n\t\t$result = $this->query($query);\n\t\twhile ($row = $result->fetch_array()) {\n\t\t\t$return[] = $row[$col];\n\t\t}\n\t\t$result->free();\n\t\treturn $return;\n\t}", "private function createAssocArrayOfResult(mysqli_stmt $statement)\r\n\t{\r\n\t\t$statement->store_result();\r\n\t\t\r\n\t\tif($statement->num_rows <= 0)\r\n\t\t{\r\n\t\t\treturn array();\r\n\t\t}\r\n\t\t\r\n\t\t$meta = $statement->result_metadata();\r\n\r\n\t\twhile ($field = $meta->fetch_field()) { \r\n\t\t\t$params[] = &$row[$field->name]; \r\n\t\t}\r\n\t\t\r\n\t\tcall_user_func_array(array($statement, 'bind_result'), $params); \r\n\t\t\r\n\t\tif($statement->num_rows === 1)\r\n\t\t{\r\n\t\t\t$statement->fetch();\r\n\t\t\tforeach($row as $key => $val) \r\n\t\t\t{ \r\n\t\t\t\t$result[$key] = $val; \r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\twhile ($statement->fetch()) { \r\n\t\t\tforeach($row as $key => $val) \r\n\t\t\t{ \r\n\t\t\t\t$c[$key] = $val; \r\n\t\t\t} \r\n\t\t\t$result[] = $c; \r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "public function processColumnListing($results)\n {\n $mapping = function ($r) {\n $r = (object) $r;\n\n return $r->colname;\n };\n\n return array_map($mapping, $results);\n }", "function get_col_info($info_type=\"name\",$col_offset=-1)\n\t\t{\n\t\t\tif ( $this->col_info )\n\t\t\t{\n\t\t\t\tif ( $col_offset == -1 )\n\t\t\t\t{\n\t\t\t\t\t$i=0;\n\t\t\t\t\tforeach($this->col_info as $col )\n\t\t\t\t\t{\n\t\t\t\t\t\t$new_array[$i] = $col->{$info_type};\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t\treturn $new_array;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn $this->col_info[$col_offset]->{$info_type};\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function get_col($query=null, $x=0) {\n\n\t\t// If there is a query then perform it if not then use cached results..\n\t\tif ($query)\n\t\t\t$this->query($query);\n\n\t\t// Extract the column values\n\t\tfor ($i=0; $i < count($this->last_result); $i++)\n\t\t\t$new_array[$i] = $this->get_var(null, $x, $i);\n\n\t\treturn $new_array;\n\t}", "function getFromDbBarber($mysqli){\n\n //create array to save the price 2d\n $array_barber_fun = array(array());\n\n\n $sqlBarber = \"SELECT name,lastname,email,male,age,workThere FROM Barber \";\n\n $resultBarber = $mysqli->query($sqlBarber);\n\n\n\n $i = 1 ;\n\n if ($resultBarber->num_rows > 0) {\n // output data of each row\n while($row = $resultBarber->fetch_assoc()) {\n\n if (strcmp(\"Y\", $row[\"workThere\"]) === 0){\n $array_barber_fun[$i][0] = $row[\"name\"];\n $array_barber_fun[$i][1] = $row[\"lastname\"];\n $array_barber_fun[$i][2] = $row[\"email\"];\n $array_barber_fun[$i][3] = $row[\"male\"];\n $array_barber_fun[$i][4] = $row[\"age\"];\n $array_barber_fun[$i][5] = $row[\"workThere\"];\n\n $i = $i +1 ;\n }\n\n\n }\n }\n\n $array_barber_fun[0][0] = $i - 1 ;\n\n return $array_barber_fun ;\n\n\n}", "public static function getColumn($query)\n {\n $result = array();\n\n if ($_result = call_user_func_array(array('self', 'query'), func_get_args())) {\n while ($arr = self::$_db->fetchRow($_result, 'indexed')) {\n $result[] = $arr[0];\n }\n\n self::$_db->freeResult($_result);\n }\n\n return $result;\n }", "function get_col_info($info_type=\"name\",$col_offset=-1) {\n\n\t\t\tif ( $this->col_info ) {\n\t\t\t\tif ( $col_offset == -1 ) {\n\t\t\t\t\t$i=0;\n\t\t\t\t\tforeach($this->col_info as $col ) {\n\t\t\t\t\t\t$new_array[$i] = $col->{$info_type};\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t\treturn $new_array;\n\t\t\t\t} else {\n\t\t\t\t\treturn $this->col_info[$col_offset]->{$info_type};\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}", "public function toMap($strColumnKeyName, $strColumnValueName) {\r\n\t\t$tblTMP = $this->PDOStatement->fetchAll(PDO::FETCH_ASSOC);\r\n\t\tif(!sizeof($tblTMP)) return array();\r\n\t\t$tblOutput=array();\r\n\t\tforeach($tblTMP as $tblRow) {\r\n\t\t\t$tblOutput[$tblRow[$strColumnKeyName]]=$tblRow[$strColumnValueName];\r\n\t\t}\r\n\t\treturn $tblOutput;\r\n\t}", "abstract public function getColNames();", "public function fetch_field($name=null)\n {\n $out = array();\n foreach ($this->fetch_all() as $row)\n $out[] = $row[is_null($name) ? $row->keys()->get(0): $name];\n return $out;\n }", "function get_col_info($info_type=\"name\",$col_offset=-1)\n\t\t{\n\n\t\t\tif ( $this->col_info )\n\t\t\t{\n\t\t\t\tif ( $col_offset == -1 )\n\t\t\t\t{\n\t\t\t\t\t$i=0;\n\t\t\t\t\tforeach($this->col_info as $col )\n\t\t\t\t\t{\n\t\t\t\t\t\t$new_array[$i] = $col->{$info_type};\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t\treturn $new_array;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn $this->col_info[$col_offset]->{$info_type};\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}", "public function fetch_array(&$result){\r\n\t\t$ADODB_FETCH_MODE = ADODB_FETCH_BOTH;\r\n\t\tif(!$result->EOF){\r\n\t\t \t$rs = $result->fields;\r\n\t\t \t$result->MoveNext(); \r\n\t\t \treturn $rs;\r\n\t\t} \r\n\t}", "function cvt_to_key_values(&$row) {\n\t$row_out=array();\n\tforeach ($row as $k => $v) {\n\t\t$row_out[$k] = $v;\n\t}\n\treturn $row_out;\n}", "public static function get_columns_as_associative_array($col1, $col2)\n{\n try\n {\n $users_data = DB::table('users')->get(array($col1, $col2));\n foreach ($users_data as $key => $value)\n {\n $users[$value->id] = $value->username;\n }\n\n return $users;\n }\n\n catch(Exception $e)\n {\n Log::write('error', $e->getMessage());\n throw $e;\n }\n}", "public function fetch_array()\n\t{\n\t\tif($this->num_rows() < 1)\n\t\t\treturn false;\n\n\t\t$data = $this->result_metadata();\n\t\t$fields = array();\n\t\t$out = array();\n\n\t\t$fields[0] = &$this;\n\t\t$count = 0;\n\n\t\twhile($field = $data->fetch_field()) {\n\t\t\t$fields[$count] = &$out[$field->name];\n\t\t\t$count++;\n\t\t}\n\n\t\tcall_user_func_array(array($this, 'bind_result'), $fields);\n\n\t\treturn ($this->fetch()) ? $out : false;\n }", "public function getArrayColumnValues($field, $twoDimArray){\n return array_column($twoDimArray, $field);\n }", "public function get_col_dbnames($result){\r\n\t\t$col_dbnames = array();\r\n\t\t$num_fields = $result->FieldCount();\r\n\t\tfor($i = 0; $i < $num_fields; $i++) {\r\n\t\t\t$col_dbname = $this->field_name($result, $i); \r\n\t\t\t$col_dbnames[] = $col_dbname; \r\n\t\t} \r\n\t\t\r\n\t\treturn $col_dbnames;\r\n\t}", "public function processColumnListing($results) {\n return array_values(array_map(function ($r) {\n return $r->column_name;\n }, $results));\n }", "function array_column($array, $key) {\n\t\t\t$result = [];\n\t\t\tforeach ($array as $val) {\n\t\t\t\t$result[] = $val[$key];\n\t\t\t}\n\t\t\treturn $result;\n\t\t}", "function sql_fetch_assoc($res)\n {\n $results = array();\n if ($res)\n $results = $res->fetch(PDO::FETCH_ASSOC); \n return $results;\n }" ]
[ "0.6702796", "0.6625242", "0.64290893", "0.63385665", "0.63283736", "0.6311988", "0.6290015", "0.6265841", "0.6242912", "0.6227342", "0.6206899", "0.6200778", "0.6192673", "0.61892676", "0.61691314", "0.61562866", "0.6126762", "0.6117339", "0.6112531", "0.61124295", "0.6109998", "0.6075963", "0.6043008", "0.6042653", "0.6037724", "0.60363954", "0.60325515", "0.60277647", "0.60181326", "0.5989809", "0.59691215", "0.5950614", "0.5915298", "0.5890477", "0.58621794", "0.58531183", "0.5843305", "0.58424276", "0.58318794", "0.58317626", "0.58246493", "0.5808148", "0.5807187", "0.5805403", "0.5796792", "0.5782537", "0.5779604", "0.5774611", "0.5757402", "0.5739279", "0.5733948", "0.57287896", "0.5722723", "0.57124466", "0.5709084", "0.5707295", "0.5702868", "0.57015693", "0.56998163", "0.5698112", "0.5690739", "0.5680016", "0.567486", "0.5668167", "0.5666172", "0.5649684", "0.562223", "0.5615879", "0.5608794", "0.5605976", "0.5601662", "0.5594991", "0.5587423", "0.55664486", "0.55616736", "0.55615985", "0.5558729", "0.55558676", "0.55491585", "0.55473053", "0.5537469", "0.55312586", "0.5517057", "0.5512341", "0.5502304", "0.5500206", "0.54994285", "0.5492216", "0.5488584", "0.54818285", "0.54793227", "0.54683644", "0.54656726", "0.5463684", "0.5454532", "0.54544115", "0.54519373", "0.54495084", "0.54475915", "0.54449564" ]
0.8162258
0
run the query (expects initiated dbconnection)
static function runMysqlQuery($sql) { return BaseQueries::performQuery($sql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function execute_single_query(){\n\t\t$this -> open_connection();\n\t\t$this -> conn -> query($this -> query);\n\t\t$this -> close_connection();\n\t}", "private function executeQuery() {\n\t\t$recordset = $this->getConnection()->execute( $this );\n\t\t\n\t\tif( $recordset === false ) {\n\t\t\t$this->_recordset = array();\n\t\t} else {\n\t\t\t$this->_recordset = $recordset;\n\t\t}\n\n\t\t$this->_currentRow = 0;\n\t\t$this->isDirty( false );\n\t}", "public function run(){\n $sql = $this->sql();\n return $this->query($sql,$this->args);\n }", "private function func_execute () {\n $this -> connection = parent::func_query ($this -> query, $this -> query_data);\n }", "function query(\\database $dbase){\n //\n //Get the sql string \n $sql=$this->to_str();\n //\n // Execute the $sql on columns to get the $result\n $dbase->query($sql);\n \n }", "private function RunBasicQuery() {\n // Prepare the Query\n $this->stmt = $this->db->prepare($this->sql);\n \n // Run the Query in the Database\n $this->stmt->execute();\n \n // Store the Number Of Rows Returned\n $this->num_rows = $this->stmt->rowCount();\n \n // Work with the results (as an array of objects)\n $this->rs = $this->stmt->fetchAll();\n \n // Free the statement\n $this->stmt->closeCursor(); \n }", "function db_run_query( $statement ) {\n\n $this->pm_clear_dataset();\n $this->pm_store_statement( $statement );\n $this->pm_debug_statement( $statement );\n if( ! $this->query_is_select ) $this->pm_write_logfile( $statement );\n\n $this->dataset_obj = $this->connection->query( $statement );\n $this->pm_die_if_error( 'dataset_obj' );\n\n if( is_object( $this->dataset_obj )) # updates/inserts/deletes seem to return an integer not an object\n $this->rowcount = $this->dataset_obj->numrows();\n else\n $this->rowcount = ROWCOUNT_NOT_SET;\n\n return $this->dataset_obj;\n }", "protected function execute_single_query() \n\t\t{\n \t\t\t$this->open_connection();\n \t\t\t$this->conn->query($this->query);\n \t\t\t$this->close_connection();\n\t\t}", "abstract function executeQuery($cons);", "function executeQuery($query);", "function run_query($query) {\r\n\t \t$db = new Database();\r\n\t \t$queryResult = $db->run_query_internal($query);\r\n\t \treturn mysqli_query($db->getConnection(),$query);\r\n\t }", "public function execute() {\n\t\t\t$connection = \\Leap\\Core\\DB\\Connection\\Pool::instance()->get_connection($this->data_source);\n\t\t\tif ($this->before !== NULL) {\n\t\t\t\tcall_user_func_array($this->before, array($connection));\n\t\t\t}\n\t\t\t$connection->execute($this->command());\n\t\t\tif ($this->after !== NULL) {\n\t\t\t\tcall_user_func_array($this->after, array($connection));\n\t\t\t}\n\t\t}", "abstract protected function doQuery( $sql );", "function doQuery(&$sql,$dsn=\"default\") {\n\t\t//use this tableName\n\t\t$db = DB::getHandle($dsn);\n\n\t\t$db->query($sql);\n\n\t \treturn;\n\t}", "function doQuery(&$sql,$dsn=\"default\") {\n\t\t//use this tableName\n\t\t$db = DB::getHandle($dsn);\n\n\t\t$db->query($sql);\n\n\t \treturn;\n\t}", "abstract public function query();", "function queryExecute($query) {\r\n\t\t\r\n\t\tif (strlen(trim($query)) < 0 ) {\r\n\t\t\ttrigger_error(\"Database encountered empty query string in queryExecute function\",E_ERROR);\r\n\t\t}\r\n\t\tif( !$this->connected ) \r\n\t\t\t$this->connect();\r\n\t\t\r\n\t\tif($this->socket->query($query) === true) {\r\n\t\t\t$this->recordsUpdated = $this->socket->affected_rows;\r\n\t\t}\r\n\t}", "private function runQuery () {\n\n // Prepare the constructed SQL statement\n if ($this->_query = $this->_pdo->prepare($this->_sql)) {\n\n // Set a counter to one to use when binding\n $x = 1;\n \n // Loop through the binding array\n foreach($this->_bindArray as $param) {\n \n // Run the bindValue function to match the correct value to the correct placing\n $this->_query->bindValue($x, $param);\n\n // Increment the counter\n $x++;\n \n }\n \n // Run the execute function\n $this->execute();\n }\n }", "abstract public function query($sql);", "function query() {}", "public function query()\n\t{\n\t\t\n\t}", "function runQuery()\r\n\t\t{\r\n\t\tif(!$this->conn)\r\n\t\t\t{\r\n\t\t\t$this->createConnect();\r\n\t\t\t}\r\n\t\tif($this->query)\r\n\t\t\t{\r\n\t\t\t$this->errors=\"\";\r\n\t\t\t$this->query.=\";\";\r\n\t\t\t$this->result = mysql_query($this->query);\r\n\t\t\tif(mysql_affected_rows()>=0)\r\n\t\t\t\t{\r\n\t\t\t\tunset($this->query);\r\n\t\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\techo \"<br>Error:<br>\";\r\n\t\t\t\t$debugging=debug_backtrace();\r\n\t\t\t\tforeach ($debugging as $debug)\r\n\t\t\t\t\t{\r\n\t\t\t\t\techo \"<b>File :</b> \".$debug[\"file\"].\"<br />\";\r\n\t\t\t\t\techo \"<b>Line :</b> \".$debug[\"line\"].\"<br />\";\r\n\t\t\t\t\techo \"<b>Function :</b> \".$debug[\"function\"].\"<br />\";\r\n\t\t\t\t\techo \"<b>Cause :</b> \".mysql_error().\"<br />\";\r\n\t\t\t\t\t}\r\n\t\t\t\techo \"<b>Query :</b> \".$this->query.\"<hr>\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\telse\r\n\t\t\t{\r\n\t\t\techo \"<br>-- NULL Query --\";\r\n\t\t\t}\r\n\t\tif (!is_resource($this->result))\r\n\t\t\t{\r\n\t\t\t$this->errors=mysql_error();\r\n\t\t\tif($this->transaction)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->transaction=FALSE;\r\n\t\t\t\t\t$this->query=\"ROLLBACK TRANSACTION\";\r\n\t\t\t\t\t$this->runQuery();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public function execute($query);", "public function execute()\n {\n \tif ( $this->cur_query != \"\" )\n \t{\n \t\t$res = $this->query( $this->cur_query );\n \t}\n \t\n \t$this->cur_query \t= \"\";\n \t$this->is_shutdown \t= false;\n\n \treturn $res;\n }", "public function query($sql);", "public function query($sql);", "public function query($sql);", "public function query($sql);", "function query(DBWrapper $db, $sql)\n {\n\n $db->query($sql);\n }", "public function query();", "public function query();", "public function query();", "abstract protected function _query($sql);", "public static function query($query){\n if(!self::$connection){\n self::initDb();\n }\n\n return self::$connection->query($query);\n }", "public function doQuery($sql, $params);", "public static function query($sql);", "private function execute () {\n if($this->_query->execute()) {\n\n // It has been succesful so add the output to $this->results and set it as an object\n $this->_results = $this->_query->fetchAll(PDO::FETCH_OBJ);\n\n // Set the affected row count to $this->_count\n $this->_count = $this->_query->rowCount();\n\n } else {\n\n // The query failed so set $this->_error to true. MORE WORK NEEDED HERE\n $this->_error = true;\n\n }\n }", "public function runCustomQuery($query, Database_Config $databaseConfig = NULL);", "public function ExecuteQuery($query){\n\t\treturn $this->db_con->query($query);\n\t}", "public static function query();", "public function executeQuery() \r\n\t{\r\n\t\t$Result = $this->objStatement->execute();\r\n\t\t\r\n\t\tif($Result)\r\n\t\t{\r\n\t\t\t$Result = new DatabaseStatement($this->objStatement);\r\n\t\t}\r\n\t\t\r\n\t\treturn $Result;\r\n\t}", "public function testRunASqlQuery(){\r\n $sql = \"Select * from orders;\";\r\n $db = new database;\r\n $db->connectToDatabase();\r\n $success = $db->runASqlQuery($sql);\r\n $this->assertEquals(true,$success);\r\n }", "protected abstract function executeQuery($query);", "function db_query($db_query) {\n\t\t$result = pg_query($this->db_connection,$db_query)\n\t\t\tor die(\"Query: $db_query <br /> Error: \".pg_last_error($this->db_connection).\"<br />\");\n\t\treturn $result;\n\t}", "function query_db($sql) {\n\t\treturn mysql_query($sql, $this -> dbc);\n\t}", "function db_driver_query($query)\n{\n global $_db;\n\n return pg_query($_db['resource'][$_db['target']]['dbh'], $query);\n}", "function query($query){\r\n if($this->query = $this->connection->prepare($query)){\r\n $this->query->execute();\r\n //cek kalo error\r\n if ($this->query->errno){\r\n die(\"otak anda error: \". $this->query->error);\r\n }\r\n }else{\r\n die(\"Error execution: \". $this->query->error);\r\n }\r\n }", "function doQuery($query,$db='')\n\t{\n\n\t\tglobal $stats;\n\n\t\tif (DEBUG)\n\t\t{\n\t\t\t$stats['queries'][]\t= $query;\n\t\t\t$stats['querycount']\t= $stats['querycount']+1;\t// Number of queries\n\t\t}\n\n\t\t// change DB if neccessary\n\n\t\tif ($db!=='')\n\t\t\tselectDB($db);\n\n\t\t// perform query\n\n\t\t$result\t= @mssql_query($query);\n\n\t\tif (DEBUG)\n\t\t{\n\n\t\t\t$fh\t= @fopen(BASEDIR.'data'.DIRECTORY_SEPARATOR.'dblog.txt','a');\n\t\t\t@fputs($fh,$query.\"\\n\");\n\n\t\t\tif ($result !== true)\n\t\t\t{\n\n\t\t\t\t$error\t\t= mssql_get_last_message();\n\n\t\t\t\tif ((stristr($error,'Changed database context') === false) && (stristr($error,'Datenbankkontext wurde auf') === false))\n\t\t\t\t{\n\t\t\t\t\t@fputs($fh,\"\\n\".'ERROR: '.mssql_get_last_message().\"\\n\");\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t@fputs($fh,\"\\n\\n\".str_repeat('=',80).\"\\n\\n\\n\");\n\n\t\t\t@fclose($fh);\n\n\t\t}\n\n\t\t//\n\n\t\treturn $result;\n\n\t}", "function runQuery()\n\t{\n\t\treturn $this->query;\n\t}", "function _execute($sql) {\n\t\t$result = sqlite_query($this->connection, $sql);\n\n\t\tif (preg_match('/^(INSERT|UPDATE|DELETE)/', $sql)) {\n\t\t\t$this->resultSet($result);\n\t\t\tlist($this->_queryStats) = $this->fetchResult();\n\t\t}\n\t\treturn $result;\n\t}", "public function query()\n {\n $args = func_get_args();\n\n $this->connect(atkDb::getQueryMode($args[0]));\n\n return call_user_method_array('query',$this->m_current_clusternode, $args);\n }", "function tep_db_query($query){\n\t\tglobal $db;\n\t\treturn($db->Execute($query));\n\t}", "function execSql($query) {\n if ($result = mysql_query($query, $this->linkDatabaseSrc)) {\n return $result;\n } else {\n return 0;\n }\n }", "public function query($statement);", "public function executeQuery($query) {\r\n\t\t\r\n\t\t$this->mdb2->connect();\r\n\t\t\t\t\r\n\t\t$ResultSet = $this->mdb2->query($query);\r\n\t\t\r\n\t\t$this->mdb2->disconnect();\r\n\t\t\r\n\t\tif (PEAR::isError($ResultSet)) {\r\n\t\t\tdie($ResultSet->getMessage() . \": \" . $query);\r\n\t\t}\r\n\t\t\r\n\t\treturn $ResultSet;\r\n\t\t\r\n\t}", "public function execute()\n {\n if (!$this->sessionSet && $this->platform instanceof MySqlPlatform) {\n $this->connection->exec(\"SET @@SESSION.sql_mode = '';\");\n $this->sessionSet = true;\n }\n\n // Take a local copy so that we don't modify the original query and cause issues later\n $query = $this->replacePrefix((string) $this->sql);\n\n if (!($this->sql instanceof \\JDatabaseQuery) && ($this->limit > 0 || $this->offset > 0)) {\n // @TODO\n if ($this->offset > 0) {\n $query .= ' LIMIT ' . $this->offset . ', ' . $this->limit;\n } else {\n $query .= ' LIMIT ' . $this->limit;\n }\n }\n\n $this->prepared = $this->connection->prepare($query);\n\n // Increment the query counter.\n $this->count++;\n\n // Reset the error values.\n $this->errorNum = 0;\n $this->errorMsg = '';\n $memoryBefore = null;\n\n // If debugging is enabled then let's log the query.\n if ($this->debug) {\n // Add the query to the object queue.\n $this->log[] = $query;\n\n \\JLog::add($query, \\JLog::DEBUG, 'databasequery');\n\n $this->timings[] = microtime(true);\n }\n\n // Execute the query.\n $this->executed = false;\n $previous = null;\n\n if ($this->prepared instanceof Statement) {\n // Bind the variables:\n if ($this->sql instanceof JDatabaseQueryPreparable) {\n $bounded = $this->sql->getBounded();\n\n foreach ($bounded as $key => $obj) {\n $this->prepared->bindParam($key, $obj->value, $obj->dataType, $obj->length, $obj->driverOptions);\n }\n }\n\n try {\n $this->executed = $this->prepared->execute();\n } catch (\\Exception $previous) {\n }\n }\n\n if ($this->debug) {\n $this->timings[] = microtime(true);\n\n if (defined('DEBUG_BACKTRACE_IGNORE_ARGS')) {\n $this->callStacks[] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n } else {\n $this->callStacks[] = debug_backtrace();\n }\n }\n\n // If an error occurred handle it.\n if (!$this->executed) {\n // Get the error number and message before we execute any more queries.\n $errorNum = (int) $this->connection->errorCode();\n $errorMsg = (string) 'SQL: ' . implode(\", \", $this->connection->errorInfo());\n\n // Get the error number and message from before we tried to reconnect.\n $this->errorNum = $errorNum;\n $this->errorMsg = $errorMsg;\n\n // Throw the normal query exception.\n \\JLog::add(\n \\JText::sprintf('JLIB_DATABASE_QUERY_FAILED', $this->errorNum, $this->errorMsg),\n \\JLog::ERROR,\n 'databasequery'\n );\n throw new RuntimeException($this->errorMsg, $this->errorNum, $previous);\n }\n\n return $this->prepared;\n }", "abstract public function execute($query);", "function query( $sql ){\n\t\tif( $this->db == null ){\n\t\t\treturn false;\n\t\t}\n\t\t$result = $this->db->query( $sql );\n\n\t\treturn $result;\n\t}", "public function query()\n {\n }", "public function query()\n {\n }", "function queryDb($query) {\n\tglobal $connection;\n\n\treturn mysqli_query($connection, $query);\n}", "public function query($query){\n\t\t$this->lastQuery = $query;\n\t\treturn $this->connection->query($query);\n\t}", "private function query() {\n return ApplicationSql::query($this->_select, $this->_table, $this->_join, $this->_where, $this->_order, $this->_group, $this->_limit, $this->_offset);\n }", "public function query($query){\n return $this->connection->query($query);\n }", "public function executeQuery($query) {\n\t\t$result = $this->connection->query($query);\n\t\t$this->rowsAffected = $this->connection->affected_rows;\n\t\t\t\n\t\tif(!$result) {\n\t\t\tthrow new DBException(\"Unable to execute query: \" . $query);\n\t\t}\n\t\treturn $result;\n\t}", "protected abstract function executeQuery(Result $result);", "public function executeSQL($query){\n\t\t$this->lastQuery = $query;\t\t\n\t\tif($this->result = mysqli_query( $this->databaseLink,$query)){\n\t\t\tif (gettype($this->result) === 'object') {\n\t\t\t\t$this->records = @mysqli_num_rows($this->result);\n\t\t\t\t$this->affected = @mysqli_affected_rows($this->databaseLink);\n\t\t\t} else {\n\t\t\t\t$this->records = 0;\n\t\t\t\t$this->affected = 0;\n\t\t\t}\n\n\t\t\tif($this->records > 0){\n\t\t\t\t$this->arrayResults();\n\t\t\t\treturn $this->arrayedResult;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t}else{\n\t\t\t$this->lastError = mysql_error($this->databaseLink);\n\t\t\techo $this->lastError;\n\t\t\treturn false;\n\t\t}\n\t}", "final public function execute()\n {\n return $this\n ->finalize()\n ->getDB()\n ->execute($this);\n }", "function query($sql) {\r\n\t\treturn $this->execute($sql);\r\n\r\n\t}", "public function execute() {\r\n // $this->connecxao = parent::getConnect();\r\n $stmt = $this->connecxao->prepare($this->getQuery());\r\n $this->transition = $stmt->execute($this->getBinds());\r\n $this->error = $stmt->errorInfo();\r\n\r\n if ($this->error[0] == \"00000\") {\r\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\r\n $this->data = $stmt;\r\n } else {\r\n $this->setMsgError(\"Code Aplic Error: \" . $this->error[0] . \"<br />Code BD Error: \" . $this->error[1] . \"<br />Msg BD Error: \" . $this->error[2]);\r\n }\r\n }", "public function execute($sql) {\n\t\tquery_db2($sql, true);\n\t}", "public function query($sql) {\n $this->statement = $this->dbHandler->prepare($sql);\n }", "public function execute($sql);", "public function execute($sql);", "public function execute($sql) {\n\t\tif(SYS_USE_FIREPHP==1)\n\t\t\tPhpBURN_Message::output(\"[!Performing the query!]: $sql\");\n\t\treturn $this->getModel()->getConnection()->executeSQL($sql);\n\t\t//$this->resultSet = &$this->getModel()->getConnection()->executeSQL($sql);\n\t}", "function query() {\n }", "function query($query) {\n\t\treturn $this->dbcr_query( $query, true );\n\t}", "protected function dbquery($query) {\r\n\r\n $this->query_result = $this->connection->query($query);\r\n\r\n return $this->query_result;\r\n }", "public function query($query) {\n $this->result = $this->dbHandler->prepare($query);\n }", "public function query($sql){\r\n $this->stmt = $this->dbh->prepare($sql);\r\n }", "public function executeQuery( $sql )\n {\n \tif( ! $result = $this->connections[$this->activeConnection]->query( $sql ) )\n \t{\n\t\t trigger_error('Error executing query: ' . $sql .' - '.$this->connections[$this->activeConnection]->error, E_USER_ERROR);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->previouslyExecuted = $result;\n\t\t}\n }", "function db_execute($query)\n {\n /*\n * Execute the Query\n */\n $this->varifysql($query[\"SQL\"]);\n return $this->get_conn()->query($query[\"SQL\"], PDO::FETCH_ASSOC);\n }", "public function execute () {\n $this->query->execute();\n }", "private function ExecuteQuery()\n\t{\n\t\tswitch($this->querytype)\n\t\t{\n\t\t\tcase \"SELECT\":\n\t\t\t{\n\t\t\t\t$this->stmt->execute();\n\t\t\t\t$this->querydata = $this->stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"INSERT\":\n\t\t\tcase \"UPDATE\":\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$this->beginTransaction();\n\t\t\t\t\t$this->stmt->execute();\n\t\t\t\t\t$this->commit();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcatch (PDOException $e)\n\t\t\t\t{\n\t\t\t\t\t$this->rollBack();\n\t\t\t\t\techo(\"Query failed: \" . $e->getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function executeQuery($sql)\r\n\t{\r\n\t\t//return qocqal_query($sql);\r\n\t}", "public function queryBuilder($sql){\n\t $$this->con->query($sql); \n\t \n }", "public function runQuery($sql){\n $stmt = $this->conn->prepare($sql);\n return $stmt;\n }", "function customQuery($query) \t{\n $res = $this->execute($query);\n\t\t return $res;\n\t}", "function query($sql)\n\t{\n\t\t$ret = $this->db->query($sql);\n\t\tlog_message('info','SQL Query: ' . $this->db->last_query());\n\t\treturn $ret;\n\t}", "function execQuery($query, $database)\n{\n include 'dbconfig.php';\n mysql_connect($_db_server,$_db_username,$_db_password) or die(mysql_error());\n mysql_select_db($database) or die(mysql_error());\n \n $data = mysql_query($query) or die(mysql_error());\n \n return $data;\n \n mysql_close();\n}", "function query($db,$value)\r\n\t\t{\r\n\t\t\tif (!isset($db) || empty($db)) $this->killClass();\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->last_query[\"start_time\"] = $this->getmicrotime();\r\n\t\t\t\tif (!$this->result = mysql_query($value))\r\n\t\t\t\t{\r\n\t\t\t\t\t$db->printError(mysql_errno($db->linkID), mysql_error($db->linkID));\r\n\t\t\t\t}\r\n\t\t\t\t$lastError = mysql_errno($db->linkID);\r\n \t\t\t\tif ( $lastError > 0) {\r\n \t\t\t\t$lastError = $lastError;\r\n \t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->last_query[\"end_time\"] = $this->getmicrotime();\r\n\t\t\t\t\r\n\t\t\t\t$this->affected_rows = mysql_affected_rows($db->linkID);\r\n\t\t\t\t$this->numrows = 0;\r\n\t\t\t\t$this->numfields = 0;\t\r\n\t\t\t\t\r\n\t\t\t\t//if (eregi(\"^SELECT\", $value) || eregi(\"^SHOW\", $value)) //milsoft changed to allow show commands as queries\r\n if (preg_match(\"/\\bSELECT\\b/i\", $value) || preg_match(\"/\\bSHOW\\b/i\", $value) ) //milsoft changed to allow show commands as queries\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->numrows = @mysql_num_rows($this->result);\r\n\t\t\t\t\t$this->numfields = @mysql_num_fields($this->result);\r\n\t\t\t\t}\r\n\t\t\t\t$this->last_query[\"sql\"] = $value;\r\n\t\t\t}\r\n\t\t}", "public function query($sql)\n\t{\n\t\t$this->stm = $this->dbh->prepare($sql);\n\t}", "function query($sql) {\n\t\t\treturn $this->db->query($sql);\n\t\t}", "public static function execute()\n {\n if(DEBUG_QUERIES)\n {\n $start = microtime();\n }\n $r = self::$stmt->execute();\n if(DEBUG_QUERIES)\n {\n $elapsed = round(microtime() - $start, 4);\n isset(Core::$benchmark['db']['count']) ? Core::$benchmark['db']['count']++ : Core::$benchmark['db']['count'] = 1;\n isset(Core::$benchmark['db']['elapsed']) ? (Core::$benchmark['db']['elapsed']+$elapsed) : Core::$benchmark['db']['elapsed'] = $elapsed;\n }\n if(self::$stmt->errorCode() !== '00000')\n {\n trigger_error(json_encode(self::$stmt->errorInfo()));\n }\n return $r;\n }", "public function __invoke()\n {\n $this->execute();\n }", "private function runQuery($query) {\r\n\t\treturn mysql_query($query, $this->sql);\r\n\t}", "public function query()\n {\n $statement = null;\n $args = func_get_args();\n $attempt = 0;\n $retry = false;\n $logger = $this->_config->getSQLLogger();\n\n do {\n /** @noinspection BadExceptionsProcessingInspection */\n try {\n $this->connect();\n\n if ($logger) {\n $logger->startQuery($args[0]);\n }\n\n try {\n $statement = call_user_func_array(\n [\n $this->_conn,\n 'query'\n ], $args\n );\n\n /** @var StatementInterface $statement */\n $statement->setFetchMode(PDO::FETCH_ASSOC);\n } catch (Exception $ex) {\n throw DBALException::driverExceptionDuringQuery($this->_driver, $ex, $args[0]);\n }\n\n if ($logger) {\n $logger->stopQuery();\n }\n } catch (Exception $e) {\n if ($this->validateReconnectAttempt($e, $attempt)) {\n $this->close();\n\n $retry = true;\n\n $attempt++;\n } else {\n throw $e;\n }\n }\n } while ($retry);\n\n return $statement;\n }", "public function executeQuery($sql){\n return DB::executeQuery($this->db, $sql);\n }", "private function execute() {\n $query = $this->db->query($this->sql);\n return $query->result();\n }", "public function _query()\n {\n }", "function fvls_db_ExecuteQuery($sql){\n\t\tglobal $FLVS_db_link;\n\t\tif( !$FLVS_db_link instanceof MySQLi )\n\t\t\treturn false;\n\n\t\tif ( !($response = $FLVS_db_link->query( $sql ) ) ){\n\t\t\tif( defined('FVLS_DEVELOPER_MODE') && FVLS_DEVELOPER_MODE )\n\t\t\t echo \"FV Link Shortener Error: mySQL Query Error - $FLVS_db_link->error | $sql\\n\";\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $response;\n\t}" ]
[ "0.72317255", "0.70712966", "0.7024052", "0.6991761", "0.6991309", "0.69155735", "0.69066733", "0.6876861", "0.68557477", "0.68087125", "0.6721281", "0.67079777", "0.6687356", "0.66456914", "0.66456914", "0.66221046", "0.65970576", "0.6596652", "0.6571933", "0.65457284", "0.6544335", "0.6540227", "0.65166605", "0.64922166", "0.6486824", "0.6486824", "0.6486824", "0.6486824", "0.6476131", "0.6470844", "0.6470844", "0.6470844", "0.64466876", "0.64059734", "0.6392802", "0.6378821", "0.6370964", "0.6369801", "0.6348977", "0.6347318", "0.6346605", "0.6342546", "0.6331387", "0.6324948", "0.63237464", "0.63199186", "0.6316551", "0.6311607", "0.63104546", "0.63068175", "0.62994224", "0.6294655", "0.6292727", "0.62900126", "0.6275645", "0.6264099", "0.6258704", "0.62365264", "0.62230337", "0.62230337", "0.62214124", "0.62122273", "0.6197475", "0.6183608", "0.6181934", "0.61754936", "0.6174192", "0.61715376", "0.6171004", "0.61685055", "0.6160124", "0.61573774", "0.6156594", "0.6156594", "0.61546135", "0.61512566", "0.61484444", "0.61480707", "0.614583", "0.61371833", "0.61361146", "0.6134562", "0.61307734", "0.61248827", "0.6120126", "0.6117323", "0.6114005", "0.6105768", "0.61005014", "0.6099436", "0.6098401", "0.60945123", "0.60929275", "0.6081455", "0.607824", "0.60776603", "0.60633355", "0.6057068", "0.6057013", "0.6056752", "0.60564697" ]
0.0
-1
Action index Access to the action is possible in the following paths: /admin/blog/index /admin/blog
public function indexAction() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fullIndexAction() {}", "public function singleIndexAction() {}", "public function actionIndex() {}", "public function actionIndex() {}", "public function indexAction() {\n\t\t// TODO Auto-generated AdminController::indexAction() default action\n\t}", "abstract public function actionIndex();", "protected function indexAction() {}", "public function indexAction(){}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function actionIndex()\n {}", "public function actionIndex()\n {\n\t\techo \"=== Action index ===\";\n \n }", "public function indexAction(){\r\n\t\t\t\r\n\t\t}", "abstract function indexAction();", "public function indexAction(){\t\t\n\t}", "protected function indexAction()\n {\n }", "public function actionIndex()\n\t{\n\t\t// do stuff that's not the main content?\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('RudakBlogBundle:Post')->getAdminIndexList();\n\n return $this->render('RudakBlogBundle:Post:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function action_index()\n {\n }", "public function indexAction() {\n\n //check get variables\n if ($this->request->hasArgument('blogId')) {\n $blogId = $this->request->getArgument('blogId');\n } else {\n $blogId = 1;\n }\n if ($this->request->hasArgument('page')) {\n $page = $this->request->getArgument('page');\n } else {\n $page = 1;\n }\n if ($this->request->hasArgument('postId')) {\n $postId = $this->request->getArgument('postId');\n } else {\n $postId = 0;\n }\n if ($this->request->hasArgument('categoryId')) {\n $categoryId = $this->request->getArgument('categoryId');\n } else {\n $categoryId = 0;\n }\n\n $blog = $this->blogRepository->findByUid($blogId);\n\n //Check which view has to be displayed\n //Case: Blog view | Startpage of the blog\n if ($postId == 0) {\n $this->blogView($blog->getUid(), $page, $categoryId);\n }\n //Case: Single Post View\n if ($postId > 0) {\n $this->singleView($blog->getUid(), $postId);\n }\n\n //general view values\n $this->setSeoHeader($blogId, $postId);\n $this->setSidebarValues($blog->getUid());\n $this->view->assign('blog', $blog);\n }", "public function indexAction() {\n\t}", "public function indexAction() {\n\t}", "public function actionIndex() {\n \n $this->redirect('admin');\n \n\t}", "function indexAction(){\n \n $this->_templateObj->loadTemplate();\n $this->_viewObj->title = \"<title>Tadmin - index/index </title>\";\n $this->_viewObj->render('index/index', true);\n\n }", "public function indexAction() {\n\n\t}", "function admin_index()\n\t{\n\t \n\t}", "public function indexAction() {\r\n }", "function indexAction(){\n \t}", "public function indexAction()\n {\n\t\techo 'Module Admin IndexController indexAction';\n\t\t\n }", "public function indexAction()\n {\n $this->view->title = 'Li-No | Admin Index';\n $this->_forward('login', 'auth');\n }", "public function indexAction()\n {\n $this->addAction();\n }", "public function indexAction()\n {\n\n return parent::indexAction();\n\n\n }", "public function action_index()\n\t{\n\t}", "public function indexAction() {\r\n \r\n }", "public function getIndex()\n\t{\n\t\treturn Redirect::to('blog');\n\t}", "public function actionIndex()\n {\n\n }", "public function indexAction()\n {}", "public function indexAction() \n {\n \t\n }", "public function indexAction() {\n }", "public function indexAction() {\n }", "public function actionIndex()\n\n {\n\n echo 'Index action has not used.';\n\n }", "public function action_index()\n\t{\n\t\tif ( ! Auth::instance()->logged_in('admin'))\n\t\t\tthrow new HTTP_Exception_403();\n\t\t\n\t\t// show admin page\n\t\t$companies = ORM::factory('company')->find_all();\n\t\t$this->template->content = View::factory('admin/admin')->bind('companies', $companies);\n\t\t\n\t}", "public function indexPerLevelAction() {\n\n }", "public function actionIndex() {\n $this->actionTrenutniSpored();\n }", "public function getIndex()\n {\n // add stuff here\n }", "function indexAction(){\r\n }", "public function indexAction(): void\n {\n echo 'User admin index';\n }", "public function actionIndex() {\n\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.structure.controllers');\n\t\t$this->redirect(array(\n\t\t\t'content/detail',\n\t\t\t'contentId'=>\\Yii::app()->request->getParam('contentId', 0)\n\t\t));\n\t}", "public function indexAction ()\r\n {\r\n\r\n }", "public function indexAction()\r\n {\r\n echo 'User admin index';\r\n }", "public function indexAction()\n {\n \n }", "public function indexAction()\n {\n \n }", "public function admincp_index(){\n\t\tpermission_force_check('r');\n\t\t$default_func = 'created';\n\t\t$default_sort = 'DESC';\n\t\t$data = array(\n\t\t\t'module'=>$this->module,\n\t\t\t'module_name'=>$this->session->userdata('Name_Module'),\n\t\t\t'default_func'=>$default_func,\n\t\t\t'default_sort'=>$default_sort\n\t\t);\n\t\t$this->template->write_view('content','BACKEND/index',$data);\n\t\t$this->template->render();\n\t}", "public function admincp_index() {\n $toolBar = array('addNew', 'show', 'hide', 'delete');\n getToolbar($this->module, $toolBar);\n \n $default_func = 'created';\n $default_sort = 'DESC';\n $data = array(\n 'module' => $this->module,\n 'default_func' => $default_func,\n 'default_sort' => $default_sort\n );\n $this->template->write_view('content', 'BACKEND/index', $data);\n $this->template->render();\n }", "public function index() {\n\t\t$data['pagetitle'] = 'Dashboard - Posts';\n\t\t$viewmodel = new Post_Model();\n\t\t$data['posts'] = $viewmodel->getPosts() ;\t// get list of posts\n\n\t\tView::renderAdminTemplate($data, \"App/Views/admin/posts/index.php\") ;\n\t\t\n\t}", "public function indexAction() {\n\n }", "public function indexAction() {\n\n }", "public function index_post(){\n }", "public function getIndex(){\n\t\t$blogPosts = BlogPost::query()->orderBy('id', 'desc')->get();\n\n\t\treturn $this->render('admin/posts.twig', ['blogPosts' => $blogPosts]);\n\t}", "public function indexAction()\n {\n //for real application\n }", "public function admincp_index() {\n $toolBar = array('addNew', 'delete');\n getToolbar($this->module, $toolBar);\n\n $default_func = 'updated';\n $default_sort = 'DESC';\n $data = array(\n 'module' => $this->module,\n 'default_func' => $default_func,\n 'default_sort' => $default_sort\n );\n $this->template->write_view('content', 'BACKEND/index', $data);\n $this->template->render();\n }", "public function index(){}", "public function actionIndex(): void\n {\n $this->actionInit();\n $this->actionDeploy();\n $this->actionSwitch();\n }", "public function actionIndex(){\r\r\n\t\t$this->render('index', array());\r\r\n\t}", "public function indexAction()\n {\n return $this->doIndex();\n }", "public function indexAction()\n {\n return $this->doIndex();\n }", "public function indexAction()\n {\n return $this->doIndex();\n }", "public function indexAction()\n {\n return $this->doIndex();\n }", "public function action_index()\r\n\t{\t\t\t\t\r\n\t\t$this->template->title = \"Dashboard\";\r\n\t\t$this->template->content = View::forge('admin/dashboard');\r\n\t}", "public function indexAction()\n {\n }", "public function indexAction()\n {\n }", "public function indexAction()\n {\n }", "public function indexAction()\n {\n }", "public function indexAction()\n {\n }", "public function indexAction()\n {\n }", "public function indexAction() {\n $this->formAction();\n }", "public function indexAction() {\n $this->formAction();\n }", "public function index()\n\t{\n\t\t$this->template\n\t\t\t->title('')\n\t\t\t->build('admin/index');\n\t}", "public function actionIndex()\n {\n $this->render('index');\n }", "public function indexAction()\n {\n return $this->_forward('top', 'search', 'admin');\n }", "public function indexAction()\n {\n // action body\n }", "public function actionIndex() {\n // renders the view file 'protected/views/site/index.php'\n // using the default layout 'protected/views/layouts/main.php'\n //echo \"admin/admin/index\";exit;\n //var_dump(Yii::app()->user->isRoot);exit;\n $this->render('index');\n }", "public function indexAction() {\n\n\n\n\n }", "public function index() {\r\n $this->logger->info(\"Action Index \");\r\n $this->template->display('listsettings');\r\n }", "public function indexAction() {\n ;\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function indexAction()\n {\n\n }", "public function indexAction()\n\t{\n\n\t}", "public function index() {\n\t\t// the /article URL without /article/view/. In this case, let's\n\t\t// redirect them to the index.\n\t\theader('Location: /');\n\t}", "public function actionIndex()\n {\n\t return $this->render('index');\n }", "public function indexAction()\n {\n// echo \"Hi Wlodek, I'm in index() action in the Post controller\";\n// echo'<br/><p>Query string: <pre>'.htmlspecialchars(print_r($_GET, true)).'</pre></p>';\n $posts= Post::getAllPosts();\n View::renderTemplate('Posts/index.html', ['posts'=>$posts]);\n }" ]
[ "0.7819512", "0.7778239", "0.7673298", "0.7673298", "0.7630946", "0.7581945", "0.7576016", "0.7482569", "0.74470323", "0.7444691", "0.744463", "0.744463", "0.744463", "0.744463", "0.744463", "0.744463", "0.744463", "0.744463", "0.744463", "0.7417557", "0.7409074", "0.731672", "0.73130995", "0.7280398", "0.7250452", "0.7237127", "0.722959", "0.7198935", "0.71857184", "0.71771586", "0.71771586", "0.7176409", "0.7174315", "0.71736807", "0.71505696", "0.7146516", "0.71367925", "0.7134657", "0.7129814", "0.71259695", "0.7122089", "0.7113794", "0.70982915", "0.7088451", "0.7082706", "0.70795053", "0.705001", "0.70484483", "0.70484483", "0.7031932", "0.70153326", "0.70092773", "0.69938457", "0.6972739", "0.6961746", "0.6951998", "0.6941061", "0.69368577", "0.6914775", "0.69132143", "0.69132143", "0.6896592", "0.6893107", "0.68903416", "0.6867624", "0.6867624", "0.6860249", "0.6859441", "0.68433887", "0.6842688", "0.68420964", "0.68409145", "0.68287694", "0.6828579", "0.6828579", "0.6828579", "0.6828579", "0.68000984", "0.679572", "0.679572", "0.679572", "0.679572", "0.679572", "0.679572", "0.67898864", "0.67898864", "0.6788353", "0.6787624", "0.678719", "0.6786276", "0.6782184", "0.6781866", "0.677634", "0.6768436", "0.6768028", "0.6754825", "0.6753471", "0.67513055", "0.67403245", "0.6736752" ]
0.72522384
24
Action posts Get a list of all user posts Access to the action is possible in the following paths: /admin/blog/posts
public function postsAction() { $params = $this->_request->getParams(); $this->view->ajax_post = isset($params['ajax_post']) ? TRUE : FALSE; //Добавим путь к действию $this->_breadcrumbs->addStep($this->Translate('Список сообщений в блогах')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listPostsAction() {\n $this->session->start();\n if ($this->session->get('user_id') != NULL) {\n $vars = $this->getUserLoggedInformation();\n $user = Users::findFirstByUser_id($this->session->get('user_id'));\n if ($user->user_type_id < 3) {\n $posts = Posts::find(array(\n \"order\" => \"post_date_posted DESC\"\n ));\n }\n elseif ($user->user_type_id == 3) {\n $usr = Users::find(array(\n \"conditions\" => \"user_type_id > :user_type_id: OR user_id = :user_id: \",\n \"bind\" => array(\n \"user_type_id\" => $user->user_type_id,\n \"user_id\" => $user->user_id\n )\n ));\n foreach ($usr as $u) {\n $arr_id_users[] = $u->user_id;\n }\n $string_users = implode(\",\", $arr_id_users);\n $posts = Posts::find(array(\n \"conditions\" => \"post_author IN ({$string_users})\",\n \"order\" => \"post_date_posted DESC\"\n ));\n }\n else {\n $posts = Posts::findByPost_author($user->user_id);\n }\n $vars['menus'] = $this->getSideBarMenus();\n $vars['posts'] = $posts;\n $vars['categories'] = $this->getCategoriesByPost($posts);\n\n $this->view->setVars($vars);\n $this->view->render(\"post\", \"listPosts\");\n }\n else {\n $this->response->redirect(URL_PROJECT . 'admin');\n }\n }", "public function listPost()\n {\n $this->areaAdmin->verifyAdmin();\n\n $posts = $this->postManager->getList(\"admin\");\n\n $this->renderview->generateView(array('name' => \"AdminPost\", 'function' => $posts, 'nameFunction' => 'posts'), 'layoutPageAdmin');\n }", "public function getPosts() {}", "function adminPosts()\n {\n $userLogged = Auth::check(['administrateur']);\n \n $postManager = new PostManager();\n $listPosts = $postManager->getListPosts();\n \n require'../app/Views/backViews/post/backAdminPostsView.php';\n }", "public function getPosts();", "public function getPosts();", "public function manage_posts()\n\t{\n\t\t$data['posts'] = $this->common_model->getAllData('blog_post','*','',array('deleted_at' => 'Null'));\n\n\t\t$data['page'] = \"blog/manage_posts\";\n \t$this->template->template_view($data);\t\n\t}", "public function posts()\n {\n session_start();\n $posts = new PostManager;\n $resultat = $posts->getPosts(100);\n echo $this->getRender()->render('listPostsView.twig', [\n 'posts' => $resultat,\n 'session' => $this->getSuperglobals()->get_SESSION()\n ]);\n }", "public function index()\n {\n $posts = Post::where('user_id', Auth::id())->orderBy('id', 'DESC')->get();\n dd($posts);\n }", "function get_all_user_posts(){\n\treturn query(\"SELECT * FROM posts WHERE user_id = \".loggedInUserId().\"\");\n}", "public function posts()\n\t{\n\t\t$this -> template = 'default_1';\n\t\t$url = $this -> basepath();\n\n\t\t$posts = \\App\\App::getInstance() -> getTable('postsManager');\n\t\t$posts = $posts -> getPosts();\n\t\t$categories = \\App\\App::getInstance() -> getTable('categoriesManager');\n\t\t$categories = $categories -> getCategories();\n\t\t$this -> page('posts/posts', compact('posts', 'categories', 'url'));\n\t}", "public function index()\n {\n return Post::where('user_id', auth()->id())->get();\n }", "public function getListPost() {\n\n $postsModel = new Posts();\n $posts = $postsModel->getListPost();\n $this->data['posts'] = $posts;\n\n return view('admin.post_list', $this->data);\n }", "public function index()\n {\n $posts = Auth::user()->admin ? Post::all() : Auth::user()->posts;\n return view('admin.posts.index', ['posts' => $posts]);\n }", "public function indexPosts()\n {\n /**\n * The page\n *\n * @var integer\n */\n $page = Input::get('page', 0);\n $repo = App::make('Pulse\\Cms\\PostRepository');\n $posts = $repo->all($page);\n\n return $this->render('pulse::front.posts.index', compact('posts'));\n }", "public function indexAction()\n {\n $limit = \\App\\Config::getConfig('pagination_frontend');\n $page = $this->routeParams['page'];\n $posts = $this->postModel->getAll(true, $limit, $page);\n foreach ($posts as $post) {\n $tagIds = $this->postModel->getPostTagIds($post->id);\n $post->tags = $this->tagModel->getAllBy('id', $tagIds);\n }\n $totalRows = $this->postModel->countBy(['is_active' => 1]);\n $paginator = $this->paginator->init($totalRows, $limit, $page, $this->routeParams);\n View::renderTemplate('Cms::frontend/post/index.html', [\n 'posts' => $posts,\n 'paginator' => $paginator\n ]);\n }", "public function get_posts()\n {\n }", "public function adminPosts()\n {\n $adminSettings = DB::table('settings')->get();\n $adminUsers = DB::table('users');\n $adminPosts = DB::table('posts');\n\n return view('adminpanel::admin.posts')->with([\n 'settings' => $adminSettings,\n 'adminUsers' => $adminUsers,\n 'adminPosts' => $adminPosts,\n ]);\n }", "public function posts(){\n // get all the posts by this user\n return $this->hasMany('cms\\Post');\n }", "public function listPosts()\n {\n $PostsRepository = new PostsRepository();\n $posts = $PostsRepository->getAllPosts();\n require 'src/View/postListView.php';\n }", "public function allblogpostsActionGet() : object\n {\n $page = $this->app->page;\n $title = \"Alla posts i databasen\";\n $db = $this->app->db;\n\n $db->connect();\n $sql = <<<EOD\nSELECT\n *,\n DATE_FORMAT(COALESCE(updated, published), '%Y-%m-%dT%TZ') AS published_iso8601,\n DATE_FORMAT(COALESCE(updated, published), '%Y-%m-%d') AS published\nFROM content\nWHERE type=?\nORDER BY published DESC\n;\nEOD;\n $resultset = $db->executeFetchAll($sql, [\"post\"]);\n\n $page->add(\"cms/header\");\n $page->add(\"cms/allblogposts\", [\n \"resultset\" => $resultset\n ]);\n return $page->render([\n \"title\" => $title\n ]);\n }", "public function index()\n {\n // $data = User::with(['posts','comments'])\n // ->where('id',\\Auth::user()->id)\n // ->first();\n // return $data->posts;\n return Post::with('posteable')->get();\n }", "public function adminPosts()\n {\n $adminSettings = DB::table('settings')->get();\n $adminUsers = DB::table('users');\n $adminPosts = DB::table('posts');\n return view('admin.posts')->with([\n 'settings' => $adminSettings,\n 'adminUsers' => $adminUsers,\n 'adminPosts' => $adminPosts, \n ]);\n }", "public function index()\n\t{\n $posts=Auth::user()->posts()->orderBy('id', 'DESC')->paginate(1);\n\n return view('account.posts.index', ['posts'=>$posts]);\n\t}", "public function index() {\n\t\t$this->template->content = View::instance(\"v_posts_index\");\n\t\t$this->template->title = \"All the posts\";\n\t\t\t\n\t\t# Figure out the connections\n\t\t$q = \"SELECT *\n\t\t\tFROM users_users\n\t\t\tWHERE user_id = \".$this->user->user_id;\n\t\t\t\n\t\t$connections = DB::instance(DB_NAME)->select_rows($q);\n\t\t\t\t\t\t\n\t\t$connections_string = \"\";\n\t\t\n\t\tforeach($connections as $k => $v) {\n\t\t\t$connections_string .= $v['user_id_followed'].\",\";\n\t\t}\t\t\t\t\n\t\t\n\t\t# Trim off the last comma\n\t\t\t$connections_string = substr($connections_string, 0, -1);\n\t\t\n\t\t# Grab all the posts\n\t\t$q = \"SELECT *\n\t\t\tFROM posts\n\t\t\tJOIN users USING(user_id)\n\t\t\tWHERE posts.user_id IN (\".$connections_string.\")\";\n\t\t\t\t\t\n\t\t$posts = DB::instance(DB_NAME)->select_rows($q);\n\t\t\t\t \n\t\t# Pass data to the view\n\t\t$this->template->content->posts = $posts;\n\t\t\n\t\t\t\n\t\t# Render the view\n\t\techo $this->template;\n\t\n\t}", "public function index()\n {\n $posts = $this->postRepository->getAllForAdminList();\n\n return view('admin.blog.posts.index', compact('posts'));\n }", "public function showAllPosts()\n {\n $posts = \\Blog\\Models\\Posts::find();\n $dataPosts = [];\n foreach ($posts as $post) {\n $dataPosts[] = [\n 'id' => $post->getPostId(),\n 'date' => $post->getDate(),\n 'category' => $post->getCategory(),\n 'user_id' => $post->getUserId(),\n 'title' => $post->getTitle(),\n 'status' => $post->getStatus(),\n ];\n }\n return $dataPosts;\n }", "public function allPosts()\n {\n return Post::all();\n }", "public function listPosts()\n {\n $query = $this->getPostsQuery();\n\n $this->handlePostFilters($query);\n\n $this->handleOrder($query);\n\n $posts = $query->paginate($this->resultsPerPage, $this->currentPage);\n\n $this->setPostUrls($posts);\n\n $this->posts = $posts;\n }", "public function addActionPosts(){}", "public function get_admin_list() {\n //Grab all blog posts\n $posts = Post::paginate($this->perPage);\n\n //Create a data array\n $data = array(\n 'section' => 'post',\n 'pageTitle' => 'Blog Post List',\n 'posts' => $posts,\n );\n\n //Build the view\n return View::make('admin.post.list', $data);\n }", "public function posts()\n {\n \n\t\t\n\t\t$postData['post'] = Blog::getpostData();\n\t\t$comments = Blog::getcountcommentData();\n\t\treturn view('admin.post',[ 'postData' => $postData, 'comments' => $comments]);\n }", "public function index()\n {\n $posts = Post::allowed()->get();\n return view('admin.posts.index', compact('posts'));\n }", "public function index()\n {\n $posts = $this->user()->post()->select('id', 'title', 'slug', 'created_at')->orderBy('id', 'desc')->paginate(10);\n return view('user.post.index', ['posts' => $posts]);\n }", "public function listPost()\n {\n //Your code goes here\n $data['posts'] = PostModel::where('status',1)->orWhere('status',2)->orderBy('id','desc')->get();\n $data['pagemode'] = 'edit';\n return admin_view('Posts::List', $data);\n }", "public function index()\n {\n $post = Post::paginate(5);\n return postresource::collection($post);\n }", "public function posts()\n\t{\n\t\t// drugi argument stupac u bazi preko kojeg radimo relaciju\n\t\treturn $this->hasMany(static::$postModel, 'user_id');\n\t}", "public function index()\n {\n $posts = Post::all();\n $user = Auth::user();\n return view('admin.posts.index', compact('posts', 'user'));\n }", "public function index()\n {\n return View::make('admin.posts.index')\n ->with(\n 'posts',\n Auth::user()->posts()\n ->orderBy('updated_at', 'desc')\n ->paginate(25)\n );\n }", "public function index()\n {\n if (!Gate::allows('isAdmin')) {\n abort(403);\n }\n $datos['posts']=Posts::get();\n return view ('admin.post.index',$datos);\n }", "public function getAllPosts(){\n $sql = 'SELECT * FROM userposts LIMIT 100';\n $entries = self::query($sql);\n return $entries;\n }", "public function index()\n {\n return Post::with('category:id,name,slug', 'user:id,name,email')\n ->select([\n 'id', 'title', 'slug', 'content', 'image', 'category_id', 'user_id'\n ])\n ->paginate(); // json_encode(Post::all());\n }", "public function index()\n {\n $posts = $this->postService->getAll();\n\n return $posts;\n }", "public function index()\n {\n return view('frontend.blog.post.index')\n ->withPosts($this->postRepository->getPaginatedByUser(auth()->user()));\n }", "public function index() {\n\t\t$data['pagetitle'] = 'Dashboard - Posts';\n\t\t$viewmodel = new Post_Model();\n\t\t$data['posts'] = $viewmodel->getPosts() ;\t// get list of posts\n\n\t\tView::renderAdminTemplate($data, \"App/Views/admin/posts/index.php\") ;\n\t\t\n\t}", "public function get_posts()\n\t{\n\t\t$this->post_posts();\n\t}", "function getAllPosts()\n{\n\tglobal $conn;\n\t\n\t// Admin can view all posts\n\t// Author can only view their posts\n\tif ($_SESSION['user']['role'] == \"Admin\") {\n\t\t$sql = \"SELECT * FROM posts\";\n\t} elseif ($_SESSION['user']['role'] == \"Author\") {\n\t\t$user_id = $_SESSION['user']['id'];\n\t\t$sql = \"SELECT * FROM posts WHERE user_id=$user_id\";\n\t}\n\t$result = mysqli_query($conn, $sql);\n\t$posts = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\n\t$final_posts = array();\n\tforeach ($posts as $post) {\n\t\t$post['author'] = getPostAuthorById($post['user_id']);\n\t\tarray_push($final_posts, $post);\n\t}\n\treturn $final_posts;\n}", "public function actionIndex()\n {\n $userId = Yii::$app->user->getId();\n $posts = new ActiveDataProvider([\n 'query' => Post::find()\n ->where(['user_id'=> $userId])\n ->orderBy('updated_at DESC'),\n 'pagination' => [\n 'pageSize' => 20,\n ]\n ]);\n return $this->render('index',[\n 'posts'=> $posts,\n ]);\n }", "public function index()\n {\n if (!auth()->user()->ability('admin', 'manage_posts,show_posts')) {\n return abort(403);\n }\n return view('backend.posts.index');\n }", "public function actionIndex()\n {\n\n $searchModel = new PostSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->pagination->pageSize=10;\n $dataProvider->setSort([\n 'defaultOrder' => ['post_id'=>SORT_DESC],]);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $posts = Posts::where('user_id',Auth::user()->id)->get();\n\n return view('posts.userPosts',['posts' => $posts]);\n }", "public function index()\n {\n $posts = Post::where('user_id', auth()->user()->id)->orderByRaw('id')->get();\n $lastPosts = Post::orderBy('id', 'desc')->skip(0)->take(10)->get();\n return view('admin.viewposts', compact('posts', 'lastPosts'));\n }", "public function posts()\n\t{\n\t\t//To do : Blog Posts by Category, Author, tags\n\n\t\t$wheres = $this->checkInputData(array('category_id', 'id', 'author_id', 'tag'));\n\n\t\t$before_after = $this->checkInputData(array('after_id', 'before_id', 'since', 'until'));\n\n\t\t$limit = (Input::get('limit')) ?: 0;\n\n\t\t$offset = (Input::get('offset')) ?: 0;\n\n\t\tif (empty($wheres) and empty($before_after)) {\n\n\t\t\t$blog = Provider::allPublicPosts($limit, $offset);\n\n\t\t} else {\n\n\t\t\tif (!empty($wheres)) {\n\t\t\t\t$conditions['wheres'] = $wheres;\n\t\t\t}\n\n\t\t\tif (!empty($before_after)) {\n\t\t\t\t$conditions['before_after'] = $before_after;\n\t\t\t}\n\n\t\t\t$blog = Provider::getPostsBy($conditions, $limit, $offset);\n\n\t\t}\n\n\t\t$data = $this->transform($blog);\n\n\t\treturn Response::json(array(\n\t\t\t'total_items' => count($data),\n\t\t\t'type'\t\t => 'posts',\n\t\t\t'items'\t\t => $data\n\t\t));\n\n\t}", "public function AllPost()\n {\n $posts = DB::select('select * from posts where status=\"posted\"');\n return view ('home', ['posts' => $posts]);\n }", "public function getPosts()\n {\n return $this->hasMany(Post::class, ['author_id' => 'id'])->inverseOf('user');\n }", "public function all_post() {\n if($this->access_role->is_Admin() == false) show_404();\n \n $this->load->model('All_post_Model');\n $data = $this->All_post_Model->view_post();\n $this->load->view('admin/all_post_content',$data);\n }", "public function index() {\n $posts = $this->postModel->getPosts();\n\n // Check whether user like some post\n if (isLoggedIn()) {\n foreach ($posts as $post) {\n $likes = $this->postModel->getLikesByPostId($post->postId);\n\n foreach ($likes as $like) {\n if ($like->user_id === $_SESSION['user_id']) {\n // Add field with likes\n $post->isLiked = true;\n }\n }\n }\n }\n\n $data = [\n 'posts' => $posts\n ];\n\n $this->view('posts/index', $data);\n }", "public function getPosts()\n {\n $posts = Post::where('author_id',Auth::user()->id)->orderBy('id','DESC')->paginate(15);\n return view('/home',compact('posts'));\n }", "public function index()\n {\n if(auth()->user()->profile->role_id <= 2) {\n // Para Administrador e Revisor\n $posts = Post::orderBy('id','DESC')->paginate(6);\n } else {\n // utilizador normal vo ve o que lhe pertence\n $posts = Post::orderBy('id','DESC')\n ->where('user_id', auth()->user()->id)\n ->paginate(6);\n }\n\n return view('admin.posts.index', compact('posts'));\n }", "public function index()\n {\n $posts = Post::all();\n return view('admin.listpost', compact('posts'));\n }", "public function get_posts()\n {\n $this->Friend_model->get_posts_model();\n }", "public function getAllPost()\n {\n return Post::get();\n }", "public function index()\n {\n return Posts::all();\n }", "public function getPosts(Request $request)\n {\n\t\t$user = null;\n\t\t$v = \"\";\n\t\t\n\t\t$signals = $this->helpers->signals;\n\t\t$plugins = $this->helpers->getPlugins();\n\t\t\n\t\t#$this->helpers->populateTips();\n $cpt = ['user','signals','plugins'];\n\t\t\t\t\n\t\tif(Auth::check())\n\t\t{\n\t\t\t\n\t\t\t$user = Auth::user();\n\t\t\t\n\t\t\tif($this->helpers->isAdmin($user))\n\t\t\t{\n\t\t\t\t$hasPermission = $this->helpers->hasPermission($user->id,['view_posts','edit_posts']);\n\t\t\t\t#dd($hasPermission);\n\t\t\t\t$req = $request->all();\n\t\t\t\t\n\t\t\t\tif($hasPermission)\n\t\t\t\t{\n\t\t\t\t $v = \"posts\";\n\t\t\t\t $posts = $this->helpers->getPosts();\n\t\t\t\t #dd($posts);\n\t\t\t\t array_push($cpt,'posts');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsession()->flash(\"permissions-status-error\",\"ok\");\n\t\t\t\t\treturn redirect()->intended('/');\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tAuth::logout();\n\t\t\t\t$u = url('/');\n\t\t\t\treturn redirect()->intended($u);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$v = \"login\";\n\t\t}\n\t\treturn view($v,compact($cpt));\n }", "function index()\n {\n $per = $this->check_permission();\n\t\t\n\t\t\n\t\tif($per=='All'){\n $data['postlist'] = $this->Post_model->get_all_postlist();\n\t\t}\n\t\telseif($per=='Own'){\n\t\t$data['postlist'] = $this->Post_model->get_own_postlist();\n\t\t}\n\t\t$data['categorylist'] = $this->Post_model->get_post_categorylist();\n\t\t\n\t\t//var_dump($data['postlist']); exit;\n\t\t\n\t\t$this->render_template('secure/post/index', $data);\n }", "public function index() {\n\t\t//Eager loading ...\n\t\t//$posts = Post::with('author')->get();\n\t\t$posts = Post::with('author')->paginate(10);\n\t\t//$posts = Post::slug('slug-search')->with('author')->paginate(10);\n // devAuthor();\n\t\t//$posts = Post::paginate(10);\n\n\t\t//$posts->setPath('/usrssss/alexh');\n\n\t\treturn view('post.list_all',['posts'=>$posts]);\n\t}", "public function index()\n\t{\n //$posts = Posts::all();\n $posts = Posts::with('user')->get();\n //$posts = Posts::where('title','like','%post%')->get();\n //$posts = Posts::where('title','like','%post%')->take(1)->skip(1)->get();\n return View::make('post.list',compact('posts'));\n\t}", "public function adminIndex()\n {\n $items = $this->postService::getAll();\n\n return view('admin.pages.posts')->with(compact('items'));\n }", "public function indexAction()\n {\n $arr = Post::getAll();\n View::renderTemplate('Post/index.html', [\n 'data' => $arr\n ]);\n }", "public function index()\n\t{\n\t\t$posts = $this->user->posts()->orderBy('id', 'desc')->paginate(10);\n\n\t\treturn View::make('posts.index', compact('posts'));\n\t}", "public function getPosts()\n {\n return $this->posts;\n }", "public function posts()\n {\n return $this->hasManyThrough(Post::class, User::class);\n }", "public function all(){\n\t\t$posts = $this->repository->all();\n SEOMeta::setTitle(\"Blog\");\n SEOMeta::setDescription(\"Blog público com as opiniões de diversos alunos e professores da plataforma\");\n\n\t\treturn view('posts.all', ['posts' => $posts]);\n }", "public function index()\n {\n // Create Varable and store all the blog post \n\n $posts = Post::orderBy('id', 'desc')->paginate(10);\n\n\n // Return a view and shoing to the user \n\n return view('posts.index')->withPosts($posts);\n }", "public function index()\n\t{\n $posts = $this->post->getPaginatedPosts();\n\n return View::make('admin.posts.index', ['posts' => $posts]);\n\t}", "public function index()\n {\n // Query Post model for all posts\n // 1st version\n //$posts = Post::all();\n //dd($posts);\n\n // adding category and user\n // Query Post model for all posts\n // latest() sort by created_at desc\n // with('user') compliments the information of user, running the function user()\n // with('category') compliments the information of category, running the function category()\n // paginate() the results using the constant MAX_POSTS\n $posts = Post::latest()\n ->with('user')\n ->with('category')\n ->paginate(self::MAX_POSTS);\n\n // show the view 'blog\\index.blade.php' sending the $posts result\n return view('blog.index', compact('posts'));\n }", "public function index()\n {\n //\n $allPost = Blog::all();\n\n return view('admin.blog_all_post', compact('allPost'));\n }", "public function posts()\n {\n $this->authCheck();\n\n $postData = DB::table('posts')\n ->get();\n // $category_name = DB::table('categories')\n // ->where('id',$postData['category']);\n \n $posts=view('admin.posts')\n ->with('postData',$postData);\n\n return view('admin.master')\n ->with('main_content',$posts);\n }", "public function user_post() {\n $this->loadModel('Image');\n $id = $this->Auth->user('id');\n $this->layout = 'front_end';\n $allImage = $this->Image->getAllimage($id);\n $data = $this->User->userData($id);\n $this->loadModel('Post');\n $post = $this->Post->postList();\n $this->set('image', $allImage);\n $this->set('user', $data);\n $this->set('post', $post);\n $this->render('/Users/user_post');\n }", "public function index() {\n\n $posts = null;\n\n if ($this->request->is('post')) {\n\n $this->Post->create();\n\n $searchField = $this->request->data['lstField'];\n $searchValue = $this->request->data['searchValue'];\n\n if (!empty($searchField) && !empty($searchValue)) {\n $posts = $this->Post->search($searchField, $searchValue);\n $this->set('posts', $posts);\n }\n } else {\n $posts = $this->Post->viewPosts();\n }\n\n $this->set('posts', $posts);\n }", "public function blogPosts()\n\t{\n\t\t$auth = $this->ensureAuthed();\n\t\t$output = Output::getInstance();\n\t\t$feeds = Feeds::getInstance();\n\n\t\t$urls = $feeds->getValidURLs();\n\n\t\t$posts = array();\n\t\tforeach ($urls as $url => $user)\n\t\t{\n\t\t\t$teams = $auth->getTeams($user);\n\t\t\tif (count($teams) > 0)\n\t\t\t{\n\t\t\t\t$author = $auth->displayNameForTeam($teams[0]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$author = $user;\n\t\t\t}\n\t\t\t$msgs = Feeds::getRecentPosts($url, 3, $author);\n\t\t\t$posts = array_merge($posts, $msgs);\n\t\t}\n\t\t$output->setOutput('posts', $posts);\n\t\treturn true;\n\t}", "public function PostList()\n {\n return view('post_list');\n }", "public function index()\n {\n if (Auth::user()->role === \"member\") {\n $data = Post::where('author', Auth::id())->get();\n } else\n $data = Post::all();\n return view('admin.post.index', compact('data'));\n }", "public function index()\n {\n $posts = Post::orderby('id','desc')->get();\n return view('admins.posts.index',['posts' => $posts]);\n }", "public function index() {\n // ! Not so good if you have millions post in Database\n // $posts = Post::get();\n\n // Pagination for our post\n // arg. takes how many posts inside the page\n // * Post::with(['user', 'likes']) is used something called \"eager loader\". We can bundle those query together\n // * so we don't create seperated query for a user and likes, so a user that has a post and a likes for example that is bundled together for a single query\n // * If we don't have this solution, then we would be overloaded to many queries and makes website slow\n // * orderBy('created_at', 'desc') will get the latest post on the top\n $posts = Post::orderBy('created_at', 'desc')->with(['user', 'likes'])->paginate(20);\n\n return view('posts.index', [\n 'posts' => $posts,\n ]);\n }", "public function index()\n {\n $posts = Post::with(['user', 'category', 'tags', 'comments'])->paginate(10);\n\n return view('admin.posts.index', compact('posts'));\n }", "public function index()\n {\n return view('admin.posts.list');\n }", "public function myposts() {\n\t\t$this->template->content = View::instance('v_posts_myposts');\n\t\t$this->template->title = \"My Posts\";\n\n\t\t# only select posts created by the logged in user\n\t\t# the latest modified one is on the top\n\t\t$q = \"SELECT *\n\t\t\tFROM posts where user_id = \" . $this->user->user_id .\n\t\t\t\" ORDER BY modified DESC\";\n\t\t\t\n// echo $q;\t\t\t\n\n\t\t# Run the query\n\t\t$posts = DB::instance(DB_NAME)->select_rows($q);\n\n\t\t# Pass data to the View\n\t\t$this->template->content->posts = $posts;\n\n\t\t# Render the View\n\t\techo $this->template;\n\t}", "public function getPosts()\n {\n return $this->hasMany(Post::className(), ['usuario_id' => 'id'])->inverseOf('usuario');\n }", "public function index()\n {\n $blogPosts = DB::table('blog_posts')\n ->join('blog_post_categories','blog_post_categories.unique_id','=','blog_posts.category_id')\n ->select('blog_posts.*','blog_post_categories.name')\n ->orderby('blog_posts.id','desc')\n ->get();\n return view('admin.blog_post.manage',compact('blogPosts'));\n }", "public function index()\n {\n $posts = Auth::user()->posts()->simplePaginate(10);\n return view('posts.index', compact('posts'));\n }", "public function index()\n {\n // $posts = Post::where(auth()->user()->id,user_id)->paginate(5);\n\n\n if(auth()->user()->admin==1){\n $posts=Post::paginate(5);\n }\n else{\n $posts = DB::table('posts')->where('user_id', auth()->user()->id)->paginate(5);\n }\n\n \n \n \n return view ('admin.posts.index',compact('posts'));\n }", "public function index() {\n\t\t\n\t\t# Set up view\n\t\t$this->template->content = View::instance('v_posts_index');\n\n\n\t\t$q = 'SELECT *\n\t\t\t\tFROM posts\n\t\t\t\tINNER JOIN users \n\t\t\t\t ON posts.user_id = users.user_id';\n\t\t# Set up query\n\t\t/*$q = 'SELECT \n\t\t\t posts.content,\n\t\t\t posts.created,\n\t\t\t posts.user_id AS post_user_id,\n\t\t\t users_users.user_id AS follower_id,\n\t\t\t users.first_name,\n\t\t\t users.last_name\n\t\t\tFROM posts\n\t\t\tINNER JOIN users_users \n\t\t\t ON posts.user_id = users_users.user_id_followed\n\t\t\tINNER JOIN users \n\t\t\t ON posts.user_id = users.user_id\n\t\t\tWHERE users_users.user_id = '.$this->user->user_id;*/\n\t\t\n\t\t# Run query\t\n\t\t$posts = DB::instance(DB_NAME)->select_rows($q);\n\t\t\n\t\t# Pass $posts array to the view\n\t\t$this->template->content->posts = $posts;\n\t\t\n\t\t# Render view\n\t\techo $this->template;\n\t\t\n\t}", "public function showPosts() {\r\n\t\t$allposts = $this->renderPostTemplate();\r\n\t\tforeach($allposts as $post) {\r\n\t\t\techo $post;\r\n\t\t}\r\n\t}", "public function index() {\n $this->data['posts'] = $this->blog_model->get_many_by(['status' => 1]);\n\n $this->template->build('public/blog/index', $this->data);\n }", "public function index()\n {\n return Post::all();\n }", "public function index()\n {\n return Post::all();\n }", "public function index()\n {\n return Post::all();\n\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('RudakBlogBundle:Post')->getAdminIndexList();\n\n return $this->render('RudakBlogBundle:Post:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function getAllUsers_posts()\n {\n\n // retourne le resultat de la requete SELECT * FROM categories\n return DB::table('users_posts')->get();\n\n\n }", "public function index(Posts $posts)\n {\n //$posts = Posts::paginate(10);\n $posts = $posts->sortable(['updated_at' => 'desc'])->paginate(10);\n //$posts = Posts::orderBy('updated_at', 'desc')->paginate(10);\n return view('admin.posts.index',compact('posts'));\n }" ]
[ "0.82235134", "0.786157", "0.77137405", "0.76117605", "0.7587183", "0.7587183", "0.74776477", "0.7375221", "0.723881", "0.72291696", "0.7208755", "0.7201365", "0.71835613", "0.7156826", "0.7139057", "0.712851", "0.7108499", "0.7092893", "0.7066298", "0.7057565", "0.70547754", "0.7039445", "0.70337564", "0.70308334", "0.70288396", "0.70231146", "0.7015541", "0.7007172", "0.7006251", "0.7003098", "0.6994133", "0.69905764", "0.69887733", "0.69856143", "0.6974451", "0.696914", "0.69634545", "0.69493073", "0.6947272", "0.6945371", "0.6942398", "0.6917309", "0.6914305", "0.6913297", "0.6882019", "0.6878683", "0.6874971", "0.6871215", "0.68690276", "0.68676394", "0.68643904", "0.68638253", "0.6849763", "0.6847473", "0.68452036", "0.682931", "0.68285364", "0.6827147", "0.6826962", "0.6824194", "0.68067867", "0.680395", "0.67943484", "0.67917", "0.6788017", "0.6786573", "0.67850894", "0.67820346", "0.6778115", "0.67741627", "0.67729634", "0.6764823", "0.67573065", "0.674323", "0.67432195", "0.67391956", "0.67246014", "0.67227346", "0.67220354", "0.6719654", "0.6715399", "0.6715163", "0.67113936", "0.67087644", "0.6708742", "0.670827", "0.67057", "0.67044884", "0.67029196", "0.67023736", "0.67019904", "0.67002237", "0.66973454", "0.6694831", "0.66944075", "0.66922235", "0.66922235", "0.66792065", "0.667624", "0.66754323", "0.66748405" ]
0.0
-1
Action rows get all data according to the request parameters Access to the action is possible in the following paths: /admin/blog/rows
public function rowsAction() { parent::rowsAction(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFilteredRows($rows) {\n $filterRows = array();\n $filterRow = array();\n //-------------------\n // Получим параметры запроса\n $request = $this->getRequest();\n $params = $request->getParams();\n $table = $params['table'];\n\n if ($table == 'admin.blog_posts') {\n foreach ($rows as $row) {\n // Отфильтруем ненужные поля в записи (масиве)\n foreach ($row as $key => $value) {\n // Исключим поля\n switch ($key) {\n case \"content\":\n break;\n default :\n $filterRow[$key] = $value;\n break;\n }\n }\n if (count($filterRow) > 0) {\n $filterRows[] = $filterRow;\n }\n $filterRow = array();\n }\n }\n if ($table == 'admin.blog_posts_tags') {\n foreach ($rows as $row) {\n // Отфильтруем ненужные поля в записи (масиве)\n foreach ($row as $key => $value) {\n // Исключим поля\n switch ($key) {\n case \"sortColumn\":\n case \"ascDescFlg\":\n break;\n default :\n $filterRow[$key] = $value;\n break;\n }\n }\n\n if (count($filterRow) > 0) {\n $filterRows[] = $filterRow;\n }\n $filterRow = array();\n }\n }\n if ($table == 'admin.blog_posts_images') {\n foreach ($rows as $row) {\n // Отфильтруем ненужные поля в записи (масиве)\n foreach ($row as $key => $value) {\n // Исключим поля\n switch ($key) {\n case \"sortColumn\":\n case \"ascDescFlg\":\n break;\n default :\n $filterRow[$key] = $value;\n break;\n }\n }\n if (count($filterRow) > 0) {\n $filterRows[] = $filterRow;\n }\n $filterRow = array();\n }\n }\n if ($table == 'admin.blog_posts_audio') {\n foreach ($rows as $row) {\n // Отфильтруем ненужные поля в записи (масиве)\n foreach ($row as $key => $value) {\n // Исключим поля\n switch ($key) {\n case \"sortColumn\":\n case \"ascDescFlg\":\n break;\n default :\n $filterRow[$key] = $value;\n break;\n }\n }\n if (count($filterRow) > 0) {\n $filterRows[] = $filterRow;\n }\n $filterRow = array();\n }\n }\n if ($table == 'admin.blog_posts_video') {\n foreach ($rows as $row) {\n // Отфильтруем ненужные поля в записи (масиве)\n foreach ($row as $key => $value) {\n // Исключим поля\n switch ($key) {\n case \"sortColumn\":\n case \"ascDescFlg\":\n break;\n default :\n $filterRow[$key] = $value;\n break;\n }\n }\n if (count($filterRow) > 0) {\n $filterRows[] = $filterRow;\n }\n $filterRow = array();\n }\n }\n if ($table == 'admin.blog_posts_locations') {\n foreach ($rows as $row) {\n // Отфильтруем ненужные поля в записи (масиве)\n foreach ($row as $key => $value) {\n // Исключим поля\n switch ($key) {\n case \"content\":\n case \"correction\":\n case \"details\":\n case \"sortColumn\":\n case \"ascDescFlg\":\n break;\n default :\n $filterRow[$key] = $value;\n break;\n }\n }\n if (count($filterRow) > 0) {\n $filterRows[] = $filterRow;\n }\n $filterRow = array();\n }\n }\n return $filterRows;\n }", "abstract public function get_rows();", "public function index()\n {\n $blogs = Blog::all();\n return view('tables.datatables',compact('blogs'))->with('i', (request()->input('page', 1) - 1) * 5);\n }", "public function findAllAction();", "public function get_rows()\n {\n $lock = !empty($this->configs['rows_edit']) && $this->configs['rows_edit'] == 1 ? true : false;\n\n $tables = $this->file->sheets->first()->tables;\n\n list($query, $power) = $this->get_rows_query($tables);\n\n $head = $tables[0]->columns->map(function($column) { return 'C' . $column->id; })->toArray();\n\n if (Input::has('search.text') && Input::has('search.column_id')) {\n $query->where('C' . Input::get('search.column_id'), Input::get('search.text'));\n }\n\n $query->whereNull('deleted_at')->select($head)->addSelect('id');\n\n $paginate = $this->isCreater()\n ? $query->addSelect('created_by')->paginate(15)\n : $query->where('created_by', $this->user->id)->paginate(15);\n\n $encrypts = $tables[0]->columns->filter(function($column) { return $column->encrypt; });\n\n if (!$encrypts->isEmpty()) {\n $paginate->getCollection()->each(function($row) use($encrypts) {\n $this->setEncrypts($row, $encrypts);\n });\n }\n return ['paginate' => $paginate->toArray(),'lock' => $lock];\n }", "public function index()\n {\n return Row::all();\n }", "public function readAction() {\n\t\tif(getParam('id')){\n\t\t\t$model = new $this->model(intval(getParam('id')));\n\t\t\t$records = array(\n\t\t\t\t$this->formatRow($model->get())\n\t\t\t);\n\t\t\t$this->setParam('records', $records);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// get submitted params\n\t\t$sortBy = getParam('sort', false);\n\t\t$filter = json_decode(getParam('filter', '{}'), true);\n\t\t\n\t\t// Setup the filtering and query variables\n\t\t$start = intval(getParam('start', 0));\n\t\t$limit = intval(getParam('limit', 0));\n\t\t\n\t\t//Fields to select\n\t\t$fields = $this->getFields();\n\t\t\n\t\t//From to use\n\t\t$from = $this->getFrom();\n\t\t\n\t\t//Join tables\n\t\t$join = $this->getJoin();\n\t\t\n\t\t//Base where clause\n\t\t$where = $this->getWhere();\n\t\t\n\t\t//Sort\n\t\t$sort = $this->getSort();\n\t\t\n\t\tif ($sortBy) {\n\t\t\t$sortArray = json_decode($sortBy, true);\n\t\t\t$numSorters = count($sortArray);\n\t\t\t$sort = array();\n\t\t\tfor ($i = 0; $i < $numSorters; $i++) {\n\t\t\t\t$sort[] = $sortArray[$i]['property'] . ' ' . $sortArray[$i]['direction'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Filter\n\t\t$where = array_merge($where, $this->applyFilter($filter));\n\t\t\n\n\t\t\n\t\t// convert query data to sql\n\t\t$fieldsSql = implode(',', $fields);\n\t\t$fromSql = ' FROM ' . implode(',', $from);\n\t\t$joinSql = implode(' ', $join);\n\t\t$whereSql = 'WHERE ' . implode(' AND ', $where);\n\t\tif (!count($where)) {\n\t\t\t$whereSql = '';\n\t\t}\n\t\t$sortSql = implode(',', $sort);\n\n\t\t// get total count\n\t\t$total = 0;\n\t\t$totalQuery = \"SELECT COUNT(*) total $fromSql $joinSql $whereSql\";\n\t\t$row = LP_Db::fetchRow($totalQuery);\n\t\tif ($row) {\n\t\t\t$total = $row['total'];\n\t\t}\n\t\t$this->setParam('total', $total);\n\t\t\n\t\t// get records\n\t\t$query = \"SELECT $fieldsSql $fromSql $joinSql $whereSql\";\n\t\t$this->setParam('query', $query);\n\t\tif($limit){\n\t\t\t$query = LP_Util::buildQuery($query, $sortSql, $limit, $start);\n\t\t}\n\t\t$rows = LP_Db::fetchAll($query);\n\t\t$numRows = count($rows);\n\t\t$records = array();\n\t\t\n\t\t//Format rows\n\t\tforeach ($rows as $row){\n\t\t\t$records[] = $this->formatRow($row);\n\t\t}\n\t\t\n\t\t$this->setParam('records', $records);\n\t}", "protected function _prepareRowsAction() {\n \n }", "public function index()\n\t{\n\t\t$rownds = $this->rownd->all(array('sort_order'=>'asc'), array('user_id'=>app::session('id')));\n\t\t\n\t\tif ($rownds)\n\t\t{\n\t\t\t$data['rownds'] = $rownds->result;\n\t\t\t$this->render($data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->render();\n\t\t}\n\t}", "public function getRows();", "public function getRows();", "public function data()\n {\n $article = PagesModel::join('article_categories', 'article_categories.id', '=', 'articles.article_category_id')\n ->select(array('articles.id','articles.title','article_categories.title as category',\n 'articles.created_at'));\n\n return Datatables::of($article)\n ->add_column('actions', '<a href=\"{{{ URL::to(\\'admin/article/\\' . $id . \\'/edit\\' ) }}}\" class=\"btn btn-success btn-sm iframe\" ><span class=\"glyphicon glyphicon-pencil\"></span> {{ trans(\"admin/modal.edit\") }}</a>\n <a href=\"{{{ URL::to(\\'admin/article/\\' . $id . \\'/delete\\' ) }}}\" class=\"btn btn-sm btn-danger iframe\"><span class=\"glyphicon glyphicon-trash\"></span> {{ trans(\"admin/modal.delete\") }}</a>\n <input type=\"hidden\" name=\"row\" value=\"{{$id}}\" id=\"row\">')\n ->remove_column('id')\n\n ->make();\n }", "public function getPageData() {\n\t\t//$stat = Statistic::select(array('statistic.id', 'statistic.created_at','category.category_name', 'statistic.ip_address'))\n\t\t//->join('category','statistic.category_id','=','category.id'); \n\t\t$stat = StatView::select(array('id','date','category_name', 'ip_address'));\n\n\t\treturn Datatables::of($stat) \n\t\t-> add_column('actions','<a href=\"{{{ URL::to(\\'admin/blogs/\\' . $id . \\'/delete\\' ) }}}\" class=\"btn btn-xs btn-danger iframe\">{{{ Lang::get(\\'button.delete\\') }}}</a>') \n -> remove_column('id') -> make();\n\n\t}", "function all(){\r\n $data = $this -> model -> getXML();\r\n render('index',$data);\r\n }", "public function indexAction() {\n //on forge la requete SQL\n $articles = $this->repo->getAll();\n \n if ($articles) {\n $nbRows = count($articles);\n \n \n \n \n \n \n \n }\n \n \n \n }", "public function admin_index() {\r\n\t\t$this->data = $this->{$this->modelClass}->find('all');\r\n }", "public function actionData()\n {\n// \n// $connector->configure(new Grid(), \"event_id\", \"start_date, end_date, event_name\");\n// $connector->render();\n\n return new Grid();\n }", "public function index()\n {\n $this->dataGrid\n ->model($this->post)\n ->addColumn('Imagem', 'image', false, 130)\n ->addColumn('Título', 'title')\n //->addColumn('Categoria', 'category_id')\n // Pretendo passar desse jeito quando tiver relacionamento\n ->addColumn('Categoria', 'category.name')\n ->addColumn('Data', 'created_at')\n ->addFilter('title')\n ->addFilter('category.name')\n ->addEditAction('home.edit')\n ->addDeleteAction('home.destroy')\n ->search(['category_id']);\n\n // dd($this->dataGrid);\n\n // foreach ($this->dataGrid->rows() as $row) {\n\n // foreach ($this->dataGrid->getColumns() as $column) {\n // $column = $column['name'];\n\n // // echo $row->$column;\n\n // if (strpos($column, '.')) {\n // $array = explode(\".\", $column);\n // $antes = $array[0];\n // $depois = $array[1];\n\n // // $depois = explode(\".\", $column)[1];\n\n // echo $row->$antes->$depois;\n // } else {\n // echo $row->$column;\n // }\n // }\n // echo \"<br>\";\n // }\n\n\n return view('home', [\n 'dataGrid' => $this->dataGrid\n ]);\n }", "public function listAction()\n {\n /*$this->_helper->viewRenderer->setNoRender(true);\n\n $params = $this->_request->getPost();\n $data = $this->_model->getList($params);\n die(json_encode($data));*/\n\n $this->_helper->viewRenderer->setNoRender(true);\n\n $params = $this->_request->getPost();\n \n //cek apakah ada table master yang sedang diedit, jika ada yang sedang diedit, maka data tidak akan muncul\n $lock = $this->_global->checkLockTable($params);\n \n /*if($lock['JUMLAH']) {\n $data['return'] = \"locked\";\n $data['module'] = $lock['MODULE'];\n $data['insert_user'] = $lock['INSERT_USER'];\n die(json_encode($data));\n } else { */\n $data = $this->_model->getList($params);\n die(json_encode($data));\n //}\n }", "public function rowAction()\n {\n $params = $this->_request->getParams();\n $params['rowid'] = rawurldecode($params['rowid']);\n\t\t\n\t\t$table = new Application_Model_SetupMasterBudgetPeriod();\n $row = $table->getRow($params);\n $result = Zend_Json::encode($row);\n\n die($result);\n }", "public function getAction() {\n\t\t$customerMapper = Models_Mapper_CustomerMapper::getInstance();\n\t\t$id = filter_var($this->_request->getParam('id'), FILTER_VALIDATE_INT);\n\t\t$for = filter_var($this->_request->getParam('for'), FILTER_SANITIZE_STRING);\n\n\t\tif ($for === 'dashboard'){\n\t\t\t$order = filter_var($this->_request->getParam('order'), FILTER_SANITIZE_STRING);\n\t\t\t$limit = filter_var($this->_request->getParam('limit'), FILTER_SANITIZE_NUMBER_INT);\n\t\t\t$offset = filter_var($this->_request->getParam('offset'), FILTER_SANITIZE_NUMBER_INT);\n\t\t\t$search = filter_var($this->_request->getParam('search'), FILTER_SANITIZE_SPECIAL_CHARS);\n\n\t\t\t$currency = Zend_Registry::get('Zend_Currency');\n\t\t\t$data = array_map(function($row) use ($currency){\n\t\t\t\t$row['reg_date'] = date('d M, Y', strtotime($row['reg_date']));\n\t\t\t\t$row['total_amount'] = $currency->toCurrency($row['total_amount']);\n\t\t\t\treturn $row;\n\t\t\t},\n\t\t\t$customerMapper->listAll($id ? array('id = ?'=>$id) : null, $order, $limit, $offset, $search));\n\t\t} else {\n\t\t\tif ($id) {\n\t\t\t\t$result = $customerMapper->find($id);\n\t\t\t\tif ($result) {\n\t\t\t\t\t$data = $result->toArray();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$result = $customerMapper->fetchAll();\n\t\t\t\tif ($result){\n\t\t\t\t\t$data = array_map(function($model){ return $model->toArray(); }, $result);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}", "function all($request){\r\n global $context;\r\n $i= new $this->model;\r\n\r\n if(!$this->authRequired){\r\n $i->supperUser();\r\n }\r\n\r\n $data=$i->get();\r\n\r\n if($request->UseApi() ){\r\n json_success(\"Success\",$data);//where(['id','<','50'])->orderBy('id','desc')->limit(2,1)->\r\n }else{\r\n return $this->view(compact('data'));\r\n }\r\n\r\n }", "public function indexForFilter(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n }\n $query = $this->{$this->main_model}->find();\n $this->CommonQuery->build_common_query($query,$user,[]); \n $q_r = $query->all();\n $items = array();\n foreach($q_r as $i){\n array_push($items,array(\n 'id' => $i->id, \n 'text' => $i->name\n ));\n } \n\n $this->set(array(\n 'items' => $items,\n 'success' => true,\n '_serialize' => array('items','success')\n ));\n }", "public function actionIndex()\n {\n $model = new PostKey();\n\n $curPage = Yii::$app->request->get('page',1);\n $pageSize = Yii::$app->params['pageSize'];\n\n $type = Yii::$app->request->get('type');\n $value = Yii::$app->request->get('value');\n $search = ($type&&$value)?['like',$type,$value]:'';\n\n $query = PostKey::find()->orderBy('post_id ASC');\n $data = $model->getPages($query,$curPage,$pageSize,$search);\n $pages = new Pagination(['totalCount'=>$data['count'],'pageSize' => $pageSize]);\n\n return $this->render('index',['data'=>$data,'pages'=>$pages]);\n }", "private function getData(){\n\t\tdb::getAdapter();\n\t\t\n\t\t$counter=0;\n\t\t$arrayFieldQuery=array();\n\t\tforeach($this->fields as $field){\n\t\t\t$arrayFieldQuery[$field]=$this->types[$counter];\n\t\t\t$counter++;\n\t\t}\n\t\t\n\t\t$counter=0;\n\t\t$arrayFilters=array();\n\t\tforeach($this->filters as $filter){\n\t\t\t$arrayFilters[$this->fields[$filter[0]]]=array(\"type\"=>$this->types[$filter[0]],\"value\"=>$filter[1]);\n\t\t}\n\t\t\n\t\tif(db::getFields($this->table,$arrayFieldQuery,$arrayFilters,$this->orderQuery,$this->limit,true)){\n\t\t\t$this->pages=ceil(((int)db::getCalculatedRows())/((int)$this->maxRowsPerPage));\n\t\t\t$this->maxRows=(int)db::getCalculatedRows();\n\t\t\twhile($row=db::fetch(db::$FETCH_TYPE_ASSOC)){\n\t\t\t\t$this->addRow($row);\n\t\t\t}\n\t\t}\n\t}", "public function all(){\t\r\n\t\t//Get ALL recipes from the database, but limit the search according to the \r\n\t\t//GET parameters outlining upper and lowerl imits\r\n\t\t$recipes = Recipe::retrieve();\r\n\t\t//Set the recipes results to the template and display\r\n\t\t$this->template->recipes = $recipes;\r\n\t\t$this->template->display('all.html.php');\r\n\t}", "public function actionListAllEscrows(){\n \n $escrow = Escrow::model()->findAll();\n if($escrow===null) {\n http_response_code(404);\n $data['error'] ='No record found';\n echo CJSON::encode($data);\n } else {\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n //\"assigned\" => $assigned,\n \"escrow\" => $escrow)\n );\n \n }\n \n }", "public function getTimelineRows_get() {\n //extract($_GET);\n $result = $this->feeds_model->numRows();\n return $this->response($result);\n }", "public function get_row();", "public function postAction()\n {\n // $this->view->blog = $Blog->fetchAll();\n \n }", "public function indexAction()\n { \n if(!$this->_rParams->id) {\n // we want all items\n }\n }", "public function getIndex()\n\t{\n\t\tif (auth()->check()) {\n\t\t\t$resourceList = ResourceList::where('resource_list.reStatus', '审核通过')->where('resource_list.uid', '!=', auth()->user()->id);\n\t\t}\n\t\telse {\n\t\t\t$resourceList = ResourceList::where('resource_list.reStatus', '审核通过');\n\t\t}\n\t\t\n\t\tif (Input::get('dlTms') == 'desc') {\n\t\t\t$resourceList->orderby('resource_list.dlTms', 'desc');\n\t\t}\n\t\telseif (Input::get('dlTms') == 'asc') {\n\t\t\t$resourceList->orderby('resource_list.dlTms', 'asc');\n\t\t}\n\t\telse {\n\t\t\t$resourceList->orderby('resource_list.created_at', 'desc');\n\t\t}\n\t\tif (Input::get('action') == 'attention') \n\t\t\t$resourceList->leftJoin('res_attention_rel', 'resource_list.id', '=', 'res_attention_rel.rlid')->where('res_attention_rel.uid', auth()->user()->id)->select('resource_list.*', 'res_attention_rel.*', 'resource_list.id');\n\t\t$this->filter = \\DataFilter::source($resourceList);\n\t\t$this->filter->attributes(['class'=>'form-custom member-search mt20 mb20 clearfix']);\n\t\t$this->filter->add('coopManu')->attributes(['style'=>'display:none']);\n\t\t$this->filter->add('variety')->attributes(['style'=>'display:none']);\n\t\t$this->filter->add('cmpy')->attributes(['style'=>'display:none']);\n\t\t$this->filter->add('city')->attributes(['style'=>'display:none']);\n\t\t$this->filter->submit(trans('panel::fields.query'));\n\t\t$this->filter->build();\n\t\t\n\t\t$this->grid = \\DataGrid::source($this->filter);\n\t\t$this->setGridCommon();\n\t\t$this->grid->add('id');\n\t\t$this->grid->add('cmpy');\n\t\t$this->grid->add('contact');\n\t\t$this->grid->add('variety');\n\t\t$this->grid->add('coopManu');\n\t\t$this->grid->add('city');\n\t\t$this->grid->add('dlTms');\n\t\t$this->grid->add('annex');\n\t\t$this->grid->add('annexName');\n\t\t$this->grid->add('uid');\n\t\t$this->grid->add('isAttention');\n\t\t//$this->grid->paginate(1);\n\t\t$this->grid->row(function ($row) {\n\t\t\tif (auth()->check()) {\n\t\t\t\t$row->cell('isAttention')->value = ResAttentionRel::firstOrNew(['uid'=>auth()->user()->id, 'rlid'=>$row->cell('id')->value])->exists;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$row->cell('isAttention')->value = false;\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t$this->grid->getGrid('rapyd::datagrid_custom_resource');\n\t\t\n\t\t/*\n\t\t * 资源单地区数据\n\t\t */\n\t\t$city = ResourceArea::lists('city', 'id')->all();\n\t\t/*\n\t\t * 厂商数据\n\t\t */\n\t\t$coopManu = $this->getOptionGroupData(new CoopManu(), 'cname');\n\t\t\n\t\treturn view('fore.resource', array(\n\t\t\t\t'grid' \t => $this->grid,\n\t\t\t\t'city' \t => $city,\n\t\t\t\t'coopManu' \t => $coopManu,\n\t\t\t\t'filter' \t => $this->filter,\n\t\t\t\t'import_message' => Input::get('import_message'),\n\t\t));\n\t}", "public function index()\n {\n $data['column_name'] = $this->article->getProperties();\n $data['rows'] = $this->article->getValues();\n\n return view('post::index');\n }", "public function actionIndex2()\r\n\t{\r\n\t\t// calling line :\r\n\t\t/*\r\n\t\thttp://www.k-m.ru/app2/index.php?r=backend/index&Table=Assortment&_dc=1401196798272&page=1&start=0&limit=20&filter[0][field]=price&filter[0][data][type]=numeric&filter[0][data][comparison]=lt&filter[0][data][value]=5&filter[0][field]=price&filter[0][data][type]=numeric&filter[0][data][comparison]=lt&filter[0][data][value]=56&filter[1][field]=size&filter[1][data][type]=list&filter[1][data][value]=medium,large\r\n\t\t*/\r\n// filter[0][operator]=OR&filter[0][field]=title&filter[0][data][type]=string&filter[0][data][value]=ela\r\n\t\t$ModelName = $_GET['Table'];\t\t\r\n\t/*\tif (!class_exists($ModelName, false)) \r\n\t\t\treturn json_encode(array('success'=> false , 'msg'=> Yii::t('general', 'There is no such class in the system')));*/\r\n\t\t\t\r\n\t\t$table_name = 'tarex_' . strtolower($ModelName);\r\n\t\t// collect request parameters\r\n\t\t$offset = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;\r\n\t\t$limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : 50;\r\n\t\t$sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : '';\r\n\t\t$dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : 'ASC';\r\n\t\t$filters = isset($_REQUEST['filter']) ? $_REQUEST['filter'] : null;\r\n\t\t\r\n\t\t// GridFilters sends filters as an Array if not json encoded\r\n\t\tif (is_array($filters)) {\r\n\t\t\t$encoded = false;\r\n\t\t} else {\r\n\t\t\t$encoded = true;\r\n\t\t\t$filters = json_decode($filters);\r\n\t\t}\r\n\t\t\r\n\t\t$where = ' 0 = 0 ';\r\n\t\t$qs = '';\r\n\r\n\t\t// loop through filters sent by client\r\n\t\tif (is_array($filters)) {\r\n\t\t\tfor ($i=0;$i<count($filters);$i++){\r\n\t\t\t\t$filter = $filters[$i];\r\n\r\n\t\t\t\t// assign filter data (location depends if encoded or not)\r\n\t\t\t\tif ($encoded) {\r\n\t\t\t\t\t$field = $filter->field;\r\n\t\t\t\t\t$value = $filter->value;\r\n\t\t\t\t\t$compare = isset($filter->comparison) ? $filter->comparison : null;\r\n\t\t\t\t\t$filterType = $filter->type;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$field = $filter['field'];\r\n\t\t\t\t\t$value = $filter['data']['value'];\r\n\t\t\t\t\t$compare = isset($filter['data']['comparison']) ? $filter['data']['comparison'] : null;\r\n\t\t\t\t\t$filterType = $filter['data']['type'];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tswitch($filterType){\r\n\t\t\t\t\tcase 'string' : $qs .= \" AND \".$field.\" LIKE '%\".$value.\"%' \"; Break;\r\n\t\t\t\t\tcase 'list' :\r\n\t\t\t\t\t\tif (strstr($value,',')){\r\n\t\t\t\t\t\t\t$fi = explode(',',$value);\r\n\t\t\t\t\t\t\tfor ($q=0;$q<count($fi);$q++){\r\n\t\t\t\t\t\t\t\t$fi[$q] = \"'\".$fi[$q].\"'\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$value = implode(',',$fi);\r\n\t\t\t\t\t\t\t$qs .= \" AND \".$field.\" IN (\".$value.\")\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$qs .= \" AND \".$field.\" = '\".$value.\"'\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tBreak;\r\n\t\t\t\t\tcase 'boolean' : $qs .= \" AND \".$field.\" = \".($value); Break;\r\n\t\t\t\t\tcase 'numeric' :\r\n\t\t\t\t\t\tswitch ($compare) {\r\n\t\t\t\t\t\t\tcase 'eq' : $qs .= \" AND \".$field.\" = \".$value; Break;\r\n\t\t\t\t\t\t\tcase 'lt' : $qs .= \" AND \".$field.\" < \".$value; Break;\r\n\t\t\t\t\t\t\tcase 'gt' : $qs .= \" AND \".$field.\" > \".$value; Break;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tBreak;\r\n\t\t\t\t\tcase 'date' :\r\n\t\t\t\t\t\tswitch ($compare) {\r\n\t\t\t\t\t\t\tcase 'eq' : $qs .= \" AND \".$field.\" = '\".date('Y-m-d',strtotime($value)).\"'\"; Break;\r\n\t\t\t\t\t\t\tcase 'lt' : $qs .= \" AND \".$field.\" < '\".date('Y-m-d',strtotime($value)).\"'\"; Break;\r\n\t\t\t\t\t\t\tcase 'gt' : $qs .= \" AND \".$field.\" > '\".date('Y-m-d',strtotime($value)).\"'\"; Break;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tBreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$where .= $qs;\r\n\t\t}\r\n\t\t\r\n\t\t$query = \"SELECT * FROM {$table_name} WHERE \" . $where;\r\n\t\t/// \"SELECT COUNT(id) FROM demo WHERE \".$where\r\n\t\t$sql = \"SELECT COUNT(*) FROM {$table_name} WHERE \" . $where;\r\n\t\theader('Content-type:text/html; charset=utf-8');\r\n\t\techo '$sql=', $sql, '<br>';\r\n\t\t$data_count = Yii::app()->db->createCommand($sql)->queryScalar();\r\n\t\t//$data_count = CActiveRecord::model($ModelName)->count($criteria);\r\n\t\techo '$sql count = ' , $data_count, '<br>';\r\n\t\t\r\n\t\t// добавление сортировки и ограничений на вывод\r\n\t\tif ($sort != \"\") {\r\n\t\t\t$query .= \" ORDER BY \".$sort.\" \".$dir;\r\n\t\t}\t\t\r\n\t\t//$query .= \" LIMIT \".$offset.\",\".$limit;\r\n\t\t\r\n\t\t//echo 'запрос с сортировкой и ограничением на вывод: $query = ', $query, '<br><br>'; // показ окончательного запроса\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$criteria = new CDbCriteria;\t \r\n\t\t//$data_count = CActiveRecord::model($ModelName)->count($criteria); \r\n\t\t\r\n\t\t//$criteria->addCondition( $filter['']) \r\n\t\t//$criteria->select = array('id', 'oem', 'article', 'title', 'make');\r\n\t\t\r\n\t\t// добавляем параметры постраничного вывода\r\n\t\t\r\n\t\t/*\r\n\t\t$criteria->limit = $_GET['limit'] ? $_GET['limit'] : 20; //echo \"Limit = \", $_GET['limit'];\r\n\t\t$criteria->offset = $_GET['start'] ? $_GET['start'] : 0; \r\n\t\t*/\r\n\t\t\r\n\t\t//echo '$criteria = '; print_r($criteria->toArray()); echo '<br/>';\r\n\t\t//$data = CActiveRecord::model($ModelName)->findAll($criteria); \r\n\t\t$data = CActiveRecord::model($ModelName)->findAllBySql($query); \r\n\t\t\r\n\t//\tprint_r($data);\r\n\t\t\r\n\t\t//$table_name='yiiapp_'.$Table; \r\n\r\n\t\t//$variable = 'MainMenu'; \r\n\t\t//$TestData = $variable::model()->findAll(); // since 5.3\r\n\t\t\r\n\t\t/*\r\n\t\t$criteria=new CDbCriteria(array(\r\n\t\t'select'=>'t.*,count(j.*)',\r\n\t\t'join'=>'left join CountTbl j on condition',\r\n\t\t'order'=>'count(j.*)',\r\n\t\t))\r\n\r\n\t\t$criteria->condition='id=:id AND login=:login';\r\n\t\t$criteria->params=array(':id'=>5, ':login' => 'test'); // задаем параметры\r\n*/\r\n\t\t$new = array();\r\n\t foreach($data as $r) \r\n\t\t{\t\t \r\n\t\t\t/*$res['id']=$r['id'];\t\r\n\t\t\t$res['title']=$r['title'];\t\r\n\t\t\t$res['oem']=$r['oem'];\t\t\t\t\r\n\t\t\t$res['article']=$r['title'];\t\r\n\t\t\t$res['make']=$r['make'];\t*/\r\n\t\t\tforeach($r as $key => $value)\r\n\t\t\t{\r\n\t\t\t\t$res[$key] = $value;\r\n\t\t\t}\r\n\t\t\t$new[] = $res;\r\n\t\t} \r\n\t\t $result = array(\r\n\t\t\t'success'=>true,\r\n\t\t\t'data' => $new,\r\n\t\t\t'count' => $data_count //sizeof($new)\r\n\t\t );\r\n\t\t//echo 'TestData '.$TestData;\r\n\t\tprint_r(json_encode($result)); \r\n\t\t\r\n\t\t\r\n\t}", "public function index()\n {\n \n /* return *///$sort \n\n \n $articles = Article::query();\n\n /* foreach($sort as $sortcol)\n {\n $sortdir = starts_with($sortcol, '-') ? 'desc' : 'asc';\n\n $sortCol = ltrim($sortcol, '-');\n\n $articles->orderBy($sortCol, $sortdir);\n } */\n\n if(request()->has('filterBy'))\n {\n list($criteria, $value) = explode(':', request()->filterBy);\n\n $articles->where($criteria, $value);\n }\n\n return ArticleResource::collection($articles->paginate(15));\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function get_all(){ \n\t\treturn $this->call('GET', '/admin/blogs.json', array()); \n\t}", "public function index()\n {\n //get all blogs\n //$blog = Blog::paginate(15);\n $blog = Blog::with(['blog_content' => function($query) {\n $query->where('type', '=', 'img_main')->orWhere('type', '=','intro');\n }])->where('blog_id', '!=', 'a41f5295-8535-4eaa-97a3-ddcdf4a86a47')->orderBy('published_date', 'DESC')->get();\n // $blog = DB::table('blogContent')\n // ->join('blog', 'blog.id', '=','blogContent.blog_id')\n // ->where('blogContent.type', '=', 'intro')\n // ->get();\n return BlogResource::collection($blog);\n }", "public function getAllEntriesAsRows() {\n $allModels = $this -> getAllHistoricFilterEntries();\n $html = \"\";\n //TODO may need to make a function that makes a JS array to hold the info\n foreach ($allModels as $model) {\n $idHistoricFilter = strval($model -> getIdHistoricFilter());\n $objectRowID = \"14\" . $idHistoricFilter;\n $editAndDelete = \"</td><td><button class='btn basicBtn' onclick='updateHistoricFilter(\"\n . $objectRowID . \",\"\n . $model -> getIdHistoricFilter()\n . \")'>Update</button>\"\n . \"</td><td>\";\n\n if ($idHistoricFilter != \"0\") {\n $editAndDelete = $editAndDelete . \"<button class='btn basicBtn' onclick=\"\n . '\"deleteHistoricFilter('\n . $model -> getIdHistoricFilter()\n . ')\"> Delete</button>';\n }\n\n $html = $html\n . \"<tr id='\" . $objectRowID . \"'><td>\" . $model -> getHistoricFilterName()\n . \"</td><td>\" . $model -> getDateStart()\n . \"</td><td>\" . $model -> getDateEnd()\n . \"</td><td>\" . $model -> getDescription()\n . \"</td><td>\" . $model -> getButtonColor()\n . $editAndDelete\n . \"</td></tr>\";\n }\n return $html;\n }", "public function getForDataTable()\n {\n\n $q = $this->query();\n if (request('module') == 'task') {\n $q->where('section', '=', 2);\n } else {\n $q->where('section', '=', 1);\n }\n return\n $q->get();\n }", "public function getAjaxList(Request $request) // GET THE SLUG, ex. 'posts', 'pages', etc.\n {\n // GET THE SLUG, ex. 'posts', 'pages', etc.\n $slug = $request->slug;\n\n // GET THE DataType based on the slug\n $dataType = Admin::model('DataType')->where('slug', '=', $slug)->first();\n\n // Check permission\n $this->authorize('browse', app($dataType->model_name));\n\n $model = app($dataType->model_name);\n $query = $model->select('*');\n\n if (method_exists($model, 'adminList')) {\n $query = $model->adminList()->select('*');\n }\n\n if (!isset($request->order)) {\n if ($model->timestamps) {\n $query = $query->latest($model::CREATED_AT);\n } else {\n $relationships = $this->getRelationships($dataType);\n $query = $query->with($relationships)->orderBy($model->getKeyName(), 'DESC');\n }\n }\n\n $query = DataTables::of($query);\n\n foreach ($dataType->ajaxList() as $dataRow) {\n $query->editColumn($dataRow->field, function($dataTypeContent) use($request, $slug, $dataRow){\n $content = $dataTypeContent->{$dataRow->field};\n\n $handler = AbstractHandler::initial($dataRow->type);\n\n if (method_exists($handler, 'getContentForList')) {\n $content = $handler->getContentForList($request, $slug, $dataRow, $dataTypeContent);\n }\n\n return $content;\n });\n\n if ($dataRow->type == 'relationship') {\n $query->filterColumn($dataRow->field, function ($query, $keyword) use($dataRow){\n $relationship = json_decode($dataRow->details);\n $ids = app($relationship->model)->where($relationship->label, 'like', \"%$keyword%\")->pluck($relationship->key);\n $query->whereIn($relationship->column, $ids);\n });\n }\n }\n\n return $query\n ->addColumn('delete_checkbox', function($dataTypeContent) {\n return '<input type=\"checkbox\" name=\"row_id\" id=\"checkbox_' . $dataTypeContent->id . '\" value=\"' . $dataTypeContent->id . '\">';\n\n })\n ->addColumn('actions', function($dataTypeContent) use($dataType){\n return Admin::view('admin::list.datatable.buttons', ['data' => $dataTypeContent, 'dataType' => $dataType]);\n })\n ->rawColumns(array_merge($dataType->ajaxListFields(), ['delete_checkbox', 'actions']))\n ->make(true);\n }", "public function allblogpostsActionGet() : object\n {\n $page = $this->app->page;\n $title = \"Alla posts i databasen\";\n $db = $this->app->db;\n\n $db->connect();\n $sql = <<<EOD\nSELECT\n *,\n DATE_FORMAT(COALESCE(updated, published), '%Y-%m-%dT%TZ') AS published_iso8601,\n DATE_FORMAT(COALESCE(updated, published), '%Y-%m-%d') AS published\nFROM content\nWHERE type=?\nORDER BY published DESC\n;\nEOD;\n $resultset = $db->executeFetchAll($sql, [\"post\"]);\n\n $page->add(\"cms/header\");\n $page->add(\"cms/allblogposts\", [\n \"resultset\" => $resultset\n ]);\n return $page->render([\n \"title\" => $title\n ]);\n }", "function FetchTableContent($i)\r\n{\r\n\r\n/*\r\nFetchtable content List\r\n\r\n1. fetch all users for dashboard\r\n2. fetch all admins for dahsboard\r\n3. total all sub-admins for dahsboard\r\n4. total count of all registered users\r\n5. total count of all admin users\r\n6. fetch all users\r\n17. Fetch General Settings\r\n*/ \r\n\tglobal $connect;\r\n\t$crud = new Crud($connect);\r\n\r\n\tswitch ($i) {\r\n\r\n\t\t//select all users\r\n\t\tcase 1:\r\n\t\t\t$data = $crud->select(\"users\",\"*\",\"\", \"ID DESC\");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t//select all row from admin 1st level\r\n\t\tcase 2:\r\n\t\t\t$data = $crud->select(\"admin\",\"*\", \"\", \"ID DESC\");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t//select all row from admin 2nd level\r\n\t\tcase 3:\r\n\t\t\t$data = $crud->select(\"sub_admin\",\"*\", \"\", \"ID DESC\");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t//select all row from guest\r\n\t\tcase 4:\r\n\t\t\t$data = $crud->select(\"guest\",\"*\", \"\", \"ID DESC\");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t//fetch audit trail messages for dashboard\r\n\t\tcase 8:\r\n\t\t\t$data = $crud->select(\"gallery p\",\r\n\t\t\t\t\t\"p.*, k.Album, k.ID \",\r\n\t\t\t\t\t\"\",\r\n\t\t\t\t\t\" p.ID DESC \", \r\n\t\t\t\t\t\" LEFT JOIN album k on p.Album = k.ID \");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t//select all row from advert\r\n\t\tcase 9:\r\n\t\t\t$data = $crud->select(\"advert\",\"*\", \"\", \"ID DESC\");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t//select total unique users from general_log table\r\n\t\tcase 10:\r\n\t\t\t$data = $crud->select(\"general_log\",\"COUNT(ID) as Total\", \"\", \"ID DESC\");\r\n\t\t\treturn $data[0][\"Total\"];\r\n\t\t\tbreak;\r\n\t\t\r\n\t\t//select total clicks from general_log table\r\n\t\tcase 11:\r\n\t\t\t$data = $crud->select(\"general_log\",\"SUM(Visit) as Total\", \"\", \"ID DESC\");\r\n\t\t\treturn $data[0][\"Total\"];\r\n\t\t\tbreak;\r\n\r\n\t\t//select total unique user clicks from general_log table(For Individual Dashboards)\r\n\t\tcase 12:\r\n\t\t\t$data = $crud->select(\"general_log\",\"COUNT(Visit) as Total\", \"\", \"ID DESC\");\r\n\t\t\treturn $data[0][\"Total\"];\r\n\r\n\t\t//select all row from Audit Log\r\n\t\tcase 13:\r\n\t\t\t$data = $crud->select(\"audit_log\",\"*\", \"\", \"COUNT(ID) DESC\", \"UserID\");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t//select total unique users from general_log table\r\n\t\tcase 14:\r\n\t\t\t$data = $crud->select(\"users\",\"COUNT(ID) as Total\", \"\", \"ID DESC\");\r\n\t\t\treturn $data[0][\"Total\"];\r\n\t\t\tbreak;\r\n\t\t\r\n\t\t//fetch general settings - used\r\n\t\tcase 17:\r\n\t\t\t$data = $crud->select(\"general_settings\", \"*\");\r\n\r\n\t\t\treturn $data;\r\n\t\tbreak;\r\n\r\n\t\t//count schools\r\n\t\tcase 18:\r\n\t\t\t$data = $crud->select(\"school\",\"COUNT(SchoolID) as Total\", \"\", \"SchoolID DESC\");\r\n\t\t\treturn $data[0][\"Total\"];\r\n\t\t\tbreak;\r\n\r\n\t\t//count teachers \r\n\t\tcase 19:\r\n\t\t\t$data = $crud->select(\"teacher\",\"COUNT(TID) as Total\", \"\", \"TID DESC\");\r\n\t\t\treturn $data[0][\"Total\"];\r\n\t\t\tbreak;\r\n\r\n\t\t//count student\r\n\t\tcase 20:\r\n\t\t\t$data = $crud->select(\"student\",\"COUNT(StdID) as Total\", \"\", \"StdID DESC\");\r\n\t\t\treturn $data[0][\"Total\"];\r\n\t\t\tbreak;\r\n\r\n\t\t//count parent\r\n\t\tcase 21:\r\n\t\t\t$data = $crud->select(\"parent\",\"COUNT(ParID) as Total\", \"\", \"ParID DESC\");\r\n\t\t\treturn $data[0][\"Total\"];\r\n\t\t\tbreak;\r\n\r\n\t\t//count non-academic\r\n\t\tcase 22:\r\n\t\t\t$data = $crud->select(\"non_academic\",\"COUNT(ID) as Total\", \"\", \"ID DESC\");\r\n\t\t\treturn $data[0][\"Total\"];\r\n\t\t\tbreak;\r\n\r\n\t\t//count sub-admin\r\n\t\tcase 23:\r\n\t\t\t$data = $crud->select(\"sub_admin\",\"COUNT(ID) as Total\", \"\", \"ID DESC\");\r\n\t\t\treturn $data[0][\"Total\"];\r\n\t\t\tbreak;\r\n\t\t//select all school\r\n\t\tcase 24:\r\n\t\t\t$data = $crud->select(\"school\",\"*\",\"\", \"SchoolID DESC\");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\t\t//select all teacher\r\n\t\tcase 25:\r\n\t\t\t$data = $crud->select(\"teacher\",\"*\",\"\", \"TID DESC\");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\t\t//select all student\r\n\t\tcase 26:\r\n\t\t\t$data = $crud->select(\"student\",\"*\",\"\", \"StdID DESC\");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\t\t//select all parent\r\n\t\tcase 27:\r\n\t\t\t$data = $crud->select(\"parent\",\"*\",\"\", \"ParID DESC\");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\t\t//select all non-academic\r\n\t\tcase 28:\r\n\t\t\t$data = $crud->select(\"non_academic\",\"*\",\"\", \"ID DESC\");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\tdefault:\r\n\t\t\t# code...\r\n\t\t\tbreak;\r\n\t}\r\n}", "public function action_index()\n\t{\n\t\t $list = array(\n 'foo' => Input::get('foo'),\n 'baz' => array(\n 1, 50, 219\n ),\n 'empty' => null\n );\n\t\t$results = Articles::get_list( 10, 0);\n //print_r($results);\n\t\treturn $this->response($results, 200);\n\t}", "public function loadDataAction()\n {\n $contentService = Dm_Session::GetServiceFactory()->getContentService();\n\n $filter = new Service_Api_Filter_Content();\n\n $filter->id = $this->_getParam('id');\n $filter->mimeType = $this->_getParam('mimeType');\n $filter->limit = $this->_getParam('limit');\n $filter->offset = $this->_getParam('offset');\n $filter->search = $this->_getParam('search');\n $filter->sources = $this->_getParam('sources');\n $filter->format = $this->_getParam('dim');\n $filter->properties = $this->_getParam('properties');\n $contents = $contentService->contentsRead($filter);\n $this->view->data = $contents;\n }", "abstract public function getData(GridViewRequest $request);", "function index(){\r\n \r\n $all = $this->model->selectAll();\r\n $this->data('all', $all);\r\n $this->loadView();\r\n }", "public function pageAction(){\n $this->_request->setParam('table', 'Page'); \n \t$this->view->gridIndexRoute = Rhema_Constant::ROUTE_GRID_INDEX ; \t \n \t$this->_helper->displayGrid(); \t \n }", "public function listarAction()\n {\n /* Recibo parámetros propios del grid */\n $sidx = $this->getRequest()->getParam('sidx'); /* Obtiene la dirección de ordenamiento ASC o DESC */\n $sord = $this->getRequest()->getParam('sord'); /* Obttiene la columna de orden - Es decir, la columna donde ha dado click el usuario para ordenar */\n $page = $this->getRequest()->getParam('page'); /* La página solicitado */\n $limit = $this->getRequest()->getParam('rows'); /* El número de filas solicitado */\n\n /* Recibo otros parámetros que envío */\n $txtBuscar = $this->getRequest()->getParam('txtBuscar'); /* Texto a buscar */\n $todaOficina = $this->getRequest()->getParam('todaOficina'); \n $dependencia_busca_id = $this->getRequest()->getParam('dependencia_busca_id'); \n\n /* Al ingresar por primera vez no existe el parámetro 'rows' por lo tanto lo hacemos igual a 1, para que no exista problema en la división $total_pages = ceil($count/$limit) */\n if(!$limit) $limit = 1;\n\n if(!$dependencia_busca_id){\n $dependencia_busca_id = $this->_usuario->dependencia_id;\n }\n \n $usuario_id = $this->_usuario->id; \n\n if($todaOficina){\n \n $where = \"a.dependencia_id = $dependencia_busca_id AND a.tipomovimiento_id IN (1,2,3,5,7) AND a.procesado = FALSE AND \"; \n \n } else {\n \n $where = \"a.dependencia_id = $dependencia_busca_id AND a.usuario_id = $usuario_id AND a.tipomovimiento_id IN (1,2,3,5,7) AND a.procesado = FALSE AND \"; \n \n }\n \n $where .= \"a.documento_id||c.nombre||b.firma||b.cargo||b.asunto ILIKE '%$txtBuscar%'\";\n\n /* Paso Array a formato Json */\n $count = $this->_modeloMovimiento->Count($where);\n\n if( $count > 0 ) {\n $total_pages = ceil($count/$limit);\n } else {\n $total_pages = 0;\n }\n if ($page > $total_pages) $page=$total_pages;\n\n $start = $limit * $page - $limit; // do not put $limit*($page - 1)\n if ($start<0) $start=0;\n\n $rsArray = $this->_modeloMovimiento->getList($sidx,$sord,$start,$limit,$where);\n\n $response = new stdClass(); \n $response->page = $page;\n $response->total = $total_pages;\n $response->records = $count;\n\n $i = 0;\n\n //$urlReportes = 'http://localhost:10088/misreportes/gidoc/';\n //$urlrptDocumento = $urlReportes.'rptDocumento2.php';\n \n //$urlReportes = 'http://localhost:10088/misreportes/gidoc/';\n \n foreach ($rsArray as $fila) {\n $id = $fila['id'];\n $documento_id = $fila['documento_id'];\n $secuencia = $fila['secuencia']; \n $expediente_id = $fila['expediente_id']; \n $tipomovimiento_id = $fila['tipomovimiento_id'];\n\n $linkEdita = \"<a href='#' onClick=editaDesdeLink($id) >$expediente_id-$secuencia</a>\";\n \n $urlrptDocumento = \"/gidoc/rptdocumento/index/documento_id/$documento_id\"; \n \n $linkVerArchivo = '';\n if($fila['archivo']){\n $linkVerArchivo = \"<a target='_blank' href='/uploads/\".$fila['archivo'].\"'><span class='ui-icon ui-icon-document'></span></a>\";\n } else {\n /* Si es Documento interno */\n if($fila['origen'] == 1){\n $linkVerArchivo = \"<a target='_blank' href='$urlrptDocumento' ><span class='ui-icon ui-icon-document'></span></a>\";\n }\n }\n\n if($fila['usuario_destino']){\n $derivadoA = $fila['oficina_destino'].'/'.$fila['usuario_destino']; \n } else {\n $derivadoA = $fila['oficina_destino']; \n }\n\n /* Preparo botón para firma o deshacer firma */\n $boton = '';\n if($tipomovimiento_id == 1 ){ /* Si está solo registrado */\n\n if($this->_config->general->opcionFirma){\n /* Si es Doc. Personal */\n if($fila['tipo'] == 1) {\n /* Mostrar botón para firmar */\n if(!$fila['firma']) { \n $boton = \"<div><button type='button' onclick='firmar($documento_id)' >Firmar</button></div>\";\n } else {\n $boton = \"<div><button type='button' onclick='deshacer_firma($documento_id)' >Retirar Firma</button></div>\";\n }\n } else { /* Si es doc. Interno */\n /* Muestro el botón firmar o deshacer firma si el Usuario activo es jefe y la oficina orígen es la oficina del usuario activo . */\n if($this->_usuario->jefe_de !== null and $fila['doc_dependencia_id'] == $this->_usuario->dependencia_id) {\n if(!$fila['firma']) { \n $boton = \"<div><button type='button' onclick='firmar($documento_id)' >Firmar</button></div>\";\n } else {\n $boton = \"<div><button type='button' onclick='deshacer_firma($documento_id)' >Retirar Firma</button></div>\";\n }\n }\n\n }\n }\n \n }\n\n /* Fin: Preparo botón para firma o deshacer firma */ \n \n $linkVerArchivo = '';\n if($fila['archivo']){\n $linkVerArchivo = \"<a target='_blank' href='/uploads/\".$fila['archivo'].\"'><span class='ui-icon ui-icon-document'></span></a>\";\n } else {\n /* Si es Documento interno */\n if($fila['origen'] == 1){\n if($fila['clasificacion_id'] <> 22){ /* Si es diferente de \"Confidencial\", podrá verse el documento */\n $linkVerArchivo = \"<a target='_blank' href='$urlrptDocumento' ><span class='ui-icon ui-icon-document'></span></a>\";\n }\n\n $linkVerArchivo .= $boton;\n \n }\n }\n\n \n /* Para mostrar tambien los archivos subidos */\n $linkVerArchivo .= $fila['archivos'];\n \n $response->rows[$i]['id'] = $id;\n $response->rows[$i]['cell'] = array($linkEdita, $fila['dependencia_origen'], $fila['firma'], \n $fila['cargo'], $fila['documento'], $fila['fecha_documento'],\n $fila['asunto'],$linkVerArchivo, $derivadoA,\n $fila['acciones'], $fila['tipomovimiento_id'], $fila['origen'], $fila['tipo']);\n $i++;\n }\n \n $this->_helper->json($response); /* */\n }", "public function search()\n {\n $this->crud->hasAccessOrFail('list');\n\n $this->crud->applyUnappliedFilters();\n\n $totalRows = $this->crud->baseQuery->count();\n $filteredRows = $this->crud->count();\n $startIndex = request()->input('start') ?: 0;\n // if a search term was present\n if (request()->input('search') && request()->input('search')['value']) {\n // filter the results accordingly\n $this->crud->applySearchTerm(request()->input('search')['value']);\n // recalculate the number of filtered rows\n $filteredRows = $this->crud->count();\n }\n // start the results according to the datatables pagination\n if (request()->input('start')) {\n $this->crud->skip((int) request()->input('start'));\n }\n // limit the number of results according to the datatables pagination\n if (request()->input('length')) {\n $this->crud->take((int) request()->input('length'));\n }\n // overwrite any order set in the setup() method with the datatables order\n if (request()->input('order')) {\n $column_number = request()->input('order')[0]['column'];\n $column_direction = request()->input('order')[0]['dir'];\n $column = $this->crud->findColumnById($column_number);\n if ($column['tableColumn']) {\n // clear any past orderBy rules\n $this->crud->query->getQuery()->orders = null;\n // apply the current orderBy rules\n $this->crud->query->orderBy($column['name'], $column_direction);\n }\n\n // check for custom order logic in the column definition\n if (isset($column['orderLogic'])) {\n $this->crud->customOrderBy($column, $column_direction);\n }\n }\n\n // show newest items first, by default (if no order has been set for the primary column)\n // if there was no order set, this will be the only one\n // if there was an order set, this will be the last one (after all others were applied)\n $orderBy = $this->crud->query->getQuery()->orders;\n $hasOrderByPrimaryKey = false;\n collect($orderBy)->each(function ($item, $key) use ($hasOrderByPrimaryKey) {\n if (!isset($item['column'])) {\n return false;\n }\n\n if ($item['column'] == $this->crud->model->getKeyName()) {\n $hasOrderByPrimaryKey = true;\n\n return false;\n }\n });\n if (!$hasOrderByPrimaryKey) {\n $this->crud->query->orderByDesc($this->crud->model->getKeyName());\n }\n\n $entries = $this->crud->getEntries();\n\n return $this->crud->getEntriesAsJsonForDatatables($entries, $totalRows, $filteredRows,\n $startIndex);\n }", "protected function getAll() {}", "function fetchAllBlogPosts()\r\n{\r\n return showAllBlogPosts();\r\n}", "public function get_all ();", "public function listAction()\n {\n $this->denyAccessUnlessGranted('POST_LIST');\n\n $source = new Entity($this->get('opifer.form.post_manager')->getClass());\n\n $formColumn = new TextColumn(['id' => 'posts', 'title' => 'Form', 'source' => false, 'filterable' => false, 'sortable' => false, 'safe' => false]);\n $formColumn->manipulateRenderCell(function ($value, $row, $router) {\n return '<a href=\"'.$this->generateUrl('opifer_form_form_edit', ['id'=> $row->getEntity()->getForm()->getId()]).'\">'.$row->getEntity()->getForm()->getName().'</a>';\n });\n\n $viewAction = new RowAction('view', 'opifer_form_post_view');\n $viewAction->setRouteParameters(['id']);\n\n $deleteAction = new RowAction('delete', 'opifer_form_post_delete');\n $deleteAction->setRouteParameters(['id']);\n\n $grid = $this->get('grid');\n $grid->setId('posts')\n ->setSource($source)\n ->setDefaultOrder('id', 'desc')\n ->addColumn($formColumn, 2)\n ->addRowAction($viewAction)\n ->addRowAction($deleteAction);\n\n return $grid->getGridResponse('@OpiferCms/Backend/Post/list.html.twig');\n }", "public function index()\n {\n return Post::with('category:id,name,slug', 'user:id,name,email')\n ->select([\n 'id', 'title', 'slug', 'content', 'image', 'category_id', 'user_id'\n ])\n ->paginate(); // json_encode(Post::all());\n }", "public function getAction() {\r\n \t\r\n \t$data = $this->getMapper()->fetch($this->getRequest());\r\n \t\r\n \tif (is_array($data)) {\r\n \t\t$this->view->data = $data;\r\n \t} else {\r\n \t\t$this->view->data = $data->toArray();\r\n \t}\r\n \t$this->view->total = $this->getMapper()->rowCount();\r\n \treturn $this->view->data;\r\n }", "public function actionListOfData()\n {\n return Tag::getDataForAjax(Yii::$app->request->get());\n }", "public function index() {\n $this->data['posts'] = $this->blog_model->get_many_by(['status' => 1]);\n\n $this->template->build('public/blog/index', $this->data);\n }", "public function allAction() {\n /*\n * Get Role and Post quantity for each user from 3 table\n */\n /*\n $query = $this->getEntityManager()->createQuery(\"SELECT \n u.id as ID, \n u.userNicename as user_nicename, \n u.displayName as display_name, \n u.userEmail as user_email, \n p.postType as post_type,\n um.metaValue as meta_value, \n COUNT( p.postType ) AS quantity\n FROM Cms\\Entity\\WpUsers AS u\n LEFT JOIN Cms\\Entity\\WpPosts AS p WITH u = p.postAuthor\n LEFT JOIN Cms\\Entity\\WpUsermeta as um WITH um.user = u\n WHERE (um.metaKey='wp_capabilities')\n GROUP BY p.postType\"); // (p.postType = 'post' OR p.postType is null) AND\n $res = $query->getResult(\\Doctrine\\ORM\\Query::HYDRATE_ARRAY); //HYDRATE_SCALAR: return combination of tables, HYDRATE_ARRAY: return only rows from 1 table\n */\n \n $res = $this->getEntityManager()->getRepository('Cms\\Entity\\WpUsers')->findAll();\n \n $arrayAdapter = new \\Zend\\Paginator\\Adapter\\ArrayAdapter($res);\n $paginator = new Paginator($arrayAdapter); \n\n if ($this->params()->fromRoute('id')) $pageIndex = $this->params()->fromRoute('id', 1);\n $paginator->setCurrentPageNumber((int)$pageIndex)->setItemCountPerPage(POST_QUANTITY_IN_A_PAGE);\n\n /*\n * Get user quantity for every user's type\n */\n $users = $this->getEntityManager()->createQuery(\"SELECT um.metaValue as meta_value, count(um.user) as quantity\n FROM Cms\\Entity\\WpUsers AS u\n JOIN Cms\\Entity\\WpUsermeta as um WITH um.user = u\n WHERE (um.metaKey='wp_capabilities')\n GROUP BY um.metaValue\")->getResult(\\Doctrine\\ORM\\Query::HYDRATE_ARRAY); //u.id\n $admins_quantity = 0;\n $editors_quantity = 0;\n $authors_quantity = 0;\n $contributors_quantity = 0;\n $subscribers_quantity = 0;\n foreach ($users as $key => $user) {\n if (strpos($user['meta_value'], 'administrator')!== false) $admins_quantity = (int)$user['quantity'];\n elseif (strpos($user['meta_value'], 'editor')!== false) $editors_quantity = (int)$user['quantity'];\n elseif (strpos($user['meta_value'], 'author')!== false) $authors_quantity = (int)$user['quantity'];\n elseif (strpos($user['meta_value'], 'contributor')!== false) $contributors_quantity = (int)$user['quantity'];\n elseif (strpos($user['meta_value'], 'subscriber')!== false) $subscribers_quantity = (int)$user['quantity'];\n }\n\n return new ViewModel(array(\n 'users' => $paginator, // $posts,\n 'all_quantity' => $paginator->getTotalItemCount(), //$paginator->getItemCount(),\n 'admins_quantity' => $admins_quantity,\n 'editors_quantity' => $editors_quantity,\n 'authors_quantity' => $authors_quantity,\n 'contributors_quantity' => $contributors_quantity,\n 'subscribers_quantity' => $subscribers_quantity,\n ));\n }", "public function indexAction()\n {\n $source = new Entity('AdminBundle:RefrendaAct','grupo_refrenda');\n \n $grid = $this->get('grid');\n \n $grid->setId('grid_refrenda');\n $grid->setSource($source); \n\n //Columnas para filtrar\n $NombrePlazas = new TextColumn(array('id' => 'plazas','source' => true,'field'=>'idplaza.nombreplaza','title' => 'Plazas','operatorsVisible'=>false));\n $grid->addColumn($NombrePlazas,2); \n \n // Mostrar\n $rowAction1 = new RowAction('Consultar', 'refrendaact_show');\n $rowAction1->manipulateRender(\n function ($action, $row)\n {\n $action->setRouteParameters(array('id','tipogrid'=> 1));\n return $action;\n }\n );\n $grid->addRowAction($rowAction1);\n\n $grid->setDefaultOrder('partida', 'asc');\n $grid->setLimits(array(10 => '10', 20 => '20', 30 => '30'));\n \n // Incluimos camino de migas\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem(\"Inicio\", $this->get(\"router\")->generate(\"hello_page\"));\n $breadcrumbs->addItem(\"Expediente\", $this->get(\"router\")->generate(\"pantalla_modulo\",array('id'=>1)));\n $breadcrumbs->addItem(\"Empleado activo\", $this->get(\"router\")->generate(\"pantalla_empleadoactivo\"));\n $breadcrumbs->addItem(\"Consultar puestos\", \"\");\n \n return $grid->getGridResponse('ExpedienteBundle:RefrendaAct:index.html.twig');\n }", "public function actionList() {\n $models = Post::model()->findAll();\n $rows = array();\n foreach($models as $model) \n $rows[] = $model->attributes;\n\t\t$data_response = array(\n\t\t\t'error'=> array('status'=>200, 'message'=>''),\n\t\t\t'datas'=>$rows\n\t\t);\n $this->response($data_response);\n }", "public function indexData()\n {\n $tickets = Ticket::with('provider', 'client')->where('type', 'admin');\n $url = url('/backend/tickets/');\n return Datatables::of($tickets)\n ->addColumn('action', function ($ticket) use($url) {\n return '<a href=\"'.$url.'/'.$ticket->id.'\" class=\"btn btn-success m-btn m-btn--icon\">\n <span><i class=\"fa fa-eye\"></i><span>View</span></span></a>';\n })\n ->editColumn('status', function ($ticket) use($url) {\n if($ticket->status == 'opened'){\n return '<label class=\"m-badge m-badge--default m-badge--wide\">Opened</label>';\n }else{\n return '<label class=\"m-badge m-badge--success m-badge--wide\">Closed</label>';\n }\n })\n ->editColumn('client', function ($ticket) use($url) {\n if($ticket->client_id != null){\n return $ticket->client->first_name . ' ' . $ticket->client->last_name;\n }else{\n return '--';\n }\n })\n ->editColumn('provider', function ($ticket) use($url) {\n if($ticket->provider_id != null){\n return $ticket->provider->first_name . ' ' . $ticket->provider->last_name;\n }else{\n return '--';\n }\n })\n ->rawColumns(['action', 'status'])\n ->make(true);\n }", "public function indexAction() {\n\t\t$this->_model->where_clause(NULL);\n\n\t\tif(!isset($this->params['page'])) {\n\t\t\tself::$params['page'] = 1;\n\t\t} \n\n\t\t$this->_view->data['info'] = $this->_model->getPage($this->params['page'], $this->config->pagination_limit);\n\t\t$this->_view->data['total_items'] = $this->_model->getCount();\n\t\t$this->addModuleTemplate($this->module, 'index');\n\n\t}", "abstract protected function getRows();", "public function __getData() {\n $qb = $this->entity->listQuery();\n\t$qb = $this->setArchiveStatusQuery($qb);\n $data = $this->entity->dtGetData($this->getRequest(), $this->columns, null, $qb);\n foreach ($data['data'] as $key => $val) {\n $id= \\Application\\Library\\CustomConstantsFunction::encryptDecrypt('encrypt', $val['action']['id']);\n\t $data['data'][$key]['protocol'] .= '<input type=\"checkbox\" class=\"unique hide\" value=\"'.$id.'\">';\n $data['data'][$key]['start_date'] = (isset($val['start_date'])) ? DateFunction::convertTimeToUserTime($val['start_date']) : '-';\n $studyPricingObj = $this->entity->getEntityObj($val['action']['pricingid'], 'Application\\Entity\\PhvStudyPricing');\n $data['data'][$key]['cro'] = $studyPricingObj->getCro()->getCompanyName();\n if (empty($data['data'][$key]['cro'])) {\n $data['data'][$key]['cro'] = '-';\n }\n $btnLabel = $this->translate('Archive');\n $textMessage = $this->translate('Are you sure you want to archive study?');\n if ($val['action']['status'] == 3) {\n $btnLabel = $this->translate('Unarchive');\n $textMessage = $this->translate('Are you sure you want to unarchive study?');\n }\n \n if ($data['data'][$key]['status'] != 2 && $this->currentUser->getRole()->getId() == 2) {\n $data['data'][$key]['action'] = \"<button class='tabledit-edit-button btn btn-sm btn btn-rounded btn-inline btn-primary-outline' onclick='showModal(\\\"\" . $id . \"\\\",\\\"\" . $textMessage . \"\\\")' type='button' value='1'>\" . $btnLabel . \"</button>&nbsp;\";\n } \n $data['data'][$key]['status'] = $this->entity->setStatusText($val['action']['status']);\n }\n\n return $data;\n }", "public function indexAction(): object\n {\n // Sets webpage title\n $title = \"Show all content with sorting and pagination\";\n\n // Sets extended webpage title\n $titleExtended = \" | Eshop\";\n\n // Framework variables\n $response = $this->app->response;\n $session = $this->app->session;\n\n // Verifies if user is logged in\n if (!$session->get(\"loggedIn\")) {\n $response->redirect(\"eshop/login\");\n };\n\n // Retrieves title\n $searchTitle = getGet(\"searchTitle\") ?? null;\n\n // Connects to db\n $this->app->db->connect();\n\n if ($searchTitle) {\n // Fetches data from db and stores in $resultset\n $resultset = $this->admin->getItem($searchTitle);\n } else {\n // Get number of hits per page\n $hits = getGet(\"hits\", 8);\n if (!(is_numeric($hits) && $hits > 0 && $hits <= 8)) {\n die(\"Not valid for hits.\");\n }\n\n // Get max number of pages\n $max = $this->admin->getMaxNumberOfItems();\n $max = ceil($max[0]->max / $hits);\n\n // Get current page\n $page = getGet(\"page\", 1);\n if (!(is_numeric($hits) && $page > 0 && $page <= $max)) {\n die(\"Not valid for page.\");\n }\n\n $offset = $hits * ($page - 1);\n\n // Only these values are valid\n $columns = [\"id\", \"title\", \"type\", \"published\", \"created\", \"updated\", \"deleted\"];\n $orders = [\"asc\", \"desc\"];\n\n // Get settings from GET or use defaults\n $orderBy = getGet(\"orderby\") ?: \"id\";\n $order = getGet(\"order\") ?: \"asc\";\n\n // Incoming matches valid value sets\n if (!(in_array($orderBy, $columns) && in_array($order, $orders))) {\n die(\"Not valid input for sorting.\");\n }\n\n // Calls sortBlogposts method and stores data in $resultset\n $resultset = $this->admin->sortItems($orderBy, $order, $hits, $offset);\n }\n\n // Data array\n $data = [\n \"title\" => $title,\n \"titleExtended\" => $titleExtended,\n \"resultset\" => $resultset,\n \"max\" => $max ?? null,\n \"searchTitle\" => $searchTitle\n ];\n\n // Includes admin header\n $this->app->page->add(\"content/header_admin\");\n\n // Adds route and sends data array to view\n $this->app->page->add(\"content/admin\", $data);\n\n // Renders page\n return $this->app->page->render($data);\n }", "public function index() {\r\n $conditions = array();\r\n $data = empty($this->request->data)?$this->request->params['named']:$this->request->data;\r\n if(!empty($data))\r\n { $conditions = array('Customer.nome ilike'=>'%'.$data['search'].'%'); }\r\n \r\n $this->Customer->recursive = 0;\r\n $this->set('customers', $this->paginate('Customer', $conditions));\r\n $this->set('args', $data);\r\n }", "public function getAll() {}", "public function getAll() {}", "public function getAll() {}", "public function index()\n {\n $this->paginate = array(\n 'all',\n 'conditions' => array('$or' => array(\n array('table' => null),\n array('table' => array('$exists' => false))\n ))\n );\n $contentVariables = $this->paginate('ContentVariable');\n $this->set(compact('contentVariables', $contentVariables));\n }", "public function getAll() {}", "public function getAll() {}", "public function getall(Request $request)\n {\n\n $schools = School::orderby('id', 'desc');\n $schools = $schools->get();\n return DataTables::of($schools)\n ->addColumn('action', function ($q) {\n $id = $q->id;\n\n $return = '<a class=\"btn btn-primary btn-sm openclientview\" data-toggle=\"modal\" data-school_id=\"'.$id.'\" data-typeid=\"\" data-target=\".view_detail\" href=\"#\"><i class=\"fas fa-folder\"></i> </a>';\n if(checkPermission(['super_admin'])){\n $return .= ' <a title=\"Edit\" data-id=\"'.$id.'\" data-toggle=\"modal\" data-target=\".add_modal\" class=\"btn btn-info btn-sm openaddmodal\" href=\"javascript:void(0)\"><i class=\"fas fa-pencil-alt\"></i> </a>';\n\n /*$return .= ' <a class=\"btn btn-danger btn-sm delete_record\" data-id=\"'.$q->id.'\" href=\"javascript:void(0)\"> <i class=\"fas fa-trash\"></i> </a>';\n*/\n $return .= ' <a class=\"btn btn-primary btn-sm opencommission\" data-toggle=\"modal\" data-school_id=\"'.$id.'\" data-typeid=\"\" data-target=\".add_commision\" href=\"#\"><i class=\"fas fa-plus\"></i> </a> ';\n }\n\n return $return;\n })\n ->addColumn('image', function ($q) {\n $image = url('public/company/employee/default.png'); \n if(file_exists(public_path().'/company/employee/'.$q->p_image) && !empty($q->p_image)) :\n $image = url('public/company/employee/'.$q->p_image); \n endif;\n return '<img class=\"profile-user-img img-fluid\" src=\"'.$image.'\" style=\"width:50px; height:50px;\">';\n }) \n\n ->addColumn('name', function ($q) {\n return $q->name;\n })\n\n ->addColumn('city', function ($q) {\n return $q->city->name;\n })\n \n ->addIndexColumn()\n ->rawColumns(['image','status', 'action'])->make(true);\n }", "function get_all(){\r\n\t\t$rows = array();\r\n\t\twhile($row = $this->get_row()){\r\n\t\t\t$rows[] = $row;\r\n\t\t}\r\n\t\treturn $rows;\r\n\t}", "public static function fetch_all($params) {}", "public function index()\n {\n return Bien::paginate(3);\n }", "public function admin_index()\n {\n $this->Redirect->urlToNamed();\n\n // Sets Search Parameters\n $conditions = $this->getSearchConditions(array(\n array('model' => $this->modelClass, 'field' => \"name\", 'type' => 'string', 'view_field' => 'name'),\n ));\n \n $this->paginate[\"limit\"] = 20;\n $records = $this->paginate($this->modelClass, $conditions);\n \n //setting variables\n $this->set(compact('records')); \n }", "public function index(Request $request)\n {\n\t\t$query=null;\n\t\t$aciunta=\"\";\n\t\t\n\t\tif ($request->filled('order')) {\n\t\t\t$by=$request->order;\n\t\t\t$dir=$request->dir;\n\t\t\t\n\t\t} else {\n\t\t\t$by='id';\n\t\t\t$dir='asc';\n\t\t}\n\t\t\n \t$items = QueryModel::orderBy($by, $dir)->paginate(config('labimus.options.option_paginate'));\n\t\t\t\t\n $det=$this->det;\n $noadd=true;\n \n\t\tif (($request->has('page'))&&($request->ajax())) {\n\t\t\treturn view('query_rows',compact('items','det','aciunta','query'));\n\t\t} \n\t\telseif ($request->ajax())\n\t\t{\t\t\t\t\t\n\t\t\treturn view('layouts/table2',compact('items','det','aciunta','query','noadd'));\n\t\t}\n }", "function admin_index()\n {\n $perPage = 100;\n $this->lordModel('Post');\n $condition = array('type' => 'post');\n $d['posts'] = $this->Post->find(array(\n 'condition' => $condition,\n 'limit' => ($perPage * ($this->request->page - 1)) . ',' . $perPage\n ));\n $d['total'] = $this->Post->findCount($condition);\n $d['nbrPage'] = ceil($d['total'] / $perPage);\n //print_r($d);\n $this->setvars($d);\n //$this->setvars('phrase', 'bienvenue sur ma page');\n //$this->render('view');\n }", "public function getAllRecords();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();" ]
[ "0.67892647", "0.63651437", "0.6339406", "0.62565047", "0.6231803", "0.6097168", "0.60956466", "0.59888613", "0.59446675", "0.5929927", "0.5929927", "0.59069574", "0.58724004", "0.58528715", "0.58291197", "0.58230424", "0.58177394", "0.58005977", "0.5784119", "0.5784118", "0.57664967", "0.5759099", "0.5748999", "0.5747111", "0.5744909", "0.57440156", "0.57265335", "0.57257557", "0.57201785", "0.5719551", "0.5718797", "0.57172096", "0.57140803", "0.57038367", "0.5700808", "0.56959367", "0.56855947", "0.5677631", "0.5676064", "0.56745535", "0.56737334", "0.56719124", "0.56705403", "0.56652015", "0.566517", "0.566438", "0.56619626", "0.56577075", "0.56514984", "0.5650339", "0.5645584", "0.5643912", "0.5642838", "0.56424", "0.5642146", "0.56412643", "0.5637839", "0.56370205", "0.5629911", "0.562445", "0.5612795", "0.560491", "0.5602536", "0.55962646", "0.5595637", "0.55941945", "0.5593885", "0.55917966", "0.55917966", "0.55917966", "0.55891293", "0.55888623", "0.55888623", "0.558875", "0.55879295", "0.55823296", "0.5582255", "0.5579908", "0.55780536", "0.5576249", "0.5576021", "0.55737746", "0.55737746", "0.55737746", "0.55737746", "0.55737746", "0.55737746", "0.55737746", "0.55737746", "0.55737746", "0.55737746", "0.55737746", "0.55737746", "0.55737746", "0.55737746", "0.55737746", "0.55737746", "0.55737746", "0.55737746", "0.55737746" ]
0.648794
1
Action data get data on certain fields of the table. This data placed in the ComboBox, to edit these table fields Access to the action is possible in the following paths: /admin/blog/data
public function dataAction() { parent::dataAction(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function load_field(){\r\n $this->layout=\"ajax\";\r\n $module=$_POST['module'];\r\n $this->loadModel($module);\r\n $field_names= Set::extract('/COLUMNS/Field',$this->$module->query(\"DESCRIBE {$this->$module->useTable}\"));\r\n $field= array_combine($field_names, $field_names);\r\n $this->set(compact('field'));\r\n }", "function listPage_tableField(){\n $this->data_view['tableField'] = array(\n array('name'=>'id','title'=>'Mã'),\n array('name'=>'image','title'=>'Hình','type'=>'image','linkDetail'=>true),\n array('name'=>'title','title'=>'Tên','linkDetail'=>true),\n array('name'=>'c_title','title'=>'Loại'),\n array('name'=>'price','title'=>'Giá','type'=>'number'),\n array('name'=>'price_promotion','title'=>'Giá giảm','type'=>'number','hidden'=>true),\n array('name'=>'views','title'=>'Lượt xem','type'=>'number'),\n array('name'=>'is_active','title'=>'Trạng thái','type'=>'status'),\n array('name'=>'is_stock','title'=>'Còn hàng','type'=>'status','hidden'=>true),\n array('name'=>'is_special','title'=>'Nổi bật','type'=>'status','hidden'=>true)\n );\n }", "public function __getData() {\n $qb = $this->entity->listQuery();\n\t$qb = $this->setArchiveStatusQuery($qb);\n $data = $this->entity->dtGetData($this->getRequest(), $this->columns, null, $qb);\n foreach ($data['data'] as $key => $val) {\n $id= \\Application\\Library\\CustomConstantsFunction::encryptDecrypt('encrypt', $val['action']['id']);\n\t $data['data'][$key]['protocol'] .= '<input type=\"checkbox\" class=\"unique hide\" value=\"'.$id.'\">';\n $data['data'][$key]['start_date'] = (isset($val['start_date'])) ? DateFunction::convertTimeToUserTime($val['start_date']) : '-';\n $studyPricingObj = $this->entity->getEntityObj($val['action']['pricingid'], 'Application\\Entity\\PhvStudyPricing');\n $data['data'][$key]['cro'] = $studyPricingObj->getCro()->getCompanyName();\n if (empty($data['data'][$key]['cro'])) {\n $data['data'][$key]['cro'] = '-';\n }\n $btnLabel = $this->translate('Archive');\n $textMessage = $this->translate('Are you sure you want to archive study?');\n if ($val['action']['status'] == 3) {\n $btnLabel = $this->translate('Unarchive');\n $textMessage = $this->translate('Are you sure you want to unarchive study?');\n }\n \n if ($data['data'][$key]['status'] != 2 && $this->currentUser->getRole()->getId() == 2) {\n $data['data'][$key]['action'] = \"<button class='tabledit-edit-button btn btn-sm btn btn-rounded btn-inline btn-primary-outline' onclick='showModal(\\\"\" . $id . \"\\\",\\\"\" . $textMessage . \"\\\")' type='button' value='1'>\" . $btnLabel . \"</button>&nbsp;\";\n } \n $data['data'][$key]['status'] = $this->entity->setStatusText($val['action']['status']);\n }\n\n return $data;\n }", "public function actionData()\n {\n// \n// $connector->configure(new Grid(), \"event_id\", \"start_date, end_date, event_name\");\n// $connector->render();\n\n return new Grid();\n }", "function field(){\n\t\t\t$this->aah->check_access();\n\n\t\t\t$nav_id = $this->aah->get_nav_id(__CLASS__.'/field');\n\t\t\t$read_access = $this->aah->check_privilege('read',$nav_id);\n\t\t\t$add_access = $this->aah->check_privilege('add',$nav_id);\n\n\t\t\tif($read_access)\n\t\t\t{\n\t\t\t\t$this->global_model->reinitialize_dao();\n\t\t\t\t$dao = $this->global_model->get_dao();\n\t\t\t\t$data['active_url'] = str_replace('::','/',__METHOD__);\n\t\t\t\t$data['dt2_rows'] = $dao->execute(0,\"SELECT * FROM ref_dt2 WHERE provinsi_id='\".$this->_SYS_PARAMS[1].\"'\")->result_array();\n\t\t\t\t$data['form_id'] = \"search-school-form\";\n\t\t\t\t$data['active_controller'] = $this->active_controller;\n\t\t\t\t$data['containsTable'] = true;\n\t\t\t\t$data['add_access'] = $add_access;\n\t\t\t\t$this->backoffice_template->render($this->active_controller.'/field/index',$data);\n\t\t\t}else{\n\t\t\t\t$this->error_403();\n\t\t\t}\n\t\t}", "public function getPageData() {\n\t\t//$stat = Statistic::select(array('statistic.id', 'statistic.created_at','category.category_name', 'statistic.ip_address'))\n\t\t//->join('category','statistic.category_id','=','category.id'); \n\t\t$stat = StatView::select(array('id','date','category_name', 'ip_address'));\n\n\t\treturn Datatables::of($stat) \n\t\t-> add_column('actions','<a href=\"{{{ URL::to(\\'admin/blogs/\\' . $id . \\'/delete\\' ) }}}\" class=\"btn btn-xs btn-danger iframe\">{{{ Lang::get(\\'button.delete\\') }}}</a>') \n -> remove_column('id') -> make();\n\n\t}", "public function postAction()\n {\n // $this->view->blog = $Blog->fetchAll();\n \n }", "public function editAction() {}", "public function admin_index() {\r\n\t\t$this->data = $this->{$this->modelClass}->find('all');\r\n }", "public function editAction()\n {\n parent::editAction();\n $this->_fillMappingsArray();\n $this->_fillAvailableProperties();\n }", "public function edit()\n\t{\n\t\t\n\t\t$sql = SqlQuery::getInstance();\n\t\t\n\t\t$tbl = new AbTable(\"SELECT u.first_name, u.last_name, u.zip, c.* FROM IBO_camp c JOIN user u ON u.id = c.user_id\",array('user_id'));\n\t\t\n\t\treturn $tbl->getHtml();\n\t\t\n\t\t\n\t}", "function list_field_views_data($field) {\n $data = field_views_field_default_views_data($field);\n foreach ($data as $table_name => $table_data) {\n foreach ($table_data as $field_name => $field_data) {\n if (isset($field_data['filter']) && $field_name != 'delta') {\n $data[$table_name][$field_name]['filter']['handler'] = 'views_handler_filter_field_list';\n }\n if (isset($field_data['argument']) && $field_name != 'delta') {\n if ($field['type'] == 'list_text') {\n $data[$table_name][$field_name]['argument']['handler'] = 'views_handler_argument_field_list_string';\n }\n else {\n $data[$table_name][$field_name]['argument']['handler'] = 'views_handler_argument_field_list';\n }\n }\n }\n }\n return $data;\n}", "public function listdataAsetAction() {\n $this->view->dataList = $this->adm_listdata_serv->getDataList('ASET');\n }", "protected function data(){\nEditor::inst( $db, 'datatables_demo' )\n ->fields(\n Field::inst( 'product_name' )->validator( 'Validate::notEmpty' ),\n Field::inst( 'quantity_in_stock' )\n ->validator( 'Validate::numeric' )\n ->setFormatter( 'Format::ifEmpty', null ),\n\t\tField::inst( 'product_price' )\n ->validator( 'Validate::numeric' )\n ->setFormatter( 'Format::ifEmpty', null ),\n\t\t Field::inst( 'date' )\n ->validator( 'Validate::dateFormat', array(\n \"format\" => Format::DATE_ISO_8601,\n \"message\" => \"Please enter a date in the format yyyy-mm-dd\"\n ) )\n ->getFormatter( 'Format::date_sql_to_format', Format::DATE_ISO_8601 )\n ->setFormatter( 'Format::date_format_to_sql', Format::DATE_ISO_8601 ),\n\t\t\tField::inst( 'total' )\n ->validator( 'Validate::numeric' )\n ->setFormatter( 'Format::ifEmpty', null )\t\n )\n ->process( $_POST )\n ->json();\n\t\t\n\t\t\n\t\t\n\t}", "public function doData() {\n\t\t\t$dataSet = array();\n\t\t\t$dataSet['attribute:type'] = $this->dataType;\n\t\t\t$dataSet['attribute:action'] = $this->actionType;\n\n\t\t\tif($this->total) {\n\t\t\t\t$dataSet['attribute:total'] = $this->total;\n\n\t\t\t\tif(!is_null($this->offset)) {\n\t\t\t\t\t$dataSet['attribute:offset'] = $this->offset;\n\t\t\t\t}\n\n\t\t\t\tif(!is_null($this->limit)) {\n\t\t\t\t\t$dataSet['attribute:limit'] = $this->limit;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$dataSet = array_merge($dataSet, $this->data);\n\n\t\t\tcmsController::getInstance()->setAdminDataSet($dataSet);\n\t\t}", "function beneficiariesView_views_data()\n{\n $data = array();\n\n $data['aj_registration']['table']['group'] = t('Registration');\n\n $data['aj_registration']['table']['base'] = array(\n 'title' => t('Registration'),\n 'help' => t('This is data from the aj_registration table.'),\n );\n\n $data['aj_registration']['table']['join'] = array(\n 'eck_provider' => array(\n 'left_field' => 'id',\n 'field' => 'provider_id',\n ),\n );\n\n\n// The ID field\n$data['aj_registration']['uuid'] = array(\n\t'group' => t('Registration'),\n 'title' => t('UUID'),\n 'help' => t('The beneficiary UUID.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n// The nombre field\n$data['aj_registration']['nombre'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Nombre'),\n 'help' => t('The beneficiary name.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t 'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n// The apellido field\n$data['aj_registration']['apellido'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Apellido'),\n 'help' => t('The beneficiary surname.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n\n// The apodo field\n$data['aj_registration']['apodo'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Apodo'),\n 'help' => t('The beneficiary nickname.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n// The Estecolateralparticipante field\n$data['aj_registration']['Estecolateralparticipante'] = array(\n\t'group' => t('Registration'),\n 'title' => t('¿Indirecto?'),\n 'help' => t('The beneficiary type.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n\n// The DOB field\n$data['aj_registration']['DOB'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Fecha de Nacimiento'),\n 'help' => t('The beneficiary date of birth.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_date',\n ),\n);\n\n\n// The Fecha field\n$data['aj_registration']['Fecha'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Fecha de Registro'),\n 'help' => t('The Beneficiary date of registration.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_date',\n ),\n);\n\n\n\n// The provider_name field\n$data['aj_registration']['provider_name'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Organización name'),\n 'help' => t('The organización name.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n\n// The provider_id field\n$data['aj_registration']['provider_id'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Esto es provider_id'),\n 'help' => t('The organización ID.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_numeric',\n ),\n 'relationship' => array(\n 'base' => 'eck_provider',\n 'base field' => 'id',\n \t 'field' => 'provider_id',\n 'handler' => 'views_handler_relationship',\n 'label' => t('aj_registration retlation'),\n \t 'help' => t('This is the relationship with aj_registration and eck_provider'),\n \t 'title' => t('aj_registration relationship'),\n ),\n 'argument' => array(\n 'handler' => 'views_handler_argument',\n 'numeric' => TRUE,\n ),\n);\n return $data;\n}", "public function _editAction() {\n\t\t\n\t\t$args = $this->getAllArguments ();\n\t\t\n\t\tif (array_key_exists ( 'cid', $args )) {\n\t\t\t$action_id = $args ['cid'] [0];\n\t\t} else {\n\t\t\t$action_id = @$args [3] ? @$args [3] : $args [1];\n\t\t}\n\t\t\n\t\t$field = $this->getModel ( 'field' );\n\t\t$field->getAllWhere ( 'form_id = \"' . ( int ) $this->_getFormId () . '\"' );\n\t\t\n\t\t$action = $this->getModel ( 'action' );\n\t\t$action->get ( ( int ) $action_id );\n\t\t\n\t\t$this->loadPluginModel ( 'actions' );\n\t\t\n\t\t$this->setView ( 'edit_action' );\n\t\n\t}", "public function listdataAction() {\n $this->view->dataList = $this->adm_listdata_serv->getDataList('%');\n }", "function index_post() {\n $this->crud_post($this->post());\n }", "public function views_data() {\n $data = parent::views_data();\n //dsm($data);\n $data['tincan_statement']['stored'] = array(\n 'title' => t('Stored'),\n 'help' => t('Stored date value, the date the statement was stored'),\n 'field' => array(\n 'handler' => 'tincan_lrs_handler_field_datetime',\n 'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'tincan_lrs_handler_sort_date',\n ),\n 'filter' => array(\n 'handler' => 'tincan_lrs_handler_filter_datetime',\n ),\n 'argument' => array(\n 'handler' => 'views_handler_argument_tincanlrs_fulldate',\n ),\n );\n $data['tincan_statement']['timestamp'] = array(\n 'title' => t('Timestamp'),\n 'help' => t('Timestamp of the statement'),\n 'field' => array(\n 'handler' => 'tincan_lrs_handler_field_datetime',\n 'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'tincan_lrs_handler_sort_date',\n ),\n 'filter' => array(\n 'handler' => 'tincan_lrs_handler_filter_datetime',\n ),\n 'argument' => array(\n 'handler' => 'views_handler_argument_tincanlrs_fulldate',\n ),\n );\n return $data;\n }", "function get_actions_data() {\n\t\t$actions_data = $this->get_meta( 'actions' );\n\t\treturn is_array( $actions_data ) ? array_map( [ $this, 'format_action_fields' ], $actions_data ) : [];\n\t}", "function listPage_quickAction(){\n $this->data_view['dataTable']['quickAction'] = array(\n array('action'=>$this->_table.'/set_status/is_active/0','title'=>'Ẩn','popup'=>false),\n array('action'=>$this->_table.'/set_status/is_active/1','title'=>'Hiện','popup'=>false),\n array('action'=>$this->_table.'/delete_popup','title'=>'Xóa','popup'=>true),\n array('action'=>$this->_table.'/tag_popup/create','title'=>'Thêm tag','popup'=>true),\n array('action'=>$this->_table.'/tag_popup/delete','title'=>'Xóa tag','popup'=>true),\n array('action'=>$this->_table.'/cate_popup/create','title'=>'Thêm vào danh mục','popup'=>true),\n array('action'=>$this->_table.'/cate_popup/delete','title'=>'Xóa khỏi danh mục','popup'=>true),\n );\n }", "public function annimalEditAction()\n {\n }", "public function actionIndex()\n {\n $field_value = \\common\\models\\FieldsValue::find()->all();\n\n foreach ($field_value as $item)\n {\n $new_value = new FieldsValueNew();\n $new_value->order = $item->order;\n $new_value->field_id = $item->field_id;\n $new_value->value = $item->value;\n\n if($item->card_id != null)\n {\n $new_value->item_type = 0;\n $new_value->item_id = $item->card_id;\n }\n if($item->balance_id != null)\n {\n $new_value->item_type = 3 ;\n $new_value->item_id = $item->balance_id;\n }\n if($item->project_id != null)\n {\n $new_value->item_type = 1;\n $new_value->item_id = $item->project_id;\n }\n if($item->company_id!= null)\n {\n $new_value->item_type = 2;\n $new_value->item_id = $item->company_id;\n }\n\n $new_value->save();\n }\n }", "public function data()\n {\n $article = PagesModel::join('article_categories', 'article_categories.id', '=', 'articles.article_category_id')\n ->select(array('articles.id','articles.title','article_categories.title as category',\n 'articles.created_at'));\n\n return Datatables::of($article)\n ->add_column('actions', '<a href=\"{{{ URL::to(\\'admin/article/\\' . $id . \\'/edit\\' ) }}}\" class=\"btn btn-success btn-sm iframe\" ><span class=\"glyphicon glyphicon-pencil\"></span> {{ trans(\"admin/modal.edit\") }}</a>\n <a href=\"{{{ URL::to(\\'admin/article/\\' . $id . \\'/delete\\' ) }}}\" class=\"btn btn-sm btn-danger iframe\"><span class=\"glyphicon glyphicon-trash\"></span> {{ trans(\"admin/modal.delete\") }}</a>\n <input type=\"hidden\" name=\"row\" value=\"{{$id}}\" id=\"row\">')\n ->remove_column('id')\n\n ->make();\n }", "function edit_columns_html($column, $post_id){\n \n switch($column){\n \n // Name\n case 'name':\n \n echo '<code style=\"font-size: 12px;\">' . $this->get_name($post_id) . '</code>';\n break;\n \n // Field Groups\n case 'field_groups':\n \n $return = '—';\n \n $field_groups = acf_get_array(get_field('acfe_form_field_groups', $post_id));\n \n if(!empty($field_groups)){\n \n $links = array();\n \n foreach($field_groups as $key){\n \n $field_group = acf_get_field_group($key);\n \n if(!$field_group)\n continue;\n \n if(acf_maybe_get($field_group, 'ID')){\n \n $links[] = '<a href=\"' . admin_url(\"post.php?post={$field_group['ID']}&action=edit\") . '\">' . $field_group['title'] . '</a>';\n \n }else{\n \n $links[] = $field_group['title'];\n \n }\n \n }\n \n $return = implode(', ', $links);\n \n }\n \n echo $return;\n break;\n \n // Actions\n case 'actions':\n \n $return = '—';\n \n $icons = array();\n \n if(have_rows('acfe_form_actions', $post_id)):\n while(have_rows('acfe_form_actions', $post_id)): the_row();\n \n // Custom\n if(get_row_layout() === 'custom'){\n \n $action_name = get_sub_field('acfe_form_custom_action');\n \n $icons[] = '<span class=\"acf-js-tooltip dashicons dashicons-editor-code\" title=\"Custom action: ' . $action_name . '\"></span>';\n \n }\n \n // E-mail\n elseif(get_row_layout() === 'email'){\n $icons[] = '<span class=\"acf-js-tooltip dashicons dashicons-email\" title=\"E-mail\"></span>';\n }\n \n // Post\n elseif(get_row_layout() === 'post'){\n \n $action = get_sub_field('acfe_form_post_action');\n \n // Insert\n if($action === 'insert_post'){\n $icons[] = '<span class=\"acf-js-tooltip dashicons dashicons-edit\" title=\"Create post\"></span>';\n }\n \n // Update\n elseif($action === 'update_post'){\n $icons[] = '<span class=\"acf-js-tooltip dashicons dashicons-update\" title=\"Update post\"></span>';\n }\n \n }\n \n // Term\n elseif(get_row_layout() === 'term'){\n \n $action = get_sub_field('acfe_form_term_action');\n \n // Insert\n if($action === 'insert_term'){\n $icons[] = '<span class=\"acf-js-tooltip dashicons dashicons-category\" title=\"Create term\"></span>';\n }\n \n // Update\n elseif($action === 'update_term'){\n $icons[] = '<span class=\"acf-js-tooltip dashicons dashicons-category\" title=\"Update term\"></span>';\n }\n \n }\n \n // User\n elseif(get_row_layout() === 'user'){\n \n $action = get_sub_field('acfe_form_user_action');\n \n // Insert\n if($action === 'insert_user'){\n $icons[] = '<span class=\"acf-js-tooltip dashicons dashicons-admin-users\" title=\"Create user\"></span>';\n }\n \n // Update\n elseif($action === 'update_user'){\n $icons[] = '<span class=\"acf-js-tooltip dashicons dashicons-admin-users\" title=\"Update user\"></span>';\n }\n \n // Update\n elseif($action === 'log_user'){\n $icons[] = '<span class=\"acf-js-tooltip dashicons dashicons-migrate\" title=\"Log user\"></span>';\n }\n \n }\n \n endwhile;\n endif;\n \n if(!empty($icons)){\n $return = implode('', $icons);\n }\n \n echo $return;\n break;\n \n // Shortcode\n case 'shortcode':\n \n echo '<code style=\"font-size: 12px;\">[acfe_form name=\"' . $this->get_name($post_id) . '\"]</code>';\n break;\n \n }\n \n }", "public function getEdit($data)\n {\n return array(\n 'Currency.name' => array('type' => 'text', 'label' => __(\"Name\")),\n 'Currency.code' => array('type' => 'text', 'label' => __(\"Code\")),\n 'Currency.rate' => array('type' => 'text', 'label' => __(\"Rate\"))\n );\n }", "public function listdataAdmAction() {\n $this->view->dataList = $this->adm_listdata_serv->getDataList('ADMINISTRASI SYSTEM');\n }", "public function setupdatafieldsAction()\n {\n $result = array('errors' => false, 'message' => '');\n $websiteParam = $this->getRequest()->getParam('website', 0);\n $website = Mage::app()->getWebsite($websiteParam);\n $apiModel = Mage::helper('ddg')->getWebsiteApiClient($website->getId());\n $redirectUrl = Mage::helper('adminhtml')->getUrl(\n 'adminhtml/system_config/edit', array(\n 'section' => 'connector_data_mapping'\n )\n );\n\n if (!$apiModel) {\n Mage::getSingleton('adminhtml/session')->addNotice(Mage::helper('ddg')->__('Please enable api first.'));\n } else {\n // get all possible datafields\n $datafields = Mage::getModel('ddg_automation/connector_datafield')->getContactDatafields();\n foreach ($datafields as $key => $datafield) {\n $response = $apiModel->postDataFields($datafield);\n\n //ignore existing datafields message\n if (isset($response->message) && $response->message !=\n Dotdigitalgroup_Email_Model_Apiconnector_Client::API_ERROR_DATAFIELD_EXISTS\n ) {\n $result['errors'] = true;\n $result['message'] .= ' Datafield ' . $datafield['name'] . ' - '. $response->message . '</br>';\n } else {\n if ($websiteParam) {\n $scope = 'websites';\n $scopeId = $website->getId();\n } else {\n $scope = 'default';\n $scopeId = '0';\n }\n\n //map the successfully created datafield\n $config = Mage::getModel('core/config');\n $config->saveConfig(\n 'connector_data_mapping/customer_data/' . $key, strtoupper($datafield['name']), $scope, $scopeId\n );\n Mage::helper('ddg')->log('successfully connected : ' . $datafield['name']);\n }\n }\n\n if ($result['errors']) {\n Mage::getSingleton('adminhtml/session')->addNotice($result['message']);\n } else {\n Mage::getConfig()->cleanCache();\n Mage::getSingleton('adminhtml/session')\n ->addSuccess(Mage::helper('ddg')->__('All Datafields Created And Mapped.'));\n }\n }\n\n $this->_redirectUrl($redirectUrl);\n }", "function webpinas_glf_data_table_handler()\n{\n global $wpdb;\n\n $table = new Custom_Table_webpinas_glf_Plugin();\n $table->prepare_items();\n\n $message = '';\n if ('delete' === $table->current_action()) {\n $message = '<div class=\"updated below-h2\" id=\"message\"><p>' . sprintf(__('Items deleted: %d', 'custom_table_example'), count($_REQUEST['id'])) . '</p></div>';\n }\n ?>\n\n<div class=\"wrap\">\n\n <div class=\"icon32 icon32-posts-post\" id=\"icon-edit\"><br></div>\n <h2><?php _e('Form Submissions')?> \n <!--<a class=\"add-new-h2\" href=\"<?php echo get_admin_url(get_current_blog_id(), 'admin.php?page=exc_quote_form');?>\"><?php _e('Add new', 'custom_table_example')?></a>-->\n </h2>\n <?php echo $message; ?>\n \n<!--<form method=\"get\">\n <input type=\"hidden\" name=\"page\" value=\"\">\n<?php $table->dropdown_search_user( __( 'Search User' ), 'user_sort' ); ?>\n</form>-->\n\n <form id=\"persons-table\" method=\"GET\">\n <input type=\"hidden\" name=\"page\" value=\"<?php echo $_REQUEST['page'] ?>\"/>\n <?php $table->display() ?>\n </form>\n\n</div>\n\n<?php \n}", "abstract public function fields(AdminRequest $request);", "public function editAction()\r\n {\r\n }", "function index($action = '') {\r\n\t\t$grid = new Grid;\t\t\r\n\t\t$grid->setTitle('List UPD Komparator');\t\t\r\n\t\t$grid->setTable('dossier.dossier_upd');\t\t\r\n\t\t$grid->setUrl('browse_upd_komparator');\r\n\t\t$grid->addList('pilih','vUpd_no','vNama_usulan','itemas.C_ITENO','itemas.C_ITNAM','tabmas02.c_nmlisen','cNip_pengusul','plc2_upb_team.vteam');\r\n\t\t$grid->setSortBy('vUpd_no');\r\n\t\t$grid->setSortOrder('DESC');\r\n\t\t$grid->setWidth('vUpd_no', '70');\r\n\t\t$grid->setWidth('itemas.C_ITENO', '70');\r\n\t\t$grid->setWidth('plc2_upb_team.vteam', '150');\r\n\t\t$grid->setWidth('pilih', '50');\r\n\r\n\t\r\n\t\t$grid->setLabel('vUpd_no', 'No Dossier');\r\n\t\t$grid->setLabel('vNama_usulan', 'Nama Usulan');\r\n\t\t$grid->setLabel('itemas.C_ITENO', 'Kode Produk');\r\n\t\t$grid->setLabel('cNip_pengusul', 'NIP Pengusul');\r\n\t\t$grid->setLabel('plc2_upb_team.vteam', 'Team Andev');\r\n\t\t$grid->setLabel('itemas.C_ITNAM', 'Nama Produk');\r\n\t\t$grid->setLabel('tabmas02.c_nmlisen', 'Lisensi');\r\n\r\n\t\t$grid->setAlign('pilih', 'center');\r\n\r\n\t\t$grid->setInputGet('field',$this->_field);\r\n\t\t$grid->hideTitleCol('pilih');\r\n\t\t$grid->notSortCol('pilih');\r\n\t\t$grid->setSearch('vUpd_no','vNama_usulan');\r\n\t\t$grid->setJoinTable('plc2.plc2_upb_team', 'plc2.plc2_upb_team.iteam_id = dossier.dossier_upd.iTeam_andev', 'inner');\r\n\t\t$grid->setJoinTable('plc2.itemas','dossier_upd.iupb_id=itemas.C_ITENO','inner');\r\n\t\t$grid->setJoinTable('plc2.tabmas02', 'tabmas02.c_lisensi = itemas.c_lisensi', 'inner');\t\r\n\t\t$grid->setQuery('dossier_upd.ihold', 0);\r\n\t\t$grid->setQuery('dossier_upd.lDeleted', 0);\r\n\r\n\t\t$nip=$this->user->gNIP;\r\n\t\tif($this->auth->is_manager()){\r\n\t\t\t$x=$this->auth->dept();\r\n\t\t\t$manager=$x['manager'];\r\n\t\t\tif(in_array('AD', $manager)){\r\n\t\t\t\t$type='AD';\r\n\t\t\t\t$grid->setQuery('dossier_upd.iTeam_andev IN ('.$this->auth->my_teams().')', null);\r\n\t\t\t}elseif(in_array('TD', $manager)){\r\n\t\t\t\t$type='TD';\r\n\t\t\t\t$sqlcek='select * from plc2.plc2_upb_team te where te.vnip=\"'.$nip.'\" and vtipe=\"TD\"';\r\n\t\t\t\t$r=$this->dbset->query($sql);\r\n\t\t\t\tif($r->num_rows>=1){\r\n\t\t\t\t\t$d=$r->row_array();\r\n\t\t\t\t\tif($d['iteam_id']==81){\r\n\t\t\t\t\t\t$grid->setQuery('dossier_upd.iTeam_andev IN (17)', null);\r\n\t\t\t\t\t}elseif ($d['iteam_id']==83) {\r\n\t\t\t\t\t\t$grid->setQuery('dossier_upd.iTeam_andev IN (40)', null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{$type='';}\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$x=$this->auth->dept();\r\n\t\t\t$team=$x['team'];\r\n\t\t\tif(in_array('AD', $team)){\r\n\t\t\t\t$type='AD';\r\n\t\t\t\t$grid->setQuery('dossier_upd.iTeam_andev IN ('.$this->auth->my_teams().')', null);\r\n\t\t\t}elseif(in_array('TD', $manager)){\r\n\t\t\t\t$type='TD';\r\n\t\t\t\t$sqlcek='select * from plc2.plc2_upb_team_item ite\r\n\t\t\t\t\tjoin plc2.plc2_upb_team te on te.iteam_id=ite.iteam_id\r\n\t\t\t\t\twhere ite.ldeleted=0 and te.ldeleted=0 and te.vtipe=\"TD\" and ite.vnip=\"'.$nip.'\"';\r\n\t\t\t\t$r=$this->dbset->query($sql);\r\n\t\t\t\tif($r->num_rows>=1){\r\n\t\t\t\t\t$d=$r->row_array();\r\n\t\t\t\t\tif($d['iteam_id']==81){\r\n\t\t\t\t\t\t$grid->setQuery('dossier_upd.iTeam_andev IN (17)', null);\r\n\t\t\t\t\t}elseif ($d['iteam_id']==83) {\r\n\t\t\t\t\t\t$grid->setQuery('dossier_upd.iTeam_andev IN (40)', null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{$type='';}\r\n\t\t}\r\n\t\t//Tidak muncul jika sudah di input di komparator\r\n\t\t$grid->setQuery('dossier_upd.idossier_upd_id not in (select kom.idossier_upd_id from dossier.dossier_komparator kom where kom.lDeleted=0)',NULL);\r\n\r\n\t\t//Approval review_dokumen\r\n\t\t$grid->setQuery('dossier_upd.idossier_upd_id in (select rev.idossier_upd_id from dossier.dossier_review rev where rev.lDeleted=0 and rev.iApprove_review=2)',NULL);\r\n\r\n\t\t$grid->setGridView('grid');\r\n\r\n\t\tswitch ($action) {\r\n\t\t\tcase 'json':\r\n\t\t\t\t$grid->getJsonData();\r\n\t\t\t\tbreak;\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\t$grid->render_grid();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n }", "public function getSelectDataFields();", "public function actionUpdate()\n\t{\n\t parent::actionUpdate();\n\t $dodetail=new Dodetail('search');\n\t $dodetail->unsetAttributes(); // clear any default values\n\t if(isset($_GET['Dodetail']))\n\t\t$dodetail->attributes=$_GET['Dodetail'];\n\n\t\t$customer=new Customer('search');\n\t $customer->unsetAttributes(); // clear any default values\n\t if(isset($_GET['Customer']))\n\t\t$customer->attributes=$_GET['Customer'];\n\n\t\t$product=new Product('search');\n\t $product->unsetAttributes(); // clear any default values\n\t if(isset($_GET['Product']))\n\t\t$product->attributes=$_GET['Product'];\n\n\t\t$unitofmeasure=new Unitofmeasure('search');\n\t $unitofmeasure->unsetAttributes(); // clear any default values\n\t if(isset($_GET['Unitofmeasure']))\n\t\t$unitofmeasure->attributes=$_GET['Unitofmeasure'];\n\n $soheader=new Soheader('search');\n\t $soheader->unsetAttributes(); // clear any default values\n\t if(isset($_GET['Soheader']))\n\t\t$soheader->attributes=$_GET['Soheader'];\n\n $project=new Project('search');\n\t $project->unsetAttributes(); // clear any default values\n\t if(isset($_GET['Project']))\n\t\t$project->attributes=$_GET['Project'];\n\n\t\t$id=$_POST['id'];\n\t $model=$this->loadModel($id[0]);\nif ($model != null)\n {\n if ($this->CheckDataLock($this->menuname, $id[0]) == false)\n {\n $this->InsertLock($this->menuname, $id[0]);\n echo CJSON::encode(array(\n 'status'=>'success',\n\t\t\t\t'doheaderid'=>$model->doheaderid,\n\t\t\t\t'dono'=>$model->dono,\n\t\t\t\t'dodate'=>$model->dodate,\n\t\t\t\t'postdate'=>$model->postdate,\n 'soheaderid'=>$model->soheaderid,\n 'sono'=>($model->soheader!==null)?$model->soheader->sono:\"\",\n 'projectid'=>$model->projectid,\n 'projectno'=>($model->project!==null)?$model->project->projectno:\"\",\n\t\t\t\t'addressbookid'=>$model->addressbookid,\n\t\t\t\t'fullname'=>($model->customer!==null)?$model->customer->fullname:\"\",\n\t\t\t\t'recordstatus'=>$model->recordstatus,\n 'div'=>$this->renderPartial('_form', array('model'=>$model,\n\t\t\t\t\t'dodetail'=>$dodetail,\n\t\t\t\t\t'customer'=>$customer,\n\t\t\t\t\t'product'=>$product,\n\t\t\t\t\t'unitofmeasure'=>$unitofmeasure,\n 'soheader'=>$soheader,\n 'project'=>$project), true)\n\t\t\t\t));\n Yii::app()->end();\n }\n }\n\t}", "function field_data_type_view(){\r\n\t\tglobal $current_user;\r\n\t\t$current_user = wp_get_current_user();\r\n\t\tif( !current_user_can( 'manage_options', $current_user->ID ) ){\r\n\t\t\twp_die( __( 'You do not have permissions to activate this plugin, sorry, check with site administrator to resolve this issue please!', 'user-registration-aide' ) );\r\n\t\t}else{\r\n\t\t\t$field = new FIELDS_DATABASE();\r\n\t\t\t?>\r\n\t\t\t<table class=\"style\">\t\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th colspan=\"3\"><?php _e( 'Change Field Type: ', 'user-registration-aide' );?></th>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th colspan=\"2\"><?php _e( 'Field Title: ', 'user-registration-aide' );?></th>\r\n\t\t\t\t\t<th><?php _e( 'Field Type: ', 'user-registration-aide' );?></th>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<?php\r\n\t\t\t\t$nfc = new INPUT_NEW_FIELDS_MODEL();\r\n\t\t\t\t$input = $nfc->input_options_array();\r\n\t\t\t\t$ura_fields = $field->get_all_fields();\r\n\t\t\t\tif( !empty( $ura_fields ) ){\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach( $ura_fields as $objects ){\r\n\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<td class=\"fieldName\" colspan=\"2\">\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\techo '<label for=\"'.$objects->meta_key.'\">'. _e( $objects->field_name, 'user-registration-aide').'</label>';\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<select class=\"fieldOrder\" name=\"<?php echo $objects->meta_key.'_data_type'; ?>\" title=\"<?php _e( 'Select the field type to change to', 'user-registration-aide' );?>\">\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\tforeach( $input as $key => $title ){\r\n\t\t\t\t\t\t\t\t\tif( $objects->data_type == $key ){\r\n\t\t\t\t\t\t\t\t\t\t$selected = \"selected=\\\"selected\\\"\";\r\n\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t$selected = null;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\techo \"<option value=\\\"$key\\\" $selected >$title</option>\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<?php\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"fieldName\" colspan=\"3\">\r\n\t\t\t\t\t\t<p class=\"deleteFields\">\r\n\t\t\t\t\t\t<?php _e( 'No new fields currently exist, you have to add new fields on the main page before you can change the order!', 'user-registration-aide' ); ?>\r\n\t\t\t\t\t\t</p>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t}?>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td colspan=\"3\">\r\n\t\t\t\t\t<div class=\"submit\"><input type=\"submit\" class=\"button-primary\" name=\"change_field_type\" value=\"<?php _e( 'Change Field Type', 'user-registration-aide' );?>\" /></div>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t\t\t\r\n\t\t\t<?php\r\n\t\t}\r\n\t}", "public function fieldsettingAction() {\r\n $this->_helper->viewRenderer(\"fieldsetting/list\");\r\n }", "public static function ADMIN_AREA_GET_AREA_EDIT_DATA(){\n\t $SQL_String = \"SELECT area_type,area_name,area_descrip,area_link,area_gates,area_load,accept_max_day,accept_min_day,revise_day,cancel_day,filled_day,wait_list,member_max,auto_pass,time_open,time_close,refer_json,form_json FROM area_main WHERE area_code=:area_code AND _keep=1 ;\";\n\t return $SQL_String;\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "function inputAction()\n {\n\t\t$customers = new CustomersModel();\n \t$id=(int)$this->_request->getParam('id');\n\t\t$this->view->id = $id;\n \t$error=$this->_request->getParam('error');\n \t$parameter = $this->getRequest()->getParams();\n \t//If it has submitted from listForm\n\t\t//get current setting for page\n\t\t$limit = $parameter[\"limit\"];\n $page = $parameter[\"page\"];\n $search = $parameter[\"search\"];\n $filter_object = $parameter[\"filter_object\"];\n // Set biến cho view\n $this->view->limit = $limit;\n $this->view->search = $search;\n $this->view->page = $page;\n $this->view->filter_object = $filter_object;\n\t\t\n\t\t \n QLVBDHButton::EnableSave(\"/qtht/customers/save\");\n\t\tQLVBDHButton::EnableBack(\"/qtht/customers/\");\n\t\t//if id>0 It's edit action awake\n \tif($id>0)\n \t{\n \t\t$this->view->title = \"Cá nhân - Đơn vị\";\n \t\t$this->view->subtitle=\"Chỉnh sửa\";\n \t\t$this->view->data = $customers->GetCustomersById($id);\n }\n \telse\n \t{\n \t\t$this->view->title = \"Cá nhân - Đơn vị\";\n \t\t$this->view->subtitle=\"Thêm mới\";\n \t\t\n \t}\n }", "function edit(){\n\t\t$arr = $this->uri->uri_to_assoc(3);\n\t\t$data['arr'] = $arr['id'];\n\t\t\n\t\t/* membuat value */\n\t\t$this->user->setID($arr['id']);\n\n\t\t/* fungsi ambil data */\n\t\t$result = $this->user->ambil_data();\n\n\t\t/* data dropdown */\n\t\t$data['role'] = role_dropdown();\n\t\t$data['result'] = $result;\n\n\t\t/* load view */\n\t\t$this->template->write_view('edit', $data);\n\t}", "function edit_field()\n\t{\n\t\t// -------------------------------------\n\t\t//\tField id\n\t\t// -------------------------------------\n\n\t\t$field_id\t= ee()->input->get_post('field_id');\n\n\t\t// -------------------------------------\n\t\t//\tSQL\n\t\t// -------------------------------------\n\n\t\tif ( ! empty( $_POST['sql'] ) )\n\t\t{\n\t\t\t$sql\t= base64_decode( $_POST['sql'] );\n\n\t\t\tee()->db->query( $sql );\n\t\t}\n\n\t\t// -------------------------------------\n\t\t//\tLoad fields page\n\t\t// -------------------------------------\n\n\t\tee()->functions->redirect( $this->cached_vars['base_uri'] . AMP . 'method=fields' . AMP . 'msg=field_edited_successfully' );\n\t}", "public function actionListOfData()\n {\n return Tag::getDataForAjax(Yii::$app->request->get());\n }", "function admin_index()\n {\n $perPage = 100;\n $this->lordModel('Post');\n $condition = array('type' => 'post');\n $d['posts'] = $this->Post->find(array(\n 'condition' => $condition,\n 'limit' => ($perPage * ($this->request->page - 1)) . ',' . $perPage\n ));\n $d['total'] = $this->Post->findCount($condition);\n $d['nbrPage'] = ceil($d['total'] / $perPage);\n //print_r($d);\n $this->setvars($d);\n //$this->setvars('phrase', 'bienvenue sur ma page');\n //$this->render('view');\n }", "public function edit() {\n\t\t$data['pagetitle'] = 'Dashboard - Edit Posts';\n\n\t\t$data['postid'] = $viewmodel->getPostById($postid['id'] );\n\t\tView::renderAdminTemplate($data, \"App/Views/admin/edit/index.php\") ;\n\t}", "function field_views_data_alter(&$data) {\n foreach (field_info_fields() as $field) {\n if ($field['storage']['type'] != 'field_sql_storage') {\n continue;\n }\n\n $function = $field['module'] . '_field_views_data_views_data_alter';\n if (function_exists($function)) {\n $function($data, $field);\n }\n }\n}", "public static function columns() {\n\n $controller = new page();\n \n $columns['id'] = new \\Gino\\IntegerField(array(\n\t\t\t'name'=>'id',\n\t\t\t'primary_key'=>true,\n\t\t\t'auto_increment'=>true,\n \t'max_lenght'=>11,\n\t\t));\n $columns['category_id'] = new \\Gino\\ForeignKeyField(array(\n 'name'=>'category_id',\n 'label'=>_(\"Categoria\"),\n 'required'=>false,\n \t'foreign'=>'\\Gino\\App\\Page\\PageCategory',\n \t'foreign_order'=>'name ASC',\n \t'add_related' => true,\n \t'add_related_url' => $controller->linkAdmin(array(), \"block=ctg&insert=1\"),\n ));\n\t\t$columns['author'] = new \\Gino\\ForeignKeyField(array(\n\t\t\t'name' => 'author',\n\t\t\t'label' => _(\"Autore\"),\n\t\t\t'required' => true,\n\t\t\t'foreign' => '\\Gino\\App\\Auth\\User',\n\t\t\t'foreign_order' => 'lastname ASC, firstname ASC',\n\t\t\t'add_related' => false,\n\t\t));\n\t\t$columns['creation_date'] = new \\Gino\\DatetimeField(array(\n\t\t\t'name' => 'creation_date',\n\t\t\t'label' => _('Inserimento'),\n\t\t\t'required' => true,\n\t\t\t'auto_now' => false,\n\t\t\t'auto_now_add' => true,\n\t\t));\n\t\t$columns['last_edit_date'] = new \\Gino\\DatetimeField(array(\n\t\t\t'name'=>'last_edit_date',\n\t\t\t'label'=>_('Ultima modifica'),\n\t\t\t'required'=>true,\n\t\t\t'auto_now'=>true,\n\t\t\t'auto_now_add'=>true,\n\t\t));\n\t\t$columns['title'] = new \\Gino\\CharField(array(\n\t\t\t'name'=>'title',\n\t\t\t'label'=>_(\"Titolo\"),\n\t\t\t'required'=>true,\n\t\t\t'max_lenght'=>200,\n\t\t));\n $columns['slug'] = new \\Gino\\SlugField(array(\n 'name'=>'slug',\n \t'unique_key'=>true,\n 'label'=>array(_(\"Slug\"), _('utilizzato per creare un permalink alla risorsa')),\n 'required'=>true,\n \t'max_lenght'=>200,\n \t'autofill'=>'title',\n ));\n $columns['image'] = new \\Gino\\ImageField(array(\n \t'name'=>'image',\n \t'label'=>_(\"Immagine\"),\n \t'max_lenght'=>100,\n \t'extensions'=>self::$_extension_img,\n \t'resize'=>false,\n \t'path'=>null,\n \t'add_path'=>null\n ));\n $columns['url_image'] = new \\Gino\\CharField(array(\n \t'name'=>'url_image',\n \t'label'=>array(_(\"Collegamento sull'immagine\"), _(\"indirizzo URL\")),\n \t'required'=>false,\n \t'max_lenght'=>200,\n ));\n $columns['text'] = new \\Gino\\TextField(array(\n \t'name' => 'text',\n \t'label' => _(\"Testo\"),\n \t'required' => true\n ));\n $columns['tags'] = new \\Gino\\TagField(array(\n \t'name' => 'tags',\n \t'label' => array(_('Tag'), _(\"elenco separato da virgola\")),\n \t'required' => false,\n \t'max_lenght' => 255,\n \t'model_controller_class' => 'page',\n \t'model_controller_instance' => 0,\n ));\n $columns['enable_comments'] = new \\Gino\\BooleanField(array(\n \t'name'=>'enable_comments',\n \t'label'=>_('Abilita commenti'),\n \t'required'=>true,\n \t'default' => 0\n ));\n\t\t$columns['published'] = new \\Gino\\BooleanField(array(\n 'name'=>'published',\n 'label'=>_('Pubblicato'),\n 'required'=>true,\n \t'default' => 0\n ));\n\t\t$columns['social'] = new \\Gino\\BooleanField(array(\n 'name'=>'social',\n 'label'=>_('Condivisioni social'),\n 'required'=>true,\n \t'default' => 0\n ));\n $columns['private'] = new \\Gino\\BooleanField(array(\n \t'name'=>'private',\n \t'label'=>array(_(\"Privata\"), _(\"pagina visualizzabile da utenti con il relativo permesso\")),\n \t'required'=>true,\n \t'default' => 0\n ));\n /*\n $ids = \\Gino\\App\\Auth\\User::getUsersWithDefinedPermissions(array('can_view_private'), $controller);\n if(count($ids)) {\n \t$where_mf = \"active='1' AND id IN (\".implode(',', $ids).\")\";\n }\n else {\n \t$where_mf = \"id=NULL\";\n }*/\n \n $columns['users'] = new \\Gino\\MulticheckField(array(\n \t'name' => 'users',\n \t'label' => _(\"Utenti che possono visualizzare la pagina\"),\n \t'max_lenght' => 255,\n \t'refmodel' => '\\Gino\\App\\Auth\\User',\n \t'refmodel_where' => \"active='1'\",\n \t'refmodel_order' => \"lastname ASC, firstname\",\n ));\n $columns['view_last_edit_date'] = new \\Gino\\BooleanField(array(\n \t'name' => 'view_last_edit_date',\n \t'label' => _(\"Visualizzare la data di aggiornamento della pagina\"),\n \t'required' => true,\n \t'default' => 0\n ));\n \n $ids = \\Gino\\App\\Auth\\User::getUsersWithDefinedPermissions(array('can_edit_single_page'), $controller);\n if(count($ids)) {\n \t$where_mf = \"active='1' AND id IN (\".implode(',', $ids).\")\";\n }\n else {\n \t$where_mf = \"id=NULL\";\n }\n \n $columns['users_edit'] = new \\Gino\\MulticheckField(array(\n \t'name' => 'users_edit',\n \t'label' => array(_(\"Utenti che possono editare la pagina\"), _(\"elenco degli utenti associati al permesso di redazione dei contenuti di singole pagine\")),\n \t'max_lenght' => 255,\n \t'refmodel' => '\\Gino\\App\\Auth\\User',\n \t'refmodel_where' => $where_mf,\n \t'refmodel_order' => \"lastname ASC, firstname\",\n ));\n $columns['read'] = new \\Gino\\IntegerField(array(\n \t'name'=>'read',\n \t'label'=>_('Visualizzazioni'),\n \t'required'=>true,\n \t'default'=>0,\n ));\n $columns['tpl_code'] = new \\Gino\\TextField(array(\n \t'name'=>'tpl_code',\n \t'label' => array(_(\"Template pagina intera\"), _(\"richiamato da URL (sovrascrive il template di default)\")),\n \t'required' => false,\n 'footnote' => page::explanationTemplate()\n ));\n $columns['box_tpl_code'] = new \\Gino\\TextField(array(\n \t'name'=>'box_tpl_code',\n \t'label' => array(_(\"Template box\"), _(\"richiamato nel template del layout (sovrascrive il template di default)\")),\n \t'required' => false\n ));\n\n return $columns;\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Browser_Service_Recsite::getRecsite(intval($id));\t\t\n\t\t$this->assign('info', $info);\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}", "function admin_page_wpdrs_content()\n\t\t{\n\t\t\t$post_types = WPDRS::get_post_types();\n\n\t\t\t$post_type_setting_fields = array(\n\t\t\t\tarray('type'=>'select', 'name'=>'show_rating[]','label'=>'Show Rating','options'=>array('No','Yes')),\n\t\t\t\tarray('type'=>'select', 'name'=>'rating_type[]','label'=>'Rating Type','options'=>array('No','Yes')),\n\t\t\t\t);\n\n\t\t\t$action = trim(strtolower($_REQUEST['wpdrs_action']));\n\t\t\tif(method_exists($this, $action)) return $this->$action();\n\t\t\t}", "function edit($actionValue) \n\t{\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n $this->viewData['editrecord']=UserModel::Create()->SelectUser($actionValue);\n // Render the action with template\n $this->renderWithTemplate('users/edit', 'AdminPageBaseTemplate');\n }", "public function getAction(){\n \t$user=Doctrine_Query::create()\n\t\t ->select(\"u.ID, u.nome,u.cognome,u.user,u.active,u.data_iscrizione,u.ID_role\")\n\t\t ->from(\"Users u\")\n\t\t ->addWhere(\"u.ID=?\",$this->getRequest()->getParam('id'))\n\t\t ->fetchOne(null,Doctrine::HYDRATE_ARRAY);\n $this->emitLoadData($user);\n }", "protected function setupListOperation()\n {\n CRUD::column('key')->label('ID key')->type('text');\n CRUD::column('name')->label('Nom')->type('text')->limit(200);\n }", "function getDataField() {return $this->_datafield;}", "public function editAction() {\r\n\t\t$id = $this->getInput('id');\r\n\t\t$info = Gou_Service_Ad::getAd(intval($id));\r\n\t\t$this->assign('ad_types', $this->ad_types[$info['channel_id']]);\r\n\t\t\r\n\t\tlist($info['module_id'], $info['cid']) = explode('_', $info['module_channel']);\r\n\t\t$this->assign('info', $info);\r\n\t\t\r\n\t\tif($info['channel_id'] == 2 || $info['channel_id'] == 6) {\r\n\t\t list(, $ptypes) = Type_Service_Ptype::getsBy(array('status'=>1,'pid'=>0), array('sort'=>'DESC', 'id'=>'DESC'));\r\n\t\t $this->assign('ptype', $ptypes);\r\n\t\t}\r\n\t\t\r\n\t if($info['channel_id'] == 2) {\r\n\t\t $this->assign('actions', $this->client_actions);\r\n\t\t}\r\n\r\n $this->assign('channel_id', $info['channel_id']);\r\n $this->assign('ad_type', $info['ad_type']);\r\n\r\n\t\t//module channel\r\n\t\tlist($modules, $channel_names) = Gou_Service_ChannelModule::getsModuleChannel();\r\n\t\t$this->assign('modules', $modules);\r\n\t\t$this->assign('channel_names', $channel_names);\r\n\t}", "public function index()\n {\n $data_url = $this->request->query;\n\n //Obtengo los datos de la tabla\n $mapaConfig = $this->Mapconfig->find('all', [])->first();\n\n\n $action = $data_url['Accion'];\n $categoria = $data_url['Categoria'];\n\n\n $this->set('action', $action);\n $this->set('categoria', $categoria);\n $this->set('mapaConfig', $mapaConfig);\n\n }", "protected function getFieldsFromShowItem() {}", "public function actionFieldList($id){\n\n $fields= Yii::app()->db->createCommand()\n //->select('*')\n ->select('field_name,field_length,field_type,field_input_type,is_unique,is_required,default_value')\n ->from('cyl_fields')\n ->where('table_id = '.$id)\n ->queryRow();\n\n $field_values = Yii::app()->db->createCommand()\n //->select('field_id,field_name,field_length,field_type,field_input_type,is_unique,is_required,incremental_start,default_value')\n ->select('*')\n ->from('cyl_fields')\n ->where('table_id = '.$id)\n ->queryAll();\n\n foreach ($fields as $key => $field){\n $field_title[] = $key;\n }\n $this->renderPartial('field-list',array('fields'=>$field_title,'fields_value' => $field_values,'id'=>$id));\n }", "function form_init_data($action = FT_ACTION_DELETE)\r\n {\r\n parent::form_init_data($action) ;\r\n }", "public function getEdit()\n\t{\n\t}", "public function initAction()\n\t{\n\t\t$preservemodels = array('category','Category','file','File','EmailMessage','emailmessage','tag','mgmt_entity','mgmt_lang');\n\t\t$preserve = array('emailmessage','user','tag','mgmtlang','category');\n\t\n\t\t//standard language module is also basis for the front end module\n\t\t$language = $this->language('NL');\n\n\t\t$this->view->disable();\n\t\t$status = array('status' => 'false');\t\n\t\tif ($this->request->isPost()) \n\t\t{\n\t\t\t$post = $this->request->getPost();\n\t\t\t$noincludes = array('file');\n\n\t\t\t$images = array();\n\t\t\t$functions = array();//array for new/edit extra functions information\n\t\t\t$widgets = array();\n\t\t\t$tables = array();\n\t\t\t$ctables = array();\n\t\t\t\n\t\t\t$postkeys = array_keys($post);\n\t\t\tforeach($postkeys as $var)\n\t\t\t{\n\t\t\t\t$v = explode('_',$var);\n\t\t\t\tif(isset($v[1]))\n\t\t\t\t{\n\t\t\t\t\tswitch($v[0])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'file':\n\t\t\t\t\t\t\tif($post[$var] == 1){ array_push($images,$v[1]); }\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'functions':\n\t\t\t\t\t\t\tif(is_array($post[$var]))\n\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tforeach($post[$var] as $function)\n\t\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t\t$entity = $v[1];\n\t\t\t\t\t\t\t\t\t$value = explode('_',$function);\n\t\t\t\t\t\t\t\t\t$widgetentity = $value[0];\n\t\t\t\t\t\t\t\t\t$widgetentityid = $value[1];\n\t\t\t\t\t\t\t\t\t$table = array($entity,array('widgetentity' => $widgetentity,'widgetentityid' => $widgetentityid));\n\t\t\t\t\t\t\t\t\tarray_push($functions,$table);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'widget':\n\t\t\t\t\t\t\tarray_push($widgets,$v[1]);\n\t\t\t\t\t\tbreak;\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($post[$var] == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($tables,$var);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//SETTINGS SLUG & ALIAS SAVE \t\tNEW/EDIT & VIEW WIDGETS ALSO\n\t\t\t\n\t\t\t//mgmtentities cant update for some reason\n\t\t\t\n\t\t\t\n\t\t\t$ent = MgmtEntity::find();\n\t\t\tforeach($ent as $e)\n\t\t\t{\n\t\t\t\t$e->delete();\n\t\t\t}\n\t\t\t\n\t\t\tforeach($tables as $table)\n\t\t\t{\t\t\t\n\t\t\t\tif(isset($post['clearance_'.$table]) && isset($post['alias_'.$table]))\n\t\t\t\t{\n\t\t\t\t\t$mgmt_entity = MgmtEntity::findFirst('titel = \"'.$table.'\"');\n\t\t\t\t\tif(!$mgmt_entity)\n\t\t\t\t\t{\t\n\t\t\t\t\t\t$mgmt_entity = new MgmtEntity();\t\n\t\t\t\t\t}\n\t\t\t\t\t$mgmt_entity->id = $this->uuid();\n\t\t\t\t\t$mgmt_entity->titel = $table;\n\t\t\t\t\t$mgmt_entity->slug = strtolower(preg_replace(\"/[^a-zA-Z]/\", \"\", $table));\n\t\t\t\t\t$mgmt_entity->clearance = $post['clearance_'.$table];\n\t\t\t\t\t$mgmt_entity->alias = $post['alias_'.$table];\t\t\n\t\t\t\t\t\n\t\t\t\t\t$mgmt_entity->newedit = serialize($post['functions_'.$table.'_new']);\n\t\t\t\t\t$mgmt_entity->view = serialize($post['functions_'.$table.'_view']);\n\t\t\t\t\t\n\t\t\t\t\tif($post[$table] == 1)\n\t\t\t\t\t{ $val = 1;\t}else{$val = 0;}\n\t\t\t\t\t\n\t\t\t\t\t$mgmt_entity->visible = $val;\n\t\t\n\t\t\t\t\tif($mgmt_entity->save())\n\t\t\t\t\t{ \n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($mgmt_entity->getMessages() as $message)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\techo $message;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t//get all tables\n\t\t\t$tablesq = $this->db->fetchAll(\"SHOW TABLES\", Phalcon\\Db::FETCH_ASSOC);\n\t\t\t$linktables = array();\n\t\t\tforeach ($tablesq as $tableq) \n\t\t\t{\n\t\t\t\t$ext = explode('_',$tableq['Tables_in_'.DATABASENAME]);\n\t\t\t\tif(isset($ext[1]))\n\t\t\t\t{\tarray_push($linktables,$tableq['Tables_in_'.DATABASENAME]);\t}\n\t\t\t\t\n\t\t\t\tarray_push($ctables,$tableq['Tables_in_'.DATABASENAME]);\n\t\t\t}\n\n\t\t\t//tables with columns\n\t\t\t$tablesobject = array();\n\t\t\tforeach ($tablesq as $tableq) \n\t\t\t{\n\t\t\t\t$tablesobject[$tableq['Tables_in_'.DATABASENAME]] = array();\n\t\t\t\t$columns = $this->db->fetchAll(\"DESCRIBE `\".$tableq['Tables_in_'.DATABASENAME].\"`\", Phalcon\\Db::FETCH_ASSOC);\n\t\t\t\tforeach($columns as $column)\n\t\t\t\t{\n\t\t\t\t\tarray_push($tablesobject[$tableq['Tables_in_'.DATABASENAME]],$column['Field']);\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$error =0;\n\t\t\t//create models for link tables\t\n\t\t\tforeach($linktables as $linktable)\n\t\t\t{\n\t\t\t\tif(!in_array($linktable,$preservemodels))\n\t\t\t\t{\n\t\t\t\t\t$model = new Modell();\n\t\t\t\t\t$model->name = $linktable;\n\t\t\t\t\t$columns = $this->db->fetchAll(\"DESCRIBE \".$linktable, Phalcon\\Db::FETCH_ASSOC);\n\t\t\t\t\t$model->columns = $columns;\n\t\t\t\t\t\n\t\t\t\t\t$model->tables = $tables;\n\t\t\t\t\t$model->tablesobject = $tablesobject;\n\t\t\t\t\tif(!$model->tofile()){ $error++; }\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//create models\t\t\t\n\t\t\tforeach($tables as $table)\n\t\t\t{\n\t\t\t\tif(!in_array($table,$preserve))\n\t\t\t\t{\n\t\t\t\t\t$model = new Modell();\n\t\t\t\t\t$model->name = $table;\n\t\t\t\t\t$columns = $this->db->fetchAll(\"DESCRIBE \".$table, Phalcon\\Db::FETCH_ASSOC);\n\t\t\t\t\t$model->columns = $columns;\n\t\t\t\t\t$model->tables = $ctables;\n\t\t\t\t\t$model->tablesobject = $tablesobject;\n\t\t\t\t\tif(!$model->tofile()){ $error++; }\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$relations = array();\n\t\t\t\t\tforeach($tables as $tablex)\n\t\t\t\t\t{\n\t\t\t\t\t\t$columnx = $this->db->fetchAll(\"DESCRIBE \".$tablex, Phalcon\\Db::FETCH_ASSOC);\n\t\t\t\t\t\tforeach($columnx as $column)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($column['Field'] == $tablex.'id')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tarray_push($relations,$column['Field']);\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//generate view relations for detail view\n\t\t\t\t\t$linkentityrelations = array();\n\t\t\t\t\t$entityrelations = array();\n\t\t\t\t\tforeach($tablesq as $tablex)\n\t\t\t\t\t{\t\t\n\t\t\t\t\t\t$table3 = explode('_',$tablex['Tables_in_'.DATABASENAME]);\n\t\t\t\t\t\tif(!isset($table3[1]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$columnx = $this->db->fetchAll(\"DESCRIBE `\".$tablex['Tables_in_'.DATABASENAME].\"`\", Phalcon\\Db::FETCH_ASSOC);\n\t\t\t\t\t\t\tforeach($columnx as $column)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($table.'id' == $column['Field'])\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif($tablex['Tables_in_'.DATABASENAME] != 'acl')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tarray_push($entityrelations,$tablex['Tables_in_'.DATABASENAME]);\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($table3[0] == $table || $table3[1] == $table)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tarray_push($linkentityrelations,$tablex['Tables_in_'.DATABASENAME]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$controller = new Controller();\n\t\t\t\t\t$controller->language = $language;\t\t\t\t\n\t\t\t\t\t$controller->entity = $table;\n\t\t\t\t\t$controller->columns = $columns;\n\t\t\t\t\t$controller->relations = $entityrelations;\n\t\t\t\t\t$controller->linkrelations = $linkentityrelations;\n\t\t\t\t\t$controller->tables = $tables;\t\t\n\t\t\t\t\t$controller->images = in_array($table,$images);\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t$view = new View();\n\t\t\t\t\t$view->language = $language;\n\t\t\t\t\t$view->entity = $table;\n\t\t\t\t\t$view->columns = $columns;\n\t\t\t\t\t$view->relations = $entityrelations;\n\t\t\t\t\t$view->linkrelations = $linkentityrelations;\n\t\t\t\t\t$view->baseuri = $this->url->getBaseUri();\t\t\n\t\t\t\t\t$view->images = in_array($table,$images); \n\t\t\t\t\t$view->tablesobject = $tablesobject;\n\t\t\t\t\t\n\t\t\t\t\t$functions = array();\n\t\t\t\t\tif(isset($post['functions_'.$table.'_new']) && is_array($post['functions_'.$table.'_new']) )\n\t\t\t\t\t{\t\n\t\t\t\t\t\tforeach($post['functions_'.$table.'_new'] as $function)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tarray_push($functions,$function);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tif(isset($post['functions_'.$table.'_view']) && is_array($post['functions_'.$table.'_view']) )\n\t\t\t\t\t{\t\n\t\t\t\t\t\tforeach($post['functions_'.$table.'_view'] as $function)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tarray_push($functions,$function);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(count($functions) > 0)\n\t\t\t\t\t{ \n\t\t\t\t\t\t$view->functions = $functions; \n\t\t\t\t\t\t$controller->functions = $functions;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!$view->tofile()){ $error++; }\t\n\t\t\t\t\t\n\t\t\t\t\tif(!$controller->tofile()){ $error++; }\t\n\t\t\t\t}\n\t\t\t}\t\n\n\t\t\t$menu = new Menu();\n\t\t\t$menu->tables = MgmtEntity::find(array('order' => 'titel ASC'));\n\t\t\tif(!$menu->tofile()){ $error++; }\n\t\t\t\n\t\t\tif(!isset($error) || $error == 0)\n\t\t\t{\n\t\t\t\t$status['status'] = 'ok';\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$status['messages'] = 'Something went wrong!';\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\techo json_encode($status);\n\t}", "public function show_tablefields()\n {\n $table_name = JFactory::getApplication()->input->get('table_name');\n\n if( ! $table_name)\n {\n return;\n }\n\n $db = JFactory::getDBO();\n\n $table_name = $db->getPrefix().$table_name;\n $fields = $db->getTableColumns($table_name);\n\n if( ! count($fields) || ! count($fields[$table_name]))\n {\n JFactory::getApplication()->enqueueMessage(jgettext('No table fields found'), 'error');\n }\n\n ?>\n<table>\n <tr>\n <th colspan=\"2\"><?php echo jgettext('Include')?></th>\n <th><?php echo jgettext('Editable'); ?></th>\n <th><?php echo jgettext('Type'); ?></th>\n </tr>\n <?php\n foreach($fields[$table_name] as $key => $value)\n {\n switch($value)\n {\n case 'int':\n case 'tinyint':\n $def = '0';\n break;\n\n default:\n $def = 'NULL';\n break;\n }\n\n $javascript1 = \"$('tblfield_edit_\".$key.\"').disabled=(this.checked)?false:true;\";\n $javascript2 = \"$('tblfield_type_\".$key.\"').disabled=(this.checked && $('tblfield_edit_\"\n .$key.\"').checked)?false:true;\";\n\n $javascript = $javascript1.$javascript2;\n ?>\n <tr>\n <td><input type=\"checkbox\" onchange=\"<?php echo $javascript; ?>\"\n name=\"table_fields[]\" checked=\"checked\"\n id=\"tblfield_<?php echo $key; ?>\"\n value=\"<?php echo $key; ?>\">\n </td>\n <td><label for=\"tblfield_<?php echo $key; ?>\">\n <?php echo $key.'<br />('.$value.')'; ?>\n </label></td>\n <td><input type=\"checkbox\" onchange=\"<?php echo $javascript2; ?>\"\n name=\"table_fields_edits[]\" checked=\"checked\"\n id=\"tblfield_edit_<?php echo $key; ?>\"\n value=\"<?php echo $key; ?>\"></td>\n <td><select name=\"table_fields_types[<?php echo $key; ?>]\"\n id=\"tblfield_type_<?php echo $key; ?>\">\n <option>text</option>\n <option>text area</option>\n <option>radio bool</option>\n <option>html</option>\n </select></td>\n </tr>\n <?php\n }\n ?>\n</table>\n <?php\n }", "function wdtEdit()\n{\n if (!current_user_can('manage_options')) {\n wp_die(__('You do not have sufficient permissions to access this page.'));\n }\n\n if (isset($_GET['table_id'])) {\n if (isset($_GET['simple'])) {\n $tableID = (int)$_GET['table_id'];\n $tableData = WDTConfigController::loadSimpleTableConfig($tableID);\n } else if (isset($_GET['table_view'])) {\n $tableData = WDTConfigController::loadTableConfig((int)$_GET['table_id'], $_GET['table_view']);\n } else {\n $tableData = WDTConfigController::loadTableConfig((int)$_GET['table_id']);\n }\n if (isset($tableData->error)) {\n echo WDTTools::wdtShowError($tableData->error);\n return;\n }\n WDTTools::exportJSVar('wpdatatable_init_config', $tableData->table);\n }\n\n /** @noinspection PhpUnusedLocalVariableInspection */\n $wdtUserRoles = get_editable_roles();\n\n if (isset($tableData) && isset($tableData->table)) {\n $connection = $tableData->table->connection;\n } elseif (isset($_GET['connection'])) {\n $connection = $_GET['connection'];\n } else {\n $connection = null;\n }\n\n\n if (isset($_GET['table_id']) && isset($_GET['simple'])) {\n ob_start();\n include WDT_ROOT_PATH . 'templates/admin/table-settings/edit_simple_table.inc.php';\n $editPage = ob_get_contents();\n ob_end_clean();\n\n $editPage = apply_filters('wpdatatables_filter_edit_page_simple_table', $editPage);\n echo $editPage;\n } else {\n ob_start();\n include WDT_ROOT_PATH . 'templates/admin/table-settings/edit_table.inc.php';\n $editPage = ob_get_contents();\n ob_end_clean();\n\n $editPage = apply_filters('wpdatatables_filter_edit_page', $editPage);\n echo $editPage;\n }\n}", "public function getAjaxData($request)\n {\n if ($this->selectedViewType == 'simple') {\n // Remove action column for query\n if (in_array('action', $this->listViewSimple))\n $this->listViewSimple = array_diff($this->listViewSimple, array('action'));\n $columns = $this->listViewSimple;\n\t\t\t$users = Admin::select($columns);\n } else\n // All and Custom Case\n $columns = ['*'];\n\t\t$users = Admin::select($columns);\n //$users = Admin::select($columns);\n $table = DataTables::of($users);\n $table->editColumn('avatar', function ($user) {\n return getAvatar($user->avatar, $user->name);\n });\n $table->addColumn('action', function ($user) {\n return '<a href=\"' . route('admin-member-edit', $user->user_id) . '\" class=\"btn btn-xs btn-primary\"><i class=\"glyphicon glyphicon-edit\"></i></a>\n <a href=\"' . route('admin-member-detail', $user->user_id) . '\" class=\"btn btn-xs bg-color-pink txt-color-white\"><i class=\"glyphicon glyphicon-th-list\"></i></a>\n <a href=\"javascript:void(0)\" class=\"btn btn-xs btn-danger txt-color-white\" onclick=\"confirmBox(\\'' . route('admin-member-delete', $user->user_id) . '\\')\"><i class=\"glyphicon glyphicon-remove\" ></i></a>';\n });\n $table->editColumn('created_timestamp', function ($user) {\n return my_date($user->created_timestamp, '', '');\n });\n $table->filterColumn('created_timestamp', function ($query, $keyword) {\n $query->whereRaw(\"DATE_FORMAT(FROM_UNIXTIME(created_timestamp),'%d-%m-%Y %h:%i:%s') like ?\", [\"%$keyword%\"]);\n });\n $table->editColumn('updated_timestamp', function ($user) {\n return my_date($user->updated_timestamp, '', '');\n });\n $table->filterColumn('updated_timestamp', function ($query, $keyword) {\n $query->whereRaw(\"DATE_FORMAT(FROM_UNIXTIME(updated_timestamp),'%d-%m-%Y %h:%i:%s') like ?\", [\"%$keyword%\"]);\n });\n\n $table->rawColumns(['avatar', 'action']);\n\n //If custom Filter Added.\n if ($this->advanceFilters)\n setAdvanceFilter($request, $table);\n\n return $table->make(true);\n }", "public function getData()\n {\n $posts = Post::join('posts_texts', 'posts.id', '=', 'posts_texts.post_id')\n ->select('posts.id', 'posts_texts.title', 'posts.affair_id', 'posts.importance', 'posts.lang', 'posts.state')\n ->where('posts_texts.lang', '=', 'en');\n return Datatables::of($posts)\n\n ->edit_column('lang', '{{ Lang::get(\\'langs.\\' . $lang) }}')\n ->edit_column('state', '{{ Lang::get(\\'states.\\' . $state) }}')\n ->edit_column('importance', '{{ ($importance == 4) ? \"CR\" : $importance }}')\n\n ->add_column('actions', '<a href=\"{{{ URL::to(\\'admin/affairs/translate/\\' . $id . \\'/edit\\' ) }}}\" class=\"btn btn-default btn-xs iframe\" >{{{ Lang::get(\\'button.edit\\') }}}</a>\n ')\n\n ->remove_column('id')\n\n ->make();\n }", "function DBDataForm()\n {\n $this->ItemData();\n $this->ItemDataGroups();\n \n $this->InitActions();\n $this->SetPertains();\n\n return\n $this->ItemsForm_Run\n (\n array\n (\n \"FormTitle\" => $this->DBDataFormTitle(),\n \"ID\" => 2,\n \"Name\" => \"Datas\",\n \"Method\" => \"post\",\n \"Action\" => \n \"?Unit=\".$this->GetCGIVarValue(\"Unit\").\n \"&ModuleName=Events&Action=\".\n $this->CGI_Get(\"Action\").\n \"&Event=\".\n $this->GetGET(\"Event\")\n ,\n\n \"Anchor\" => \"TOP\",\n \"Uploads\" => FALSE,\n \"CGIGETVars\" => array(\"Group\",\"Datas\",\"Datas_Sort\",\"Datas_Reverse\"),\n\n\n \"Edit\" => 1,\n \"Update\" => 1,\n\n \"RowMethod\" => \"\",\n \"RowsMethod\" => \"Table_Rows\",\n \"RowMethod\" => \"\",\n \"RowsMethod\" => \"ItemsForm_ItemRows\",\n\n \"DefaultSorts\" => array(\"SortOrder\",\"ID\"),\n \"ReadWhere\" => array\n (\n \"Event\" => $this->Event(\"ID\"),\n \"Pertains\" => $this->ApplicationObj()->Pertains,\n ),\n\n \"IgnoreGETVars\" => array(\"CreateTable\"),\n \"UpdateCGIVar\" => \"Update\",\n \"UpdateCGIValue\" => 1,\n \"UpdateItems\" => array(),\n\n\n \"Group\" => $this->DBDataFormDataGroup(),\n\n \"Edit\" => 1,\n\n \"Items\" => array(),\n \"AddGroup\" => \"Basic\",\n \"AddItem\" => array\n (\n \"Unit\" => $this->Unit(\"ID\"),\n \"Event\" => $this->Event(\"ID\"),\n \"Pertains\" => $this->ApplicationObj()->Pertains,\n \"Friend\" => 3, //default access to friend is edit\n ),\n \"AddDatas\" => array(\"Pertains\",\"DataGroup\",\"SqlKey\",\"Type\",\"SortOrder\",\"Text\",\"Text_UK\"),\n \"UniqueDatas\" => array(\"SqlKey\"),\n \"NCols\" => 20,\n \n \"DetailsMethod\" => \"DBDataFormDetailsCell\",\n \"DetailsSGroups\" => \"GetDetailsSGroups\",\n )\n ).\n $this->DBDataQuest().\n \"\";\n }", "public function indexAction()\r\n\t{\r\n\t\t$this->view->contratoCombo = $this->objContrato->getContrato(true, true);\t\t\r\n\t}", "public function edit() {\n\t\t\t\n\t\t}", "function local_callbacks_coursemodule_edit_post_actions($data, $course) {\n // Pull apart $data and insert/update the database table.\n}", "public function actionUpdateFields() {\n\t\t$xlsAttributes = json_decode($_POST['xlsAttributes']);\n\t\tif(isset($_POST)) {\n\t\t\t$model_fields = new $_POST['table'];\n\t\t\techo \"<p class=\\\"note\\\">\".Yii::t('excel','Attach the columns to table fields').\"</p>\";\n\t\t\tforeach($model_fields->attributeNames() as $attribute)\n\t\t\t{\n\t\t\t\techo \"<div class=\\\"jFormComponent\\\">\";\n\t\t\t\techo CHtml::label($attribute, 'label_'.$attribute);\n\t\t\t\t$selected = null;\n\t\t\t\tfor ($col = 0; $col <= count($xlsAttributes)-1; ++$col) {\n\t\t\t\t\tif($xlsAttributes[$col] == $attribute)\n\t\t\t\t\t\t$selected = $col;\n\t\t\t\t}\n\t\t\t\techo CHtml::dropDownList('attr_'.$attribute, $selected, $xlsAttributes, array('empty'=>Yii::t('excel','--select field--')));\n\t\t\t\techo \"</div>\";\n\t\t\t}\n\t\t}\n\t}", "function tripal_views_views_data() {\n $data = array();\n\n // Manually integrate the drupal.tripal_views* tables\n $data = tripal_views_views_data_tripal_views_tables($data);\n\n // Determine the name of the chado schema\n $chado_schema = tripal_get_schema_name('chado');\n\n // MAKE SURE ALL CHADO TABLES ARE INTEGRATED\n tripal_views_integrate_all_chado_tables();\n\n // DEFINE GLOBAL FIELDS\n // Filter handler that lets the admin say:\n // \"Show no results until they enter search parameters\"\n $data['views']['search_results'] = array(\n 'title' => t('Delay Results'),\n 'help' => t('Delay results until Apply/Search is clicked by the user.'),\n 'filter' => array(\n 'handler' => 'tripal_views_handler_filter_no_results',\n ),\n );\n\n $data['views']['action_links_area'] = array(\n 'title' => t('Action Links'),\n 'help' => t('Add action links to the view.'),\n 'area' => array(\n 'handler' => 'tripal_views_handler_area_action_links',\n ),\n );\n\n $tvi_query = db_query('SELECT * FROM {tripal_views}');\n\n // INTEGRATE THE LIGHTEST SETUP FOR EACH TABLE\n foreach ($tvi_query as $tvi_row) {\n\n // check to see if this is the lightest (drupal-style) priority setup for this table\n // if not then don't use this definition\n $lightest_priority_setup = tripal_is_lightest_priority_setup($tvi_row->setup_id, $tvi_row->table_name);\n if (!$lightest_priority_setup) {\n continue;\n }\n\n // ids we'll use for queries\n $setup_id = $tvi_row->setup_id;\n $mview_id = $tvi_row->mview_id;\n\n // holds the base table name and fields\n $base_table = '';\n $base_fields = array();\n\n // indicated whether the current table is a base table or not\n $is_base_table = $tvi_row->base_table;\n\n // POPULATE THE BASE TABLE NAME AND FIELDS\n // If an $mview_id is given then get the materialized view info,\n // otherwise get the Chado table info\n $legacy_mview = FALSE;\n if ($mview_id) {\n\n // get the base table name from the materialized view\n // D7 TODO: Check DBTNG changes work\n $sql = \"SELECT name, mv_specs FROM {tripal_mviews} WHERE mview_id = :id\";\n $mview_table = db_query($sql, array(':id' => $mview_id));\n $mview_table = $mview_table->fetchObject();\n $base_table = $mview_table->name;\n\n if (!empty($mview_table->mv_specs)) {\n $legacy_mview = TRUE;\n }\n }\n\n if ($legacy_mview) {\n // get the columns in this materialized view. They are separated by commas\n // where the first word is the column name and the rest is the type\n $columns = explode(\",\", $mview_table->mv_specs);\n foreach ($columns as $column) {\n $column = trim($column); // trim trailing and leading spaces\n preg_match(\"/^(.*?)\\ (.*?)$/\", $column, $matches);\n $column_name = $matches[1];\n $column_type = $matches[2];\n $base_fields[$column_name] = array(\n 'column_name' => $column_name,\n 'type' => $column_type,\n );\n }\n\n // get the field name and descriptions\n // D7 TODO: Check DBTNG changes work\n $sql = \"SELECT * FROM {tripal_views_field} WHERE setup_id=:setup\";\n $query = db_query($sql, array(':setup' => $setup_id));\n foreach($query as $field) {\n $base_fields[$field->column_name]['name'] = $field->name;\n $base_fields[$field->column_name]['help'] = $field->description;\n }\n }\n // if this is not a legacy materialized view\n else {\n $base_table = $tvi_row->table_name;\n\n // get the table description\n $table_desc = chado_get_schema($base_table);\n\n $fields = $table_desc['fields'];\n if (!is_array($fields)) {\n $fields = array();\n }\n foreach ($fields as $column => $attrs) {\n $base_fields[$column] = array(\n 'column_name' => $column,\n 'type' => $attrs['type'],\n );\n }\n\n // get the field name and descriptions\n $sql = \"SELECT * FROM {tripal_views_field} WHERE setup_id=:setup\";\n $query = db_query($sql, array(':setup' => $setup_id));\n foreach ($query as $field) {\n $base_fields[$field->column_name]['name'] = $field->name;\n $base_fields[$field->column_name]['help'] = $field->description;\n }\n }\n\n // SETUP THE BASE TABLE INFO IN THE DATA ARRAY\n $data[$base_table]['table']['group'] = t(\"$tvi_row->name\");\n\n if ($is_base_table) {\n $data[$base_table]['table']['base'] = array(\n 'group' => \"$tvi_row->name\",\n 'title' => \"$tvi_row->name\",\n 'help' => $tvi_row->comment,\n 'search_path' => $chado_schema\n );\n }\n else {\n $data[$base_table]['table'] = array(\n 'group' => \"$tvi_row->name\",\n 'title' => \"$tvi_row->name\",\n 'help' => $tvi_row->comment,\n 'search_path' => $chado_schema\n );\n }\n\n // ADD THE FIELDS TO THE DATA ARRAY\n foreach ($base_fields as $column_name => $base_field) {\n if (!isset($base_field['name'])) {\n $data[$base_table][$column_name] = array(\n 'title' => t($column_name),\n 'help' => t($column_name),\n 'field' => array(\n 'click sortable' => TRUE,\n ),\n );\n\n tripal_report_error(\n 'tripal_views',\n TRIPAL_WARNING,\n \"The name and help were not set for %table.%column. As a consequence the column\n name has been used... You should ensure that the 'name' and 'help' keys for\n this field are set in the integration array (priority = %priority)\",\n array(\n '%table'=> $base_table,\n '%column' => $column_name,\n '%priority' => $tvi_row->priority\n )\n );\n }\n else {\n $data[$base_table][$column_name] = array(\n 'title' => t($base_field['name']),\n 'help' => t($base_field['help']),\n 'field' => array(\n 'click sortable' => TRUE,\n ),\n );\n }\n\n // now add the handlers\n $sql = \"SELECT * FROM {tripal_views_handlers} WHERE setup_id = :setup AND column_name = :column\";\n $handlers = db_query($sql, array(':setup' => $setup_id, ':column' => $column_name));\n $num_handlers = 0;\n foreach ($handlers as $handler) {\n $num_handlers++;\n\n $data[$base_table][$column_name][$handler->handler_type]['handler'] = $handler->handler_name;\n\n // Add in any additional arguments\n // This should be a serialized array including (at a minimum) name => <handler name>\n if ($handler->arguments) {\n $data[$base_table][$column_name][$handler->handler_type] = array_merge($data[$base_table][$column_name][$handler->handler_type], unserialize($handler->arguments));\n }\n };\n\n // If there were no handlers applied to the current field then warn the administrator!\n if ($num_handlers == 0) {\n tripal_report_error(\n 'tripal_views',\n TRIPAL_WARNING,\n \"No handlers were registered for %table.%column. This means there is no views\n functionality for this column. To register handlers, make sure the 'handlers'\n key for this field is set in the integration array (priority = %priority).\n The supported keys include 'field', 'filter', 'sort', 'relationship'. Look\n at the tripal_add_views_integration() for additional details.\",\n array(\n '%table'=> $base_table,\n '%column' => $column_name,\n '%priority' => $tvi_row->priority\n )\n );\n }\n }\n\n // ADD JOINS & RELATIONSHIPS TO DATA ARRAY\n // only add joins if this is a base table\n // this keeps the list of available fields manageable\n // all other tables should be added via relationships\n $sql = \"SELECT * FROM {tripal_views_join} WHERE setup_id = :setup\";\n $joins = db_query($sql, array(':setup' => $setup_id));\n if (!isset($joins)) {\n $joins = array();\n }\n foreach ($joins as $join) {\n $left_table = $join->left_table;\n $left_field = $join->left_field;\n $base_table = $join->base_table;\n $base_field = $join->base_field;\n $handler = $join->handler;\n $base_title = ucwords(str_replace('_', ' ', $base_table));\n $left_title = ucwords(str_replace('_', ' ', $left_table));\n\n // if the 'node' table is in our integrated list then\n // we want to skip it. It shouldn't be there.\n if ($left_table == 'node') {\n continue;\n }\n\n // add join entry\n if (!$join->relationship_only) {\n $data[$left_table]['table']['join'][$base_table] = array(\n 'left_field' => $base_field,\n 'field' => $left_field,\n );\n if ($handler) {\n $data[$left_table]['table']['join'][$base_table]['handler'] = $handler;\n }\n if (!empty($join->arguments)) {\n array_merge($data[$left_table]['table']['join'][$base_table], unserialize($join->arguments));\n }\n }\n\n // warn if deprecated method of relationship addition was used (ie: through handlers)\n if (isset($data[$base_table][$base_field]['relationship'])) {\n tripal_report_error('tripal_views', TRIPAL_NOTICE,\n 'DEPRECATED: Currently using tripal_views_handlers to store relationship for %base => %left when you should be using tripal_views_joins.',\n array('%base' => $base_table, '%left' => $left_table));\n }\n\n // Add relationship entry.\n // NOTE: we use a fake field name to allow us to have multiple\n // relationships for the same field (ie: feature.feature_id has many\n // Many relationships but views only supports a single one).\n $fake_field = $base_field . '_to_' . $left_table;\n\n // Bug Fix: The old $fake_field used above doesn't take into account\n // multiple relationships to the same left table. To keep backwards\n // compatibility, this old fake_field needs to continue to be used for\n // the LAST recorded relationship. However, for all previously set\n // relationships we can use an improved fake name which takes into\n // account the left field and ensures all relationships for a single\n // left table are not condensed into a single relationship.\n if (array_key_exists($fake_field, $data[$base_table])) {\n\n // Again, note that we can't just change the fake_name after finding\n // there is more than one relationship because then the FIRST\n // relationship would keep the old fake_name rather than the LAST\n // which keeps backwards compatiblity since the old naming caused all\n // previous relationships be be overridden by the next one.\n // Thus we first need to determine the left field of the previous\n // join for this table combination and then use that to form our\n // improved fake field.\n $previous_left_field = $data[$base_table][$fake_field]['relationship']['base field'];\n $improved_fake_field = $base_field . '_to_' . $left_table . \".\" . $previous_left_field;\n $data[$base_table][$improved_fake_field] = $data[$base_table][$fake_field];\n }\n $data[$base_table][$fake_field] = array(\n 'title' => \"$base_title.$base_field => $left_title.$left_field\",\n 'help' => t(\"Joins @base to @left\", array('@base' => \"$base_title.$base_field\", '@left' => \"$left_title.$left_field\")),\n 'relationship' => array(\n 'handler' => $join->relationship_handler,\n 'title' => t(\"$base_field => $left_title ($left_field)\"),\n 'label' => t(\"$base_field => $left_title ($left_field)\"),\n 'real field' => $base_field,\n 'base' => $left_table,\n 'base field' => $left_field\n )\n );\n if (!empty($join->arguments)) {\n array_merge($data[$base_table][$fake_field]['relationship'], unserialize($join->arguments));\n }\n }\n }\n return $data;\n}", "public function indexAction() {\n \n //GET NAVIGATION\n $this->view->navigationStore = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitestore_admin_main', array(), 'sitestore_admin_main_sitestoreoffer'); \n\n //CREATE NAVIGATION TABS\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('sitestoreoffer_admin_main', array(), 'sitestoreoffer_admin_main_manage');\n\n //FORM GENERATION\n $this->view->formFilter = $formFilter = new Sitestoreoffer_Form_Admin_Manage_Filter();\n\n //FETCH OFFER DATAS\n $tableUser = Engine_Api::_()->getItemTable('user')->info('name');\n $tableSitestore = Engine_Api::_()->getItemTable('sitestore_store')->info('name');\n $table = Engine_Api::_()->getDbtable('offers', 'sitestoreoffer');\n $rName = $table->info('name');\n $select = $table->select()\n ->setIntegrityCheck(false)\n ->from($rName)\n ->joinLeft($tableUser, \"$rName.owner_id = $tableUser.user_id\", 'username')\n ->joinLeft($tableSitestore, \"$rName.store_id = $tableSitestore.store_id\", 'title AS sitestore_title');\n $values = array();\n if ($formFilter->isValid($this->_getAllParams())) {\n $values = $formFilter->getValues();\n }\n\n foreach ($values as $key => $value) {\n if (null === $value) {\n unset($values[$key]);\n }\n }\n if (isset($_POST['search'])) {\n if (!empty($_POST['owner'])) {\n $this->view->owner = $_POST['owner'];\n $select->where($tableUser . '.username LIKE ?', '%' . $_POST['owner'] . '%');\n }\n if (!empty($_POST['title'])) {\n $this->view->title = $_POST['title'];\n $select->where($rName . '.title LIKE ?', '%' . $_POST['title'] . '%');\n }\n if (!empty($_POST['sitestore_title'])) {\n $this->view->sitestore_title = $_POST['sitestore_title'];\n $select->where($tableSitestore . '.title LIKE ?', '%' . $_POST['sitestore_title'] . '%');\n }\n if (!empty($_POST['hotoffer'])) {\n $this->view->hotoffer = $_POST['hotoffer'];\n $_POST['hotoffer']--;\n $select->where($rName . '.hotoffer = ? ', $_POST['hotoffer']);\n }\n \n if (!empty($_POST['coupon_code'])) {\n $this->view->coupon_code = $_POST['coupon_code'];\n $select->where($rName . '.coupon_code LIKE ?', '%' . $_POST['coupon_code'] . '%');\n }\n }\n $values = array_merge(array(\n 'order' => 'offer_id',\n 'order_direction' => 'DESC',\n ), $values);\n\n $this->view->assign($values);\n $select->order((!empty($values['order']) ? $values['order'] : 'offer_id' ) . ' ' . (!empty($values['order_direction']) ? $values['order_direction'] : 'DESC' ));\n include APPLICATION_PATH . '/application/modules/Sitestore/controllers/license/license2.php';\n }", "public function getData()\n {\n return datatables(Category::all())->addColumn('action', 'backend.category.action')\n ->editColumn('status', function (Category $category) {\n return ($category->status == 1) ? 'نشط' : 'غير نشط';\n })\n ->toJson();\n }", "protected function setupShowOperation(): void\n {\n $this->crud->addColumn([\n 'name' => 'name',\n 'type' => 'text',\n 'label' => 'Наименование',\n ]);\n $this->crud->addColumn([\n 'name' => 'category_id',\n 'type' => 'select',\n 'label' => 'Категория',\n 'entity' => 'category',\n 'attribute' => \"name\",\n 'model' => Category::class,\n ]);\n $this->crud->addColumn([\n 'name' => 'photos',\n 'label' => 'Фотографии',\n 'type' => 'upload_multiple',\n 'disk' => 'public'\n ]);\n $this->crud->addColumn([\n 'name' => 'attributes',\n 'label' => 'Атрибуты',\n 'type' => 'attributes',\n 'entity_singular' => 'атрибут',\n 'columns' => [\n 'name' => 'Название атрибута',\n 'value' => 'Значение',\n ],\n 'min' => 0,\n ]);\n }", "public function ajax()\n {\n return $this->datatables->eloquent($this->query())// ->addColumn('action', 'path.to.action.view')\n ->editColumn('asset_id', function ($data) {\n\n return '<a href=' . route('samples.show', $data->asset_id) . '>' . $data->asset_id . '</a>';\n })\n ->editColumn('dealer.name', function ($data) {\n\n return '<a href=' . route('samples.out.dsr', $data->dealer_id) . '>' . $data->dealer->name . '</a>';\n })\n ->editColumn('user.name', function ($data) {\n\n return '<a href=' . route('samples.out.rep', $data->user_id) . '>' . $data->user->name . '</a>';\n })\n ->editColumn('created_at', function ($data) {\n\n return $data->created_at ? with(new Carbon($data->created_at))->format('m/d/Y') : '';\n })\n ->editColumn('expected_return_date', function ($data) {\n\n return $data->expected_return_date ? with(new Carbon($data->expected_return_date))->format('m/d/Y') : '';\n })->make(true);\n }", "public function listAction()\n {\n /*$this->_helper->viewRenderer->setNoRender(true);\n\n $params = $this->_request->getPost();\n $data = $this->_model->getList($params);\n die(json_encode($data));*/\n\n $this->_helper->viewRenderer->setNoRender(true);\n\n $params = $this->_request->getPost();\n \n //cek apakah ada table master yang sedang diedit, jika ada yang sedang diedit, maka data tidak akan muncul\n $lock = $this->_global->checkLockTable($params);\n \n /*if($lock['JUMLAH']) {\n $data['return'] = \"locked\";\n $data['module'] = $lock['MODULE'];\n $data['insert_user'] = $lock['INSERT_USER'];\n die(json_encode($data));\n } else { */\n $data = $this->_model->getList($params);\n die(json_encode($data));\n //}\n }", "function admin_edit($id)\n {\n $this->lordModel('Post');\n $condition = array('id' => $id);\n $d['post'] = $this->Post->find(array(\n 'condition' => $condition\n ));\n $this->setvars($d);\n }", "public function _editField() {\n\t\t\n\t\t$args = $this->getAllArguments ();\n\t\t\n\t\tif (array_key_exists ( 'cid', $args )) {\n\t\t\t$field_id = $args ['cid'] [0];\n\t\t} else {\n\t\t\t$field_id = @$args [3] ? @$args [3] : $args [1];\n\t\t}\n\t\t\n\t\t$field = $this->getModel ( 'field' );\n\t\t$field->get ( ( int ) $field_id );\n\t\t\n\t\t$this->loadPluginModel ( 'fields' );\n\t\t\n\t\t$this->setView ( 'edit_field' );\n\t\n\t}", "public function bankdetailsAction() {\r\n $this->_checkIfUserIsLoggedIn();\r\n $queryBuilder = $this->getEntityManager()->createQueryBuilder();\r\n $queryBuilder->add('select', 'bd.bankDetailsId,bd.branchName ,bd.ifscCode,ct.ctname,b.bankName,bd.status')\r\n ->add('from', '\\Admin\\Entity\\BankDetails bd') \r\n ->innerJoin('\\Admin\\Entity\\City', 'ct',\\Doctrine\\ORM\\Query\\Expr\\Join::WITH,\r\n 'bd.cityId=ct.cityId')\r\n ->innerJoin('\\Admin\\Entity\\Bank', 'b',\\Doctrine\\ORM\\Query\\Expr\\Join::WITH,\r\n 'bd.bankName=b.bankId')\r\n ->orderBy('bd.bankDetailsId', 'DESC');\r\n $data= $queryBuilder->getQuery()->getArrayResult(); \r\n $keys=array();\r\n foreach($data as $array){ \r\n foreach($array as $key=>$value){\r\n $key=str_replace(\"_\",\" \",$key);\r\n $keys[]=$key ; \r\n }\r\n break;\r\n}\r\n $fieldNames=$keys;\r\n $this->layout()->setVariable('fildnames', $fieldNames);\r\n return new ViewModel(array('fildnames'=>$fieldNames));\r\n }", "public function action() {\r\n parent::action();\r\n\r\n\r\n switch (SQ_Tools::getValue('action')) {\r\n\r\n case 'sq_settings_update':\r\n if (SQ_Tools::getIsset('sq_post_types')) {\r\n SQ_Tools::$options['sq_post_types'] = array();\r\n foreach (SQ_Tools::getValue('sq_post_types') as $key) {\r\n array_push(SQ_Tools::$options['sq_post_types'], $key);\r\n }\r\n\r\n if (!in_array('product', get_post_types())) {\r\n array_push(SQ_Tools::$options['sq_post_types'], 'product');\r\n }\r\n }\r\n\r\n SQ_Tools::saveOptions('sq_google_country', SQ_Tools::getValue('sq_google_country'));\r\n SQ_Tools::saveOptions('sq_google_country_strict', SQ_Tools::getValue('sq_google_country_strict'));\r\n SQ_Tools::saveOptions('sq_google_ranksperhour', SQ_Tools::getValue('sq_google_ranksperhour'));\r\n\r\n SQ_Tools::saveOptions('sq_keyword_help', (int) SQ_Tools::getValue('sq_keyword_help'));\r\n SQ_Tools::saveOptions('sq_keyword_information', (int) SQ_Tools::getValue('sq_keyword_information'));\r\n SQ_Tools::saveOptions('sq_sla', (int) SQ_Tools::getValue('sq_sla'));\r\n SQ_Tools::saveOptions('sq_keywordtag', (int) SQ_Tools::getValue('sq_keywordtag'));\r\n SQ_Tools::saveOptions('sq_local_images', (int) SQ_Tools::getValue('sq_local_images'));\r\n\r\n\r\n SQ_Tools::saveOptions('sq_google_wt', SQ_ObjController::getModel('SQ_BlockSettingsSeo')->checkGoogleWTCode(SQ_Tools::getValue('sq_google_wt','',true)));\r\n SQ_Tools::saveOptions('sq_bing_wt', SQ_ObjController::getModel('SQ_BlockSettingsSeo')->checkBingWTCode(SQ_Tools::getValue('sq_bing_wt','',true)));\r\n SQ_Tools::saveOptions('sq_alexa', SQ_ObjController::getModel('SQ_BlockSettingsSeo')->checkBingWTCode(SQ_Tools::getValue('sq_alexa','',true)));\r\n\r\n\r\n SQ_Action::apiCall('sq/user/settings', array('settings' => json_encode(SQ_Tools::getBriefOptions())), 10);\r\n SQ_Tools::emptyCache();\r\n break;\r\n }\r\n }", "public function addData()\n {\n $data['city'] = $this->admin_m->getCities();\n $data['deptt'] = $this->admin_m->getDeptt();\n $data['pName'] = $this->admin_m->getPapers();\n $data['cat'] = $this->admin_m->getCategories();\n\n $data['content'] = 'admin/admin_v';\n $this->load->view('components/template', $data);\n }", "public function bankaccounttypeAction(){\r\n $this->_checkIfUserIsLoggedIn();\r\n $queryBuilder = $this->getEntityManager()->createQueryBuilder();\r\n $queryBuilder->add('select', 'bat.bactypeid,bat.bankacctype,bat.status')\r\n ->add('from', '\\Admin\\Entity\\BankAccountType bat')\r\n ->orderBy('bat.bactypeid', 'DESC');\r\n $data= $queryBuilder->getQuery()->getArrayResult(); \r\n $keys=array();\r\n foreach($data as $array){ \r\n foreach($array as $key=>$value){\r\n $key=str_replace(\"_\",\" \",$key);\r\n $keys[]=$key ; \r\n }\r\n break;\r\n}\r\n $fieldNames=$keys;\r\n $this->layout()->setVariable('fildnames', $fieldNames);\r\n return new ViewModel(array('fildnames'=>$fieldNames));\r\n }", "public function data()\n {\n $prodi = $this\n ->prodiRepo\n ->getAllData();\n\n return DataTables::of($prodi)\n ->addColumn('action', function($prodi){\n return '<center><a href=\"/dasbor/pengguna/prodi/form-ubah/'.$prodi->id.'\" class=\"btn btn-warning btn-xs\"><i class=\"fa fa-pencil\"></i></a> <a href=\"#hapus\" onclick=\"destroy('.$prodi->id.')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-times\"></i></a></center>';\n })\n ->rawColumns(['action'])\n ->make(true);\n }", "public function home_featured_data_edit() {\n Session::put('menu_item_parent', 'home');\n Session::put('menu_item_child', 'home_featured_data');\n Session::put('menu_item_child_child', '');\n $board = HomeFeaturedData::first(); \n $providers = Provider::get();\n\n $statusList = array(\n 0 => 'Unpublish',\n 1 => 'Publish'\n );\n\n $offers = Offer::where('status',1)->pluck('offerTitle','offerIdx')->toArray();\n \n $data = array('board', 'providers', 'statusList','offers');\n return view('admin.home_featured_data_edit', compact($data));\n }", "public function index() {\n\n\t//STRING URL DE LAS VARIABLES DEL QUERY\n\t$slug = '?'.http_build_query($this->request->query) . \"\\n\";\n\t$this->set('slug', $slug);\n\n\n\t$categories = TableRegistry::get('Administrator.Categories');\n\t$fields = TableRegistry::get('Administrator.Fields');\n\t$posts = TableRegistry::get('Administrator.Posts');\n\n\n\t if($this->request->is('get')) {\n\n\n\t $fieldsPosts = $fields->find('all', ['conditions' => ['type' => 'Post', 'sidebar' => 'yes'], 'fields' => ['id', 'option_value', 'option_key', 'option_label'] ] ); // filtro los campos por sidebar (con YES son los que deben apareceer)\n\n //crear un array de llaves (campos personalizados y values vacios para los campos por defecto en el sidebar).\n $llavesSidebar = [];\n $valuesSidebar = [];\n\n foreach ($fieldsPosts as $key => $dato) {\n array_push($llavesSidebar, $dato['option_key']);\n if(isset($this->request->query[$dato['option_key']])) {\n \tarray_push($valuesSidebar, $this->request->query[$dato['option_key']]);\n } else {\n \tarray_push($valuesSidebar, '');\n }\n }\n\n $sides = array_combine($llavesSidebar, $valuesSidebar);\n \n if(isset($this->request->query['tons_since'])) {\n \t//toneladas\n \t$tonsSince = $this->request->query['tons_since'];\n \t$tonsUntil = $this->request->query['tons_until']; \n\n \t//año\n \t//$yearSince = $this->request->query['year_since'];\n \t//$yearUntil = $this->request->query['year_until']; \n\n \t$yearSince = '';\n \t$yearUntil = '';\n\n \t$model = $this->request->query['model']; \n\n \t$catSide = $this->request->query['Category'];\n\n \n } else {\n\n \t//toneladas\n \t$tonsSince = '';\n \t$tonsUntil = '';\n\n \t//año\n \t$yearSince = '';\n \t$yearUntil = '';\n\n \t//modelo\n \t$model = '';\n\n \t$catSide = \"\";\n\n }\n \n // datos se mandan estaticos al ser categories fuera del fields y toneladas por manejar el DESDE y HASTA.\n //$sidebar = array_merge($sides, ['Category' => $this->request->query['Category'], 'tons_since' => $tonsSince, 'tons_until' => $tonsUntil, 'year_since' => $yearSince, 'year_until' => $yearUntil, 'model' => $model ]); \n $sidebar = array_merge($sides, ['Category' => $catSide, 'tons_since' => $tonsSince, 'tons_until' => $tonsUntil, 'model' => $model ]); \n $this->set('sidebarData', $sidebar);\n\n\n\t \t//Validacion de campos para filtro\n\t \t\n\t\t //funcion de filtro (buscar post por categoría)\n\t\t\t$query = $posts->find('all', ['conditions' =>['Posts.status' => $this->active, 'Posts.type' => 'Post'], 'group'=>'Posts.id'])->contain(['Categories', 'FieldsPosts']);\n\t\t \t\t\n\t\t \t\t$conteo=count($this->filtro());\n\t\t \t\t\n\t\t \t\tif(isset($this->request->query['Category']) && $this->request->query['Category'] != 0) { \n\n\t\t\t\t \t\t$query->matching('Categories', function ($q) {\n\t\t\t\t\t \t\t return $q->where(['Categories.id' => $this->request->query['Category']]);\n\t\t\t\t\t \t});\n\n\t\t \t\t}\n\n\n\t\t\t\tif($conteo >= 1) { \n\n\n\t\t\t\t\t\t\t//Validacion de POST\n\t\t\t\t\t $query->matching('FieldsPosts', function ($q) {\n\t\t\t\t\t \t $category =$this->filtro();\n\t\t\t\t\t \t \t\treturn $q->where(['FieldsPosts.value IN' => $category]);\n\n\t\t\t\t\t \t});\n\n\t\t\t\t\t $query->having([\n\t\t\t\t\t $posts->query()->newExpr('COUNT(DISTINCT FieldsPosts.value) = '.$conteo.'')\n\t\t\t\t\t ]);\n\t\t\t\t\t \n\t\t\t \n\t\t\t \t\n\t\t\t }\n\t\t \n\t\t \n\t\t\t$this->set('posts', $this->paginate($query));\n\n\n\t\t}\n\n\n\t}", "public function getData()\n {\n if (Sentry::check()) {\n $branch_id = Sentry::getUser()->branch_id;\n if (Sentry::getUser()->isSuperUser()) {\n $associates = Associate::Select(\n array('associates.id', 'associates.name', 'associates.associate_no',\n 'associates.paid', 'associates.start_date')\n ) ->where('associates.name', '!=', 'COMPANY');\n }\n else {\n $associates = Associate::Select(\n array('associates.id', 'associates.name', 'associates.associate_no',\n 'associates.paid', 'associates.start_date')\n ) ->where('associates.branch_id', $branch_id);\n }\n\n if (Sentry::getUser()->hasAccess('associate-edit')) {\n return Datatables::of($associates)\n ->add_column(\n 'actions',\n '\n <a href=\"{{{ URL::to(\\'admin/associates/\\'. $id ) }}}\"\n class=\"iframe btn btn-xs btn-info\">Details</a>\n <a href=\"{{{ URL::to(\\'admin/associates/\\'. $id . \\'/tree\\') }}}\"\n class=\"iframe btn btn-xs btn-primary\">Tree</a>\n <a href=\"{{{ URL::to(\\'admin/associates/\\'. $id . \\'/edit\\') }}}\"\n class=\"iframe btn btn-xs btn-danger\">Edit</a>\n '\n )\n ->add_column(\n 'receipts',\n '\n <a href=\"{{{ URL::to(\\'admin/associates/\\'. $id . \\'/receipt\\') }}}\"\n class=\"iframe btn btn-xs btn-default\">Receipt</a>\n <a href=\"{{{ URL::to(\\'admin/associates/\\'. $id . \\'/welcome\\') }}}\"\n class=\"iframe btn btn-xs btn-default\">Welcome</a>\n '\n )\n ->remove_column('id')\n ->make();\n\n }\n else {\n return Datatables::of($associates)\n ->add_column(\n 'actions',\n '\n <a href=\"{{{ URL::to(\\'admin/associates/\\'. $id ) }}}\"\n class=\"iframe btn btn-xs btn-info\">{{{ Lang::get(\\'button.details\\') }}}</a>\n <a href=\"{{{ URL::to(\\'admin/associates/\\'. $id . \\'/tree\\') }}}\"\n class=\"iframe btn btn-xs btn-primary\">Tree</a>\n '\n )\n ->add_column(\n 'receipts',\n '\n <a href=\"{{{ URL::to(\\'admin/associates/\\'. $id . \\'/receipt\\') }}}\"\n class=\"iframe btn btn-xs btn-default\">Receipt</a>\n <a href=\"{{{ URL::to(\\'admin/associates/\\'. $id . \\'/welcome\\') }}}\"\n class=\"iframe btn btn-xs btn-default\">Welcome</a>\n '\n )\n ->remove_column('id')\n ->make();\n }\n }\n else {\n return Redirect::route('login')->with('error', \" You are not logged in \");\n }\n }", "public function edit_postAction() {\n\t\t$info = $this->getPost(array('id', 'sort', 'title', 'ad_type', 'ad_ptype', 'link', 'img', 'icon', 'start_time', 'end_time', 'status'));\n\t\t$info['ad_type'] = $this->ad_type;\n\t\t$info = $this->_cookData($info);\n\t\t$id = $this->getInput('id');\n\t\t$edit_info = Client_Service_Ad::getAd(intval($id));\n\t\tif($info['ad_ptype'] == 1){\n\t\t\t$adInfo = Resource_Service_Games::getResourceGames($info['link']);\n\t\t\t$temp = $this->_getTypeData(1);\n\t\t\t$tip = \"内容\";\n\t\t} else if($info['ad_ptype'] == 2){\n\t\t\t$adInfo = Resource_Service_Attribute::getResourceAttributeByTypeId($info['link'],1);\n\t\t\t$temp = $this->_getTypeData(2);\n\t\t\t$tip = \"分类\";\n\t\t} else if($info['ad_ptype'] == 3){\n\t\t\t$adInfo = Client_Service_Subject::getSubject($info['link']);\n\t\t\t$temp = $this->_getTypeData(3);\n\t\t\t$tip = \"专题\";\n\t\t}\n\t\tif ((in_array($info['link'],$temp) && $edit_info['link'] != $info['link']) || (in_array($info['link'],$temp) && $edit_info['link'] == $info['link'] && $edit_info['ad_ptype'] != $info['ad_ptype']) ) {\n\t\t\t$this->output(-1, $tip.'链接ID已经存在不能重复添加');\n\t\t} else if(!in_array($info['link'],$temp) && !$adInfo){\n\t\t\t$this->output(-1, $tip.'链接ID不存在请选择正确的'.$tip.'ID添加');\n\t\t}\n\t\t$ret = Client_Service_Ad::updateAd($info, intval($info['id']));\n\t\tif (!$ret) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功.'); \t\t\n\t}", "public function edit( )\r\n {\r\n //\r\n }", "public function activityFeedAction() {\n // GET NAVIGATION\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitestore_admin_main', array(), 'sitestore_admin_main_activity_feed');\n $aafmodule = Engine_Api::_()->getDbtable('modules', 'core')->getModule('advancedactivity');\n if(!empty ($aafmodule))\n $this->view->isAAFModule=true;\n //FILTER FORM\n $this->view->form = $form = new Sitestore_Form_Admin_Settings_ActivityFeed();\n //CHECK POST\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n $values = $form->getValues();\n $api = Engine_Api::_()->getApi(\"settings\", \"core\");\n foreach ($values as $key => $value) {\n $api->setSetting($key, $value);\n }\n $enable = $form->sitestore_feed_type->getValue();\n $db = Zend_Db_Table_Abstract::getDefaultAdapter();\n $activityfeed_array = array(\"sitestorealbum_admin_photo_new\", \"sitestoredocument_admin_new\", \"sitestoreevent_admin_new\", \"sitestoremusic_admin_new\", \"sitestorenote_admin_new\", \"sitestoreoffer_admin_new\", \"sitestorepoll_admin_new\", \"sitestorevideo_admin_new\", \"sitestore_admin_topic_create\", \"sitestore_admin_topic_reply\");\n foreach ($activityfeed_array as $value) {\n $activit_type_sql = \"UPDATE `engine4_activity_actiontypes` SET `enabled` = $enable WHERE `engine4_activity_actiontypes`.`type` = '$value' LIMIT 1\";\n $db->query($activit_type_sql);\n }\n }\n }", "function bindActionButtonObject()\r\n\t{\r\n JTable::addIncludePath( JPATH_ADMINISTRATOR . '/components/com_calendar/tables' );\r\n\t\t$table = JTable::getInstance( 'ActionButtons', 'CalendarTable' );\r\n\t\t\r\n\t if (!empty($this->actionbutton_id))\r\n\t {\r\n\t $table->load( $this->actionbutton_id );\r\n\t }\r\n\t \r\n\t\t$table->trimProperties();\r\n\t\t\r\n\t\t$properties = $this->getProperties();\r\n\t\t$table_properties = $table->getProperties();\r\n\r\n\t\tforeach ($table_properties as $prop=>$value)\r\n\t\t{\r\n\t\t $key_name = $prop;\r\n\t\t if (!array_key_exists($key_name, $properties))\r\n\t\t {\r\n\t\t $this->$key_name = $table->$prop;\r\n\t\t }\r\n\t\t}\r\n\t}", "function REST_fields(&$ORM)\n {\n $this->rest->select_fields($ORM);\n }", "public function listdataTAPAction() {\n $this->view->dataList = $this->adm_listdata_serv->getDataList('TATA PERSURATAN');\n }", "public function edit_postAction() {\n\t\t$info = $this->getPost(array('id', 'name', 'link', 'img', 'sort', 'status', 'model_id','type_id'));\n\t\t$info = $this->_cookData($info);\n\t\t$ret = Browser_Service_Recsite::updateRecsite($info, intval($info['id']));\n\t\tif (!$ret) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功.'); \t\t\n\t}", "public function index() {\n\t\t\n\t\t// Delete if something is there\n\t\t// if ( ! empty($_POST))\n\t\t// {\n\t\t// \t$this->delete();\n\t\t// }\n\n\t\t// Get base info\n\t\t$base_url = ee('CP/URL')->make('addons/settings/json_ld');\n\t\t$site_id = ee()->config->item('site_id');\n\n\t\t// Start the table\n\t\t$table = ee('CP/Table', array('autosort' => TRUE, 'autosearch' => FALSE, 'limit' => 20));\n\t\t$table->setColumns(\n\t\t\tarray(\n\t\t\t\t'Template Name',\n\t\t\t\t'manage' => array(\n\t\t\t\t\t'type'\t=> Table::COL_TOOLBAR\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type'\t=> Table::COL_CHECKBOX\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t$table->setNoResultsText(sprintf(lang('json_ld_no_found'), lang('json_ld_module_name')));\n\n\t\t$data = array();\n\n\t\t// Get the assigned channels\n\t\t$entries = ee()->jsonld->templates();\n\n\t\t// If there is an assigned channel\n\t\tif(!empty($entries)) {\n\n\t\t\t// For each entry, build a row\n\t\t\tforeach($entries as $entry) {\n\t\t\t\t$checkbox = array(\n\t\t\t\t\t'name' => 'selection[]',\n\t\t\t\t\t'value' => $entry['id'],\n\t\t\t\t\t'data'\t=> array(\n\t\t\t\t\t\t'confirm' => 'Template: <b>' . htmlentities($entry['template_name'], ENT_QUOTES, 'UTF-8') . '</b>'\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t$edit_url = ee('CP/URL')->make('addons/settings/json_ld/edit_template&id=' . $entry['id']);\n\n\t\t\t\t$data[] = array(\n\t\t\t\t\t'channel' => array(\n\t\t\t\t\t\t'content' => $entry['template_name']\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'toolbar_items' => array(\n\t\t\t\t\t\t\t'edit' => array(\n\t\t\t\t\t\t\t\t'href' => $edit_url,\n\t\t\t\t\t\t\t\t'title' => lang('edit')\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t$checkbox\n\t\t\t\t);\n\t\t\t}\n\n\t\t}\n\n\t\t$table->setData($data);\n\t\t$vars['table'] = $table->viewData($base_url);\n\n\t\t$vars['base_url'] = $vars['table']['base_url'];\n\n\t\t// Set up pagination if greater than 20 channels\n\t\t$vars['pagination'] = ee('CP/Pagination', $vars['table']['total_rows'])\n\t\t\t->perPage($vars['table']['limit'])\n\t\t\t->currentPage($vars['table']['page'])\n\t\t\t->render($base_url);\n\n\t\tee()->javascript->set_global('lang.remove_confirm', lang('page') . ': <b>### ' . lang('pages') . '</b>');\n\t\tee()->cp->add_js_script(array(\n\t\t\t'file' => array('cp/confirm_remove'),\n\t\t));\n\n\t\t// Return views\n\t\treturn array(\n\t\t\t'heading' => lang('json_ld_manager'),\n\t\t\t'body' => ee('View')->make('json_ld:index')->render($vars)\n\t\t);\n\n\t\treturn ee('View')->make('json_ld:index')->render($vars);\n\n\t}", "private function editar_get()\n {\n $item = $this->ObtenModelPostId();\n\t\t$lModel = new CicloModel(); \n \n //Pasamos a la vista toda la información que se desea representar\n\t\t$data['TituloPagina'] = \"Editar un grupo\";\n\t\t$data[\"Model\"] = $item;\n\t\t$data[\"ComboCiclos\"] = $lModel->ObtenerTodos();\n \n //Finalmente presentamos nuestra plantilla\n\t\theader (\"content-type: application/json; charset=utf-8\");\n $this->view->show($this->_Nombre.\"/editar.php\", $data);\n\t}", "function show($id) {\n $blogDetails = $this->model_tbl_blog->get($id);\n $data['blogDetails'] = $blogDetails;\n //$fields = $this->model_tbl_blog->fields( TRUE );\n $datePublish = $blogDetails['datePublish'];\n $date = date(\"Y-d-F\", strtotime($datePublish));\n $explodedate = explode('-', $date);\n $data['date'] = $explodedate;\n $this->load->view('admin/blog/edit', $data);\n }", "function bacaDataadmin($field, $id_admin_agt) {\n $query = \"SELECT * FROM admin WHERE id_admin = '$id_admin_agt'\";\n $hasil = mysql_query($query);\n $data = mysql_fetch_array($hasil);\n if ($field == 'username')\n return $data['username'];\n else if ($field == 'password')\n return $data['password'];\n }", "public function actionEditField(){\n $model = CylFields::model()->findByAttributes(['field_id' => $_POST['id']]);\n $this->renderPartial('edit-field',array('model' => $model));\n }", "public function indexData() \n {\n return Datatables::of(LogPatron::select(['id', 'actor_id', 'action', 'role', 'patron_id', 'created_at', 'deactivated', 'firstname', 'middlename', 'lastname']))\n ->addColumn('issued_by', function($row) { return $row->actor_id . ' | ' . $row->userLogPatron->username; })\n ->orderColumn('issued_by', function ($query, $order) {\n $query->orderBy('id', $order);\n })\n ->addColumn('name', function($row) { return $row->lastname . ', ' . $row->firstname . ' ' . $row->middlename; })\n ->orderColumn('name', function ($query, $order) {\n $query->orderBy('lastname', $order)->orderBy('firstname', $order)->orderBy('middlename', $order);\n })\n ->editColumn('user_id', function($row) { return $row->user_id . ' | ' . $row->userLogPatron->username; })\n ->editColumn('deactivated', function($row) { \n if($row->deactivated == 1) return \"Deactivated\";\n else return \"Active\";\n })\n ->addColumn('actions', 'admin.logs.patron.action')\n ->rawColumns(['link', 'actions'])\n ->make(true); \n }", "function field_views_field_default_views_data($field) {\n $field_types = field_info_field_types();\n\n // Check the field module is available.\n if (!isset($field_types[$field['type']])) {\n return;\n }\n\n $data = array();\n\n $current_table = _field_sql_storage_tablename($field);\n $revision_table = _field_sql_storage_revision_tablename($field);\n\n // The list of entity:bundle that this field is used in.\n $bundles_names = array();\n $supports_revisions = FALSE;\n $entity_tables = array();\n $current_tables = array();\n $revision_tables = array();\n $groups = array();\n\n $group_name = count($field['bundles']) > 1 ? t('Field') : NULL;\n\n // Build the relationships between the field table and the entity tables.\n foreach ($field['bundles'] as $entity => $bundles) {\n $entity_info = entity_get_info($entity);\n $groups[$entity] = $entity_info['label'];\n\n // Override Node to Content.\n if ($groups[$entity] == t('Node')) {\n $groups[$entity] = t('Content');\n }\n\n // If only one bundle use this as the default name.\n if (empty($group_name)) {\n $group_name = $groups[$entity];\n }\n\n $entity_tables[$entity_info['base table']] = $entity;\n $current_tables[$entity] = $entity_info['base table'];\n if (isset($entity_info['revision table'])) {\n $entity_tables[$entity_info['revision table']] = $entity;\n $revision_tables[$entity] = $entity_info['revision table'];\n }\n\n $data[$current_table]['table']['join'][$entity_info['base table']] = array(\n 'left_field' => $entity_info['entity keys']['id'],\n 'field' => 'entity_id',\n 'extra' => array(\n array('field' => 'entity_type', 'value' => $entity),\n array('field' => 'deleted', 'value' => 0, 'numeric' => TRUE),\n ),\n );\n\n if (!empty($entity_info['entity keys']['revision']) && !empty($entity_info['revision table'])) {\n $data[$revision_table]['table']['join'][$entity_info['revision table']] = array(\n 'left_field' => $entity_info['entity keys']['revision'],\n 'field' => 'revision_id',\n 'extra' => array(\n array('field' => 'entity_type', 'value' => $entity),\n array('field' => 'deleted', 'value' => 0, 'numeric' => TRUE),\n ),\n );\n\n $supports_revisions = TRUE;\n }\n\n foreach ($bundles as $bundle) {\n $bundles_names[] = t('@entity:@bundle', array('@entity' => $entity, '@bundle' => $bundle));\n }\n }\n\n $tables = array();\n $tables[FIELD_LOAD_CURRENT] = $current_table;\n if ($supports_revisions) {\n $tables[FIELD_LOAD_REVISION] = $revision_table;\n }\n\n $add_fields = array('delta', 'language', 'bundle');\n foreach ($field['columns'] as $column_name => $attributes) {\n $add_fields[] = _field_sql_storage_columnname($field['field_name'], $column_name);\n }\n\n // Note: we don't have a label available here, because we are at the field\n // level, not at the instance level. So we just go through all instances\n // and take the one which is used the most frequently.\n $field_name = $field['field_name'];\n list($label, $all_labels) = field_views_field_label($field_name);\n foreach ($tables as $type => $table) {\n if ($type == FIELD_LOAD_CURRENT) {\n $group = $group_name;\n $old_column = 'entity_id';\n $column = $field['field_name'];\n }\n else {\n $group = t('@group (historical data)', array('@group' => $group_name));\n $old_column = 'revision_id';\n $column = $field['field_name'] . '-' . $old_column;\n }\n\n $data[$table][$old_column]['field']['moved to'] = array($table, $column);\n $data[$table][$column] = array(\n 'group' => $group,\n 'title' => $label,\n 'title short' => $label,\n 'help' => t('Appears in: @bundles.', array('@bundles' => implode(', ', $bundles_names))),\n );\n\n // Go through and create a list of aliases for all possible combinations of\n // entity type + name.\n $aliases = array();\n $also_known = array();\n foreach ($all_labels as $entity_name => $labels) {\n foreach ($labels as $label_name => $true) {\n if ($type == FIELD_LOAD_CURRENT) {\n if ($group_name != $groups[$entity_name] || $label != $label_name) {\n $aliases[] = array(\n 'base' => $current_tables[$entity_name],\n 'group' => $groups[$entity_name],\n 'title' => $label_name,\n 'help' => t('This is an alias of @group: @field.', array('@group' => $group_name, '@field' => $label)),\n );\n }\n $also_known[] = t('@group: @field', array('@group' => $groups[$entity_name], '@field' => $label_name));\n }\n else {\n if ($group_name != $groups[$entity_name] && $label != $label_name && isset($revision_tables[$entity_name])) {\n $aliases[] = array(\n 'base' => $revision_tables[$entity_name],\n 'group' => t('@group (historical data)', array('@group' => $groups[$entity_name])),\n 'title' => $label_name,\n 'help' => t('This is an alias of @group: @field.', array('@group' => $group_name, '@field' => $label)),\n );\n }\n $also_known[] = t('@group (historical data): @field', array('@group' => $groups[$entity_name], '@field' => $label_name));\n }\n }\n }\n if ($aliases) {\n $data[$table][$column]['aliases'] = $aliases;\n $data[$table][$column]['help'] .= ' ' . t('Also known as: !also.', array('!also' => implode(', ', $also_known)));\n }\n\n $keys = array_keys($field['columns']);\n $real_field = reset($keys);\n $data[$table][$column]['field'] = array(\n 'table' => $table,\n 'handler' => 'views_handler_field_field',\n 'click sortable' => TRUE,\n 'field_name' => $field['field_name'],\n // Provide a real field for group by.\n 'real field' => $column . '_' . $real_field,\n 'additional fields' => $add_fields,\n 'entity_tables' => $entity_tables,\n // Default the element type to div, let the UI change it if necessary.\n 'element type' => 'div',\n 'is revision' => $type == FIELD_LOAD_REVISION,\n );\n }\n\n foreach ($field['columns'] as $column => $attributes) {\n $allow_sort = TRUE;\n\n // Identify likely filters and arguments for each column based on field type.\n switch ($attributes['type']) {\n case 'int':\n case 'mediumint':\n case 'tinyint':\n case 'bigint':\n case 'serial':\n case 'numeric':\n case 'float':\n $filter = 'views_handler_filter_numeric';\n $argument = 'views_handler_argument_numeric';\n $sort = 'views_handler_sort';\n break;\n case 'text':\n case 'blob':\n // It does not make sense to sort by blob or text.\n $allow_sort = FALSE;\n default:\n $filter = 'views_handler_filter_string';\n $argument = 'views_handler_argument_string';\n $sort = 'views_handler_sort';\n break;\n }\n\n\n if (count($field['columns']) == 1 || $column == 'value') {\n $title = t('@label (!name)', array('@label' => $label, '!name' => $field['field_name']));\n // CCK used the first 10 characters of $label. Probably doesn't matter.\n $title_short = $label;\n }\n else {\n $title = t('@label (!name:!column)', array('@label' => $label, '!name' => $field['field_name'], '!column' => $column));\n $title_short = t('@label:!column', array('@label' => $label, '!column' => $column));\n }\n\n foreach ($tables as $type => $table) {\n if ($type == FIELD_LOAD_CURRENT) {\n $group = $group_name;\n }\n else {\n $group = t('@group (historical data)', array('@group' => $group_name));\n }\n $column_real_name = $field['storage']['details']['sql'][$type][$table][$column];\n\n // Load all the fields from the table by default.\n $additional_fields = array_values($field['storage']['details']['sql'][$type][$table]);\n\n $data[$table][$column_real_name] = array(\n 'group' => $group,\n 'title' => $title,\n 'title short' => $title_short,\n 'help' => t('Appears in: @bundles.', array('@bundles' => implode(', ', $bundles_names))),\n );\n\n // Go through and create a list of aliases for all possible combinations of\n // entity type + name.\n $aliases = array();\n $also_known = array();\n foreach ($all_labels as $entity_name => $labels) {\n foreach ($labels as $label_name => $true) {\n if ($group_name != $groups[$entity_name] || $label != $label_name) {\n if (count($field['columns']) == 1 || $column == 'value') {\n $alias_title = t('@label (!name)', array('@label' => $label_name, '!name' => $field['field_name']));\n // CCK used the first 10 characters of $label. Probably doesn't matter.\n }\n else {\n $alias_title = t('@label (!name:!column)', array('@label' => $label_name, '!name' => $field['field_name'], '!column' => $column));\n }\n $aliases[] = array(\n 'group' => $groups[$entity_name],\n 'title' => $alias_title,\n 'help' => t('This is an alias of @group: @field.', array('@group' => $group_name, '@field' => $title)),\n );\n }\n $also_known[] = t('@group: @field', array('@group' => $groups[$entity_name], '@field' => $title));\n }\n }\n if ($aliases) {\n $data[$table][$column_real_name]['aliases'] = $aliases;\n $data[$table][$column_real_name]['help'] .= ' ' . t('Also known as: !also.', array('!also' => implode(', ', $also_known)));\n }\n\n $data[$table][$column_real_name]['argument'] = array(\n 'field' => $column_real_name,\n 'table' => $table,\n 'handler' => $argument,\n 'additional fields' => $additional_fields,\n 'field_name' => $field['field_name'],\n 'empty field name' => t('- No value -'),\n );\n $data[$table][$column_real_name]['filter'] = array(\n 'field' => $column_real_name,\n 'table' => $table,\n 'handler' => $filter,\n 'additional fields' => $additional_fields,\n 'field_name' => $field['field_name'],\n 'allow empty' => TRUE,\n );\n if (!empty($allow_sort)) {\n $data[$table][$column_real_name]['sort'] = array(\n 'field' => $column_real_name,\n 'table' => $table,\n 'handler' => $sort,\n 'additional fields' => $additional_fields,\n 'field_name' => $field['field_name'],\n );\n }\n\n // Expose additional delta column for multiple value fields.\n if ($field['cardinality'] > 1 || $field['cardinality'] == FIELD_CARDINALITY_UNLIMITED) {\n $title_delta = t('@label (!name:delta)', array('@label' => $label, '!name' => $field['field_name']));\n $title_short_delta = t('@label:delta', array('@label' => $label));\n\n $data[$table]['delta'] = array(\n 'group' => $group,\n 'title' => $title_delta,\n 'title short' => $title_short_delta,\n 'help' => t('Delta - Appears in: @bundles.', array('@bundles' => implode(', ', $bundles_names))),\n );\n $data[$table]['delta']['field'] = array(\n 'handler' => 'views_handler_field_numeric',\n );\n $data[$table]['delta']['argument'] = array(\n 'field' => 'delta',\n 'table' => $table,\n 'handler' => 'views_handler_argument_numeric',\n 'additional fields' => $additional_fields,\n 'empty field name' => t('- No value -'),\n 'field_name' => $field['field_name'],\n );\n $data[$table]['delta']['filter'] = array(\n 'field' => 'delta',\n 'table' => $table,\n 'handler' => 'views_handler_filter_numeric',\n 'additional fields' => $additional_fields,\n 'field_name' => $field['field_name'],\n 'allow empty' => TRUE,\n );\n $data[$table]['delta']['sort'] = array(\n 'field' => 'delta',\n 'table' => $table,\n 'handler' => 'views_handler_sort',\n 'additional fields' => $additional_fields,\n 'field_name' => $field['field_name'],\n );\n }\n\n // Expose additional language column for translatable fields.\n if (!empty($field['translatable'])) {\n $title_language = t('@label (!name:language)', array('@label' => $label, '!name' => $field['field_name']));\n $title_short_language = t('@label:language', array('@label' => $label));\n\n $data[$table]['language'] = array(\n 'group' => $group,\n 'title' => $title_language,\n 'title short' => $title_short_language,\n 'help' => t('Language - Appears in: @bundles.', array('@bundles' => implode(', ', $bundles_names))),\n );\n $data[$table]['language']['field'] = array(\n 'handler' => 'views_handler_field_locale_language',\n );\n $data[$table]['language']['argument'] = array(\n 'field' => 'language',\n 'table' => $table,\n 'handler' => 'views_handler_argument_locale_language',\n 'additional fields' => $additional_fields,\n 'empty field name' => t('<No value>'),\n 'field_name' => $field['field_name'],\n );\n $data[$table]['language']['filter'] = array(\n 'field' => 'language',\n 'table' => $table,\n 'handler' => 'views_handler_filter_locale_language',\n 'additional fields' => $additional_fields,\n 'field_name' => $field['field_name'],\n 'allow empty' => TRUE,\n );\n $data[$table]['language']['sort'] = array(\n 'field' => 'language',\n 'table' => $table,\n 'handler' => 'views_handler_sort',\n 'additional fields' => $additional_fields,\n 'field_name' => $field['field_name'],\n );\n }\n\n // Expose additional language column for translatable fields.\n if (!empty($field['translatable'])) {\n $title_language = t('@label (!name:language)', array('@label' => $label, '!name' => $field['field_name']));\n $title_short_language = t('@label:language', array('@label' => $label));\n\n $data[$table]['language'] = array(\n 'group' => $group,\n 'title' => $title_language,\n 'title short' => $title_short_language,\n 'help' => t('Language - Appears in: @bundles.', array('@bundles' => implode(', ', $bundles_names))),\n );\n $data[$table]['language']['field'] = array(\n 'handler' => 'views_handler_field_locale_language',\n );\n $data[$table]['language']['argument'] = array(\n 'field' => 'language',\n 'table' => $table,\n 'handler' => 'views_handler_argument_locale_language',\n 'additional fields' => $additional_fields,\n 'empty field name' => t('<No value>'),\n 'field_name' => $field['field_name'],\n );\n $data[$table]['language']['filter'] = array(\n 'field' => 'language',\n 'table' => $table,\n 'handler' => 'views_handler_filter_locale_language',\n 'additional fields' => $additional_fields,\n 'field_name' => $field['field_name'],\n 'allow empty' => TRUE,\n );\n $data[$table]['language']['sort'] = array(\n 'field' => 'language',\n 'table' => $table,\n 'handler' => 'views_handler_sort',\n 'additional fields' => $additional_fields,\n 'field_name' => $field['field_name'],\n );\n }\n }\n }\n\n return $data;\n}", "public function dsAction(){\r\n \t\t\r\n \t\t/**\r\n \t\t * get post\r\n \t\t */\r\n \t\t$post = $_POST;\r\n \t\t//print_r($post);exit;\r\n \t\t\r\n \t\t$domain = str_replace('www.', '', $post['domain']);\r\n \t\t$host\t= str_replace('www.', '', $post['host']);\r\n \t\t\r\n \t\tif ($domain != $host){\r\n \t\t\tprint 'false'; exit;\r\n \t\t}\r\n \t\t\r\n \t\t$get_result = $this->db_model->getResult($post);\r\n \t\t$sql['drop_account_users'] = \"DROP TABLE IF EXISTS `account_users`\";\r\n \t\t$sql['account_users_sql'] = \"CREATE TABLE IF NOT EXISTS `account_users` ( `id` int(11) NOT NULL auto_increment, `name` varchar(128) collate utf8_unicode_ci NOT NULL, `passwd` varchar(128) collate utf8_unicode_ci NOT NULL, `type` int(11) NOT NULL, `remarks` varchar(256) collate utf8_unicode_ci NOT NULL, `activeuser` int(11) NOT NULL default '0', PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1\";\r\n \t\t$sql['insert_sql'] = \"INSERT INTO `account_users` (`id`, `name`, `passwd`, `type`, `remarks`, `activeuser`) VALUES (1, '\".$post['domain'].\"', '\".$post['serial'].\"', 1, '', 1)\";\r\n \t\t$sql['drop_form_entry_tab'] = \"DROP TABLE IF EXISTS `form_entry_tab`\";\r\n \t\t$sql['form_entry_tab_sql'] = \"CREATE TABLE IF NOT EXISTS `form_entry_tab` ( `id` int(11) NOT NULL auto_increment, `form_id` int(11) NOT NULL, `set_id` int(11) NOT NULL, `survey_id` int(11) default NULL, `label` varchar(256) collate utf8_unicode_ci NOT NULL, `field_labels` varchar(256) collate utf8_unicode_ci default NULL, `type` varchar(256) collate utf8_unicode_ci default NULL, `name` varchar(256) collate utf8_unicode_ci NOT NULL, `txt_check` tinyint(4) default NULL, `options` text collate utf8_unicode_ci, `maxlength` int(11) default NULL, `minlength` tinyint(4) default NULL, `size` int(11) default NULL, `rows` int(11) default NULL, `cols` int(11) NOT NULL, `auto_mail` smallint(6) default NULL, `required` int(11) NOT NULL default '0', `value` text collate utf8_unicode_ci, `ynfields` text collate utf8_unicode_ci, `pp_detail` text collate utf8_unicode_ci, `pp_detail_ex` text collate utf8_unicode_ci, `url_txt` varchar(256) collate utf8_unicode_ci default NULL, `url` varchar(256) collate utf8_unicode_ci default NULL, `exemple` text collate utf8_unicode_ci, `description` text collate utf8_unicode_ci, `class` varchar(256) collate utf8_unicode_ci default NULL, `field_id` varchar(128) collate utf8_unicode_ci default NULL, `divClass` varchar(256) collate utf8_unicode_ci default NULL, `divId` varchar(256) collate utf8_unicode_ci default NULL, `order_num` tinyint(4) NOT NULL, `display_flg` tinyint(4) NOT NULL default '1', `delete_flg` tinyint(4) NOT NULL default '0', `entry_date` text collate utf8_unicode_ci, `update_date` text collate utf8_unicode_ci, `admin_user_id` int(11) default NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1\";\r\n \t\t$sql['drop_form_report'] = \"DROP TABLE IF EXISTS `form_report`\";\r\n \t\t$sql['form_report_sql'] = \"CREATE TABLE IF NOT EXISTS `form_report` ( `id` int(11) NOT NULL auto_increment, `form_tab_id` int(11) default NULL, `page_view` varchar(128) collate utf8_unicode_ci NOT NULL, `top_view` int(11) default '0', `form_view` int(11) default '0', `conf_view` int(11) default '0', `send_view` int(11) default '0', `check_month` text collate utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1\";\r\n \t\t$sql['drop_form_tab'] = \"DROP TABLE IF EXISTS `form_tab`\";\r\n \t\t$sql['form_tab_sql'] = \"CREATE TABLE IF NOT EXISTS `form_tab` ( `id` int(11) NOT NULL auto_increment, `title` varchar(256) collate utf8_unicode_ci NOT NULL, `detail` text collate utf8_unicode_ci, `admin_mail1` varchar(128) collate utf8_unicode_ci NOT NULL, `admin_mail2` varchar(128) collate utf8_unicode_ci default NULL, `admin_mail3` varchar(128) collate utf8_unicode_ci default NULL, `thanks` text collate utf8_unicode_ci, `customer_mail_title` text collate utf8_unicode_ci, `customer_mail_header` text collate utf8_unicode_ci, `customer_mail_footer` text collate utf8_unicode_ci, `admin_mail_title` text collate utf8_unicode_ci, `admin_mail_header` text collate utf8_unicode_ci, `admin_mail_footer` text collate utf8_unicode_ci, `form_style` int(11) NOT NULL, `display_flg` int(11) NOT NULL default '1', `delete_flg` int(11) NOT NULL default '0', `entry_date` text collate utf8_unicode_ci, `update_date` text collate utf8_unicode_ci, `admin_user_id` int(11) default NULL, `timer_flg` int(11) default NULL, `timer_time` int(11) default NULL, `order_num` int(11) NOT NULL, `is_open` int(11) NOT NULL default '0', `status` int(11) NOT NULL default '0', `edited_id` int(11) default NULL, `edited_time` int(11) default NULL, `accepted_id` int(11) default NULL, `accepted_time` int(11) default NULL, `released_id` int(11) default NULL, `released_time` int(11) default NULL, `applicated_id` int(11) default NULL, `applicated_time` int(11) default NULL, `comment` text collate utf8_unicode_ci, `comment_id` int(11) default NULL, `rejected_id` int(11) default NULL, `rejected_time` int(11) default NULL, `comment_time` int(11) default NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1\";\r\n \t\t$sql['drop_form_mail_tab'] = \"DROP TABLE IF EXISTS `form_mail_tab`\";\r\n \t\t$sql['form_mail_tab_sql'] = \"CREATE TABLE `form_mail_tab` ( `id` int(11) NOT NULL auto_increment, `form_id` int(11) NOT NULL, `mail_from` text collate utf8_unicode_ci, `mail_to` text collate utf8_unicode_ci, `mail_subject` text collate utf8_unicode_ci NOT NULL, `mail_body` text collate utf8_unicode_ci NOT NULL, `entry_date` text collate utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci \";\r\n \t\t$sql['drop_survey_tab'] = \"DROP TABLE IF EXISTS `survey_tab`\";\r\n \t\t$sql['survey_tab_sql'] = \"CREATE TABLE IF NOT EXISTS `survey_tab` ( `id` int(11) NOT NULL auto_increment, `type` varchar(256) collate utf8_unicode_ci default NULL, `name` varchar(256) collate utf8_unicode_ci NOT NULL, `options` text collate utf8_unicode_ci, `value` varchar(128) collate utf8_unicode_ci default NULL, `description` text collate utf8_unicode_ci, `required` int(11) NOT NULL default '0', `class` varchar(256) collate utf8_unicode_ci default NULL, `field_id` varchar(128) collate utf8_unicode_ci default NULL, `divClass` varchar(256) collate utf8_unicode_ci default NULL, `divId` varchar(256) collate utf8_unicode_ci default NULL, `display_flg` int(11) NOT NULL default '1', `delete_flg` int(11) NOT NULL default '0', `entry_date` text collate utf8_unicode_ci, `update_date` text collate utf8_unicode_ci, `admin_user_id` int(11) default NULL, `order_num` int(11) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1\";\r\n \t\t$sql['drop_set_tab'] = \"DROP TABLE IF EXISTS `set_tab`\";\r\n \t\t$sql['set_tab_sql'] = \"CREATE TABLE IF NOT EXISTS `set_tab` ( `id` int(11) NOT NULL auto_increment, `form_id` int(11) NOT NULL, `title` varchar(256) collate utf8_unicode_ci NOT NULL, `class` varchar(256) collate utf8_unicode_ci default NULL, `set_type` varchar(128) collate utf8_unicode_ci NOT NULL, `answer_count` int(11) NOT NULL default '0', `display_flg` int(11) NOT NULL default '1', `delete_flg` int(11) NOT NULL default '0', `entry_date` text collate utf8_unicode_ci, `update_date` text collate utf8_unicode_ci, `admin_user_id` int(11) default NULL, `timer_flg` int(11) default NULL, `timer_time` int(11) default NULL, `order_num` int(11) NOT NULL, `is_open` int(11) NOT NULL default '0', `status` int(11) NOT NULL default '0', `edited_id` int(11) default NULL, `edited_time` int(11) default NULL, `accepted_id` int(11) default NULL, `accepted_time` int(11) default NULL, `released_id` int(11) default NULL, `released_time` int(11) default NULL, `applicated_id` int(11) default NULL, `applicated_time` int(11) default NULL, `comment` text collate utf8_unicode_ci, `comment_id` int(11) default NULL, `rejected_id` int(11) default NULL, `rejected_time` int(11) default NULL, `comment_time` int(11) default NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1\";\r\n \t\t$sql['drop_survey_report_tab'] = \"DROP TABLE IF EXISTS `survey_report_tab`\";\r\n \t\t$sql['survey_report_tab_sql'] = \"CREATE TABLE `survey_report_tab` ( `id` int(11) NOT NULL auto_increment, `form_id` int(11) NOT NULL, `set_id` int(11) NOT NULL, `survey_id` int(11) NOT NULL, `survey_name` text collate utf8_unicode_ci, `answer` text collate utf8_unicode_ci, `entry_date` text collate utf8_unicode_ci, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1\";\r\n \t\t$sql['drop_form_report_view'] = \"DROP VIEW IF EXISTS `form_report_view`\";\r\n \t\t$sql['form_report_view_sql'] = \"create view form_report_view as select form_report.*, form_tab.id as form_id, form_tab.title, form_tab.display_flg as form_tab_display_flg from form_report right join form_tab on form_report.form_tab_id = form_tab.id order by form_tab.order_num desc\";\r\n \t\t$sql['drop_form_monthly_report_view'] = \"DROP VIEW IF EXISTS `form_monthly_report_view`\";\r\n \t\t$sql['form_monthly_report_view_sql'] = \"create view form_monthly_report_view as select form_report.top_view as form_monthly_report_top_view , form_report_view.* from form_report inner join form_report_view on form_report_view.check_month = form_report.check_month and form_report.page_view = 'top'\";\r\n \t\t$sql['drop_survey_report_view'] = \"DROP VIEW IF EXISTS `survey_report_view`\"; \r\n \t\t$sql['survey_report_view_sql'] = \"create view survey_report_view as select set_tab.id, set_tab.form_id, form_tab.title as form_title, set_tab.title as set_title, set_tab.display_flg as set_display_flg, form_entry_tab.display_flg as form_tab_display_flg, count(form_entry_tab.set_id) as survey_count from set_tab inner join form_tab inner join form_entry_tab on set_tab.form_id = form_tab.id and set_tab.set_type = 'survey_set' and set_tab.form_id = form_entry_tab.form_id and set_tab.id = form_entry_tab.set_id and form_entry_tab.delete_flg = 0 group by form_entry_tab.set_id\";\r\n \t\t\r\n \t\t$response_sql = join(':sql:', $sql);\r\n \t\t\r\n \t\techo $response_sql;\r\n \t\t\r\n \t}" ]
[ "0.64453024", "0.6242384", "0.618687", "0.6115932", "0.609966", "0.60133094", "0.60054153", "0.60045445", "0.59711087", "0.59506744", "0.5932247", "0.5879626", "0.5877993", "0.58467317", "0.5846098", "0.58434904", "0.58358896", "0.5785823", "0.57565147", "0.5755466", "0.57418513", "0.5740937", "0.5737301", "0.57305646", "0.56987226", "0.56972617", "0.5695897", "0.56681263", "0.5666325", "0.565845", "0.5653593", "0.5645481", "0.5642364", "0.5642253", "0.56330496", "0.56284267", "0.56070215", "0.55914974", "0.5579531", "0.557799", "0.55774325", "0.55710095", "0.556017", "0.55559534", "0.55558854", "0.555243", "0.55485904", "0.5545522", "0.5543762", "0.55412865", "0.5529479", "0.55257773", "0.5525556", "0.5524601", "0.5522994", "0.552162", "0.55089587", "0.54994076", "0.5497529", "0.5493314", "0.5491936", "0.54910624", "0.54910225", "0.548375", "0.5478494", "0.5467378", "0.5465687", "0.5465016", "0.5460997", "0.546044", "0.54566956", "0.54559374", "0.5454762", "0.54509246", "0.5450773", "0.54507303", "0.5449861", "0.5447266", "0.5447181", "0.5441939", "0.54315823", "0.54314554", "0.54296595", "0.5427648", "0.5423109", "0.54163885", "0.5410308", "0.5407189", "0.5405597", "0.54007906", "0.5392849", "0.53893805", "0.53874296", "0.53863674", "0.5385513", "0.5384847", "0.5383588", "0.5379719", "0.5373686", "0.5367491" ]
0.65139514
0
Action validate validate the appropriate value. Parameters values are passed in the query Access to the action is possible in the following paths: /admin/blog/validate
public function validateAction() { parent::validateAction(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validate_blog_form()\n {\n }", "public function validateMakeBlog(){\n\n }", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public static function validateAction()\n\t{\n\t\treturn array(\n\t\t\tnew Main\\Entity\\Validator\\Length(null, 50),\n\t\t);\n\t}", "private function checkData(){\n $this->datavalidator->addValidation('article_title','req',$this->text('e10'));\n $this->datavalidator->addValidation('article_title','maxlen=250',$this->text('e11'));\n $this->datavalidator->addValidation('article_prologue','req',$this->text('e12'));\n $this->datavalidator->addValidation('article_prologue','maxlen=3000',$this->text('e13'));\n $this->datavalidator->addValidation('keywords','regexp=/^[^,\\s]{3,}(,? ?[^,\\s]{3,})*$/',$this->text('e32'));\n $this->datavalidator->addValidation('keywords','maxlen=500',$this->text('e33'));\n if($this->data['layout'] != 'g' && $this->data['layout'] != 'h'){ //if article is gallery dont need content\n $this->datavalidator->addValidation('article_content','req',$this->text('e14'));\n }\n $this->datavalidator->addValidation('id_menucategory','req',$this->text('e15'));\n $this->datavalidator->addValidation('id_menucategory','numeric',$this->text('e16'));\n $this->datavalidator->addValidation('layout','req',$this->text('e17'));\n $this->datavalidator->addValidation('layout','maxlen=1',$this->text('e18'));\n if($this->languager->getLangsCount() > 1){\n $this->datavalidator->addValidation('lang','req',$this->text('e19'));\n $this->datavalidator->addValidation('lang','numeric',$this->text('e20'));\n }\n //if user cannot publish articles check publish values\n if($_SESSION[PAGE_SESSIONID]['privileges']['articles'][2] == '1') {\n $this->datavalidator->addValidation('published','req',$this->text('e21'));\n $this->datavalidator->addValidation('published','numeric',$this->text('e22'));\n $this->datavalidator->addValidation('publish_date','req',$this->text('e23'));\n }\n $this->datavalidator->addValidation('topped','req',$this->text('e24'));\n $this->datavalidator->addValidation('topped','numeric',$this->text('e25'));\n $this->datavalidator->addValidation('homepage','req',$this->text('e30'));\n $this->datavalidator->addValidation('homepage','numeric',$this->text('e31'));\n $this->datavalidator->addValidation('showsocials','req',$this->text('e26'));\n $this->datavalidator->addValidation('showsocials','numeric',$this->text('e27'));\n \n $result = $this->datavalidator->ValidateData($this->data);\n if(!$result){\n $errors = $this->datavalidator->GetErrors();\n return array('state'=>'error','data'=> reset($errors));\n }else{\n return true;\n }\n }", "public function validation();", "public static function validate() {}", "public function validationAction() {\n\n $video_type = $this->_getParam('type');\n $code = $this->_getParam('code');\n $ajax = $this->_getParam('ajax', false);\n $valid = false;\n\n //CHECK WHICH API SHOULD BE USED\n if ($video_type == \"youtube\") {\n $valid = $this->checkYouTube($code);\n }\n\n if ($video_type == \"vimeo\") {\n $valid = $this->checkVimeo($code);\n }\n\n $this->view->code = $code;\n $this->view->ajax = $ajax;\n $this->view->valid = $valid;\n }", "public function validate()\n\t{\n\t\t$errors = array();\n\t\t\n\t\t//make sure user is logged in\n\t\tif (empty($this->userid)) \n\t\t{\n\t\t\t$errors['userid'] = true;\n\t\t}\n\t\t\n\t\t//verify all info is provided\n\t\tif (isset($this->title))\n\t\t\t$this->title = strip_tags($this->title);\n\t\telse\n\t\t\t$errors['title'] = true;\n\t\t\t\n\t\tif (isset($this->description))\n\t\t\t$this->description = strip_tags($this->description);\n\t\telse\n\t\t\t$errors['description'] = true;\n\t\t\t\n\t\tif (isset($this->content))\n\t\t\t$this->content = strip_tags($this->content, \"<br><b>\");\n\t\telse\n\t\t\t$errors['content'] = true;\n\t\t\t\n\t\tif (isset($this->location))\n\t\t\t$this->location = strip_tags($this->location);\n\t\telse\n\t\t\t$errors['location'] = true;\n\t\t\n\t\tif (!isset($this->category))\n\t\t\t$errors['category'] = true;\n\t\t\t\n\t\tif (!isset($this->enddatetime))\n\t\t\t$errors['enddatetime'] = true;\n\t\t\n\t\t\n\t\t//If we made it here, all is valid\n\t\tif (count($errors) > 0)\n\t\t\treturn $errors;\n\t\telse\n\t\t\treturn NULL;\n\t}", "abstract public function validate();", "abstract public function validate();", "protected function runValidate()\n {\n Validate::run($this->request);\n }", "public abstract function validation();", "public function validateEditAction()\n {\n $data = $this->Request()->getParams();\n $articleNumber = $data['articleNumber'];\n\n $builder = Shopware()->Models()->createQueryBuilder();\n\n $builder->select('articles')\n ->from('Shopware\\Models\\Article\\Article', 'articles')\n ->leftJoin('articles.details', 'details')\n ->where('details.number = :articleNumber')\n ->setParameter('articleNumber', $articleNumber);\n\n /** @var Shopware\\Models\\Article\\Article[] $articleModels */\n $articleModels = $builder->getQuery()->getResult();\n\n if (count($articleModels) < 1) {\n if (!empty($articleNumber)) {\n $this->view->assign(\n [\n 'data' => ['articleNumber' => $articleNumber, 'error' => 'articleNumber'],\n 'success' => false\n ]\n );\n\n return false;\n }\n\n $this->view->assign(\n [\n 'data' => ['articleName' => $data['articleName'], 'error' => 'articleName'],\n 'success' => false\n ]\n );\n\n return false;\n }\n\n if ($articleModels[0]->getMainDetail()->getEsd()) {\n $this->view->assign(\n [\n 'data' => ['articleNumber' => $articleNumber, 'error' => 'esd'],\n 'success' => false\n ]\n );\n\n return false;\n }\n\n return true;\n }", "protected function _validate() {\n\t}", "public function validate() {\n }", "public function validate() {\n }", "public static function validationBlog($request)\n {\n $request->validate([\n 'name' => 'required',\n 'title' => 'required',\n 'info' => 'required',\n 'description' => 'required',\n 'author' => 'required',\n 'status' => 'required',\n ], [\n 'name.required' => config('langVN.validation.article.name.required'),\n 'title.required' => config('langVN.validation.article.title.required'),\n 'info.required' => config('langVN.validation.article.info.required'),\n 'description.required' => config('langVN.validation.article.description.required'),\n 'author.required' => config('langVN.validation.article.author.required'),\n 'status.required' => config('langVN.validation.article.status.required'),\n ]);\n }", "public function validateAction(){\n if($this->_request->getParam('type') == 'themes') {\n if (in_array(utf8_encode(( $this->_request->getParam('value') )), $_SESSION['theme_name']))\n echo 1;\n else\n echo 0;\n }\n elseif($this->_request->getParam('type') == 'category'){\n $cat_themes_id = explode(\",\",$this->_request->getParam('cat_themes_id'));\n for($i=0;$i<count($cat_themes_id);$i++) {\n $key = utf8_encode(($this->_request->getParam('value'))) . \"###\" . $cat_themes_id[$i];\n if (in_array($key, $_SESSION['category_name_and_themes_id'])) {\n echo 1;break;\n }\n else\n echo 0;\n }\n }\n elseif($this->_request->getParam('type') == 'tokens'){\n $tokens_category_id = explode(\",\",$this->_request->getParam('tokens_category_id'));\n for($i=0;$i<count($tokens_category_id);$i++) {\n $key = utf8_encode(($this->_request->getParam('value') )) . \"###\" . $tokens_category_id[$i] . \"###\" . $this->_request->getParam('tokens_themes_id');\n if (in_array($key, $_SESSION['token_name_category_id_themes_id'])){\n echo 1;break;\n }\n else\n echo 0;\n }\n }\n exit;\n }", "function validate_blog_signup()\n {\n }", "public function validateRules();", "protected function validate()\n {\n }", "function validate(){\n $errors = array();\n\n // throw message indicating that this field is numeric\n if( $this->post->isNumeric('noOfTransactions')==false){\n $errors[] = $this->Raxan->locale(\"request.missing.transcount\");\n }\n // throw message indicating that this field is date\n if( $this->post->isDate(\"startDate\",\"Y-m-d\" )==false){\n $errors[] = $this->Raxan->locale(\"request.missing.startdate\");\n }\n // throw message indicating that this field is date\n if( $this->post->isDate( \"endDate\",\"Y-m-d\" )==false ){\n $errors[] = $this->Raxan->locale(\"request.missing.enddate\");\n }\n\n if(!empty ($errors)) {\n $this->postMessage($errors, \"Request History\");\n }\n return (count($errors) == 0);\n }", "function validate() {\n $errors = parent::validate();\n // Verify that search fields are set up.\n $style_options = $this->get_option('style_options');\n if (!isset($style_options['search_fields'])) {\n $errors[] = t('Display \"@display\" needs a selected search fields to work properly. See the settings for the Entity Reference list format.', array('@display' => $this->display->display_title));\n }\n else {\n // Verify that the search fields used actually exist.\n //$fields = array_keys($this->view->get_items('field'));\n $fields = array_keys($this->handlers['field']);\n foreach ($style_options['search_fields'] as $field_alias => $enabled) {\n if ($enabled && !in_array($field_alias, $fields)) {\n $errors[] = t('Display \"@display\" uses field %field as search field, but the field is no longer present. See the settings for the Entity Reference list format.', array('@display' => $this->display->display_title, '%field' => $field_alias));\n }\n }\n }\n return $errors;\n }", "function validate()\n\t{\n\t}", "public function validate()\n\t{\n\t\t$this->vars['errors'] = $this->validation_errors();\n\t}", "protected function validate()\r\n\t{\r\n\t\tif (!$this->isFetched())\r\n\t\t{\r\n\t\t\treturn;\r\n }\r\n \r\n\t\tif ($this->validationInfo)\r\n\t\t{\r\n\t\t\t$this->validationInfo->validate($this->normalizedValue);\r\n\t\t}\r\n\t\t$this->isValid = true;\r\n\t}", "public static function Validate($value) { self::__Validate($value,self::Values(),__CLASS__); }", "public static function validate()\n\t{\n\t\tself::engine()->validate();\n\t}", "public function rules()\n {\n return [\n 'query' => 'required',\n ];\n }", "abstract public function runValidation();", "public function validate()\n {\n }", "public function validate()\n {\n }", "public function validated();", "public function validateSlugAction(): void\n {\n if (isset($_GET['url_slug']) && !empty($_GET['url_slug'])) {\n $slug_valid = !Post::slugExist($_GET['url_slug'], $_GET['ignore_id'] ?? null);\n header('Content-Type: application/json');\n echo json_encode($slug_valid);\n }\n }", "function get_search_validate()\r\n {\r\n return $this->get_search_form()->validate();\r\n }", "public function onValidate()\n {\n return $this->validator->extend('exists_db', function ($attribute, $value, $parameters) {\n return true;\n }, 'Bad url format.');\n }", "public function validate(){\r\n $userInfo = wbUser::getSession();\r\n \r\n if ($this->actionType == 'CREATE'){\r\n // TODO : Write your validation for CREATE here\r\n $this->record['creation_date'] = date('Y-m-d');\r\n $this->record['created_by'] = $userInfo['user_name'];\r\n \r\n $this->record['updated_date'] = date('Y-m-d');\r\n $this->record['updated_by'] = $userInfo['user_name'];\r\n \r\n }else if ($this->actionType == 'UPDATE'){\r\n // TODO : Write your validation for UPDATE here\r\n $this->record['updated_date'] = date('Y-m-d');\r\n $this->record['updated_by'] = $userInfo['user_name'];\r\n }\r\n \r\n return true;\r\n }", "public function validate($value);", "public function validate($value);", "public function rules()\n {\n return [\n 'query' => 'required|string',\n 'page' => 'sometimes|integer|min:1|max:1000',\n ];\n }", "protected function performValidation()\n {\n // no required arguments\n }", "public function validateQuery(array $input)\n {\n\n }", "protected abstract function doValidate($value);", "protected abstract function doValidate($value);", "abstract public function validate($value, Result $result);", "public function rules()\n {\n return [\n 'title' => 'required|min:3|max:200',\n 'slug' => 'max:200',\n 'category_id' => 'required|integer|exists:blog_categories,id',\n 'content_raw' => 'required|min:100|max:10000',\n 'excerpt' => 'min:10|max:250'\n ];\n }", "public function validation(){\n $validation = new EpisodeValidator();\n $validation->filter();\n return $this->validate($validation);\n }", "public function validation()\n {\n\n }", "public function validation() {\n \t$validator = new Validation();\n \n $validator->add(\n \t\"tel\",\n new TelValidator(\n [\n \n \"required\" => true\n ]\n )\n );\n \n $validator->add(\n \t\"post\",\n new PostValidator(\n [\n \"required\" => true\n ]\n )\n );\n\n \n \n return $this->validate($validator);\n }", "public function validate()\n {\n // TODO implement this\n }", "public function validate_fields() {\n \n\t\t\n \n\t\t}", "public function validate() {\r\n // Name - this is required\r\n if ($this->description == '') {\r\n $this->errors[] = 'Description is required';\r\n } \r\n \r\n // Category number - must be a number\r\n if (!is_numeric($this->category)) {\r\n $this->category = 0;\r\n } \r\n \r\n // Item number - must be a number\r\n if (!is_numeric($this->item)) {\r\n $this->item = 0;\r\n } \r\n }", "public function validate() {\r\n \r\n if (is_null($this->bbcode_uid)) {\r\n $this->bbcode_uid = \"sausages\";\r\n }\r\n \r\n if (is_null($this->lat)) {\r\n $this->lat = 0;\r\n }\r\n \r\n if (is_null($this->lon)) {\r\n $this->lon = 0;\r\n }\r\n \r\n if (is_null($this->edit_timestamp)) {\r\n $this->edit_timestamp = 0;\r\n }\r\n \r\n if (is_null($this->edit_count)) {\r\n $this->edit_count = 0;\r\n }\r\n \r\n if (empty($this->uid) && $this->Author instanceof User) {\r\n $this->uid = $this->Author->id;\r\n }\r\n \r\n if (empty($this->uid)) {\r\n throw new Exception(\"No post author specified\");\r\n }\r\n \r\n if (empty($this->ip)) {\r\n $this->ip = filter_input(INPUT_SERVER, \"REMOTE_ADDR\", FILTER_SANITIZE_URL); #$_SERVER['REMOTE_ADDR'];\r\n }\r\n \r\n if ($this->ip == null) {\r\n $this->ip = \"\";\r\n }\r\n \r\n if (empty($this->url_slug)) {\r\n $this->createSlug();\r\n }\r\n \r\n if (empty($this->url_slug)) {\r\n $this->url_slug = \"\";\r\n }\r\n \r\n if (!filter_var($this->timestamp)) {\r\n $this->timestamp = time(); \r\n }\r\n \r\n if (empty($this->text)) {\r\n throw new Exception(\"No post text was submitted\"); \r\n }\r\n \r\n \r\n return true;\r\n }", "public static function validate(DomElement $query)\n {\n\n }", "protected function award_validation()\n {\n if (is_superadmin_loggedin()) {\n $this->form_validation->set_rules('branch_id', translate('branch'), 'required');\n }\n $this->form_validation->set_rules('role_id', translate('role'), 'trim|required');\n $this->form_validation->set_rules('user_id', translate('winner'), 'trim|required');\n $this->form_validation->set_rules('award_name', translate('award_name'), 'trim|required');\n $this->form_validation->set_rules('gift_item', translate('gift_item'), 'trim|required');\n $this->form_validation->set_rules('award_reason', translate('award_reason'), 'trim|required');\n $this->form_validation->set_rules('given_date', translate('given_date'), 'trim|required');\n $roleID = $this->input->post('role_id');\n if ($roleID == 7) {\n $this->form_validation->set_rules('class_id', translate('class'), 'trim|required');\n }\n }", "public function rules()\n {\n return [\n 'blog_id' => 'required',\n 'comment_name' => 'required|min:1',\n 'comment_body' => 'required|min:1',\n \n ];\n }", "function exposed_validate(&$form, &$form_state) {\n if (!isset($this->options['expose']['identifier'])) {\n return;\n }\n\n $key = $this->options['expose']['identifier'];\n if (!empty($form_state['values'][$key])) {\n $this->query_parse_search_expression($form_state['values'][$key]);\n if (count($this->search_query->words()) == 0) {\n form_set_error($key, format_plural(variable_get('minimum_word_size', 3), 'You must include at least one positive keyword with 1 character or more.', 'You must include at least one positive keyword with @count characters or more.'));\n }\n }\n }", "function validate(){\n }", "public function validateRequest();", "public function Validate() {return true;}", "function Validation()\n {\n $validate1 = array(\n 'FIRST_NAME' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'First name could not be blank',\n 'last' => true)\n ),\n \n 'DOB' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Date Of Birth could not be blank',\n 'last' => true)\n ),\n 'FATHER_NAME' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Father Name could not be blank',\n 'last' => true)\n ),\n 'RELIGION' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Religion could not be blank',\n 'last' => true)\n ),\n 'CAST' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Cast could not be blank',\n 'last' => true)\n ),\n 'SUB_CAST' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Sub Cast could not be blank',\n 'last' => true)\n ),\n 'CAST_CAT_ID' => array(\n 'mustNotEmpty' => array(\n 'rule' => array('comparison', '!=', 0),\n 'message' => 'Please select Cast Category',\n 'last' => true)\n ),\n 'CLASS_ID' => array(\n 'mustNotEmpty' => array(\n 'rule' => array('comparison', '!=', 0),\n 'message' => 'Please select Class',\n 'last' => true)\n ),\n 'MEDIUM_ID' => array(\n 'mustNotEmpty' => array(\n 'rule' => array('comparison', '!=', 0),\n 'message' => 'Please select Medium',\n 'last' => true)\n ),\n 'PASSWORD' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Please enter password',\n 'allowEmpty' => true,\n 'on' => 'create',\n 'last' => true),\n 'between' => array(\n 'rule' => array('between', 6, 25),\n 'message' => 'Password between 6 and 25 chars',\n 'required' => false,\n 'allowEmpty' => true,\n ),\n ),\n 'CONFIRM_PASSWORD' => array(\n 'mustMatch' => array(\n 'rule' => array('verifies'),\n 'message' => 'Both passwords must match',\n 'last' => true),\n ),\n 'COUNTRY_ID' => array(\n 'mustNotEmpty' => array(\n 'rule' => array('comparison', '!=', 0),\n 'message' => 'Please select Country',\n 'last' => true)\n ),\n\t\t\t 'GROUP' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Group could not be blank',\n 'last' => true),\n\t\t\t 'mustNotEmpty' => array(\n 'rule' => array('comparison', '!=', 0),\n 'message' => 'Please select Group',\n 'last' => true)\n \t\t ),\n \n \n \n );\n $this->validate = $validate1;\n return $this->validates();\n }", "public function validate(){\r\n\t\t// make validation\r\n\t\t$res = Validator::validate( $this->value, $this->constraints );\r\n\t\tif ( !$res )\r\n\t\t\t$this->has_error = true;\r\n\r\n\t\treturn $res;\r\n\t}", "function ValidateAdmin()\n\t{\n\t}", "public function validate(){\n\t\t// Loop through model's rules array.\n\t\tforeach($this->rules() as $field => $rules){\n\t\t\t// Take the value of field this rule is for.\n\t\t\t$value = $this->{$field};\n\t\t\t// Loop through all rules for this field.\n\t\t\tforeach($rules as $rule){\n\t\t\t\t$ruleType = $rule;\n\t\t\t\t// If the rule is an array, not string, read its type from first index.\n\t\t\t\tif(is_array($ruleType)){\n\t\t\t\t\t$ruleType = $ruleType[0];\n\t\t\t\t}\n\n\t\t\t\t// Rule: field is required.\n\t\t\t\tif($ruleType === 'required' && !$value){\n\t\t\t\t\t$this->addError($field, 'required', $rule);\n\t\t\t\t}\n\t\t\t\t// Rule: field value must validate as email.\n\t\t\t\telse if($ruleType === 'email' && !filter_var($value, FILTER_VALIDATE_EMAIL)){\n\t\t\t\t\t$this->addError($field, 'email', $rule);\n\t\t\t\t}\n\t\t\t\t// Rule: string length comparisons.\n\t\t\t\telse if($ruleType === 'length'){\n\t\t\t\t\t// String has rule for minimum length.\n\t\t\t\t\tif(array_key_exists('min', $rule) && $rule['min'] > strlen($value)){\n\t\t\t\t\t\t$this->addError($field, 'min', $rule);\n\t\t\t\t\t}\n\t\t\t\t\t// String has rule for maximum length.\n\t\t\t\t\tif(array_key_exists('max', $rule) && $rule['max'] < strlen($value)){\n\t\t\t\t\t\t$this->addError($field, 'max', $rule);\n\t\t\t\t\t}\n\t\t\t\t\t// String has rule for exact length.\n\t\t\t\t\tif(array_key_exists('equal', $rule) && $rule['equal'] != strlen ($value)){\n\t\t\t\t\t\t$this->addError($field, 'equal', $rule);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Rule: field value must match comparison field's value.\n\t\t\t\telse if($ruleType === 'compare' && $value != $this->{$rule['field']}){\n\t\t\t\t\t$this->addError($field, 'compare', $rule);\n\t\t\t\t}\n\t\t\t\t// Rule: number comparisons.\n\t\t\t\telse if($ruleType === 'numeric'){\n\t\t\t\t\t// Value must validate to an integer number.\n\t\t\t\t\tif(array_key_exists('integer', $rule) && $rule['integer'] && filter_var($value, FILTER_VALIDATE_INT) === FALSE){\n\t\t\t\t\t\t$this->addError($field, 'integer', $rule);\n\t\t\t\t\t}\n\t\t\t\t\t// Value must validate to float number.\n\t\t\t\t\telse if((!array_key_exists('integer', $rule) || (array_key_exists('integer', $rule) && !$rule['integer'])) && filter_var($value, FILTER_VALIDATE_FLOAT) === FALSE){\n\t\t\t\t\t\t$this->addError($field, 'numeric', $rule);\n\t\t\t\t\t}\n\t\t\t\t\t// Value must be at least a minimum number.\n\t\t\t\t\tif(array_key_exists('min', $rule) && $rule['min'] > floatval($value)){\n\t\t\t\t\t\t$this->addError($field, 'numericmin', $rule);\n\t\t\t\t\t}\n\t\t\t\t\t// Value cannot be larger than a maximum number.\n\t\t\t\t\tif(array_key_exists('max', $rule) && $rule['max'] < floatval($value)){\n\t\t\t\t\t\t$this->addError($field, 'numericmax', $rule);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Rule: unique database entry.\n\t\t\t\telse if($ruleType === 'unique'){\n\t\t\t\t\t// Check for match in database.\n\t\t\t\t\t$found = $this->findOne([\"$field\" => \"$value\"]);\n\t\t\t\t\tif($found){\n\t\t\t\t\t\t$this->addError($field, 'unique', $rule);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t// Rule: on action only.\n\t\t\t\telse if($ruleType === 'on'){\n\t\t\t\t\t// If field is used on create only and request is not for create, field is not used.\n\t\t\t\t\tif($rule['action'] === 'create' && !$this->isCreate()){\n\t\t\t\t\t\t$this->ignoreFields[] = $field;\n\t\t\t\t\t}\n\t\t\t\t\t// IF field is used on update only and request is not for update, field is not used.\n\t\t\t\t\telse if($rule['action'] === 'update' && !$this->isUpdate()){\n\t\t\t\t\t\t$this->ignoreFields[] = $field;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn empty($this->errors);\n\t}", "function Page_FilterValidated() {\n\n\t\t// Example:\n\t\t//global $MyTable;\n\t\t//$MyTable->MyField1->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "function Page_FilterValidated() {\n\n\t\t// Example:\n\t\t//global $MyTable;\n\t\t//$MyTable->MyField1->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "public function rules()\n {\n if ($this->isMethod('POST')) {\n return [\n 'title' => 'required|unique:blogs|max:100',\n 'content' => 'required',\n 'blog_thumbnail' => 'required|max:100',\n 'age_limit' => 'required|numeric|min:0|max:100',\n 'gender_limit' => 'required|numeric|min:0|max:2',\n ];\n }\n if ($this->isMethod('PUT')) {\n $exploredUrl = explode(\"/\", $this->url());\n $id = end($exploredUrl);\n return [\n 'title' => 'required|max:100|unique:blogs,title,' . $id,\n 'content' => 'required',\n 'blog_thumbnail' => 'required|max:100',\n 'age_limit' => 'required|numeric|min:0|max:100'\n ];\n }\n }", "public function validate() {\n//\t\tif( intval($this->params[\"startYear\"] < date(\"yyyy\"))) $this->add_validation_error(\"Season cannot exist in the past.\");\n\t}", "public function validate(ValueContext $valueContext);", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public function validate(){\r\n\t\tif(array_get($this->entity, array_get($this->validate, 'fieldName')) != $this->fieldValue){\r\n\t\t\tHmsException::occur($fieldName. '必须等于', $this->fieldValue);\r\n\t\t}\r\n\t}", "function validate() {\n\t\t// execute the column validation \n\t\tparent::validate();\n\t\t\n\t\t// connection\t\t\n\t\t$conn = Doctrine_Manager::connection();\n\t\t\n\t\t// query for check if location exists\n\t\t$unique_query = \"SELECT id FROM company WHERE name = '\".$this->getName().\"' AND id <> '\".$this->getID().\"'\";\n\t\t$result = $conn->fetchOne($unique_query);\n\t\t// debugMessage($unique_query);\n\t\t// debugMessage(\"result is \".$result);\n\t\tif(!isEmptyString($result)){ \n\t\t\t$this->getErrorStack()->add(\"unique.name\", \"The name \".$this->getName().\" already exists. Please specify another.\");\n\t\t}\n\t}", "public function validate($configData);", "private function validaAll()\r\n {\r\n $this->setId(filter_input(INPUT_POST, 'id') ?? time())\r\n ->setTitle(filter_input(INPUT_POST, 'title', FILTER_SANITIZE_SPECIAL_CHARS))\r\n ->setContent(filter_input(INPUT_POST, 'content', FILTER_SANITIZE_SPECIAL_CHARS))\r\n ->setBeginningDate(filter_input(INPUT_POST, 'beginning_date', FILTER_SANITIZE_SPECIAL_CHARS))\r\n ->setEndingDate(filter_input(INPUT_POST, 'ending_date', FILTER_SANITIZE_SPECIAL_CHARS));\r\n\r\n // Inicia a Validação dos dados\r\n $this->validaId()\r\n ->validaTitle()\r\n ->validaContent()\r\n ->validaBeginningDate()\r\n ->validaEndingDate();\r\n }", "function validate($request, $articleId = null, $step = false, $reason = null) {\n\t\tparent::validate($reason);\n\t\t$articleDao =& DAORegistry::getDAO('ArticleDAO');\n\t\t$user =& $request->getUser();\n\t\t$journal =& $request->getJournal();\n\n\t\tif ($step !== false && ($step < 1 || $step > 5 || (!$articleId && $step != 1))) {\n\t\t\t$request->redirect(null, null, 'submit', array(1));\n\t\t}\n\n\t\t$article = null;\n\n\t\t// Check that article exists for this journal and user and that submission is incomplete\n\t\tif ($articleId) {\n\t\t\t$article =& $articleDao->getArticle((int) $articleId);\n\t\t\tif (!$article || $article->getUserId() !== $user->getId() || $article->getJournalId() !== $journal->getId() || ($step !== false && $step > $article->getSubmissionProgress())) {\n\t\t\t\t$request->redirect(null, null, 'submit');\n\t\t\t}\n\t\t}\n\n\t\t$this->article =& $article;\n\t\treturn true;\n\t}", "function Page_FilterValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "function Page_FilterValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "protected function preValidate() {}", "function adminCommentsWaiteValidate()\n {\n $userLogged = Auth::check(['administrateur']);\n\n $commentManager = new CommentManager();\n $listCommentsWaiteValidate = $commentManager->listCommentsWaiteValidate();\n\n require'../app/Views/backViews/comment/backAdminCommentsWaiteValidateView.php';\n }", "public function validate()\n\t{\n\t\tswitch ($_REQUEST[STR_URL_QUERY_STRING]) {\n\t\t/**\n\t\t\t * If we're on the Logout page, logout by clearing sessions and cookies.\n\t\t\t * Redirect to the login page.\n\t\t\t */\n\t\t\tcase FILE_LOGOUT:\n\t\t\t\t$this->logout();\n\t\t\t\tROCKETS_HTTP::redirect(RPATH_ROOT . \"/\" . FILE_LOGIN);\n\t\t\t\tbreak;\n\t\t\t/**\n\t\t\t * If we're on the Register page, logout (clear sessions and cookies)\n\t\t\t * Don't redirect: allow user to stay on this page so he/she can register\n\t\t\t */\n\t\t\tcase FILE_REGISTER:\n\t\t\t\t$this->logout();\n\t\t\t\tbreak;\n\t\t\t/**\n\t\t\t * If we're on the login page, run ->login();\n\t\t\t */\n\t\t\tcase FILE_LOGIN:\n\t\t\tcase \"/\" .FILE_LOGIN:\n\t\t\t\t$this->login();\n\t\t\t\tbreak;\n\t\t\t/**\n\t\t\t * If we're creating a new user, \"pass through\" - \n\t\t\t */\n\t\t\tcase FILE_CREATE_USER:\n\t\t\t\treturn;\n\t\t\t/**\n\t\t\t * On any other page....see if a user is logged in\n\t\t\t */\n\t\t\tdefault:\n\t\t\t\tif (!$this->is_logged_in())\n\t\t\t\t{\n\t\t\t\t\tROCKETS_HTTP::redirect(RPATH_ROOT . \"/\" . FILE_LOGIN);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}", "function validate() {\n\t\t// If it's not required, there's nothing to validate\n\t\tif ( !$this->get_attribute( 'required' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$field_id = $this->get_attribute( 'id' );\n\t\t$field_type = $this->get_attribute( 'type' );\n\t\t$field_label = $this->get_attribute( 'label' );\n\n\t\t$field_value = isset( $_POST[$field_id] ) ? stripslashes( $_POST[$field_id] ) : '';\n\n\t\tswitch ( $field_type ) {\n\t\tcase 'email' :\n\t\t\t// Make sure the email address is valid\n\t\t\tif ( !is_email( $field_value ) ) {\n\t\t\t\t$this->add_error( sprintf( __( '%s requires a valid email address', 'jetpack' ), $field_label ) );\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t// Just check for presence of any text\n\t\t\tif ( !strlen( trim( $field_value ) ) ) {\n\t\t\t\t$this->add_error( sprintf( __( '%s is required', 'jetpack' ), $field_label ) );\n\t\t\t}\n\t\t}\n\t}", "public function validate()\n {\n // query for validation information\n // set the validation flag\n // close database\n }", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public function validate_fields() {\n \n\t\t//...\n \n }", "public function validate() {\n\n $validationErrors = [];\n\n // If we have a duplicate site key, complain.\n if (self::values(\"COUNT(*) total\", \"WHERE siteKey = ? AND siteId <> ?\", $this->siteKey, $this->siteId ? $this->siteId : \"\")[0]) {\n $validationErrors[\"siteKey\"][\"unique\"] = new FieldValidationError(\"siteKey\", \"unique\", \"The site key supplied is already in use\");\n }\n\n return $validationErrors;\n }", "protected function validate() {\n if($this->title == ''){\n $this->errors[] = \"Title is required\";\n }\n\n if($this->content == ''){\n $this->errors[] = \"Content is required\";\n }\n\n if($this->published_at != '') {\n $date_time = date_create_from_format('Y-m-d H:i:s', $this->published_at);\n\n if($date_time === false){\n $this->errors[] = \"Invalid date and time.\";\n }else{\n $date_errors = date_get_last_errors();\n\n if($date_errors['warning_count'] > 0){\n $this->errors[] = \"Invalid date and time.\";\n }\n }\n }\n return empty($this->errors);\n }", "protected function validateParams() {\r\n $ads = $this->ads;\r\n $adsId = $this->adsId;\r\n $lang = $this->getLanguage();\r\n if ($ads === NULL) {\r\n // the ads must exist\r\n $this->addErrorMessage($lang->getMessage('error.adsNotFound', htmlspecialchars($adsId)));\r\n return FALSE;\r\n }\r\n return TRUE;\r\n }" ]
[ "0.6453827", "0.60346836", "0.58949053", "0.58949053", "0.58949053", "0.58949053", "0.58949053", "0.58949053", "0.58949053", "0.58949053", "0.58949053", "0.58949053", "0.58949053", "0.58949053", "0.57893074", "0.57779145", "0.57361805", "0.5680614", "0.5619464", "0.55940646", "0.55795145", "0.55795145", "0.5542682", "0.5512955", "0.549731", "0.54875046", "0.5482163", "0.5482163", "0.54758716", "0.54639727", "0.54561436", "0.5447789", "0.54144853", "0.5395255", "0.53917956", "0.53917253", "0.53779197", "0.5367935", "0.5367088", "0.5362654", "0.5354971", "0.53237706", "0.53160316", "0.53160316", "0.53057796", "0.52716076", "0.5259321", "0.52411985", "0.52407414", "0.52376914", "0.52376914", "0.5223899", "0.52190703", "0.52013236", "0.5192222", "0.5192222", "0.51899415", "0.5183336", "0.51765394", "0.517429", "0.5172318", "0.51722586", "0.5170856", "0.5159037", "0.51505226", "0.5148033", "0.51472795", "0.51431274", "0.5133316", "0.5132583", "0.51252174", "0.5122872", "0.51174814", "0.5113839", "0.51091945", "0.50985503", "0.509696", "0.509696", "0.50965506", "0.50897557", "0.5081429", "0.50733525", "0.5064431", "0.5055509", "0.50510144", "0.50482917", "0.50370467", "0.50294083", "0.50294083", "0.50275904", "0.5025124", "0.50235975", "0.50214076", "0.50168014", "0.5015559", "0.5015559", "0.5009831", "0.49945325", "0.49848533", "0.49835643" ]
0.59037596
2
Action save save the modified data or add new data Access to the action is possible in the following paths: /admin/blog/save
public function saveAction() { parent::saveAction(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function postSave() {}", "public function save() {\n $db = Db::instance();\n $db_properties = array(\n 'action' => $this->action,\n 'url_mod' => $this->url_mod,\n 'description' => $this->description,\n 'target_id' => $this->target_id,\n 'target_name' => $this->target_name,\n 'creator_id' => $this->creator_id,\n 'creator_username' => $this->creator_username\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"index\"\n ));\n }\n\n $id = $this->request->getPost(\"id\");\n\n $article = Articles::findFirstByid($id);\n if (!$article) {\n $this->flash->error(\"article does not exist \" . $id);\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"index\"\n ));\n }\n\n $article->id = $this->request->getPost(\"id\");\n $article->title = $this->request->getPost(\"title\");\n $article->slug = $this->request->getPost(\"slug\");\n $article->content = $this->request->getPost(\"content\"); \n $article->isPublished = $this->request->getPost(\"isPublished\"); \n\n if (!$article->save()) {\n\n foreach ($article->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"edit\",\n \"params\" => array($article->id)\n ));\n }\n\n $this->flash->success(\"article was updated successfully\");\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"index\"\n ));\n\n }", "public function save()\n {\n remove_action('save_post', array($this, 'save'), 999);\n add_filter('wp_save_post_revision_post_has_changed', function () {\n return false;\n }, 99999);\n global $post;\n if (is_a($post, '\\WP_Post')) {\n $postArgs = array(\n 'ID' => $post->ID,\n 'post_content' => $this->content\n );\n wp_update_post($postArgs);\n\n $rev = wp_get_post_revisions($post);\n if (!empty($rev)) {\n $last = current($rev);\n $postArgs = array(\n 'ID' => $last->ID,\n 'post_content' => $this->content\n );\n wp_update_post($postArgs);\n }\n\n do_action('kb.concat.save', $postArgs);\n }\n\n }", "protected function updateAndPersistBlog() {}", "public function save() {}", "public function save() {}", "public function save() {}", "public function save() {\n\t\t\t\n\t\t}", "public function autosave() {\n\t $this->use_layout=false;\n\t $this->use_view=false;\n\t $content = new $this->model_class(Request::get(\"id\"));\n\t if($content->primval) {\n\t $content->update_attributes($_POST[\"cms_content\"]);\n\t echo date(\"H:i:s\");\n\t }else{\n\t throw new WXRoutingException('Tried to save in a non-existing database entry!', \"Page not found\", '404');\n\t }\n\t exit;\n\t}", "function save() {\n //save the added fields\n }", "public function save()\r\n {\r\n \r\n }", "public function save()\r\n {\r\n //\r\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward(array(\n 'controller' => \"export_yy_logs\",\n 'action' => 'index'\n ));\n\n return;\n }\n\n $id = $this->request->getPost(\"id\");\n $export_yy_log = ExportYyLogs::findFirstByid($id);\n\n if (!$export_yy_log) {\n $this->flash->error(\"移出記録が見つからなくなりました。\" . $id);\n\n $this->dispatcher->forward(array(\n 'controller' => \"export_yy_logs\",\n 'action' => 'index'\n ));\n\n return;\n }\n\n if ($export_yy_log->updated !== $this->request->getPost(\"updated\")) {\n $this->flash->error(\"他のプロセスから移出記録が変更されたため更新を中止しました。\"\n . $id . \",uid=\" . $export_yy_log->kousin_user_id . \" tb=\" . $export_yy_log->updated .\" pt=\" . $this->request->getPost(\"updated\"));\n\n $this->dispatcher->forward(array(\n 'controller' => \"export_yy_logs\",\n 'action' => 'edit',\n 'params' => array($id)\n ));\n\n return;\n }\n\n $post_flds = [];\n $post_flds = [\"cd\",\n \"name\",\n \"time_from\",\n \"time_to\",\n \"updated\",\n ];\n \n\n $thisPost=[]; // カンマ編集を消すとか日付編集0000-00-00を入れるとか$thisPost[]で行う\n $chg_flg = 0;\n foreach ($post_flds as $post_fld) {\n if ((array_key_exists($post_fld, $thisPost)?$thisPost[$post_fld]:$this->request->getPost($post_fld)) !== $export_yy_log->$post_fld) {\n $chg_flg = 1;\n break;\n }\n }\n if ($chg_flg === 0) {\n $this->flash->error(\"変更がありません。\" . $id);\n\n $this->dispatcher->forward(array(\n \"controller\" => \"export_yy_logs\",\n \"action\" => \"edit\",\n \"params\" => array($export_yy_log->id)\n ));\n\n return;\n }\n\n $this->_bakOut($export_yy_log);\n\n foreach ($post_flds as $post_fld) {\n $export_yy_log->$post_fld = array_key_exists($post_fld, $thisPost)?$thisPost[$post_fld]:$this->request->getPost($post_fld);\n }\n\n if (!$export_yy_log->save()) {\n\n foreach ($export_yy_log->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward(array(\n 'controller' => \"export_yy_logs\",\n 'action' => 'edit',\n 'params' => array($id)\n ));\n\n return;\n }\n\n $this->flash->success(\"移出記録の情報を更新しました。\");\n\n $this->dispatcher->forward(array(\n 'controller' => \"export_yy_logs\",\n 'action' => 'edit',\n 'params' => array($export_yy_log->id)\n ));\n }", "public function save()\n {\n $DB = DB::singleton(dsn());\n\n if ( $this->update ) {\n $SQL = SQL::newUpdate('entry');\n foreach ( $this->columns as $column ) {\n $SQL->addUpdate('entry_' . $column, $this->{$column});\n }\n $SQL->addWhereOpr('entry_id', $this->id);\n $SQL->addWhereOpr('entry_blog_id', $this->blog_id);\n $DB->query($SQL->get(dsn()), 'exec');\n } else {\n $SQL = SQL::newInsert('entry');\n foreach ( $this->columns as $column ) {\n $SQL->addInsert('entry_' . $column, $this->{$column});\n }\n $DB->query($SQL->get(dsn()), 'exec');\n }\n\n EntryHelper::saveColumn($this->units, $this->id, $this->blog_id);\n Common::saveField('eid', $this->id, $this->fields);\n Common::saveFulltext('eid', $this->id, Common::loadEntryFulltext($this->id));\n }", "public function save($action = '', $data = '', $site_id = ''){\n if($data !== '' && $action === 'new'){\n $result = $this->db->insert('sites_tb', $data);\n return $result;\n }else if($data !== '' && $action === 'existing' && $site_id !== ''){\n $result = $this->db->where('site_id', $site_id)->update('sites_tb', $data);\n return $result;\n }\n }", "public function saveAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t// check if form is posted\n\t\tif($this->_request->isPost())\n\t\t{\n\t\t\t$arrData = array();\n\t\t\t$arrData['layout_name'] = $this->_request->getPost('layout_name');\n\t\t\t$arrData['folder_name'] = $this->_request->getPost('folder_name');\n\t\t\t$arrData['title'] \t\t= $this->_request->getPost('title');\n\t\t\t$arrData['sections'] \t= $this->_request->getPost('sections');\n\t\t\t$arrData['thumb']\t \t= $this->_request->getPost('thumb');\n\t\t\t$id = $this->_request->getPost('id');\n\t\t\t$model->updateLayout($arrData, $id);\n\t\t\t$this->_redirect('/admin/layout/list');\n\t\t}\n\t\telse\n\t\t\t$this->_redirect('/admin/layout/list');\n\t }", "public function saveAction()\n {\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"userstory\",\n \"action\" => \"index\"\n ));\n }\n\n $id_us = $this->request->getPost(\"id\");\n\n $us = Userstory::findFirst(array(\n 'id_us = :id_us:',\n 'bind' => array('id_us' => $id_us)\n ));\n if (!$us) {\n $this->flash->error(\"Cette userstory n'existe pas.\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"userstory\",\n \"action\" => \"index\"\n ));\n }\n\n $us->id_us = $id_us;\n $us->title = $this->request->getPost(\"title\");\n $us->content = $this->request->getPost(\"content\");\n $us->cost = $this->request->getPost(\"cost\");\n \n if (!$us->save()) {\n foreach ($us->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"userstory\",\n \"action\" => \"edit\",\n \"params\" => array($us->id_us)\n ));\n }\n\n $this->flash->success(\"Userstory correctement modifiée.\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"userstory\",\n \"action\" => \"index\"\n ));\n\n }", "public function save()\n\t{\n\n\t}", "public function save($data);", "public function save($data);", "public function save($data);", "function save();", "function save();", "public function save(){\n }", "public function saveAction() :void\n {\n $data = $this->request->getPost();\n $record = ModuleTemplate::findFirst();\n if ($record === null) {\n $record = new ModuleTemplate();\n }\n $this->db->begin();\n foreach ($record as $key => $value) {\n switch ($key) {\n case 'id':\n break;\n case 'checkbox_field':\n case 'toggle_field':\n if (array_key_exists($key, $data)) {\n $record->$key = ($data[$key] === 'on') ? '1' : '0';\n } else {\n $record->$key = '0';\n }\n break;\n default:\n if (array_key_exists($key, $data)) {\n $record->$key = $data[$key];\n } else {\n $record->$key = '';\n }\n }\n }\n\n if ($record->save() === FALSE) {\n $errors = $record->getMessages();\n $this->flash->error(implode('<br>', $errors));\n $this->view->success = false;\n $this->db->rollback();\n return;\n }\n\n $this->flash->success($this->translation->_('ms_SuccessfulSaved'));\n $this->view->success = true;\n $this->db->commit();\n }", "public\tfunction\tsave()\n\t\t{\n\t\t}", "function saveAction()\n {\n\t\t$params = $this->_request->getParams();\n \t$id=(int)$params[\"id\"];\n\t\t$name = $params[\"txtName\"];\n\t\t$address = $params[\"txtAddress\"];\n\t\t$email = $params[\"txtEmail\"];\n\t\t$phone = $params[\"txtPhone\"];\n\n\t\t$customers = new CustomersModel();\n\t\tif($id > 0)\n\t\t{\n\t\t\t$customers->updateCustomersById($id, $name, $address, $email, $phone);\n\t\t\t$this->_redirect('/qtht/customers');\n\t\t} else {\n\t\t\t$customers->insertCustomers($name, $address, $email, $phone);\n\t\t\t$this->_redirect('/qtht/customers');\n\t\t}\n }", "public function save()\n {\n }", "public function save()\n {\n $postMapper = new Application_Model_PostsMapper();\n $postMapper->save($this);\n }", "public function saveAction() {\n $request = $this->getRequest();\n if($request->isPost()) {\n $params = $request->getPost();\n if(!array_key_exists('company_id', $params)) {\n Default_Model_Company::create($params);\n } else {\n Default_Model_Company::update($params);\n }\n }\n \n $this->_redirect($this->view->actions['index']);\n }", "public function savePost(){\n\t\t\t//Required model\n\t\t\trequire_once(MODEL.'ProcessPost.php');\n\t\t\t$this->model = new ProcessPost();\n\t\t\t//Render view page\n\t\t\t$this->view->headerAdmin($this->initData);\n\t\t\t\n\t\t\t//Process data\n\t\t\t$title = empty($_POST['title'])? false: $_POST['title'];\n\t\t\t$content = empty($_POST['content'])? false:$_POST['content'];\n\t\t\t$id = $_SESSION['user']->id;\n\t\t\t$category_id = empty($_POST['category_id'])? false:$_POST['category_id'];\n\t\t\t$timedate = date('Y-m-d H:i:s');\t\n\t\t\tif($title){\n\t\t\t\t$url = trim($title);\n\t\t\t\t$url = $this->model->makeTitleLink($url);\n\t\t\t}\n\t\t\t\t\n\t\t\t//Save post\n\t\t\tif($title && $content && $id && $category_id && $timedate && $url){\n\t\t\t\t$result = $this->model->insertPost($title,$content,$id,$category_id,$timedate,$url);\n\t\t\t\tif($result){\n\t\t\t\t\techo \"Create new post successfully!\";\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\techo \"Error! Can't be save this post, maybe wrong something.\";\n\t\t\t}\n\t\t\t$this->view->footerAdmin();\n\n\t\t}", "protected function hook_afterSave(){}", "protected function afterSave()\n\t{\n\t\tparent::afterSave();\n\t\tif(!$this->status == 1){\n\t\t$title = $this->howtoTitle($this->id);\n\t\t$tags = $this->tagLinks();\n\t\t$title = CHtml::link('Created '.$title , array('/howto/' . $this->id . '/' . $title ) );\n\t\t$shortText = substr($this->content,0,160);\n\t\t$content = $shortText.\"...<br/>Tags:\";\n\t\tforeach($tags as $tag){\n\t\t\t$content .=\" \".$tag.\",\";\n\t\t}\n\t\tAction::newAction($content,$title);\n\t\t}\n\t\t\n\t}", "public function actionSave()\n\t{\n\t\t$redirect = parent::actionSave();\n\t\t\n\t\tif (!empty($redirect))\n\t\t{\n\t\t\t// send bookmark alert\n\t\t\t$postId = $this->_input->filterSingle('post_id', XenForo_Input::UINT);\n\t\t\t$bookmarksModel = $this->_getBookmarksModel();\n\t\t\t$bookmarksModel->sendBookmarkAlerts('post', $postId, 'content_edit', 'edit');\n\t\t}\n\t\t\n\t\treturn $redirect;\n\t}", "function save()\n {\n if( $this->input->post('modifiedwiki') !== null )\n {\n $params = array(\n 'body' => $this->input->post('savewiki'),\n );\n \n $this->wiki_model->update_wiki($this->input->post('modifiedwiki'), $params);\n\n $data['wikis'] = $this->wiki_model->get_all_wikis();\n $data['title'] = \"Documentation\";\n $this->load->view('templates/header', $data);\n $this->load->view('pages/wikihome.php');\n $this->load->view('templates/footer'); \n }\n else\n {\n show_error('The wiki you are trying to edit does not exist.');\n }\n }", "public function save() {\n }", "protected function _postSave()\r\n\t{\r\n\t}", "public function actionSave()\r\n {\r\n $this->_assertPostOnly();\r\n\r\n $spamRuleId = $this->_input->filterSingle('spam_rule_id', XenForo_Input::STRING);\r\n\r\n $input = $this->_input->filter(\r\n array(\r\n 'title' => XenForo_Input::STRING,\r\n 'action' => XenForo_Input::STRING,\r\n 'content_criteria' => XenForo_Input::ARRAY_SIMPLE,\r\n 'request_criteria' => XenForo_Input::ARRAY_SIMPLE,\r\n 'user_criteria' => XenForo_Input::ARRAY_SIMPLE\r\n ));\r\n\r\n $writer = XenForo_DataWriter::create('ThemeHouse_SpamRules_DataWriter_SpamRule');\r\n if ($spamRuleId) {\r\n $writer->setExistingData($spamRuleId);\r\n }\r\n $writer->bulkSet($input);\r\n $writer->save();\r\n\r\n if ($this->_input->filterSingle('reload', XenForo_Input::STRING)) {\r\n return $this->responseRedirect(XenForo_ControllerResponse_Redirect::RESOURCE_UPDATED,\r\n XenForo_Link::buildAdminLink('spam-rules/edit', $writer->getMergedData()));\r\n } else {\r\n return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS,\r\n XenForo_Link::buildAdminLink('spam-rules') . $this->getLastHash($writer->get('spam_rule_id')));\r\n }\r\n }", "public function save($post_id);", "public function save()\n {\n //\n }", "function save()\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t$post\t= JRequest::get('post');\n\t\t$cid\t= JRequest::getVar( 'cid', array(0), 'post', 'array' );\n\t\t$post['id'] = (int) $cid[0];\n\n\t\t$model = $this->getModel('weblink');\n\n\t\tif ($model->store($post)) {\n\t\t\t$msg = JText::_( 'Weblink Saved' );\n\t\t} else {\n\t\t\t$msg = JText::_( 'Error Saving Weblink' );\n\t\t}\n\n\t\t// Check the table in so it can be edited.... we are done with it anyway\n\t\t$model->checkin();\n\t\t$link = 'index.php?option=com_weblinks';\n\t\t$this->setRedirect($link, $msg);\n\t}", "public function Admin_Action_Save() {\n // Dynamic Content Tags Properties\n $userAPI = &GetUser ();\n $tagId = $this->_getPOSTRequest ( 'dynamiccontenttags_id', 0 );\n $tagName = $this->_getPOSTRequest ( 'dynamiccontenttags_name', '' );\n $tagDate = time ();\n $mesgPrefix = 'Update';\n if ($tagId == 0) {\n $mesgPrefix = 'Create';\n }\n $redirectUrl = $this->admin_url;\n\n // Tag lists\n $lists = $this->_getPOSTRequest ( 'SelectList', array () );\n\n // Content Blocks Properties\n $tmpBlocks = $this->_getPOSTRequest ( 'blocks', array () );\n\n $blocks = array ();\n if (sizeof ( $tmpBlocks )) {\n $sortOrderCounter = 0;\n foreach ( $tmpBlocks as $k => $v ) {\n $blockId = (strlen($k) == 32) ? 0 : $k;\n $blockActivated = (isset ( $v ['activated'] ) && $v ['activated'] == 1) ? 1 : 0;\n $blockName = $v ['name'];\n $blockRules = $v ['data'];\n $blockSortOrder = $sortOrderCounter++;\n $blocks [] = new DynamicContentTag_Api_Block ( $blockId, $blockName, $blockRules, $blockActivated, $blockSortOrder, $tagId );\n }\n }\n\n $tag = new DynamicContentTag_Api_Tag ( $tagId, $tagName, $tagDate, $userAPI->Get('userid'), $blocks, $lists );\n\n $savedTagId = $tag->save ();\n\n if (isset ( $_POST ['subact'] ) && $_POST ['subact'] == 'saveedit') {\n $redirectUrl = $this->admin_url . \"&Action=Edit&id={$savedTagId}\";\n }\n\n if ($savedTagId) {\n FlashMessage ( GetLang ( 'Addon_dynamiccontenttags_' . $mesgPrefix . 'Tag_Success' ), SS_FLASH_MSG_SUCCESS, $redirectUrl );\n } else {\n FlashMessage ( GetLang ( 'Addon_dynamiccontenttags_' . $mesgPrefix . 'Tag_Failure' ), SS_FLASH_MSG_ERROR, $redirectUrl );\n }\n }", "public function actionSave()\n\t{\n\t\t$ajax = new \\AjaxHelper();\n\t\t$ajax->success = Menu::model()->updateTree(\\Yii::app()->request->getPost('items'));\n\t\t$ajax->errorDefaultMessage = 'Произошла ошибка на сервере, порядок не был сохранен';\n\t\t$ajax->endFlush();\n\t}", "public function save() {\n }", "public function save() {\n }", "function save(){\n\t\t// $insert_query = 'INSERT INTO tb_categories';\n\t\t// $insert_query .= ' SET ';\n\t\t// $insert_query .= ' name = \"'.$this->name.'\"';\n\n\t\t// $this->db->query($insert_query);\n\t\t\tif($this->page_id){\n\t\t\t\t$this->update();\n\t\t\t}else{\n\t\t\t\t$this->page_id = $this->db->insert(\n\t\t\t\t\t'tb_pages',\n\t\t\t\t\tarray(\t\t\t\t\t\n\t\t\t\t\t'title' => $this->title,\n\t\t\t\t\t'content' => $this->content)\n\t\t\t\t);\n\t\t\t}\n\t\t}", "public function save($data)\n\t{\n\t}", "public function saveBlogPost() {\r\n\t\t\r\n\t\t//$this->verifyID($toid);\r\n\t\t$html_tags = '<b><p><br></br><u><ul><li><table><tr><th><td><i>';\r\n\r\n\t\t// controleer of submit gepost is\r\n\t\tif (isset($_POST['admblogsubmit'])) {\r\n\t\t\t\r\n\t\t\t// check: velden voor titel en content zijn niet leeg\r\n\t\t\tif (!empty($_POST[\"admblogtitle\"] && $_POST['admblogcontent'])) {\r\n\r\n\t\t\t\t// schrijf post inputs weg naar variabelen\r\n\t\t\t\t$admblogtitle = strip_tags($_POST[\"admblogtitle\"], $html_tags);\r\n\t\t\t\t$admblogintro = strip_tags($_POST[\"admblogintro\"], $html_tags);\r\n\t\t\t\t$admblogcontent = strip_tags($_POST[\"admblogcontent\"], $html_tags);\r\n\t\t\t\t$admurl = strtolower(preg_replace('/[[:space:]]+/', '-', $_POST['admblogtitle']));\r\n\t\t\t\t\r\n\t\t\t\t// maak PDO connectie om weg te schrijven + set attributes voor error meldingen\r\n\t\t\t\t$stmt = new PDO(\"mysql:host=localhost;dbname=demo\", 'root', '');\r\n\t\t\t\t$stmt->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t\t\t\t\r\n\t\t\t\t// try query\r\n\t\t\t\ttry {\r\n\t\t\t\t\t\t$query = $stmt->prepare(\"INSERT INTO `evdnl_blog_posts_yc` (create_date, modify_date, title, intro, content, dashedtitle) VALUES(CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '$admblogtitle', '$admblogintro', '$admblogcontent', '$admurl')\");\r\n\t\t\t\t\t\t$query->execute();\r\n\t\t\t\t\t\t$this->createBlogPostFile();\r\n\r\n\t\t\t\t\t\t// sluit PDO connectie\r\n\t\t\t\t\t\t$query = NULL;\r\n\t\t\t\t\t}\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t// catch error\r\n\t\t\t\t\tcatch (PDOException $e) {\r\n\t\t\t\t\t\techo $e->getMessage();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function save() {\n\n\t\t// calls generic ORM save (insert or update)\n\t\tparent::save();\n\n\t}", "public function save()\n {\n }", "public function save()\n {\n }", "public function save($data)\n {\n }", "public function save($data)\n {\n }", "public function save($data)\n {\n }", "public function save($data)\n {\n }", "public function save($data)\n {\n }", "function save_post()\n \t{\n \t\treturn $this->class_post->save_post();\n \t}", "public function save(Post $post): void;", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"comments\",\n \"action\" => \"index\"\n ));\n }\n\n $id = $this->request->getPost(\"id\");\n\n $comment = Comments::findFirstByid($id);\n if (!$comment) {\n $this->flash->error(\"comment does not exist \" . $id);\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"comments\",\n \"action\" => \"index\"\n ));\n }\n\n $comment->model = $this->request->getPost(\"model\");\n $comment->model_id = $this->request->getPost(\"model_id\");\n $comment->body = $this->request->getPost(\"body\");\n \n\n if (!$comment->save()) {\n\n foreach ($comment->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"comments\",\n \"action\" => \"edit\",\n \"params\" => array($comment->id)\n ));\n }\n\n $this->flash->success(\"comment was updated successfully\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"comments\",\n \"action\" => \"index\"\n ));\n\n }", "public function save( $data ){\n\t\t\t$args['numToShow'] \t = (int) $data['numToShow'];\n $args['displayBeneath'] = (int) $data['displayBeneath'];\n $args['parentPageID'] = (int) $data['parentPageID'];\n\t\t\tparent::save( $args );\n\t\t}", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"article_categories\",\n \"action\" => \"index\"\n ));\n }\n\n $id = $this->request->getPost(\"id\");\n\n $category = ArticleCategories::findFirstByid($id);\n if (!$category) {\n $this->flash->error(\"category does not exist \" . $id);\n return $this->dispatcher->forward(array(\n \"controller\" => \"article_categories\",\n \"action\" => \"index\"\n ));\n }\n\n $category->id = $this->request->getPost(\"id\");\n $category->name = $this->request->getPost(\"name\");\n $category->description = $this->request->getPost(\"description\");\n \n\n if (!$category->save()) {\n\n foreach ($category->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"article_categories\",\n \"action\" => \"edit\",\n \"params\" => array($category->id)\n ));\n }\n\n $this->flash->success(\"category was updated successfully\");\n return $this->dispatcher->forward(array(\n \"controller\" => \"article_categories\",\n \"action\" => \"index\"\n ));\n\n }", "public function save() {\n\n $data = array(\n 'name' => $this->getName(),\n 'description' => $this->getDescription(),\n 'metatitle' => $this->getMetatitle(),\n 'metakeywords' => $this->getMetakeywords(),\n 'metadescription' => $this->getMetadescription()\n );\n $data['parent_id'] = 0; // by default it is 0, becouse right now there is no use of parent id in this application\n if (null === ($id = $this->getId())) {\n unset($data['id']);\n $data['status'] = 1;\n return $this->getMapper()->getDbTable()->insert($data);\n } else {\n $data['status'] = $this->getStatus();\n return $this->getMapper()->getDbTable()->update($data, array('id = ?' => $id));\n }\n\n }", "function save()\n {\n }", "function save()\n {\n }", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "public function onSave()\n {\n try\n {\n // open a transaction with database 'samples'\n TTransaction::open('samples');\n \n // get the form data into an active record Entry\n $object = $this->form->getData('AgendaEntry');\n \n $this->form->validate(); // form validation\n $object->store(); // stores the object\n $this->form->setData($object); // keep form data\n \n TTransaction::close(); // close the transaction\n $posAction = new TAction(array('AgendaView', 'reload'));\n // shows the success message\n new TMessage('info', TAdiantiCoreTranslator::translate('Record saved'), $posAction);\n }\n catch (Exception $e) // in case of exception\n {\n // shows the exception error message\n new TMessage('error', $e->getMessage());\n \n $this->form->setData( $this->form->getData() ); // keep form data\n \n // undo all pending operations\n TTransaction::rollback();\n }\n }", "protected function save()\n\t{\n\t\t$this->saveItems();\n\t\t//$this->saveAssignments();\n\t\t//$this->saveRules();\n\t}", "public abstract function save();", "public function post_save(){\n\n }", "public function save() {\n\n }", "protected function saveUpdate()\n {\n }", "public function save():void;", "public function saveData()\r\n {\r\n \r\n }", "private function saveData($data)\n {\n $newDate = date('Y-m-d H:i:s');\n $data['commentDate'] = $newDate;\n // --- saving part ---\n $comments = new commentModel();\n $commentID = $comments->insert($data);\n // --- routing after storage ---\n $url = '/comments/show/id/' . $data['topicID'];\n $this->_redirect($url);\n }", "public function saveAction(){\n //d'you post?\n if ($this->getRequest()->isPost()){\n $knight = $this->getKnight();\n $knight->setName( $this->getRequest()->getPost(\"name\") );\n $knight->setArmor( $this->getRequest()->getPost(\"armor\") );\n //persist the knight\n $this->getDM()->persist($knight);\n $this->getDM()->flush();\n }\n //go back to home (indexAction) to show the grid of knights\n $this->redirect()->toRoute(\"home\");\n }", "public function saveAction($postarray){\n $updateStatus = $this->book->update($postarray['id'], $postarray['author'], $postarray['title'], $_SESSION['user']->getID(), $postarray['price'], $postarray['isbn']);\n $book = $this->book->getBook($postarray['id']);\n $message = $updateStatus[1];\n require_once('views/bookForm.php');\n }", "abstract public function save( $data );" ]
[ "0.7115507", "0.7094427", "0.70813453", "0.70813453", "0.70813453", "0.70813453", "0.70813453", "0.70813453", "0.70813453", "0.70813453", "0.70813453", "0.70813453", "0.70813453", "0.70813453", "0.70813453", "0.70813453", "0.70813453", "0.70813453", "0.70813453", "0.70813453", "0.70633703", "0.703708", "0.69139963", "0.6874664", "0.6874664", "0.6873281", "0.68598497", "0.6803101", "0.6795956", "0.6785517", "0.67767376", "0.6757222", "0.6748278", "0.67309994", "0.67215097", "0.67130005", "0.66914016", "0.66704047", "0.66704047", "0.66704047", "0.6660958", "0.6660958", "0.6650402", "0.6648907", "0.6640527", "0.6636653", "0.6631066", "0.6628387", "0.66158235", "0.6611356", "0.6609338", "0.6604888", "0.66014963", "0.6596947", "0.6577635", "0.65769035", "0.6565446", "0.6564609", "0.65441126", "0.65394115", "0.6536065", "0.65316826", "0.6531177", "0.6531177", "0.65277827", "0.6520773", "0.6516867", "0.65076995", "0.6505537", "0.6505537", "0.6504935", "0.6504935", "0.6503935", "0.6502777", "0.6502777", "0.6492939", "0.6486045", "0.64852417", "0.6484725", "0.6466831", "0.6458156", "0.6450106", "0.6450106", "0.64468217", "0.64468217", "0.64468217", "0.64468217", "0.64468217", "0.6441139", "0.64301735", "0.6421403", "0.64134353", "0.6407283", "0.6398188", "0.63958895", "0.6389977", "0.637625", "0.6376217", "0.6366453", "0.63482815" ]
0.70068663
22
Action delete delete data from the database Access to the action is possible in the following paths: /admin/blog/delete
public function deleteAction() { parent::deleteAction(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteAction()\n {\n $id = (int) $this->params()->fromRoute('id', 0);\n if (!$id) {\n return $this->redirect()->toRoute('blog');\n }\n\n $request = $this->getRequest();\n if ($request->isPost()) {\n $del = $request->getPost('del', 'No');\n\n if ($del == 'Yes') {\n $id = (int) $request->getPost('id');\n $this->getBlogTable()->deleteBlog($id);\n }\n\n // Redirect to list of Blogs\n return $this->redirect()->toRoute('blog');\n }\n\n return array(\n 'id' => $id,\n 'blog' => $this->getBlogTable()->getBlog($id)\n );\n }", "public function delete() {\n BlogPost::remove($_GET['blogid']);\n $blogposts = BlogPost::all('BlogID', 'desc');\n require_once('views/blogs/readAll.php');\n }", "public function deleteAction() {\n\t\t// if($post->delete()) {\n\t\t// \tSession::message([\"Post <strong>$post->name</strong> deleted!\" , \"success\"]);\n\t\t// \tredirect_to('/posts/index');\n\t\t// } else {\n\t\t// \tSession::message([\"Error saving! \" . $error->get_errors() , \"success\"]);\n\t\t// }\n\t}", "public function actionDelete() {}", "public function actionDelete() {}", "public function delete()\n {\n $post['id'] = $this->request->getParameter('id'); // récupérer le paramètre de l'ID\n $this->post->deletePost($post['id']);\n $this->redirect(\"admin\", \"chapters\"); // une fois le post supprimé, je redirige vers la vue chapters\n }", "public function deleteAction()\n {\n $id = $this->params()->fromRoute(\"id\");\n $result = $this->getServiceLocator()->get(\"Application\\Service\\BlogPost\")->delete($id);\n return $this->redirect()->toRoute('blog-post');\n }", "function admin_delete($id)\n {\n $this->lordModel('Post');\n //$this->Post->delete($id);\n $this->session->setflash('mon contenu a bien ete supprimer');\n $this->redirect('admin/posts/index');\n }", "public function deleteList(){\n\n $posts=$this->articleDAO->getPosts();\n $this->view->adminRender ('delete_view', ['posts' =>$posts]);\n\n }", "public function delete_blog()\n\t\t{\n\t\t\tif($this->uri->segment(3)===FALSE)\n\t\t\t{\n\t\t\t\t$blog_id = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$blog_id = $this->uri->segment(3);\n\t\t\t}\n\n\t\t\t$result = $this->Blog_Modal->delete_single_blog($blog_id);\n\t\t\tif($result)\n\t\t\t{\n\t\t\t\t$this->session->set_flashdata('Delete', 'Record Delete Successfully....');\n\t\t\t\tredirect('Blog/viewblog');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->session->set_flashdata('Delete', 'Record Not Deleted....');\n\t\t\t\tredirect('Blog/viewblog');\n\t\t\t}\n\t\t}", "function delete_post()\n {\n $this->Admin_model->procedure = 'POST_DELETE';\n\n echo $this->p_post_id_delete;\n\n\n $rs = $this->Admin_model->delete($this->p_post_id_delete);\n\n //redirect('admin/Posts/display_cat');\n }", "public function deleteAction()\n {\n $postId = (int)$this->params()->fromRoute('id', -1);\n \n // Validate input parameter\n if ($postId<0) {\n $this->getResponse()->setStatusCode(404);\n return;\n }\n \n $post = $this->entityManager->getRepository(Post::class)\n ->findOneById($postId); \n if ($post == null) {\n $this->getResponse()->setStatusCode(404);\n return; \n }\n \n if (!$this->access('post.own.delete', ['post'=>$post])) {\n return $this->redirect()->toRoute('not-authorized');\n }\n \n $this->postManager->removePost($post);\n $this->imageManager->removePost($postId);\n $this->videoManager->removePost($postId);\n $this->audioManager->removePost($postId);\n \n // Redirect the user to \"admin\" page.\n return $this->redirect()->toRoute('posts', ['action'=>'admin']); \n \n }", "public function deleteAction() {\n \n }", "public function deleteActionPost(): object\n {\n // Connects to db\n $this->app->db->connect();\n\n $contentId = getPost(\"contentId\");\n\n if (!is_numeric($contentId)) {\n return $this->app->response->redirect(\"admin\");\n }\n\n if (hasKeyPost(\"doDelete\")) {\n $contentId = getPost(\"contentId\");\n\n // Executes SQL statement\n $this->admin->deleteBlogpost($contentId);\n\n // Redirects\n return $this->app->response->redirect(\"admin\");\n }\n }", "protected function deleteAction()\n {\n }", "function admin_delete($id){\n\t\t$this->loadModel('Post');\n\t\t$this->Post->delete($id);\n\t\t$this->Session->setFlash('Le contenu a bien été supprimé');\n\t\t$this->redirect('admin/posts/index');\n\t}", "public function action_delete()\n {\n\t $this->template = View::forge('template-admin');\n\n $post = Input::post();\n $entry = Model_Event::find_by_pk($post[\"id\"]);\n\t\tif ($entry){\n\t\t\tif(!$entry->delete()){\n\t\t\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t\t\t$this->template->title = \"イベント一覧\";\n\t\t\t\t$this->template->content = View::forge('event/index', $data);\n\t\t\t}\n\t\t}\n\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t$this->template->title = \"イベント一覧\";\n\t\t$this->template->content = View::forge('event/index', $data);\n }", "function admin_delete($id){\n $this->loadModel('Post');\n $this->Post->delete($id);\n $this->Session->setFlash('Le contenu à bien été supprimée');\n\n $this->redirect('admin/posts/index');\n }", "public function delete() {\n // we expect a url of form ?controller=posts&action=delete&id=x\n // without an id we just redirect to the error page as we need the post id to find it in the database\n if (!isset($_GET['id']))\n return call('pages', 'error');\n\n // we use the given id to get the right post and delete from the database\n $post = Post::delete($_GET['id']);\n require_once('view/posts/delete.php');\n }", "public function deleteBlogPost() {\r\n\t\ttry {\r\n\r\n\t\t\t// PDO iniatialiseren met attributes\r\n\t\t\t$stmt = new PDO(\"mysql:host=localhost;dbname=demo\", 'root', '');\r\n\t\t\t$stmt->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\r\n\t\t\t// mogelijkheid inbouwen waarschuwingsvenster voor verwijderen te openen\r\n\r\n\r\n\t\t\t\r\n\t\t\t$query = $stmt->prepare('SELECT id, create_date, title, intro, content FROM `evdnl_blog_posts_yc`');\r\n\t\t\t\r\n\t\t\twhile($row = $query->fetch()) {\r\n\t\t\t\t// confirmation dialog\r\n\t\t\t\techo '<tr>';\r\n\t\t\t\techo '<td>' . $row['title'] . '</td>';\r\n\t\t\t\techo '<td>' . date('jS M Y', strtotime($row['title'])) . '</td>';\r\n\t\t\t\techo '<td><a href=\"javascript:jsdeletepost(' . $row['id']; \r\n\t\t\t\techo $row['title'];\r\n\t\t\t\techo ')\">Delete</a>';\r\n\t\t\t\techo '</td>';\r\n\t\t\t\techo '</tr>';\r\n\r\n\t\t\t\t// rij / id ophalen om te verwijderen\r\n\t\t\t\tif (isset($_GET['jsdeletepost'])) {\r\n\t\t\t\t\t$todelete = $stmt->prepare('DELETE FROM `evdnl_blog_posts_yc` WHERE id = \"$row\" LIMIT 1');\r\n\t\t\t\t\t$todelete->execute($row);\r\n\r\n\t\t\t\t\theader('Location: index.php?action=deleted');\r\n\t\t\t\t\texit;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t// file verwijderen\r\n\t\t\t\t// unlink();\r\n\r\n\t\t\t\t// rij uit db verwijderen\r\n\r\n\t\t\t\t}\r\n\t\t\t\t/*\r\n\t\t\t\t\r\n\t\t\t\t*/\r\n\t\t}\r\n\r\n\t\tcatch (PDOException $e) {\r\n\t\t\techo $e->getMessage();\r\n\t\t}\r\n\t}", "public function delete(){\n global $db;\n $delete = $db->prepare('DELETE FROM posts WHERE id = :id');\n $delete->bindValue(':id', $this->_id, PDO::PARAM_INT);\n $delete->execute();\n }", "public function delete($id){\n\n if($this->Blog->delete($id)){\n $this->Session->setFlash(__('Your blog and blog posts have been removed'), 'success');\n $this->redirect($this->referer());\n }else{\n $this->Session->setFlash(__('There was a problem removing your blog'), 'error');\n $this->redirect($this->referer());\n }\n\n }", "public function delete() {\n\t\t$db = self::getDB();\n\t\t$sql = \"DELETE FROM posts \n\t\t\t\tWHERE\n\t\t\t\t\tidPost = :idPost \";\n\t\t$query = $db->prepare($sql);\n\t\t$query->execute([\n\t\t\t':idPost' => $this->getIdPost()\n\t\t]);\n\t}", "public function deleteAction()\n {\n \n }", "public function deleteAction()\n {\n if ($this->isConfirmedItem($this->_('Delete %s'))) {\n $model = $this->getModel();\n $deleted = $model->delete();\n\n $this->addMessage(sprintf($this->_('%2$u %1$s deleted'), $this->getTopic($deleted), $deleted), 'success');\n $this->_reroute(array('action' => 'index'), true);\n }\n }", "function delete()\n{\n\t$model = $this->getModel('logs');\n\t$read = $model->delete();\n\t$this->view_logs();\n}", "public function deleteAction()\n {\n }", "public function deleteAction() {\n\t\t\t$this->_forward('index');\n\t\t}", "Public function delete($id) {\n\t\t\t$blog = Blog::find($id);\n\n\t\t\tif(! is_null($blog))\n\t\t\t{\n\t\t\t\t$blog->delete();\n\t\t\t}\n\n\t\t\treturn Redirect::to('admin/dashboard');\n\t\t}", "public function deleteAction() {\n $post_data = $request = $this->getRequest()->getPost();\n\n $mapper = new Application_Model_DistractionMapper();\n $anzDeletedRows = $mapper->delete($post_data['id']);\n\n $this->view->success = ($anzDeletedRows > 0);\n }", "public function delete()\n {\n $post_id = $this->uri->rsegment('3');\n $this->_del($post_id);\n $image = $this->input->get('image');\n unlink(\"upload/post\".$image);\n // thong bao xoa thanh cong\n $this->session->set_flashdata('message', 'Xóa thành công tin tức này');\n redirect(admin_url('blog'));\n }", "public function actionDelete()\n {\n if ($post = Template::validateDeleteForm()) {\n $id = $post['id'];\n $this->findModel($id)->delete();\n }\n return $this->redirect(['index']);\n }", "public function deleteAction()\n {\n $authorization = Zend_Auth::getInstance();\n if(!$authorization -> hasIdentity()) {\n $this->redirect('/users/login');\n }\n else\n {\n // Check if user is Admin\n $userObj = $authorization->getIdentity();\n \n //$this -> view -> data = $this -> model -> listAllUsers(); \n // Get User Id\n $id = $this->getRequest()->getParam('id');\n $thread_id = $this->getRequest()->getParam('thread_id');\n if($comment = $this->model ->getCommentById($id)){\n if ($this->model->deleteComment($id))\n {\n $this->redirect('threads/index/id/'.$thread_id);\n }\n }\n else\n {\n $this->redirect('thread/view/id/'.$thread_id);\n }\n\n\n \n }\n }", "public function actionDelete() {\n// print_r($_POST);\n Comment::model()->findByPk($_POST['id'])->delete();\n echo CJSON::encode(array(\"data\" => 'berhasil'));\n// $this->loadModel($_POST['id'])->delete();\n // if AJAX request (triggered by deletion via dashboard grid view), we should not redirect the browser\n// if (!isset($_GET['ajax']))\n// $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('dashboard'));\n }", "public function delete($id=false) {\n\t\t\tif (!$GLOBALS['sizzle']->apps['backend']->models['backend']->authenticate()) {\n \t\t\t$GLOBALS['sizzle']->utils->redirect('/backend/login', '<strong>Error:</strong> Please login to continue.');\n\t\t\t}\n\t\t\t// Authorize w/ backend app.\n\t\t\tif (!$GLOBALS['sizzle']->apps['backend']->models['backend']->authorize('blog', 'delete')) {\n \t\t\t$GLOBALS['sizzle']->utils->redirect('/backend', '<strong>Error:</strong> Insufficient user access.');\n\t\t\t}\n\t\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n \t\t\t// Handle form submit.\n\t\t\t\treturn $this->models['blog']->delete();\n\t\t\t} else {\n \t\t\t// Load view.\n \t\t\t$view = '/views/delete.tpl';\n \t\t\tif ($id === false \n \t\t\t|| $this->models['blog']->fetch($id) === false) {\n \t\t\t\t$view = '/views/select.tpl';\n \t\t\t}\n \t\t\treturn $this->_loadView(dirname(__FILE__) . $view);\n }\n\t\t}", "public function deleteAction() {\n\t\tif(!isset($this->params['cancel'])) {\n\n\t\t\t// XXX: Maybe do some hook call validation here?\n\n\t\t\t// auto call the hooks for this module/action\n\t\t\tAPI::callHooks(self::$module, $this->action, 'controller', $this);\n\n\t\t\t// delete an entry\n\t\t\t$host = $this->_model->delete();\n\t\t}\n\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t}", "protected function _delete() {\r\n\t\tif ($this -> _disableHooks)\r\n\t\t\treturn;\r\n\r\n\t\t//Delete Blog Member\r\n\t\t$become_table = Engine_Api::_() -> getDbTable('becomes', 'ynblog');\r\n\t\t$become_selected = $become_table -> select() -> where('blog_id = ?', $this -> getIdentity());\r\n\t\tforeach ($become_table->fetchAll($become_selected) as $blog_become) {\r\n\t\t\t$blog_become -> delete();\r\n\t\t}\r\n\r\n\t\tparent::_delete();\r\n\t}", "function del($id)\n{\n $this->load->module('site_security');\n $this->site_security->_make_sure_is_admin();\n if(!is_numeric($id)){redirect('index');}\n\n $data = $this->fetch_data_from_db($id);\n\n $submit = $this->input->post('submit', TRUE);\n if ($submit=='No, cancelar.'){\n redirect('blog/index');\n }\n\n if ($submit=='Si, borrar.'){\n $this->del_image($id, TRUE);\n $this->_delete($id);\n \n $value = \"<div class='alert alert-danger'>\n <strong>Hecho!</strong> El articulo fue <strong>eliminado</strong> satisfactoriamente.\n </div>\";\n \n $this->session->set_flashdata('delete', $value);\n \tredirect('blog/index');\n } \n\n $data['form_location'] = current_url();\n $data['view_module'] = 'blog';\n $data['view_file'] = \"delete\";\n $this->load->module('templates');\n $this->templates->admin($data);\n\n}", "function deleteActorsPosts()\n{\n deleteActorsPostsInDb();\n header('Location: index.php?controller=adminhome');\n}", "public function deleteArticle($id){\n //TODO Verification du rôle (admin ou redacteut\n Blog::deleteArticle($id);\n header('Location: /Blog/index');\n\n }", "public function delete() {\n $this->remove_content();\n\n parent::delete();\n }", "public function delete($id)\n {\n echo $this->blog_articles_model->delete($id);\n }", "public function actionDelete()\r\n {\r\n $this->_userAutehntication();\r\n\r\n switch($_GET['model'])\r\n {\r\n /* Load the respective model */\r\n case 'posts': \r\n $model = Post::model()->findByPk($_GET['id']); \r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Error: Mode <b>delete</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n /* Find the model */\r\n if(is_null($model)) {\r\n // Error : model not found\r\n $this->_sendResponse(400, sprintf(\"Error: Didn't find any model <b>%s</b> with ID <b>%s</b>.\",$_GET['model'], $_GET['id']) );\r\n }\r\n\r\n /* Delete the model */\r\n $response = $model->delete();\r\n if($response>0)\r\n $this->_sendResponse(200, sprintf(\"Model <b>%s</b> with ID <b>%s</b> has been deleted.\",$_GET['model'], $_GET['id']) );\r\n else\r\n $this->_sendResponse(500, sprintf(\"Error: Couldn't delete model <b>%s</b> with ID <b>%s</b>.\",$_GET['model'], $_GET['id']) );\r\n }", "function index_delete() {\n $id_diagnosa = $this->delete('id_diagnosa');\n $this->db->where('id_diagnosa', $id_diagnosa);\n $delete = $this->db->delete('diagnosa');\n if ($delete) {\n $this->response(array('status' => 'success'), 201);\n } else {\n $this->response(array('status' => 'fail', 502));\n }\n }", "public function delete($idPost);", "public function delete($id) {\n\t\t// get blog\n\t\t$blog = BlogPost::find($id);\n\t\t$picture = $blog->picture;\n\t\t// get blog post\n\t\tif($blog->destroy($id)) {\n\t\t\t// delete picture\n\t\t\tunlink(\"assets/images/blog/\" . $picture);\n\t\t\t// return index\n\t\t\t$blogs = BlogPost::orderBy('created_at', 'DESC')->with('reactions')->get();\n\t\t\treturn Redirect::route('blog')->with('posts', $blogs);\n\t\t} else {\n\t\t\treturn Redirect::route('blog')->with(array('message' => 'Something went wrong..'));\n\t\t}\n\t}", "public function deleteAction() {\r\n\t\t$id = $this->getInput('id');\r\n\t\t$info = Gou_Service_Ad::getAd($id);\r\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\r\n//\t\tUtil_File::del(Common::getConfig('siteConfig', 'attachPath') . $info['img']);\r\n\t\t$result = Gou_Service_Ad::deleteAd($id);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}", "public function deleteDocument() {\n\n // should get instance of model and run delete-function\n\n // softdeletes-column is found inside database table\n\n return redirect('/home');\n }", "public function deleteAction()\n {\n $post = $this->checkInputDataIdAndEntity();\n if ( $post === false ) {\n $this->getResponse()->setStatusCode(404);\n return;\n }\n\n $this->postService->deletePost($post);\n $this->flashMessenger()->addSuccessMessage('Deleted the post.');\n\n return $this->redirect()->toRoute('posts', ['action'=>'index']);\n }", "public function deleteAction() {\n\n //GET POST SUBJECT\n $post = Engine_Api::_()->core()->getSubject('sitereview_post');\n\n //GET LISTING SUBJECT\n $sitereview = $post->getParent('sitereview_listing');\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n\n if (!$sitereview->isOwner($viewer) && !$post->isOwner($viewer)) {\n return $this->_helper->requireAuth->forward();\n }\n\n //AUTHORIZATION CHECK\n if (!$this->_helper->requireAuth()->setAuthParams($sitereview, null, \"view_listtype_$sitereview->listingtype_id\")->isValid())\n return;\n\n //MAKE FORM\n $this->view->form = $form = new Sitereview_Form_Post_Delete();\n\n //CHECK METHOD\n if (!$this->getRequest()->isPost()) {\n return;\n }\n\n //FORM VALIDATION\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n\n //PROCESS\n $table = Engine_Api::_()->getDbTable('posts', 'sitereview');\n $db = $table->getAdapter();\n $db->beginTransaction();\n $topic_id = $post->topic_id;\n try {\n $post->delete();\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n //GET TOPIC\n $topic = Engine_Api::_()->getItem('sitereview_topic', $topic_id);\n\n $href = ( null == $topic ? $sitereview->getHref() : $topic->getHref() );\n return $this->_forwardCustom('success', 'utility', 'core', array(\n 'closeSmoothbox' => true,\n 'parentRedirect' => $href,\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Post deleted.')),\n ));\n }", "public function post_delete($id)\n {\n if(Auth::user()->admin=='superadmin' || Auth::user()->admin=='admin')\n {\n $this->cms::where('id',$id)->delete();\n $wpisy=$this->cms::orderBy('id','desc')->paginate(25);\n return view('cms.edit_lista',compact('wpisy'));\n }\n }", "public function delete($id) \n\t\t{\n\t\t\tif ($this->request->is('get')) \n\t\t\t{\n\t\t\t\tthrow new MethodNotAllowedException();\n\t\t\t}\n\t\t\tif ($this->Blog->delete($id)) \n\t\t\t{\n\t\t\t\t$this->Session->setFlash('The post with id: ' . $id . ' has been deleted.');\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t}\n\t\t}", "public function admin_delete($id=null) {\n\t\t$this->_render['layout'] = 'admin';\n\n\t\t// Get the document from the db to edit\n\t\t$conditions = array('_id' => $id);\n\t\t$document = Content::find('first', array('conditions' => $conditions));\n\n\t\t// Redirect if invalid content\n\t\tif(empty($document)) {\n\t\t\tFlashMessage::write('That content was not found.');\n\t\t\treturn $this->redirect(array('library' => 'blackprint', 'controller' => 'content', 'action' => 'index', 'admin' => true));\n\t\t}\n\n\t\t$files = array();\n\t\tif(!empty($document->_files)) {\n\t\t\t$files = $document->_files->data();\n\t\t}\n\t\tif($document->delete()) {\n\t\t\tforeach($files as $k => $v) {\n\t\t\t\tAsset::remove(array('_id' => $k));\n\t\t\t\t// Remove any thumbnails if this was an image asset (or other types of children files)\n\t\t\t\tAsset::remove(array('_parent' => new MongoId($k)));\n\t\t\t}\n\t\t\tFlashMessage::write('The content has been deleted.');\n\t\t}\n\n\t\treturn $this->redirect(array('library' => 'blackprint', 'controller' => 'content', 'action' => 'index', 'admin' => true));\n\t}", "public function undeleteAction(){\n\t}", "public function actionDelete($id)\n\t{\n\t\t$this->allowUser(SUPERADMINISTRATOR);\n\t\tif (Yii::app()->request->isPostRequest) {\n\t\t\t// we only allow deletion via POST request\n\t\t\t$this->loadModel($id)->delete();\n\t\t\tTerm::model()->updateAll(array('parent_id'=>null),'parent_id=\"'.$id.'\"');\n\t\t\t\t\t\n\t\t\t$affected_posts = Post::model()->findAllByAttributes(array('post_type_id'=>1));\n\t\t\tforeach($affected_posts as $affected_post) {\n\n\t\t\t\t$terms = implode(',',$this->arrayDelete(explode(',',$affected_post['term_id']),explode(',',$id)));\n\t\t\t\tif ($terms != $affected_post['term_id']) {\n\t\t\t\t\t$post = Post::model()->findByPk($affected_post['id']);\n\t\t\t\t\t$post->term_id = $terms;\n\t\t\t\t\t$post->save();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\t\tif (!isset($_GET['ajax'])) {\n\t\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new CHttpException(400,'Invalid request. Please do not repeat this request again.');\n\t\t}\n\t}", "public function admin_delete($id = false) {\r\n\t\tif($id) {\r\n\t\t\t$this->{$this->modelClass}->delete($id);\t\t\t\r\n\t\t}\r\n\t\tif(isset($this->data)) {\r\n\t\t\t$this->{$this->modelClass}->delete($this->data[$this->modelClass]['id']);\r\n\t\t\t$message = $this->modelClass . ' deleted';\r\n\t\t\t$this->_message($message, array('action' => 'index'));\r\n\t\t} else {\r\n\t\t\t$this->viewPath = 'shared';\r\n\t\t}\r\n }", "public function deleteAction()\n {\n if (!Auth::loggedIn()) {\n return redirect('auth/login');\n }\n\n // Get first parameter from URL as comment $id.($this->params are from Controller)\n // $id = $this->params[0];\n $id = $this->getParam();\n\n // Call static function from Model which return comment object or null.\n $article = Article::findById($id);\n\n if (!$article) {\n return redirect();\n }\n\n if (!$article->canDelete()) {\n return redirect('articles/details/' . $article->id);\n }\n\n $comments = $article->getComments();\n\n // Delete each comment in the loop\n foreach ($comments as $comment) {\n $comment->delete();\n }\n\n // Delete article on the end\n $article->delete();\n\n set_alert('info', '<b>Success!</b> Your article has been deleted!');\n\n return redirect('articles');\n }", "protected function _postDelete() {}", "protected function _postDelete() {}", "public function DELETE() {\n #\n }", "public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }", "public function deleteAction()\n {\n $isPosted = $this->request->getPost('doDelete');\n if (!$isPosted) {\n $this->response->redirect($this->request->getPost('redirect'));\n }\n $comment = [\n 'id' => $this->request->getPost('id'),\n 'pageKey' => $this->request->getPost('pageKey')\n ];\n $comments = new \\Anax\\Comment\\CommentsInSession();\n $comments->setDI($this->di);\n $comments->delete($comment);\n $this->response->redirect($this->request->getPost('redirect'));\n }", "public function actionDelete()\n {\n if(Yii::app()->request->isPostRequest)\n {\n // we only allow deletion via POST request\n $this->loadPost()->delete();\n $this->redirect(array('list'));\n }\n else\n throw new CHttpException(400,'Invalid request. Please do not repeat this request again.');\n }", "public function deleteAction() {\n\t\t$this->_notImplemented();\n\t}", "function index_delete() {\n $id = $this->delete('id');\n $this->db->where('id', $id);\n $delete = $this->db->delete('barang');\n if ($delete) {\n $this->response(array('status' => 'success'), 201);\n } else {\n $this->response(array('status' => 'fail', 502));\n }\n }", "public function actionDelete($id) {\n if (Yii::app()->request->isPostRequest) {\n $model = $this->loadModel($id);\n $imagefile = $model->image;\n if ($imagefile <> '') {\n CommonFunctions::deleteFile(Yii::app()->params['blogImagePath'], $imagefile, true);\n }\n $model->delete();\n echo \"<div class='flash-success'>\" . CommonFunctions::getText(MSG_RECORD_DELETE_SUCCESS) . \"</div>\";\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }\n else\n throw new CHttpException(400, CommonFunctions::getText(MSG_ERROR_400_INVALID_REQUEST));\n }", "public function actionDelete()\n {\n if (!$this->isAdmin()) {\n $this->getApp()->action403();\n }\n\n $request = $this->getApp()->getRequest();\n $id = $request->paramsNamed()->get('id');\n $model = $this->findModel($id);\n if (!$model) {\n $this->getApp()->action404();\n }\n\n $model->delete();\n\n return $this->back();\n }", "public function index_delete(){\n\t\t\n\t\t}", "function index_delete() {\n $id = $this->delete('NewsID');\n $this->db->where('NewsID', $id);\n $delete = $this->db->delete('CMS_News');\n if ($delete) {\n $this->response(array('status' => 'success'), 201);\n } else {\n $this->response(array('status' => 'fail', 502));\n }\n }", "public function delete() {\n\t\t$query = new WP_Query( array(\n\t\t\t'name' => $this->params['post_name'],\n\t\t\t'post_type' => $this->params['post_type']\n\t\t) );\n\n\t\t$post = array_shift( $query->posts );\n\n\t\t// die('<pre>'.var_export($post,true).'</pre>');\n\n\t\tif ( $post ) {\n\t\t\t$current_action = $this->get_current_action();\n\t\t\t$this->action_results[ 'status' ] = 'success';\n\t\t\t$this->action_results[ 'messages' ][ $post->post_type ][ $post->ID ][ 'note' ] = __( 'The information has been deleted', 'kickpress' );\n\t\t\t$this->action_results[ 'data' ][ 'post_id' ] = $post->ID;\n\n\t\t\twp_trash_post( $post->ID );\n\t\t}\n\t}", "public function deleteAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Client_Service_Ad::getAd($id);\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\n\t\t$result = Client_Service_Ad::deleteAd($id);\n\t\tif (!$result) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}", "public function actionDelete(){\n\t\t$form = $_POST;\n\t\t$db = $this->context->getService('database');\n\t\t$db->exec('DELETE FROM core_pages WHERE id = ?', $form['id']);\n\t\t$this->redirect('pages:');\n\t}", "public function delete()\n\t{\n\t\t// Delete the comments\n\t\t$this->comments()->delete();\n\n\t\t// Delete the blog post\n\t\treturn parent::delete();\n\t}", "public function delete()\n\t{\n\t\t// Delete the comments\n\t\t$this->comments()->delete();\n\n\t\t// Delete the blog post\n\t\treturn parent::delete();\n\t}", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "public function delete()\n\n {\n Customers::find($this->deleteId)->delete();\n session()->flash('message', 'Post Deleted Successfully.');\n\n }", "public function delete() {\r\n $page = $this->api->getParam('page', '1');\r\n $this->model->id = $_REQUEST['id'];\r\n $this->checkOwner();\r\n $message = 'Cannot Be Deleted';\r\n if ($this->model->delete()) {\r\n $message = 'Deleted Successfully';\r\n }\r\n $this->api->redirect('contact/home?message=' . $message . '&page=' . $page);\r\n }", "function deleteAction()\r\n\t{\r\n\t\t$data['message'] = \"\";\r\n\t\t$MaNguoiDung = $_GET['MaNguoiDung']; \r\n\r\n\t\t//echo $MaNguoiDung;\r\n\t\tif (isset($MaNguoiDung)) {\r\n\r\n\t\t\t$this->model->load(\"Nguoidung\");\r\n\t\t\t$nguoidung = new Nguoidung_Model();\r\n\t\t\t$nguoidung->delete($MaNguoiDung);\r\n\t\t\t$data['message'] = \"xóa người dùng thành công\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$data['message'] = \"không tồn tại mã người dùng\";\r\n\t\t}\r\n\r\n\t\t$this->indexAction($data);\r\n\t\t\r\n\t}", "public function deleteAction()\n {\n /* Check if user is signed in and redirect to sign in if is not */\n $this->requireSignin();\n\n /* Getting current user's data */\n $user = Auth::getUser();\n\n /* Redirect link after deleting. By default index page */\n $returnUrl = (isset($_POST['return'])) ? '/'.$_POST['return'] : '/';\n\n /* Getting Question by id */\n $answer = Answer::getById(intval($_POST['id']));\n\n /* If Answer exists and is active */\n if ($answer) {\n\n /* Checking if signed in user is answer's author */\n if ($answer->user_id == $user->id) {\n\n /* Check if question deleted */\n if (Answer::delete($answer->id)) {\n\n Flash::addMessage(\"Answer deleted!\", Flash::INFO);\n \n } else {\n\n Flash::addMessage(\"You can not delete this answer!\", Flash::INFO);\n }\n\n } else {\n\n Flash::addMessage(\"You can not delete this answer!\", Flash::INFO);\n }\n\n } else {\n\n Flash::addMessage(\"You can not delete this answer!\", Flash::INFO);\n }\n\n /* Redirect back */\n $this->redirect($returnUrl);\n }", "public function getDestroy($id)\n\t{\n\t\t$l=tbl_blogs::find($id);\n\t\t$l->delete();\n\t\treturn redirect('/home/blog');\n\t}", "public function DeleteAction()\r\n\t{\r\n\t\t// If form has been submitted\r\n\t\tif(isset($_GET['id']))\r\n\t\t{\r\n\t\t\t// Save data to table\r\n\t\t\t$this->View->status = $this->Author->delete($_GET['id']);\r\n\t\t}\r\n\t}", "public function deleting(BlogPost $blogPost)\n\t{\n\t\t//\n\t}", "public function actionDelete()\n {\n if (Yii::$app->request->isPost) {\n $id = Yii::$app->request->post('id');\n $this->findModel($id)->unlinkAll('comments', true);\n if($this->findModel($id)->delete()) {\n Yii::$app->session->setFlash('success', 'Статья удалена');\n } else {\n Yii::$app->session->setFlash('error', 'При удалении возникла ошибка');\n }\n }\n return $this->renderIndex();\n }", "public function deleteActionPost($id) : object\n {\n // Prepare and execute sql-statement\n if (hasKeyPost(\"doDelete\")) {\n $sql = \"UPDATE content SET deleted=NOW() WHERE id=?;\";\n $this->app->db->execute($sql, [$id]);\n }\n\n // Redirect to show content database\n return $this->app->response->redirect(\"content\");\n }", "public function actionDelete()\n {\n if(isset($_POST['id'])){\n $id = $_POST['id'];\n $this->findModel($id)->delete();\n echo \"success\";\n }\n }", "public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }", "public function deleteAction() {\n\t\t$redirect_url = Minz_Request::param('r', false, true);\n\t\tif (!$redirect_url) {\n\t\t\t$redirect_url = array('c' => 'subscription', 'a' => 'index');\n\t\t}\n\t\tif (!Minz_Request::isPost()) {\n\t\t\tMinz_Request::forward($redirect_url, true);\n\t\t}\n\n\t\t$id = Minz_Request::param('id');\n\n\t\tif (self::deleteFeed($id)) {\n\t\t\tMinz_Request::good(_t('feedback.sub.feed.deleted'), $redirect_url);\n\t\t} else {\n\t\t\tMinz_Request::bad(_t('feedback.sub.feed.error'), $redirect_url);\n\t\t}\n\t}", "public function deleted(BlogPost $blogPost)\n\t{\n\t\t//\n\t}", "public function deleteAction()\n {\n \t$this->_helper->getHelper('ViewRenderer')->setNoRender(true);\n \t\n \t// Récuperation de l'ID photo\n\t\t$id = (is_numeric($this->_getParam('id'))) ? $this->_getParam('id') : 0;\n\t\t\n\t\t// Récuperation de la photo\n\t\t$photoMapper = new Application_Model_PhotoMapper();\n\t\t$photo = $photoMapper->getPhoto($id);\n\t\t\n\t\tif(!is_null($photo))\n\t\t{\n\t\t\t// Suppression de la photo\n\t\t\t$rowsDeleted = $photoMapper->deletePhoto($id);\n\t\t\n\t\t\t// Message\n\t\t\t$message = $rowsDeleted.' photo supprimée';\n\t\t\t$this->_helper->getHelper('FlashMessenger')->addMessage($message);\n\t\t\t\n\t\t\t// Redirection\n\t\t\t$this->_helper->getHelper('Redirector')->gotoSimple('edit', 'project', 'admin', array('id' => $photo->getIdProjet()));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_helper->getHelper('Redirector')->gotoSimple('list', 'project', 'admin');\n\t\t}\n }", "public function delete(Request $request)\n {\n if(isset($request['cancel'])) return redirect(\"blog/{$request['id']}\");\n if(!($blog = Blog::find($request['id'])))\n return redirect('blog')->withErrors('Post does not exist');\n\n if($blog->user_id != Auth::id() && !User::find(Auth::id())->admin)\n return redirect('blog')->withErrors('Unable to delete post not owned by current user');\n\n if(isset($request['delete'])) {\n Blog::destroy($request['id']);\n return redirect('blog');\n }\n\n\n return view('blog/delete', ['blog' => $blog]);\n }", "public function deleteAction()\n {\n $this->deleteParameters = $this->deleteParameters + $this->_deleteExtraParameters;\n\n parent::deleteAction();\n }", "public function deleting()\n {\n # code...\n }", "public function deletecategory(){\n\t\n\t\t$id = $this->request->getParameter(\"actionid\");\n\t\t$modelCategory = new CaCategory();\n\t\t$modelCategory->delete($id);\n\t\n\t\t// generate view\n\t\t$this->redirect(\"catalogadmin/categories\");\n\t}", "public function deleteAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Browser_Service_Recsite::getRecsite($id);\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\n\t\tUtil_File::del(Common::getConfig('siteConfig', 'attachPath') . $info['img']);\n\t\t$result = Browser_Service_Recsite::deleteRecsite($id);\n\t\tif (!$result) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}", "function deletes($id) {\n\t\n\tglobal $link;\n\t\n\tdelete (array ('table' => 'articles', 'link' => $link, 'id' => $id));\n\theader(\"location:\".BASE_URL.\"/articles/backoffice_index\");\t\n\n}", "public function deletePostAction() {\n \t$id = $this->getInput('id');\n \tlist($info, $itemsList) = Admin_Service_Material::getById($id);\n \tif ($info && $info['id'] == 0) $this->failPostOutput('无法删除');\n \t$result = Admin_Service_Material::delete($id);\n \tif (!$result) $this->failPostOutput('操作失败');\n \t$attachPath = Common::getConfig('siteConfig', 'attachPath');\n \t$attachroot = Yaf_Application::app()->getConfig()->attachroot;\n \tforeach ($itemsList as $items) {\n \t\tUtil_File::del($attachPath.str_replace($attachroot, \"\", $items['image']));\n \t}\n \t$this->successPostOutput($this->actions['listUrl']);\n }", "public function delete(){\r\n\t\t$this->db->delete();\r\n\t}", "public function actionDelete()\n {\n $id = Yii::$app->request->post('id');\n $this->findModel($id)->delete();\n }", "public function delete() { // Page::destroy($this->pages()->select('id')->get());\n $this->pages()->detach();\n parent::delete();\n }", "public function deleteAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif ($item) {\n\t\t\t$item->delete();\n\t\t}\n\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName));\n\t}" ]
[ "0.79647154", "0.7955823", "0.78939915", "0.7767942", "0.7767942", "0.77510136", "0.76893973", "0.76484615", "0.75295067", "0.75174606", "0.744879", "0.74480104", "0.743859", "0.74230987", "0.7387145", "0.7378031", "0.73777443", "0.7374603", "0.7363383", "0.73403054", "0.7307171", "0.72949463", "0.7274664", "0.72221833", "0.7211757", "0.7202596", "0.71973056", "0.71879524", "0.71458435", "0.71281517", "0.71184564", "0.70756614", "0.7071195", "0.70696425", "0.7064848", "0.7059843", "0.7059472", "0.7052685", "0.70443904", "0.70388657", "0.7034677", "0.7031579", "0.7030982", "0.7026079", "0.7024998", "0.7017517", "0.70041865", "0.6998591", "0.69929206", "0.6968039", "0.6967438", "0.69644934", "0.6960674", "0.69490945", "0.69404334", "0.6935089", "0.6932721", "0.6927197", "0.6926616", "0.6925506", "0.6915928", "0.6910535", "0.6904547", "0.68940806", "0.68808526", "0.6880784", "0.6879857", "0.6878531", "0.68774116", "0.6872241", "0.6869791", "0.6864121", "0.6863535", "0.6863535", "0.68629843", "0.68616927", "0.6855487", "0.6854594", "0.6847529", "0.68328625", "0.6832241", "0.6828984", "0.682271", "0.68218666", "0.6819133", "0.68129504", "0.68100065", "0.68093926", "0.6795428", "0.6795334", "0.6789911", "0.67798316", "0.6776143", "0.6768576", "0.67643017", "0.6763238", "0.6761585", "0.67500764", "0.673907", "0.67260283" ]
0.7044645
38
Action search search the row in the table and return the number of row Access to the action is possible in the following paths: /admin/blog/search
public function searchAction() { parent::searchAction(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function search_result_count($get_search){\n$get_search = htmlspecialchars($get_search);\nglobal $prefix_content;\n\t$newquery=\" and ($prefix_content.post_status='publish' and $prefix_content.title LIKE '%\".mysqli_escape($get_search).\"%' or $prefix_content.content LIKE '%\".mysqli_escape($get_search).\"%')\";\n\t\t$sql = \"SELECT * FROM $prefix_content WHERE post_status='publish' $newquery\";\n\n\t$number = mysqli_num_rows(borno_query($sql));\n\tif(isset($_GET['search']) & !isset($_GET['cat'])){\n\t\treturn $number;\n\t}\n}", "public function getCatalogObjectCountSearch($search = array()) {\n $this->formedStandartSelect();\n\n $this->formedSearchQuery($search);\n\n $res = $this->db->where('site_catalog.parentid = 0')->get();\n// echo $this->db->last_query();\n// die();\n \n return (int)$res->num_rows();\n }", "public function get_search_blog_count($search_value = '')\r\n {\r\n $result =$this->db->query(\"SELECT count(\".$this->prefix.\"blog.blog_id) FROM \".$this->prefix.\"blog left join \".$this->prefix.\"blog_category on \".$this->prefix.\"blog.blog_category = \".$this->prefix.\"blog_category.category_id left join \".$this->usertable.\" on \".$this->prefix.\"blog.user_id = \".$this->usertable.\".\".$this->uidfield.\" where category_name like '%$search_value%' or `blog_desc` like '%$search_value%' or `blog_title` like '%$search_value%' or \".$this->unamefield.\" like '%$search_value%' \");\r\n\t return count($result);\r\n }", "public function record_count_search($key, $column_name) \n\t\t{\n\t\t if ($column_name == \"\") \n\t\t {\n\t\t \t$this->db->like(\"post_title\", $key);\n\t\t \t$this->db->or_like(\"post_desc\", $key);\n\t\t \t$this->db->or_like(\"post_postby\", $key);\n\t\t \t$this->db->or_like(\"post_postdate\", $key);\n\t\t \t$this->db->or_like(\"post_slug\", $key);\n\t\t } \n\t\t else \n\t\t {\n\t\t \t$this->db->like($column_name, $key);\n\t\t }\n\t\t return $this->db->count_all_results(\"table_post\");\n\t\t}", "public function search()\n\t{\n\t\t$search=$this->input->post('search');\n\t\t$data_rows=get_role_manage_table_data_rows($this->Role->search($search),$this);\n\t\techo $data_rows;\n\t}", "public static function record_count($search = '')\n\t{\n\n\t\tglobal $wpdb;\n\t\t$apf_form_tbl = $wpdb->prefix . 'applicant_submissions';\n\n\t\tif (!empty($search)) {\n\t\t\t$sql = \"SELECT * FROM \" . $apf_form_tbl . \" WHERE f_name LIKE '%\" . $search . \"%' OR l_name LIKE '%\" . $search . \"%' OR ap_address LIKE '%\" . $search . \"%' OR ap_email LIKE '%\" . $search . \"%' OR ap_mobile LIKE '%\" . $search . \"%' OR ap_postname LIKE '%\" . $search . \"%' \";\n\t\t} else {\n\t\t\t$sql = \"SELECT * FROM \" . $apf_form_tbl;\n\t\t}\n\n\t\t$wpdb->get_results($sql);\n\n\t\treturn $wpdb->num_rows;\n\t}", "public function DoSearch()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n $this->GetSearchResults_Obj(true);\n \n $ret = $this->GetNumberOfResults();\n \n return $ret;\n }", "public function searchAction()\n {\n $search = $this->createSearchObject();\n $result = $search->searchWord($this->view->word);\n $this->view->assign($result);\n\n if (Model_Query::$debug) {\n $this->view->actionTrace = [\n 'action' => sprintf('%s::searchWord()', get_class($search)),\n 'result' => $result,\n ];\n\n $this->view->queryTrace = Model_Query::$trace;\n }\n\n }", "public function getSearchIndex();", "public function searchAction() {\n $search = $this->getParam('search');\n\n\n $queryBuilder = new Application_Util_QueryBuilder($this->getLogger());\n\n $queryBuilderInput = array(\n 'searchtype' => 'simple',\n 'start' => '0',\n 'rows' => '10',\n 'sortOrder' => 'desc',\n 'sortField'=> 'score',\n 'docId' => null,\n 'query' => $search,\n 'author' => '',\n 'modifier' => 'contains_all',\n 'title' => '',\n 'titlemodifier' => 'contains_all',\n 'persons' => '',\n 'personsmodifier' => 'contains_all',\n 'referee' => '',\n 'refereemodifier' => 'contains_all',\n 'abstract' => '',\n 'abstractmodifier' => 'contains_all',\n 'fulltext' => '',\n 'fulltextmodifier' => 'contains_all',\n 'year' => '',\n 'yearmodifier' => 'contains_all',\n 'author_facetfq' => '',\n 'languagefq' => '',\n 'yearfq' => '',\n 'doctypefq' => '',\n 'has_fulltextfq' => '',\n 'belongs_to_bibliographyfq' => '',\n 'subjectfq' => '',\n 'institutefq' => ''\n );\n\n\n $query = $queryBuilder->createSearchQuery($queryBuilderInput, $this->getLogger());\n\n $result = array();\n\n $searcher = new Opus_SolrSearch_Searcher();\n try {\n $result = $searcher->search($query);\n }\n catch (Opus_SolrSearch_Exception $ex) {\n var_dump($ex);\n }\n\n $matches = $result->getReturnedMatches();\n\n $this->view->total = $result->getAllMatchesCount();\n $this->view->matches = $matches;\n }", "public function actionSearch()\n {\n $search=new SiteSearchForm;\n\n if(isset($_POST['SiteSearchForm']))\n {\n $search->attributes=$_POST['SiteSearchForm'];\n $_GET['searchString']=$search->keyword;\n }\n else\n $search->keyword=$_GET['searchString'];\n\n if($search->validate())\n {\n\n $criteria=new CDbCriteria;\n $criteria->condition='status='.Post::STATUS_PUBLISHED.' AND t.publishTime<'.time();// MFM 1.1 migration Post to t.publishTime\n $criteria->order='createTime DESC';\n\n $criteria->condition.=' AND contentshort LIKE :keyword';\n $criteria->params=array(':keyword'=>'%'.CHtml::encode($search->keyword).'%');\n\n $postCount=Post::model()->count($criteria);\n $pages=new CPagination($postCount);\n $pages->pageSize=Yii::app()->params['postsPerPage'];\n $pages->applyLimit($criteria);\n\n $posts=Post::model()->findAll($criteria);\n }\n\n $this->pageTitle=Yii::t('lan','Search Results').' \"'.CHtml::encode($_GET['searchString']).'\"';\n $this->render('search',array(\n 'posts'=>($posts)?$posts:array(),\n 'pages'=>$pages,\n 'search'=>$search,\n ));\n }", "public function search() {\n // without an entry we just redirect to the error page as we need the entry to find it in the database\n if (!isset($_POST['submit-search']))\n return call('pages', 'error');\n \n //try{\n // we use the given entry to get the correct post\n $userentry = filter_input(INPUT_POST,'search', FILTER_SANITIZE_SPECIAL_CHARS);\n $results = Search::find($_POST['search']);\n require_once('views/pages/SearchResults.php');\n //}\n //catch (Exception $ex){\n // $ex->getMessage();\n // return call('pages','error');\n }", "public function search(){\r\n\t\t//Test if the POST parameters exist. If they don't present the user with the\r\n\t\t//search controls/form\r\n\t\tif(!isset($_POST[\"search\"])){\r\n\t\t\t$this->template->display('search.html.php');\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//Get the recipe from the database\r\n\t\t$recipes = Recipe::search($_POST[\"search\"]);\r\n\t\t//If successful and the count is equal to one (as desired)\r\n\t\t//set the recipe object in the template to be displayed\r\n\t\t$this->template->recipes = $recipes;\r\n\t\r\n\t\t$this->template->display('results.html.php');\r\n\t}", "public function searchAction() {\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$this->view->model = $this->_getParam('model');\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t\n\t\tif ($this->_request->isPost()) {\n\t\t\t$fields = array();\n\t\t\t$func \t= array();\n\t\t\t$query \t= array();\n\t\t\tforeach ($_POST['query'] as $key => $q) {\n\t\t\t\tif (isset($_POST['fields'][$key]) && !empty($_POST['fields'][$key])) {\n\t\t\t\t\t$fields[$key] = $_POST['fields'][$key];\n\t\t\t\t\t$func[$key] \t= $_POST['func'][$key];\n\t\t\t\t\t$query[$key] \t= $_POST['query'][$key];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data = array('fields' => $fields, 'func' => $func, 'query' => $query);\n\t\t\t$data = serialize($data);\n\t\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName, 'data' => $data));\n\t\t}\n\t}", "public function search() {\n$blogposts = BlogPost::search($_POST['search']);\n require_once('views/blogs/search.php');\n}", "public function actionSearch()\n {\n }", "public function search(){}", "public function execute_search()\n {\n\n $search_term = $this->input->post('search');\n\n $v_data = array(\"results\" => $this->Manage_roles_model->get_role($search_term));\n\n $data = array(\n \"title\" => $this->site_model->display_page_title(),\n \"content\" => $this->load->view(\"backoffice/execute_search\", $v_data, true),\n );\n $this->load->view(\"site/layouts/layout\", $data);\n\n }", "function search_total_rows($keyword = NULL) {\n $this->db->like('id_nilai', $keyword);\n\t\t$this->db->or_like('id_infeksi', $keyword);\n\t\t$this->db->or_like('nilai', $keyword);\n\t$this->db->from($this->table);\n return $this->db->count_all_results();\n }", "public function search();", "public function search();", "public function getrecordCount($search) {\n if (!empty($search)) {\n\n $this->db->like('origen', $search['origen']);\n $this->db->like('destino', $search['destino']);\n if ($search['fecha']) { //búsqueda por fecha es opcional\n $this->db->where('fecha', $search['fecha']);\n }\n }\n \n // Si selecciono \"solo mis viajes\"\n $solo_mis_viajes =$this->session->userdata('solo_mis_viajes');\n if ($solo_mis_viajes)\n {\n $id_chofer=$this->session->userdata('id_user');\n $this->db->where('id_chofer', $id_chofer);\n }\n \n $current_date = date(\"Y-m-d\");\n\n $this->db->from('viaje');\n $this->db->where('fecha >= ', $current_date);\n $this->db->where('estado', 0);\n\n return $this->db->count_all_results();\n }", "public function search() {\n\t\t$this->form_validation->set_data($this->input->get());\n\t\t$this->form_validation->set_rules('search', 'Search term', 'required|trim|min_length[3]',array('min_length' => 'The Search term must be at least 3 characters long.'));\n\t\t$this->form_validation->set_error_delimiters('<p class = \"error search-error\">', '</p>\n\t\t\t');\n \t\t// If search fails\n\t\tif ($this->form_validation->run() === FALSE) {\n\t\t\treturn $this->index();\n\t\t} else {\n\t\t\t$expression = $this->input->get('search');\n\t\t\t$posts_count = $this->Posts_model->search_count($expression);\n\t\t\t$query_string_segment = 'page';\n\t\t\t$config = $this->_initPagination(\"/posts/search\", $posts_count, $query_string_segment);\n\t\t\t$data = $this->Static_model->get_static_data();\n\t\t\t$data['pages'] = $this->Pages_model->get_pages();\n\t\t\t$data['categories'] = $this->Categories_model->get_categories();\n //use limit and offset returned by _initPaginator method\n\t\t\t$data['posts'] = $this->Posts_model->search($expression, $config['limit'], $config['offset']);\n\t\t\t$data['expression'] = $expression;\n\t\t\t$data['posts_count'] = $posts_count;\n\t\t\t$this->load->view('partials/header', $data);\n\t\t\t$this->load->view('search');\n\t\t\t$this->load->view('partials/footer');\n\t\t}\n\t}", "public function search() {\n if (!isset($this->params['searchText'])) {\n DooUriRouter::redirect(Doo::conf()->APP_URL);\n return FALSE;\n }\n $blog = new News();\n\n $data['title'] = $this->__('Search results');\n $data['body_class'] = 'index_news';\n $data['selected_menu'] = 'news';\n $data['left'] = PlayerHelper::playerLeftSide();\n $data['right'] = PlayerHelper::playerRightSide();\n\n $list = array();\n $this->appendCategories($list, $news, false);\n\n //crumb adding\n $this->addCrumb($this->__('Search results'));\n $list['crumb'] = $this->getCrumb();\n\n $totalResults = $news->getSearchTotal(urldecode($this->params['searchText']));\n $pager = $this->appendPagination($list, new stdClass(), $totalResults > 0 ? $totalResults : 1, MainHelper::site_url('news/search/' . urlencode($this->params['searchText'])));\n\n $list['hideHeader'] = true;\n $list['searchText'] = urldecode($this->params['searchText']);\n $list['resultCount'] = $totalResults;\n $list['newsList'] = $news->getSearch(urldecode($this->params['searchText']), $pager->limit);\n\n $data['content'] = $this->renderBlock('news/searchResults', $list);\n\n $data['footer'] = MainHelper::bottomMenu();\n $data['header'] = MainHelper::topMenu();\n $this->render3Cols($data);\n }", "public function searchCount() {\n try {\n if (!($this->permission instanceof Base_Model_ObtorLib_App_Core_Doc_Entity_Permission)) {\n throw new Base_Model_ObtorLib_App_Core_Doc_Exception(\" Permission Entity not intialized\");\n } else {\n $objPermission = new Base_Model_ObtorLib_App_Core_Doc_Dao_Permission();\n $objPermission->permission = $this->permission;\n return $objPermission->searchCount();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Doc_Exception($ex);\n }\n }", "function search()\n\t{\n\t\t$search=$this->input->post('search');\n\t\t\t$data_rows=get_temp_manage_table_data_rows1($this->Giftcard->search($search),$this);\n\t\t\techo $data_rows;\n\t}", "public function countSearchResults($data)\n{\n\t$this->db->select('*');\n\t$this->db->where('sample_field', $data['search_key']);\n\t$count=$this->db->count_all_results('sample_table');\n\treturn $count;\n}", "public function searchprocessAction() {\n\t\t$this->_helper->ajaxgrid->setConfig ( ProductsAttributes::grid() )->search ();\n\t}", "public function search()\n\t{\n\t\t\n\t}", "public function count_filtered(){\n $this->datatables_query();\n $query = $this->db->get();\n return $query->num_rows();\n }", "public function searchCount(string $searchText): int;", "public function search()\n {\n $vereinRepository = new VereinRepository();\n $searchTerm = $_GET['searchTerm'];\n $view = new View('verein_index');\n $view->heading = 'Suchbegriff: '. $searchTerm;\n $view->title = 'Vereine';\n $view->vereine = $vereinRepository->search($searchTerm);\n\n $view->display();\n }", "function search_total_rows($keyword = NULL) {\n $this->db->like('id_out', $keyword);\n $this->db->or_like('nomor_permohonan', $keyword);\n $this->db->or_like('tanggal_permohonan', $keyword);\n $this->db->or_like('id_ijin', $keyword);\n $this->db->or_like('barang', $keyword);\n $this->db->or_like('jumlah', $keyword);\n $this->db->or_like('satuan', $keyword);\n $this->db->from($this->table);\n return $this->db->count_all_results();\n }", "public function search() {\n\t\t$data = $this->model->getSearchData($this->table->getFilterNames());\n\t\t$this->table->setData($data);\n\t\t// Store the user/object ids in the session so the report() can reuse them\n\t\t$this->storeIdsInSession($data);\n\t\t$this->tpl->setContent($this->table->getHTML());\n\t}", "public function search($search);", "public function searchprocessAction() {\n\t\t$this->_helper->ajaxgrid->setConfig ( Invoices::grid() )->search ();\n\t}", "function search_total_rows($keyword = NULL) {\n $this->db->like('id_penanaman', $keyword);\n\t$this->db->or_like('nama_penanam', $keyword);\n\t$this->db->or_like('tgl_tanam', $keyword);\n\t$this->db->or_like('id_user', $keyword);\n\t$this->db->or_like('id_pohon', $keyword);\n\t$this->db->or_like('id_petak', $keyword);\n\t$this->db->or_like('status', $keyword);\n\t$this->db->or_like('jumlah', $keyword);\n\t$this->db->from($this->table);\n return $this->db->count_all_results();\n }", "public function get_search_blog($search_value,$offset='',$noofpage='')\r\n {\r\n\t $result=$this->db->query(\"SELECT \".$this->prefix.\"blog.*,\".$this->prefix.\"blog_category.category_name,\".$this->usertable.\".\".$this->unamefield.\" as name FROM \".$this->prefix.\"blog left join \".$this->prefix.\"blog_category on \".$this->prefix.\"blog.blog_category = \".$this->prefix.\"blog_category.category_id left join \".$this->usertable.\" on \".$this->prefix.\"blog.user_id = \".$this->usertable.\".\".$this->uidfield.\" where category_name like '%$search_value%' or `blog_desc` like '%$search_value%' or `blog_title` like '%$search_value%' or \".$this->unamefield.\" like '%$search_value%' order by \".$this->prefix.\"blog.blog_id desc limit $offset,$noofpage \" );\r\n\t return $result;\r\n }", "public function actionSearch()\n {\n $this->render(\"Search\");\n }", "public function count_as_results( $search ){\n\n\t\tif( !empty( $search ) ){\n\n\t\t\t$i = 0;\n\t\t\tforeach( $search as $s_cat => $val ){\n\t\t\t\t$query = \"\";\n\t\t\t\t$j = 0;\n\n\t\t\t\t$size = sizeof($val) - 1;\n\t\t\t\t$title = $s_cat;\n\t\t\t\tforeach ( $val as $sc ){\n\t\t\t\t\tif( $j == 0 ):\n\t\t\t\t\t\t$query .= \" \".$title.\" = '\".$sc.\"'\";\n\t\t\t\t\telse:\n\t\t\t\t\t\t$query .= \" OR \".$title.\" = '\".$sc.\"'\";\n\t\t\t\t\tendif;\n\n\t\t\t\t\t$j++;\n\t\t\t\t}\n\t\t\t\t$i++;\n\n\t\t\t\t$this->db->where( \"(\".$query.\")\" );\n\t\t\t}\n\t\t}\n\t\t$this->db->from('xx_job_post');\n\t\treturn $this->db->count_all_results();\n\t}", "public function actionSearch() {\n $postSearch = new Search;\n if (isset($_POST['Search'])) {\n $postSearch->attributes = $_POST['Search'];\n $keyWord = $postSearch->keyWord;\n $criteria = new CDbCriteria;\n $criteria->distinct = true;\n if (strlen($keyWord) > 0) {\n $searchCondition = '';\n if ($postSearch->searchByName) {\n $searchCondition = 'd.title like :keyWord';\n }\n if ($postSearch->searchByContent) {\n if ($searchCondition == '') {\n $searchCondition = 'd.content like :keyWord';\n } else {\n $searchCondition = ' OR d.content like :keyWord';\n }\n }\n if (!$postSearch->searchByName && !$postSearch->searchByContent) {\n $searchCondition = 'd.title like :keyWord OR d.content like :keyWord';\n }\n if ($searchCondition != '') {\n $searchCondition = ' AND (' . $searchCondition . ')';\n }\n $criteria->join = ' INNER JOIN post_detail d ON t.id=d.post_id ' . $searchCondition;\n $criteria->params = array(':keyWord' => '%' . $keyWord . '%');\n }\n $dataProvider = new CActiveDataProvider('Post', array(\n 'criteria' => $criteria,\n 'pagination' => array(\n 'pageSize' => 15,\n ),\n ));\n $postSearch = new Search;\n $this->render('list', array(\n 'postSearch' => $postSearch,\n 'dataProvider' => $dataProvider,\n ));\n }\n }", "public function search()\n {\n $this->crud->hasAccessOrFail('list');\n\n $this->crud->applyUnappliedFilters();\n\n $totalRows = $this->crud->baseQuery->count();\n $filteredRows = $this->crud->count();\n $startIndex = request()->input('start') ?: 0;\n // if a search term was present\n if (request()->input('search') && request()->input('search')['value']) {\n // filter the results accordingly\n $this->crud->applySearchTerm(request()->input('search')['value']);\n // recalculate the number of filtered rows\n $filteredRows = $this->crud->count();\n }\n // start the results according to the datatables pagination\n if (request()->input('start')) {\n $this->crud->skip((int) request()->input('start'));\n }\n // limit the number of results according to the datatables pagination\n if (request()->input('length')) {\n $this->crud->take((int) request()->input('length'));\n }\n // overwrite any order set in the setup() method with the datatables order\n if (request()->input('order')) {\n $column_number = request()->input('order')[0]['column'];\n $column_direction = request()->input('order')[0]['dir'];\n $column = $this->crud->findColumnById($column_number);\n if ($column['tableColumn']) {\n // clear any past orderBy rules\n $this->crud->query->getQuery()->orders = null;\n // apply the current orderBy rules\n $this->crud->query->orderBy($column['name'], $column_direction);\n }\n\n // check for custom order logic in the column definition\n if (isset($column['orderLogic'])) {\n $this->crud->customOrderBy($column, $column_direction);\n }\n }\n\n // show newest items first, by default (if no order has been set for the primary column)\n // if there was no order set, this will be the only one\n // if there was an order set, this will be the last one (after all others were applied)\n $orderBy = $this->crud->query->getQuery()->orders;\n $hasOrderByPrimaryKey = false;\n collect($orderBy)->each(function ($item, $key) use ($hasOrderByPrimaryKey) {\n if (!isset($item['column'])) {\n return false;\n }\n\n if ($item['column'] == $this->crud->model->getKeyName()) {\n $hasOrderByPrimaryKey = true;\n\n return false;\n }\n });\n if (!$hasOrderByPrimaryKey) {\n $this->crud->query->orderByDesc($this->crud->model->getKeyName());\n }\n\n $entries = $this->crud->getEntries();\n\n return $this->crud->getEntriesAsJsonForDatatables($entries, $totalRows, $filteredRows,\n $startIndex);\n }", "public function RunSearch()\n {\n BizSystem::log(LOG_DEBUG,\"FORMOBJ\",$this->m_Name.\"::RunSearch()\");\n global $g_BizSystem;\n $this->m_SearchRule = \"\";\n foreach ($this->m_RecordRow as $fldCtrl) {\n $value = $g_BizSystem->GetClientProxy()->GetFormInputs($fldCtrl->m_Name);\n if ($value) {\n $searchStr = $this->InputValToRule($fldCtrl->m_BizFieldName, $value);\n if ($this->m_SearchRule == \"\")\n $this->m_SearchRule .= $searchStr;\n else\n $this->m_SearchRule .= \" AND \" . $searchStr;\n }\n }\n\n $this->SetDisplayMode (MODE_R);\n $this->GotoPage(1);\n $this->m_RecordId = null; // clean the current record id\n $this->m_ClearSearchRule = true;\n return $this->ReRender();\n }", "public function index()\n { \n return Post::orderBy('created_at', 'desc')->paginate(5);\n //if( empty(request()->term) ){\n // return Post::orderBy('created_at', 'desc')->paginate(5);\n //}\n //else{\n // $this->search();//(2)\n //}\n }", "public function actionSearch() {\n $keyword = isset($_GET['keyword']) ? $_GET['keyword'] : '';\n $condition = '`id` < 0';\n $tagId = '';\n $page = isset($_GET['page']) ? $_GET['page'] : 1;\n $item = isset(Yii::app()->request->cookies['setItem']) ? Yii::app()->request->cookies['setItem']->value : 30;\n $office = ($page - 1) * $item;\n $listId = '';\n if ($keyword) {\n $string = $keyword;\n $string1 = '\"' . $keyword . '\"';\n $result = Yii::app()->askSearch->get('content:' . $string1 . '^60 OR content:' . $string . '^10 OR title:' . $string1 . '^100 OR title:' . $string . '^20', $office, $item);\n if (isset($result->response->docs)) {\n foreach ($result->response->docs as $doc) {\n $listId .= ',' . $doc->id;\n }\n }\n if (strlen($listId) > 1) {\n $listId = substr($listId, 1);\n $condition = '`id` IN (' . $listId . ')';\n }\n }\n\n $criteria = new CDbCriteria(array(\n 'condition' => $condition,\n 'order' => 'lastUpdate DESC',\n ));\n $criteria->limit = $item;\n $criteria->offset = ($page - 1) * $item;\n\n $dataProvider = new CActiveDataProvider('AskModel', array(\n 'pagination' => false,\n 'criteria' => $criteria,\n ));\n\n $dataProvider = $dataProvider->getData();\n\n //add comment value\n\n $this->commentProcess();\n\n $this->render('view/search', array('dataProvider' => $dataProvider, 'tagId' => $tagId, 'keyword' => $keyword));\n }", "public function indexAction() {\n //on forge la requete SQL\n $articles = $this->repo->getAll();\n \n if ($articles) {\n $nbRows = count($articles);\n \n \n \n \n \n \n \n }\n \n \n \n }", "public function searchResult()\r\n {\r\n // Setting the page title\r\n $this->set(\"title_for_layout\",\"Search Results\");\r\n \r\n // Getting all the categories\r\n $categoryList = $this->Category->getCategoryList();\r\n \r\n // Passing the categories list to views\r\n $this->set('categoryList', $categoryList);\r\n \r\n // initialising the variable\r\n $whereCondition = '';\r\n $search_keyword = '';\r\n // if any search keyword then setting into variable.\r\n if (isset($this->data['Product']['keywords']) && !empty($this->data['Product']['keywords']))\r\n {\r\n $search_keyword = $this->data['Product']['keywords'];\r\n \r\n if(!empty($whereCondition))\r\n {\r\n $whereCondition .= \" AND \";\r\n }\r\n \r\n $whereCondition .= \" (Product.product_name LIKE '%\".$search_keyword.\"%') OR (Product.product_desc LIKE '%\".$search_keyword.\"%') \";\r\n }\r\n \r\n $conditions[] = $whereCondition;\r\n \r\n // Getting the products and categories list agianst search criteria\r\n $productList = $this->Product->getSearchResults($conditions);\r\n \r\n // Passing for first product images by default.\r\n $this->set('productList', $productList);\r\n \r\n // Passing the search keywords to views\r\n $this->set('search_keyword', $search_keyword);\r\n \r\n }", "public function totalNumRows()\n {\n try {\n\n $sql = 'SELECT DISTINCT gil.id_item\n FROM geocontexter.gc_item AS gil\n '.$this->_sql_tables.'\n WHERE gil.title ILIKE ?\n '.$this->_sql_in_id_list;\n\n $res = $this->query($sql, array($this->search . '%'));\n return (int)count($res);\n\n } catch(\\Exception $e) {\n throw $e;\n }\n }", "private function getSearch() {\n\t\tif( $_SESSION['privilege'] != 'anon' ) {\n\n\t\t\t// If NOT anon then IS logged in so set userID to SESSION['id'] \n\t\t\t$userID = $_SESSION['id'];\n\n\t\t} else {\n\t\t\t\n\t\t\t// For this function default $userID to non-exitent user # 0 \n\t\t\t$userID = 0;\n\n\t\t}\n\n\t\t// Set search term per input OR blank\n\n\t\tif( !isset($_POST['search'])) {\n\t\t\t$_POST['search'] = \"\";\n\t\t}\n\t\t\n\t\tif(strlen($_POST['search']) === 0) {\n\t\t\t$searchTerm = \"\";\n\n\t\t} else {\n\t\t\t$result = $_POST['search'];\n\t\t\t$searchTerm = strtolower($result);\n\t\t}\n\n\t\t$this->data['searchTerm'] = $searchTerm;\n\n\t\t$sql = \"SELECT posts.id, title AS score_title, intro AS score_intro, article AS score_article\n\t\t\tFROM posts\n\t\t\tWHERE\n\t\t\t\t(title LIKE '%$searchTerm%' OR \n\t\t\t\tintro LIKE '%$searchTerm%' OR\n\t\t\t\tarticle LIKE '%$searchTerm%')\";\n\n\t\tif( $_SESSION['privilege'] != 'admin' ) {\n\n\t\t\t$sql .= \" AND (user_id = $userID\n\t\t\t\t\tOR status = 'Approved')\t\n\t\t\t\t\tORDER BY score_title ASC\";\n\t\t\n\t\t} else {\n\n\t\t\t$sql .= \" ORDER BY score_title ASC\";\t\n\n\t\t}\t\t\n\t\n\t\t$result = $this->dbc->query($sql);\n\n\t\tif( !$result || $result->num_rows == 0) {\n\t\t\t$this->data['searchResults'] = \"No results\";\n\t\t} else {\n\t\t\t$this->data['searchResults'] = $result->fetch_all(MYSQLI_ASSOC);\n\t\t}\n\t}", "function _admin_search_query()\n {\n }", "public function search()\n {\n\n $q = input::get('q');\n if($q !=\"\"){\n $search = DB::table('postad')\n ->where('title','LIKE','%'.$q.'%')\n ->orWhere('description','LIKE','%'.$q.'%')\n ->get();\n\n if(count($search)>0){\n return view('basic.search')->withDetails($search)->withQuery($q);\n }\n else{\n return Redirect::back()->with('search', ['Result Not Found']);\n }\n }\n else{\n return Redirect::back();\n } \n }", "public function searchAction()\n {\n $user_id = $this->getSecurityContext()->getUser()->getId();\n $drive = $this->_driveHelper->getRepository()->getDriveByUserId($user_id);\n\n $q = $this->getScalarParam('q');\n // $hits = $this->getResource('drive.file_indexer')->searchInDrive($q, $drive->drive_id);\n $hits = $this->getResource('drive.file_indexer')->search($q);\n\n echo '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />';\n echo '<strong>', $hits->hitCount, '</strong> hits<br/>';\n foreach ($hits->hits as $hit) {\n $file = $this->_driveHelper->getRepository()->getFile($hit->document->file_id);\n if (empty($file)) {\n echo 'Invalid file ID: ', $hit->document->file_id;\n }\n if ($file && $this->_driveHelper->isFileReadable($file)) {\n echo '<div>', '<strong>', $file->name, '</strong> ', $this->view->fileSize($file->size), '</div>';\n }\n }\n exit;\n }", "public function searchCount($keyword)\n {\n $keyword = \"%{$keyword}%\";\n $sql = \"SELECT count(*) as totalItem\n FROM \" . self::TABLE_NAME . \"\n WHERE LOWER(id) LIKE LOWER(?) OR\n LOWER(pro_name) LIKE LOWER(?) OR\n LOWER(pro_slug) LIKE LOWER(?)\";\n $stmt = $this->prepare($sql);\n $stmt->bind_param(\"sss\", $keyword, $keyword, $keyword);\n $stmt->execute();\n $result = $stmt->get_result();\n $stmt->close();\n $result = $result->fetch_assoc();\n return $result['totalItem'];\n }", "public function commonsearch()\r\n \t{ echo '';exit;\r\n\t\t$key=html::specialchars($this->input->get('search_value')); \r\n\t\t $this->value = $key; \r\n\t\t$page_no=$this->uri->last_segment();\r\n\t\tif($page_no==0 || $page_no=='commansearch')\r\n\t\t$page_no = 1;\r\n\t\t$offset=10*($page_no-1);\r\n\t\r\n\t\t $this->template->get_blog=$this->model->get_common_search($key,'category',$offset,10);\r\n\t\t $this->total=$this->model->count_common_search($key,'category');\r\n\t\t\r\n\t\t $this->template->pagination = new Pagination(array\r\n\t\t (\r\n\t\t\t 'base_url' => 'blog',\r\n\t\t\t 'uri_segment' =>'commonsearch',\r\n\t\t\t 'items_per_page' => 10,\r\n\t\t\t 'total_items' => $this->total,\r\n\t\t\t 'style' => 'classic' )\r\n\t\t\t );\t\r\n\t \r\n\t\r\n\t\t// template code\r\n\t\t$this->template->title = \"Search Blogs\"; \r\n\t\t$this->left=new View(\"blog_leftmenu\");\r\n\t\t$this->right=new View(\"manage_blogs\");\r\n\t\t$this->title_content = \"Search Blogs\";\r\n\t\t$this->template->content=new View(\"template/template2\"); \r\n\r\n\t}", "function itemListingCount($searchStatus = null, $searchName = '')\n {\n $query = \"select count(feedback.no) as total_cnt \n from feedback\n left join user on feedback.user_id = user.no\n left join event on feedback.event_id = event.id\n where feedback.event_id = event.id \";\n if (!empty($searchText)) {\n if (isset($searchStatus)) {\n if ($searchStatus == '0') {\n $query = $query . \" and (user.nickname LIKE '%\" . $searchText . \"%')\";\n } else {\n $query = $query . \" and (event.name LIKE '%\" . $searchText . \"%')\";\n }\n }\n }\n $result = $this->db->query($query);\n return $result->row()->total_cnt;\n }", "public function search_result(string $term)\n {\n # select table to count data\n $query = \"SELECT\n (SELECT COUNT(*) FROM news WHERE title LIKE '%{$term}%') as news,\n (SELECT COUNT(*) FROM accounts WHERE username LIKE '%{$term}%' OR email LIKE '%{$term}%') as accounts,\n (SELECT COUNT(*) FROM blog WHERE title LIKE '%{$term}%') as blog,\n (SELECT COUNT(*) FROM contect WHERE seen = 0) as message\n FROM DUAL\";\n # use fake table (use count table)\n return $this->db->query($query)->result_array()[0];\n }", "public function search(){\t\r\r\n\r\r\n\t\t\r\r\n\t\t$this->load->database();\r\r\n\t\t$this->load->library('custom_search_library');\r\r\n\t\t//$this->custom_search_library->create_index();\r\r\n\t\t$this->custom_search_library->search( $_POST['keyword'] );\r\r\n\t}", "public function action_search()\n\t{\n\t\tglobal $txt, $context;\n\n\t\t// What can we search for?\n\t\t$subActions = array(\n\t\t\t'internal' => array($this, 'action_search_internal', 'permission' => 'admin_forum'),\n\t\t\t'online' => array($this, 'action_search_doc', 'permission' => 'admin_forum'),\n\t\t\t'member' => array($this, 'action_search_member', 'permission' => 'admin_forum'),\n\t\t);\n\n\t\t// Set the subaction\n\t\t$action = new Action('admin_search');\n\t\t$subAction = $action->initialize($subActions, 'internal');\n\n\t\t// Keep track of what the admin wants in terms of advanced or not\n\t\tif (empty($context['admin_preferences']['sb']) || $context['admin_preferences']['sb'] != $subAction)\n\t\t{\n\t\t\t$context['admin_preferences']['sb'] = $subAction;\n\n\t\t\t// Update the preferences.\n\t\t\trequire_once(SUBSDIR . '/Admin.subs.php');\n\t\t\tupdateAdminPreferences();\n\t\t}\n\n\t\t// Setup for the template\n\t\t$context['search_type'] = $subAction;\n\t\t$context['search_term'] = $this->_req->getPost('search_term', 'trim|\\\\ElkArte\\\\Util::htmlspecialchars[ENT_QUOTES]');\n\t\t$context['sub_template'] = 'admin_search_results';\n\t\t$context['page_title'] = $txt['admin_search_results'];\n\n\t\t// You did remember to enter something to search for, otherwise its easy\n\t\tif ($context['search_term'] === '')\n\t\t{\n\t\t\t$context['search_results'] = array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$action->dispatch($subAction);\n\t\t}\n\t}", "public function admin_search() {\n $url['action'] = 'index';\n \n // build a URL will all the search elements in it\n // the resulting URL will be\n // example.com/cake/posts/index/Search.keywords:mykeyword/Search.tag_id:3\n foreach ($this->data as $k=>$v){\n foreach ($v as $kk=>$vv){\n $url[$k.'.'.$kk]=$vv;\n }\n }\n \n // redirect the user to the url\n $this->redirect($url, null, true);\n }", "public function index()\n\t{\n\t\t\n\t\t\t// Lets start with pagination\n\t\t\t// First off, how many items per page and what page are we on?\n\t\t $per_page = 10;\n\t\t\t$current_page = (isset($_GET['p'])) ? intval($_GET['p']) : '1';\n\t\t\t\n\t\t\t// If there a search being done?\n\t\t\tif (isset($_GET['search']))\n\t\t\t{\n\t\t\t\t$this->data['search_value'] = htmlspecialchars($_GET['search']);\n\t\t\t}\n\t\t\t\n\t\t// This is to check if the slug being given matches one in the index_information table, if not then we'll check later if it's even a table\n\t\t$index_info = new Index_Information;\n\t\t\n\t\tif ($index_info->select(array('slug'=>strtolower(Router::uri(3)))))\n\t\t{\n\t\t\t$this->data['page_title'] = $index_info->title;\n\t\t\t$this->data['table'] = $index_info->table;\n\t\t\t\n\t\t\t// If no custom sql is in the table then just use the default select * statement\n\t\t\tif (is_null($index_info->sql) || empty($index_info->sql))\n\t\t\t\t$index_info->sql = '%select%';\n\t\t\t\n\t\t\t// Check if we should do a search...\n\t\t\tif (isset($this->data['search_value']))\n\t\t\t{\n\t\t\t\t// If there's already a where statement we need an AND\n\t\t\t\tif (preg_match('/where/i', $index_info->sql))\n\t\t\t\t\t$index_info->sql .= 'AND ';\n\t\t\t\t\n\t\t\t\t$index_info->sql .= '';\n\t\t\t}\n\n\t\t // Next, get the total number of items in the database\n\t\t\t// I know this isn't the most efficient count rows but because this can be a custom query, i don't know how else...\n\t\t $num_entries = Database::get_instance()->num_rows(str_replace('%select%', 'SELECT * FROM ' . $index_info->table, $index_info->sql));\n\t\t\tif ($num_entries == false)\n\t\t\t\t$num_entries = 0;\n\n\t\t // Initialize the Pager object\n\t\t $pager = new Pagination($current_page, $per_page, $num_entries);\n\t\t\n\t\t\t// Converting string in url to what should match a db object\n\t\t\t$db_object_name = String::uc_slug($index_info->table, '_', '_');\n\t\t\n\t\t\t// If $db_object doesn't match a current class then something's wrong...\n\t\t\tif (!class_exists($db_object_name))\n\t\t\t\tdie('<h2>Sorry, ' . $db_object_name . ' does not exist.</h2>');\n\t\t\t\n\t\t\t$db_object = new $db_object_name;\n\t\t\n\t\t\t$this->data['fields'] = $db_object->get_fields();\n\t\t\t\n\t\t\t// TODO: Parameter for added columns should be included, must add field to table and model\n\t\t\t$this->data['objects'] = $db_object->select_many($index_info->sql . ' LIMIT ' . $pager->first_record . ', ' . $pager->per_page);\n\t\t\t\n\t\t\t/*\n\t\t\t\tTEMPLATE FIELD FORMAT:\n\t\t\t\t<table>header html...\n\t\t\t\t%startloop%\n\t\t\t\t<tr>loop info</tr> %fieldname% %fieldname%\n\t\t\t\t%endloop%\n\t\t\t\t</table>footer html\n\t\t\t*/\n\t\t\n\t\t\t$this->data['template']['header'] = preg_match('/(.*?)%startloop%/im', $index_info->template, $matches);\n\t\t\t$this->data['template']['header'] = $matches[1];\n\t\t\n\t\t\t$this->data['template']['loop'] = preg_match('/%startloop%(.*?)%endloop%/im', $index_info->template, $matches);\n\t\t\t$this->data['template']['loop'] = $matches[1];\n\t\t\n\t\t\t$this->data['template']['footer'] = preg_match('/%endloop%(.*?)/im', $index_info->template, $matches);\n\t\t\t$this->data['template']['footer'] = $matches[1];\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->data['table'] = String::clean(Router::uri(3), '_');\n\t\t\t\n\t\t\t// Converting string in url to what should match a db object\n\t\t\t$db_object_name = String::uc_slug(Router::uri(3), '_', '-');\n\t\t\t\n\t\t\t$db_object = new $db_object_name;\n\t\t\n\t\t\t$this->data['fields'] = $db_object->get_fields();\n\t\t\n\t\t\t// If $db_object doesn't match a current class then something's wrong...\n\t\t\tif (!class_exists($db_object_name))\n\t\t\t\tdie('<h2>Sorry, ' . $db_object_name . ' does not exist.</h2>');\n\t\t\t\n\t\t\t// This is where we'll store the WHERE info the sql statement\n\t\t\t$where = '';\n\t\t\t\n\t\t\t// Check if we should do a search...\n\t\t\tif (isset($this->data['search_value']))\n\t\t\t{\t\n\t\t\t\t$where .= ' WHERE ';\n\t\t\t\tforeach ($this->data['fields'] as $field)\n\t\t\t\t{\n\t\t\t\t\t$where .= '(`' . $field .'` LIKE \\'%' . Database::get_instance()->escape($this->data['search_value']) . '%\\') OR ';\n\t\t\t\t}\n\t\t\t\t$where = ' ' . trim($where, 'OR ');\n\t\t\t}\n\n\t\t // Next, get the total number of items in the database\n\t\t $this->data['num_entries'] = $num_entries = Database::get_instance()->get_value('SELECT COUNT(*) FROM `' . $this->data['table'] . '`' . $where);\n\n\t\t // Initialize the Pager object\n\t\t $pager = new Pagination($current_page, $per_page, $num_entries);\n\t\t\t\n\t\t\t$this->data['objects'] = $db_object->select_many('%select%' . $where . ' ORDER BY ' . $db_object->id_column_name . ' DESC LIMIT ' . $pager->first_record . ', ' . $pager->per_page);\n\n\t\t\t$this->data['page_title'] = String::uc_slug(Router::uri(3), ' ', '_');\n\t\t\t\n\t\t\t$this->data['template']['header'] = '<table class=\"default_table\"><tr><th class=\"entry_actions_wrapper\"></th>';\n\t\t\t$this->data['template']['footer'] = '</table>';\n\t\t\t$this->data['template']['loop'] = '<tr class=\"entry_row\" id=\"entry_%id%\"><td class=\"entry_actions_wrapper\"><div class=\"entry_actions\"><a href=\"' . WEB_ROOT . Router::uri(0) . '/delete/' . Router::uri(3) . '/%id%/\" class=\"delete\" rel=\"facebox.default_modal\">Delete</a><a href=\"' . WEB_ROOT . Router::uri(0) . '/edit/' . Router::uri(3) . '/%id%/\" class=\"edit\">Edit</a></div></td>';\n\t\t\n\t\t\t\t// We only want to return the first 4 fields, more than that and it might be too long\n\t\t\t\tif (count($this->data['fields']) > 4)\n\t\t\t\t\t$this->data['fields'] = array_slice($this->data['fields'], 0, 4);\n\t\t\t\t\n\t\t\t\tforeach ($this->data['fields'] as $field) \n\t\t\t\t{\n\t\t\t\t\t$this->data['template']['header'] .= '<th>' . String::uc_slug($field, ' ', '_') . '</th>';\n\t\t\t\t\t$this->data['template']['loop'] .= '<td>%' . $field . '%</td>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$object_filter = new Object_Filter();\n\t\t\t\t$this->data['objects'] = $object_filter->for_display($this->data['table'], $this->data['fields'], $this->data['objects']);\n\t\t\t\n\t\t\t\t// Final column for edit and delete buttons\n\t\t\t\t$this->data['template']['header'] .= '</tr>';\n\t\t\t\t$this->data['template']['loop'] .= '</tr>';\n\t\t\n\t\t\t$this->data['template']['header'] .= '</tr>';\n\t\t}\n\t\t\n\t\t$this->data['pager'] = $pager;\n\t\t$this->load_template('index');\n\t}", "public function search()\n {\n $data['resultList'] = $this->ReviewModel->searchForReview($this->input->post('searchtxt'));\n $data['body'] = 'results';\n $this->load->view('template', $data);\n }", "function CountNumPosts($search_string) {\n $sql = \"SELECT count(*) FROM \".GALLERY_POST_TABLE.\" T WHERE \".CreateSQLClauses($search_string).\";\";\n if (!sql_query_into($result, $sql, 1)) return -1; // Get 1 row containing the count.\n $row = $result->fetch_assoc();\n return $row['count(*)'];\n}", "public function search()\n {\n return view('blog::blog.search');\n }", "function count_all_search()\r\n\t{\r\n\t\t$value = $this->input->get('name');\r\n\t\t$this->db->like('roomName',$value);\r\n\t\t$this->db->or_like('file_name',$value);\r\n\t\t$query = $this->db->get('lecture_room');\r\n\t\treturn $query->num_rows();\r\n\t}", "public function count_search_detail_chats($post_data){\n $searchId = $post_data['searchId'];\n\n $sql = \"SELECT c.*,u.firstName,u.lastName FROM chat c,users u \n WHERE c.searchId = $searchId AND c.deleteFlag !=1 AND c.userId = u.userId\n ORDER BY c.createdAt ASC\";\n $record = $this->db->query($sql);\n if($record->num_rows()>0){\n return $record->num_rows();\n }else{\n return false;\n }\n }", "public function search() {\n $page = \"home\";\n $param = $this->input->post('search');\n if(!file_exists(APPPATH.'views/pages/'.$page.'.php')) {\n show_404();\n }\n\n\n $data['title'] = \"New Posts\";\n $data['posts'] = $this->Posts_model->get_posts_search($param);\n $data['total'] = count($data['posts']);\n\n $this->load->view('templates/header');\n $this->load->view('pages/'.$page, $data);\n $this->load->view('templates/footer');\n }", "function search() {}", "public function searchCount($keyword)\n {\n $keyword = \"%{$keyword}%\";\n $sql = \"SELECT count(*) as totalItem\n FROM \" . self::TABLE_NAME . \"\n WHERE LOWER(news_name) LIKE LOWER(?) OR\n LOWER(news_slug) LIKE LOWER(?) OR\n LOWER(news_content) LIKE LOWER(?) OR\n LOWER(news_seo_title) LIKE LOWER(?) OR\n LOWER(news_seo_description) LIKE LOWER(?)\";\n $stmt = $this->prepare($sql);\n $stmt->bind_param(\"sssss\", $keyword, $keyword, $keyword, $keyword, $keyword);\n $stmt->execute();\n $result = $stmt->get_result();\n $stmt->close();\n $result = $result->fetch_assoc();\n return $result['totalItem'];\n }", "public function userSearch()\n {\n $query = $this->input->post('query');\n $data['results'] = $this->admin_m->search($query);\n $data['query'] = $query;\n $data['content'] = 'admin/searchResults';\n $this->load->view('components/template', $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\r\n\t\t\r\n\t\t$this->title = 'Search Media';\r\n\t\t$this->list = $this->Results();\r\n\t\treturn $this->renderWith(array('Media_results','App'));\r\n\t}", "public function countFiltered($postData,$table,$column_order,$column_search,$order){\r\n $this->_get_datatables_query($postData,$table,$column_order,$column_search,$order);\r\n $query = $this->db->get();\r\n return $query->num_rows();\r\n }", "function fetch_total_restaurant_rows($query)\n {\n $search = $query['search'];\n $this->db->select('*')->from($this->table);\n if(!empty($search)) {\n\t\t\t$this->db->like('restaurant_name', $search);\n\t\t}\n return $this->db->get()->num_rows();\n }", "public function Index(){\r\n\t\tif (isset($_POST['q'])) {\r\n\t\t\t$q = trim($_POST['q']);\r\n\t\t\t$q = strtolower($q);\r\n\t\t$this->query(\"SELECT * FROM images WHERE img_title LIKE '%\".$q.\"%'\");\r\n\t\t$rows = $this->resultSet();\r\n\t\treturn $rows;\r\n\t\t}\r\n\t}", "public function get_search_post_count($q)\r\n {\r\n $this->set_filter_query();\r\n $this->db->group_start();\r\n $this->db->like('posts.title', $q);\r\n $this->db->or_like('posts.content', $q);\r\n $this->db->or_like('posts.summary', $q);\r\n $this->db->group_end();\r\n $query = $this->db->get('posts');\r\n return $query->num_rows();\r\n }", "function count_filtered()\n {\n $this->_get_datatables_query();\n $query = $this->db->get();\n return $query->num_rows();\n }", "function search() {\n // ...\n }", "public function indexAction ()\r\n {\r\n // TODO Auto-generated SearchController::indexAction() default action\r\n }", "public function search()\n {\n\n }", "public function search()\n {\n\n }", "function geScalaire($table, $col2count, $filter, $op = 'count', $debug = false){\n\tGlobal $xoopsDB, $xoopsConfig, $xoopsModule;\n\t\n $sql = \"SELECT {$op}({$col2count}) AS nbEnr \"\n .\" FROM \".$xoopsDB->prefix($table)\n .(($filter == '') ? '' : \" WHERE {$filter}\"); \n\n $sqlquery = $xoopsDB->query ($sql); \n if ($xoopsDB->getRowsNum($sqlquery) == 0){\n $r = 0;\n }else{\n //$sqlfetch = $xoopsDB->fetchArray($sqlquery);\n //$r = $sqlfetch['nbEnr'] ;\n list($r) = $xoopsDB->fetchRow($sqlquery);\n }\n \n if ($debug) echo \"<hr>countArchives<br>$sql<hr>\";\n //displayArray($t,\"----- countArchives -----\");\n return $r;\n}", "public function actionIndex() {\n\n if (($term = Yii::app()->getRequest()->getParam('s'))) {\n \n $index = new Zend_Search_Lucene(Yii::getPathOfAlias('application.' . $this->_indexFiles));\n Zend_Search_Lucene_Search_QueryParser::setDefaultEncoding(\"UTF-8\");\n $results = $index->find($term);\n $query = Zend_Search_Lucene_Search_QueryParser::parse($term);\n $dataProvider = new CArrayDataProvider($results, array(\n 'pagination' => array(\n 'pageSize' => 1,\n 'params'=>array('s'=>$term),\n ),\n ));\n \n \n $this->render('search', array('results' => $results, 'term' => $term, 'query' => $query, 'data' => $dataProvider));\n } else {\n $this->redirect(array('site/index'));\n }\n }", "public function actionSearch($info){\n $cl = new SphinxClient();\n $cl->SetServer ( '127.0.0.1', 9312);\n//$cl->SetServer ( '10.6.0.6', 9312);\n//$cl->SetServer ( '10.6.0.22', 9312);\n//$cl->SetServer ( '10.8.8.2', 9312);\n $cl->SetConnectTimeout ( 10 );\n $cl->SetArrayResult ( true );\n// $cl->SetMatchMode ( SPH_MATCH_ANY);\n $cl->SetMatchMode ( SPH_MATCH_EXTENDED2);\n $cl->SetLimits(0, 1000);\n// $info = '戴尔';\n $res = $cl->Query($info, 'goods');//shopstore_search\n//print_r($cl);\n// print_r($res);\n// var_dump($res);exit;\n if (isset($res)){\n $ids=[];\n foreach ($res['matches'] as $r){\n $ids[] = $r['id'];\n }\n $pager = new Pagination();\n $pager->totalCount = Goods::find()->where(['in','id',$ids])->count();\n $pager->defaultPageSize = 4;\n $goods = Goods::find()->where(['in','id',$ids])->andWhere(['status'=>1])->offset($pager->offset)->limit($pager->limit)->all();\n //实例化表单模型\n// var_dump($ids);exit;\n// $goods = Goods::find()->where(['goods_category_id'=>$parent_id])->andWhere(['status'=>1])->all();\n// var_dump($pager);exit;\n return $this->render('/list/index',['goods'=>$goods,'pager'=>$pager]);\n\n\n }else{\n\n }\n }", "function count_search_product_result($conditions_array=array()){\n\t\t$this->db->where($conditions_array);\n\t\t$this->db->like('product', $this->input->post('search_text'));\n\t\t$this->db->or_like('description', $this->input->post('search_text'));\n\t\treturn $this->db->count_all_results('red_support_product as rsp');\n\t}", "public function searchAction()\n {\n $page = $this->params()->fromQuery('page', 1);\n $filter = $this->params()->fromQuery('s', '');\n\n // Filter posts by type\n $query = $this->entityManager->getRepository(Post::class)->findPostsBySearchQuery($filter);\n\n $adapter = new DoctrineAdapter(new ORMPaginator($query, false));\n $paginator = new Paginator($adapter);\n $paginator->setDefaultItemCountPerPage(15);\n $paginator->setCurrentPageNumber($page);\n\n /* Change layout */\n $this->layout()->setTemplate('layout/layout-front');\n\n /* Latest 3 posts */\n $latestPosts = $this->entityManager->getRepository(Post::class)->findLatestPosts(2);\n\n /* Countries List */\n $countries = $this->entityManager->getRepository(Post::class)->getCountries();\n\n /* Cuisine Types list */\n $types = $this->entityManager->getRepository(Post::class)->getCuisineTypes();\n\n // Render the view template.\n return new ViewModel([\n 'posts' => $paginator,\n 'postManager' => $this->postManager,\n 'countries' => $countries,\n 'types' => $types,\n 'latestPosts' => $latestPosts\n ]);\n }", "public function search(){ \n\t\t$this->layout = false;\t \n\t\t$q = trim(Sanitize::escape($_GET['q']));\t\n\t\tif(!empty($q)){\n\t\t\t// execute only when the search keywork has value\t\t\n\t\t\t$this->set('keyword', $q);\n\t\t\t$data = $this->BdSpoc->find('all', array('fields' => array('HrEmployee.first_name'),\n\t\t\t'group' => array('first_name'), 'conditions' => \tarray(\"OR\" => array ('first_name like' => '%'.$q.'%'),\n\t\t\t'AND' => array('HrEmployee.status' => '1', 'HrEmployee.is_deleted' => 'N','BdSpoc.is_deleted' => 'N'))));\t\t\n\t\t\t$this->set('results', $data);\n\t\t}\n }", "public function index()\n {\n if(request()->has('search')){\n $posts=post::where('id',request('search'))\n ->Orwhere('title','Like','%'.request('search').'%')\n ->paginate(8);\n }\n else{\n $posts=post::paginate(8);\n }\n return view('admin/post/show',compact('posts'));\n }", "function searchAction() {\n\t\t$this->getModel()->setPage($this->getPageFromRequest());\n\t\t$this->getInputManager()->setLookupGlobals(utilityInputManager::LOOKUPGLOBALS_GET);\n\t\t$inData = $this->getInputManager()->doFilter();\n\t\t$this->addInputToModel($inData, $this->getModel());\n\t\t$oView = new userView($this);\n\t\t$oView->showSearchLeaderboard();\n\t}", "public function countQuery();", "public function doSearch() {\n\t\t$data['posts'] = $this->Messages_model->searchMessages($this->input->get('query'));\n\t\t$this->load->view('view_viewmessages',$data);\n\t}", "public function search()\n {\n // Start calculating the execution time.\n $start = microtime(true);\n\n $query = Document::sanitize(Input::get('query'));\n\n // Validate the input.\n $validator = Validator::make([\n 'query' => $query,\n ], [\n 'query' => 'required|min:4'\n ]);\n\n // Check the validation.\n if ($validator->fails())\n {\n return Redirect::home()->with('error_message', 'الرجاء إدخال كلمة البحث و التي لا تقل عن 3 أحرف.');\n }\n\n // Other than that, everything is great.\n // TODO: Maybe rank them then order them by the ranking.\n $results = Document::whereRaw('MATCH(title, content) AGAINST(?)', [$query])->get();\n\n if ($results->count() == 0)\n {\n return Redirect::home()->with('warning_message', 'لم يتم العثور على نتائج لبحثك.');\n }\n\n $keywords = explode(' ', $query);\n\n $finish = microtime(true);\n\n $taken_time = round(($finish-$start), 3);\n\n // If there is at least one result, show it.\n return View::make('pages.search')->with(compact('results', 'query', 'keywords', 'taken_time'));\n }", "public function search()\r\n {\r\n $this->setTpl('search.htm');\r\n $this->setControllerTitle('Apollo');\r\n $this->setCurrentControllerName('Rechecher une condition');\r\n }", "function allposts_count($tabel,$where = \"\")\n { \n if (!empty($where)) {\n $query = $this->db->where($where)->get($tabel);\n }else{\n $query = $this->db->get($tabel);\n }\n return $query->num_rows(); \n }", "public function getQueryCount();", "public static function getTotalSearchResultsCount() {\n\n $category_dress_type_id = isset($_POST['product_type']) ? $_POST['product_type'] : '';\n $search_term = $_POST['search_term'];\n\n if (isset($_POST['model_type'])) {\n $model_type = $_POST['model_type'];\n switch ($model_type) {\n case \"girl\":\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=260\");\n Db_Actions::DbSelect(\"SELECT product_id FROM cscart_product_descriptions WHERE product LIKE '%\" . $search_term . \"%'\");\n break;\n case \"boy\":\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=261\");\n\n break;\n }\n }\n $products_count = Db_Actions::DbGetResults();\n if (!isset($products_count->empty_result)) {\n foreach ($products_count as $count) {\n echo ceil($count->totalprds / 9);\n }\n }\n else {\n echo 0;\n }\n }", "function get_filtered_data(){\n $this->make_query();\n $query = $this->db->get();\n return $query->num_rows();\n }", "public function FetchTotalRowsSearch($qSearch) {\n\t\n\t\t$encTxt = Encryption::Encrypt($qSearch);\n\t\n\t\t$query = \"SELECT Count(*) AS total FROM \" . $this->mTableName .\n\t\t\" WHERE username LIKE '%$qSearch%' OR date_create LIKE '%$qSearch%' OR email = '$encTxt' ;\";\n\t\t$objects = $this->SelectWithQuery($query);\n\t\treturn $objects[0]->total;\n\t}", "public function actionSearchEmployee()\n {\n// $search= Employee::getIdEmployee();\n// if ($search!=null)\n// {\n $this->render('SearchEmployee');\n// $this->render('SearchEmployee', array('search'=>$search));\n// }\n// else\n// {\n// return false;\n// }\n }", "function filter_rsa_tambah_em(){\n\t\t\tif($this->check_session->user_session() && $this->check_session->get_level()==100){\n\t\t\t\t$keyword = form_prep($this->input->post('keyword'));\n\t\t\t\t$data['result_rsa_tambah_em'] = $this->rsa_tambah_em_model->search_rsa_tambah_em($keyword);\n\t\t\t\t$this->load->view('rsa_tambah_em/row_rsa_tambah_em',$data);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tshow_404('page');\n\t\t\t}\n \n \n\t\t}", "function find( $searchString )\n\t{\n\t\t$this->data['pagebody'] = 'searchResult'; // this is the view we want shown\n\t\t$this->data['searchString'] = $searchString;\n\t\t\n $this->render();\n\t}", "public function actionIndex()\n {\n $searchModel = new PostSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->post());\n \n //setlocale(LC_ALL, 'en_US.UTF-8');\n setlocale(LC_CTYPE, 'ru_RU.UTF-8');\n //Lucene\\Lucene::setDefaultSearchField('contents');\n Lucene\\Search\\QueryParser::setDefaultEncoding('UTF-8');\n Lucene\\Analysis\\Analyzer\\Analyzer::setDefault(new Lucene\\Analysis\\Analyzer\\Common\\Utf8\\CaseInsensitive());\n Lucene\\Lucene::setResultSetLimit(10);\n \n\n // create blog posts index located in /data/posts_index ,make sure the folder is writable\n $index = Lucene\\Lucene::create('data/posts_index');\n\n $posts = Post::find()->all();\n //var_dump($posts);die();\n // iterate through posts and build the index\n foreach ($posts as $p) {\n $doc = new Lucene\\Document();\n $doc->addField(Lucene\\Document\\Field::UnIndexed('entry_id', $p->id));\n $doc->addField(Lucene\\Document\\Field::Keyword('title', $p->title));\n $doc->addField(Lucene\\Document\\Field::text('contents', $p->content));\n $index->addDocument($doc);\n }\n // commit the index\n $index->commit();\n //Lucene\\Analysis\\Analyzer\\Analyzer::setDefault(new Lucene\\Analysis\\Analyzer\\Common\\Utf8\\CaseInsensitive());\n // explode the search query to individual words\n $words = explode(' ', urldecode(Yii::$app->getRequest()->getQueryParam('q')));\n // start a search query and add a term for each word to it\n $query = new Lucene\\Search\\Query\\MultiTerm();\n foreach ($words as $w) {\n $query->addTerm(new Lucene\\Index\\Term($w));\n }\n\n // open and query the index\n $index = Lucene\\Lucene::open('data/posts_index');\n $results = $index->find($query); // the search results\n //var_dump($results);\n \n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'search' => $results,\n 'query' => $query\n ]);\n }" ]
[ "0.6726707", "0.6525201", "0.63989586", "0.6297661", "0.62954736", "0.62824494", "0.6255008", "0.6212479", "0.6207256", "0.61830723", "0.61449784", "0.6137208", "0.6074548", "0.60454625", "0.60261595", "0.60249025", "0.5994329", "0.596605", "0.59654284", "0.59421694", "0.59421694", "0.59421355", "0.59235096", "0.59228975", "0.5898667", "0.58847815", "0.58683366", "0.58560157", "0.5846589", "0.5838946", "0.5827249", "0.58100206", "0.58076024", "0.5796729", "0.57957333", "0.57884866", "0.57760143", "0.57513225", "0.5750776", "0.5737511", "0.5726608", "0.57179934", "0.57171774", "0.57167035", "0.571601", "0.57150716", "0.57150716", "0.5708661", "0.5698278", "0.56859547", "0.5682001", "0.56752867", "0.5666479", "0.5662729", "0.5656179", "0.5654337", "0.564853", "0.5640657", "0.5639735", "0.5637455", "0.5628723", "0.5618218", "0.5608734", "0.5607073", "0.5602225", "0.55949455", "0.5594933", "0.55919677", "0.55878764", "0.5579628", "0.556918", "0.5568639", "0.5566421", "0.5555751", "0.55491775", "0.55432886", "0.55398136", "0.553673", "0.553673", "0.55364984", "0.55331385", "0.55281824", "0.5527808", "0.5514667", "0.5511494", "0.55079573", "0.5502389", "0.54988766", "0.54985183", "0.54957634", "0.54936516", "0.54930204", "0.54921263", "0.54896075", "0.548708", "0.54819906", "0.54799056", "0.547645", "0.54749817", "0.5474867" ]
0.600728
16
=============== REPORT =================// Action report create report Access to the action is possible in the following paths: /admin/blog/report
public function reportAction() { parent::reportAction(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n\t{\n\t\t//\n\t\treturn View::make('dashboard.b.reports.create');\n\t}", "public function reportsAction()\n {\n $flashMessenger = $this->_helper->FlashMessenger;\n\n include_once(dirname(dirname(__FILE__)).\"/forms/CreateReport.php\");\n try{\n $form = new HistoryLog_Form_Reports();\n }catch(Exception $e) {\n\t$flashMessenger->addMessage(\"Error rendering log report form\",\"error\"); \n } //end try-catch\n\n //if valid form submitted\n if ($this->getRequest()->isPost()\n\t&& $form->isValid($this->getRequest()->getPost())) {\n\n try{\n\n\t//if we're downloading\n\tif($this->_is_download())\n\t {\n\t $this->getResponse()\n\t ->setHeader('Content-Disposition', 'attachment; filename=OmekaLog'.date('Y-m-d').\".csv\")\n\t ->setHeader('Content-type', 'application/x-pdf');\n\t $this->view->download=true;\n\t $this->view->report = HistoryLog_Form_Reports::ProcessPost('csv');\n\n\t //if we're displaying\n\t } else\n\t {\n\t $this->view->download=false;\n\t $this->view->report = HistoryLog_Form_Reports::ProcessPost();\n\t }\n\n }catch(Exception $e) {\n\t$flashMessenger->addMessage(\"Error processing form data. \".$e->getMessage(),\"error\"); \n } //end try-catch\n\n } //end if valid form was submitted\n \n $this->view->form = $form;\n }", "public function create()\n\t{\n\t\tif(Request::ajax())\n\t\t{\n\t\t\treturn $this->_ajax_denied();\n\t\t}\n\t\tif(!Report::canCreate())\n\t\t{\n\t\t\treturn $this->_access_denied();\n\t\t}\n\t\treturn View::make('reports.create');\n\t}", "public function reportAction()\n {\n /* Checking if user is signed in to be allowed to report answer */\n $this->requireSignin();\n\n /* Getting user's id */\n $user = Auth::getUser();\n \n /* Getting Answer by id */\n $this_answer = Answer::getById(intval($_POST['answer_id']));\n\n /* Checking if user is online and the answer is not already deleted */\n if ($user->id > 0 && $this_answer->active > 0) {\n\n /* Creating new Report's object */\n $report = new Report([\n 'from_user' => $user->id,\n 'answer_id' => $this_answer->id,\n 'message' => $_POST['report_message'],\n ]);\n\n /* Adding new report */\n if ($report->add()) {\n\n /* Show success message */\n Flash::addMessage(\"Done: Report sent!\", Flash::INFO);\n \n } else {\n \n /* Show error messages */\n Flash::addMessage(\"Error: \".implode(\", \", $report->errors), Flash::INFO);\n }\n\n } else {\n\n /* Show error messages */\n Flash::addMessage(\"Error: You can not report this answer.\", Flash::INFO);\n }\n\n /* Redirect to previous page */\n if (isset($_REQUEST[\"destination\"])) {\n\n header(\"Location: \".$_REQUEST['redirect_url']);\n\n } else if (isset($_SERVER[\"HTTP_REFERER\"])) {\n\n header(\"Location: \".$_SERVER[\"HTTP_REFERER\"]);\n \n } else {\n\n $this->redirect('/');\n }\n }", "public function create()\n {\n $report=Report::all();\n $reportdaily=ReportDaily::all();\n return view('reports.create',compact('report','reportdaily'));\n\n }", "public function create()\n {\n return view('admin.report.create');\n }", "public function actionReport()\n {\n $this->forcePostRequest();\n \n $json = array();\n $json['success'] = false;\n \n $form = new ReportReasonForm();\n \n if (isset($_POST['ReportReasonForm'])) {\n $_POST['ReportReasonForm'] = Yii::app()->input->stripClean($_POST['ReportReasonForm']);\n $form->attributes = $_POST['ReportReasonForm'];\n \n if ($form->validate() && ReportContent::canReportPost($form->object_id)) {\n \n $report = new ReportContent();\n $report->created_by = Yii::app()->user->id;\n $report->reason = $form->reason;\n $report->object_model = 'Post';\n $report->object_id = $form->object_id;\n $report->save();\n \n $json['success'] = true;\n }\n }\n \n echo CJSON::encode($json);\n Yii::app()->end();\n }", "public function actionCreate()\n {\n $model = new ReportTrackingHistory();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->tbs_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionReportuser(){\n $type = htmlentities($_GET['type']);\n $page = preg_replace('/[^-a-zA-Z0-9_]/', '', $type);\n $id = (int) $_GET['id'];\n $reason = htmlentities($_GET['reason']);\n if($type == 'others' && $reason != ''){\n $type = $reason;\n }\n $report = new FlagReports;\n $report->reported_by = \\Yii::$app->user->getId();\n $report->user_id = $id;\n $report->report = $type;\n $report->datetimestamp = date('Y-m-d H:i:s', time());\n if($report->save()){\n echo \"true\";\n }else{\n echo \"false\";\n }\n }", "public function actionCreate($id)\n {\n $model = new Reporte();\n $model->reportador_id = Yii::$app->user->id;\n $model->reportado_id = Publicacion::findOne($id)->usuario->id;\n $model->publicacion_id = $id;\n\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function createAction()\n {\n if (!$this->request->isPost()) {\n $this->dispatcher->forward(array(\n 'controller' => \"export_yy_logs\",\n 'action' => 'index'\n ));\n\n return;\n }\n\n $export_yy_log = new ExportYyLogs();\n\n $post_flds = [];\n $post_flds = [\"cd\",\n \"name\",\n \"time_from\",\n \"time_to\",\n \"updated\",\n ];\n \n\n $thisPost=[]; // カンマ編集を消すとか日付編集0000-00-00を入れるとか$thisPost[]で行う\n foreach ($post_flds as $post_fld) {\n $export_yy_log->$post_fld = array_key_exists($post_fld, $thisPost)?$thisPost[$post_fld]:$this->request->getPost($post_fld);\n }\n\n if (!$export_yy_log->save()) {\n foreach ($export_yy_log->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward(array(\n 'controller' => \"export_yy_logs\",\n 'action' => 'new'\n ));\n\n return;\n }\n\n $this->flash->success(\"移出記録の作成が完了しました。\");\n\n $this->dispatcher->forward(array(\n 'controller' => \"export_yy_logs\",\n 'action' => 'edit',\n 'params' => array($export_yy_log->id)\n ));\n }", "public function makeReport()\n {\n }", "public function actionCreate()\n {\n //if(Yii::$app->user->identity->role == 4) {\n $model = new Reports();\n $post = Yii::$app->request->post();\n\n $user_id = Yii::$app->user->id;\n\n // страница 1 или 2 заказ или остатки\n if( ! $page = (int)Yii::$app->request->get('report-page') ){\n if(isset($post['report-page'])) $page = (int)$post['report-page'];\n }\n if((int)$page==0) $page=1;\n\n $_order = [];\n $ostat_med = 0;\n $ostat_sup = 0;\n // остатки на начало периода\n if( $report_ostat = ReportsTable1::find()->orderBy('id DESC')->limit(2)->all() ){\n foreach($report_ostat as $ost) {\n if($ost->material_id==1) {\n $ostat_med = $ost->end;\n }elseif($ost->material_id==2) {\n $ostat_sup = $ost->end;\n }\n }\n }\n\n\n $pacients= [];\n if ($model->load($post)) {\n\n // echo '<pre>'; print_r($post);exit;\n\n if( !$model->save() ){\n echo 'error save report. ';\n print_r($model->getErrors());\n }\n\n\n $model->report_type = $page;\n $model->date = date('Y-m-d',strtotime($post['Reports']['date'])) ;\n\n $model->doctor_id = $user_id; // пользователь создавший отчет, может быть и админ\n\n if($page==1) {\n if(isset($post['pacients'])) {\n \n foreach ($post['pacients'] as $i => $pac) {\n if ($pac == -1) unset($post['pacients'][$i]); // удалить если выбрано Укажите пациента\n }\n \n // копия всех пациентов в отчете\n $model->pacients = json_encode($post['pacients']);\n\n // копия всех № заказов в отчете\n $model->order_num = json_encode($post['orders']);\n\n\n\n $pid = 0;\n // запись всех пациентов для отчета \n foreach($post['pacients'] as $_pacient_id){\n $pac_rep = new ReportsPacients() ;\n $pac_rep->report_id = $model->id;\n $pac_rep->pacient_id = $_pacient_id;\n $pac_rep->order_id = $post['orders'][$pid]; // dec 2016\n $pac_rep->save();\n $pid++;\n }\n /*echo '<pre>';\n print_r($post);\n exit;*/\n }\n\n // с проверкой на оплату\n $pacients_ids = Assign::getPacientsByDoctorId( Yii::$app->user->id); // пациенты только для текущего техника\n\n $_paid = ['date'=>'0','sum'=>'0'];\n foreach($pacients_ids as $k => $pid) {\n // последняя подтв. дата оплаты\n $paid = Payments::getLastPaid( $pid );// $model->pacient->id); // массив дата-date и сумма - sum\n if($paid['date']=='0') {\n unset($pacients_ids[$k]); // удалить пациента из списка, т.к. не подтв. оплата\n //}elseif( $model->pacient->id==$id){ // при создании не нужно проверять объекта еще нет\n // $_paid = $paid; // данные текущего пациента (дата и сумма)\n }\n }\n\n // имена пациентов\n $pacients = ArrayHelper::map(Pacients::find()->where(['id'=>$pacients_ids])->all(), 'id', function ($model, $defaultValue) {\n return $model->name;\n });\n\n // только свои заказы !!!\n $order_ids = $post['orders'];\n\n // if( $orders = \\backend\\models\\Orders::find()->where(['pacient_code'=>$pacients_ids,'creater'=>$user_id,'status'=>'0'])->orderBy('pacient_code')->all() ) {\n if( $orders = \\backend\\models\\Orders::find()->where(['num'=>$order_ids,'creater'=>$user_id,'status'=>'0'])->orderBy('pacient_code')->all() ) {\n $_order = $this->getOrderData($orders);\n }\n\n }\n $post = Yii::$app->request->post();\n $model->date = date('Y-m-d',strtotime($post['Reports']['date'])) ;\n if($model->save()){\n\n $id = $model->id;\n if(isset($post['Materials']['table1'])) {\n foreach ($post['Materials']['table1']['material_id'] as $key => $table1) {\n $table1 = new ReportsTable1();\n $table1->report_id = $model->id;\n // $table1->pacient_id = $post['Materials']['table1']['pacient_id'][$key];\n $table1->material_id = $post['Materials']['table1']['material_id'][$key];\n $table1->total = $post['Materials']['table1']['total'][$key];\n $table1->model = $post['Materials']['table1']['model'][$key];\n $table1->norm = $post['Materials']['table1']['norm'][$key];\n $table1->begin = $post['Materials']['table1']['begin'][$key];\n $table1->end = $post['Materials']['table1']['end'][$key];\n $table1->dop = $post['Materials']['table1']['dop'][$key];\n if (!$table1->save()) print_r($table1->errors);\n }\n }\n if(isset($post['Materials']['table2'])) {\n // удалить из таблицы 2 данные текущего отчета и записать новые\n ReportsTable2::deleteAll(['report_id' => $id]);\n $row = 0;\n foreach ($post['Materials']['table2'] as $_table) { // по строкам\n $row++;\n $k = 0;\n foreach ($_table as $key => $value) { // по материалам 0-9 0-пациент 1-9-материалы\n $k++;\n if ( $k > 10 ||($k == 1 && (int)$value == 0) ) break; // пропуск пустого ряда, если не задан id пациент\n if ($k == 1) $pacient_id = $value; // id пациента\n\n $table2 = new ReportsTable2();\n $table2->report_id = $id;\n $table2->material_id = (int)$key; // material_id = 0 - пациенты\n $table2->value = $value; // value[0] - id пациента\n $table2->pacient_id = $pacient_id;\n $table2->row_id = $row;\n\n if (!$table2->save()) {\n print_r($table2->getErrors());\n }\n }\n }\n }\n\n //if(isset($post['Materials']['table3'])) {\n if($page==2){\n $table3 = new ReportsTable3();\n $table3->report_id = $id;\n $table3->data = json_encode($post['Table']);\n $table3->save();\n }\n }\n return $this->redirect(['update', 'id' => $model->id,'report-page'=>$page]);\n } else {\n $model->report_type = $page;\n $model->date = date('Y-m-d', time());\n $doctors = User::getDoctors();\n //$pacients = Pacients::getList();\n $materials = Materials::find()->all();\n // $reporstsMaterials = ReportsMaterials::find()->all();\n\n // с проверкой на оплату\n $pacients_ids = Assign::getPacientsByDoctorId( Yii::$app->user->id); // пациенты только для текущего техника\n\n $_paid = ['date'=>'0','sum'=>'0'];\n foreach($pacients_ids as $k => $pid) {\n // последняя подтв. дата оплаты\n $paid = Payments::getLastPaid( $pid );// $model->pacient->id); // массив дата-date и сумма - sum\n if($paid['date']=='0') {\n unset($pacients_ids[$k]); // удалить пациента из списка, т.к. не подтв. оплата\n //}elseif( $model->pacient->id==$id){ // при создании не нужно проверять объекта еще нет\n // $_paid = $paid; // данные текущего пациента (дата и сумма)\n }\n }\n\n // 23.11 получить всех пациентов у которых есть заказы - order\n if( $order_pacients = Orders::find()->select('pacient_code')->where(['pacient_code'=>$pacients_ids])->all() ){\n $pacients_ids = []; // очистка для добавления только тех, у которых есть заказ\n foreach($order_pacients as $order_pacient){\n $pacients_ids[] = $order_pacient->pacient_code;\n }\n\n }\n\n // имена пациентов\n $pacients = ArrayHelper::map(Pacients::find()->where(['id'=>$pacients_ids])->all(), 'id', function ($model, $defaultValue) {\n return $model->name;\n });\n\n /* if(isset($model->pacients)){\n $pacients_selected = json_decode($model->pacients);\n }else{*/\n $pacients_selected = [0];\n\n // }\n\n\n return $this->render('create', [\n 'model' => $model,\n 'pacients' => $pacients,\n 'pacients_selected' => $pacients_selected,\n 'doctors' => $doctors,\n 'materials' => $materials,\n // 'reporstsMaterials' => $reporstsMaterials,\n 'page' => $page,\n 'order' => $_order,\n 'ostat' => ['med'=>$ostat_med,'sup'=>$ostat_sup],\n ]);\n }\n // }\n }", "function generateSubmissionsReport($args) {\r\n\t\tparent::validate();\r\n\t\t$this->setupTemplate();\r\n\t\r\n\t\t$journal =& Request::getJournal();\r\n\t\t$journalId = $journal->getId();\r\n\t\t\r\n\t\t//Get user filter decision\r\n $submissionsAndCriterias = $this->_getFilteredSubmissions($journalId);\r\n $submissions = $submissionsAndCriterias[0];\r\n $criterias = $submissionsAndCriterias[1];\r\n \r\n $reportType = Request::getUserVar('reportType');\r\n \r\n switch($reportType){\r\n case 0:\r\n $this->_CSVReport($submissions, $criterias);\r\n break;\r\n case 1:\r\n $this->_simpleChart($submissions, $criterias, $reportType);\r\n break; \r\n case 2:\r\n $this->_simpleChart($submissions, $criterias, $reportType);\r\n break; \r\n default :\r\n break;\r\n }\r\n\t}", "public function create()\n {\n return redirect('/report/step-1');\n }", "public function report() {\n $data = [];\n if ($this->input->post('submit')) {\n $report_data['from_date'] = $this->input->post('form_from_date');\n $report_data['to_date'] = $this->input->post('form_to_date');\n if ($this->input->post('form_summarized')) {\n $data['summarized_report'] = $this->account_model->getSummarizedReport($report_data);\n } else {\n $data['report'] = $this->account_model->getReport($report_data);\n }\n } else {\n if ($this->session->has_userdata('financialyear')) {\n $data['financialyear'] = $this->session->userdata('financialyear');\n }\n }\n $this->view('report', $data);\n }", "public function abuseReportAction()\n {\n \t$params=$this->getRequest()->getParams();\n \t$current_user_id = Auth_UserAdapter::getIdentity()->getId();\n \t$wallpost_owner_info = \\Extended\\ilook_user::getRowObject($params[\"wallpost_owner_id\"]);\n \t$wallpost_owner_fullname = $wallpost_owner_info->getFirstname().\" \".$wallpost_owner_info->getLastname();\n \t\\Extended\\report_abuse::addAbuseReport($current_user_id,$params[\"post_id\"],$params[\"wallpost_owner_id\"]);\n \t$wallInfo=Extended\\wall_post::getRowObject($params[\"post_id\"]);\n \t\n \n \t$userName = Auth_UserAdapter::getIdentity()->getFirstname().\" \".Auth_UserAdapter::getIdentity()->getLastname();\n \t$msg='';\n \t$msg = \"<p style='padding:0; font-size:14px; font-family:Arial, Helvetica, sans-serif; color:#3a3a3a'>\n \t\t\t\tA wall post has been reported abuse.\n \t\t\t</p>\n\t \t\t<p style='padding:0; font-size:14px; font-family:Arial, Helvetica, sans-serif; color:#3a3a3a'>\n\t \t\t\t\".$wallpost_owner_fullname.\"'s wall post has been reported abuse by \".$userName.\"\n\t \t\t</p>\";\n \t\t\t\n \t$subject=\"iLook - A wall post has been reported abuse\";\n \t$result=Email_Mailer::sendMail ( $subject, $msg, \"Admin\", '[email protected]', array(), \"iLook Team\",\"\",\"Hello \",\"Best Regards\");\n \tif($result){\n \t\t$msg=array(\"msg\"=>\"success\");\n \t}\n \techo Zend_Json::encode($msg); \n \tdie;\n }", "function reports($args){\n $this->view->add('page_title','Reports');\n \n\t\t//Set tool box\n\t\tif( $args['tool'] == null ){\n $tool = 'display';\n } else {\n $tool = $args['tool'];\n }\n\t\t if( $func = $this->reports_toolbox($tool,$this) ) {\n \n // check for success, default to no\n $success = false;\n \n // choose tool and execute\n $success = $func($this);\n }\n \n // add self link\n $this->view->add('self_link',\n $this->app->form_path('admin/reports')\n );\n\t}", "public function create()\n {\n return view('reports.create');\n }", "public function reportComment() {\n $commentId = $this->request->getParameter(\"comId\");\n $postId = $this->request->getParameter(\"postId\");\n $this->comment->report($commentId);\n $this->redirect('Post','index/'.$postId);\n }", "public function create()\n\t{\n\t\treturn view('audit.create');\n\t}", "public function created(Reports $report)\n {\n switch ($report->property_type) {\n case 'chat_post':\n $post = ChatPost::where('id', $report->property_id)->first();\n $post->report_count += 1;\n $post->save();\n $room = ChatRoom::where('id', $post->chat_room_id)->first();\n $room->report_count += 1;\n $room->save();\n break;\n case 'chat_attachment':\n $attachment = ChatAttachment::where('id', $report->property_id)->first();\n $attachment->report_count += 1;\n $attachment->save();\n $room = ChatRoom::where('id', $attachment->chat_room_id)->first();\n $room->report_count += 1;\n $room->save();\n break;\n default:\n break;\n }\n\n }", "public function Maintenance_add_report() {\n\t\t$data['content'] = 'Maintenance_add_report';\n\t\t$this->load->view('base_view_maintenance', $data);\n\t\t$this->load->view('Maintenance_add_report', $data);\n\t\t/*Check submit button */\n\t\tif($this->input->post('submit'))\n \t\t{\n\t\t\n\t\t$date_req=$this->input->post('date_req');\n\t\t$description=$this->input->post('description');\n\t\t$parts_rep=$this->input->post('parts_rep');\n\t\t$date_rep=$this->input->post('date_rep');\n\t\t$time_rep=$this->input->post('time_rep');\n\t\t$date_fin=$this->input->post('date_fin');\n\t\t$remark=$this->input->post('remark');\n\t\t$performed_by=$this->input->post('performed_by');\n\n\t\t$this->Login_auth_db->add_report($date_req,$description,$parts_rep,$date_rep,$time_rep,$date_fin,$remark,$performed_by);\t\n\t\techo \"Records Saved Successfully\";\n\t\t}\n\t\n}", "abstract public function buildReport();", "public function report($id)\n {\n //$user = Auth::user(); //works but method is underlined as an error\n\n //* save record in reports table\n $post = Post::find($id);\n if (Auth::user() !== null) {\n $user = User::find(Auth::user()->id);\n $user->postsReports()->save($post);\n }\n\n //* if post has 3 reports then soft delete for admin to check out\n if (count($post->usersReports) >= 3) {\n $this->softDestroy($id);\n return redirect(\"/post/reported\");\n } else {\n return redirect(\"/posts/$post->id\");\n }\n }", "public function processReports();", "public function actionCreate()\n {\n $model = new BugReport();\n $uploadForm = new UploadForm();\n $model->reporter_id = Yii::$app->user->id;\n $model->status = '1';\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', 'Yeah! It is! Bug №' . $model->bug_id . ' was added successfully!');\n return $this->redirect(['bug-report/index', 'id' => $model->project_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'uploadForm' => $uploadForm,\n ]);\n }", "public function create($id)\n {\n DB::table('history_log')->insert(\n array('user'=>Auth::user()->name,'history_type'=>'inserted','path'=>url()->current())\n );\n $reporting = ErpProjectReporting::where('project_id', '=', $id)->get();\n $maxAmendmentReporting = 0;\n foreach ($reporting as $report) {\n\n if ($report->amendment > $maxAmendmentReporting) {\n $maxAmendmentReporting = $report->amendment;\n }\n }\n $project = ErpProject::find($id);\n return view('backEnd.project_reporting.create', compact('project','maxAmendmentReporting'));\n }", "public function actionCreate()\n\t{\n\t $model=new ReportFinancial;\n\t\n\t // Uncomment the following line if AJAX validation is needed\n\t // $this->performAjaxValidation($model);\n\t \n// \t $store = array(91, 104, 105, 106, 112, 115, 120, 121, 122, 124, 147);\n// \t for($i=2; $i <300; $i++){\n// \t $model=new ReportFinancial;\n// \t $model->store_id = $store[array_rand($store)];\n// \t $model->order_id = $i;\n// \t $model->value = rand(100, 10000);\n// \t $model->charge = rand(100, 10000);\n// \t $model->date = date('Y-m-d',rand(time() - 12*30*24*60*60, time()));\n// \t $model->status = rand(0, 1);\n// \t $model->save();\n// \t }\n\t\n\t if(isset($_POST['ReportFinancial']))\n\t {\n\t $model->attributes=$_POST['ReportFinancial'];\n\t if($model->save())\n\t $this->redirect(array('index'));\n\t }\n\t\n\t $this->render('create',array(\n\t 'model'=>$model,\n\t ));\n\t}", "public function indexAction ()\n\t{\n\t\t// TODO Auto-generated ReportController::indexAction() default action\n\t}", "public function crearReporte() {\r\n $datos = $this->factura->listarFacturas($this->input->post(\"fecha\"));\r\n $this->load->view(\"reporte\", $datos);\r\n }", "function owa_newBlogActionTracker($blog_id, $user_id, $domain, $path, $site_id) {\r\n\r\n\t$owa = owa_getInstance();\r\n\t$owa->trackAction('wordpress', 'Blog Created', $domain);\r\n}", "public function actionCreate() {\n if (User::userIsAllowedTo('Submit back to office report')) {\n $model = new MeBackToOfficeReport();\n if (Yii::$app->request->isAjax) {\n $model->load(Yii::$app->request->post());\n return Json::encode(\\yii\\widgets\\ActiveForm::validate($model));\n }\n\n if (!empty(Yii::$app->request->post()) && Yii::$app->request->post('submit_for_review') == 'true') {\n //var_dump(Yii::$app->request->post());\n $model->load(Yii::$app->request->post());\n $model->team_members = implode(\", \", $model->team_members);\n list( $model->start_date, $model->end_date) = explode('to', $model->travel_dates);\n $model->created_by = Yii::$app->user->id;\n $model->updated_by = Yii::$app->user->id;\n $model->status = \\backend\\models\\Storyofchange::_submitted_for_review;\n if ($model->save()) {\n $audit = new AuditTrail();\n $audit->user = Yii::$app->user->id;\n $audit->action = \"Submitted a back to office report for review\";\n $audit->ip_address = Yii::$app->request->getUserIP();\n $audit->user_agent = Yii::$app->request->getUserAgent();\n $audit->save();\n $role_model = \\common\\models\\RightAllocation::find()->where(['right' => 'Review back to office report'])->all();\n if (!empty($role_model)) {\n $subject = \"Back to office report:\" . $model->name_of_officer;\n foreach ($role_model as $_role) {\n //We now get all users with the fetched role\n $resetLink = Yii::$app->urlManager->createAbsoluteUrl(['site/login']);\n $_user_model = User::find()\n ->where(['role' => $_role->role])\n ->all();\n if (!empty($_user_model)) {\n //We send the emails\n foreach ($_user_model as $_model) {\n $msg = \"\";\n $msg .= \"<p>Dear \" . $_model->first_name . \" \" . $_model->other_name . \" \" . $_model->last_name . \",<br/>\";\n $msg .= $model->name_of_officer . \" has submitted a 'Back to office report' below is the summary of the assignment outcome<br/>\";\n $msg .= $model->summary_of_assignment_outcomes . \"</b></p>\";\n $msg .= '<p>You can login <i style=\"color: blue;\">' . Html::a('(Click Here to Login)', $resetLink) . '</i> to see more details and review the submitted BtOR</p>';\n \\backend\\models\\Storyofchange::sendEmail($msg, $subject, $_model->email);\n }\n }\n }\n }\n\n Yii::$app->session->setFlash('success', 'Back to office report was successfully submitted for review');\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $message = \"\";\n foreach ($model->getErrors() as $error) {\n $message .= $error[0];\n }\n Yii::$app->session->setFlash('error', 'Error occured while submitting back to office report for review.Error::' . $message);\n }\n }\n\n\n if (!empty(Yii::$app->request->post()) && Yii::$app->request->post('submit for review') != 'true') {\n $model->load(Yii::$app->request->post());\n $model->team_members = implode(\", \", $model->team_members);\n list( $model->start_date, $model->end_date) = explode('to', $model->travel_dates);\n $model->created_by = Yii::$app->user->id;\n $model->updated_by = Yii::$app->user->id;\n $model->status = 0;\n if ($model->save()) {\n $audit = new AuditTrail();\n $audit->user = Yii::$app->user->id;\n $audit->action = \"Saved back to office report as draft\";\n $audit->ip_address = Yii::$app->request->getUserIP();\n $audit->user_agent = Yii::$app->request->getUserAgent();\n $audit->save();\n Yii::$app->session->setFlash('success', 'Back to office report was successfully saved as a draft');\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $message = \"\";\n foreach ($model->getErrors() as $error) {\n $message .= $error[0];\n }\n Yii::$app->session->setFlash('error', 'Error occured while saving back to office report.Error::' . $message);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n } else {\n Yii::$app->session->setFlash('error', 'You are not authorised to perform that action.');\n return $this->redirect(['home/home']);\n }\n }", "public function create()\n\t{\n\t\treturn view('backend.blog.create');\n\t}", "public function create(Request $request)\n\t{\n\t\t$message = $request->input('message');\n $report_type_id = $request->input('report_type_id');\n\n if(!$message || !$report_type_id)\n\t\t\treturn $this->prepareResponse('BAD_REQUEST');\n\n $report_type = ReportType::find($report_type_id);\n\t\t$report = Report::create(['message' => $message, 'report_type_id' => $report_type->id, 'user_id' => $this->current_user->id]);\n\n Mandrill::send_email('admin', 'report.new',\n [ 'build_from_oss_config' => true,\n 'report'=> $report,\n 'user' => $this->current_user,\n 'report_type' => $report_type]);\n\n\t\treturn $this->prepareResponse('report.CREATED');\n\n\t}", "public function store()\n\t{\n\t\t$data = Input::all();\n\t\tReport::setRules('store');\n\t\tif(!Report::canCreate())\n\t\t{\n\t\t\treturn $this->_access_denied();\n\t\t}\n\t\t$report = new Report;\n\t\t$report->fill($data);\n\t\tif(!$report->save())\n\t\t{\n\t\t\treturn $this->_validation_error($report);\n\t\t}\n\t\tif(Request::ajax())\n\t\t{\n\t\t\treturn Response::json($report, 201);\n\t\t}\n\t\treturn Redirect::action('ReportsController@index')\n ->with('notification:success', $this->created_message);\n }", "public function actionCreate()\n {\n $model = new QuestionReported();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function adCreativereport()\n\t{\n\n\n\n\t\t$query=\"https://graph.facebook.com/v3.2/\".$this->ad_acc_id.\"/campaigns?fields=ads{adcreatives{id,name,thumbnail_url},insights.level(ad).metrics(ctr){cost_per_unique_click,spend,impressions,frequency,reach,unique_clicks,clicks,ctr,ad_name,adset_name,cpc,cpm,cpp,campaign_name,ad_id,adset_id,account_id,account_name}}&access_token=\".$this->user_access_token.\"\";\n\n\n\t\t\t// Call to Graph api here\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch,CURLOPT_URL,$query);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_POST, 0);\n\n\n\t\t$resp = curl_exec($ch);\n\t\t$resp = json_decode($resp);\n\t\tcurl_close($ch);\n\t\tif(isset($resp->error->error_user_msg))\n\t\t\tSession::flash('message',$resp->error->error_user_msg);\n\t\telseif(isset($resp->error->message))\n\t\t\tSession::flash('message',$resp->error->message);\n\n\n\t\treturn view('social.adcreative-reports',['resp'=>$resp]);\n\t}", "public function accounts_report() {\n\n theme('accounts_report');\n }", "public function reportAbuseAction()\n {\n $params=$this->getRequest()->getParams();\n $wallInfo=Extended\\wall_post::getRowObject($params[\"wall_id\"]);\n $imageName=$wallInfo->getWall_postsSocialise_photo()->getImage_name();\n $albumName=$wallInfo->getWall_postsSocialise_photo()->getSocialise_photosSocialise_album()->getAlbum_name();\n $albumTme=$wallInfo->getWall_postsSocialise_photo()->getSocialise_photosSocialise_album()->getCreated_at_timestamp()->getTimeStamp();\n $imagePath=IMAGE_PATH.\"/albums/user_\".$wallInfo->getWall_postsFrom_user()->getId().\"/album_\".$albumName.\"/wall_thumbnails/thumbnail_\".$imageName;\n $userId = Auth_UserAdapter::getIdentity()->getId();\n $userName = Auth_UserAdapter::getIdentity()->getFirstname().\" \".Auth_UserAdapter::getIdentity()->getLastname();\n $msg='';\n $msg=$msg.'<div style=\"width:100%;\">';\n $msg=$msg.'<label style=\"font-weight:bold;\">Dear Admin</label>';\n $msg=$msg.'<p style=\"margin-left:10px;\">A wall post has been report abused</p>';\n $msg=$msg.'<table border=\"1\" style=\"margin-left:10px;\">';\n $msg=$msg.'<tr><td>Report abused by name</td><td>'.$userName.'</td></tr>';\n $msg=$msg.'<tr><td>Report abused by id</td><td>'.$userId.'</td></tr>';\n $msg=$msg.'<tr><td>Wall post type</td><td>Photo</td></tr>';\n $msg=$msg.'<tr><td>Wal post PhotoPath</td><td>'.$imagePath.'</td></tr>';\n $msg=$msg.'<tr><td>Wall post id</td><td>'.$params[\"wall_id\"].'</td></tr>';\n $msg=$msg.'</table>';\n $msg=$msg.'</div>';\n $adminEmail=\\Extended\\ilook_user::getRowObject(ADMIN_ID)->getEmail();\n $subject=\"Socialise wall post reported abuse\";\n $result=Email_Mailer::sendMail ( $subject, $msg, \"Admin\", $adminEmail, array(), \"iLook Team\",\"\",\"Hello \",\"Best Regards\");\n if($result):\n // for success\n Zend_Json::encode(1);\n else:\n // for failure\n Zend_Json::encode(0);\n endif;\n die;\n }", "function cannedReports(){\n\t\t\n\tif(!empty($this->params['form']))\n\t\t{\n\t\t\tif($_POST['cannedReports']=='allData'){\n\t\t\t\t$this->redirect('alldatareport');\n\t\t\t\t//$this->set('surveyexports',$this->Surveyexport->find('all'));\n\t\t\t\t\n\t\t\t\t//echo \" running your fancy report\";\n\t\t\t}\n\t\t\tif($_POST['cannedReports']=='recordCount')\n\t\t\t{\n\t\t\t\t\t$this->redirect('countsreport'); // record count page\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\tif($_POST['cannedReports']=='referralReport')\n\t\t\t{\n\t\t\t\t\t$this->redirect('referralreport'); // record count page\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//else\n\t\t\t //{\n\t\t\t\t//echo \" select a report to run!\";\n\t\t\t\t//echo \"<br/>what was passed \".$this->params['form'].\"</br>\";\n\t\t\t\t//echo\" <br/>post array \".$_POST['cannedReports'] ;\n\t\t\t\t//echo\"</br></br>\";\n\t\t\t\t\n\t\t\t//}\n\t\t\t\t\n\t\t\t\t\n\t\t}\n\t\t\n\t}", "function insert()\n\t{\n\t\t//@TODO email advisor and student(?)\n\t\t$kReport = $this->report->insert();\n\t\tif($this->input->post(\"email_advisor\")){\n\t\t\t$this->notify($kReport);\n\t\t}\n\t\tredirect(\"report/view/$kReport\");\n\t}", "function cannedReports(){\n\t\t\n\tif(!empty($this->params['form']))\n\t\t{\n\t\t\tif($_POST['cannedReports']=='allData'){\n\t\t\t\t$this->redirect('alldatareport');\n\t\t\t\t//$this->set('surveyexports',$this->Surveyexport->find('all'));\n\t\t\t\t\n\t\t\t\t//echo \" running your fancy report\";\n\t\t\t}\n\t\t\tif($_POST['cannedReports']=='recordCount')\n\t\t\t{\n\t\t\t\t\t$this->redirect('countsreport'); // record count page\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t//else\n\t\t\t //{\n\t\t\t\t//echo \" select a report to run!\";\n\t\t\t\t//echo \"<br/>what was passed \".$this->params['form'].\"</br>\";\n\t\t\t\t//echo\" <br/>post array \".$_POST['cannedReports'] ;\n\t\t\t\t//echo\"</br></br>\";\n\t\t\t\t\n\t\t\t//}\n\t\t\t\t\n\t\t\t\t\n\t\t}\n\t\t\n\t}", "public function actionCollectorReport() {\n /*Get result using model method*/\n $result = [\n ['a', 'b', 'c',],\n [1, 2, 3,],\n ];\n\n $fileName = 'debtorList' . date('Y-m-d');\n $this->createCSV($result, $fileName);\n\n //$subscribers = Subscriber::getSubscribers('collector');\n //$this->actionSendReport($fileName, $subscribers);\n\n }", "public function add()\n\t{\n\t\t// Add a Sub-Nav Link\n\t\tEvent::add('ushahidi_action.nav_admin_reports', array($this, '_report_link'));\n\t\t// Only add the events if we are on that controller\n\t\tif (Router::$controller == 'reports')\n\t\t{\n\t\t\tswitch (Router::$method)\n\t\t\t{\n\t\t\t\t// Hook into the Report Add/Edit Form in Admin\n\t\t\t\tcase 'edit':\n\t\t\t\t\t// Hook into the form itself\n\t\t\t\t\tEvent::add('ushahidi_action.report_form_admin', array($this, '_report_form'));\n\t\t\t\t\t// Hook into the report_submit_admin (post_POST) event right before saving\n\t\t\t\t\t// Event::add('ushahidi_action.report_submit_admin', array($this, '_report_validate'));\n\t\t\t\t\t// Hook into the report_edit (post_SAVE) event\n\t\t\t\t\tEvent::add('ushahidi_action.report_edit', array($this, '_report_form_submit'));\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Hook into the Report view (front end)\n\t\t\t\tcase 'view':\n\t\t\t\t\tplugin::add_stylesheet('actionable/css/actionable');\n\t\t\t\t\tEvent::add('ushahidi_action.report_meta', array($this, '_report_view'));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'index':\n\t\t\t\t\tplugin::add_stylesheet('actionable/css/actionable');\n\t\t\t\t\tEvent::add('ushahidi_action.report_filters_ui', array($this, '_report_filters_ui'));\n\t\t\t\t\tEvent::add('ushahidi_action.report_js_filterReportsAction', array($this, '_report_js_filterReportsAction'));\n\t\t\t\t\tEvent::add('ushahidi_action.report_js_filterReportsActionRemove', array($this, '_report_js_filterReportsActionRemove'));\n\t\t\t\t\tEvent::add('ushahidi_action.report_js_keyToFilter', array($this, '_report_js_keyToFilter'));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'fetch_reports':\n\t\t\t\t\tEvent::add('ushahidi_filter.fetch_incidents_set_params', array($this, '_fetch_incidents_set_params'));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\telseif (Router::$controller == 'feed')\n\t\t{\n\t\t\t// Add Actionable Tag to RSS Feed\n\t\t\tEvent::add('ushahidi_action.feed_rss_item', array($this, '_feed_rss'));\n\t\t}\n\t\telseif (Router::$controller == 'reports')\n\t\t{\n\t\t\tEvent::add('ushahidi_action.map_main_filters', array($this, '_map_main_filters'));\n\t\t}\n\t\telseif (Router::$controller == 'main')\n\t\t{\n\t\t\tEvent::add('ushahidi_action.map_main_filters', array($this, '_map_main_filters'));\n\t\t}\n\t\telseif (Router::$controller == 'json' OR Router::$controller == 'bigmap_json')\n\t\t{\n\t\t\tEvent::add('ushahidi_filter.fetch_incidents_set_params', array($this, '_fetch_incidents_set_params'));\n\t\t\tEvent::add('ushahidi_filter.json_index_features', array($this, '_json_index_features'));\n\n\t\t\t// Never cluster actionable json\n\t\t\tif (Router::$method == 'cluster' AND $this->_check_media_type())\n\t\t\t{\n\t\t\t\tRouter::$method = 'index';\n\t\t\t}\n\t\t}\n\t}", "public function create()\n {\n return view('admin_panel.blog.create');\n }", "public function create()\n {\n\n if(!empty($this->data)){\n\n if($this->Blog->save($this->data)){\n $this->Session->setFlash(__('Your blog has been created'), 'success');\n $this->redirect(\"/blogs/edit/{$this->Blog->id}\");\n }else{\n $this->Session->setFlash(__('There was a problem creating your blog'), 'error');\n }\n }\n\n $this->set('syntaxes', $this->Blog->listSyntaxTypes());\n $this->set('postAccesses', $this->Blog->listPostAccess());\n $this->set('title_for_layout', 'Create a Blog');\n\n\n }", "public function ReportComment(){ \r\n $this->comment();\r\n $this->reportPost();\r\n $this->_commentManager->getReportComment($this->_reportPostSecure,\"1\");\r\n header('location: '.$_GET[\"url\"].'&id='.$_GET[\"id\"]);\r\n }", "public function addReport(Request $request){\n $userLogin = Auth::guard(\"accounts\")->user();\n if ($userLogin==null || !$userLogin->can('addReport', Report::class)){\n return (Route('mylogincontroller.login'));\n }\n try {\n $report = new Report();\n $report->noiDung = $request['noiDung'];\n $report->loaiReport = $request['loaiReport'];\n $report->isProcessed = 0;\n $report->idAcc = $request['accID'];\n\n $idCmt = $request['idCMT'];\n $idRepCmt = $request['idRepCMT'];\n $idBtl = $request['idBTL'];\n\n if ($idCmt != -1)\n $report->idCmt = $request['idCMT'];\n else if ($idRepCmt != -1)\n $report->idRepCmt = $request['idRepCMT'];\n else\n $report->idBtl = $request['idBTL'];\n $report->save();\n return \"true\";\n }catch (\\Exception $e){\n\n }\n return \"false\";\n // Report::create(['id'=>null],['noiDung'=>$noiDung],['loaiReport'=>$loaiReport],['isProcessed'=>0],['idAcc'=>$idAcc],['idBtl'=>$idBTL],['idCmt'=>$idCMT],['idRepCmt'=>$idRepCMT]);\n }", "public function thirdReport()\n {\n return view('reported-post');\n }", "public function actionCreate()\n {\n $model = new AfterSaleStatistics();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('product_backlogs.create')\n ->with('action', 'Create');\n }", "public function create()\n {\n //\n return view('adminblog.create');\n }", "public function AddNew_Report(User $user)\n {\n }", "public function create()\n {\n //\n return view(\"Reports/monthlySales\");\n }", "public function create()\n {\n return view('frontend.customer.blog_create');\n }", "public function reportPost(Request $request){\n $report = new ReportPostTopicModel();\n $report->user_id = Auth::user()->id;\n $report->content = $request->reason;\n $report->post_id = $request->post_id;\n $report->save();\n return Response()->json(array('ok'=>$request->all()));\n }", "function action() {\n\t\t// to use. In this case, that's below.\n\t\t$this->setSubview('example.reportDashboard');\n\t\t$this->setTitle('Dashboard');\n\t\t\n\t\t// the getParam method is used to get things from the $_GET and $POST objects\n\t\t// note that, if you ask for currentUser, it will look for owa_currentUser\n\t\t// Existing OWA code mainly uses the $_GET variable more than $_POST\n\t\t// by default, you will have the following parameters in any new module you create:\n\t\t// siteId, period (e.g.: last_seven_days), startDate, endDate, action (your reportName)\n\t\t$currentUser = $this->getParam('currentUser');\n\t\t$startDate = $this->getParam('startDate');\n\t\t$endDate = $this->getParam('endDate');\n\t\t\n\t\t// Getting Data\n\t\t// There are a couple ways to get data from the database\n\t\t\n\t\t// First: you can use OWA's Data Access API (controlled by owa_coreAP.php)\n\t\t// Documentation: http://wiki.openwebanalytics.com/index.php?title=Data_Access_API\n\t\t// List of all metrics and dimensions: http://wiki.openwebanalytics.com/index.php?title=Metrics_%26_Dimensions\n\t\t// The following API request gets the list of all actions performed within the specified date range\n\t\t$params = array('do'\t\t => 'getResultSet',\n\t\t\t\t\t\t'period' \t => $this->get('period'),\n\t\t\t\t\t\t'startDate'\t => $startDate,\n\t\t\t\t\t\t'endDate'\t => $endDate,\n\t\t\t\t\t\t'metrics' \t => 'actions,uniqueActions',\n\t\t\t\t\t\t'dimensions' => 'actionGroup',\n\t\t\t\t\t\t'siteId' \t => $this->getParam('siteId'),\n\t\t\t\t\t\t'resultsPerPage' => 10,\n\t\t\t\t\t\t'sort' => 'actionGroup-'\n\t\t\t\t\t\t);\n\t\t$actions = owa_coreAPI::executeApiCommand($params);\n\n\t\t// But the Data Access API is limited. E.g.: you can't filter actions by user name, since that's not a dimension\n\t\t// To do more normal sql queries, you can do the following (for more info, you can see owa_db.php)\n\t\t// The follow DB request gets the list of all actions performed by a particular user (if one is selected)\n\t\tif ($currentUser){\n\t\t\t$db = owa_coreAPI::dbSingleton();\n\t\t\t$db->selectFrom('owa_action_fact');\n\t\t\t$db->selectColumn('timestamp,action_group,action_name,action_label');\n\t\t\t$db->where('user_name', $user);\n\t\t\t$actionsByUser = $db->getAllRows();\n\t\t}\n\t\t// If you expect to do a lot of similar sql commands like above, you can put that functionality into a class\n\t\t// Should have path example/classes/className.php \n\t\t// Use the supportClassFactory method to include your class\n\t\t// This code gets the list of all visitor names that have performed actions on the site(s) you are tracking\n\t\t$p = owa_coreAPI::supportClassFactory('example', 'exampleClass');\n\t\t$users = $p->getAllUserNames();\n\t\t\n\t\t// To make the data compiled here accessible to the view controller class (below), use the set method\n\t\t// It's good practice to keep the variable names the same when you do this\n\t\t$this->set('actions', $actions);\n\t\tif ($currentUser)\n\t\t\t$this->set('actionsByUser', $actionsByUser);\n\t\t$this->set('users', $users);\n\t\t$this->set('currentUser', $currentUser);\n\t\t\n\t\t$this->set('actionsByUser',$actionsByUser);\n\t\t\n\t}", "public function create() {\n // if it's a GET request display a blank form for creating a new product\n // else it's a POST so add to the database and redirect to readAll action\n if($_SERVER['REQUEST_METHOD'] == 'GET'){\n require_once('views/blogs/create.php');\n }\n else { \n BlogPost::add();\n $blogposts = BlogPost::all('BlogID', 'desc'); //$blogposts is used within the view\n require_once('views/blogs/readAll.php');\n }\n }", "public function reportsNew()\n\t{\n\t\treturn view('admin.pages.planning.department.reports-new');\n\t}", "function scheduledreporting_component_add_report($report, $userid = 0)\n{\n $reports = scheduledreporting_component_get_reports($userid);\n \n $id = random_string(12);\n $reports[$id] = $report;\n\n scheduledreporting_component_save_reports($reports, $userid);\n\n return $id;\n}", "function submissionsReport($args) {\r\n\t\timport ('classes.submission.sectionEditor.SubmissionsReportForm');\r\n\t\tparent::validate();\r\n\t\t$this->setupTemplate();\r\n\t\t$submissionsReportForm= new SubmissionsReportForm($args);\r\n\t\t$isSubmit = Request::getUserVar('generateSubmissionsReport') != null ? true : false;\r\n\t\r\n\t\tif ($isSubmit) {\r\n\t\t\t$submissionsReportForm->readInputData();\r\n\t\t\tif($submissionsReportForm->validate()){\r\n\t\t\t\t$this->generateSubmissionsReport($args);\r\n\t\t\t}else{\r\n\t\t\t\tif ($submissionsReportForm->isLocaleResubmit()) {\r\n\t\t\t\t\t$submissionsReportForm->readInputData();\r\n\t\t\t\t}\r\n\t\t\t\t$submissionsReportForm->display($args);\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\t$submissionsReportForm->display($args);\r\n\t\t}\r\n\t}", "public function create()\n {\n return view('quicksite::modules.blogs.create');\n }", "public function actionReport()\n\t{\n\t\t$model = new AutoChores();\n\t\t$results = array();\n\t\t$errors = array();\n\t\t$isPrint = 0;\n\t\t//exit;\n\t\tif(isset($_REQUEST['go'])){\n\t\t if(!isset($_REQUEST['go']))\n \t\t $isPrint = 1;\n\t\t\tif(empty($_REQUEST['from_date'])){\n\t\t\t\t$errors[\"from_date\"] = \"Invalid From Date\";\n\t\t\t}\n\t\t\tif(empty($_REQUEST['to_date'])){\n\t\t\t\t$errors[\"to_date\"] = \"Invalid To Date\";\n\t\t\t}\n\t\t\tif(empty($_REQUEST['farm'])){\n\t\t\t\t$errors[\"farm\"] = \"Invalid Farm & Herd\";\n\t\t\t}else {\n\t\t\t\t$qtxt =\"SELECT farm_herd FROM herd_setup WHERE farm_herd = '\".$_REQUEST['farm'].\"' \";\n\t\t\t\t$command =Yii::app()->db->createCommand($qtxt);\n\t\t\t\t$res =$command->queryColumn();\n\n\t\t\t\tif($_REQUEST['farm'] != 'A' && (!isset($res[0]) || $res[0] != $_REQUEST['farm']))\n\t\t\t\t\t$errors[\"farm\"] = \"Invalid Farm & Herd\";\n\t\t\t}\n\t\t\tif(count($errors) == 0) {\n\t\t\t\t$results1 = $this->dateRange($_REQUEST['from_date'], $_REQUEST['to_date'],'+1 day','m/d/Y');\n\t\t\t\tforeach ($results1 as $result) {\n\t\t\t\t\t$qtxt = \"SELECT * FROM chores WHERE date = '\".$result.\"' \";\n\t\t\t\t\tif($_REQUEST['farm'] != 'A')\n\t\t\t\t\t\t$qtxt .= \" AND farm_herd = '\".$_REQUEST['farm'].\"' \";\n\t\t\t\t\t$command =Yii::app()->db->createCommand($qtxt);\n\t\t\t\t\t$res =$command->queryAll();\n\t\t\t\t\t//$results[$result] = $res;\n\n\t\t\t\t\t//D\n\t\t\t\t\t$qtxt = \"SELECT * FROM auto_chores WHERE generated_by = 'D' AND disabled = 'N' \";\n\t\t\t\t\tif($_REQUEST['farm'] != 'A')\n\t\t\t\t\t\t$qtxt .= \" AND (farm_herd = '\".$_REQUEST['farm'].\"' OR generated_by = 'A') \";\n\n\t\t\t\t\t$qtxt1 = \" ADDDATE(date_asof, days_after) = '\".$result.\"' \";\n\t\t\t\t\t$qtxt2 = \" ADDDATE(date_asof, (days_after+(times_occur*days_between))) = '\".$result.\"' AND times_occur >= 2\";\n\t\t\t\t\t$qtxt .= \" AND ((\".$qtxt1.\") OR (\".$qtxt2.\")) \";\n\n\n\t\t\t\t\t$command =Yii::app()->db->createCommand($qtxt);\n\t\t\t\t\t$res1 =$command->queryAll();\n\t\t\t\t\t$results[$result] = array_merge($res,$res1);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$model->addErrors($errors);\n\t\t\t}\n\t\t}\n\n\n\t\t$this->render('report',array(\n\t\t\t\t'model'=>$model,\n\t\t\t\t'results'=>$results,\n\t\t 'isPrint'=>$isPrint,\n\n\t\t));\n\t}", "public function feVisitReportAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey; \n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$comment\t= isset($params['comment'])?$params['comment']:\"\";\n\t\t\t\t$sink_date_time \t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE; \n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\t$fe_report = array(); \n\n\t\t\t\t\t$fe_report['comment'] = $comment;\n\n\t\t\t\t\t$fe_report['farmer_code'] = $farmer_code;\n\t\t\t\t\t$fe_report['farmer_id'] = $farmerID;\n\t\t\t\t\t$fe_report['fe_code'] = $LoginID;\n\t\t\t\t\t$fe_report['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$fe_report['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_fevisit_report', $fe_report);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Fe report Detail Inserted successfully.', 'fe_report_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t}", "public function run()\n {\n // $author = User::where('email', '=', '[email protected]')->get();\n // $postCat = PostCategory::where('name', '=', 'Report')->get();\n\n // print_r\n \n // id, author_id, category_id, title, seo_title, excerpt,\n // body, image, slug, meta_description, status, featured,\n // created_at, updated_at, tags, published_date\n // ADD Existing Post(s)\n DB::table('blog_posts')->insert([\n 'author_id' => 1,\n 'category_id' => 1,\n 'title' => 'Initial Findings Report',\n 'seo_title' => NULL,\n 'excerpt' => 'Our first report is out! Read about our initial findings from 2009.',\n 'body' => '<p>Our first report is out! Read about our initial findings from 2009 in the &lt;span md-colors=\"{color:\"accent\"}\"&gt;Clark County Amphibians Report&lt;/span&gt; by clicking the link above.</p>\n<p>&lt;a class=\"swamp-btn submit\" href=\"#\" href=\"/content/documents/clark_county_amphibian_report.pdf\" target=\"_self\" download=\"report_2009.pdf\"&gt;Download Amphibians Report&lt;/a&gt;</p>\n<p>&nbsp;</p>',\n 'image' => 'blog_posts/March2019/bkiu6kUdWU8SZGMbwvC7.png',\n 'slug' => 'initial-findings-report',\n 'meta_description' => '2009-survey-report',\n 'status' => 'PUBLISHED',\n 'featured' => 0,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n 'tags' => 'report, survey',\n 'published_date' => Carbon::now()\n ]);\n }", "public function create()\n {\n return view('admin.blogs.create',['title'=>trans('admin.create')]);\n }", "public function create()\n {\n //\n //$page = '/admin/doctor';\n $investigation=Investigation::where('status',1)->get();\n $patients = User::with('roles')->whereHas('roles', function ($q) {\n $q->where('id', 3);\n })->get(); \n return view('admin.labreport.create',compact('investigation','patients'));\n }", "public function report()\n\t{\n\n\n\n\t\t$query=\"https://graph.facebook.com/v3.2/\".$this->ad_acc_id.\"/campaigns?fields=ads{id,name,status,created_time,adcreatives{thumbnail_url},adset{name},insights.level(adset){campaign_name,account_id,reach,impressions,cost_per_unique_click,actions,spend}}&limit=3000&access_token=\".$this->user_access_token.\"\";\n\n\n\t\t\t// Call to Graph api here\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch,CURLOPT_URL,$query);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_POST, 0);\n\n\n\t\t$resp = curl_exec($ch);\n\t\t$resp = json_decode($resp);\n\n\t\tcurl_close($ch);\n\t\tif(isset($resp->error->error_user_msg))\n\t\t\tSession::flash('message',$resp->error->error_user_msg);\n\t\telseif(isset($resp->error->message))\n\t\t\tSession::flash('message',$resp->error->message);\n\n\n\t\treturn view('social.reports',['resp'=>$resp]);\n\t}", "public function report()\n {\n }", "public function getPostReport()\n {\n return post_report::all();\n }", "public function create()\n {\n //\n\n return view('front.career-advisor.blog.add');\n }", "public function create()\n {\n return view('report', ['categories' => Category::all()]);\n }", "public function indexAction()\n\t{\n\t\t$this->view->title = \"Survey Reports\";\n\t}", "public function index()\r\n {\r\n $this->global['pageTitle'] = 'Reports';\r\n $where=array(\r\n 'isActive'=>1,\r\n );\r\n $select=array('*');\r\n \r\n $projects=$this->common_model->selectData(TABLE_MASTER_PROJECTS,$select,$where);\r\n $data=array(\r\n 'projects'=>$projects\r\n );\r\n \r\n \r\n $post= $this->input->post();\r\n $fromdate=$todate=$project=$users='';\r\n $reporttype=1;\r\n if($post){\r\n $fromdate=isset($post['fromdate'])?$post['fromdate']:'';\r\n $todate=isset($post['todate'])?$post['todate']:'';\r\n $project=isset($post['project'])?$post['project']:'';\r\n $reporttype=isset($post['reporttype'])?$post['reporttype']:'';\r\n $users=isset($post['users'])?$post['users']:'';\r\n $data['post']=$post;\r\n }else{\r\n $fromdate=date(\"m/01/Y\");\r\n //$fromdate=getFirstDayofWeek();\r\n //$data['post']['fromdate']=$fromdate;\r\n $data['post']['reporttype']=$reporttype;\r\n }\r\n $role=$this->session->userdata ( 'role' );\r\n $projectId=$this->session->userdata ('projectId' );\r\n $userId=$this->session->userdata ( 'userId' );\r\n $currentDate=date(\"Y-m-d\");\r\n $trakingTable=TABLE_DAILY_TRACKING;\r\n $userTable=TABLE_USERS;\r\n $projectsTable=TABLE_MASTER_PROJECTS;\r\n \r\n //pre($data,1);\r\n $where=array(\r\n // 'dt.userid'=>$userId,\r\n );\r\n if($fromdate){\r\n $where[\"dt.created_on >=\"]=sqldateformate($fromdate);\r\n }\r\n if($todate){\r\n $where[\"dt.created_on <=\"]=sqldateformate($todate);\r\n }\r\n if($project){\r\n $where[\"u.projectId\"]=$project;\r\n }\r\n \r\n if($users){\r\n $where[\"u.userId\"]=$users;\r\n }\r\n \r\n if($role==ROLE_TEAMLEAD){\r\n $where[\"u.roleId !=\"]=ROLE_MANAGER;\r\n $where[\"u.teamleadId\"]=$userId;\r\n $where[\"u.isDeleted\"]=0;\r\n }\r\n $select=array('u.name,dt.*,p.name as projectname');\r\n $join=array(\r\n \"$userTable u\"=>\"u.userId=dt.userid\",\r\n \"$projectsTable p\"=>\"p.id=u.projectId\",\r\n );\r\n //selectData($tableName=null,$select=null,$where=null,$join=null,$like=null,$order_by=null,$order=null,$ion_limit=null,$ion_offset=null,$group_by=null)\r\n $res=$this->common_model->selectData(\"$trakingTable dt\",$select,$where,$join);\r\n \r\n $data['info']=$res;\r\n \r\n $where_user=array(\r\n \r\n );\r\n if($role==ROLE_TEAMLEAD){\r\n //$where_user[\"roleId !=\"]=ROLE_MANAGER;\r\n $where_user[\"teamleadId\"]=$userId;\r\n $where_user[\"isDeleted\"]=0;\r\n \r\n }\r\n $select_user=array('*');\r\n \r\n $Info_users=$this->common_model->selectData($userTable,$select_user,$where_user);\r\n $data['users']=$Info_users;\r\n if($reporttype && $reporttype==2){\r\n $result=array();\r\n $user='';\r\n foreach ($res as $r){\r\n \r\n $name=$r->name;\r\n $userids=$r->userid;\r\n $break_hours=$r->break_hours;\r\n $spend_hours=$r->spend_hours;\r\n $projectname=$r->projectname;\r\n \r\n \r\n if($user=='' || $userids !=$user){\r\n $user=$userids;\r\n $breakCount=$hoursCount=0;\r\n $days=1;\r\n }\r\n \r\n $hoursCount=sumofTimes($hoursCount,$spend_hours);\r\n $breakCount=sumofTimes($breakCount,$break_hours);\r\n $result[$userids]=array(\r\n 'name'=> $name,\r\n 'projectname'=>$projectname,\r\n 'days'=>$days,\r\n 'hourscount'=>$hoursCount,\r\n 'breakscount'=>$breakCount\r\n );\r\n //echo $userids.\"==>\".$hoursCount.\"<br>\";\r\n $days++;\r\n \r\n }\r\n //pre($result,1);\r\n $data['info']=$result;\r\n $data['projectId']=$projectId;\r\n $data['userId']=$userId;\r\n $data['roleId']=$role;\r\n }\r\n \r\n $this->loadViews(\"reports\", $this->global, $data , NULL);\r\n }", "public function create()\n {\n // dd(date('F', strtotime('2020-12-23'))); \n $route = route('report.store');\n $method = 'POST';\n $provinces = Province::all();\n $event_types = EventType::all();\n $fields = Fields::all();\n $years = $this->get_list_of_years();\n $months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n return view('add_edit_report', compact('route', 'method', 'provinces', 'years', 'months', 'event_types', 'fields'));\n }", "public function create()\n {\n $retail_sale_data=RetailSaleChildModel::join('customer','customer.customer_id','=','retail_sale_child.customer_name')->get();\n return view('Admin.Sale.retail_sale_report',['retail_sale_data'=>$retail_sale_data]);\n }", "function runReport (){\n\t\tif(!empty($this->params['form']))\n\t\t{\n\t\t\tif($this->params['form']=='allData'){\n\t\t\t\tindex();\n\t\t\t}else {\n\t\t\t\tindex();\n\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t}\n\t}", "function runReport (){\n\t\tif(!empty($this->params['form']))\n\t\t{\n\t\t\tif($this->params['form']=='allData'){\n\t\t\t\tindex();\n\t\t\t}else {\n\t\t\t\tindex();\n\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t}\n\t}", "function archimedes_build_report() {\n global $databases;\n\n $owl = new Archimedes('drupal', variable_get('site_mail', FALSE), archimedes_get_token());\n\n $owl->createField('title', variable_get('site_name', \"Drupal\"));\n $owl->createField('field_drupal_version', VERSION);\n\n // This allows site instances of the same project to be\n // related. For example my.site.com may also have staging.my.site.com\n // and we don't want the reports to clash, but grouping these sites\n // is still useful.\n $owl->createField('field_common_hash', variable_get('archimedes_common_key', ''));\n\n if (variable_get('archimedes_description', '') != '') {\n $nid = arg(1,drupal_get_normal_path(variable_get('archimedes_description', 'node')));\n $node = node_load($nid);\n $body = trim(substr(drupal_html_to_text($node->body,array('b','strong','i','em','p')),0,500));\n $owl->createField('body', $body);\n } else {\n $owl->createField('body', variable_get('site_mission', 'No description has been set.'));\n }\n\n // If Drush (or some other CLI passed method) is used to \n // run cron. You'll need to ensure a correct servername is\n // passed to PHP. With drush, use -l http://mysite.com.\n $owl->createField('field_servername', url('', array('absolute' => 1)));\n\n // The location where Drupal believes it resides.\n $owl->createField('field_webroot', DRUPAL_ROOT);\n\n // Build an understanding of the databases Drupal\n // can connect too. At this stage, Archimedes only\n // reports on the default connections, i.e, master\n // slave databases for Drupal only.\n $values = array();\n $connections = array();\n foreach($databases['default'] as $key => $connection) {\n if ($key == 'slave') {\n foreach ($connection as $slave) {\n $connections[] = $slave;\n }\n }\n else {\n $connections[] = $connection;\n }\n }\n\n foreach ($connections as $url) {\n //format into url like drupal 6\n $db_url = $url['driver'] . '://' . $url['username'] . ':' . $url['password'] . '@' . $url['host'] . '/' . $url['database'];\n $db = parse_url($db_url);\n if (!isset($database_name)) {\n $database_name = substr($db['path'],1);\n $owl->createField('field_dbname', $database_name);\n }\n $dbhost = ($db['host'] == 'localhost' || $db['host'] == '127.0.0.1') ? 'localhost' : $db['host'];\n $values[] = archimedes_value($dbhost,'nodereference')->addNode(array('title' => $dbhost, 'type' => 'host'));\n }\n\n $owl->createField('field_dbhost', $values)\n ->invokeFacet();\n\n $user = array(\n 'type' => 'mail',\n 'mailto' => 'mailto:' . db_query(\"SELECT u.mail FROM {users} u WHERE uid = 1 LIMIT 1\")->fetchField(),\n );\n $value = archimedes_value($user['mailto'],'userreference')\n ->addUser($user);\n $owl->createField('field_users', array($value))\n ->invokeFacet();\n\n // Graphable data.\n $users = archimedes_value(db_query(\"SELECT COUNT(uid) as count FROM {users}\")->fetchField() - 1, 'dataset')->setTitle('Users');\n $nodes = archimedes_value(db_query(\"SELECT COUNT(nid) as count FROM {node}\")->fetchField(), 'dataset')->setTitle('Nodes');\n $revisions = archimedes_value(db_query(\"SELECT COUNT(nid) as count FROM {node_revision}\")->fetchField(), 'dataset')->setTitle('Revisions');\n $owl->createField('field_c_dataset', array($nodes, $revisions, $users));\n\n $modules = $themes = array();\n foreach (module_list() as $module) {\n $info = drupal_parse_info_file(drupal_get_path('module', $module) . '/' . $module . '.info');\n $node = array(\n 'title' => (isset($info['name']) ? $info['name'] : ''),\n 'body' => (isset($info['description']) ? $info['description'] : ''),\n 'field_name' => $module,\n 'field_dru_pkg' => (isset($info['package']) ? $info['package'] : ''),\n 'field_dru_proj' => (isset($info['project']) ? $info['project'] : 'drupal'),\n 'field_mod_version' => (isset($info['version']) ? $info['version'] : ''),\n 'field_mod_url' => (isset($info['project status url']) ? $info['project status url'] : ''),\n 'type' => 'drupal_module',\n );\n if (empty($node['field_dru_proj']) && !empty($node['field_dru_pkg']) && (strpos($node['field_dru_pkg'], 'Core -') !== FALSE)) {\n $node['field_dru_proj'] = 'drupal';\n }\n $value = archimedes_value($node['title'], 'drupalmod')\n ->addNode($node);\n $modules[] = $value;\n }\n\n $owl->createField('field_drupal_mod', $modules)\n ->invokeFacet();\n\n\n $result = db_query(\"SELECT name FROM {system} WHERE status = 1 AND type = 'theme'\");\n while ($theme = $result->fetchField()) {\n $info = drupal_parse_info_file(drupal_get_path('theme', $theme) . '/' . $theme . '.info');\n $node = array(\n 'title' => (isset($info['name']) ? $info['name'] : ''),\n 'body' => (isset($info['description']) ? $info['description'] : ''),\n 'field_name' => $theme,\n 'field_mod_version' => (isset($info['version']) ? $info['version'] : ''),\n 'field_dru_proj' => (isset($info['project']) ? $info['project'] : 'drupal'),\n 'field_mod_url' => (isset($info['project status url']) ? $info['project status url'] : ''),\n 'type' => 'drupal_theme',\n );\n if (empty($node['field_dru_proj']) && in_array($theme, array('bluemarine', 'chameleon', 'garland', 'marvin', 'minnelli', 'pushbutton'))) {\n // Unfortunately, there's no way to tell if a theme is part of core,\n // so we must hard-code a list here.\n $node['field_dru_proj'] = 'drupal';\n }\n\n $value = archimedes_value($node['title'], 'drupalmod')\n ->addNode($node);\n\n $themes[] = $value;\n }\n\n $owl->createField('field_drupal_theme', $themes)\n ->invokeFacet();\n\n $environment = array_shift(environment_current(NULL,NULL,TRUE));\n\n $owl->createField('field_site_env', $environment['label']);\n\n $ignore = array('#(\\w*/)*sites/\\w*/files#', '#.*\\.(git|svn|bzr|cvs)/.*#');\n \n // The point of the directory hash is to record the state of the deployed code base.\n // If the code base changes, then the site could have been redeployed or hacked! However,\n // in development scenarios, the code changes very frequently so we don't care to change\n // it.\n $dir_hash = archimedes_directory_hash(DRUPAL_ROOT, $ignore);\n $owl->createField('field_directory_hash', $dir_hash);\n\n if (variable_get('archimedes_use_unsafe_collection', FALSE)) {\n $collect = new ArchimedesDrupalUnsafeCollection($owl);\n $collect->servername()\n ->database_size()\n ->storage_usage();\n }\n\n // Allow other modules to add data via hook_archimedes.\n drupal_alter('archimedes', $owl);\n \n return $owl;\n}", "public function create()\n {\n $data = array(\n 'users_detail' => json_encode(DB::select('select users_id as id, users_name as value, users_name as label from table_users_detail')),\n 'content' => json_encode(DB::select('select content_id as id, content_title as value, content_title as label from table_content')),\n );\n \n return view('admin.database.banned-report.banned-report-create', compact('data'));\n }", "public function create()\n {\n return view('complaint_logs.create');\n }", "function record_stat($blog_id, $action) {\r\n\t\tglobal $wpdb;\r\n\t\t//only record one stat action per blog per day\r\n\t\t$exists = $wpdb->get_var( $wpdb->prepare(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_signup_stats WHERE blog_ID = %s AND action = %s AND time_stamp = %s\", $blog_id, $action, date('Y-m-d')) );\r\n\t\tif ( !$exists ) {\r\n $wpdb->insert( \"{$wpdb->base_prefix}pro_sites_signup_stats\", array( 'blog_ID' => $blog_id, 'action' => $action, 'time_stamp' => date('Y-m-d') ), array( '%d', '%s', '%s' ) );\r\n\t\t}\r\n\t}", "public function index()\n {\n $reports = Report::whereType('post')\n ->with('type', 'member', 'reportable', 'reportable.media')\n ->orderBy('created_at', 'DESC')\n ->paginate(20);\n\n return view('dashboard.report.index', compact('reports'));\n }", "public function reports(){\n $reports = DB::table('reports')->paginate(25);\n $suggestions = DB::table('category_suggestion')->paginate(25);\n $categories = DB::table('categories')->paginate(25);\n return view('admin.reports')->with('reports', $reports)\n ->with('suggestions', $suggestions)\n ->with('categories', $categories);\n }", "public function insert () {\n\t\t$GLOBALS[\"logger\"]->debug(\"report:insert\");\n\t\t\n\t\t$newRec = ORM::for_table (self::REPORT_TABLE)->create();\n\t\t$newRec->clip_id = $this->clip->id;\n\t\t$newRec->master_id = $this->masterId;\n\t\t$sngid = NULL;\n\t\tif (!is_null($this->song)) {\n\t\t\t$GLOBALS[\"logger\"]->debug('There is a song with ID ' . $this->song->id);\n\t\t\t$sngid = $this->song->id;\n\t\t}\n\t\t$newRec->song_id = $sngid;\n\t\t$newRec->singalong = $this->singalong;\n\t\t$newRec->seq_num = $this->seqNum;\n\t\t$newRec->user_id = $this->user->id;\n\t\t$newRec->sound_type = $this->soundType;\n\t\t$newRec->sound_subtype = $this->soundSubtype;\n\t\t$newRec->performer_type = $this->performerType;\n\t\t$newRec->flagged = $this->flagged;\n\t\t$GLOBALS[\"logger\"]->debug(\"Saving newRec\");\n\t\t$newRec->save();\n\t\t$GLOBALS[\"logger\"]->debug(\"insert: saved new record into reports table\");\n\t\t$this->id = $newRec->id();\n//\t\t$insstmt = \"INSERT INTO REPORTS (CLIP_ID, MASTER_ID, SEQ_NUM, USER_ID, SOUND_TYPE, \" .\n//\t\t\t\" SOUND_SUBTYPE, SONG_ID, PERFORMER_TYPE, SINGALONG, FLAGGED) \" .\n//\t\t\t\" VALUES ($clpid, $mstrid, $seqn, $usrid, $sndtyp, $sndsbtyp, $sngid, $prftyp, $sngalng, $flgd)\";\n\t\t$this->writePerformers();\n\t\t$this->writeInstruments();\n\t\treturn $newRec->id();\n\t}", "public function create()\n\t{\n\n\t\tif ( $this->admin )\n\t {\n\t \n\t $view['teams'] = Team::with(array('senior', 'junior'))->get();\n\t\t\t$view['homes'] = Home::all();\n\t\t\t$view['admin'] = true;\n\n\t } else {\n\n\t \t$view['teams'] = Team::with(array('senior', 'junior'))->where('id', '=', $this->userTeam->id)->get();\n\t\t\t$view['homes'] = Home::where('team_id', '=', $this->userTeam->id)->get();\n\t\t\t$view['admin'] = false;\n\t }\n\n\t if (count($view['homes']) == 0) return Redirect::to('error')->with('error_message', 'There are no famillies to report on yet !'); \n\n\t\t$this->layout->content = View::Make('visits.new', $view);\n\t}", "public function mailReportAction(){\r\n \t\t\r\n \t\t/**\r\n \t\t * get form id\r\n \t\t */\r\n \t\t$form_id = $this->getAttribute('form_id');\r\n \t\t\r\n \t\t/**\r\n \t\t * set page url array\r\n \t\t */\r\n \t\t$url_array = array(\r\n \t\t\t$this->module_name, $this->action_name,\r\n \t\t\t'form_id', make_id($form_id),\r\n \t\t);\r\n \t\t\r\n \t\t/**\r\n \t\t * get page number from url and set attribute\r\n \t\t */\r\n \t\t$page_no = $this->getUrlParam('page');\r\n \t\t\r\n \t\t/**\r\n \t\t * set page number to 1 if page number is empty and assign to view\r\n \t\t */\r\n \t\tif (empty($page_no)){\r\n \t\t\t$page_no = 1;\r\n \t\t}else {\r\n \t\t\tif (is_numeric($page_no))\r\n \t\t\t\tarray_push($url_array, 'page',$page_no);\r\n \t\t}\r\n \t\t$this->viewAssign('page_no', $page_no);\r\n \t\t\r\n \t\t/**\r\n \t\t * get page limit from parameter\r\n \t\t */\r\n \t\t$limit = $this->getUrlParam('limit');\r\n \t\tif (is_numeric($limit))\r\n \t\t\t$this->setAttribute('limit', $limit);\r\n \t\t\r\n \t\t/**\r\n \t\t * if page limit is empty set page limit and assign to view\r\n \t\t */\t\r\n \t\tif (empty($limit)){\r\n \t\t\t$limit = ADMIN_DISP;\r\n \t\t}else {\r\n \t\t\tif (is_numeric($limit))\r\n \t\t\t\tarray_push($url_array, 'limit', $limit);\r\n \t\t}\r\n \t\t$this->viewAssign('limit', $limit);\r\n \t\t\r\n \t\t/**\r\n \t\t * set paging offset\r\n \t\t */\r\n \t\t$offset = ($page_no-1) * $limit;\r\n \t\t\r\n \t\t/**\r\n \t\t * set number to dispaly list number on view\r\n \t\t */\r\n \t\t$this->viewAssign('number', (($page_no-1)*$limit));\r\n \t\t\r\n \t\t/**\r\n\t\t * get form mail list\r\n\t\t */\r\n \t\t$list = $this->db_model->getFormMailList($form_id, $limit, $offset);\r\n \t\t\r\n \t\t/**\r\n \t\t * page view list assign to view\r\n \t\t */\r\n \t\t$this->viewAssign('list', $list);\r\n \t\t \t\t\r\n \t\t/**\r\n \t\t * if show all in one page\r\n \t\t */\r\n\t\tif ($limit == 'all'){\r\n \t\t\t$limit = 0;\r\n \t\t\t$this->viewAssign(\"paging\",'<li><span>1</span></li>');\r\n \t\t}else {\r\n \t\t\t\r\n \t\t\t/**\r\n \t\t\t * get paging html, previous, next page info and assign to view\r\n \t\t \t */\r\n \t\t\t$page_class = new PageClass($total_rows, $page_no, $limit);\r\n \t\t\t$this->viewAssign('prev', $page_class->isPrev());\r\n\t\t\t$this->viewAssign('prev_pn', $page_no-1);\r\n\t\t\t$this->viewAssign('next', $page_class->isNext());\r\n\t\t\t$this->viewAssign('next_pn', $page_no+1);\r\n\t\t\t$link_url = $this->self_url.'/'.$this->action_name.'/form_id/'.make_id($form_id).'/limit/'.$limit;;\r\n\t\t\t$paging = $page_class->DisPage($link_url);\r\n\t\t\t$this->viewAssign(\"paging\",$paging);\r\n\t\t}\r\n \t\t\r\n\t\t\r\n \t\t$this->setDisplay('report');\r\n \t\t\r\n \t}", "public function create()\n {\n return view('admin.statistical_reports_user.create');\n }", "function printReport() {\n # You need both of these globals!!\n global $report, $page_index;\n\n # This turns the Name Field into a link to the correct contact.\n $report->setFieldRule( 'Account',\n '<a href=\"/ACCT_main_workspace_page.php?content_page='\n . urlencode(\"/py/account/view.pt\")\n . '&args=' . urlencode('account_number=') \n . '%Account\">%Account</a>');\n\n\n # This does the actual printing of the HTML\n $report->printHTML( $page_index );\n}", "public function blogAction()\n {\n\n \t$blogId = $this->_request->getParam(2);\n $page = $this->_request->getParam(3);\n\n $blog = Data::factory($blogId, Blog::ITEM_TYPE);\n\t\tif(empty($blog)){\n throw new Lib_Exception_NotFound(\"Blog '$blogId' not found\");\n }\n\n Zend_Registry::set('Category', $blog->getCategory());\n Zend_Registry::set('SubCategory', $blog->getSubCategory());\n\n $table = new Blog_Post();\n $select = $table->select();\n $select->where(\"blogId = $blog->id\");\n\n // Regular users only see valid posts\n if(!$blog->isEditableBy($this->_user, $this->_acl)){\n \t$select->where(\"status = '\".Data::VALID.\"'\");\n }\n $select->order(\"date DESC\");\n\n $posts = $this->_helper->dataPaginator($select, $page, 'commonviews/pagination.phtml', BLOGPOSTS_PER_PAGE);\n\n $this->view->blog = $blog;\n $this->view->dataType = 'Blog_Post';\n $this->view->posts = $posts;\n \n if($this->_user->getId() == $blog->getSubmitter()->getId()){\n \t$this->_useAdditionalContent = false;\n \t$this->_helper->layout->setLayout('one-column');\n } else {\n \t$this->_useAdditionalContent = true;\n \t$this->_helper->layout->setLayout('two-columns');\n \t$this->view->wrapperIsCard = true;\n }\n \n \n }", "function create()\n\t{\n\n\t\t$kStudent = $this->uri->segment(3);\n\t\t$this->load->model(\"student_model\",\"student\");\n\t\t$this->load->model(\"teacher_model\",\"teacher\");\n\t\t$this->load->model(\"menu_model\",\"menu\");\n\t\t$data[\"ranks\"] = get_keyed_pairs($this->menu->get_pairs(\"report_rank\"),array(\"value\",\"label\"));\n\t\t$data[\"kTeach\"] = $this->session->userdata(\"userID\");\n\t\t//if the individual is not a teacher, show a dropdown list of teachers on whose behalf.\n\t\t//Include the author as an option\n\t\t$data[\"is_teacher\"] = TRUE;\n\t\tif($this->session->userdata('dbRole') != 2){\n\t\t\t$this->load->model(\"teacher_model\");\n\t\t\t$teachers = $this->teacher_model->get_teacher_pairs();\n\t\t\t$data['teachers'] = get_keyed_pairs($teachers, array('kTeach', 'teacher'),NULL,NULL,array('value'=>\"Myself\",'name'=>$data[\"kTeach\"]));\n\t\t\t$data[\"is_teacher\"] = FALSE;\n\t\t}\n\t\t$data[\"kStudent\"] = $kStudent;\n\t\t$report = $this->student->get($kStudent,\"stuFirst,stuLast,stuNickname,teacher.teachFirst as advisorFirst,teacher.teachLast as advisorLast,teacher.kTeach as kAdvisor\",TRUE);\n\t\t$data[\"student\"] = format_name($report->stuFirst,$report->stuLast,$report->stuNickname);\n\t\t$data[\"advisor\"] = format_name($report->advisorFirst,$report->advisorLast);\n\t\t$data[\"report\"] = $report;\n\t\t$data[\"methods\"] = array(\"In Person\",\"Over the Phone\",\"Via Email\");\n\n\t\t$data[\"statuses\"] = get_keyed_pairs($this->menu->get_pairs(\"report_status\"),array(\"value\",\"label\"));\n\t\t$data[\"categories\"] = get_keyed_pairs($this->menu->get_pairs(\"report_category\"),array(\"value\",\"label\"));\n\t\t$data[\"methods\"] = $this->menu->get_pairs(\"report_contact_method\");\n\t\t$data[\"action\"] = \"insert\";\n\t\t$data[\"title\"] = sprintf(\"Adding an %s for %s\", STUDENT_REPORT, $data[\"student\"]);\n\t\t$data[\"target\"] = \"report/edit\";\n\t\t$this->_view($data);\n\t\t\n\t}", "public function _report_view()\n\t{\n\t\t$incident_id = Event::$data;\n\t\tif ($incident_id)\n\t\t{\n\t\t\t$actionable = ORM::factory('actionable')\n\t\t\t\t->where('incident_id', $incident_id)\n\t\t\t\t->find();\n\t\t\tif ($actionable->loaded)\n\t\t\t{\n\t\t\t\tif ($actionable->actionable)\n\t\t\t\t{\n\t\t\t\t\t$report = View::factory('actionable_report');\n\t\t\t\t\t$report->actionable = $actionable->actionable;\n\t\t\t\t\t$report->action_taken = $actionable->action_taken;\n\t\t\t\t\t$report->action_summary = $actionable->action_summary;\n\t\t\t\t\t$report->action_date = $actionable->action_date;\n\t\t\t\t\t$report->resolution_summary = $actionable->resolution_summary;\n\t\t\t\t\t$report->resolution_date = $actionable->resolution_date;\n\t\t\t\t\t$report->render(TRUE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function create()\n {\n $teams = Team::all();\n return view('manage.report.create', compact('teams'));\n }", "public function postAction()\n {\n // $this->view->blog = $Blog->fetchAll();\n \n }", "public function create()\n {\n //\n return view('blog.create');\n\n }", "public function create()\n {\n return view('backoffice.blog.create');\n }", "public function create()\n {\n return view('money_logs.create');\n }", "public function create()\n {\n //\n return view('blog.create');\n }", "public function actionCreate()\n\t{\t\t\n\t\t// Check Access\n\t\tcheckAccessThrowException('op_blog_addposts');\n\t\t\n\t\t$model = new BlogPost;\n\t\t\n\t\tif( isset( $_POST['BlogPost'] ) ) {\n\t\t\t$model->attributes = $_POST['BlogPost'];\n\t\t\tif( isset( $_POST['submit'] ) ) {\n\t\t\t\tif( $model->save() ) {\n\t\t\t\t\tfok(at('Page Created.'));\n\t\t\t\t\talog(at(\"Created Blog Post '{name}'.\", array('{name}' => $model->title)));\n\t\t\t\t\t$this->redirect(array('blog/index'));\n\t\t\t\t}\n\t\t\t} else if( isset( $_POST['preview'] ) ) {\n\t\t\t\t$model->attributes = $_POST['BlogPost'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t$roles = AuthItem::model()->findAll(array('order'=>'type DESC, name ASC'));\n\t\t$_roles = array();\n\t\tif( count($roles) ) {\n\t\t\tforeach($roles as $role) {\n\t\t\t\t$_roles[ AuthItem::model()->types[ $role->type ] ][ $role->name ] = $role->name;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Add Breadcrumb\n\t\t$this->addBreadCrumb(at('Creating New Post'));\n\t\t$this->title[] = at('Creating New Post');\n\t\t\n\t\t// Display form\n\t\t$this->render('form', array( 'roles' => $_roles, 'model' => $model ));\n\t}" ]
[ "0.6467288", "0.641362", "0.6370828", "0.6370657", "0.6277838", "0.62200916", "0.6209229", "0.6180525", "0.60439444", "0.60050166", "0.5978354", "0.59729266", "0.5954844", "0.5946367", "0.5914815", "0.59090835", "0.59010774", "0.5891789", "0.5878827", "0.58530945", "0.58482826", "0.58388776", "0.58130026", "0.5801891", "0.57881916", "0.576818", "0.57394063", "0.56990063", "0.5676966", "0.5670359", "0.5635902", "0.563028", "0.5612967", "0.55997425", "0.5581482", "0.5577343", "0.55700123", "0.5567719", "0.55659866", "0.5563527", "0.5552435", "0.5551438", "0.5548813", "0.55488104", "0.55487347", "0.5531601", "0.55128676", "0.5510855", "0.54984164", "0.54949814", "0.5488309", "0.5487302", "0.5486677", "0.5475855", "0.5471031", "0.5470416", "0.54701453", "0.5460406", "0.5460128", "0.54510945", "0.5450676", "0.54506654", "0.5446517", "0.54447335", "0.5441095", "0.54368424", "0.5434988", "0.5424058", "0.5413469", "0.5403205", "0.5399335", "0.53977025", "0.5394766", "0.5385942", "0.5385423", "0.5379327", "0.5377278", "0.53735924", "0.53735924", "0.5370546", "0.5368948", "0.5364565", "0.5362553", "0.5355851", "0.5354048", "0.53525597", "0.5348405", "0.5347053", "0.53413165", "0.5341219", "0.53400165", "0.5335068", "0.5334866", "0.5334058", "0.53335965", "0.53273916", "0.53265387", "0.5323734", "0.5311086", "0.5310523" ]
0.61931825
7
=============== Working with Tables =================// Get the number of rows in the table
public function getCountRowsTable($options = NULL) { $request = $this->getRequest(); $params = $request->getParams(); $table = $params['table']; //--------------------------- if ($table == 'admin.blog_posts') { return Default_Model_DbTable_BlogPost::GetPostsCount($this->db, $options); } if ($table == 'admin.blog_posts_tags') { $post_ids = Default_Model_DbTable_BlogPost::GetPostsIds_Array($this->db, $options); return Default_Model_DbTable_BlogPostTag::GetPostsTags_Count($this->db, array('post_id' => $post_ids)); } if ($table == 'admin.blog_posts_images') { $post_ids = Default_Model_DbTable_BlogPost::GetPostsIds_Array($this->db, $options); return Default_Model_DbTable_BlogPostImage::GetPostsImages_Count($this->db, array('post_id' => $post_ids)); } if ($table == 'admin.blog_posts_audio') { $post_ids = Default_Model_DbTable_BlogPost::GetPostsIds_Array($this->db, $options); return Default_Model_DbTable_BlogPostAudio::GetPostsAudio_Count($this->db, array('post_id' => $post_ids)); } if ($table == 'admin.blog_posts_video') { $post_ids = Default_Model_DbTable_BlogPost::GetPostsIds_Array($this->db, $options); return Default_Model_DbTable_BlogPostVideo::GetPostsVideo_Count($this->db, array('post_id' => $post_ids)); } if ($table == 'admin.blog_posts_locations') { $post_ids = Default_Model_DbTable_BlogPost::GetPostsIds_Array($this->db, $options); return Default_Model_DbTable_BlogPostLocation::GetPostsLocations_Count($this->db, array('post_id' => $post_ids)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNumberOfRows();", "public function getNumRows();", "public function getTableRowsCount()\n {\n return $this->tableRowsCount;\n }", "function RowCount() {}", "public function numOfRows();", "public abstract function row_count();", "public function getNumberOfRows()\r\n {\r\n return count($this->data);\r\n }", "abstract public function getNumRows();", "abstract public function getNumRows();", "public static function tableNumRows( $sTableName ) {\n\t\t$rRes = mysql_query( sprintf( 'SELECT COUNT(*) FROM %s', $sTableName ) );\n\t\t$aRes = mysql_fetch_row( $rRes );\n\t\treturn $aRes[ 0 ];\n\t}", "public function getRowsCount()\n {\n if (is_null($this->summaryRow)) {\n return count($this->rows);\n } else {\n return count($this->rows) + 1;\n }\n }", "public function getNumberOfRows() {\n return count($this->rows);\n }", "public function numberOfRows();", "function getNumberOfRows($table_name)\n {\n $sql = \"SELECT COUNT(*) as count FROM \".$table_name;\n return $this->querySingle($sql);\n }", "public function getNumRows(){\n\t\treturn $this->instance->getNumRows();\n\t}", "public function getNumberOfRows(){\r\n $this->setTable('subscribed');\r\n $table = $this->getTable();\r\n\r\n $sql = \"SELECT * FROM \" . $table;\r\n $stmt = $this->fetch()->query($sql);\r\n return $stmt->rowCount();\r\n }", "public function countRows()\n {\n return count($this->rows);\n }", "public abstract function GetNumRows();", "public function RowCount() {\n return $this->_row == '' ? $this->_rown : $this->_rown + 1;\n }", "public function nbRows();", "function numRows()\n {\n $this->getRows();\n return $this->row_counter;\n }", "public function rowCount()\n {\n return sasql_num_rows($this->result);\n }", "public function getRowCount()\n {\n return $this->row_count;\n }", "public function getRowCount()\n {\n return $this->row_count;\n }", "public function getRowCount()\n {\n return $this->row_count;\n }", "abstract public function NumRows();", "public function getRowCount() {\n\t\treturn $this->ROW_COUNT;\n\t}", "function NumberofRows($table){\t\t\n\t\t$query = \"SELECT * FROM `$table`\";\n\t\tif($result = mysql_query($query)){\n\t\t\t$num_of_rows=mysql_num_rows($result);\n\t\t\treturn $num_of_rows;\n\t\t}else{\n\t\t\t$String='Table '.$table.' not found!';\n\t\t\treturn $String;\n\t\t}\n\t}", "public function countRows(): int\n {\n $result = $this->_getResult()->numRows(); // Returns an integer on success and an \\PEAR_Error object on failure\n return is_int($result) ? $result : 0;\n }", "public function count() {\n return count($this->__rows__);\n }", "function NumRows() {}", "public function getNumRows() {\n\t\treturn $this->_num_rows;\n\t}", "public function get_rows_count()\n\t{\n\t\treturn count($this->get_rows());\n\t}", "public function num_rows() {\n\t\treturn $this->GetNumRows();\n\t}", "function NumRows() {\n\t\t\t$result = pg_num_rows($this->result);\n\t\t\treturn $result;\n\t\t}", "public function getNumRows()\n {\n \treturn $this->previouslyExecuted->num_rows;\n }", "public function GetNumberOfRows() {\n return $this->num_rows;\n }", "public function getRowsSize();", "public function get_row_count() {\n return 0;\n }", "public function getRowCount();", "function getNumRows() {\r\n\t\t\tif($this->privateVars['resultset']) {\r\n\t\t\t\tif(@mysql_num_rows($this->privateVars['resultset']))\r\n\t\t\t\t\treturn mysql_num_rows($this->privateVars['resultset']);\r\n\t\t\t}\r\n\t\t\treturn -1;\r\n\t\t}", "function RowCount()\n\t{\n\t\tif (!isset($this->_intCurrentRow))\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn ($this->_intCurrentRow + 1);\n\t\t}\n\t}", "public function count() {\n if($this->count === false) {\n if (is_object($this->table)) {\n $this->count = 1;\n } elseif (is_array($this->table)) {\n $this->count = count($this->table);\n } else {\n $this->count = 0;\n }\n }\n return $this->count;\n }", "public function rowCounter($table,$id_field){\n\t\t$query=\"SELECT \".$id_field.\" FROM \".$table;\n\t\t$numRows=$this->rows($query);\n\t\treturn $numRows;\n\t}", "public function getRowNumber() {\n if($this->result) {\n return mysql_num_rows($this->result);\n }\n return 0;\n }", "public function getNumRows() {\n\t\t$this->_numRows = mysqli_num_rows($this->_result);\n\t\treturn $this->_numRows;\n\t}", "public function GetRowCount() : INT\r\n {\r\n return($this->preparedStatement->rowCount());\r\n }", "function get_num_rows($table_name) {\n $this->db->select('*')->from($table_name);\n $query = $this->db->get();\n return ($this->db->count_all_results($table_name));\n }", "public function getNumRows(): int\n {\n if (is_int($this->numRows)) {\n return $this->numRows;\n }\n if ($this->resultArray !== []) {\n return $this->numRows = count($this->resultArray);\n }\n if ($this->resultObject !== []) {\n return $this->numRows = count($this->resultObject);\n }\n\n return $this->numRows = count($this->getResultArray());\n }", "public function numRows() : int\n\t{\n\t\treturn $this->handle->numRows($this->result);\n\t}", "public function rowCount();", "public function rowCount();", "public function rowCount()\n {\n return oci_num_rows($this->sth);\n }", "public function getRowCount(): int\n {\n return $this->rowCount;\n }", "function get_num_rows($table_name = '') {\n $this->db->select('*')\n ->from(self::table_name);\n\n $query = $this->db->get();\n return ($this->db->count_all_results(self::table_name));\n }", "public function rows(): int\n {\n return $this->rows;\n }", "public function numRows() {\n\t\t$q = \"SELECT COUNT(*) FROM {$this->_name}\";\n\t\t$r = @sqlite_query($q, $this->_connection);\n\t\tlist($numRows) = sqlite_fetch_array($r, SQLITE_NUM);\n\t\treturn $numRows;\n\t}", "public function getRowCount() {\n return $this->Read->rowCount();\n }", "public function count()\n {\n return count($this->_rows);\n }", "public function getNumberOfRows() {\n\n $query = $this->db->prepare(\"SELECT COUNT(*) FROM `products`\");\n\n try {\n\n $query->execute();\n $rows = $query->fetchColumn();\n\n return $rows;\n\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n }", "public function getRowCount() {\n return $this->statement->rowCount();\n }", "public function getRowNumber()\n {\n $this->sql_query->count($this->tableName);\n $result = $this->sql_query->getSingleResult();\n return $result[0];\n }", "public function rows(){\n return $this->rowNum(\"SELECT * FROM Anuncios\");\n }", "public function getRowCount()\n {\n return $this->statement->rowCount();\n }", "public function getCountRowsOfTable ($tableName,$fieldname='*');", "public function CountRow()\n\t{\n\treturn HDB::hus()->Hcount(\"partdata\");\n\t}", "function getRowCounter()\n {\n $this->getRows();\n return $this->row_counter;\n }", "public function getNumRows()\n {\n $db = DB::conn();\n $query = \"SELECT COUNT(*) FROM \" . self::COMMENT_TABLE . \" WHERE thread_id = ?\";\n $where_params = array($this->thread_id);\n $count = $db->value($query, $where_params);\n return $count; \n }", "function getNumRows() {\r\n return mysql_num_rows($this->m_Result);\r\n }", "abstract public function countTable();", "public function count_rows() {\r\n return $this->db->count_all_results($this->table_name);\r\n }", "public function getRowCount()\n {\n return $this->rowCount;\n }", "public function CountRow()\n\t{\n\treturn HDB::hus()->Hcount(\"jobdata\");\n\t}", "function nbrRows() {\n return mysqli_num_rows($this->result);\n }", "public function countRows()\n {\n return $this->_result !== null ? $this->_result->rowCount() : 0;\n }", "public function getNumRows(){\n return $this->numrows;\n }", "public function getNumTables() {}", "public function getNumTables() {}", "public function getNumTables() {}", "function getNumRowsData($data,$table)\n {\n $this->db->where(array('role_id'=>$data));\n return $this->db->count_all_results($table);\n }", "function get_row_count() {\n return $this->row_count;\n }", "function rows_count($table){\n\t$conn = connect();\n\t$sql = \"select count(*) as C from \".$table;//radiology_record\n\n\tif(($statement = oci_parse($conn, $sql)) == false){\n\t\t$err = oci_error($statement);\n\t\techo htmlentities($err['message']);\n\t\toci_close($conn);\n\t\treturn FALSE;\n\t}\n\n\t$exec = oci_execute($statement);\n\n\tif(!$exec){\n\t\t$err = oci_error($statement);\n\t\toci_free_statement($statement);\n\t\techo htmlentities($err['message']);\n\t\toci_close($conn);\n\t\treturn FALSE;\n\t}\n\n\t$row = oci_fetch_assoc($statement);\n\t\n\t$ret = $row['C'];\n\n\toci_free_statement($statement);\n\toci_close($conn);\n\n\treturn $ret;\n}", "function get_num_records()\n\t{\n\t\t$this->sql = 'SELECT COUNT(*) FROM ' . $this->table;\n\t\t$this->apply_filters();\n\t\treturn db_getOne($this->sql, $this->use_db);\n\t}", "public function rowCount(): int\n {\n }", "function getTotalRows()\n {\n $query = \"SELECT * FROM \" . $this->table_name;\n $result = mysqli_query($this->conn, $query);\n return mysqli_num_rows($result);\n }", "public function num_rows() {\n\t\t\treturn $this->count();\n\t\t}", "public function count_row($tabel)\n {\n return $this->db->get($tabel)->num_rows();\n }", "public function count() {\n return $this->row_count();\n }", "public function CountRow()\n\t{\n\treturn HDB::hus()->Hcount(\"mtrbundle\");\n\t}", "public function rowCount() {}", "public function count(){\n\t\t\t$query = \"SELECT COUNT(*) as total_rows FROM \" . $this->table_name . \"\";\n\t\t\n\t\t\t$stmt = $this->conn->prepare( $query );\n\t\t\t$stmt->execute();\n\t\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t\n\t\t\treturn $row['total_rows'];\n\t\t}", "public function count()\n {\n $query = \"SELECT COUNT(*) as total_rows FROM \" . $this->table_name . \"\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n return $row['total_rows'];\n }", "public function CountRow()\n\t{\n\treturn HDB::hus()->Hcount(\"mailingdataavmedgroupinvoicesrecord30\");\n\t}", "function getTableSize(){\n\t\t $db = $this->startDB();\n\t\t \n\t\t $sql = \"SELECT count(id) as IDcount\n\t\t FROM \".$this->penelopeTabID.\"\n\t\t \";\n\t\t \n\t\t $result = $db->fetchAll($sql);\n\t\t if($result){\n\t\t\t\t$this->recordCount = $result[0][\"IDcount\"]+0;\n\t\t }\n\t\t else{\n\t\t\t\treturn false;\n\t\t }\n\t }", "public function count()\n\t{\n\t\treturn (int) $this->getStatement()->rowCount();\n\t}", "public function numRows() {\n\t\treturn $this->sth->rowCount();\n\t}", "public function count(){\n $query = \"SELECT COUNT(*) as total_rows FROM \" . $this->table_name . \"\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n return $row['total_rows'];\n }", "function num_rows() {\r\n\t\treturn $this->dbh->num_rows();\r\n\t}", "public function getRowCount() {\n return $this->rowCount;\n }", "function get_row_count() {\n $query = \"SELECT COUNT(*) FROM failure;\";\n $count = select_scalar($query);\n return $count;\n}", "public function rowCount () {\n return $this->query->rowCount();\n }" ]
[ "0.81914073", "0.81560457", "0.8128445", "0.81144124", "0.8032105", "0.7970469", "0.7867709", "0.78305453", "0.78305453", "0.78171575", "0.7781033", "0.7769886", "0.7750394", "0.7736338", "0.77266306", "0.76864004", "0.76817936", "0.76749086", "0.7669943", "0.7641071", "0.7631975", "0.7623098", "0.7612782", "0.7612782", "0.7612782", "0.7596815", "0.75915676", "0.75859326", "0.7563656", "0.7548765", "0.7531569", "0.7526549", "0.752642", "0.74743044", "0.7436563", "0.7435392", "0.74245137", "0.7423622", "0.74154985", "0.74022573", "0.7397045", "0.73894465", "0.73861414", "0.7383306", "0.736967", "0.7360988", "0.7357575", "0.73506284", "0.7349351", "0.7338996", "0.73385924", "0.73385924", "0.7337421", "0.7330827", "0.73246896", "0.73224944", "0.7319238", "0.7316193", "0.7301746", "0.7296254", "0.72842485", "0.7281392", "0.7276606", "0.72709984", "0.7269641", "0.72656685", "0.72521996", "0.7247282", "0.72397625", "0.72155213", "0.7213959", "0.7213663", "0.7212581", "0.7212316", "0.7183495", "0.71802956", "0.7175572", "0.7175572", "0.7175572", "0.7168542", "0.71548104", "0.7134528", "0.7130684", "0.7121808", "0.7119596", "0.7119193", "0.710329", "0.7101138", "0.70960027", "0.7086146", "0.7085773", "0.708524", "0.7083861", "0.70784867", "0.70720387", "0.7060324", "0.70569015", "0.70496994", "0.70470375", "0.70398283", "0.70202196" ]
0.0
-1
Create a table record object
public function createRowTable($options = NULL) { $request = $this->getRequest(); $params = $request->getParams(); $table = $params['table']; //--------------------------- if ($table == 'admin.blog_posts') { return new Default_Model_DbTable_BlogPost($this->db); } if ($table == 'admin.blog_posts_tags') { return new Default_Model_DbTable_BlogPostTag($this->db); } if ($table == 'admin.blog_posts_images') { return new Default_Model_DbTable_BlogPostImage($this->db); } if ($table == 'admin.blog_posts_audio') { return new Default_Model_DbTable_BlogPostAudio($this->db); } if ($table == 'admin.blog_posts_video') { return new Default_Model_DbTable_BlogPostVideo($this->db); } if ($table == 'admin.blog_posts_locations') { return new Default_Model_DbTable_BlogPostLocation($this->db); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createRecord();", "private static function object_from_table_row($record) {\n\t // Could check that $record exists and is an array\n\t // Simple, long-form approach:\n\t $class_name = get_called_class();\n\t\t$object = new $class_name;\n\t\t\n\t\tforeach($record as $attribute=>$value){\n $attr = strtolower($attribute); //specific for Oracle, where table columns are always uppercase\n\t\t if($object->has_attribute($attr)) {\n\t\t $object->$attr = $value;\n\t\t }\n\t\t}\n\t\treturn $object;\n }", "public static function Create() {\r\n\t\t$cls = get_called_class();\r\n\t\t$model = new $cls();\r\n\t\t$record = new Dbi_Record($model, array());\r\n\t\treturn $record;\r\n\t}", "protected abstract function createTestTable();", "public function create()\n\t{\n\t\treturn $this->_adapter->createTable($this->_identifier, $this->_info, $this->_options);\n\t}", "public function createRecord(array $data);", "private function createDummyTable() {}", "function createTable($objSchema);", "private function createNewTable() {\n //generate the create table statement\n $sql = \"create table $this->tableName(\";\n $comma = \"\";\n $keyNameList = [];\n foreach ($this->columns as $column /* @var $column DbColumn */) {\n $sql .= \" $comma $column->columnName $column->dataType $column->extraStuff\";\n $comma = \",\";\n if ($column->primaryKey === true) {\n $keyNameList[] = $column->columnName;\n }\n }\n //generate the primary key list, if any are present\n $primaryKeySql = \"\";\n if (count($keyNameList) > 0) {\n $primaryKeySql = \"primary key(\";\n $comma = \"\";\n foreach ($keyNameList as $keyName) {\n $primaryKeySql = \"$primaryKeySql $comma $keyName\";\n $comma = \",\";\n }\n $primaryKeySql = \",$primaryKeySql)\";\n }\n\n //constraints\n $cSql = \"\";\n //we are assuming that there is at least one table. otherwise, the query would fail anyway.\n $comma = \",\";\n foreach ($this->constraints as $c) {\n $cSql .= \" $comma\";\n switch ($c->constraintType) {\n case \"foreign key\":\n $cSql .= \" FOREIGN KEY($c->columnName) REFERENCES $c->referencesTableName($c->referencesColumnName)\";\n break;\n }\n }\n $sql = \"$sql $primaryKeySql $cSql)\";\n return DbManager::nonQuery($sql);\n }", "public function create_record() {\n $class = get_called_class();\n\n if ($this->does_exist()) {\n return false;\n }\n\n $db = DB::connect();\n\n $attributes = '';\n $values = '';\n\n // Loop through all the attributes to get the attributes and values\n foreach (get_object_vars($this) as $key => $value) {\n // We dont add the id of the object, as it is autoincremented\n if ($value == null) {\n continue;\n }\n\n $attributes = $attributes . \" $key,\";\n\n // We cannot add an object to sql statemnt. if the value is an object, get the id of it\n if (gettype($value) == 'object') {\n $value = $value->id;\n } elseif (gettype($value) === 'string') {\n $value = \"'\" . $value . \"'\";\n }\n\n $values = $values . \" $value,\";\n\n }\n\n // Delete the last comma\n $attributes = substr_replace($attributes, \" \", -1);\n $values = substr_replace($values, \" \", -1);\n\n $sql = $db->prepare(\"INSERT INTO \" . $class . \" (\" . $attributes . \") VALUES (\" . $values . \")\");\n $sql->execute();\n\n return true;\n }", "abstract public function createTable();", "function create()\n {\n $this->definitions['columns'] =& $this->columns;\n return $this->connection->create_table($this->name, $this->definitions);\n }", "public static function createTable(){\n if (RBModel::recreateTable(get_called_class()) == false){\n return;\n }\n\n $bean = R::dispense( strtolower(get_called_class()));\n $fields = get_class_vars(get_called_class());\n \n foreach( $fields as $field=>$value){\n\n \n //ignora as variaveis que começam com _\n if ($field[0] == \"_\" || $field == \"id\"){\n continue;\n }\n\n $r = new ReflectionProperty(get_called_class(), $field);\n $comment = strtolower($r->getDocComment());\n\n if (strstr($comment,\"@varchar\")){\n $value = \"\";\n } else\n if (strstr($comment,\"@int\")){\n $value = 0;\n } else\n if (strstr($comment,\"@date\")){\n $value = \"1990-01-01\";\n } else\n if (strstr($comment,\"@datetime\")){\n $value = \"1990-01-01 00:00:00\";\n } else\n if (strstr($comment,\"@double\")){\n $value = 0.0;\n } else\n if (strstr($comment,\"@bool\")){\n $value = false;\n } else\n if (strstr($comment,\"@money\")){\n $value = \"10.00\";\n }\n \n \n $bean->$field = $value;\n }\n \n R::store($bean);\n R::trash($bean);\n }", "public function newTable($name, $attr) {\n $t= new DBTable($name);\n foreach ($attr as $key => $definitions) {\n $t->attributes[]= new DBTableAttribute(\n $key,\n $definitions[0], // Type\n TRUE,\n FALSE,\n $definitions[1] // Length\n );\n }\n $t->indexes[]= new DBIndex(\n 'PRIMARY',\n array('deviceinfo_id')\n );\n $t->indexes[0]->unique= TRUE;\n $t->indexes[0]->primary= TRUE;\n $t->indexes[]= new DBIndex(\n 'deviceinfo_I_serial',\n array('serial_number')\n );\n return $t;\n }", "public function create(Tinebase_Record_Interface $_record) {\n }", "abstract public function insertRecord($tableName, $record);", "public function createRecord()\n {\n $sql = sprintf(\n \"INSERT INTO %s (%s) values (%s)\", \"Cubans\",\n implode(\", \", array_keys($this->arrayKeysValues())),\n \":\" . implode(\", :\", array_keys($this->arrayKeysValues()))\n );\n $statement = $this->connect->prepare($sql);\n\t\t$statement->execute($this->arrayKeysValues());\n }", "function createRecord($array){\n parent::createRecord($array);\n }", "public function create()\n {\n parent::create();\n\n $sheet = $this->add_sheet();\n\n $this->add_table($sheet, $this->database, $this->generate_table());\n }", "abstract public function create_table($table_name, $fields, $primary_key = TRUE);", "public function createRecord(array $data = array());", "protected function _create()\n {\n $entry = $this->_db->createRow();\n foreach ($this->getFields() as $key => $value) {\n $entry->{$key} = $value;\n }\n return $entry->save();\n }", "public function createSchemaTable();", "function __construct(record $r, $wheres=null){\n //\n //save the values as an array of key value pairs \n $this->values= $r->values;\n //Create the parent\n $db=$r->entity->get_parent();\n parent::__construct(new table($db->name,$r->entity->name),[], [$wheres]);\n }", "function table($table, array $params = ['pk' => 'id'])\n {\n if (class_exists($table) && is_subclass_of($table, 'Objectiveweb\\DB\\Table')) {\n\n return new $table($this);\n } else {\n return new DB\\Table($this, $table, $params);\n }\n }", "protected function createEntryRecord() {\n\n\t\t$lot = CqlixHistory::getInstance()->getEntryLotRecord();\n\t\t$modelName = $this->model->getTable()->getModelName();\n\n\t\treturn HistoryEntry::create(array(\n\t\t\t'history_id' => $this->historyRecord->getId(),\n\t\t\t'Lot' => $lot,\n\t\t\t'model' => $modelName,\n\t\t\t'model_id' => $this->model->getPrimaryKeyValue(),\n\t\t\t'operation' => $this->operation,\n\t\t));\n\t}", "public static function create($data = [])\n {\n $table = new static();\n\n return $table->createRow((array) $data);\n }", "public function testCreateTable() {\r\n // Drop table\r\n $this->executeQuery('drop table POTEST');\r\n // Automatically create table\r\n $this->getPersistenceAdapter()->updateOrCreateTable('test_persistence_AbstractPersistenceAdapterTestPersistentObject');\r\n // Insert test data\r\n $uuid = 'abcdefg';\r\n $bool = true;\r\n $int = 1234567;\r\n $string = 'avorium';\r\n // Write data to the database\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$uuid.'\\','.($bool ? 1:0).','.$int.', \\''.$string.'\\')');\r\n // Read data out and cast it to persistent object\r\n $po = $this->getPersistenceAdapter()->get('test_persistence_AbstractPersistenceAdapterTestPersistentObject', $uuid);\r\n // Compare properties\r\n $this->assertEquals($uuid, $po->uuid, 'Uuid value from persistent object differs from the UUID value of the database.');\r\n $this->assertEquals($bool, $po->booleanValue, 'Boolean value from persistent object differs from the boolean value of the database.');\r\n $this->assertEquals($int, $po->intValue, 'Integer value from persistent object differs from the int value of the database.');\r\n $this->assertEquals($string, $po->stringValue, 'String value from persistent object differs from the string value of the database.');\r\n }", "public static function create($config)\n\t{\n\t\treturn self::new_instance_records()->create($config);\n\t}", "abstract protected function createEntity(array $row);", "public static function create($data)\n {\n $name = $data['name'];\n $language = $data['language'];\n $columnOption = $data['columnOption'];\n $specificColumns = $data['specificColumns'];\n return new TableType(self::generateId($name), $name, $language, $columnOption, $specificColumns);\n }", "public function __construct($table, $values = array(), $database = NULL) {\n\t\ttry {\n\t\t\tparent::__construct($database);\n\t\t\t\n\t\t\t$this->_table = new \\Bedrock\\Model\\Table(array('name' => $table));\n\t\t\t$this->_table->load();\n\t\t\t$this->_columns = $this->_table->getColumns();\n\t\t\t$this->_state = self::STATE_UNCHANGED;\n\t\t\t\n\t\t\tforeach($this->_columns as $column) {\n\t\t\t\tswitch($column->type) {\n\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_BOOL:\n\t\t\t\t\t\tif(is_bool($values[$column->name])) {\n\t\t\t\t\t\t\t$this->_data[$column->name] = $values[$column->name];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$this->_data[$column->name] = ($values[$column->name] == 1 ? true : false);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$this->_data[$column->name] = $values[$column->name];\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($column->primary_key) {\n\t\t\t\t\t$this->_key_primary = $column;\n\t\t\t\t\t\n\t\t\t\t\tif(!$values[$column->name]) {\n\t\t\t\t\t\t$this->_state = self::STATE_NEW;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Foreign Key Reference?\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('A record object could not be initialized.');\n\t\t}\n\t}", "function newRecord($vals=null){\n\t\treturn new Dataface_ViewRecord($this, $vals);\n\t}", "public function create()\n {\n $db = XenForo_Application::get('db');\n $db->query('CREATE TABLE `' . self::DB_TABLE . '`\n (`threema_id` CHAR(8) NOT NULL PRIMARY KEY,\n `public_key` CHAR(64) NOT NULL)\n ');\n }", "protected function tinydb_create($data)\n {\n $values = array();\n foreach (static::tinydb_get_table_info()->table_info() as $field => $info) {\n if (isset($data[$field])) {\n if ($this->tinydb_getset_is_method(\"create_$field\", true)) {\n $method_name = \"create_$field\";\n $values[$field] = $this->$method_name($data[$field]);\n } else {\n $values[$field] = $data[$field];\n }\n } else if ($field === 'created_at' || $field === 'modified_at') {\n $values[$field] = time();\n } else if (!$info->nullable && !$info->auto_increment && !isset($info->default)) {\n throw new \\InvalidArgumentException($field . ' is required when creating this object.');\n }\n\n // If a value was set, encode it properly\n if (isset($values[$field])) {\n $values[$field] = \\TinyDb\\Internal\\SqlDataAdapters::encode($info->type, $values[$field]);\n }\n }\n\n $id = \\TinyDb\\Query::create()->insert()->into(static::$table_name, array_keys($values))->values(array_values($values))->exec();\n\n // If the primary key is composite, generate the primary key\n if (is_array(static::tinydb_get_table_info()->primary_key)) {\n $id = array();\n foreach (static::tinydb_get_table_info()->primary_key as $field) {\n $id[$field] = $data[$field];\n }\n // If the primary key was provided, use that\n } else if (isset($values[static::tinydb_get_table_info()->primary_key])) {\n $id = $values[static::tinydb_get_table_info()->primary_key];\n }\n\n $query = \\TinyDb\\Query::create()->select('*')->from(static::$table_name);\n $query = static::tinydb_add_where_for_pkey($id, $query);\n $rows = $query->exec();\n $this->tinydb_datafill($rows[0]);\n }", "private static function instantiate($record) {\n $class_name = get_called_class();\n $object = new $class_name;\n foreach($record as $attribute=>$value) {\n if($object->has_attribute($attribute)) {\n $object->$attribute = $value;\n }\n }\n return $object;\n }", "public function actionCreateTableForRecord($args)\n\t{\n\t\t$record = $this->_getRecord($args[0]);\n\n\t\t$table = $record->getTableName();\n\t\t$indexes = $record->defineIndexes();\n\t\t$attributes = $record->getAttributeConfigs();\n\t\t$columns = array();\n\n\t\t// Add any Foreign Key columns\n\t\tforeach ($record->getBelongsToRelations() as $name => $config)\n\t\t{\n\t\t\t$columnName = $config[2];\n\n\t\t\t// Is the record already defining this column?\n\t\t\tif (isset($attributes[$columnName]))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$required = !empty($config['required']);\n\t\t\t$columns[$columnName] = array('column' => ColumnType::Int, 'required' => $required);\n\n\t\t\t// Add unique index for this column? (foreign keys already get indexed, so we're only concerned with whether\n\t\t\t// it should be unique)\n\t\t\tif (!empty($config['unique']))\n\t\t\t{\n\t\t\t\t$indexes[] = array('columns' => array($columnName), 'unique' => true);\n\t\t\t}\n\t\t}\n\n\t\t// Add all other columns\n\t\t$dbConfigSettings = array('column', 'maxLength', 'length', 'decimals', 'values', 'unsigned', 'zerofill', 'required', 'null', 'default', 'primaryKey');\n\n\t\tforeach ($attributes as $name => $config)\n\t\t{\n\t\t\t// Add (unique) index for this column?\n\t\t\t$indexed = !empty($config['indexed']);\n\t\t\t$unique = !empty($config['unique']);\n\n\t\t\tif ($unique || $indexed)\n\t\t\t{\n\t\t\t\t$indexes[] = array('columns' => array($name), 'unique' => $unique);\n\t\t\t}\n\n\t\t\t// Filter out any settings that don't influence the table SQL\n\t\t\t$settings = array_keys($config);\n\n\t\t\tforeach ($settings as $setting)\n\t\t\t{\n\t\t\t\tif (!in_array($setting, $dbConfigSettings))\n\t\t\t\t{\n\t\t\t\t\tunset($config[$setting]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$columns[$name] = $config;\n\t\t}\n\n\t\t$pk = $record->primaryKey();\n\n\t\tif (isset($columns[$pk]))\n\t\t{\n\t\t\t$columns[$pk]['primaryKey'] = true;\n\t\t\t$addIdColumn = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$addIdColumn = true;\n\t\t}\n\n\t\t// Create the table\n\t\techo \"\\n// Create the craft_{$table} table\\n\";\n\n\t\techo 'craft()->db->createCommand()->createTable(' .\n\t\t\t$this->_varExport($table).\", array(\\n\";\n\n\t\t$colNameLength = max(array_map('strlen', array_keys($columns))) + 2;\n\n\t\tforeach ($columns as $name => $config)\n\t\t{\n\t\t\techo \"\\t\".str_pad(\"'{$name}'\", $colNameLength).' => '.$this->_varExport($config).\",\\n\";\n\t\t}\n\n\t\techo '), null, '.$this->_varExport($addIdColumn).\");\\n\";\n\n\t\t// Create the indexes\n\t\tif ($indexes)\n\t\t{\n\t\t\techo \"\\n// Add indexes to craft_{$table}\\n\";\n\t\t\tforeach ($indexes as $index)\n\t\t\t{\n\t\t\t\t$columns = ArrayHelper::stringToArray($index['columns']);\n\t\t\t\t$unique = !empty($index['unique']);\n\n\t\t\t\techo 'craft()->db->createCommand()->createIndex(' .\n\t\t\t\t\t$this->_varExport($table).', ' .\n\t\t\t\t\t\"'\".implode(',', $columns).\"', \" .\n\t\t\t\t\t$this->_varExport($unique).\");\\n\";\n\t\t\t}\n\t\t}\n\n\t\treturn 1;\n\t}", "function NewRow() {\n\t\t$row = array();\n\t\t$row['unid'] = NULL;\n\t\t$row['u_id'] = NULL;\n\t\t$row['acl_id'] = NULL;\n\t\t$row['Title'] = NULL;\n\t\t$row['LV'] = NULL;\n\t\t$row['Type'] = NULL;\n\t\t$row['ResetTime'] = NULL;\n\t\t$row['ResetType'] = NULL;\n\t\t$row['CompleteTask'] = NULL;\n\t\t$row['Occupation'] = NULL;\n\t\t$row['Target'] = NULL;\n\t\t$row['Data'] = NULL;\n\t\t$row['Reward_Gold'] = NULL;\n\t\t$row['Reward_Diamonds'] = NULL;\n\t\t$row['Reward_EXP'] = NULL;\n\t\t$row['Reward_Goods'] = NULL;\n\t\t$row['Info'] = NULL;\n\t\t$row['DATETIME'] = NULL;\n\t\treturn $row;\n\t}", "protected function initDatabaseRecord() {}", "public static function new_detail_record()\n\t{\n\t\treturn new league_record_detail();\n\t}", "public function newRecord(array $row) : UserRecord\n {\n return new UserRecord($row);\n }", "public function create_a_record()\n {\n // Add a record\n factory(Email::class, 1)->create();\n\n $this->assertCount(1, Email::all());\n }", "private static function instantiate($record) {\r\n\t\t$object = new self;\r\n\t\t/*\r\n\t\t$object->id \t\t\t= $record['id'];\r\n\t\t$object->username \t\t= $record['username'];\r\n\t\t$object->password \t\t= $record['password'];\r\n\t\t$object->first_name \t= $record['first_name'];\r\n\t\t$object->last_name \t\t= $record['last_name'];*/\r\n\r\n\t\t//more dynamic approach to this\r\n\t\tforeach($record as $attribute=>$value) {\r\n\t\t\tif($object->has_attribute($attribute)) {\r\n\t\t\t\t$object->$attribute = $value;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $object;\r\n\t}", "protected function _toTableRow($tableName, array $data) // {{{\n {\n $table = $this->_getTable($tableName);\n $rowClass = $table->getRowClass();\n\n return new $rowClass(array(\n 'table' => $table,\n 'data' => $data,\n 'readOnly' => false,\n 'stored' => true, // use given data as clean data, i.e. treat\n // this record as stored in the database\n ));\n }", "function createTable($name, $rows);", "public function create($table, $parameters)\n {\n\n }", "public function testTable()\n {\n $statement = (new CreateTable($this->mockConnection));\n $return = $statement->table('name');\n $array = $statement->toArray();\n\n $this->assertInstanceOf(CreateTable::class, $return);\n $this->assertEquals([\n 'table' => 'name',\n ], $array);\n }", "private static function instantiate($record) {\r\r\n $object = new self;\r\r\n\t\tforeach($record as $attribute=>$value){\r\r\n\t\t if($object->has_attribute($attribute)) {\r\r\n\t\t $object->$attribute = $value;\r\r\n\t\t }\r\r\n\t\t}\r\r\n\t\treturn $object;\r\r\n\t}", "abstract protected function create(Blueprint $table);", "function create_table($table_name, $field_name, $field_type, $field_length){\n // $sql_chk = db::query(\"SELECT COUNT(*) AS TOTAL FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_CATALOG='\".strtoupper(db::$_dbName).\"' AND TABLE_NAME = '\".$table_name.\"'\");\n // $rec_chk = db::fetch_array($sql_chk);\n // if($rec_chk['TOTAL'] > 0)\n // {\n // echo \"<script>alert('ตาราง \".$table_name.\" ถูกใช้งานแล้ว กรุณาตรวจสอบ'); window.location.href='\".$_SERVER['HTTP_REFERER'].\"';</script>\";\n // db::db_close();\n // exit;\n // }\n\n $field_length = $field_length == \"\" ? \"\" : \"(\".$field_length.\")\";\n\n $sql_create = \" CREATE TABLE [dbo].[\".$table_name.\"]([\".$field_name.\"] \".$field_type.\" \".$field_length.\" NOT NULL, PRIMARY KEY ([\".$field_name.\"]))\";\n\n }", "protected function createTable() {\n $this->db->initializeQuery();\n $query = \"\nCREATE TABLE `items` (\n`id`INTEGER,\n`name`TEXT,\n`price`REAL,\nPRIMARY KEY(`id`)\n);\n\";\n\n $r = $this->db->q->Expr($query)->execute($this->db->c);\n \n }", "public static function new_detail_record()\n\t{\n\t\treturn new user_record_detail();\n\t}", "public function test_create_table()\n\t{\n\t\t$handler = DB::handler( 'phpunit_sqlite' );\n\t\t\n\t\t$handler->run( \"DROP TABLE IF EXISTS people\" );\n\t\t\n\t\t$handler->run( \n\t\t\"CREATE TABLE people ( \n\t\t\tid INTEGER PRIMARY KEY AUTOINCREMENT, \n\t\t\tname VARCHAR, \n\t\t\tage INTEGER\n\t\t);\");\n\t}", "private static function instantiate($record) {\n $object = new self;\n\t\tforeach($record as $attribute=>$value){\n\t\t if($object->has_attribute($attribute)) {\n\t\t $object->$attribute = $value;\n\t\t }\n\t\t}\n\t\treturn $object;\n\t}", "private function _createTablesFromRecords($records)\n\t{\n\t\tforeach ($records as $record)\n\t\t{\n\t\t\tCraft::log('Creating table for record:'. get_class($record));\n\t\t\t$record->createTable();\n\t\t}\n\t}", "private static function instantiate($record) {\r\n $object = new self;\r\n\t\t\r\n\t// More dynamic, short-form approach:\r\n\tforeach($record as $attribute=>$value){\r\n if($object->has_attribute($attribute)) {\r\n\t $object->$attribute = $value;\r\n }\r\n\t}\r\n\r\n return $object;\r\n }", "private static function instantiate($record) {\r\n $object = new self;\r\n\t\t\r\n\t// More dynamic, short-form approach:\r\n\tforeach($record as $attribute=>$value){\r\n if($object->has_attribute($attribute)) {\r\n\t $object->$attribute = $value;\r\n }\r\n\t}\r\n\r\n return $object;\r\n }", "public function createSequencerTable();", "private static function instantiate($record) {\n $object = new self;\n\t\t// Simple, long-form approach:\n\t\t// $object->id \t\t\t\t= $record['id'];\n\t\t// $object->username \t= $record['username'];\n\t\t// $object->password \t= $record['password'];\n\t\t// $object->first_name = $record['first_name'];\n\t\t// $object->last_name \t= $record['last_name'];\n\t\t\n\t\t// More dynamic, short-form approach:\n\t\tforeach($record as $attribute=>$value){\n\t\t if($object->has_attribute($attribute)) {\n\t\t $object->$attribute = $value;\n\t\t }\n\t\t}\n\t\treturn $object;\n\t}", "protected function createEntity()\n {\n return (new LogRecord());\n }", "function __construct() \n {\n // Creation de la table\n self::createTableIfNeeded();\n }", "public function addRecord()\n {\n $rec = new Record($this, true);\n $rec->markForInsert();\n $this->records[] = $rec;\n return $rec;\n }", "private function tableDataTable()\r\n\t{\r\n\t\t$source = $this->getSource();\r\n\r\n\t\t//$table = new TableExample\\DataTable();\r\n\t\t$table = new Model\\DataInsTable();\r\n\t\t$table->setAdapter($this->getDbAdapter())\r\n\t\t->setSource($source)\r\n\t\t->setParamAdapter(new AdapterDataTables($this->getRequest()->getPost()))\r\n\t\t;\r\n\t\treturn $table;\r\n\t}", "public function createDataRow()\n\t{\n\t\t$row = array() ;\n\t\tforeach( $this->values as $field=>$value )\n\t\t{\n\t\t\t$row[$field] = $this->$field ;\n\t\t}\n\t\treturn $row ;\n\t}", "function make_record($id, $patient, $doctor, $rad, $type, $p_date, $t_date, $diag, $desc){\n\t$conn = connect();\n\t$sql = \"insert into radiology_record values (\".(string)$id.\", \".(string)$patient.\", \".(string)$doctor.\", \".(string)$rad.\", '\".(string)$type.\"', TO_DATE('\".(string)$p_date.\"', 'YYYY-MM-DD'), TO_DATE('\".(string)$t_date.\"', 'YYYY-MM-DD'), '\".(string)$diag.\"', '\".(string)$desc.\"')\";\n\n\tif(($statement = oci_parse($conn, $sql)) == false){\n\t\t$err = oci_error($statement);\n\t\techo htmlentities($err['message']);\n\t\toci_close($conn);\n\t\treturn FALSE;\n\t}\n\n\t$exec = oci_execute($statement);\n\n\tif(!$exec){\n\t\t$err = oci_error($statement);\n\t\toci_free_statement($statement);\n\t\techo htmlentities($err['message']);\n\t\toci_close($conn);\n\t\treturn FALSE;\n\t}\n\toci_commit($conn);//_______________________________-----------------------------------------------------------------------------------------------\n\toci_free_statement($statement);\n\toci_close($conn);\n}", "public function newRecord(array $row) : ReferenceRecord\n {\n return new ReferenceRecord($row);\n }", "public function create()\n {\n return view(\"management.table.create\");\n }", "private static function instantiate($record) {\n\t\t// Simple long-form approach\n\t\t$obj = new self;\n\t\t// $obj->id \t\t\t= $record['id'];\n\t\t// $obj->username \t\t= $record['username'];\n\t\t// $obj->password \t\t= $record['password'];\n\t\t// $obj->first_name\t= $record['first_name'];\n\t\t// $obj->last_name \t= $record['last_name'];\n\n\t\t// More Dynamic, short form approach\n\t\tforeach($record as $attribute=>$value){\n\t\t if($obj->has_attribute($attribute)) {\n\t\t $obj->$attribute = $value;\n\t\t }\n\t\t}\n\t\treturn $obj;\n\t}", "public function testCreateTable() {\n $tableDef = [\n 'name' => 'user',\n 'columns' => [\n 'userID' => ['dbtype' => 'int', 'primary' => true, 'autoIncrement' => true],\n 'name' => ['dbtype' => 'varchar(50)'],\n 'email' => ['dbtype' => 'varchar(255)'],\n 'fullName' => ['dbtype' => 'varchar(50)', 'allowNull' => true],\n 'banned' => ['dbtype' => 'tinyint', 'default' => 0],\n 'insertTime' => ['dbtype' => 'int'],\n 'num' => ['dbtype' => 'int', 'default' => 0]\n ],\n 'indexes' => [\n ['columns' => ['name'], 'type' => Db::INDEX_UNIQUE],\n ['columns' => ['email']],\n ['columns' => ['insertTime']]\n ]\n ];\n\n self::$db->defineTable($tableDef);\n\n $r = self::$db->fetchTableDef('user');\n $this->assertIsArray($r);\n\n return $r;\n }", "public function createTable($tableName, $schemaName, $definition){ }", "protected function _getTable()\n\t{\n\t\t$tableName = substr( get_class($this), strlen(self::PREFIX) );\n\t\t$tableClass = self::PREFIX . 'DbTable_' . $tableName;\n\t\t$table = new $tableClass();\n\t\treturn $table;\n\t}", "protected function createRecord($name, $namespace = null)\n {\n $object = new $name;\n \n if ($namespace === null)\n {\n $namespace = $this->getRecordNamespace();\n }\n\n $object['namespace'] = $namespace;\n\n return $object;\n }", "public abstract function getCreateTable(Table $table, $config);", "function createTable($tablename, $fields, $types, $overwrite = FALSE) {\r\n //CREATE TABLE `TableName` (`FieldName1` DATE, `FieldName2` VARCHAR (50), `FieldName3` TEXT)\r\n $params = \"\";\r\n if (count($fields) == count($types)) {\r\n $params .= \"(\";\r\n $i = 0;\r\n foreach ($fields as $field) {\r\n $params .= $field . \" \" . $types[$i];\r\n if ($i < (count($types) - 1)) {\r\n $params .= \",\";\r\n }\r\n $i++;\r\n }\r\n $params .= \");\";\r\n }\r\n if ($overwrite == TRUE) {\r\n $query = \"drop table if exists $tablename;\";\r\n $this->makeQuery($query);\r\n }\r\n\r\n $query = \"CREATE TABLE $tablename \" . $params;\r\n //echo $query.'<br/>';\r\n return $this->makeQuery($query);\r\n }", "function ActiveRecord($table)\n\t\t{\n\t\t\tparent::Model();\n\t\t\t$this->record = $table;\n\t\t}", "function table()\n {\n return array('pattern' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL,\n 'created' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL);\n }", "public function makeTable($name)\n {\n $table = new Table($this);\n $table->setName($name);\n return $table;\n }", "function create($table, $data)\n {\n $current = get_instance();\n $current->db->insert($table, $data);\n return $current->db->insert_id();\n }", "function table ( $arguments = \"\" ) {\n $arguments = func_get_args();\n $rc = new ReflectionClass('ttable');\n return $rc->newInstanceArgs( $arguments ); \n}", "function mscaffolding_create_table($name, $data)\n\t{\n\t\t$query_string = \"CREATE TABLE `\" . lconf_get(\"db_name\") . \"`.`\" . $name . \"` (`id` INT NOT NULL AUTO_INCREMENT,\";\n\n\t\tfor ($i = 0; $i < count($data) / 2; $i++)\n\t\t{\n\t\t\t$query_string .= \"`\" . $data[\"name\" . $i] . \"`\" . mscaffolding_get_type($data[\"type\" . $i]);\n\t\t}\n\n\t\t$query_string .= \" PRIMARY KEY ( `id` )) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_slovenian_ci\";\n\n\t\treturn ldb_query($query_string);\n\t}", "function NewRow() {\n\t\t$row = array();\n\t\t$row['id'] = NULL;\n\t\t$row['id_sector'] = NULL;\n\t\t$row['id_actividad'] = NULL;\n\t\t$row['id_categoria'] = NULL;\n\t\t$row['apellidopaterno'] = NULL;\n\t\t$row['apellidomaterno'] = NULL;\n\t\t$row['nombre'] = NULL;\n\t\t$row['fecha_nacimiento'] = NULL;\n\t\t$row['sexo'] = NULL;\n\t\t$row['ci'] = NULL;\n\t\t$row['nrodiscapacidad'] = NULL;\n\t\t$row['celular'] = NULL;\n\t\t$row['direcciondomicilio'] = NULL;\n\t\t$row['ocupacion'] = NULL;\n\t\t$row['email'] = NULL;\n\t\t$row['cargo'] = NULL;\n\t\t$row['nivelestudio'] = NULL;\n\t\t$row['id_institucion'] = NULL;\n\t\t$row['observaciones'] = NULL;\n\t\t$row['id_centro'] = NULL;\n\t\treturn $row;\n\t}", "protected function _createKey() {\n return new PapayaDatabaseRecordKeyFields(\n $this,\n $this->_tableName,\n array('source_id', 'target_id')\n );\n }", "public static function instantation($the_record){\n\n // can be used to retrieve a string with the name of the called class and static:: introduces its scope.\n $calling_class = get_called_class();\n\n $the_object = new $calling_class;\n\n\n // doing a loop to get all of the values in the object ]\n foreach($the_record as $key => $value) {\n\n if($the_object->has_the_key($key)){\n $the_object->$key = $value;\n \n }\n }\n\n return $the_object;\n }", "public function create($data)\n {\n try {\n $record = $this->model->create($data);\n } catch (\\Exception $e) {\n throw $e;\n }\n\n return $record;\n }", "public function create_table() {\n\n\t\tglobal $wpdb;\n\n\t\t$table_name \t = $this->table_name;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\n\t\t$query = \"CREATE TABLE {$table_name} (\n\t\t\tid bigint(10) NOT NULL AUTO_INCREMENT,\n\t\t\tname text NOT NULL,\n\t\t\tdate_created datetime NOT NULL,\n\t\t\tdate_modified datetime NOT NULL,\n\t\t\tstatus text NOT NULL,\n\t\t\tical_hash text NOT NULL,\n\t\t\tPRIMARY KEY id (id)\n\t\t) {$charset_collate};\";\n\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\tdbDelta( $query );\n\n\t}", "protected function createNew() {\n $this->db->insert($this->tableName, $this->mapToDatabase());\n $this->id = $this->db->insert_id();\n }", "function payment_create($con, $data, $params, $types, $table_name, $primary_key, $foreign_key) {\n\n /* Checking if the data and params are matching */\n $combined_param = '';\n $comma = ',';\n $combined_param = check_attributes($data, $params, $types, $comma, $primary_key, $foreign_key, 0);\n if($combined_param != '') {\n /* If the parameter is found, then combined param will not be empty and filled with data types and variable names */\n /* create table query */\n $create_query = \"CREATE TABLE IF NOT EXISTS \".$table_name. ' ('.$combined_param.' )';\n if($con->query($create_query)) {\n /* Creating the Payment Main table */\n return 1;\n } else {\n return 0;\n }\n } else {\n /* returning false when the attributes count doesn't match */\n return 0;\n }\n}", "protected function tableModel()\n {\n }", "public static function instantation($the_record){ //Its the same as $row\n //$the_object = new self; // Bse of inheritance problem ,this as to change in late static\n $calling_class = get_called_class();\n $the_object = new $calling_class;\n \n \n// $the_object->id =$found_user['id'];\n// $the_object->username =$found_user['username'];\n// $the_object->password =$found_user['password'];\n// $the_object->First_Name =$found_user['first_name'];\n// $the_object->Last_Name =$found_user['last_name'];\n// \n foreach ($the_record as $the_attribute =>$value){\n if ($the_object->has_the_attribute($the_attribute)){\n \n $the_object->$the_attribute=$value; // Value is attribute in database\n } \n }\n return $the_object; \n \n }", "public function create() {\n\t\t$columns = implode(', ', array_keys($this->params));\n\t\t$bindings = substr(str_repeat(', ?', count($this->params)), 2);\n\t\t$sql = 'INSERT INTO ' . static::$table . ' (' . $columns . ') VALUES (' . $bindings . ');';\n\t\t$query = DBH()->prepare($sql);\n\t\t$query->execute(array_values($this->params));\n\t}", "public function create() {\n global $db;\n $this->_precreate();\n $sql_keys = ''; $sql_values = '';\n $data = array();\n foreach($this->_magicProperties as $key=>$value)\n {\n $sql_keys .= \"`\".addslashes($key).\"`,\";\n $sql_values .= \"?,\";\n $data[] = $value;\n }\n $sql_keys = substr($sql_keys, 0, -1);\n $sql_values = substr($sql_values, 0, -1);\n\n $query = \"INSERT INTO {$this->table} ($sql_keys) VALUES ($sql_values);\";\n $result = $db->query($query,$data);\n if (!isset($this->_magicProperties['id']) || !$this->_magicProperties['id']) {\n $id = $db->lastInsertId();\n $this->{'set'.$this->id_field}($id);\n }\n $this->loaded = true;\n $this->_postcreate($result);\n return $this->id;\n }", "public function __construct($data=null){\r\n\t\t// Load Table\r\n\t\t$class = get_class($this);\r\n\t\t$this->definition = DBObjectDefinition::getByClassName($class,$this);\r\n\t\t\r\n\t\t// Process Input\r\n\t\t$dataLoaded = false;\r\n\t\tif (!is_null($data)){\r\n\t\t\tif ($data instanceof SQLQueryResultRow){\r\n\t\t\t\tif (!$this->loadFromSqlResult($data)){\r\n\t\t\t\t\tthrow new DBObjectException(get_class(),'Unable to load '.get_class($this).' object from SQL result row');\r\n\t\t\t\t}\r\n\t\t\t\t$dataLoaded = true;\r\n\t\t\t} elseif (is_array($data) || $data instanceof ArrayAccess) {\r\n\t\t\t\t$dataLoaded = $this->loadFromQuery($data);\r\n\t\t\t} elseif (is_numeric($data)) {\r\n\t\t\t\t$data = (int)$data;\r\n\t\t\t\t$pk = $this->getTable()->getPrimaryKey();\r\n\t\t\t\tif ($pk->size()==1){\r\n\t\t\t\t\t$id = $data;\r\n\t\t\t\t\t$data = array(ArrayUtils::getFirst($pk->getColumns())=>$id);\r\n\t\t\t\t\t$dataLoaded = $this->loadFromQuery($data);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow new DBObjectException(get_class(),'Attempted to create '.get_class($this).' object from ID, but primary key contains multiple fields: '.$data);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tthrow new DBObjectException(get_class(),'Attempted to create '.get_class($this).' object from unexpected data: '.var_export($data,true).']');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Load Data\r\n\t\tif ($dataLoaded){\r\n\t\t\t$this->new = false;\r\n\t\t\t$this->hasChanged = false;\r\n\t\t\t$this->values = SQLQueryResultRow::wrap($this->values);\r\n\t\t} else {\r\n\t\t\t$this->values = array();\r\n\t\t\tforeach ($this->definition->getColumns() as $name=>$column){\r\n\t\t\t\t$this->values[$name] = new SQLValue($column,$column->getDefaultValue());\r\n\t\t\t}\r\n\t\t\t$this->values = SQLQueryResultRow::wrap($this->values);\r\n\t\t\t\r\n\t\t\t// If a query was specified, but data has not been loaded from it because the record doesn't exist, load that information\r\n\t\t\tif (is_array($data)){\r\n\t\t\t\tforeach ($data as $field=>$value){\r\n\t\t\t\t\t$this->values[$field]->setValue($value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "private function addRecord( $objTable ){\r\n\r\n\t\t\t$tableName = $objTable->table_name;\r\n\t\t\tunset( $objTable->table_name );\r\n\r\n\t\t\tforeach( $objTable as $key => $value ){\r\n\t\t\t\t$objTable->$key = addslashes(trim($value));\r\n\t\t\t}\r\n\t\t\t$this->post( $objTable, $tableName );\r\n\r\n\t\t}", "function createTableModel()\r\n {\r\n?>\r\n // table model\r\n var <?php echo $this->Name; ?>_tableModel = new qx.ui.table.SimpleTableModel();\r\n <?php\r\n if ($this->owner!=null)\r\n {\r\n ?>\r\n <?php echo $this->owner->Name.\".\".$this->Name; ?>_tableModel=<?php echo $this->Name; ?>_tableModel;\r\n <?php\r\n }\r\n ?>\r\n<?php\r\n }", "function ADOdb_Active_Record_Factory($classname, $tablename = null) {\n // create the class\n eval('class ' . $classname . ' extends ADOdb_Active_Record{}');\n\n if ($tablename != null) {\n return new $classname($tablename);\n } else {\n return new $classname;\n }\n }", "public static function createGooglePlayPaymentHistoryTable()\n\t{\n\t\treturn TDOTableManager::createGenericTable(\"CREATE TABLE tdo_googleplay_payment_history(userid VARCHAR(36) NOT NULL, product_id VARCHAR(128) NOT NULL, purchase_timestamp INT NOT NULL DEFAULT 0, expiration_timestamp INT NOT NULL DEFAULT 0, INDEX tdo_googleplay_payment_history_userid (userid))\");\n\t}", "public function newTable($items);", "public function createTable()\n\t{\n\t\tphpCAS::traceBegin();\n\n\t\t// initialize the PDO object for this method\n\t\t$pdo = $this->getPdo();\n\t\t$this->setErrorMode();\n\n\t\ttry {\n\t\t\t$pdo->beginTransaction();\n\n\t\t\t$query = $pdo->query($this->_createTableSQL());\n\t\t\t$query->closeCursor();\n\n\t\t\t$pdo->commit();\n\t\t}\n\t\tcatch(PDOException $e) {\n\t\t\t// attempt rolling back the transaction before throwing a phpCAS error\n\t\t\ttry {\n\t\t\t\t$pdo->rollBack();\n\t\t\t}\n\t\t\tcatch(PDOException $e) {}\n\t\t\tphpCAS::error('error creating PGT storage table: ' . $e->getMessage());\n\t\t}\n\n\t\t// reset the PDO object\n\t\t$this->resetErrorMode();\n\n\t\tphpCAS::traceEnd();\n\t}", "private static function instantiate($record) {\n\t\t// Could check that $record exists and is an array\n\t\t// Simple, long-form approach:\n\t\t$object = new self;\n\t\t// $object->id \t\t = $record[\"id\"];\n\t\t// $object->username = $record[\"username\"];\n\t\t// $object->password = $record[\"password\"];\n\t\t// $object->first_name = $record[\"first_name\"];\n\t\t// $object->last_name = $record[\"last_name\"];\n\t\t// return $object;\n\t\n\t\t// More dynamic, short-form approach:\n\t\tforeach ($record as $attribute => $value) {\n\t\t\tif ($object->has_attribute($attribute)) {\n\t\t\t\t$object->$attribute = $value;\n\t\t\t}\n\t\t}\n\t\treturn $object;\n\t}", "function NewRow() {\n\t\t$row = array();\n\t\t$row['row_id'] = NULL;\n\t\t$row['auc_date'] = NULL;\n\t\t$row['auc_number'] = NULL;\n\t\t$row['auc_place'] = NULL;\n\t\t$row['start_bid'] = NULL;\n\t\t$row['close_bid'] = NULL;\n\t\t$row['auc_notes'] = NULL;\n\t\t$row['total_sack'] = NULL;\n\t\t$row['total_netto'] = NULL;\n\t\t$row['total_gross'] = NULL;\n\t\t$row['auc_status'] = NULL;\n\t\t$row['rate'] = NULL;\n\t\treturn $row;\n\t}" ]
[ "0.7799738", "0.69427574", "0.6865926", "0.6822653", "0.672537", "0.66169614", "0.65882516", "0.6585383", "0.6583678", "0.6571775", "0.64920217", "0.6465001", "0.6451912", "0.6439331", "0.6430276", "0.635564", "0.63192564", "0.62920046", "0.62826157", "0.6231155", "0.6229715", "0.6219644", "0.6203434", "0.6198958", "0.61497307", "0.6121783", "0.61120135", "0.61050344", "0.6060995", "0.60574114", "0.60565597", "0.60349846", "0.5965913", "0.59553784", "0.5952914", "0.59517044", "0.5944611", "0.5923758", "0.590089", "0.58977866", "0.5887809", "0.5872133", "0.5867287", "0.58672327", "0.5866718", "0.58625495", "0.58598423", "0.5854751", "0.5834025", "0.5833721", "0.58312774", "0.58295375", "0.5809385", "0.5806543", "0.5786622", "0.5786337", "0.5786337", "0.5781096", "0.5778849", "0.57710874", "0.5765301", "0.5759236", "0.5756703", "0.57542914", "0.57273763", "0.57237154", "0.5718096", "0.57178414", "0.5715594", "0.5710212", "0.5707977", "0.5701196", "0.56955415", "0.5691678", "0.5691298", "0.5690952", "0.56895876", "0.5686201", "0.56810135", "0.5680517", "0.566808", "0.5667038", "0.5666927", "0.5666323", "0.565529", "0.56508267", "0.5646138", "0.5642532", "0.56384706", "0.5628065", "0.56238353", "0.5623817", "0.5621467", "0.5620058", "0.5613305", "0.56074166", "0.560431", "0.5601478", "0.5600931", "0.5589246" ]
0.5892662
40
Get a table records
public function getRowsArraysTable($options = NULL) { $newRows = array(); $sortRows = array(); $newRow = array(); //------------------- // Получим параметры запроса $request = $this->getRequest(); $params = $request->getParams(); $table = $params['table']; $fromPage = $options['fromPage']; $toPage = $options['toPage']; if ($options['sortColumn']) { $sortColumn = $options['sortColumn']; } else { $sortColumn = 'id'; } $ascDescFlg = $options['ascDescFlg']; $count = 1; if ($table == 'admin.blog_posts') { // Получим все строки сообщений с учетом параметров $rows = Default_Model_DbTable_BlogPost::GetPosts_Array($this->db, $options); foreach ($rows as $row) { foreach ($row as $key => $value) { if (is_array($value)) { } else { $newRow[$key] = $value; } } $newRows[] = $newRow; $newRow = array(); } return $newRows; } if ($table == 'admin.blog_posts_tags') { // Получим все строки сообщений с учетом параметров $options['offset'] = NULL; $options['limit'] = NULL; $options['sort'] = FALSE; $rows = Default_Model_DbTable_BlogPost::GetPosts_Array($this->db, $options); foreach ($rows as $row) { foreach ($row as $key => $value) { if (is_array($value)) { if ($key == '_tags_') { $arrValues = $value; $arrPost = $newRow; foreach ($arrValues as $arrValue) { $newRow = $arrValue + $arrPost + array( 'sortColumn' => $sortColumn, 'ascDescFlg' => $ascDescFlg ); $newRows[] = $newRow; } } } else { if (($sortColumn !== 'id' && $key == $sortColumn) || $key == 'title') { $newRow[$key] = $value; } } } } usort($newRows, array("Default_Model_DatabaseObject", "_SortProfiles_Arrays")); foreach ($newRows as $newRow) { if ($count >= $fromPage && $count <= $toPage) { $sortRows[] = $newRow; } $count++; } return $sortRows; } if ($table == 'admin.blog_posts_images') { // Получим все строки сообщений с учетом параметров $options['offset'] = NULL; $options['limit'] = NULL; $options['sort'] = FALSE; $rows = Default_Model_DbTable_BlogPost::GetPosts_Array($this->db, $options); foreach ($rows as $row) { foreach ($row as $key => $value) { if (is_array($value)) { if ($key == '_images_') { $arrValues = $value; $arrPost = $newRow; foreach ($arrValues as $arrValue) { $newRow = $arrValue + $arrPost + array( 'sortColumn' => $sortColumn, 'ascDescFlg' => $ascDescFlg ); $newRows[] = $newRow; } } } else { if (($sortColumn !== 'id' && $key == $sortColumn) || $key == 'title') { $newRow[$key] = $value; } } } } usort($newRows, array("Default_Model_DatabaseObject", "_SortProfiles_Arrays")); foreach ($newRows as $newRow) { if ($count >= $fromPage && $count <= $toPage) { $sortRows[] = $newRow; } $count++; } return $sortRows; } if ($table == 'admin.blog_posts_audio') { // Получим все строки сообщений с учетом параметров $options['offset'] = NULL; $options['limit'] = NULL; $options['sort'] = FALSE; $rows = Default_Model_DbTable_BlogPost::GetPosts_Array($this->db, $options); foreach ($rows as $row) { foreach ($row as $key => $value) { if (is_array($value)) { if ($key == '_audio_') { $arrValues = $value; $arrPost = $newRow; foreach ($arrValues as $arrValue) { $newRow = $arrValue + $arrPost + array( 'sortColumn' => $sortColumn, 'ascDescFlg' => $ascDescFlg ); $newRows[] = $newRow; } } } else { if (($sortColumn !== 'id' && $key == $sortColumn) || $key == 'title') { $newRow[$key] = $value; } } } } usort($newRows, array("Default_Model_DatabaseObject", "_SortProfiles_Arrays")); foreach ($newRows as $newRow) { if ($count >= $fromPage && $count <= $toPage) { $sortRows[] = $newRow; } $count++; } return $sortRows; } if ($table == 'admin.blog_posts_video') { // Получим все строки сообщений с учетом параметров $options['offset'] = NULL; $options['limit'] = NULL; $options['sort'] = FALSE; $rows = Default_Model_DbTable_BlogPost::GetPosts_Array($this->db, $options); foreach ($rows as $row) { foreach ($row as $key => $value) { if (is_array($value)) { if ($key == '_video_') { $arrValues = $value; $arrPost = $newRow; foreach ($arrValues as $arrValue) { $newRow = $arrValue + $arrPost + array( 'sortColumn' => $sortColumn, 'ascDescFlg' => $ascDescFlg ); $newRows[] = $newRow; } } } else { if (($sortColumn !== 'id' && $key == $sortColumn) || $key == 'title') { $newRow[$key] = $value; } } } } usort($newRows, array("Default_Model_DatabaseObject", "_SortProfiles_Arrays")); foreach ($newRows as $newRow) { if ($count >= $fromPage && $count <= $toPage) { $sortRows[] = $newRow; } $count++; } return $sortRows; } if ($table == 'admin.blog_posts_locations') { // Получим все строки сообщений с учетом параметров $options['offset'] = NULL; $options['limit'] = NULL; $options['sort'] = FALSE; $rows = Default_Model_DbTable_BlogPost::GetPosts_Array($this->db, $options); foreach ($rows as $row) { foreach ($row as $key => $value) { if (is_array($value)) { if ($key == '_locations_') { $arrValues = $value; $arrPost = $newRow; foreach ($arrValues as $arrValue) { $newRow = $arrValue + $arrPost + array( 'sortColumn' => $sortColumn, 'ascDescFlg' => $ascDescFlg ); $newRows[] = $newRow; } } } else { if (($sortColumn !== 'id' && $key == $sortColumn) || $key == 'title') { $newRow[$key] = $value; } } } } usort($newRows, array("Default_Model_DatabaseObject", "_SortProfiles_Arrays")); foreach ($newRows as $newRow) { if ($count >= $fromPage && $count <= $toPage) { $sortRows[] = $newRow; } $count++; } return $sortRows; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllRecords();", "public function getRecords($table, $where=false){// method getRecords body start\n\t\t\n\t\tif($where){\n\t\t\t$where = $this->makeWhere($where);\n\t\t}\n\t\t$query = \"SELECT * FROM $table \".$where;\n\t\treturn $this->exeQuery($query);\n\t\t\n\t}", "function getData($table)\n {\n $record = array();\n $sql = \"select * from $table\";\n $result = $this->conn->prepare($sql);\n $result->execute();\n if ($result->rowCount() > 0) {\n while ($row = $result->fetch(PDO::FETCH_ASSOC)) {\n $record[] = $row;\n }\n return $record;\n } else {\n return $record = false;\n }\n $this->conn = null;\n }", "public function get_records(){\n\t\t$records = array();\n\t\t$this->do_db();\n\t\t$tmps\t = $this->last_result;\n\t\t$db\t\t = $this->db;\n\t\twhile($record\t = $db->fetch_array($tmps)){\n\t\t\t$records[] = $record;\n\t\t}\n\t\treturn $records;\n\t}", "public function getRecords()\n {\n $result = $this->fetchAll($this->select()->order('id ASC'))->toArray();\n return $result;\n }", "public function get(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n\t\t\t\t\t ;\n return $this->db->getRows(array(\"where\"=>$condition,\"return_type\"=>\"single\"));\n\t\t\t\t\t }", "function getListOfRecords(){\n // the orders will be display and the receipts from there \n \n $element = new Order();\n \n $receipts_filter_orders = cisess(\"receipts_filter_orders\");\n \n if ($receipts_filter_orders===FALSE){\n $receipts_filter_orders = \"Abierta\"; // default to abiertas\n }\n \n if (!empty($receipts_filter_orders))\n {\n $element->where(\"status\",$receipts_filter_orders);\n }\n \n \n $element->order_by(\"id\",\"desc\");\n \n $all = $element->get()->all;\n //echo $element->check_last_query();\n ///die();\n $table = $this->entable($all);\n \n return $table;\n \n \n }", "function getallrecord()\n\t{\n\t\treturn $this->db->get(\"tblteman\");\n\t\t// fungsi get(\"namatable\") adalah active record ci\n\t}", "function get_all_records(){\n\t\tglobal $db;\n\t\t$sql=\"SELECT * FROM $this->table order by id asc\";\n\t\t$db->query($sql);\n\t\t$row=$db->fetch_assoc_all();\n\t\treturn $row;\n\t}", "public function getRows();", "public function getRows();", "public function table_get_all($table);", "protected function tableRows()\n {\n $tbody = DB::table($this->argument('table'))->get();\n\n return $tbody->map(function ($field) {\n return $this->selectRowByField($field);\n });\n }", "abstract public function get_rows();", "function get()\n\t{\n\t\tif (empty($this->use_db)) $this->use_db = false; //use default connection\n\t\t$this->sql = 'SELECT * FROM ' . $this->table;\n\t\t$this->apply_filters();\n\t\t$this->apply_sort();\n\t\treturn $this->fetch_records();\n\t}", "public function getRecords(){\n // Get the sql statement\n $sql = $this->getSql($this->filters);\n // Prepare the query\n $stmt = $this->db->query($sql);\n // Fetch values from PDO array\n return $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n }", "public function fetchRecords() {\n return self::all();\n }", "public function get(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n\t\t\t\t\t $condition = array(\"ide\" =>$this->ide);\n return $this->db->getRows(array(\"where\"=>$condition,\"return_type\"=>\"single\"));\n\t\t\t\t\t }", "function getallrecordbytablename($tablename,$data,$limit = '', $offset = '', $sortby = '', $orderby = '',$conditionarray='')\n {\n \n $this->db->order_by($sortby,$orderby);\n\t\t\n //Setting Limit for Paging\n if( $limit != '' && $offset == 0)\n { $this->db->limit($limit); }\n else if( $limit != '' && $offset != 0)\n {\t$this->db->limit($limit, $offset);\t}\n\n //Executing Query\n $this->db->select($data);\n $this->db->from($tablename);\n if($conditionarray!='')\n {\n $this->db->where($conditionarray);\n }\n $query = $this->db->get();\n if ($query->num_rows() > 0)\n {\n return $query->result_array();\n }\n else\n {\n return array();\n }\n \n }", "public function getQueryRecords()\n {\n return $this->get(self::_QUERY_RECORDS);\n }", "function getRecords($limit = false)\n\t{\n\t\tif ($limit !== false)\n\t\t\t$this->setParam(\"limit\", $limit);\n\n\t\t$this->table->getRecords();\n\t}", "function getAllRecords($tableName, $dbName){\n\n\n\t$allRecords = dbMassData(\"SELECT * FROM $dbName.$tableName\");\n\n\treturn $allRecords;\n}", "public function get(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n\t\t\t\t\t $condition = array(\"IDP\" =>$this->IDP);\n return $this->db->getRows(array(\"where\"=>$condition,\"return_type\"=>\"single\"));\n\t\t\t\t\t }", "public static function getAll(){\n\t\t$sql = \"select * from \".self::$tablename;\n\t\t$query = Executor::doit($sql);\n\t\treturn Model::many($query[0],new TemparioData());\n\t}", "public function getTables();", "public function getTables();", "public function getTables();", "abstract protected function getRows();", "public function getAllRecordsFromTable($tableName, $pkField) {\n $result = $this->get($tableName, array($pkField, '>', 0));\n //var_dump($result);\n if (!empty($result)) {\n if ($result->count()) {\n return $result;\n }\n }\n return false;\n }", "function records( $table_name, $where, $order_by = '', $output = OBJECT ) {\n global $wpdb;\n\n $where = self::where( $where );\n\n $sql = <<< SQL\nSELECT * FROM `{$table_name}`\n{$where}\nORDER BY {$order_by}\nSQL;\n $result = $wpdb->get_results( $sql, $output );\n\n return $result;\n\n }", "public function getAll()\n {\n $sql = \"SELECT * FROM `%s`\";\n $this->_sql[] = sprintf($sql, $this->_table);\n $this->_parameters[] = array();\n return $this->run();\n }", "public function liste(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"many\"));\n\t\t\t\t\t }", "public function liste(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"many\"));\n\t\t\t\t\t }", "public function liste(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"many\"));\n\t\t\t\t\t }", "public function getCustomTableData()\n {\n $connection = $this->resourceConnection->getConnection();\n $select = $connection->select();\n $select->from(self::TABLE_NAME, ['table_id', 'name', 'content']);\n $result = $connection->fetchAll($select);\n\n return $result;\n }", "function getRows($table_name)\n {\n $sql = sprintf(\"SELECT * FROM %s\", $table_name);\n $rows = array();\n\n $result = $this->query($sql);\n while($row = $result->fetchArray(SQLITE3_ASSOC))\n {\n array_push($rows, $row);\n }\n\n return $rows;\n }", "public function getAll()\n\t{\n\t\t$args = array('order' => 't.id');\n \t$records = $this->record->findAll($args);\n \treturn $this->model->populateModels($records, 'id');\n\t}", "public function records() { return $this->_m_records; }", "public function &getTables();", "public function get($table);", "function getAllData($table){\n\t\ttry {\n\t\t\t$sql = \"SELECT * FROM $table\";\n\t\t\t$query = $this->executeQuery($sql);\n\t\t\t$list = $query->fetchAll(PDO::FETCH_ASSOC);\n\t\t}catch(Exception $e){\n\t\t\t$this->logger->error($sql, $e->getMessage());\n\t\t\tthrow $e;\n\t\t}\n\t\treturn $list;\n\t}", "function getRecords($columnParameterArray){\n\t\t\t\n\t\t}", "public function getDataFromDb($table) {\r\n $sql_query = \"SELECT * FROM $table\";\r\n $result = $this->mysqli->query($sql_query);\r\n if ($result->num_rows > 0) {\r\n while(($resultArray[] = $result->fetch_assoc())|| array_pop($resultArray));\r\n $result->free();\r\n return $resultArray;\r\n }\r\n }", "public function getAllData($table_name){\n return $this->getStatement(\"select * from \".$table_name);\n }", "public function getRecords()\n {\n return $this->records;\n }", "public function getRecords()\n {\n return $this->records;\n }", "public static function getMultiRecord(){\n $sql = \"SELECT user_id, user_name, email, password, phone, address, type, signup_day, del_flag FROM user_t\";\n $records = Database::currentDb()->getMultiRecord($sql, $total_row);\n return $records;\n }", "public function tblGetRecords($strWhere = \"\") {\n if(!$this->blnGoodToGo()) return;\n $arrRecords = $this->arrGetRecords($strWhere);\n if(is_array($arrRecords)) {\n $tbl = new DbTable($arrRecords);\n }\n if($this->intCountErrors($tbl,true)) return false;\n return $tbl;\n }", "function getList()\n {\n global $db;\n $sql = \" select * from \".$this->table.\" \"; \n $db->SetFetchMode(ADODB_FETCH_ASSOC);\n\t\t$info = $db->execute($sql);\n \t\t$item = $info->GetRows();\t\n\t\treturn $item;\n }", "public function getRecord($connection,$tableName){\n $sql = \"SELECT * FROM $tableName\";\n $pst = $connection->prepare($sql);\n $pst->execute();\n// check if records are there or not\n if($pst!=null){\n// if resultset is not empty return an array\n return $pst;\n\n }\n }", "public function getRecord();", "public abstract function fetchAll($table);", "function find($table, $where=\"1=1\", $fields=\"*\", $orderBy=\"1\"){\n\t\tActiveRecord::sql_item_sanizite($table);\n\t\tActiveRecord::sql_sanizite($fields);\n\t\tActiveRecord::sql_sanizite($orderBy);\n\t\t$q = $this->query(\"select $fields from $table where $where order by $orderBy\");\n\t\t$results = array();\n\t\twhile($row=$this->fetch_array($q)){\n\t\t\t$results[] = $row;\n\t\t}\n\t\treturn $results;\n\t}", "function getRecords($table, $fields=\"\", $condition=\"\", $orderby=\"\", $single_row=false) //$condition is array \n\t{\n//\t\tif($fields != \"\")\n//\t\t{\n//\t\t\t$this->db->select($fields);\n//\t\t}\n\n $rs = $this->db->table($table);\n\n\t\tif($orderby != \"\")\n\t\t{\n $rs->orderBy($orderby,'DESC');\n\t\t}\n\n\t\tif($condition != \"\")\n\t\t{\n\t\t\t$rs->getWhere($condition);\n\t\t}\n\t\t\n\t\tif($single_row)\n\t\t{ \n\t\t\treturn $rs->get()->getResultArray();\n\t\t}\n\t\treturn $rs->get()->getResultArray();\n\n\t}", "public function table(): Query\n {\n return $this->database->records();\n }", "public static function findAll()\n\t\t{\n\t\t\t$tb = self::get('tabla') ;\n\t\t\t\n\t\t\treturn Database::getInstance()\n\t\t\t\t\t->query(\"SELECT * FROM $tb ;\")\n\t\t\t\t\t->getObjects(get_called_class()) ;\n\t\t}", "function get_records($recordType, $params = array(), $limit = 10)\n{\n return get_db()->getTable($recordType)->findBy($params, $limit);\n}", "function get_usersrecords() {\n\t\t$this->db->select('ut.users_id, ut.message, u.users_fname, u.users_lname,u.users_email_id');\n\t\t$this->db->from('user_tickets ut');\n\t\t$this->db->join('users u', 'u.users_id = ut.users_id');\n\t\t$query = $this->db->get();\n\n\t\t$collection = $query->result();\n\t\treturn $collection;\n\t}", "public function get_row();", "public function records() : array {\n return $this->records;\n }", "public static function get_all_records() {\n\t\tglobal $wpdb;\n\n\t\t$query = 'select * from ' . self::TABLE_NAME . ' order by email asc;';\n\n\t\t$results = $wpdb->get_results( $query, ARRAY_A );\n\n\t\tif ( ! is_array( $results ) ) {\n\t\t\t$results = array();\n\t\t\treturn $results;\n\t\t}\n\n\t\treturn $results;\n\t}", "public function fetchAll()\n {\n // LEFT JOIN patient ON patient.patientId = doc_calendar.patientId\n $select = new \\Zend\\Db\\Sql\\Select ;\n $select->from('doc_calendar');\n $user_session = new Container('user');\n\n $select->where(\" doc_calendar.doctorId = '{$user_session['user']->getId()}'\");\n $select->join(array(\"p\" => \"patient\"), \"doc_calendar.patientId = p.patientId\");\n\n $dbAdapter = $this->tableGateway->getAdapter();\n $statement = $dbAdapter->createStatement();\n\n $select->prepareStatement($dbAdapter, $statement);\n $driverResult = $statement->execute(); // execute statement to get result\n\n $resultSet = new ResultSet();\n $resultSet->initialize($driverResult);\n $rows = array();\n foreach($resultSet as $row) {\n $rows[] = $row->getArrayCopy();\n }\n\n return $rows;\n }", "public function getRecords()\n\t{\n\t\treturn $this->records['data'];\n\t}", "public function getAll(){\n\t\treturn $this->db->get($this->table);\n\t}", "function getRecords() {\n\t\treturn $this->records;\n\t}", "function getDataRowWhere($table,$fields = null,$where = null,$order = null) {\r\n\t\t\r\n\t\t$db = self::getDatabaseDataWhere($table,$fields,$where,$order);\r\n\t\t\r\n\t\t//echo $db->getQuery();\r\n\t\treturn $db->loadObject();\r\n\t}", "public function getAllData($table){\n $sql = \"select * from $table\";\n $this->execute($sql);\n if($this->num_rows() == 0){\n $data = 0;\n }\n else {\n while($datas = $this->getData()){\n $data[] = $datas;\n }\n }\n return $data;\n }", "public function get($table, $fields)\n\t{\n\t\t//print_r($data); print_r($table); print_r($fields); die();\n\t\treturn $table::where($fields)->get();\n\t}", "public function readTable()\n {\n $sql = \"SELECT Cubans.Id, FirstName, LastName, Gender, YearOfBirth, \n `Name`, IsInGroup FROM Cubans\n JOIN Genre ON Cubans.IdGenre=Genre.id\";\n $statement = $this->connect->prepare($sql);\n $statement->execute();\n return $statement->fetchAll();\n }", "public function getAll()\n {\n $sql = \"SELECT * FROM \" . self::table . \";\";\n\n $conn = $this->dbc->Get();\n $statement = $conn->prepare($sql);\n $statement->execute();\n $data = $statement->fetchAll();\n $conn = null;\n\n return $data;\n }", "public function getEntries($table, $fields = '*', $limit = 10, $offset = 0);", "abstract public function getTables();", "function getRawData($tableName, $tableHeadArr) {\n $getTableDataSqlQuery = \"SELECT * FROM \" . $tableName;\n $sqlResult = oswQuery($getTableDataSqlQuery);\n $allRows = array();\n while ($oneSqlRow = oci_fetch_array($sqlResult)) {\n $oneRow = array();\n foreach ($tableHeadArr as $oneCol) {\n $oneRow[$oneCol] = $oneSqlRow[$tableHeadArr];\n }\n $allRows[] = $oneRow;\n }\n return $allRows;\n }", "public function getData()\n {\n// print_r($this->where);exit;\n $records = DB::table($this->dbTable)\n ->where($this->where)\n ->get();\n if (count($records) == 0) {\n return null;\n }\n\n return $records;\n }", "public function get_contents_in_table($table)\n {\n header('Content-Type: application/json');\n try {\n $stmt = $this->db->prepare(\"SELECT * FROM $table\");\n $stmt->execute();\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n return array(\n 'table' => $table,\n 'rows_in_table' => $stmt->rowCount(),\n 'columns_in_table' => $stmt->columnCount(),\n 'data' => $result);\n } catch (PDOException $e) {\n $e->getMessage();\n }\n }", "public function getAll()\n {\n $sql = \"SELECT * FROM \".$this->table;\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll(PDO::FETCH_OBJ);\n \n }", "public function getAll()\n {\n $records = $this->getRecordsModel()->getAll();\n \n return $records;\n }", "function getData($fields, $table, $condition = null, $params = array()){\n\t\ttry {\n\t\t\tif(!$fields || empty($fields)) {\n\t\t\t\t$fields = \"*\";\n\t\t\t}\n\n\t\t\t$sql = \"SELECT $fields FROM $table\";\n\t\t\tif($condition && !empty($condition)) {\n\t\t\t\t$sql .=\" WHERE $condition\";\n\t\t\t}\n\t\t\t$query = $this->executeQuery($sql, $params);\n\t\t\t$list = $query->fetchAll(PDO::FETCH_ASSOC);\n\t\t}catch(Exception $e){\n\t\t\t$this->logger->error($sql, $e->getMessage());\n\t\t\tthrow $e;\n\t\t}\n\t\treturn $list;\n\t}", "public function getData($table, $id = null, $valueId = null)\n {\n if ($id == null && $valueId == null) {\n $query = \"SELECT * FROM \".$table;\n }else{\n $query = \"SELECT * FROM \".$table.\" WHERE $id ='\".$valueId.\"'\";\n }\n\n $result = $this->conn->query($query);\n $rows = [];\n\n while ($row = $result->fetch_object()) {\n $rows[] = $row;\n }\n \n return $rows;\n }", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getAll()\n {\n $sql = \"SELECT * FROM $this->table\";\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll();\n }", "public static function get($table, $fields){\r\n $queryType = \"get\";\r\n \r\n include '../helper/retrieve_data.php';\r\n return $dataobj;\r\n }", "function getRecords( $sql ) {\r\n\t\t\t$result = $this->_connectAndExec( $sql );\r\n\t\t\t$dataset = array();\r\n\t\t\twhile ( ocifetchinto( $result, $line, OCI_ASSOC ) ) {\r\n\t\t\t\tarray_push( $dataset, $this->_lowerKeyNames( $line ) );\r\n\t\t\t}\r\n\t\t\tOCIFreeStatement( $result );\r\n\t\t\treturn $dataset;\r\n\t\t}", "private function getData(){\n\t\tdb::getAdapter();\n\t\t\n\t\t$counter=0;\n\t\t$arrayFieldQuery=array();\n\t\tforeach($this->fields as $field){\n\t\t\t$arrayFieldQuery[$field]=$this->types[$counter];\n\t\t\t$counter++;\n\t\t}\n\t\t\n\t\t$counter=0;\n\t\t$arrayFilters=array();\n\t\tforeach($this->filters as $filter){\n\t\t\t$arrayFilters[$this->fields[$filter[0]]]=array(\"type\"=>$this->types[$filter[0]],\"value\"=>$filter[1]);\n\t\t}\n\t\t\n\t\tif(db::getFields($this->table,$arrayFieldQuery,$arrayFilters,$this->orderQuery,$this->limit,true)){\n\t\t\t$this->pages=ceil(((int)db::getCalculatedRows())/((int)$this->maxRowsPerPage));\n\t\t\t$this->maxRows=(int)db::getCalculatedRows();\n\t\t\twhile($row=db::fetch(db::$FETCH_TYPE_ASSOC)){\n\t\t\t\t$this->addRow($row);\n\t\t\t}\n\t\t}\n\t}", "public function readTabla() {\r\n $query = 'SELECT * FROM ' . $this->tabla;\r\n\r\n\r\n \r\n\r\n $sentencia = $this->con->prepare($query);\r\n\r\n $sentencia->execute();\r\n\r\n return $sentencia;\r\n }", "function getDataListWhere($table,$fields = null,$where = null,$order = null,$limit_start,$limit_limit) {\r\n\t\t\r\n\t\t$db = self::getDatabaseDataWhere($table,$fields,$where,$order,$limit_start,$limit_limit);\r\n\t\t\r\n\t\t//echo $db->getQuery();\r\n\t\treturn $db->loadAssocList();\r\n\t}", "public function getListRecords()\n {\n $result = array();\n $records = $this->records;\n if (count($records)) {\n $columns = $this->columns;\n $customColumns = $this->customColumns;\n $formatterColumns = $this->formatterColumns;\n foreach ($records as $index => $record) {\n $row = array();\n foreach ($columns as $column) {\n if (isset($customColumns[$column])) {\n $params = $customColumns[$column];\n ob_start();\n call_user_func($params['callback'], $record, $this);\n $output = ob_get_contents();\n ob_end_clean();\n $row[$column] = $output;\n } else {\n if (isset($formatterColumns[$column])) {\n $params = $formatterColumns[$column];\n ob_start();\n call_user_func($params['callback'], $record);\n $output = ob_get_contents();\n ob_end_clean();\n $row[$column] = $output;\n } else {\n // Is alias column\n if (array_key_exists($column, $this->aliases)) {\n $columnName = $column;\n } else {\n list($tableName, $columnName) = explode(\".\", $column);\n }\n $columnIdentifier = isset($columnName) ? $columnName : $column;\n $row[$column] = $record[$columnIdentifier];\n }\n }\n }\n $result[$index] = $row;\n }\n }\n return $result;\n }", "public function getMultipleRecords() {\n $i = 0;\n $output = [];\n $_this = $this;\n while($row = $_this->fetchAssoc()){\n $output[\"data\"][$i] = $row;\n $i++;\n }\n return $output;\n }", "public function GetAllRecord ($columnas, $tabla, $getObjects=true) {\n $result=null;\n $col=null;\n try {\n /* Extraemos las columnas para preparar la consulta*/\n if(isset($columnas)){\n foreach ($columnas as $key) {\n if (!empty($key)){\n $col.=$key.\",\";\n } \n }\n $sql=\" SELECT \".substr($col, 0, strlen($col)-1).\" FROM \".$tabla;\n }else{\n $sql=\" SELECT * FROM \" . $tabla;\n }\n $query= $this->con->prepare($sql);\n $query->execute();\n $this->setNumRows( $query->rowCount());\n if($getObjects){\n $result=$query->fetchAll(PDO::FETCH_ASSOC);\n } else {\n $result=$query->fetchAll(PDO::FETCH_OBJ);\n }\n } catch (PDOException $exc) {\n error_log($exc->getMessage());\n $this->setMerrors($exc->getMessage());\n \n } \n return $result;\n }", "public function getRecords($table, $where = NULL,$whereOR = NULL,$order_by=NULL, $num = NULL, $offset = NULL)\n\t{\n\t\t$this->db->select('*');\n\t\t\n\t\tif($where != NULL )\n\t\t{\n\t\t \t$this->db->where($where);\n\t\t}\n \n if($whereOR != NULL){\n $this->db->or_where($whereOR);\n }\n\t\t\n\t\tif($num != NULL || $offset != NULL)\n\t\t{\n\t\t\t$this->db->limit($num, $offset);\n\t\t}\n\t\t\n\t\tif($order_by)\n\t\t{\n\t\t $this->db->order_by($order_by[0], $order_by[1]);\n\t\t}\t\n\t\t\t\n\t\t$query = $this->db->get($table); \n\t\t\n\t\t#print_r($this->db->last_query()); echo '<hr>'; \t\n\t\t\t\t\n\t\tif($query->num_rows > 0 )\n\t\t{ \n\t\t\t$ret = $query->result_array();\n\t\t\t$query->free_result();\n\t\t\treturn $ret;\n\t\t\t\n\t\t}else{ \n\t\t\n\t\t\t$ret = array();\n\t\t\t$query->free_result();\n\t\t\treturn $ret;\n\t\t}\n\t\n $this->db->close();\n\t}", "public function allrecord_get() { \n $result = $this->Api_model->selectData('info', 'id, name, email');\n if($result == null)\n $this->set_response(array('response_code'=>400,'response_message'=>'No Data Found','response_data'=>array()), REST_Controller::HTTP_OK);\n else\n $this->set_response(array('response_code'=>200,'response_message'=>'Success','response_data'=>$result), REST_Controller::HTTP_OK);\n }", "public function getTableData()\n\t{\n\t}", "public function getAll($table){\n\t\treturn $this->db->get($table);\n\t}", "public function getData($npk,$table)\n {\n return $this->db->get_where($table,array('npk' => $npk));\n }", "public function findAll(){\n \n\t\t$sql = 'SELECT * FROM ' . self::TABLENAME;\n\n \t$db = new Database(); // se creeaza conexiunea la baza de date\n\t\t$stmt = $db->getConnection()->prepare($sql);\n\t\t$stmt->execute();\n\t\t$results = $stmt->fetchAll();\n\t\n\t\treturn $results; \n }" ]
[ "0.76982784", "0.754573", "0.7206273", "0.7156476", "0.71145016", "0.7085658", "0.7037923", "0.70350975", "0.7029576", "0.7011103", "0.7011103", "0.69669336", "0.6895782", "0.6886045", "0.6882344", "0.6856441", "0.6819337", "0.6802144", "0.6714102", "0.6708727", "0.6684441", "0.6681775", "0.6660156", "0.6615772", "0.6595246", "0.6595246", "0.6595246", "0.65865713", "0.6586227", "0.6578866", "0.6550129", "0.65481675", "0.65481675", "0.65481675", "0.6544364", "0.65438205", "0.6533187", "0.6532988", "0.64970714", "0.64926714", "0.6490658", "0.6488286", "0.6470948", "0.64636457", "0.64594805", "0.64594805", "0.6441478", "0.64330155", "0.6429451", "0.64177984", "0.64116347", "0.6411253", "0.6408049", "0.6397423", "0.6386221", "0.63819826", "0.6381298", "0.63774765", "0.636764", "0.636674", "0.6363344", "0.63609403", "0.6357779", "0.63575125", "0.63572514", "0.63521385", "0.63500017", "0.6347912", "0.6344621", "0.6329213", "0.6326828", "0.6326339", "0.6322913", "0.63150156", "0.6305792", "0.6304982", "0.63045424", "0.63026285", "0.63014203", "0.6300229", "0.6300229", "0.6300229", "0.6300229", "0.6300229", "0.6300229", "0.6300229", "0.6298556", "0.6298227", "0.629393", "0.6292987", "0.6292489", "0.6288961", "0.62776726", "0.6277009", "0.6275478", "0.62744224", "0.62735975", "0.62720925", "0.62715906", "0.62711143", "0.6269759" ]
0.0
-1
Get the values of a field in a table
public function getValuesForCol($options = NULL) { // Обращение идет к таблице "users" if ($options['joinTableForSort'] == 'admin.users') { $options['joinTableForSort'] = ''; $rows = Default_Model_DbTable_User::GetValuesForCol($this->db, $options); return $rows; } // Обращение идет к таблице "users_profile" if ($options['joinTableForSort'] == 'admin.users_profile') { $options['joinTableForSort'] = 'users_profile'; $rows = Default_Model_DbTable_User::GetValuesForCol($this->db, $options); return $rows; } // Обращение идет к таблице "blog_post" или присоединенным таблицам: // blog_post_profile; blog_post_tags; blog_post_images; blog_post_locations $rows = Default_Model_DbTable_BlogPost::GetValuesForCol($this->db, $options); return $rows; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getValueFromField()\r\n\t{\r\n\t\treturn $this->row[ key( $this->mapping ) ];\r\n\t}", "public function getFields($table);", "function getValueFromField()\n {\n return $this->current_row[ key( $this->mapping ) ];\n }", "public function fetchField();", "public function get_field_struct($database,$table,$field){\n\t\t$sql=\"SELECT * FROM `information_schema`.`COLUMNS` WHERE `TABLE_SCHEMA`='$database' AND `TABLE_NAME`='$table' AND `COLUMN_NAME`='$field' ;\"; \t\t\n\t\t$this->query($sql);\n\t\treturn $this->fetch();\n\t}", "private function getFieldsOnTable()\n{\n\n $returnArray=array(); \n foreach ($this->tableStructure as $ind => $fieldArray) { \n $returnArray[$fieldArray['columnName']]=$fieldArray['columnName'];\n }\n \n return $returnArray; \n}", "function my_get_field_list( $table_name ){\r\n\t\r\n\t$query = \" SHOW fields FROM `\".$table_name.\"` \";\r\n\t$result = my_query( $query );\r\n\t \r\n\twhile($row = my_fetch_array( $result ) ){\r\n\t\t$data = $row['Field'];\r\n\t\tbreak;\r\n\t}\r\n\t\r\n\treturn $data;\r\n\t\r\n}", "public function fetchFields();", "function getFieldValue($field);", "public function getFieldValues()\n {\n if($this->isNewRecord){\n return []; //TODO: LOAD DEFAULT FIELDS OF TYPE\n }\n\n //pull meta values from DB\n $table = self::tablePrefix().'cms_post_field';\n $strSql = \"SELECT id, field_id, value \n\t\t\t\t\tFROM {$table}\n\t\t\t\t\tWHERE post_id = :pid\n\t\t\t\t \";\n $cmd = self::getDb()->createCommand($strSql);\n $cmd->bindValue(\":pid\",$this->id,\\PDO::PARAM_STR);\n $arrResults = $cmd->queryAll();\n\n return ArrayHelper::index($arrResults, 'id', 'field_id');\n }", "function getValue(int $field);", "public function getViaTableAttributesValue();", "public static function fetch_fields($table){\n $sql = 'SHOW columns FROM '.self::clean($table);\n self::$__querys[] = $sql;\n $result = mysqli_query(self::$__connection, $sql);\n $data = array();\n if ($result) {\n while ($r = $result->fetch_assoc()) {\n $data[] = $r;\n }\n $result->close();\n }\n return $data;\n }", "function fieldInfo( $table, $field );", "function get_row_data($table,$field_name,$id)\r\n\t{\t\r\n\t\t$sql_query=\"SELECT * FROM $table WHERE `id`='\".$id.\"'\";\r\n\t\t$res_query=hb_mysql_query($sql_query);\r\n\t\t$rows_query=hb_mysql_fetch_array($res_query);\r\n\t\t\r\n\t\t$get_field_name=$rows_query[$field_name];\r\n\t\t\r\n\t\treturn $get_field_name;\r\n\t}", "public function getFieldData()\n {\n $retval = array();\n for ($c = 1, $fieldCount = $this->getFieldsCount(); $c <= $fieldCount; $c++) {\n $item = array();\n $item['name'] = oci_field_name($this->stmt_id, $c);\n $item['type'] = oci_field_type($this->stmt_id, $c);\n $item['max_length'] = oci_field_size($this->stmt_id, $c);\n $retval[] = $item;\n }\n\n return $retval;\n }", "function field_data()\r\n\t{\r\n\t\t$retval = array();\r\n /*\r\n echo \"<pre>\";\r\n var_dump($this->result_id);\r\n var_dump($this->pdo_results);\r\n echo \"</pre>\";\r\n */\r\n $table_info = $this->pdo_results;\r\n assert(is_array($table_info));\r\n foreach ($table_info as $row_info) {\r\n $F = new stdClass();\r\n $F->name = $row_info['name'];\r\n $F->type = $row_info['type'];\r\n $F->default = $row_info['dflt_value'];\r\n $F->max_length = 0;\r\n $F->primary_key = $row_info['pk'];\r\n \r\n $retval[] = $F;\r\n }\r\n\r\n return $retval;\r\n }", "public function getFieldValue($table, $fields=\"\", $condition=\"\") //$condition is array \n\t{\n\t\tif($fields != \"\")\n\t\t{\n\t\t\t$this->db->select($fields);\n\t\t}\n\n\t\tif($condition != \"\")\n\t\t{\n\t\t\t$rs = $this->db->get_where($table,$condition);\n\t\t}\n\t\t$result = $rs->row_array();\n\t\treturn $result[$fields];\n\n\t}", "function get_table_field($table){\n\t return mysql_query(\"SHOW FIELDS FROM \".$table, $this->link);\t\t\n\t}", "private function _fields() {\n if ($this->_table() && empty($this->fields)) {\n $this->fields = $this->db->list_fields($this->_table());\n }\n return $this->fields;\n }", "public function getAllFields() {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db_q'];\n\t\t\t// Initialize variables\n\t\t\t$return\t\t\t= false;\n\t\t\t// Query set up\t\n\t\t\t$table\t\t\t= 'tb_field';\n\t\t\t$select_what\t= 'id, vc_field AS vc_name';\n\t\t\t$conditions\t\t= \"1 ORDER BY vc_field ASC\";\n\t\t\t$return\t\t\t= $db->getAllRows_Arr($table, $select_what, $conditions);\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}", "function getvalue($field, $table, $condition = \"\") {\n\n $q = mysqli_query(\"select $field from $table $condition\") or die(mysql_error());\n $row = mysqli_fetch_array($q);\n return $row[$field];\n}", "public function field_data()\n\t{\n\t\t$retval = array();\n\t\tfor ($c = 1, $fieldCount = $this->num_fields(); $c <= $fieldCount; $c++)\n\t\t{\n\t\t\t$F\t\t\t= new stdClass();\n\t\t\t$F->name\t\t= oci_field_name($this->stmt_id, $c);\n\t\t\t$F->type\t\t= oci_field_type($this->stmt_id, $c);\n\t\t\t$F->max_length\t\t= oci_field_size($this->stmt_id, $c);\n\n\t\t\t$retval[] = $F;\n\t\t}\n\n\t\treturn $retval;\n\t}", "public function getFields($table) {\n\t\treturn $this->_list_fields($table);\n\t}", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "function getvalue($field, $table, $condition)\n{\ninclude_once 'config.php';\n\t$q = mysql_query(\"select $field from $table $condition\") or die(mysql_error());\n\t$row = mysql_fetch_assoc($q);\n\treturn $row[$field];\n}", "function wrapper_field_names($table) {\n\n\t\t$rowdata = $this->query_return(\"SELECT TOP 1 * FROM $table\");\n\t\t$fields = array();\n\n\t\tforeach ($rowdata as $f => $x) {\n\t\t\t$fields[] = $f;\n\t\t}\n\n\t\treturn $fields;\n\t}", "function getFieldValues()\n {\n $myvalues = $this->m_oPageHelper->getFieldValues($this->m_protocol_shortname);\n return $myvalues;\n }", "function get_fields_in_table( ){\n\t\t\t\t $result = mysql_query(\"SHOW COLUMNS FROM \".$this->db.\".\".$this->table.\"\");\n\t\t\t\tif (!$result) {\n\t\t\t\t echo 'Could not run query: ' . mysql_error();\n\t\t\t\t exit;\n\t\t\t\t}\n\t\t\t\tif (mysql_num_rows($result) > 0) {\n\t\t\t\t while ($row = mysql_fetch_assoc($result)) {\n\t\t\t\t \n\t\t\t\t //$a_fields[]=$row;\n\t\t\t\t $a_fields[]=$row['Field'].\" | \".$row['Type'];\n\t\t\t\t \n\t\t\t\t }\n\t\t\t\t}\n\t\t\t\treturn $a_fields;\n\t\t\t }", "public function getValues(ContentEntityInterface $entity, $field);", "function getField($id, $table, $field){\n\t$q = mysql_query(\"SELECT `$field` FROM `$table` WHERE `id`='$id'\");\n\t$qd = mysql_fetch_assoc($q);\n\treturn stripslashes($qd[$field]);\n}", "function getAllDataValues() {\n\t\t$conn = Doctrine_Manager::connection(); \n\t\t$resultvalues = $conn->fetchAll(\"SELECT * FROM lookuptypevalue WHERE lookuptypeid = '\".$this->getID().\"' order by lookupvaluedescription asc \");\n\t\treturn $resultvalues;\t\n\t}", "function getFields();", "function getTableFields($table) {\n return $this->select(\"show fields from $table\");\n }", "public function _fieldData(string $table): array\n\t{\n\t\t//log_message('error', '_fieldData');\n\t\tif (($query = $this->query( $this->_listColumns($table))) === false)\n\t\t{\n\t\t\tthrow new DatabaseException(lang('Database.failGetFieldData'));\n\t\t}\n\t\t$query = $query->getResultObject();\n\n\t\t//log_message('error', print_r($query, true) );\n\n\t\treturn $query;\n\t}", "public function getQueryFields ($table);", "public function fetchFields()\n {\n $field_names = array();\n for ($c = 1, $fieldCount = $this->getFieldsCount(); $c <= $fieldCount; $c++) {\n $field_names[] = oci_field_name($this->stmt_id, $c);\n }\n return $field_names;\n }", "protected function fetchFields(){\n $fields = X3::db()->fetchFields($this->modelName);\n $_res = array();\n foreach($fields as $name=>$field){\n $dataType = X3_MySQL_Command::parseMySQLField($field);\n $_res[$name] = $dataType;\n }\n return $_res;\n }", "public function fields()\n {\n $fields = array();\n\n foreach ($this->_data as $field => $row)\n {\n $fields[$field] = $row['value'];\n }\n\n return $fields;\n }", "protected function _field_data($table)\n {\n return 'SELECT TOP 1 * FROM ' . $this->protect_identifiers($table);\n }", "public function getField();", "public function getField();", "public function getField();", "function get_value($field, $table, $where)\n{\n # load ci instance\n $CI = & get_instance();\n $CI->load->database();\n\n $val = '';\n $sql = \"SELECT \" . $field . \" FROM \" . $table . \" WHERE \" . $where;\n $query = $CI->db->query($sql);\n foreach ($query->result_array() as $r) {\n $val = $r[$field];\n }\n return $val;\n}", "function getvalMultiple($con,$table,$field,$where,$space)\n{\n\tif($where != \"\")\n\t $sql = \"select $field from $table where $where\";\n\telse\n\t $sql = \"select $field from $table\";\n\t \n\t//echo $sql;\n\t$getvalue = mysqli_query($con,$sql);\n\t$getval=\"\";\n\twhile($row = mysqli_fetch_row($getvalue))\n\t{\n\t\tif($getval == \"\")\n\t\t$getval = $row[0];\n\t\telse\n\t\t{\n\t\t\tif($space==true)\n\t\t\t$getval .= \", \". $row[0];\n\t\t\telse\n\t\t\t$getval .= \",\". $row[0];\n\t\t}\n\t}\n\treturn $getval;\n}", "private function _getColumn($table)\n\t{\n\t\t$result = $this->db->list_fields($table);\n\n\t\treturn $result;\n\t}", "function fieldValues() {\n\t\n\t\tif (isset($this->fieldValues)) {\n\t\t\treturn $this->fieldValues;\n\t\t}\n\n\t\t// fieldvalues fanns inte.\n\t\t// kolla preload först och om inte där så ladda in\n\t\t$preloader = pb_query_preloader::getInstance();\n\t\t$preloadRows = $preloader->getPreloadFieldsRows($this->id);\n\t\tif ($preloadRows === false) {\n\t\t\t#echo \"<br>nah, no preload row for field, article: $this->id \";\n\t\t\t// no preload for this articles field, fetch them from db\n\t\t\tglobal $polarbear_db;\t\t\n\t\t\t$sql = \"\n\t\t\t\tSELECT \n\t\t\t\t\tfv.fieldID, fv.articleID, fv.value, fv.numInSet,\n\t\t\t\t\tf.name as fieldName, f.type as fieldType\n\t\t\t\tFROM \" . POLARBEAR_DB_PREFIX . \"_fields_values as fv\n\t\t\t\tINNER JOIN \" . POLARBEAR_DB_PREFIX . \"_fields as f ON f.id = fv.fieldID\n\t\t\t\tWHERE articleID = '$this->id' ORDER BY fieldID ASC, numInSet ASC\";\n\t\t\t$rows = $polarbear_db->get_results($sql);\n\t\t} else {\n\t\t\t#echo \"<br>got preload row for field, article: $this->id\";\n\t\t\t// horay! we got the field values preloaded\n\t\t\t$rows = $preloadRows;\n\t\t}\n\t\n\t\t$arrFieldValues = array();\n\t\t$arrFieldCount = array();\n\t\tif (is_array($rows)) {\n\t\t\tforeach ($rows as $oneRow) {\n\t\t\t\tif (!isset($arrFieldValues[$oneRow->fieldID])) {\n\t\t\t\t\t$arrFieldValues[$oneRow->fieldID] = array();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t\ttodo: om det är en fil/bild ska det kanske finnas\n\t\t\t\t\tlink, downloadLink, imageSrc osv.\n\t\t\t\t*/\n\t\t\t\t$arrFieldValues[$oneRow->fieldID][] = array(\n\t\t\t\t\t\"fieldID\" => $oneRow->fieldID,\n\t\t\t\t\t\"articleID\" => $oneRow->articleID,\n\t\t\t\t\t\"value\" => $oneRow->value,\n\t\t\t\t\t\"numInSet\" => $oneRow->numInSet,\n\t\t\t\t\t// and some useful \"extras\" too\n\t\t\t\t\t\"valueEscaped\" => htmlspecialchars ($oneRow->value, ENT_COMPAT, \"UTF-8\"),\n\t\t\t\t\t\"valueNoTags\" => strip_tags($oneRow->value),\n\t\t\t\t\t\"fieldName\" => $oneRow->fieldName,\n\t\t\t\t\t\"fieldType\" => $oneRow->fieldType\n\t\t\t\t);\n\t\t\t\tif (!isset($arrFieldCount[$oneRow->fieldID])) {\n\t\t\t\t\t$arrFieldCount[$oneRow->fieldID]=0;\n\t\t\t\t}\n\t\t\t\t$arrFieldCount[$oneRow->fieldID]++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// update count\n\t\tforeach ($arrFieldCount as $fieldID => $fieldCount) {\n\t\t\tfor ($i=0; $i<sizeof($arrFieldValues[$fieldID]); $i++) {\n\t\t\t\t$arrFieldValues[$fieldID][$i][\"fieldSetCount\"] = $fieldCount;\n\t\t\t}\n\t\t}\n\t\t\n\t\t#pb_pqp_log_speed(\"article fieldValues()\");\n\t\t\n\t\t$this->fieldValues = $arrFieldValues;\n\t\treturn $this->fieldValues;\n\t}", "private static function fields()\n {\n $fields = static::$fields;\n $primary_key = static::$primary_key;\n\n $rows = [$primary_key, ...$fields];\n\n if(!count($rows)) {\n return ['*'];\n }\n\n return $rows;\n }", "function getFieldAndValues($params) {\n global $conn;\n\n if (!is_array($params))\n exit('Parâmetro inválido!');\n\n $id = $params['id'];\n $mod = $params['modulo'];\n $pre = $params['pre'];\n $ref = isset($params['ref']) ? $params['ref'] : 'id';\n\n if (empty($id) || empty($mod) || empty($pre))\n exit('Dados inválidos');\n\n\n /*\n *pega lista de colunas\n */\n $sql= \"SELECT * FROM \".TABLE_PREFIX.\"_{$mod} WHERE {$pre}_{$ref}=\\\"{$id}\\\"\";\n $fields = array();\n if(!$qry = $conn->query($sql))\n echo $conn->error();\n\n else {\n\n while($fld = $qry->fetch_field())\n array_push($fields, str_replace($pre.'_', null, $fld->name));\n\n $qry->close();\n }\n\n /*\n *pega valores dessas colunas\n */\n $sqlv= \"SELECT * FROM \".TABLE_PREFIX.\"_{$mod} WHERE {$pre}_{$ref}=\\\"{$id}\\\"\";\n if(!$qryv = $conn->query($sqlv))\n echo $conn->error();\n\n else {\n $valores = $qryv->fetch_array(MYSQLI_ASSOC);\n $qryv->close();\n }\n\n $res = null;\n foreach ($fields as $i=>$col)\n $res .= \"{$col} = \".$valores[$pre.'_'.$col].\";\\n\";\n\n\n return $res.\"\\n\";\n}", "public function listFields($table)\r\n {\r\n return $this->fetchItems($this->query(\"SHOW FIELDS FROM $table\"), 0, 'row');\r\n }", "public function getAllFields();", "function db_GetFieldValues()\n{\n // Inputs: $db_table, $key, [where]\n\n $numargs = func_num_args();\n $db_table = func_get_arg(0);\n $key = func_get_arg(1);\n $where = ($numargs > 2)? ' WHERE '.func_get_arg(2) : '';\n\n $RESULT = array();\n\n if (empty($key)) {\n return $RESULT;\n }\n\n $query = \"SELECT $key FROM `$db_table`$where GROUP BY $key ORDER BY $key\";\n SetDbQuery('db_GetFieldValues',$query);\n\n $db_query = mysql_query($query);\n\n if (!$db_query) {\n return $RESULT;\n }\n\n while ($row = mysql_fetch_assoc($db_query)) {\n foreach ($row as $key => $value) {\n $RESULT[] = $value;\n }\n }\n\n return $RESULT;\n}", "public abstract function FetchField();", "public function fetch_fields() {}", "function getFields($table,$fields=\"\",$condition=\"\",$limit=\"\",$calculateRows=false,$fastHint=false);", "function field_data()\n\t{\n\t\t$retval = array();\n\t\twhile ($field = mysqli_fetch_field($this->result_id))\n\t\t{\n\t\t\t$F\t\t\t\t= new stdClass();\n\t\t\t$F->name\t\t= $field->name;\n\t\t\t$F->type\t\t= $field->type;\n\t\t\t$F->default\t\t= $field->def;\n\t\t\t$F->max_length\t= $field->max_length;\n\t\t\t$F->primary_key = ($field->flags & MYSQLI_PRI_KEY_FLAG) ? 1 : 0;\n\n\t\t\t$retval[] = $F;\n\t\t}\n\n\t\treturn $retval;\n\t}", "function getByField ( $field,$value){\n\t\t $result=$this->fetchRow(\"$field= '$value' \"); //order by id?\n\t\t if($result==null)\n\t\t\t return;\n\t\t if(is_array($result))\n\t\t\t return $result[0];\n\t\t return $result;\n\t}", "abstract public function getFields();", "abstract public function getFields();", "function getTableFields($sessionID, $table){\r\n\t\t//echo $table;\r\n\t\t$result = mysql_list_fields($this->dbname, $table);\r\n\t\treturn $result;\t\t// jeremy originally called this variable $tom, and for that i shall kill him.\r\n\t}", "public function list_fields() {\n return $this->db->list_fields($this->_table());\n }", "function GetFieldsList($table)\n\t{\n\t\t$tbl = $this->Table($table);\n\t\treturn $tbl->GetFieldsList();\n\t}", "function getfield($field){\n\n\t\treturn($this->record[$field]);\n\t}", "function dbTableField($tableName) {\n $data = array();\n $sql = \"SHOW COLUMNS FROM \" . $tableName;\n $result = mysql_query($sql);\n $i = 0;\n while ($row = mysql_fetch_assoc($result)) {\n $data[$i]['Field'] = $row['Field'];\n $data[$i]['Type'] = $row['Type'];\n $data[$i]['Null'] = $row['Null'];\n $data[$i]['Key'] = $row['Key'];\n $data[$i]['Default'] = $row['Default'];\n $data[$i]['Extra'] = $row['Extra'];\n $i++;\n }\n\n return $data;\n }", "public function fetchByField( $field, $value )\n\t{\n\t\t$select = $this->table->select()->where( $field . ' = ?', $value );\n\n\t\t$rowSet = $this->table->fetchAll( $select );\n\n\t\treturn $rowSet->toArray();\n\t}", "public function singleRecordArray($table_name, $table_field_name_with_value) {\n return $this->db->where($table_field_name_with_value)->get($table_name)->result();\n }", "function fieldvalue($field=\"menu_id\",$id=\"\",$condition=\"\",$order=\"\")\n\t{\n\t\t$rs=$this->fetchrecordset($id, $condition, $order);\n\t\t$ret=0;\n\t\twhile($rw=mysql_fetch_assoc($rs))\n\t\t{\n\t\t\t$ret=$rw[$field];\n\t\t}\n\t\treturn $ret;\n\t}", "function get_editable_field($role_id,$table)\n {\n // LEFT JOIN TBM_EDITFIELD a ON a.fieldname = b.COLUMN_NAME AND a.role_id = '\".$role_id.\"'\n // WHERE b.TABLE_NAME ='\".$table.\"' \";\n $sql = \" SELECT DISTINCT UPPER(b.COLUMN_NAME) AS fieldname, a.editable FROM INFORMATION_SCHEMA.COLUMNS b\n LEFT JOIN TBM_EDITFIELD a ON a.fieldname = b.COLUMN_NAME AND a.role_id = '\".$role_id.\"'\n WHERE b.TABLE_NAME IN (\".$table.\") \";\n\n Debugbar::info($sql);\n $data = DB::SELECT($sql);\n\n if(!empty($data))\n {\n foreach($data as $k => $v)\n {\n //echo \"1<pre>\"; print_r($v);\n $result[$v->fieldname]= $v->editable;\n }\n }\n\n return $result;\n }", "public function getValues();", "public function getAllFieldValues($field)\n {\n $column = $this->repo->getColumnByField($field);\n $result = [];\n for ($this->rewind(); $this->valid(); $this->next()) {\n $result[] = parent::current()[$column];\n }\n\n return array_unique($result);\n }", "public function getFields() {}", "public function getFields() {}", "public function getFields() {}", "public function getFieldData(): array\n {\n return array_map(fn ($fieldIndex) => (object) [\n 'name' => oci_field_name($this->resultID, $fieldIndex),\n 'type' => oci_field_type($this->resultID, $fieldIndex),\n 'max_length' => oci_field_size($this->resultID, $fieldIndex),\n ], range(1, $this->getFieldCount()));\n }", "public function get_values() {\n\t\t$values = [];\n\n\t\tforeach ( $this->fields as $field ) {\n\t\t\t$values[$field->name] = $field->get_value();\n\t\t}\n\n\t\treturn $values;\n\t}", "public function getListFields();", "public function get($field);", "public function get($field);", "function getFieldValue($value_id)\r\n\t{\r\n\t\t$q = \"SELECT \".$this->fieldToSelect.\" FROM `\".$this->tableName.\"` WHERE \".$this->tableId.\"='\".$value_id.\"'\";\r\n\t\t$this->db->Execute($q);\r\n\r\n\t\tif($this->db->Affected_rows() > 0)\r\n\t\t{\r\n\t\t\t$field_value = $this->db->GetOne($q);\r\n\t\t\treturn $field_value;\r\n\t\t}else{\r\n\t\t\tdie('<strong>Nama Field yang ada di dalam tanda {} tidak ada di table '.$this->tableName.',<br> sql : '.$this->sql.'</strong>');\r\n\t\t}\r\n\t\treturn '';\r\n\t}", "function fields($fldname) {\n\t\treturn $this->fields[$fldname];\n\t}", "public static function getValues($fieldName)\n\t{\n\t\tif (\\App\\Cache::has('Picklist::getValues', $fieldName)) {\n\t\t\treturn \\App\\Cache::get('Picklist::getValues', $fieldName);\n\t\t}\n\t\t$primaryKey = static::getPickListId($fieldName);\n\t\t$dataReader = (new \\App\\Db\\Query())\n\t\t\t->from(\"vtiger_$fieldName\")\n\t\t\t->orderBy('sortorderid')\n\t\t\t->createCommand()->query();\n\t\t$values = [];\n\t\twhile ($row = $dataReader->read()) {\n\t\t\t$row['picklistValue'] = \\App\\Purifier::decodeHtml(\\App\\Purifier::decodeHtml($row[$fieldName]));\n\t\t\t$row['picklistValueId'] = $row[static::getPickListId($fieldName)];\n\t\t\t$values[$row[$primaryKey]] = $row;\n\t\t}\n\t\t\\App\\Cache::save('Picklist::getValues', $fieldName, $values);\n\t\treturn $values;\n\t}", "function getField($campo)\n{\n\treturn $this->res2[$campo];\n}", "public function getFields(): array;", "public function getFields(): array;", "public function getFields(): array;", "function getByID($table,$field,$value);", "function getDBData($field, $search = ID, $where = 'user_id', $table = 'users')\n{\n\tglobal $db;\n\n\t$ret = $db->query('select ' . $field . ' from ' . $table . ' where ' . $where . '=\\'' . $search . '\\'');\n\n\tif(count($ret) > 0)\n\t\treturn $ret[0][$field];\n\telse\n\t\treturn '';\n}", "function f($field) {\n\t\treturn($this->fetchfield($field));\n\t}", "function field_data()\n\t{\n\t\t$retval = array();\n\t\tforeach(sqlsrv_field_metadata($this->result_id) as $offset => $field)\n\t\t{\n\t\t\t$F \t\t\t\t= new stdClass();\n\t\t\t$F->name \t\t= $field['Name'];\n\t\t\t$F->type \t\t= $field['Type'];\n\t\t\t$F->max_length\t= $field['Size'];\n\t\t\t$F->primary_key = 0;\n\t\t\t$F->default\t\t= '';\n\t\t\t\n\t\t\t$retval[] = $F;\n\t\t}\n\t\t\n\t\treturn $retval;\n\t}", "function sql_fetch_field($res,$offset = 0)\n {\n $results = array();\n $obj = NULL;\n $results = $res->getColumnMeta($offset);\n foreach($results as $key=>$value) {\n $obj->$key = $value;\n }\n return $obj;\n }", "public function getFieldValues() {\n return array_values($this->_fields);\n }", "public static function fetch_field_data_for_id($table, $id, $id_field = 'id') {\n $sql = 'SELECT * FROM \\''.self::clean($table).'\\' WHERE `'.self::clean($id_field).'` = \\''.self::clean($id).'\\'';\n \n /** store query for debug * */\n self::$__querys[] = $sql;\n $result = mysqli_query(self::$__connection, $sql);\n $data = array();\n if ($result) {\n\n /* Get field information for all columns */\n $finfo = $result->fetch_fields();\n\n foreach ($finfo as $val) {\n $data[] = array('name'=>$val->name, 'type'=>$val->type, 'max_len'=>$val->max_length);\n }\n $result->close();\n }\n return $data;\n }", "abstract public function getFields($entity);", "function get_fields(){\n\t\t\t \n\t\t\t // IN: database,table\n\t\t\t //OUT: array of fields\n\t\t\t \n\t\t\t$this->db_connect;\n\t\t\t$result = mysql_query(\"SHOW COLUMNS FROM \".$this->db.\".\".$this->table.\"\" );\n\t\t\t//echo(\"SHOW COLUMNS FROM \".$this->db.\".\".$this->table.\"\" );\n\t\t\tif (!$result) {\n\t\t\t echo 'Could not run query: ' . mysql_error();\n\t\t\t exit;\n\t\t\t}\n\t\t\tif (mysql_num_rows($result) > 0) {\n\t\t\t while ($row = mysql_fetch_assoc($result)) {\n\t\t\t $a_fields[]=$row['Field'];\n\t\t\t }\n\t\t\t}\n\t\t\treturn $a_fields;\n\t}", "function getField($field,$table,$chkfield,$id=0)\n\t{\n\t\t$ret=0;\n\t\tif($field)\n\t\t{\n\t\t\tif($table)\n\t\t\t{\n\t\t\t\t$where=$this->WhereClause($chkfield,$id);\n // $t_field=$this->sqlFormatField($field);\n\t\t\t\tif(strlen($where))\n\t\t\t\t{\n\t\t\t\t\t$sql=\"select $field from $table where $where\";\n\t\t\t\t\t$qt=$this->query($sql);\n\t\t\t\t\tif($qt)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($temp_arr=$this->getRow(MYSQL_ASSOC))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$ret=$temp_arr[$field];\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "abstract protected function getFields();" ]
[ "0.72546417", "0.71838105", "0.7182165", "0.71717983", "0.69473153", "0.6944949", "0.6906652", "0.6866785", "0.68116117", "0.67833066", "0.6768291", "0.6738672", "0.67305446", "0.6688033", "0.6676277", "0.6671597", "0.6669802", "0.6652373", "0.6651995", "0.66340274", "0.6588098", "0.6586593", "0.6564096", "0.6560166", "0.654942", "0.654942", "0.654942", "0.654942", "0.654942", "0.654942", "0.65422285", "0.65172285", "0.6474598", "0.6469012", "0.6461026", "0.6454605", "0.64463884", "0.644375", "0.6437461", "0.6428394", "0.6409611", "0.6406721", "0.6396023", "0.6388674", "0.6388216", "0.6384024", "0.6384024", "0.6384024", "0.6377191", "0.6373036", "0.6371163", "0.6370393", "0.6355287", "0.6318781", "0.6314639", "0.6308751", "0.630454", "0.6299067", "0.6290494", "0.6288745", "0.628485", "0.62720245", "0.6269976", "0.6269976", "0.62388706", "0.6229484", "0.6223704", "0.6218791", "0.62175107", "0.6216731", "0.61984736", "0.61963403", "0.61959004", "0.61913013", "0.6185601", "0.6184192", "0.6184192", "0.6184192", "0.61840993", "0.6170168", "0.616199", "0.6153759", "0.6153759", "0.61512107", "0.6148099", "0.61469376", "0.6141181", "0.6136846", "0.6136846", "0.6136846", "0.61333555", "0.6128544", "0.6119884", "0.6117878", "0.61176544", "0.6116377", "0.6115212", "0.6110165", "0.61087334", "0.61007386", "0.6082053" ]
0.0
-1
Create a form to validation the values
public function createFormForValidation($options = NULL) { return new Admin_Form_Blogs(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createForm();", "public function createForm();", "abstract public function createForm();", "abstract public function createForm();", "public function valiteForm();", "public function form()\n {\n\n $this->hidden('key', '字段名')->rules('required');\n $this->editor('val', '平台规则')->rules('required');\n }", "public function CreateForm();", "public function createForm()\n {\n }", "protected function form()\n {\n $form = new Form(new Purchase());\n if ($form->isCreating()) {\n $form->select('consumer_id', \"客户\")->options(Consumer::all()->pluck('full_name', 'id'))->required();\n $form->select('house_id', \"购买房源\")->options(House::purchasable()->pluck('readable_name', 'id'))->required();\n }\n $form->datetime('started_at', \"生效日期\");\n $form->datetime('ended_at', \"结束日期\");\n $form->select('sell_type', \"出售方式\")->options(Purchase::$type)->required();\n $form->currency('price', \"成交价格\")->symbol('¥')->required();\n\n return $form;\n }", "public function form()\n {\n $this->select('type', '计算类型')\n ->options(Interest::$typeMap)\n ->default(Interest::TYPE_FUTURE)->required();\n\n $this->number('value', '计算值')->required();\n $this->number('years', '存入年限')->required();\n $this->rate('rate', '年化利率')->required();\n }", "private function IndexValidacionFormulario() {\n\t\t\t$Val = new NeuralJQueryFormularioValidacion(true, true, false);\n\t\t\t$Val->Requerido('AVISO', 'Debe Ingresar el Número del Aviso');\n\t\t\t$Val->Numero('AVISO', 'El Aviso debe Ser Numérico');\n\t\t\t$Val->CantMaxCaracteres('AVISO', 10, 'Debe ingresar aviso con 10 Números');\n\t\t\t$Val->Requerido('PRIORIDAD', 'Debe Seleccionar una Opción');\n\t\t\t$Val->Requerido('RAZON', 'Debe Seleccionar una Opción');\n\t\t\t$Val->Requerido('REGIONAL[]', 'Seleccione la Regional a Reportar');\n\t\t\t$Val->Requerido('NODO', 'Debe ingresar el Nodo al que pertenece la Matriz');\n\t\t\t$Val->Requerido('HORAFIN', 'Defina la fecha-hora que termina el Aviso');\n\t\t\t$Val->Requerido('MATRIZ', 'Debe informar el Número de la Matriz');\n\t\t\t$Val->ControlEnvio('peticionAjax(\"FormularioGuion\", \"Respuesta\");');\n\t\t\treturn $Val->Constructor('FormularioGuion');\n\t\t}", "public function form()\n {\n // 设置隐藏表单,传递用户id\n $check_status = [\n 'verify' => '已审核',\n 'overrule' => '驳回',\n ];\n $this->hidden('id')->value($this->id);\n $this->hidden('num')->value(0);\n $this->hidden('status')->value('verify');\n\n $this->radio('status', '审批')->options($check_status)->default('verify');\n $this->text('num', '准购数量')->default($this->wait_num)->rules('required');\n $this->textarea('reason', '审核意见');\n }", "public function form($values = array())\n {\n $form = new Zend_Form();\n $form->setAttrib('id', 'locationTypeForm')\n ->setDecorators(array(\n 'FormElements',\n array('HtmlTag', array('tag' => 'div', 'class' => 'zend_form')),\n 'Form',\n ));\n \n $name = $form->createElement('text', 'name', array('label' => 'Name:'));\n $name->setRequired(true)\n ->addFilter('StringTrim')\n ->addFilter('StripTags')\n ->setAttrib('maxlength', '64')\n ->setValue((isset($values['name']) ? $values['name'] : ''));\n \n// $status = $form->createElement('select', 'status', array('label' => 'Status:'));\n// $status->addMultiOption('enabled', 'Enabled');\n// $status->addMultiOption('disabled', 'Disabled');\n// $status->setValue((isset($values['status']) ? $values['status'] : 'enabled')); \n \n// $capacity = $form->createElement('text', 'capacity', array('label' => 'Capacity:'));\n// $capacity->setRequired(true)\n// ->addFilter('StringTrim')\n// ->addFilter('StripTags')\n// ->addValidator('Digits')\n// ->setAttrib('maxlength', '64')\n// ->setValue((isset($values['capacity']) ? $values['capacity'] : ''));\n\n// $address = $form->createElement('text', 'address', array('label' => 'Address:'));\n// $address->setRequired(true)\n// ->addFilter('StringTrim')\n// ->addFilter('StripTags')\n// ->setAttrib('maxlength', '255')\n// ->setValue((isset($values['address']) ? $values['address'] : '')); \n \n $description = $form->createElement('textarea', 'description', array('label' => 'Description:')); \n $description->setRequired(false)\n ->addFilter('StringTrim')\n ->setAttrib('style', 'width: 95%; height: 300px;')\n ->setValue((isset($values['description']) ? $values['description'] : ''));\n \n $submit = $form->createElement('submit', 'submitButton', array('label' => 'Submit'));\n $submit->setDecorators(array(\n array('ViewHelper', array('helper' => 'formSubmit'))\n ));\n\n $cancel = $form->createElement('button', 'cancel', array('label' => 'Cancel'));\n $cancel->setAttrib('id', 'cancel');\n $cancel->setDecorators(array(\n array('ViewHelper', array('helper' => 'formButton'))\n ));\n \n $form->addElements(array($name, $description));\n\n $form->setElementDecorators(array(\n 'ViewHelper',\n 'Errors',\n array('HtmlTag', array('tag' => 'div', 'class' => 'elm')),\n array('Label', array('tag' => 'span')),\n ))\n ->addElements(array($submit, $cancel));\n\n if (isset($values['typeId'])) {\n\n $locationId = $form->createElement('hidden', 'typeId');\n $locationId->setValue($values['typeId']);\n $locationId->setDecorators(array(\n array('ViewHelper', array('helper' => 'formHidden'))\n ));\n\n $form->addElement($locationId);\n }\n return $form;\n }", "public function form()\n {\n $this->text('姓名')->rules('required');\n $this->email('电子邮箱')->rules('email');\n $this->datetime('创建时间');\n }", "public function createComponentGenerateForm() {\n $form = new Form;\n\n\n $groups = $this->groups->getForTest($this->user->id);\n\n $form->addSelect('groupBox', 'Skupina:', $groups);\n $form->addHidden('test_id', $this->getParameter('testId'));\n $form->addText('questionCount')->setRequired('Zadejte počet otázek');\n $form->addText('answerCount')->setRequired('Zadejte počet odpovědí');\n $form->addRadioList('pageFormat', 'Formát stránky', array('a4' => 'A4', 'a5' => 'A5'))\n ->setRequired('Vyberte formát stránky');\n $form->addTextArea('students');\n\n $form->onSuccess[] = callback($this, 'generateFormSubmitted');\n $form->addSubmit('submit');\n\n return $form;\n }", "public function buildForm() {\n\t\techo \"<!DOCTYPE html>\n\t\t<html>\n\t\t<head>\n\t\t\t<title>$this->title</title>\n\t\t</head>\n\t\t<body>\n\t\t<form method=\\\"$this->method\\\">\";\n\t\tforeach ($this->_inputs as $key => $input) {\n\t\t\t// Check if email validation is required.\n\t\t\tif (isset($input['rule']) && in_array('email', $input['rule'])) {\n\t\t\t\t$input['inputType'] = 'email';\n\t\t\t}\n\n\t\t\techo \"<label>\".$input['label'].\"</label><input type=\\\"\".$input['inputType'].\"\\\" id=\\\"\".$input['name'].\"\\\" name=\\\"\".$input['name'].\"\\\" value=\\\"\".$input['defaultValue'].\"\\\"\";\n\n\t\t\t// Check if field was required.\n\t\t\tif (isset($input['rule']) && in_array('required', $input['rule'])) {\n\t\t\t\techo \" required\";\n\t\t\t}\n\n\t\t\techo \"><br></form>\";\n\t\t}\n\t}", "protected function form()\n {\n $form = new Form(new WarningPackage);\n\n $form->date('create_date', '日期')->rules('required');\n $form->text('number', '单号')->rules('required');\n $form->text('number_pre', '原始单号');\n\n $area_names = DB::table('area_name') -> get();\n foreach($area_names as $vo){\n $area_setting[$vo -> id] = $vo -> area_name;\n }\n $form->select('area_id','区域')->options($area_setting)->rules('required');\n\n $wxuser = DB::table('wxuser') -> get(['nickname','id']);\n //dd($wxuser);\n $option_wxuser = [];\n foreach($wxuser as $vo){\n $option_wxuser[$vo -> id] = 'ID:'.$vo -> id.'---昵称:'.$vo -> nickname;\n }\n\n $form -> select('user_id','客户') -> options($option_wxuser)->rules('required');\n $warning_reason = config('admin.warning_reason');\n $form -> select('reason','异常原因') -> options($warning_reason) -> rules('required');\n $tracking_status = config('admin.warning_tracking_status');\n $form -> select('tracking_status','最新物流状态')-> options($tracking_status) -> rules('required');\n\n $form->text('name', '收件人');\n //$form->text('tel', '电话');\n //$form->text('address', '地址');\n //$form->number('status', '状态');\n $form->decimal('tax_price', '税金');\n $form->textarea('remark', '备注');\n\n return $form;\n }", "public function form()\n {\n // 设置隐藏表单,传递用户id\n $check_status = [\n 'no_void' => '正常',\n 'void' => '作废',\n ];\n $this->hidden('id')->value($this->id);\n $this->hidden('status')->value('void');\n\n $this->radio('status', '是否作废')->options($check_status)->default('void');\n $this->textarea('reason', '作废原因');\n }", "public function buildForm()\n {\n }", "function FormAsseretion(){\r\n $creat = new UIMAP_createFormPage();\r\n \r\n $this->assertElementPresent($creat->formName());\r\n $this->assertElementPresent($creat->formLanguige());\r\n for($i = 1; $i < 4; $i++){\r\n $this->assertElementPresent($creat->formRespuniqtype($i));\r\n }\r\n $this->assertElementPresent($creat->submitButton());\r\n }", "protected function form()\n {\n $form = new Form(new CompanyCulture());\n\n $form->text('name', '企业名称')->rules('required');\n $form->text('en_name', '企业名称(en)')->rules('required');\n $form->image('image_url', '图片')->rules('required|image');\n $form->editor('content', '内容')->rules('required');\n\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`列表`按钮\n $tools->disableList();\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n\n\n $form->footer(function ($footer) {\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n });\n\n return $form;\n }", "function validarFormulario()\n\t\t{\n\t\t}", "abstract function form();", "function form1()\r\n {\r\n global $f3;\r\n $isValid= true;\r\n if (!validString($f3->get('animal'))) {\r\n $isValid = false;\r\n $f3->set(\"errors['animal']\", \"Please enter an animal \");\r\n }\r\n if (!validQty($f3->get('qty'))) {\r\n $isValid = false;\r\n $f3->set(\"errors['qty']\", \"Please enter quantity\");\r\n }\r\n return $isValid;\r\n }", "function form() {\n\tglobal $cert_amt_tbl;\n\t\n\t$certificates_form = table_form_header('* indicates required field');\n\t$certificates_form .= table_form_field('Sort:','<input name=\"crtamt_sort\" type=\"text\" size=\"5\" maxlength=\"12\" value=\"'.$cert_amt_tbl->crtamt_sort.'\">');\n\t$certificates_form .= table_form_field('<span class=\"required\">*Discount Amount:</span>','<input name=\"discount_amount\" type=\"text\" size=\"5\" maxlength=\"15\" value=\"'.$cert_amt_tbl->discount_amount.'\">');\n\t$certificates_form .= table_form_field('Discount Cost:','<input name=\"cost\" type=\"text\" size=\"5\" maxlength=\"12\" value=\"'.$cert_amt_tbl->cost.'\">');\n\t$certificates_form .= table_form_field('Min Spend Amounts:','<input name=\"min_spend_amts\" type=\"text\" size=\"30\" value=\"'.$cert_amt_tbl->min_spend_amts.'\">');\n\t$certificates_form .= table_span_form_field('<center><input name=\"id\" type=\"hidden\" value=\"'.$cert_amt_tbl->id.'\"><input name=\"submit\" type=\"submit\" value=\"Submit\"></center>');\n\t\n return $certificates_form;\n }", "protected function Form_Create() {\n\t\t\t$this->txtValue1 = new QTextBox($this);\n\t\t\t\n\t\t\t$this->txtValue2 = new QTextBox($this);\n\t\t\t\n\t\t\t$this->lstOperation = new QListBox($this);\n\t\t\t$this->lstOperation->AddItem('+', 'add');\n\t\t\t$this->lstOperation->AddItem('-', 'subtract');\n\t\t\t$this->lstOperation->AddItem('*', 'multiply');\n\t\t\t$this->lstOperation->AddItem('/', 'divide');\n\t\t\t\n\t\t\t$this->btnCalculate = new QButton($this);\n\t\t\t$this->btnCalculate->Text = 'Calculate';\n\t\t\t$this->btnCalculate->AddAction(new QClickEvent(), new QServerAction('btnCalculate_Click'));\n\t\t\t\n\t\t\t$this->lblResult = new QLabel($this);\n\t\t\t$this->lblResult->HtmlEntities = false;\n\t\t}", "protected function form()\n {\n $form = new Form(new Goods);\n\n $form->text('title', trans('admin.title'))->required()->rules('required');\n $form->text('slogan', trans('admin.slogan'))->required()->rules('required');\n $form->text('name', trans('admin.name'))->required()->rules('required');\n $form->decimal('price', trans('admin.price'))->required()->rules('required');\n $form->display('created_at', trans('admin.created_at'));\n $form->display('updated_at', trans('admin.updated_at'));\n return $form;\n }", "private function setRules()\n {\n $form = array(\n array(\n 'field' => 'nama_agen',\n 'label' => 'Nama Agen',\n 'rules' => 'required|max_length[25]'\n ),\n array(\n 'field' => 'alamat_agen',\n 'label' => 'Alamat Agen',\n 'rules' => 'max_length[50]'\n ),\n );\n return $form;\n }", "public function form_builder()\n {\n // ToDo run checks when form is being created, please.\n// if(!empty($this->check())):\n// throw new ValidationError(checks_html_output($this->check()));\n//\n// endif;\n\n return new form\\ModelForm($this, $this->_field_values());\n }", "protected function form()\n {\n $form = new Form(new UserHealth());\n\n $form->number('height', __('Height'));\n $form->number('weight', __('Weight'));\n $form->text('blood_pressure', __('Blood pressure'));\n $form->text('sugar_level', __('Sugar level'));\n $form->text('blood_type', __('Blood type'));\n $form->decimal('muscle_mass', __('Muscle mass'))->default(0);\n $form->text('metabolism', __('Metabolism'));\n $form->textarea('genetic_history', __('Genetic history'));\n $form->textarea('illness_history', __('Illness history'));\n $form->textarea('allergies', __('Allergies'));\n $form->textarea('prescription', __('Prescription'));\n $form->textarea('operations', __('Operations'));\n $form->number('user_id', __('User id'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Exam());\n\n $form->text('exam_name', __('试卷名称'));\n $form->text('description', __('试卷描述'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Resources);\n\n $form->text('name', '名称')->rules('required',['required' => '请输入 配置项的名称']);\n\n $form->radio('type', '类型')->options(Resources::TYPE);\n\n $form->cropper('url','图片');\n\n $form->number('sort_num','排序');\n\n $form->textarea('memo','备注');\n\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n\n // 去掉`查看`按钮\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n\n return $form;\n }", "private function createForm()\n\t{\n\t\t$builder = $this->getService('form')->create();\n\t\t$builder->setValidatorService($this->getService('validator'));\n\t\t$builder->setFormatter(new BasicFormFormatter());\n\t\t$builder->setDesigner(new DoctrineDesigner($this->getDoctrine(), 'Entity\\User',array('location')));\n\n\t\t$builder->getField('location')->setRequired(true);\n\t\t$builder->submit($this->getRequest());\n\n\t\treturn $builder;\n\t}", "public function populateForm() {}", "protected function form()\n {\n $form = new Form(new EnterPlan);\n\n $form->date('enter_time', __('进线时间'))->default(date('Y-m-d'));\n $form->text('a1', __('1'));\n $form->text('a2', __('1A'));\n $form->text('a3', __('2'));\n $form->text('a4', __('2A'));\n $form->text('a5', __('3'));\n $form->text('a6', __('5'));\n $form->text('a7', __('10'));\n $form->text('a8', __('11'));\n $form->text('a9', __('11A'));\n $form->text('a10', __('12'));\n $form->text('a11', __('13'));\n $form->text('a12', __('15'));\n $form->text('a13', __('16'));\n $form->text('a14', __('16A'));\n $form->text('a15', __('17'));\n $form->text('a16', __('18'));\n $form->text('a17', __('19'));\n// $form->text('a18', __('A18'));\n// $form->text('a19', __('A19'));\n// $form->text('a20', __('A20'));\n// $form->text('a21', __('A21'));\n// $form->text('a22', __('A22'));\n// $form->text('a23', __('A23'));\n// $form->text('a24', __('A24'));\n// $form->text('a25', __('A25'));\n// $form->text('a26', __('A26'));\n// $form->text('a27', __('A27'));\n// $form->text('a28', __('A28'));\n// $form->text('a29', __('A29'));\n// $form->text('a30', __('A30'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Goodss);\n $form->switch('is_enable','状态')->options([\n 'on' => ['value' => 1, 'text' => '正常', 'color' => 'primary'],\n 'off' => ['value' => 0, 'text' => '禁止', 'color' => 'default'],\n ]);\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n\n // 去掉`重置`按钮\n //$footer->disableReset();\n\n // 去掉`提交`按钮\n //$footer->disableSubmit();\n\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n return $form;\n }", "protected function form()\n {\n $form = new Form(new MachinesStyle());\n\n $form->text('style_name', __('型号名称'));\n\n $form->select('aa', __('所属类型'))->options(MachinesType::where('state', '1')->get()->pluck('name', 'id'))->load('factory_id', '/api/getAdminFactory');\n\n $form->select('factory_id', __('所属厂商'))->required();\n\n $form->ignore(['aa']);\n\n return $form;\n }", "public function form()\n {\n $this->number('month', '贷款月数')\n ->min(1)\n ->max(360)\n ->required();\n $this->number('total', '贷款总额')\n ->required();\n $this->rate('rate', '贷款利率')\n ->required();\n $this->radio('type', '还款方式')\n ->options(Loan::$typeMap)\n ->required();\n\n $this->html('等额本金法与等额本息法并没有很大的优劣之分,大部分是根据每个人的现状和需求而定的。');\n $this->html('<a target=\"_blank\" href=\"https://zhuanlan.zhihu.com/p/61140535\">等额本息和等额本金的区别!</a>');\n }", "protected function form()\n {\n $form = new Form(new AgeModel);\n\n $form->text('tag_name', 'Tag name');\n $form->number('lable_id', 'Lable id');\n $form->number('add_time', 'Add time');\n\n return $form;\n }", "public function form()\n {\n if ($this->id) {\n $this->hidden('id', 'ID');\n }\n $this->datetime('datetime', '解禁时间')->rules([\n Rule::required(),\n ])->placeholder('选择解禁时间');\n $this->textarea('reason', '封禁原因');\n }", "protected function form()\n {\n $form = new Form(new Boarding()); \n \n $form->select('pet_id',__('Pet Name'))->options(Pet::all()->pluck('name','id'))->rules('required');\n $form->select('reservation_id',__('Reservation'))->options(Reservation::all()->pluck('date','id'))->rules('required');\n $form->select('cage_id',__('Available Cages'))->options(Cage::get()->where(\"availability\",\"Available\")->pluck('id','id'))->rules('required');\n $form->datetime('end_date', __('End date'))->default(date('Y-m-d H:i:s'))->rules('required');\n \n return $form; \n }", "protected function form()\n {\n $form = new Form(new Drug);\n\n $form->text('street_name', '«Уличное» название');\n $form->text('city', 'Город');\n $form->text('active_substance', 'Активное вещество');\n $form->text('symbol', 'Символ');\n $form->text('state', 'Состояние');\n $form->text('color', 'Цвет');\n $form->text('inscription', 'Надпись');\n $form->text('shape', 'Форма');\n $form->text('weight', 'Вес таблетки');\n $form->text('weight_active', 'Вес действующего вещества');\n $form->text('description', 'Описание');\n $form->text('negative_effect', 'Негативный эффект');\n $form->switch('confirm', 'Подтверждение');\n\n return $form;\n }", "abstract public function forms();", "protected function form()\n {\n $form = new Form(new Cases);\n\n $form->select('cate_id', '分类')->options('/admin/api/getcasecate');\n $form->select('algw_id', '顾问')->options('/admin/api/getgw');\n $form->text('title', '标题');\n $form->text('keywords', 'SEO关键字');\n $form->text('description', 'SEO描述');\n $form->text('desc', '副标题');\n $form->text('author', '来源');\n $form->radio('is_tj', '推荐')->options([0=>'否',1=>'是']);\n $form->image('thumb', '缩略图')->uniqueName();\n $form->editor('data', '详情');\n\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Usertype());\n\n $form->text('usertype', '类型名称')->rules('required|max:10');\n $form->tools(function (Form\\Tools $tools) {\n $tools->disableList();\n $tools->disableDelete();\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n $footer->disableReset();\n $footer->disableViewCheck();\n $footer->disableEditingCheck();\n $footer->disableCreatingCheck();\n });\n return $form;\n }", "protected function form()\n {\n $categories = Category::get()->pluck('name', 'id')->toArray();\n\n $form = new Form(new Plan);\n\n $form->select(Plan::CATEGORY_ID, 'Категория')\n ->options($categories)\n ->default(request()->input(Plan::CATEGORY_ID))\n ->required();\n\n $form->text(Plan::COUNT, __('Количество'))->required();\n $form->month('month', __('Месяц'))->default(now()->month)->required();\n $form->year('year', __('Год'))->default(now()->year)->required();\n\n $form->footer(function ($footer) {\n\n // disable `View` checkbox\n $footer->disableViewCheck();\n\n // disable `Continue editing` checkbox\n $footer->disableEditingCheck();\n\n // disable `Continue Creating` checkbox\n $footer->disableCreatingCheck();\n\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Good);\n\n $form->hidden('group_id')->value(session('group_id'));\n $form->text('name', __('Наименование'));\n $form->text('size', __('Объем/кол-во'));\n $form->decimal('price', __('Цена'))->default(0);\n $form->image('file', 'Фото');\n\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Student);\n\n $form->text('surname', 'Фамилия')->rules('required|max:50');\n $form->text('name', 'Имя')->rules('required|max:50');\n $form->text('family_name', 'Отчество')->rules('required|max:255');\n $form->text('telegram_id', 'Telegram-id')->rules('nullable');\n $form->email('email', 'Email');\n $form->text('number', 'Контактный телефон')->rules('max:100');;\n $form->select('groups_id', 'Ид группы')->options(Group::all()->pluck('name', 'id'))\n ->rules('required');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Customer);\n\n $form->text('code', '客户编号');\n $form->text('name', '客户名称');\n// $form->text('openid', '客户openid');\n $form->text('contactor', '联系人');\n $form->text('tel', '联系电话');\n $form->email('email', '邮箱');\n $form->text('address', '地址');\n $form->decimal('receivables', '应收账款数字')->default(0.00);\n $form->text('fax', '传真');\n $form->switch('is_delete', '是否删除');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Good);\n $form->text('name', __('名称'))->rules('required');\n $form->decimal('amount', __('价格'))->default(0.00)->rules('required');\n $form->text('unit', __('单位'))->rules('required');\n $form->image('list_img', __('缩略图(320*320)'))->creationRules('required');\n $form->hasMany('goodsimgs', __('轮播图(640*640)'),function(Form\\NestedForm $form){\n $form->image('img',__('轮播图'))->creationRules('required');\n });\n $form->kindeditor('describe', __('描述'));\n // 去掉`查看`checkbox\n $form->disableViewCheck();\n // 去掉`继续编辑`checkbox\n $form->disableEditingCheck();\n // 去掉`继续创建`checkbox\n $form->disableCreatingCheck();\n return $form;\n }", "private function validateForm(): void\n { if ($this->form->isSubmitted()) {\n // get the status\n $status = $this->getRequest()->request->has('saveAsDraft') ? 'draft' : 'active';\n\n // cleanup the submitted fields, ignore fields that were added by hackers\n $this->form->cleanupFields();\n\n // validate fields\n $this->form->getField('title')->isFilled(BL::err('TitleIsRequired'));\n $this->form->getField('text')->isFilled(BL::err('FieldIsRequired'));\n $this->form->getField('publish_on_date')->isValid(BL::err('DateIsInvalid'));\n $this->form->getField('publish_on_time')->isValid(BL::err('TimeIsInvalid'));\n $this->form->getField('category_id')->isFilled(BL::err('FieldIsRequired'));\n if ($this->form->getField('category_id')->getValue() == 'new_category') {\n $this->form->getField('category_id')->addError(BL::err('FieldIsRequired'));\n }\n\n // validate meta\n $this->meta->validate();\n\n if ($this->form->isCorrect()) {\n // build item\n $item = [\n 'id' => (int) BackendBlogModel::getMaximumId() + 1,\n 'meta_id' => $this->meta->save(),\n 'category_id' => (int) $this->form->getField('category_id')->getValue(),\n 'user_id' => $this->form->getField('user_id')->getValue(),\n 'language' => BL::getWorkingLanguage(),\n 'title' => $this->form->getField('title')->getValue(),\n 'introduction' => $this->form->getField('introduction')->getValue(),\n 'text' => $this->form->getField('text')->getValue(),\n 'publish_on' => BackendModel::getUTCDate(\n null,\n BackendModel::getUTCTimestamp(\n $this->form->getField('publish_on_date'),\n $this->form->getField('publish_on_time')\n )\n ),\n 'created_on' => BackendModel::getUTCDate(),\n 'hidden' => $this->form->getField('hidden')->getValue(),\n 'allow_comments' => $this->form->getField('allow_comments')->getChecked(),\n 'num_comments' => 0,\n 'status' => $status,\n ];\n $item['edited_on'] = $item['created_on'];\n\n // insert the item\n $item['revision_id'] = BackendBlogModel::insert($item);\n\n if ($this->imageIsAllowed) {\n // the image path\n $imagePath = FRONTEND_FILES_PATH . '/Blog/images';\n\n // create folders if needed\n $filesystem = new Filesystem();\n $filesystem->mkdir([$imagePath . '/source', $imagePath . '/128x128']);\n\n // image provided?\n if ($this->form->getField('image')->isFilled()) {\n // build the image name\n $item['image'] = $this->meta->getUrl()\n . '-' . BL::getWorkingLanguage()\n . '-' . $item['revision_id']\n . '.' . $this->form->getField('image')->getExtension();\n\n // upload the image & generate thumbnails\n $this->form->getField('image')->generateThumbnails($imagePath, $item['image']);\n\n // add the image to the database without changing the revision id\n BackendBlogModel::updateRevision($item['revision_id'], ['image' => $item['image']]);\n }\n }\n\n // save the tags\n BackendTagsModel::saveTags($item['id'], $this->form->getField('tags')->getValue(), $this->url->getModule());\n\n // active\n if ($item['status'] == 'active') {\n // add search index\n BackendSearchModel::saveIndex($this->getModule(), $item['id'], ['title' => $item['title'], 'text' => $item['text']]);\n\n // everything is saved, so redirect to the overview\n $this->redirect(BackendModel::createUrlForAction('Index') . '&report=added&var=' . rawurlencode($item['title']) . '&highlight=row-' . $item['revision_id']);\n } elseif ($item['status'] == 'draft') {\n // draft: everything is saved, so redirect to the edit action\n $this->redirect(BackendModel::createUrlForAction('Edit') . '&report=saved-as-draft&var=' . rawurlencode($item['title']) . '&id=' . $item['id'] . '&draft=' . $item['revision_id'] . '&highlight=row-' . $item['revision_id']);\n }\n }\n }\n }", "protected function form()\n {\n $form = new Form(new Leavetime());\n\n /*$form->select('designer_id',__('设计师'))->options(function ($id) {\n $designer = Designer::find($id);\n\n if ($designer) {\n return [$designer->id => $designer->name];\n }\n })->ajax('/admin/api/designer')->required();*/\n $form->select('designer_id',__('设计师'))->options(Designer::all()->pluck('name', 'id'))->required();\n $form->radio('type', __('请假类型'))->options(['0' => '全天', '1'=> '半天'])->default(0)\n ->required()->help('如果请假为半天请填写请假时间段, 全天无需填写时间段');\n $form->date('date', __('请假日期'))->default(date('Y-m-d'));\n $form->embeds('time',__('时间段'), function ($form) {\n $form->select('start_time', __('开始时间'))->options(Worktime::all()->pluck('time', 'id'));\n $form->select('end_time', __('结束时间'))->options(Worktime::all()->pluck('time', 'id'));\n\n });\n return $form;\n }", "abstract function setupform();", "protected function form()\n {\n $form = new Form(new Enseignant());\n\n $form->text('matricule', __('Matricule'));\n $form->text('nom', __('Nom'));\n $form->text('postnom', __('Postnom'));\n $form->text('prenom', __('Prenom'));\n $form->text('sexe', __('Sexe'));\n $form->text('grade', __('Grade'));\n $form->text('fonction', __('Fonction'));\n\n return $form;\n }", "protected function createFormFields() {\n\t}", "protected function form()\n {\n $form = new Form(new Client);\n\n // dd(Gender::LakiLaki());\n $gender = [\n Gender::LakiLaki()->value => Gender::LakiLaki()->description,\n Gender::Perempuan()->value => Gender::Perempuan()->description,\n ];\n\n $marital_statuses = [\n MaritalStatus::BelumKawin()->value => MaritalStatus::BelumKawin()->description,\n MaritalStatus::Kawin()->value => MaritalStatus::Kawin()->description,\n MaritalStatus::CeraiHidup()->value => MaritalStatus::CeraiHidup()->description,\n MaritalStatus::CeraiMati()->value => MaritalStatus::CeraiMati()->description,\n ];\n\n $blood_types = ['A', 'B', 'AB', 'O'];\n\n $form->display('id', 'ID');\n\n $form->text('nik', \"NIK\")->inputmask([\"mask\" => 9, \"repeat\" => 16]);\n $form->text('name', \"Nama\");\n $form->select('gender', 'Jenis Kelamin')->options($gender);\n $form->text('birth_place', \"Tempat Lahir\");\n $form->date('birth_date', \"Tanggal Lahir\");\n $form->text('occupation', \"Pekerjaan\")->icon('fa-briefcase');\n $form->text('latest_education', \"Pendidikan Terakhir\")->icon('fa-school');\n $form->text('religion', \"Agama\");\n $form->select('marital_status', \"Status Perkawinan\")->options($marital_statuses);\n $form->select('blood_type', \"Golongan Darah\")->options($blood_types);\n $form->text('postal_code', \"Kode Pos\")->inputmask([\"mask\" => 99999])->icon('fa-map-pin');\n $form->textarea('address', \"Alamat\");\n $form->text('rtrw', 'RT/RW')->inputmask([\"mask\" => \"999/999\"]);\n $form->text('location_address', \"Lokasi\");\n $form->select('provinces', 'Provinsi')->options(function ($id) {\n return Province::options($id);\n })->ajax('/admin/api/v1/indonesian/provinces');\n $form->hidden('extras');\n\n $form->display('created_at', trans('admin.created_at'));\n $form->display('updated_at', trans('admin.updated_at'));\n\n if ($form->isCreating())\n $form->tools(function (Form\\Tools $tools) {\n $tools->disableDelete();\n // $tools->disableView();\n // $tools->disableList();\n });\n \n $form->ignore(['rtrw', 'location_address', 'provinces']);\n $form->saving(function (Form $form) {\n $form->extras = json_encode($form->rtrw);\n // dump(request()->all());\n // dump($form->rtrw);\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Dictionary());\n $form->disableViewCheck();\n $form->disableEditingCheck();\n $form->disableCreatingCheck();\n\n\n $form->select('type', __('Type'))->options(Dictionary::TYPES);\n $form->text('option', __('Title'))->required();\n $form->text('slug', __('Slug'))->rules('nullable|regex:/(\\w\\d\\_)*/', [\n 'regex' => 'Только латинские буквы и знаки подчеркивания',\n ]);\n $form->text('alternative', __('Alternative'));\n $form->switch('approved', __('Approved'))->default(1);\n $form->number('sort', __('Sort'));\n\n $form->saving(function (Form $form) {\n if ($form->slug === null) {\n $form->slug = Str::slug($form->option);\n }\n });\n return $form;\n }", "protected function form()\n {\n $form = new Form(new User());\n\n $form->mobile('phone', __('手机号'));\n $form->text('uname', __('姓名'));\n $form->text('wechat', __('微信号'));\n $form->text('phonenumber', __('联系电话'));\n $form->text('position', __('岗位'));\n $form->text('company', __('公司'));\n $form->switch('role', __('角色'));\n $form->switch('state', __('核实状态'));\n $form->datetime('create_date', __('创建时间'))->default(date('Y-m-d H:i:s'));\n // $form->text('openid', __('Openid'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new BlogSubscribe);\n $form->email('email', __('邮箱名称'))->creationRules('required|unique:blog_subscribes,email');\n $pass_status = [1 => '审核中', 2 => '审核通过', 3 => '冻结封禁'];\n $form->radio('is_pass', __('审核状态'))->options($pass_status)->default(1);\n $form->hidden('add_mode')->default(2);\n return $form;\n }", "public function createValidator();", "protected function form()\n {\n $form = new Form(new User());\n\n $id = request()->route('user');\n if ($id) {\n $unique_rule = Rule::unique('users')->ignore($id);\n } else {\n $unique_rule = 'unique:users';\n }\n $form->text('name', __('微信昵称'))->rules(['required', 'max:40'], [\n 'required' => '昵称未填写',\n 'max' => '昵称长度最大为40'\n ]);\n $form->mobile('phone', __('手机号'))->rules(['required', $unique_rule], [\n 'required' => '手机号未填写',\n 'unique' => '手机号已存在',\n ]);\n\n $form->switch('info.sub',__('订阅'))->default(false);\n // 账号类别:0-普通用户,1-二级代理,2-一级代理\n $form->select('info.type', __('账号类别'))->options(config('admin.user_type'));\n // 性别:0-保密,1-男,2-女\n $form->select('info.gender', __('性别'))->options(config('admin.gender'));\n $form->image('avatar', __('微信头像'));\n $form->password('password', __('密码 '));\n\n\n return $form;\n }", "public function validation();", "function inscription_jesa_manage_validate($form, &$form_state) {\n \n}", "protected function form()\n {\n $form = new Form(new NewEnergy());\n\n $form->number('user_id', __('User id'));\n $form->text('car_id', __('车辆ID'));\n $form->image('start_mileage', __('开始'));\n $form->image('end_mileage', __('介绍'));\n $form->decimal('mileage', __('里程 / 时间'));\n $form->select('type', __('类型'))->options([\n \"1\" => \"电动车\",\n \"2\" => \"燃油车\",\n ]);\n $form->select('status', __('状态'))->options([\n \"1\" => \"审核中\",\n \"10\" => \"审核拒绝\",\n \"20\" => \"审核撤销\",\n \"30\" => \"审核通过\"\n ]);\n $form->text('remark', __('Remark'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Setting());\n\n $form->decimal('member_fee', __('会员年费'))->required();\n $form->decimal('task_rate', __('任务佣金抽成比例'))->required()->help('将扣除对应比例,比例范围0-1');\n $form->tools(function (Form\\Tools $tools) {\n\n // 去掉`列表`按钮\n $tools->disableList();\n\n // 去掉`删除`按钮\n $tools->disableDelete();\n\n // 去掉`查看`按钮\n $tools->disableView();\n });\n\n $form->footer(function ($footer) {\n\n // 去掉`重置`按钮\n $footer->disableReset();\n\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n\n //保存后回调\n $form->saved(function (Form $form) {\n $success = new MessageBag([\n 'title' => '提示',\n 'message' => '保存成功',\n ]);\n\n return back()->with(compact('success'));\n });\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Member);\n\n $form->text('open_id', 'Open id');\n $form->text('wx_open_id', 'Wx open id');\n $form->text('access_token', 'Access token');\n $form->number('expires', 'Expires');\n $form->text('refresh_token', 'Refresh token');\n $form->text('unionid', 'Unionid');\n $form->text('nickname', 'Nickname');\n $form->switch('subscribe', 'Subscribe');\n $form->switch('sex', 'Sex');\n $form->text('headimgurl', 'Headimgurl');\n $form->switch('disablle', 'Disablle');\n $form->number('time', 'Time');\n $form->mobile('phone', 'Phone');\n\n return $form;\n }", "protected function _processValidForm()\n {\n $table = $this->_getTable();\n\n $formValues = $this->_getForm()->getValues();\n\n if (!empty($formValues[$this->_getPrimaryIdKey()])) {\n $row = $this->_getRow($this->_getPrimaryId());\n } else {\n $row = $table->createRow();\n }\n\n foreach ($formValues as $key => $value) {\n if (isset($row->$key) && !$table->isIdentity($key)) {\n $row->$key = $value;\n }\n }\n\n $row->save();\n\n $this->_goto($this->_getBrowseAction());\n }", "protected function form()\n {\n $form = new Form(new Ticket);\n\n\n $form->text('ticket_article', 'Номер заявки')->default(mt_rand(100000, 999999))->placeholder(' ');\n $form->text('fio', 'ФІО')->placeholder(' ');\n $form->mobile('phone', 'Телефон')->options(['mask' => '+38(999) 999 99 99'])->placeholder(' ');\n $form->text('city', 'Місто')->placeholder(' ');\n $form->text('adress', 'Адреса')->placeholder(' ');\n $form->email('email', 'Email')->placeholder(' ');\n $form->select('type', 'Тип')->options([\n 'Ремонт' => 'Ремонт',\n 'Запчастини' => 'Запчастини',\n 'Дефект' => 'Дефект'\n ])->placeholder(' ');\n $form->text('brand', 'Бренд')->placeholder(' ');\n $form->text('model', 'Модель')->placeholder(' ');\n $form->text('serial_number', 'С/Н')->placeholder(' ');\n\n $form->date('date_sale', 'Дата продажу')->format('DD.MM.YYYY')->placeholder(' ');\n $form->textarea('description', 'Додатково')->placeholder(' ');\n $form->multipleFile('files', 'Файли')->placeholder(' ');\n $form->textarea('answer', 'Відповідь клієнту')->placeholder(' ');\n $form->select('status', 'Статус')->options([\n 'Відкрита' => 'Відкрита',\n 'В обробці' => 'В обробці',\n 'Закрита' => 'Закрита'\n ])->placeholder(' ');\n\n return $form;\n }", "protected function form()\n {\n $Adv=new Adv();\n $form = new Form($Adv);\n $platform= $Adv->platform;\n $type= $Adv->type;\n $status= $Adv->status;\n $list_array=[\n array(\"field\"=>\"title\",\"title\"=>\"标题\",\"type\"=>\"text\"),\n array(\"field\"=>\"platform\",\"title\"=>\"平台\",\"type\"=>\"select\",\"array\"=>$platform),\n array(\"field\"=>\"type\",\"title\"=>\"类型\",\"type\"=>\"select\",\"array\"=>$type),\n array(\"field\"=>\"image\",\"title\"=>\"图片\",\"type\"=>\"image\"),\n array(\"field\"=>[\"start_time\",\"end_time\"],\"title\"=>\"活动时间\",\"type\"=>\"datetimeRange\"),\n array(\"field\"=>\"font1\",\"title\"=>\"字段1\",\"type\"=>\"text\"),\n array(\"field\"=>\"font2\",\"title\"=>\"字段2\",\"type\"=>\"text\"),\n array(\"field\"=>\"font3\",\"title\"=>\"字段3\",\"type\"=>\"text\"),\n array(\"field\"=>\"font4\",\"title\"=>\"字段4\",\"type\"=>\"text\"),\n array(\"field\"=>\"font5\",\"title\"=>\"字段5\",\"type\"=>\"text\"),\n array(\"field\"=>\"status\",\"title\"=>\"状态\",\"type\"=>\"switch\",\"array\"=>$status),\n array(\"field\"=>\"created_at\",\"title\"=>\"创建时间\",\"type\"=>\"value\")\n ];\n BaseControllers::set_form($form,$list_array);\n return $form;\n }", "protected function form()\n {\n $form = new Form(new LotteryCode());\n\n $form->text('code', __('Code'));\n $form->number('batch_num', __('Batch num'));\n $form->text('prizes_name', __('Prizes name'));\n $form->datetime('valid_period', __('Valid period'))->default(date('Y-m-d H:i:s'));\n $form->datetime('prizes_time', __('Prizes time'))->default(date('Y-m-d H:i:s'));\n $form->text('operator', __('Operator'));\n $form->switch('award_status', __('Award status'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Activity());\n\n $form->text('name', __('Name'));\n $form->image('image', __('Image'));\n $form->text('intro', __('Intro'));\n $form->UEditor('details', __('Details'));\n $form->datetime('start_at', __('Start at'))->default(date('Y-m-d H:i:s'));\n $form->datetime('end_at', __('End at'))->default(date('Y-m-d H:i:s'));\n $form->text('location', __('Location'));\n $form->decimal('fee', __('Fee'))->default(0.00);\n $form->number('involves', __('Involves'));\n $form->number('involves_min', __('Involves min'));\n $form->number('involves_max', __('Involves max'));\n $form->switch('status', __('Status'));\n $form->text('organizers', __('Organizers'));\n $form->number('views', __('Views'));\n $form->switch('is_stick', __('Is stick'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new FinancialPrizeModel);\n\n $form->display('id', 'ID');\n $form->select('user_id', '用户名')->options(UserModel::getAllUsersPluck())->rules('required');\n $form->select('type', '类型')->options(FinancialPrizeModel::getCommonPluck())->rules('required');\n $form->month('date', '所属月份')->format('YYYY-MM')->rules('required');\n $form->number('money', '金额');\n $form->text('mark', '简要说明')->help('奖项具体名称等,最多输入100字');\n $form->hidden('year', 'year');\n\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n\n $form->saving(function (Form $f) {\n $f->year = substr($f->date, 0, 4);\n $f->date = $f->date . '-01';\n });\n\n return $form;\n }", "protected function form()\n {\n $chainIds = Chain::query()->pluck(\"title\", \"chainId\")->toArray();\n\n return Form::make(new Pair(), function (Form $form) use ($chainIds) {\n $form->display('id');\n $form->select('fromChain')\n ->options($chainIds)\n ->required();\n $form->select('toChain')->options($chainIds)->required();\n $form->text('name')->required();\n $form->text('title')->required();\n $form->text('decimal')->required()->default(0);\n $form->text('fromToken')\n ->default(\"0x0000000000000000000000000000000000000000\")\n ->placeholder(\"如果是主网币跨出请输入 0x0000000000000000000000000000000000000000\");\n $form->text('toToken')->required();\n $form->text('tokenFee')\n ->placeholder(\"资产本身转账需要扣除的手续费\")\n ->default(0);\n $form->text('bridgeFee')\n ->placeholder(\"资产跨链需要扣除的手续费\")\n ->default(0);\n $form->switch('isMain')->default(0);\n $form->switch('isNative')->default(0);\n $form->switch('isStop')->default(0);\n $form->text('minValue')->default(0);\n $form->text('limit')->default(0);\n $form->image('icon');\n $form->text('sort')->default(0);\n });\n }", "public function form()\n {\n return Administrator::form(function (Form $form) {\n\n //工具按钮\n $form->tools(function (Form\\Tools $tools) {\n // 去掉返回按钮\n $tools->disableBackButton();\n // 去掉跳转列表按钮\n $tools->disableListButton();\n });\n\n $form->text('custno', '客户号')->rules('required');\n $form->radio('acctype', '账户类型')->options(['00' => '对私', '01'=> '对公'])->default('00');\n $form->text('accbank', '开户银行')->rules('required');\n\n $form->text('cardno', '银行卡号')->rules('required');\n $form->text('cardname', '持卡人姓名')->rules('required');\n $form->text('idno', '身份证号码')->rules('required');\n $form->mobile('mobileno','手机号')->rules('required')->options(['mask' => '99999999999']);\n\n $form->text('corpname', '企业名称')->rules('required');\n $form->text('corpcode', '企业统一信用代码')->rules('required');\n $form->text('corpaccno', '企业银行账号')->rules('required');\n\n\n });\n }", "function validar() {\n leerClase('Formulario');\n Formulario::validar('login' , $this->login , 'texto', 'El Nombre de Usuario');\n Formulario::validar('clave', $this->clave, 'texto', 'Contraseña');\n \n }", "public function form()\n {\n $this->text('old_password', '原密码')->rules('required');\n $this->text('new_password', '新密码')->rules('required');\n $this->text('confirm_password', '重复新密码')->rules('required');\n }", "protected function initializeForm()\n {\n $this->form = new Form();\n $this->form->add(Element::create(\"FieldSet\",\"Report Format\")->add\n (\n Element::create(\"SelectionList\", \"File Format\", \"report_format\")\n ->addOption(\"Hypertext Markup Language (HTML)\",\"html\")\n ->addOption(\"Portable Document Format (PDF)\",\"pdf\")\n ->addOption(\"Microsoft Excel (XLS)\",\"xls\")\n ->addOption(\"Microsoft Word (DOC)\",\"doc\")\n ->setRequired(true)\n ->setValue(\"pdf\"),\n Element::create(\"SelectionList\", \"Page Orientation\", \"page_orientation\")\n ->addOption(\"Landscape\", \"L\")\n ->addOption(\"Portrait\", \"P\")\n ->setValue(\"L\"),\n Element::create(\"SelectionList\", \"Paper Size\", \"paper_size\")\n ->addOption(\"A4\", \"A4\")\n ->addOption(\"A3\", \"A3\")\n ->setValue(\"A4\")\n )->setId(\"report_formats\")->addAttribute(\"style\",\"width:50%\")\n );\n $this->form->setSubmitValue(\"Generate\");\n $this->form->addAttribute(\"action\",Application::getLink($this->path.\"/generate\"));\n $this->form->addAttribute(\"target\",\"blank\");\n }", "public function registrationForm() {\n\n }", "abstract function builder_form(): string;", "public function createComponentQuestionForm() {\n $form = new Form;\n\n $form->addHidden('test_id');\n $form->addHidden('id');\n $form->addTextArea('text', 'Text')->setRequired();\n $form->addSubmit('submit');\n $form->setDefaults($this->questions->getById($this->questionId));\n $form->onSuccess[] = $this->questionFormSucceeded;\n\n return $form;\n }", "private function makeform() {\n\tglobal $qqi;\n\t\n\t$form=new llform($this,'form');\n\t$form->addFieldset('d','');\n\t$form->addControl('d',new ll_listbox($form,'users','Users'));\n\t$form->addControl('d',new ll_button($form,'allusers','Select All','button'));\n\t$form->addControl('d',new ll_listbox($form,'functions','Functions'));\n\t$form->addControl('d',new ll_button($form,'allfunctions','Select All','button'));\n\t$rg=new ll_radiogroup($form,'showby');\n\t\t$rg->addOption('byusers','Rows of Users');\n\t\t$rg->addOption('byfunctions','Rows of Functions');\n\t\t$rg->setValue('byfunctions');\n\t$form->addControl('d',$rg);\t\n\t$form->addControl('d',new ll_button($form,'update','Update Display','button'));\n\treturn $form;\n}", "public function Form() {\n\t\t$fields = new FieldSet();\n\t\t$fieldValidation = array();\n\t\t$fieldValidationRules = array();\n\t\t$CustomDisplayRules = \"\";\n\t\t$defaults = \"\";\n\t\t$this->SubmitButtonText = ($this->SubmitButtonText) ? $this->SubmitButtonText : _t('UserDefinedForm.SUBMITBUTTON', 'Submit');\n\t\tif($this->Fields()) {\n\t\t\tforeach($this->Fields() as $field) {\n\t\t\t\n\t\t\t\t$fieldToAdd = $field->getFormField();\n\t\t\t\t\n\t\t\t\tif(!$fieldToAdd) break;\n\t\t\t\t\n\t\t\t\t$fieldValidationOptions = array();\n\t\t\t\t\n\t\t\t\t// Set the Error Messages\n\t\t\t\t$errorMessage = sprintf(_t('Form.FIELDISREQUIRED').'.', strip_tags(\"'\". ($field->Title ? $field->Title : $field->Name) . \"'\"));\n\t\t\t\t$errorMessage = ($field->CustomErrorMessage) ? $field->CustomErrorMessage : $errorMessage;\n\t\t\t\t$fieldToAdd->setCustomValidationMessage($errorMessage);\n\t\t\t\t\n\t\t\t\t// Is this field required\n\t\t\t\tif($field->Required) {\n\t\t\t\t\t$fieldValidation[$field->Name] = $errorMessage;\n\t\t\t\t\t$fieldValidationOptions['required'] = true;\n\t\t\t\t\t$fieldToAdd->addExtraClass('requiredField');\n\t\t\t\t\tif(UserDefinedForm::$required_identifier) {\n\t\t\t\t\t\t$title = $fieldToAdd->Title() .\" <span class='requiredIdentifier'>\". UserDefinedForm::$required_identifier . \"</span>\";\n\t\t\t\t\t\t$fieldToAdd->setTitle($title);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Add field to the form\n\t\t\t\t$fields->push($fieldToAdd);\n\t\t\t\t\n\t\t\t\t// Ask our form field for some more information on hour it should be validated\n\t\t\t\t$fieldValidationOptions = array_merge($fieldValidationOptions, $field->getValidation());\n\t\t\t\t\n\t\t\t\t// Check if we have need to update the global validation\n\t\t\t\tif($fieldValidationOptions) {\n\t\t\t\t\t$fieldValidationRules[$field->Name] = $fieldValidationOptions;\n\t\t\t\t}\n\t\t\t\t$fieldId = $field->Name;\n\t\t\t\t\n\t\t\t\tif($field->ClassName == 'EditableFormHeading') { \n\t\t\t\t\t$fieldId = 'Form_Form_'.$field->Name;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Is this Field Show by Default\n\t\t\t\tif(!$field->ShowOnLoad) {\n\t\t\t\t\t$defaults .= \"$(\\\"#\" . $fieldId . \"\\\").hide();\\n\";\n\t\t\t\t}\n\n\t\t\t\t// Check for field dependencies / default\n\t\t\t\tif($field->Dependencies()) {\n\t\t\t\t\tforeach($field->Dependencies() as $dependency) {\n\t\t\t\t\t\tif(is_array($dependency) && isset($dependency['ConditionField']) && $dependency['ConditionField'] != \"\") {\n\t\t\t\t\t\t\t// get the field which is effected\n\t\t\t\t\t\t\t$formName = Convert::raw2sql($dependency['ConditionField']);\n\t\t\t\t\t\t\t$formFieldWatch = DataObject::get_one(\"EditableFormField\", \"\\\"Name\\\" = '$formName'\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(!$formFieldWatch) break;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// watch out for multiselect options - radios and check boxes\n\t\t\t\t\t\t\tif(is_a($formFieldWatch, 'EditableDropdown')) {\n\t\t\t\t\t\t\t\t$fieldToWatch = \"$(\\\"select[name='\".$dependency['ConditionField'].\"']\\\")\";\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// watch out for checkboxs as the inputs don't have values but are 'checked\n\t\t\t\t\t\t\telse if(is_a($formFieldWatch, 'EditableCheckboxGroupField')) {\n\t\t\t\t\t\t\t\t$fieldToWatch = \"$(\\\"input[name='\".$dependency['ConditionField'].\"[\".$dependency['Value'].\"]']\\\")\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$fieldToWatch = \"$(\\\"input[name='\".$dependency['ConditionField'].\"']\\\")\";\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// show or hide?\n\t\t\t\t\t\t\t$view = (isset($dependency['Display']) && $dependency['Display'] == \"Hide\") ? \"hide\" : \"show\";\n\t\t\t\t\t\t\t$opposite = ($view == \"show\") ? \"hide\" : \"show\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// what action do we need to keep track of. Something nicer here maybe?\n\t\t\t\t\t\t\t// @todo encapulsation\n\t\t\t\t\t\t\t$action = \"change\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($formFieldWatch->ClassName == \"EditableTextField\" || $formFieldWatch->ClassName == \"EditableDateField\") {\n\t\t\t\t\t\t\t\t$action = \"keyup\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// is this field a special option field\n\t\t\t\t\t\t\t$checkboxField = false;\n\t\t\t\t\t\t\tif(in_array($formFieldWatch->ClassName, array('EditableCheckboxGroupField', 'EditableCheckbox'))) {\n\t\t\t\t\t\t\t\t$action = \"click\";\n\t\t\t\t\t\t\t\t$checkboxField = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// and what should we evaluate\n\t\t\t\t\t\t\tswitch($dependency['ConditionOption']) {\n\t\t\t\t\t\t\t\tcase 'IsNotBlank':\n\t\t\t\t\t\t\t\t\t$expression = ($checkboxField) ? '$(this).attr(\"checked\")' :'$(this).val() != \"\"';\n\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'IsBlank':\n\t\t\t\t\t\t\t\t\t$expression = ($checkboxField) ? '!($(this).attr(\"checked\"))' : '$(this).val() == \"\"';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'HasValue':\n\t\t\t\t\t\t\t\t\t$expression = ($checkboxField) ? '$(this).attr(\"checked\")' : '$(this).val() == \"'. $dependency['Value'] .'\"';\n\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'ValueLessThan':\n\t\t\t\t\t\t\t\t\t$expression = '$(this).val() < parseFloat(\"'. $dependency['Value'] .'\")';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'ValueLessThanEqual':\n\t\t\t\t\t\t\t\t\t$expression = '$(this).val() <= parseFloat(\"'. $dependency['Value'] .'\")';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'ValueGreaterThan':\n\t\t\t\t\t\t\t\t\t$expression = '$(this).val() > parseFloat(\"'. $dependency['Value'] .'\")';\n\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'ValueGreaterThanEqual':\n\t\t\t\t\t\t\t\t\t$expression = '$(this).val() >= parseFloat(\"'. $dependency['Value'] .'\")';\n\n\t\t\t\t\t\t\t\t\tbreak;\t\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t$expression = ($checkboxField) ? '!($(this).attr(\"checked\"))' : '$(this).val() != \"'. $dependency['Value'] .'\"';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// put it all together\n\t\t\t\t\t\t\t$CustomDisplayRules .= $fieldToWatch.\".$action(function() {\n\t\t\t\t\t\t\t\tif(\". $expression .\" ) {\n\t\t\t\t\t\t\t\t\t$(\\\"#\". $fieldId .\"\\\").\".$view.\"();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t$(\\\"#\". $fieldId .\"\\\").\".$opposite.\"();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';\n\t\t\n\t\t// Keep track of the referer\n\t\t$fields->push( new HiddenField( \"Referrer\", \"\", $referer ) );\n\t\t\t\t\n\t\t// Build actions\n\t\t$actions = new FieldSet(\n\t\t\tnew FormAction(\"process\", $this->SubmitButtonText)\n\t\t);\n\t\t\n\t\t// Do we want to add a clear form.\n\t\tif($this->ShowClearButton) {\n\t\t\t$actions->push(new ResetFormAction(\"clearForm\"));\n\t\t}\n\t\t\n\t\t// return the form\n\t\t$form = new Form($this, \"Form\", $fields, $actions, new RequiredFields(array_keys($fieldValidation)));\n\t\t$form->loadDataFrom($this->failover);\n\t\t\n\t\t$FormName = $form->FormName();\n\n\t\t// Set the Form Name\n\t\t$rules = $this->array2json($fieldValidationRules);\n\t\t$messages = $this->array2json($fieldValidation);\n\t\t\n\n\t\t// set the custom script for this form\n\t\tRequirements::customScript(<<<JS\n\t\t\t(function($) {\n\t\t\t\t$(document).ready(function() {\n\t\t\t\t\t$defaults\n\t\t\t\t\t$(\"#$FormName\").validate({\n\t\t\t\t\t\terrorClass: \"required\",\t\n\t\t\t\t\t\tmessages:\n\t\t\t\t\t\t\t$messages\n\t\t\t\t\t\t,\n\t\t\t\t\t\t\n\t\t\t\t\t\trules: \n\t\t\t\t\t\t \t$rules\n\t\t\t\t\t});\n\t\t\t\t\t$CustomDisplayRules\n\t\t\t\t});\n\t\t\t})(jQuery);\nJS\n);\n\n\t\treturn $form;\n\t}", "function makeForm($request, $formOpts){\n\t\t#print_r ($request);\n\t\t$formDescriptor = array(\n\t\t\t'radioForm' => array(\n \t\t\t\t'type' => 'radio',\n \t\t\t\t'label' => 'Select a search type:',\n \t\t\t\t'options' => array( # The options available within the checkboxes (displayed => value)\n\t\t\t\t\t\t\t\t\t\t\t\t'Radio button label 0' => 0,\n\t\t\t\t\t\t\t\t\t\t\t\t'Radio button label 1' => 1,\n\t\t\t\t\t\t\t\t\t\t\t\t'Radio button label 2' => 2,\n\t\t\t\t\t\t\t\t\t\t\t),\n \t\t\t\t'default' => 0 # The option selected by default (identified by value)\n \t\t\t),\n 'textfield1' => array(\n\t\t\t\t\t\t\t\t'label' => 'textfield 1 label', # What's the label of the field\n\t\t\t\t\t\t\t\t'class' => 'HTMLTextField' # What's the input type\n\t\t\t\t\t\t\t\t),\n\t\t\t'textfield2' => array(\n\t\t\t\t\t'label' => 'textfield 2 label', # What's the label of the field\n\t\t\t\t\t'class' => 'HTMLTextField' # What's the input type\n\t\t\t\t\t), \t\t\t\t\n \t\t);\n\t\t\n\t\tswitch($formOpts){\n\t\t\tcase '1':\n\t\t\t\t$formDescriptor['textfield1']['label'] = 'textfield 1 label'; # What's the label of the field\n\t\t\t\t$formDescriptor['textfield2']['label'] = 'textfield 2 label'; # What's the label of the field\t\n\t\t\t\tbreak;\n\t\t\tcase '2':\n\t\t\t\t#same as case 1\n\t\t\tdefault:\n\t\t}\n\n\t\t#Submit button structure and page callback. \n $htmlForm = new HTMLForm( $formDescriptor, $this->getContext(), 'myform'); # We build the HTMLForm object, calling the form 'myform'\n $htmlForm->setSubmitText( 'Submit button text' ); # What text does the submit button display\n\t\t\n\t\t/* We set a callback function */ \n\t\t#This code has no function to the special page. It used to produce red wiki text callback such as \"Try Again\" commented-out below under processInput function. \n\t\t$htmlForm->setSubmitCallback( array( 'specialpagetemplate', 'processInput' ) ); # Call processInput() in specialpagetemplate on submit\n $htmlForm->show(); # Displaying the form\n\t}", "public function form()\n {\n $form = new Form($this->model);\n\n $form->display('id', 'ID');\n\n $form->select('user_id', 'User')->rules('required')\n ->options(function () {\n $options = [];\n $users = User::all();\n\n if ($users) {\n foreach ($users as $user) {\n $options[$user->id] = $user->name;\n }\n }\n\n return $options;\n });\n $form->select('platform_id', 'Platform')->rules('required')\n ->options(function () {\n $options = [];\n $platforms = Platform::all();\n\n if ($platforms) {\n foreach ($platforms as $platform) {\n $options[$platform->id] = $platform->name;\n }\n }\n\n return $options;\n });\n $form->text('product_code','Product Code')->rules('required');\n $form->text('receipt','Receipt');\n $form->text('transaction_id','Transaction id');\n $form->text('signature','Signature');\n $form->text('order_id','Order id');\n $form->text('json_data','Json data');\n $form->text('propaty_code','Propaty Code');\n $form->datetime('expires_date', 'Expire Date')->rules('required');\n $form->display('created_at', trans('admin.created_at'));\n $form->display('updated_at', trans('admin.updated_at'));\n\n return $form;\n }", "function InputForm()\n\t{\t\n\t\t$form = new Form($_SERVER[\"SCRIPT_NAME\"] . \"?id=\" . $this->id, \"crewcvForm\");\n\t\t$form->AddTextInput(\"City name\", \"cityname\", $this->InputSafeString($this->details[\"cityname\"]), \"\", 100);\n\t\t$form->AddSelect(\"Country\", \"country\", $this->id ? $this->details[\"country\"] : $_GET[\"ctry\"], \"\", $this->CountriesList(), true, true, \"onchange='GetFromEmail(\\\"country\\\", \\\"country\\\")';\");\n\t\t$form->AddTextInput(\"\\\"From\\\" email address\", \"emailfrom\", $this->InputSafeString($this->details[\"emailfrom\"]), \"long\", 255);\n\t\tif ($this->details[\"country\"])\n\t\t{\t$country = new Country($this->details[\"country\"]);\n\t\t\t$defemail = $country->EmailFrom();\n\t\t} else\n\t\t{\t$defemail = $this->GetParameter(\"emailfrom\");\n\t\t}\n\t\t$form->AddRawText(\"<label>Default \\\"From\\\" if not defined here</label><label id='ad_ak_emailfrom' class='content_label'>$defemail</label><br />\\n\");\n\t\t$form->AddSubmitButton(\"\", $this->id ? \"Save Changes\" : \"Create New City\", \"submit\");\n\t\tif ($histlink = $this->DisplayHistoryLink(\"cities\", $this->id))\n\t\t{\techo \"<p>\", $histlink, \"</p>\";\n\t\t}\n\t\tif ($this->CanDelete())\n\t\t{\techo \"<p><a href='\", $_SERVER[\"SCRIPT_NAME\"], \"?id=\", $this->id, \"&delete=1\", \n\t\t\t\t\t$_GET[\"delete\"] ? \"&confirm=1\" : \"\", \"'>\", $_GET[\"delete\"] ? \"please confirm you really want to \" : \"\", \n\t\t\t\t\t\"delete this city</a></p>\\n\";\n\t\t}\n\t\t$form->Output();\n\t}", "protected function form()\n {\n $form = new Form(new Procurement);\n\n $form->number('u_id', 'U id');\n $form->number('brand', 'Brand');\n $form->number('type', 'Type');\n $form->number('models', 'Models');\n $form->number('material', 'Material');\n $form->decimal('area', 'Area');\n $form->radio('status', '审核')->options(['0' => '待审核', '1'=> '通过','2'=>'未通过'])->default('0');\n $form->number('room_city', 'Room city');\n $form->text('address', 'Address');\n $form->number('brick_time', 'Brick time')->default(1);\n $form->text('images', 'Images');\n $form->number('ctime', 'Ctime');\n $form->number('utime', 'Utime');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Terrace());\n\n $form->image('image', __('平台图片'))->rules('required', ['required' => '平台图片不能为空']);\n $form->text('name', __('平台名称'))->rules('required', ['required' => '平台名称不能为空']);\n $form->text('path', __('外链'))->rules('required', ['required' => '平台外链不能为空']);\n $form->text('notice_info', __('提示语'))->rules('required', ['required' => '平台提示语不能为空']);\n $form->radio('status','状态')->options(['1' => '未推荐', '2'=> '已推荐'])->default(1);\n\n return $form;\n }", "protected function form()\n {\n return Form::make(new LotteryRuleGroup(), function (Form $form) {\n $form->display('id');\n $lottery = Lottery::Status()->get()->pluck( 'title','id');\n $form->select('lottery_id')->options($lottery)->required();\n $form->text('title')->required();\n $form->select('status')->options([1 => '开启', 2 => '关闭'])->default(1);\n\n $form->display('created_at');\n $form->display('updated_at');\n });\n }", "public function generate()\n {\n switch ($this->sColumn) {\n case 'description':\n $this->oForm->addElement(\n new Textarea(\n t('Description:'),\n $this->sColumn,\n [\n 'id' => $this->getFieldId('str'),\n 'onblur' => 'CValid(this.value,this.id,20,4000)',\n 'value' => $this->sVal,\n 'validation' => new Str(20, 4000),\n 'required' => 1\n ]\n )\n );\n $this->addCheckErrSpan('str');\n break;\n\n case 'punchline':\n $this->oForm->addElement(\n new Textbox(\n t('Punchline/Headline:'),\n 'punchline',\n [\n 'id' => $this->getFieldId('str'),\n 'onblur' => 'CValid(this.value,this.id,5,150)',\n 'value' => $this->sVal,\n 'validation' => new Str(5, 150)\n ]\n )\n );\n $this->addCheckErrSpan('str');\n break;\n\n case 'country':\n $this->oForm->addElement(\n new Country(\n t('Country:'),\n $this->sColumn,\n [\n 'id' => $this->getFieldId('str'),\n 'value' => $this->sVal,\n 'required' => 1\n ]\n )\n );\n break;\n\n case 'city':\n $this->oForm->addElement(\n new Textbox(\n t('City:'),\n $this->sColumn,\n [\n 'id' => $this->getFieldId('str'),\n 'onblur' => 'CValid(this.value,this.id,2,150)',\n 'value' => $this->sVal,\n 'validation' => new Str(2, 150),\n 'required' => 1\n ]\n )\n );\n $this->addCheckErrSpan('str');\n break;\n\n case 'state':\n $this->oForm->addElement(\n new Textbox(\n t('State/Province:'),\n $this->sColumn,\n [\n 'id' => $this->getFieldId('str'),\n 'onblur' => 'CValid(this.value,this.id,2,150)',\n 'value' => $this->sVal,\n 'validation' => new Str(2, 150)\n ]\n )\n );\n $this->addCheckErrSpan('str');\n break;\n\n case 'zipCode':\n $this->oForm->addElement(\n new Textbox(\n t('Postal Code:'),\n $this->sColumn,\n [\n 'id' => $this->getFieldId('str'),\n 'onblur' => 'CValid(this.value,this.id,2,15)',\n 'value' => $this->sVal,\n 'validation' => new Str(2, 15)\n ]\n )\n );\n $this->addCheckErrSpan('str');\n break;\n\n case 'middleName':\n $this->oForm->addElement(\n new Textbox(\n t('Middle Name:'),\n $this->sColumn,\n [\n 'id' => $this->getFieldId('name'),\n 'onblur' => 'CValid(this.value,this.id)',\n 'value' => $this->sVal,\n 'validation' => new Name\n ]\n )\n );\n $this->addCheckErrSpan('name');\n break;\n\n case 'height':\n $this->oForm->addElement(\n new Height(\n t('Height:'),\n $this->sColumn,\n [\n 'value' => $this->sVal\n ]\n )\n );\n break;\n\n case 'weight':\n $this->oForm->addElement(\n new Weight(\n t('Weight:'),\n $this->sColumn,\n [\n 'value' => $this->sVal\n ]\n )\n );\n break;\n\n case 'website':\n case 'socialNetworkSite':\n $sLabel = $this->sColumn === 'socialNetworkSite' ? t('Social Media Profile:') : t('Website:');\n $sDesc = $this->sColumn === 'socialNetworkSite' ? t('The URL of your social profile, such as Facebook, Instagram, Snapchat, LinkedIn, ...') : t('Your Personal Website/Blog (any promotional/affiliated contents will be removed)');\n $this->oForm->addElement(\n new Url(\n $sLabel,\n $this->sColumn, [\n 'id' => $this->getFieldId('url'),\n 'onblur' => 'CValid(this.value,this.id)',\n 'description' => $sDesc,\n 'value' => $this->sVal\n ]\n )\n );\n $this->addCheckErrSpan('url');\n break;\n\n case 'phone':\n $this->oForm->addElement(\n new Phone(\n t('Phone Number:'),\n $this->sColumn,\n array_merge(\n [\n 'id' => $this->getFieldId('phone'),\n 'onblur' => 'CValid(this.value, this.id)',\n 'value' => $this->sVal,\n ],\n self::setCustomValidity(\n t('Enter full number with area code.')\n ),\n )\n )\n );\n $this->addCheckErrSpan('phone');\n break;\n\n default:\n $sLangKey = strtolower($this->sColumn);\n $sClass = '\\PFBC\\Element\\\\' . $this->getFieldType();\n $this->oForm->addElement(new $sClass(t($sLangKey), $this->sColumn, ['value' => $this->sVal]));\n }\n\n return $this->oForm;\n }", "public function isValidCreateData($form){\n return true;\n }", "public function form()\n\t{\n\t\tglobal $L;\n\n\t\t$html = '<div class=\"mb-3\">';\n\t\t$html .= '<label class=\"form-label\" for=\"label\">' . $L->get('Label') . '</label>';\n\t\t$html .= '<input class=\"form-control\" id=\"label\" name=\"label\" type=\"text\" value=\"' . $this->getValue('label') . '\">';\n\t\t$html .= '<div class=\"form-text\">' . $L->get('This title is almost always used in the sidebar of the site') . '</div>';\n\t\t$html .= '</div>';\n\n\t\tif (defined('BLUDIT_PRO')) {\n\t\t\t$html .= '<div class=\"mb-3\">';\n\t\t\t$html .= '<label class=\"form-label\" for=\"excludeAdmins\">' . $L->get('Exclude administrators users') . '</label>';\n\t\t\t$html .= '<select class=\"form-select\" id=\"excludeAdmins\" name=\"excludeAdmins\">';\n\t\t\t$html .= '<option value=\"true\" ' . ($this->getValue('excludeAdmins') === true ? 'selected' : '') . '>' . $L->get('Enabled') . '</option>';\n\t\t\t$html .= '<option value=\"false\" ' . ($this->getValue('excludeAdmins') === false ? 'selected' : '') . '>' . $L->get('Disabled') . '</option>';\n\t\t\t$html .= '</select>';\n\t\t\t$html .= '</div>';\n\t\t}\n\n\t\treturn $html;\n\t}", "public function getForm();", "public abstract function validation();", "protected function form()\n {\n $form = new Form(new Barang());\n\n $form->text('nama', __('Nama'));\n $form->currency('harga', __('Harga Beli'))->symbol('Rp');\n $form->currency('harga_jual', __('Harga Jual'))->symbol('Rp');\n $form->select('satuan_id', __('Satuan id'))->options(\n Satuan::get()->pluck('nama', 'id')\n );\n $form->number('jumlah_unit', __('Jumlah Unit'));\n $form->select('parent_id', 'Parent Barang')->options(\n Barang::where('satuan_id', 1)->get()->pluck('nama', 'id')\n );\n $form->currency('b_pengiriman', __('Pengiriman'))->symbol('Rp');\n $form->currency('b_keamanan', __('Keamanan'))->symbol('Rp');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Information);\n \n \n\n $form->text('name', __('项目名称'))->autofocus()->placeholder('例:上汽大众新能源汽车工厂项目')->required();\n $form->text('industry', __('行业类别'))->required();\n $form->currency('investment', __('投资金额'))->icon('fa-usd')->required(); \n $form->text('cont_name', __('资方联系人'))->placeholder('选填内容,可为空');\n $form->text('cont_phone', __('资方联系方式'))->placeholder('选填内容,可为空');\n $form->text('staff_name', __('工作人员姓名'));\n $form->text('staff_phone', __('工作人员电话'));\n $form->hidden('adminuser_id', __('adminuser_id'))->value(Admin::user()->id);\n $form->textarea('content', __('项目情况'))->required()->placeholder('请填写项目介绍(包括项目投资额度、产业类别等)、项目需求(如土地、排放、能耗等)、谈判进度等......');\n\n\n\n $form->tools(function (Form\\Tools $tools) {\n\n // 去掉`列表`按钮\n $tools->disableList();\n\n });\n\n $form->footer(function ($footer) {\n\n // 去掉`重置`按钮\n $footer->disableReset();\n\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n\n $form->setAction('../admin/myinfo');\n\n return $form;\n }", "public function toForm($id) {\n \n\n var_dump($this->validateUser());\t\n \treturn 'nice';\n \t//return View::make('add');\n\n}", "protected function form()\n {\n $form = new Form(new Direction());\n\n $form->text('name', __(trans('hhx.name')));\n $form->text('intro', __(trans('hhx.intro')));\n $form->image('Img', __(trans('hhx.img')))->move('daily/direction')->uniqueName();\n $form->select('status', __(trans('hhx.status')))->options(config('hhx.status'));;\n $form->number('order_num', __(trans('hhx.order_num')));\n $form->hidden('all_num', __(trans('hhx.all_num')))->default(0.00);\n $form->decimal('stock', __(trans('hhx.stock')));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new RequestForConfirmation());\n\n $form->switch('status', __('Status'));\n $form->text('comment', __('Comment'));\n $form->select('user_id', __('User id'))->options(User::all()->pluck('name', 'id'))->required();\n $form->select('project_id', __('Project id'))->options(Project::all()->pluck('project_name', 'id'))->required();\n\n\n return $form;\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "protected function form()\n {\n $form = new Form(new Reservation());\n\n $form->select('user_id',__('Pet Owner'))->options(User::all()->pluck('name','id'))->rules('required');\n $form->select('pet_id',__('Pet Name'))->options(Pet::all()->pluck('name','id'))->rules('required');\n $form->select('service_id',__('Service'))->options(Service::all()->pluck('name','id'));\n $form->datetime('date', __('Date'))->default(date('Y-m-d H:i:s'))->rules('required|min:3');\n $form->select('status',__('Status'))->options([\n 'pending' => 'Pending',\n 'completed' => 'completed',\n 'canceled' => 'Canceled',\n ])->default('pending');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Order());\n\n $form->switch('paid', __('Paid'));\n $form->datetime('reservation_expires', __('Reservation expires'))->default(date('Y-m-d H:i:s'));\n $form->decimal('price', __('Price'));\n\n $form->tools(function (Form\\Tools $tools) {\n $tools->disableView();\n });\n\n\n\n return $form;\n }" ]
[ "0.7360534", "0.7360534", "0.7128525", "0.7128525", "0.7059673", "0.70533156", "0.6911732", "0.6846659", "0.66728", "0.6578245", "0.65587085", "0.6554194", "0.6552962", "0.6527648", "0.65254146", "0.6489886", "0.6439921", "0.6431028", "0.6413214", "0.64054006", "0.64006907", "0.636878", "0.63499206", "0.63485587", "0.6323989", "0.6323734", "0.63217175", "0.6303943", "0.6292373", "0.62888145", "0.6283853", "0.6282576", "0.62821835", "0.6270143", "0.6260792", "0.6254722", "0.6252298", "0.62499434", "0.62498504", "0.62469697", "0.6245223", "0.624286", "0.62260246", "0.62242573", "0.6223266", "0.62210625", "0.6206934", "0.6206189", "0.62061006", "0.6201708", "0.61931425", "0.61854994", "0.61833143", "0.61797446", "0.6175353", "0.61751664", "0.617315", "0.61706406", "0.6168391", "0.61605", "0.6152994", "0.61486185", "0.6145176", "0.6138546", "0.6135832", "0.61167747", "0.6116607", "0.6111885", "0.6111277", "0.6098035", "0.60946894", "0.6090948", "0.60905206", "0.60811704", "0.60789645", "0.6077409", "0.60708416", "0.6070244", "0.606994", "0.6065549", "0.60654396", "0.6063", "0.6059289", "0.6054015", "0.6051298", "0.6050745", "0.6046842", "0.6038831", "0.60375625", "0.60355324", "0.6033569", "0.6033227", "0.6031519", "0.6030568", "0.6025421", "0.6018454", "0.60170454", "0.6016731", "0.601473", "0.6005913", "0.6004433" ]
0.0
-1
Get the formatted value
public function getFormattedValue($key, $value) { if ($key == 'ts_created') { if ($value) { $value = $this->dtFormat($value, 'U', 'yyyy-MM-dd'); } else { $value = time(); } } if ($key == 'actual') { if (!$value) { $value = 0; } } return $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFormattedValue()\r\n\t{\r\n\t\treturn $this->value;\r\n\t}", "public function getFormattedValue()\n {\n return $this->dbObject('Value');\n }", "public function format()\n {\n $separator = $this->object->config('separator');\n $decimals = $this->object->config('decimals');\n $point = $this->object->config('point');\n\n return number_format($this->object->getValue(), $decimals, $point, str_replace('&#160;', ' ', $separator));\n }", "function format($value);", "function value()\r\n {\r\n return number_format( $this->Value, 4, \".\", \"\" );\r\n }", "public function getValueFormattedAttribute()\n {\n return DataHelper::getFloat2Real($this->getAttribute('value'));\n }", "function format()\r\n\t{\r\n\t\treturn $this->text;\r\n\t}", "public function doFormat($value)\n {\n return $value;\n }", "public function format(): string;", "public static function getFormat(): string;", "public function getValue(): string\n {\n return $this->transform($this->value);\n }", "public function format(string $value): string;", "public function format() {\n return $this->format;\n }", "public function getStringValue()\n {\n if ($this->defaultValue === $this->getValue()) {\n return '';\n }\n\n return $this->value->format(self::FORMAT);\n }", "public function format()\n {\n $separator = $this->object->config('separator');\n $decimals = $this->object->config('decimals');\n $point = $this->object->config('point');\n\n $decimal_value = $this->getDecimalValue($this->object->getValue());\n\n if (setting_value('visiosoft.field_type.decimal::showDecimalMaxPrice') < intval($this->object->getValue()) and $decimal_value == 0) {\n if (!setting_value('visiosoft.field_type.decimal::showDecimal')) {\n $decimals = 0;\n }\n }\n\n return number_format($this->object->getValue(), $decimals, $point, str_replace('&#160;', ' ', $separator));\n }", "public function getFormat() {}", "public function getFormat() {}", "public function getFormat() {}", "public function getFormattedValue(): HtmlString\n {\n return new HtmlString($this->value ?? '');\n }", "public function format()\n {\n return sprintf('%s %s %s', $this->x(), $this->y(), $this->z());\n }", "public function formatAsString()\n {\n return $this->formatTimeAsString(\n $this->value,\n $this->nanoSeconds\n );\n }", "public function getHTMLDatePickerFormatValue(): string\n {\n return Carbon::parse($this->value)->format('Y-m-d');\n }", "public function formatted()\n\t{\n\t\treturn $this->feed_formatted;\n\t}", "public function getValue(): string\n {\n return gmp_strval($this->value);\n }", "public function getFormattedAmount(): string;", "public function getValue()\n\t{\n\t\tif( isset( $this->values[$this->prefix . 'value'] ) ) {\n\t\t\treturn (string) $this->values[$this->prefix . 'value'];\n\t\t}\n\n\t\treturn '';\n\t}", "public function getSqlFormattedValue()\n {\n if ($this->getType() == \"string\" || $this->getType() == \"time\" || $this->getType() == \"enum\") {\n return \"{\" .\"$\". \"this->parseValue(\". \"$\". \"this->\". $this->getName() .\",'notNumber')},\";\n } else if ($this->getType() == \"date\") {\n return \"{\" .\"$\". \"this->parseValue(\". \"$\". \"this->\". $this->getName() .\",'date')},\";\n } else if ($this->getType() == \"datetime\") {\n return \"{\" .\"$\". \"this->parseValue(\". \"$\". \"this->\". $this->getName() .\",'datetime')},\";;\n } else {\n return \"{\". \"$\". \"this->parseValue(\". \"$\". \"this->\". $this->getName().\")},\";\n }\n /*\n } else if ($this->getType() == \"date_OLD\") {\n return \"STR_TO_DATE(\". \"{\".\"$\". \"this->parseValue(\". \"$\". \"this->\". $this->getName().\",'date')},\".\"'\". \"{\".\"$\".\"constants['STORED_DATE_FORMAT']}\" .\"'),\";\n } else if ($this->getType() == \"datetime_OLD\") {\n return \"STR_TO_DATE(\". \"{\".\"$\". \"this->parseValue(\". \"$\". \"this->\". $this->getName().\",'date')},\".\"'\". \"{\".\"$\".\"constants['STORED_DATETIME_FORMAT']}\" .\"'),\";\n */\n\n }", "public function getValueAsString();", "abstract function format();", "public function render()\n {\n $value = number_format($this->value, $this->decimals, $this->decimal_separator, $this->thousands_separator);\n\n return Str::of($value)\n ->prepend($this->before.' ')\n ->append(' '.$this->after)\n ->trim()\n ->toString();\n }", "public function getFormat();", "public function getFormat();", "public function getFormat();", "public function getFormat();", "public function getFormat();", "public function getFormat();", "public function getOutputFormat()\n {\n $formated = $this->formatTxt(0);\n $number = $this->formatTxt(0, array('display' => Zend_Currency::NO_SYMBOL));\n return str_replace($number, '%s', $formated);\n }", "public function getFormatSetting()\n {\n return $this->format_setting;\n }", "public function getToStringFormat()\n {\n return $this->_to_string_format;\n }", "private function format($value)\n {\n if (is_callable($this->formatter)) {\n $value = call_user_func($this->formatter, $value, $this->dataSet);\n }\n return $value;\n }", "public function getValue()\n {\n return $this->date->getValue() . 'T' . $this->time->getValue();\n }", "public function value(): string\n {\n return $this->get('value');\n }", "protected function getFormat()\n {\n return 'FORMAT: 1A';\n }", "public function getFormatting() {\n\t\treturn $this->formatting;\n\t}", "public function getFormattedData();", "public function getFormat(): int;", "public function getValue(): string\n {\n return $this->value;\n }", "public function getValue(): string\n {\n return $this->value;\n }", "public function getValue(): string\n {\n return $this->value;\n }", "public function getValue(): string\n {\n return $this->value;\n }", "public function getValue(): string\n {\n return $this->value;\n }", "public function getValue(): string\n {\n return $this->value;\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "public function format($mask = self::MASK_TIMESTAMP_USER)\r\n {\r\n return $this->getValue($mask);\r\n }", "public function getFormattedPrice()\n {\n return $this->formatted_price;\n }", "public function getFormattedPrice()\n {\n return $this->formatted_price;\n }", "public function format() {\n\t\treturn elgg_echo('payments:price', [$this->getConvertedAmount(), $this->getCurrency()]);\n\t}", "protected function getFormat()\n {\n return $this->format;\n }", "public function getFormat() { return $this->_format; }", "public function getValue(): string\n {\n return $this->fusionValue('value') ?? '';\n }", "function format()\r\n\t{\r\n\t\treturn call_user_func($this->callback);\r\n\t}", "public function getFormattedCriteriaValue($value) {\n return $value;\n }", "protected function getFormattedDate()\n\t{\n\t\t$value = $this->getValue();\n\t\t$defaultText = $this->getDefaultText();\n\t\tif(empty($value) && !empty($defaultText))\n\t\t\treturn $this->getDefaultText();\n\n\t\t$app = $this->getApplication()->getGlobalization();\n\n\t\t//initialized the default class wide formatter\n\t\tif(self::$formatter===null)\n\t\t\tself::$formatter = new DateFormat($app->getCulture());\n\n\t\t$culture = $this->getCulture();\n\n\t\t//return the specific cultural formatted date time\n\t\tif(strlen($culture) && $app->getCulture() !== $culture)\n\t\t{\n\t\t\t$formatter = new DateFormat($culture);\n\t\t\treturn $formatter->format($value,\n\t\t\t\t\t\t\t\t\t $this->getPattern(),\n\t\t\t\t\t\t\t\t\t $this->getCharset());\n\t\t}\n\t\t//return the application wide culture formatted date time.\n\t\t$result = self::$formatter->format($value,\n\t\t\t\t\t\t\t\t\t\t$this->getPattern(),\n\t\t\t\t\t\t\t\t\t\t$this->getCharset());\n\t\treturn $result;\n\t}", "function get_value($post_id, $field)\n\t{\n\t\t// get value\n\t\t$value = parent::get_value($post_id, $field);\n\t\t\n\t\t// format value\n\t\t\n\t\t// return value\n\t\treturn $value;\t\t\n\t}", "public function formatTag( $mValue ) {\n\t\treturn $mValue;\n\t}", "public function getFormat()\n {\n return $this->_format;\n }", "public function getString()\n {\n return $this->format('%s%s%s');\n }", "public function getFormat()\n {\n return $this->format;\n }", "public function getFormat()\n {\n return $this->format;\n }", "public function getFormat()\n {\n return $this->format;\n }", "public function getFormat()\n {\n return $this->format;\n }", "public function getFormat()\n {\n return $this->format;\n }", "public function getFormat()\n {\n return $this->format;\n }", "public function getFormat()\n {\n return $this->format;\n }", "public function getFormat()\n {\n return $this->format;\n }", "public function getFormat()\n {\n return $this->format;\n }", "public function getFormat()\n {\n return $this->format;\n }", "public function getModifiedValue(): string\n {\n\t\treturn $this->applyModifiers((string) $this->value);\n\t}", "public function getFormat(): string\n {\n if ($this->format === null) {\n $this->format = self::$default_format;\n }\n return $this->format;\n }", "public static function formatValue($val)\n {\n if (is_object($val)) {\n return ObjectFormatter::formatRef($val);\n } elseif (is_array($val)) {\n return ArrayFormatter::formatRef($val);\n } elseif (is_resource($val)) {\n return sprintf('<%s>', print_r($val, true));\n } else {\n return json_encode($val);\n }\n }", "public function format($value) {\n return $this->setProperty('format', $value);\n }" ]
[ "0.83123934", "0.8035234", "0.76245993", "0.7609305", "0.7483259", "0.7384057", "0.73573667", "0.719351", "0.71194214", "0.7107636", "0.70575047", "0.7052939", "0.70378065", "0.6943173", "0.6914553", "0.6891656", "0.6891656", "0.6891656", "0.6775048", "0.6761286", "0.6723418", "0.67231447", "0.66907233", "0.6679708", "0.66774356", "0.66710687", "0.66559863", "0.6622429", "0.66179967", "0.65862936", "0.65731204", "0.65731204", "0.65731204", "0.65731204", "0.65731204", "0.65731204", "0.65587795", "0.6520237", "0.6503636", "0.6503002", "0.65024185", "0.6496374", "0.6494352", "0.6491845", "0.6488141", "0.6482077", "0.6473341", "0.6473341", "0.6473341", "0.6473341", "0.6473341", "0.6473341", "0.6473147", "0.6473147", "0.6473147", "0.6473147", "0.6473147", "0.6473147", "0.6473147", "0.6473147", "0.6473147", "0.6473147", "0.6473147", "0.6473147", "0.6473147", "0.6473147", "0.6473147", "0.6473147", "0.6473147", "0.6473147", "0.6473147", "0.6473147", "0.6467449", "0.6450698", "0.6450698", "0.6449693", "0.64451414", "0.64303994", "0.6392492", "0.63682353", "0.6363204", "0.6356336", "0.6352481", "0.6352344", "0.63389915", "0.6338975", "0.6338496", "0.6338496", "0.6338496", "0.6338496", "0.6338496", "0.6338496", "0.6338496", "0.6338496", "0.6338496", "0.6338496", "0.63248175", "0.63224894", "0.6309415", "0.6301892" ]
0.65909207
29
Get formatted row values
public function getFormattedRows($rows) { $formatRows = array(); $formatRow = array(); foreach ($rows as $row) { foreach ($row as $key => $value) { if ($key == 'ts_created') { if ($value) { if (is_int($value)) { $value = $this->dtFormat($value, 'yyyy-MM-dd', 'U'); } } else { $value = $this->dtFormat(time(), 'yyyy-MM-dd', 'U'); } } if ($key == 'ts_published') { if ($value) { if (is_int($value)) { $value = $this->dtFormat($value, 'yyyy-MM-dd HH:mm:ss', 'U'); } } else { $value = $this->dtFormat(time(), 'yyyy-MM-dd HH:mm:ss', 'U'); } } $formatRow[$key] = $value; } $formatRows[] = $formatRow; $formatRow = array(); } return $formatRows; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatRow(){\n $this->hook('formatRow');\n }", "public function getFormattedData();", "public function getValuesForOutput() {\n $formattedValues = $this->getFormattedValues();\n $rawValues = $this->getRawValues();\n\n $valuesForOutput = $rawValues;\n\n foreach ($formattedValues as $columnName => $value) {\n $valuesForOutput[$columnName] = $value;\n }\n\n return $valuesForOutput;\n }", "public function getRowsFormatted($input = array(), $data = array())\n\t{\n\t\t$rowsFormated = array();\n\t\t$rowsObj = $this->getRows();\n\t\n\t\n\t\t// Interate through row data and format\n\t\tforeach($rowsObj->rows as $row){\n\t\t\t\n\t\t\t$rowFormatted[] = \"The row \" . $row['some_column_name_here'] . \" is now formatted!\"; \n\t\t\t\n\t\t}\n\t\t\n\t\n // Return a formatted rows object\n $rowsFormattedObj = new stdClass;\n $rowsFormattedObj->rows = $rowsFormatted;\n \n return $rowsFormattedObj;\t\t\n\t\t\n\t}", "public function formatRow($row){\r\n \tif(!empty($row))\r\n \t$row['_rev'] = \"\";\r\n return $row;\r\n }", "public function getRowValues()\n {\n return array(\n $this->getUsdModifier(),\n $this->getEurModifier(),\n $this->getPlnModifier()\n );\n }", "public function enumerate_values_table_row(){\n\t\treturn \"\n\t\t\t<tr>\n\t\t\t\t<td>$this->avg_reaction_time_m_no_faces</td> \n\t\t\t\t<td>$this->accuracy_m_no_faces</td> \n\t\t\t\t<td>$this->avg_reaction_time_m_faces</td> \n\t\t\t\t<td>$this->accuracy_m_faces</td> \n\n\t\t\t\t<td>$this->avg_reaction_time_aba_no_faces</td> \n\t\t\t\t<td>$this->accuracy_aba_no_faces</td> \n\t\t\t\t<td>$this->avg_reaction_time_aba_faces</td> \n\t\t\t\t<td>$this->accuracy_aba_faces</td> \n\n\t\t\t\t<td>$this->avg_reaction_time_faces</td> \n\t\t\t\t<td>$this->accuracy_faces</td> \n\t\t\t\t<td>$this->avg_reaction_time_no_faces</td> \n\t\t\t\t<td>$this->accuracy_no_faces</td> \n\t\t\t</tr>\n\t\t\";\n\t}", "public function getDataToBeFormatted(){\n\t\t\treturn $this->setDataToBeFormatted();\n\t\t}", "public function values($data, $format)\n {\n $result = '';\n $replace = (strpos($format, '%value%') !== false) || (strpos($format, '%column%') !== false); \n if (is_array($data)) {\n foreach ($data as $key => $value) {\n $value = is_null($value) ? 'NULL' : (is_int($value) ? $value : '\"' . $this->escapeSQL($value) . '\"');\n $key = $this->escapeDbIdentifier($key);\n if ($format == 'fields') {\n $result .= \", $key\";\n } else{\n if ($format == 'pairs') {\n $result .= \", $key = $value\";\n } elseif ($replace) {\n $result .= \", \" . strtr($format, ['%value%' => $value, '%column%' => $key]);\n } else {\n $result .= \",\\t$value\";\n }\n }\n }\n }\n return substr($result, 2 /* length of the initial \", \" */);\n }", "public function getFormattedValue()\n {\n return $this->dbObject('Value');\n }", "private function prepareValuesRow(): string\n {\n $values = [];\n foreach ($this->storage as $key => $value) {\n $values[] = \"('{$key}', '{$value}')\";\n }\n\n return implode(', ', $values);\n }", "function formatRow($cur){\n $data = [\n \"CityCode\"=>$cur[0], \n \"AsciiName\"=>$cur[1], \n \"CountryCodeISO\"=>$cur[2], \n \"Latitude\"=>$cur[3],\n \"Longitude\"=>$cur[4],\n \"Population\"=>$cur[5],\n \"Elevation\"=>$cur[6],\n \"TimeZone\"=>$cur[7]\n ];\n return $data;\n }", "function format($row)\r\n\t{\r\n\t\tif (is_callable($this->template))\r\n\t\t{\r\n\t\t\treturn call_user_func($this->template, $row);\r\n\t\t}\r\n\t\telse return $row->format($this->template);\r\n\t}", "public function getSqlFormattedValue()\n {\n if ($this->getType() == \"string\" || $this->getType() == \"time\" || $this->getType() == \"enum\") {\n return \"{\" .\"$\". \"this->parseValue(\". \"$\". \"this->\". $this->getName() .\",'notNumber')},\";\n } else if ($this->getType() == \"date\") {\n return \"{\" .\"$\". \"this->parseValue(\". \"$\". \"this->\". $this->getName() .\",'date')},\";\n } else if ($this->getType() == \"datetime\") {\n return \"{\" .\"$\". \"this->parseValue(\". \"$\". \"this->\". $this->getName() .\",'datetime')},\";;\n } else {\n return \"{\". \"$\". \"this->parseValue(\". \"$\". \"this->\". $this->getName().\")},\";\n }\n /*\n } else if ($this->getType() == \"date_OLD\") {\n return \"STR_TO_DATE(\". \"{\".\"$\". \"this->parseValue(\". \"$\". \"this->\". $this->getName().\",'date')},\".\"'\". \"{\".\"$\".\"constants['STORED_DATE_FORMAT']}\" .\"'),\";\n } else if ($this->getType() == \"datetime_OLD\") {\n return \"STR_TO_DATE(\". \"{\".\"$\". \"this->parseValue(\". \"$\". \"this->\". $this->getName().\",'date')},\".\"'\". \"{\".\"$\".\"constants['STORED_DATETIME_FORMAT']}\" .\"'),\";\n */\n\n }", "protected function value()\n {\n return $this->row($this->row);\n }", "protected function formatLine($row)\n {\n // TODO: _buildGrid should be refactored so we don't have to call arrayPluck here\n $s = implode(',', array_map(array($this, 'formatCell'), $this->arrayPluck($row)));\n return $s;\n }", "public function getCellValue($row);", "public function value($row) {\n\t\t$value = $row[$this->field];\n\t\tif (is_array($value)) {\n\t\t\t$value = $this->Table->Text->toList($value, __d('ui', 'and', true));\n\t\t}\n\t\tif (!empty($this->options['truncate'])) {\n\t\t\t$value = Sanitize::stripTags($value, 'img', 'object', 'embed', 'div', 'span');\n\t\t\t$value = $this->Table->Text->truncate($value, $this->options['truncate'], array('html' => true));\n\t\t}\n\t\treturn $value;\n\t}", "public function _format_row($row)\n {\n $row['config'] = !empty($row['config']) ? unserialize($row['config']) : array();// 活动配置\n return $row;\n }", "public function _format_row($row)\n {\n $row['config'] = !empty($row['config']) ? unserialize($row['config']) : array();// 活动配置\n return $row;\n }", "public static function rowFields($row){\n\t $fields = '';\n $fld = '';\n\n for($x=0;$x < Model::numFields();$x++){\n $fld = Model::fieldName($x);\n\n if($x < Model::numFields() -1){\n $fields .= '<td>' . $row[\"$fld\"] . '</td>'.\"\\n\";\n\t }else{\n $fields .= '<td>' . $row[\"$fld\"] . '</td>';\n }\n }\n return $fields;\n }", "public function getFormattedValue()\r\n\t{\r\n\t\treturn $this->value;\r\n\t}", "private function _getRecordRowData()\n {\n $regPay = round($this->_reg / 3600, 2) * $this->_intRate;\n $otPay = round($this->_ot / 3600, 2) * round($this->_intRate * 1.5, 2);\n\n return [\n 'overtime_rate' => number_format($this->_intRate * 1.5, 2, '.', ''),\n 'current_rate' => $this->_rate,\n 'totalRegularHours' => number_format($this->_reg / 3600, 2, '.', '') ?? '0.00',\n 'totalOvertimeHours' => number_format($this->_ot / 3600, 2, '.', '') ?? '0.00',\n 'totalRegularPay' => number_format($regPay, 2, '.', '') ?? '0.00',\n 'totalOvertimePay' => number_format($otPay, 2, '.', '') ?? '0.00',\n 'totalHoursWorked' => number_format($this->_paid / 3600, 2, '.', '') ?? '0.00',\n 'totalPay' => number_format($regPay + $otPay, 2, '.', '') ?? '0.00',\n 'open' => boolval($this->singleRecord !== false) ? 'pr-record-open' : '',\n ];\n }", "public static function format_single_value( $field, $value, $args, $post_id ) {\n\t\t$output = '<tr>';\n\t\tforeach ( $value as $subvalue ) {\n\t\t\t$output .= \"<td>$subvalue</td>\";\n\t\t}\n\t\t$output .= '</tr>';\n\t\treturn $output;\n\t}", "public function getValuesForProcessing() {\n $formattedValues = $this->getFormattedValues();\n $rawValues = $this->getRawValues();\n\n $valuesForProcessing = $rawValues;\n\n foreach ($formattedValues as $columnName => $value) {\n if (!isset($rawValues[$columnName]) || $rawValues[$columnName] === null) {\n $valuesForProcessing[$columnName] = $value;\n }\n }\n\n return $valuesForProcessing;\n }", "public function getCellValues()\n {\n return $this->get('CellValues');\n }", "public function getCellValueForRendering($row, $cell=null);", "public function format_row(&$p_row)\n {\n global $g_loc;\n\n $l_date_format_user = $g_loc->get_user_settings(LC_TIME);\n $l_date_format = str_replace('%', '', $l_date_format_user['d_fmt_m']);\n $l_empty_value = isys_tenantsettings::get('gui.empty_value', '-');\n\n $p_row[\"isys_catg_invoice_list__amount\"] = $g_loc->fmt_monetary($p_row[\"isys_catg_invoice_list__amount\"]);\n $p_row[\"isys_catg_invoice_list__date\"] = ($p_row[\"isys_catg_invoice_list__date\"] != null) ? date(\n $l_date_format,\n strtotime($p_row[\"isys_catg_invoice_list__date\"])\n ) : $l_empty_value;\n $p_row[\"isys_catg_invoice_list__edited\"] = ($p_row[\"isys_catg_invoice_list__edited\"] != null) ? $p_row[\"isys_catg_invoice_list__edited\"] = date(\n $l_date_format,\n strtotime($p_row[\"isys_catg_invoice_list__edited\"])\n ) : $l_empty_value;\n $p_row[\"isys_catg_invoice_list__financial_accounting_delivery\"] = ($p_row[\"isys_catg_invoice_list__financial_accounting_delivery\"] != null) ? $p_row[\"isys_catg_invoice_list__financial_accounting_delivery\"] = date(\n $l_date_format,\n strtotime($p_row[\"isys_catg_invoice_list__financial_accounting_delivery\"])\n ) : $l_empty_value;\n }", "public function render(): array\n {\n return array_merge($this->attributes, [\n 'cols' => $this->table->toArray()\n ]);\n }", "public function getEditCellValue($row);", "public function GetFieldValue($oTableRow)\n {\n $sValue = '';\n if (array_key_exists($this->sColumnAlias, $oTableRow->sqlData)) {\n $sValue = $oTableRow->sqlData[$this->sColumnAlias];\n }\n $sFormatedValue = '';\n if (!is_null($this->sFormatCallbackFunction)) {\n $sFunction = $this->sFormatCallbackFunction;\n if (method_exists($oTableRow, $this->sFormatCallbackFunction)) {\n $sFormatedValue = $oTableRow->$sFunction($sValue, $this->sColumnAlias);\n } elseif (function_exists($this->sFormatCallbackFunction)) {\n $sFormatedValue = $sFunction($sValue, $oTableRow, $this->sColumnAlias);\n } else {\n trigger_error('Error: Callback ['.$sFunction.'] does not exist in THTMLTable/THTMLTableColumn::GetFieldValue()', E_USER_ERROR);\n }\n } else {\n $sFormatedValue = $this->FormatValue($sValue, $oTableRow);\n }\n\n return $sFormatedValue;\n }", "function table_table_row($values,$escape=false)\n{\n\t$cells=new ocp_tempcode();\n\tforeach ($values as $value)\n\t{\n\t\tif (($escape) && ((!is_object($value)) || ($value->pure_lang!==true)))\n\t\t\t$value=make_string_tempcode(escape_html(is_object($value)?$value->evaluate():$value));\n\n\t\t$cells->attach(do_template('TABLE_TABLE_ROW_CELL',array('_GUID'=>'700a982eb2262149295816ddee91b0e7','VALUE'=>$value)));\n\t}\n\n\treturn do_template('TABLE_TABLE_ROW',array('_GUID'=>'a4efacc07ecb165e37c355559f476ae9','CELLS'=>$cells));\n}", "private function printCsvRow($row) {\n\t\t$string = '';\n\t\tforeach ($row as $value) {\n\t\t\t// remove line-breaks and whitespace at the start end end of a value and unify the values a little bit with the uppercase function (located in functions.php) and add a seperator after each value\n\t\t\t$string .= uppercase(trim(preg_replace('/\\s+/', ' ', $value))).$this->seperator;\t\t\t\n\t\t}\n\t\t$string .= \"\\n\";\n\t\treturn $string;\n\t}", "function print_row($key, $row)\n{\n printf('Reading data for row %s' . PHP_EOL, $key);\n foreach ((array) $row as $family => $cols) {\n printf('Column Family %s' . PHP_EOL, $family);\n foreach ($cols as $col => $data) {\n for ($i = 0; $i < count($data); $i++) {\n printf(\n \"\\t%s: %s @%s%s\" . PHP_EOL,\n $col,\n $data[$i]['value'],\n $data[$i]['timeStamp'],\n $data[$i]['labels'] ? sprintf(' [%s]', $data[$i]['labels']) : ''\n );\n }\n }\n }\n print(PHP_EOL);\n}", "function format($type, $row) {\n\n $row->RemittanceSequence = $this->transaction->RemittanceSequence;\n $row->CustomerOrgNumber = $this->transaction->CustomerOrgNumber;\n $row->NumTransactions = $this->transaction->NumTransactions;\n $row->TotalAmount = $this->transaction->TotalAmount;\n $row->Database = $this->transaction->Database;\n $row->Date = $this->transaction->Date;\n $row->VersionSoftware = $this->transaction->VersionSoftware;\n\n $this->transaction->RemittanceDaySequence++; #Starts at zero each day\n $this->transaction->NumRecords++; #Starts at zero each file\n \n $row->RemittanceDaySequence = $this->transaction->RemittanceDaySequence;\n $row->NumRecords = $this->transaction->NumRecords;\n\n #$html = \"$type\";\n foreach($this->formatH[$type] as $field => $column) {\n if($field != 'name') {\n #print_r($row);\n #print \"$field - field: \" . $column['field'] . \"<br>\\n\";\n\n $value = '';\n if(isset($column['field']) && $row->{$column['field']}) {\n $value = $row->{$column['field']};\n\n } elseif(isset($column['value']) && strlen($column['value'])) {\n $value = $column['value'];\n\n } else {\n $value = ' ';\n }\n $length = $column['stop'] - $column['start'] + 1;\n if($column['type'] == 'int' || $column['type'] == 'amount') {\n $pad = '0';\n $align = STR_PAD_LEFT;\n } elseif($column['type'] == 'text' || $column['type'] == 'date' || $column['type'] == 'bankaccount' || $column['type'] == 'monthdate') {\n $pad = ' ';\n $align = STR_PAD_RIGHT;\n } else {\n $pad = '*'; #Not defined \n $align = STR_PAD_LEFT;\n }\n $value = $this->{$column['type']}($value);\n $value = substr($value, 0, $length); #husk Œ klippe de totale datene til max lenge\n \n $html .= str_pad($value, $length, $pad, $align);\n #print \"field: $field: length: $length, value: <b>\" . str_pad($value, $length, $pad, $align) . \"</b>, pad: $pad, field: \" . $column['field'] . \", type: \" . $column['type'] . \"<br>\\n\";\n\n }\n }\n $html .= \"\\n\";\n return $html;\n }", "public function getToArray()\n {\n $row = [];\n foreach (array_keys($this->columns) as $column) {\n $row[$column] = trim($this->getColumnValue($column));\n }\n return $row;\n }", "public function getValue()\n {\n //get value\n $value = $this->getValueFromRow($this->getData(), $this->dataIndex);\n\n if ($this->formater) {\n $value = call_user_func_array($this->formater, [$value, $this->getData(), $this->dataIndex]);\n }\n\n //render link\n if ($url = $this->getUrl()) {\n $href = is_array($url) ? $url['href'] : $url;\n $target = is_array($url) && !empty($url['target']) ? $url['target'] : '';\n\n $href = $href . (strpos($href, '?') === false ? '?' : '&') . 'return=' . urlencode($this->getGrid()->getUrl());\n //замена конструкций {{param}} на значение\n if (preg_match_all('#{{([\\d\\w_]+)}}#', $href, $m)) {\n foreach ($m[1] as $key) {\n $href = str_replace('{{' . $key . '}}', $this->getValueFromRow($this->getData(), $key), $href);\n }\n }\n $value = '<a ' . ($target ? 'target=\"' . $target . '\"' : '') . ' href=\"' . $href . '\">' . $value . '</a>';\n }\n\n return $value;\n }", "function getRowHtml()\r\n\t{\r\n\t // Failsafe if i18n is not loaded\r\n\t if(! function_exists('__'))\r\n\t Misc::use_helper('I18N');\r\n\r\n\t if ($this->showGeenResultaten && ($this->rowCount == 0)) {\r\n\t\t $html = \" <td colspan='$this->colCount'>\" . __('Geen resultaten') . \"</td>\\n\";\r\n\t\t}\r\n\t\telse $html = $this->rowDataHtml;\r\n\r\n\t\treturn $html;\r\n\t}", "public function getData()\n {\n return $this->rowData;\n }", "protected function getValueFromRow($row, $key)\n {\n if (!empty($key)) {\n $dataIndex = explode('.', $key);\n $value = $row;\n foreach ($dataIndex as $index) {\n if (empty($value)) {\n break;\n }\n\n $v = \\Widget\\Helper::getValue($value, $index);\n if ($v !== null) {\n $value = $v;\n } else {\n $value = '';\n// if (array_key_exists($index, $value) && is_null($value[$index])) {\n// $value = '';\n// } else {\n// $value = join('<br/>', A1_Helper_array::findKey($index, $value));\n// }\n }\n }\n if (is_array($value)) {\n $value = join('<br/>', $value);\n }\n } else {\n $value = Helper::getValue($row, $this->name);\n }\n\n if (is_array($value) && empty($value)) {\n $value = '';\n }\n\n return $value;\n }", "public function get_display_data($form_name, $column_header, $column_data, $rowid, $state) {\n\t\treturn $this->cell_formatter->format($form_name, $column_header, $column_data, $rowid, $state);\n\t}", "#[Pure] public function get_values(): string\n {\n if(gettype($this -> value) === \"string\") {\n return \"'\" . $this->value . \"'\";\n }else{\n $res = \"'\";\n foreach($this -> value as $v){\n $res .= strval($v) . \" \";\n }\n $res .= \"'\";\n }\n return $res;\n }", "public function get_row();", "protected function _getValues()\n {\n $values = $this->getColumn()->getValues();\n return $this->_converter->toFlatArray($values);\n }", "public function formatRowWithStringsAlignRightByDefault()\n {\n // Given\n $fieldSpecs = array(\n array(\n \"len\" => \"10\",\n \"type\" => \"s\"),\n array(\n \"len\" => \"15\",\n \"type\" => \"s\"),\n );\n $values = array(\"first\", \"second\");\n\n // When\n $result = RowFormatter::format($values, $fieldSpecs, \" \");\n\n // Then\n $this->assertEquals($result, \" first second\");\n }", "protected function formatColumns()\n {\n $output = '[';\n foreach ($this->incorrect as $column) {\n $output .= $column . ', ';\n }\n\n // Remove last delimiter, and close the bracket.\n $output = substr($output, 0, -2);\n $output .= ']';\n\n return $output;\n }", "function ods_render_row($row, $data = array()) {\n $cells = $row->getElementsByTagName('table-cell');\n\n foreach ($cells as $cell) {\n $value_type = $cell\n ->getAttribute('office:value-type');\n\n //get text data\n $p1 = $cell\n ->getElementsByTagName('p'); \n\n foreach ($p1 as $p) {\n\n $orig_cell_text = $p->nodeValue;\n\n $data_val = false;\n\n if (!empty($orig_cell_text)) {\n if ($this->string_has_params($orig_cell_text)) {\n\n if ($this->parse_string_is_once_param($orig_cell_text)) {\n $param_key = $this->parse_string_extract_param($orig_cell_text);\n\n if ($this->parse_param_exists($param_key, $data)) {\n\n $data_val = $this->parse_param_value(\n $param_key, $data\n );\n $this->ods_cell_set_val($cell, $p, $data_val, array());\n }\n } else {\n $p->nodeValue = $this->parse_string($orig_cell_text, $data);\n }\n }\n }\n }\n \n $this->ods_render_cell_images($cell, $data); \n \n }\n return $row;\n }", "public function aggregateListRowValues()\n\t{\n\t}", "public function aggregateListRowValues()\n\t{\n\t}", "protected function getFormattedReturn($oSql)\n {\n $aRows = $this->_getReadAdapter()->fetchAll($oSql);\n $aReturn = array();\n foreach ($aRows as $row) {\n $aReturn[$row['key']] = $row['value'];\n }\n return $aReturn;\n }", "public function extractRow()\n\t{\n \n // extract the row data into a field array\n \n // validate each field\n \n // return field array\n \n }", "public function getValueFormattedAttribute()\n {\n return DataHelper::getFloat2Real($this->getAttribute('value'));\n }", "public function getDateformatPl() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(4, $this->_result)) return (string) $this->_result[4];\n\t\t\telse parent::throwGetColException('Not set ProjectsListingsModel::getDateformatPl', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From ProjectsListingsModel::getDateformatPl', __LINE__, __FILE__);\n\t}", "public function print_csv_rows() {\n\n\t\t$row_data = '';\n\t\t$data = $this->get_data();\n\t\t$cols = $this->get_csv_cols();\n\n\t\tif ( $data ) {\n\n\t\t\t// Output each row\n\t\t\tforeach ( $data as $row ) {\n\t\t\t\t$i = 1;\n\t\t\t\tforeach ( $row as $col_id => $column ) {\n\t\t\t\t\t// Make sure the column is valid\n\t\t\t\t\tif ( array_key_exists( $col_id, $cols ) ) {\n\t\t\t\t\t\t$row_data .= '\"' . preg_replace( '/\"/', \"'\", $column ) . '\"';\n\t\t\t\t\t\t$row_data .= $i == count( $cols ) ? '' : ',';\n\t\t\t\t\t\t$i ++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$row_data .= \"\\r\\n\";\n\t\t\t}\n\n\t\t\t$this->stash_step_data( $row_data );\n\n\t\t\treturn $row_data;\n\t\t}\n\n\t\treturn false;\n\t}", "public function format($form_name, $column_header, $column_data, $rowid, $state)\n\t{\n\t\treturn htmlspecialchars((string)$column_data);\n\t}", "protected function buildValuesForInsert()\n {\n return ' ('\n . $this->indentCsv(array_keys($this->col_values))\n . PHP_EOL . ') VALUES ('\n . $this->indentCsv(array_values($this->col_values))\n . PHP_EOL . ')';\n }", "protected function getValue($entity)\n {\n $value = $this->getFieldValue($entity);\n\n if ($this->formatter) {\n return $this->formatter->formatValue($value);\n }\n else {\n if ($value instanceof \\DateTime) {\n $formatter = new DateTimeCellFormatter($this->getDateTimeFormat());\n return $formatter->formatValue($value);\n }\n else {\n return $value;\n }\n }\n }", "protected function getHeadRowValues() \n {\n return array(\n\t\t 'Order Number',\n\t\t 'Order Date',\n\t\t \t/*'Month',*/\n 'Bill to name',\n\t\t\t'Ship to Name',\n\t\t\t'Order Location',\n\t\t\t'Zone',\n\t\t\t'Region',\n\t\t\t'Pincode #',\n\t\t\t'Payment Type',\n\t\t\t'Status',\n \t'Category',\n\t\t\t'Brand',\n\t\t\t'Stock Number',\n 'Sku_name',\n /*'MRP',*/\n\t\t\t'Weight',\n\t\t\t'Order Quantity',\n\t\t\t'Shipping Quantity',\n\t\t\t/*'BSP',*/\n\t\t\t'Invoice Id',\n\t\t\t'Invoice Date',\n\t\t\t/*'Method',*/\n\t\t\t'Original MRP',\n\t\t\t'MRP',\n\t\t\t'Discount_Amount',\n\t\t\t'Basic Sale',\n\t\t\t'TAX Amt',\n\t\t\t'Bill Value',\n\t\t\t'Coupon_Code',\n\t\t\t'Coupon Amt',\n\t\t\t'Formula',\n\t\t\t'Tax %',\n\t\t\t'Tax Type',\n\t\t\t'Courier',\n\t\t\t'AWB No',\n\t\t\t/*'Tax Amount',*/\n\t\t\t\t\t\t\n\t\t);\n }", "public function __toString() {\n $params = [];\n $str = '';\n foreach ($this->data as $x => $row) {\n $str .= '[ ';\n foreach ($row as $y => $value) {\n $str .= \"%s \";\n $params[] = $value;\n }\n $str .= \"]\\n\";\n }\n return vsprintf($str, $params);\n }", "public function to_html_raw()\n {\n $html = \"\";\n if(count($this->data))\n {\n $html = \"<tr>\";\n foreach($this->data as $key => $val)\n {\n $html .= \"<td>\".$val.\"</td>\"; \n } \n $html .= \"</tr>\";\n }\n return $html; \n }", "public function formatRowWithStringsAlignRight()\n {\n // Given\n $fieldSpecs = array(\n array(\n \"len\" => \"10\",\n \"type\" => \"s\",\n \"align\" => \"right\"),\n array(\n \"len\" => \"15\",\n \"type\" => \"s\",\n \"align\" => \"right\"),\n );\n $values = array(\"first\", \"second\");\n\n // When\n $result = RowFormatter::format($values, $fieldSpecs, \" \");\n\n // Then\n $this->assertEquals($result, \" first second\");\n }", "function prepareRowData(array &$row)\n{\n sanitizeDataQueried($row);\n convertAllDates($row);\n roundRawGrade($row);\n}", "public function format()\n {\n $separator = $this->object->config('separator');\n $decimals = $this->object->config('decimals');\n $point = $this->object->config('point');\n\n return number_format($this->object->getValue(), $decimals, $point, str_replace('&#160;', ' ', $separator));\n }", "function format()\r\n\t{\r\n\t\treturn $this->text;\r\n\t}", "public function getData_row()\n {\n return $this->data_row;\n }", "public function get_value() {\n\t\t$row = $this->get_row();\n\t\tif ($row) {\n\t\t\treturn current($row);\n\t\t}\n\t}", "public function formatted()\n\t{\n\t\treturn $this->feed_formatted;\n\t}", "function the_row($format = \\false)\n{\n}", "public function format(array $record);", "public function getViaTableAttributesValue();", "public function row( array $row ) {\n\n\t\t$extra_row_count = 0;\n\n\t\tif ( count( $row ) > 0 ) {\n\t\t\t$extra_rows = array_fill( 0, count( $row ), array() );\n\n\t\t\tforeach( $row as $col => $value ) {\n\n\t\t\t\t$value = str_replace( array( \"\\r\\n\", \"\\n\" ), ' ', $value );\n\n\t\t\t\t$col_width = $this->_widths[ $col ];\n\t\t\t\t$encoding = function_exists( 'mb_detect_encoding' ) ? mb_detect_encoding( $value, null, true /*strict*/ ) : false;\n\t\t\t\t$original_val_width = Colors::width( $value, self::isPreColorized( $col ), $encoding );\n\t\t\t\tif ( $col_width && $original_val_width > $col_width ) {\n\t\t\t\t\t$row[ $col ] = \\cli\\safe_substr( $value, 0, $col_width, true /*is_width*/, $encoding );\n\t\t\t\t\t$value = \\cli\\safe_substr( $value, \\cli\\safe_strlen( $row[ $col ], $encoding ), null /*length*/, false /*is_width*/, $encoding );\n\t\t\t\t\t$i = 0;\n\t\t\t\t\tdo {\n\t\t\t\t\t\t$extra_value = \\cli\\safe_substr( $value, 0, $col_width, true /*is_width*/, $encoding );\n\t\t\t\t\t\t$val_width = Colors::width( $extra_value, self::isPreColorized( $col ), $encoding );\n\t\t\t\t\t\tif ( $val_width ) {\n\t\t\t\t\t\t\t$extra_rows[ $col ][] = $extra_value;\n\t\t\t\t\t\t\t$value = \\cli\\safe_substr( $value, \\cli\\safe_strlen( $extra_value, $encoding ), null /*length*/, false /*is_width*/, $encoding );\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\tif ( $i > $extra_row_count ) {\n\t\t\t\t\t\t\t\t$extra_row_count = $i;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} while( $value );\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t$row = array_map(array($this, 'padColumn'), $row, array_keys($row));\n\t\tarray_unshift($row, ''); // First border\n\t\tarray_push($row, ''); // Last border\n\n\t\t$ret = join($this->_characters['border'], $row);\n\t\tif ( $extra_row_count ) {\n\t\t\tforeach( $extra_rows as $col => $col_values ) {\n\t\t\t\twhile( count( $col_values ) < $extra_row_count ) {\n\t\t\t\t\t$col_values[] = '';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdo {\n\t\t\t\t$row_values = array();\n\t\t\t\t$has_more = false;\n\t\t\t\tforeach( $extra_rows as $col => &$col_values ) {\n\t\t\t\t\t$row_values[ $col ] = ! empty( $col_values ) ? array_shift( $col_values ) : '';\n\t\t\t\t\tif ( count( $col_values ) ) {\n\t\t\t\t\t\t$has_more = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$row_values = array_map(array($this, 'padColumn'), $row_values, array_keys($row_values));\n\t\t\t\tarray_unshift($row_values, ''); // First border\n\t\t\t\tarray_push($row_values, ''); // Last border\n\n\t\t\t\t$ret .= PHP_EOL . join($this->_characters['border'], $row_values);\n\t\t\t} while( $has_more );\n\t\t}\n\t\treturn $ret;\n\t}", "public function getValueFormatersNames(): array;", "public function cellFormat($row, $column) {\n\t}", "public function getFormattedQueryResults( $queryResults ) {\n\t\t$formattedQueryResults = $queryResults;\n\t\tforeach ( $queryResults as $rowNum => $row ) {\n\t\t\tforeach ( $row as $fieldName => $value ) {\n\t\t\t\tif ( trim( $value ) == '' ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( !array_key_exists( $fieldName, $this->mFieldDescriptions ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$fieldDescription = $this->mFieldDescriptions[$fieldName];\n\t\t\t\t$tableName = $this->mFieldTables[$fieldName];\n\t\t\t\t$fieldType = $fieldDescription->mType;\n\n\t\t\t\t$text = '';\n\t\t\t\tif ( $fieldDescription->mIsList ) {\n\t\t\t\t\t// There's probably an easier way to do\n\t\t\t\t\t// this, using array_map().\n\t\t\t\t\t$delimiter = $fieldDescription->mDelimiter;\n\t\t\t\t\t$fieldValues = explode( $delimiter, $value );\n\t\t\t\t\tforeach( $fieldValues as $i => $fieldValue ) {\n\t\t\t\t\t\tif ( trim( $fieldValue ) == '' ) continue;\n\t\t\t\t\t\tif ( $i > 0 ) $text .= \"$delimiter \";\n\t\t\t\t\t\t$text .= self::formatFieldValue( $fieldValue, $fieldType, $fieldDescription, $this->mParser );\n\t\t\t\t\t}\n\t\t\t\t} elseif ( $fieldType == 'Date' || $fieldType == 'Datetime' ) {\n\t\t\t\t\t$datePrecisionField = str_replace( ' ', '_', $fieldName ) . '__precision';\n\t\t\t\t\tif ( array_key_exists( $datePrecisionField, $row ) ) {\n\t\t\t\t\t\t$datePrecision = $row[$datePrecisionField];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$fullDatePrecisionField = $tableName . '.' . $datePrecisionField;\n\t\t\t\t\t\tif ( array_key_exists( $fullDatePrecisionField, $row ) ) {\n\t\t\t\t\t\t\t$datePrecision = $row[$fullDatePrecisionField];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// This should never\n\t\t\t\t\t\t\t// happen, but if it\n\t\t\t\t\t\t\t// does - let's just\n\t\t\t\t\t\t\t// give up.\n\t\t\t\t\t\t\t$datePrecision = CargoStore::FULL_PRECISION;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$text = self::formatDateFieldValue( $value, $datePrecision, $fieldType );\n\t\t\t\t} else {\n\t\t\t\t\t$text = self::formatFieldValue( $value, $fieldType, $fieldDescription, $this->mParser );\n\t\t\t\t}\n\t\t\t\tif ( $text != '' ) {\n\t\t\t\t\t$formattedQueryResults[$rowNum][$fieldName] = $text;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $formattedQueryResults;\n\t}", "public function nextRow() {\n $row = parent::nextRow();\n\n // If any decimal columns, ensure we map them back to the correct PHP type\n // GETS ROUND A HOPEFULLY TEMPORARY WEIRDNESS WITH PDO/MYSQL\n if ($this->decimalColumns && $row) {\n foreach ($this->decimalColumns as $decimalColumn) {\n $row[$decimalColumn] = doubleval($row[$decimalColumn]);\n }\n }\n\n return $row;\n }", "function AggregateListRowValues() {\n\t}", "function AggregateListRowValues() {\n\t}", "function AggregateListRowValues() {\n\t}", "function AggregateListRowValues() {\n\t}", "public function get_values(){\n $value_str = '';\n if (is_array($this->value)){\n foreach ($this->value as $val){\n $value_str .= $val.' ';\n }\n } else {\n $value_str .= $this->value;\n }\n\n return $value_str;\n }", "public function format()\n {\n $result = array();\n\n foreach ($this->groups as $group) {\n $result[] = array(\n 'id' => $group->getInternalId(),\n 'external_id' => $group->getExternalId(),\n 'value' => $group->getName(),\n 'label' => $group->getName(),\n );\n }\n\n return $result;\n }", "final protected function getSqlRow() {\n\t\t$myArray = array ();\n\t\tforeach ( $this as $key => $value ) {\n\t\t\t$value = addslashes ( $value );\n\t\t\t$myArray [\"$key\"] = \"$value\";\n\t\t}\n\t\treturn $myArray;\n\t}", "function getCalculatedRows();", "public function toRow() {\r\n\t\treturn $this->PDOStatement->fetch(PDO::FETCH_ASSOC);\r\n\t}", "public function toRow()\n {\n return $this->pdoStatement->fetch(\\PDO::FETCH_ASSOC);\n }", "protected function newRow()\n\t{\n\t\t$this->loadDefaultValues();\n\t\t$row = [];\n\t\t$row['document_sequence'] = $this->document_sequence->CurrentValue;\n\t\t$row['firelink_doc_no'] = $this->firelink_doc_no->CurrentValue;\n\t\t$row['project_name'] = $this->project_name->CurrentValue;\n\t\t$row['document_tittle'] = $this->document_tittle->CurrentValue;\n\t\t$row['submit_no'] = $this->submit_no->CurrentValue;\n\t\t$row['revision_no'] = $this->revision_no->CurrentValue;\n\t\t$row['transmit_no'] = $this->transmit_no->CurrentValue;\n\t\t$row['transmit_date'] = $this->transmit_date->CurrentValue;\n\t\t$row['direction'] = $this->direction->CurrentValue;\n\t\t$row['approval_status'] = $this->approval_status->CurrentValue;\n\t\t$row['document_link'] = $this->document_link->Upload->DbValue;\n\t\t$row['transaction_date'] = $this->transaction_date->CurrentValue;\n\t\t$row['document_native'] = $this->document_native->CurrentValue;\n\t\t$row['username'] = $this->username->CurrentValue;\n\t\t$row['expiry_date'] = $this->expiry_date->CurrentValue;\n\t\treturn $row;\n\t}", "public function getRow() {}", "private function getColumnValues()\n {\n return array_slice($this->_args, 2);\n }", "function _formatData($column, $value, &$R){\n global $conf;\n $vals = explode(\"\\n\",$value);\n $outs = array();\n foreach($vals as $val){\n $val = trim($val);\n if($val=='') continue;\n $type = $column['type'];\n if (is_array($type)) $type = $type['type'];\n switch($type){\n case 'page':\n $val = $this->_addPrePostFixes($column['type'], $val, ':');\n $outs[] = $R->internallink($val,null,null,true);\n break;\n case 'title':\n case 'pageid':\n list($id,$title) = explode('|',$val,2);\n $id = $this->_addPrePostFixes($column['type'], $id, ':');\n $outs[] = $R->internallink($id,$title,null,true);\n break;\n case 'nspage':\n // no prefix/postfix here\n $val = ':'.$column['key'].\":$val\";\n\n $outs[] = $R->internallink($val,null,null,true);\n break;\n case 'mail':\n list($id,$title) = explode(' ',$val,2);\n $id = $this->_addPrePostFixes($column['type'], $id);\n $id = obfuscate(hsc($id));\n if(!$title){\n $title = $id;\n }else{\n $title = hsc($title);\n }\n if($conf['mailguard'] == 'visible') $id = rawurlencode($id);\n $outs[] = '<a href=\"mailto:'.$id.'\" class=\"mail\" title=\"'.$id.'\">'.$title.'</a>';\n break;\n case 'url':\n $val = $this->_addPrePostFixes($column['type'], $val);\n $outs[] = '<a href=\"'.hsc($val).'\" class=\"urlextern\" title=\"'.hsc($val).'\">'.hsc($val).'</a>';\n break;\n case 'tag':\n // per default use keyname as target page, but prefix on aliases\n if(!is_array($column['type'])){\n $target = $column['key'].':';\n }else{\n $target = $this->_addPrePostFixes($column['type'],'');\n }\n\n $outs[] = '<a href=\"'.wl(str_replace('/',':',cleanID($target)),array('dataflt'=>$column['key'].'='.$val )).\n '\" title=\"'.sprintf($this->getLang('tagfilter'),hsc($val)).\n '\" class=\"wikilink1\">'.hsc($val).'</a>';\n break;\n case 'timestamp':\n $outs[] = dformat($val);\n break;\n case 'wiki':\n global $ID;\n $oldid = $ID;\n list($ID,$data) = explode('|',$val,2);\n $data = $this->_addPrePostFixes($column['type'], $data);\n // Trim document_{start,end}, p_{open,close}\n $ins = array_slice(p_get_instructions($data), 2, -2);\n $outs[] = p_render('xhtml', $ins, $byref_ignore);\n $ID = $oldid;\n break;\n default:\n $val = $this->_addPrePostFixes($column['type'], $val);\n if(substr($type,0,3) == 'img'){\n $sz = (int) substr($type,3);\n if(!$sz) $sz = 40;\n $title = $column['key'].': '.basename(str_replace(':','/',$val));\n $outs[] = '<a href=\"'.ml($val).'\" class=\"media\" rel=\"lightbox\"><img src=\"'.ml($val,\"w=$sz\").'\" alt=\"'.hsc($title).'\" title=\"'.hsc($title).'\" width=\"'.$sz.'\" /></a>';\n }else{\n $outs[] = hsc($val);\n }\n }\n }\n return join(', ',$outs);\n }", "protected function formatResult()\n\t{\n\t\t$this->arResult =& $this->dbResult;\n\t\t$this->arResult['ERRORS'] =& $this->errors;\n\n\t\t$this->arResult['FORM_ID'] = 'CRM_LOC_EDIT_FORM';\n\t\t$this->arResult['GRID_ID'] = 'CRM_LOC_EDIT_GRID';\n\n\t\tforeach($this->componentData['FORM_ROWS'] as $code => $row)\n\t\t{\n\t\t\t$required = $row['required'];\n\n\t\t\tif(!$required && mb_substr($code, 0, 5) == 'NAME_')\n\t\t\t\t$required = true;\n\n\t\t\t$this->arResult['FIELDS'][] = array(\n\t\t\t\t'id' => $code,\n\t\t\t\t'name' => $row['title'],\n\t\t\t\t'value' => Helper::makeSafeDisplay($this->arResult['FORM_DATA'][$code], $code),\n\t\t\t\t'required' => $required,\n\t\t\t\t'type' => 'text' // can and will be redefined at the template\n\t\t\t);\n\t\t}\n\n\t\tif($this->checkIsNonemptyArray($this->arResult['EXTERNAL_SERVICES']))\n\t\t{\n\t\t\t$this->arResult['FIELDS'][] = array(\n\t\t\t\t'id' => 'EXTERNAL',\n\t\t\t\t'required' => false\n\t\t\t);\n\t\t}\n\n\t\t$this->arResult['EXTERNAL_TABLE_COLUMNS'] = Helper::getExternalMap();\n\n\t\tunset($this->componentData);\n\t}", "function format($value);", "public function toFormattedArray() {\r\n $tmp = array();\r\n foreach($this->headers as $key => $val){\r\n $tmp[] = $key . ': ' . $val;\r\n }\r\n return $tmp;\r\n }", "public function getCellValue()\n {\n return $this->get('CellValue');\n }", "public function getCellValue()\n {\n return $this->get('CellValue');\n }", "protected function FormatValue($sValue, $oTableRow)\n {\n return TGlobal::OutHTML($sValue);\n }", "public function format_row(&$p_arrRow)\n {\n global $g_loc;\n\n $p_arrRow[\"practice_date\"] = $g_loc->fmt_datetime($p_arrRow[\"practice_date\"]);\n }", "public function getValueAsString();", "public function getRow();", "protected function _formatColumnStyle($name, $value, $row)\n {\n $styles = array();\n foreach ($this->_column($name)->formatters as $formatter) {\n $style = $formatter['condition']->call($value, $row, $this);\n if (is_bool($style)) {\n if ($style) {\n $styles[] = $formatter['style'];\n }\n } else {\n $styles[] = $style;\n }\n }\n return count($styles) ? ' style=\"' . implode(';', $styles) . '\"' : '';\n }", "public function formatRowWithStringsAlignLeft()\n {\n // Given\n $fieldSpecs = array(\n array(\n \"len\" => \"10\",\n \"type\" => \"s\",\n \"align\" => \"left\"),\n array(\n \"len\" => \"15\",\n \"type\" => \"s\",\n \"align\" => \"left\"),\n );\n $values = array(\"first\", \"second\");\n\n // When\n $result = RowFormatter::format($values, $fieldSpecs, \" \");\n\n // Then\n $this->assertEquals($result, \"first second \");\n }" ]
[ "0.70155305", "0.69406927", "0.6521682", "0.6479101", "0.6448609", "0.6415753", "0.6384841", "0.6347829", "0.6245053", "0.62427217", "0.6240617", "0.61983836", "0.6127799", "0.6094565", "0.6050382", "0.602072", "0.59226245", "0.5862174", "0.58225733", "0.58225733", "0.5727662", "0.57259876", "0.57069546", "0.57023925", "0.5694727", "0.56843203", "0.5656195", "0.56516397", "0.5624657", "0.5601732", "0.55823904", "0.5576388", "0.55744195", "0.55623764", "0.55533504", "0.55531454", "0.55445045", "0.55387926", "0.55321336", "0.55286187", "0.5505453", "0.54962283", "0.5492683", "0.5488461", "0.54839957", "0.5470992", "0.5452818", "0.5452291", "0.5452291", "0.5450551", "0.54242766", "0.541884", "0.5399143", "0.5383868", "0.5364968", "0.5339558", "0.5329532", "0.5325983", "0.53256893", "0.53173393", "0.5317067", "0.5316347", "0.5312522", "0.5307519", "0.53067005", "0.5303179", "0.530273", "0.5299511", "0.5297593", "0.528741", "0.5285051", "0.52791107", "0.52700174", "0.5247075", "0.52453905", "0.52412677", "0.52412677", "0.52412677", "0.52412677", "0.52378726", "0.5229991", "0.52289164", "0.52242416", "0.52194333", "0.5218304", "0.5200423", "0.51948947", "0.5180406", "0.51802456", "0.5179297", "0.5171542", "0.5171155", "0.516867", "0.516867", "0.5159825", "0.51589733", "0.51546365", "0.51490396", "0.51455635", "0.5140697" ]
0.6170964
12
Get the filtered values
public function getFilteredRows($rows) { $filterRows = array(); $filterRow = array(); //------------------- // Получим параметры запроса $request = $this->getRequest(); $params = $request->getParams(); $table = $params['table']; if ($table == 'admin.blog_posts') { foreach ($rows as $row) { // Отфильтруем ненужные поля в записи (масиве) foreach ($row as $key => $value) { // Исключим поля switch ($key) { case "content": break; default : $filterRow[$key] = $value; break; } } if (count($filterRow) > 0) { $filterRows[] = $filterRow; } $filterRow = array(); } } if ($table == 'admin.blog_posts_tags') { foreach ($rows as $row) { // Отфильтруем ненужные поля в записи (масиве) foreach ($row as $key => $value) { // Исключим поля switch ($key) { case "sortColumn": case "ascDescFlg": break; default : $filterRow[$key] = $value; break; } } if (count($filterRow) > 0) { $filterRows[] = $filterRow; } $filterRow = array(); } } if ($table == 'admin.blog_posts_images') { foreach ($rows as $row) { // Отфильтруем ненужные поля в записи (масиве) foreach ($row as $key => $value) { // Исключим поля switch ($key) { case "sortColumn": case "ascDescFlg": break; default : $filterRow[$key] = $value; break; } } if (count($filterRow) > 0) { $filterRows[] = $filterRow; } $filterRow = array(); } } if ($table == 'admin.blog_posts_audio') { foreach ($rows as $row) { // Отфильтруем ненужные поля в записи (масиве) foreach ($row as $key => $value) { // Исключим поля switch ($key) { case "sortColumn": case "ascDescFlg": break; default : $filterRow[$key] = $value; break; } } if (count($filterRow) > 0) { $filterRows[] = $filterRow; } $filterRow = array(); } } if ($table == 'admin.blog_posts_video') { foreach ($rows as $row) { // Отфильтруем ненужные поля в записи (масиве) foreach ($row as $key => $value) { // Исключим поля switch ($key) { case "sortColumn": case "ascDescFlg": break; default : $filterRow[$key] = $value; break; } } if (count($filterRow) > 0) { $filterRows[] = $filterRow; } $filterRow = array(); } } if ($table == 'admin.blog_posts_locations') { foreach ($rows as $row) { // Отфильтруем ненужные поля в записи (масиве) foreach ($row as $key => $value) { // Исключим поля switch ($key) { case "content": case "correction": case "details": case "sortColumn": case "ascDescFlg": break; default : $filterRow[$key] = $value; break; } } if (count($filterRow) > 0) { $filterRows[] = $filterRow; } $filterRow = array(); } } return $filterRows; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFilterValues()\n {\n return $this->filter_values;\n }", "public function getValues($clean = true) {\n if ($clean) {\n return array_diff_key($this->data, $this->filter);\n } else {\n return $this->data;\n }\n }", "public function filtering();", "public function filter()\n {\n foreach ($this->array as $key => $value) {\n foreach ($this->conditions as list($k, $op, $v)) {\n\n $this->convertVariableType($v);\n\n if (!$this->logicFilter($key, $value[$k], $op, $v)) {\n continue 2;\n }\n }\n }\n\n $this->array = array_intersect_key($this->array, array_flip(array_keys($this->filterMask, true)));\n\n return $this->array;\n }", "public function getFilteredDetails();", "public function getFilter() :array;", "public function filter();", "public function filter($values)\n\t{\n\t\treturn $this->returnValues($this->filterValues($this->prepareValues($values)));\n\t}", "public function filters()\n\t{\n\t\treturn array(\n\t\t\t'amount' => array(\n\t\t\t\tarray('Num::filter_number')\n\t\t\t),\n\t\t\t'price' => array(\n\t\t\t\tarray('Num::filter_number')\n\t\t\t)\n\t\t);\n\t}", "abstract protected function filterFieldvalue();", "public function get_filtering()\r\n\t{\r\n\t\treturn $this->filtering->get_value();\r\n\t}", "public function getFilterParameters(): array;", "public function filters()\n {\n return array(\n 'value' => array(\n array(array($this, 'check_for_array_or_object')),\n )\n );\n }", "private static function _getFilter() {}", "public function getFilterValue(): string;", "public function getFilter();", "public function getFilter();", "protected abstract function filter();", "public function getFiltred(array &$data);", "public function getValues();", "public function getGetValues()\n {\n // Define the check for params\n $get_check_array = array(\n // Action\n 'action' => array('filter' => FILTER_SANITIZE_STRING),\n // Id of current row\n 'vraagId' => array('filter' => FILTER_VALIDATE_INT)\n );\n // Get filtered input:\n $inputs = filter_input_array(INPUT_GET, $get_check_array);\n // RTS\n return $inputs;\n }", "public function getValues() {}", "public function getValues() {}", "public function getFilters(): array;", "function readfilter()\n\t{\n\t\t$field = $this->input->post(\"namafield\");\n\t\t$value = $this->input->post(\"valfilter\");\n\n\t\treturn array(\n\t\t\t\t\"field\" => $field,\n\t\t\t\t\"value\" => $value\n\t\t\t);\n\t}", "protected function getFilteredInput(): array\n {\n return (new Filter($this->getParams(), [\n Lines::_HSRC => FILTER_SANITIZE_STRING,\n Stations::_NAME => FILTER_SANITIZE_STRING,\n self::_LIMIT => FILTER_SANITIZE_NUMBER_INT,\n self::_PAGE => FILTER_SANITIZE_NUMBER_INT,\n ]))->process()->toArray();\n }", "public function getFilteredData() {\n $collection = Mage::getModel('redirect404error/redirect404error')->getCollection()\n ->addFieldToSelect('match_type')\n ->addFieldToSelect('match')\n ->addFieldToSelect('destination')\n ->addFieldToSelect('redirect')\n ->addFieldToFilter('status', 1);\n return $collection->getData();\n }", "public function getFilter(): array\n {\n return $this->filter;\n }", "public function getFilter(): array\n {\n return $this->filter;\n }", "public function getFilters(): array;", "function GetExtendedFilterValues() {\n\t\tglobal $deals_details;\n\n\t\t// Field dealer\n\t\t$sSelect = \"SELECT DISTINCT rep.dealer FROM \" . $deals_details->SqlFrom();\n\t\t$sOrderBy = \"rep.dealer ASC\";\n\t\t$wrkSql = ewrpt_BuildReportSql($sSelect, $deals_details->SqlWhere(), \"\", \"\", $sOrderBy, $this->UserIDFilter, \"\");\n\t\t$deals_details->dealer->DropDownList = ewrpt_GetDistinctValues(\"\", $wrkSql);\n\n\t\t// Field date_start\n\t\t$sSelect = \"SELECT DISTINCT rep.date_start FROM \" . $deals_details->SqlFrom();\n\t\t$sOrderBy = \"rep.date_start ASC\";\n\t\t$wrkSql = ewrpt_BuildReportSql($sSelect, $deals_details->SqlWhere(), \"\", \"\", $sOrderBy, $this->UserIDFilter, \"\");\n\t\t$deals_details->date_start->DropDownList = ewrpt_GetDistinctValues($deals_details->date_start->DateFilter, $wrkSql);\n\n\t\t// Field status\n\t\t$sSelect = \"SELECT DISTINCT rep.status FROM \" . $deals_details->SqlFrom();\n\t\t$sOrderBy = \"rep.status ASC\";\n\t\t$wrkSql = ewrpt_BuildReportSql($sSelect, $deals_details->SqlWhere(), \"\", \"\", $sOrderBy, $this->UserIDFilter, \"\");\n\t\t$deals_details->status->DropDownList = ewrpt_GetDistinctValues(\"\", $wrkSql);\n\t}", "abstract protected function getFilters();", "private function filter()\n {\n if ($this->allowsFilter()) {\n if ($this->hasFilters()) {\n $tmp = [];\n foreach ($this->filters as $filter) {\n // check, if it is a \"forbidden\" query parameter\n if ($this->isExcludedParameter($filter['key'])) {\n continue;\n }\n $tmp[] = $filter;\n }\n\n $this->filters = $tmp;\n\n return $this->operator->filter($this->filters);\n }\n }\n }", "public function getFilters();", "public function getPreparedFieldFilterValues () {\n return MLI18n::gi()->get(ucfirst(MLModul::gi()->getMarketPlaceName()).'_Productlist_Filter_aPreparedStatus');\n }", "abstract public function filters();", "function get_active_filter_values($filter_name) {\n global $SESSION;\n\n mtrace('<br><font color=red>NOTICE: $this->get_active_filter_values() is now deprecated; use php_report_filtering_get_active_filter_values($this->get_report_shortname(),$filter_name) instead (sorry... lol)</font><br>');\n\n $result = array();\n\n /* DOES NOT WORK ANYMORE\n if(!empty($this->id)) {\n $filtering_array =& $SESSION->user_index_filtering[$this->id];\n } else {\n $filtering_array =& $SESSION->user_filtering;\n }\n\n if (isset($filtering_array[$filter_name])) {\n $result = $filtering_array[$filter_name];\n }\n */\n\n $reportid = 'php_report_' . $this->get_report_shortname();\n\n if (isset($SESSION->php_report_default_params)) {\n $params = $SESSION->php_report_default_params;\n\n foreach ($params as $key=>$val) {\n if ($key == $reportid.'/'.$filter_name) {\n $result[] = array('value'=>$val);\n }\n }\n }\n\n if (!empty($result)) {\n return $result;\n } else {\n return false;\n }\n }", "public function getValues()\n {\n\n\t\t$record = ProductAttributeValues::whereIn('avid',[1,6])->get();\n\t\t$rec = $record->pluck('pro_att_value');\n\t\treturn $rec;\n }", "public function ReporterFilterData($value)\n {\n $em = $this->getEntityManager();\n if ($value == 'Display All') {\n $qb1 = $em->createQueryBuilder();\n $qb1->select('u.id,up.name,up.employeeId,up.email');\n $qb1->from('Vlreleases\\UserBundle\\Entity\\User', 'u');\n $qb1->innerJoin('u.personalProfile', 'up');\n $result1 = $qb1->getQuery()->getResult();\n return $result1;\n } \n else {\n $qb = $em->createQueryBuilder();\n $qb->select('DISTINCT ur.id');\n $qb->from('Vlreleases\\UserBundle\\Entity\\User', 'u');\n $qb->innerJoin('u.reportingPersons', 'ur');\n if ($value == 'Non Jyo')\n $qb->where(\"u.id !='14'\");\n elseif ($value == 'Jyo')\n $qb->where(\"u.id = '14'\");\n $result = $qb->getQuery()->getResult();\n\n for ($i = '0'; $i < sizeof($result); $i++) {\n $id = $result[$i]['id'];\n $qb1 = $em->createQueryBuilder();\n $qb1->select('u.id,up.name,up.employeeId,up.email');\n $qb1->from('Vlreleases\\UserBundle\\Entity\\User', 'u');\n $qb1->innerJoin('u.personalProfile', 'up');\n $qb1->where(\"u.id='$id'\");\n $finalResult[$i] = $qb1->getQuery()->getResult();\n }\n \n return $finalResult;\n }\n }", "public function filters(){\r\r\n\t\treturn CMap::mergeArray(parent::filters(),array(\r\r\n\t\t\t\r\r\n\t\t));\r\r\n\t}", "public function getFilter(): array\n {\n return $this->model->getFilter();\n }", "public function getValues()\n {\n return $this->getVal('value', []);\n }", "public function filter($data);", "protected function getFilterPrices()\n\t{\n\t\tif (!isset($this->priceFilter))\n\t\t{\n\t\t\t$this->priceFilter = array();\n\t\t\tif (self::$catalog)\n\t\t\t{\n\t\t\t\t//TODO: replace \\CCatalogGroup::GetListArray after create cached d7 method\n\t\t\t\t$priceList = \\CCatalogGroup::GetListArray();\n\t\t\t\tif (!empty($priceList))\n\t\t\t\t\t$this->priceFilter = array_keys($priceList);\n\t\t\t\tunset($priceList);\n\t\t\t}\n\t\t}\n\t\treturn $this->priceFilter;\n\t}", "public function getFilter(){ }", "protected function filter(array $values) {\n return $values;\n }", "private function get_filter()\n {\n $arr_return = array();\n\n // Prompt the expired time to devlog\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, 'begin' );\n\n // Set marker label\n $markerLabel = '###' . strtoupper( $this->curr_tableField ) . '###';\n\n // RETURN condition isn't met\n if ( !$this->ts_getCondition() )\n {\n $arr_return[ 'data' ][ 'marker' ][ $markerLabel ] = null;\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, 'end' );\n return $arr_return;\n }\n // RETURN condition isn't met\n\n $this->set_currFilterIsArea();\n\n // Get filter rows\n $arr_return = $this->get_rows();\n if ( $arr_return[ 'error' ][ 'status' ] )\n {\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, 'end' );\n return $arr_return;\n }\n $rows = $arr_return[ 'data' ][ 'rows' ];\n unset( $arr_return );\n // Get filter rows\n // Set class var $rows\n $this->rows = $rows;\n\n // Localise the rows\n $this->localise();\n\n // Render the filter rows\n $arr_return = $this->get_filterItems();\n $items = $arr_return[ 'data' ][ 'items' ];\n unset( $arr_return );\n $arr_return[ 'data' ][ 'marker' ][ $markerLabel ] = $items;\n // Render the filter rows\n // Prompt the expired time to devlog\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, 'end' );\n return $arr_return;\n }", "protected function _getItemsData()\n {\n if ($this->_filterItems === null) {\n $attribute = $this->getAttributeModel();\n $this->_requestVar = 'filter' . $attribute->getAttributeCode();\n\n $options = $attribute->getItems();\n $this->_filterItems = array();\n if (is_array($options)) {\n foreach ($options as $option) {\n if ($option['selected'] == true) {\n $this->_selectedFilterItems[$attribute->getAttributeCode()][] = $option;\n continue;\n }\n\n $this->_filterItems[] = $option;\n }\n }\n }\n\n return $this->_filterItems;\n }", "function GetFilterValues(&$fld) {\n\t\t$parm = substr($fld->FldVar, 2);\n\t\tif (ewrpt_IsHttpPost())\n\t\t\treturn; // Skip post back\n\t\t$got = FALSE;\n\t\tif (isset($_GET[\"sv1_$parm\"])) {\n\t\t\t$fld->SearchValue = ewrpt_StripSlashes($_GET[\"sv1_$parm\"]);\n\t\t\t$got = TRUE;\n\t\t}\n\t\tif (isset($_GET[\"so1_$parm\"])) {\n\t\t\t$fld->SearchOperator = ewrpt_StripSlashes($_GET[\"so1_$parm\"]);\n\t\t\t$got = TRUE;\n\t\t}\n\t\tif (isset($_GET[\"sc_$parm\"])) {\n\t\t\t$fld->SearchCondition = ewrpt_StripSlashes($_GET[\"sc_$parm\"]);\n\t\t\t$got = TRUE;\n\t\t}\n\t\tif (isset($_GET[\"sv2_$parm\"])) {\n\t\t\t$fld->SearchValue2 = ewrpt_StripSlashes($_GET[\"sv2_$parm\"]);\n\t\t\t$got = TRUE;\n\t\t}\n\t\tif (isset($_GET[\"so2_$parm\"])) {\n\t\t\t$fld->SearchOperator2 = ewrpt_StripSlashes($_GET[\"so2_$parm\"]);\n\t\t\t$got = TRUE;\n\t\t}\n\t\treturn $got;\n\t}", "function GetFilterValues(&$fld) {\n\t\t$parm = substr($fld->FldVar, 2);\n\t\tif (ewrpt_IsHttpPost())\n\t\t\treturn; // Skip post back\n\t\t$got = FALSE;\n\t\tif (isset($_GET[\"sv1_$parm\"])) {\n\t\t\t$fld->SearchValue = ewrpt_StripSlashes($_GET[\"sv1_$parm\"]);\n\t\t\t$got = TRUE;\n\t\t}\n\t\tif (isset($_GET[\"so1_$parm\"])) {\n\t\t\t$fld->SearchOperator = ewrpt_StripSlashes($_GET[\"so1_$parm\"]);\n\t\t\t$got = TRUE;\n\t\t}\n\t\tif (isset($_GET[\"sc_$parm\"])) {\n\t\t\t$fld->SearchCondition = ewrpt_StripSlashes($_GET[\"sc_$parm\"]);\n\t\t\t$got = TRUE;\n\t\t}\n\t\tif (isset($_GET[\"sv2_$parm\"])) {\n\t\t\t$fld->SearchValue2 = ewrpt_StripSlashes($_GET[\"sv2_$parm\"]);\n\t\t\t$got = TRUE;\n\t\t}\n\t\tif (isset($_GET[\"so2_$parm\"])) {\n\t\t\t$fld->SearchOperator2 = ewrpt_StripSlashes($_GET[\"so2_$parm\"]);\n\t\t\t$got = TRUE;\n\t\t}\n\t\treturn $got;\n\t}", "public static function get_values()\n {\n }", "public static function get_values()\n {\n }", "public static function get_values()\n {\n }", "function GetFilter ( )\n{\n\treturn $this->FilterExp();\n}", "public function getActiveFilters()\n {\n \t$ret = $this->getSettingValue('filters', []);\n \treturn (is_array($ret)) ? $ret : [];\n }", "public function getFilterProducts()\n {\n return $this->filterProducts;\n }", "public function getFilter($value) {\n\t$filter = array();\n\tif ($value && !is_array($value)) {\n\t $filter[$this->field] = $value;\n\t}\n\treturn $filter;\n }", "private function get_filterItems()\n {\n $arr_return = array();\n\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Default return value\n $arr_return[ 'data' ][ 'items' ] = null;\n\n // Set rows, if current filter is with areas\n $this->areas_toRows();\n\n// 4.1.16, 120927, dwildt, -\n// // RETURN rows are empty\n// if( empty ( $this->rows) )\n// {\n// // DRS\n// if( $this->pObj->b_drs_warn )\n// {\n// $prompt = 'Rows are empty. Filter: ' . $this->curr_tableField . '.';\n// t3lib_div::devlog( '[WARN/FILTER] ' . $prompt, $this->pObj->extKey, 2 );\n// }\n// // DRS\n// return $arr_return;\n// }\n// // RETURN rows are empty\n// 4.1.16, 120927, dwildt, -\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Set nice_piVar\n $this->set_nicePiVar();\n\n // Set class var $htmlSpaceLeft\n $this->set_htmlSpaceLeft();\n\n // Set class var $maxItemsPerHtmlRow\n $this->set_maxItemsPerHtmlRow();\n\n // SWITCH current filter is a tree view\n // #i0117, 141223, dwildt, 1-/+\n //switch ( in_array( $table, $this->arr_tablesWiTreeparentfield ) )\n switch ( in_array( $this->curr_tableField, $this->arr_tablesWiTreeparentfield ) )\n {\n case( true ):\n $arr_return = $this->get_filterItemsTree();\n break;\n case( false ):\n default:\n $arr_return = $this->get_filterItemsDefault();\n if ( !empty( $arr_return ) )\n {\n $items = $arr_return[ 'data' ][ 'items' ];\n $arr_return = $this->get_filterItemsWrap( $items );\n }\n break;\n }\n // SWITCH current filter is a tree view\n\n return $arr_return;\n }", "public function getAllValues();", "protected function getFilter() {\n\t\t$conditions = $this->getConditions();\n\t\treturn $conditions;\n\t}", "public function get_filtros(){\n\t\treturn Filtro::get();\n\t}", "abstract public function filterFields();", "public function & GetFilters () {\n\t\t$filters = [];\n\t\tforeach ($this->filters as $direction => $handler) \n\t\t\t$filters[$direction] = $handler[1];\n\t\treturn $filters;\n\t}", "public function filtering(): string;", "public function getFilterResponse();", "public function getValueUnfiltered()\n {\n return $this->_value;\n }", "private function filterFields() {\n\n // Initialize an associate array of our field name and value pairs.\n $values = array();\n\n // Initialize an associate array of our field name and filters pairs.\n $filters = array();\n\n // Populate the arrays.\n foreach ($this->fields as $field) {\n if ($field->getFilters()) {\n $values[$field->getName()] = $field->getValue();\n $filters[$field->getName()] = $field->getFilters();\n }\n }\n\n // Load an instance of GUMP to use to sanitize and filter our field values.\n $gump = new \\GUMP();\n\n // Sanitize the field values.\n $values = $gump->sanitize($values);\n\n // Pass the arrays to GUMP and let it do the heavy-lifting.\n $values = $gump->filter($values, $filters);\n\n // Set the values of all fields to their filtered values.\n foreach ($values as $name => $value) {\n $this->passValue($name, $value);\n }\n }", "public function filterByValueRecursive() {}", "public function getValuesList(){\n return $this->_get(1);\n }", "public function filter(): array {\n\t\t$results = [];\n\t\tforeach ( $this->filter_item_keys() as $item_key ) {\n\t\t\tif ( ! isset( $this->items[ $item_key ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$item = $this->filter_item( $this->items[ $item_key ] );\n\n\t\t\tif ( $item ) {\n\t\t\t\t$results[$item_key] = $item;\n\t\t\t}\n\t\t}\n\n\t\treturn $results;\n\t}", "public function filter_values()\n {\n $current_time = time();\n $values = $this->storevalues;\n if (!empty($values)) {\n $filter_values = array_filter($values, function ($value) use ($current_time) {\n $difference = ($current_time - $value['created_at']);\n $difference = $difference / 60; //difference in minutes\n return ($difference < $this->expiration_time);\n }, ARRAY_FILTER_USE_BOTH);\n //Save the filtered values\n $this->save($filter_values);\n }\n }", "public function getFilterInput();", "public function getValuesList() {\n return $this->_get(2);\n }", "public static function GET_FILTER(): array\n\t{\n\t\treturn self::$filters;\n\t}", "public function get_values(){ return $this->values; }", "public function GetFilters ();", "public function getFilter(): string;", "function getFilterFromRequest() {\n\t\t$_filter = array();\n\n\t\tif(isset($_REQUEST['filterSelect_0'])) {\n\n\n\t\t\t$_parse = true;\n\t\t\t$_count = 0;\n\n\t\t\twhile ($_parse) {\n\t\t\t\tif(isset($_REQUEST['filterSelect_'.$_count])) {\n\n\t\t\t\t\tif(isset($_REQUEST['filterLogic_'.$_count]) && $_REQUEST['filterLogic_'.$_count]=='OR') {\n\t\t\t\t\t\t$_logic = 'OR';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$_logic = 'AND';\n\t\t\t\t\t}\n\t\t\t\t\tif(isset($_REQUEST['filterValue_'.$_count]) && trim($_REQUEST['filterValue_'.$_count])<>'') {\n\t\t\t\t\t\t$_filter[] = array(\n\t\t\t\t\t\t\t\t'logic' => $_logic,\n\t\t\t\t\t\t\t\t'field' => $_REQUEST['filterSelect_'.$_count],\n\t\t\t\t\t\t\t\t'operation' => $_REQUEST['filterOperation_'.$_count],\n\t\t\t\t\t\t\t\t'value' => $_REQUEST['filterValue_'.$_count]\n\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t$_count++;\n\t\t\t\t} else {\n\t\t\t\t\t$_parse = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $_filter;\n\t}", "public function filter() {\n\t\t$args = func_get_args();\n\t\t$r = Core_Types::reflection_for($this->sets[':default']);\n\t\t$m = $r->getMethod('filter');\n\t\treturn $m->invokeArgs($this->sets[':default'],$args);\n\t}", "private function get_filterItemsFromRows()\n {\n // Default return value\n $arr_return = array();\n $arr_return[ 'data' ][ 'items' ] = null;\n\n // RETURN rows are empty\n if ( empty( $this->rows ) )\n {\n // DRS\n if ( $this->pObj->b_drs_warn )\n {\n $prompt = 'Rows are empty. Filter: ' . $this->curr_tableField . '.';\n t3lib_div::devlog( '[WARN/FILTER] ' . $prompt, $this->pObj->extKey, 2 );\n }\n // DRS\n return $arr_return;\n }\n // RETURN rows are empty\n // Get table and field\n list( $table ) = explode( '.', $this->curr_tableField );\n\n // Set nice_piVar\n $this->set_nicePiVar();\n\n // Set class var $htmlSpaceLeft\n $this->set_htmlSpaceLeft();\n\n // Set class var $maxItemsPerHtmlRow\n $this->set_maxItemsPerHtmlRow();\n\n // SWITCH current filter is a tree view\n // #i0117, 141223, dwildt, 1-/+\n //switch ( in_array( $table, $this->arr_tablesWiTreeparentfield ) )\n switch ( in_array( $this->curr_tableField, $this->arr_tablesWiTreeparentfield ) )\n {\n case( true ):\n $arr_return = $this->get_filterItemsTree();\n break;\n case( false ):\n default:\n $arr_return = $this->get_filterItemsDefault();\n $items = $arr_return[ 'data' ][ 'items' ];\n $arr_return = $this->get_filterItemsWrap( $items );\n break;\n }\n // SWITCH current filter is a tree view\n\n return $arr_return;\n }", "public function all()\n {\n return $this->values;\n }", "public function values();", "public function values();", "public function values();", "public function values();", "public function values();", "protected function filterSliderFields(): array\n {\n return [];\n }", "protected function prefilterValues(array $values)\n\t{\n\t\treturn array_filter($values, [$this, 'prefilterValue']);\n\t}", "public function getValuesList() {\n return $this->_get(3);\n }", "protected function getFilterable()\n {\n return [];\n }", "public function getValues(): array;", "public function getValues(): array;", "public function getAll()\n {\n return $this->values;\n }", "public function getAll()\n {\n return $this->values;\n }", "public function filters()\n {\n $filters = array(\n 'postOnly + delete',\n );\n\n return CMap::mergeArray($filters, parent::filters());\n }", "public function filters()\n {\n $filters = array(\n 'postOnly + delete',\n );\n\n return CMap::mergeArray($filters, parent::filters());\n }", "public function getValues()\n {\n return $this->values;\n }", "public function getValues()\n {\n return $this->values;\n }", "public function getValues()\n {\n return $this->values;\n }", "public function getValues()\n {\n return $this->values;\n }", "function filterValuesArray(array $values) {\n $res = array();\n foreach ($values as $v) {\n if (is_scalar(($v))) $res[] = $v;\n }\n $res = array_intersect($res, array_keys($this->getValueList()));\n return $res;\n }" ]
[ "0.81921625", "0.7246898", "0.71400106", "0.70694065", "0.7029267", "0.7017463", "0.6964265", "0.68759525", "0.67988944", "0.6796289", "0.67618036", "0.67512417", "0.6748305", "0.6697213", "0.66776544", "0.6651267", "0.6651267", "0.66359484", "0.6593406", "0.6587459", "0.65525955", "0.6551676", "0.6551676", "0.6539656", "0.6509639", "0.65052617", "0.6477902", "0.647256", "0.647256", "0.6461109", "0.6450032", "0.6443601", "0.64075476", "0.6397577", "0.6372973", "0.63696504", "0.6368294", "0.63584745", "0.6355864", "0.6345941", "0.6340971", "0.63384163", "0.63203907", "0.6317129", "0.6315923", "0.63060784", "0.63037354", "0.6253681", "0.62522477", "0.62522477", "0.62320733", "0.62320733", "0.62320733", "0.6220062", "0.6213934", "0.6191887", "0.61819035", "0.6179498", "0.6176392", "0.6173805", "0.6162783", "0.61496234", "0.61354613", "0.61316043", "0.6127561", "0.61254853", "0.61203754", "0.61157626", "0.6110397", "0.6110073", "0.61075056", "0.6097436", "0.6082235", "0.60819256", "0.60804284", "0.6060466", "0.6052346", "0.60296845", "0.602842", "0.6019492", "0.6008764", "0.6007217", "0.6007217", "0.6007217", "0.6007217", "0.6007217", "0.60071784", "0.6006702", "0.59984446", "0.59846956", "0.59813917", "0.59813917", "0.59749645", "0.59749645", "0.59671825", "0.59671825", "0.5964204", "0.5964204", "0.5964204", "0.5964204", "0.5955458" ]
0.0
-1
Valid the values of the row when save
public function validRowForSave($row) { $params = $this->_request->getParams(); $table = $params['table']; //----------------------- // Проверим строку на валидность $jsons = $this->_isValidRow($row); if (isset($jsons['class_message'])) { // Ошибка валидации return $jsons; } // Проверка валидации особых случаев if ($table == 'admin.blog_posts_tags') { $params = array(); $params['table'] = 'blog_posts_tags'; $params['fieldKey1'] = 'post_id'; $params['fieldKey2'] = 'tag'; $params['adapter'] = $this->db; $params['id'] = $row['id']; $validator = new Default_Form_Validate_DbMultipleKey($params); $value = $row['post_id'] . ';' . $row['tag']; if (!$validator->isValid($value)) { $messages = $validator->getMessages(); $newMess = array(); $newMess[] = '<em>' . Zend_Registry::get('Zend_Translate')->_('Ошибка формы! Неверно введены данные в форму.') . '</em>'; $messages = array_values($messages); $newMess[] = $messages[0]; $jsons = array( 'class_message' => 'warning', 'messages' => $newMess ); } } return $jsons; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _processValidForm()\n {\n $table = $this->_getTable();\n\n $formValues = $this->_getForm()->getValues();\n\n if (!empty($formValues[$this->_getPrimaryIdKey()])) {\n $row = $this->_getRow($this->_getPrimaryId());\n } else {\n $row = $table->createRow();\n }\n\n foreach ($formValues as $key => $value) {\n if (isset($row->$key) && !$table->isIdentity($key)) {\n $row->$key = $value;\n }\n }\n\n $row->save();\n\n $this->_goto($this->_getBrowseAction());\n }", "private function validate(){\n\t\t$row = $this->row;\n\t\t$col = $this->col;\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeRow($i,$j);\n\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeCol($i,$j);\n\n\t}", "function checkValues($row,&$data,$insert,$from_update=false) {\n global $Language;\n $hp = Codendi_HTMLPurifier::instance();\n for ($c=0; $c < count($this->parsed_labels); $c++) {\n $label = $this->parsed_labels[$c];\n $val = $data[$c];\n $field = $this->used_fields[$label];\n if ($field) $field_name = $field->getName();\n \n // check if val in predefined vals (if applicable)\n unset($predef_vals);\n if (isset($this->predefined_values[$c])) {$predef_vals = $this->predefined_values[$c];}\n if (isset($predef_vals)) {\n\tif (!$this->checkPredefinedValues($field,$field_name,$label,$val,$predef_vals,$row,$data)) {\n\t return false;\n\t}\n }\n \n // check whether we specify None for a field which is mandatory\n if ($field && !$field->isEmptyOk() &&\n\t $field_name != \"artifact_id\") {\n\tif ($field_name == \"submitted_by\" ||\n\t $field_name == \"open_date\") {\n\t //submitted on and submitted by are accepted as \"\" on inserts and\n\t //we put time() importing user as default\n\t} else {\n\t \n\t $is_empty = ( ($field->isSelectBox() || $field->isMultiSelectBox()) ? ($val==$Language->getText('global','none')) : ($val==''));\n\n\t if ($is_empty) {\n\t $this->setError($Language->getText('plugin_tracker_import_utils','field_mandatory_and_current',array(\n $row+1,\n $hp->purify(implode(\",\",$data), CODENDI_PURIFIER_CONVERT_HTML),\n $hp->purify($label, CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify(SimpleSanitizer::unsanitize($this->ath->getName()), CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify($val, CODENDI_PURIFIER_CONVERT_HTML) )));\n\t return false;\n\t }\n\t}\n }\n \n // for date fields: check format\n if ($field && $field->isDateField()) {\n\tif ($field_name == \"open_date\" && $val == \"\") {\n\t //is ok.\n\t} else {\n\t \n\t if ($val == \"-\" || $val == \"\") {\n\t //ok. transform it by hand into 0 before updating db\n\t $data[$c] = \"\";\n\t } else {\n\t list($unix_time,$ok) = util_importdatefmt_to_unixtime($val);\n\t if (!$ok) {\n\t $this->setError($Language->getText('plugin_tracker_import_utils','incorrect_date',array(\n $row+1,\n $hp->purify(implode(\",\",$data), CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify($val, CODENDI_PURIFIER_CONVERT_HTML) )));\n\t return false;\n\t }\n\t $date = format_date(\"Y-m-d\",$unix_time);\n\t $data[$c] = $date;\n\t }\n\t}\n }\n } // end of for parsed_labels\n\n\n if (!$insert && $label == $this->lbl_list['follow_ups']) {\n /* check whether we need to remove known follow-ups */\n \n }\n \n // if we come from update case ( column tracker_id is specified but for this concrete artifact no aid is given)\n // we have to check whether all mandatory fields are specified and not empty\n if ($from_update) {\n\n \n while (list($label,$field) = each($this->used_fields)) {\n\tif ($field) $field_name = $field->getName();\n\t\n\tif ($field) {\n if ($field_name != \"artifact_id\" &&\n $field_name != \"open_date\" &&\n $field_name != \"submitted_by\" &&\n $label != $this->lbl_list['follow_ups'] &&\n $label != $this->lbl_list['is_dependent_on'] &&\n $label != $this->lbl_list['add_cc'] &&\n $label != $this->lbl_list['cc_comment'] &&\n !$field->isEmptyOk() && !in_array($label,$this->parsed_labels)) {\n\t \n\t $this->setError($Language->getText('plugin_tracker_import_utils','field_mandatory_and_line',array(\n $row+1,\n $hp->purify(implode(\",\",$data), CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify($label, CODENDI_PURIFIER_CONVERT_HTML) ,\n $hp->purify(SimpleSanitizer::unsanitize($this->ath->getName()), CODENDI_PURIFIER_CONVERT_HTML) )));\n\t return false;\n }\n\t}\n }\n \n \n }//end from_update\n \n return true;\n }", "function validate_rows() {\r\n $ok = True;\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if (!$this->validate_field($colvar,$i)) { # make sure this field is not empty\r\n $ok = False;\r\n }\r\n }\r\n }\r\n return $ok;\r\n }", "public function isValid() {\n\n foreach ($this->entity as $nameColumn => $column) {\n\n $validate = null;\n // Se for chave primaria e tiver valor, valida inteiro somente sem nenhuma outra validacao.\n if ($column['contraint'] == 'pk' && $column['value']) {\n $validate = new Zend_Validate_Digits();\n } else {\n\n//______________________________________________________________________________ VALIDANDO POR TIPO DA COLUNA NO BANCO\n // Se tiver valor comeca validacoes de acordo com o tipo.\n // Se nao pergunta se é obrigatorio, se for obrigatorio valida.\n if ($column['value']) {\n // Se for inteiro\n if ($column['type'] == 'integer' || $column['type'] == 'smallint') {\n $validate = new Zend_Validate_Digits();\n // Se for data\n } else if ($column['type'] == 'numeric') {\n $column['value'] = str_replace('.', '', $column['value']);\n $column['value'] = (float) str_replace(',', '.', $column['value']);\n $validate = new Zend_Validate_Float();\n } else if ($column['type'] == 'date') {\n\n\t\t\t\t\t\t$posBarra = strpos($column['value'], '/');\n\t\t\t\t\t\t$pos = strpos($column['value'], '-');\n\t\t\t\t\t\tif ($posBarra !== false) {\n\t\t\t\t\t\t\t$date = explode('/', $column['value']);\n\t\t\t\t\t\t\tif (!checkdate($date[1], $date[0], $date[2])) {\n\t\t\t\t\t\t\t\t$this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($column['value'] . self::MSG_DATA_INVALIDA));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($pos !== false) {\n\t\t\t\t\t\t\t$date = explode('-', $column['value']);\n\t\t\t\t\t\t\tif (!checkdate($date[1], $date[2], $date[0])) {\n\t\t\t\t\t\t\t\t$this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($column['value'] . self::MSG_DATA_INVALIDA));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n // Se for texto\n } else if ($column['type'] == 'character' || $column['type'] == 'character varying') {\n\n // Se for Bollean\n } else if ($column['type'] == 'boolean') {\n\n // Se for texto\n } else if ($column['type'] == 'text') {\n \n } else if ($column['type'] == 'timestamp without time zone') {\n if (strpos($column['value'], '/')) {\n\n if (strpos($column['value'], ' ')) {\n $arrDate = explode(' ', $column['value']);\n\n // Validando a data\n $date = explode('/', $arrDate[0]);\n if (!checkdate($date[1], $arrDate[0], $date[2])) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($arrDate[0] . self::MSG_DATA_INVALIDA));\n }\n\n // Validando a hora\n $validateTime = new Zend_Validate_Date('hh:mm');\n $validateTime->isValid($arrDate[1]);\n if ($validateTime->getErrors()) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($arrDate[1] . self::MSG_DATA_HORA_INVALIDA));\n }\n } else {\n // Validando a data\n $date = explode('/', trim($column['value']));\n if (!checkdate($date[1], $date[0], $date[2])) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($column['value'] . self::MSG_DATA_INVALIDA));\n }\n }\n }\n }\n\n//______________________________________________________________________________ VALIDANDO POR LIMITE DA COLUNA NO BANCO\n // Validando quantidade de caracteres.\n if ($column['maximum']) {\n $validateMax = new Zend_Validate_StringLength(array('max' => $column['maximum']));\n $validateMax->isValid($column['value']);\n if ($validateMax->getErrors()) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => (reset($validateMax->getMessages())));\n }\n $validateMax = null;\n }\n } else {\n//______________________________________________________________________________ VALIDANDO POR NAO VAZIO DA COLUNA NO BANCO\n // Validando se nao tiver valor e ele for obrigatorio.\n if ($column['is_null'] == 'NO' && $column['contraint'] != 'pk') {\n $validate = new Zend_Validate_NotEmpty();\n }\n }\n\n//______________________________________________________________________________ VALIDANDO A CLOUNA E COLOCANDO A MENSAGEM\n if ($validate) {\n $validate->isValid($column['value']);\n if ($validate->getErrors()) {\n\t\t\t\t\t\t$msg = $validate->getMessages();\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ( reset($msg) ));\n }\n\n $validate = null;\n }\n }\n }\n\t\t\n if ($this->error)\n return false;\n else\n return true;\n }", "public function save(){\n\t\t$res = true;\n\t\t$changedData = $this->changedData();\n\t\tif(count($changedData)){\n\t\t\tif(!empty($this->orig)){\n\t\t\t\t$res = (dbHelper::updateQry($this->tableName,$changedData,array($this->primaryKey=>$this->data[$this->primaryKey]))?true:false);\n\t\t\t\t$this->orig = $this->data;\n\t\t\t} else {\n\t\t\t\t//if this row has been deleted but someone else saves data to it this will automatically restore the row from $data\n\t\t\t\t$res = (dbHelper::insertQry($this->tableName,$this->data)?true:false);\n\t\t\t\t$this->data[$this->primaryKey] = db::insertID();\n\t\t\t\tdbData::addRow($this->tableName,$this->primaryKey,$this->data);\n\t\t\t\t$this->orig =& dbData::rowRefrence($this->tableName,$this->primaryKey,$this->data[$this->primaryKey]);\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}", "public function beforeSave()\n {\n $value = $this->getValue();\n try {\n $this->validate($value);\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $e) {\n $msg = __('%1', $e->getMessage());\n $error = new \\Magento\\Framework\\Exception\\LocalizedException($msg, $e);\n throw $error;\n }\n }", "public function validate(){\n\n if(!$this->convert_and_validate_rows()){\n return 0;\n }\n\n if(!$this->validate_columns()){\n return 0;\n }\n\n if(!$this->validate_regions()){\n return 0;\n }\n\n return 1;\n }", "function save() {\n $id = (int)$this->getId();\n $fields = array();\n foreach ($this->_data as $col => &$value) {\n if (($value->flags & DATAFLAG_CHANGED)) // only save/update values that have been changed\n {\n $fields[] = new ColVal($col, $value->dataType, $value->value);\n }\n }\n if (sizeof($fields) == 0) {\n if ($id == 0) {\n return false;\n }\n return true;\n }\n\n if ($id != 0) {\n // update\n if (!App::getDBO()->update($this->getTableName(), $fields, \"id=$id\")) {\n return false;\n }\n } else {\n // save new (insert)\n if ($id = App::getDBO()->insert($this->getTableName(), $fields)) {\n $this->_data['id']->value = $id;\n $this->_data['id']->flags = DATAFLAG_LOADED;\n } else {\n return false;\n }\n }\n\n // if we got here, the save was successful\n\n foreach ($this->_data as $col => &$value) {\n if (($value->flags & DATAFLAG_CHANGED)) // we just saved/updated values that were changed\n {\n $value->flags &= ~DATAFLAG_CHANGED;\n } // remove changed flag\n }\n\n return true;\n }", "function EditRow() {\r\n\t\tglobal $Security, $Language;\r\n\t\t$sFilter = $this->KeyFilter();\r\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\r\n\t\t$conn = &$this->Connection();\r\n\t\t$this->CurrentFilter = $sFilter;\r\n\t\t$sSql = $this->SQL();\r\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE)\r\n\t\t\treturn FALSE;\r\n\t\tif ($rs->EOF) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\r\n\t\t\t$EditRow = FALSE; // Update Failed\r\n\t\t} else {\r\n\r\n\t\t\t// Save old values\r\n\t\t\t$rsold = &$rs->fields;\r\n\t\t\t$this->LoadDbValues($rsold);\r\n\t\t\t$rsnew = array();\r\n\r\n\t\t\t// Nro_Serie\r\n\t\t\t$this->Nro_Serie->SetDbValueDef($rsnew, $this->Nro_Serie->CurrentValue, \"\", $this->Nro_Serie->ReadOnly || $this->Nro_Serie->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// SN\r\n\t\t\t$this->SN->SetDbValueDef($rsnew, $this->SN->CurrentValue, NULL, $this->SN->ReadOnly || $this->SN->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Cant_Net_Asoc\r\n\t\t\t$this->Cant_Net_Asoc->SetDbValueDef($rsnew, $this->Cant_Net_Asoc->CurrentValue, NULL, $this->Cant_Net_Asoc->ReadOnly || $this->Cant_Net_Asoc->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Marca\r\n\t\t\t$this->Id_Marca->SetDbValueDef($rsnew, $this->Id_Marca->CurrentValue, 0, $this->Id_Marca->ReadOnly || $this->Id_Marca->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Modelo\r\n\t\t\t$this->Id_Modelo->SetDbValueDef($rsnew, $this->Id_Modelo->CurrentValue, 0, $this->Id_Modelo->ReadOnly || $this->Id_Modelo->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_SO\r\n\t\t\t$this->Id_SO->SetDbValueDef($rsnew, $this->Id_SO->CurrentValue, 0, $this->Id_SO->ReadOnly || $this->Id_SO->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Estado\r\n\t\t\t$this->Id_Estado->SetDbValueDef($rsnew, $this->Id_Estado->CurrentValue, 0, $this->Id_Estado->ReadOnly || $this->Id_Estado->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// User_Server\r\n\t\t\t$this->User_Server->SetDbValueDef($rsnew, $this->User_Server->CurrentValue, NULL, $this->User_Server->ReadOnly || $this->User_Server->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Pass_Server\r\n\t\t\t$this->Pass_Server->SetDbValueDef($rsnew, $this->Pass_Server->CurrentValue, NULL, $this->Pass_Server->ReadOnly || $this->Pass_Server->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// User_TdServer\r\n\t\t\t$this->User_TdServer->SetDbValueDef($rsnew, $this->User_TdServer->CurrentValue, NULL, $this->User_TdServer->ReadOnly || $this->User_TdServer->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Pass_TdServer\r\n\t\t\t$this->Pass_TdServer->SetDbValueDef($rsnew, $this->Pass_TdServer->CurrentValue, NULL, $this->Pass_TdServer->ReadOnly || $this->Pass_TdServer->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Cue\r\n\t\t\t// Fecha_Actualizacion\r\n\r\n\t\t\t$this->Fecha_Actualizacion->SetDbValueDef($rsnew, ew_CurrentDate(), NULL);\r\n\t\t\t$rsnew['Fecha_Actualizacion'] = &$this->Fecha_Actualizacion->DbValue;\r\n\r\n\t\t\t// Usuario\r\n\t\t\t$this->Usuario->SetDbValueDef($rsnew, CurrentUserName(), NULL);\r\n\t\t\t$rsnew['Usuario'] = &$this->Usuario->DbValue;\r\n\r\n\t\t\t// Call Row Updating event\r\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\r\n\t\t\tif ($bUpdateRow) {\r\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\r\n\t\t\t\tif (count($rsnew) > 0)\r\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\r\n\t\t\t\telse\r\n\t\t\t\t\t$EditRow = TRUE; // No field to update\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t\tif ($EditRow) {\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\r\n\r\n\t\t\t\t\t// Use the message, do nothing\r\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\r\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\r\n\t\t\t\t\t$this->CancelMessage = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\r\n\t\t\t\t}\r\n\t\t\t\t$EditRow = FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Call Row_Updated event\r\n\t\tif ($EditRow)\r\n\t\t\t$this->Row_Updated($rsold, $rsnew);\r\n\t\tif ($EditRow) {\r\n\t\t\t$this->WriteAuditTrailOnEdit($rsold, $rsnew);\r\n\t\t}\r\n\t\t$rs->Close();\r\n\t\treturn $EditRow;\r\n\t}", "function ValidRow($row) {\n\t$ValidRow = TRUE;\n\treturn $ValidRow;\n}", "function EditRow() {\n\t\tglobal $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$conn = &$this->Connection();\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$this->LoadDbValues($rsold);\n\t\t\t$rsnew = array();\n\n\t\t\t// nomr\n\t\t\t$this->nomr->SetDbValueDef($rsnew, $this->nomr->CurrentValue, \"\", $this->nomr->ReadOnly);\n\n\t\t\t// ket_nama\n\t\t\t$this->ket_nama->SetDbValueDef($rsnew, $this->ket_nama->CurrentValue, NULL, $this->ket_nama->ReadOnly);\n\n\t\t\t// ket_tgllahir\n\t\t\t$this->ket_tgllahir->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->ket_tgllahir->CurrentValue, 0), NULL, $this->ket_tgllahir->ReadOnly);\n\n\t\t\t// ket_alamat\n\t\t\t$this->ket_alamat->SetDbValueDef($rsnew, $this->ket_alamat->CurrentValue, NULL, $this->ket_alamat->ReadOnly);\n\n\t\t\t// ket_jeniskelamin\n\t\t\t$this->ket_jeniskelamin->SetDbValueDef($rsnew, $this->ket_jeniskelamin->CurrentValue, NULL, $this->ket_jeniskelamin->ReadOnly);\n\n\t\t\t// ket_title\n\t\t\t$this->ket_title->SetDbValueDef($rsnew, $this->ket_title->CurrentValue, NULL, $this->ket_title->ReadOnly);\n\n\t\t\t// dokterpengirim\n\t\t\t$this->dokterpengirim->SetDbValueDef($rsnew, $this->dokterpengirim->CurrentValue, 0, $this->dokterpengirim->ReadOnly);\n\n\t\t\t// statusbayar\n\t\t\t$this->statusbayar->SetDbValueDef($rsnew, $this->statusbayar->CurrentValue, 0, $this->statusbayar->ReadOnly);\n\n\t\t\t// kirimdari\n\t\t\t$this->kirimdari->SetDbValueDef($rsnew, $this->kirimdari->CurrentValue, 0, $this->kirimdari->ReadOnly);\n\n\t\t\t// keluargadekat\n\t\t\t$this->keluargadekat->SetDbValueDef($rsnew, $this->keluargadekat->CurrentValue, \"\", $this->keluargadekat->ReadOnly);\n\n\t\t\t// panggungjawab\n\t\t\t$this->panggungjawab->SetDbValueDef($rsnew, $this->panggungjawab->CurrentValue, \"\", $this->panggungjawab->ReadOnly);\n\n\t\t\t// masukrs\n\t\t\t$this->masukrs->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->masukrs->CurrentValue, 0), NULL, $this->masukrs->ReadOnly);\n\n\t\t\t// noruang\n\t\t\t$this->noruang->SetDbValueDef($rsnew, $this->noruang->CurrentValue, 0, $this->noruang->ReadOnly);\n\n\t\t\t// tempat_tidur_id\n\t\t\t$this->tempat_tidur_id->SetDbValueDef($rsnew, $this->tempat_tidur_id->CurrentValue, 0, $this->tempat_tidur_id->ReadOnly);\n\n\t\t\t// nott\n\t\t\t$this->nott->SetDbValueDef($rsnew, $this->nott->CurrentValue, \"\", $this->nott->ReadOnly);\n\n\t\t\t// NIP\n\t\t\t$this->NIP->SetDbValueDef($rsnew, $this->NIP->CurrentValue, \"\", $this->NIP->ReadOnly);\n\n\t\t\t// dokter_penanggungjawab\n\t\t\t$this->dokter_penanggungjawab->SetDbValueDef($rsnew, $this->dokter_penanggungjawab->CurrentValue, 0, $this->dokter_penanggungjawab->ReadOnly);\n\n\t\t\t// KELASPERAWATAN_ID\n\t\t\t$this->KELASPERAWATAN_ID->SetDbValueDef($rsnew, $this->KELASPERAWATAN_ID->CurrentValue, NULL, $this->KELASPERAWATAN_ID->ReadOnly);\n\n\t\t\t// NO_SKP\n\t\t\t$this->NO_SKP->SetDbValueDef($rsnew, $this->NO_SKP->CurrentValue, NULL, $this->NO_SKP->ReadOnly);\n\n\t\t\t// sep_tglsep\n\t\t\t$this->sep_tglsep->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->sep_tglsep->CurrentValue, 5), NULL, $this->sep_tglsep->ReadOnly);\n\n\t\t\t// sep_tglrujuk\n\t\t\t$this->sep_tglrujuk->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->sep_tglrujuk->CurrentValue, 5), NULL, $this->sep_tglrujuk->ReadOnly);\n\n\t\t\t// sep_kodekelasrawat\n\t\t\t$this->sep_kodekelasrawat->SetDbValueDef($rsnew, $this->sep_kodekelasrawat->CurrentValue, NULL, $this->sep_kodekelasrawat->ReadOnly);\n\n\t\t\t// sep_norujukan\n\t\t\t$this->sep_norujukan->SetDbValueDef($rsnew, $this->sep_norujukan->CurrentValue, NULL, $this->sep_norujukan->ReadOnly);\n\n\t\t\t// sep_kodeppkasal\n\t\t\t$this->sep_kodeppkasal->SetDbValueDef($rsnew, $this->sep_kodeppkasal->CurrentValue, NULL, $this->sep_kodeppkasal->ReadOnly);\n\n\t\t\t// sep_namappkasal\n\t\t\t$this->sep_namappkasal->SetDbValueDef($rsnew, $this->sep_namappkasal->CurrentValue, NULL, $this->sep_namappkasal->ReadOnly);\n\n\t\t\t// sep_kodeppkpelayanan\n\t\t\t$this->sep_kodeppkpelayanan->SetDbValueDef($rsnew, $this->sep_kodeppkpelayanan->CurrentValue, NULL, $this->sep_kodeppkpelayanan->ReadOnly);\n\n\t\t\t// sep_jenisperawatan\n\t\t\t$this->sep_jenisperawatan->SetDbValueDef($rsnew, $this->sep_jenisperawatan->CurrentValue, NULL, $this->sep_jenisperawatan->ReadOnly);\n\n\t\t\t// sep_catatan\n\t\t\t$this->sep_catatan->SetDbValueDef($rsnew, $this->sep_catatan->CurrentValue, NULL, $this->sep_catatan->ReadOnly);\n\n\t\t\t// sep_kodediagnosaawal\n\t\t\t$this->sep_kodediagnosaawal->SetDbValueDef($rsnew, $this->sep_kodediagnosaawal->CurrentValue, NULL, $this->sep_kodediagnosaawal->ReadOnly);\n\n\t\t\t// sep_namadiagnosaawal\n\t\t\t$this->sep_namadiagnosaawal->SetDbValueDef($rsnew, $this->sep_namadiagnosaawal->CurrentValue, NULL, $this->sep_namadiagnosaawal->ReadOnly);\n\n\t\t\t// sep_lakalantas\n\t\t\t$this->sep_lakalantas->SetDbValueDef($rsnew, $this->sep_lakalantas->CurrentValue, NULL, $this->sep_lakalantas->ReadOnly);\n\n\t\t\t// sep_lokasilaka\n\t\t\t$this->sep_lokasilaka->SetDbValueDef($rsnew, $this->sep_lokasilaka->CurrentValue, NULL, $this->sep_lokasilaka->ReadOnly);\n\n\t\t\t// sep_user\n\t\t\t$this->sep_user->SetDbValueDef($rsnew, $this->sep_user->CurrentValue, NULL, $this->sep_user->ReadOnly);\n\n\t\t\t// sep_flag_cekpeserta\n\t\t\t$this->sep_flag_cekpeserta->SetDbValueDef($rsnew, $this->sep_flag_cekpeserta->CurrentValue, NULL, $this->sep_flag_cekpeserta->ReadOnly);\n\n\t\t\t// sep_flag_generatesep\n\t\t\t$this->sep_flag_generatesep->SetDbValueDef($rsnew, $this->sep_flag_generatesep->CurrentValue, NULL, $this->sep_flag_generatesep->ReadOnly);\n\n\t\t\t// sep_nik\n\t\t\t$this->sep_nik->SetDbValueDef($rsnew, $this->sep_nik->CurrentValue, NULL, $this->sep_nik->ReadOnly);\n\n\t\t\t// sep_namapeserta\n\t\t\t$this->sep_namapeserta->SetDbValueDef($rsnew, $this->sep_namapeserta->CurrentValue, NULL, $this->sep_namapeserta->ReadOnly);\n\n\t\t\t// sep_jeniskelamin\n\t\t\t$this->sep_jeniskelamin->SetDbValueDef($rsnew, $this->sep_jeniskelamin->CurrentValue, NULL, $this->sep_jeniskelamin->ReadOnly);\n\n\t\t\t// sep_pisat\n\t\t\t$this->sep_pisat->SetDbValueDef($rsnew, $this->sep_pisat->CurrentValue, NULL, $this->sep_pisat->ReadOnly);\n\n\t\t\t// sep_tgllahir\n\t\t\t$this->sep_tgllahir->SetDbValueDef($rsnew, $this->sep_tgllahir->CurrentValue, NULL, $this->sep_tgllahir->ReadOnly);\n\n\t\t\t// sep_kodejeniskepesertaan\n\t\t\t$this->sep_kodejeniskepesertaan->SetDbValueDef($rsnew, $this->sep_kodejeniskepesertaan->CurrentValue, NULL, $this->sep_kodejeniskepesertaan->ReadOnly);\n\n\t\t\t// sep_namajeniskepesertaan\n\t\t\t$this->sep_namajeniskepesertaan->SetDbValueDef($rsnew, $this->sep_namajeniskepesertaan->CurrentValue, NULL, $this->sep_namajeniskepesertaan->ReadOnly);\n\n\t\t\t// sep_nokabpjs\n\t\t\t$this->sep_nokabpjs->SetDbValueDef($rsnew, $this->sep_nokabpjs->CurrentValue, NULL, $this->sep_nokabpjs->ReadOnly);\n\n\t\t\t// sep_status_peserta\n\t\t\t$this->sep_status_peserta->SetDbValueDef($rsnew, $this->sep_status_peserta->CurrentValue, NULL, $this->sep_status_peserta->ReadOnly);\n\n\t\t\t// sep_umur_pasien_sekarang\n\t\t\t$this->sep_umur_pasien_sekarang->SetDbValueDef($rsnew, $this->sep_umur_pasien_sekarang->CurrentValue, NULL, $this->sep_umur_pasien_sekarang->ReadOnly);\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($EditRow) {\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\t\treturn $EditRow;\n\t}", "public function onSave()\n\t{\n\t\t$value = $this->getValue();\n\t\tif(!empty( $value ))\n\t\t{\n\t\t\treturn $this->getLookupTable()->set(\n\t\t\t\t $this->getValue(),\n\t\t\t\t $this->getValueObject()->getKey()\n\t\t\t ) > 0;\n\t\t}\n\t\treturn false;\n\t}", "public function validate_fields() {\n \n\t\t\n \n\t\t}", "public function validateSave() {\n\t\t//0. Pobranie parametrów z walidacją\n\t\t$this->form->id = getFromRequest('id',true,'Błędne wywołanie aplikacji');\n\t\t$this->form->volt1 = getFromRequest('v1',true,'Błędne wywołanie aplikacji');\n\t\t$this->form->volt2 = getFromRequest('v2',true,'Błędne wywołanie aplikacji');\n\t\t$this->form->amps = getFromRequest('amp',true,'Błędne wywołanie aplikacji');\n $this->form->resis = getFromRequest('resistor',true,'Błędne wywołanie aplikacji');\n\n\t\tif ( getMessages()->isError() ) return false;\n\n\t\t// 1. sprawdzenie czy wartości wymagane nie są puste\n\t\tif (empty(trim($this->form->volt1))) {\n\t\t\tgetMessages()->addError('Wprowadź napięcie zasilania');\n\t\t}\n\t\tif (empty(trim($this->form->volt2))) {\n\t\t\tgetMessages()->addError('Wprowadź napięcie przewodzenia diody');\n\t\t}\n\t\tif (empty(trim($this->form->amps))) {\n\t\t\tgetMessages()->addError('Wprowadź prąd przewodzenia diody');\n\t\t}\n\n\t\tif ( getMessages()->isError() ) return false;\n\t\t\n\t\treturn ! getMessages()->isError();\n\t}", "public function saveRow( $row );", "public function save()\n { \n return $this->checkForRows() ? $this->updateRow() : $this->insertRow();\n }", "function EditRow() {\r\n\t\tglobal $Security, $Language;\r\n\t\t$sFilter = $this->KeyFilter();\r\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\r\n\t\t$conn = &$this->Connection();\r\n\t\t$this->CurrentFilter = $sFilter;\r\n\t\t$sSql = $this->SQL();\r\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE)\r\n\t\t\treturn FALSE;\r\n\t\tif ($rs->EOF) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\r\n\t\t\t$EditRow = FALSE; // Update Failed\r\n\t\t} else {\r\n\r\n\t\t\t// Save old values\r\n\t\t\t$rsold = &$rs->fields;\r\n\t\t\t$this->LoadDbValues($rsold);\r\n\t\t\t$this->Ruta_Archivo->OldUploadPath = 'ArchivosPase';\r\n\t\t\t$this->Ruta_Archivo->UploadPath = $this->Ruta_Archivo->OldUploadPath;\r\n\t\t\t$rsnew = array();\r\n\r\n\t\t\t// Serie_Equipo\r\n\t\t\t$this->Serie_Equipo->SetDbValueDef($rsnew, $this->Serie_Equipo->CurrentValue, NULL, $this->Serie_Equipo->ReadOnly);\r\n\r\n\t\t\t// Id_Hardware\r\n\t\t\t$this->Id_Hardware->SetDbValueDef($rsnew, $this->Id_Hardware->CurrentValue, NULL, $this->Id_Hardware->ReadOnly);\r\n\r\n\t\t\t// SN\r\n\t\t\t$this->SN->SetDbValueDef($rsnew, $this->SN->CurrentValue, NULL, $this->SN->ReadOnly);\r\n\r\n\t\t\t// Modelo_Net\r\n\t\t\t$this->Modelo_Net->SetDbValueDef($rsnew, $this->Modelo_Net->CurrentValue, NULL, $this->Modelo_Net->ReadOnly);\r\n\r\n\t\t\t// Marca_Arranque\r\n\t\t\t$this->Marca_Arranque->SetDbValueDef($rsnew, $this->Marca_Arranque->CurrentValue, NULL, $this->Marca_Arranque->ReadOnly);\r\n\r\n\t\t\t// Nombre_Titular\r\n\t\t\t$this->Nombre_Titular->SetDbValueDef($rsnew, $this->Nombre_Titular->CurrentValue, NULL, $this->Nombre_Titular->ReadOnly);\r\n\r\n\t\t\t// Dni_Titular\r\n\t\t\t$this->Dni_Titular->SetDbValueDef($rsnew, $this->Dni_Titular->CurrentValue, NULL, $this->Dni_Titular->ReadOnly);\r\n\r\n\t\t\t// Cuil_Titular\r\n\t\t\t$this->Cuil_Titular->SetDbValueDef($rsnew, $this->Cuil_Titular->CurrentValue, NULL, $this->Cuil_Titular->ReadOnly);\r\n\r\n\t\t\t// Nombre_Tutor\r\n\t\t\t$this->Nombre_Tutor->SetDbValueDef($rsnew, $this->Nombre_Tutor->CurrentValue, NULL, $this->Nombre_Tutor->ReadOnly);\r\n\r\n\t\t\t// DniTutor\r\n\t\t\t$this->DniTutor->SetDbValueDef($rsnew, $this->DniTutor->CurrentValue, NULL, $this->DniTutor->ReadOnly);\r\n\r\n\t\t\t// Domicilio\r\n\t\t\t$this->Domicilio->SetDbValueDef($rsnew, $this->Domicilio->CurrentValue, NULL, $this->Domicilio->ReadOnly);\r\n\r\n\t\t\t// Tel_Tutor\r\n\t\t\t$this->Tel_Tutor->SetDbValueDef($rsnew, $this->Tel_Tutor->CurrentValue, NULL, $this->Tel_Tutor->ReadOnly);\r\n\r\n\t\t\t// CelTutor\r\n\t\t\t$this->CelTutor->SetDbValueDef($rsnew, $this->CelTutor->CurrentValue, NULL, $this->CelTutor->ReadOnly);\r\n\r\n\t\t\t// Cue_Establecimiento_Alta\r\n\t\t\t$this->Cue_Establecimiento_Alta->SetDbValueDef($rsnew, $this->Cue_Establecimiento_Alta->CurrentValue, NULL, $this->Cue_Establecimiento_Alta->ReadOnly);\r\n\r\n\t\t\t// Escuela_Alta\r\n\t\t\t$this->Escuela_Alta->SetDbValueDef($rsnew, $this->Escuela_Alta->CurrentValue, NULL, $this->Escuela_Alta->ReadOnly);\r\n\r\n\t\t\t// Directivo_Alta\r\n\t\t\t$this->Directivo_Alta->SetDbValueDef($rsnew, $this->Directivo_Alta->CurrentValue, NULL, $this->Directivo_Alta->ReadOnly);\r\n\r\n\t\t\t// Cuil_Directivo_Alta\r\n\t\t\t$this->Cuil_Directivo_Alta->SetDbValueDef($rsnew, $this->Cuil_Directivo_Alta->CurrentValue, NULL, $this->Cuil_Directivo_Alta->ReadOnly);\r\n\r\n\t\t\t// Dpto_Esc_alta\r\n\t\t\t$this->Dpto_Esc_alta->SetDbValueDef($rsnew, $this->Dpto_Esc_alta->CurrentValue, NULL, $this->Dpto_Esc_alta->ReadOnly);\r\n\r\n\t\t\t// Localidad_Esc_Alta\r\n\t\t\t$this->Localidad_Esc_Alta->SetDbValueDef($rsnew, $this->Localidad_Esc_Alta->CurrentValue, NULL, $this->Localidad_Esc_Alta->ReadOnly);\r\n\r\n\t\t\t// Domicilio_Esc_Alta\r\n\t\t\t$this->Domicilio_Esc_Alta->SetDbValueDef($rsnew, $this->Domicilio_Esc_Alta->CurrentValue, NULL, $this->Domicilio_Esc_Alta->ReadOnly);\r\n\r\n\t\t\t// Rte_Alta\r\n\t\t\t$this->Rte_Alta->SetDbValueDef($rsnew, $this->Rte_Alta->CurrentValue, NULL, $this->Rte_Alta->ReadOnly);\r\n\r\n\t\t\t// Tel_Rte_Alta\r\n\t\t\t$this->Tel_Rte_Alta->SetDbValueDef($rsnew, $this->Tel_Rte_Alta->CurrentValue, NULL, $this->Tel_Rte_Alta->ReadOnly);\r\n\r\n\t\t\t// Email_Rte_Alta\r\n\t\t\t$this->Email_Rte_Alta->SetDbValueDef($rsnew, $this->Email_Rte_Alta->CurrentValue, NULL, $this->Email_Rte_Alta->ReadOnly);\r\n\r\n\t\t\t// Serie_Server_Alta\r\n\t\t\t$this->Serie_Server_Alta->SetDbValueDef($rsnew, $this->Serie_Server_Alta->CurrentValue, NULL, $this->Serie_Server_Alta->ReadOnly);\r\n\r\n\t\t\t// Cue_Establecimiento_Baja\r\n\t\t\t$this->Cue_Establecimiento_Baja->SetDbValueDef($rsnew, $this->Cue_Establecimiento_Baja->CurrentValue, NULL, $this->Cue_Establecimiento_Baja->ReadOnly);\r\n\r\n\t\t\t// Escuela_Baja\r\n\t\t\t$this->Escuela_Baja->SetDbValueDef($rsnew, $this->Escuela_Baja->CurrentValue, NULL, $this->Escuela_Baja->ReadOnly);\r\n\r\n\t\t\t// Directivo_Baja\r\n\t\t\t$this->Directivo_Baja->SetDbValueDef($rsnew, $this->Directivo_Baja->CurrentValue, NULL, $this->Directivo_Baja->ReadOnly);\r\n\r\n\t\t\t// Cuil_Directivo_Baja\r\n\t\t\t$this->Cuil_Directivo_Baja->SetDbValueDef($rsnew, $this->Cuil_Directivo_Baja->CurrentValue, NULL, $this->Cuil_Directivo_Baja->ReadOnly);\r\n\r\n\t\t\t// Dpto_Esc_Baja\r\n\t\t\t$this->Dpto_Esc_Baja->SetDbValueDef($rsnew, $this->Dpto_Esc_Baja->CurrentValue, NULL, $this->Dpto_Esc_Baja->ReadOnly);\r\n\r\n\t\t\t// Localidad_Esc_Baja\r\n\t\t\t$this->Localidad_Esc_Baja->SetDbValueDef($rsnew, $this->Localidad_Esc_Baja->CurrentValue, NULL, $this->Localidad_Esc_Baja->ReadOnly);\r\n\r\n\t\t\t// Domicilio_Esc_Baja\r\n\t\t\t$this->Domicilio_Esc_Baja->SetDbValueDef($rsnew, $this->Domicilio_Esc_Baja->CurrentValue, NULL, $this->Domicilio_Esc_Baja->ReadOnly);\r\n\r\n\t\t\t// Rte_Baja\r\n\t\t\t$this->Rte_Baja->SetDbValueDef($rsnew, $this->Rte_Baja->CurrentValue, NULL, $this->Rte_Baja->ReadOnly);\r\n\r\n\t\t\t// Tel_Rte_Baja\r\n\t\t\t$this->Tel_Rte_Baja->SetDbValueDef($rsnew, $this->Tel_Rte_Baja->CurrentValue, NULL, $this->Tel_Rte_Baja->ReadOnly);\r\n\r\n\t\t\t// Email_Rte_Baja\r\n\t\t\t$this->Email_Rte_Baja->SetDbValueDef($rsnew, $this->Email_Rte_Baja->CurrentValue, NULL, $this->Email_Rte_Baja->ReadOnly);\r\n\r\n\t\t\t// Serie_Server_Baja\r\n\t\t\t$this->Serie_Server_Baja->SetDbValueDef($rsnew, $this->Serie_Server_Baja->CurrentValue, NULL, $this->Serie_Server_Baja->ReadOnly);\r\n\r\n\t\t\t// Fecha_Pase\r\n\t\t\t$this->Fecha_Pase->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->Fecha_Pase->CurrentValue, 7), NULL, $this->Fecha_Pase->ReadOnly);\r\n\r\n\t\t\t// Id_Estado_Pase\r\n\t\t\t$this->Id_Estado_Pase->SetDbValueDef($rsnew, $this->Id_Estado_Pase->CurrentValue, 0, $this->Id_Estado_Pase->ReadOnly);\r\n\r\n\t\t\t// Ruta_Archivo\r\n\t\t\tif ($this->Ruta_Archivo->Visible && !$this->Ruta_Archivo->ReadOnly && !$this->Ruta_Archivo->Upload->KeepFile) {\r\n\t\t\t\t$this->Ruta_Archivo->Upload->DbValue = $rsold['Ruta_Archivo']; // Get original value\r\n\t\t\t\tif ($this->Ruta_Archivo->Upload->FileName == \"\") {\r\n\t\t\t\t\t$rsnew['Ruta_Archivo'] = NULL;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$rsnew['Ruta_Archivo'] = $this->Ruta_Archivo->Upload->FileName;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif ($this->Ruta_Archivo->Visible && !$this->Ruta_Archivo->Upload->KeepFile) {\r\n\t\t\t\t$this->Ruta_Archivo->UploadPath = 'ArchivosPase';\r\n\t\t\t\t$OldFiles = explode(EW_MULTIPLE_UPLOAD_SEPARATOR, $this->Ruta_Archivo->Upload->DbValue);\r\n\t\t\t\tif (!ew_Empty($this->Ruta_Archivo->Upload->FileName)) {\r\n\t\t\t\t\t$NewFiles = explode(EW_MULTIPLE_UPLOAD_SEPARATOR, $this->Ruta_Archivo->Upload->FileName);\r\n\t\t\t\t\t$FileCount = count($NewFiles);\r\n\t\t\t\t\tfor ($i = 0; $i < $FileCount; $i++) {\r\n\t\t\t\t\t\t$fldvar = ($this->Ruta_Archivo->Upload->Index < 0) ? $this->Ruta_Archivo->FldVar : substr($this->Ruta_Archivo->FldVar, 0, 1) . $this->Ruta_Archivo->Upload->Index . substr($this->Ruta_Archivo->FldVar, 1);\r\n\t\t\t\t\t\tif ($NewFiles[$i] <> \"\") {\r\n\t\t\t\t\t\t\t$file = $NewFiles[$i];\r\n\t\t\t\t\t\t\tif (file_exists(ew_UploadTempPath($fldvar, $this->Ruta_Archivo->TblVar) . EW_PATH_DELIMITER . $file)) {\r\n\t\t\t\t\t\t\t\tif (!in_array($file, $OldFiles)) {\r\n\t\t\t\t\t\t\t\t\t$file1 = ew_UploadFileNameEx(ew_UploadPathEx(TRUE, $this->Ruta_Archivo->UploadPath), $file); // Get new file name\r\n\t\t\t\t\t\t\t\t\tif ($file1 <> $file) { // Rename temp file\r\n\t\t\t\t\t\t\t\t\t\twhile (file_exists(ew_UploadTempPath($fldvar, $this->Ruta_Archivo->TblVar) . EW_PATH_DELIMITER . $file1)) // Make sure did not clash with existing upload file\r\n\t\t\t\t\t\t\t\t\t\t\t$file1 = ew_UniqueFilename(ew_UploadPathEx(TRUE, $this->Ruta_Archivo->UploadPath), $file1, TRUE); // Use indexed name\r\n\t\t\t\t\t\t\t\t\t\trename(ew_UploadTempPath($fldvar, $this->Ruta_Archivo->TblVar) . EW_PATH_DELIMITER . $file, ew_UploadTempPath($fldvar, $this->Ruta_Archivo->TblVar) . EW_PATH_DELIMITER . $file1);\r\n\t\t\t\t\t\t\t\t\t\t$NewFiles[$i] = $file1;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->Ruta_Archivo->Upload->FileName = implode(EW_MULTIPLE_UPLOAD_SEPARATOR, $NewFiles);\r\n\t\t\t\t\t$rsnew['Ruta_Archivo'] = $this->Ruta_Archivo->Upload->FileName;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$NewFiles = array();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Call Row Updating event\r\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\r\n\t\t\tif ($bUpdateRow) {\r\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\r\n\t\t\t\tif (count($rsnew) > 0)\r\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\r\n\t\t\t\telse\r\n\t\t\t\t\t$EditRow = TRUE; // No field to update\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t\tif ($EditRow) {\r\n\t\t\t\t\tif ($this->Ruta_Archivo->Visible && !$this->Ruta_Archivo->Upload->KeepFile) {\r\n\t\t\t\t\t\t$OldFiles = explode(EW_MULTIPLE_UPLOAD_SEPARATOR, $this->Ruta_Archivo->Upload->DbValue);\r\n\t\t\t\t\t\tif (!ew_Empty($this->Ruta_Archivo->Upload->FileName)) {\r\n\t\t\t\t\t\t\t$NewFiles = explode(EW_MULTIPLE_UPLOAD_SEPARATOR, $this->Ruta_Archivo->Upload->FileName);\r\n\t\t\t\t\t\t\t$NewFiles2 = explode(EW_MULTIPLE_UPLOAD_SEPARATOR, $rsnew['Ruta_Archivo']);\r\n\t\t\t\t\t\t\t$FileCount = count($NewFiles);\r\n\t\t\t\t\t\t\tfor ($i = 0; $i < $FileCount; $i++) {\r\n\t\t\t\t\t\t\t\t$fldvar = ($this->Ruta_Archivo->Upload->Index < 0) ? $this->Ruta_Archivo->FldVar : substr($this->Ruta_Archivo->FldVar, 0, 1) . $this->Ruta_Archivo->Upload->Index . substr($this->Ruta_Archivo->FldVar, 1);\r\n\t\t\t\t\t\t\t\tif ($NewFiles[$i] <> \"\") {\r\n\t\t\t\t\t\t\t\t\t$file = ew_UploadTempPath($fldvar, $this->Ruta_Archivo->TblVar) . EW_PATH_DELIMITER . $NewFiles[$i];\r\n\t\t\t\t\t\t\t\t\tif (file_exists($file)) {\r\n\t\t\t\t\t\t\t\t\t\t$this->Ruta_Archivo->Upload->SaveToFile($this->Ruta_Archivo->UploadPath, (@$NewFiles2[$i] <> \"\") ? $NewFiles2[$i] : $NewFiles[$i], TRUE, $i); // Just replace\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$NewFiles = array();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$FileCount = count($OldFiles);\r\n\t\t\t\t\t\tfor ($i = 0; $i < $FileCount; $i++) {\r\n\t\t\t\t\t\t\tif ($OldFiles[$i] <> \"\" && !in_array($OldFiles[$i], $NewFiles))\r\n\t\t\t\t\t\t\t\t@unlink(ew_UploadPathEx(TRUE, $this->Ruta_Archivo->OldUploadPath) . $OldFiles[$i]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\r\n\r\n\t\t\t\t\t// Use the message, do nothing\r\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\r\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\r\n\t\t\t\t\t$this->CancelMessage = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\r\n\t\t\t\t}\r\n\t\t\t\t$EditRow = FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Call Row_Updated event\r\n\t\tif ($EditRow)\r\n\t\t\t$this->Row_Updated($rsold, $rsnew);\r\n\t\tif ($EditRow) {\r\n\t\t\t$this->WriteAuditTrailOnEdit($rsold, $rsnew);\r\n\t\t}\r\n\t\t$rs->Close();\r\n\r\n\t\t// Ruta_Archivo\r\n\t\tew_CleanUploadTempPath($this->Ruta_Archivo, $this->Ruta_Archivo->Upload->Index);\r\n\t\treturn $EditRow;\r\n\t}", "public function validate_fields() {\n \n\t\t//...\n \n }", "public function beforeSave()\n {\n $value = $this->getValue();\n $scopeid=$this->getScopeId();\n $store = $this->storeManager->getStore($scopeid)->getCode();\n $resultArray = [];\n foreach ($value as $rowId => $row) {\n if (is_array($row)) {\n $caseSensitiveVal = trim($row['currency_code']);\n $caseSensVal = strtoupper($caseSensitiveVal);\n\n if (array_key_exists($caseSensVal, $resultArray)) {\n $errorMsg = $this->helper->getConfigValue('ACAM12', $store);\n throw new CouldNotSaveException(__(sprintf($errorMsg, $row['currency_code'])));\n }\n if (ctype_space($row['exponent'])) {\n $msg=new Phrase($this->helper->getConfigValue('ACAM13', $store).\"-\".$row['exponent']);\n throw new CouldNotSaveException($msg);\n }\n $resultArray[$row['currency_code']] = ['currency_code'=>$row['currency_code'],\n 'currency'=>$row['currency'], 'exponent'=>$row['exponent']];\n }\n }\n $value = $this->currencyexponent->makeStorableArrayFieldValue($value);\n $this->setValue($value);\n }", "protected function _validateRowForUpdate(array $rowData, $rowNumber)\n {\n $multiSeparator = $this->getMultipleValueSeparator();\n if ($this->_checkUniqueKey($rowData, $rowNumber)) {\n $email = strtolower($rowData[self::COLUMN_EMAIL]);\n $website = $rowData[self::COLUMN_WEBSITE];\n $addressId = $rowData[self::COLUMN_ADDRESS_ID];\n $customerId = $this->_getCustomerId($email, $website);\n\n if ($customerId === false) {\n $this->addRowError(self::ERROR_CUSTOMER_NOT_FOUND, $rowNumber);\n } else {\n if ($this->_checkRowDuplicate($customerId, $addressId)) {\n $this->addRowError(self::ERROR_DUPLICATE_PK, $rowNumber);\n } else {\n // check simple attributes\n foreach ($this->_attributes as $attributeCode => $attributeParams) {\n $websiteId = $this->_websiteCodeToId[$website];\n $attributeParams = $this->adjustAttributeDataForWebsite($attributeParams, $websiteId);\n\n if (in_array($attributeCode, $this->_ignoredAttributes)) {\n continue;\n }\n if (isset($rowData[$attributeCode]) && strlen($rowData[$attributeCode])) {\n $this->isAttributeValid(\n $attributeCode,\n $attributeParams,\n $rowData,\n $rowNumber,\n $multiSeparator\n );\n } elseif ($attributeParams['is_required']\n && !$this->addressStorage->doesExist(\n (string)$addressId,\n (string)$customerId\n )\n ) {\n $this->addRowError(self::ERROR_VALUE_IS_REQUIRED, $rowNumber, $attributeCode);\n }\n }\n\n if (isset($rowData[self::COLUMN_POSTCODE])\n && isset($rowData[self::COLUMN_COUNTRY_ID])\n && !$this->postcodeValidator->isValid(\n $rowData[self::COLUMN_COUNTRY_ID],\n $rowData[self::COLUMN_POSTCODE]\n )\n ) {\n $this->addRowError(self::ERROR_VALUE_IS_REQUIRED, $rowNumber, self::COLUMN_POSTCODE);\n }\n\n if (isset($rowData[self::COLUMN_COUNTRY_ID]) && isset($rowData[self::COLUMN_REGION])) {\n $countryRegions = isset(\n $this->_countryRegions[strtolower($rowData[self::COLUMN_COUNTRY_ID])]\n ) ? $this->_countryRegions[strtolower(\n $rowData[self::COLUMN_COUNTRY_ID]\n )] : [];\n\n if (!empty($rowData[self::COLUMN_REGION]) && !empty($countryRegions) && !isset(\n $countryRegions[strtolower($rowData[self::COLUMN_REGION])]\n )\n ) {\n $this->addRowError(self::ERROR_INVALID_REGION, $rowNumber, self::COLUMN_REGION);\n }\n }\n }\n }\n }\n }", "public function validationUpdate()\n\t{\n\t\t$validationUpdate=array();\n\t\tforeach($this->getTable()->result_array() as $row)\n\t\t{\n\t\t\t$validationUpdate[]=array(\n\t\t\t\t'field'=>$row['Field'],\n\t\t\t\t'maxlength'=>preg_match('/varchar/',$row['Type']) ? (preg_replace('/[A-Za-z()]/','',$row['Type'])!=='' ? '\\'maxlength\\'=>'.preg_replace('/[A-Za-z()]/','',$row['Type']).',' : false) : false,\n\t\t\t\t'required'=>$row['Null']=='NO' ? '\\'required\\'=>true,' : false,\n\t\t\t\t'email'=>preg_match('/email/',$row['Field']) ? '\\'email\\'=>true,' : false,\n\t\t\t);\n\t\t}\n\t\treturn $validationUpdate;\n\t}", "function validateRow($row) { \n \n if(!$this->fields) {\n return $row;\n }\n \n $return = [];\n foreach($this->fields as $key => $field) {\n $return[$key] = $this->validateField($row, $key);\n }\n return $return;\n }", "public function validateData(){\n return true;\n }", "public function postHydrate(): void\n {\n if ('invalid' === $this->value) {\n $this->value = 'valid';\n }\n }", "public function fill_fields() {\n if (!parent::fill_fields()) {\n return false;\n }\n $stmt = $this->pdo->prepare('select valid from user where id = :id');\n $stmt->bindValue(':id', $this->id);\n $stmt->execute();\n $res = $stmt->fetchAll();\n if (count($res) != 1) {\n return false;\n }\n $this->valid = $res[0][0];\n return true;\n }", "public function beforeSave()\n\t{\n\t\tif ( parent::beforeSave() )\n\t\t{\n\t\t\t//\tStrips off all bogus characters from numbers\n\t\t\tforeach ( $this->getAttributes() as $_sKey => $_oValue )\n\t\t\t{\n\t\t\t\tif ( $this->tableSchema->columns[ $_sKey ]->type != 'string' && null !== $_oValue && $_oValue != '' )\n\t\t\t\t{\n\t\t\t\t\t$_sTestVal = trim( $_oValue, '+-.,0123456789' );\n\n\t\t\t\t\tif ( ! empty( $_sTestVal ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->{$_sKey} = floatval( preg_replace('/[\\+\\-\\,]/', '', $_oValue ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "protected function validate()\r\n\t{\r\n\t\tif (!$this->isFetched())\r\n\t\t{\r\n\t\t\treturn;\r\n }\r\n \r\n\t\tif ($this->validationInfo)\r\n\t\t{\r\n\t\t\t$this->validationInfo->validate($this->normalizedValue);\r\n\t\t}\r\n\t\t$this->isValid = true;\r\n\t}", "public function save(){\n\t\t// If primary key is set in model, run an update instead.\n\t\t$primaryKey = $this->getPrimaryKey();\n\t\tif(isset($this->{$primaryKey})){\n\t\t\treturn $this->update();\n\t\t}\n\t\t$this->beforeSave();\n\t\t$tableName = $this->tableName();\n\t\t$fields = $this->fields();\n\t\t// Remove fields set as ignored by rules validation.\n\t\t$fields = $this->removeIgnored($fields);\n\t\t// Create PDO placeholders.\n\t\t$params = array_map(fn($name) => ':'.$name, $fields);\n\t\t// Populate statement by imploding the arrays.\n\t\t$statement = $this->db->prepare('INSERT INTO ' . $tableName . ' ( ' . implode(', ', $fields) . ') VALUES (' . implode(', ', $params) . ')');\n\t\t// Bind values to placeholders.\n\t\tforeach($fields as $field){\n\t\t\t$this->binder($statement, ':' . $field, $this->{$field});\n\t\t}\n\t\tif($statement->execute()){\n\t\t\t$this->afterSave();\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function check_insert($i) {\r\n $no_error = True;\r\n\r\n foreach ($this->properties as $colvar=>$col) {\r\n #~ if (strpos($colvar,'_phone') !== false or strpos($colvar,'_fax') !== false) {\r\n if (strpos($colvar,'_phone') === false and strpos($colvar,'_fax') === false) continue;\r\n #~ if (!preg_match('/[,\\-\\/]/',$this->ds->{$colvar}[$i])) continue;\r\n if (!preg_match('/[^0-9 ]/',$this->ds->{$colvar}[$i])) continue;\r\n $this->error_msgs[] = \"[\".($i+1).\"] {$col->label} must be numeric only\";\r\n #~ $this->error_msgs[] = \"[\".($i+1).\"] {$col->label} must not contain these characters: , / -\";\r\n $this->error_rows[$i] = True;\r\n $no_error = False;\r\n }\r\n\r\n # place holder function\r\n if ($this->ds->total[$i] == 0) {\r\n $this->error_msgs[] = \"[\".($i+1).\"] Total must not zero\";\r\n $this->error_rows[$i] = True;\r\n $no_error = False;\r\n }\r\n\r\n if ($this->ds->list_price[$i] == 0) {\r\n $this->error_msgs[] = \"[\".($i+1).\"] List price must not zero\";\r\n $this->error_rows[$i] = True;\r\n $no_error = False;\r\n }\r\n $this->ds->cu_name[$i] = strtoupper($this->ds->cu_name[$i]);\r\n\r\n return $no_error;\r\n }", "protected function _saveValidatedBunches()\n {\n $source = $this->_getSource();\n $source->rewind();\n\n while ($source->valid()) {\n try {\n $rowData = $source->current();\n } catch (\\InvalidArgumentException $e) {\n $this->addRowError($e->getMessage(), $this->_processedRowsCount);\n $this->_processedRowsCount++;\n $source->next();\n continue;\n }\n\n $rowData = $this->_customFieldsMapping($rowData);\n\n $this->validateRow($rowData, $source->key());\n\n $source->next();\n }\n $this->checkUrlKeyDuplicates();\n $this->getOptionEntity()->validateAmbiguousData();\n return parent::_saveValidatedBunches();\n }", "abstract public function validateData();", "public function save(){\n $val = new ValidaModel();\n $val->Idvalida=$_POST['id'];\n $val->IdDepartamento=$_POST['departamento'];\n $val->IdProyecto=$_POST['proyecto'];\n $val->IdMeta=$_POST['metas'];\n $val->anio=$_POST['anio'];\n if($_POST['id'] == 0){\n $val->add();\n }else{\n $val->update();\n }\n header('location: '.FOLDER_PATH.'/Valida');\n }", "public function sanitizeValueOnSave(): bool\n {\n return true;\n }", "public function save()\n {\n $this->hasTableName();\n $pk = $this->pk;\n $condition = \"\";\n if ($this->isNew) {\n $sql = \"INSERT INTO \" . $this->table_name . \" SET \";\n $update = '';\n } else {\n if (!isset($this->$pk))\n throw new Exception('Update em objeto sem chave definida', 403);\n\n $sql = \"UPDATE \" . $this->table_name . \" SET \";\n $update = \" WHERE `\" . $this->pk . \"` = '\" . $this->$pk . \"'\";\n }\n foreach ($this->rules() as $key => $validation) {\n if ($this->validateField($key, $validation) && isset($this->$key) && $this->$key != \"\") {\n $sql .= \" `\" . $key . \"` = '\" . $this->$key . \"',\";\n $condition .= \" `\" . $key . \"` = '\" . $this->$key . \"' AND\";\n }\n }\n if (!$this->getErrors()) {\n $sql = substr($sql, 0, -1) . $update;\n if (Database::dbactionf($sql)) {\n if ($this->isNew) {\n $this->$pk = Database::lastID();\n $this->persisted();\n }\n return true;\n }\n }\n return false;\n }", "public function validated();", "public function checkIsValidForUpdate() {\n $errors = array();\n\n if (strlen($this->phone) >0 && !is_numeric($this->phone)){\n $errors[\"phone\"] = i18n(\"You must write a valid phone number\");\n }\n if (strlen($this->phone) < 1) {\n $errors[\"phone\"] = i18n(\"You must write a valid phone number\");\n }\n try{\n $this->checkIsValidForCreate();\n }catch(ValidationException $ex) {\n foreach ($ex->getErrors() as $key=>$error) {\n $errors[$key] = $error;\n }\n }\n if (sizeof($errors) > 0) {\n throw new ValidationException($errors, \"User is not valid\");\n }\n }", "public function validaterecord() {\n if ($this->application_id == 0) {\n $temp = Propertyapplication::find()->where(['application_no' => $this->application_no, 'project_id' => $this->project_id])->one();\n if ($temp != NULL) {\n $this->addError('application_no', 'Form No. already exist.');\n return FALSE;\n }\n } else {\n $temp = Propertyapplication::find()->where(['application_no' => $this->application_no, 'project_id' => $this->project_id])->andFilterWhere(['!=', 'application_id', $this->application_id])->one();\n if ($temp != NULL) {\n $this->addError('application_no', 'Form No. already exist.');\n return FALSE;\n }\n\n if ($this->application_status == 10) {\n $this->addError('application_no', 'Form is already submitted.');\n return false;\n }\n }\n\n if ($this->property_against == 1 && ($this->owner_id == NULL || $this->owner_id == 0)) {\n $this->addError('property_against', 'Form is already submitted.');\n return false;\n }\n\n return true;\n }", "function EmptyRow() {\r\n\t\tglobal $rekeningju, $objForm;\r\n\t\tif ($objForm->HasValue(\"x_NoRek\") && $objForm->HasValue(\"o_NoRek\") && $rekeningju->NoRek->CurrentValue <> $rekeningju->NoRek->OldValue)\r\n\t\t\treturn FALSE;\r\n\t\tif ($objForm->HasValue(\"x_Keterangan\") && $objForm->HasValue(\"o_Keterangan\") && $rekeningju->Keterangan->CurrentValue <> $rekeningju->Keterangan->OldValue)\r\n\t\t\treturn FALSE;\r\n\t\tif ($objForm->HasValue(\"x_debet\") && $objForm->HasValue(\"o_debet\") && $rekeningju->debet->CurrentValue <> $rekeningju->debet->OldValue)\r\n\t\t\treturn FALSE;\r\n\t\tif ($objForm->HasValue(\"x_kredit\") && $objForm->HasValue(\"o_kredit\") && $rekeningju->kredit->CurrentValue <> $rekeningju->kredit->OldValue)\r\n\t\t\treturn FALSE;\r\n\t\tif ($objForm->HasValue(\"x_kode_bukti\") && $objForm->HasValue(\"o_kode_bukti\") && $rekeningju->kode_bukti->CurrentValue <> $rekeningju->kode_bukti->OldValue)\r\n\t\t\treturn FALSE;\r\n\t\tif ($objForm->HasValue(\"x_tanggal\") && $objForm->HasValue(\"o_tanggal\") && $rekeningju->tanggal->CurrentValue <> $rekeningju->tanggal->OldValue)\r\n\t\t\treturn FALSE;\r\n\t\tif ($objForm->HasValue(\"x_tanggal_nota\") && $objForm->HasValue(\"o_tanggal_nota\") && $rekeningju->tanggal_nota->CurrentValue <> $rekeningju->tanggal_nota->OldValue)\r\n\t\t\treturn FALSE;\r\n\t\tif ($objForm->HasValue(\"x_kode_otomatis\") && $objForm->HasValue(\"o_kode_otomatis\") && $rekeningju->kode_otomatis->CurrentValue <> $rekeningju->kode_otomatis->OldValue)\r\n\t\t\treturn FALSE;\r\n\t\tif ($objForm->HasValue(\"x_kode_otomatis_tingkat\") && $objForm->HasValue(\"o_kode_otomatis_tingkat\") && $rekeningju->kode_otomatis_tingkat->CurrentValue <> $rekeningju->kode_otomatis_tingkat->OldValue)\r\n\t\t\treturn FALSE;\r\n\t\tif ($objForm->HasValue(\"x_apakah_original\") && $objForm->HasValue(\"o_apakah_original\") && $rekeningju->apakah_original->CurrentValue <> $rekeningju->apakah_original->OldValue)\r\n\t\t\treturn FALSE;\r\n\t\treturn TRUE;\r\n\t}", "function validate() {\n\t\t// execute the column validation \n\t\tparent::validate();\n\t\t\n\t\t// connection\t\t\n\t\t$conn = Doctrine_Manager::connection();\n\t\t\n\t\t// query for check if location exists\n\t\t$unique_query = \"SELECT id FROM company WHERE name = '\".$this->getName().\"' AND id <> '\".$this->getID().\"'\";\n\t\t$result = $conn->fetchOne($unique_query);\n\t\t// debugMessage($unique_query);\n\t\t// debugMessage(\"result is \".$result);\n\t\tif(!isEmptyString($result)){ \n\t\t\t$this->getErrorStack()->add(\"unique.name\", \"The name \".$this->getName().\" already exists. Please specify another.\");\n\t\t}\n\t}", "function EditRow() {\n\t\tglobal $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$conn = &$this->Connection();\n\t\tif ($this->Supplier_Number->CurrentValue <> \"\") { // Check field with unique index\n\t\t\t$sFilterChk = \"(`Supplier_Number` = '\" . ew_AdjustSql($this->Supplier_Number->CurrentValue, $this->DBID) . \"')\";\n\t\t\t$sFilterChk .= \" AND NOT (\" . $sFilter . \")\";\n\t\t\t$this->CurrentFilter = $sFilterChk;\n\t\t\t$sSqlChk = $this->SQL();\n\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"]; // v11.0.4\n\t\t\t$rsChk = $conn->Execute($sSqlChk);\n\t\t\t$conn->raiseErrorFn = '';\n\t\t\tif ($rsChk === FALSE) {\n\t\t\t\treturn FALSE;\n\t\t\t} elseif (!$rsChk->EOF) {\n\t\t\t\t$sIdxErrMsg = str_replace(\"%f\", $this->Supplier_Number->FldCaption(), $Language->Phrase(\"DupIndex\"));\n\t\t\t\t$sIdxErrMsg = str_replace(\"%v\", $this->Supplier_Number->CurrentValue, $sIdxErrMsg);\n\t\t\t\t$this->setFailureMessage($sIdxErrMsg);\n\t\t\t\t$rsChk->Close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t$rsChk->Close();\n\t\t}\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"]; // v11.0.4\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Begin transaction\n\t\t\tif ($this->getCurrentDetailTable() <> \"\")\n\t\t\t\t$conn->BeginTrans();\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$this->LoadDbValues($rsold);\n\t\t\t$rsnew = array();\n\n\t\t\t// Supplier_Number\n\t\t\t$this->Supplier_Number->SetDbValueDef($rsnew, $this->Supplier_Number->CurrentValue, \"\", $this->Supplier_Number->ReadOnly);\n\n\t\t\t// Supplier_Name\n\t\t\t$this->Supplier_Name->SetDbValueDef($rsnew, $this->Supplier_Name->CurrentValue, \"\", $this->Supplier_Name->ReadOnly);\n\n\t\t\t// Address\n\t\t\t$this->Address->SetDbValueDef($rsnew, $this->Address->CurrentValue, \"\", $this->Address->ReadOnly);\n\n\t\t\t// City\n\t\t\t$this->City->SetDbValueDef($rsnew, $this->City->CurrentValue, \"\", $this->City->ReadOnly);\n\n\t\t\t// Country\n\t\t\t$this->Country->SetDbValueDef($rsnew, $this->Country->CurrentValue, \"\", $this->Country->ReadOnly);\n\n\t\t\t// Contact_Person\n\t\t\t$this->Contact_Person->SetDbValueDef($rsnew, $this->Contact_Person->CurrentValue, \"\", $this->Contact_Person->ReadOnly);\n\n\t\t\t// Phone_Number\n\t\t\t$this->Phone_Number->SetDbValueDef($rsnew, $this->Phone_Number->CurrentValue, \"\", $this->Phone_Number->ReadOnly);\n\n\t\t\t// Email\n\t\t\t$this->_Email->SetDbValueDef($rsnew, $this->_Email->CurrentValue, \"\", $this->_Email->ReadOnly);\n\n\t\t\t// Mobile_Number\n\t\t\t$this->Mobile_Number->SetDbValueDef($rsnew, $this->Mobile_Number->CurrentValue, \"\", $this->Mobile_Number->ReadOnly);\n\n\t\t\t// Notes\n\t\t\t$this->Notes->SetDbValueDef($rsnew, $this->Notes->CurrentValue, \"\", $this->Notes->ReadOnly);\n\n\t\t\t// Balance\n\t\t\t$this->Balance->SetDbValueDef($rsnew, $this->Balance->CurrentValue, NULL, $this->Balance->ReadOnly);\n\n\t\t\t// Is_Stock_Available\n\t\t\t$this->Is_Stock_Available->SetDbValueDef($rsnew, ((strval($this->Is_Stock_Available->CurrentValue) == \"Y\") ? \"Y\" : \"N\"), \"N\", $this->Is_Stock_Available->ReadOnly);\n\n\t\t\t// Date_Added\n\t\t\t$this->Date_Added->SetDbValueDef($rsnew, $this->Date_Added->CurrentValue, NULL, $this->Date_Added->ReadOnly);\n\n\t\t\t// Added_By\n\t\t\t$this->Added_By->SetDbValueDef($rsnew, $this->Added_By->CurrentValue, NULL, $this->Added_By->ReadOnly);\n\n\t\t\t// Date_Updated\n\t\t\t$this->Date_Updated->SetDbValueDef($rsnew, ew_CurrentDateTime(), NULL);\n\t\t\t$rsnew['Date_Updated'] = &$this->Date_Updated->DbValue;\n\n\t\t\t// Updated_By\n\t\t\t$this->Updated_By->SetDbValueDef($rsnew, CurrentUserName(), NULL);\n\t\t\t$rsnew['Updated_By'] = &$this->Updated_By->DbValue;\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"]; // v11.0.4\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($EditRow) {\n\t\t\t\t}\n\n\t\t\t\t// Update detail records\n\t\t\t\tif ($EditRow) {\n\t\t\t\t\t$DetailTblVar = explode(\",\", $this->getCurrentDetailTable());\n\t\t\t\t\tif (in_array(\"a_purchases\", $DetailTblVar) && $GLOBALS[\"a_purchases\"]->DetailEdit) {\n\t\t\t\t\t\tif (!isset($GLOBALS[\"a_purchases_grid\"])) $GLOBALS[\"a_purchases_grid\"] = new ca_purchases_grid(); // Get detail page object\n\t\t\t\t\t\t$EditRow = $GLOBALS[\"a_purchases_grid\"]->GridUpdate();\n\t\t\t\t\t}\n\t\t\t\t\tif (in_array(\"a_stock_items\", $DetailTblVar) && $GLOBALS[\"a_stock_items\"]->DetailEdit) {\n\t\t\t\t\t\tif (!isset($GLOBALS[\"a_stock_items_grid\"])) $GLOBALS[\"a_stock_items_grid\"] = new ca_stock_items_grid(); // Get detail page object\n\t\t\t\t\t\t$EditRow = $GLOBALS[\"a_stock_items_grid\"]->GridUpdate();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Commit/Rollback transaction\n\t\t\t\tif ($this->getCurrentDetailTable() <> \"\") {\n\t\t\t\t\tif ($EditRow) {\n\t\t\t\t\t\t$conn->CommitTrans(); // Commit transaction\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$conn->RollbackTrans(); // Rollback transaction\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\t\treturn $EditRow;\n\t}", "protected function beforeValidate ()\n {\n //$this->tglrevisimodul = date ('Y-m-d', strtotime($this->tglrevisimodul));\n $format = new MyFormatter();\n //$this->tglrevisimodul = $format->formatDateTimeForDb($this->tglrevisimodul);\n foreach($this->metadata->tableSchema->columns as $columnName => $column){\n if ($column->dbType == 'date')\n {\n $this->$columnName = $format->formatDateTimeForDb($this->$columnName);\n }\n else if ( $column->dbType == 'timestamp without time zone')\n {\n $this->$columnName = $format->formatDateTimeForDb($this->$columnName);\n }\n }\n\n return parent::beforeValidate ();\n }", "public function validate()\n {\n\t# checking default value\n\tif ( $this->default &&\n\t !$this->isValidValue($this->default))\n\t{\n\t $this->_addError(\"invalid datatype of default value '$this->default'\");\n\t}\n\telseif ($this->default)\n\t{\n\t $this->default= $this->retype($this->default);\n\t}\n\n\tforeach($this->errors as $key => $error)\n\t{\n\t $this->errors[$key] = str_replace('%s', $this->getModel()->getName(). '::'.$this->name, $error);\n\t}\n\treturn $this->errors;\n }", "function isDataValid() \n {\n return true;\n }", "public function save() {\n\t\tif (empty($this->values))\n\t\t\treturn false;\n\n\t\tif ($this->fieldUpdatedAt && isset($this->schema[$this->fieldUpdatedAt]))\n\t\t\t$this->values[$this->fieldUpdatedAt] = date('Y-m-d H:i:s');\n\t\telse if (!$this->modified)\n\t\t\treturn true;\n\n\t\t// Prepare sql\n\t\tif (is_null($this->id)) {\n\t\t\t// Insert\n\t\t\tif ($this->fieldCreatedAt && isset($this->schema[$this->fieldCreatedAt]))\n\t\t\t\t$this->values[$this->fieldCreatedAt] = date('Y-m-d H:i:s');\n\n\t\t\t$sql = \"INSERT INTO `{$this->table}` (\"\n\t\t\t\t. implode(',', array_map(function($item) {\n\t\t\t\t\t\treturn \"`$item`\";\n\t\t\t\t\t}, array_keys($this->values)))\n\t\t\t\t. ') VALUES ('\n\t\t\t\t. implode(',', array_map(function($item) {\n\t\t\t\t\t\treturn \":$item\";\n\t\t\t\t\t}, array_keys($this->values)))\n\t\t\t\t. ')';\n\t\t} else {\n\t\t\t// Update\n\t\t\t$id = $this->values['id'];\n\t\t\tunset($this->values['id']);\n\t\t\t$sql = \"UPDATE `{$this->table}` SET \"\n\t\t\t\t. implode(',', array_map(function($item) {\n\t\t\t\t\t\treturn \"`$item`=:$item\";\n\t\t\t\t\t}, array_keys($this->values)))\n\t\t\t\t. ' WHERE `id`=:id';\n\t\t\t$this->values['id'] = $id;\n\t\t}\n\n\t\t// Bind params\n\t\t$query = self::$pdo->prepare($sql);\n\t\tforeach ($this->values as $key => $value) {\n\t\t\t$query->bindValue(\":$key\", $value);\n\t\t}\n\n\t\tif ($query->execute()) {\n\t\t\tif (is_null($this->id))\n\t\t\t\t$this->id = self::$pdo->lastInsertId();\n\t\t\t$this->modified = false;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function EditRow() {\r\n\t\tglobal $conn, $Security, $Language, $rekeningju;\r\n\t\t$sFilter = $rekeningju->KeyFilter();\r\n\t\t$rekeningju->CurrentFilter = $sFilter;\r\n\t\t$sSql = $rekeningju->SQL();\r\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE)\r\n\t\t\treturn FALSE;\r\n\t\tif ($rs->EOF) {\r\n\t\t\t$EditRow = FALSE; // Update Failed\r\n\t\t} else {\r\n\r\n\t\t\t// Save old values\r\n\t\t\t$rsold =& $rs->fields;\r\n\t\t\t$rsnew = array();\r\n\r\n\t\t\t// NoRek\r\n\t\t\t$rekeningju->NoRek->SetDbValueDef($rsnew, $rekeningju->NoRek->CurrentValue, \"\", $rekeningju->NoRek->ReadOnly);\r\n\r\n\t\t\t// Keterangan\r\n\t\t\t$rekeningju->Keterangan->SetDbValueDef($rsnew, $rekeningju->Keterangan->CurrentValue, NULL, $rekeningju->Keterangan->ReadOnly);\r\n\r\n\t\t\t// debet\r\n\t\t\t$rekeningju->debet->SetDbValueDef($rsnew, $rekeningju->debet->CurrentValue, 0, $rekeningju->debet->ReadOnly);\r\n\r\n\t\t\t// kredit\r\n\t\t\t$rekeningju->kredit->SetDbValueDef($rsnew, $rekeningju->kredit->CurrentValue, 0, $rekeningju->kredit->ReadOnly);\r\n\r\n\t\t\t// kode_bukti\r\n\t\t\t$rekeningju->kode_bukti->SetDbValueDef($rsnew, $rekeningju->kode_bukti->CurrentValue, NULL, $rekeningju->kode_bukti->ReadOnly);\r\n\r\n\t\t\t// tanggal\r\n\t\t\t$rekeningju->tanggal->SetDbValueDef($rsnew, ew_UnFormatDateTime($rekeningju->tanggal->CurrentValue, 7), ew_CurrentDate(), $rekeningju->tanggal->ReadOnly);\r\n\r\n\t\t\t// tanggal_nota\r\n\t\t\t$rekeningju->tanggal_nota->SetDbValueDef($rsnew, ew_UnFormatDateTime($rekeningju->tanggal_nota->CurrentValue, 7), ew_CurrentDate(), $rekeningju->tanggal_nota->ReadOnly);\r\n\r\n\t\t\t// kode_otomatis\r\n\t\t\t// kode_otomatis_tingkat\r\n\r\n\t\t\t$rekeningju->kode_otomatis_tingkat->SetDbValueDef($rsnew, $rekeningju->kode_otomatis_tingkat->CurrentValue, \"\", $rekeningju->kode_otomatis_tingkat->ReadOnly);\r\n\r\n\t\t\t// apakah_original\r\n\t\t\t$rekeningju->apakah_original->SetDbValueDef($rsnew, $rekeningju->apakah_original->CurrentValue, \"\", $rekeningju->apakah_original->ReadOnly);\r\n\r\n\t\t\t// Call Row Updating event\r\n\t\t\t$bUpdateRow = $rekeningju->Row_Updating($rsold, $rsnew);\r\n\t\t\tif ($bUpdateRow) {\r\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t\t\tif (count($rsnew) > 0)\r\n\t\t\t\t\t$EditRow = $conn->Execute($rekeningju->UpdateSQL($rsnew));\r\n\t\t\t\telse\r\n\t\t\t\t\t$EditRow = TRUE; // No field to update\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t} else {\r\n\t\t\t\tif ($rekeningju->CancelMessage <> \"\") {\r\n\t\t\t\t\t$this->setFailureMessage($rekeningju->CancelMessage);\r\n\t\t\t\t\t$rekeningju->CancelMessage = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\r\n\t\t\t\t}\r\n\t\t\t\t$EditRow = FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Call Row_Updated event\r\n\t\tif ($EditRow)\r\n\t\t\t$rekeningju->Row_Updated($rsold, $rsnew);\r\n\t\t$rs->Close();\r\n\t\treturn $EditRow;\r\n\t}", "public function save() : bool {\n $this->getForm();\n $model = (array) $this;\n unset($model['id']);\n\n $colNames = implode(', ', array_keys($model));\n $colValues = ':' . str_replace(', ', ', :', $colNames);\n $arrBind = array_combine(explode(', ', $colValues), array_values($model));\n\n try {\n $db = new DbConnection();\n $db = $db->connect();\n $statement = $db->prepare(\"INSERT INTO \" . static::tableName() . \" (\" . $colNames . \")\n VALUES (\" . $colValues . \")\");\n\n foreach ($arrBind as $key => &$value) {\n $statement->bindParam($key, $value);\n }\n\n $result = $statement->execute();\n $db = null;\n } catch (PDOException $e) {\n $result = false;\n $e->getMessage(); // Only in dev mode\n }\n return $result;\n }", "public function validate(phpDataMapper_Model_Row $row)\n\t{\n\t\t// Check validation rules on each feild\n\t\tforeach($this->fields as $field => $fieldAttrs) {\n\t\t\tif(isset($fieldAttrs['required']) && true === $fieldAttrs['required']) {\n\t\t\t\t// Required field\n\t\t\t\tif(empty($row->$field)) {\n\t\t\t\t\t$this->addError(\"Required field '\" . $field . \"' was left blank\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Check for errors\n\t\tif($this->hasErrors()) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function save(){\n $tableName = $this->tableName();\n $attributes = $this->attributes();\n $params = array_map(fn($attr) => \":$attr\", $attributes);\n $statement = self::prepare(\"INSERT INTO $tableName (\".implode(',', $attributes).\") \n VALUES (\".implode(',', $params).\")\");\n \n foreach($attributes as $attribute){\n $statement->bindValue(\":$attribute\", $this->{$attribute});\n }\n \n $statement->execute();\n return true;\n }", "public function save()\r\n {\r\n if( empty($this->dirty) ) return true;\r\n \r\n $pkName = $this->pkName();\r\n //is it an update?\r\n if( isset($this->data[$pkName]) ){\r\n $this->table->update($this->dirty, \"{$pkName}=?\", array($this->data[$pkName]) );\r\n $merged_data[$pkName] = $this->data[$pkName];\r\n } else {\r\n //it's an insert\r\n $merged_data = array_merge(\r\n $this->array_diff_schema($this->dirty),\r\n $this->array_diff_schema($this->data)\r\n );\r\n $this->table->insert($merged_data);\r\n $pk = $this->pkName();\r\n if( !isset($merged_data[$pk]) )\r\n $merged_data[$pk] = $this->table->lastInsertId();\r\n }\r\n $this->reset($merged_data);\r\n return true;\r\n }", "public function testValueValidationForUpdate()\n {\n $eavValue = $this->getEavValueRepo()->findOneBy(['value' => 'customer_invoice']);\n\n $this->assertNotNull($eavValue);\n\n $eavValue->setValue('not_existing_type');\n\n $this->em->persist($eavValue);\n\n try {\n $this->em->flush();\n } catch (\\Exception $e) {\n $this->assertInstanceOf(EavDocumentValidationException::class, $e);\n }\n\n $violations = $eavValue->getDocument()->getLastViolations();\n\n $this->assertCount(1, $violations);\n }", "public function validate(){\r\n\t\tif(array_get($this->entity, array_get($this->validate, 'fieldName')) != $this->fieldValue){\r\n\t\t\tHmsException::occur($fieldName. '必须等于', $this->fieldValue);\r\n\t\t}\r\n\t}", "public function checkIntegrity();", "public function save(){\n $tableName = $this->tableName();\n $attributes = $this->attributes();\n $params = array_map(fn($attr)=> \":$attr\", $attributes);\n\n $st = self::prepare(\n \"INSERT INTO $tableName (\".implode(',', $attributes).\")\n VALUES(\".implode(',', $params).\")\"\n );\n\n foreach($attributes as $attribute){\n $st->bindValue(\":$attribute\", $this->{$attribute});\n }\n\n $st->execute();\n return true;\n }", "protected function beforeValidate ()\n {\n //$this->tglrevisimodul = date ('Y-m-d', strtotime($this->tglrevisimodul));\n $format = new MyFormatter();\n //$this->tglrevisimodul = $format->formatDateTimeForDb($this->tglrevisimodul);\n foreach($this->metadata->tableSchema->columns as $columnName => $column){\n if ($column->dbType == 'date')\n {\n $this->$columnName = $format->formatDateTimeForDb($this->$columnName);\n }\n else if ($column->dbType == 'timestamp without time zone')\n {\n $this->$columnName = $format->formatDateTimeForDb($this->$columnName);\n } \n }\n\n return parent::beforeValidate ();\n }", "public function valid()\n {\n return $this->dataSource->valid();\n }", "function EditRow() {\n\t\tglobal $conn, $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t\tif ($this->fbid->CurrentValue <> \"\") { // Check field with unique index\n\t\t\t$sFilterChk = \"(`fbid` = \" . ew_AdjustSql($this->fbid->CurrentValue) . \")\";\n\t\t\t$sFilterChk .= \" AND NOT (\" . $sFilter . \")\";\n\t\t\t$this->CurrentFilter = $sFilterChk;\n\t\t\t$sSqlChk = $this->SQL();\n\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t\t$rsChk = $conn->Execute($sSqlChk);\n\t\t\t$conn->raiseErrorFn = '';\n\t\t\tif ($rsChk === FALSE) {\n\t\t\t\treturn FALSE;\n\t\t\t} elseif (!$rsChk->EOF) {\n\t\t\t\t$sIdxErrMsg = str_replace(\"%f\", $this->fbid->FldCaption(), $Language->Phrase(\"DupIndex\"));\n\t\t\t\t$sIdxErrMsg = str_replace(\"%v\", $this->fbid->CurrentValue, $sIdxErrMsg);\n\t\t\t\t$this->setFailureMessage($sIdxErrMsg);\n\t\t\t\t$rsChk->Close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t$rsChk->Close();\n\t\t}\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$rsnew = array();\n\n\t\t\t// fbid\n\t\t\t$this->fbid->SetDbValueDef($rsnew, $this->fbid->CurrentValue, NULL, $this->fbid->ReadOnly);\n\n\t\t\t// name\n\t\t\t$this->name->SetDbValueDef($rsnew, $this->name->CurrentValue, \"\", $this->name->ReadOnly);\n\n\t\t\t// email\n\t\t\t$this->_email->SetDbValueDef($rsnew, $this->_email->CurrentValue, \"\", $this->_email->ReadOnly);\n\n\t\t\t// password\n\t\t\t$this->password->SetDbValueDef($rsnew, $this->password->CurrentValue, NULL, $this->password->ReadOnly);\n\n\t\t\t// validated_mobile\n\t\t\t$this->validated_mobile->SetDbValueDef($rsnew, $this->validated_mobile->CurrentValue, NULL, $this->validated_mobile->ReadOnly);\n\n\t\t\t// role_id\n\t\t\t$this->role_id->SetDbValueDef($rsnew, $this->role_id->CurrentValue, 0, $this->role_id->ReadOnly);\n\n\t\t\t// image\n\t\t\t$this->image->SetDbValueDef($rsnew, $this->image->CurrentValue, NULL, $this->image->ReadOnly);\n\n\t\t\t// newsletter\n\t\t\t$this->newsletter->SetDbValueDef($rsnew, $this->newsletter->CurrentValue, 0, $this->newsletter->ReadOnly);\n\n\t\t\t// points\n\t\t\t$this->points->SetDbValueDef($rsnew, $this->points->CurrentValue, NULL, $this->points->ReadOnly);\n\n\t\t\t// last_modified\n\t\t\t$this->last_modified->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->last_modified->CurrentValue, 7), NULL, $this->last_modified->ReadOnly);\n\n\t\t\t// p2\n\t\t\t$this->p2->SetDbValueDef($rsnew, $this->p2->CurrentValue, NULL, $this->p2->ReadOnly || (EW_ENCRYPTED_PASSWORD && $rs->fields('p2') == $this->p2->CurrentValue));\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\tif ($EditRow) {\n\t\t\t$this->WriteAuditTrailOnEdit($rsold, $rsnew);\n\t\t}\n\t\t$rs->Close();\n\t\treturn $EditRow;\n\t}", "private function validate() {\n $this->valid = (1 === count($this->marriages));\n }", "function EditRow() {\n\t\tglobal $conn, $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$rsnew = array();\n\n\t\t\t// model_id\n\t\t\t$this->model_id->SetDbValueDef($rsnew, $this->model_id->CurrentValue, 0, $this->model_id->ReadOnly);\n\n\t\t\t// title\n\t\t\t$this->title->SetDbValueDef($rsnew, $this->title->CurrentValue, NULL, $this->title->ReadOnly);\n\n\t\t\t// description\n\t\t\t$this->description->SetDbValueDef($rsnew, $this->description->CurrentValue, NULL, $this->description->ReadOnly);\n\n\t\t\t// s_order\n\t\t\t$this->s_order->SetDbValueDef($rsnew, $this->s_order->CurrentValue, 0, $this->s_order->ReadOnly);\n\n\t\t\t// status\n\t\t\t$this->status->SetDbValueDef($rsnew, $this->status->CurrentValue, 0, $this->status->ReadOnly);\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\t\treturn $EditRow;\n\t}", "function EditRow() {\n\t\tglobal $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$conn = &$this->Connection();\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$this->LoadDbValues($rsold);\n\t\t\t$this->featured_image->OldUploadPath = \"../uploads/product/\";\n\t\t\t$this->featured_image->UploadPath = $this->featured_image->OldUploadPath;\n\t\t\t$rsnew = array();\n\n\t\t\t// cat_id\n\t\t\t$this->cat_id->SetDbValueDef($rsnew, $this->cat_id->CurrentValue, 0, $this->cat_id->ReadOnly || $this->cat_id->MultiUpdate <> \"1\");\n\n\t\t\t// company_id\n\t\t\t$this->company_id->SetDbValueDef($rsnew, $this->company_id->CurrentValue, 0, $this->company_id->ReadOnly || $this->company_id->MultiUpdate <> \"1\");\n\n\t\t\t// pro_model\n\t\t\t$this->pro_model->SetDbValueDef($rsnew, $this->pro_model->CurrentValue, NULL, $this->pro_model->ReadOnly || $this->pro_model->MultiUpdate <> \"1\");\n\n\t\t\t// pro_name\n\t\t\t$this->pro_name->SetDbValueDef($rsnew, $this->pro_name->CurrentValue, NULL, $this->pro_name->ReadOnly || $this->pro_name->MultiUpdate <> \"1\");\n\n\t\t\t// pro_description\n\t\t\t$this->pro_description->SetDbValueDef($rsnew, $this->pro_description->CurrentValue, NULL, $this->pro_description->ReadOnly || $this->pro_description->MultiUpdate <> \"1\");\n\n\t\t\t// pro_condition\n\t\t\t$this->pro_condition->SetDbValueDef($rsnew, $this->pro_condition->CurrentValue, NULL, $this->pro_condition->ReadOnly || $this->pro_condition->MultiUpdate <> \"1\");\n\n\t\t\t// pro_features\n\t\t\t$this->pro_features->SetDbValueDef($rsnew, $this->pro_features->CurrentValue, NULL, $this->pro_features->ReadOnly || $this->pro_features->MultiUpdate <> \"1\");\n\n\t\t\t// post_date\n\t\t\t$this->post_date->SetDbValueDef($rsnew, ew_CurrentDateTime(), NULL);\n\t\t\t$rsnew['post_date'] = &$this->post_date->DbValue;\n\n\t\t\t// ads_id\n\t\t\t$this->ads_id->SetDbValueDef($rsnew, $this->ads_id->CurrentValue, NULL, $this->ads_id->ReadOnly || $this->ads_id->MultiUpdate <> \"1\");\n\n\t\t\t// pro_base_price\n\t\t\t$this->pro_base_price->SetDbValueDef($rsnew, $this->pro_base_price->CurrentValue, NULL, $this->pro_base_price->ReadOnly || $this->pro_base_price->MultiUpdate <> \"1\");\n\n\t\t\t// pro_sell_price\n\t\t\t$this->pro_sell_price->SetDbValueDef($rsnew, $this->pro_sell_price->CurrentValue, NULL, $this->pro_sell_price->ReadOnly || $this->pro_sell_price->MultiUpdate <> \"1\");\n\n\t\t\t// featured_image\n\t\t\tif ($this->featured_image->Visible && !$this->featured_image->ReadOnly && strval($this->featured_image->MultiUpdate) == \"1\" && !$this->featured_image->Upload->KeepFile) {\n\t\t\t\t$this->featured_image->Upload->DbValue = $rsold['featured_image']; // Get original value\n\t\t\t\tif ($this->featured_image->Upload->FileName == \"\") {\n\t\t\t\t\t$rsnew['featured_image'] = NULL;\n\t\t\t\t} else {\n\t\t\t\t\t$rsnew['featured_image'] = $this->featured_image->Upload->FileName;\n\t\t\t\t}\n\t\t\t\t$this->featured_image->ImageWidth = 875; // Resize width\n\t\t\t\t$this->featured_image->ImageHeight = 665; // Resize height\n\t\t\t}\n\n\t\t\t// folder_image\n\t\t\t$this->folder_image->SetDbValueDef($rsnew, $this->folder_image->CurrentValue, \"\", $this->folder_image->ReadOnly || $this->folder_image->MultiUpdate <> \"1\");\n\n\t\t\t// pro_status\n\t\t\t$tmpBool = $this->pro_status->CurrentValue;\n\t\t\tif ($tmpBool <> \"Y\" && $tmpBool <> \"N\")\n\t\t\t\t$tmpBool = (!empty($tmpBool)) ? \"Y\" : \"N\";\n\t\t\t$this->pro_status->SetDbValueDef($rsnew, $tmpBool, \"N\", $this->pro_status->ReadOnly || $this->pro_status->MultiUpdate <> \"1\");\n\n\t\t\t// branch_id\n\t\t\t$this->branch_id->SetDbValueDef($rsnew, $this->branch_id->CurrentValue, NULL, $this->branch_id->ReadOnly || $this->branch_id->MultiUpdate <> \"1\");\n\n\t\t\t// lang\n\t\t\t$this->lang->SetDbValueDef($rsnew, $this->lang->CurrentValue, \"\", $this->lang->ReadOnly || $this->lang->MultiUpdate <> \"1\");\n\t\t\tif ($this->featured_image->Visible && !$this->featured_image->Upload->KeepFile) {\n\t\t\t\t$this->featured_image->UploadPath = \"../uploads/product/\";\n\t\t\t\t$OldFiles = ew_Empty($this->featured_image->Upload->DbValue) ? array() : array($this->featured_image->Upload->DbValue);\n\t\t\t\tif (!ew_Empty($this->featured_image->Upload->FileName) && $this->UpdateCount == 1) {\n\t\t\t\t\t$NewFiles = array($this->featured_image->Upload->FileName);\n\t\t\t\t\t$NewFileCount = count($NewFiles);\n\t\t\t\t\tfor ($i = 0; $i < $NewFileCount; $i++) {\n\t\t\t\t\t\t$fldvar = ($this->featured_image->Upload->Index < 0) ? $this->featured_image->FldVar : substr($this->featured_image->FldVar, 0, 1) . $this->featured_image->Upload->Index . substr($this->featured_image->FldVar, 1);\n\t\t\t\t\t\tif ($NewFiles[$i] <> \"\") {\n\t\t\t\t\t\t\t$file = $NewFiles[$i];\n\t\t\t\t\t\t\tif (file_exists(ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file)) {\n\t\t\t\t\t\t\t\t$OldFileFound = FALSE;\n\t\t\t\t\t\t\t\t$OldFileCount = count($OldFiles);\n\t\t\t\t\t\t\t\tfor ($j = 0; $j < $OldFileCount; $j++) {\n\t\t\t\t\t\t\t\t\t$file1 = $OldFiles[$j];\n\t\t\t\t\t\t\t\t\tif ($file1 == $file) { // Old file found, no need to delete anymore\n\t\t\t\t\t\t\t\t\t\tunset($OldFiles[$j]);\n\t\t\t\t\t\t\t\t\t\t$OldFileFound = TRUE;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ($OldFileFound) // No need to check if file exists further\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t$file1 = ew_UploadFileNameEx($this->featured_image->PhysicalUploadPath(), $file); // Get new file name\n\t\t\t\t\t\t\t\tif ($file1 <> $file) { // Rename temp file\n\t\t\t\t\t\t\t\t\twhile (file_exists(ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file1) || file_exists($this->featured_image->PhysicalUploadPath() . $file1)) // Make sure no file name clash\n\t\t\t\t\t\t\t\t\t\t$file1 = ew_UniqueFilename($this->featured_image->PhysicalUploadPath(), $file1, TRUE); // Use indexed name\n\t\t\t\t\t\t\t\t\trename(ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file, ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file1);\n\t\t\t\t\t\t\t\t\t$NewFiles[$i] = $file1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->featured_image->Upload->DbValue = empty($OldFiles) ? \"\" : implode(EW_MULTIPLE_UPLOAD_SEPARATOR, $OldFiles);\n\t\t\t\t\t$this->featured_image->Upload->FileName = implode(EW_MULTIPLE_UPLOAD_SEPARATOR, $NewFiles);\n\t\t\t\t\t$this->featured_image->SetDbValueDef($rsnew, $this->featured_image->Upload->FileName, \"\", $this->featured_image->ReadOnly || $this->featured_image->MultiUpdate <> \"1\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($EditRow) {\n\t\t\t\t\tif ($this->featured_image->Visible && !$this->featured_image->Upload->KeepFile) {\n\t\t\t\t\t\t$OldFiles = ew_Empty($this->featured_image->Upload->DbValue) ? array() : array($this->featured_image->Upload->DbValue);\n\t\t\t\t\t\tif (!ew_Empty($this->featured_image->Upload->FileName) && $this->UpdateCount == 1) {\n\t\t\t\t\t\t\t$NewFiles = array($this->featured_image->Upload->FileName);\n\t\t\t\t\t\t\t$NewFiles2 = array($rsnew['featured_image']);\n\t\t\t\t\t\t\t$NewFileCount = count($NewFiles);\n\t\t\t\t\t\t\tfor ($i = 0; $i < $NewFileCount; $i++) {\n\t\t\t\t\t\t\t\t$fldvar = ($this->featured_image->Upload->Index < 0) ? $this->featured_image->FldVar : substr($this->featured_image->FldVar, 0, 1) . $this->featured_image->Upload->Index . substr($this->featured_image->FldVar, 1);\n\t\t\t\t\t\t\t\tif ($NewFiles[$i] <> \"\") {\n\t\t\t\t\t\t\t\t\t$file = ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $NewFiles[$i];\n\t\t\t\t\t\t\t\t\tif (file_exists($file)) {\n\t\t\t\t\t\t\t\t\t\tif (@$NewFiles2[$i] <> \"\") // Use correct file name\n\t\t\t\t\t\t\t\t\t\t\t$NewFiles[$i] = $NewFiles2[$i];\n\t\t\t\t\t\t\t\t\t\tif (!$this->featured_image->Upload->ResizeAndSaveToFile($this->featured_image->ImageWidth, $this->featured_image->ImageHeight, EW_THUMBNAIL_DEFAULT_QUALITY, $NewFiles[$i], TRUE, $i)) {\n\t\t\t\t\t\t\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UploadErrMsg7\"));\n\t\t\t\t\t\t\t\t\t\t\treturn FALSE;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$NewFiles = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$OldFileCount = count($OldFiles);\n\t\t\t\t\t\tfor ($i = 0; $i < $OldFileCount; $i++) {\n\t\t\t\t\t\t\tif ($OldFiles[$i] <> \"\" && !in_array($OldFiles[$i], $NewFiles))\n\t\t\t\t\t\t\t\t@unlink($this->featured_image->OldPhysicalUploadPath() . $OldFiles[$i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\n\t\t// featured_image\n\t\tew_CleanUploadTempPath($this->featured_image, $this->featured_image->Upload->Index);\n\t\treturn $EditRow;\n\t}", "function ValidateEdit()\n\t{\n\t}", "public function validate(){\r\n $userInfo = wbUser::getSession();\r\n \r\n if ($this->actionType == 'CREATE'){\r\n // TODO : Write your validation for CREATE here\r\n $this->record['creation_date'] = date('Y-m-d');\r\n $this->record['created_by'] = $userInfo['user_name'];\r\n \r\n $this->record['updated_date'] = date('Y-m-d');\r\n $this->record['updated_by'] = $userInfo['user_name'];\r\n \r\n }else if ($this->actionType == 'UPDATE'){\r\n // TODO : Write your validation for UPDATE here\r\n $this->record['updated_date'] = date('Y-m-d');\r\n $this->record['updated_by'] = $userInfo['user_name'];\r\n }\r\n \r\n return true;\r\n }", "public function save()\n\t{\n\t\t$status = $this->validated ? TRUE : $this->valid();\n\n\t\tif ($status === TRUE)\n\t\t{\n\t\t\tif ($this->data['id']) // Do an update\n\t\t\t\treturn count($this->db->update($this->table_name, $this->data, array('id' => $this->data['id'])));\n\t\t\telse // Do an insert\n\t\t\t{\n\t\t\t\t$id = $this->db->insert($this->table_name, $this->data)->insert_id();\n\t\t\t\treturn ($this->data['id'] = $id);\n\t\t\t}\n\t\t}\n\n\t\tthrow new Kohana_User_Exception('auto_modeler.validation_error', $status);\n\t}", "private function _validData($data){\n\t\t$columnsLen = array(\n\t\t\t\t\t\t\t'nro_pedido' => 6,\n\t\t\t\t\t\t\t'id_factura_pagos' => 1,\n\t\t\t\t\t\t\t'valor' => 1,\n\t\t\t\t\t\t\t'concepto' => 1,\n\t\t\t\t\t\t\t'fecha_inicio' => 0,\n\t\t\t\t\t\t\t'fecha_fin' => 0,\n\t\t\t\t\t\t\t'id_user' => 1\n\t\t);\n\t\treturn $this->_checkColumnsData($columnsLen, $data);\n\t}", "public function setInvalid();", "public function validate() {\n\t\t// field validation:\n\t\t$sw = $this->exists();\n\t\t$this->errors = validation::validate($this->new_data, $this->vrules, $sw);\n\t\tif ($this->errors) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// uniques:\n\t\tif ($this->errors = $this->check_uniques()) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function validate_on_update() {}", "public function isValid(){\n\t\t//Initally create a valid variable and set it to true\n\t\t$valid = true;\n\t\t//Loop through all of the validation rules in the model\n\t\tforeach (static::$validationRules as $column => $rules) {\n\t\t\t//At the beginning there are no errors in any column\n\t\t\t$this->errors[$column] = null;\n\t\t\t//sperate all the different rules\n\t\t\t$rules = explode(\",\", $rules);\n\t\t\t//Loop over each of the different rules for each column\n\t\t\tforeach($rules as $rule){\n\t\t\t\t//Seperate the value from the rule\n\t\t\t\tif(strstr($rule, \":\")){\n\t\t\t\t\t$rule = explode(\":\", $rule);\n\t\t\t\t\t//rule gets turned into an array\n\t\t\t\t\t//Put the value into a value variable\n\t\t\t\t\t$value = $rule[1];\n\t\t\t\t\t//Put the rule back into the rule variable\n\t\t\t\t\t$rule = $rule[0];\n\t\t\t\t}\n\t\t\t\t//use a switch to go over all of the rules\n\t\t\t\tswitch ($rule) {\n\t\t\t\t\t//These case's must match the ones in the model\n\t\t\t\t\t//Check min length\n\t\t\t\t\tcase 'minlength':\n\t\t\t\t\t\tif(strlen($this->$column) < $value){\n\t\t\t\t\t\t\t$valid = false;\n\t\t\t\t\t\t\t$this->errors[$column] = \"To Short - Must be at least $value characters long\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t// Check max length\n\t\t\t\t\tcase 'maxlength':\n\t\t\t\t\t\tif(strlen($this->$column) > $value){\n\t\t\t\t\t\t\t$valid = false;\n\t\t\t\t\t\t\t$this->error[$column] = \"To Long - Must be no more than $value characters long\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'email':\n\t\t\t\t\t\tif(! filter_var($this->$column, FILTER_VALIDATE_EMAIL)){\n\t\t\t\t\t\t\t$valid = false;\n\t\t\t\t\t\t\t$this->errors[$column] = \"Must be a valid Email\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'unique':\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $valid;\n\t}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function update(){\n\t\t$this->beforeSave();\n\t\t$tableName = $this->tableName();\n\t\t$fields = $this->fields();\n\t\t// Remove fields set as ignored by rules validation.\n\t\t$fields = $this->removeIgnored($fields);\n\t\t// Create PDO placeholders.\n\t\t$params = implode(', ', array_map(fn($name) => $name . ' = :' . $name, $fields));\n\t\t$primaryKey = $this->getPrimaryKey();\n\t\t$where = $primaryKey . ' = :' . $primaryKey;\n\t\t$statement = $this->db->prepare('UPDATE ' . $tableName . ' SET ' . $params . ' WHERE ' . $where);\n\t\t// Bind values to placeholders.\n\t\tforeach($fields as $field){\n\t\t\t$this->binder($statement, ':' . $field, $this->{$field});\n\t\t}\n\t\t$statement->bindValue(':' . $primaryKey, $this->{$primaryKey});\n\t\tif($statement->execute()){\n\t\t\t$this->afterSave();\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function beforeSave()\n\t{\n\t\t//Set null for empty field in table\n\t\tif($this->sale_date=='') $this->sale_date = NULL;\n\t\tif($this->next_sale_date=='') $this->next_sale_date = NULL;\n\t\treturn true;\n\t}", "public function validate() {\n $stmt = $this->pdo->prepare('update user set valid = true where id = :id');\n $stmt->bindValue(':id', $this->id);\n if ($stmt->execute() == 1) {\n $this->valid = true;\n }\n return $this->valid;\n }", "function validateinsert(){\n\t\tglobal $_REQUEST;\n\t\t\n\t\t\n\t\tif(!empty($this->errors)){\n\t\t\t$result = false;\n\t\t}else{\n\t\t\t$result = true;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function save() {\n\t\t\ttry {\n\t\t\t\t$this->presave();\n\t\t\t\tif (!$this->validate()) { return FALSE; }\n\t\t\t} catch (Exception $ex) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tif (!$this->hasChanged()) { return TRUE; }\n\n\t\t\t$keys = [];\n\t\t\t$placeholders = [];\n\t\t\t$sets = [];\n\t\t\t$params = [];\n\n\t\t\tforeach (array_keys(static::$_fields) as $key) {\n\t\t\t\tif ($key == static::$_key) { continue; }\n\n\t\t\t\t$keys[] = '`' . $key . '`';\n\t\t\t\t$placeholders[] = ':' . $key;\n\t\t\t\t$sets[] = '`' . $key . '` = :' . $key;\n\n\t\t\t\t$params[':' . $key] = $this->getData($key);\n\t\t\t\tif (is_bool($params[':' . $key])) { $params[':' . $key] = $params[':' . $key] ? 'true' : 'false'; }\n\t\t\t\tif (in_array($key, static::$_json_fields)) { $params[':' . $key] = json_encode($params[':' . $key]); }\n\t\t\t}\n\n\t\t\tif ($this->isKnown()) {\n\t\t\t\t$keyKey = '`' . static::$_key . '`';\n\t\t\t\t$keyPlaceholder = ':' . static::$_key;\n\t\t\t\t$params[$keyPlaceholder] = $this->getData(static::$_key);\n\n\t\t\t\t$query = sprintf('UPDATE `%s` SET %s WHERE %s = %s', static::$_table, implode(', ', $sets), $keyKey, $keyPlaceholder);\n\t\t\t} else {\n\t\t\t\t$query = sprintf('INSERT INTO `%s` (%s) VALUES (%s)', static::$_table, implode(', ', $keys), implode(', ', $placeholders));\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t$statement = $this->myDB->getPDO()->prepare($query);\n\t\t\t\t$result = $statement->execute($params);\n\t\t\t} catch (\\PDOException $t) {\n\t\t\t\t$result = FALSE;\n\t\t\t}\n\t\t\tif ($result) {\n\t\t\t\tif (!$this->isKnown()) {\n\t\t\t\t\t$this->setData(static::$_key, $this->myDB->getPDO()->lastInsertId());\n\t\t\t\t}\n\t\t\t\t$this->postSave($result);\n\t\t\t\t$this->setChanged(false);\n\t\t\t\treturn TRUE;\n\t\t\t} else {\n\t\t\t\t$this->lastError = $statement->errorInfo();\n\t\t\t\t$this->postSave($result);\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\treturn FALSE;\n\t\t}", "protected function getValidFieldValues()\n {\n return [\n 'id' => [\n '1',\n '100'\n ]\n ];\n }", "public function isValidCustomRow(){\n return $this->capacity === $this->getNbSeatsCustomRow();\n }", "public function isValid()\n\t{\n\t\tif (empty($this->titre)) $this->titre = \"TITRE A REMPLACER\";\n\t\telse $this->titre = trim (preg_replace('/\\s+/', ' ', $this->titre) ); // Suppression des espaces\n\t\tif (!empty($this->contenu)) $this->contenu = trim (preg_replace('/\\s+/', ' ', $this->contenu) ); // Suppression des espaces\n\t\tif (empty($this->statut)) $this->statut = 0;\n\t\tif (empty($this->id_type)) $this->id_type = 1;\n\t\tif (empty($this->id_membre)) $this->id_membre = 0;\n\t}", "function beforeSave(&$Model) {\n extract($this->settings[$Model->alias]);\n $fields = array_diff_key($Model->data[$Model->alias], $schema);\n\n // Reset schema to default for class.. needed so we don't try to save EAV fields directly to the parent model\n $Model->schema(true);\n/*\n foreach ($fields as $key => $val) {\n // moved data fixer from here to beforeValidate\n }\n*/\n return true;\n }", "public function save() : bool {\n\t\t// Check if record is new\n\t\t$isNew = isset($this->{$this->primaryKey}) && $this->{$this->primaryKey} ? false : true;\n\n\t\tif ($isNew) {\n\t\t\t// Insert\n\t\t\t$this->database->query('INSERT INTO ' . $this->tableNamePrefixed, $this->getValuesForDatabase());\n\t\t\tif ($this->database->getInsertId()) {\n\t\t\t\t$this->{$this->primaryKey} = $this->database->getInsertId();\n\t\t\t}\n\t\t} else {\n\t\t\t// Update\n\t\t\t$this->database->query(\n\t\t\t\t'UPDATE ' . $this->tableNamePrefixed . ' SET',\n\t\t\t\t$this->getValuesForDatabase(),\n\t\t\t\t'WHERE ' . $this->primaryKey . ' = ?', $this->{$this->primaryKey}\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}", "public function validation();", "public function save(){\n\n if (!$this->preSave()) {\n return FALSE;\n }\n\n $reference = $this->_getReference();\n $pk = $this->_getPK();\n\n $data = get_object_vars($this);\n\n if (empty($pk) && $pk !== NULL) {\n throw new \\Exception('Model PK is empty!');\n }\n\n if (is_array($pk)) {\n $pkv = [];\n $_pkv = [];\n $insert = TRUE;\n foreach ($pk as $c) {\n if (!empty($data[$c])) {\n $pkv[] = $data[$c];\n $_pkv[$c] = $data[$c];\n // unset($data[$c]);\n $insert = FALSE;\n }\n }\n\n if (!$insert) {\n $insert = is_null(self::getWhere($_pkv));\n }\n\n\n } else {\n $pkv = !empty($data[$pk]) ? $data[$pk] : NULL;\n $_pkv = [$pk => $pkv];\n\n // Se for AUTO INCREMENT remove dos campos a serem INSERIDOS/ALTERADOS\n if (self::_isPkAi())\n unset($data[$pk]);\n\n $insert = empty($pkv);\n }\n\n unset($data['__error']);\n\n foreach ($data as $key => $value) {\n if (strpos($key, '_') === 0)\n unset($data[$key]);\n }\n\n if ($insert) {\n\n if (array_key_exists('created', $data))\n $data['created'] = Date('Y-m-d H:i:s');\n\n if (array_key_exists('updated', $data))\n unset($data['updated']);\n\n\n $res = self::$connection->insert($reference, $data)->execute();\n\n if ($res && $pk !== NULL && !is_array($pk))\n $this->{'set'.$pk}(self::$connection->lastInsertId());\n\n } else {\n\n if (array_key_exists('updated', $data))\n $data['updated'] = Date('Y-m-d H:i:s');\n\n if (array_key_exists('created', $data))\n unset($data['created']);\n\n $res = self::$connection->update($reference, $data, $_pkv)->execute();\n\n }\n\n if ($res)\n $this->refresh();\n\n $this->afterSave($res);\n\n return $res;\n\n }", "public function is_valid()\n {\n }", "public function is_valid()\n {\n }", "public function save()\n {\n $primary = $this->primary_key;\n $id = null;\n\n try {\n \n /** Verifica os campos obrigatórios */\n if ( !$this->required() ) {\n throw new \\Exception('Preencha os campos necessários.');\n }\n\n $date_now = (new \\DateTime())->format('Y-m-d H:i:s');\n\n /** Se for um update */\n if ( !empty($this->data->$primary) ) {\n $this->data->updated_at = $date_now;\n $id = $this->data->$primary;\n $this->update($this->safe(), [\"{$this->primary_key}=\" => $id]);\n }\n\n /** Se for um create */\n if ( empty($this->data->$primary) ) {\n $this->data->created_at = $date_now;\n $this->data->updated_at = $date_now;\n $id = $this->create($this->safe());\n }\n\n if ( !$id ) {\n return false;\n }\n\n $this->data = $this->findByPrimaryKey($id);\n return true;\n\n } catch(\\Exception $exception) {\n $this->fail = $exception;\n return false;\n }\n }", "public function validateSave() {\r\n //0. Pobranie parametrów z walidacją\r\n $this->form->id = ParamUtils::getFromRequest('id', true, 'Błędne wywołanie aplikacji');\r\n $this->form->distance = ParamUtils::getFromRequest('distance', true, 'Błędne wywołanie aplikacji');\r\n $this->form->startTime = ParamUtils::getFromRequest('startTime', true, 'Błędne wywołanie aplikacji');\r\n $this->form->endTime = ParamUtils::getFromRequest('endTime', true, 'Błędne wywołanie aplikacji');\r\n $this->form->cityFrom = ParamUtils::getFromRequest('cityFrom', true, 'Błędne wywołanie aplikacji');\r\n $this->form->cityTo = ParamUtils::getFromRequest('cityTo', true, 'Błędne wywołanie aplikacji');\r\n $this->form->personId = ParamUtils::getFromRequest('personId', true, 'Błędne wywołanie aplikacji');\r\n $this->form->carId = ParamUtils::getFromRequest('carId', true, 'Błędne wywołanie aplikacji');\r\n\r\n if (App::getMessages()->isError())\r\n return false;\r\n\r\n // 1. sprawdzenie czy wartości wymagane nie są puste\r\n if (empty(trim($this->form->distance))) {\r\n Utils::addErrorMessage('Wprowadź dystans');\r\n }\r\n if (empty(trim($this->form->startTime))) {\r\n Utils::addErrorMessage('Wprowadź datę wyjazdu');\r\n }\r\n if (empty(trim($this->form->endTime))) {\r\n Utils::addErrorMessage('Wprowadź datę przyjazdu na miejsce');\r\n }\r\n if (empty(trim($this->form->cityFrom))) {\r\n Utils::addErrorMessage('Wprowadź miejsce początkowe');\r\n }\r\n if (empty(trim($this->form->cityTo))) {\r\n Utils::addErrorMessage('Wprowadź miejsce końcowe');\r\n }\r\n if (empty(trim($this->form->personId))) {\r\n Utils::addErrorMessage('Wprowadź pracownika');\r\n }\r\n if (empty(trim($this->form->carId))) {\r\n Utils::addErrorMessage('Wprowadź pojazd');\r\n }\r\n\r\n if (App::getMessages()->isError())\r\n return false;\r\n\r\n // 2. sprawdzenie poprawności przekazanych parametrów\r\n $check_distance = is_numeric($this->form->distance);\r\n if ($check_distance === false) {\r\n Utils::addErrorMessage('Dystans musi być liczbą');\r\n }\r\n\r\n //sprawdzenie poprawnosci daty\r\n\r\n $sT = $this->form->startTime;\r\n $eT = $this->form->endTime;\r\n\r\n $check_timeStart = checkdate(substr($sT, 5, 2), substr($sT, 8, 2), substr($sT, 0, 4));\r\n $check_timeEnd = checkdate(substr($eT, 5, 2), substr($eT, 8, 2), substr($eT, 0, 4));\r\n\r\n if ($check_timeEnd === false) {\r\n Utils::addErrorMessage('Zły format daty. Przykład: 2018-01-01 00:00:00 lub czeski błąd');\r\n }\r\n\r\n if ($check_timeStart === false) {\r\n Utils::addErrorMessage('Zły format daty. Przykład: 2018-01-01 00:00:00 lub czeski błąd');\r\n }\r\n\r\n return !App::getMessages()->isError();\r\n }", "protected function beforeValidate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t{\n\t\t\t//new record so set all four values\n\t\t\t$this->create_time = $this->update_time = new CDbExpression('NOW()');\n\t\t\t$this->create_user_id = $this->update_user_id = Yii::app()->user->id;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//not a new record just an update so set the two values\n\t\t\t$this->update_time = new CDbExpression('NOW()');\n\t\t\t$this->update_user_id = Yii::app()->user->id;\n\t\t}\n\t\treturn parent::beforeValidate();\n\t}", "public abstract function validation();", "function save_all()\n {\n $total = FSInput::get('total', 0, 'int');\n if (!$total)\n return true;\n $field_change = FSInput::get('field_change');\n if (!$field_change)\n return false;\n $field_change_arr = explode(',', $field_change);\n $total_field_change = count($field_change_arr);\n $record_change_success = 0;\n for ($i = 0; $i < $total; $i++){\n $row = array();\n $update = 0;\n foreach ($field_change_arr as $field_item)\n {\n $field_value_original = FSInput::get($field_item . '_' . $i . '_original');\n $field_value_new = FSInput::get($field_item . '_' . $i);\n if (is_array($field_value_new))\n {\n $field_value_new = count($field_value_new) ? ',' . implode(',', $field_value_new) .\n ',' : '';\n }\n if ($field_value_original != $field_value_new)\n {\n $update = 1;\n $row[$field_item] = $field_value_new;\n }\n }\n if ($update)\n {\n $id = FSInput::get('id_' . $i, 0, 'int');\n $str_update = '';\n global $db;\n $j = 0;\n foreach ($row as $key => $value)\n {\n if ($j > 0)\n $str_update .= ',';\n $str_update .= \"`\" . $key . \"` = '\" . $value . \"'\";\n $j++;\n }\n $sql = ' UPDATE ' . $this->table_name . ' SET ';\n $sql .= $str_update;\n $sql .= ' WHERE id = ' . $id . ' ';\n $db->query($sql);\n $rows = $db->affected_rows();\n if (!$rows)\n return false;\n $record_change_success++;\n }\n }\n return $record_change_success;\n }", "public function valid();", "public function valid();", "public function valid();", "public function valid();", "protected function _validate() {\n\t}" ]
[ "0.66925913", "0.66674876", "0.6642058", "0.6595251", "0.6526923", "0.6463464", "0.6407072", "0.6321227", "0.62717885", "0.6266767", "0.6248346", "0.62174565", "0.6156634", "0.6124942", "0.61172116", "0.6092139", "0.60753393", "0.60645187", "0.605301", "0.60499895", "0.60405666", "0.60221314", "0.6018208", "0.60176826", "0.6007119", "0.5985077", "0.59672505", "0.5965464", "0.5958191", "0.59579456", "0.5938947", "0.59334236", "0.5927144", "0.5925195", "0.591446", "0.5882699", "0.58800817", "0.5860439", "0.5859976", "0.5853311", "0.5847915", "0.5847637", "0.5838996", "0.5837966", "0.58316743", "0.5829354", "0.5815671", "0.58130753", "0.580091", "0.57980365", "0.57907975", "0.57891494", "0.5788296", "0.5784494", "0.5780846", "0.57802", "0.5777912", "0.5769911", "0.57645106", "0.5764481", "0.57611144", "0.57576096", "0.5756782", "0.5756147", "0.5745679", "0.57336193", "0.57251763", "0.5724877", "0.5720982", "0.5720982", "0.5720982", "0.5720982", "0.5720982", "0.5720982", "0.5720982", "0.5720982", "0.57040393", "0.57016253", "0.570035", "0.5698596", "0.56900567", "0.5686639", "0.56837505", "0.56814194", "0.56747794", "0.5673269", "0.56711996", "0.56696653", "0.5663327", "0.566274", "0.5662493", "0.5655601", "0.5654056", "0.565401", "0.5652568", "0.5647373", "0.5647373", "0.5647373", "0.5647373", "0.5645364" ]
0.65783334
4
dinValidatorNumberRange::configure() Clean input value
protected function doClean( $value ) { $minField = $this->getOption( 'min_field' ); $maxField = $this->getOption( 'max_field' ); $value[$minField] = $this->getOption( 'min')->clean( isset( $value[$minField] ) ? $value[$minField] : null ); $value[$maxField] = $this->getOption( 'max')->clean( isset( $value[$maxField] ) ? $value[$maxField] : null ); if ( $value[$minField] && $value[$maxField] ) { $v = new sfValidatorSchemaCompare( $minField, sfValidatorSchemaCompare::LESS_THAN_EQUAL, $maxField, array( 'throw_global_error' => true ), array( 'invalid' => $this->getMessage( 'invalid' ) ) ); $v->clean( $value ); } return $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function sanitizeRange( $range ) {\n list( /*...*/, $bits ) = self::parseCIDR( $range );\n list( $start, /*...*/ ) = self::parseRange( $range );\n $start = self::formatHex( $start );\n if ( $bits === false ) {\n return $start; // wasn't actually a range\n }\n return \"$start/$bits\";\n }", "function tc_sanitize_number( $value) {\r\n $value = esc_attr( $value); // clean input\r\n $value = (int) $value; // Force the value into integer type.\r\n return ( 0 < $value ) ? $value : null;\r\n }", "function __give_sanitize_number_decimals_setting_field( $value ) {\n\t$value_changed = false;\n\t$show_notice = false;\n\t$old_value = $value;\n\n\tif ( isset( $_POST['decimal_separator'] ) ) {\n\t\t$value = ! empty( $_POST['decimal_separator'] ) ? $value : 0;\n\t\t$value_changed = true;\n\t}\n\n\tif ( $value_changed && ( $old_value !== $value ) ) {\n\t\tGive_Admin_Settings::add_error( 'give-number-decimal', __( 'The \\'Number of Decimals\\' option has been automatically set to zero because the \\'Decimal Separator\\' is not set.', 'give' ) );\n\t}\n\n\t$value = absint( $value );\n\t$is_currency_set_to_bitcoin = ( 'BTC' === give_get_option( 'currency' ) && ! isset( $_POST['currency'] ) ) || 'BTC' === $_POST['currency'];\n\n\tif ( $is_currency_set_to_bitcoin && 8 < $value) {\n\t\t$value = 8;\n\t\t$show_notice = true;\n\t}elseif ( ! $is_currency_set_to_bitcoin && 6 <= $value ) {\n\t\t$value = 5;\n\t\t$show_notice = true;\n\t}\n\n\tif( $show_notice ) {\n\t\tGive_Admin_Settings::add_error(\n\t\t\t'give-number-decimal',\n\t\t\tsprintf(\n\t\t\t\t__( 'The \\'Number of Decimals\\' option has been automatically set to %s because you entered a number higher than the maximum allowed.', 'give' ),\n\t\t\t\t$value\n\t\t\t)\n\t\t);\n\t}\n\n\treturn absint( $value );\n}", "public function forceIntegerInRangeForcesIntegerIntoDefaultBoundariesDataProvider() {}", "function validate() {\n\t\t\t$this->field['msg'] = ( isset( $this->field['msg'] ) ) ? $this->field['msg'] : esc_html__( 'You must provide a comma separated list of numerical values for this option.', 'redux-framework' );\n\n\t\t\tif ( ! is_numeric( str_replace( ',', '', $this->value ) ) || strpos( $this->value, ',' ) == false ) {\n\t\t\t\t$this->value = ( isset( $this->current ) ) ? $this->current : '';\n\t\t\t\t$this->field['current'] = $this->value;\n\n\t\t\t\t$this->error = $this->field;\n\t\t\t}\n\t\t}", "public function beforeSave()\n {\n $value = $this->getValue();\n if ($value < 0 || !preg_match('/^[0-9]+$/', $value)) {\n throw new LocalizedException(\n __(\n 'Fetch tag limit value \"%1\" is not valid. Please use only numbers equal or greater than 0.',\n $this->escaper->escapeHtml($value)\n )\n );\n }\n return $this;\n }", "public function validate_field_range ( $input ) {\n\t\t$input = number_format( floatval( $input ), 1 );\n\n\t\treturn $input;\n\t}", "function test_post_value_validation_sanitization_order() {\n\t\t$default_value = '0';\n\t\t$setting = $this->manager->add_setting( 'numeric', array(\n\t\t\t'validate_callback' => array( $this, 'filter_customize_validate_numeric' ),\n\t\t\t'sanitize_callback' => array( $this, 'filter_customize_sanitize_numeric' ),\n\t\t) );\n\t\t$this->assertEquals( $default_value, $this->manager->post_value( $setting, $default_value ) );\n\t\t$this->assertEquals( $default_value, $setting->post_value( $default_value ) );\n\n\t\t$post_value = '42';\n\t\t$this->manager->set_post_value( 'numeric', $post_value );\n\t\t$this->assertEquals( $post_value, $this->manager->post_value( $setting, $default_value ) );\n\t\t$this->assertEquals( $post_value, $setting->post_value( $default_value ) );\n\t}", "function StripValidator ()\n {\n\n $this->params['chars'] = array();\n\n }", "public function set_id_poblacion($value = \"\"){ \n $this->_id_poblacion= \\helpers\\Validator::valInt('f_id_poblacion',$value,TRUE);\n}", "function range($valor,$parms)\n\t{\t\t\n\t\tlist($min, $max) = explode(\",\", $parms, 2);\n\t\tif($valor<$min||$valor>$max)\n\t\t{\n\t\t\t$this->CI->form_validation->set_message('range', \"El campo %s debe contener un valor entre {$min} y {$max}.\");\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "public function cleanNumber($value) {\n $data = trim($value);\n\n // Removes Unwanted Characters\n $data = filter_var($data, FILTER_SANITIZE_NUMBER_INT);\n\n // Sanitizes HTML Characters\n $data = htmlspecialchars_decode($data, ENT_QUOTES);\n\n return $data;\n }", "function clean_option_values( $config ){\r\n\t\t$core_inputs = array( 'select', 'multiselect' );\r\n\t\tif( ! isset( $config['options'] ) || ! is_array( $config['options'] ) || ! in_array( $config['type'], $core_inputs ) ) return $config;\r\n\r\n\t\t$tmp_options = array();\r\n\r\n\t\tforeach( $config['options'] as $value => $label ){\r\n\t\t\t$value = str_replace( '*', '', $value, $replace_default );\r\n\t\t\t$value = str_replace( '~', '', $value, $replace_disabled );\r\n\r\n\t\t\t$tmp_options[ $value ] = $label;\r\n\t\t}\r\n\r\n\t\t$config['options'] = $tmp_options;\r\n\r\n\t\treturn $config;\r\n\t}", "public function setNumber($value)\n {\n // strip non-numeric characters\n return $this->setParameter('number', preg_replace('/\\D/', '', $value));\n }", "function sanitize_numbers($value)\n{\n return filter_var($value, FILTER_SANITIZE_NUMBER_INT);\n}", "function sugar_valid_int($value, $min=1, $max=65535) {\n $options = array(\n 'options' => array(\n 'min_range' => $min,\n 'max_range' => $max,\n ),\n );\n return filter_var($value, FILTER_VALIDATE_INT, $options);\n}", "function validate_field_range(string $field_value, array &$field, array $params): ?bool\n{\n if (($field_value < $params['min']) || ($field_value > $params['max'])) {\n $field['error'] = strtr('Laukelio vertė turi būti @from iki @to', [\n '@from' => $params['min'],\n '@to' => $params['max']\n ]);\n return false;\n } else {\n return true;\n }\n}", "public function filter_range($data,$min,$max){\n return filter_var($data,FILTER_VALIDATE_INT,array(\n \"options\" => array(\n \"min_range\" =>$min,\n \"min_range\"=>$max)\n ));\n }", "public static function validateRange(TextBase $control, $range)\r\n\t{\r\n\t\tthrow new \\LogicException(':RANGE validator is not applicable to TagInput.');\r\n\t}", "public function sanitizeNumber($data){\n $data = filter_var($data, FILTER_SANITIZE_NUMBER_INT);\n return $data;\n }", "protected function filterNumber($value) {\n return preg_replace(\"/.*(^\\-?[0-9\\ ]+[\\.|\\,]?[0-9]*).*$/\", \"$1\", $value);\n }", "function pimd_validate_intrange($value, $min, $max) {\n\tif (is_numericint($value) && ($value >= $min) && ($value <= $max)) {\n\t\treturn $value;\n\t} else {\n\t\treturn null;\n\t}\n}", "public function unsetNumberValue(): void\n {\n $this->numberValue = [];\n }", "private function sanitiseNum($x)\n {\n return filter_var($x, FILTER_VALIDATE_INT, array(\"options\" => array(\"min_range\" => 0, \"max_range\" => 1000000)));\n }", "public function setFilter($filter)\n {\n parent::setFilter($filter);\n\n $minValue = $this->getOption('min_value');\n $maxValue = $this->getOption('max_value');\n\n $this->userOptions['min_value'] = $minValue ? str_replace(',', '', $minValue) : $minValue;\n $this->userOptions['max_value'] = $maxValue ? str_replace(',', '', $maxValue) : $maxValue;\n }", "protected function cleanValue()\n {\n return str_replace([\n '%',\n '-',\n '+',\n ], '', $this->condition->value);\n }", "public function rules()\n {\n return [\n 'amount' => 'required|numeric|between:1,99999999.99'\n ];\n }", "public function isValid($value)\n {\n if (!is_numeric($value)) {\n $this->addError(\n $this->translateErrorMessage(\n 'validator.numberrange.notvalid',\n 'extbase'\n ),\n 1221563685\n );\n return;\n }\n\n $minimum = $this->options['minimum'];\n $maximum = $this->options['maximum'];\n\n if ($minimum > $maximum) {\n $x = $minimum;\n $minimum = $maximum;\n $maximum = $x;\n }\n if ($value < $minimum || $value > $maximum) {\n $this->addError($this->translateErrorMessage(\n 'validator.numberrange.range',\n 'extbase',\n [\n $minimum,\n $maximum\n ]\n ), 1221561046, [$minimum, $maximum]);\n }\n }", "public static function nullOrBcRange(\n string $value,\n string $min,\n string $max,\n string $message = '',\n ?int $scale = null\n ): void;", "function clean_value( $t )\n\t{\n\t\treturn $this->parse_clean_value( $t );\n\t}", "public function validateInput($arr)\n {\n $element = $this->_applicationPage->getPage()->getElementByFixedId(self::FID_REGISTRATION_NUMBER);\n $key = 'el' . $element->getId();\n $arr[$key] = preg_replace('#[^0-9]#', '', $arr[$key]);\n $arr[$key] = ltrim($arr[$key], '0');\n\n return parent::validateInput($arr);\n }", "public function numberFormatDataProvider() {}", "public function __construct($in) {\n $this->num= FALSE !== strpos($in, '.') ? rtrim(rtrim($in, '0'), '.') : (string)$in;\n }", "function validator_number($min = NULL, $max = NULL, $integer = NULL, $optional = NULL)\n{\n\tif (is_null($min))\n\t\t$min = -INF;\n\tif (is_null($max))\n\t\t$max = INF;\n\tif (is_null($integer))\n\t\t$integer = false;\n\tif (is_null($optional))\n\t\t$optional = false;\n\n\treturn array('optional' => $optional, 'validator' =>\n\t\tfunction($value) use ($min, $max, $integer)\n\t\t{\n\t\t\tif (!is_numeric($value)) {\n\t\t\t\tthrow new Exception('Could not validate number');\n\t\t\t}\n\n\t\t\tif ($integer) {\n\t\t\t\t$value = intval($value, 10);\n\t\t\t} else {\n\t\t\t\t$value = floatval($value);\n\t\t\t}\n\n\t\t\tif (is_numeric($value) && $value >= $min && $value <= $max) {\n\t\t\t\treturn $value;\n\t\t\t}\n\n\t\t\tthrow new Exception('Could not validate number');\n\t\t}\n\t);\n}", "protected function parseRangeUsingCidr($input, &$range): void\n {\n $input = explode('/', $input);\n $this->fillAddress($input[0], '0');\n\n $range['min'] = $input[0];\n $isAddressMask = strpos($input[1], '.') !== false;\n\n if ($isAddressMask && $this->verifyAddress($input[1])) {\n $range['mask'] = sprintf('%032b', ip2long($input[1]));\n return;\n }\n\n if ($isAddressMask || $input[1] < 8 || $input[1] > 30) {\n throw new ComponentException('Invalid network mask');\n }\n\n $range['mask'] = sprintf('%032b', ip2long(long2ip(~(2 ** (32 - $input[1]) - 1))));\n }", "protected function setNameCurrencyMinMaxAmount()\n {\n $minAmount = &$this->in_min_amount;\n $maxAmount = &$this->in_max_amount;\n if ($this->flagAddNameCurrencyToMinMaxAmount) {\n $minAmount = $minAmount . ' ' . $this->from;\n $maxAmount = $maxAmount . ' ' . $this->from;\n }\n }", "public function rules() {\n return array(\n array('maxValue, minValue', 'numerical', 'min' => 0),\n );\n }", "public function afterValidate() {\n\t\tif($this->allowFrom !== \"\"){\n\t\t\t$res\t= preg_split(\"/\\./\",$this->allowFrom);\n\t\t\t$this->allowFrom= sprintf(\"%03d\",$res[0]).\".\".sprintf(\"%03d\",$res[1]).\".\".sprintf(\"%03d\",$res[2]).\".\".sprintf(\"%03d\",$res[3]);\n\t\t}else{\n\t\t\t$this->allowFrom = NULL;\n\t\t}\n\t\t//----------------------------------------------------------------------\n\t\t$res\t= NULL;\n\t\t// ---------------------------------------------------------------------\n\t\tif($this->allowTo !== \"\"){\n\t\t\t$res\t= preg_split(\"/\\./\",$this->allowTo);\n\t\t\t$this->allowTo\t= sprintf(\"%03d\",$res[0]).\".\".sprintf(\"%03d\",$res[1]).\".\".sprintf(\"%03d\",$res[2]).\".\".sprintf(\"%03d\",$res[3]);\n\t\t}else{\n\t\t\t$this->allowTo = NULL;\n\t\t}\n\t\t//----------------------------------------------------------------------\n\t\tparent::afterValidate();\n\t}", "function sanitizeInput($input, $type = \"string\", $max = NULL, $min = NULL, $padding = \"_\"){\r\n\r\n \r\n switch($type){\r\n\r\n case \"string\":\r\n if(!is_string($input)){\r\n $input = strval($input);\r\n }\r\n \r\n if($min && strlen($input) < $min){\r\n $input = str_pad($input, $min, $padding);\r\n }\r\n\r\n if($max && strlen($input) > $max){\r\n $input = mb_substr($input, 0, $max);\r\n }\r\n\r\n break;\r\n\r\n case \"integer\":\r\n if(!is_int($input)){\r\n $input = intval($input);\r\n }\r\n\r\n if($min !== NULL && $input < $min){\r\n $input = $min;\r\n }\r\n\r\n if($max !== NULL && $input > $max){\r\n $input = $max;\r\n }\r\n\r\n break;\r\n\r\n case \"float\":\r\n if(!is_float($input)){\r\n $input = floatval($input);\r\n }\r\n\r\n if($min !== NULL && $input < $min){\r\n $input = $min;\r\n }\r\n\r\n if($max !== NULL && $input > $max){\r\n $input = $max;\r\n }\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n\r\n return $input;\r\n}", "function test_validate_setting_values_validation_sanitization_order() {\n\t\t$setting = $this->manager->add_setting( 'numeric', array(\n\t\t\t'validate_callback' => array( $this, 'filter_customize_validate_numeric' ),\n\t\t\t'sanitize_callback' => array( $this, 'filter_customize_sanitize_numeric' ),\n\t\t) );\n\t\t$post_value = '42';\n\t\t$this->manager->set_post_value( 'numeric', $post_value );\n\t\t$validities = $this->manager->validate_setting_values( $this->manager->unsanitized_post_values() );\n\t\t$this->assertCount( 1, $validities );\n\t\t$this->assertEquals( array( 'numeric' => true ), $validities );\n\t}", "function setNota_num($inota_num = '')\n {\n // adminto ',' como separador decimal.\n $inota_num = str_replace(\",\", \".\", $inota_num);\n $this->inota_num = $inota_num;\n }", "function setArticleCountsRange($min, $max)\n\t{\n\t\t$this->validate['articles_count']['range']['rule'][1] = $min-1;\n\t\t$this->validate['articles_count']['range']['rule'][2] = $max+1;\n\t}", "public static function range($value, $min, $max, $message = '');", "public function validate($value, Constraint $constraint)\n {\n if (!($constraint instanceof SeparatorSeparatedNumbers)) {\n throw new UnexpectedTypeException($constraint, __NAMESPACE__ . '\\SeparatorSeparatedNumbers');\n }\n if (null === $value) {\n return;\n }\n $separator = $constraint->separator;\n if (!in_array($separator, [',', ';', '|', ':', \"\\\\\"], true)) {\n $this->context->buildViolation($constraint->messageInvalidSeparator)\n ->setParameter('{{ string }}', $value)\n ->addViolation();\n return;\n }\n $onlyIntegers = $constraint->onlyIntegers;\n $escapedSeparator = \"\\\\\" . $separator;\n if ($onlyIntegers) {\n $pattern = '^(?:0|-?[1-9]\\d*)(?:' . $escapedSeparator . '(?:0|-?[1-9]\\d*))*$';\n } else {\n $pattern = '^(?:0|-?[1-9]\\d*)(?:\\.\\d+)?(?:' . $escapedSeparator . '(?:0|-?[1-9]\\d*)(?:\\.\\d+)?)*$';\n }\n if (!preg_match('/' . $pattern . '/', $value)) {\n $this->context->buildViolation($constraint->messageInvalidList)\n ->setParameter('{{ string }}', $value)\n ->addViolation();\n return;\n }\n $min = $constraint->lowerLimitOfAnElement;\n $max = $constraint->upperLimitOfAnElement;\n if (null === $min && null === $max) {\n return;\n }\n $elements = explode($separator, $value);\n foreach ($elements as $index => $element) {\n $elementValue = $onlyIntegers ? (int)$element : (float)$element;\n if (null !== $max && $elementValue > $max) {\n $this->context->buildViolation($constraint->messageElementUpperLimit)\n ->setParameter('{{ index }}', $this->formatValue($index))\n ->setParameter('{{ value }}', $this->formatValue($elementValue))\n ->setParameter('{{ limit }}', $this->formatValue($max))\n ->addViolation();\n return;\n }\n if (null !== $min && $elementValue < $min) {\n $this->context->buildViolation($constraint->messageElementLowerLimit)\n ->setParameter('{{ index }}', $this->formatValue($index))\n ->setParameter('{{ value }}', $this->formatValue($elementValue))\n ->setParameter('{{ limit }}', $this->formatValue($min))\n ->addViolation();\n return;\n }\n }\n }", "function validateNumberOrRange($number, $min_value, $max_value)\n {\n $result=false;\n\n if (filter_var($number, FILTER_VALIDATE_INT)===0 || !filter_var($number, FILTER_VALIDATE_INT)===false) //number provided\n {\n if ($number>=$min_value && $number<=$max_value)\n {\n $result=true;\n }\n else\n {\n $result=false;\n }\n }\n\n if (stristr($number, \"-\")) //range provided\n {\n $numbers_array=explode(\"-\", $number);\n if (filter_var($numbers_array[0], FILTER_VALIDATE_INT)===0 || !filter_var($numbers_array[0], FILTER_VALIDATE_INT)===false && filter_var($numbers_array[1], FILTER_VALIDATE_INT)===0 || !filter_var($numbers_array[1], FILTER_VALIDATE_INT)===false)\n {\n if ($numbers_array[0]>=$min_value && $numbers_array[1]<=$max_value && $numbers_array[0]<=$numbers_array[1])\n {\n $result=true;\n }\n else\n {\n $result=false;\n }\n }\n }\n\n return $result;\n }", "function jt_cmb2_sanitize_date_year_range( $check, $meta_value, $object_id, $field_args, $sanitizer ) {\n\n\t// if not repeatable, bail out.\n\tif ( ! is_array( $meta_value ) || ! $field_args['repeatable'] ) {\n\t\treturn $check;\n\t}\n\n\tforeach ( $meta_value as $key => $val ) {\n\t\t$meta_value[ $key ] = array_filter( array_map( 'sanitize_text_field', $val ) );\n\t}\n\n\treturn array_filter( $meta_value );\n}", "public function processRange($range) {\n $parts = explode($this->_range_delimiter, $range);\n\n if ( sizeof($parts) !== 2 ) {\n throw new InvalidArgumentException(\"bad range: ${range}\");\n }\n\n // sanity\n $start = $parts[0];\n $end = $parts[1];\n\n // could be roman numerals from prelim\n if ( !is_numeric($start) ) {\n\n \tif ( !$this->isPrelim($start) ) {\n \t\tthrow new InvalidArgumentException(\"bad range: ${range}\");\n \t}\n\n if ( !is_numeric($end) ) {\n\n\t \tif ( !$this->isPrelim($end) ) {\n\t \t\tthrow new InvalidArgumentException(\"bad range: ${range}\");\n\t \t}\n \n return $start . $this->_range_delimiter . $end;\n\n } else if ( intval($end) > $this->_min_page ) {\n \t// way out on the edge case: second number could be arabic\n \n $end = $this->step($end);\n\n return $start . $this->_range_delimiter . $end;\n }\n }\n\n // fill out $end with leading digits of $start\n $end = $this->expandRangeEnd($start, $end);\n\n // sanity\n if ( intval($end) <= intval($start) ) {\n \tthrow new InvalidArgumentException(\"bad range: ${start} to ${end}\");\n }\n\n // does the addition/subtraction fall within this range?\n if ( intval($start) <= $this->_min_page && $this->_min_page < intval($end) ) {\n\n \t// removing pages from within a range is problematic\n \tif ( $this->_increment < 0 ) {\n \t\tthrow new InvalidArgumentException(\"Cannot remove pages from with range: ${range}\");\n \t}\n\n \t// gap this range\n \treturn $this->splitRange($start, $end);\n }\n\n $start = $this->step($start);\n $end = $this->step($end);\n\n $end = $this->collapseRangeEnd($start, $end);\n\n return $start . $this->_range_delimiter . $end;\n }", "public function setNumero($value,$options=array('required'=>true)){ \n $this->_data['numero'] = new ZendT_Type_String($value,array('mask'=>''\n ,'charMask'=>''\n ,'filterDb'=>array (\n 0 => '',\n)\n ,'filter'=>array('trim', 'strtoupper', 'removeAccent', )));\n if ($options['db'])\n $this->_data['numero']->setValueFromDb($value);\n \n if (!$options['db']){\n \n if ($options['required'])\n $this->isRequired($value,'numero');\n \n $valid = new Zend_Validate_StringLength(array ( 'max' => 10, ) );\n $valueValid = $this->_data['numero']->getValueToDb();\n if ($valueValid && !$valid->isValid($valueValid)){\n throw new ZendT_Exception_Business(implode(\"\\n\",$valid->getMessages()));\n }\n \n }\n return $this;\n }", "public function filter($value)\n {\n $value = preg_replace(\"/\\([^)]+\\)/\", \"\", $value);\n $numeric = preg_replace(\"/[^0-9]/\", \"\", $value);\n\n if (strpos($numeric, '00') === 0 && (strlen($numeric) === 12 || strlen($numeric) === 13)) {\n $numeric = ltrim($numeric, '0');\n }\n\n if ((strpos($numeric, '06') === 0 && strlen($numeric) === 10) || (strpos($numeric, '6') && strlen($numeric) === 9)) {\n $numeric = '31' . ltrim($numeric, '0');\n }\n\n return (string)$numeric;\n }", "protected function doClean($value)\n {\n // based on http://stackoverflow.com/questions/406230/regular-expression-to-match-string-not-containing-a-word\n $value = preg_replace('/((?![0-9]).)*/', '', $value);\n\n if (!self::isValidCreditCard($value, $this->options['card_type']))\n {\n throw new sfValidatorError($this, 'invalid', array('value' => $value));\n }\n\n return $value;\n }", "protected function normalize()\r\n\t{\r\n\t\tif ($this->isFetched())\r\n\t\t{\r\n\t\t\tif ($this->validationInfo)\r\n\t\t\t{\r\n\t\t\t\t$this->normalizedValue = $this->validationInfo->normalize($this->taintValue);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->normalizedValue = $this->taintValue;\r\n\t\t\t}\t\r\n\t\t}\r\n\t}", "protected function parseRangeUsingWildcards($input, &$range): void\n {\n $this->fillAddress($input);\n\n $range['min'] = str_replace('*', '0', $input);\n $range['max'] = str_replace('*', '255', $input);\n }", "public function set_id_subclase($value = \"\"){ \n $this->_id_subclase= \\helpers\\Validator::valInt('f_id_subclase',$value,TRUE);\n}", "public function set_id_clases($value = \"\"){ \n $this->_id_clases= \\helpers\\Validator::valInt('f_id_clases',$value,TRUE);\n}", "public function setInvalid();", "protected static function filter_sanitize_numbers($value)\n\t{\n\t\treturn filter_var($value, FILTER_SANITIZE_NUMBER_INT); \n\t}", "public function setRange( $range ) \n {\n \n if( !is_int( $range ) ) {\n throw new Execption( \"<<THE RANGE MUST BE AN INTEGER>>\" );\n }\n \n $this->_range = $range;\n \n }", "public function sanitizeNData($nData){\n $this->validatePositiveInt($nData);\n\n //convert nData string to int\n $nData=$this->enforceIntNData($nData);\n\n //enforce maximum value\n $this->validateMaxValue($nData);\n\n //return cleaned nData\n return $nData;\n }", "public function testRangeValidation()\n {\n $aircraft = factory(\\App\\Aircraft::class)->create();\n $aircraft->range = null;\n $this->assertFalse($aircraft->save());\n\n $aircraft->range = 'a';\n $this->assertFalse($aircraft->save());\n\n $aircraft->range = 0.5;\n $this->assertFalse($aircraft->save());\n\n $aircraft->range = -3;\n $this->assertFalse($aircraft->save());\n\n $aircraft->range = 50;\n $this->assertTrue($aircraft->save());\n }", "public function __construct(string $strName, string $strWidth, int $iMin = 0, int $iMax = 100, int $wFlags = 0)\n {\n parent::__construct($strName, $strWidth, $wFlags);\n $this->strType = 'range';\n $this->iMin = $iMin;\n $this->iMax = $iMax;\n }", "public function numbers_only($value)\n{\n //return preg_match('/^([0-9]+)$/', $value);\n return ctype_digit(strval($value));\n}", "function clean_no ($cc_no)\t{\n\t\treturn ereg_replace ('[^0-9]+', '', $cc_no); \n\t}", "public function getInvalidValue();", "public function validateContactNumber()\n {\n if(! ctype_digit($this->Landline))\n $this->addError('Landline', 'Invalid landline.');\n }", "function get_input_number($id_campo, $lbl_campo, $value, $arr_err, $class='campo', $min=1, $max=9999, $decimal=false, $placeholder='') {\n $aux_aplicar_decimal = ($decimal == true) ? ' step=\".01\" ' : '';\n \n $o = '<div class=\"'.$class.'\">'; //output\n $o .= $lbl_campo;\n $o .= (isset($arr_err[$id_campo])) ? $arr_err[$id_campo] : '';\n $o .= '<input type=\"number\" max=\"'.$max.'\" min=\"'.$min.'\" id=\"'.$id_campo.'\" name=\"'.$id_campo.'\" '.$aux_aplicar_decimal.' placeholder=\"'.$placeholder.'\" value=\"'.htmlspecialchars(stripslashes($value)).'\" />';\n $o .= '</div>';\n return $o;\n }", "function render_field_validation_settings( $field ) {\n\t\t\t$field['min'] = empty( $field['min'] ) ? '' : $field['min'];\n\t\t\t$field['max'] = empty( $field['max'] ) ? '' : $field['max'];\n\n\t\t\tacf_render_field_setting(\n\t\t\t\t$field,\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Minimum Posts', 'acf' ),\n\t\t\t\t\t'instructions' => '',\n\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t'name' => 'min',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tacf_render_field_setting(\n\t\t\t\t$field,\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Maximum Posts', 'acf' ),\n\t\t\t\t\t'instructions' => '',\n\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t'name' => 'max',\n\t\t\t\t)\n\t\t\t);\n\t\t}", "private function prepareInRangeCondition($inRange)\n {\n list($attribute, $from, $to) = array_pad($inRange, 3, null);\n $inRange = new Range();\n $inRange->addField($attribute, ['from' => $from, 'to' => $to]);\n $this->filter->addMust($inRange);\n }", "protected static function _minLength() {\n if (self::$_ruleValue) {\n if (self::$_ruleValue > strlen(trim(self::$_elementValue))) {\n self::setErrorMessage(\"Enter at least \" . self::$_ruleValue . \" charachters \");\n self::setInvalidFlag(true);\n } else {\n self::setInvalidFlag(false);\n }\n }\n }", "function range($args) {\r\n\t\t$args = $this->apply_name_fix($this->apply_default_args($args)) ;\r\n\t\techo \"<div style='line-height:24px;'><input style=' float:left;\" . $this->width($args['width']) . \"' type='range' data-tooltip='\" . $args['tooltip'] . \"' min='\" . $args['min'] . \"' max='\" . $args['max'] . \"' class='range' size='57' \" . $this->placeholder($args['placeholder'] ) . \" name='\" . $args['formname'] . \"' value='\" . $args['value'] . \"'/>\";\t\t\t\t\r\n\t\t\r\n\t\techo \"<span style=' float:left; margin-left:10px;' class='rangeval'>\" . $args['value']. \"</span><span>\" . $args['unit']. \"</span</div>\";\r\n\t\r\n\t\t$this->description($args['description']);\r\n\t\t}", "private function validate()\n {\n if (! is_numeric($this->number)) {\n throw new \\InvalidArgumentException(\"Invalid numeric value provided ($this->number).\");\n }\n }", "public static function preRenderRange($element) {\n $element['#attributes']['type'] = 'range';\n Element::setAttributes($element, ['id', 'name', 'value', 'step', 'min', 'max']);\n static::setAttributes($element, ['form-range']);\n\n return $element;\n }", "function clean_input( $value ) {\n if ( is_numeric( $value ) ) {\n return( $value );\n }\n // Strip slashes if necessary\n if ( get_magic_quotes_gpc( ) ) {\n $value = stripslashes( $value );\n }\n // Make sure no sql-dangerous code gets through\n $value = mysql_real_escape_string( $value );\n // Strip HTML tags, to be sure\n // May need another routine to allow input of HTML\n $value = strip_tags( $value );\n \n return( $value );\n }", "function __give_validate_decimal_separator_setting_field( $value ) {\n\t$thousand_separator = isset( $_POST['thousands_separator'] ) ? give_clean( $_POST['thousands_separator'] ) : '';\n\t$decimal_separator = isset( $_POST['decimal_separator'] ) ? give_clean( $_POST['decimal_separator'] ) : '';\n\n\tif ( $decimal_separator === $thousand_separator ) {\n\t\t$value = '';\n\t\t$_POST['number_decimals'] = 0;\n\t\tGive_Admin_Settings::add_error( 'give-decimal-separator', __( 'The \\'Decimal Separator\\' option has automatically been set to empty because it can not be equal to the \\'Thousand Separator\\'', 'give' ) );\n\t}\n\n\treturn $value;\n}", "function options_validate(&$form, &$form_state) {\n parent::options_validate($form, $form_state);\n if (!preg_match('/^(?:\\-[0-9]{1,4}|[0-9]{4}):(?:[\\+|\\-][0-9]{1,4}|[0-9]{4})$/', $form_state['values']['options']['year_range'])) {\n form_error($form['year_range'], t('Date year range must be in the format -9:+9, 2005:2010, -9:2010, or 2005:+9'));\n }\n }", "public function sanitize($value): string\n {\n $renavam = parent::sanitize((string) $value);\n if (preg_match(\"/^([0-9]{9})$/\", $renavam)) {\n $renavam = '00' . $renavam;\n }\n\n if (preg_match(\"/^([0-9]{10})$/\", $renavam)) {\n $renavam = '0' . $renavam;\n }\n\n return $renavam;\n }", "public function __construct() {\n\t\t\t$this->field_type = 'number';\n\n\t\t\tparent::__construct();\n\t\t}", "protected function configureValidations()\n {\n }", "protected function _clean()\r\n\t{\r\n\t\t$this->taintValue = null;\r\n\t\t$this->normalizedValue = null;\r\n\t\r\n\t\t$this->parameterInfo = null;\r\n\t\t$this->bFetched = false;\r\n\t\t\r\n\t\t$this->validationInfo = null;\r\n\t\t$this->isValid = false;\r\n\t}", "public static function onRemove($input)\n {\n $input->removeValidator('max');\n }", "function setMinMax(&$min, &$max) {\n if (is_int($min) && is_int($max)) {\n if ($min > $max) {\n $inputA = $min;\n $inputB = $max;\n $min = $inputB;\n $max = $inputA;\n }\n return \"Generating a number between \" . $min . \" and \" . $max . \":\";\n } else {\n return \"Input not recognized as whole numbers. <br> Number generated between 1 and 100.\";\n } \n}", "abstract protected function validateValue($value);", "public function sanitize($value);", "public function init() {\n\t\t$this->addRegex('/0[0-9]{10}/');\n\t}", "public function filter($value) {\n return \\Zend_Locale_Format::toNumber($value, $this->options);\n }", "public function filter($value)\n {\n if(!is_scalar($value)) {\n // Return non-scalar value unfiltered.\n return $value;\n }\n\n $value = (string)$value;\n\n if(strlen($value)==0) {\n // Return empty value unfiltered.\n return $value;\n }\n\n // First remove any non-digit character.\n $digits = preg_replace('#[^0-9]#', '', $value);\n\n $format = $this->options['format'];\n\n if($format == self::PHONE_FORMAT_INTL) {\n\n // Pad with zeros if count of digits is incorrect.\n $digits = str_pad($digits, 11, \"0\", STR_PAD_LEFT);\n\n // Add the braces, spacing and the dash.\n $phoneNumber = substr($digits, 0, 1) . ' ('. substr($digits, 1, 3) . ') ' .\n substr($digits, 4, 3) . '-'. substr($digits, 7, 4);\n } else { // self::PHONE_FORMAT_LOCAL\n // Pad with zeros if count of digits is incorrect.\n $digits = str_pad($digits, 7, \"0\", STR_PAD_LEFT);\n\n // Add the the dash.\n $phoneNumber = substr($digits, 0, 3) . '-'. substr($digits, 3, 4);\n }\n\n return $phoneNumber;\n }", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "function int_filter ($nama){\rif (is_numeric ($nama)){\rreturn (int)preg_replace ( '/\\D/i', '', $nama);\r}\relse {\r $nama = ltrim($nama, ';');\r $nama = explode (';', $nama);\r return (int)preg_replace ( '/\\D/i', '', $nama[0]);\r}\r}", "public static function invalidDistanceValue()\n {\n return new static('The distance value must be a numeric value.');\n }", "private function validate_input() {\n\t\t$fields = array_merge( array( $this->range_field ), $this->key_fields, $this->checksum_fields );\n\n\t\t$this->validate_fields( $fields );\n\t\t$this->validate_fields_against_table( $fields );\n\t}", "function sanitization() {\n genesis_add_option_filter( 'one_zero', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n genesis_add_option_filter( 'no_html', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n }", "private function init(): void\n {\n $this->value_signs = [\n '+' => 'plus',\n '-' => 'minus',\n ];\n\n // init number formatter\n $formatter = new NumberFormatter($this->getValueLocale(), NumberFormatter::SPELLOUT);\n\n // generate number value array with translated labels per locale\n for ($index = $this->getValueRange()[0]; $index <= $this->getValueRange()[1]; $index++) {\n $this->value_numbers[$index] = $formatter->format($index);\n }\n }", "function _erpal_contract_helper_cancelation_precalculate_range() {\n return variable_get('cancelation_precalculate_range', 500);\n}", "public function filter($value) {\n\t\t$value = preg_replace(\"/[^0-9]+/\", \"\", $value);\n\t\t\n\t\t// sformatowanie nipu na ogolny zapis XXX-XXX-XX-XX\n\t\t$value = preg_replace('/([0-9]{3})([0-9]{3})([0-9]{2})([0-9]{2})/i', '$1-$2-$3-$4', $value);\n return $value;\n }", "public function setNumberAttribute($input)\n {\n $this->attributes['number'] = $input ? $input : null;\n }", "function validate() {\n\t\t\n\t\tif(is_array($this->value)) { // If array\n\t\t\tforeach($this->value as $k => $value){\n\t\t\t\t$this->value[$k] = $this->validate_color_rgba($value);\n\t\t\t}//foreach\n\t\t} else { // not array\n\t\t\t$this->value = $this->validate_color_rgba($this->value);\n\t\t} // END array check\n\t\t\n\t}", "protected function prepareForValidation()\n {\n $merge = [];\n\n if ($this->valtotal) {\n $merge['valtotal'] = Format::strToFloat($this->valtotal);\n }\n\n $this->merge($merge);\n }", "public function validator()\n {\n\n return WhitelistedNumberValidator::class;\n }", "protected function clean() {\n if (isset($this->_value)) {\n $this->clearValue = floatval($this->_value);\n if ($this->clearValue === 0 && $this->_value !== 0) {\n $this->bTypeMissmatch = true;\n }\n } else {\n $this->clearValue = null;\n }\n \n return $this;\n }", "function filter_client_phone_option(){\n\n\t\t$this->get_numbers();\n\n\t\t$numbers = $this->options['phone_numbers']->get_value();\n\t\t// var_dump($numbers);\n\t\tforeach ( $numbers as $values ) {\n\t\t\tif ( isset( $values['filter_option'] ) && !empty( $values['filter_option'] ) && $values['filter_option'] != \"\" ){\n\t\t\t\t$number = $this->is_referral() ? $values['replacement_number'] : $values['default_number'];\n\t\t\t\t// var_dump( $this->is_referral() );\n\t\t\t\tadd_filter( 'option_' . $values['filter_option'], function($option) use ($number) { return $number; } );\n\t\t\t\t// var_dump($values);\n\t\t\t\t// echo 'option_' . $values['filter_option'] . \"<br>\";\n\t\t\t\t// echo get_option(\"client_phone\");\n\t\t\t\t// exit;\n\t\t\t}\n\t\t}\n\n\t}" ]
[ "0.5773597", "0.55941844", "0.55088323", "0.54564637", "0.54523873", "0.54519165", "0.5392221", "0.53614455", "0.5358085", "0.5339111", "0.52929157", "0.526351", "0.5247512", "0.52205044", "0.5209895", "0.51884323", "0.51872766", "0.51597834", "0.5156324", "0.5140664", "0.5110302", "0.51055217", "0.5102006", "0.5075436", "0.5056428", "0.5033149", "0.49938014", "0.49716955", "0.49662992", "0.49636847", "0.49558133", "0.4952427", "0.49488798", "0.49443537", "0.49397355", "0.49394208", "0.4936989", "0.4929188", "0.492127", "0.49105334", "0.49043941", "0.4900072", "0.48944423", "0.48852512", "0.48841897", "0.48838165", "0.48611277", "0.48510122", "0.4846515", "0.48398095", "0.48289192", "0.48166534", "0.4812736", "0.47965142", "0.4792022", "0.47896302", "0.4780285", "0.47779518", "0.47730753", "0.4771551", "0.4766203", "0.47661525", "0.4765548", "0.47551703", "0.4752362", "0.47520322", "0.47497746", "0.47318113", "0.47313493", "0.47273842", "0.47172892", "0.47033432", "0.47030523", "0.46997252", "0.46875417", "0.46598208", "0.46512637", "0.46428403", "0.46410742", "0.46377656", "0.46293086", "0.4619001", "0.46186692", "0.4618425", "0.46169588", "0.461688", "0.461688", "0.46160656", "0.46127746", "0.4612241", "0.46102333", "0.46086153", "0.46072596", "0.46047008", "0.46016935", "0.46001583", "0.45990035", "0.4598704", "0.4598424", "0.45958045" ]
0.5818396
0
Display a listing of the resource.
public function adminOrderIndex() { $orders = Order::with(['products', 'user'])->whereNotNull('paid_datetime')->latest()->get()->all(); return view('admin.orders.index', compact('orders')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Display the specified resource.
public function show(Order $order) { return view('user.orders.show', compact('order')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit(Order $order) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.7855196", "0.76957726", "0.7273917", "0.7241426", "0.71717227", "0.7064183", "0.70528984", "0.69836885", "0.694763", "0.69469565", "0.6941572", "0.69301945", "0.6903868", "0.68989486", "0.68989486", "0.68787694", "0.68641657", "0.6860115", "0.6857286", "0.68464494", "0.6834566", "0.68116575", "0.68075293", "0.6805924", "0.6801357", "0.6796291", "0.67915684", "0.67915684", "0.67874014", "0.678544", "0.67787844", "0.6777662", "0.67675763", "0.676299", "0.6746726", "0.6745706", "0.67450166", "0.67450166", "0.6739429", "0.6734577", "0.6725992", "0.67127997", "0.6694406", "0.6692487", "0.6689421", "0.66884303", "0.6687299", "0.6685663", "0.6682167", "0.66701853", "0.66697115", "0.6666091", "0.6666091", "0.66627705", "0.6661716", "0.6661522", "0.6657919", "0.6656454", "0.6653187", "0.6642113", "0.66332614", "0.66324973", "0.66275465", "0.66275465", "0.6619777", "0.6619387", "0.6617973", "0.66154003", "0.66110945", "0.6607966", "0.66065043", "0.6596376", "0.65953517", "0.65941286", "0.6591486", "0.6590759", "0.6588404", "0.658161", "0.6580548", "0.6579757", "0.6577171", "0.65761065", "0.657386", "0.65686774", "0.6567784", "0.65672046", "0.6566417", "0.65615803", "0.65615714", "0.65615714", "0.65592474", "0.65586483", "0.65568006", "0.6556628", "0.65564895", "0.6555322", "0.65551996", "0.6555016", "0.654888", "0.65477645", "0.65451735" ]
0.0
-1
Update the specified resource in storage.
public function updateQuantity(Request $request, Order $order, Product $product) { $validatedData = $request->validate([ 'quantity' => 'required|min:1|integer', 'product_id' => 'required|min:1|integer', ]); $order->products()->find($product->id)->pivot->update(['quantity' => intval($validatedData['quantity'])]); return redirect(route('cart.index')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Order $order) { $order->delete(); return redirect()->back()->with(['success' => 'سفارش ' . $order->pay_code . ' با موفقیت حذف شد!']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Skupljamo vrednosti iz url ono sto ukucamo
public function parseUrl(){ $url =isset( $_GET ['url']) ? $_GET['url']: null; $url =explode('/',$url); //print_r($url); //Ako ne ukucamo nista tada pozovi automatski Index controller i metodu index if(empty($url[0])){ require 'controllers/index.php'; $controller = new Index(); $controller ->index(); //da bi se kod prekinuo return false; } //Controller moramo fizički da pozovemo $file = 'controllers/'.$url[0].'.php'; //Da li ovaj fajl postoji, ako postoji uključi ga fizički if(file_exists($file)) { require $file; } else { // echo 'Ovaj fajl ne postoji'; $this->error(); return false; } $controller = new $url[0](); //Proveravamo da li postoji metoda i parametar //Ako je postavljen parametar proveri da li ima metode i postavi metodu sa parametrom if(isset($url[2])){ if(method_exists($controller,$url[1])){ $controller -> {$url[1]}($url[2]); }else { //echo 'Ova stranica ne postoji'; $this->error(); } } else{ //Ako nije postavljen parametar proveravamo da li je postavljena metoda if(isset($url[1])){ //Proveravamo da li metoda postoji u okviru naseg controllera if(method_exists($controller,$url[1])){ $controller->{$url[1]}(); }else { // echo 'Ova stranica ne postoji'; $this->error(); } }else { //Ukoliko ne postoji ni metoda pozivati defaul metodu a to je index $controller->index(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function url();", "public function url();", "public function url();", "abstract public function getUrl();", "public function get_url();", "public function getURL ();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getURL();", "public function getURL();", "public function url(): string;", "function getUrl();", "abstract public function get_url_update();", "function modificar_url($url) {\n\t\t$find = array(' ');\n\t\t$repl = array('-');\n\t\t$url = str_replace ($find, $repl, $url);\n\t\t$find = array('á', 'é', 'í', 'ó', 'ú', 'ñ');\n\t\t$repl = array('a', 'e', 'i', 'o', 'u', 'n');\n\t\t$url = str_replace ($find, $repl, utf8_encode($url));\n\t\t//utf8_decode();\n\t\t// Añaadimos los guiones\n\t\t$find = array(' ', '&', '\\r\\n', '\\n', '+');\n\t\t$url = str_replace ($find, '-', $url);\n\t\t\n\t\t// Eliminamos y Reemplazamos demás caracteres especiales\n\t\t$find = array('/[^A-Za-z0-9\\-<>\\_]/', '/[\\-]+/', '/<[^>]*>/');\n\t\t$repl = array('', '_', '');\n\t\t$url = preg_replace ($find, $repl, $url);\n\t\tucwords($url);\n\t\n\treturn $url;\n\t}", "function decoupe_url($t) {\n//\treturn($t);\n\t$z = strrpos($t, '/');\n\tif ($z != '') {\n\t\t$t = substr($t, $z+1, strlen($t));\n\t\t// RECHERCHE DU DERNIER ?\n\t\t$z = strrpos($t, '?');\n\t\tif ($z != '') {\n\t\t\treturn(substr($t, 0,$z));\n\t\t} else {\n\t\t\treturn($t);\n\t\t}\n\t} else {\n\t\treturn($t);\n\t}\n}", "function modificar_url($url) {\n $find = array(' ');\n $repl = array('-');\n $url = str_replace ($find, $repl, $url);\n\n $find = array('á', 'é', 'í', 'ó', 'ú', 'ñ');\n $repl = array('a', 'e', 'i', 'o', 'u', 'n');\n $url = str_replace ($find, $repl, utf8_encode($url));\n\n $find = array('0', '1', '2', '3', '4', '5','6', '7', '8', '9');\n $repl = array('zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine');\n $url = str_replace ($find, $repl, utf8_encode($url));\n //utf8_decode();\n // Añaadimos los guiones\n $find = array(' ', '&', '\\r\\n', '\\n', '+');\n $url = str_replace ($find, '-', $url);\n\n // Eliminamos y Reemplazamos demás caracteres especiales\n $find = array('/[^A-Za-z0-9\\-<>\\_]/', '/[\\-]+/', '/<[^>]*>/');\n $repl = array('', '_', '');\n $url = preg_replace ($find, $repl, $url);\n $url= strtolower($url);\n //ucwords($url);\n\n return $url;\n }", "public abstract function getURL();", "function get_url()\n {\n }", "function skarla_url($url)\n{\n return url(\"skarla/{$url}\");\n}", "public function get_url()\n {\n }", "function skarla_url($url) {\n return url(\"skarla/{$url}\");\n}", "public function getUrl(): string;", "public function getUrl(): string;", "public function getUrl(): string;", "public function test(){\n\t $url = urls('content/show','id=96');\n\t echo \"<a href='$url'>$url</a>\";\n\t}", "function maps_actual_url($url, $uriapp = NULL){\n //Elimino el primer caracter si es igual a \"/\"\n if(substr($url, 0, 1) == \"/\"){\n $url= substr($url, 1);\n } \n //Separa la url pasada y la uri en partes para poder analizarlas\n $partes_url= explode(\"/\", $url);\n \n //Saco de la uri actual los parametros\n $uri_explode= explode(\"?\", URIAPP);\n if($uriapp != NULL){\n $uri_explode= explode(\"?\", $uriapp);\n }\n $uri_front= $uri_explode[0];\n //Separo la uri actual\n $partes_uri_actual= explode(\"/\", $uri_front); \n $mapea= TRUE; \n //Analiza que url-uri tiene mas elementos\n if(count($partes_url) >= count($partes_uri_actual)){\n //Si el tamano de la url es igual o mayor que la uri actual uso el for recorriendo las partes de la url\n $count_partes_uri= count($partes_url);\n for($i= 0; $i < $count_partes_uri; $i++) {\n if(count($partes_uri_actual) >= ($i + 1)){\n //Si hay un * no me importa que viene despues, mapea todo, no deberia haber nada despues\n if($partes_url[$i] != \"*\"){\n $pos_ocurrencia= strpos($partes_url[$i], \"*\");\n if($pos_ocurrencia != FALSE){\n $parte_url= explode(\"*\", $partes_url[$i]);\n $parte_url= $parte_url[0];\n if(strlen($partes_uri_actual[$i]) >= strlen($parte_url)){\n $parte_uri_actual= substr($partes_uri_actual[$i], 0, strlen($parte_url));\n if($parte_url == $parte_uri_actual){\n break;\n }\n else{\n $mapea= FALSE;\n break;\n }\n }\n else{\n $mapea= FALSE;\n break;\n }\n }\n //Si alguna esta vacia no compara el mapeo con () y voy directo a la comparacion\n if(empty($partes_url[$i]) || empty($partes_uri_actual[$i])){\n //Si no coinciden las partes no mapean\n if($partes_url[$i] != $partes_uri_actual[$i]){\n $mapea= FALSE;\n break;\n }\n }\n else{\n //Si la parte de la uri empieza con ( y termina con ) puede ir cualquier string ahi por lo que pasa directamente esta parte de la validacion\n if(! ($partes_url[$i]{0} == \"(\" and $partes_url[$i]{strlen($partes_url[$i]) -1} == \")\")){\n //Si no contiene ( y ) debe mapear\n //Si no coinciden las partes no mapean\n if($partes_url[$i] != $partes_uri_actual[$i]){\n $mapea= FALSE;\n break;\n }\n }\n }\n }\n else{\n break;\n }\n }\n else{\n //La uri actual no tiene mas partes y no hay coincidencia completa\n $mapea= FALSE;\n break;\n }\n } \n }\n else{\n //Si el tamano de la url pasada es menor que la uri uso el for recorriendo las partes de la uri\n $count_partes_uri_actual= count($partes_uri_actual);\n for($i= 0; $i < $count_partes_uri_actual; $i++){\n if(count($partes_url) >= ($i + 1)){ \n //Si hay un * no me importa que viene despues, mapea todo, no deberia haber nada despues\n if($partes_url[$i] != \"*\"){\n $pos_ocurrencia= strpos($partes_url[$i], \"*\");\n if($pos_ocurrencia != FALSE){\n $parte_url= explode(\"*\", $partes_url[$i]);\n $parte_url= $parte_url[0];\n if(strlen($partes_uri_actual[$i]) >= strlen($parte_url)){\n $parte_uri_actual= substr($partes_uri_actual[$i], 0, strlen($parte_url));\n if($parte_url == $parte_uri_actual){\n break;\n }\n else{\n $mapea= FALSE;\n break;\n }\n }\n else{\n $mapea= FALSE;\n break;\n }\n }\n //Si alguna esta vacia no compara el mapeo con () y voy directo a la comparacion\n if(empty($partes_url[$i]) || empty($partes_uri_actual[$i])){\n //Si no coinciden las partes no mapean\n if($partes_url[$i] != $partes_uri_actual[$i]){\n $mapea= FALSE;\n break;\n }\n }\n else{\n //Si la parte de la uri empieza con ( y termina con ) puede ir cualquier string ahi por lo que pasa directamente esta parte de la validacion\n if(! ($partes_url[$i]{0} == \"(\" and $partes_url[$i]{strlen($partes_url[$i]) -1} == \")\")){\n //Si no contiene ( y ) debe mapear \n //Si no coinciden las partes no mapean\n if($partes_url[$i] != $partes_uri_actual[$i]){\n $mapea= FALSE;\n break;\n }\n }\n }\n }\n else{\n break;\n }\n }\n else{\n //La url pasada no tiene mas partes y no hay coincidencia completa\n $mapea= FALSE;\n break;\n }\n }\n } \n return $mapea;\n }", "function fct_decode_lien_url ($urlpage) {\nglobal $url_parlante;\n\t// recupere ligne de produits et criteres (separes par _)\n\t$pos = strpos($urlpage, \"_\");\n\tif ($pos === false) {\n\t\t$gauche = $urlpage;\n\t} else {\n\t\t$gauche= substr($urlpage,0,$pos);\n\t\t$droite = substr($urlpage,$pos+1);\n\t\tif (substr($droite,-5) == \".html\") $droite = substr($droite,0,-5);\n\t}\n\t// remplace libelles criteres par ref et code critere (ex: tho = 00801)\n\tif (isset($droite)) {\n\t\t$paramd = explode(\"_\", $droite);\n\t\tforeach ($paramd as $libelle) {\t\n//echo \"url\";print_r($libelle);\n\n\t\t\t$code_paire = array_search($libelle, $url_parlante);\n//echo \"code $code_paire - \";\n\t\t\tif ($code_paire === false) $code_paire = $libelle;\n\t\t\t$pos = strpos($code_paire,\"~\"); \n\t\t\t$couple = explode(\"~\",$code_paire);\n\t\t\t$_GET[$couple[0]] = $couple[1]; \n\t\t}\n\t}\n}", "function url($url){\n $url=ereg_replace(\"[&?]+$\", \"\", $url);\n \n $url .= ( strpos($url, \"?\") != false ? \"&\" : \"?\" ).urlencode($this->name).\"=\".$this->id;\n \n return $url;\n }", "private function _url($par = array()) {\n\t\t$get = $_GET;\n\t\t\n\t\tforeach ((array) $par AS $key => $val) { //overide value\n\t\t\tif ($key == 'path') //if path, encode\n\t\t\t\t$get['path'] = \\Crypt::encrypt($val);\n\t\t\telse\n\t\t\t\t$get[$key] = $val;\n\t\t}\n\t\t\n\t\t$url = '//';\n\t\t\n\t\t$url .= $this->_sanitize(g($_SERVER, 'HTTP_HOST').'/'.strtok(g($_SERVER, 'REQUEST_URI'), '?'));\n\t\t\n\t\treturn $url.'?'.http_build_query($get);\n\t}", "private function _getUrl()\n {\n // Explode url to the array Variabels (url)\n $url = isset($_GET['url']) ? $_GET['url'] : null;;\n $url = rtrim($url, '/');\n $url = filter_var($url,FILTER_SANITIZE_URL);\n $this->_url = explode('/', $url);\n }", "protected function getUrl(){\n\n\t\t//retornando a url aonde o usuario está\n\t\treturn parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n\n\t}", "function url_para($pagina){\n return vazio($pagina) ? URL : URL.\"index.php/\".$pagina;\n }", "function url($id)\r\n\t{\r\n\t\treturn '';\r\n\t}", "function get_url($index = '')\n{\n /**\n * $_GET['url'] merupakan URL atau pretty url yang di set\n * atau dirapikan pada file .htaccess, jadi penulisannya yang di set\n * menggunakan htaccess adalah index.php?url=xyz sebagai default\n * maka dari itu bisa memanggil $_get['url']\n */\n if (isset($_GET['url'])) {\n /**\n * Merapikan url menggukan method rtrim untuk menhapus / dibagian akhir url\n * \tmengamankan url dari variabel aneh dengan method Filter_var \n * memecar URL menjadi array dengan method explode setiap bertemu string atau karakter /\n */ \n $url = rtrim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n\n if ($index !== '') {\n return $url[$index];\n } else {\n return $url;\n }\n }else{\n \n $url = trim($_SERVER[\"REQUEST_URI\"], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n\n if ($index !== '') {\n return $url[$index];\n unset($url[0]);\n } else {\n return $url;\n }\n }\n}", "public function urlUret3(){\n //generateUrl de olan name php bin/console debug:router ile bulduk\n //page den sonra olan kisimlari ekleyerek ne aradimizi netlestirmis olduk\n // 3. parametre olarak \"UrlGeneratorInterface\" bize verecegi URL turunu belirleyebiliyoruz\n $url=$this->generateUrl(\"post_listeleme_yeni\",[\n 'page'=>'99',\n ]);\n\n\n $fullurl=$this->generateUrl(\"post_listeleme_yeni\",[\n 'page'=>'99',\n 'category'=>'health',\n 'age'=>25,\n 'height'=>170\n ],UrlGeneratorInterface::RELATIVE_PATH);\n\n\n return new JsonResponse([\"Generate URL\"=>$url , \"Full URL: \"=> $fullurl]);\n }", "function ruta($url){\n\t$host = $_SERVER['HTTP_HOST'];\n\t$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\\\');\n\t$extra = $url;\n\n\t$tipo = 'http';\n\tif (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {\n \t$tipo = 'https';\n\t}\n\n\treturn $tipo . \"://\" . $host . $uri . \"/\" . $url; \n}", "private function _getUrl()\n\t{\n\t\t$url = isset($_GET['url']) ? $_GET['url'] : null;\n\t\t$url = rtrim($url, '/');\n\t\t$url = filter_var($url, FILTER_SANITIZE_URL);\n\t\t$this->_url = explode('/', $url);\n\t}", "private function _getUrl()\n\t{\n\t\t$url = isset($_GET['url']) ? $_GET['url'] : null;\n\t\t$url = rtrim($url, '/');\n\t\t$url = filter_var($url, FILTER_SANITIZE_URL);\n\t\t$this->_url = explode('/', $url);\n\t}", "public function parseURL()\n {\n if (isset($_GET['url'])) {\n $url = rtrim($_GET['url'], '/'); //menghapus tanda / di akhir url\n $url = filter_var($url, FILTER_SANITIZE_URL);//memfilter url dari karakter aneh (hack)\n $url = explode('/', $url); //memecah url yang diinput dengan delimiter / dan menjadikannya array\n return $url;\n }\n }", "abstract public function url($manipulation_name = '');", "function validarEstudiante($url=null){\n echo $url[0];\n }", "abstract public function get_url_read();", "public function getUrl() {\r\n\t}", "public function siteUrl() {}", "private static function loadUrl(){\n\n $uri = $_SERVER['REQUEST_URI'];\n\n if (ENCRYPTURL == '1')\n $uri = CR::decrypt($uri);\n\n BASEDIR == '/' || $uri = str_replace(BASEDIR,'', $uri);\n $uri = explode('/', $uri);\n\n array_walk($uri, function(&$item){\n strpos($item, '?') == false ||\n $item = substr($item, 0, strpos($item, '?'));\n });\n\n return $uri;\n }", "function get_url_nav_bo($Rub) \r\n{\t\r\n\t$StrSQL = \"\r\n\t\t SELECT\r\n _nav.url_page\r\n\t\t FROM\r\n \t\t\t_nav\r\n\t \tWHERE\r\n\t\t\t\t\t\t\t_nav.id__nav=\".$Rub;\r\n\r\n\t$Rst = mysql_query($StrSQL);\r\n\t$url = mysql_result($Rst, 0, 0);\r\n\t\r\n\tif (!$url) $url = _URL_PAGE_PAR_DEFAUT;\r\n\t\r\n\t// on ajoute le Rub a la fin ssi si il n'est pas déja positionné dans url_nav (redirection d'une\r\n\t// rub vers une autre), et si ce n'est pas un lien externe\r\n\tif ( (!eregi(\"rub\",$url)) && (!eregi(\"http\",$url)) )\r\n\t{\r\n\t if (!eregi(\"\\?\",$url)) {\r\n\t \t\t$url .= \"?Rub=\".$Rub;\r\n\t } else {\r\n\t \t $url .= \"&Rub=\".$Rub;\r\n\t }\r\n\t}\r\n\r\n\treturn ($url);\t\r\n}", "private function verificaShortUrl() {\n FormataLink::verificaMiniUrl(\"fwk_link_encurtado\");\n }", "private function getUrl()\n {\n //echo $_GET['url'];\n if(isset($_GET['url']))\n {\n $url=rtrim($_GET['url'],'/');\n $url=filter_var($url,FILTER_SANITIZE_URL);\n $url=explode('/',$url);\n return $url;\n }\n }", "function vUrl( $url )\r\n\t\t{\r\n\t\t return filter_var( $url, FILTER_VALIDATE_URL );\r\n\t\t \r\n\t\t}", "private function setUrl(): void\n {\n $completeUrl = $_SERVER['REQUEST_URI'];\n $explodedUrl = \\explode('?', $completeUrl);\n $this->url = trim($explodedUrl[0], '/'); // Cleaned URL\n }", "function url ($link) {\r\n\treturn $link;\r\n}", "public function getUrl($name);", "function urls_geodiv_dist($i, $entite, $args='', $ancre='') {\n\t$contexte = $GLOBALS['contexte']; // recuperer aussi les &debut_xx\n\n\tif (is_numeric($i))\n\t\treturn _generer_url_geodiv($entite, $i, $args, $ancre);\n\n\t// traiter les injections du type domaine.org/spip.php/cestnimportequoi/ou/encore/plus/rubrique23\n\tif ($GLOBALS['profondeur_url']>0 AND $entite=='sommaire'){\n\t\treturn array(array(),'404');\n\t}\n\t$url = $i;\n\n\t// Decoder l'url html, page ou standard\n\t$objets = 'article|breve|rubrique|mot|auteur|site|syndic|media|cat|tag|collection|album';\n\tif (preg_match(\n\t',^(?:[^?]*/)?('.$objets.')([0-9]+)(?:\\.html)?([?&].*)?$,', $url, $regs)\n\tOR preg_match(\n\t',^(?:[^?]*/)?('.$objets.')\\.php3?[?]id_\\1=([0-9]+)([?&].*)?$,', $url, $regs)\n\tOR preg_match(\n\t',^(?:[^?]*/)?(?:spip[.]php)?[?]('.$objets.')([0-9]+)(&.*)?$,', $url, $regs)) {\n\t\tswitch ($regs[1]){\n\t\t\tcase 'media':\n\t\t\t\t$regs[1] = 'article';\n\t\t\t\tbreak;\n\t\t\tcase 'cat':\n\t\t\t\t$regs[1] = 'rubrique';\n\t\t\t\tbreak;\n\t\t\tcase 'tag':\n\t\t\t\t$regs[1] = 'mot';\n\t\t\t\tbreak;\n\t\t\tcase 'album':\n\t\t\t\t$regs[1] = 'collection';\n\t\t\t\tbreak;\n\t\t}\n\t\t$type = preg_replace(',s$,', '', table_objet($regs[1]));\n\t\t$_id = id_table_objet($regs[1]);\n\t\t$id_objet = $regs[2];\n\t\t$suite = $regs[3];\n\t\t$contexte[$_id] = $id_objet;\n\t\tif ($type == 'syndic') $type = 'site';\n\t\treturn array($contexte, $type, null, $type);\n\t}\n\n}", "public function getAproposUrl(){\n // return \"chanson.php/\".$id; \n return $this->rootUrl().\"apropos\"; \n }", "function url( $url ) {\n\t\treturn $this->path( $url, true );\n\t}", "function turl_ffull_url()\n{\n\t//$GLOBALS[\"content\"].=$_SERVER[\"SERVER_PORT\"];\n\t\n\tif ($_SERVER[\"SERVER_PORT\"]==443)\n\t{\n\t\t$full_url=\"https://\".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];\n\t}\n\telse\n\t{\n\t\t//$full_url=\"http://\".$_SERVER['HTTP_HOST'].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER['REQUEST_URI'];\n\t\t$full_url=\"http://\".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];\n\t}\n\t\n\t//$GLOBALS[\"content\"].=$full_url;\n\t\n\tpj_deb_flog3(__LINE__, __FILE__, $full_url, \"tuti\");\n\t\n\treturn $full_url;\n}", "function pobierz_urle_uzyt($nazwa_uz) {\r\n // pobranie z bazy danych wszystkich URL-i danego u�ytkownika\r\n $lacz = lacz_bd();\r\n $wynik = $lacz->query(\"select URL_zak\r\n from zakladka\r\n where nazwa_uz = '\".$nazwa_uz.\"'\");\r\n if (!$wynik) {\r\n return false;\r\n }\r\n\r\n // tworzenie tablicy URL-i\r\n $tablica_url = array();\r\n for ($licznik = 0; $rzad = $wynik->fetch_row(); ++$licznik) {\r\n $tablica_url[$licznik] = $rzad[0];\r\n }\r\n return $tablica_url;\r\n}", "private function _getURL()\n {\n\n $url = $this->_ect . '?';\n foreach ($this as $name => $var) {\n if ($name == 'ect') {\n continue;\n }\n $url .= \"$name=$var&\";\n }\n\n $this->url = $url;\n\n return $this->url;\n }", "function _url($path){\n echo getFullUrl($path);\n}", "private static function generateUrlPrams(){\n\t\t$url = [] ;\n\t\tif ( isset($_GET['urlFromHtaccess']) ){\n\t\t\t$url = explode('/' , trim($_GET['urlFromHtaccess']) );\n\t\t}\n\t\tself::$url = $url ;\n\t}", "private function _getUrl()\r\n {\r\n $url = filter_input(INPUT_GET, 'url');\r\n $url = rtrim($url, '/');\r\n $url = filter_var($url,FILTER_SANITIZE_URL);\r\n $this->_url = explode('/', $url);\r\n }", "function url($url, $mode) {\n\tglobal $gfe_url, $nice_url, $root_filename, $sort_by, $sort_order;\n\t$temp_url = '';\n\t$temp_url_nice = '';\n\t$GET_sortby = trim($_GET['by']);\n\t$GET_sortorder = trim($_GET['order']);\n\t$url = urldecode($url);\n\t$url = urlencode($url);\n\t$url = str_replace('%2F', '/', $url);\n\tswitch($mode) {\n\t\tcase 'dir':\n\t\t\tif($url == 'home') {\n\t\t\t\t$temp_url = $gfe_url.'/'.$root_filename;\n\t\t\t\t$temp_url_nice = $gfe_url.'/';\n\t\t\t} else {\n\t\t\t\t$temp_url = \"$gfe_url/$root_filename?dir=$url\";\n\t\t\t\t$temp_url_nice = \"$gfe_url/browse/$url/\";\n\t\t\t}\n\t\t\tif(!empty($GET_sortby)) {\n\t\t\t\tif(strpos($temp_url, '?') === false) {\n\t\t\t\t\t$temp_url .= \"?by=$sort_by&amp;order=$GET_sortorder\";\n\t\t\t\t} else {\n\t\t\t\t\t$temp_url .= \"&amp;by=$sort_by&amp;order=$GET_sortorder\";\n\t\t\t\t}\n\t\t\t\t$temp_url_nice .= \"sortby/$sort_by/sortorder/$GET_sortorder/\";\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'file':\n\t\t\t$temp_url = \"$gfe_url/view.php?file=$url\";\n\t\t\t$temp_url_nice = \"$gfe_url/viewing/$url/\";\n\t\t\tbreak;\n\t\tcase 'download';\n\t\t\t$temp_url = \"$gfe_url/view.php?file=$url&amp;dl=1\";\n\t\t\t$temp_url_nice = \"$gfe_url/download/$url/\";\n\t\t\tbreak;\n\t}\n\tif($nice_url) {\n\t\treturn $temp_url_nice;\n\t} else {\n\t\treturn $temp_url;\n\t}\n}", "public function testDemoteAutomatchUrlUsingGET()\n {\n }", "function url_check($str)\n{\n //En caso de ser una edición, la URI contiene el id\n $update_id = $this->uri->segment(3);\n\n //variable que se va a usar en un while\n $isnotok = true;\n\n //Convertir los caracteres acentuados a texto pleno\n $this->load->helper('text');\n $str = convert_accented_characters($str);\n \n //Se pasa todo a minuscula por las dudas\n $str = strtolower($str);\n \n //Se quita cualquier simbolo que no se admita en la url (son una bocha lpm)\n $symbols = array('º' => '', 'ª' => '', '!' => '', '|' => '', '@' => '', '·' => '', '¡' => '', \n '/' => '', '?' => '', '¿' => '', '[' => '', ']' => '', '{' => '', '}' => '', \n '^' => '', '¨' => '', 'ç' => '', 'Ç' => '', '*' => '', 'ñ' => 'n', '\"' => '', \n '$' => '', '%' => '', '#' => '', '&' => '', '=' => '', '(' => '', ')' => '', \n \"'\" => '', '¬' => '', '+' => '', '\\\\' => '');\n $str = strtr($str, $symbols);\n \n //Si la url solo tenía alguno de esos simbolos, va a quedar completamente vacía. Para que esto no ocurra se agrega una 'a'\n if($str == ''){$str = 'a';}\n\n //Mientras se siga repitiendo la url, no se va a cambiar el while\n while($isnotok){\n if(is_numeric($update_id))\n {\n //Si update_id pasa el if, significa que es una edición del item. La query que se utiliza entonces es mas larga\n //Porque si se deja la url tal cual está en un item que está siendo modificado el filtro va a interpretar que\n //Se está queriendo ingresar una nueva url cuando en realidad es la misma en el mismo item\n $query = $this->_custom_query('select * from blog where url=\"'.$str.'\" and id!='.$update_id);\n }\n else\n {\n //Si no hay update_id singfica que se está creando un nuevo producto por lo que se debe buscar en todos los demás la coincidencia de url\n $query = $this->get_where_custom('url', $str);\n }\n \n //Solo nos interesa saber si la query devuelve rows, si es mayor a 0, se encontró coincidencia, no hace falta nada mas\n $num_rows = $query->num_rows();\n \n //De haber coincidencia, a la url se le agrega un \"copy\"\n if($num_rows>0)\n {\n $str .= 'copy';\n }\n else\n {\n $isnotok = false;\n }\n }\n \n return $str;\n}", "public function ___httpUrl() {\n\t\t$page = $this->pagefiles->getPage();\n\t\t$url = substr($page->httpUrl(), 0, -1 * strlen($page->url())); \n\t\treturn $url . $this->url(); \n\t}", "public function onBeforeGet($url){}", "function jc_url() {\n\n}", "public function testGetURL()\n {\n $pagSeguroController = new PagSeguroController();\n\n $url = $pagSeguroController->getURL('/teste');\n\n if($pagSeguroController::MODE == 'development') {\n $this->assertEquals('https://ws.sandbox.pagseguro.uol.com.br/teste', $url);\n } else {\n $this->assertEquals('https://ws.pagseguro.uol.com.br/', $url);\n }\n }", "protected function url()\n\t{\n\t\treturn Phpfox::getLib('url');\t\n\t}", "function __urls_amigables($url) {\n $url = strtolower($url);\n \n //Rememplazamos caracteres especiales latinos\n $find = array('�', '�', '�', '�', '�', '�');\n $repl = array('a', 'e', 'i', 'o', 'u', 'n');\n $url = str_replace ($find, $repl, $url);\n \n // A�aadimos los guiones\n $find = array(' ', '&', '\\r\\n', '\\n', '+');\n $url = str_replace ($find, '-', $url);\n \n // Eliminamos y Reemplazamos dem�s caracteres especiales\n $find = array('/[^a-z0-9\\-<>]/', '/[\\-]+/', '/<[^>]*>/');\n $repl = array('', '-', '');\n $url = preg_replace ($find, $repl, $url);\n return $url;\n }", "public function testUrl() {\n $this->assertEquals('http://domain.com?key=ber', Sanitize::url('http://domain.com?key=Über'));\n $this->assertEquals('http%3A%2F%2Fdomain.com%3Fkey%3D%C3%9Cber', Sanitize::url(urlencode('http://domain.com?key=Über')));\n }", "function getContentUrl($url){\n return $url[1];\n\t}", "public function getUrl(){\n $urls = [];\n $url_rules = [];\n //Получаем массив URL из таблицы Sef\n $pages = PagesHelper::select(Yii::$app->params['pages'],[],[['attr_name' => 'is_active', 'operand'=> '=', 'value'=> '1'],\n ['attr_name' => 'show_sitemap', 'operand'=> '=', 'value'=> '1']]);\n\n //'shini_legko/all_sizes/R-<radius:\\d+>' => 'shini/radius',//все товары с выбраным радиусом\n $SQL = 'SELECT radius FROM tyres_radius WHERE is_passenger = 1';\n $tyres_radius = Yii::$app->db->createCommand($SQL)->queryColumn();\n foreach ($tyres_radius AS $tr){\n $tr = str_replace('.00','',(string)$tr);\n $url_rules[] = Url::to(['shini/radius', 'radius'=>$tr]);\n }\n unset($tyres_radius);\n\n //'shini_legko/all_sizes/R-<radius:\\d+>/<width:\\d+>-<profile:\\d+>' =>\n // 'shini/size',//все товары с выбраным размером\n $SQL = 'SELECT size_width, size_profile, radius\n FROM tyres_sizes \n JOIN tyres_radius ON tyres_radius.id = tyres_sizes.id_radius\n WHERE tyres_radius.is_passenger = 1';\n $tyres_sizes = Yii::$app->db->createCommand($SQL)->queryAll();\n foreach ($tyres_sizes AS $ts){\n $url_rules[] = Url::to(['shini/size',\n 'radius'=>str_replace('.00','',(string)$ts['radius']),\n 'width'=>$ts['size_width'],\n 'profile'=>str_replace('.00','',(string)$ts['size_profile'])]);\n }\n unset($tyres_sizes);\n\n //'shini_legko/producers/<alias:\\S+>' => 'shini/producer',//все шины одного производителя\n //'shini_gruz/producers/<alias:\\S+>' => 'shini/gruz_producer',//все шины одного производителя\n $SQL = 'SELECT alias, is_truck, is_passenger FROM tyres_vendors';\n $tyres_vendors = Yii::$app->db->createCommand($SQL)->queryAll();\n foreach ($tyres_vendors AS $tyres_vendor){\n if($tyres_vendor['is_passenger'])\n $url_rules[] =\n Url::to(['shini/producer',\n 'alias'=>$tyres_vendor['alias']]);\n if($tyres_vendor['is_truck'])\n $url_rules[] =\n Url::to(['shini/gruz_producer',\n 'alias'=>$tyres_vendor['alias']]);\n\n }\n unset($tyres_vendors);\n\n //'shini_legko/producers/<vendor:\\S+>/<model:\\S+>' => 'shini/model_tyre',//модель шины\n //'shini_gruz/producers/<vendor:\\S+>/<model:\\S+>' => 'shini/gruz_model_tyre',//модель шины\n $SQL = 'SELECT type, tyres_models.alias, tyres_vendors.alias AS vendor_alias FROM tyres_models\n JOIN tyres_vendors ON tyres_vendors.id_vendor = tyres_models.id_vendor';\n $tyres_models = Yii::$app->db->createCommand($SQL)->queryAll();\n foreach ($tyres_models AS $tyres_model){\n if($tyres_model['type'] < 6)\n $url_rules[] =\n Url::to(['shini/model_tyre',\n 'vendor'=>$tyres_model['vendor_alias'],\n 'model'=>$tyres_model['alias']]);\n else\n $url_rules[] =\n Url::to(['shini/gruz_model_tyre',\n 'vendor'=>$tyres_model['vendor_alias'],\n 'model'=>$tyres_model['alias']]);\n }\n unset($tyres_models);\n\n //'shini_legko/producers/<vendor:\\S+>/<model:\\S+>/<id:\\d+>' => 'shini/tyre',//шина\n //'shini_gruz/producers/<vendor:\\S+>/<model:\\S+>/<id:\\d+>' => 'shini/gruz_tyre',//шина\n $SQL = 'SELECT type, tyres_models.alias AS model_alias, tyres_vendors.alias AS vendor_alias, id_size \n FROM tyres_model_sizes\n JOIN tyres_models ON tyres_models.id_model = tyres_model_sizes.id_model\n JOIN tyres_vendors ON tyres_vendors.id_vendor = tyres_models.id_vendor\n WHERE tyres_model_sizes.price > 0';\n $tyres_model_sizes = Yii::$app->db->createCommand($SQL)->queryAll();\n foreach ($tyres_model_sizes AS $tyres_model_size){\n if($tyres_model_size['type'] < 6)\n $url_rules[] =\n Url::to(['shini/tyre',\n 'vendor'=>$tyres_model_size['vendor_alias'],\n 'model'=>$tyres_model_size['model_alias'],\n 'id'=>$tyres_model_size['id_size']]);\n else\n $url_rules[] =\n Url::to(['shini/gruz_tyre',\n 'vendor'=>$tyres_model_size['vendor_alias'],\n 'model'=>$tyres_model_size['model_alias'],\n 'id'=>$tyres_model_size['id_size']]);\n }\n unset($tyres_model_sizes);\n\n //'shini_legko/vendors_auto/<alias:\\S+>' => 'shini/vendor_auto', //все модели текущей марки авто\n //'wheels/vendors_auto/<alias:\\S+>'=> 'wheels/vendor_auto', //все модели текущей марки авто\n $SQL = 'SELECT alias FROM vehicles_vendors';\n $vehicles_vendors = Yii::$app->db->createCommand($SQL)->queryColumn();\n foreach ($vehicles_vendors AS $vehicles_vendor){\n $url_rules[] =\n Url::to(['shini/vendor_auto',\n 'alias'=>$vehicles_vendor,]);\n $url_rules[] =\n Url::to(['wheels/vendor_auto',\n 'alias'=>$vehicles_vendor,]);\n }\n unset($vehicles_vendors);\n\n //'wheels/R-<radius:\\d+>' => 'wheels/radius',//все товары с выбраным радиусом\n $SQL = 'SELECT radius FROM wheels_radius WHERE is_passenger = 1';\n $wheels_radius = Yii::$app->db->createCommand($SQL)->queryColumn();\n foreach ($wheels_radius AS $wr){\n $url_rules[] = Url::to(['wheels/radius', 'radius'=>$wr]);\n }\n unset($wheels_radius);\n\n //'wheels/producers/<alias:\\S+>' => 'wheels/producer',//все диски одного производителя\n //'wheels_gruz/producers/<alias:\\S+>' => 'wheels/gruz_producer',//все диски одного производителя\n $SQL = 'SELECT alias, is_truck, is_passenger FROM wheels_vendors';\n $wheels_vendors = Yii::$app->db->createCommand($SQL)->queryAll();\n foreach ($wheels_vendors AS $wheels_vendor){\n if($wheels_vendor['is_passenger'])\n $url_rules[] =\n Url::to(['wheels/producer',\n 'alias'=>$wheels_vendor['alias']]);\n if($wheels_vendor['is_truck'])\n $url_rules[] =\n Url::to(['wheels/gruz_producer',\n 'alias'=>$wheels_vendor['alias']]);\n }\n unset($wheels_vendors);\n\n //'wheels/producers/<vendor:\\S+>/<model:\\S+>' => 'wheels/model_wheel',//модель диска\n //'wheels_gruz/producers/<vendor:\\S+>/<model:\\S+>' => 'wheels/gruz_model_wheel',//модель диска\n $SQL = 'SELECT type, wheels_models.model_alias, wheels_vendors.alias AS vendor_alias FROM wheels_models\n JOIN wheels_vendors ON wheels_vendors.id_vendor = wheels_models.id_vendor';\n $wheels_models = Yii::$app->db->createCommand($SQL)->queryAll();\n foreach ($wheels_models AS $wheels_model){\n if($wheels_model['type'] != 2)\n $url_rules[] =\n Url::to(['wheels/model_wheel',\n 'vendor'=>$wheels_model['vendor_alias'],\n 'model'=>$wheels_model['model_alias']]);\n else\n $url_rules[] =\n Url::to(['wheels/gruz_model_wheel',\n 'vendor'=>$wheels_model['vendor_alias'],\n 'model'=>$wheels_model['model_alias']]);\n }\n unset($wheels_models);\n\n //'wheels/producers/<vendor:\\S+>/<model:\\S+>/<id:\\d+>' => 'wheels/wheel',//диск\n //'wheels_gruz/producers/<vendor:\\S+>/<model:\\S+>/<id:\\d+>' => 'wheels/gruz_wheel',//диск\n $SQL = 'SELECT type, wheels_models.model_alias, wheels_vendors.alias AS vendor_alias, id_size \n FROM wheels_model_sizes\n JOIN wheels_models ON wheels_models.id_model = wheels_model_sizes.id_model\n JOIN wheels_vendors ON wheels_vendors.id_vendor = wheels_models.id_vendor\n WHERE wheels_model_sizes.price > 0';\n $wheels_model_sizes = Yii::$app->db->createCommand($SQL)->queryAll();\n foreach ($wheels_model_sizes AS $wheels_model_size){\n if($wheels_model_size['type'] != 2)\n $url_rules[] =\n Url::to(['wheels/wheel',\n 'vendor'=>$wheels_model_size['vendor_alias'],\n 'model'=>$wheels_model_size['model_alias'],\n 'id'=>$wheels_model_size['id_size']]);\n else\n $url_rules[] =\n Url::to(['wheels/gruz_wheel',\n 'vendor'=>$wheels_model_size['vendor_alias'],\n 'model'=>$wheels_model_size['model_alias'],\n 'id'=>$wheels_model_size['id_size']]);\n }\n unset($wheels_model_sizes);\n\n //'news/<alias:\\S+>' => 'news/new'\n $SQL = 'SELECT alias FROM news WHERE is_active = 1';\n $news = Yii::$app->db->createCommand($SQL)->queryColumn();\n foreach ($news AS $new){\n $url_rules[] = Url::to(['news/new','alias'=>$new,]);\n }\n unset($news);\n\n $url_rules = array_merge($url_rules, $this->getChildPages($pages,0));\n //Формируем двумерный массив. createUrl преобразует ссылки в правильный вид.\n //Добавляем элемент массива 'daily' для указания периода обновления контента\n // foreach ($url_rules as $url_rule){\n // $urls[] = array($url_rule,'daily');\n // }\n return $url_rules;\n }", "function url_amigable($url)\n {\n $url = strtolower($url);\n //Rememplazamos caracteres especiales latinos\n $find = array('á', 'é', 'í', 'ó', 'ú', 'ñ');\n $repl = array('a', 'e', 'i', 'o', 'u', 'n');\n $url = str_replace($find, $repl, $url);\n // Añaadimos los guiones\n $find = array(' ', '&', '\\r\\n', '\\n', '+');\n $url = str_replace($find, '-', $url);\n // Eliminamos y Reemplazamos demás caracteres especiales\n $find = array('/[^a-z0-9\\-<>]/', '/[\\-]+/', '/<[^>]*>/');\n $repl = array('', '-', '');\n $url = preg_replace($find, $repl, $url);\n\n return $url;\n }", "public function href();", "static function obtenerUrlActual() {\n $url = Util::crearUrl($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);\n return $url;\n }", "public function getUrl(){\n return $this->server->getUrl() . \"/\" . $this->name;\n \n }", "private function getUrl() {\r\n if(!$this->markActive)\r\n return '';\r\n $mid = Yii::$app->controller->module->id == Yii::$app->id ? '' : Yii::$app->controller->module->id;\r\n $cid = Yii::$app->controller->id;\r\n $aid = Yii::$app->controller->action->id;\r\n $id = isset($_GET['slug']) ? $_GET['slug'] : (isset($_GET['id']) ? $_GET['id'] : '');\r\n $rubric = isset($_GET['rubric']) ? $_GET['rubric'] : '';\r\n $tag = isset($_GET['tag']) ? $_GET['tag'] : '';\r\n return ($mid ? $mid. '/' : '') . \r\n $cid . '/' . \r\n ($aid == 'index' \r\n ? ($rubric \r\n ? 'rubric/' . $rubric . ($tag \r\n ? '/tag/' . $tag \r\n : '') \r\n : 'index') \r\n : ($aid == 'view' ? $id : $aid)\r\n );\r\n }", "function armin_url($url = '')\n { \n if(is_multilingual()) { \n $url = localized_url($url);\n }\n \n return request()->secure() ? secure_url(trim_url($url)) : url(trim_url($url));\n }", "public function url(){\r\n\t\treturn $this->_url;\r\n\t}", "function short($urlf){\r\n\t\r\n$url = file_get_contents(\"http://migre.me/api.txt?url=$urlf\");\r\necho $url;\r\n}", "private function splitUrl() {\n\n if (isset($_GET['url'])) {\n\n $url = trim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n\n $this->url_controller = isset($url[0]) ? $url[0] : null;\n $this->url_action = isset($url[1]) ? $url[1] : null;\n\n unset($url[0], $url[1]);\n\n $this->url_params = array_values($url);\n\n // para debugging, descomente estas lineas si tiene problemas con la URL\n //echo 'Controller: ' . $this->url_controller . '<br>';\n //echo 'Action: ' . $this->url_action . '<br>';\n //echo 'Parameters: ' . print_r($this->url_params, true) . '<br>';\n }\n }", "function url( $url = \"teste-teste\" ){\r\n \r\n return str_ireplace(\"-\", \"\", $url);\r\n}", "function formatCurrentUrl() ;", "function url()\n\t{\n\t\t$id\t\t= $this->attribute('id');\n\t\t$page\t= $this->pyrocache->model('pages_m', 'get', array($id));\n\n\t\treturn site_url($page ? $page->uri : '');\n\t}", "public static function setUrl(): void\n\t{\n\n\t\tif (strpos(static::$fullUrl, '?')) {\n\t\t\tstatic::$url = substr(static::$fullUrl, 0, strpos(static::$fullUrl, '?'));\n\t\t} else {\n\t\t\tstatic::$url = static::$fullUrl;\n\t\t}\n\n\t}", "public function getUrl(){\r\n if(isset($_GET['url'])){\r\n $url = rtrim($_GET['url'], '/');\r\n $url = filter_var($url, FILTER_SANITIZE_URL);\r\n $url = explode('/', $url);\r\n return $url;\r\n }\r\n }", "function sUrl( $url )\r\n\t\t{\r\n\t\t return filter_var( $url, FILTER_SANITIZE_URL );\r\n\t\t \r\n\t\t}", "public function url()\n\t{\n\t\t\n\t\t$lang = Config::get('app.locale');\n\t\t$route_prefix = ($lang == \"ar\" ? \"ar/\" : \"\");\t\t\n\t\treturn Url::to($route_prefix .'page/' .$this->link);\n\t}", "function get_url_content($url=''){\n\n get_clean_url($url);\n show_route_content();\n \n enable_url_aliases();\n \n //~ echo $_GET['fetched-url'];\n //~ echo '<br>';\n //~ print_r($_GET['clean-url']);\n //~ print_r($_SESSION);\n}", "public function get2($link){\n $url = explode('/', $_GET['url']);\n $this->url_enlace = $url[2];\n }", "function put_my_url(){\n\treturn (get_home_url());\n}", "function createURL($key_word, $tipo_pasto){\r\n $url = \"http://localhost:5028/rec/?q=\" . $key_word .'&';\r\n\r\n/*\r\n if($tipo_dieta == 'balanced')\r\n $url = $url . \"diet=balanced&\";\r\n if($tipo_dieta == 'high-protein')\r\n $url = $url . \"diet=high-protein&\";\r\n if($tipo_dieta == 'high-fiber')\r\n $url = $url . \"diet=high-fiber&\";\r\n if($tipo_dieta == 'low-carb')\r\n $url = $url . \"diet=low-carb&\";\r\n if($tipo_dieta == 'low-fat')\r\n $url = $url . \"diet=low-fat&\";\r\n if($tipo_dieta == 'low-sodium')\r\n $url = $url . \"diet=low-sodium&\";\r\n\r\n if($etichette_salutari == 'vegan')\r\n $url = $url . \"health=vegan&\" ;\r\n if($etichette_salutari == 'vegetarian')\r\n $url = $url . \"health=vegetarian&\" ;\r\n if($etichette_salutari == 'egg-free')\r\n $url = $url . \"health=egg-free&\" ;\r\n if($etichette_salutari == 'fish-free')\r\n $url = $url . \"health=fish-free&\" ;\r\n if($etichette_salutari == 'gluten-free')\r\n $url = $url . \"health=gluten-free&\" ;\r\n\r\n if($tipo_pasto == 'Breakfast')\r\n $url = $url.'mealType=Breakfast&';\r\n if($tipo_pasto == 'Launch')\r\n $url = $url.'mealType=Launch&';\r\n if($tipo_pasto == 'Dinner')\r\n $url = $url.'mealType=Dinner&';\r\n if($tipo_pasto == 'Sneak')\r\n $url = $url.'mealType=Sneak&';\r\n if($tipo_pasto == 'Teatime')\r\n $url = $url.'mealType=Teatime&';\r\n*/ \r\n if($tipo_pasto == 'Starter')\r\n \t$url = $url.'dishType=Starter&';\r\n if($tipo_pasto == 'Biscuits and cookies')\r\n $url = $url.'dishType=Biscuitsandcookies&';\r\n if($tipo_pasto == 'Bread')\r\n $url = $url.'dishType=Bread&';\r\n if($tipo_pasto == 'Cereals')\r\n $url = $url.'dishType=Cereals&';\r\n if($tipo_pasto == 'Condimentsandsauces')\r\n $url = $url.'dishType=Condimentsandsauces&';\r\n if($tipo_pasto == 'Desserts')\r\n $url = $url.'dishType=Desserts&';\r\n if($tipo_pasto == 'Egg')\r\n $url = $url.'dishType=Egg&';\r\n if($tipo_pasto == 'Main course')\r\n $url = $url.'dishType=Maincourse&';\r\n if($tipo_pasto == 'Omelet')\r\n $url = $url.'dishType=Omelet&';\r\n if($tipo_pasto == 'Pancake')\r\n $url = $url.'dishType=Pancake&';\r\n if($tipo_pasto == 'Preps')\r\n $url = $url.'dishType=Preps&';\r\n if($tipo_pasto == 'Preserve')\r\n $url = $url.'dishType=Preserve&';\r\n if($tipo_pasto == 'Salad')\r\n $url = $url.'dishType=Salad&';\r\n if($tipo_pasto == 'Sandwiches')\r\n $url = $url.'dishType=Sandwiches&';\r\n if($tipo_pasto == 'Soup')\r\n $url = $url.'dishType=Soup&';\r\n \r\n \r\n $url = $url . \"n=10&lang=en\";\r\n\r\n return $url;\r\n\r\n}", "public function getUrl(){\n if(isset($_REQUEST['url'])){\n $url = $_REQUEST['url'];\n $url = rtrim($url,'/');\n $url = filter_var($url,FILTER_SANITIZE_URL);\n $url = explode('/',$url);\n return $url;\n }\n }", "public function uri();" ]
[ "0.72046965", "0.72046965", "0.72046965", "0.69323164", "0.6907604", "0.6830484", "0.67822206", "0.67822206", "0.67822206", "0.67822206", "0.67822206", "0.67822206", "0.67822206", "0.67822206", "0.6776884", "0.6776884", "0.67462593", "0.67397875", "0.67217314", "0.66465443", "0.6645478", "0.66019255", "0.6587239", "0.65727365", "0.6558029", "0.65408295", "0.64768535", "0.6463835", "0.6463835", "0.6463835", "0.6452829", "0.6442727", "0.6427691", "0.64004093", "0.63938355", "0.639378", "0.6367671", "0.6331892", "0.6329495", "0.6325301", "0.6310916", "0.63107455", "0.62996274", "0.62996274", "0.6284489", "0.6281464", "0.6279848", "0.62748325", "0.6267028", "0.6243956", "0.62225753", "0.6220353", "0.6218883", "0.618195", "0.61749387", "0.6173874", "0.61572176", "0.61508846", "0.6136803", "0.6129835", "0.612459", "0.61055243", "0.61028445", "0.6100737", "0.6095695", "0.60858893", "0.6083018", "0.6082459", "0.60782856", "0.60628474", "0.6056011", "0.60519373", "0.6051232", "0.60380065", "0.6037308", "0.6037195", "0.60347646", "0.6029409", "0.6018784", "0.60147095", "0.5999338", "0.5998558", "0.5997621", "0.59969425", "0.59964496", "0.597867", "0.59659505", "0.5949969", "0.59361094", "0.5922142", "0.59198844", "0.5917226", "0.5916904", "0.5910525", "0.58959264", "0.58950746", "0.5889089", "0.5883005", "0.5877372", "0.5867046", "0.5862628" ]
0.0
-1
Creates data provider instance with search query applied
public function search($params) { $query = CitasMedicas::find(); $query->joinWith(['medicos', 'pacientes', 'tipoServicio']); $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $dataProvider->sort->attributes['medico'] = [ 'asc'=>['medicos.nombre'=>SORT_ASC], 'desc'=>['medicos.nombre'=>SORT_DESC], ]; $dataProvider->sort->attributes['id_pac'] = [ 'asc'=>['pacientes.identificacion'=>SORT_ASC], 'desc'=>['pacientes.identificacion'=>SORT_DESC], ]; $dataProvider->sort->attributes['nombre1'] = [ 'asc'=>['pacientes.nombre1'=>SORT_ASC], 'desc'=>['pacientes.nombre1'=>SORT_DESC], ]; $dataProvider->sort->attributes['nombre2'] = [ 'asc'=>['pacientes.nombre2'=>SORT_ASC], 'desc'=>['pacientes.nombre2'=>SORT_DESC], ]; $dataProvider->sort->attributes['apellido1'] = [ 'asc'=>['pacientes.apellido1'=>SORT_ASC], 'desc'=>['pacientes.apellido1'=>SORT_DESC], ]; $dataProvider->sort->attributes['apellido2'] = [ 'asc'=>['pacientes.apellido2'=>SORT_ASC], 'desc'=>['pacientes.apellido2'=>SORT_DESC], ]; $dataProvider->sort->attributes['motivo'] = [ 'asc'=>['tipos_servicio.nombre'=>SORT_ASC], 'desc'=>['tipos_servicio.nombre'=>SORT_DESC], ]; $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere([ 'id_citas' => $this->id_citas, 'pacientes_id' => $this->pacientes_id, 'medicos_id' => $this->medicos_id, 'fecha' => $this->fecha, 'tipo_servicio'=>$this->tipo_servicio, // 'hora' => $this->hora, 'hora_llegada' => $this->hora_llegada, ]); $query->andFilterWhere(['like', 'observaciones', $this->observaciones]) ->andFilterWhere(['like', 'medicos.nombre', $this->medico]) ->andFilterWhere(['like', 'pacientes.identificacion', $this->id_pac]) ->andFilterWhere(['like', 'hora', $this->hora]) ->andFilterWhere(['like', 'tipos_servicio.nombre', $this->motivo]) ->andFilterWhere(['like', 'pacientes.nombre1', $this->nombre1]) ->andFilterWhere(['like', 'pacientes.nombre2', $this->nombre2]) ->andFilterWhere(['like', 'pacientes.apellido1', $this->apellido1]) ->andFilterWhere(['like', 'pacientes.apellido2', $this->apellido2]) ->andFilterWhere(['like', 'estado', $this->estado]); $query->limit(20); return $dataProvider; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function searchQueryDataProvider() {}", "public function search()\n {\n $q = $this->getQuery();\n $dataProvider = new ActiveDataProvider([\n 'query' => $q,\n ]);\n\n return $dataProvider;\n }", "public function getQueryDataProvider() {}", "public function search() {\n // Get CDbCriteria instance\n $dbCriteria = new CDbCriteria;\n // Search for client name\n $dbCriteria->compare('name', Yii::app()->request->getQuery('name', ''), true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $dbCriteria,\n 'pagination' => array(\n 'pageSize' => 10,\n ),\n ));\n }", "protected function getDataProviders()\n {\n $searchModel = $this->getSearchModel();\n $queryParams = Yii::$app->request->queryParams;\n $dataProvider = $searchModel->search($queryParams);\n return [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider\n ];\n }", "public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('url', $this->url);\n $criteria->compare('type', $this->type);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => 100),\n ));\n }", "public function backendSearch()\n {\n $criteria = new CDbCriteria();\n\n return new CActiveDataProvider(\n __CLASS__,\n array(\n 'criteria' => $criteria,\n )\n );\n }", "public function search() {\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria' => $this->getSearchCriteria(),\n\t\t\t'sort' => array(\n\t\t\t\t'defaultOrder' => 't.id DESC',\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'client_id' => array(\n\t\t\t\t\t\t'asc' => 'client_name asc',\n\t\t\t\t\t\t'desc' => 'client_name desc',\n\t\t\t\t\t),\n\t\t\t\t\t'*',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'pagination' => array(\n\t\t\t\t'pageSize' => Yii::app()->config->get('global.per_page'),)\n\t\t));\n\t}", "public function search()\n {\n $criteria = new CDbCriteria;\n $criteria->compare('id', $this->id, true);\n $criteria->compare('level', $this->level);\n $criteria->compare('text', $this->text, true);\n $criteria->compare('ip_create', $this->ip_create, true);\n\n return new ActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function createSearchQuery()\n {\n $query = new SearchQuery($this->elastic);\n $query->listeners = $this->listeners;\n return $query;\n }", "public function search()\n {\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('state', $this->state);\n $criteria->compare('type','0');\n return new ActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function prepareDataProvider()\n\t{\n\t $searchModel = new \\app\\models\\ClearanceSearch(); \n\t\treturn $searchModel->search(\\Yii::$app->request->queryParams);\n\n\t}", "public function search()\n {\n $criteria = new CDbCriteria;\n $criteria->compare('authorname', $this->authorname, true);\n return new CActiveDataProvider($this, array('criteria' => $criteria, ));\n }", "public function getDataProvider(array $query = []);", "protected function prepareDataProvider()\n {\n if ($this->prepareDataProvider !== null) {\n return call_user_func($this->prepareDataProvider, $this);\n }\n\n\t\t/* @var $modelClass \\yii\\db\\BaseActiveRecord */\n $modelClass = $this->modelClass;\n\t\t$query = $modelClass::find();\n\t\t\n\t\t$filters = ActionHelpers::getFilter();\n\t\t\n\t\tforeach($filters as $filter) {\n\t\t\t$query->andFilterWhere($filter);\n\t\t}\n\t\t\n\t\tif($with = ActionHelpers::getWith()) {\n $query->with($with);\n }\n\n return new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => [\n 'pageSize' => ActionHelpers::getLimit()\n ],\n 'sort'=> ActionHelpers::getSort()\n // 'sort'=> ['defaultOrder' => ['id'=>SORT_DESC]]\n ]);\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('entity_id', $this->entity_id);\n $criteria->compare('dbname', $this->dbname, true);\n $criteria->compare('isfiltered', $this->isfiltered);\n $criteria->compare('filtertype', $this->filtertype);\n $criteria->compare('alias', $this->alias, true);\n $criteria->compare('enabled', $this->enabled);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => false,\n ));\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that should not be searched.\n\t\t$criteria = new \\CDbCriteria;\n\n\t\tforeach (array_keys($this->defineAttributes()) as $name)\n\t\t{\n\t\t\t$criteria->compare($name, $this->$name);\n\t\t}\n\n\t\treturn new \\CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria\n\t\t));\n\t}", "public function search()\n\t{\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('memo',$this->memo,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n $query = Hotel::find();\n // add conditions that should always apply here\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n \n // grid filtering conditions\n $query->availables($this->quantity_of_guests);\n $query->andFilterWhere([\n 'hotel_id' => $this->hotel_id,\n 'price_per_guest' => $this->price_per_guest,\n ]);\n $query->andFilterWhere(['like', 'city_name', $this->city_name]);\n return $dataProvider;\n \n }", "public function search()\n\t{\n\t $criteria=new CDbCriteria;\n\t\t\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('projection',$this->projection,true);\n\t\t$criteria->compare('username',Yii::app()->user->id);\n\t\t$criteria->compare('title',$this->title);\n\t\t$criteria->compare('url',$this->url);\n\t return new CActiveDataProvider(get_class($this), array(\n\t 'criteria'=> $criteria,\n\t 'sort'=>array(\n\t 'defaultOrder'=>'name ASC',\n\t ),\n\t 'pagination'=>array(\n\t 'pageSize'=>10\n\t ),\n\t ));\n\t}", "private function _getDataProvider($query, $params){\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n if (!($this->load($params) && $this->validate())) {\n return $dataProvider;\n }\n\n $query->andFilterWhere([\n 'user_id' => $this->user_id,\n 'profile_id' => $this->profile_id,\n 'authentication_method_id' => $this->authentication_method_id,\n 'status' => $this->status,\n 'created_at' => $this->created_at,\n 'updated_at' => $this->updated_at,\n ]);\n\n $query->andFilterWhere(['like', 'username', $this->username])\n ->andFilterWhere(['like', 'auth_key', $this->auth_key])\n ->andFilterWhere(['like', 'password_hash', $this->password_hash])\n ->andFilterWhere(['like', 'password_reset_token', $this->password_reset_token])\n ->andFilterWhere(['like', 'email', $this->email]);\n\n return $dataProvider;\n }", "public function getMetadataQueryProviderWrapper();", "protected function prepareDataProvider()\n {\n \t$modelClass = $this->modelClass;\n\n $orderBy='id';\n if (isset($_GET['orderBy'])) $orderBy=$_GET['orderBy'];\n\n $orderByDir='DESC';\n if (isset($_GET['orderByDir'])) $orderByDir=$_GET['orderByDir'];\n\n $limit=20;\n if (isset($_GET['limit'])) $limit=$_GET['limit'];\n\n $order = \"$orderBy $orderByDir\";\n\n \t$dataProvider = new ActiveDataProvider([\n 'query' => $modelClass::find()->limit($limit)->with('supplier')->orderBy($order),\n 'pagination' => [\n 'pageSize' => $limit,\n ],\n ]);\n\n \treturn $dataProvider;\n }", "public function makeSearch() \n {\n $this->setSelect($this->qb);\n $this->setAssociations($this->qb);\n $this->setWhere($this->qb);\n $this->setOrderBy($this->qb);\n $this->setLimit($this->qb);\n\n return $this;\n }", "public function search()\n\t{\n\t\t$criteria = new CDbCriteria;\n\t\t//TODO: update search criteria\n\t\t$criteria->compare('id', $this->id, true);\n\t\t$criteria->compare('event_id', $this->event_id, true);\n\t\t$criteria->compare('standard_intervention_exists', $this->standard_intervention_exists);\n\t\t$criteria->compare('details', $this->details);\n\t\t$criteria->compare('interventions_id', $this->interventions_id);\n\t\t$criteria->compare('description', $this->description);\n\t\t$criteria->compare('patient_factors', $this->patient_factors);\n\t\t$criteria->compare('patient_factor_details', $this->patient_factor_details);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('title',$this->title,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('keywords',$this->keywords,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public static function new_search_record()\n\t{\n\t\treturn new user_record_search();\n\t}", "public function search() {\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('content', $this->content, true);\n\t\t$criteria->compare('score', $this->score);\n\t\t$criteria->compare('author', $this->author, true);\n\t\t$criteria->compare('type', $this->type);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}", "public function search()\n {\n $criteria = new CDbCriteria;\n $criteria->compare('uid', $this->uid);\n $criteria->compare('token', $this->token, true);\n $criteria->compare('created', $this->created, true);\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n\n $this->entity = $this->name;\n $this->conditions = $this->_getSearchConditions();\n $this->joins = $this->_getSearchJoins();\n $this->orders = $this->_getSearchOrder();\n $this->limit = $this->_getSearchLimit();\n $this->maxLimit = $this->_getSearchMaxLimit();\n $this->offset = $this->_getSearchOffset();\n $this->fields = $this->_getSearchFields();\n $this->group = $this->_getSearchGroup();\n\n// $this->setVar('entity', $this->name);\n// $this->setVar('conditions', $this->_getSearchConditions());\n// $this->setVar('joins', $this->_getSearchJoins());\n// $this->setVar('orders', $this->_getSearchOrder());\n// $this->setVar('limit', $this->_getSearchLimit());\n// $this->setVar('maxLimit', $this->_getSearchMaxLimit());\n// $this->setVar('offset', $this->_getSearchOffset());\n// $this->setVar('fields', $this->_getSearchFields());\n// $this->setVar('group', $this->_getSearchGroup());\n//\n// $this->setVar('baseAdditionalElements', $this->additionalElements);\n $this->getFieldsForSearchFunction = '_extractSearchFields';\n\n return $this->baseSearch();\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('keyword_id', $this->keyword_id);\n $criteria->compare('visits', $this->visits);\n $criteria->compare('page_views', $this->page_views);\n $criteria->compare('parsing', $this->parsing);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => 50),\n ));\n }", "protected function getNewSearchModel()\n {\n $searchModelName = $this->getSearchModelName();\n return new $searchModelName;\n }", "public function search()\n\t{\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function searchdatas(){\r\n\t\t// should not be searched.\r\n\t\t$conditions=array();\r\n\t\t$params=array();\r\n\t\t$page_params=array();\r\n\t\t$criteria=new CDbCriteria;\r\n\t\t$sort=new CSort();\r\n \t$sort->attributes=array();\r\n \t$sort->defaultOrder=\"t.create_time ASC\";\r\n \t$sort->params=$page_params;\r\n\t\treturn new CActiveDataProvider(get_class($this), array(\r\n\t\t\t'criteria'=>array(\r\n\t\t\t 'condition'=>'',\r\n\t\t\t 'params'=>array(),\r\n\t\t\t 'with'=>array(\"User\",\"District\"),\r\n\t\t\t),\r\n\t\t\t'pagination'=>array(\r\n 'pageSize'=>'20',\r\n 'params'=> $page_params,\r\n ),\r\n 'sort'=>$sort,\r\n\t\t));\r\n\t}", "public function search()\n {\n\n $query = Board::find()->where(['user_id' => $this->user_id]);\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => [\n 'pageSize' => 10,\n ],\n 'sort' => [\n 'defaultOrder' => [\n 'created_at' => SORT_DESC,\n\n ]\n ],\n ]);\n\n return $dataProvider;\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('post_id', $this->post_id);\n $criteria->compare('language_id', $this->language_id);\n $criteria->compare('header', $this->header, true);\n $criteria->compare('text', $this->text, true);\n\t\t$criteria->compare('rating',$this->rating);\n\t\t$criteria->compare('author_id',$this->author_id);\n\t\t$criteria->compare('date_add',$this->date_add,true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('t.id', $this->id);\n $criteria->compare('who', $this->who);\n $criteria->compare('date', $this->date, true);\n $criteria->compare('text', $this->text, true);\n $criteria->compare('rate', $this->rate);\n $criteria->compare('knowledge', $this->knowledge);\n $criteria->compare('behavior', $this->behavior);\n $criteria->compare('motivation', $this->motivation);\n $criteria->compare('rate', $this->who_ip);\n $criteria->compare('is_checked', $this->is_checked);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array(\n 'pageSize' => '50',\n ),\n 'sort' => array(\n 'defaultOrder' => array(\n 'date' => CSort::SORT_DESC,\n ),\n ),\n ));\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('name', $this->name, true);\n $criteria->compare('latitude', $this->latitude);\n $criteria->compare('longitude', $this->longitude);\n $criteria->compare('type', $this->type, true);\n $criteria->compare('vicinity', $this->vicinity, true);\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function parametersAndQueriesDataProvider() {}", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('region_id', $this->region_id);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t $this->StateProcess(get_class($this).'_'.Y::app()->params['cfgName']);\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('title',$this->title,true);\n $criteria->compare('title_adm',$this->title,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n 'sort'=>array('defaultOrder'=>'id DESC'),\n 'pagination'=>array('pageSize'=>Config::$data['base']->pageSize)\n\t\t));\n\t}", "public function search($params,$query=null)\n {\n if(!$query) $query = RestClient::find();\n\n $query = $query->joinWith(['hospital']) \n ->joinWith(['hospital.sales']);\n //$query = $query->joinWith('mingrui_comments');\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 //var_dump($params);exit;\n return $dataProvider;\n }\n \n // grid filtering conditions\n $query->andFilterWhere([\n 'rest_client.id' => $this->id, \n 'age' => $this->age, \n 'hospital_id' => $this->hospital_id, \n ]);\n\n $query->andFilterWhere(['like', 'rest_client.name', $this->name])\n ->andFilterWhere(['like', 'sex', $this->sex])\n ->andFilterWhere(['like', 'birthplace', $this->birthplace])\n ->andFilterWhere(['like', 'email', $this->email])\n ->andFilterWhere(['like', 'tel', $this->tel])\n ->andFilterWhere(['like', 'school', $this->school])\n ->andFilterWhere(['like', 'education', $this->education])\n ->andFilterWhere(['like', 'experience', $this->experience])\n ->andFilterWhere(['like', 'employed', $this->employed])\n ->andFilterWhere(['like', 'department', $this->department])\n ->andFilterWhere(['like', 'worktime', $this->worktime])\n ->andFilterWhere(['like', 'position', $this->position])\n ->andFilterWhere(['like', 'speciality', $this->speciality])\n ->andFilterWhere(['like', 'hobby', $this->hobby])\n ->andFilterWhere(['like', 'notes', $this->notes])\n ->andFilterWhere(['like', 'zhuren', $this->zhuren])\n ->andFilterWhere(['like', 'pianhao', $this->pianhao]) \n ->andFilterWhere(['like', 'rest_danwei.name', $this->hospitalname])\n ->andFilterWhere(['like', 'rest_sales.name', $this->salesname])\n ;\n\n // echo $query->createCommand()->getRawSql(); exit; \n return $dataProvider;\n }", "public function search()\n\t{\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('agreement',$this->agreement);\n\t\t$criteria->compare('date',$this->date,true);\n\t\t$criteria->compare('user',$this->user);\n\t\t$criteria->compare('new_status',$this->new_status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('description', $this->description, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n\n\t\t$criteria = $this->getDbCriteria();\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('subject', $this->subject, true);\n\t\t$criteria->compare('status', $this->status);\n\t\t$criteria->compare('template.name', $this->template_id, true);\n\n\t\t$sort = new CSort;\n\t\t$sort->defaultOrder = 'id DESC';\n\n\t\treturn new NActiveDataProvider($this, array(\n\t\t\t\t\t'criteria' => $criteria,\n\t\t\t\t\t'sort' => $sort,\n\t\t\t\t\t'pagination' => array(\n\t\t\t\t\t\t'pageSize' => 20,\n\t\t\t\t\t),\n\t\t\t\t));\n\t}", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=new CDbCriteria;\n\n $criteria->compare('id',$this->id,true);\n $criteria->compare('query_id',$this->query_id,true);\n $criteria->compare('se_id',$this->se_id,true);\n $criteria->compare('se_page',$this->se_page,true);\n $criteria->compare('se_url',$this->se_url,true);\n $criteria->compare('visits',$this->visits);\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n 'pagination' => array('pageSize' => 25),\n ));\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('acquisition_date_id', $this->acquisition_date_id);\n $criteria->compare('acquisition_type_id', $this->acquisition_type_id);\n $criteria->compare('location_id', $this->location_id);\n $criteria->compare('number', $this->number, true);\n $criteria->compare('annotation', $this->annotation, true);\n $criteria->compare('location_coordinates_id', $this->location_coordinates_id);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "protected function _initSearch()\n {\n $this->where['is_del'] = array('eq', 1);\n $this->order = 'create_time desc';\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('id_client', $this->id_client);\n $criteria->compare('first_name', $this->first_name, true);\n $criteria->compare('last_name', $this->last_name, true);\n $criteria->compare('date_birth', $this->date_birth, true);\n $criteria->compare('gender', $this->gender);\n\n return new CActiveDataProvider(get_class($this), array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('domain', $this->domain, true);\n $criteria->compare('ru_domain', $this->ru_domain, true);\n $criteria->compare('page', $this->ru_domain);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function applyDefaultSearchQuery(\\yii\\data\\ActiveDataProvider &$dataProvider);", "protected function _initSearch()\n {\n $this->where['is_del'] = array('eq', 0);\n $this->order = 'create_time desc';\n }", "public static function new_search_record()\n\t{\n\t\treturn new league_record_search();\n\t}", "public function search()\n {\n $query = Story::find()\n ->owner()\n ->globalChannel()\n ->orderBy(['_id' => SORT_ASC])\n ->active();\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => false\n ]);\n\n return $dataProvider;\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('project_id', $this->project_id);\n $criteria->compare('num', $this->num);\n $criteria->compare('team_strength', $this->team_strength);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "private function instantiate_search_page() {\n // Build the search_types_fields and search_types_label arrays out of post_types_defs\n $search_types_fields = array();\n $search_types_label = array();\n foreach ( $this->post_type_defs as $post_type ) {\n $search_types_fields[ $post_type[ 'slug' ] ] = $post_type[ 'fields' ];\n $search_types_label[ $post_type[ 'slug' ] ] = $post_type[ 'plural_name' ];\n }\n $this->search_page = new HRHS_Search( array(\n // Using the default slug and title for now\n 'search_types_fields' => $search_types_fields,\n 'search_types_label' => $search_types_label\n ) );\n }", "public function search()\n\t{\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('title',$this->title,true);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search($query);", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('sex', $this->sex);\n $criteria->compare('mobile', $this->mobile, true);\n $criteria->compare('idcard', $this->idcard, true);\n $criteria->compare('password', $this->password, true);\n $criteria->compare('place_ids', $this->place_ids, true);\n $criteria->compare('depart_id', $this->depart_id);\n $criteria->compare('bank', $this->bank, true);\n $criteria->compare('bank_card', $this->bank_card, true);\n $criteria->compare('address', $this->address, true);\n $criteria->compare('education', $this->education, true);\n $criteria->compare('created', $this->created);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('summ', $this->summ, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('company_id', Yii::app()->user->company_id);\n $criteria->compare('zone_id', $this->zone_id, true);\n $criteria->compare('low_qty_threshold', $this->low_qty_threshold);\n $criteria->compare('high_qty_threshold', $this->high_qty_threshold);\n $criteria->compare('created_date', $this->created_date, true);\n $criteria->compare('created_by', $this->created_by, true);\n $criteria->compare('updated_date', $this->updated_date, true);\n $criteria->compare('updated_by', $this->updated_by, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('nrs', $this->nrs, true);\n $criteria->compare('supplier_name', $this->supplier_name, true);\n $criteria->compare('npwp', $this->npwp, true);\n $criteria->compare('bank_name', $this->bank_name, true);\n $criteria->compare('bank_account_number', $this->bank_account_number, true);\n $criteria->compare('created_at', $this->created_at, true);\n $criteria->compare('created_by', $this->created_by);\n $criteria->compare('updated_at', $this->updated_at, true);\n $criteria->compare('updated_by', $this->updated_by);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'sort' => array(\n 'defaultOrder' => 'id DESC',\n ),\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('code',$this->code,true);\n\t\t$criteria->compare('title',$this->title,true);\n\t\t$criteria->compare('did',$this->did);\n\t\t$criteria->compare('date_prod',$this->date_prod,true);\n\t\t$criteria->compare('kind',$this->kind,true);\n\t\t$criteria->compare('len',$this->len,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('code', $this->code, true);\n\t\t$criteria->compare('name', $this->name, true);\n\t\t$criteria->compare('printable_name', $this->printable_name, true);\n\t\t$criteria->compare('iso3', $this->iso3, true);\n\t\t$criteria->compare('numcode', $this->numcode);\n\t\t$criteria->compare('is_default', $this->is_default);\n\t\t$criteria->compare('is_highlight', $this->is_highlight);\n\t\t$criteria->compare('is_active', $this->is_active);\n\t\t$criteria->compare('date_added', $this->date_added);\n\t\t$criteria->compare('date_modified', $this->date_modified);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}", "public function search($params)\n {\n $this->__search($params);\n\n // grid filtering conditions\n $this->query\n\t ->andFilterWhere([\n\t 'id' => $this->id,\n\t 'ord' => $this->ord,\n\t 'type' => $this->type,\n\t ])\n\t ->andFilterWhere(['like', 'code', $this->code])\n ->andFilterWhere(['like', 'name', $this->name]);\n\n return $this->dataProvider;\n }", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n $criteria = new CDbCriteria();\n \n $criteria->compare('question_id', $this->question_id);\n $criteria->compare('student_id', $this->student_id);\n $criteria->compare('answer_id', $this->answer_id);\n $criteria->compare('answer_text', $this->answer_text, true);\n $criteria->compare('answer_number', $this->answer_number, true);\n $criteria->compare('exec_time', $this->exec_time);\n $criteria->compare('result', $this->result);\n $criteria->compare('test_result', $this->test_result);\n \n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria\n ));\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('createDate', $this->createDate);\n $criteria->compare('lastUpdated', $this->lastUpdated);\n $criteria->compare('trackingKey', $this->trackingKey);\n $criteria->compare('email', $this->email);\n $criteria->compare('leadscore', $this->leadscore);\n\n if (!Yii::app()->user->isGuest) {\n $pageSize = Profile::getResultsPerPage();\n } else {\n $pageSize = 20;\n }\n\n return new SmartActiveDataProvider(get_class($this), array(\n 'pagination' => array(\n 'pageSize' => $pageSize,\n ),\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n// @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('description', $this->description, true);\n $criteria->compare('type', $this->type, true);\n $criteria->compare('options', $this->options, true);\n $criteria->compare('autoreplys', $this->autoreplys, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function googleSearch()\n {\n $search = new \\Hoor\\Search\\Google(get_search_query(), $this->getIndex());\n $this->data['search'] = $search;\n $this->data['results'] = $search->results;\n }", "protected function addSearchConfigs()\n {\n\n $this['textQueryBuilder'] = function () {\n return new TextQueryBuilder();\n };\n\n $this['searchManager'] = function ($c) {\n return new SearchManager($c['databaseAdapter'], $c['queue'], $c['request'], array(\n $c['textQueryBuilder']\n ));\n };\n\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('tbl_customer_supplier', $this->tbl_customer_supplier, true);\n $criteria->compare('id_customer', $this->id_customer, true);\n $criteria->compare('id_supplier', $this->id_supplier, true);\n $criteria->compare('title', $this->title, true);\n $criteria->compare('date_add', $this->date_add, true);\n $criteria->compare('date_upd', $this->date_upd, true);\n $criteria->compare('active', $this->active);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public static function search()\n {\n return self::filterSearch([\n 'plot_ref' => 'string',\n 'plot_name' => 'string',\n 'plot_start_date' => 'string',\n 'user.name' => self::filterOption([\n 'select' => 'id',\n 'label' => trans_title('users', 'plural'),\n 'fields' => ['id', 'name'],\n //ComboBox user list base on the current client\n //See in App\\Models\\Users\\UsersScopes\n 'model' => app(User::class)->bySearch(),\n ]),\n 'client.client_name' => self::filterOption([\n 'conditional' => Credentials::hasRoles(['admin', 'admin-gv']),\n 'select' => 'client_id',\n 'label' => trans_title('clients', 'plural'),\n 'model' => Client::class,\n 'fields' => ['id', 'client_name']\n ])\n ]);\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('name', $this->name, true);\n\t\t$criteria->compare('district_id', $this->district_id);\n\t\t$criteria->compare('active', $this->active);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t\t\t'criteria' => $criteria,\n\t\t\t\t));\n\t}", "public function search()\n\t{\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('issue_date', $this->issue_date, true);\n\n\t\treturn new CActiveDataProvider($this, array('criteria' => $criteria,));\n\t}", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('hol_id', $this->hol_id);\n $criteria->compare('loc_id', $this->loc_id);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search($params)\n {\n $this->__search($params);\n\n // grid filtering conditions\n $this->query\n\t ->andFilterWhere(['id' => $this->id])\n\t ->andFilterWhere(['like', 'description', $this->description])\n ->andFilterWhere(['like', 'type', $this->type]);\n\n return $this->dataProvider;\n }", "public function search()\r\n\t{\r\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\r\n\r\n\t\t$criteria = new CDbCriteria;\r\n\r\n\t\t$criteria->compare('doc_num', $this->doc_num, true);\r\n\t\t$criteria->compare('doc_num2', $this->doc_num2);\r\n\t\t$criteria->compare('doc_date', $this->doc_date, true);\r\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria' => $criteria,\r\n\t\t));\r\n\t}", "public function search()\n {\n $criteria = new CDbCriteria();\n\n $criteria->compare('productCategoryId', $this->productCategoryId, true);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('level', $this->level);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('name', $this->name, true);\n\t\t$criteria->compare('wikilink', $this->wikilink, true);\n\t\t$criteria->compare('picture', $this->picture, true);\n\t\t$criteria->compare('score', $this->score);\n\t\t$criteria->compare('modification_date', $this->modification_date, true);\n\t\t$criteria->compare('featured', $this->featured);\n\t\t$criteria->compare('users_found', $this->users_found);\n\t\t$criteria->compare('gpsdata', $this->gpsdata);\n\t\t$criteria->compare('category', $this->category);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}", "public function scopeSearch($query){\n if (request()->has('search_query') && !empty(request()->search_query) && request()->has('search_columns') && !empty(request()->search_columns) ) {\n \t$query = $this->getQuery($query , request()->search_columns , request()->search_query );\n }else{\n \tif (request()->has('search_query') && !empty(request()->search_query)) {\n \t\t$query = $this->getQuery($query , $this->fillable , request()->search_query );\n \t}\n }\n\n \n \n \n \n \n return $query;\n }", "public function search()\n {\n $criteria=new CDbCriteria;\n\n $criteria->compare('id',$this->id);\n $criteria->compare('title',$this->title,true);\n $criteria->compare('text',$this->text,true);\n $criteria->compare('author_id',$this->author_id);\n $criteria->compare('editor_id',$this->editor_id);\n $criteria->compare('crated_at',$this->crated_at,true);\n $criteria->compare('edited_at',$this->edited_at,true);\n $criteria->compare('publish_at',$this->publich_at,true);\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('date_start',$this->date_start,true);\n\t\t$criteria->compare('date_end',$this->date_end,true);\n\t\t$criteria->compare('count_attempt',$this->count_attempt);\n\t\t$criteria->compare('count_questions',$this->count_questions);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('date_create',$this->date_create,true);\n\t\t$criteria->compare('author',$this->author,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('latitud',$this->latitud,true);\n\t\t$criteria->compare('longitud',$this->longitud,true);\n\t\t$criteria->compare('telefono',$this->telefono,true);\n\t\t$criteria->compare('direccion',$this->direccion,true);\n\t\t$criteria->compare('web',$this->web,true);\n\t\t$criteria->compare('activo',$this->activo);\n\t\t$criteria->compare('userId',$this->userId);\n\t\t$criteria->compare('ratingGeneral',$this->ratingGeneral);\n\t\t$criteria->compare('youtubeUrl',$this->youtubeUrl,true);\n\t\t$criteria->compare('esDestacado',$this->esDestacado);\n\t\t$criteria->compare('aprobado',$this->aprobado);\n $criteria->compare('regionId',$this->regionId);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('id_user',$this->id_user);\n\t\t$criteria->compare('id_answer',$this->id_answer);\n\t\t$criteria->compare('mark',$this->mark);\n\t\t$criteria->compare('comment',$this->comment,true);\n\t\t$criteria->compare('time',$this->time,true);\n\t\t$criteria->compare('read_mark',$this->read_mark,true);\n\t\t$criteria->compare('marked_by',$this->marked_by,true);\n\t\t\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n// $criteria->compare('name', $this->name, true);\n $criteria->compare('description', $this->description, true);\n// $criteria->compare('alias', $this->alias, true);\n// $criteria->compare('module', $this->module, true);\n $criteria->compare('crud', $this->crud, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID);\n\t\t$criteria->compare('UserID',$this->UserID);\n\t\t$criteria->compare('ProviderID',$this->ProviderID);\n\t\t$criteria->compare('Date',$this->Date,true);\n\t\t$criteria->compare('RawID',$this->RawID);\n\t\t$criteria->compare('Document',$this->Document,true);\n\t\t$criteria->compare('State',$this->State,true);\n\t\t$criteria->compare('Temperature',$this->Temperature,true);\n\t\t$criteria->compare('Conditions',$this->Conditions,true);\n\t\t$criteria->compare('Expiration',$this->Expiration,true);\n\t\t$criteria->compare('Comments',$this->Comments,true);\n\t\t$criteria->compare('Quantity',$this->Quantity,true);\n\t\t$criteria->compare('Type',$this->Type,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array(\n \t'pageSize'=>Yii::app()->params['defaultPageSize'], \n ),\n\t\t));\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\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('sn',$this->sn,true);\n\t\t$criteria->compare('fn',$this->fn,true);\n\t\t$criteria->compare('region',$this->region);\n\t\t$criteria->compare('postal',$this->postal,true);\n\t\t$criteria->compare('inn',$this->inn,true);\n\t\t$criteria->compare('ogrn',$this->ogrn,true);\n\t\t$criteria->compare('okpo',$this->okpo,true);\n\t\t$criteria->compare('adress',$this->adress,true);\n\t\t$criteria->compare('tel',$this->tel,true);\n\t\t$criteria->compare('fax',$this->fax,true);\n\t\t$criteria->compare('okved',$this->okved,true);\n\t\t$criteria->compare('oid',$this->oid,true);\n\t\t$criteria->compare('hits',$this->hits);\n\t\t$criteria->compare('st',$this->st);\n\t\t$criteria->compare('alias',$this->alias,true);\n\t\t$criteria->compare('alias2',$this->alias2,true);\n\t\t$criteria->compare('alias3',$this->alias3,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('cardid', $this->cardid, true);\n $criteria->compare('subclassid', $this->subclassid, true);\n $criteria->compare('cardname', $this->cardname, true);\n\n return new ActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('pid', $this->pid, true);\n $criteria->compare('userName', $this->userName, true);\n $criteria->compare('userEmail', $this->userEmail, true);\n $criteria->compare('text', $this->text, true);\n $criteria->compare('userId', $this->userId, true);\n $criteria->compare('visibility', $this->visibility);\n $criteria->compare('date', $this->date, true);\n $criteria->compare('type', $this->type, true);\n $criteria->compare('recordId', $this->recordId, true);\n $criteria->compare('info', $this->info, true);\n $criteria->compare('new', $this->new, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('user', $this->user, true);\n $criteria->compare('amount', $this->amount);\n $criteria->compare('currency', $this->currency, true);\n $criteria->compare('valid_from', $this->valid_from, true);\n $criteria->compare('valid_to', $this->valid_to, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search () {\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('title', $this->title, true);\n\t\t$criteria->compare('description', $this->description, true);\n\t\t$criteria->compare('type', $this->type);\n\t\t$criteria->compare('required', $this->required);\n\t\t$criteria->compare('cId', $this->cId);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t 'criteria' => $criteria,\n\t\t ));\n\t}", "private function new_search()\n {\n $this->template = FALSE;\n \n $articulo = new articulo();\n $codfamilia = '';\n if( isset($_REQUEST['codfamilia']) )\n {\n $codfamilia = $_REQUEST['codfamilia'];\n }\n \n $con_stock = isset($_REQUEST['con_stock']);\n $this->results = $articulo->search($this->query, 0, $codfamilia, $con_stock);\n \n /// añadimos la busqueda\n foreach($this->results as $i => $value)\n {\n $this->results[$i]->query = $this->query;\n $this->results[$i]->dtopor = 0;\n }\n \n header('Content-Type: application/json');\n echo json_encode($this->results);\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('frequency_band',$this->frequency_band,true);\n\n\t\t$criteria->compare('date_of_issue',$this->date_of_issue,true);\n\n\t\t$criteria->compare('date_of_renewal',$this->date_of_renewal,true);\n\n\t\t$criteria->compare('emission',$this->emission,true);\n\n\t\t$criteria->compare('tolerance',$this->tolerance,true);\n\n\t\t$criteria->compare('application_vsat_id',$this->application_vsat_id,true);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\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/*\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('percent_discount',$this->percent_discount,true);\n\t\t$criteria->compare('taxable',$this->taxable);\n\t\t$criteria->compare('id_user_created',$this->id_user_created);\n\t\t$criteria->compare('id_user_modified',$this->id_user_modified);\n\t\t$criteria->compare('date_created',$this->date_created,true);\n\t\t$criteria->compare('date_modified',$this->date_modified,true);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t\t*/\n\t}", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('first_name', $this->first_name, true);\n $criteria->compare('last_name', $this->last_name, true);\n $criteria->compare('address', $this->address, true);\n $criteria->compare('contact_number', $this->contact_number, true);\n $criteria->compare('city', $this->city, true);\n $criteria->compare('gender', $this->gender, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->select = 'createDate, employeeId';\n\t\t$criteria->distinct = true;\n\t\t$criteria->addCondition('employeeId=\"' . $this->employeeId . '\" AND createDate between \"' . $this->startDate . '\" AND \"' . $this->endDate . '\"');\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}" ]
[ "0.7773856", "0.674291", "0.65721744", "0.6503215", "0.6472826", "0.6389071", "0.63745373", "0.6287255", "0.62671757", "0.62457365", "0.62425256", "0.62123144", "0.61969537", "0.6172912", "0.61250603", "0.6123412", "0.6116283", "0.61031115", "0.6101092", "0.608637", "0.6081774", "0.6081262", "0.6073599", "0.60723656", "0.60405684", "0.6040201", "0.6035497", "0.60331875", "0.60318124", "0.60199106", "0.6013893", "0.5998194", "0.59764904", "0.59671843", "0.59620416", "0.59579474", "0.59551156", "0.5941564", "0.5935285", "0.590389", "0.5899341", "0.5895071", "0.5894937", "0.5888715", "0.58834034", "0.5882613", "0.58762497", "0.58638185", "0.5860362", "0.5846486", "0.58438134", "0.5839541", "0.5829547", "0.5825096", "0.5821819", "0.5821492", "0.5816446", "0.5815201", "0.58059967", "0.58025193", "0.57952476", "0.5785819", "0.57808983", "0.57782406", "0.57766914", "0.5775805", "0.57744527", "0.57744527", "0.57744527", "0.57722074", "0.5771512", "0.5770783", "0.5769345", "0.57683945", "0.57675093", "0.576178", "0.57557786", "0.5747564", "0.5746954", "0.5745489", "0.5741678", "0.57375383", "0.57335705", "0.57302207", "0.57280165", "0.5726227", "0.57238483", "0.57218784", "0.5715393", "0.57136387", "0.5713353", "0.5711261", "0.5710481", "0.571002", "0.57075536", "0.57075375", "0.57060134", "0.5704971", "0.5703576", "0.57000446", "0.5696112" ]
0.0
-1
Create a new controller instance.
public function __construct() { // $this->middleware('auth'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function createController( ezcMvcRequest $request );", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}", "public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}", "private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se cre&oacute; correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}", "public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}", "public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }", "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }", "protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "public function makeTestController(TestController $controller)\r\n\t{\r\n\t}", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }", "public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}", "public function getController( );", "public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }", "static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }", "public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }", "private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }", "protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }", "public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }", "protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}", "public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }", "public function controller()\n\t{\n\t\n\t}", "protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}", "public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }", "public static function createController( MShop_Context_Item_Interface $context, $name = null );", "public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }", "public function getController();", "public function getController();", "public function getController();", "public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }", "private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }", "public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }", "public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }", "private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }", "static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }", "private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }", "public function AController() {\r\n\t}", "protected function initializeController() {}", "public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }", "function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }", "public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}", "public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}", "protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }", "public function create() {}", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }" ]
[ "0.82668066", "0.8173394", "0.78115296", "0.77052677", "0.7681875", "0.7659338", "0.74860525", "0.74064577", "0.7297601", "0.7252339", "0.7195181", "0.7174191", "0.70150065", "0.6989306", "0.69835985", "0.69732994", "0.6963521", "0.6935819", "0.68973273", "0.68920785", "0.6877748", "0.68702674", "0.68622285", "0.6839049", "0.6779292", "0.6703522", "0.66688496", "0.66600126", "0.6650373", "0.66436416", "0.6615505", "0.66144013", "0.6588728", "0.64483404", "0.64439476", "0.6429303", "0.6426485", "0.6303757", "0.6298291", "0.6293319", "0.62811387", "0.6258778", "0.62542456", "0.616827", "0.6162314", "0.61610043", "0.6139887", "0.613725", "0.61334985", "0.6132223", "0.6128982", "0.61092585", "0.6094611", "0.60889256", "0.6074893", "0.60660255", "0.6059098", "0.60565156", "0.6044235", "0.60288006", "0.6024102", "0.60225666", "0.6018304", "0.60134345", "0.60124683", "0.6010913", "0.6009284", "0.6001683", "0.5997471", "0.5997012", "0.59942573", "0.5985074", "0.5985074", "0.5985074", "0.5967613", "0.5952533", "0.5949068", "0.5942203", "0.5925731", "0.5914304", "0.5914013", "0.59119135", "0.5910308", "0.5910285", "0.59013796", "0.59003943", "0.5897524", "0.58964556", "0.58952993", "0.58918965", "0.5888943", "0.5875413", "0.5869938", "0.58627135", "0.58594996", "0.5853714", "0.5839484", "0.5832913", "0.582425", "0.58161044", "0.5815566" ]
0.0
-1
Show the application dashboard.
public function index(Request $request) { $data['gigs'] = Gigs::limit(3)->where('status',0)->where('deadline','>=',date('Y-m-d'))->orderBy('created_at','DESC')->get(); $data['services'] = Service::limit(4)->orderBy('created_at','DESC')->get(); $lang = ($request['is_api'])?$request->lang:app()->getLocale(); $categories = Category::where([['parent_id', 0],['featured',1]])->orderBy('name')->limit(6)->get(); $data['categories'] = $categories; // $data['current'] = ; $data['howitwork'] = config('staticpages_'.$lang.'.howitwork'); if ($request['is_api']) { } else { if(Auth::check()){ if (!$request->session()->has('member_type')) { $request->session()->put('member_type',Auth::user()->member_type); } } return view('home',$data); // return HTML response } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }", "function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}", "public function showDashboard() { \n\t\n return View('admin.dashboard');\n\t\t\t\n }", "public function showDashboard()\n {\n return View::make('users.dashboard', [\n 'user' => Sentry::getUser(),\n ]);\n }", "public function dashboard()\n {\n return view('backend.dashboard.index');\n }", "public function index() {\n return view(\"admin.dashboard\");\n }", "public function dashboard()\n {\n return $this->renderContent(\n view('dashboard'),\n trans('sleeping_owl::lang.dashboard')\n );\n }", "public function dashboard(){\n return view('backend.admin.index');\n }", "public function showDashBoard()\n {\n \treturn view('Admins.AdminDashBoard');\n }", "public function dashboard()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('admin.dashboard', ['title' => 'Dashboard']);\n }", "public function dashboard() \r\n {\r\n return view('admin.index');\r\n }", "public function dashboard()\n\t{\n\t\t$page_title = 'organizer dashboard';\n\t\treturn View::make('organizer.dashboard',compact('page_title'));\n\t}", "public function dashboard()\n {\n\t\t$traffic = TrafficService::getTraffic();\n\t\t$devices = TrafficService::getDevices();\n\t\t$browsers = TrafficService::getBrowsers();\n\t\t$status = OrderService::getStatus();\n\t\t$orders = OrderService::getOrder();\n\t\t$users = UserService::getTotal();\n\t\t$products = ProductService::getProducts();\n\t\t$views = ProductService::getViewed();\n\t\t$total_view = ProductService::getTotalView();\n\t\t$cashbook = CashbookService::getAccount();\n $stock = StockService::getStock();\n\n return view('backend.dashboard', compact('traffic', 'devices', 'browsers', 'status', 'orders', 'users', 'products', 'views', 'total_view', 'cashbook', 'stock'));\n }", "public function dashboard()\n {\n\n return view('admin.dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('adm.dashboard');\n }", "public function dashboard()\n {\n $users = \\App\\User::all()->count();\n $roles = \\Spatie\\Permission\\Models\\Role::all()->count();\n $permissions = \\Spatie\\Permission\\Models\\Permission::all()->count();\n $banner = \\App\\Banner::all();\n $categoria = \\App\\Categoria::all();\n $entidadOrganizativa = \\App\\Entidadorganizativa::all();\n $evento = \\App\\Evento::all();\n $fichero = \\App\\Fichero::all();\n $recurso = \\App\\Recurso::all();\n $redsocial = \\App\\Redsocial::all();\n $subcategoria = \\App\\Subcategoria::all();\n $tag = \\App\\Tag::all();\n\n $entities = \\Amranidev\\ScaffoldInterface\\Models\\Scaffoldinterface::all();\n\n return view('scaffold-interface.dashboard.dashboard',\n compact('users', 'roles', 'permissions', 'entities',\n 'banner', 'categoria', 'entidadOrganizativa',\n 'evento', 'fichero', 'recurso', 'redsocial', 'subcategoria', 'tag')\n );\n }", "public function show()\n {\n return view('dashboard');\n }", "public function index()\n\t{\n\t\treturn View::make('dashboard');\n\t}", "public function index() {\n return view('modules.home.dashboard');\n }", "public function show()\n {\n return view('dashboard.dashboard');\n \n }", "public function index()\n {\n return view('admin.dashboard.dashboard');\n\n }", "public function dashboard()\n { \n return view('jobposter.dashboard');\n }", "public function show()\n\t{\n\t\t//\n\t\t$apps = \\App\\application::all();\n\t\treturn view('applications.view', compact('apps'));\n\t}", "public function index()\n {\n return view('pages.admin.dashboard');\n }", "public function indexAction()\n {\n $dashboard = $this->getDashboard();\n\n return $this->render('ESNDashboardBundle::index.html.twig', array(\n 'title' => \"Dashboard\"\n ));\n }", "public function index()\n {\n //\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard.index');\n }", "public function dashboard()\n {\n return view('pages.backsite.dashboard');\n }", "public function index()\n {\n // return component view('dashboard.index');\n return view('layouts.admin_master');\n }", "public function index()\n {\n\n $no_of_apps = UploadApp::count();\n $no_of_analysis_done = UploadApp::where('isAnalyzed', '1')->count();\n $no_of_visible_apps = AnalysisResult::where('isVisible', '1')->count();\n\n return view('admin.dashboard', compact('no_of_apps', 'no_of_analysis_done', 'no_of_visible_apps'));\n }", "public function getDashboard() {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('smartcrud.auth.dashboard');\n }", "public function index()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n $this->global['pageTitle'] = 'Touba : Dashboard';\n \n $this->loadViews(\"dashboard\", $this->global, NULL , NULL);\n }", "public function dashboard() {\n $data = ['title' => 'Dashboard'];\n return view('pages.admin.dashboard', $data)->with([\n 'users' => $this->users,\n 'num_services' => Service::count(),\n 'num_products' => Product::count(),\n ]);\n }", "public function index()\n {\n return view('board.pages.dashboard-board');\n }", "public function index()\n {\n return view('admin::settings.development.dashboard');\n }", "public function index()\n {\n return view('dashboard.dashboard');\n }", "public function show()\n {\n return view('dashboard::show');\n }", "public function adminDash()\n {\n return Inertia::render(\n 'Admin/AdminDashboard', \n [\n 'data' => ['judul' => 'Halaman Admin']\n ]\n );\n }", "public function dashboard()\n {\n return view('Admin.dashboard');\n }", "public function show()\n {\n return view('admins\\auth\\dashboard');\n }", "public function index()\n {\n // Report =============\n\n return view('Admin.dashboard');\n }", "public function index()\n {\n return view('bitaac::account.dashboard');\n }", "public function index()\n { \n return view('admin-views.dashboard');\n }", "public function getDashboard()\n {\n return view('dashboard');\n }", "function showDashboard()\n { \n $logeado = $this->checkCredentials();\n if ($logeado==true)\n $this->view->ShowDashboard();\n else\n $this->view->showLogin();\n }", "public function index()\n { \n $params['crumbs'] = 'Home';\n $params['active'] = 'home';\n \n return view('admin.dashboard.index', $params);\n }", "public function index()\n\t{\n\t\treturn view::make('customer_panel.dashboard');\n\t}", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index() {\n // return view('home');\n return view('admin-layouts.dashboard.dashboard');\n }", "public function index()\r\n {\r\n return view('user.dashboard');\r\n }", "public function index() {\n return view('dashboard', []);\n }", "public function index()\n {\n //\n return view('dashboard.dashadmin', ['page' => 'mapel']);\n }", "public function index()\n {\n return view('back-end.dashboard.index');\n //\n }", "public function index()\n\t{\n\t\t\n\t\t$data = array(\n\t\t\t'title' => 'Administrator Apps With Laravel',\n\t\t);\n\n\t\treturn View::make('panel/index',$data);\n\t}", "public function index() {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('page.dashboard.index');\n }", "public function index()\n {\n\n return view('dashboard');\n }", "public function dashboardview() {\n \n $this->load->model('Getter');\n $data['dashboard_content'] = $this->Getter->get_dash_content();\n \n $this->load->view('dashboardView', $data);\n\n }", "public function index()\n {\n $this->authorize(DashboardPolicy::PERMISSION_STATS);\n\n $this->setTitle($title = trans('auth::dashboard.titles.statistics'));\n $this->addBreadcrumb($title);\n\n return $this->view('admin.dashboard');\n }", "public function action_index()\r\n\t{\t\t\t\t\r\n\t\t$this->template->title = \"Dashboard\";\r\n\t\t$this->template->content = View::forge('admin/dashboard');\r\n\t}", "public function index()\n {\n $info = SiteInfo::limit(1)->first();\n return view('backend.info.dashboard',compact('info'));\n }", "public function display()\n\t{\n\t\t// Set a default view if none exists.\n\t\tif (!JRequest::getCmd( 'view' ) ) {\n\t\t\tJRequest::setVar( 'view', 'dashboard' );\n\t\t}\n\n\t\tparent::display();\n\t}", "public function index()\n {\n $news = News::all();\n $posts = Post::all();\n $events = Event::all();\n $resources = Resources::all();\n $admin = Admin::orderBy('id', 'desc')->get();\n return view('Backend/dashboard', compact('admin', 'news', 'posts', 'events', 'resources'));\n }", "public function index()\n {\n\n return view('superAdmin.adminDashboard')->with('admin',Admininfo::all());\n\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n $this->template->set('title', 'Dashboard');\n $this->template->load('admin', 'contents' , 'admin/dashboard/index', array());\n }", "public function index()\n {\n return view('/dashboard');\n }", "public function index()\n {\n \treturn view('dashboard');\n }", "public function index()\n {\n return view('ketua.ketua-dashboard');\n }", "public function index(){\n return View::make('admin.authenticated.dashboardview');\n }", "public function admAmwDashboard()\n {\n return View::make('admission::amw.admission_test.dashboard');\n }", "public function index()\n {\n return view('adminpanel.home');\n }", "public function dashboard()\n\t{\n\t\t$this->validation_access();\n\t\t\n\t\t$this->load->view('user_dashboard/templates/header');\n\t\t$this->load->view('user_dashboard/index.php');\n\t\t$this->load->view('user_dashboard/templates/footer');\n\t}", "public function index()\n {\n return view('dashboard.home');\n }", "public function index()\n {\n $admins = $this->adminServ->all();\n $adminRoles = $this->adminTypeServ->all();\n return view('admin.administrators.dashboard', compact('admins', 'adminRoles'));\n }", "public function index()\n {\n if (ajaxCall::ajax()) {return response()->json($this -> dashboard);}\n //return response()->json($this -> dashboard);\n JavaScript::put($this -> dashboard);\n return view('app')-> with('header' , $this -> dashboard['header']);\n //return view('home');\n }", "public function index()\n {\n $userinfo=User::all();\n $gateinfo=GateEntry::all();\n $yarninfo=YarnStore::all();\n $greyinfo=GreyFabric::all();\n $finishinfo=FinishFabric::all();\n $dyesinfo=DyeChemical::all();\n return view('dashboard',compact('userinfo','gateinfo','yarninfo','greyinfo','finishinfo','dyesinfo'));\n }", "public function actionDashboard(){\n \t$dados_dashboard = Yii::app()->user->getState('dados_dashbord_final');\n \t$this->render ( 'dashboard', $dados_dashboard);\n }", "public function index()\n {\n $user = new User();\n $book = new Book();\n return view('admin.dashboard', compact('user', 'book'));\n }", "public function dashboard() {\n if (!Auth::check()) { // Check is user logged in\n // redirect to dashboard\n return Redirect::to('login');\n }\n\n $user = Auth::user();\n return view('site.dashboard', compact('user'));\n }", "public function dashboard()\n {\n $users = User::all();\n return view('/dashboard', compact('users'));\n }", "public function index()\n {\n $lineChart = $this->getLineChart();\n $barChart = $this->getBarChart();\n $pieChart = $this->getPieChart();\n\n return view('admin.dashboard.index', compact(['lineChart', 'barChart', 'pieChart']));\n }" ]
[ "0.77850926", "0.7760142", "0.7561336", "0.75147176", "0.74653697", "0.7464913", "0.73652893", "0.7351646", "0.7346477", "0.73420244", "0.7326711", "0.7316215", "0.73072463", "0.7287626", "0.72826403", "0.727347", "0.727347", "0.727347", "0.727347", "0.7251768", "0.7251768", "0.7251768", "0.7251768", "0.7251768", "0.7241342", "0.7236133", "0.7235562", "0.7218318", "0.71989936", "0.7197427", "0.71913266", "0.71790016", "0.71684825", "0.71577966", "0.7146797", "0.7133428", "0.7132746", "0.71298903", "0.71249074", "0.71218014", "0.71170413", "0.7110151", "0.7109032", "0.7107029", "0.70974076", "0.708061", "0.7075653", "0.70751685", "0.7064041", "0.70550334", "0.7053102", "0.7051273", "0.70484304", "0.7043605", "0.70393986", "0.70197886", "0.70185125", "0.70139873", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.6992477", "0.6979631", "0.69741416", "0.69741327", "0.6968815", "0.6968294", "0.69677526", "0.69652885", "0.69586027", "0.6944985", "0.69432825", "0.69419175", "0.6941512", "0.6941439", "0.6938837", "0.6937524", "0.6937456", "0.6937456", "0.69276494", "0.6921651", "0.69074917", "0.69020325", "0.6882262", "0.6869339", "0.6867868", "0.68557185", "0.68479055", "0.684518", "0.68408877", "0.6838798", "0.6833479", "0.6832326", "0.68309164", "0.6826798", "0.6812457" ]
0.0
-1
Display the specified resource.
public function show($id) { $other_material = OtherMaterial::findOrFail($id); return new OtherMaterialResource($other_material); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Get the registered name of the component.
protected static function getFacadeAccessor() { return 'filesystemPublicUrl'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getComponentName()\n {\n return $this->_componentName;\n }", "public function getComponentName()\n {\n $component = $this->argument('component') ?: app('components')->getUsedNow();\n\n $component = app('components')->findOrFail($component);\n\n return $component->getStudlyName();\n }", "public function get_component_name() {\n return $this->plugintype.'_'.$this->pluginname;\n }", "public function get_name() {\n if(get_config(constants::M_COMPONENT,'customname')){\n return get_config(constants::M_COMPONENT,'customname');\n }else {\n return get_string('pluginname', constants::M_COMPONENT);\n }\n }", "public function getComponentName(): string;", "public function get_component() : string\n {\n return $this->component;\n }", "protected function getComponentName(): string {\n if ($this->isPageTemplate()) {\n return \"{$this->layout}-{$this->post->post_type}\";\n }\n\n if (str_contains($this->componentId, '-')) {\n return implode('', \\__::chain($this->componentId)\n ->split('-')\n ->map(fn ($string) => \\__::capitalize($string))\n ->value());\n }\n\n return \\__::chain($this->componentId)\n ->camelCase()\n ->capitalize()\n ->value();\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n\t{\n\t\treturn $this->name ?: class_basename($this);\n\t}", "public function getName()\n\t{\n\t\treturn isset($this->_name) ? $this->_name : spl_object_hash($this);\n\t}", "public function getName() {\n return $this->get(self::NAME);\n }", "public function getName() {\n return $this->get(self::NAME);\n }", "public function getName() {\n return $this->get(self::NAME);\n }", "protected static function _getName()\n {\n return isset(static::$_name) ? static::$_name : get_called_class();\n }", "public function getName()\n {\n return $this->get(self::NAME);\n }", "public function getName()\n {\n return $this->get(self::NAME);\n }", "public static function getName(): string\n {\n return static::$name;\n }", "function getComponentName()\n {\n $p = get_class($this);\n\n $reflector = new ReflectionClass($p);\n $path = dirname($reflector->getFileName());\n\n $component = str_replace(BW_PATH_COMPONENTS . DS, '', $path);\n $component = str_replace(DS . 'models', '', $component);\n\n if (bwFolder::is(BW_PATH_COMPONENTS . DS . $component)) {\n return $component;\n } else {\n return NULL;\n }\n }", "public function getName() {\n return ($this->isInit()) ? $this->name : null;\n }", "function getName() {\n return $this->instance->getName();\n }", "public function name() : string\n {\n return call_user_func([get_called_class(), 'resolveName']);\n }", "public static function name()\n {\n return isset(static::$name) ? static::$name : self::getClassShortName();\n }", "public function get_registered_component( $name );", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n {\n return $this->str_name;\n }", "public function getName()\n\t{\n\t\treturn str_replace('\\\\', '_', __CLASS__);\n\t}", "function get_name()\n {\n return $this->get_default_property(self :: PROPERTY_NAME);\n }", "public function getName()\n {\n $value = $this->get(self::NAME);\n return $value === null ? (string)$value : $value;\n }", "public function getName()\n {\n $value = $this->get(self::NAME);\n return $value === null ? (string)$value : $value;\n }", "public function getName()\n {\n $value = $this->get(self::NAME);\n return $value === null ? (string)$value : $value;\n }", "public function getName(): string\n {\n return $this->getIdentifier()->getName();\n }", "public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }", "public function get_name() {\n\n\t\treturn $this->name;\n\t}", "public static function getName();", "public function getName()\n {\n return implode(',', $this->components['CN']);\n }", "function get_name()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_NAME);\r\n }", "public function getName() {\n\t\t\n\t\t// cut last part of class name\n\t\treturn substr( get_class( $this ), 0, -11 );\n\t\t\n\t}", "static public function getName(): string\n {\n return static::$name;\n }", "public function getName()\n {\n return $this->__get(\"name\");\n }", "public function getName()\n {\n return $this->__get(\"name\");\n }", "public function get_name() {\n return get_string('pluginname', 'forumngtype_' . $this->get_id());\n }", "public function getName()\n {\n switch ($this->queriedContext) {\n case $this->i8n('context-keyword'):\n return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-keyword') . ' : ' . $this->getInput('q');\n break;\n case $this->i8n('context-group'):\n return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-group') . ' : ' . $this->getKey('group');\n break;\n case $this->i8n('context-talk'):\n return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-talk') . ' : ' . $this->getTalkTitle();\n break;\n default: // Return default value\n return static::NAME;\n }\n }", "public function getName(): string {\n\t\t\treturn $this->name;\n\t\t}", "public function get_component_name() {\n return 'user';\n }", "public function name() {\n\t\treturn $this->name;\n\t}", "function getName () {\n\t\treturn $this->name;\n\t}", "public function get_name() {\n\t\treturn $this->name;\n\t}", "public function get_name() {\n\t\treturn $this->name;\n\t}", "public function get_name() {\n\t\treturn $this->name;\n\t}", "public function get_name() {\n\t\treturn $this->name;\n\t}", "public function getName(): string\n {\n\t\treturn $this->name;\n\t}", "public function getName ()\n {\n return $this->getLabel();\n }", "public function getName() {\n $path = explode('\\\\', get_class($this->object[\"data\"]));\n return array_pop($path);\n }", "public function getName() {\n return self::NAME;\n }", "public function getName() {\n\t\treturn $this->current_name;\n\t}", "public function getName () {\n\t\treturn $this->name;\n\t}", "public function getName()\n {\n return $this->__call(__FUNCTION__, func_get_args());\n }", "public function getName() {\n\t\treturn ($this->name);\n\t}", "public function getName()\n {\n return $this->getConfig ( 'name' );\n }", "public function getName(): string {\n return $this->name;\n }", "public function getName() {\n\t\treturn $this->_name;\n\t}", "public function getName() {\n\t\treturn $this->_name;\n\t}", "public function get_name(): string\n {\n return $this->name;\n }", "function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\r\n $parsed = Parser::parseClassName(get_class());\r\n return $parsed['className'];\r\n }", "public function getName()\n {\n return $this->getValue('name');\n }", "public function getName()\n {\n return isset($this->name) ? $this->name : '';\n }", "public function getName()\n {\n return isset($this->name) ? $this->name : '';\n }", "public function getName()\n {\n return isset($this->name) ? $this->name : '';\n }", "public function getName()\n {\n return isset($this->name) ? $this->name : '';\n }", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "public function name()\n\t{\n\t\treturn $this->name;\n\t}" ]
[ "0.8145252", "0.81059104", "0.79843503", "0.7875069", "0.7621859", "0.71461004", "0.7101458", "0.705496", "0.705496", "0.705496", "0.705496", "0.705496", "0.705496", "0.705496", "0.70394325", "0.70209575", "0.69877225", "0.69877225", "0.69877225", "0.6984164", "0.6965933", "0.6965933", "0.69652396", "0.69386864", "0.69140494", "0.68974113", "0.68967915", "0.68593174", "0.68486273", "0.68120587", "0.68120587", "0.67868453", "0.6775167", "0.6775155", "0.6755135", "0.6755135", "0.6755135", "0.6752984", "0.674242", "0.6710877", "0.670616", "0.6703415", "0.67011756", "0.6691306", "0.668469", "0.66830266", "0.66830266", "0.66790146", "0.66775", "0.66692185", "0.6668179", "0.66607153", "0.6660571", "0.6660436", "0.6660436", "0.6660436", "0.6660436", "0.66595274", "0.6658804", "0.66557944", "0.6651633", "0.66399175", "0.6633721", "0.6629492", "0.662811", "0.66218275", "0.6617998", "0.66178477", "0.66178477", "0.6610472", "0.6607344", "0.6605626", "0.66048145", "0.66030926", "0.66030926", "0.66030926", "0.66030926", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65966654", "0.65966654" ]
0.0
-1
Display a listing of the resource.
public function index() { $students = Student::all(); return view('student.index', compact('students')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { $countires = Country::pluck('name', 'id')->toArray(); return view('student.create', compact('countires')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $this->validate($request, [ 'name' => 'required', 'roll' => 'required' ]); Student::create($request->all()); return redirect()->route('student.index') ->with('success','Student created successfully'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { $student = Student::find($id) ->with('country') ->with('district') ->with('thana') ->with('courses') ->first(); return view('student.show', compact('student')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $student = Student::find($id); return view('student.edit',compact('student')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $this->validate($request, [ 'name' => 'required', 'roll' => 'required' ]); Student::find($id)->update($request->all()); return redirect()->route('student.index') ->with('success','Student updated successfully'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { Student::find($id)->delete(); return redirect()->route('student.index') ->with('success','Student deleted successfully'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Calculates the greatcircle distance between two points, with the Haversine formula.
function haversine($latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo, $earthRadius = 3963){ // convert from degrees to radians $latFrom = deg2rad($latitudeFrom); $lonFrom = deg2rad($longitudeFrom); $latTo = deg2rad($latitudeTo); $lonTo = deg2rad($longitudeTo); $latDelta = $latTo - $latFrom; $lonDelta = $lonTo - $lonFrom; $angle = 2 * asin(sqrt(pow(sin($latDelta / 2), 2) + cos($latFrom) * cos($latTo) * pow(sin($lonDelta / 2), 2))); return $angle * $earthRadius; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function haversineGreatCircleDistance(\n $latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo, $earthRadius = 6371000)\n{\n $latFrom = deg2rad($latitudeFrom);\n $lonFrom = deg2rad($longitudeFrom);\n $latTo = deg2rad($latitudeTo);\n $lonTo = deg2rad($longitudeTo);\n\n $latDelta = $latTo - $latFrom;\n $lonDelta = $lonTo - $lonFrom;\n\n $angle = 2 * asin(sqrt(pow(sin($latDelta / 2), 2) +\n cos($latFrom) * cos($latTo) * pow(sin($lonDelta / 2), 2)));\n return $angle * $earthRadius;\n}", "function haversineGreatCircleDistance($latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo, $earthRadius = 6371000)\n{\n // convert from degrees to radians\n $latFrom = deg2rad($latitudeFrom);\n $lonFrom = deg2rad($longitudeFrom);\n $latTo = deg2rad($latitudeTo);\n $lonTo = deg2rad($longitudeTo);\n\n $latDelta = $latTo - $latFrom;\n $lonDelta = $lonTo - $lonFrom;\n\n $angle = 2 * asin(sqrt(pow(sin($latDelta / 2), 2) +\n cos($latFrom) * cos($latTo) * pow(sin($lonDelta / 2), 2)));\n return $angle * $earthRadius;\n}", "function haversineGreatCircleDistance(\n $latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo, $earthRadius = 6371000)\n{\n // convert from degrees to radians\n $latFrom = deg2rad($latitudeFrom);\n $lonFrom = deg2rad($longitudeFrom);\n $latTo = deg2rad($latitudeTo);\n $lonTo = deg2rad($longitudeTo);\n\n $latDelta = $latTo - $latFrom;\n $lonDelta = $lonTo - $lonFrom;\n\n $angle = 2 * asin(sqrt(pow(sin($latDelta / 2), 2) +\n cos($latFrom) * cos($latTo) * pow(sin($lonDelta / 2), 2)));\n return $angle * $earthRadius;\n}", "function distance($lat_1, $lon_1, $lat_2, $lon_2) {\n\n $radius_earth = 6371; // Радиус Земли\n\n $lat_1 = deg2rad($lat_1);\n $lon_1 = deg2rad($lon_1);\n $lat_2 = deg2rad($lat_2);\n $lon_2 = deg2rad($lon_2);\n\n $d = 2 * $radius_earth * asin(sqrt(sin(($lat_2 - $lat_1) / 2) ** 2 + cos($lat_1) * cos($lat_2) * sin(($lon_2 - $lon_1) / 2) ** 2));\n//\n return number_format($d, 2, '.', '');\n}", "public function haversineGreatCircleDistance(\n $latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo, $earthRadius = 6371000)\n{\n $latFrom = deg2rad($latitudeFrom);\n $lonFrom = deg2rad($longitudeFrom);\n $latTo = deg2rad($latitudeTo);\n $lonTo = deg2rad($longitudeTo);\n\n $latDelta = $latTo - $latFrom;\n $lonDelta = $lonTo - $lonFrom;\n\n $angle = 2 * asin(sqrt(pow(sin($latDelta / 2), 2) +\n cos($latFrom) * cos($latTo) * pow(sin($lonDelta / 2), 2)));\n return $angle * $earthRadius;\n}", "public function haversineGreatCircleDistance($latitude_from, $longitude_from, $latitude_to, $longitude_to)\n {\n # Ref: http://www.movable-type.co.uk/scripts/latlong.html\n\n // converting from degrees to radians\n $latitude_from_radian = deg2rad($latitude_from);\n $longitude_from_radian = deg2rad($longitude_from);\n $latitude_to_radian = deg2rad($latitude_to);\n $longitude_to_radian = deg2rad($longitude_to);\n\n $latitude_delta = $latitude_to_radian - $latitude_from_radian;\n $longitude_delta = $longitude_to_radian - $longitude_from_radian;\n\n # Harversine formula implementation\n $angle = 2 * asin(\n sqrt(\n pow(\n sin($latitude_delta / 2), 2) + cos($latitude_from_radian) * cos($latitude_to_radian) * pow(sin($longitude_delta / 2), 2\n )\n )\n );\n\n return $angle * $this->earth_radius;\n }", "function haversineGreatCircleDistance(\n $latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo, $earthRadius = 6371000) {\n // convert from degrees to radians\n $latFrom = deg2rad($latitudeFrom);\n $lonFrom = deg2rad($longitudeFrom);\n $latTo = deg2rad($latitudeTo);\n $lonTo = deg2rad($longitudeTo);\n\n $latDelta = $latTo - $latFrom;\n $lonDelta = $lonTo - $lonFrom;\n\n $angle = 2 * asin(sqrt(pow(sin($latDelta / 2), 2) +\n cos($latFrom) * cos($latTo) * pow(sin($lonDelta / 2), 2)));\n return $angle * $earthRadius;\n}", "function dist(float $lat1, float $lon1, float $lat2, float $lon2): float\n{\n $R = 6371e3; // earth radius, metres\n\n // convert degrees to radians\n $lat1 = ($lat1 / 180) * M_PI;\n $lat2 = ($lat2 / 180) * M_PI;\n $lon1 = ($lon1 / 180) * M_PI;\n $lon2 = ($lon2 / 180) * M_PI;\n // caclulate differences between latitude and longitude\n $dlat = $lat2 - $lat1;\n $dlon = $lon2 - $lon1;\n\n // Haversine distance formula\n $a = sin($dlat / 2) * sin($dlat / 2)\n + cos($lat1) * cos($lat2)\n * sin($dlon / 2) * sin($dlon / 2);\n\n $c = 2 * atan2(sqrt($a), sqrt(1 - $a));\n return $R * $c;\n}", "function haversineGreatCircleDistance($latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo, $earthRadius = 6371000) {\n\t\t// convert from degrees to radians\n\t\t$latFrom = deg2rad($latitudeFrom);\n\t\t$lonFrom = deg2rad($longitudeFrom);\n\t\t$latTo = deg2rad($latitudeTo);\n\t\t$lonTo = deg2rad($longitudeTo);\n\n\t\t$latDelta = $latTo - $latFrom;\n\t\t$lonDelta = $lonTo - $lonFrom;\n\n\t\t$angle = 2 * asin(sqrt(pow(sin($latDelta / 2), 2) +\n\t\t\tcos($latFrom) * cos($latTo) * pow(sin($lonDelta / 2), 2)));\n\t\treturn $angle * $earthRadius;\n\t}", "function distance($latlon1, $latlon2) {\n\t$angle = acos(sin(deg2rad($latlon1[0])) * sin(deg2rad($latlon2[0])) + cos(deg2rad($latlon1[0])) * cos(deg2rad($latlon2[0])) * cos(deg2rad($latlon1[1] - $latlon2[1])));\n\t$earthradius_km = 6372.8;\n\treturn $earthradius_km * $angle;\n}", "function distHaversine($coorA,$coorB)\n\t{\n\t\t\t$R = 6371;\n\t\t\n\t\t\t$coord_a = explode(\",\",$coorA);\n\t\t\t$coord_b = explode(\",\",$coorB);\n\t\t\t$dLat = ($coord_b[0] - $coord_a[0]) * M_PI / 180;\n\t\t\t$dLong = ($coord_b[1] - $coord_a[1]) * M_PI / 180;\n\t\t\t$a = sin($dLat/2) * sin($dLat/2) + cos((($coord_a[0])* M_PI / 180)) * cos((($coord_b[0])* M_PI / 180)) * sin($dLong/2) * sin($dLong/2);\n\t\t\t$c = 2 * atan2(sqrt($a), sqrt(1-$a));\n\t\t\t$d = $R * $c;\n\t\t $resp = (round($d, 2));\n\t\t\treturn $resp;\n\t\t\n # hasil akhir dalam satuan kilometer\n\t\t\n\t}", "private function haversineGreatCircleDistance(\n $latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo, $earthRadius = 6371000)\n {\n $latFrom = deg2rad($latitudeFrom);\n $lonFrom = deg2rad($longitudeFrom);\n $latTo = deg2rad($latitudeTo);\n $lonTo = deg2rad($longitudeTo);\n\n $latDelta = $latTo - $latFrom;\n $lonDelta = $lonTo - $lonFrom;\n\n $angle = 2 * asin(sqrt(pow(sin($latDelta / 2), 2) +\n cos($latFrom) * cos($latTo) * pow(sin($lonDelta / 2), 2)));\n return 0.000621371*$angle * $earthRadius;\n }", "public function greatCircleDistance($latitude_from, $longitude_from, $latitude_to, $longitude_to) {\n # Ref: https://en.wikipedia.org/wiki/Great-circle_distance\n\n $latitude_from_radian = deg2rad($latitude_from);\n $longitude_from_radian = deg2rad($longitude_from);\n $latitude_to_radian = deg2rad($latitude_to);\n $longitude_to_radian = deg2rad($longitude_to);\n\n $latitude_delta = $latitude_to_radian - $latitude_from_radian;\n $longitude_delta = $longitude_to_radian - $longitude_from_radian;\n\n $angle = acos(\n sin($latitude_from_radian) * sin($latitude_to_radian) + cos($latitude_from_radian) * cos($latitude_to_radian) * cos($longitude_delta)\n );\n\n return $angle * $this->earth_radius;\n }", "function distance($lat1, $lon1, $lat2, $lon2)\n{\n if (($lat1 == $lat2) && ($lon1 == $lon2)) {\n return 0;\n } else {\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist) * 60 * 1.853159616;\n return $dist;\n }\n}", "function vincentyGreatCircleDistance(\r\n $latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo, $earthRadius = 3959 )\r\n{\r\n $latFrom = deg2rad($latitudeFrom);\r\n $lonFrom = deg2rad($longitudeFrom);\r\n $latTo = deg2rad($latitudeTo);\r\n $lonTo = deg2rad($longitudeTo);\r\n\r\n $lonDelta = $lonTo - $lonFrom;\r\n $a = pow(cos($latTo) * sin($lonDelta), 2) +\r\n pow(cos($latFrom) * sin($latTo) - sin($latFrom) * cos($latTo) * cos($lonDelta), 2);\r\n $b = sin($latFrom) * sin($latTo) + cos($latFrom) * cos($latTo) * cos($lonDelta);\r\n\r\n $angle = atan2(sqrt($a), $b);\r\n return $angle * $earthRadius;\r\n}", "function distance($lat1,$lon1,$lat2,$lon2){\n $delta_lat = $lat2-$lat1;\n $delta_lon = $lon2-$lon1;\n return (($delta_lat * $delta_lat) + ($delta_lon * $delta_lon));\n}", "function vincentyGreatCircleDistance($latitudeFrom,$longitudeFrom,$latitudeTo,$longitudeTo,$earthRadius=6371000){\n\t\t\t\t\t$latFrom = deg2rad($latitudeFrom);\n\t\t\t\t\t$lonFrom = deg2rad($longitudeFrom);\n\t\t\t\t\t$latTo = deg2rad($latitudeTo);\n\t\t\t\t\t$lonTo = deg2rad($longitudeTo);\n\t\t\t\t\t$lonDelta = $lonTo - $lonFrom;\n\t\t\t\t\t$a = pow(cos($latTo)*sin($lonDelta),2)+pow(cos($latFrom)*sin($latTo)-sin($latFrom)*cos($latTo)*cos($lonDelta),2);\n\t\t\t\t\t$b = sin($latFrom)*sin($latTo)+cos($latFrom)*cos($latTo)*cos($lonDelta);\n\t\t\t\t\t$angle = atan2(sqrt($a), $b);\n\t\t\t\t\treturn $angle * $earthRadius;\n\t\t\t\t}", "function vincentyGreatCircleDistance(\n $latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo, $earthRadius = 6371000)\n {\n $latFrom = deg2rad($latitudeFrom);\n $lonFrom = deg2rad($longitudeFrom);\n $latTo = deg2rad($latitudeTo);\n $lonTo = deg2rad($longitudeTo);\n \n $lonDelta = $lonTo - $lonFrom;\n $a = pow(cos($latTo) * sin($lonDelta), 2) +\n pow(cos($latFrom) * sin($latTo) - sin($latFrom) * cos($latTo) * cos($lonDelta), 2);\n $b = sin($latFrom) * sin($latTo) + cos($latFrom) * cos($latTo) * cos($lonDelta);\n \n $angle = atan2(sqrt($a), $b);\n return $angle * $earthRadius;\n }", "function vincentyGreatCircleDistance(\n $latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo, $earthRadius = 6371000)\n{\n // convert from degrees to radians\n $latFrom = deg2rad($latitudeFrom);\n $lonFrom = deg2rad($longitudeFrom);\n $latTo = deg2rad($latitudeTo);\n $lonTo = deg2rad($longitudeTo);\n\n $lonDelta = $lonTo - $lonFrom;\n $a = pow(cos($latTo) * sin($lonDelta), 2) +\n pow(cos($latFrom) * sin($latTo) - sin($latFrom) * cos($latTo) * cos($lonDelta), 2);\n $b = sin($latFrom) * sin($latTo) + cos($latFrom) * cos($latTo) * cos($lonDelta);\n\n $angle = atan2(sqrt($a), $b);\n return $angle * $earthRadius;\n}", "function calcDist($lat_A, $long_A, $lat_B, $long_B)\r\n{\r\n\r\n $distance = sin(deg2rad($lat_A))\r\n * sin(deg2rad($lat_B))\r\n + cos(deg2rad($lat_A))\r\n * cos(deg2rad($lat_B))\r\n * cos(deg2rad($long_A - $long_B));\r\n\r\n $distance = (rad2deg(acos($distance))) * 69.09;\r\n\r\n return $distance;\r\n}", "function distance_slc($lat1, $lon1, $lat2, $lon2) {\n\t\t$earth_radius = 3960.00; # in miles\n\t\t$delta_lat = $lat2 - $lat1 ;\n\t\t$delta_lon = $lon2 - $lon1 ;\n\t\t$distance = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($delta_lon)) ;\n\t\t$distance = acos($distance);\n\t\t$distance = rad2deg($distance);\n\t\t$distance = $distance * 60 * 1.1515;\n\t\t$distance = round($distance, 4);\n\t\n\t\treturn $distance;\n\t}", "function distance($point1, $point2) {\n\t\t$lat1 = $point1[0];\n\t\t$long1 = $point1[1];\n\n\t\t$lat2 = $point2[0];\n\t\t$long2 = $point2[1];\n\n\t\t$deltaLat = $this -> toRadians($lat2 - $lat1);\n\t\t$deltaLon = $this -> toRadians($long2 - $long1);\n\n\t\t$a = sin($deltaLat / 2) * sin($deltaLat / 2) + cos($this -> toRadians($lat1)) * cos($this -> toRadians($lat2)) * sin($deltaLon / 2) * sin($deltaLon / 2);\n\n\t\t$c = 2 * asin(sqrt($a));\n\n\t\treturn $this -> EARTH_RADIUS * $c;\n\t}", "public function haversineGreatCircleDistance($latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo, $earthRadius = 6371000){\n $latFrom = deg2rad($latitudeFrom);\n $lonFrom = deg2rad($longitudeFrom);\n $latTo = deg2rad($latitudeTo);\n $lonTo = deg2rad($longitudeTo);\n\n $latDelta = $latTo - $latFrom;\n $lonDelta = $lonTo - $lonFrom;\n\n $angle = 2 * asin(sqrt(pow(sin($latDelta / 2), 2) +\n cos($latFrom) * cos($latTo) * pow(sin($lonDelta / 2), 2)));\n return $angle * $earthRadius;\n }", "function Calculate($dblLat1, $dblLong1, $dblLat2, $dblLong2) {\n $EARTH_RADIUS_MILES = 3963;\n $dist = 0;\n //convert degrees to radians\n $dblLat1 = $dblLat1 * M_PI / 180;\n $dblLong1 = $dblLong1 * M_PI / 180;\n $dblLat2 = $dblLat2 * M_PI / 180;\n $dblLong2 = $dblLong2 * M_PI / 180;\n if ($dblLat1 != $dblLat2 || $dblLong1 != $dblLong2) {\n //the two points are not the same\n $dist = sin($dblLat1) * sin($dblLat2) + cos($dblLat1) * cos($dblLat2) * cos($dblLong2 - $dblLong1);\n $dist = $EARTH_RADIUS_MILES * (-1 * atan($dist / sqrt(1 - $dist * $dist)) + M_PI / 2);\n }\n return $dist;\n }", "function distanceCalculation($point1_lat, $point1_long, $point2_lat, $point2_long, $unit = 'km' ,$decimals = 2){\n\n $degrees = rad2deg(acos((sin(deg2rad($point1_lat))*sin(deg2rad($point2_lat))) + (cos(deg2rad($point1_lat))*cos(deg2rad($point2_lat))*cos(deg2rad($point1_long-$point2_long)))));\n\n switch($unit){\n \n case 'km':\n $distance = $degrees * 111.13384;\n break;\n\n case 'mi':\n $distance = $degrees * 69.05482;\n break;\n\n case 'nmi':\n $distance = $degrees * 59.97662;\n\n }\n\n //echo \"la distancia entre lat: \".$point1_lat.\" long: \".$point1_long. \" y lat2: \".$point2_lat.\" long: \".$point2_long.\"es de \". round($distance,$decimals) . \"\\n\";\n\n return round($distance, $decimals);\n\n\n}", "function distance($v1, $v2)\r\n{\r\n return sqrt(pow(($v1[0]-$v2[0]),2)+pow(($v1[1]-$v2[1]),2));//計算座標2點的距離\r\n}", "function distance_calculator($lat1 = 0, $lng1 = 0, $lat2 = 0, $lng2 = 0, $miles = FALSE) {\n\t$latDegr1 = $lat1 / 180 * pi();\n\t$lngDegr1 = $lng1 / 180 * pi();\n\t\t\n\t$latDegr2 = $lat2 / 180 * pi();\n\t$lngDegr2 = $lng2 / 180 * pi();\n\t\t\n\t$e = acos( sin( $latDegr1 ) * sin( $latDegr2 ) + cos( $latDegr1 ) * cos( $latDegr2 ) * cos( $lngDegr2 - $lngDegr1 ) );\n\tif( $miles ) return round( $e * 3963.191, 2);\n\telse return round( $e * 6378.137, 2 );\n}", "function calcDist( $lat, $long, $lat2, $long2){\n $lat_rad = floatval($lat) * pi() / 180;\n $long_rad = floatval($long) *pi() / 180;\n $lat_rad2 = $lat2 * pi() / 180;\n $long_rad2 = $long2 *pi() / 180;\n\n $distance = (ACOS(COS($lat_rad) * COS($long_rad) * COS($lat_rad2) * COS($long_rad2) + COS($lat_rad) * SIN($long_rad) * COS($lat_rad2) * SIN($long_rad2) + SIN($lat_rad) * SIN($lat_rad2)) * 6371) * 1.15;\n $distance = round($distance,2);\n return $distance;\n }", "public function calculateDistance(Point $a, Point $b)\n\t{\n\t\t$R = 6371; // km\n\t\t$dLat = deg2rad(abs($b->getLatitude() - $a->getLatitude()));\n\t\t$dLon = deg2rad(abs($b->getLongitude() - $a->getLongitude()));\n\t\t$lat1 = deg2rad($a->getLatitude());\n\t\t$lat2 = deg2rad($b->getLatitude());\n\n\t\t$a = sin($dLat / 2) * sin($dLat / 2)\n\t\t\t+ sin($dLon / 2) * sin($dLon / 2) * cos($lat1) * cos($lat2);\n\t\t$c = 2 * atan2(sqrt($a), sqrt(1 - $a));\n\n\t\treturn $R * $c;\n\t}", "function getDistance($coord1,$coord2) {\r\n\t$x=($coord1['x']-$coord2['x'])*($coord1['x']-$coord2['x']);\r\n\t$y=($coord1['y']-$coord2['y'])*($coord1['y']-$coord2['y']);\r\n\treturn sqrt($x+$y);\r\n}", "private function calculateHaversineDistance(\n float $startLatitude,\n float $endLatitude,\n float $deltaLatitude,\n float $deltaLongitude\n ): float {\n return asin(\n sqrt(\n pow(\n sin($deltaLatitude * 0.5),\n 2\n )\n + cos($startLatitude)\n * cos($endLatitude)\n * pow(\n sin($deltaLongitude * 0.5),\n 2\n )\n )\n ) * 2;\n }", "public function getRoughPairDistance($lat1,$lon1,$lat2,$lon2){\n //It spits out a back-of-napkin distance between two points.\n //Precision is somewhat limited, but ok for our purpose. See disclaimer above. \n $latdistance = abs($lat1 - $lat2)/$this->latmile;\n $londistance = abs($lon1 - $lon2)/$this->lonmile;\n $distance = sqrt(pow($latdistance,2)+pow($londistance,2));\n return($distance);\n }", "public function testDistanceBetweenAppleAndGoogleUsingHaversine()\n {\n $distance = new Distance();\n $distance->setUnit('m');\n $distance->setFormula('haversine');\n\n $this->assertEquals(11164, $distance->between(37.331741, -122.030333, 37.422546, -122.084250));\n\n $distance->setUnit('km');\n\n $this->assertEquals(11.164, $distance->between(37.331741, -122.030333, 37.422546, -122.084250));\n\n $distance->setUnit('mi');\n\n $this->assertEquals(6.936987987488, $distance->between(37.331741, -122.030333, 37.422546, -122.084250));\n\n $distance->setUnit('cm');\n\n $this->assertEquals(1116400, $distance->between(37.331741, -122.030333, 37.422546, -122.084250));\n\n $distance->setUnit('ft');\n\n $this->assertEquals(36627.2966436, $distance->between(37.331741, -122.030333, 37.422546, -122.084250));\n\n $distance->setUnit('in');\n\n $this->assertEquals(439527.5586068, $distance->between(37.331741, -122.030333, 37.422546, -122.084250));\n }", "private static function getDistanceBetweenPointsNew(float $latitude1, float $longitude1, float $latitude2, float $longitude2, string $unit = 'miles') : float\n {\n $theta = floatval($longitude1) - floatval($longitude2);\n $distance = (sin(deg2rad(floatval($latitude1))) * sin(deg2rad(floatval($latitude2)))) + (cos(deg2rad(floatval($latitude1))) * cos(deg2rad(floatval($latitude2))) * cos(deg2rad($theta)));\n $distance = acos($distance);\n $distance = rad2deg($distance);\n $distance = $distance * 60 * 1.1515;\n\n if ($unit == 'kilometers') {\n $distance = $distance * 1.609344;\n }\n\n return round($distance, 2);\n }", "function haversine(\n $latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo, $earthRadius = 3963.1676)\n{\n $latFrom = deg2rad($latitudeFrom);\n $lonFrom = deg2rad($longitudeFrom);\n $latTo = deg2rad($latitudeTo);\n $lonTo = deg2rad($longitudeTo);\n\n $latDelta = $latTo - $latFrom;\n $lonDelta = $lonTo - $lonFrom;\n\n $angle = 2. * asin(sqrt(pow(sin($latDelta / 2.), 2) + cos($latFrom) * cos($latTo) * pow(sin($lonDelta / 2.), 2)));\n return $angle * $earthRadius;\n}", "function distance($lat1, $lon1, $lat2, $lon2, $unit = \"M\") {\n\n\t\t$theta = $lon1 - $lon2;\n\t\t$dist = acos(sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)));\n\t\t$dist = rad2deg($dist);\n\t\t$dist = $dist * 60 * 1.1515;\n\t\t$unit = strtoupper($unit);\n\t\n\t\tif ($unit == \"K\") {\n\t\t\t$dist = $dist * 1.609344;\n\t\t} else if ($unit == \"N\") {\n\t\t\t$dist = $dist * 0.8684;\n\t\t}\n\t\treturn round($dist,1);\n\t}", "static public function distance($lat1, $lon1, $lat2, $lon2) {\n\t\t$rad1 = deg2rad($lat1);\n\t\t$rad2 = deg2rad($lat2);\n\t\t$dist = sin($rad1) * sin($rad2) + cos($rad1) * cos($rad2) * cos(deg2rad($lon1 - $lon2)); \n\t\t$dist = acos($dist); \n\t\t$dist = rad2deg($dist); \n\t\t$miles = $dist * 60 * 1.1515;\n\n\t\tif (is_nan($miles))\n\t\t\treturn 0;\n\t\n\t\treturn ($miles * 1.609344);\n\t}", "function calculateDistance($aLon, $aLat, $bLon, $bLat, $unit = KILOMETERS)\n{\n $sinHalfDeltaLat = sin(deg2rad($bLat - $aLat) / 2.0);\n $sinHalfDeltaLon = sin(deg2rad($bLon - $aLon) / 2.0);\n $lonSqrd = $sinHalfDeltaLon * $sinHalfDeltaLon;\n $latSqrd = $sinHalfDeltaLat * $sinHalfDeltaLat;\n $angle = 2 * asin(\n sqrt($latSqrd + cos(deg2rad($aLat)) * cos(deg2rad($bLat)) * $lonSqrd)\n );\n return $unit * $angle;\n}", "function distanceBetweenTowPlaces($latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo)\n{\n $long1 = deg2rad($longitudeFrom);\n $long2 = deg2rad($longitudeTo);\n $lat1 = deg2rad($latitudeFrom);\n $lat2 = deg2rad($latitudeTo);\n //Haversine Formula\n $dlong = $long2 - $long1;\n $dlati = $lat2 - $lat1;\n $val = pow(sin($dlati / 2), 2) + cos($lat1) * cos($lat2) * pow(sin($dlong / 2), 2);\n $res = 2 * asin(sqrt($val));\n $radius = 6367.756;\n return ($res * $radius);\n}", "function distance(\n $latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo, $earthRadius = 6371000)\n{\n $latFrom = deg2rad($latitudeFrom);\n $lonFrom = deg2rad($longitudeFrom);\n $latTo = deg2rad($latitudeTo);\n $lonTo = deg2rad($longitudeTo);\n\n $latDelta = $latTo - $latFrom;\n $lonDelta = $lonTo - $lonFrom;\n\n $angle = 2 * asin(sqrt(pow(sin($latDelta / 2), 2) +\n cos($latFrom) * cos($latTo) * pow(sin($lonDelta / 2), 2)));\n return $angle * $earthRadius;\n}", "function calculateDistance($first, $second)\r\n{\r\n return abs($first - $second);\r\n}", "public function getDistanceBetweenTwoPoints($point1 , $point2){\n $earthRadius = 6371; // earth radius in km\n $point1Lat = $point1['latitude'];\n $point2Lat =$point2['latitude'];\n $deltaLat = deg2rad($point2Lat - $point1Lat);\n $point1Long =$point1['longitude'];\n $point2Long =$point2['longitude'];\n $deltaLong = deg2rad($point2Long - $point1Long);\n $a = sin($deltaLat/2) * sin($deltaLat/2) + cos(deg2rad($point1Lat)) * cos(deg2rad($point2Lat)) * sin($deltaLong/2) * sin($deltaLong/2);\n $c = 2 * atan2(sqrt($a), sqrt(1-$a));\n\n $distance = $earthRadius * $c;\n return $distance; // in km\n }", "function distance($lat1, $lon1, $lat2, $lon2, $unit)\n{\n if (($lat1 == $lat2) && ($lon1 == $lon2)) {\n return round(0, 2);\n } else {\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n $unit = strtoupper($unit);\n\n if ($unit == \"K\") {\n return round(($miles * 1.609344), 2);\n } else if ($unit == \"N\") {\n return round(($miles * 0.8684), 2);\n } else {\n return round($miles, 2);\n }\n }\n}", "function distance($lat1, $lon1, $lat2, $lon2)\r\n {\r\n if ($lat1 == $lat2 && $lon1 == $lon2) return 0;\r\n $unit = 'M'; // miles please!\r\n $theta = $lon1 - $lon2;\r\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\r\n $dist = acos($dist);\r\n $dist = rad2deg($dist);\r\n $miles = $dist * 60 * 1.1515;\r\n $unit = strtoupper($unit);\r\n\r\n if ($unit == \"K\") {\r\n return ($miles * 1.609344);\r\n } else if ($unit == \"N\") {\r\n return ($miles * 0.8684);\r\n } else {\r\n return $miles;\r\n }\r\n }", "function distanceCalculation($point1_lat, $point1_long, $point2_lat, $point2_long, $unit = 'km', $decimals = 2) {\n\t// Calculate the distance in degrees\n\t$degrees = rad2deg(acos((sin(deg2rad($point1_lat))*sin(deg2rad($point2_lat))) + (cos(deg2rad($point1_lat))*cos(deg2rad($point2_lat))*cos(deg2rad($point1_long-$point2_long)))));\n \n\t// Convert the distance in degrees to the chosen unit (kilometres, miles or nautical miles)\n\tswitch($unit) {\n\t\tcase 'km':\n\t\t\t$distance = $degrees * 111.13384; // 1 degree = 111.13384 km, based on the average diameter of the Earth (12,735 km)\n\t\t\tbreak;\n\t\tcase 'mi':\n\t\t\t$distance = $degrees * 69.05482; // 1 degree = 69.05482 miles, based on the average diameter of the Earth (7,913.1 miles)\n\t\t\tbreak;\n\t\tcase 'nmi':\n\t\t\t$distance = $degrees * 59.97662; // 1 degree = 59.97662 nautic miles, based on the average diameter of the Earth (6,876.3 nautical miles)\n\t}\n\treturn round($distance, $decimals);\n}", "function sphere_distance($lat1, $lon1, $lat2, $lon2, $radius = 6378.135) {\r\n\t$rad = doubleval(M_PI/180.0);\r\n\t\r\n\t$lat1 = doubleval($lat1) * $rad;\r\n\t$lon1 = doubleval($lon1) * $rad;\r\n\t$lat2 = doubleval($lat2) * $rad;\r\n\t$lon2 = doubleval($lon2) * $rad;\r\n\t\r\n\t$theta = $lon2 - $lon1;\r\n\t$dist = acos(sin($lat1) * sin($lat2) +\r\n\t\tcos($lat1) * cos($lat2) *\r\n\t\tcos($theta));\r\n\tif($dist < 0) { \r\n\t\t$dist += M_PI; \r\n\t}\r\n\t// Default is Earth equatorial radius in kilometers\r\n\treturn $dist = $dist * $radius;\r\n}", "public function calculateDistance(Point $from, Point $to): float;", "function getDistance($lat1, $lon1, $lat2, $lon2) {\n if(!$lat1 || !$lat2 || !$lon1 || !$lon2){\n return NULL;\n }\n\n if (($lat1 == $lat2) && ($lon1 == $lon2)) {\n return 0;\n }\n else {\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n\n return ($miles * 1.609344);\n }\n }", "function distance($lat1, $lng1, $lat2, $lng2, $miles = true)\n{\n\t$pi80 = M_PI / 180;\n\t$lat1 *= $pi80;\n\t$lng1 *= $pi80;\n\t$lat2 *= $pi80;\n\t$lng2 *= $pi80;\n\n\t$r = 6372.797; // mean radius of Earth in km\n\t$dlat = $lat2 - $lat1;\n\t$dlng = $lng2 - $lng1;\n\t$a = sin($dlat / 2) * sin($dlat / 2) + cos($lat1) * cos($lat2) * sin($dlng / 2) * sin($dlng / 2);\n\t$c = 2 * atan2(sqrt($a), sqrt(1 - $a));\n\t$km = $r * $c;\n\n\treturn ($miles ? ($km * 0.621371192) : $km);\n}", "public static function getDistanceBetweenPoints($latitude1, $longitude1, $latitude2, $longitude2, $unit = 'Mi') \n { \n $theta = $longitude1 - $longitude2; \n $distance = (sin(deg2rad($latitude1)) * sin(deg2rad($latitude2))) + (cos(deg2rad($latitude1)) * cos(deg2rad($latitude2)) * cos(deg2rad($theta))); \n $distance = acos($distance); $distance = rad2deg($distance); $distance = $distance * 60 * 1.1515; \n switch($unit) \n { \n case 'Mi': \n break; \n case 'Km' : \n $distance = $distance * 1.609344; \n } \n return $distance; \n }", "function get_distance_from_lat_long($lat1, $lon1, $lat2, $lon2) \n{\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $distance_in_miles = $dist * 60 * 1.1515;\n $distance_in_Km = $distance_in_miles * 1.609344;\n\n return $distance_in_miles;\n}", "function distance($lat1, $lon1, $lat2, $lon2, $unit) {\r\n\r\n\t$theta = $lon1 - $lon2;\r\n\t$dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\r\n\t$dist = acos($dist);\r\n\t$dist = rad2deg($dist);\r\n\t$miles = $dist * 60 * 1.1515;\r\n\t$unit = strtoupper($unit);\r\n\r\n\tif ($unit == \"K\") {\r\n\t\treturn ($miles * 1.609344);\r\n\t} else if ($unit == \"N\") {\r\n\t\treturn ($miles * 0.8684);\r\n\t} else {\r\n\t\treturn $miles;\r\n\t}\r\n}", "function distance( $latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo, $earthRadius = 6371000){\n // convert from degrees to radians\n $latFrom = deg2rad($latitudeFrom);\n $lonFrom = deg2rad($longitudeFrom);\n $latTo = deg2rad($latitudeTo);\n $lonTo = deg2rad($longitudeTo);\n\n $latDelta = $latTo - $latFrom;\n $lonDelta = $lonTo - $lonFrom;\n\n $angle = 2 * asin(sqrt(pow(sin($latDelta / 2), 2) +\n cos($latFrom) * cos($latTo) * pow(sin($lonDelta / 2), 2)));\n return $angle * $earthRadius / 1000;\n }", "public static function distance ($x1, $y1, $x2, $y2)\n {\n return abs($x2 - $x1) + abs($y2 - $y1);\n }", "function distance($lat1, $lon1, $lat2, $lon2, $unit) {\n\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n $unit = strtoupper($unit);\n\n if ($unit == \"K\") {\n return ($miles * 1.609344);\n } else if ($unit == \"N\") {\n return ($miles * 0.8684);\n } else {\n return $miles;\n }\n }", "function calculateDistance($lat1, $lon1, $lat2, $lon2, $unit) {\n\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n $unit = strtoupper($unit);\n\n if ($unit == \"K\") {\n return ($miles * 1.609344);\n } else if ($unit == \"N\") {\n return ($miles * 0.8684);\n } else {\n return $miles;\n }\n}", "protected function distance($a, $b)\n {\n list($lat1, $lon1) = $a;\n list($lat2, $lon2) = $b;\n\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n return $miles;\n }", "function distance($lat1, $lon1, $lat2, $lon2, $unit) {\n\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n $unit = strtoupper($unit);\n\n if ($unit == \"K\") {\n return ($miles * 1.609344);\n } else if ($unit == \"N\") {\n return ($miles * 0.8684);\n } else {\n return $miles;\n }\n}", "public static function vincentyGreatCircleDistance(\n $latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo, $earthRadius = 6371000)\n {\n // convert from degrees to radians\n $latFrom = deg2rad($latitudeFrom);\n $lonFrom = deg2rad($longitudeFrom);\n $latTo = deg2rad($latitudeTo);\n $lonTo = deg2rad($longitudeTo);\n\n $lonDelta = $lonTo - $lonFrom;\n $a = pow(cos($latTo) * sin($lonDelta), 2) +\n pow(cos($latFrom) * sin($latTo) - sin($latFrom) * cos($latTo) * cos($lonDelta), 2);\n $b = sin($latFrom) * sin($latTo) + cos($latFrom) * cos($latTo) * cos($lonDelta);\n\n $angle = atan2(sqrt($a), $b);\n return $angle * $earthRadius;\n }", "function distance($lat1, $lon1, $lat2, $lon2, $unit) {\n\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n $unit = strtoupper($unit);\n\n if ($unit == \"K\") {\n return ($miles * 1.609344);\n } else if ($unit == \"N\") {\n return ($miles * 0.8684);\n } else {\n return $miles;\n }\n }", "private function _calculatePointDistance($lat1, $lon1, $lat2, $lon2, $unit) {\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n $unit = strtoupper($unit);\n\n if ($unit == \"K\") {\n return ($miles * 1.609344);\n }\n else if ($unit == \"M\") {\n return $this->_ceiling(($miles * 1.609344 * 1000), 50);\n }else if ($unit == \"N\") {\n return ($miles * 0.8684);\n } else {\n return $miles;\n }\n }", "function getDistance2pts($coord1, $coord2){\n\t$r = 6366;\n\n\t$coord1[0] = deg2rad($coord1[0]);\n\t$coord1[1] = deg2rad($coord1[1]);\n\t$coord2[0] = deg2rad($coord2[0]);\n\t$coord2[1] = deg2rad($coord2[1]);\n\t\n\t$ds= acos(sin($coord1[0])*sin($coord2[0])+cos($coord1[0])*cos($coord2[0])*cos($coord1[1]-$coord2[1]));\n\t\n\t$dpr = $ds * $r;\n\t\n\treturn $dpr * 0.54;\t// return une distance en nm\t\n}", "public static function getDistance(float $lat1, float $lon1, float $lat2, float $lon2) : float {\n\t\t// The same?\n\t\tif (($lat1 === $lat2) && ($lon1 === $lon2)) {\n\t\t\treturn 0.0;\n\t\t}\n\n\t\t$theta = $lon1 - $lon2;\n\t\t$distance = \\sin(\\deg2rad($lat1)) * \\sin(\\deg2rad($lat2)) + \\cos(\\deg2rad($lat1)) * \\cos(\\deg2rad($lat2)) * \\cos(\\deg2rad($theta));\n\t\t$distance = \\acos($distance);\n\t\treturn $distance * 60 * 1.1515;\n\t}", "public function distanceVincenty(Position $from, Position $to): Distance\n {\n $lat1 = $from->latitude();\n $lng1 = $from->longitude();\n $lat2 = $to->latitude();\n $lng2 = $to->longitude();\n\n $a = Earth::SEMI_MAJOR_AXIS;\n $b = Earth::SEMI_MINOR_AXIS;\n $f = Earth::FLATTENING;\n\n $L = deg2rad($lng2 - $lng1);\n $U1 = atan((1 - $f) * tan(deg2rad($lat1)));\n $U2 = atan((1 - $f) * tan(deg2rad($lat2)));\n\n $sinU1 = sin($U1);\n $cosU1 = cos($U1);\n $sinU2 = sin($U2);\n $cosU2 = cos($U2);\n\n $lambda = $L;\n $iterLimit = 100;\n\n do {\n $sinLambda = sin($lambda);\n $cosLambda = cos($lambda);\n $sinSigma = sqrt(($cosU2 * $sinLambda) * ($cosU2 * $sinLambda) +\n ($cosU1 * $sinU2 - $sinU1 * $cosU2 * $cosLambda) *\n ($cosU1 * $sinU2 - $sinU1 * $cosU2 * $cosLambda));\n\n if ($sinSigma === 0.0) {\n return new Distance(0); // co-incident points\n }\n\n $cosSigma = $sinU1 * $sinU2 + $cosU1 * $cosU2 * $cosLambda;\n $sigma = atan2($sinSigma, $cosSigma);\n $sinAlpha = $cosU1 * $cosU2 * $sinLambda / $sinSigma;\n $cosSqAlpha = (float) 1 - $sinAlpha * $sinAlpha;\n\n if ($cosSqAlpha !== 0.0) {\n $cos2SigmaM = $cosSigma - 2 * $sinU1 * $sinU2 / $cosSqAlpha;\n } else {\n $cos2SigmaM = 0.0; // Equatorial line\n }\n\n $C = $f / 16 * $cosSqAlpha * (4 + $f * (4 - 3 * $cosSqAlpha));\n $lambdaP = $lambda;\n $lambda = $L + (1 - $C) * $f * $sinAlpha *\n ($sigma + $C * $sinSigma * ($cos2SigmaM + $C * $cosSigma * (-1 + 2 * $cos2SigmaM * $cos2SigmaM)));\n } while (abs($lambda - $lambdaP) > 1e-12 && --$iterLimit > 0);\n\n if ($iterLimit <= 0) {\n throw new Exception\\RuntimeException('Vincenty formula failed to converge.');\n }\n\n $uSq = $cosSqAlpha * ($a * $a - $b * $b) / ($b * $b);\n $A = 1 + $uSq / 16384 * (4096 + $uSq * (-768 + $uSq * (320 - 175 * $uSq)));\n $B = $uSq / 1024 * (256 + $uSq * (-128 + $uSq * (74 - 47 * $uSq)));\n $deltaSigma = $B * $sinSigma * ($cos2SigmaM + $B / 4 * ($cosSigma * (-1 + 2 * $cos2SigmaM * $cos2SigmaM) -\n $B / 6 * $cos2SigmaM * (-3 + 4 * $sinSigma * $sinSigma) * (-3 + 4 * $cos2SigmaM * $cos2SigmaM)));\n $s = $b * $A * ($sigma - $deltaSigma);\n\n return new Distance($s);\n }", "public function distance(array $point1, array $point2)\n {\n $dLat = $this->toRadian($point2['latitude'] - $point1['latitude']);\n $dLng = $this->toRadian($point2['longitude'] - $point1['longitude']);\n\n $lat1 = $this->toRadian($point1['latitude']);\n $lat2 = $this->toRadian($point2['latitude']);\n\n $a = sin($dLat / 2) * sin($dLat / 2) +\n sin($dLng / 2) * sin($dLng / 2) *\n cos($lat1) * cos($lat2);\n\n $c = 2 * atan2(sqrt($a), sqrt(1 - $a));\n $d = static::EARTH_RADIUS * $c;\n\n return (int)round($d, 0);\n }", "private function distance($p0, $p1, $p2)\n\t{\n\t\tif ($p1[0] == $p2[0] && $p1[1] == $p2[1])\n\t\t{\n\t\t\t$out = sqrt(pow($p2[0] - $p0[0], 2) + pow($p2[1] - $p0[1], 2));\n\t\t} else\n\t\t{\n\t\t\t$u = (($p0[0] - $p1[0]) * ($p2[0] - $p1[0]) + ($p0[1] - $p1[1]) * ($p2[1] - $p1[1])) / (pow($p2[0] - $p1[0], 2) + pow($p2[1] - $p1[1], 2));\n\t\t\tif ($u <= 0)\n\t\t\t{\n\t\t\t\t$out = sqrt(pow($p0[0] - $p1[0], 2) + pow($p0[1] - $p1[1], 2));\n\t\t\t}\n\t\t\tif ($u >= 1)\n\t\t\t{\n\t\t\t\t$out = sqrt(pow($p0[0] - $p2[0], 2) + pow($p0[1] - $p2[1], 2));\n\t\t\t}\n\t\t\tif (0 < $u && $u < 1)\n\t\t\t{\n\t\t\t\t$out = sqrt(pow($p0[0] - $p1[0] - $u * ($p2[0] - $p1[0]), 2) + pow($p0[1] - $p1[1] - $u * ($p2[1] - $p1[1]), 2));\n\t\t\t}\n\t\t}\n\t\treturn $out;\n\t}", "public function getDistance(IPoint $point2): float;", "private function calculateDistanceCommercial($lat1, $lon1, $lat2, $lon2, $unit=\"K\") {\r\n\r\n\t $theta = $lon1 - $lon2;\r\n\t $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\r\n\t $dist = acos($dist);\r\n\t $dist = rad2deg($dist);\r\n\t $miles = $dist * 60 * 1.1515;\r\n\t $unit = strtoupper($unit);\r\n\r\n\t if ($unit == \"K\") {\r\n\t\treturn ($miles * 1.609344);\r\n\t } else if ($unit == \"N\") {\r\n\t\t return ($miles * 0.8684);\r\n\t\t} else {\r\n\t\t\treturn $miles;\r\n\t\t }\r\n\t}", "public function Calculate(float $lat1, float $lon1, float $lat2, float $lon2) : float\n {\n $theta = deg2rad($lon1 - $lon2);\n\n $lat1 = deg2rad($lat1);\n $lon1 = deg2rad($lon1);\n $lat2 = deg2rad($lat2);\n $lon2 = deg2rad($lon2);\n\n $divisor = sqrt(pow(cos($lat2) * sin($theta), 2) + pow(cos($lat1) * sin($lat2) - sin($lat1) * cos($lat2) * cos($theta), 2));\n $divider = sin($lat1) * sin($lat2) + cos($lat1) * cos($lat2) * cos($theta);\n\n $dist = atan($divisor / $divider);\n\n return parent::RadiansToKilometers($dist);\n }", "function Distance($lat1, $lon1, $lat2, $lon2, $unit) {\n\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n $unit = strtoupper($unit);\n\n if ($unit == \"K\") {\n return ($miles * 1.609344);\n } else if ($unit == \"N\") {\n return ($miles * 0.8684);\n } else {\n return $miles;\n }\n }", "public function calculateDistanceBetween(string $address1, string $address2)\n {\n }", "function mathGeoDistance( $lat1, $lng1, $lat2, $lng2, $miles = false )\n\t{\n\t $pi80 = M_PI / 180;\n\t $lat1 *= $pi80;\n\t $lng1 *= $pi80;\n\t $lat2 *= $pi80;\n\t $lng2 *= $pi80;\n\n\t $r = 6372.797; // mean radius of Earth in km\n\t $dlat = $lat2 - $lat1;\n\t $dlng = $lng2 - $lng1;\n\t $a = sin($dlat / 2) * sin($dlat / 2) + cos($lat1) * cos($lat2) * sin($dlng / 2) * sin($dlng / 2);\n\t $c = 2 * atan2(sqrt($a), sqrt(1 - $a));\n\t $km = $r * $c;\n\n\t return ($miles ? ($km * 0.621371192) : $km);\n\t}", "protected function calculateDistance($point_a, $point_b)\n {\n $distance = 0;\n for ($i = 0, $count = count($point_a); $i < $count; $i++) {\n $difference = $point_a[$i] - $point_b[$i];\n $distance += pow($difference, 2);\n }\n return $distance;\n }", "public function distance($lat1, $long1, $lat2, $long2, $unit ){\n\n if (($lat1 == $lat2) && ($long1 == $long2)) {\n \n return 0;\n }else{\n $theta = $long1 - $long2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + \n cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n $unit = strtoupper($unit);\n\n if ($unit == \"K\") {\n return round(($miles * 1.609344));\n }elseif ($unit == \"N\") {\n return round(($miles * 0.8684));\n }else{\n return $miles;\n }\n }\n }", "private static function hypotenuse($a, $b)\n {\n return $c = sqrt($a * $a + $b * $b);\n }", "public function measureDistance($lat1, $long1, $lat2, $long2) {\n $earthRadius = 6371;\n\n $latDistance = deg2rad($lat2 - $lat1);\n $longDistance = deg2rad($long2 - $long1);\n\n $a = sin($latDistance/2) * sin($latDistance/2) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * sin($longDistance/2) * sin($longDistance/2);\n $c = 2 * asin(sqrt($a));\n $distance = $earthRadius * $c * 1000;\n\n return $distance;\n }", "public function calculateDistanceBetweenTwoPoints($latitudeOne = '', $longitudeOne = '', $latitudeTwo = '', $longitudeTwo = '', $distanceUnit = '', $round = false, $decimalPoints = '')\n {\n if (empty($decimalPoints)) {\n $decimalPoints = '2';\n }\n if (empty($distanceUnit)) {\n $distanceUnit = 'KM';\n }\n $distanceUnit = strtolower($distanceUnit);\n $pointDifference = $longitudeOne - $longitudeTwo;\n $toSin = (sin(deg2rad($latitudeOne)) * sin(deg2rad($latitudeTwo))) + (cos(deg2rad($latitudeOne)) * cos(deg2rad($latitudeTwo)) * cos(deg2rad($pointDifference)));\n $toAcos = acos($toSin);\n $toRad2Deg = rad2deg($toAcos);\n $toMiles = $toRad2Deg * 60 * 1.1515;\n $toKilometers = $toMiles * 1.609344;\n return ($round == true ? round($toKilometers) : round($toKilometers, $decimalPoints));\n }", "private function distance($latA, $latB, $lngA, $lngB, $unit)\n\t{\n\t\t$theta = $lngA - $lngB;\n\t\t$dist = sin(deg2rad($latA)) * sin(deg2rad($latB)) + cos(deg2rad($latA)) * cos(deg2rad($latB)) * cos(deg2rad($theta));\n\t\t$dist = acos($dist);\n\t\t$dist = rad2deg($dist);\n\t\t$miles = $dist * 60 * 1.1515;\n\t\t$unit = strtoupper($unit);\n\n\n\n\t\t# We want to convert the result the unit we want to work with (K = KM)\n\t\t$result = 0;\n\t\tif ($unit == \"K\")\n\t\t{\n\t\t\t$result = ($miles * 1.609344);\n\t\t} \n\t\telse\n\t\t{\n\t\t\t$result = $miles;\n\t\t}\n\n\n\n\t\t# Finally we return our result\n\t\treturn $result;\n\t\t\n\n\t}", "public function getDistance($lat1, $lgn1, $lat2, $lgn2){\n $earth_radius = 6371;\n $alpha = $lat1 - $lat2;\n $beta = $lgn1 - $lgn2;\n $h = pow((sin(deg2rad($alpha/2))), 2) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * pow(sin(deg2rad($beta/2)),2);\n $dist = 2*$earth_radius*sqrt($h);\n\n return $dist;\n }", "public static function diffDistance($from, $to)\n\t{\n $distance = new Distance();\n $distance->setUnit('m');\n $distance->setFormula('haversine');\n return $dist = $distance->between($from['lat'],$from['long'], $to['lat'],$to['long']);\n\t}", "public function calculateDistance()\n {\n echo 'distance is 3km.',\"\\n\";\n }", "protected function calculateDistance($first, $second)\n {\n return \\levenshtein($first, $second);\n }", "public function distance($lat1, $lon1, $lat2, $lon2, $unit) {\n if (($lat1 == $lat2) && ($lon1 == $lon2)) {\n return 0;\n }\n else {\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n $unit = strtoupper($unit);\n\n if ($unit == \"K\") {\n return ($miles * 1.609344);\n } else if ($unit == \"N\") {\n return ($miles * 0.8684);\n } else {\n return $miles;\n }\n }\n }", "public static function lat_lon_distance($lat1, $lng1, $lat2, $lng2, $miles = true)\r\n {\n \t$pi = 3.1415926;\r\n \t$rad = doubleval($pi/180.0);\r\n \t$lon1 = doubleval($lng1)*$rad; \n \t$lat1 = doubleval($lat1)*$rad;\n \t\r\n \t$lon2 = doubleval($lng2)*$rad; \n \t$lat2 = doubleval($lat2)*$rad;\n \t\r\n \t$theta = $lon2 - $lon1;\r\n \t$dist = acos(sin($lat1) * sin($lat2) + cos($lat1) * cos($lat2) * cos($theta));\r\n \tif ($dist < 0) {\r\n \t\t$dist += $pi;\r\n \t}\r\n \t$dist = $dist * 6371.2;\r\n \treturn $dist;\r\n }", "static public function distance($lat1, $lon1, $lat2, $lon2, $unit = 'K')\n {\n\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(\n deg2rad($theta)\n );\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n $unit = strtoupper($unit);\n\n if ($unit == 'K') {\n return ($miles * 1.609344);\n } else {\n if ($unit == 'N') {\n return ($miles * 0.8684);\n } else {\n return $miles;\n }\n }\n }", "public function testDistanceBetweenAppleAndGoogleUsingVincenty()\n {\n $distance = new Distance();\n $distance->setUnit('m');\n $distance->setFormula('vincenty');\n\n $this->assertEquals(11164, $distance->between(37.331741, -122.030333, 37.422546, -122.084250));\n\n $distance->setUnit('km');\n\n $this->assertEquals(11.164, $distance->between(37.331741, -122.030333, 37.422546, -122.084250));\n\n $distance->setUnit('mi');\n\n $this->assertEquals(6.936987987488, $distance->between(37.331741, -122.030333, 37.422546, -122.084250));\n\n $distance->setUnit('cm');\n\n $this->assertEquals(1116400, $distance->between(37.331741, -122.030333, 37.422546, -122.084250));\n\n $distance->setUnit('ft');\n\n $this->assertEquals(36627.2966436, $distance->between(37.331741, -122.030333, 37.422546, -122.084250));\n\n $distance->setUnit('in');\n\n $this->assertEquals(439527.5586068, $distance->between(37.331741, -122.030333, 37.422546, -122.084250));\n }", "public function getDistance();", "public static function geoDistanceGC(Application\\Model\\Waypoint_Coordinate $c1, Application\\Model\\Waypoint_Coordinate $c2) {\n // Perform the formula and return the value\n return acos(\n ( sin($c1->lat->getAsRad()) * sin($c2->lat->getAsRad()) ) +\n ( cos($c1->lat->getAsRad()) * cos($c2->lat->getAsRad()) * cos($c2->lon->getAsRad() - $c1->lon->getAsRad()) )\n ) * self::EARTH_R;\n }", "function calculateBearing($lat1,$long1,$lat2,$long2) {\r\n $y = $lat2-$lat1;\r\n $x = $long2-$long1;\r\n \r\n if($x==0 AND $y==0){ return 0; };\r\n return ($x < 0) ? rad2deg(atan2($x,$y))+360 : rad2deg(atan2($x,$y)); \r\n }", "public function getDistance($latitudeA, $longitudeA, $latitudeB, $longitudeB) {\n\t\t$EQUATORIAL_RADIUS_KM = 6378.137;\n\n\t\t$latA = $latitudeA / 180 * 3.14159265358979323;\n\t\t$lonA = $longitudeA / 180 * 3.14159265358979323;\n\t\t$latB = $latitudeB / 180 * 3.14159265358979323;\n\t\t$lonB = $longitudeB / 180 * 3.14159265358979323;\n\t\treturn acos(sin($latA) * sin($latB) + cos($latA) * cos($latB) * cos($lonB - $lonA)) * $EQUATORIAL_RADIUS_KM;\n\t}", "function miles_distance($lat1, $lng1, $lat2, $lng2, $miles = true){\n\t $pi80 = M_PI / 180;\n\t $lat1 *= $pi80;\n\t $lng1 *= $pi80;\n\t $lat2 *= $pi80;\n\t $lng2 *= $pi80;\n\t \n\t $r = 6372.797; // mean radius of Earth in km\n\t $dlat = $lat2 - $lat1;\n\t $dlng = $lng2 - $lng1;\n\t $a = sin($dlat / 2) * sin($dlat / 2) + cos($lat1) * cos($lat2) * sin($dlng / 2) * sin($dlng / 2);\n\t $c = 2 * atan2(sqrt($a), sqrt(1 - $a));\n\t $km = $r * $c;\n\t \n\t return ($miles ? ($km * 0.621371192) : $km);\n \t}", "public static function geoDistance (Application\\Model\\Waypoint_Coordinate $c1, Application\\Model\\Waypoint_Coordinate $c2, $unit=\"s\")\n {\n $theta = $c1->lon->getAsRad() - $c2->lon->getAsRad();\n $dist = sin($c1->lat->getAsRad()) * sin($c2->lat->getAsRad()) +\n cos($c1->lat->getAsRad()) * cos($c2->lat->getAsRad()) *\n cos($theta);\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n $unit = strtolower($unit);\n switch($unit) {\n case \"k\":\n return ($miles * 1.609344);\n case \"m\":\n return ($miles * 1607.344);\n case \"f\":\n return ($miles * 5280);\n case \"y\":\n return ($miles * 5280/3);\n default:\n return $miles;\n }\n }", "public function distance($latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo, $earthRadius = 6371000)\n\t\t{\n\t\t $latFrom = deg2rad($latitudeFrom);\n\t\t $lonFrom = deg2rad($longitudeFrom);\n\t\t $latTo = deg2rad($latitudeTo);\n\t\t $lonTo = deg2rad($longitudeTo);\n\n\t\t $lonDelta = $lonTo - $lonFrom;\n\t\t $a = pow(cos($latTo) * sin($lonDelta), 2) +\n\t\t pow(cos($latFrom) * sin($latTo) - sin($latFrom) * cos($latTo) * cos($lonDelta), 2);\n\t\t $b = sin($latFrom) * sin($latTo) + cos($latFrom) * cos($latTo) * cos($lonDelta);\n\n\t\t $angle = atan2(sqrt($a), $b);\n\t\t return $angle * $earthRadius;\n\t\t}", "protected function calculateDistance($lat1, $lng1, $lat2, $lng2){\n $theta = $lng1-$lng2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) +\n cos(deg2rad($lat1)) * cos(deg2rad($lat2)) *\n cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n return $miles;\n }", "public static function distance($latA, $lonA, $latB, $lonB): string\n {\n $latA = is_numeric($latA) ? self::formatCoord((float)$latA) : $latA;\n $lonA = is_numeric($lonA) ? self::formatCoord((float)$lonA) : $lonA;\n $latB = is_numeric($latB) ? self::formatCoord((float)$latB) : $latB;\n $lonB = is_numeric($lonB) ? self::formatCoord((float)$lonB) : $lonB;\n\n return 'EARTH_DISTANCE( LL_TO_EARTH(' . $latA . ', ' . $lonA . '), LL_TO_EARTH(' . $latB . ', ' . $lonB . ') )';\n }", "public static function distance($lat1, $lng1, $lat2, $lng2, $unit = 'k') {\n $earth_radius = 6378137; // Terre = sphère de 6378km de rayon\n $rlo1 = deg2rad($lng1);\n $rla1 = deg2rad($lat1);\n $rlo2 = deg2rad($lng2);\n $rla2 = deg2rad($lat2);\n $dlo = ($rlo2 - $rlo1) / 2;\n $dla = ($rla2 - $rla1) / 2;\n $a = (sin($dla) * sin($dla)) + cos($rla1) * cos($rla2) * (sin($dlo) * sin($dlo));\n $d = 2 * atan2(sqrt($a), sqrt(1 - $a));\n //\n $meter = ($earth_radius * $d);\n if ($unit == 'k') {\n return $meter / 1000;\n }\n return $meter;\n }", "public function distance($lat1, $lng1, $lat2, $lng2, $miles = true) {\n $pi80 = M_PI / 180;\n $lat1 *= $pi80;\n $lng1 *= $pi80;\n $lat2 *= $pi80;\n $lng2 *= $pi80;\n\n $r = 6372.797; // mean radius of Earth in km\n $dlat = $lat2 - $lat1;\n $dlng = $lng2 - $lng1;\n $a = sin($dlat / 2) * sin($dlat / 2) + cos($lat1) * cos($lat2) * sin($dlng / 2) * sin($dlng / 2);\n $c = 2 * atan2(sqrt($a), sqrt(1 - $a));\n $km = $r * $c;\n\n return ($miles ? ($km * 0.621371192) : $km);\n }", "public static function distance($x, $y)\n {\n /**power of x,x */\n $squareX = pow($x, $x);\n\n /**power of y,y */\n $squareY = pow($y, $y);\n\n /** calculate distancec*/\n $distance = sqrt($squareX + $squareY);\n echo \"Euclidean distance \\n\";\n echo $distance.\"\\n\";\n }", "function area_check_center($x, $y){\n\t\t\t$part1 = pow($x, 2) * ( asin($y/$x) - (1/2) * sin(2 * asin( $y/$x )));// Area of the segment of the larger circle\n\t\t\t$part2 = (1/2) * pi() * pow($y, 2);// Area of the smaller semi-circle\n\t\t\treturn $part1 + $part2;\n\t\t}", "public function getWalkingDistance($lat1, $lng1, $lat2, $lng2){\n $start = \"\" . $lat1 . \",\" . $lng1;\n \n //Our end point / destination. Change this if you wish.\n $destination = \"\" . $lat2 . \",\" . $lng2;\n \n //The Google Directions API URL. Do not change this.\n $apiUrl = 'https://maps.googleapis.com/maps/api/directions/json';\n \n //Construct the URL that we will visit with cURL.\n $url = $apiUrl . '?key=AIzaSyBx7STG0PaXcrFVDiDqGsnr1AmMZcvf110&mode=walking' . '&origin=' . urlencode($start) . '&destination=' . urlencode($destination);\n \n //Initiate cURL.\n $curl = curl_init($url);\n \n //Tell cURL that we want to return the data.\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n \n //Execute the request.\n $res = curl_exec($curl);\n \n //If something went wrong with the request.\n if(curl_errno($curl)){\n throw new Exception(curl_error($curl));\n }\n \n //Close the cURL handle.\n curl_close($curl);\n \n //Decode the JSON data we received.\n $json = json_decode(trim($res), true);\n \n\n //Automatically select the first route that Google gave us.\n $route = $json['routes'][0];\n \n //Loop through the \"legs\" in our route and add up the distances.\n $totalDistance = 0;\n $totlaDuration = 0;\n\n foreach($route['legs'] as $leg){\n $totalDistance += $leg['distance']['value'];\n $totlaDuration +=$leg['duration']['value'];\n }\n \n //Divide by 1000 to get the distance in KM.\n $totalDistance = $totalDistance / 1000;\n \n //Print out the result.\n return [\n \"distance\" => $totalDistance,\n \"duration\" => $totlaDuration,\n \"routes\" => $json['routes']\n ];\n }" ]
[ "0.72125775", "0.71618986", "0.7093784", "0.7034759", "0.7011908", "0.6999548", "0.6992199", "0.69722396", "0.68901825", "0.6825098", "0.6820741", "0.6808978", "0.6808856", "0.67704844", "0.6748302", "0.67439526", "0.67240345", "0.6709782", "0.6649138", "0.66481364", "0.6609488", "0.65793407", "0.6543611", "0.6403785", "0.6377792", "0.63443244", "0.6321051", "0.629995", "0.62918353", "0.62876934", "0.62769085", "0.6269717", "0.6249409", "0.62406635", "0.6198789", "0.6188855", "0.61513454", "0.61395395", "0.61335033", "0.61331207", "0.61279845", "0.61214346", "0.61196715", "0.6108491", "0.6047718", "0.60335934", "0.6028944", "0.6019634", "0.60053825", "0.59710866", "0.5956248", "0.59413254", "0.5923217", "0.58869934", "0.58753383", "0.58674717", "0.58620846", "0.5860024", "0.582968", "0.58189017", "0.5810807", "0.5797815", "0.57903016", "0.5755013", "0.574613", "0.57441044", "0.57410926", "0.57145387", "0.57105017", "0.5678684", "0.56743723", "0.5659881", "0.56584585", "0.5651673", "0.56272364", "0.5610579", "0.5606324", "0.558227", "0.55688375", "0.5568758", "0.55449736", "0.5532561", "0.55110055", "0.5501096", "0.5480864", "0.5457425", "0.5456692", "0.5449241", "0.5435005", "0.54280406", "0.5417572", "0.537627", "0.5371945", "0.5357646", "0.52806085", "0.5273505", "0.5246001", "0.51983845", "0.5165961", "0.5142577" ]
0.6033144
46
getGeoJson Description: Creates a GeoJson from an array of points
function buildGeoJson($airports){ $json = []; // empty json array $json['type']='FeatureCollection'; // add top level key to be a 'FeatureCollection' $json['feautures'] = []; // now push on an array with the key 'feautures' // loop through result set and build a php associative array to be encoded as a json (geojson) object foreach($airports as $airport){ // push a new "object" (feature) onto our features array $json['feautures'][] = ['type'=>'Feature', 'geometry'=>[ 'type'=>'Point', 'coordinates'=>[$airport['Longitude']*1.0,$airport['Latitude']*1.0]], "properties"=> [ "title" =>"{$airport['Name']}", "description"=>"{$airport['TZ']}", "marker-size"=>"medium", "marker-symbol"=>"airport", "marker-color"=>"#f00", "stroke"=>"#555555", "stroke-opacity" =>1, "stroke-width"=>2, "fill" => "#555555", "fill-opacity" => 0.5 ] ]; } for($i=1;$i<sizeof($airports);$i++){ $json['features'][] = ['type'=>'Feature', 'geometry'=>[ 'type'=>"LineString", 'coordinates'=>[ [$airports[$i-1]['Longitude']*1.0,$airports[$i-1]['Latitude']*1.0], [$airports[$i]['Longitude']*1.0,$airports[$i]['Latitude']*1.0] ] ], "properties"=> [ "title" =>"Flight Path", "description"=>"Leg {$i}", "stroke"=>"#555555", "stroke-opacity" =>1, "stroke-width"=>2, "fill" => "#555555", "fill-opacity" => 0.5 ] ]; } // dump to output (json pretty adds newlines and indentation) file_put_contents("round_the_world.geojson",json_encode($json,JSON_PRETTY_PRINT)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getGeoJson()\n {\n return $this->geoJson;\n }", "public function jsonSerialize(): mixed\n {\n $position = [$this->getLng(), $this->getLat()];\n if ($this->is3d()) $position[] = $this->getAlt();\n return new \\GeoJson\\Geometry\\Point($position);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n $geometries = [];\n foreach ($this->items as $geometry) {\n $geometries[] = $geometry->jsonSerialize();\n }\n\n return new \\GeoJson\\Geometry\\GeometryCollection($geometries);\n }", "#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n $polygons = [];\n foreach ($this->items as $polygon) {\n $polygons[] = $polygon->jsonSerialize();\n }\n\n return new GeoJsonMultiPolygon($polygons);\n }", "public function geoJson($sites){\n $geojson = array( 'type' => 'FeatureCollection', 'features' => array());\n foreach ($sites as $site) {\n $marker = array(\n 'type' => 'Feature',\n 'properties' => array(\n 'name' => $site->name,\n 'id' => $site->idDiveSite,\n 'marker-color' => MARKER_COLOR,\n 'marker-size' => MARKER_SIZE\n ),\n 'geometry' => array(\n 'type' => 'Point',\n 'coordinates' => array( \n $site->longitude,\n $site->latitude\n )\n )\n );\n array_push($geojson['features'], $marker);\n }\n return $geojson;\n }", "public function jsonSerialize()\n {\n $json = array();\n $json['circle'] = $this->circle;\n $json['polygon'] = $this->polygon;\n\n return $json;\n }", "public function getSpGeometryArray() {\n if ($this->getSpGeometry()) {\n $json['type'] = $this->getSpGeometry()->getType();\n $json['coordinates'] = $this->getSpGeometry()->toArray();\n\n return $json;\n }\n\n return NULL;\n }", "function jsonSerialize()\n {\n\n $this->points = array_reverse($this->points);\n\n for ($i=0; $i< count($this->points); $i++) {\n foreach ($this->points[$i] as $key => $value) {\n if ($key == \"LOCATION_ID\")\n continue;\n\n if ($key == 'time')\n $this->points[$i][$key] = strtotime($this->points[$i][$key]) * 1000;\n else\n $this->points[$i][$key] = round($this->points[$i][$key], 2);\n }\n }\n return $this->points;\n/*\n\n $lines = [];\n foreach ($this->points as $point) {\n $i = 0;\n foreach ($point as $key => $value) {\n if ($key == \"LOCATION_ID\")\n continue;\n\n if (!isset($lines[$i])) {\n $lines[$i] = [];\n }\n\n if ($key == 'time')\n $lines[$i][] = strtotime($point['time']) * 1000;\n else\n $lines[$i][] = round($point[$key], 2);\n\n $i++;\n }\n }\n return $lines;*/\n }", "public function wktBuildPolygon(array $points);", "public function jsonSerialize()\n {\n return [\n 'x' => $this->x,\n 'y' => $this->y,\n ];\n }", "private function get_json_geo_data()\n {\n $response = false;\n if ($this->ipaddress != 'UNKNOWN') {\n foreach (self::$geo_service_url as $key => $url) {\n $response = wp_remote_get($url . $this->ipaddress);\n if (is_array($response) && array_key_exists('region_code', json_decode($response['body']))) {\n continue;\n }\n }\n }\n\n if (is_array($response)) {\n $this->body = json_decode($response['body']);\n } else {\n $this->body = false;\n }\n }", "public function getGeo() {\n return $this->get(self::GEO);\n }", "public function geoJson($zoom, $bounds)\n {\n $features = collect();\n\n if ($zoom >= static::GEO_JSON_ZOOM_LEVEL) {\n $bounds = Bounds::fromString($bounds)->scale(1.5);\n $limit = (int) (static::GEO_JSON_LIMIT * config('starmap.ratio'));\n\n $features = $features->merge(\n app(StarFeatureTransformer::class)->transformCollection(Star::inBounds($bounds)\n ->limit($limit)\n ->get())\n );\n\n $features = $features->merge(\n app(PlanetFeatureTransformer::class)->transformCollection(Planet::inBounds($bounds)\n ->limit(static::GEO_JSON_LIMIT - $limit)\n ->get())\n );\n\n /** @var \\Koodilab\\Models\\User $user */\n $user = auth()->user();\n\n $incomingMovements = $user->current->findIncomingMovements();\n $outgoingMovements = $user->current->findOutgoingMovements();\n\n $movementFeatureTransformer = app(MovementFeatureTransformer::class);\n $movementUnitFeatureTransformer = app(MovementUnitFeatureTransformer::class);\n\n $features = $features->merge(\n $movementFeatureTransformer->transformCollection(\n Collection::make($incomingMovements)\n )\n );\n\n $features = $features->merge(\n $movementUnitFeatureTransformer->transformCollection(\n $incomingMovements\n )\n );\n\n $features = $features->merge(\n $movementFeatureTransformer->transformCollection(\n Collection::make($outgoingMovements)\n )\n );\n\n $features = $features->merge(\n $movementUnitFeatureTransformer->transformCollection(\n $outgoingMovements\n )\n );\n\n $features = $features->merge(\n app(ExpeditionFeatureTransformer::class)->transformCollection(\n $user->findNotExpiredExpeditions()\n )\n );\n }\n\n return response()->json([\n 'type' => 'FeatureCollection',\n 'features' => $features,\n ]);\n }", "public function get_geometry($region)\n\t{\n\t\t$dir = $_SERVER[\"DOCUMENT_ROOT\"].'/data/'.$region;\n\t\tif (!file_exists($dir))\n\t\t\tmkdir($dir);\n\n\t\t$fname = \"$dir/geometry.json\";\n\n\t\tif (file_exists($fname)) {\n\n\t\t\t$st = file_get_contents($fname);\n\n\t\t\t$polygons = json_decode($st, true);\n\t\t\tif (isset($polygons)) {\n\t\t\t\treturn $polygons;\n\t\t\t}\n\t\t}\n\n\t\t// TODO: сделать одну функцию для запросов к Overpass API\n\t\t$url = \"https://overpass.openstreetmap.ru/api/interpreter\";\n\t\t//$url = \"https://overpass-api.de/api/interpreter\";\n\n\t\t// FIXME: запрос слишком много инфы загружает, поправить\n\t\t$query =\n\t\t\t'[out:json][timeout:180];\n\t\t\trel[ref=\"'.$region.'\"][admin_level=4][boundary=administrative];\n\t\t\tout geom;';\n\n\t\t$page = $this->get_web_page($url, $query);\n\t\tif (is_null($page)) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$page = json_decode($page, true);\n\t\tif (is_null($page)) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$polygons = [[]];\n\t\t$n = 0;\n\n\t\tforeach ($page['elements'][0]['members'] as $member) {\n\t\t\tif ($member['type'] == 'way') {\n\t\t\t\t$way = $member['geometry'];\n\n\t\t\t\tif (isset($polygons[$n][0])) {\n\t\t\t\t\tif ($way[0] == $polygons[$n][0]) {\n\t\t\t\t\t\t$polygons[$n] = array_reverse($polygons[$n]);\n\t\t\t\t\t\tarray_shift($way);\n\t\t\t\t\t} else if ($way[0] == end($polygons[$n])) {\n\t\t\t\t\t\tarray_shift($way);\n\t\t\t\t\t} else if (end($way) == $polygons[$n][0]) {\n\t\t\t\t\t\t$polygons[$n] = array_reverse($polygons[$n]);\n\t\t\t\t\t\t$way = array_reverse($way);\n\t\t\t\t\t\tarray_shift($way);\n\t\t\t\t\t} else if (end($way) == end($polygons[$n])) {\n\t\t\t\t\t\t$way = array_reverse($way);\n\t\t\t\t\t\tarray_shift($way);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$n++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tforeach ($way as $node) {\n\t\t\t\t\t$polygons[$n][] = $node;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Удаление последней точки\n\t\tforeach ($polygons as $i => $polygon) {\n\t\t\tif ($polygon[0] == end($polygon)) {\n\t\t\t\tarray_pop($polygons[$i]);\n\t\t\t\t$this->log(\"Замкнутый полигон!\");\n\t\t\t} else {\n\t\t\t\t$this->log(\"Незамкнутый полигон!\");\n\t\t\t}\n\t\t}\n\n\t\t$st = json_encode($polygons);\n\t\tfile_put_contents($fname, $st);\n\n\t\t$this->log(\"Загружена геометрия $region.\");\n\n\t\treturn $polygons;\n\t}", "public function get_data_geojson($d,$tbl){\n $siz =!empty(sizeof($d['a']))?sizeof($d['a']):0;\n for($i=0; $siz >$i; $i++){\n //$this->db->select($d['a'][$i]['col'].' AS '. $d['a'][$i]['name']);\n $this->db->select($d['a'][$i]['col'].' AS '. pg_escape_string(str_replace(\".\",\"\",$d['a'][$i]['name'])));\n }\n $this->db->select('ST_AsGeoJSON(the_geom)');\n $this->db->order_by('id','ASC');\n $q=$this->db->get($tbl);\n return $q;\n }", "public function geotoPoly($geoJson) {\n $poly = '(';\n $geoJson = str_replace(array(\"\\r\", \"\\n\", \" \"), '', $geoJson);\n $poligono = json_decode($geoJson);\n foreach ($poligono as $confine) {\n $poly .= '(';\n foreach ($confine as $vertice) \n {\n $poly .= $vertice[0] . ' ' . $vertice[1] . ',';\n }\n $poly = substr($poly, 0, strlen(($poly))-1);\n $poly .= '),';\n }\n $poly = substr($poly, 0, strlen(($poly))-1);\n $poly .= ')';\n return $poly; \n }", "public static function toGeoJson($type, $coordinates, $srid = 4326)\n {\n\n $geoJson = [\n 'type' => $type,\n 'coordinates' => $coordinates,\n ];\n\n if (!is_null($srid)) {\n\n $geoJson['crs'] = [\n 'type' => 'name',\n 'properties' => ['name' => \"EPSG:$srid\"],\n ];\n\n }\n\n return Json::encode($geoJson);\n\n }", "public function appendGeoJson(){\n\t\t//This might be made dynamic in the future, not sure yet.\n\t\t$table = \"BroDeployOverseas\"; // do be used later if tables need to be dynamic\n\t\t//Query that sums up all the regions' data.\n\t\t$query = \"Select Avg(BroDeployOverseas.regworkpercentcompleted) as regworkpercentcompleted, \n\t\t\tAvg(bandwidth.capacity) as Bcapacity,\n\t\t\tAvg(BroDeployOverseas.vsenpercentcompleted) as vsenpercentcompleted, BroDeployOverseas.region \n\t\t\tfrom public.BroDeployOverseas, public.bandwidth\n\t\t\tWhere BroDeployOverseas.region = bandwidth.region \n\t\t\tOR BroDeployOverseas.post = bandwidth.post\n\t\t\tGroup By BroDeployOverseas.region;\";\n\n\t\t$result = $this->connectPG($query);\t\t\t\n\t\t$rows = pg_fetch_all($result);\n\n\t\t$filename1 = \"js/geometry/dos_region_None.geojson\";\n\t\t$jsonStr1 = file_get_contents($filename1);\n\t\t$jsonObj1 = json_decode($jsonStr1);\n\t\t//var_dump($jsonObj1);\n\n\t\tif(file_exists($filename1)){\t\t\t\n\t\t\tforeach($jsonObj1->features as $metrodata){\n\t\t\t\tforeach($rows as $dbData){ // Can't think of a better way to do this than O(N^2)\t\t\t\t\n\t\t\t\t\tif($metrodata->properties->dos_region == trim($dbData['region'])){\n\t\t\t\t\t\tif(isset($dbData['regworkpercentcompleted'])){\n\t\t\t\t\t\t\t$metrodata->properties->regworkpercentcompleted = round($dbData['regworkpercentcompleted'],2);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$metrodata->properties->regworkpercentcompleted = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(isset($dbData['vsenpercentcompleted'])){\n\t\t\t\t\t\t\t$metrodata->properties->vsenpercentcompleted = round($dbData['vsenpercentcompleted'],2);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$metrodata->properties->vsenpercentcompleted = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(isset($dbData['bcapacity'])){\n\t\t\t\t\t\t\t$metrodata->properties->capacity = round($dbData['bcapacity'],2);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$metrodata->properties->capacity = 0;\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t}else{\t\t\t\t\t\n\t\t\t\t\t\t//error_log($dbData['region']);\n\t\t\t\t\t\t//error_log($metrodata->properties->dos_region);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t$jsonStr1 = json_encode($jsonObj1);\n\t\t\t//error_log($jsonStr1);\n\t\t\t$cleanJsonStr = json_decode($jsonStr1);\n\n\t\t\t//Validate the JSON\n\t\t\tif($cleanJsonStr === NULL){\n\t\t\t\terror_log(\"There is an issue with your json in appendJson().\\n\");\n\t\t\t}else{\n\t\t\t\t//error_log(\"JSON is correct\");\n\t\t\t\treturn $jsonStr1;\n\t\t\t}\n\t\t}else{\n\t\t\terror_log(\"File: \".$filename1.\" does not exist in appendJson().\\n\");\n\t\t}\n\t}", "public function serialize() {\n return array( \n 'lat' => $this->getLat(),\n 'lon' => $this->getLong()\n );\n }", "public function toArray()\n {\n return [\n 'latitude' => $this->latitude,\n 'longitude' => $this->longitude,\n ];\n }", "public function getPoints(): array;", "public function geojson(Request $request)\n {\n $search = new Search($request);\n\n return $search->geojson();\n }", "public static function toArray($geoJson)\n {\n\n $geoJson = Json::decode($geoJson);\n\n return $geoJson['coordinates'];\n\n }", "public function toArray()\n {\n return array(\n \"lat\" => $this->lat,\n \"lng\" => $this->lng\n );\n }", "function processGeometry($geometry) {\n\t\t$json = array();\n\t\t$jsonOuter = array();\n\t\t$jsonInner = array();\n\n//If the object has multiple geometries\nif (strpos($geometry,'<MultiGeometry>') == true) {\n\t\t//IMPLEMENT\n\t\t//Return the stuff between the multiple geometry tags so that the caller knows to expect more than one\n\t\t$search = array(\"<MultiGeometry>\",\"</MultiGeometry>\");\n\t\treturn \"multiple\";\n} else {\n\t\t//Get the coordinates between the outerBoundary tags inside LinearRing\n\t\t$outer = get_string($geometry, \"<outerBoundaryIs><LinearRing><coordinates>\",\"</coordinates></LinearRing></outerBoundaryIs>\");\n\t\t//Split the string by spaces to create a list of the coordinate pairs\n\t\t$outer = explode(\" \", $outer);\n\t\t//This gets added to the JSON information\n\t\tarray_push($json, $outer); \n\n\t\t//Get the coordinates between the innerBoundary tags inside LinearRing\n\t\t$inner = get_string($geometry, \"<innerBoundaryIs><LinearRing><coordinates>\",\"</coordinates></LinearRing></innerBoundaryIs>\");\n\t\t//If it isn't empty,\n\t\tif($inner !== null || $inner !== \"\") {\n\t\t\t//Split the coordinate pairs into a list\n\t\t\t$inner = explode(\" \", $inner);\n\t\t\t//Add the coordinates to the JSON information\n\t\t\tarray_push($json, $inner); \n\t\t}\n\t\t//Return the JSON information\n\t\treturn $json;\n}\n}", "public static function toTopoJSON($geojson) {\n // TODO\n }", "public function jsonSerialize()\n {\n return [\n 'id'=> $this->id,\n 'nom'=> $this->nom,\n 'rue'=> $this->rue,\n 'latitude'=> $this->latitude,\n 'longitude'=> $this->longitude,\n 'ville'=> $this->ville,\n ];\n }", "function parseGeojson(array $data, $bmpFile = null) {\n list($w, $h) = $bmpFile ? (getimagesize($bmpFile) ?: []) : [0, 0];\n $w = 0; // don't flip horizontally\n\n if (($type = $data['type'] ?? '') !== 'FeatureCollection') {\n throw new Exception(\"Unrecognized Geojson type: $type\");\n }\n\n $res = [];\n\n foreach ($data['features'] as $exteriorIndex => $feature) {\n if (($type = $feature['type'] ?? '') !== 'Feature') {\n throw new Exception(\"Unrecognized Geojson feature: $type\");\n }\n if (($type = $feature['geometry']['type'] ?? '') !== 'Polygon') {\n throw new Exception(\"Unrecognized Geojson geometry: $type\");\n }\n\n // https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.6\n // \"For Polygons with more than one of these rings, the first MUST be\n // the exterior ring, and any others MUST be interior rings.\"\n foreach ($feature['geometry']['coordinates'] as $i => $coords) {\n $ref = &$res[$exteriorIndex][];\n\n // potrace contour is such that its bottom and right edges are on the outside\n // of the shape while top and left are inside. In other words, if right or bottom\n // edge's pixel is at (X;Y) then potrace will specify it as (X+1;Y+1)\n // but will specify (X;Y) for left and top edges. Therefore $x/$y can equal\n // to $w/$h (which they normally should not). We don't normalize this here\n // because this is very minor offset that the player will hardly recognize.\n //\n // Also, potrace flips the image vertically which, given the above, can\n // result in negative X/Y (-1 at minimum). This too works fine with <map>.\n //\n // Memo: potrace ensures that last coord closes the path but <map> would\n // do that automatically anyway.\n foreach ($coords as [$x, $y]) {\n $w and $x = $w - $x;\n $h and $y = $h - $y;\n $ref[] = round($x);\n $ref[] = round($y);\n }\n }\n }\n\n return $res;\n}", "public function getMarkersJSON()\n {\n $markers = [];\n \n foreach ($this->getAllMarkers() as $marker) {\n $markers[] = $marker->toMap();\n }\n \n return Convert::array2json($markers);\n }", "public function getGeographyData()\n {\n return $this->geography_data;\n }", "public function getGeo()\n {\n return $this->geo;\n }", "function wpgmza_b_return_polygon_array($poly_id) {\n global $wpdb;\n global $wpgmza_tblname_poly;\n $results = $wpdb->get_results($wpdb->prepare(\"SELECT * FROM $wpgmza_tblname_poly WHERE `id` = %d LIMIT 1\",intval($poly_id)) );\n foreach ( $results as $result ) {\n $current_polydata = $result->polydata;\n $new_polydata = str_replace(\"),(\",\"|\",$current_polydata);\n $new_polydata = str_replace(\"(\",\"\",$new_polydata);\n $new_polydata = str_replace(\"),\",\"\",$new_polydata);\n $new_polydata = explode(\"|\",$new_polydata);\n foreach ($new_polydata as $poly) {\n \n $ret[] = $poly;\n }\n return $ret;\n }\n}", "private function GetJsonGeoCode($address)\n\t{\n\t\t\n\t\t$geoCodeURL = \"https://maps.googleapis.com/maps/api/geocode/json?address=\".$address.\"&key=\".$this->APIKEY;\n\t\t// call the results via cURL -> more secure than file_get_contents.\n\t\t$ch = curl_init();\n\t\t$curlConfig = array(\n\t\t\tCURLOPT_URL => $geoCodeURL,\n\t\t\tCURLOPT_POST => true,\n\t\t\tCURLOPT_RETURNTRANSFER => true\n\t\t);\n\t\t// set opts\n\t\tcurl_setopt_array($ch, $curlConfig);\n\t\t// execute the call and pull the results\n\t\t$result = curl_exec($ch);\n\t\t// close the connection\n\t\tcurl_close($ch);\n\t\t// set results into array format for easy parsing - and pull the location\n\t\t$resultObj = $this->ParseJsonGeoCode($result);\t\t\t\t\t\t\n\t\treturn $resultObj;\t\t\n\t\n\t}", "function mapit_get_voting_areas_geometry($ary, $polygon_type = null) {\n global $mapit_client;\n $params = func_get_args();\n $result = $mapit_client->call('MaPit.get_voting_areas_geometry', $params);\n return $result;\n}", "public function getJsonArray()\n {\n $json = [\n \"ip\"=>$this->getIP(),\n \"ipType\" =>$this->getIpType(),\n \"latitude\" =>$this->getLatitude(),\n \"longitude\" =>$this->getLongitude(),\n \"city\" =>$this->getCity(),\n \"country\" =>$this->getCountry(),\n ];\n return $json;\n }", "protected function mapPoints(array $points): array\n {\n return array_map(function (GPXPoint $point) {\n return [\n 'latitude' => $point->latitude,\n 'longitude' => $point->longitude,\n 'elevation' => $point->elevation,\n 'time' => $point->time,\n 'name' => $point->name,\n 'description' => $point->description,\n ];\n }, $points);\n }", "public static function getActiveEventsMapGeoJSON()\n {\n $cacheExpireMinutes = 1440; // Set the duration time of the cache (1 day - 1440 minutes) - this cache tag get invalidates also on event save\n\n $eventsMapGeoJSONArrayCached = Cache::remember('active_events_map_markers_json', $cacheExpireMinutes, function () {\n $eventsData = self::getActiveEventsMapMarkersDataFromDb();\n $eventsMapGeoJSONArray = [];\n foreach ($eventsData as $key => $eventData) {\n //dd($eventData);\n\n // Generates event link\n $nextEventRepetitionId = EventRepetition::getFirstEventRpIdByEventId($eventData->id);\n $eventLinkformat = 'event/%s/%s'; //event/{{$event->slug}}/{{$event->rp_id}}\n $eventLink = sprintf($eventLinkformat, $eventData->event_slug, $nextEventRepetitionId);\n\n // Get Next event occurrence date\n $nextDateOccurence = EventRepetition::getFirstFutureEventRpDatesByEventId($eventData->id);\n if (! empty($nextDateOccurence)) {\n $nextDate = Carbon::parse($nextDateOccurence->start_repeat)->isoFormat('D MMM YYYY');\n } else {\n $nextDate = '';\n }\n\n $address = (! empty($eventData->address)) ? ', '.$eventData->address : '';\n $city = (! empty($eventData->city)) ? $eventData->city : '';\n\n // Add one element to the Geo array\n $eventsMapGeoJSONArray[] = [\n 'type' => 'Feature',\n 'id' => $eventData->id,\n 'properties' => [\n 'Title' => $eventData->title,\n 'Category' => EventCategory::getCategoryName($eventData->category_id),\n 'VenueName' => EventVenue::getVenueName($eventData->venue_id),\n 'City' => $city,\n 'Address' => $address,\n 'Link' => $eventLink,\n 'NextDate' => $nextDate,\n 'IconColor' => LaravelEventsCalendar::getMapMarkerIconColor($eventData->category_id),\n ],\n 'geometry' => [\n 'type' => 'Point',\n 'coordinates' => [$eventData->lng, $eventData->lat],\n ],\n ];\n }\n\n /* EVERY TIME THIS CHANGE REMEMBER TO FLUSH THE CACHE\n (php artisan cache:clear) */\n\n return $eventsMapGeoJSONArray;\n });\n\n $ret = json_encode($eventsMapGeoJSONArrayCached);\n\n return $ret;\n }", "public function points(): array;", "public static function toGeoJSONs($topojson) {\n if (is_scalar($topojson)) {\n $json = json_decode($topojson);\n } else {\n $json = $topojson;\n }\n\n if ($json->type != 'Topology') {\n throw new Exception('Type must be Topology');\n }\n\n if (property_exists($json, 'transform')) {\n $scale = $json->transform->scale;\n $translate = $json->transform->translate;\n } else {\n $scale = array(1, 1);\n $translate = array(0, 0);\n }\n\n $arcs = $json->arcs;\n $ret = array();\n foreach ($json->objects as $key => $object) {\n $ret[$key] = self::topoObjectToGeoObject($object, $scale, $translate, $arcs);\n }\n return $ret;\n }", "function json_post($post_id) {\n // $post = get_post($post_id);\n // $fields = get_fields($post_id);\n $content = array();\n\n //On récupère les lat lng en fonction de l'adresse\n $coords = geocode(get_field('adresse_de_lassociation',$post_id),get_field('ville',$post_id),\"FRANCE\");\n // $fields['latitude'] = $coords['latitude'];\n // $fields['longitude'] = $coords['longitude'];\n\n\n update_field('field_528e0e4107a59', $coords['latitude'], $post_id);\n update_field('field_528e0e5207a5a', $coords['longitude'], $post_id);\n\n\n //array_push($content,$fields);\n\n \n\n $tmp = array();\n foreach(get_posts( array('post_type'=> 'associations')) as $key=>$value){\n $id=$value->ID;\n\n $tmp = get_fields($id);\n $tmp['nom']=get_the_title($id);\n $tmp['permalink']=get_permalink($id);\n $tmp['categories']=wp_get_post_terms($id,'categories');\n $tmp['action_en_cours']=wp_get_post_terms($id,'action_en_cours');\n\n array_push($content, $tmp);\n }\n\n $content = json_encode($content);\n\n $fp = fopen(get_stylesheet_directory().\"/associations.json\",\"wb\");\n fwrite($fp,$content);\n fclose($fp);\n\n}", "public static function getCommunes($minDate, $maxDate) {\n\t\t$polygons = Polygon::all();\n\t\tforeach ($polygons as $polygon) {\n\t\t\t$polygon->id = (int) $polygon->id;\n\t\t\t$polygon->value = (int) $polygon->summary($minDate, $maxDate);\n\t\t\t$polygon->quantity = $polygon->quantity($minDate, $maxDate);\t\t\t\n\t\t\t$polygon->path = PolygonPath::where('polygon_id', $polygon->id)->get();\n\t\t\tforeach ($polygon->path as $point) {\n\t\t\t\t$point->lat = (float) $point->lat;\n\t\t\t\t$point->lng = (float) $point->lng;\n\t\t\t}\n\t\t}\n\t\treturn array('data' => $polygons);\n\t}", "private function __geocoords($q,$options = array())\n\t{\n\t\t$data = array();\n\n\t\t//Extract variables to use\n\t\textract($options);\n\t\textract($this->settings[$model->alias]['providers'][$provider]);\n\n\t\t//Add country code to query\n\t\t$q .= ', '.$country_code;\n\n\t\t//Build url\n\t\t$url = String::insert($url,compact('api','q','country_code'));\n\n\t\t//Get data and parse\n\t\tif ($result = $this->connection->get($url)) {\n\t\t\tforeach ($fields as $field => $regex) {\n\t\t\t\tif (preg_match($regex,$result,$match)) {\n\t\t\t\t\tif (!empty($match[1]))\n\t\t\t\t\t\t$data[$field] = $match[1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}", "public function getAsArray($serializeNestedObjects=false) {\n\n\t\treturn [\"locationLabel\"=>$this->locationLabel, \"address\"=>$this->address, \"loc\"=>array(\"type\"=>\"Point\",\"coordinates\"=>[(float)$this->longitude,(float)$this->latitude]), \"isPrimary\"=>$this->isPrimary];\n\t}", "public function addPolygon($points)\n {\n $pointCount = count($points);\n\n $this->dataString .= 'M'. \n number_format($points[0]->x, 2, '.', '') .' '. \n number_format($points[0]->y, 2, '.', '');\n\n for ($i = 1; $i < $pointCount; $i++) {\n $this->dataString .= 'L'. \n number_format($points[$i]->x, 2, '.', '') .' '. \n number_format($points[$i]->y, 2, '.', '');\n }\n\n $this->dataString .= 'Z';\n }", "public function jsonSerialize()\n {\n $json = [];\n $json['id'] = $this->id;\n $json['points'] = $this->points;\n $json['name'] = $this->name;\n $json['definition'] = $this->definition;\n $json['created_at'] = $this->createdAt;\n\n return array_filter($json, function ($val) {\n return $val !== null;\n });\n }", "function world_to_json(){\n $world_str = \"{\\\"color\\\":{\";\n $i2 = 0;\n $len2 = count($_SESSION['world']);\n foreach ($_SESSION['world'] as $oneroom){\n $world_str .= \"\\\"{$oneroom[\"color\"]}\";\n $world_str .= \"\\\":{ \\\"points\\\":[\";\n $i = 0;\n $len = count($oneroom[\"points\"]);\n foreach ($oneroom[\"points\"] as $value) {\n $world_str .= \" [\" . $value[0] . \", \" . $value[1] . \"] \";\n if ($i != $len - 1) {\n $world_str .= \",\";\n }\n $i++;\n }\n if($i2!=$len2 - 1) {\n $world_str .= \"] }, \";\n }else{\n $world_str .= \"] } \";\n }\n $i2++;\n }\n $world_str .= \"} }\";\n\n return $world_str;\n}", "public function jsonSerialize()\r\n {\r\n $json = array();\r\n $json['street'] = $this->street;\r\n $json['number'] = $this->number;\r\n $json['complement'] = $this->complement;\r\n $json['postal_code'] = $this->postal_code;\r\n $json['locality'] = $this->locality;\r\n $json['city'] = $this->city;\r\n $json['region_code'] = $this->region_code;\r\n $json['country'] = $this->country;\r\n\r\n return $json;\r\n }", "public function jsonSerialize(){\n return [\n \"name\" => $this->getName(),\n \"location\" => $this->getLocation()\n ];\n }", "public function toArray()\n {\n return [\n 'city' => $this->city,\n 'region' => $this->region,\n 'country' => $this->country,\n 'countryCode' => $this->countryCode,\n 'latitude' => $this->latitude,\n 'longitude' => $this->longitude,\n ];\n }", "public function getLatLng() {\n return $point = $this->getLat().','.$this->getLng();\n }", "private function ParseJsonGeoCode($json)\n\t{\n\t\t$ArrayResults = json_decode($json);\n\t\t\n\t\t// grab the location object\n\t\t$_location_array = $ArrayResults->results[0]->geometry->location;\n\t\t\n\t\t// return the location object\n\t\treturn $_location_array;\n\t\t\t\t\t\t\n\t}", "function get_buffer_polygone_for_point_wkt($lon,$lat,$d_metres){\n \n $points = array();\n for($i = 0; $i < 360; $i = $i + 10){\n $points[] = get_point_for_distance($lon,$lat,$d_metres / 1000,$i);\n }\n \n // print_r($points);\n \n $out = \"POLYGON((\";\n for($i = 0; $i < count($points); $i++){\n if($i > 0) $out .= ', ';\n $out .= implode(' ', $points[$i]);\n }\n $out .= ', ' . implode(' ', $points[0]); // ends with start point\n $out .= \"))\";\n \n return $out;\n \n}", "public function geoId($id)\n {\n\t// build parameters\n\t$parameters = null;\n\n\t// make the call\n\treturn (array) $this->doCall(\n\t 'geo/id/' . (string) $id . '.json', $parameters\n\t);\n }", "public function getGeoDat($geoCurrentData) \n {\n $currData = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::trimExplode(';', $geoCurrentData ); \n if( is_array($currData) && ($currData[0] && $currData[1]) ) {\n $returnArray = array( 'lat' => $currData[0], 'lng' => $currData[1] );\n } else {\n $returnArray = array( 'lat' => 0, 'lng' => 0 );\n }\n return $returnArray;\n }", "public function getGeoList($params = [])\n {\n $this->sendRequest(\n [\n 'methodName' => 'geo.list',\n 'parameters' => [\n 'limit' => $params['limit'] ?? 10,\n 'regionType' => $params['regionType'] ?? 'all',\n 'lang' => strtoupper(LANGUAGE_ID),\n 'name' => $params['name'] ? ucfirst($params['name']) : ''\n ]\n ]\n );\n\n return $this->result;\n }", "public function toJSON()\n {\n return array(\n 'id' => $this->id,\n 'code_name' => $this->name,\n 'full_name' => $this->display_name,\n\n 'x' => $this->location_x,\n 'y' => $this->location_z,\n\n 'is_visible' => $this->is_visible,\n 'is_safe' => $this->is_safe,\n 'is_intersection' => $this->is_intersection,\n 'is_portal' => $this->is_portal\n );\n }", "public function getHeatMapDraw($geojson, $type = \"price_rent\") {\n\t\tif($type == \"price_rent\") {\n\t\t\t$table = \"price_density_rent\";\n\t\t} elseif($type == \"price_sell\") {\n\t\t\t$table = \"price_density_sell\";\n\t\t} else {\n\t\t\t$table = \"population_density\";\n\t\t}\n\t\t\n\t\t$query = \"SELECT ST_AsGeoJson((ST_Dump(geom)).geom) as polygon, densidad from $table where ST_Overlaps(\";\n\t\t$query .= \"$geojson, geom) or ST_Contains(\";\n\t\t$query .= \"$geojson, geom);\";\n\t\t\n\t\t$data = $this->Db->query($query);\n\t\t\n\t\tif(!$data) return false;\n\t\t\n\t\t$geojson = '{';\n\t\t$geojson .='\"type\": \"FeatureCollection\",';\n\t\t$geojson .='\"crs\": { \"type\": \"name\", \"properties\": { \"name\": \"urn:ogc:def:crs:OGC:1.3:CRS84\" } },';\n\t\t$geojson .='\"features\": [';\n\t\t\n\t\tforeach($data as $key=> $value) {\n\t\t\t$geojson .= '{ \"type\": \"Feature\", \"properties\": { \"density\": ' . $value[\"densidad\"]. ', \"color\": \"' . $this->getColorHeatMap($value[\"densidad\"], $type) . '\" },';\n\t\t\t$geojson .= '\"geometry\": ' . $value[\"polygon\"];\n\t\t\t$geojson .= '},';\n\t\t}\n\t\t\n\t\t$geojson = rtrim($geojson, \",\");\n\t\t$geojson .= ']';\n\t\t$geojson .= '}';\n\t\n\t\treturn $geojson;\n\t}", "public function jsonSerialize()\r\n {\r\n $json = array();\r\n $json['nbTypos'] = $this->nbTypos;\r\n $json['firstMatchedWord'] = $this->firstMatchedWord;\r\n $json['proximityDistance'] = $this->proximityDistance;\r\n $json['userScore'] = $this->userScore;\r\n $json['geoDistance'] = $this->geoDistance;\r\n $json['geoPrecision'] = $this->geoPrecision;\r\n $json['nbExactWords'] = $this->nbExactWords;\r\n $json['words'] = $this->words;\r\n $json['filters'] = $this->filters;\r\n $json['matchedGeoLocation'] = $this->matchedGeoLocation;\r\n\r\n return $json;\r\n }", "private function getLatLng() {\n\t\tif( $this->getAutomaticLocation() && ( $this->isChanged() || ( !$this->getLat() && !$this->getLng() ) ) ) {\n\t\t\t$addressStr = $this->getAddLine1() . ' ' . $this->getStreetName() . ',' . $this->getTown();\n\t\t\t$addressStr.= ( $this->getCity() ) ? ',' . $this->getCity() : '';\n\t\t\t$addressStr.= ( $this->getRegion() ) ? ',' . $this->getRegion() : '';\n\t\t\t$addressStr.= ',' . $this->getPostalCode() . ',' . $this->getCountryCode();\n\t\t\t$req = sprintf( 'http://maps.googleapis.com/maps/api/geocode/json?address=%s&sensor=false', urlencode( $addressStr ) );\n\t\t\tif( !( $response = @file_get_contents( $req ) ) ) {\n\t\t\t\tthrow new Exception( sprintf( 'Unable to contact (%s)', $req ) );\n\t\t\t}\n\t\t\t$geoCode = json_decode( $response );\n// Do a switch here based on the possible status messages returned\n\t\t\tif( is_object( $geoCode ) ) {\n\t\t\t\tswitch( $geoCode->status ) {\n\t\t\t\t\tcase static::API_RESPONSE_ZERO_RESULTS:\n\t\t\t\t\t\t// ZERO RESULTS\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase static::API_RESPONSE_OK:\n\t\t\t\t\t\t$o = new StdClass();\n\t\t\t\t\t\t$o->Lat = $geoCode->results[0]->geometry->location->lat;\n\t\t\t\t\t\t$o->Lng = $geoCode->results[0]->geometry->location->lng;\n\t\t\t\t\t\treturn $o;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new Exception( sprintf( 'Invalid response (%s) from (%s)', $response, $req ) );\n\t\t\t}\n\t\t} else {\n\t\t\t$o = new StdClass();\n\t\t\t$o->Lat = $this->getLat();\n\t\t\t$o->Lng = $this->getLng();\n\t\t\treturn $o;\n\t\t}\n\t}", "function jsonSerialize() {\n $data = array();\n if ($this->getStreet()) {\n $data[self::FIELDNAME_STREET] = $this->getStreet();\n }\n if ($this->getZip()) {\n $data[self::FIELDNAME_ZIP] = $this->getZip();\n }\n if ($this->getCity()) {\n $data[self::FIELDNAME_CITY] = $this->getCity();\n }\n if ($this->getCountry()) {\n $data[self::FIELDNAME_COUNTRY] = $this->getCountry();\n }\n if ($this->getCoordinate()) {\n $data[self::FIELDNAME_COORDINATE] = $this->getCoordinate();\n }\n return $data;\n }", "public function get()\n {\n $url = $this->endpoint . '/' . $this->lat . ',' . $this->lon;\n\n if ($this->timestamp) {\n $url .= ',' . $this->timestamp;\n }\n\n return json_decode($this->client->get($url, [\n 'query' => $this->params,\n ])->getBody());\n }", "static function test_new() {\n $multipoint = Geometry::fromWkt('MULTIPOINT (153042 6799129,153043 6799174,153063 6799199)');\n echo \"multipoint=$multipoint\\n\";\n echo \"wkt=\",$multipoint->wkt(),\"\\n\";\n\n foreach ([\n 'MULTIPOINT(30 30,200 200)',\n //'MULTIPOINTxx(30 30,200 200)',\n [[10,10],[20,20]],\n [[10,10],[20,20,60]],\n //[[10,10],[20,20,60,80]],\n [new Point([0,0]), new Point([5,10])],\n ] as $param) {\n $mp = new MultiPoint($param);\n if (is_array($param)) {\n echo \"new MultiPoint(\"; print_r($param); echo \" -> $mp\\n\";\n //print_r($ls);\n }\n else\n echo \"new MultiPoint($param) -> $mp\\n\";\n echo \"wkt:\",$mp->wkt(),\"\\n\";\n echo \"GeoJSON:\",json_encode($mp->geojson()),\"\\n\";\n }\n }", "public function allCoordinates()\n {\n $houses = House::where('status', 1)->get();\n $houseCoordinates = [];\n foreach ($houses as $house) {\n $coordinate = $house->coordinates()->first();\n if ($coordinate) {\n array_push($houseCoordinates, $coordinate);\n }\n }\n return response()->json($houseCoordinates, 200);\n }", "public function getData()\n\t{\n $data = [];\n\n $temperatures = new WorldTemperatures;\n\n foreach ($this->cities as $city) {\n $temperateInCelsius = $temperatures->fromLatLng($city['name'], $city['lat'], $city['long']);\n\n $celsius = round($temperateInCelsius);\n $fahrenheit = round(($temperateInCelsius * 1.8) + 32);\n\n $data[\"{$city['name']}\"] = \"{$celsius}/{$fahrenheit}\";\n }\n\n $data['dallas_season'] = $this->currentSeason();\n\n return $data;\n\t}", "public function toArray($encode = false)\n {\n $latLng = [$this->lat, $this->lng];\n\n return $encode\n ? new JsExpression(Json::encode($latLng, LeafletMap::JSON_OPTIONS))\n : $latLng;\n }", "public function array2LatLng($value)\n {\n if (isset($value['lat'])) {\n return new LatLng($value);\n }\n\n return new LatLng([\n 'lat' => $value[0],\n 'lng' => $value[1]\n ]);\n }", "public function jsonSerialize()\n {\n $json = array();\n $json['price'] = $this->price;\n $json['store_id'] = $this->storeId;\n $json['sku'] = $this->sku;\n $json['price_from'] = $this->priceFrom;\n $json['price_to'] = $this->priceTo;\n $json['extension_attributes'] = $this->extensionAttributes;\n\n return $json;\n }", "public function to_json($post_array)\n {\n return json_encode($post_array);\n }", "public static function fromGeoJsonFeature($feature)\n {\n $prop = $feature->properties;\n $obj = new static([\n 'object_id' => $prop->OBJECTID,\n 'org_name' => $prop->ORGANIZATION_NAME,\n 'geo_json' => $feature->geometry,\n ]);\n return $obj;\n }", "public function getJson()\n {\n $newObject = $this->originalData;\n $resourcesClone = $this->resources;\n\n // Remove Main Options that might have been added\n $resourcesClone = array_filter($resourcesClone, function($value) {\n if ($value->gmResource()->getTypeName() == 'MainOptions') {\n return false;\n }\n return true;\n });\n\n // Cast to an array of objects\n $newObject->resources = array_values($resourcesClone);\n //@todo make sure this sorts the way GM does, prevent loads of changes @see\n $newObject->script_order = $this->script_order;\n return JsonService::encode($newObject);\n }", "public function makeDataPoints(): array\n {\n set_time_limit(3600); //1 hour time limit\n $this->makeDirectory();\n $jsonFile = $this->directory . self::JSON_OUTPUT_FILE;\n if (!file_exists($jsonFile) || !Cache::has($jsonFile)) {\n $simulations = $this->getSimulationsFromTags();\n $csvFile = $this->prepareCSVFile($simulations);\n $correlationFile = $this->computeCorrelationFile($csvFile);\n $data = $this->prepareCollection($correlationFile, $jsonFile, $simulations);\n Cache::put($jsonFile, true, now()->addWeek());\n } else {\n $data = $this->readCollection($jsonFile);\n }\n $data = $data->sortBy('correlation');\n if ($this->top) {\n if ($this->direction === 'negative') {\n $data = $data->take($this->n);\n } else {\n $data = $data->take(-$this->n);\n }\n }\n return [\n 'x' => $data->pluck('name'),\n 'y' => $data->pluck('correlation'),\n 'customdata' => $data->pluck('id')->map(\n fn($id) => [\n $id,\n $this->fn,\n $this->useEndpoints,\n $this->usePerturbation,\n ]\n ),\n ];\n }", "public function collectGeographyData()\n {\n try {\n $this->geography_data = [\n 'lat' => $this->response->geometry->location->lat,\n 'long' => $this->response->geometry->location->lng,\n ];\n } catch (\\Exception $e) {\n $this->geography_data = null;\n }\n\n return $this;\n }", "private function bound_to_coord($bound){\r\n $vertices=$bound->getVertices();\r\n $polygon=[\r\n 'x1' => $vertices[0]->getX(),\r\n 'y1' => $vertices[0]->getY(),\r\n 'x2' => $vertices[1]->getX(),\r\n 'y2' => $vertices[1]->getY(),\r\n 'x3' => $vertices[2]->getX(),\r\n 'y3' => $vertices[2]->getY(),\r\n 'x4' => $vertices[3]->getX(),\r\n 'y4' => $vertices[3]->getY(),\r\n ];\r\n return $polygon;\r\n }", "public function json()\n\t{\n\t\t$data = [\n\t\t\t'totalResults' => '3',\n\t\t\t'values' => [\n\t\t\t\t['name' => 'John', 'age' => 30],\n\t\t\t\t['name' => 'Mary', 'age' => 24],\n\t\t\t\t['name' => 'Petter', 'age' => 18],\n\t\t\t],\n\t\t];\n\n\t\treturn $data;\n\t}", "function getAddressComponentsFromLatLng($args){\r\n\t\t$requvired = [\t['latitude','latitude'] ,['longitude','longitude'] ];\t\r\n\t\tif(! $this->checkAruguments($requvired,$args)){ return $this->_getStatusMessage(1, 1); }\r\n\t\t$lat = $args['latitude'];\r\n\t\t$lng = $args['longitude'];\r\n\t\t$geocode = file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?latlng='.$lat.','.$lng.'&sensor=false');\r\n\t\t\r\n\t\t$api_response = array();\r\n\t\t$output= json_decode($geocode);\r\n\t\tfor($j=0;$j<count($output->results[0]->address_components);$j++){\r\n\t\t\t$api_response[$output->results[0]->address_components[$j]->types[0]] = $output->results[0]->address_components[$j]->long_name;\r\n\t\t}\r\n\t\t$response = array('errNum'=>200,'errFlag'=>0,'errMsg'=>'ok','data'=>$api_response);\r\n\t\t\r\n\t\treturn $response;\r\n\t}", "function getPointsFromArc($tid) {\n\n require ('db_config.php');\n\n $query = 'SELECT ST_X(lonlat) as lon, ST_Y(lonlat) as lat FROM \"Trajectory\", \"Point\", \"hasTP\" WHERE \"Trajectory\".id = \"hasTP\".tid AND \"Point\".id = \"hasTP\".pid AND \"Trajectory\".id = '.strval($tid).' ORDER BY pid ASC;';\n $result = pg_query($db,$query);\n $rset = pg_fetch_all($result);\n\n $ml = [];\n foreach ($rset as $t) {\n $ml[] = new LatLng($t['lat'], $t['lon']);\n }\n\n return json_encode($ml);\n}", "function convertToPostGisPoint($latlng){\n\t\t//Remove leading parentheses\n\t\t$latlng = str_replace(array('(',')'), '', $latlng);\n\t\n\t\t//Explode and trim latitude and longitude\n\t\tlist ($lat, $lng) = array_map('trim',explode(\",\",$latlng));\n\t\n\t\t$expr = \"ST_GeomFromText('POINT(\".$lng.\" \".$lat.\")', 4326)\";\n\t\t$db = $this->getDataSource();\n\t\treturn $db->expression($expr);\n\t}", "function getCoordinates($address){\r\n\t$key = \"AIzaSyA2PDrfTTbXNZKOn15K-VbWgLfdTevM3qw\";\r\n\t$url = \"https://maps.googleapis.com/maps/api/geocode/json?address=\".urlencode($address).\"&sensor=false&key=\".$key;\r\n\t$json = file_get_contents($url);\r\n\t$results = json_decode($json, true);\r\n\r\n\t$stack = array();\r\n\t$status = $results['status'];\r\n\tif ($status == \"OK\") {\r\n\t\t$lat = $results['results']['0']['geometry']['location']['lat'];\r\n\t\tarray_push($stack, $lat);\r\n\t\t$lng = $results['results']['0']['geometry']['location']['lng'];\r\n\t\tarray_push($stack, $lng);\r\n\t}\r\n\telse{\r\n\t\techo \"ERREUR DE GOOGLE GEOCODE API\";\r\n\t\t$incase = array();\r\n\t\tarray_push($stack, 48.853396);\r\n\t\tarray_push($stack, 2.348779);\r\n\t\treturn $incase;\r\n\t}\r\n\t\r\n\treturn $stack;\r\n}", "public function jsonSerialize()\n {\n $json = array();\n $json['cost'] = $this->cost;\n $json['store_id'] = $this->storeId;\n $json['sku'] = $this->sku;\n $json['extension_attributes'] = $this->extensionAttributes;\n\n return $json;\n }", "public function getGoogleGeocodeData(){\r\n\t\treturn Place::getGoogleGeocodeData($this->getAsGoogleQuery());\r\n\t}", "public function getJSON()\r\n\t{\r\n\t\treturn $this->getJSONString();\r\n\t}", "public function toJson(){\n\t\t$array = $this->toArray();\n\t\treturn json_encode($array);\n\t}", "public function jsonSerialize()\r\n {\r\n $json = array();\r\n $json['compositeFault'] = $this->compositeFault;\r\n $json['customerSupport'] = $this->customerSupport;\r\n $json['servicePoints'] = $this->servicePoints;\r\n\r\n return $json;\r\n }", "public function getPolygons(): array\n {\n return $this->items;\n }", "public function toJSONString(){\n $this->buildArray();\n return json_encode($this->array);\n }", "public static function generateJSON();", "public function projectPoints($pts) {\n\t\tif (preg_match('/^UTM/',$this->coordinate_type)) {\n\t\t\tforeach ($pts as $i=>$pt) {\n\t\t\t\t$latlon = $this->utm2latlon($pts[$i][0], $pts[$i][1],$this->utm_zone);\n\t\t\t\t$pts[$i] = array(\n\t\t\t\t\t\tround($latlon['longitude'],6),\n\t\t\t\t\t\tround($latlon['latitude'],6)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "public function jsonize()\n {\n return json_encode($this->toArray());\n }", "public function getJSON(){\n\t\treturn $this->json;\n\t}", "public function getCoordinates(): array\n {\n return $this->coordinates;\n }", "public function get_json()\n {\n return $this->_json;\n }", "public function toJson();", "public function toJson();", "public function jsonSerialize()\n {\n $json = array();\n $json['currency'] = $this->currency;\n $json['name'] = $this->name;\n $json['notes'] = $this->notes;\n $json['price'] = $this->price;\n\n return $json;\n }", "public function getJsonData() {\n\t\treturn FormatJson::decode( $this->getNativeData(), true );\n\t}", "public function toArray()\n {\n return [\n 'x' => $this->x(),\n 'y' => $this->y(),\n 'z' => $this->z\n ];\n }", "public function wktBuildPoint(array $point);", "public function wktGenerateMultipolygon();", "public function addEle($geom)\n {\n // TODO check $geom\n $j = json_decode($geom, true);\n $type = $j['type'];\n $coord = $j['coordinates'];\n $new_coord = array();\n\n switch ($type) {\n case 'LineString':\n echo \"Computing ele progres: \";\n $tot = count($coord);\n $count = 0 ;\n foreach ($coord as $l) {\n // Progress %\n $perc = floor($count/$tot*100);\n echo \"\\033[5D\";\n echo str_pad($perc,3,' ',STR_PAD_LEFT).\"%\";\n $count ++;\n\n // CALC\n $new_coord[] = array($l[0], $l[1], self::getEle($l[0], $l[1]));\n echo \".\";\n }\n echo \"\\n\";\n break;\n\n case 'Point':\n $new_coord = array($coord[0], $coord[1], self::getEle($coord[0], $coord[1]));\n break;\n\n default:\n throw new WebmappExceptionGeoJsonBadGeomType(\"$type not valid geojson type or not yet implemented in WebmappPostGis::addEle method.\", 1);\n break;\n }\n $j_new = array('type' => $type, 'coordinates' => $new_coord);\n\n return json_encode($j_new);\n }", "public function getCoordinates();" ]
[ "0.7057445", "0.6830986", "0.6685095", "0.63941664", "0.6332935", "0.63086164", "0.62386596", "0.6221871", "0.6051053", "0.6034332", "0.5992011", "0.5938496", "0.5934587", "0.5894506", "0.5868764", "0.57872504", "0.5758966", "0.5728446", "0.57201415", "0.56566375", "0.5639347", "0.5627218", "0.5613118", "0.56093585", "0.5599922", "0.55957884", "0.5561814", "0.5544311", "0.55186546", "0.550489", "0.54802215", "0.5478949", "0.54701495", "0.54194343", "0.5413538", "0.53976625", "0.5394696", "0.5394345", "0.5382294", "0.53675604", "0.53392494", "0.5327486", "0.5292686", "0.52886575", "0.5280416", "0.52777267", "0.52607304", "0.52519923", "0.52429664", "0.52117944", "0.5196021", "0.51692265", "0.5159731", "0.5159544", "0.51406074", "0.5137637", "0.5121559", "0.50855446", "0.5053966", "0.50439537", "0.5019238", "0.50178546", "0.5016999", "0.5016401", "0.5015782", "0.50155497", "0.5015068", "0.5005577", "0.5000548", "0.49883255", "0.49879256", "0.4983979", "0.4981472", "0.4981381", "0.4979892", "0.4978622", "0.4970479", "0.49700812", "0.49679488", "0.4960662", "0.49487033", "0.49422792", "0.49298495", "0.49182338", "0.4917196", "0.49088308", "0.4907485", "0.49041852", "0.48990813", "0.48836225", "0.4872928", "0.48653087", "0.48653087", "0.48641774", "0.48612347", "0.48489594", "0.48462233", "0.48442957", "0.48436016", "0.48422793" ]
0.636582
4
WP Framework core functions
function wpf_initial_constants() { // Sets the File path to the current parent theme's directory. define( 'PARENT_THEME_DIR', TEMPLATEPATH ); // Sets the URI path to the current parent theme's directory. define( 'PARENT_THEME_URI', get_template_directory_uri() ); // Sets the File path to the current parent theme's directory. define( 'CHILD_THEME_DIR', STYLESHEETPATH ); // Sets the URI path to the current child theme's directory. define( 'CHILD_THEME_URI', get_stylesheet_directory_uri() ); // Sets the file path to WP Framework define( 'WPF_DIR', PARENT_THEME_DIR . '/framework' ); // Sets the URI path to WP Framework define( 'WPF_URI', PARENT_THEME_URI . '/framework' ); // Sets the file path to extensions define( 'WPF_EXT_DIR', WPF_DIR . '/extensions' ); // Sets the URI path to extensions define( 'WPF_EXT_URI', WPF_URI . '/extensions' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function wpInit() {}", "function start_wp()\n {\n }", "public function wp_loaded()\n {\n }", "function WordpressConnect(){\n\n\t\t$this->add_init_hook();\n\n\t}", "function ap_core_setup() {\r\n require_once ( get_template_directory() . '/inc/theme-options.php' );\r\n // include theme hook alliance hooks\r\n require_once( get_template_directory() . '/inc/hooks.php' );\r\n // include bootstrap nav walker class\r\n require_once( get_template_directory() . '/inc/class-bootstrap-nav-walker.php' );\r\n\r\n // i18n stuff\r\n load_theme_textdomain('museum-core', get_template_directory() .'/lang');\r\n\r\n // Add title tag support.\r\n add_theme_support( 'title-tag' );\r\n \r\n // html5 theme support\r\n add_theme_support( 'html5' );\r\n\r\n // post thumbnail support\r\n add_theme_support( 'post-thumbnails' );\r\n set_post_thumbnail_size( 150, 150 ); // 150 pixels wide by 150 pixels tall, box resize mode\r\n // post formats\r\n // register all post formats -- child themes can remove some post formats as they so desire\r\n add_theme_support('post-formats',array('aside','gallery','link','image','quote','status','video','audio','chat'));\r\n\r\n // automatic feed links\r\n add_theme_support('automatic-feed-links');\r\n\r\n // custom nav menus\r\n // This theme uses wp_nav_menu() in three (count them, three!) locations.\r\n register_nav_menus( array(\r\n \t'top' => __( 'Top Header Navigation', 'museum-core' ),\r\n \t'main' => __( 'Main Navigation', 'museum-core' ),\r\n \t'footer' => __( 'Footer Navigation', 'museum-core' ),\r\n ) );\r\n\r\n // This theme allows users to set a custom background\r\n add_theme_support( 'custom-background', array() ); // 'nuff said. there are no defaults here, so we'll move on to headers\r\n\r\n add_theme_support( 'custom-header', array(\r\n // default header image\r\n 'default-image' => get_template_directory_uri() . '/images/headers/nature.jpg',\r\n // header text? no, because we're doing it a different way (though it would probably be good to fix this later)\r\n 'header-text' => false,\r\n // header image width\r\n 'width' => 1140,\r\n // flexible height? sure\r\n 'flex-height' => true,\r\n // header image height\r\n 'height' => 200,\r\n // admin head callback\r\n 'admin-head-callback' => 'core_admin_header_style' )\r\n );\r\n\r\n // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.\r\n register_default_headers( array(\r\n \t'nature' => array(\r\n \t\t'url' => '%s/images/headers/nature.jpg',\r\n \t\t'thumbnail_url' => '%s/images/headers/nature-thumbnail.jpg',\r\n \t\t/* translators: header image description */\r\n \t\t'description' => __( 'Nature', 'museum-core' )\r\n \t),\r\n \t'smoke' => array(\r\n \t\t'url' => '%s/images/headers/smoke.jpg',\r\n \t\t'thumbnail_url' => '%s/images/headers/smoke-thumbnail.jpg',\r\n \t\t/* translators: header image description */\r\n \t\t'description' => __( 'Smoke', 'museum-core' )\r\n \t),\r\n \t'lights1' => array(\r\n \t\t\t'url' => '%s/images/headers/lights1.jpg',\r\n \t\t'thumbnail_url' => '%s/images/headers/lights1-thumbnail.jpg',\r\n \t\t/* translators: header image description */\r\n \t\t'description' => __( 'Lights 1', 'museum-core' )\r\n \t\t),\r\n 'lights2' => array(\r\n 'url' => '%s/images/headers/lights2.jpg',\r\n 'thumbnail_url' => '%s/images/headers/lights2-thumbnail.jpg',\r\n /* translators: header image description */\r\n 'description' => __( 'Lights 2', 'museum-core' )\r\n ),\r\n \t'lights3' => array(\r\n \t\t'url' => '%s/images/headers/lights3.jpg',\r\n \t\t\t'thumbnail_url' => '%s/images/headers/lights3-thumbnail.jpg',\r\n \t\t/* translators: header image description */\r\n \t\t'description' => __( 'Lights 3', 'museum-core' )\r\n \t)\r\n ) );\r\n\r\n function core_admin_header_style() {\r\n // I don't have any custom header styles...yet.\r\n }\r\n\r\n\r\n \t// this changes the output of the comments\r\n if (!function_exists('ap_core_comment')) {\r\n \tfunction ap_core_comment($comment, $args, $depth) {\r\n $GLOBALS['comment'] = $comment; ?>\r\n <li <?php comment_class( 'media' ); ?> id=\"li-comment-<?php comment_ID() ?>\">\r\n <div id=\"comment-<?php comment_ID(); ?>\" class=\"the_comment\">\r\n <div class=\"comment-author vcard\">\r\n <?php if ( get_avatar($comment) ) : ?>\r\n <div class=\"thumbnail media-object\"><?php echo get_avatar($comment,$size='64',$default='' ); ?></div>\r\n <?php endif; ?>\r\n </div>\r\n <div class=\"media-body\">\r\n <label><?php echo sprintf(_x('On %1$s at %2$s, %3$s said:', '1: date, 2: time, 3:author', 'museum-core'),\r\n esc_html( get_comment_date() ),\r\n esc_html( get_comment_time() ),\r\n wp_kses_post( get_comment_author_link() )\r\n ); ?></label>\r\n <?php if ($comment->comment_approved == '0') : ?>\r\n <em><?php _e('Your comment is awaiting moderation.', 'museum-core') ?></em>\r\n <br />\r\n <?php endif; ?>\r\n <?php comment_text() ?>\r\n <?php if ( comments_open() ) {\r\n if ( $depth < $args['max_depth'] ) { ?>\r\n <div class=\"reply\"><button class=\"btn btn-default btn-sm\">\r\n <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'reply_text' => __('Respond to this','museum-core'), 'max_depth' => $args['max_depth']))) ?>\r\n </button></div>\r\n <?php }\r\n } ?>\r\n <small>\r\n <div class=\"comment-meta commentmetadata\"><?php edit_comment_link( '<span class=\"text-danger\">' . __('(Edit)', 'museum-core') . '</span>','','') ?></div>\r\n <a href=\"<?php comment_link(); ?>\"><?php _e( 'Permalink', 'museum-core' ); ?></a>\r\n </small>\r\n </div>\r\n </div>\r\n </li>\r\n <?php\r\n }\r\n }\r\n\r\n \t// this changes the default [...] to be a read more hyperlink\r\n if (!function_exists('ap_core_new_excerpt_more')) {\r\n \tfunction ap_core_new_excerpt_more($more) {\r\n global $post;\r\n \t\treturn '...&nbsp;(<a href=\"'. get_permalink($post->ID) . '\">' . __('read more','museum-core') . '</a>)';\r\n \t}\r\n \tadd_filter('excerpt_more', 'ap_core_new_excerpt_more');\r\n }\r\n\r\n }", "function wp_functionality_constants()\n {\n }", "function wpt_install(){\n //Nothing to say for this version\n}", "function wpt()\n{\n return \\WPTheme\\Theme::instance();\n}", "function owa_main() {\r\n\t\r\n\t//global $user_level;\r\n\t\r\n\t$owa = owa_getInstance();\r\n\towa_coreAPI::debug('wp main request method');\r\n\t\r\n\t//Check to see if this is a Feed Reeder\r\n\tif( $owa->getSetting('base', 'log_feedreaders') && is_feed() ) {\r\n\t\t$event = $owa->makeEvent();\r\n\t\t$event->setEventType('base.feed_request');\r\n\t\t$event->set('feed_format', $_GET['feed']);\r\n\t\t// Process the request by calling owa\r\n\t\treturn $owa->trackEvent($event);\r\n\t}\r\n\t\r\n\t// Set the type and title of the page\r\n\t$page_type = owa_get_page_type();\r\n\t$owa->setPageType( $page_type );\r\n\t// Get Title of Page\r\n\t$owa->setPageTitle( owa_get_title( $page_type ) );\r\n}", "function wp_upgrade()\n {\n }", "function bw_setup()\n {\n add_theme_support('post-thumbnails'); \n\n //add theme support - custom logo\n add_theme_support( 'custom-logo', array(\n 'height' => 40\n ));\n\n //register menus\n register_nav_menus(array(\n 'primary-menu' => __('Primary'),\n 'footer-menu' => __('Footer'),\n 'social-menu' => __('Social')\n ));\n\n //set the permalink structure\n global $wp_rewrite;\n $wp_rewrite->set_permalink_structure( '/%postname%/');\n\n //create pages\n if (isset($_GET['activated']) && is_admin()){\n $pages = array(\n array('title' => 'Home'),\n array('title' => 'Shop'),\n array('title' => 'Our Story'),\n array('title' => 'Blog'),\n array('title' => 'Contact')\n );\n foreach($pages as $page){\n create_page($page['title']);\n }\n \n } \n }", "public function wpide() {\r\n\t\t$this->__construct();\r\n\t}", "function nwclean_setup() {\n\t\tif ( function_exists( 'register_nav_menu' ) ) {\n\t\t\tregister_nav_menu( 'Main navigation menu', 'Main navigation menu' );\n\t\t}\n\t\t/*\n\t\t * Adding expert capabilities\n\t\t */\n\t\tadd_post_type_support( 'page', 'excerpt' );\n\t\t/* \n\t\t * Localising wordpress\n\t\t */\n\t\t$lang = TEMPLATEPATH . '/lang';\n\t\tload_theme_textdomain('nw-clean', $lang);\n\t\t/* \n\t\t * Adding support for post thumbnails\n\t\t */\n\t\tadd_theme_support( 'post-thumbnails' );\n\t\t/* \n\t\t * disabling adming bar\n\t\t */\n\t\tshow_admin_bar(false);\n\t}", "function require_wp_db()\n {\n }", "function setup() {\n\t$n = function( $function ) {\n\t\treturn __NAMESPACE__ . \"\\\\$function\";\n\t};\n\n\tadd_action( 'after_setup_theme', $n( 'i18n' ) \t\t\t);\n\tadd_action( 'wp_enqueue_scripts', $n( 'scripts' ) \t\t\t);\n\tadd_action( 'wp_enqueue_scripts', $n( 'styles' ) \t\t\t);\n\tadd_action( 'wp_head', $n( 'header_meta' ) \t\t\t);\n\tadd_action( 'after_setup_theme', $n( 'rss_feed_links' )\t\t);\n\tadd_action( 'after_setup_theme', $n( 'title_tag_support' )\t\t);\n\tadd_action( 'after_setup_theme', $n( 'post_thumbnail_support' ));\n\tadd_action( 'after_setup_theme', $n( 'image_sizes' ) );\n\tadd_action( 'after_setup_theme', $n( 'nav_menu_register' )\t\t);\n\tadd_action( 'after_setup_theme', $n( 'html5_elements' )\t\t);\n\tadd_action( 'wp_head', $n( 'add_custom_fonts' ) );\n\n\tremove_action( 'wp_head', 'print_emoji_detection_script', 7 );\n\tremove_action( 'admin_print_scripts', 'print_emoji_detection_script' );\n\tremove_action( 'wp_print_styles', 'print_emoji_styles' );\n\tremove_action( 'admin_print_styles', 'print_emoji_styles' );\n\tremove_action('wp_head', 'rsd_link' );\n\tremove_action('wp_head', 'wp_generator' );\n\tremove_action('wp_head', 'feed_links', 2 );\n\tremove_action('wp_head', 'index_rel_link' );\n\tremove_action('wp_head', 'wlwmanifest_link' );\n\tremove_action('wp_head', 'feed_links_extra', 3 );\n\tremove_action('wp_head', 'start_post_rel_link', 10, 0 );\n\tremove_action('wp_head', 'parent_post_rel_link', 10, 0 );\n\tremove_action('wp_head', 'adjacent_posts_rel_link', 10, 0 );\n}", "public function setup() {\n\t\tadd_action( 'plugins_loaded', array( $this, 'manually_load_api' ), 100 );\n\t\tadd_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );\n\t\tadd_filter( 'plugin_row_meta', array( $this, 'filter_plugin_row_meta' ), 10, 4 );\n\t\tadd_action( 'admin_notices', array( $this, 'permalink_warning' ) );\n\t\tadd_action( 'admin_init', array( $this, 'flush_rewrites' ), 10000 );\n\t}", "function add_wp_hooks(){\n\n\t\t$comments = new WordpressConnectComments();\n\t\t$like = new WordpressConnectLikeButton();\n\n\t}", "function webbusiness_setup() {\n\n\t\t/**\n\t\t * Make theme available for translation\n\t\t */\n\t\tload_theme_textdomain('webbusiness', get_template_directory() . '/languages');\n\n\t\t/**\n\t\t * Add default posts and comments RSS feed links to head\n\t\t */\n\t\tadd_theme_support('automatic-feed-links');\n\n\t\t/**\n\t\t * This theme uses wp_nav_menu() in one location.\n\t\t */\n\t\tregister_nav_menus(array(\n\t\t\t'primary' => __('Primary Menu', 'webbusiness'),\n\t\t));\n\n\t\t/**\n\t\t * Enable support for Post Formats\n\t\t */\n\t\tadd_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link'));\n\t\t\n\t\t/**\n\t\t * Add full width\n\t\t */\n\t\tadd_theme_support('post-thumbnails'); \n\t\tadd_image_size('full-width', 940, 9999, FALSE);\n\t}", "function wowaries_setup() {\n /* WowAriesProject generated Load Text Domain Begin */\n load_theme_textdomain( 'wowaries', get_template_directory() . '/languages' );\n /* WowAriesProject generated Load Text Domain End */\n\n // Add default posts and comments RSS feed links to head.\n add_theme_support( 'automatic-feed-links' );\n\n /*\n * Let WordPress manage the document title.\n */\n add_theme_support( 'title-tag' );\n\n /*\n * Enable support for Post Thumbnails on posts and pages.\n */\n add_theme_support( 'post-thumbnails' );\n set_post_thumbnail_size( 825, 510, true );\n\n // Add menus.\n register_nav_menus( array(\n 'primary' => __( 'Primary Menu', 'wowaries' ),\n 'social' => __( 'Social Links Menu', 'wowaries' ),\n ) );\n\n /*\n * Switch default core markup for search form, comment form, and comments\n * to output valid HTML5.\n */\n add_theme_support( 'html5', array(\n 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'\n ) );\n\n}", "public function wp_init() {\n\t\n\t\t// (re)load our settings\n\t\t$this->load_settings();\n\n\t\tload_plugin_textdomain('wp-united', false, 'wp-united/languages/');\n\t\t\n\t\trequire_once($this->get_plugin_path() . 'template-tags.php');\n\t\t\n\t\t// some login integration routines may be needed even when user integration is disabled.\t\n\t\trequire_once($this->get_plugin_path() . 'user-integrator.php'); \n\t\t\n\t\tif($this->get_setting('xposting')) {\t\t\n\t\t\trequire_once($this->get_plugin_path() . 'cross-posting.php');\n\t\t\t$this->xPoster = new WPU_Plugin_XPosting($this->settings);\n\t\t}\n\n\n\t\t// add new actions and filters\n\t\t$this->add_actions();\n\t\t$this->add_filters();\n\t\tunset($this->actions, $this->filters);\n\n\t}", "function WP_Http() {\n\t\t$this->__construct();\n\t}", "function wpt_loaded() {\n\t\tdo_action('wpt_loaded');\n\t}", "function wagw_setup() {\n\n\t\t/*\n\t\t * Make theme available for translation.\n\t\t * Translations can be filed in the /languages/ directory.\n\t\t * If you're building a theme based on What A Great Website, use a find and replace\n\t\t * to change 'wagw' to the name of your theme in all the template files\n\t\t */\n\t\tload_theme_textdomain( 'wagw', get_template_directory() . '/languages' );\n\n\t\t// Add default posts and comments RSS feed links to head.\n\t\t/* disable automatic feeds */\n\t\t// add_theme_support( 'automatic-feed-links' );\n\n\t\t/*\n\t\t * Enable support for Post Thumbnails on posts and pages.\n\t\t *\n\t\t * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails\n\t\t */\n\t\tadd_theme_support( 'post-thumbnails' );\n\n\t\t// This theme uses wp_nav_menu() in one location.\n\t\tregister_nav_menus( array(\n\t\t\t'primary' => __( 'Primary Menu', 'wagw' ),\n\t\t) );\n\n\t\t/*\n\t\t * Switch default core markup for search form, comment form, and comments\n\t\t * to output valid HTML5.\n\t\t */\n\t\tadd_theme_support( 'html5', array(\n\t\t\t'search-form',\n\t\t\t'comment-form',\n\t\t\t'comment-list',\n\t\t\t'gallery',\n\t\t\t'caption',\n\t\t) );\n\n\t\t/*\n\t\t * Enable support for Post Formats.\n\t\t * See http://codex.wordpress.org/Post_Formats\n\t\t */\n\t\tadd_theme_support( 'post-formats', array(\n\t\t\t'status',\n\t\t\t'aside',\n\t\t\t'image',\n\t\t\t'video',\n\t\t\t'quote',\n\t\t\t'link',\n\t\t) );\n\n\t\t// Setup the WordPress core custom background feature.\n\t\t/*--------------------------\n\t\t add_theme_support( 'custom-background', apply_filters( 'wagw_custom_background_args', array(\n\t\t'default-color' => 'ffffff',\n\t\t'default-image' => '',\n\t\t) ) );\n\t\t-----------------------------*/\n\t}", "function setup() {\n\t$n = function( $function ) {\n\t\treturn __NAMESPACE__ . \"\\\\$function\";\n\t};\n\n\tadd_action( 'after_setup_theme', $n( 'i18n' ) );\n\tadd_action( 'wp_enqueue_scripts', $n( 'scripts' ) );\n\tadd_action( 'wp_enqueue_scripts', $n( 'styles' ) );\n\tadd_action( 'wp_head', $n( 'header_meta' ) );\n\tadd_action( 'after_setup_theme', $n( 'additive_navmenus' ) );\n\tadd_action( 'widgets_init', $n( 'additive_widgets_init' ));\n add_action( 'init', $n( 'register_fablabs_post_type' ) );\n\n add_filter( 'post_gallery', \t\t\t$n('additive_gallery'), 10, 3);\n\t/*\n\t * Switch default core markup for search form, comment form, and comments\n\t * to output valid HTML5.\n\t */\n\tadd_theme_support( 'html5', array(\n\t\t'search-form',\n\t\t'gallery',\n\t\t'caption',\n\t) );\n\n\t/*\n\t * Enable support for Post Formats.\n\t *\n\t * See: https://codex.wordpress.org/Post_Formats\n\t */\n\tadd_theme_support( 'post-formats', array(\n\t\t'aside',\n\t\t'image',\n\t\t'video',\n\t\t'quote',\n\t\t'link',\n\t\t'gallery',\n\t\t'status',\n\t\t'audio',\n\t\t'chat',\n\t) );\n\n\tadd_theme_support('post-thumbnails', array('post', 'page', 'additive_fab_lab'));\n\n}", "function setup() {\n\tadd_action( 'die_setup_theme', __NAMESPACE__ . '\\\\i18n' );\n\tadd_action( 'die_setup_theme', __NAMESPACE__ . '\\\\theme_support' );\n\tadd_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\\\\scripts' );\n\tadd_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\\\\styles' );\n}", "function setup() {\n\t$n = function( $function ) {\n\t\treturn __NAMESPACE__ . \"\\\\$function\";\n\t};\n\n\tadd_action( 'after_setup_theme', $n( 'i18n' ) );\n\tadd_action( 'after_setup_theme', $n( 'theme_support' ) );\n\tadd_action( 'widgets_init', $n( 'register_theme_sidebar' ) );\n\tadd_action( 'init', $n( 'register_theme_menus' ) );\n\tadd_action( 'wp_enqueue_scripts', $n( 'scripts' ), 1000 );\n\tadd_action( 'wp_enqueue_scripts', $n( 'styles' ) );\n\tadd_action( 'wp_head', $n( 'header_meta' ) );\n\n\t// Skip duplicate parser hooks.\n\tadd_filter( 'wp_parser_skip_duplicate_hooks', '__return_true' );\n\n\t// Use custom more text.\n\tadd_filter( 'the_content_more_link', $n( 'more_link' ), 10, 2 );\n}", "function _s_setup() {\n\n\t/**\n\t * Custom template tags for this theme.\n\t */\n\trequire( get_template_directory() . '/inc/template-tags.php' );\n\n\t/**\n\t * Custom functions that act independently of the theme templates\n\t */\n\trequire( get_template_directory() . '/inc/extras.php' );\n\n\t/**\n\t * Custom Theme Options\n\t */\n\t//require( get_template_directory() . '/inc/theme-options/theme-options.php' );\n\n\t/**\n\t * WordPress.com-specific functions and definitions\n\t */\n\t//require( get_template_directory() . '/inc/wpcom.php' );\n\n\t/**\n\t * Make theme available for translation\n\t * Translations can be filed in the /languages/ directory\n\t * If you're building a theme based on _s, use a find and replace\n\t * to change '_s' to the name of your theme in all the template files\n\t */\n\tload_theme_textdomain( '_s', get_template_directory() . '/languages' );\n\n\t/**\n\t * Add default posts and comments RSS feed links to head\n\t */\n\tadd_theme_support( 'automatic-feed-links' );\n\n\t/**\n\t * Enable support for Post Thumbnails\n\t */\n\tadd_theme_support( 'post-thumbnails' );\n\n\t/**\n\t * This theme uses wp_nav_menu() in one location.\n\t */\n\tregister_nav_menus( array(\n\t\t'primary' => __( 'Primary Menu', '_s' ),\n\t) );\n\n\t/**\n\t * Add support for the Aside Post Formats\n\t */\n\tadd_theme_support( 'post-formats', array( 'aside', ) );\n}", "function WP_Careers() {\r\n\t\t$this->plugin_url = get_option('siteurl').'/wp-content/plugins/wpcareers';\r\n\t\t$this->plugin_dir = JP_PLUGIN_DIR . '/';\r\n\t\t$this->version = VERSION;\r\n\t\t$this->template_dir = $this->plugin_dir . '/themes/default';\r\n\t\t$this->cache_dir = $this->plugin_dir . '/cache';\r\n\t\t$this->compile_dir = $this->plugin_dir . '/templates_c';\r\n\t\t$this->config_dir = $this->plugin_dir . '/include/Smarty/configs';\r\n\t\t$this->affiliate_id = get_option('wpca_affiliate_id');\r\n\t\t$this->userId = get_option('wpca_userId'); // TODO\r\n\t\t$this->password = get_option('wpca_password'); // TODO\r\n\t\t$this->public_dir = ABSPATH . 'wp-content/public/wpcareers/';\r\n\t\t$this->public_url = get_option('siteurl') . '/wp-content/public/wpcareers/';\r\n $this->cache_url = get_option('siteurl') . '/wp-content/plugins/wpcareers/cache/';\r\n\t\t\r\n\t\t/**\r\n\t\t* config_page() - Add WordPress action to show the admin configuration page\r\n\t\t*/\r\n\t\t$this->admin_pages = array(\r\n\t\t\tarray('name'=>'wpcareers_structure','arg'=>'wpcareers_structure','prg'=>'process_structure'),\r\n\t\t\tarray('name'=>'wpcareers_posts','arg'=>'wpcareers_posts','prg'=>'process_posts'),\r\n\t\t\tarray('name'=>'wpcareers_utilities','arg'=>'wpcareers_utilities','prg'=>'process_utilities'),\r\n\t\t);\r\n\r\n\t\t/**\r\n\t\t* admin_page() - Show the admin page\r\n\t\t*/\r\n\t\t$this->admin_menu = array(\r\n\t\t\tarray('name'=>'List Categories','arg'=>'wpcareers_structure'),\r\n\t\t\tarray('name'=>'List Posts','arg'=>'wpcareers_posts'),\r\n\t\t\tarray('name'=>'Utilities','arg'=>'wpcareers_utilities')\r\n\t\t);\r\n\r\n\t\t//add_action('widgets_init', array(&$this, 'widget_init'));\r\n\t\tadd_action('init', array(&$this, 'login_register_init'));\r\n\t\tadd_action('admin_menu', array(&$this, 'add_admin_pages'));\r\n\t\tadd_action('admin_head', array(&$this, 'add_admin_head'));\r\n\t\tadd_action('wp_head', array(&$this, 'add_head'));\r\n\t\tadd_action('admin_head', array(&$this, 'hide_dashboard'));\r\n\t}", "function includes() {\n\t\trequire_once(dirname(__FILE__) . '/functions/helpers/class-theater-helpers-time.php');\n\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_listing.php');\n\t\trequire_once(dirname(__FILE__) . '/functions/event/class-theater-event-archive.php');\n\t\trequire_once(dirname(__FILE__) . '/functions/event/class-theater-event-order.php');\n\n\t\trequire_once(dirname(__FILE__) . '/functions/template/wpt_template.php');\t\n\t\trequire_once(dirname(__FILE__) . '/functions/template/wpt_template_placeholder.php');\t\n\t\trequire_once(dirname(__FILE__) . '/functions/template/wpt_template_placeholder_filter.php');\t\n\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_production.php');\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_production_permalink.php');\t\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_production_template.php');\t\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_production_widget.php');\n\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_productions.php');\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_productions_admin.php');\t\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_productions_list_table.php');\t\n\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_event.php');\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_event_admin.php');\t\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_event_editor.php');\t\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_event_template.php');\t\n\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_events.php');\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_events_widget.php');\n\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_setup.php');\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_season.php');\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_widget.php');\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_admin.php');\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_status.php');\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_feeds.php');\t\n\t\t\n\t\trequire_once(dirname(__FILE__) . '/functions/transient/class-theater-transient.php');\t\n\t\trequire_once(dirname(__FILE__) . '/functions/transient/class-theater-transients.php');\t\n\t\t\t\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_listing_page.php');\t\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_calendar.php');\t\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_context.php');\t\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_filter.php');\t\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_cart.php');\t\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_tags.php');\t\n\n\t\trequire_once(dirname(__FILE__) . '/functions/extensions/wpt_extensions_updater.php');\t\n\t\trequire_once(dirname(__FILE__) . '/functions/extensions/wpt_extensions_promo.php');\t\n\n\t\trequire_once(dirname(__FILE__) . '/functions/wpt_importer.php');\t\n\n\n\t\tif (is_admin()) {\n\t\t} else {\n\t\t\trequire_once(dirname(__FILE__) . '/functions/wpt_frontend.php');\n\t\t}\n\t\trequire_once(dirname(__FILE__) . '/integrations/wordpress-seo.php');\n\t\trequire_once(dirname(__FILE__) . '/integrations/jetpack-featured-content.php');\n\t\t\n\t\trequire_once(dirname(__FILE__) . '/functions/deprecated/class-wpt-order.php');\n\t\trequire_once(dirname(__FILE__) . '/functions/deprecated/class-theater-custom-css.php');\n\t\t\n\t}", "function init_setup() {\n require get_template_directory() . '/includes/navwalker.php';\n require get_template_directory() . '/includes/widget.php';\n require get_template_directory() . '/includes/options.php';\n require get_template_directory() . '/includes/plugin.php';\n add_filter('show_admin_bar', '__return_false');\n /**\n * Make theme available for translation.\n * Translations can be placed in the /languages/ directory.\n */\n load_theme_textdomain( 'initializr', get_template_directory() . '/languages' );\n \n /**\n * Add default posts and comments RSS feed links to <head>.\n */\n add_theme_support( 'automatic-feed-links' );\n \n /**\n * Enable support for post thumbnails and featured images.\n */\n add_theme_support( 'post-thumbnails' );\n \n /**\n * Add support for two custom navigation menus.\n */\n register_nav_menus( array(\n 'primary' => __( 'Primary Menu', 'initializr' ),\n 'secondary' => __('Secondary Menu', 'initializr' )\n ) );\n \n /**\n * Enable support for the following post formats:\n * aside, gallery, quote, image, and video\n */\n add_theme_support( 'post-formats', array ( 'aside', 'gallery', 'quote', 'image', 'video' ) );\n }", "static function init(){\n\t\t\t\tadd_action('wp_ajax_gdlr_core_get_pb_template', 'gdlr_core_page_builder_template::get_template');\n\t\t\t}", "public function includes()\n {\n add_action('plugins_loaded', array($this, 'load_php_files'), 10);\n add_action('init', array(__CLASS__, 'prefix_add_api_endpoints'));\n add_action('template_redirect', array($this, 'prefix_do_api'));\n add_filter('posts_request', array($this, 'disable_main_query_wordpress'), 10, 2);\n add_action('wp_enqueue_scripts', array($this, 'register_js_script'), 5);\n }", "public function includes()\n {\n // Incluir functions.php\n include_once( WI_ABSPATH . 'functions.php' );\n }", "public static function _setup(){\n\t\t$pathinfo = pathinfo(__FILE__);\n\t\t\n\t\tself::$is_mu = is_multisite();\n\t\tself::$possible = self::getUrls( TRUE );\n\t\t\n\t\tself::$baseurl = is_ssl() ? 'https://'.$_SERVER['HTTP_HOST'] : 'http://'.$_SERVER['HTTP_HOST'];\n\t\tself::$cwd = $pathinfo['dirname'];\n\t\t\n\t\t// sorry if this is confusing, some servers (media temple) have strangeness using $_SERVER['DOCUMENT_ROOT']\n\t\t// @TODO make sure second line works on MT\n\t\t//self::$path = self::_site_url_absolute(WP_PLUGIN_URL).'/'.basename( $pathinfo['dirname'] ).'/';\n\t\tself::$path = self::_site_url_absolute( str_replace(ABSPATH, '/', dirname(__FILE__)) ).'/';\n\t\t\n\t\t// these can return back urls starting with /\n\t\tadd_filter( 'bloginfo', 'AitchRef::_site_url' );\n\t\tadd_filter( 'bloginfo_url', 'AitchRef::_site_url' );\n\t\tadd_filter( 'content_url', 'AitchRef::_site_url' );\n\t\tadd_filter( 'get_pagenum_link', 'AitchRef::_site_url' );\n\t\tadd_filter( 'option_url', 'AitchRef::_site_url' );\n\t\tadd_filter( 'plugins_url', 'AitchRef::_site_url' );\n\t\tadd_filter( 'pre_post_link', 'AitchRef::_site_url' );\n\t\tadd_filter( 'script_loader_src', 'AitchRef::_site_url' );\n\t\tadd_filter( 'style_loader_src', 'AitchRef::_site_url' );\n\t\tadd_filter( 'term_link', 'AitchRef::_site_url' );\n\t\tadd_filter( 'the_content', 'AitchRef::_site_url' );\n\t\tadd_filter( 'upload_dir', 'AitchRef::_site_url' );\n\t\tadd_filter( 'url', 'AitchRef::_site_url' );\n\t\tadd_filter( 'wp_list_pages', 'AitchRef::_site_url' );\n\t\t\n\t\t// these need to return back with leading http://\n\t\tadd_filter( 'admin_url', 'AitchRef::_site_url_absolute' );\n\t\tadd_filter( 'get_permalink', 'AitchRef::_site_url_absolute' ); \n\t\tadd_filter( 'home_url', 'AitchRef::_site_url_absolute' );\n\t\tadd_filter( 'login_url', 'AitchRef::_site_url_absolute' );\n\t\tadd_filter( 'option_home', 'AitchRef::_site_url_absolute' );\n\t\tadd_filter( 'option_siteurl', 'AitchRef::_site_url_absolute' );\n\t\tadd_filter( 'page_link', 'AitchRef::_site_url_absolute' ); \n\t\tadd_filter( 'post_link', 'AitchRef::_site_url_absolute' );\n\t\tadd_filter( 'siteurl', 'AitchRef::_site_url_absolute' );\t// ಠ_ಠ DEPRECATED\n\t\tadd_filter( 'site_url', 'AitchRef::_site_url_absolute' );\n\t\tadd_filter( 'stylesheet_uri', 'AitchRef::_site_url_absolute' );\n\t\tadd_filter( 'template_directory_uri', 'AitchRef::_site_url_absolute' );\t\n\t\tadd_filter( 'wp_get_attachment_url', 'AitchRef::_site_url_absolute' );\n\t\t\n\t\t// admin\n\t\tif( !is_admin() )\n\t\t\treturn;\n\t\t\t\n\t\tadd_action( 'admin_menu', 'AitchRef::_admin_menu' );\n\t\tadd_filter( 'plugin_action_links_'.plugin_basename(__FILE__), 'AitchRef::_admin_plugins' );\n\t}", "public function doAPI() {\r\n\t\t\t/** @var ICWP_APP_FeatureHandler_Plugin $oFO */\r\n\t\t\t$oFO = $this->getFeatureOptions();\r\n\r\n\t\t\tif ( $oFO->fetchIcwpRequestParam( 'worpit_link', 0 ) == 1 ) {\r\n\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\r\n\t\t\t\trequire_once( dirname(__FILE__).ICWP_DS.'plugin_sitelink.php' );\r\n\t\t\t\t$oLinkProcessor = new ICWP_APP_Processor_Plugin_SiteLink( $this->getFeatureOptions() );\r\n\t\t\t\t$oLinkResponse = $oLinkProcessor->run();\r\n\t\t\t\t$this->sendApiResponse( $oLinkResponse );\r\n\t\t\t\tdie();\r\n\t\t\t}\r\n\t\t\telse if ( $oFO->fetchIcwpRequestParam( 'worpit_api', 0 ) == 1 ) {\r\n\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\r\n\t\t\t\trequire_once( dirname(__FILE__).ICWP_DS.'plugin_api.php' );\r\n\t\t\t\t$oApiProcessor = new ICWP_APP_Processor_Plugin_Api( $this->getFeatureOptions() );\r\n\t\t\t\t$oApiResponse = $oApiProcessor->run();\r\n\t\t\t\t$this->sendApiResponse( $oApiResponse );\r\n\t\t\t\tdie();\r\n\t\t\t}\r\n\t\t}", "function setup() : void {\n\t/**\n\t * Make theme available for translation.\n\t * Translations can be filed in the /languages/ directory.\n\t * If you're building a theme based on ALiEMU, use a find and replace\n\t * to change 'aliemu' to the name of your theme in all the template files.\n\t */\n\tload_theme_textdomain( 'aliemu', get_template_directory() . '/languages' );\n\n\t/**\n\t * Let WordPress manage the document title.\n\t * By adding theme support, we declare that this theme does not use a\n\t * hard-coded <title> tag in the document head, and expect WordPress to\n\t * provide it for us.\n\t */\n\tadd_theme_support( 'title-tag' );\n\n\t/**\n\t * Enable support for Post Thumbnails on posts and pages.\n\t *\n\t * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/\n\t */\n\tadd_theme_support( 'post-thumbnails' );\n\n\t/**\n\t * Switch default core markup for search form, comment form, and comments\n\t * to output valid HTML5.\n\t */\n\tadd_theme_support(\n\t\t'html5',\n\t\t[\n\t\t\t'search-form',\n\t\t\t'comment-form',\n\t\t\t'comment-list',\n\t\t\t'gallery',\n\t\t\t'caption',\n\t\t]\n\t);\n\n\t// Add theme support for selective refresh for widgets.\n\tadd_theme_support( 'customize-selective-refresh-widgets' );\n\n\t// This theme uses wp_nav_menu() in one location.\n\tregister_nav_menus(\n\t\t[\n\t\t\t'menu-primary' => esc_html__( 'Primary Navigation', 'aliemu' ),\n\t\t\t'menu-footer' => esc_html__( 'Footer Links', 'aliemu' ),\n\t\t]\n\t);\n}", "function setup() {\n\t$n = function( $function ) {\n\t\treturn __NAMESPACE__ . \"\\\\$function\";\n\t};\n\n\tadd_action( 'after_setup_theme', $n( 'i18n' ) );\n\tadd_action( 'after_setup_theme', $n( 'theme_setup' ) );\n\tadd_action( 'wp_enqueue_scripts', $n( 'scripts' ) );\n\tadd_action( 'wp_enqueue_scripts', $n( 'styles' ) );\n\tadd_action( 'wp_head', $n( 'js_detection' ), 0 );\n\tadd_action( 'wp_head', $n( 'add_manifest' ), 10 );\n\n\tadd_filter( 'script_loader_tag', $n( 'script_loader_tag' ), 10, 2 );\n}", "protected function get_wp_environment()\n {\n }", "function fwp_haveurl() {\n\trequire_once 'class.fwp-haveurl.php';\n\t$fwp_custom = FWP_HaveURL::get_instance();\n\t$fwp_custom->hook();\n}", "function microsite_setup() {\n add_theme_support( 'title-tag' );\n\n //agregando la imagen destacada para un post\n add_theme_support('post-thumbnails');\n\n //soporte para personalizar el logotipo del sitio\n add_theme_support( 'custom-logo' );\n\n //soporte para imagen de fondo del tema\n add_theme_support( 'custom-background' );\n\n //soporte para imagen del heroe/header\n add_theme_support( 'custom-header' );\n }", "public function installWordpressData() {\n }", "private function __construct() {\n global $wp_version;\n\n // Load plugin text domain\n add_action('init', array($this, 'load_plugin_textdomain'));\n\n // Load public-facing style sheet and JavaScript.\n add_action('wp_enqueue_scripts', array($this, 'enqueue_styles_and_scripts'));\n\n // Add support for h5p shortcodes.\n add_shortcode('h5p', array($this, 'shortcode'));\n\n // Adds JavaScript settings to the bottom of the page.\n add_action('wp_footer', array($this, 'add_settings'));\n\n // Clean up tmp editor files\n add_action('h5p_daily_cleanup', array($this, 'remove_old_tmp_files'));\n\n // Check for library updates\n add_action('h5p_daily_cleanup', array($this, 'get_library_updates'));\n\n // Remove old log messages\n add_action('h5p_daily_cleanup', array($this, 'remove_old_log_events'));\n\n // Always check if the plugin has been updated to a newer version\n add_action('init', array('H5P_Plugin', 'check_for_updates'), 1);\n\n // Add menu options to admin bar.\n add_action('admin_bar_menu', array($this, 'admin_bar'), 999);\n\n // REST API\n add_action('rest_api_init', array($this, 'rest_api_init'));\n\n // Removes all H5P data for this blog\n if (version_compare($wp_version, '5.1', '>=')) {\n add_action('wp_delete_site', array($this, 'delete_site'));\n }\n else {\n // Deprecated since 5.1\n add_action('delete_blog', array($this, 'delete_blog'));\n }\n }", "function vc_before_init_actions() {\n \t require_once( get_template_directory().'/vc-elements/my-first-custom-element.php' );\n require_once( get_template_directory().'/vc-elements/progressbar0.php' );\n\t require_once( get_template_directory().'/vc-elements/card-counter-card.php' );\t \n\t require_once( get_template_directory().'/vc-elements/Services.php' );\t\n require_once( get_template_directory().'/vc-elements/Carousel-Side-Caption.php' );\n\t require_once( get_template_directory().'/vc-elements/InteractiveSVG.php' );\n\t require_once( get_template_directory().'/vc-elements/piechart.php' );\n\t require_once( get_template_directory().'/vc-elements/OurServices.php' );\n\t require_once( get_template_directory().'/vc-elements/Timeline66.php' );\n\t require_once( get_template_directory().'/vc-elements/ServiceBox76.php' );\n\t require_once( get_template_directory().'/vc-elements/project.php' );\n\t require_once( get_template_directory().'/vc-elements/project1.php' );\n\t }", "function shell_theme_setup() {\r\n\r\n\t/* Get action/filter hook prefix. */\r\n\t$prefix = hybrid_get_prefix();\r\n\r\n\t/* === HYBRID CORE FEATURES === */\r\n\r\n\t/* Register Navigation Menus */\r\n\tadd_theme_support( 'hybrid-core-menus', array( 'primary', 'secondary', 'subsidiary' ) );\r\n\r\n\t/* Register Sidebars */\r\n\tadd_theme_support( 'hybrid-core-sidebars', array( 'primary', 'secondary', 'header', 'subsidiary', 'after-singular' ) );\r\n\r\n\t/* Widgets Reloaded */\r\n\tadd_theme_support( 'hybrid-core-widgets' );\r\n\r\n\t/* Template Shortcodes */\r\n\tadd_theme_support( 'hybrid-core-shortcodes' );\r\n\r\n\t/* Theme Settings */\r\n\tadd_theme_support( 'hybrid-core-theme-settings', array( 'about', 'footer' ) );\r\n\r\n\t/* Better Template Hierarchy */\r\n\tadd_theme_support( 'hybrid-core-template-hierarchy' );\r\n\r\n\r\n\t/* === HYBRID CORE EXTENSIONS === */\r\n\r\n\t/* Loop Pagination */\r\n\tadd_theme_support( 'loop-pagination' );\r\n\r\n\t/* Get The Image */\r\n\tadd_theme_support( 'get-the-image' );\r\n\r\n\t/* Breadcrumb Trail */\r\n\tadd_theme_support( 'breadcrumb-trail' );\r\n\r\n\t/* Cleaner Gallery */\r\n\tadd_theme_support( 'cleaner-gallery' );\r\n\r\n\r\n\t/* === WORDPRESS FEATURES === */\r\n\r\n\t/* RSS Feed */\r\n\tadd_theme_support( 'automatic-feed-links' );\r\n\r\n\r\n\t/* === DEFAULT FILTERS === */\r\n\r\n\t/* Avatar size in comments: Hybrid Core - Comments Args */\r\n\tadd_filter( \"shell_list_comments_args\", 'shell_comments_args' );\r\n\r\n\r\n\t/* === THEME UPDATER === */\r\n\r\n\t/* Updater args */\r\n\t$updater_args = array(\r\n\t\t'repo_uri' => 'http://repo.shellcreeper.com/',\r\n\t\t'repo_slug' => 'shell',\r\n\t);\r\n\r\n\t/* Add support for updater */\r\n\tadd_theme_support( 'auto-hosted-theme-updater', $updater_args );\r\n}", "private function load_whip() {\n\t\tif ( 'index.php' !== $GLOBALS['pagenow'] && current_user_can( 'manage_options' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\trequire_once TOOLSET_COMMON_PATH . '/lib/whip/src/facades/wordpress.php';\n\n\t\tadd_filter( 'whip_hosting_page_url_wordpress', '__return_true' );\n\t\twhip_wp_check_versions( array( 'php' => '>=5.3' ) );\n\t}", "function humcore_activate() {\n\n\thumcore_check_dependencies();\n\n\thumcore_register_post_type();\n\thumcore_add_rewrite_rule();\n\tglobal $wp_rewrite;\n\tflush_rewrite_rules();\n}", "function zzyy_setup() {\n\t//load_theme_textdomain( 'twentytwelve', get_template_directory() . '/languages' );\n\n\t// This theme styles the visual editor with editor-style.css to match the theme style.\n\tadd_editor_style();\n\n\t// Adds RSS feed links to <head> for posts and comments.\n\tadd_theme_support( 'automatic-feed-links' );\n\n\t// This theme supports a variety of post formats.\n\t//add_theme_support( 'post-formats', array( 'aside', 'image', 'link', 'quote', 'status' ) );\n\n\t// This theme uses wp_nav_menu() in one location.\n\tregister_nav_menu( 'primary', __( 'Primary Menu', 'zzyy' ) );\n\n\t/*\n\t * This theme supports custom background color and image, and here\n\t * we also set up the default background color.\n\t */\n\t/*\nadd_theme_support( 'custom-background', array(\n\t\t'default-color' => 'e6e6e6',\n\t) );\n*/\n\n\t// This theme uses a custom image size for featured images, displayed on \"standard\" posts.\n\tadd_theme_support( 'post-thumbnails' );\n\tset_post_thumbnail_size( 624, 9999 ); // Unlimited height, soft crop\n}", "function wp_scripts()\n {\n }", "function jet_cw_functions() {\n\treturn Jet_CW_Functions::get_instance();\n}", "public function core() {\n\t\t\tinclude_once $this->includes_path() . 'functions-cyprus-utility.php';\n\t\t\tinclude_once $this->includes_path() . 'class-cyprus-settings.php';\n\t\t\tinclude_once $this->includes_path() . 'class-cyprus-sanitize.php';\n\t\t\tinclude_once $this->includes_path() . 'class-cyprus-dynamic-css.php';\n\t\t}", "function TS_VCSC_Extensions_Front_Main() {\r\n\t\t\tglobal $post;\r\n\t\t\tglobal $wp_query;\r\n\t\t\t$url \t\t\t\t\t\t\t\t\t= plugin_dir_url( __FILE__ );\r\n\t\t\t$this->TS_VCSC_FilesRegistrations();\r\n\t\t\t// Check For Standard Frontend Page\r\n\t\t\tif (!is_404() && !is_search() && !is_archive()) {\r\n\t\t\t\t$TS_VCSC_StandardFrontendPage\t\t= \"true\";\r\n\t\t\t} else {\r\n\t\t\t\t$TS_VCSC_StandardFrontendPage\t\t= \"false\";\r\n\t\t\t}\r\n\t\t\t// Load Scripts As Needed\r\n\t\t\tif (!empty($post)){\r\n\t\t\t\t// Check for Standard Shortcodes\r\n\t\t\t\tif ((stripos($post->post_content, '[TS-VCSC-') !== FALSE) || (stripos($post->post_content, '[TS_VCSC_') !== FALSE)) {\r\n\t\t\t\t\t$TS_VCSC_StandardShorcodes\t\t= \"true\";\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$TS_VCSC_StandardShorcodes\t\t= \"false\";\r\n\t\t\t\t}\r\n\t\t\t\t// Check for EnlighterJS Shortcodes\r\n\t\t\t\tif (stripos($post->post_content, '[TS_EnlighterJS_') !== FALSE) {\r\n\t\t\t\t\t$TS_VCSC_EnlighterShorcodes\t\t= \"true\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$TS_VCSC_EnlighterShorcodes\t\t= \"false\";\r\n\t\t\t\t}\r\n\t\t\t\t// Define Ajax Path Variable\r\n\t\t\t\t/*if (stripos($post->post_content, '[TS_VCSC_Timeline_CSS_Container') !== FALSE) {\r\n\t\t\t\t\twp_enqueue_style('ts-visual-composer-extend-ajax', \t\t$url . '/css/ts-visual-composer-extend-ajax.css', null, false, 'all');\r\n\t\t\t\t\twp_enqueue_script('ts-visual-composer-extend-ajax', \t$url . '/js/ts-visual-composer-extend-ajax.js', array('jquery'), false, true);\r\n\t\t\t\t\twp_localize_script('ts-visual-composer-extend-ajax', \t'$TS_VCSC_AjaxData', array(\r\n\t\t\t\t\t\t'ajaxurl' \t\t=> admin_url('admin-ajax.php'),\r\n\t\t\t\t\t\t'queryvars' \t=> json_encode($wp_query->query)\r\n\t\t\t\t\t));\r\n\t\t\t\t}*/\r\n\t\t\t\tif ((($this->TS_VCSC_LoadFrontEndLightbox == \"true\") || ($this->TS_VCSC_UseLightboxPrettyPhoto == \"true\") || ($this->TS_VCSC_UseLightboxAutoMedia == \"true\")) && ($TS_VCSC_StandardFrontendPage == \"true\") && ($this->TS_VCSC_UseInternalLightbox == \"true\") && ($this->TS_VCSC_VCFrontEditMode == \"false\")) {\r\n\t\t\t\t\tif ((((array_key_exists('customscroll', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['customscroll'] : $this->TS_VCSC_Lightbox_Setting_Defaults['customscroll']) == 1 ? 'true' : 'false') == \"true\") {\r\n wp_enqueue_script('ts-extend-perfectscrollbar');\r\n wp_enqueue_style('ts-extend-perfectscrollbar');\r\n }\r\n wp_enqueue_script('ts-extend-krautlightbox');\r\n\t\t\t\t\twp_enqueue_style('ts-extend-krautlightbox');\r\n\t\t\t\t}\r\n\t\t\t\tif (($this->TS_VCSC_LoadFrontEndTooltips == \"true\") && ($TS_VCSC_StandardFrontendPage == \"true\") && ($this->TS_VCSC_VCFrontEditMode == \"false\")) {\r\n\t\t\t\t\twp_enqueue_style('ts-extend-tooltipster');\r\n\t\t\t\t\twp_enqueue_script('ts-extend-tooltipster');\t\r\n\t\t\t\t}\r\n\t\t\t\tif (get_option('ts_vcsc_extend_settings_loadFonts', 0) == 1) {\r\n\t\t\t\t\t// Add CSS for each enabled Font to WordPress Frontend\r\n\t\t\t\t\t$this->TS_VCSC_IconFontsEnqueue(true);\r\n\t\t\t\t}\r\n\t\t\t\t/* Force Load of Core Files */\t\t\t\t\r\n\t\t\t\tif (($this->TS_VCSC_LoadFrontEndForcable == \"true\") && ($TS_VCSC_StandardFrontendPage == \"true\")) {\t\t\t\t\t\r\n\t\t\t\t\t// Load jQuery (if not already loaded)\r\n\t\t\t\t\tif (($this->TS_VCSC_LoadFrontEndJQuery == \"true\") && (!wp_script_is('jquery'))) {\r\n\t\t\t\t\t\twp_enqueue_script('jquery');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($this->TS_VCSC_VCFrontEditMode == \"false\") {\r\n\t\t\t\t\t\t// Load Waypoints\r\n\t\t\t\t\t\tif ($this->TS_VCSC_LoadFrontEndWaypoints == \"true\") {\r\n\t\t\t\t\t\t\tif (wp_script_is('waypoints', $list = 'registered')) {\r\n\t\t\t\t\t\t\t\twp_enqueue_script('waypoints');\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\twp_enqueue_script('ts-extend-waypoints');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Add CSS for each enabled Icon Font to Page\r\n\t\t\t\t\t$this->TS_VCSC_IconFontsEnqueue(false);\r\n\t\t\t\t\t// Load Other Required Files\r\n\t\t\t\t\tif ($this->TS_VCSC_VCFrontEditMode == \"false\") {\r\n\t\t\t\t\t\twp_enqueue_style('ts-extend-animations');\r\n\t\t\t\t\t\twp_enqueue_style('ts-extend-tooltipster');\r\n\t\t\t\t\t\twp_enqueue_script('ts-extend-tooltipster');\t\r\n\t\t\t\t\t\twp_enqueue_style('ts-visual-composer-extend-front');\r\n\t\t\t\t\t\twp_enqueue_script('ts-visual-composer-extend-forms');\r\n\t\t\t\t\t\twp_enqueue_script('ts-visual-composer-extend-galleries');\r\n\t\t\t\t\t\twp_enqueue_script('ts-visual-composer-extend-backgrounds');\r\n\t\t\t\t\t\twp_enqueue_script('ts-visual-composer-extend-front');\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t/* Files if Shortcode Detected or Widgets Activated */\r\n\t\t\t\tif ((($TS_VCSC_StandardShorcodes == \"true\" || $TS_VCSC_EnlighterShorcodes == \"true\") && ($TS_VCSC_StandardFrontendPage == \"true\")) || (($this->TS_VCSC_CustomPostTypesWidgets == \"true\") && ($TS_VCSC_StandardFrontendPage == \"true\"))) { \r\n\t\t\t\t\t// Load jQuery (if not already loaded)\r\n\t\t\t\t\tif (($this->TS_VCSC_LoadFrontEndJQuery == \"true\") && (!wp_script_is('jquery'))) {\r\n\t\t\t\t\t\twp_enqueue_script('jquery');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Load MooTools (for EnlighterJS)\r\n\t\t\t\t\tif (($this->TS_VCSC_LoadFrontEndMooTools == \"true\") && ($TS_VCSC_EnlighterShorcodes == \"true\")) {\r\n\t\t\t\t\t\twp_enqueue_script('ts-library-mootools');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Load Google Charts API\r\n\t\t\t\t\tif ((TS_VCSC_CheckShortcode('TS-VCSC-Google-Charts') == \"true\") || (TS_VCSC_CheckShortcode('TS-VCSC-Google-Tables') == \"true\")) {\r\n\t\t\t\t\t\twp_enqueue_script('ts-extend-google-charts');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Add CSS for each enabled Icon Font to Page\r\n\t\t\t\t\t$this->TS_VCSC_IconFontsEnqueue(false);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Add CSS for Each Enabled Font (Force Load)\r\n\t\t\t\t\t$this->TS_VCSC_IconFontsEnqueue(true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "function leafbase_setup() {\n\n\t\tload_theme_textdomain( 'telecom-talk', get_template_directory() . '/languages' );\n\n\n\n\t\t// Add default posts and comments RSS feed links to head.\n\n\t\tadd_theme_support( 'automatic-feed-links' );\n\n\n\n\t\t/*\n\n\t\t * Let WordPress manage the document title.\n\n\t\t * By adding theme support, we declare that this theme does not use a\n\n\t\t * hard-coded <title> tag in the document head, and expect WordPress to\n\n\t\t * provide it for us.\n\n\t\t */\n\n\n\t\tadd_theme_support( 'title-tag' );\n\n\t\t/*\n\n\t\t * Enable support for Post Thumbnails on posts and pages.\n\n\t\t *\n\n\t\t * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/\n\n\t\t */\n\n\t\tadd_theme_support( 'post-thumbnails' );\n\n\t\t\t// add_image_size( 'module-1', 740, 366, true );\n\n\t\t\t// add_image_size( 'module-2', 262, 150, true );\n\n\t\t\t// add_image_size( 'module-3', 120, 90, true );\n\n\t\t\t// add_image_size( 'module-4', 340, 200, true );\n\n\t\t\t// add_image_size( 'module-5', 230, 135, true );\n\n\n\n\t\t// This theme uses wp_nav_menu() in one location.\n\n\t\tregister_nav_menus( array(\n\n\n\t\t\t'primary_nav' => esc_html__( 'Primary', 'leaf-base' ),\n\n\t\t\t'footer-menu' => esc_html__( 'Footer', 'leaf-base' ),\n\n\t\t\t'mobile-menu' \t=> esc_html__( 'Mobile Menu', 'leaf-base' ),\n\n\t\t) );\n\n\n\n\t\t/*\n\n\t\t * Switch default core markup for search form, comment form, and comments\n\n\t\t * to output valid HTML5.\n\n\t\t */\n\n\t\tadd_theme_support( 'html5', array(\n\n\t\t\t'search-form',\n\n\t\t\t'comment-form',\n\n\t\t\t'comment-list',\n\n\t\t\t'gallery',\n\n\t\t\t'caption',\n\n\t\t) );\n\n\n\n\t\t// Set up the WordPress core custom background feature.\n\n\t\t// Add theme support for selective refresh for widgets.\n\n\t\tadd_theme_support( 'customize-selective-refresh-widgets' );\n\t\t/**\n\n\t\t * Add support for core custom logo.\n\n\t\t *\n\n\t\t * @link https://codex.wordpress.org/Theme_Logo\n\n\t\t */\n\n\t\tadd_theme_support( 'custom-logo', array(\n\n\t\t\t'height' => 250,\n\n\t\t\t'width' => 250,\n\n\t\t\t'flex-width' => true,\n\n\t\t\t'flex-height' => true,\n\n\t\t) );\n\n\t}", "function raiseit_setup() {\n/**\n* Make theme available for translation.\n* Translations can be placed in the /languages/ directory.\n*/\nload_theme_textdomain( 'raiseitfast', get_template_directory() . '/languages' );\n/**\n* Add default posts and comments RSS feed links to <head>.\n*/\nadd_theme_support( 'automatic-feed-links' );\n/**\n* Enable support for post thumbnails and featured images.\n*/\nadd_theme_support( 'post-thumbnails' );\n/**\n* Add support for two custom navigation menus.\n*/\nregister_nav_menus( array(\n\t'primary' => __( 'Primary Menu', 'raiseitfast' ),\n\t'secondary' => __('Secondary Menu', 'raiseitfast' )\n) );\n/**\n* Enable support for the following post formats:\n* aside, gallery, quote, image, and video\n*/\nadd_theme_support( 'post-formats', array ( 'aside', 'gallery', 'quote', 'image', 'video' ) );\n}", "public function __construct(){\n\t\tigk_wp_registerlib(IGK_CGT_PLUGIN_DIR.\"/\");\t\n\t}", "function wp_dashboard_quick_press_output()\n {\n }", "function rooney_theme_setup() {\n\t\t\n\t\t// Clean up the head:\n\t\tremove_action('wp_head','wp_generator');\n\t\tremove_action('wp_head', 'rsd_link');\n\t\tremove_action('wp_head', 'wlwmanifest_link'); // http://wordpress.org/support/topic/wlwmanifestxml-what-is-it\n\t\tremove_action('begin_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_add'); // http://stackoverflow.com/a/12266439/922323\n\t\t\n\t\t// Add theme support for post thumbnails (featured images):\n\t\tadd_theme_support('post-thumbnails');\n\t\t\n\t\t// Valid HTML5 markup:\n\t\t//add_theme_support( 'html5', array('search-form', 'comment-form', 'comment-list',));\n\t\t\n\t\t// Add your nav menus function to the 'init' action hook:\n\t\tadd_action('init', 'rooney_register_menus');\n\t\t\n\t\tadd_filter('user_can_richedit', 'octavo_user_can_richedit');\n\t\t\n\t\tremove_filter('the_content','wpautop');\n\t\tadd_filter('the_content', 'octavo_autop_fix');\n\t\t\n\t\tremove_all_filters('the_excerpt');\n\t\tremove_all_filters('get_the_excerpt');\n\t\tadd_filter('get_the_excerpt', 'octavo_trim_excerpt');\n\t\t\n\t}", "function IDL_install() {\n\tglobal $wp_version;\n\tif (version_compare($wp_version, \"2.6\", \"<\"))\n\t\tdie(__(\"This Plugin requires WordPress version 2.6 or higher\"));\n}", "function wpms_classifieds_init() {\n\tregister_activation_hook ( __FILE__, 'wpms_classifieds_build_permissions' );\n//\tif (isset($_GET['page']) && $_GET['page'] == 'settings_page_wp-multilingual-slider') {\n// \t add_action('admin_init', 'wpms_register');\n//\t}\n\tadd_action('admin_init', 'wpms_init');\n\tadd_action('admin_init', 'wpms_register_mysettings');\n\tadd_action('admin_menu', 'wpms_home_create_menu');\n//\tload_plugin_textdomain( 'wp-multilingual-slider', 'wp-content/plugins/wp-multilingual-slider/languages/');\n}", "private function hooks() {\n\t\t$this->include_tabs();\n\t\t$this->include_tabs_server();\n\n\t\t// Enable the REST API if the settings allow for it.\n\t\tif ( true === (bool) wpcd_get_early_option( 'wordpress_app_rest_api_enable' ) ) {\n\t\t\t$this->include_rest_api();\n\t\t}\n\n\t\t// Make sure WordPress loads up our css and js scripts.\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'wpapp_enqueue_scripts' ), 10, 1 );\n\n\t\t// Show any admin notices related to upgrades.\n\t\tadd_action( 'admin_notices', array( $this, 'wpapp_upgrades_admin_notice' ) );\n\n\t\t// Actions send from the front-end when installing servers and sites.\n\t\tadd_action( \"wpcd_server_{$this->get_app_name()}_action\", array( &$this, 'do_instance_action' ), 10, 3 );\n\t\tadd_action( \"wpcd_app_{$this->get_app_name()}_action\", array( &$this, 'do_app_action' ), 10, 3 );\n\n\t\tadd_filter( \"wpcd_command_{$this->get_app_name()}_logs_done\", array( &$this, 'get_logs_done' ), 10, 4 );\n\t\tadd_filter( \"wpcd_command_{$this->get_app_name()}_logs_intermed\", array( &$this, 'get_logs_intermed' ), 10, 4 );\n\t\tadd_action( \"wpcd_command_{$this->get_app_name()}_completed\", array( &$this, 'command_completed' ), 10, 2 );\n\t\tadd_filter( 'wpcd_server_script_args', array( $this, 'add_script_args_server' ), 10, 2 );\n\t\tadd_filter( 'wpcd_app_script_args', array( $this, 'add_script_args_app' ), 10, 2 );\n\t\tadd_filter( 'wpcd_actions', array( $this, 'add_post_actions' ), 10, 2 );\n\t\tadd_filter( \"wpcd_script_placeholders_{$this->get_app_name()}\", array( $this, 'script_placeholders' ), 10, 6 );\n\t\tadd_filter( 'wpcd_app_server_admin_list_local_status_column', array( &$this, 'app_server_admin_list_local_status_column' ), 10, 2 ); // Show the server status.\n\t\tadd_filter( 'wpcd_app_server_admin_list_local_status_column', array( &$this, 'app_server_admin_list_upgrade_status' ), 11, 2 ); // Show the upgrade status in the local status column - function located in trait file upgrade.php.\n\t\tadd_filter( 'wpcd_app_admin_list_summary_column', array( &$this, 'app_admin_list_upgrade_status' ), 11, 2 ); // Show the upgrade status in the TITLE column of the app list - function located in trait file upgrade.php.\n\n\t\t// Push commands and callbacks from servers.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_server_status_completed\", array( &$this, 'push_command_server_status_completed' ), 10, 4 ); // When a server sends us it's daily status report, part 1 - see bash script #24.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_sites_status_completed\", array( &$this, 'push_command_sites_status_completed' ), 10, 4 ); // When a server sends us it's daily status report, part 2 - see bash script #24.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_maldet_scan_completed\", array( &$this, 'push_command_maldet_scan_completed' ), 10, 4 ); // When a server sends us a report of maldet scan results - see bash script #26.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_server_restart_completed\", array( &$this, 'push_command_server_restart_completed' ), 10, 4 ); // When a server sends us a report of restart or shutdown.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_monit_log_completed\", array( &$this, 'push_command_monit_log_completed' ), 10, 4 ); // When a server sends us a monit alert or report.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_start_domain_backup_completed\", array( &$this, 'push_command_domain_backup_v1_started' ), 10, 4 ); // When a server sends us a notification telling us a scheduled backup was started for a domain.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_end_domain_backup_completed\", array( &$this, 'push_command_domain_backup_v1_completed' ), 10, 4 ); // When a server sends us a notification telling us a scheduled backup was completed for a domain.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_server_config_backup_completed\", array( &$this, 'push_command_server_config_backup' ), 10, 4 ); // When a server sends us a notification telling us a backup of the server configuration has started or ended.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_test_rest_api_completed\", array( &$this, 'push_command_test_rest_api_completed' ), 10, 4 ); // When a server sends us a test notification (initiated from the TOOLS tab on a server screen).\n\n\t\t// Push commands and callbacks from sites.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_schedule_site_sync_completed\", array( &$this, 'push_command_schedule_site_sync' ), 10, 4 ); // When a scheduled site sync has started or ended.\n\n\t\t// After server prepare action hooks.\n\t\t$this->wpcd_after_server_prepare_action_hooks();\n\n\t\t// When we're querying to find out the status of a server.\n\t\tadd_filter( 'wpcd_is_server_available_for_commands', array( &$this, 'wpcd_is_server_available_for_commands' ), 10, 2 );\n\n\t\t// When an app cleanup script is being run.\n\t\tadd_action( 'wpcd_cleanup_app_after', array( $this, 'wpcd_cleanup_app_after' ), 10, 1 );\n\n\t\t// When a server cleanup script is being run.\n\t\tadd_action( 'wpcd_cleanup_server_after', array( $this, 'wpcd_cleanup_server_after' ), 10, 1 );\n\n\t\t// When WP has been installed, add temp domain to DNS if configured.\n\t\tadd_action( 'wpcd_command_wordpress-app_completed_after_cleanup', array( $this, 'wpcd_wpapp_install_complete' ), 10, 4 );\n\n\t\t// Ajax Hooks.\n\t\tadd_action( \"wp_ajax_wpcd_{$this->get_app_name()}\", array( &$this, 'ajax_server' ) ); // For ajax calls dealing with servers in wp-admin.\n\t\tadd_action( \"wp_ajax_wpcd_app_{$this->get_app_name()}\", array( &$this, 'ajax_app' ) ); // for ajax calls dealing with apps in wp-admin.\n\t\tif ( wpcd_is_woocommerce_activated() ) {\n\t\t\tadd_action( 'wp_ajax_wpcd_wpapp_frontend', array( &$this, 'ajax_wpapp_frontend' ) ); // for ajax calls from the front-end - code in trait files.\n\t\t}\n\n\t\t// Add welcome message to the settings screen.\n\t\tadd_filter( 'wpcd_general_settings_after_welcome_message', array( $this, 'welcome_message_settings' ), 10, 1 );\n\n\t\t// Add some additional instructions to the \"no application servers found\" message.\n\t\tadd_filter( 'wpcd_no_app_servers_found_msg', array( $this, 'no_app_servers_found_msg' ), 10, 1 );\n\n\t\t// Add a state called \"WordPress\" to the app when its shown on the app list.\n\t\tadd_filter( 'display_post_states', array( $this, 'display_post_states' ), 20, 2 );\n\n\t\t// Background actions for SERVER.\n\t\tadd_action( 'wpcd_wordpress_deferred_actions_for_server', array( $this, 'do_deferred_actions_for_server' ), 10 );\n\n\t\t// Background actions for APPS.\n\t\tadd_action( 'wpcd_wordpress_deferred_actions_for_apps', array( $this, 'do_deferred_actions_for_app' ), 10 );\n\n\t\t// Delete temp log files.\n\t\tadd_action( 'wpcd_wordpress_file_watcher', array( $this, 'file_watcher_delete_temp_files' ) );\n\n\t\t/* Do not allow WooCommerce to redirect to their account page */\n\t\tadd_filter( 'woocommerce_prevent_admin_access', array( $this, 'wc_subscriber_admin_access' ), 20, 1 );\n\n\t\t/*********************************************\n\t\t* Hooks and filters for screens in wp-admin\n\t\t*/\n\n\t\t// Filter hook to add new columns to the APP list.\n\t\tadd_filter( 'manage_wpcd_app_posts_columns', array( $this, 'app_posts_app_table_head' ), 10, 1 );\n\n\t\t// Action hook to add values in new columns in the APP list.\n\t\tadd_action( 'manage_wpcd_app_posts_custom_column', array( $this, 'app_posts_app_table_content' ), 10, 2 );\n\n\t\t// Filter hook to add new columns to the SERVER list.\n\t\tadd_filter( 'manage_wpcd_app_server_posts_columns', array( $this, 'app_server_table_head' ), 10, 1 );\n\n\t\t// Show some app details in the wp-admin list of apps.\n\t\tadd_filter( 'wpcd_app_admin_list_summary_column', array( &$this, 'app_admin_list_summary_column' ), 10, 2 );\n\n\t\t// Add the INSTALL WordPress button to the server list.\n\t\tadd_filter( 'wpcd_app_server_table_content', array( &$this, 'app_server_table_content' ), 10, 3 );\n\n\t\t// Filter hook to add a REMOVE SITE link to the hover action on an app.\n\t\tadd_filter( 'post_row_actions', array( $this, 'post_row_actions' ), 10, 2 );\n\n\t\t// Meta box display callback.\n\t\tadd_action( 'add_meta_boxes_wpcd_app', array( $this, 'app_admin_add_meta_boxes' ) );\n\n\t\t// Save Meta Values.\n\t\tadd_action( 'save_post', array( $this, 'app_admin_save_meta_values' ), 10, 2 );\n\n\t\t// Add Metabox.IO metaboxes for the WordPress app into the APP details CPT screen.\n\t\tadd_filter( \"wpcd_app_{$this->get_app_name()}_metaboxes\", array( $this, 'add_meta_boxes' ), 10, 1 );\n\n\t\t// Add Metabox.IO metaboxes for the SERVER CPT into the server details CPT screen.\n\t\tadd_filter( 'rwmb_meta_boxes', array( $this, 'register_server_metaboxes' ), 10, 1 ); // Register application metabox stub with filter. Note that this is a METABOX.IO filter, not a core WP filter.\n\t\tadd_filter( \"wpcd_server_{$this->get_app_name()}_metaboxes\", array( $this, 'add_meta_boxes_server' ), 10, 1 );\n\n\t\t// Action hook to fire on new site created on WP Multisite.\n\t\tadd_action( 'wp_initialize_site', array( $this, 'wpapp_schedule_events_for_new_site' ), 10, 2 );\n\n\t\t// Action hook to set transient if directory is readable and .txt files are accessible.\n\t\tadd_action( 'admin_init', array( $this, 'wpapp_admin_init' ) );\n\n\t\t// Action hook to handle ajax request to set transient if user closed the readable notice check.\n\t\tadd_action( 'wp_ajax_set_readable_check', array( $this, 'set_readable_check' ) );\n\n\t\t// Action hook to handle ajax request to set transient if user clicked the \"check again\" option in the \"readable check\" notice.\n\t\tadd_action( 'wp_ajax_readable_check_again', array( $this, 'readable_check_again' ) );\n\n\t\t// Action hook to extend admin filter options.\n\t\tadd_action( 'restrict_manage_posts', array( $this, 'wpapp_wpcd_app_table_filtering' ) );\n\n\t\t// Filter hook to filter app listing on custom meta data.\n\t\tadd_filter( 'parse_query', array( $this, 'wpapp_wpcd_app_parse_query' ), 10, 1 );\n\n\t\t// Action hook to handle ajax request to set transient if user closed the notice for cron check.\n\t\tadd_action( 'wp_ajax_set_cron_check', array( $this, 'set_cron_check' ) );\n\t}", "function utcw_wp_loaded() {\n\tglobal $utcw_allowed_taxonomies, $utcw_allowed_post_types;\n\n\t$utcw_allowed_taxonomies = get_taxonomies();\n\t$utcw_allowed_post_types = get_post_types(array('public' => true));\n}", "function setup() {\n\t$n = function ( $function ) {\n\t\treturn __NAMESPACE__ . \"\\\\$function\";\n\t};\n\n\t// NOTE: Uncomment to activate post type\n\tadd_action( 'init', $n( 'register_work' ) );\n\n}", "function itc_setup() {\n\n\n\n\t\t/*\n\n\t\t * Make theme available for translation.\n\n\t\t */\n\n\t\t//load_theme_textdomain( 'itc', get_template_directory() . '/languages' );\n\n\n\n\t\t// Add default posts and comments RSS feed links to head.\n\n\t\tadd_theme_support( 'automatic-feed-links' );\n\n\n\n\t\t/*\n\n\t\t * Enable support for Post Thumbnails on posts and pages.\n\n\t\t */\n\n\t\tadd_theme_support( 'post-thumbnails' );\n\n\n\n\t\t/*\n\n\t\t * Switch default core markup for search form, comment form, and comments\n\n\t\t * to output valid HTML5.\n\n\t\t */\n\n\t\tadd_theme_support( 'html5', array(\n\n\t\t\t'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'\n\n\t\t) );\n\n\n\n\t\t/*\n\n\t\t * Enable support for Post Formats.\n\n\t\t */\n\n\t\tadd_theme_support( 'post-formats', array(\n\n\t\t\t'aside', 'image', 'video', 'quote', 'link'\n\n\t\t) );\n\n\n\n\t}", "function setup(){\n\t//clean out the header\n\thead_cleanup();\n\n\t//theme supports\n\tadd_theme_support('post-thumbnails');\n\tadd_theme_support('menus');\n\n\t//menus\n\tregister_nav_menus(array(\n\t\t'main-nav' => __('Main Navigation', THEME_DOMAIN),\n\t\t'footer-nav' => __('Footer Navigation', THEME_DOMAIN)\n\t));\n}", "function bones_ahoy() {\n\n\t// let's get language support going, if you need it\n\tload_theme_textdomain( 'bonestheme', get_template_directory() . '/library/translation' );\n\n\t// launching operation cleanup\n\tadd_action( 'init', 'bones_head_cleanup' );\n\t// remove WP version from RSS\n\tadd_filter( 'the_generator', 'bones_rss_version' );\n\t// remove pesky injected css for recent comments widget\n\tadd_filter( 'wp_head', 'bones_remove_wp_widget_recent_comments_style', 1 );\n\t// clean up comment styles in the head\n\tadd_action( 'wp_head', 'bones_remove_recent_comments_style', 1 );\n\t// clean up gallery output in wp\n\tadd_filter( 'gallery_style', 'bones_gallery_style' );\n\n\t// enqueue base scripts and styles\n\tadd_action( 'wp_enqueue_scripts', 'bones_scripts_and_styles', 999 );\n\t// ie conditional wrapper\n\n\t// launching this stuff after theme setup\n\tbones_theme_support();\n\n\t// adding sidebars to Wordpress (these are created in functions.php)\n\tadd_action( 'widgets_init', 'bones_register_sidebars' );\n\n\t// cleaning up random code around images\n\tadd_filter( 'the_content', 'bones_filter_ptags_on_images' );\n\t// cleaning up excerpt\n\tadd_filter( 'excerpt_more', 'bones_excerpt_more' );\n\n}", "function setup() {\n\t$n = function( $function ) {\n\t\treturn __NAMESPACE__ . \"\\\\$function\";\n\t};\n\n\tadd_action( 'after_setup_theme', $n( 'vincentragosta_setup' ) );\n\tadd_action( 'wp_enqueue_scripts', $n( 'scripts' ) );\n\tadd_action( 'wp_enqueue_scripts', $n( 'styles' ) );\n}", "function wp_welcome_panel()\n {\n }", "function sparcwp_setup() {\n global $cap, $content_width;\n\n // This theme styles the visual editor with editor-style.css to match the theme style.\n add_editor_style();\n\n if ( function_exists( 'add_theme_support' ) ) {\n\n\t\t/**\n\t\t * Add default posts and comments RSS feed links to head\n\t\t*/\n\t\tadd_theme_support( 'automatic-feed-links' );\n\t\t\n\t\t/**\n\t\t * Enable support for Post Thumbnails on posts and pages\n\t\t *\n\t\t * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails\n\t\t*/\n\t\tadd_theme_support( 'post-thumbnails' );\n\t\t\n\t\t/**\n\t\t * Enable support for Post Formats\n\t\t*/\n\t\tadd_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) );\n\t\t\n\t\t/**\n\t\t * Setup the WordPress core custom background feature.\n\t\t*/\n\t\tadd_theme_support( 'custom-background', apply_filters( 'sparcwp_custom_background_args', array(\n\t\t\t'default-color' => 'ffffff',\n\t\t\t'default-image' => '',\n\t\t) ) );\n\t\n }\n\n\n\t/**\n\t * This theme uses wp_nav_menu() in one location.\n\t*/ \n register_nav_menus(\n array(\n 'primary' => 'Main Menu',\n 'footer_menu' => 'Footer Menu'\n )\n );\n\n}", "function wp_installing($is_installing = \\null)\n {\n }", "function addWPActions ()\n\t{\n\t\t//Frontend\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'frontendEnqueues' ), 1 );\n\t\tadd_shortcode( 'imperial-document-upload', array( $this, 'drawDocumentUploadShortcode' ) );\n\t\t\n\n\t}", "private function __construct() {\r\n\r\n\t\t\t// Nothing else matters if we're not on the main site\r\n\t\t\tif ( ! is_main_site() ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t//auto loader\r\n\t\t\tspl_autoload_register( array( $this, 'autoloader' ) );\r\n\t\t\t//start upgrade if needed\r\n\t\t\tif ( get_site_option( 'backwpup_version' ) != self::get_plugin_data( 'Version' ) ) {\r\n\t\t\t\tBackWPup_Install::activate();\r\n\t\t\t}\r\n\t\t\t//load pro features\r\n\t\t\tif ( class_exists( 'BackWPup_Pro' ) ) {\r\n\t\t\t\tBackWPup_Pro::get_instance();\r\n\t\t\t}\r\n\t\t\t//WP-Cron\r\n\t\t\tif ( defined( 'DOING_CRON' ) && DOING_CRON ) {\r\n\t\t\t\t//early disable caches\r\n\t\t\t\tif ( ! empty( $_GET[ 'backwpup_run' ] ) && class_exists( 'BackWPup_Job' ) ) {\r\n\t\t\t\t\tBackWPup_Job::disable_caches();\r\n\t\t\t\t}\r\n\t\t\t\t// add normal cron actions\r\n\t\t\t\tadd_action( 'backwpup_cron', array( 'BackWPup_Cron', 'run' ) );\r\n\t\t\t\tadd_action( 'backwpup_check_cleanup', array( 'BackWPup_Cron', 'check_cleanup' ) );\r\n\t\t\t\t// add action for doing thinks if cron active\r\n\t\t\t\t// must done in wp_loaded so that all is really loaded and initiated\r\n\t\t\t\tadd_action( 'wp_loaded', array( 'BackWPup_Cron', 'cron_active' ), 999 );\r\n\t\t\t\t// if in cron the rest must not needed\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t//deactivation hook\r\n\t\t\tregister_deactivation_hook( __FILE__, array( 'BackWPup_Install', 'deactivate' ) );\r\n\t\t\t//Admin bar\r\n\t\t\tif ( is_admin_bar_showing() ) {\r\n\t\t\t\tadd_action( 'init', array( 'BackWPup_Adminbar', 'get_instance' ) );\r\n\t\t\t}\r\n\t\t\t//only in backend\r\n\t\t\tif ( is_admin() && class_exists( 'BackWPup_Admin' ) ) {\r\n\t\t\t\tBackWPup_Admin::get_instance();\r\n\t\t\t}\r\n\t\t\t//work with wp-cli\r\n\t\t\tif ( defined( 'WP_CLI' ) && WP_CLI && method_exists( 'WP_CLI', 'add_command' ) ) {\r\n\t\t\t\tWP_CLI::add_command( 'backwpup', 'BackWPup_WP_CLI' );\r\n\t\t\t}\r\n\t\t}", "function install_site() {\n \n}", "function setup() {\n\t$n = function( $function ) {\n\t\treturn __NAMESPACE__ . \"\\\\$function\";\n\t};\n\n\tadd_action( 'after_setup_theme', $n( 'i18n' ) );\n\tadd_action( 'after_setup_theme', $n( 'theme_setup' ) );\n\tadd_action( 'wp_enqueue_scripts', $n( 'scripts' ) );\n\tadd_action( 'wp_enqueue_scripts', $n( 'styles' ) );\n}", "function ms_setup() {\n\n\t/*\n\t * Make theme available for translation.\n\t * Translations can be filed in the /languages/ directory.\n\t * If you're building a theme based on Mansion, use a find and replace\n\t * to change 'ms' to the name of your theme in all the template files\n\t */\n\tload_theme_textdomain( 'ms', get_template_directory() . '/languages' );\n\n\t// Add default posts and comments RSS feed links to head.\n\tadd_theme_support( 'automatic-feed-links' );\n\n\t/*\n\t * Enable support for Post Thumbnails on posts and pages.\n\t *\n\t * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails\n\t */\n\tadd_theme_support( 'post-thumbnails' );\n\n\t// This theme uses wp_nav_menu() in one location.\n\tregister_nav_menus( array(\n\t\t'primary' => __( 'Primary Menu', 'ms' ),\n\t) );\n\t\n\t/*\n\t * Switch default core markup for search form, comment form, and comments\n\t * to output valid HTML5.\n\t */\n\tadd_theme_support( 'html5', array(\n\t\t'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'\n\t) );\n\n\t/*\n\t * Enable support for Post Formats.\n\t * See http://codex.wordpress.org/Post_Formats\n\t */\n\tadd_theme_support( 'post-formats', array(\n\t\t'aside', 'image', 'video', 'quote', 'link'\n\t) );\n\n\t// Setup the WordPress core custom background feature.\n\tadd_theme_support( 'custom-background', apply_filters( 'ms_custom_background_args', array(\n\t\t'default-color' => 'ffffff',\n\t\t'default-image' => '',\n\t) ) );\n}", "function wp_dashboard_setup()\n {\n }", "function wp_initial_constants()\n {\n }", "public function setup() {\n\t\t\t \n\t\t\t/**\n\t\t\t * Set the content width based on the theme's design and stylesheet.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t */\n\t\t\t\n//\t\t\tif ( ! isset( $content_width ) )\n//\t\t\t\t$content_width = kolarik_option( 'kolarik_option', 'layout-format-width', 1400 );\n\t\t\t \n\t\t\t/**\n\t\t\t * Load Localisation files.\n\t\t\t *\n\t\t\t * Note: the first-loaded translation file overrides any following ones if the same translation is present.\n\t\t\t */\n\n\t\t\t// Loads wp-content/languages/themes/demokit-de_DE.mo.\n\t\t\tload_theme_textdomain( 'demokit', trailingslashit( WP_LANG_DIR ) . 'themes/' );\n\n\t\t\t// Loads wp-content/themes/demokit-child/languages/de_DE.mo.\n\t\t\tload_theme_textdomain( 'demokit', get_stylesheet_directory() . '/languages' );\n\n\t\t\t// Loads wp-content/themes/demokit/languages/de_DE.mo.\n\t\t\tload_theme_textdomain( 'demokit', get_template_directory() . '/languages' );\n\t\t\t\t\t\t\t\n\t\t\t/**\n\t\t\t * WordPress Core Features\n\t\t\t */\n\t\t\n\t\t\t// Add custom menus\n\t\t\t//add_theme_support( 'menus' );\n\t\t\t\n\t\t\t// Add custom widgets\n\t\t\t//add_theme_support( 'widgets' );\n\t\t\t\n\t\t\t// Add default posts and comments RSS feed links to head\n\t\t\tadd_theme_support( 'automatic-feed-links' );\n\t\t\t\n\t\t\t// Add post thumbnails\n\t\t\tadd_theme_support( 'post-thumbnails' );\n\t\t\t\n\t\t\t// Add custom background\n\t\t\tadd_theme_support( 'custom-background', array(\n\t\t\t\t'default-color'\t\t\t=> '303030',\n\t\t\t\t'default-image'\t\t\t=> ''\n\t\t\t) );\n\t\t\t\n\t\t\t// Add html5 support\n\t\t\tadd_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) );\n\t\t\t\n\t\t\t// Add support for title tag\n\t\t\tadd_theme_support( 'title-tag' );\n\t\t\t\n\t\t\t// Add support for custom logo\n\t\t\tadd_theme_support( 'custom-logo', array(\n\t\t\t\t'width' => 100,\n\t\t\t\t'height' => 100,\n\t\t\t\t'flex-height' => true,\n\t\t\t\t'flex-width' => true,\n\t\t\t\t'header-text' => array( 'site-title', 'site-description' ),\n\t\t\t) );\n\t\t\t\n\t\t\tadd_theme_support( 'responsive' );\n\t\t\t\n\t\t}", "public function core();", "public function plugins_loadedWPaction() {\n\t\tload_plugin_textdomain ( get_class ( $this ), false, dirname ( plugin_basename ( $this->application()->filename ) ) . \"/languages/\" );\n\t\twp_enqueue_style ( 'jquery-ui_smoothness', $this->application ()->pluginuri () . '/library/public/css/smoothness/jquery-ui-1.8.13.custom.css', null, $this->application ()->version () );\n\t\twp_enqueue_style ( 'v35v_style_css', $this->application ()->pluginuri () . '/library/public/css/style.css', null, $this->application ()->version () );\n\t\twp_enqueue_script ( 'v35v_script_js', $this->application ()->pluginuri () . '/library/public/js/script.js', null, $this->application ()->version () );\n\t}", "public function add_theme_support() {\n\t}", "public function get_test_wordpress_version()\n {\n }", "public function __construct() {\n\n\t\t// Setup empty class for the global $wpex_theme object\n\t\tglobal $wpex_theme;\n\t\t$wpex_theme = new stdClass;\n\n\t\t// Defines hooks and runs actions on init\n\t\tadd_action( 'init', array( $this, 'actions' ), 0 );\n\n\t\t// Define constants\n\t\tadd_action( 'after_setup_theme', array( $this, 'constants' ), 1 );\n\n\t\t// Load all the theme addons\n\t\tadd_action( 'after_setup_theme', array( &$this, 'addons' ), 2 );\n\n\t\t// Load configuration classes (post types & 3rd party plugins)\n\t\t// Must load first so it can use hooks defined in the classes\n\t\tadd_action( 'after_setup_theme', array( &$this, 'configs' ), 3 );\n\n\t\t// Load all core theme function files\n\t\tadd_action( 'after_setup_theme', array( &$this, 'include_functions' ), 4 );\n\n\t\t// Load framework classes\n\t\tadd_action( 'after_setup_theme', array( &$this, 'classes' ), 5 );\n\n\t\t// Load custom widgets\n\t\tadd_action( 'after_setup_theme', array( &$this, 'custom_widgets' ), 5 );\n\n\t\t// Populate the global opject after all core functions are registered and after the WP object is set up\n\t\t// Would be best to use template_redirect, but need to use wp_head to fix a bug with the Visual Composer Media Grid builder...\n\t\tadd_action( 'wp_head', array( $this, 'global_object' ), 0 );\n\n\t\t// Actions & filters\n\t\tadd_action( 'after_setup_theme', array( &$this, 'add_theme_support' ) );\n\n\t\t// Flush rewrites after theme switch to prevent 404 errors\n\t\tadd_action( 'after_switch_theme', array( &$this, 'flush_rewrite_rules' ) );\n\n\t\t// Load scripts in the WP admin\n\t\tadd_action( 'admin_enqueue_scripts', array( &$this, 'admin_scripts' ) );\n\n\t\t// Load theme CSS\n\t\tadd_action( 'wp_enqueue_scripts', array( &$this, 'theme_css' ) );\n\n\t\t// Load responsive CSS - must be added last\n\t\tadd_action( 'wp_enqueue_scripts', array( &$this, 'responsive_css' ), 99 );\n\n\t\t// Load theme js\n\t\tadd_action( 'wp_enqueue_scripts', array( &$this, 'theme_js' ) );\n\n\t\t// Add meta viewport tag to header\n\t\tadd_action( 'wp_head', array( &$this, 'meta_viewport' ), 1 );\n\n\t\t // Add meta viewport tag to header\n\t\tadd_action( 'wp_head', array( &$this, 'meta_edge' ), 0 );\n\n\t\t// Loads CSS for ie8\n\t\tadd_action( 'wp_head', array( &$this, 'ie8_css' ) );\n\n\t\t// Loads html5 shiv script\n\t\tadd_action( 'wp_head', array( &$this, 'html5_shiv' ) );\n\n\t\t// Adds tracking code to the site head\n\t\tadd_action( 'wp_head', array( &$this, 'tracking' ) );\n\n\t\t// Outputs custom CSS to the head\n\t\tadd_action( 'wp_head', array( &$this, 'custom_css' ), 9999 );\n\n\t\t// register sidebar widget areas\n\t\tadd_action( 'widgets_init', array( &$this, 'register_sidebars' ) );\n\n\t\t// Define the directory URI for the gallery metabox calss\n\t\tadd_action( 'wpex_gallery_metabox_dir_uri', array( &$this, 'gallery_metabox_dir_uri' ) );\n\n\t\t// Alter tagcloud widget to display all tags with 1em font size\n\t\tadd_filter( 'widget_tag_cloud_args', array( &$this, 'widget_tag_cloud_args' ) );\n\n\t\t// Alter WP categories widget to display count inside a span\n\t\tadd_filter( 'wp_list_categories', array( &$this, 'wp_list_categories_args' ) );\n\n\t\t// Exclude categories from the blog page\n\t\tadd_filter( 'pre_get_posts', array( &$this, 'pre_get_posts' ) );\n\n\t\t// Add new social profile fields to the user dashboard\n\t\tadd_filter( 'user_contactmethods', array( &$this, 'add_user_social_fields' ) );\n\n\t\t// Add a responsive wrapper to the WordPress oembed output\n\t\tadd_filter( 'embed_oembed_html', array( &$this, 'add_responsive_wrap_to_oembeds' ), 99, 4 );\n\n\t\t// Allow for the use of shortcodes in the WordPress excerpt\n\t\tadd_filter( 'the_excerpt', 'shortcode_unautop' );\n\t\tadd_filter( 'the_excerpt', 'do_shortcode' );\n\n\t\t// Make sure the wp_get_attachment_url() function returns correct page request (HTTP or HTTPS)\n\t\tadd_filter( 'wp_get_attachment_url', array( &$this, 'honor_ssl_for_attachments' ) );\n\n\t\t// Tweak the default password protection output form\n\t\tadd_filter( 'the_password_form', array( &$this, 'custom_password_protected_form' ) );\n\n\t\t// Exclude posts with custom links from the next and previous post links\n\t\tadd_filter( 'get_previous_post_join', array( &$this, 'prev_next_join' ) );\n\t\tadd_filter( 'get_next_post_join', array( &$this, 'prev_next_join' ) );\n\t\tadd_filter( 'get_previous_post_where', array( &$this, 'prev_next_where' ) );\n\t\tadd_filter( 'get_next_post_where', array( &$this, 'prev_next_where' ) );\n\n\t\t// Redirect posts with custom links\n\t\tadd_filter( 'template_redirect', array( &$this, 'redirect_custom_links' ) );\n\n\t}", "function tnc_enable_dev_wp_interface() {\n}", "function flexfour_setup(){\n\nload_theme_textdomain( 'twentytwelve', get_template_directory() . '/lang' );\nadd_theme_support( 'automatic-feed-links' );\n\tadd_theme_support( 'custom-background', array(\n\t\t'default-color' => 'e6e6e6',\n\t) );\n\tadd_theme_support( 'custom-header' );\n\t// This theme uses a custom image size for featured images, displayed on \"standard\" posts.\n\tadd_theme_support( 'post-thumbnails' );\n\tset_post_thumbnail_size( 624, 9999 ); // Unlimited height, soft crop\n\t\tadd_theme_support( 'menus' ); // wp menus\n}", "function reactor_init() {\n\t\trequire_once locate_template('/library/inc/functions/get-options.php');\n\t\t\n\t\t// extensions of WordPress\n\t\trequire_once locate_template('/library/inc/extensions/theme-support.php');\n\t\trequire_once locate_template('/library/inc/extensions/scripts-styles.php');\n\t\trequire_once locate_template('/library/inc/extensions/walkers.php');\n\t\trequire_once locate_template('/library/inc/extensions/menus.php');\n\t\trequire_once locate_template('/library/inc/extensions/post-types.php');\n\t\trequire_once locate_template('/library/inc/extensions/sidebars.php');\n\t\trequire_once locate_template('/library/inc/extensions/comments.php');\n\t\trequire_once locate_template('/library/inc/extensions/hooks.php');\n\t\t\n\t\t// hooked content\n\t\trequire_once locate_template('/library/inc/extensions/content/content-header.php');\n\t\trequire_once locate_template('/library/inc/extensions/content/content-footer.php');\n\t\trequire_once locate_template('/library/inc/extensions/content/content-posts.php');\n\t\trequire_once locate_template('/library/inc/extensions/content/content-pages.php');\n\t\t\n\t\t// additional functions\n\t\trequire_once locate_template('/library/inc/customizer/customizer-init.php');\n\t\trequire_once locate_template('/library/inc/metaboxes/meta-init.php');\n\t\trequire_once locate_template('/library/inc/shortcodes/reactor-shortcodes.php');\n\t\trequire_once locate_template('/library/inc/translation/language.php');\n\t\t\n\t\t// functions for Reactor\n\t\trequire_once locate_template('/library/inc/functions/breadcrumbs.php');\n\t\trequire_once locate_template('/library/inc/functions/columns.php');\n\t\trequire_once locate_template('/library/inc/functions/custom-login.php');\n\t\trequire_once locate_template('/library/inc/functions/helpers.php');\n\t\trequire_once locate_template('/library/inc/functions/page-links.php');\n\t\trequire_once locate_template('/library/inc/functions/post-meta.php');\n\t\trequire_once locate_template('/library/inc/functions/slider.php');\n\t\trequire_once locate_template('/library/inc/functions/taxonomy-subnav.php');\n\t\trequire_once locate_template('/library/inc/functions/top-bar.php');\n\t\trequire_once locate_template('/library/inc/functions/tumblog-icons.php');\n\t\t\n\t}", "function wp_one_viewer_run () {\n\n \n $urlsInit = new OneViewerEndPoint();\n $urlsInit->Register_Endpoint();\n\n\t$plugin = new OneViewerCore();\n $plugin->init();\n\n}", "function setup(){\n\tadd_theme_support( 'title-tag' );\n\n\t/**\n\t *\n\t * Register navigation menus\n\t * @see http://codex.wordpress.org/Function_Reference/register_nav_menus\n\t *\n\t */\n\tregister_nav_menus( [\n\t\t'primary_nav'\t=> __( 'Primary Navigation', 'jchck' )\n\t] );\n\n\t/**\n\t *\n\t * Turn on post thumbnails\n\t * @see http://codex.wordpress.org/Post_Thumbnails\n\t * @see http://codex.wordpress.org/Function_Reference/set_post_thumbnail_size\n\t * @see http://codex.wordpress.org/Function_Reference/add_image_size\n\t *\n\t */\n\tadd_theme_support('post-thumbnails');\n\n\t/**\n\t *\n\t * Turn on HTML5 support\n\t * @see http://codex.wordpress.org/Function_Reference/add_theme_support#HTML5\n\t *\n\t */\n\tadd_theme_support( 'html5', ['caption', 'comment-form', 'comment-list', 'gallery', 'search-form'] );\n}", "public function helper()\n\t{\n\t\n\t}", "function redmoon_setup(){\n load_theme_textdomain( 'redmoon', get_template_directory( ).'/languages' ); \n\n //Feed automático\n add_theme_support('automatic-feed-links'); \n\n //Thumbnails\n add_theme_support( 'post-thumbnails' ); \n\n //opciones d post's\n add_theme_support( 'post-formats', array('aside', 'gallery', 'quote', 'image', 'video') );\n\n //registramos los distintos menus\n register_nav_menus( array(\n 'main_menu' => __('Menú principal', 'redmoon'),\n 'responsive_main_menu' => __('Responsive Menú', 'redmoon'),\n 'social_header' => __('Social Cabecera', 'redmoon'),\n 'footer_social' => __('Social Pie de Página', 'redmoon')\n ) );\n\n require_once get_template_directory( ).'/inc/theme-options/setup-options-theme.php';\n setup_options_theme();\n\n }", "function pd_startup()\n{\n add_action('init', 'pd_head_cleanup');\n add_action('after_setup_theme', 'pd_theme_support'); /* end pd theme support */\n}", "function dwc_setup() {\n\tremove_theme_support( 'post-thumbnails' );\n\tremove_custom_background();\n\tremove_custom_image_header();\n\n\t// Remove hooks added in parent theme (after they are created) for dwc_auto_excerpt_more below\n\tremove_filter( 'excerpt_more', 'twentyten_auto_excerpt_more' );\n\tremove_filter( 'get_the_excerpt', 'twentyten_custom_excerpt_more' );\n\n\t// There is one customizable menu for this theme\n\tregister_nav_menus( array(\n\t\t'primary' => __( 'Primary Navigation' ),\n\t) );\n\n\t// Set the default timezone so ISO8601 timestamps are correct\n\tdate_default_timezone_set( get_option( 'timezone_string' ) );\n}", "public function __construct(){\n\n $this->define_theme_globals();\n $this->define_theme_supports();\n $this->define_image_sizes();\n $this->replace_3rd_party_pugins_hooks();\n $this->remove_actions();\n $this->init_hooks();\n $this->include_global();\n\n if( $this->is_request( 'frontend' )){\n add_action('wp_head', array('theme_construct_page', 'init'));\n }\n\n if( $this->is_request( 'admin' )){\n // $this->include_admin();\n }\n }", "function _wp_call_all_hook($args)\n {\n }", "private function require_files() {\n\n /**\n * Fixes plugins_url() for plugins located in /lib\n */\n add_filter( 'plugins_url', function( $plugins_url, $path, $plugin ) {\n if ( false !== stripos( $plugin, get_template_directory() ) ) {\n $plugins_url = get_template_directory_uri() . str_replace( WP_PLUGIN_URL . get_template_directory(), '', $plugins_url );\n }\n return $plugins_url;\n }, 10, 3 );\n\n // Include WP_oEmbed class\n require_once ABSPATH . WPINC . '/class-oembed.php';\n\n if ( defined( 'WP_CLI' ) && WP_CLI ) {\n require_once dirname( __FILE__ ) . '/inc/cli/class-cli.php';\n require_once dirname( __FILE__ ) . '/inc/cli/class-cli-clusters.php';\n }\n\n if ( is_admin() ) {\n $this->admin = Admin\\Admin::get_instance();\n $this->homepage_settings = Admin\\Homepage_Settings::get_instance();\n $this->cluster_tools = Admin\\Cluster_Tools::get_instance();\n $this->taxonomy_tools = Admin\\Taxonomy_Tools::get_instance();\n // Will be reimplemented after our move to MailChimp. See #2426\n // $this->newsletter_testing = Newsletter_Testing::get_instance();\n } else {\n $this->frontend = Frontend::get_instance();\n }\n\n $this->scripts_styles = Scripts_Styles::get_instance();\n $this->utilities = Utils::get_instance();\n $this->taxonomies = Taxonomies::get_instance();\n $this->single_option_taxonomies = Single_Option_Taxonomies::get_instance();\n $this->post_types = Types::get_instance();\n $this->user_management = User_Management::get_instance();\n $this->shortcode_manager = Shortcode_Manager::get_instance();\n $this->adverts = Adverts::get_instance();\n $this->ad_kill_switch = Admin\\Ad_Kill_Switch::get_instance();\n $this->slots = Posts\\Slots\\Slots::get_instance();\n $this->feeds = Feeds::get_instance();\n $this->featured_posts = Featured_Posts::get_instance();\n $this->icons = Icons::get_instance();\n $this->cron_management = Cron_Management::get_instance();\n $this->menus = Menus::get_instance();\n $this->menu_icons = Menu_Icons::get_instance();\n $this->component_previews = Component_Previews::get_instance();\n $this->page_cache = Page_Cache::get_instance();\n\n // Target Audience Messaging\n $this->audience = Audience::get_instance();\n $this->message_spot = Message_Spot::get_instance();\n $this->conversion_prompts = Conversion_Prompts::get_instance();\n $this->message_banner = Message_Banner::get_instance();\n\n // Metrics\n $this->metricbots = MetricBots::get_instance();\n $this->weekly_traffic_metric = Weekly_Traffic_Metric::get_instance();\n $this->newsletter_signups_by_page_metric = Newsletter_Signups_By_Page_Metric::get_instance();\n $this->yesterdays_email_metric = Yesterdays_Email_Metric::get_instance();\n\n // Emails\n $this->emails = Email::get_instance();\n $this->email_groups = Email_Groups::get_instance();\n $this->breaking_news_emails = Breaking_News_Emails::get_instance();\n $this->newsletter_emails = Newsletter_Emails::get_instance();\n $this->follow_updates = Follow_Updates::get_instance();\n $this->schedule_follow_updates = Schedule_Follow_Updates::get_instance();\n\n }", "private function public_hooks()\n\t{\n\t}", "public function private_theme_functions()\n {\n // Adds plus button\n add_action('in_admin_header', [ & $this, 'addParallaxBlock'], -200);\n\n // Replace the common scripts\n add_action('wp_default_scripts', [$this, 'changeCommonScript'], 11);\n }", "function wpRehab_setup() {\n //Define theme constants\n define('CHILD_THEME_NAME', 'wpRehab');\n define('CHILD_THEME_URL', 'http://wordpressrehab.com');\n define('CHILD_THEME_VERSION', '2.0.0');\n\n //Add html5 markup structure\n add_theme_support( 'html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption' ) );\n \n //Add viewport meta tag for mobile browsers\n add_theme_support( 'genesis-responsive-viewport' );\n \n //Add theme suport for accessibility\n add_theme_support(\n 'genesis-accessibility',\n array(\n '404-page',\n 'drop-down-menu',\n 'headings',\n 'rems',\n 'search-form',\n 'skip-links',\n )\n );\n\n remove_action( 'genesis_after_header','genesis_do_nav' ) ;\n\tadd_action( 'genesis_header_right','genesis_do_nav' );\n \n \n // //Add theme support for footer widgets\n // add_theme_support('genesis-footer-widgets',3);\n // genesis_unregister_layout( 'content-sidebar-sidebar' );\n // genesis_unregister_layout( 'sidebar-content-sidebar' );\n // genesis_unregister_layout( 'sidebar-sidebar-content' );\n\n\n\n \n //unregister secondary sidebar\n //unregister_sidebar('sidebar-alt');\n\n //Add theme widget areas\n //include_once( get_stylesheet_directory() . '\\includes\\widget-area.php' );\n}", "function clean_and_sober_setup() {\n\t\t/**\n\t\t * Custom template tags for this theme.\n\t\t */\n\t\trequire( get_template_directory() . '/inc/template-tags.php' );\n\n\t\t/**\n\t\t * Make theme available for translation\n\t\t * Translations can be filed in the /languages/ directory\n\t\t */\n\t\tload_theme_textdomain( 'clean-and-sober', get_template_directory() . '/languages' );\n\n\t\t$locale = get_locale();\n\t\t$locale_file = get_template_directory() . \"/languages/$locale.php\";\n\t\tif ( is_readable( $locale_file ) )\n\t\t\trequire_once( $locale_file );\n\n\t\t/**\n\t\t * Add default posts and comments RSS feed links to head\n\t\t */\n\t\tadd_theme_support( 'automatic-feed-links' );\n\n\t\t/**\n\t\t * Add support for the Aside and Gallery Post Formats\n\t\t */\n\t\tadd_theme_support( 'post-formats', array( 'aside', 'image', 'link', 'quote', 'status' ) );\n\t\t\n\t\t/**\n\t\t * There's a menu available at the top of the page under the masthead.\n\t\t */\n\t\tregister_nav_menu( 'primary', __( 'Primary Menu', 'clean-and-sober' ) );\n\t\t\n\t\tadd_theme_support( 'infinite-scroll', array(\n\t\t\t'container' => 'posts-container',\n\t\t\t'wrapper' => false,\n\t\t\t'posts_per_page' => 8,\n\t\t\t'render' => 'clean_and_sober_infinite_scroll_render'\n\t\t) );\n\t}", "public function includes() {\n\n\t\t\tinclude_once $this->includes_path() . 'class-cyprus-images.php';\n\t\t\tinclude_once $this->includes_path() . 'extensions/menu/class-cyprus-menu-manager.php';\n\t\t\tinclude_once $this->includes_path() . 'class-cyprus-sidebars.php';\n\t\t\tinclude_once $this->includes_path() . 'contact-form.php';\n\n\t\t\t// Widgets.\n\t\t\tinclude_once $this->includes_path() . 'widgets/widget-aboutme.php';\n\t\t\tinclude_once $this->includes_path() . 'widgets/widget-adcode.php';\n\t\t\tinclude_once $this->includes_path() . 'widgets/widget-ad125.php';\n\t\t\tinclude_once $this->includes_path() . 'widgets/widget-ad300.php';\n\t\t\tinclude_once $this->includes_path() . 'widgets/widget-tweets.php';\n\t\t\tinclude_once $this->includes_path() . 'widgets/widget-instagram.php';\n\t\t\tinclude_once $this->includes_path() . 'widgets/widget-recentposts.php';\n\t\t\tinclude_once $this->includes_path() . 'widgets/widget-relatedposts.php';\n\t\t\tinclude_once $this->includes_path() . 'widgets/widget-authorposts.php';\n\t\t\tinclude_once $this->includes_path() . 'widgets/widget-popular.php';\n\t\t\tinclude_once $this->includes_path() . 'widgets/widget-fblikebox.php';\n\t\t\tinclude_once $this->includes_path() . 'widgets/widget-social.php';\n\t\t\tinclude_once $this->includes_path() . 'widgets/widget-catposts.php';\n\t\t\tinclude_once $this->includes_path() . 'widgets/widget-postslider.php';\n\n\t\t\t// Load WooCommerce.\n\t\t\trequire_if_theme_supports( 'woocommerce', $this->includes_path() . 'vendors/woocommerce/woocommerce-init.php' );\n\t\t}", "public function includes() {\n\n\t\t\t/**\n\t\t\t * Functions used in frontend and admin\n\t\t\t */\n\t\t\tinclude_once( 'inc/wd-core-functions.php' );\n\n\t\t\tif ( $this->is_request( 'admin' ) ) {\n\t\t\t\tinclude_once( 'inc/admin/class-wd-admin.php' );\n\t\t\t}\n\n\t\t\tif ( $this->is_request( 'frontend' ) ) {\n\t\t\t\tinclude_once( 'inc/frontend/wd-functions.php' );\n\t\t\t\tinclude_once( 'inc/frontend/wd-template-hooks.php' );\n\t\t\t\tinclude_once( 'inc/frontend/class-wd-shortcode.php' );\n\t\t\t}\n\t\t}", "public static function activate() {\n\t\tif ( get_bloginfo('version') < 4.7 ) {\n\t\t\twp_die( 'Vaasco Blogcast requires Wordpress 4.7 or greater. Your current version is ' . get_bloginfo('version') );\n\t\t}\n\n\t\tif ( !get_option('permalink_structure') ) { \n\t\t\twp_die( 'Vaasco Blogcast requires permalinks to be enabled. Please enable them in Settings > Permalinks' ); \n\t\t}\n\t}", "public static function initialize() {\n\t\t\n\t\tif (!defined('ONXSHOP_PROJECT_DIR_WP')) {\n\t\t\t\n\t\t\t//self::installationHint();\n\t\t\treturn false;\n\t\t\t\n\t\t}\n\n\t\t//turn on output buffering\n\t\t//add_action('init', 'ob_start');\n\t\t//add_action('wp_footer', 'ob_end_flush');\n\n\t\tadd_shortcode( 'onxshop', array('OnxshopWordpress', 'processShortcode') );\n\t\tadd_action('init', array('OnxshopWordpress', 'initOnxshop'));\n\t\t\n\t}" ]
[ "0.70761746", "0.69151217", "0.66175145", "0.65658575", "0.65631884", "0.65502244", "0.6449238", "0.6425618", "0.63853234", "0.63566065", "0.634292", "0.6331627", "0.62645024", "0.6256334", "0.62543124", "0.62272346", "0.6209483", "0.6196697", "0.61907", "0.6190501", "0.6145439", "0.61274624", "0.61156315", "0.6101899", "0.60997665", "0.609154", "0.6071166", "0.60710675", "0.6045109", "0.6039355", "0.60335255", "0.60269696", "0.6017271", "0.60022056", "0.59981024", "0.59952354", "0.5982952", "0.598231", "0.5977994", "0.5970935", "0.5966285", "0.59661734", "0.59526473", "0.5948764", "0.5939516", "0.5920545", "0.59080327", "0.5903967", "0.58915216", "0.58902174", "0.5888968", "0.58832663", "0.58827597", "0.58790904", "0.5876917", "0.5871061", "0.58707565", "0.58668983", "0.58621854", "0.5859223", "0.5855461", "0.5851686", "0.58496666", "0.58482635", "0.5848091", "0.5841528", "0.584048", "0.58363324", "0.5834929", "0.5833826", "0.58331084", "0.5828119", "0.582752", "0.582695", "0.58228505", "0.5822373", "0.58146954", "0.580464", "0.58046305", "0.5804417", "0.5791074", "0.57890445", "0.5788092", "0.57879037", "0.5785366", "0.5779564", "0.577834", "0.5773245", "0.5772095", "0.5771488", "0.5771368", "0.5770227", "0.57687557", "0.57596976", "0.5756852", "0.57530946", "0.5751382", "0.57481205", "0.5745741", "0.5743811", "0.5740478" ]
0.0
-1
Templating constants that you can override before WP Framework is loaded.
function wpf_templating_constants() { // Sets a unique ID for the theme. if ( !defined( 'THEME_ID' ) ) define( 'THEME_ID', 'wpf_' . get_template() ); // Sets the default theme options db name if ( !defined( 'THEME_OPTIONS' ) ) define( 'THEME_OPTIONS', 'theme_options' ); // Sets relative paths for the default directories/paths if ( !defined( 'THEME_LIBRARY' ) ) define( 'THEME_LIBRARY', '/library' ); if ( !defined( 'THEME_I18N' ) ) define( 'THEME_I18N', THEME_LIBRARY . '/languages' ); if ( !defined( 'THEME_FUNC' ) ) define( 'THEME_FUNC', THEME_LIBRARY . '/functions' ); if ( !defined( 'THEME_IMG' ) ) define( 'THEME_IMG', THEME_LIBRARY . '/images' ); if ( !defined( 'THEME_CSS' ) ) define( 'THEME_CSS', THEME_LIBRARY . '/css' ); if ( !defined( 'THEME_JS' ) ) define( 'THEME_JS', THEME_LIBRARY . '/js' ); // Sets the default custom header image if ( !defined( 'DEFAULT_HEADER_IMAGE' ) ) define( 'DEFAULT_HEADER_IMAGE', get_theme_part( THEME_IMG . '/custom-header.gif' ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wp_templating_constants()\n {\n }", "function wp_initial_constants()\n {\n }", "function wpf_initial_constants() {\t\n\t// Sets the File path to the current parent theme's directory.\n\tdefine( 'PARENT_THEME_DIR', TEMPLATEPATH );\n\n\t// Sets the URI path to the current parent theme's directory.\n\tdefine( 'PARENT_THEME_URI', get_template_directory_uri() );\n\n\t// Sets the File path to the current parent theme's directory.\n\tdefine( 'CHILD_THEME_DIR', STYLESHEETPATH );\n\n\t// Sets the URI path to the current child theme's directory.\n\tdefine( 'CHILD_THEME_URI', get_stylesheet_directory_uri() );\n\n\t// Sets the file path to WP Framework\n\tdefine( 'WPF_DIR', PARENT_THEME_DIR . '/framework' );\n\n\t// Sets the URI path to WP Framework\n\tdefine( 'WPF_URI', PARENT_THEME_URI . '/framework' );\n\n\t// Sets the file path to extensions\n\tdefine( 'WPF_EXT_DIR', WPF_DIR . '/extensions' );\n\n\t// Sets the URI path to extensions\n\tdefine( 'WPF_EXT_URI', WPF_URI . '/extensions' );\n}", "public function constants() {\n\n\t\t// Theme version\n\t\tdefine( 'WPEX_THEME_VERSION', '2.0.2' );\n\n\t\t// Paths to the parent theme directory\n\t\tdefine( 'WPEX_THEME_DIR', get_template_directory() );\n\t\tdefine( 'WPEX_THEME_URI', get_template_directory_uri() );\n\n\t\t// Javascript and CSS Paths\n\t\tdefine( 'WPEX_JS_DIR_URI', WPEX_THEME_URI .'/js/' );\n\t\tdefine( 'WPEX_CSS_DIR_URI', WPEX_THEME_URI .'/css/' );\n\n\t\t// Skins Paths\n\t\tdefine( 'WPEX_SKIN_DIR', WPEX_THEME_DIR .'/skins/' );\n\t\tdefine( 'WPEX_SKIN_DIR_URI', WPEX_THEME_URI .'/skins/' );\n\n\t\t// Framework Paths\n\t\tdefine( 'WPEX_FRAMEWORK_DIR', WPEX_THEME_DIR .'/framework/' );\n\t\tdefine( 'WPEX_FRAMEWORK_DIR_URI', WPEX_THEME_URI .'/framework/' );\n\t\tdefine( 'WPEX_ClASSES', WPEX_FRAMEWORK_DIR .'/classes/' );\n\n\t\t// Classes directory\n\t\tdefine( 'WPEX_ClASSES_DIR', WPEX_FRAMEWORK_DIR .'/classes/' );\n\n\t\t// Admin Panel Hook\n\t\tdefine( 'WPEX_ADMIN_PANEL_HOOK_PREFIX', 'theme-panel_page_' );\n\n\t\t// Check if plugins are active\n\t\tdefine( 'WPEX_VC_ACTIVE', class_exists( 'Vc_Manager' ) );\n\t\tdefine( 'WPEX_BBPRESS_ACTIVE', class_exists( 'bbPress' ) );\n\t\tdefine( 'WPEX_WOOCOMMERCE_ACTIVE', class_exists( 'WooCommerce' ) );\n\t\tdefine( 'WPEX_REV_SLIDER_ACTIVE', class_exists( 'RevSlider' ) );\n\t\tdefine( 'WPEX_LAYERSLIDER_ACTIVE', function_exists( 'lsSliders' ) );\n\t\tdefine( 'WPEX_WPML_ACTIVE', class_exists( 'SitePress' ) );\n\t\tdefine( 'WPEX_TRIBE_EVENTS_CALENDAR_ACTIVE', class_exists( 'TribeEvents' ) );\n\n\t\t// Active post types\n\t\tdefine( 'WPEX_PORTFOLIO_IS_ACTIVE', get_theme_mod( 'portfolio_enable', true ) );\n\t\tdefine( 'WPEX_STAFF_IS_ACTIVE', get_theme_mod( 'staff_enable', true ) );\n\t\tdefine( 'WPEX_TESTIMONIALS_IS_ACTIVE', get_theme_mod( 'testimonials_enable', true ) );\n\n\t\t// Define branding constant based on theme options\n\t\tdefine( 'WPEX_THEME_BRANDING', get_theme_mod( 'theme_branding', 'Total' ) );\n\n\t\t// Visual Composer\n\t\tdefine( 'WPEX_VCEX_DIR', WPEX_FRAMEWORK_DIR .'visual-composer/extend/' );\n\t\tdefine( 'WPEX_VCEX_DIR_URI', WPEX_FRAMEWORK_DIR_URI .'visual-composer/extend/' );\n\n\t}", "public function defined_constant() {\n define( 'TS_VERSION', self::version );\n define( 'TS_FILE', __FILE__ );\n define( 'TS_PATH', __DIR__ );\n define( 'TS_URL', plugins_url( '', TS_FILE ) );\n define( 'TS_ASSETS', TS_URL .'/assets' );\n }", "function wp_functionality_constants()\n {\n }", "public function constants() {\n\n /* Sets the framework version number. */\n define( 'DF_VERSION', '2.2.0' );\n\n /* Sets the path to the parent theme directory. */\n define( 'THEME_DIR', get_template_directory() );\n\n /* Sets the path to the parent theme directory URI. */\n define( 'THEME_URI', get_template_directory_uri() );\n\n /* Sets the path to the child theme directory. */\n define( 'CHILD_THEME_DIR', get_stylesheet_directory());\n\n /* Sets the path to the child theme directory URI. */\n define( 'CHILD_THEME_URI', get_stylesheet_directory_uri() );\n\n /* Sets the path to the core framework directory. */\n define( 'DF_CORE_DIR', trailingslashit( trailingslashit( get_template_directory() ) . 'dahz' ) );\n\n /* Sets the path to the core framework directory URI. */\n define( 'DF_CORE_URI', trailingslashit( trailingslashit( get_template_directory_uri() ) . 'dahz' ) );\n\n define( 'DF_CUSTOMIZER_CONTROL_DIR', trailingslashit( trailingslashit( DF_CORE_DIR ) . 'customizer' ));\n\n /* Sets the path to the core framework extensions directory. */\n define( 'DF_EXTENSION_DIR', trailingslashit( trailingslashit( DF_CORE_DIR ) . 'extensions' ));\n\n /* Sets the path to the core framework functions directory. */\n define( 'DF_FUNCTION_DIR', trailingslashit( trailingslashit( DF_CORE_DIR ) . 'functions' ));\n\n /* Sets the path to the core framework CSS directory URI. */\n define( 'DF_CORE_CSS_DIR', trailingslashit( trailingslashit( DF_CORE_URI ) . 'css' ));\n\n /* Sets the path to the core framework JavaScript directory URI. */\n define( 'DF_CORE_JS_DIR', trailingslashit( trailingslashit( DF_CORE_URI ) . 'js' ));\n\n /* Sets the path to the core framework images directory URI. */\n define( 'DF_CORE_IMG_DIR', trailingslashit( trailingslashit( DF_CORE_URI ) . 'images' ));\n\n }", "function constants() {\r\n\r\n\t\t\t/**\r\n\t\t\t * Set constant name for the post type name.\r\n\t\t\t *\r\n\t\t\t * @since 1.0.0\r\n\t\t\t */\r\n\t\t\tdefine( 'RV_PORTFOLIO_NAME', 'rv-portfolio' );\r\n\r\n\t\t\t/**\r\n\t\t\t * Set the slug of the plugin.\r\n\t\t\t *\r\n\t\t\t * @since 1.0.0\r\n\t\t\t */\r\n\t\t\tdefine( 'RV_PORTFOLIO_SLUG', basename( dirname( __FILE__ ) ) );\r\n\r\n\t\t\t/**\r\n\t\t\t * Set the name for the 'meta_key' value in the 'wp_postmeta' table.\r\n\t\t\t *\r\n\t\t\t * @since 1.0.0\r\n\t\t\t */\r\n\t\t\tdefine( 'RV_PORTFOLIO_POSTMETA', 'rv_portfolio' );\r\n\r\n\t\t\t/**\r\n\t\t\t * Set constant path to the plugin directory.\r\n\t\t\t *\r\n\t\t\t * @since 1.0.0\r\n\t\t\t */\r\n\t\t\tdefine( 'RV_PORTFOLIO_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );\r\n\r\n\t\t\t/**\r\n\t\t\t * Set constant path to the plugin URI.\r\n\t\t\t *\r\n\t\t\t * @since 1.0.0\r\n\t\t\t */\r\n\t\t\tdefine( 'RV_PORTFOLIO_URI', trailingslashit( plugin_dir_url( __FILE__ ) ) );\r\n\r\n\t\t\t/**\r\n\t\t\t * Set constant DB option field.\r\n\t\t\t *\r\n\t\t\t * @since 1.0.0\r\n\t\t\t */\r\n\t\t\tdefine( 'RV_PORTFOLIO_OPTIONS_NAME', 'rv_portfolio_options' );\r\n\r\n\t\t}", "function defineConstants() {\n define('Terminus', true);\n $default_constants = Yaml::parse(\n file_get_contents(TERMINUS_ROOT . '/config/constants.yml')\n );\n foreach ($default_constants as $var_name => $default) {\n if (isset($_SERVER[$var_name]) && ($_SERVER[$var_name] != '')) {\n define($var_name, $_SERVER[$var_name]);\n } else if (!defined($var_name)) {\n define($var_name, $default);\n }\n }\n date_default_timezone_set(TERMINUS_TIME_ZONE);\n\n if (!defined('TERMINUS_SCRIPT')) {\n define('TERMINUS_SCRIPT', 'php/Terminus.php');\n }\n}", "function init_constants() {\n\t$plugin_url = plugin_dir_url( __FILE__ );\n\n\tif ( is_ssl() ) {\n\t\t$plugin_url = str_replace( 'http://', 'https://', $plugin_url );\n\t}\n\n\tdefine( 'METRO_CORE_URL', $plugin_url );\n\tdefine( 'METRO_CORE_DIR', plugin_dir_path( __FILE__ ) );\n\tdefine( 'METRO_CORE_TEXT_DOMAIN', 'metro_core' );\n}", "public function define_constants() {\n define( 'JWP_PE_VERSION', self::version );\n define( 'JWP_PE_FILE', __FILE__ );\n define( 'JWP_PE_PATH', __DIR__ );\n define( 'JWP_PE_URL', plugins_url( '', JWP_PE_FILE ) );\n define( 'JWP_PE_ASSETS', JWP_PE_URL . '/assets' );\n }", "private function consts()\n\t{\n\t\tif (!defined('WP_PARSI_ROOT'))\n\t\t\tdefine('WP_PARSI_ROOT', __FILE__);\n\n\t\tif (!defined('WP_PARSI_DIR'))\n\t\t\tdefine('WP_PARSI_DIR', plugin_dir_path(WP_PARSI_ROOT));\n\n\t\tif (!defined('WP_PARSI_URL'))\n\t\t\tdefine('WP_PARSI_URL', plugin_dir_url(WP_PARSI_ROOT));\n\n\t\tif (!defined('WP_PARSI_VER'))\n\t\t\tdefine('WP_PARSI_VER', '2.2');\n\t}", "static function get_settings(){\n\t\t\t\treturn array(\t\n\t\t\t\t\t'icon' => GDLR_CORE_URL . '/framework/images/page-builder/nav-template.png', \n\t\t\t\t\t'title' => esc_html__('Templates', 'goodlayers-core')\n\t\t\t\t);\n\t\t\t}", "protected function _define_constants() {\n\t\t\tdefine( 'LP_ADDON_STRIPE_ADVANCED_PAYMENT_PATH', dirname( LP_ADDON_STRIPE_ADVANCED_PAYMENT_FILE ) );\n\t\t\tdefine( 'LP_ADDON_STRIPE_ADVANCED_PAYMENT_INC', LP_ADDON_STRIPE_ADVANCED_PAYMENT_PATH . '/inc/' );\n\t\t\tdefine( 'LP_ADDON_STRIPE_ADVANCED_PAYMENT_URL', plugin_dir_url( LP_ADDON_STRIPE_ADVANCED_PAYMENT_FILE ) );\n\t\t\tdefine( 'LP_ADDON_STRIPE_ADVANCED_PAYMENT_TEMPLATE', LP_ADDON_STRIPE_ADVANCED_PAYMENT_PATH . '/templates/' );\n\t\t}", "public function constants() {\n\n\t\t\t/**\n\t\t\t * Set the version number of the plugin.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t */\n\t\t\tdefine( 'CHERRY_SITE_SHORTCODES_VERSION', '1.0.0' );\n\n\t\t\t/**\n\t\t\t * Set constant path to the plugin directory.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t */\n\t\t\tdefine( 'CHERRY_SITE_SHORTCODES_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );\n\n\t\t\t/**\n\t\t\t * Set constant path to the plugin URI.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t */\n\t\t\tdefine( 'CHERRY_SITE_SHORTCODES_URI', trailingslashit( plugin_dir_url( __FILE__ ) ) );\n\t\t}", "private function define_constants() {\n\t\tdefine( 'WPRMPRC_POST_TYPE', 'wprm_collection' );\n\t\tdefine( 'WPRMPRC_DIR', plugin_dir_path( dirname( __FILE__ ) ) );\n\t\tdefine( 'WPRMPRC_URL', plugin_dir_url( dirname( __FILE__ ) ) );\n\t}", "public static function get_template_global_variables()\n {\n return [\n 'FoxyStripe' => 'current_foxystripe_setting',\n ];\n }", "public function wpl_toolskit_define_constants() {\n\n\t\tdefine( 'WPL_TOOLSKIT_NAME', \"Medical ToolsKit\" );\n\n\t\tdefine( 'WPL_TOOLSKIT_VERSION', \"1.0.0\" );\n\n\t\tdefine( 'WPL_TOOLSKIT_SLUG', \"wpl_toolskit_\" );\n\n\t\tdefine( 'WPL_TOOLSKIT_SLUG_SHORT', \"wpl_\" );\n\t\t\n\t\t/* Set constant URI */\n\t\tdefine( 'WPL_TOOLSKIT_URI', trailingslashit( plugin_dir_url( __FILE__ ) ) );\n\n\t\t/* Set constant path to the plugin directory. */\n\t\tdefine( 'WPL_TOOLSKIT_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );\n\n\t\t// Call custom post types\n\t\tdefine( 'WPL_TOOLSKIT_DOCTOR', true) ;\n\t\tdefine( 'WPL_TOOLSKIT_DEPARTMENTS', true );\n\t\tdefine( 'WPL_TOOLSKIT_TESTIMONIAL', true );\n\t\tdefine( 'WPL_TOOLSKIT_SLIDER', true );\n\t\tdefine( 'WPL_TOOLSKIT_SERVICES', true );\n\t}", "function hook_template_footer() {\r\n\t\tglobal $site;\r\n\t\t$site->addScriptVar('constants', array(\r\n\t\t\t'siteUrl' => $site->urlTo('/'),\r\n\t\t\t'slug' => json_encode( $site->getSlugs() )\r\n\t\t));\r\n\t}", "function my_page_templates_function()\r\n{\t\r\n\tinclude(TEMPL_MONETIZE_FOLDER_PATH.'templatic-generalization/general_settings.php');\r\n\t\r\n}", "protected function _define_constants() {\r\n\t\t\tdefine( 'LP_ADDON_PAYIR_PAYMENT_PATH', dirname( LP_ADDON_PAYIR_PAYMENT_FILE ) );\r\n\t\t\tdefine( 'LP_ADDON_PAYIR_PAYMENT_INC', LP_ADDON_PAYIR_PAYMENT_PATH . '/inc/' );\r\n\t\t\tdefine( 'LP_ADDON_PAYIR_PAYMENT_URL', plugin_dir_url( LP_ADDON_PAYIR_PAYMENT_FILE ) );\r\n\t\t\tdefine( 'LP_ADDON_PAYIR_PAYMENT_TEMPLATE', LP_ADDON_PAYIR_PAYMENT_PATH . '/templates/' );\r\n\t\t}", "function tidyt_configured(){\n if( !defined('WP_TEMPLATE_DIRECTORY') )\n exit('<h1>WP_TEMPLATE_DIRECTORY was not defined.</h1> Add it to your wp-config.php file!');\n}", "public function define_constants() {\n define( 'WD_NOTIF_VERSION', self::VERSION );\n define( 'WD_NOTIF_FILE', __FILE__ );\n define( 'WD_NOTIF_PATH', __DIR__ );\n define( 'WD_NOTIF_URL', plugins_url( '', WD_NOTIF_FILE ) );\n define( 'WD_NOTIF_ASSETS', WD_NOTIF_URL . '/assets' );\n }", "function ae_template_type( ) {\n\n\t$tmpl = get_site_option( 'ae-appearance' );\n\n\t$tmpl = ( !empty($tmpl) && $tmpl == 1 ) ? 1 : 0;\n\n\tif ( !defined('AE_TMPL') ) define( 'AE_TMPL', $tmpl );\n}", "function rhd_init() {\n\t// Constants\n\tdefine( \"RHD_THEME_DIR\", get_template_directory_uri() );\n\tdefine( \"RHD_IMG_DIR\", get_template_directory_uri() . '/img' );\n}", "static function init(){\n\t\t\t\tadd_action('wp_ajax_gdlr_core_get_pb_template', 'gdlr_core_page_builder_template::get_template');\n\t\t\t}", "public function setup_constants() {\n\t\tself::$DIR = plugin_dir_path( __FILE__ );\n\t\tself::$URL = plugins_url( '/', __FILE__ );\n\t\tself::$FILE = __FILE__;\n\t}", "function set_defines(){\n /*\n * Define Base Paths to the plugin file\n */\n define( 'HSS_HTTP_PATH' , WP_PLUGIN_URL . '/' . str_replace(basename( __FILE__) , \"\" , plugin_basename(__FILE__) ) );\n define( 'PLUGIN_ABSPATH' , WP_PLUGIN_DIR . '/' . str_replace(basename( __FILE__) , \"\" , plugin_basename(__FILE__) ) );\n }", "public function constants(){\n\n\t\tdefine( 'NEXCESS_AUTOMATEWOO_TRIGGERS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );\n\n\t}", "function sunrise_theme_settings_page()\n {\n require_once(get_template_directory().'/inc/templates/sunrise-admin.php');\n }", "public function constants(){\n\t\tdefine( 'WPTT_ICS_FEED_FOLDER', dirname( __FILE__ ) );\n\t}", "protected function getStaticVariableHeader()\n {\n return '<p><p><b><u>' . __('Static Template variables:') . '</u></b>' . ' ' .\n __('their values are written in landing page attributes in the backend.') . ' ' .\n __('The values of randomizer feature will also be written in the attibutes.');\n }", "function wp_plugin_directory_constants()\n {\n }", "public function onTwigSiteVariables()\n {\n }", "protected function defineEnvironmentConstants()\n {\n /** Environment name for development. */\n define('ENVIRONMENT_DEV', 'dev');\n /** Environment name for development. */\n define('ENVIRONMENT_TEST', 'test');\n /** Environment name for staging. */\n define('ENVIRONMENT_STAGING', 'staging');\n /** Environment name for production. */\n define('ENVIRONMENT_PRODUCTION', 'production');\n }", "protected static function defineBaseConstants() {}", "protected function get_wp_environment()\n {\n }", "public static function get_template_global_variables()\n {\n return [\n 'TemplateConfig' => 'current_template_config',\n ];\n }", "static public function get_template_global_variables() {\n\t\treturn array\n\t\t(\n\t\t\t\"FacebookConnectURL\" => \"connect_url\",\n\t\t\t\"FacebookLoginURL\" => \"login_url\",\n\t\t\t\"FacebookDisconnectURL\" => \"disconnect_url\"\n\t\t);\n\t}", "protected function setTemplateVariables() {}", "function var_template_include( $t )\n{\n $GLOBALS['current_theme_template'] = basename($t);\n return $t;\n}", "function get_i18n_strings() {\n return [\n 'Results per row' => __( 'Results per row', 'fwp' ),\n 'Grid gap' => __( 'Grid gap', 'fwp' ),\n 'Text style' => __( 'Text style', 'fwp' ),\n 'Text color' => __( 'Text color', 'fwp' ),\n 'Font size' => __( 'Font size', 'fwp' ),\n 'Background color' => __( 'Background color', 'fwp' ),\n 'Border' => __( 'Border', 'fwp' ),\n 'Border style' => __( 'Border style', 'fwp' ),\n 'None' => __( 'None', 'fwp' ),\n 'Solid' => __( 'Solid', 'fwp' ),\n 'Dashed' => __( 'Dashed', 'fwp' ),\n 'Dotted' => __( 'Dotted', 'fwp' ),\n 'Double' => __( 'Double', 'fwp' ),\n 'Border color' => __( 'Border color', 'fwp' ),\n 'Border width' => __( 'Border width', 'fwp' ),\n 'Button text' => __( 'Button text', 'fwp' ),\n 'Button text color' => __( 'Button text color', 'fwp' ),\n 'Button padding' => __( 'Button padding', 'fwp' ),\n 'Separator' => __( 'Separator', 'fwp' ),\n 'Custom CSS' => __( 'Custom CSS', 'fwp' ),\n 'Column widths' => __( 'Column widths', 'fwp' ),\n 'Content' => __( 'Content', 'fwp' ),\n 'Image size' => __( 'Image size', 'fwp' ),\n 'Author field' => __( 'Author field', 'fwp' ),\n 'Display name' => __( 'Display name', 'fwp' ),\n 'User login' => __( 'User login', 'fwp' ),\n 'User ID' => __( 'User ID', 'fwp' ),\n 'Field type' => __( 'Field type', 'fwp' ),\n 'Text' => __( 'Text', 'fwp' ),\n 'Date' => __( 'Date', 'fwp' ),\n 'Number' => __( 'Number', 'fwp' ),\n 'Date format' => __( 'Date format', 'fwp' ),\n 'Input format' => __( 'Input format', 'fwp' ),\n 'Number format' => __( 'Number format', 'fwp' ),\n 'Link' => __( 'Link', 'fwp' ),\n 'Link type' => __( 'Link type', 'fwp' ),\n 'Post URL' => __( 'Post URL', 'fwp' ),\n 'Custom URL' => __( 'Custom URL', 'fwp' ),\n 'Open in new tab?' => __( 'Open in new tab?', 'fwp' ),\n 'Prefix' => __( 'Prefix', 'fwp' ),\n 'Suffix' => __( 'Suffix', 'fwp' ),\n 'Hide item?' => __( 'Hide item?', 'fwp' ),\n 'Padding' => __( 'Padding', 'fwp' ),\n 'Unique name' => __( 'Unique name', 'fwp' ),\n 'CSS class' => __( 'CSS class', 'fwp' ),\n 'Button Border' => __( 'Button border', 'fwp' ),\n 'Term URL' => __( 'Term URL', 'fwp' ),\n 'Fetch' => __( 'Fetch', 'fwp' ),\n 'All post types' => __( 'All post types', 'fwp' ),\n 'and show' => __( 'and show', 'fwp' ),\n 'per page' => __( 'per page', 'fwp' ),\n 'Sort by' => __( 'Sort by', 'fwp' ),\n 'Posts' => __( 'Posts', 'fwp' ),\n 'Post Title' => __( 'Post Title', 'fwp' ),\n 'Post Name' => __( 'Post Name', 'fwp' ),\n 'Post Type' => __( 'Post Type', 'fwp' ),\n 'Post Date' => __( 'Post Date', 'fwp' ),\n 'Post Modified' => __( 'Post Modified', 'fwp' ),\n 'Menu Order' => __( 'Menu Order', 'fwp' ),\n 'Custom Fields' => __( 'Custom Fields', 'fwp' ),\n 'Narrow results by' => __( 'Narrow results by', 'fwp' ),\n 'Hit Enter' => __( 'Hit Enter', 'fwp' ),\n 'Add sort' => __( 'Add sort', 'fwp' ),\n 'Add filter' => __( 'Add filter', 'fwp' ),\n 'Enter term slugs' => __( 'Enter term slugs', 'fwp' ),\n 'Enter values' => __( 'Enter values', 'fwp' ),\n 'Layout' => __( 'Layout', 'fwp' ),\n 'Content' => __( 'Content', 'fwp' ),\n 'Style' => __( 'Style', 'fwp' ),\n 'Advanced' => __( 'Advanced', 'fwp' ),\n 'Row' => __( 'Row', 'fwp' ),\n 'Column' => __( 'Column', 'fwp' ),\n 'Start typing' => __( 'Start typing', 'fwp' ),\n 'Label' => __( 'Label', 'fwp' ),\n 'Name' => __( 'Name', 'fwp' ),\n 'Facet type' => __( 'Facet type', 'fwp' ),\n 'Copy shortcode' => __( 'Copy shortcode', 'fwp' ),\n 'Data source' => __( 'Data source', 'fwp' ),\n 'Switch to advanced mode' => __( 'Switch to advanced mode', 'fwp' ),\n 'Switch to visual mode' => __( 'Switch to visual mode', 'fwp' ),\n 'Display' => __( 'Display', 'fwp' ),\n 'Query' => __( 'Query', 'fwp' ),\n 'Help' => __( 'Help', 'fwp' ),\n 'Display Code' => __( 'Display Code', 'fwp' ),\n 'Query Arguments' => __( 'Query Arguments', 'fwp' ),\n 'Saving' => __( 'Saving', 'fwp' ),\n 'Indexing' => __( 'Indexing', 'fwp' ),\n 'Indexing complete' => __( 'Indexing complete', 'fwp' ),\n 'Looking' => __( 'Looking', 'fwp' ),\n 'Purging' => __( 'Purging', 'fwp' ),\n 'Copied!' => __( 'Copied!', 'fwp' ),\n 'Press CTRL+C to copy' => __( 'Press CTRL+C to copy', 'fwp' ),\n 'Activating' => __( 'Activating', 'fwp' ),\n 'Re-index' => __( 'Re-index', 'fwp' ),\n 'Stop indexer' => __( 'Stop indexer', 'fwp' ),\n 'Loading' => __( 'Loading', 'fwp' ),\n 'Importing' => __( 'Importing', 'fwp' ),\n 'Convert to query args' => __( 'Convert to query args', 'fwp' )\n ];\n }", "private function _settings()\n\t{\n\t\tif(Utils::config('timestamps') or Utils::config('t'))\n\t\t\t$this->_timestamps = \"\\tpublic static \\$timestamps = true;\\n\\n\";\n\t}", "function wp_theme_auto_update_setting_template()\n {\n }", "function template_options()\n{\n\tglobal $context, $settings, $options, $scripturl, $txt;\n\n\t$context['theme_options'] = array(\n\t\tarray(\n\t\t\t'id' => 'show_board_desc',\n\t\t\t'label' => $txt['board_desc_inside'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'show_children',\n\t\t\t'label' => $txt['show_children'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'use_sidebar_menu',\n\t\t\t'label' => $txt['use_sidebar_menu'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'show_no_avatars',\n\t\t\t'label' => $txt['show_no_avatars'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'show_no_signatures',\n\t\t\t'label' => $txt['show_no_signatures'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'show_no_censored',\n\t\t\t'label' => $txt['show_no_censored'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'return_to_post',\n\t\t\t'label' => $txt['return_to_post'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'no_new_reply_warning',\n\t\t\t'label' => $txt['no_new_reply_warning'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'view_newest_first',\n\t\t\t'label' => $txt['recent_posts_at_top'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'view_newest_pm_first',\n\t\t\t'label' => $txt['recent_pms_at_top'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'posts_apply_ignore_list',\n\t\t\t'label' => $txt['posts_apply_ignore_list'],\n\t\t\t'default' => false,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'wysiwyg_default',\n\t\t\t'label' => $txt['wysiwyg_default'],\n\t\t\t'default' => false,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'popup_messages',\n\t\t\t'label' => $txt['popup_messages'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'copy_to_outbox',\n\t\t\t'label' => $txt['copy_to_outbox'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'pm_remove_inbox_label',\n\t\t\t'label' => $txt['pm_remove_inbox_label'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'auto_notify',\n\t\t\t'label' => $txt['auto_notify'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'topics_per_page',\n\t\t\t'label' => $txt['topics_per_page'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['per_page_default'],\n\t\t\t\t5 => 5,\n\t\t\t\t10 => 10,\n\t\t\t\t25 => 25,\n\t\t\t\t50 => 50,\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'messages_per_page',\n\t\t\t'label' => $txt['messages_per_page'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['per_page_default'],\n\t\t\t\t5 => 5,\n\t\t\t\t10 => 10,\n\t\t\t\t25 => 25,\n\t\t\t\t50 => 50,\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'calendar_start_day',\n\t\t\t'label' => $txt['calendar_start_day'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['days'][0],\n\t\t\t\t1 => $txt['days'][1],\n\t\t\t\t6 => $txt['days'][6],\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'display_quick_reply',\n\t\t\t'label' => $txt['display_quick_reply'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['display_quick_reply1'],\n\t\t\t\t1 => $txt['display_quick_reply2'],\n\t\t\t\t2 => $txt['display_quick_reply3']\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'display_quick_mod',\n\t\t\t'label' => $txt['display_quick_mod'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['display_quick_mod_none'],\n\t\t\t\t1 => $txt['display_quick_mod_check'],\n\t\t\t\t2 => $txt['display_quick_mod_image'],\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t);\n}", "function app_template_path() {\n return APP_Wrapping::$main_template;\n}", "function tb_string_swap_get_strings() {\n\t$locals = array (\n\t\t'404'\t\t\t\t\t\t=> 'Apologies, but the page you\\'re looking for can\\'t be found.',\n\t\t'404_title'\t\t\t\t\t=> '404 Error',\n\t\t'archive_no_posts'\t\t\t=> 'Apologies, but there are no posts to display.',\n\t\t'archive'\t\t\t\t\t=> 'Archive',\n\t\t'cancel_reply_link'\t\t\t=> 'Cancel reply',\n\t\t'categories'\t\t\t\t=> 'Categories',\n\t\t'category'\t\t\t\t\t=> 'Category',\n\t\t'comment_navigation'\t\t=> 'Comment navigation',\n\t\t'comments'\t\t\t\t\t=> 'Comments',\n\t\t'comments_closed'\t\t\t=> 'Comments are closed.',\n\t\t'comments_newer'\t\t\t=> 'Newer Comments &rarr;',\n\t\t'comments_no_password'\t\t=> 'This post is password protected. Enter the password to view any comments.',\n\t\t'comments_older'\t\t\t=> '&larr; Older Comments',\n\t\t'comments_title_single'\t\t=> 'One comment on &ldquo;%2$s&rdquo;',\n\t\t'comments_title_multiple'\t=> '%1$s comments on &ldquo;%2$s&rdquo;',\n\t\t'contact_us'\t\t\t\t=> 'Contact Us',\n\t\t'crumb_404'\t\t\t\t\t=> 'Error 404',\n\t\t'crumb_author'\t\t\t\t=> 'Articles posted by',\n\t\t'crumb_search'\t\t\t\t=> 'Search results for',\n\t\t'crumb_tag'\t\t\t\t\t=> 'Posts tagged',\n\t\t'edit_page'\t\t\t\t\t=> 'Edit Page',\n\t\t'email'\t\t\t\t\t\t=> 'Email',\n\t\t'home'\t\t\t\t\t\t=> 'Home',\n\t\t'invalid_layout'\t\t\t=> 'Invalid Layout ID',\n\t\t'label_submit'\t\t\t\t=> 'Post Comment',\n\t\t'last_30'\t\t\t\t\t=> 'The Last 30 Posts',\n\t\t'monthly_archives'\t\t\t=> 'Monthly Archives',\n\t\t'name'\t\t\t\t\t\t=> 'Name',\n\t\t'page'\t\t\t\t\t\t=> 'Page',\n\t\t'pages'\t\t\t\t\t\t=> 'Pages',\n\t\t'page_num'\t\t\t\t\t=> 'Page %s',\n\t\t'posts_per_category'\t\t=> 'Posts per category',\n\t\t'navigation' \t\t\t\t=> 'Navigation',\n\t\t'no_slider' \t\t\t\t=> 'Slider does not exist.',\n\t\t'no_slider_selected' \t\t=> 'Oops! You have not selected a slider in your layout.',\n\t\t'no_video'\t\t\t\t\t=> 'The video url could not retrieve a video.',\n\t\t'read_more'\t\t\t\t\t=> 'Read More',\n\t\t'search'\t\t\t\t\t=> 'Search the site...',\n\t\t'search_no_results'\t\t\t=> 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.',\n\t\t'tag'\t\t\t\t\t\t=> 'Tag',\n\t\t'title_reply'\t\t\t\t=> 'Leave a Reply',\n\t\t'title_reply_to'\t\t\t=> 'Leave a Reply to %s',\n\t\t'website'\t\t\t\t\t=> 'Website'\n\t);\n\treturn $locals;\n}", "public static function wpInit() {}", "function wpdev_make_constants() {\n \n define(\"BASE_PATH\",__DIR__);\n define(\"URL_SCHEME\",$_SERVER['REQUEST_SCHEME']);\n define(\"BASE_URL\",URL_SCHEME.'://'.$_SERVER['SERVER_NAME'].'/'.basename(BASE_PATH));\n define(\"ADMIN_URL\",BASE_URL.\"/admin\");\n define(\"ADMIN_PATH\",BASE_PATH.\"/admin\");\n \n }", "function csfg_override_shortcode_subscription_template( $paths ){\r\n $paths[49] = GIVE_RECURRING_CANCELLATION_DIR . '/templates';\r\n\r\n return $paths;\r\n}", "function prso_init_theme_post_types() {\n\t\n\t//Init vars\n\tglobal $prso_posttype_admin_icon;\n\t$file_path = plugin_dir_path( __FILE__ ) . \"theme-post-types\";\n\t\n\t$prso_posttype_admin_icon = get_stylesheet_directory_uri() . '/images/admin/custom_post_icon.png';\n\t\n\t//include_once( $file_path . '/cuztom-post-type_TEMPLATE.php' );\n\t\n}", "function gt_init() {\n add_theme_support('post-thumbnails');\n // title based on the page and General Settings\n add_theme_support('title-tag');\n // HTML support\n add_theme_support('html5', \n array('comment-list', 'comment-form', 'search-form'));\n}", "protected function defineConstants()\n {\n define('PATH_ROOT', dirname(__DIR__));\n }", "function _preview_theme_template_filter()\n {\n }", "final public function init(){\n\t\twp_register_style( 'tify-tinymce_template', self::tFyAppUrl() . '/theme.css', array(), '1.150317' );\n\t}", "public function init_globals() {\n\t\t\t$current_theme = wp_get_theme();\n\t\t\t$this->theme_name = strtolower( preg_replace( '#[^a-zA-Z]#', '', $current_theme->get( 'Name' ) ) );\n\t\t\t$this->envato_username = apply_filters( $this->theme_name . '_theme_setup_wizard_username', 'dfdevelopment' );\n\t\t\t$this->oauth_script = apply_filters( $this->theme_name . '_theme_setup_wizard_oauth_script', $this->custom_url.'/files/envato/wptoken/server-script.php' );\n\t\t\t$this->page_slug = apply_filters( $this->theme_name . '_theme_setup_wizard_page_slug', $this->theme_name . '-setup' );\n\t\t\t$this->parent_slug = apply_filters( $this->theme_name . '_theme_setup_wizard_parent_slug', '' );\n\n\t\t\t//If we have parent slug - set correct url\n\t\t\tif ( $this->parent_slug !== '' ) {\n\t\t\t\t$this->page_url = 'admin.php?page=' . $this->page_slug;\n\t\t\t} else {\n\t\t\t\t$this->page_url = 'themes.php?page=' . $this->page_slug;\n\t\t\t}\n\t\t\t$this->page_url = apply_filters( $this->theme_name . '_theme_setup_wizard_page_url', $this->page_url );\n\n\t\t\t//set relative plugin path url\n\t\t\t$this->plugin_url = trailingslashit( get_template_directory_uri() . '/inc/envato_setup' );\n\t\t}", "private function define_global_constants() {\n\t\tif ( !defined( 'PAULUS_APP_DIR' ) ) {\n\t\t\tdefine( 'PAULUS_APP_DIR', $this->app_base_path . DIRECTORY_SEPARATOR );\n\t\t}\n\t\tif ( !defined( 'PAULUS_EXTERNAL_LIB_DIR' ) ) {\n\t\t\tdefine( 'PAULUS_EXTERNAL_LIB_DIR', $this->app_base_path . '/../vendor' );\n\t\t}\n\t}", "function pre_load_settings_page() {\r\n\r\n //** Default Help items */\r\n $contextual_help['Main'][] = '<h3>' . __('Main', WPI) . '</h3>';\r\n $contextual_help['Main'][] = '<p>' . __('<b>Business Name</b><br /> Enter your business name here. This field defaults to the blog name you chose during WordPress installation.', WPI) . '</p>';\r\n $contextual_help['Main'][] = '<p>' . __('<b>Business Address</b><br /> Enter your business address here. It will appear on the invoices and quotes you send.', WPI) . '</p>';\r\n $contextual_help['Main'][] = '<p>' . __('<b>Business Phone</b><br /> Enter your business phone here. It will appear on the invoices and quotes you send.', WPI) . '</p>';\r\n $contextual_help['Main'][] = '<p>' . __('<b>Email Address</b><br /> Enter your email address here. It will appear on the invoices and quotes you send.', WPI) . '</p>';\r\n $contextual_help['Main'][] = '<p>' . __('<b>Display Styles</b><br /> Here you can set, enable or disable the WP-Invoice default style settings. Change the default values only if you are an advanced user who understands CSS styles and is able to create their own stylesheets. <a target=\"_blank\" href=\"https://usabilitydynamics.com/tutorials/wp-invoice/wp-invoice-settings-main/\">More...</a>', WPI) . '</p>';\r\n $contextual_help['Main'][] = '<p>' . __('<b>Tax Handling</b><br /> Here you can set when tax calculation is done (depends on your country\\'s fiscal system) and you can define a global default tax. <a target=\"_blank\" href=\"https://usabilitydynamics.com/tutorials/wp-invoice/wp-invoice-settings-main/\">More...</a>', WPI) . '</p>';\r\n $contextual_help['Main'][] = '<p>' . __('<b>Advanced Settings</b><br /> These settings control advanced features that have to do with billing, installation features, design issues and general actions for administrators and developers. <a target=\"_blank\" href=\"https://usabilitydynamics.com/tutorials/wp-invoice/wp-invoice-settings-main/\">More...</a>', WPI) . '</p>';\r\n\r\n $contextual_help['Business Process'][] = '<h3>' . __('Business Process', WPI) . '</h3>';\r\n $contextual_help['Business Process'][] = '<p>' . __('<b>When creating an invoice</b><br />Options for managing invoice creating process. <a target=\"_blank\" href=\"https://usabilitydynamics.com/tutorials/wp-invoice/wp-invoice-settings-business-process/\">More...</a>', WPI) . '</p>';\r\n $contextual_help['Business Process'][] = '<p>' . __('<b>When viewing an invoice</b><br />Options for managing invoice view. <a target=\"_blank\" href=\"https://usabilitydynamics.com/tutorials/wp-invoice/wp-invoice-settings-business-process/\">More...</a>', WPI) . '</p>';\r\n $contextual_help['Business Process'][] = '<p>' . __('<b>How to insert invoice</b><br />Here you have four choices that will define the way an invoice will appear on the invoice display page you have set before. <a target=\"_blank\" href=\"https://usabilitydynamics.com/tutorials/wp-invoice/wp-invoice-settings-business-process/\">More...</a>', WPI) . '</p>';\r\n $contextual_help['Business Process'][] = '<p>' . __('<b>After a payment has been completed</b><br />Here we have options that will create automatic email notifications on successful payment of an invoice (partial or complete). <a target=\"_blank\" href=\"https://usabilitydynamics.com/tutorials/wp-invoice/wp-invoice-settings-business-process/\">More...</a>', WPI) . '</p>';\r\n $contextual_help['Business Process'][] = '<p>' . __('<b>Mail From options</b><br />This options allow you to change the default email address that WordPress sends it\\'s mail from, and the name of the sender that the email is from.') . '</p>';\r\n $contextual_help['Business Process'][] = '<p>' . __('<b>Google Analytics Events Tracking</b><br />If you are using <a target=\"_blank\" href=\"http://code.google.com/intl/en/apis/analytics/docs/tracking/asyncTracking.html\">Google Analytics code snippet</a> for tracking site activity then you can do it better with WP-Invoice Event Tracking feature. Tick events you want to track in your Google Analytics account and see where/when/what people do. To view Events activity go to Content -> Events in your Google Analytics account.', WPI) . '</p>';\r\n $contextual_help['Business Process'][] = '<p>' . __('<u>Attempting to pay Invoices</u> - event is triggered on clicking \"Process Payment\" button on Invoice page.', WPI) . '</p>';\r\n $contextual_help['Business Process'][] = '<p>' . __('<u>View Invoices</u> - event is triggered when Invoice was viewed by the customer.', WPI) . '</p>';\r\n $contextual_help['Business Process'][] = '<p>' . __('<i>More Events soon!</i>', WPI) . '</p>';\r\n\r\n $contextual_help['Payment'][] = '<h3>' . __('Payment', WPI) . '</h3>';\r\n $contextual_help['Payment'][] = '<p>' . __('<b>Default Currency</b><br />Sets the default currency you will use in your invoices. Default value is U.S. Dollars.', WPI) . '</p>';\r\n $contextual_help['Payment'][] = '<p>' . __('<b>Currency list</b><br>This expandable area allows you to manage the list of currencies you have. You can add new currencies or remove existing ones.<br>Be aware, if you add a new currency please make sure that it corresponds to ISO 4217 and the currency code can be accepted by the payment services / gateways you are using. Here\\'s a <a href=\"http://en.wikipedia.org/wiki/List_of_circulating_currencies\">list of currencies</a> with ISO codes and currency symbols.<br>Note that you cannot delete a currency which has already been used in an existing invoice or that is currently selected as default. To do so, delete any invoices using that currency first.', WPI) . '</p>';\r\n\r\n $contextual_help['Payment'][] = '<p>' . __('<b>Default Payment Method</b><br />Here you can choose what default payment method you want to use for invoice payments.', WPI) . '</p>';\r\n $contextual_help['Payment'][] = '<p>' . __('<b>Payment Gateways</b><br />Here you can specify Gateways which you want to use for your invoices by default. <a target=\"_blank\" href=\"https://usabilitydynamics.com/tutorials/wp-invoice/wp-invoice-settings-payment/\">More...</a>', WPI) . '</p>';\r\n $contextual_help['Payment'][] = '<p>' . __('<b>Manual Payment Information</b><br />If you don\\'t want to use payment gateways but offline payments, or if an invoice has no payment gateways enabled, the text in this field will appear as a message to the customer, offering guidance on how to pay you. Write a short text with your bank account number or any other way you want to accept the offline payment. <a target=\"_blank\" href=\"https://usabilitydynamics.com/tutorials/wp-invoice/wp-invoice-settings-payment/\">More...</a>', WPI) . '</p>';\r\n\r\n $contextual_help['E-Mail Templates'][] = '<h3>' . __('E-Mail Templates', WPI) . '</h3>';\r\n $contextual_help['E-Mail Templates'][] = '<p>' . __('You can create as many e-mailed templates as needed, they can later be used to quickly create invoice notifications and reminders, and being sent directly from an invoice page. The following variables can be used within the Subject or the Content of the e-mail templates:', WPI) . '</p>';\r\n\r\n $email_vars['invoice_id'] = __('Invoice ID', WPI);\r\n $email_vars['link'] = __('URL of invoice', WPI);\r\n $email_vars['recipient'] = __('Name or business name of receipient', WPI);\r\n $email_vars['amount'] = __('Due BalanceID', WPI);\r\n $email_vars['subject'] = __('Invoice title', WPI);\r\n $email_vars['description'] = __('Description of Invoice', WPI);\r\n $email_vars['business_name'] = __('Business Name', WPI);\r\n $email_vars['business_email'] = __('Business Email Address', WPI);\r\n $email_vars['creator_name'] = __('Name of user who has created invoice', WPI);\r\n $email_vars['creator_email'] = __('Email of user who has created invoice', WPI);\r\n $email_vars['due_date'] = __('Invoice due date (if presented)', WPI);\r\n $email_vars['type'] = __('Replaced by Invoice Type. (invoice, recurring invoice, quote)', WPI);\r\n\r\n $email_vars = apply_filters('wpi_email_template_vars', $email_vars);\r\n\r\n if (is_array($email_vars)) {\r\n $contextual_help['E-Mail Templates'][] = '<ul>';\r\n foreach ($email_vars as $var => $title) {\r\n $contextual_help['E-Mail Templates'][] = '<li><b>%' . $var . '%</b> - ' . $title . '</li>';\r\n }\r\n $contextual_help['E-Mail Templates'][] = '</ul>';\r\n }\r\n\r\n $contextual_help['E-Mail Templates'][] = '<p><a href=\"https://usabilitydynamics.com/tutorials/wp-invoice/email-templates/\" target=\"_blank\">' . __('More...', WPI) . '</a></p>';\r\n\r\n $contextual_help['Line Items'][] = '<h3>' . __('Line Items', WPI) . '</h3>';\r\n $contextual_help['Line Items'][] = '<p>' . __('Predefined Line Items are common services and/or products that you can create once and use in your invoices. For example, if you are a Web professional and your usual invoice has at least an hour of Web Design or / and Web Development services, you can create these item entries to save yourself from typing it every time. When you create a new invoice or quote (with the Quotes Premium Feature), or edit an existing one, you will be able to select these items from a list and if you want, edit the name, description, quantity, price and tax. <a target=\"_blank\" href=\"https://usabilitydynamics.com/tutorials/wp-invoice/wp-invoice-settings-predefined-line-items/\">More...</a>', WPI) . '</p>';\r\n\r\n $contextual_help['Premium Features'][] = '<h3>' . __('Premium Features', WPI) . '</h3>';\r\n $contextual_help['Premium Features'][] = '<p>' . __('This tab show a list of the premium features which are available for purchase and those which you have purchased for WP-Invoice. You can see a list of features available for purchase in the WP-Invoice Premium Features section of our website. <a target=\"_blank\" href=\"https://usabilitydynamics.com/tutorials/wp-invoice/wp-invoice-settings-premium-features/\">More...</a>', WPI) . '</p>';\r\n\r\n $contextual_help['Help'][] = '<h3>' . __('Help', WPI) . '</h3>';\r\n $contextual_help['Help'][] = '<p>' . __('This tab will help you troubleshoot your plugin and check for updates for Premium Features', WPI) . '</p>';\r\n\r\n $contextual_help['Shortcodes'][] = '<h3>' . __('Shortcodes', WPI) . '</h3>';\r\n $contextual_help['Shortcodes'][] = '<p><b>' . __('Invoice History', WPI) . '</b></p>';\r\n $contextual_help['Shortcodes'][] = '<p>' . __('Shortcode:', WPI) . ' <code>[wp-invoice-history title=\"Your Title\"]</code></p>';\r\n $contextual_help['Shortcodes'][] = '<p>' . __(\"Works the same way as 'Invoice History' widget. Shows invoice list for currently logged in users.\", WPI) . '</p>';\r\n\r\n $contextual_help['Shortcodes'][] = '<p><b>' . __('Invoice Lookup', WPI) . '</b></p>';\r\n $contextual_help['Shortcodes'][] = '<p>' . __('Shortcode:', WPI) . ' <code>[wp-invoice-lookup message=\"Your Message\" button=\"Your Button\"]</code></p>';\r\n $contextual_help['Shortcodes'][] = '<p>' . __(\"Works the same way as 'Invoice Lookup' widget. Allows you to search your invoices by invoice numbers.\", WPI) . '</p>';\r\n //** Hook this action is you want to add info */\r\n $contextual_help = apply_filters('wpi_settings_page_help', $contextual_help);\r\n\r\n do_action('wpi_contextual_help', array('contextual_help' => $contextual_help));\r\n }", "public function include_template_functions() {\n\n\t}", "function customize_themes_print_templates()\n {\n }", "private function setup_globals() {\r\n\t\t/** Versions **********************************************************/\r\n\r\n\t\t$this->version = '0.3-alpha';\r\n\t\t$this->db_version = '1';\r\n\r\n\t\t/** Paths *************************************************************/\r\n\r\n\t\t$this->file = __FILE__;\r\n\t\t$this->basename = apply_filters( 'atcf_plugin_basenname', plugin_basename( $this->file ) );\r\n\t\t$this->plugin_dir = apply_filters( 'atcf_plugin_dir_path', plugin_dir_path( $this->file ) );\r\n\t\t$this->plugin_url = apply_filters( 'atcf_plugin_dir_url', plugin_dir_url ( $this->file ) );\r\n\r\n\t\t$this->template_url = apply_filters( 'atcf_plugin_template_url', 'crowdfunding/' );\r\n\r\n\t\t// Includes\r\n\t\t$this->includes_dir = apply_filters( 'atcf_includes_dir', trailingslashit( $this->plugin_dir . 'includes' ) );\r\n\t\t$this->includes_url = apply_filters( 'atcf_includes_url', trailingslashit( $this->plugin_url . 'includes' ) );\r\n\r\n\t\t// Languages\r\n\t\t$this->lang_dir = apply_filters( 'atcf_lang_dir', trailingslashit( $this->plugin_dir . 'languages' ) );\r\n\r\n\t\t/** Misc **************************************************************/\r\n\r\n\t\t$this->domain = 'atcf'; \r\n\t}", "function shell_theme_context_setup() {\r\n\r\n\t/* Additional Body class */\r\n\tadd_filter( 'body_class','shell_body_class');\r\n\r\n\t/* Additional css classes for widgets */\r\n\tadd_filter( 'dynamic_sidebar_params', 'shell_widget_classes' );\r\n\r\n\t/* Hybrid Core Context */\r\n\tadd_filter( 'hybrid_context', 'shell_hybrid_context' );\r\n\r\n\t/* Atomic Widget Plugin Context */\r\n\tadd_filter( 'atomic_widget_context', 'shell_atomic_widgets_context' );\r\n\r\n\t/* Post format singular template */\r\n\tadd_filter( 'single_template', 'shell_post_format_singular_template', 11 );\r\n}", "public function include_template_functions() {\n\t\t\tinclude_once( 'inc/frontend/wd-template-functions.php' );\n\t\t}", "public function page_templates()\n {\n // Single Chiro Quiz page template\n if (is_single() && get_post_type() == $this->token) {\n if (!defined('PLATFORM_FUNNEL')) {\n define('PLATFORM_FUNNEL', 'CHIRO_QUIZ');\n }\n\n include($this->template_path . 'single-quiz.php');\n exit;\n }\n }", "function tsc_theme_options() {\n\tadd_theme_page( 'Theme Options', 'Theme Options', 'edit_theme_options', 'theme_options', 'tsc_theme_options_page' );\n}", "public function __construct() {\n\t\t\t$branding = wpex_get_theme_branding();\n\t\t\t$branding = $branding ? $branding . ' - ' : '';\n\t\t\tparent::__construct(\n\t\t\t\t'wpex_templatera',\n\t\t\t\t$branding . __( 'Templatera', 'total' ),\n\t\t\t\tarray(\n\t\t\t\t\t'customize_selective_refresh' => true,\n\t\t\t\t)\n\t\t\t);\n\t\t}", "protected function defineAdditionalEntryPointRelatedConstants() {}", "public function onTwigSiteVariables()\n\t{\n\t\trequire_once __DIR__ . '/classes/datetools.php';\n\n\t\t$args = [];\n\t\t$args['config'] = $this->grav['config'];\n\n\t\t$twig = $this->grav['twig'];\n\t\t$twig->twig_vars['datetools'] = new DateTools($args);\n\t\t//$twig->twig->addGlobal('datetools', new DateTools($args));\n\t}", "function wp_cookie_constants()\n {\n }", "function __init__(){\n\tadd_theme_support('menus');\n\tadd_theme_support('post-thumbnails');\n\tadd_theme_support( 'title-tag' );\n\tadd_image_size('homepage', 620);\n\tadd_image_size('homepage-secondary', 540);\n\tadd_image_size('centerpiece-image', 940, 338, true); \t// Crops!\n\tadd_image_size('home-thumb', 110, 110);\n\tadd_image_size('subpage-subimg', 160);\n\tadd_image_size('subpage-studentimg', 115, 280);\n\tregister_nav_menu('header-menu', __('Header Menu'));\n\tregister_nav_menu('ucf-colleges', __('UCF Colleges'));\n\tregister_nav_menu('footer-menu', __('Footer Menu'));\n\tregister_nav_menu('social-links', __('Social Links'));\n\tregister_sidebar(array(\n\t\t'name' => __('Left Sidebar'),\n\t\t'id' => 'sidebar-left',\n\t\t'description' => 'Left-hand Sidebar found on subpages.',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t));\n\tregister_sidebar(array(\n\t\t'name' => __('Right Sidebar'),\n\t\t'id' => 'sidebar-right',\n\t\t'description' => 'Right-hand Sidebar found on subpages.',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t));\n\tforeach(Config::$styles as $style){Config::add_css($style);}\n\tforeach(Config::$scripts as $script){Config::add_script($script);}\n\n\tglobal $timer;\n\t$timer = Timer::start();\n\n\twp_deregister_script('l10n');\n\tset_defaults_for_options();\n}", "protected function defineLegacyConstants() {}", "protected function defineLegacyConstants() {}", "protected function defineLegacyConstants() {}", "function kcsite_theme_setup() {\n\tglobal $staticVars;\n\t$siteurl = get_bloginfo('siteurl');\n\n\t$calendarOptions = get_option('tribe_events_calendar_options');\n\t$calendarSlug = $calendarOptions['eventsSlug'];\n\n\n\tif(pll_current_language('slug') == 'en'){\n\t\t$staticVars = array(\n\t\t\t'siteUrl' => $siteurl,\n\t\t\t'sitetreeUrl' => get_permalink(804),\n\t\t\t// 'eventsUrl' => get_permalink(397),\n\t\t\t'eventsUrl' => $siteurl.'/en/'.$calendarSlug,\n\t\t\t'educationResourceUrl' => get_permalink(kcsite_getPageByTempate('education_list.php')),\n\t\t\t'newsUrl' => get_permalink(177),\n\t\t\t'industryNewsUrl' => get_permalink(4109),\n\t\t\t'keysListUrl' => get_permalink(599),\n\t\t\t'newsArchiveUrl' => get_permalink(181),\t\t//used in news blog page for news arhive btn\n\t\t\t'industryNewsArchiveUrl' => get_permalink(4108),\t\n\t\t\t// 'newsCategoryID' => 33,\n\t\t\t// 'industryNewsCategoryID' => 34,\n\t\t\t'ordinaryNewTypeID' => 37,\n\t\t\t'industryNewTypeID' => 39,\n 'filmRegisterSearchPageId' => 4393,\n 'lithuanianFilmsSearchPageId' => 7717, // not set yet\n\t\t\t'lithuanianFilmsSearchProducablePageId' => 7719, // not set yet\n\t\t);\n\n\t} else {\n\t\t$staticVars = array(\n\t\t\t'siteUrl' => $siteurl,\n\t\t\t'sitetreeUrl' => get_permalink(458),\n\t\t\t// 'eventsUrl' => get_permalink(595),\n\t\t\t'eventsUrl' => $siteurl.'/'.$calendarSlug,\n\t\t\t'educationResourceUrl' => get_permalink(kcsite_getPageByTempate('education_list.php')),\n\t\t\t'newsUrl' => get_permalink(2),\n\t\t\t'industryNewsUrl' => get_permalink(4106),\n\t\t\t'keysListUrl' => get_permalink(597),\n\t\t\t'newsArchiveUrl' => get_permalink(86),\n\t\t\t'industryNewsArchiveUrl' => get_permalink(4107),\t\n\t\t\t// 'newsCategoryID' => 31,\n\t\t\t// 'industryNewsCategoryID' => 32,\t\t\n\t\t\t'ordinaryNewTypeID' => 36,\n\t\t\t'industryNewTypeID' => 38,\t\t\t\t\n 'filmRegisterSearchPageId' => 4393,\n 'lithuanianFilmsSearchPageId' => 7713,\n\t\t\t'lithuanianFilmsSearchProducablePageId' => 7715,\n\t\t);\n\t}\n\n\tload_theme_textdomain('kcsite', TEMPLATEPATH . '/languages');\n\t$locale = get_locale();\n\t$locale_file = TEMPLATEPATH . \"/languages/$locale.php\";\n\tif (is_readable($locale_file))\trequire_once( $locale_file );\n\n\tadd_editor_style();\n\n\t// Add default posts and comments RSS feed links to <head>.\n\t//add_theme_support( 'automatic-feed-links' );\n\n\tregister_nav_menu('primary', __('Primary Menu', 'kcsite'));\n register_nav_menu('secondary', __('Secondary Menu', 'kcsite'));\n\tregister_nav_menu('left_col_films_menu', __('Filmų meniu', 'kcsite'));\n\n\tfunction fallback_nav_menu(){}\n\n\t//add_theme_support('post-formats'/*, array( 'aside', 'link', 'gallery', 'status', 'quote', 'image')*/);\n\tadd_theme_support('post-thumbnails');\t\n\tadd_image_size('home-slideshow', 627, 338, true); \t\n\tadd_image_size('medium-cropped', 505, 175, true); /* for single post view, cropped to be narrower */\t\n\tadd_image_size('feat-thumbnail', 243, 160, true); /* for two featured news in news list */\t\n\t//set_post_thumbnail_size() To set a custom post thumbnail size.\n\n\t// register sidebars\n\tfunction kcsite_widgets_init() {\t\t\t\n\t\tregister_sidebar( array(\n\t\t\t'name' => __( 'Left sidebar', 'kcsite' ),\n\t\t\t'id' => 'sidebar-l',\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget clearfix %2$s\">',\n\t\t\t'after_widget' => '</aside>',\n\t\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t'after_title' => '</h3>',\n\t\t));\t\t\n\t\tregister_sidebar( array(\n\t\t\t'name' => __( 'Right sidebar', 'kcsite' ),\n\t\t\t'id' => 'sidebar-r',\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget clearfix %2$s\">',\n\t\t\t'after_widget' => \"</aside>\",\n\t\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t'after_title' => '</h3>',\n\t\t));\n/*\n\t\tregister_sidebar( array(\n\t\t\t'name' => __('Banners Before Footer', 'kcsite'),\n\t\t\t'id' => 'sidebar-banners-before-footer',\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s help-inline\">',\n\t\t\t'after_widget' => \"</aside>\",\n\t\t\t//'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t//'after_title' => '</h3>',\n\t\t) );*/\n\t}\n\tadd_action( 'widgets_init', 'kcsite_widgets_init' );\n\n}", "public function before()\n\t{\n\t\t// Load debug helper when not in production mode\n\t\t(ENVIRONMENT !== 'production') && $this->load->helper('debug');\n\n\t\t// Auto-load resources\n\t\t$this->_autoloader();\n\n\t\t// Set available languages and current language\n\t\t$this->language = $this->config->language(true);\n\t\t$this->languages = $this->config->languages(true);\n\t\t// Remove the current language from the lsit\n\t\tunset($this->languages[$this->language['code']]);\n\n\t\t// Set some global variables\n\t\t$this->theme->set(array(\n\t\t\t'language' => $this->language,\n\t\t\t'languages' => $this->languages,\n\t\t\t'site_name' => config('app.name'), // Use @$site_name to avoid errors\n\t\t), null, true);\n\t}", "function _wp_customize_loader_settings()\n {\n }", "function launchpad_set_page_defines() {\n\tglobal $site_options;\n\t\n\t/** Google Analytics ID. */\n\tdefine('GA_ID', isset($site_options['google_analytics_id']) ? $site_options['google_analytics_id'] : '');\n\n\t/** Whether to use cache. If things get weird, turn it off by setting the value to 0. */\n\tdefine('USE_CACHE', isset($site_options['cache_timeout']) ? (int) $site_options['cache_timeout'] : 0);\n}", "function fsnat_settings_page() {\n\trequire_once( get_template_directory() . '/inc/templates/fsnat-custom-css.php');\n}", "function test_are_constants_defined() {\n\t\t$this->assertTrue( defined( 'FJ_UTILITY_TEXT_DOMAIN' ) );\n\t\t$this->assertTrue( defined( 'FJ_UTILITY_DIR' ) );\n\t\t$this->assertTrue( defined( 'FJ_UTILITY_CONFIG_DIR' ) );\n\t\t$this->assertTrue( defined( 'FJ_UTILITY_SETTINGS_DIR' ) );\n\t\t$this->assertTrue( defined( 'FJ_UTILITY_SHORTCODES_DIR' ) );\n\t\t$this->assertTrue( defined( 'FJ_UTILITY_FILE' ) );\n\t}", "private function set_templates() {\r\n $this->templates = array();\r\n\r\n foreach ( (array) $this->variations as $variation ) {\r\n $variation = strlen( $variation ) > 0 ? '-' . $variation : '';\r\n $this->templates[] = $this->base . $variation;\r\n }\r\n }", "private function registerTwigGlobals()\n {\n $files = array_merge(\n glob( $this->getThemeDirectory().'*.yaml' ),\n glob( $this->getContentPath().'*.yaml')\n );\n\n # Get the *.yaml files (either from content or from the theme):\n foreach( $files as $yaml )\n {\n if( substr(basename($yaml), 0, 1) != '_' )\n {\n $this->addTwigGlobal(\n Utils::removeExtension($yaml),\n Yaml::parseFile($yaml)\n );\n }\n }\n\n # Now add additional useful vars:\n $this->addTwigGlobal('theme_dir', $this->config->get('site.url').$this->config->get('site.dir').$this->config->get('dirs.view').'/'.$this->config->get('site.theme').'/');\n $this->addTwigGlobal('base_url', $this->config->get('site.url').$this->config->get('site.dir'));\n }", "public function Setup_Templates_List() : void\n {\n $this->Templates = apply_filters(\"WP_Plugin_virtual_pages_templates\",[\n ...array('page.php', 'index.php' ), ...(array) $this->Template]);\n }", "protected function CustomVariables ()\r\n\t{\r\n\t\t// Overwrite variables if you want them custom\r\n\t\t$this->Set ('autoload', true);\r\n\t\t$this->Set ('enable_query_strings', false);\r\n\t\t\r\n\t\t// Add your own variables\r\n\t\t$this->Set ('database_host', 'localhost');\r\n\t\t$this->Set ('database_user', 'database_username');\r\n\t\t$this->Set ('database_pass', 'database_password');\r\n\t\t$this->Set ('database_name', 'database_name');\r\n\t\t$this->Set ('database_prefix', 'database_prefix');\r\n\t}", "function init_setup() {\n require get_template_directory() . '/includes/navwalker.php';\n require get_template_directory() . '/includes/widget.php';\n require get_template_directory() . '/includes/options.php';\n require get_template_directory() . '/includes/plugin.php';\n add_filter('show_admin_bar', '__return_false');\n /**\n * Make theme available for translation.\n * Translations can be placed in the /languages/ directory.\n */\n load_theme_textdomain( 'initializr', get_template_directory() . '/languages' );\n \n /**\n * Add default posts and comments RSS feed links to <head>.\n */\n add_theme_support( 'automatic-feed-links' );\n \n /**\n * Enable support for post thumbnails and featured images.\n */\n add_theme_support( 'post-thumbnails' );\n \n /**\n * Add support for two custom navigation menus.\n */\n register_nav_menus( array(\n 'primary' => __( 'Primary Menu', 'initializr' ),\n 'secondary' => __('Secondary Menu', 'initializr' )\n ) );\n \n /**\n * Enable support for the following post formats:\n * aside, gallery, quote, image, and video\n */\n add_theme_support( 'post-formats', array ( 'aside', 'gallery', 'quote', 'image', 'video' ) );\n }", "function twig_timber_context( $context ) {\n\t\t//Useful Variables\n\t\tglobal $template;\n\t\t$context['theme_template'] = str_replace( '.php', '', basename( $template ) );\n\t\t$context['theme_url'] = \"http://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\n\t\t//Bam! Magic!\n\t\treturn $context;\n\t}", "public function _($text) {\n\t\treturn __($text, $this->wire('config')->paths->root . 'wire/templates-admin/default.php'); \n\t}", "function fusion_app_textdomain_strings() {\n\n\tglobal $fusion_settings;\n\tif ( ! $fusion_settings ) {\n\t\t$fusion_settings = Fusion_Settings::get_instance();\n\t}\n\n\t$text_strings = [\n\n\t\t'custom_css' => esc_html__( 'Custom CSS', 'fusion-builder' ),\n\t\t'builder' => esc_html__( 'Builder', 'fusion-builder' ),\n\t\t'library' => esc_html__( 'Library', 'fusion-builder' ),\n\t\t'add_css_code_here' => esc_html__( 'Add your CSS code here...', 'fusion-builder' ),\n\t\t'delete_page_layout' => esc_html__( 'Delete page layout', 'fusion-builder' ),\n\t\t'undo' => esc_html__( 'Undo', 'fusion-builder' ),\n\t\t'redo' => esc_html__( 'Redo', 'fusion-builder' ),\n\t\t'save' => esc_html__( 'Save', 'fusion-builder' ),\n\t\t'dont_save' => esc_html__( 'Don\\'t Save', 'fusion-builder' ),\n\t\t'leave' => esc_html__( 'Save & Leave', 'fusion-builder' ),\n\t\t'just_leave' => esc_html__( 'Just Leave', 'fusion-builder' ),\n\t\t'delete_item' => esc_html__( 'Delete item', 'fusion-builder' ),\n\t\t'clone_item' => esc_html__( 'Clone item', 'fusion-builder' ),\n\t\t'edit_item' => esc_html__( 'Edit item', 'fusion-builder' ),\n\t\t'element_settings' => esc_html__( 'Element Options', 'fusion-builder' ),\n\t\t/* translators: Element settings. */\n\t\t'custom_element_settings' => esc_html__( '%s Options', 'fusion-builder' ),\n\t\t'full_width_section' => esc_html__( 'Container', 'fusion-builder' ),\n\t\t'section_settings' => esc_html__( 'Container Options', 'fusion-builder' ),\n\t\t'insert_section' => esc_html__( 'Insert Container', 'fusion-builder' ),\n\t\t'clone_section' => esc_html__( 'Clone Container', 'fusion-builder' ),\n\t\t'save_section' => esc_html__( 'Save Container', 'fusion-builder' ),\n\t\t'delete_section' => esc_html__( 'Delete Container', 'fusion-builder' ),\n\t\t'builder_sections' => esc_html__( 'Builder Containers', 'fusion-builder' ),\n\t\t'click_to_toggle' => esc_html__( 'Click to toggle', 'fusion-builder' ),\n\t\t'save_custom_section' => esc_html__( 'Save Custom Container', 'fusion-builder' ),\n\t\t'save_custom_template' => esc_html__( 'Save Custom Template', 'fusion-builder' ),\n\t\t'save_custom_section_info' => esc_html__( 'Custom containers will be stored and managed on the Library tab', 'fusion-builder' ),\n\t\t'enter_name' => esc_html__( 'Enter Name...', 'fusion-builder' ),\n\t\t'column' => esc_html__( 'Column', 'fusion-builder' ),\n\t\t'columns' => esc_html__( 'Columns', 'fusion-builder' ),\n\t\t'resize_column' => esc_html__( 'Resize column', 'fusion-builder' ),\n\t\t'resized_column' => esc_html__( 'Resized Column to', 'fusion-builder' ),\n\t\t'column_library' => esc_html__( 'Column Options', 'fusion-builder' ),\n\t\t'clone_column' => esc_html__( 'Clone column', 'fusion-builder' ),\n\t\t'save_column' => esc_html__( 'Save column', 'fusion-builder' ),\n\t\t'delete_column' => esc_html__( 'Delete column', 'fusion-builder' ),\n\t\t'delete_row' => esc_html__( 'Delete row', 'fusion-builder' ),\n\t\t'clone_column' => esc_html__( 'Clone column', 'fusion-builder' ),\n\t\t'save_custom_column' => esc_html__( 'Save Custom Column', 'fusion-builder' ),\n\t\t'save_custom_column_info' => esc_html__( 'Custom elements will be stored and managed on the Library tab', 'fusion-builder' ),\n\t\t'add_element' => esc_html__( 'Add element', 'fusion-builder' ),\n\t\t'element' => esc_html__( 'Element', 'fusion-builder' ),\n\t\t'insert_columns' => esc_html__( 'Insert Columns', 'fusion-builder' ),\n\t\t'search' => esc_html__( 'Search', 'fusion-builder' ),\n\t\t'search_elements' => esc_html__( 'Search Elements', 'fusion-builder' ),\n\t\t'search_containers' => esc_html__( 'Search Containers', 'fusion-builder' ),\n\t\t'search_columns' => esc_html__( 'Search Columns', 'fusion-builder' ),\n\t\t'builder_columns' => esc_html__( 'Builder Columns', 'fusion-builder' ),\n\t\t'library_columns' => esc_html__( 'Library Columns', 'fusion-builder' ),\n\t\t'library_sections' => esc_html__( 'Library Containers', 'fusion-builder' ),\n\t\t'cancel' => esc_html__( 'Cancel', 'fusion-builder' ),\n\t\t'select_element' => esc_html__( 'Select Element', 'fusion-builder' ),\n\t\t'builder_elements' => esc_html__( 'Builder Elements', 'fusion-builder' ),\n\t\t'layout_section_elements' => esc_html__( 'Layout Section Elements', 'fusion-builder' ),\n\t\t'library_elements' => esc_html__( 'Library Elements', 'fusion-builder' ),\n\t\t'generator_elements_tooltip' => esc_html__( 'Inline element for usage in the Fusion Builder Generator.', 'fusion-builder' ),\n\t\t'template_max_use_limit' => esc_html__( 'This element can be added only', 'fusion-builder' ),\n\t\t'time' => esc_html__( 'time.', 'fusion-builder' ),\n\t\t'times' => esc_html__( 'times.', 'fusion-builder' ),\n\t\t'inner_columns' => esc_html__( 'Nested Columns', 'fusion-builder' ),\n\t\t'element_settings' => esc_html__( 'Element Options', 'fusion-builder' ),\n\t\t'clone_element' => esc_html__( 'Clone Element', 'fusion-builder' ),\n\t\t'save_element' => esc_html__( 'Save Element', 'fusion-builder' ),\n\t\t'save_global' => esc_html__( 'Save As Global', 'fusion-builder' ),\n\t\t'delete_element' => esc_html__( 'Delete Element', 'fusion-builder' ),\n\t\t'save_custom_element' => esc_html__( 'Save Custom Element', 'fusion-builder' ),\n\t\t'save_custom_element_info' => esc_html__( 'Custom elements will be stored and managed on the Library tab', 'fusion-builder' ),\n\t\t'add_edit_items' => esc_html__( 'Add / Edit Items', 'fusion-builder' ),\n\t\t'sortable_items_info' => esc_html__( 'Add or edit new items for this element. Drag and drop them into the desired order.', 'fusion-builder' ),\n\t\t'delete_inner_columns' => esc_html__( 'Delete inner columns', 'fusion-builder' ),\n\t\t'clone_inner_columns' => esc_html__( 'Clone inner columns', 'fusion-builder' ),\n\t\t'save_inner_columns' => esc_html__( 'Save inner columns', 'fusion-builder' ),\n\t\t'delete_inner_columns' => esc_html__( 'Delete inner columns', 'fusion-builder' ),\n\t\t'save_nested_columns' => esc_html__( 'Save Nested Columns', 'fusion-builder' ),\n\t\t'select_options_or_leave_blank_for_all' => esc_html__( 'Select or Leave Blank for All', 'fusion-builder' ),\n\t\t'select_categories_or_leave_blank_for_all' => esc_html__( 'Select or Leave Blank for All', 'fusion-builder' ),\n\t\t'select_categories_or_leave_blank_for_none' => esc_html__( 'Select or Leave Blank for None', 'fusion-builder' ),\n\t\t'select_post_status_leave_blank_for_publish' => esc_html__( 'Select or Leave Blank for Published', 'fusion-builder' ),\n\t\t'please_enter_element_name' => esc_html__( 'Please enter element name', 'fusion-builder' ),\n\t\t'are_you_sure_you_want_to_delete_this_layout' => esc_html__( 'You are about to remove all page layout. Do you still want to proceed?', 'fusion-builder' ),\n\t\t'are_you_sure_you_want_to_delete_this' => esc_html__( 'Are you sure you want to delete this ?', 'fusion-builder' ),\n\t\t'are_you_sure_you_want_to_delete_global' => esc_html__( 'This is a global item. Deleting this element will remove it from every page you have it on. Are you sure you want to remove it?', 'fusion-builder' ),\n\t\t'global_element' => __( 'Global element<br>Click to disable global status', 'fusion-builder' ),\n\t\t'global_column' => __( 'Global column<br>Click to disable global status', 'fusion-builder' ),\n\t\t'global_container' => __( 'Global container<br>Click to disable global status', 'fusion-builder' ),\n\t\t'duplicate_element_name_error' => esc_html__( 'An element with this name already exists. Please enter different name.', 'fusion-builder' ),\n\t\t'please_enter_template_name' => esc_html__( 'Please enter template name', 'fusion-builder' ),\n\t\t'save_page_layout' => esc_html__( 'Save page layout', 'fusion-builder' ),\n\t\t'upload' => esc_html__( 'Upload', 'fusion-builder' ),\n\t\t'upload_image' => esc_html__( 'Upload Image', 'fusion-builder' ),\n\t\t'upload_audio' => esc_html__( 'Upload Audio', 'fusion-builder' ),\n\t\t'edit' => esc_html__( 'Edit', 'fusion-builder' ),\n\t\t'remove' => esc_html__( 'Remove', 'fusion-builder' ),\n\t\t'attach_images' => esc_html__( 'Attach Images to Gallery', 'fusion-builder' ),\n\t\t'insert' => esc_html__( 'Insert', 'fusion-builder' ),\n\t\t'pre_built_page' => esc_html__( 'Pre-Built Page', 'fusion-builder' ),\n\t\t'to_get_started' => esc_html__( 'To get started, add a Container, or add a pre-built page.', 'fusion-builder' ),\n\t\t'to_get_started_ptb' => esc_html__( 'To get started building your Page Title Bar, add a container.', 'fusion-builder' ),\n\t\t'to_get_started_footer' => esc_html__( 'To get started building your Footer, add a container.', 'fusion-builder' ),\n\t\t'to_get_started_sub' => esc_html__( 'The building process always starts with a container, then columns, then elements.', 'fusion-builder' ),\n\t\t'watch_the_video' => esc_html__( 'Watch The Video!', 'fusion-builder' ),\n\t\t'edit_settings' => esc_html__( 'Edit Settings', 'fusion-builder' ),\n\t\t'backward_history' => esc_html__( 'Backward History', 'fusion-builder' ),\n\t\t'duplicate_content' => esc_html__( 'Duplicate Content', 'fusion-builder' ),\n\t\t'forward_history' => esc_html__( 'Forward History', 'fusion-builder' ),\n\t\t'save_custom_content' => esc_html__( 'Save Custom Content', 'fusion-builder' ),\n\t\t'delete_content' => esc_html__( 'Delete Content', 'fusion-builder' ),\n\t\t'add_content' => esc_html__( 'Add Content', 'fusion-builder' ),\n\t\t'additional_docs' => esc_html__( 'Click the ? icon to view additional documentation', 'fusion-builder' ),\n\t\t'getting_started_video' => esc_html__( 'Getting Started Video', 'fusion-builder' ),\n\t\t'icon_control_description' => esc_html__( 'Icon Control Descriptions:', 'fusion-builder' ),\n\t\t'history' => esc_html__( 'History', 'fusion-builder' ),\n\t\t'collapse_sections' => esc_html__( 'Collapse Sections', 'fusion-builder' ),\n\t\t'history_states' => esc_html__( 'History States', 'fusion-builder' ),\n\t\t'empty' => esc_html__( 'Start', 'fusion-builder' ),\n\t\t'moved_column' => esc_html__( 'Moved Column', 'fusion-builder' ),\n\t\t'added_custom_element' => esc_html__( 'Added Custom Element: ', 'fusion-builder' ),\n\t\t'added_custom_column' => esc_html__( 'Added Custom Column: ', 'fusion-builder' ),\n\t\t'added_columns' => esc_html__( 'Added Columns', 'fusion-builder' ),\n\t\t'added_custom_section' => esc_html__( 'Added Custom Container: ', 'fusion-builder' ),\n\t\t'deleted' => esc_html__( 'Deleted', 'fusion-builder' ),\n\t\t'cloned' => esc_html__( 'Cloned', 'fusion-builder' ),\n\t\t'pasted' => esc_html__( 'Pasted', 'fusion-builder' ),\n\t\t'pasted' => esc_html__( 'Pasted', 'fusion-builder' ),\n\t\t'moved' => esc_html__( 'Moved', 'fusion-builder' ),\n\t\t'edited' => esc_html__( 'Edited', 'fusion-builder' ),\n\t\t'reset_to_default' => esc_html__( 'Reset to Default', 'fusion-builder' ),\n\t\t'added_nested_columns' => esc_html__( 'Added Nested Columns', 'fusion-builder' ),\n\t\t'edited_nested_columns' => esc_html__( 'Edited Nested Columns', 'fusion-builder' ),\n\t\t'deleted_nested_columns' => esc_html__( 'Deleted Nested Columns', 'fusion-builder' ),\n\t\t'moved_nested_column' => esc_html__( 'Moved Nested Column', 'fusion-builder' ),\n\t\t'head_title' => esc_html__( 'Head Title', 'fusion-builder' ),\n\t\t'currency' => esc_html__( 'Currency', 'fusion-builder' ),\n\t\t'price' => esc_html__( 'Price', 'fusion-builder' ),\n\t\t'period' => esc_html__( 'Period', 'fusion-builder' ),\n\t\t'enter_text' => esc_html__( 'Enter Text', 'fusion-builder' ),\n\t\t'added' => esc_html__( 'Added', 'fusion-builder' ),\n\t\t'added_section' => esc_html__( 'Added Container', 'fusion-builder' ),\n\t\t'cloned_nested_columns' => esc_html__( 'Cloned Nested Columns', 'fusion-builder' ),\n\t\t'content_imported' => esc_html__( 'Content Imported', 'fusion-builder' ),\n\t\t'table_intro' => esc_html__( 'Visually create your table below, add or remove rows and columns', 'fusion-builder' ),\n\t\t'add_table_column' => esc_html__( 'Add Column', 'fusion-builder' ),\n\t\t'add_table_row' => esc_html__( 'Add Row', 'fusion-builder' ),\n\t\t'column_title' => esc_html__( 'Column', 'fusion-builder' ),\n\t\t'standout_design' => esc_html__( 'Standout', 'fusion-builder' ),\n\t\t'add_button' => esc_html__( 'Add Button', 'fusion-builder' ),\n\t\t'yes' => esc_html__( 'Yes', 'fusion-builder' ),\n\t\t'no' => esc_html__( 'No', 'fusion-builder' ),\n\t\t'table_options' => esc_html__( 'Table Options', 'fusion-builder' ),\n\t\t'table' => esc_html__( 'Table', 'fusion-builder' ),\n\t\t'toggle_all_sections' => esc_html__( 'Toggle All Containers', 'fusion-builder' ),\n\t\t'cloned_section' => esc_html__( 'Cloned Container', 'fusion-builder' ),\n\t\t'deleted_section' => esc_html__( 'Deleted Container', 'fusion-builder' ),\n\t\t'image' => esc_html__( 'Image', 'fusion-builder' ),\n\t\t'audio' => esc_html__( 'Audio', 'fusion-builder' ),\n\t\t'select_image' => esc_html__( 'Select Image', 'fusion-builder' ),\n\t\t'select_audio' => esc_html__( 'Select Image', 'fusion-builder' ),\n\t\t'select_images' => esc_html__( 'Select Images', 'fusion-builder' ),\n\t\t'select_video' => esc_html__( 'Select Video', 'fusion-builder' ),\n\t\t'select_audio' => esc_html__( 'Select Audio', 'fusion-builder' ),\n\t\t'select_icon' => esc_html__( 'Select Icon', 'fusion-builder' ),\n\t\t'search_icons' => esc_html__( 'Search Icons', 'fusion-builder' ),\n\t\t'empty_section' => esc_html__( 'To Add Elements, You Must First Add a Column', 'fusion-builder' ),\n\t\t'empty_section_with_bg' => esc_html__( 'This is an empty container with a background image. To add elements, you must first add a column', 'fusion-builder' ),\n\t\t/* translators: Child element name. */\n\t\t'empty_parent' => esc_html__( 'Empty %s element, please add child elements here.', 'fusion-builder' ),\n\t\t'to_add_images' => esc_html__( 'To add images to this post or page for attachments layout, navigate to \"Upload Files\" tab in media manager and upload new images.', 'fusion-builder' ),\n\t\t'importing_single_page' => esc_html__( 'WARNING: Importing a single demo page will remove all other page content, fusion page options and page template. Fusion Theme Options and demo images are not imported. Click OK to continue or cancel to stop.', 'fusion-builder' ),\n\t\t'content_error_title' => esc_html__( 'Content Error', 'fusion-builder' ),\n\t\t/* translators: Link URL. */\n\t\t'content_error_description' => sprintf( __( 'Your page content could not be displayed as a Fusion Builder layout. Most likely that means, there is some invalid markup or shortcode in it. Please check the contents in the text editor. <a href=\"%s\" target=\"_blank\">See here for more information</a>.', 'fusion-builder' ), 'https://theme-fusion.com/documentation/fusion-builder/technical/page-content-not-parsable-fusion-builder/' ),\n\t\t'unknown_error_title' => esc_html__( 'Unknown Error Occurred', 'fusion-builder' ),\n\t\t/* translators: Link URL. */\n\t\t'unknown_error_link' => sprintf( __( '<a href=\"%s\" target=\"_blank\">Click here to learn more.</a>', 'fusion-builder' ), '#' ),\n\t\t'unknown_error_copy' => esc_html__( 'Click here to copy the full error message.', 'fusion-builder' ),\n\t\t'unknown_error_copied' => esc_html__( 'Full error message copied.', 'fusion-builder' ),\n\t\t'moved_container' => esc_html__( 'Moved Container', 'fusion-builder' ),\n\t\t'currency_before' => esc_html__( 'Before', 'fusion-builder' ),\n\t\t'currency_after' => esc_html__( 'After', 'fusion-builder' ),\n\t\t'delete_nextpage' => esc_html__( 'Delete Next Page Divider', 'fusion-builder' ),\n\t\t'toggle_element' => esc_html__( 'Toggle Element', 'fusion-builder' ),\n\t\t'drag_element' => esc_html__( 'Drag Element', 'fusion-builder' ),\n\t\t'deleted_nextpage' => esc_html__( 'Deleted Next Page Divider', 'fusion-builder' ),\n\t\t'added_nextpage' => esc_html__( 'Added Next Page Divider', 'fusion-builder' ),\n\t\t'nextpage' => esc_html__( 'Next Page', 'fusion-builder' ),\n\t\t'library_misc' => esc_html__( 'Special', 'fusion-builder' ),\n\t\t'special_title' => esc_html__( 'Special Items', 'fusion-builder' ),\n\t\t'special_description' => esc_html__( 'The next page item allows you to break your page into several pages. Simply insert it onto the page, and automatic pagination will show on the frontend.', 'fusion-builder' ),\n\t\t'select_link' => esc_html__( 'Select Link', 'fusion-builder' ),\n\t\t'color_palette_options' => esc_html__( 'Color palette options', 'fusion-builder' ),\n\t\t'background_color' => esc_html__( 'Background Color', 'fusion-builder' ),\n\t\t'border_color' => esc_html__( 'Border Color', 'fusion-builder' ),\n\t\t'legend_text_color' => esc_html__( 'Legend Value Text Color', 'fusion-builder' ),\n\t\t'enter_value' => esc_html__( 'Enter Value', 'fusion-builder' ),\n\t\t'legend_label' => esc_html__( 'Legend Label', 'fusion-builder' ),\n\t\t'x_axis_label' => esc_html__( 'X Axis Label', 'fusion-builder' ),\n\t\t/* translators: Search type. */\n\t\t'search_placeholder' => esc_html__( 'Search %s', 'fusion-builder' ),\n\t\t'chart_bg_color_title' => esc_html__( 'Chart Background Color', 'fusion-builder' ),\n\t\t/* translators: Default value description & value. */\n\t\t'chart_bg_color_desc' => sprintf( __( 'Controls the background of the chart. %s', 'fusion-builder' ), $fusion_settings->get_default_description( 'chart_bg_color', '', 'color-alpha', true, '' ) ),\n\t\t'chart_axis_text_color_title' => esc_html__( 'Chart Axis Text Color', 'fusion-builder' ),\n\t\t/* translators: Default value description & value. */\n\t\t'chart_axis_text_color_desc' => sprintf( __( 'Controls the text color of the x-axis and y-axis. %s', 'fusion-builder' ), $fusion_settings->get_default_description( 'chart_axis_text_color', '', 'color-alpha', true, '' ) ),\n\t\t'chart_gridline_color_title' => esc_html__( 'Chart Gridline Color', 'fusion-builder' ),\n\t\t/* translators: Default value description & value. */\n\t\t'chart_gridline_color_desc' => sprintf( __( 'Controls the color of the chart background grid lines and values. %s', 'fusion-builder' ), $fusion_settings->get_default_description( 'chart_gridline_color', '', 'color-alpha', true, '' ) ),\n\t\t'chart_padding_title' => esc_html__( 'Chart Padding Options', 'fusion-builder' ),\n\t\t'chart_padding_desc' => esc_html__( 'Controls the top/right/bottom/left padding of the chart.', 'fusion-builder' ),\n\t\t'chart_options' => esc_html__( 'Chart Options', 'fusion-builder' ),\n\t\t'chart' => esc_html__( 'Chart Data', 'fusion-builder' ),\n\t\t'chart_border_size_heading' => esc_html__( 'Border Size', 'fusion-builder' ),\n\t\t'chart_border_size_desc ' => esc_html__( 'Set chart border size in pixels.', 'fusion-builder' ),\n\t\t'chart_intro' => esc_html__( 'Visually create your chart data below, add or remove data sets and their styling', 'fusion-builder' ),\n\t\t'chart_intro_fe' => esc_html__( 'Visually create your chart data below', 'fusion-builder' ),\n\t\t'chart_bars_note' => __( '<strong>IMPORTANT NOTE:</strong> If you are using a <strong>Bar</strong> or <strong>Horizontal Bar Chart</strong>, the table interface below and available options will change depending on the number of datasets added. This setup is needed in order to ensure maximum flexibility for your chart styling.', 'fusion-builder' ),\n\t\t'add_chart_column' => esc_html__( '+ Add Value Column', 'fusion-builder' ),\n\t\t'add_chart_row' => esc_html__( '+ Add Data Set', 'fusion-builder' ),\n\t\t'chart_dataset' => esc_html__( 'Data Set', 'fusion-builder' ),\n\t\t'chart_dataset_styling' => esc_html__( 'Data Set Styling', 'fusion-builder' ),\n\t\t'chart_value_set_styling' => esc_html__( 'Value Set Styling', 'fusion-builder' ),\n\t\t'chart_table_button_desc' => esc_html__( 'Build your chart data visually', 'fusion-builder' ),\n\t\t'chart_table_button_text' => esc_html__( 'Edit Chart Data Table', 'fusion-builder' ),\n\t\t'user_login_register_note' => esc_html__( 'Registration confirmation will be emailed to you.', 'fusion-builder' ),\n\t\t'are_you_sure_you_want_to_remove_global' => esc_html__( 'Are you sure you want to remove global property?', 'fusion-builder' ),\n\t\t'remove_global' => esc_html__( 'Remove Global?', 'fusion-builder' ),\n\t\t'removed_global' => esc_html__( 'Removed Global Status', 'fusion-builder' ),\n\t\t'container_draft' => esc_html__( 'Draft container.', 'fusion-builder' ),\n\t\t'container_scheduled' => esc_html__( 'Scheduled container.', 'fusion-builder' ),\n\t\t'container_publish' => esc_html__( 'Click to remove sheduling.', 'fusion-builder' ),\n\t\t'are_you_sure_you_want_to_publish' => esc_html__( 'Are you sure you want to remove sheduling? This will set the container to be a normally published element.', 'fusion-builder' ),\n\t\t'container_published' => esc_html__( 'Container published.', 'fusion-builder' ),\n\t\t'on' => esc_html__( 'On', 'fusion-builder' ),\n\t\t'off' => esc_html__( 'Off', 'fusion-builder' ),\n\t\t'get_started_video' => esc_html__( 'Watch Our Get Started Video', 'fusion-builder' ),\n\t\t'get_started_video_description' => esc_html__( 'Do you need a helping hand? Let us guide you.', 'fusion-builder' ),\n\t\t'watch_the_video_link' => esc_html__( 'Watch The Video', 'fusion-builder' ),\n\t\t'fusion_builder_docs' => esc_html__( 'Fusion Builder Docs', 'fusion-builder' ),\n\t\t'fusion_builder_docs_description' => esc_html__( 'Videos not for you? That\\'s ok! We have you covered.', 'fusion-builder' ),\n\t\t'fusion_panel_desciption_toggle' => esc_html__( 'Toggle Description', 'fusion-builder' ),\n\t\t'fusion_dimension_top_label' => esc_html__( 'Top', 'fusion-builder' ),\n\t\t'fusion_dimension_bottom_label' => esc_html__( 'Bottom', 'fusion-builder' ),\n\t\t'fusion_dimension_left_label' => esc_html__( 'Left', 'fusion-builder' ),\n\t\t'fusion_dimension_right_label' => esc_html__( 'Right', 'fusion-builder' ),\n\t\t'fusion_dimension_height_label' => esc_html__( 'Height', 'fusion-builder' ),\n\t\t'fusion_dimension_width_label' => esc_html__( 'Width', 'fusion-builder' ),\n\t\t'fusion_dimension_top_left_label' => esc_html__( 'Top/Left', 'fusion-builder' ),\n\t\t'fusion_dimension_top_right_label' => esc_html__( 'Top/Right', 'fusion-builder' ),\n\t\t'fusion_dimension_bottom_left_label' => esc_html__( 'Bot/Left', 'fusion-builder' ),\n\t\t'fusion_dimension_bottom_right_label' => esc_html__( 'Bot/Right', 'fusion-builder' ),\n\t\t'fusion_dimension_all_label' => esc_html__( 'All', 'fusion-builder' ),\n\t\t'confirm' => esc_html__( 'Confirm', 'fusion-builder' ),\n\t\t'unsaved_changes' => esc_html__( 'Unsaved Changes', 'fusion-builder' ),\n\t\t'changes_will_be_lost' => esc_html__( 'Your changes will be lost, do you want to save changes before leaving?', 'fusion-builder' ),\n\t\t'reset' => esc_html__( 'Reset', 'fusion-builder' ),\n\t\t'reset_element_options' => esc_html__( 'Reset to Defaults', 'fusion-builder' ),\n\t\t'reset_element_options_confirmation' => esc_html__( 'Are you sure you want to reset this element\\'s options to default?', 'fusion-builder' ),\n\t\t'remove_element_options_confirmation' => esc_html__( 'Are you sure you want to delete this element?', 'fusion-builder' ),\n\t\t'i_agree' => esc_html__( 'I agree', 'fusion-builder' ),\n\t\t'are_you_sure' => esc_html__( 'Are you sure?', 'fusion-builder' ),\n\t\t'im_sure' => esc_html__( 'I\\'m sure', 'fusion-builder' ),\n\t\t'ok' => esc_html__( 'Ok', 'fusion-builder' ),\n\t\t'import_demo_page' => esc_html__( 'Import Demo Page', 'fusion-builder' ),\n\t\t'extended_options' => esc_html__( 'Extended options', 'fusion-builder' ),\n\t\t'align_text' => esc_html__( 'Align text', 'fusion-builder' ),\n\t\t'align_left' => esc_html__( 'Align left', 'fusion-builder' ),\n\t\t'align_center' => esc_html__( 'Align center', 'fusion-builder' ),\n\t\t'align_right' => esc_html__( 'Align right', 'fusion-builder' ),\n\t\t'align_justify' => esc_html__( 'Justify', 'fusion-builder' ),\n\t\t'indent' => esc_html__( 'Indent', 'fusion-builder' ),\n\t\t'outdent' => esc_html__( 'Outdent', 'fusion-builder' ),\n\t\t'accept' => esc_html__( 'Accept', 'fusion-builder' ),\n\t\t'typography' => esc_html__( 'Typography', 'fusion-builder' ),\n\t\t'typography_settings' => esc_html__( 'Settings', 'fusion-builder' ),\n\t\t'typography_family' => esc_html__( 'Family', 'fusion-builder' ),\n\t\t'typography_tag' => esc_html__( 'Tag', 'fusion-builder' ),\n\t\t'typography_fontsize' => esc_html__( 'Font Size', 'fusion-builder' ),\n\t\t'typography_lineheight' => esc_html__( 'Line Height', 'fusion-builder' ),\n\t\t'typography_letterspacing' => esc_html__( 'Letter Spacing', 'fusion-builder' ),\n\t\t'typography_variant' => esc_html__( 'Variant', 'fusion-builder' ),\n\t\t'typography_subset' => esc_html__( 'Subset', 'fusion-builder' ),\n\t\t'typography_default' => esc_html__( 'Default', 'fusion-builder' ),\n\t\t'font_color' => esc_html__( 'Font color', 'fusion-builder' ),\n\t\t'inline_element_edit' => esc_html__( 'Edit Inline Element', 'fusion-builder' ),\n\t\t'inline_element_remove' => esc_html__( 'Remove Inline Element', 'fusion-builder' ),\n\t\t'inline_element_delete' => esc_html__( 'Delete All', 'fusion-builder' ),\n\t\t'delete' => esc_html__( 'Delete', 'fusion-builder' ),\n\t\t'preview_mode' => esc_html__( 'Preview Mode', 'fusion-builder' ),\n\t\t'preview_mode_notice' => esc_html__( 'Please beware that editing options are limited on this mode. All open dialogs and panels will be closed.', 'fusion-builder' ),\n\t\t'multi_dialogs' => esc_html__( 'Multiple Dialogs', 'fusion-builder' ),\n\t\t'multi_dialogs_notice' => esc_html__( 'Please close other open dialogs first to use this option.', 'fusion-builder' ),\n\t\t'widget' => esc_html__( 'Widget', 'fusion-builder' ),\n\t\t'select_widget' => esc_html__( 'No widget selected. Edit to select widget type.', 'fusion-builder' ),\n\n\t\t/* translators: Add unknown element type. */\n\t\t'add_unknown' => esc_html__( 'Add %s', 'fusion-builder' ),\n\t\t'link_options' => esc_html__( 'Link Options', 'fusion-builder' ),\n\t\t'open_in_new_tab' => esc_html__( 'Open Link in New Tab', 'fusion-builder' ),\n\t\t'clear' => esc_html__( 'Clear', 'fusion-builder' ),\n\t\t'remove_format' => esc_html__( 'Remove formatting', 'fusion-builder' ),\n\t\t'gallery_placeholder' => esc_html__( 'Please add a gallery image here.', 'fusion-builder' ),\n\t\t'slider_placeholder' => esc_html__( 'Please select a slider for it to display here.', 'fusion-builder' ),\n\t\t'form_placeholder' => esc_html__( 'Please select a form for it to display here.', 'fusion-builder' ),\n\t\t'video_placeholder' => esc_html__( 'Please add a video here.', 'fusion-builder' ),\n\t\t'search_results' => esc_html__( 'Search Results', 'fusion-builder' ),\n\t\t'problem_saving' => esc_html__( 'Page Save Incomplete', 'fusion-builder' ),\n\t\t'changes_not_saved' => esc_html__( 'Not all content has saved correctly. Click ok to return to the page editor and try again.', 'fusion-builder' ),\n\t\t'page_save_failed' => esc_html__( 'Page Save Failed', 'fusion-builder' ),\n\t\t'authentication_no_heartbeat' => esc_html__( 'Security nonce check failed. Attempts to reconnect were also unsuccessful. Please ensure WordPress Heartbeat is not disabled.', 'fusion-builder' ),\n\t\t'layout_cleared' => esc_html__( 'Layout cleared.', 'fusion-builder' ),\n\t\t'remove' => esc_html__( 'Remove', 'fusion-builder' ),\n\t\t'enter_value' => esc_attr__( 'Enter value', 'fusion-builder' ),\n\t\t'import_failed' => esc_attr__( 'Import Failed', 'fusion-builder' ),\n\t\t'import_failed_description' => esc_attr__( 'Please check that the file selected is valid JSON. Click ok to return to the page editor and try again.', 'fusion-builder' ),\n\t\t'saved' => esc_attr__( 'Saved', 'fusion-builder' ),\n\t\t'as_global' => esc_attr__( 'As global', 'fusion-builder' ),\n\t\t'front_end_redirect_confirm' => esc_html__( 'This action will redirect you to the front-end builder. All unsaved changes will be lost. Are you sure?', 'fusion-builder' ),\n\t\t'duplicate_slider_revolution' => esc_html__( 'Duplicate Slider Revolution detected. Duplicate sliders will not be rendered whilst in the live editor.', 'fusion-builder' ),\n\t\t/* Translators: List of tags. */\n\t\t'tags' => esc_html__( 'Tags: %s', 'fusion-builder' ),\n\t\t'other' => esc_html__( 'Other', 'fusion-builder' ),\n\t\t'dynamic_data' => esc_html__( 'Dynamic Data', 'fusion-builder' ),\n\t\t'select_dynamic_content' => esc_html__( 'Select Dynamic Content', 'fusion-builder' ),\n\t\t'custom_fonts' => esc_html__( 'Custom Font(s)', 'fusion-builder' ),\n\t\t'add_new' => esc_html__( 'Add New', 'fusion-builder' ),\n\t\t'add' => esc_html__( 'Add', 'fusion-builder' ),\n\t\t'separate_with_comma' => esc_html__( 'Separate with Commas', 'fusion-builder' ),\n\t\t'previous' => esc_html__( 'Previous', 'fusion-builder' ),\n\t\t'next' => esc_html__( 'Next', 'fusion-builder' ),\n\t\t'related_posts' => esc_html__( 'Related Posts', 'fusion-builder' ),\n\t\t'related_projects' => esc_html__( 'Related Projects', 'fusion-builder' ),\n\t\t'related_faqs' => esc_html__( 'Related Faqs', 'fusion-builder' ),\n\t\t'project_details' => esc_html__( 'Project Details', 'fusion-builder' ),\n\t\t'add_custom_icon_set' => esc_html__( 'Add Custom Icon Set', 'fusion-builder' ),\n\t\t'edit_layout_section' => esc_html__( 'Edit Layout Section', 'fusion-builder' ),\n\t\t'edit_content_layout_section' => esc_html__( 'Edit Content Layout Section', 'fusion-builder' ),\n\t\t'edit_footer_layout_section' => esc_html__( 'Edit Footer Layout Section', 'fusion-builder' ),\n\t\t'dynamic_source' => esc_html__( 'Set dynamic content to update preview source.', 'fusion-builder' ),\n\n\t\t/* translators: The iconset name. */\n\t\t'no_results_in' => esc_html__( 'No Results in \"%s\"', 'fusion-builder' ),\n\t];\n\n\treturn $text_strings;\n}", "public function load_wp_dependent_properties() {\n\t\t\tdefine( 'BITLIVECC_PLUGIN_URL', untrailingslashit( plugin_dir_url( BITLIVECC_PLUGIN_FILE ) ) );\n\t\t\tdefine( 'BITLIVECC_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );\n\t\t}", "public static function init() {\n\t\tif ( ! is_admin() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tself::$theme = wp_get_theme();\n\t\tself::$version = self::$theme->get( 'Version' );\n\n\t\tself::setup_actions();\n\t}", "function init__themes()\n{\n global $THEME_IMAGES_CACHE, $CDN_CONSISTENCY_CHECK, $RECORD_THEME_IMAGES_CACHE, $RECORDED_THEME_IMAGES, $THEME_IMAGES_SMART_CACHE_LOAD;\n $THEME_IMAGES_CACHE = array();\n $CDN_CONSISTENCY_CHECK = array();\n $RECORD_THEME_IMAGES_CACHE = false;\n $RECORDED_THEME_IMAGES = array();\n $THEME_IMAGES_SMART_CACHE_LOAD = 0;\n}", "public static function setup_statics_once() {\n\t\tif ( self::$help_texts === array() ) {\n\t\t\tself::set_basic_help_texts();\n\t\t\tself::set_advanced_help_texts();\n\t\t}\n\n\t\tif ( self::$external_replacements === array() ) {\n\t\t\t/**\n\t\t\t * Action: 'wpseo_register_extra_replacements' - Allows for registration of additional\n\t\t\t * variables to replace.\n\t\t\t */\n\t\t\tdo_action( 'wpseo_register_extra_replacements' );\n\t\t}\n\t}", "private static function init(): void\n {\n parent::__install();\n $tmpl = _THEMES_ . \"/\" . _THEME_NAME_ . \"/tpl\";\n $smarty = self::getInstance(Smarty::class);\n $smarty->template_dir = $tmpl;\n $smarty->assign(\"template\", $tmpl);\n Modules::loadModules();\n\n }", "function scs_prepare_template_vars()\n\t{\n\t\n\t\tglobal $scs_theme, $scs_options;\n\t\t\n\t\t$scs_theme = $scs_options['theme_options'];\n\t\t\n\t\treturn true;\n\t\n\t}", "function init_template() {\n /*aniade soporte a Image destacada en la bara superior*/\n add_theme_support('post-thumbnails');\n /* aniade soorte de : titulo en la barra superior*/\n add_theme_support('title-tag');\n /* registrar menu de navegacion en el panel admin*/\n register_nav_menus(\n array(\n 'top_menu' => 'Menu Principal'\n )\n );\n\n}", "function ms_upload_constants() {\n\tglobal $wpdb;\n\n\t// This filter is attached in ms-default-filters.php but that file is not included during SHORTINIT.\n\tadd_filter( 'default_site_option_ms_files_rewriting', '__return_true' );\n\n\tif ( ! get_site_option( 'ms_files_rewriting' ) )\n\t\treturn;\n\n\t// Base uploads dir relative to ABSPATH\n\tif ( !defined( 'UPLOADBLOGSDIR' ) )\n\t\tdefine( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' );\n\n\t// Note, the main site in a post-MU network uses wp-content/uploads.\n\t// This is handled in wp_upload_dir() by ignoring UPLOADS for this case.\n\tif ( ! defined( 'UPLOADS' ) ) {\n\t\tdefine( 'UPLOADS', UPLOADBLOGSDIR . \"/{$wpdb->blogid}/files/\" );\n\n\t\t// Uploads dir relative to ABSPATH\n\t\tif ( 'wp-content/blogs.dir' == UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) )\n\t\t\tdefine( 'BLOGUPLOADDIR', WP_CONTENT_DIR . \"/blogs.dir/{$wpdb->blogid}/files/\" );\n\t}\n}", "public function _strings_for_pot() {\n\t\t/* translators: Localized date format, see https://www.php.net/date */\n\t\t__( 'F j, Y' );\n\t\t/* translators: Localized time format, see https://www.php.net/date */\n\t\t__( 'g:i a' );\n\t\t/* translators: Localized date and time format, see https://www.php.net/date */\n\t\t__( 'F j, Y g:i a' );\n\t}", "public static function defines()\n {\n define('STRUCTURE_DATA' , self::data());\n define('CURRENT_COPEN_PAGE' , STRUCTURE_DATA['openFunction']);\n define('CURRENT_CFPARAMETERS', STRUCTURE_DATA['parameters']);\n define('CURRENT_CFILE' , STRUCTURE_DATA['file']);\n define('CURRENT_CFUNCTION' , STRUCTURE_DATA['function']);\n define('CURRENT_CPAGE' , ($page = STRUCTURE_DATA['page']) . '.php');\n define('CURRENT_CONTROLLER' , $page);\n define('CURRENT_CNAMESPACE' , $namespace = STRUCTURE_DATA['namespace'] );\n define('CURRENT_CCLASS' , $namespace . CURRENT_CONTROLLER);\n define('CURRENT_CFPATH' , str_replace\n (\n CONTROLLERS_DIR, '', CURRENT_CONTROLLER) . '/' . CURRENT_CFUNCTION\n );\n define('CURRENT_CFURI' , strtolower(CURRENT_CFPATH));\n define('CURRENT_CFURL' , Request::getSiteURL() . CURRENT_CFPATH);\n }", "function settings_callback(){\n\trequire_once(COMPILER_PATH.\"templates/settings.php\");\n}", "function theme_init() {\n\n\t\tstatic $loaded;\n\n\t\tif ( $loaded ) {\n\t\t\treturn;\n\t\t} else {\n\t\t\t$loaded = true;\n\t\t}\n\n\t\t$config = apply_filters( 'publisher-theme-core/post-fields/config', array(\n\t\t\t'subtitle' => $this->subtitle,\n\t\t\t'subtitle-meta-id' => $this->subtitle_meta_id,\n\t\t\t'subtitle-default' => $this->subtitle_default,\n\t\t\t'excerpt' => $this->excerpt,\n\t\t) );\n\n\t\t$this->subtitle = isset( $config['subtitle'] ) ? $config['subtitle'] : $this->subtitle;\n\n\t\t$this->subtitle_meta_id = isset( $config['subtitle-meta-id'] ) ? $config['subtitle-meta-id'] : $this->subtitle_meta_id;\n\n\t\t$this->subtitle_default = isset( $config['subtitle-default'] ) ? $config['subtitle-default'] : $this->subtitle_default;\n\n\t\t$this->excerpt = isset( $config['excerpt'] ) ? $config['excerpt'] : $this->excerpt;\n\n\t\t// Compatibility for third party plugins with same functionality\n\t\tif ( $this->subtitle ) {\n\t\t\t$this->other_plugin_compatibility();\n\t\t}\n\n\t\tif ( $this->subtitle ) {\n\n\t\t\t// Add subtitle support to posts\n\t\t\tadd_post_type_support( 'post', 'bs_subtitle' );\n\n\t\t}\n\n\t\tif ( ( is_admin() && ! bf_is_doing_ajax() ) && ( $this->subtitle || $this->excerpt ) ) {\n\t\t\tadd_action( 'admin_init', array( $this, 'admin_init' ) );\n\t\t}\n\n\t}", "protected function _setTemplateMeta(){\n $this->template->project_name = $this->config['project']['name'] ;\n $this->template->title = $this->config['view']['title'] ;\n $this->template->keywords = $this->config['view']['keywords'];\n $this->template->description = $this->config['view']['description'];\n }" ]
[ "0.85753495", "0.7227877", "0.7188217", "0.69760865", "0.69572526", "0.6908326", "0.66635805", "0.6513728", "0.63636035", "0.63473785", "0.6332199", "0.62888145", "0.62441224", "0.62306416", "0.6228174", "0.62086886", "0.6141833", "0.6123586", "0.6114036", "0.6113174", "0.60899", "0.6078874", "0.60671383", "0.6054289", "0.60205805", "0.5965011", "0.5961557", "0.5959763", "0.5929097", "0.59189564", "0.5876922", "0.5867998", "0.58609205", "0.5855941", "0.5818847", "0.5810466", "0.5790517", "0.5780665", "0.5757462", "0.5755105", "0.57446116", "0.5733911", "0.57198596", "0.57179195", "0.57054514", "0.5705384", "0.56777215", "0.5668363", "0.5667749", "0.5659604", "0.56525165", "0.5636132", "0.5627843", "0.5614071", "0.56070435", "0.5600743", "0.5585337", "0.55843866", "0.55667573", "0.55600107", "0.5555967", "0.554901", "0.554572", "0.5542878", "0.5534453", "0.5533028", "0.5530275", "0.5530191", "0.55284196", "0.5527732", "0.55238175", "0.55233777", "0.5523287", "0.5519069", "0.5516021", "0.5513293", "0.5506451", "0.5502207", "0.5501905", "0.5501324", "0.5496227", "0.5494881", "0.549239", "0.54906553", "0.54888064", "0.5487779", "0.5486954", "0.54767025", "0.5471948", "0.54714596", "0.54712826", "0.5469859", "0.5467187", "0.5464429", "0.5463432", "0.5460069", "0.54585814", "0.54565716", "0.54564196", "0.5444161" ]
0.795855
1
Retrieves the theme framework class and initalises it.
function WPF() { global $wpf_classes; $theme_class = wpf_get_class( 'theme' ); return $wpf_classes['theme'] = new $theme_class; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_theme_framework() {\n\treturn \\Classy\\Classy::get_instance();\n}", "function MicroBuilder_Theme_Factory () {}", "public static function getTheme()\n {\n $className = static::getCalledClass();\n while (!StringHandler::endsWith($className, \"App\")) {\n $className = get_parent_class($className);\n if ($className === false) {\n $className = \"\";\n break;\n }\n if (strpos($className, \"\\\\\") !== 0) {\n $className = \"\\\\\" . $className;\n }\n }\n $theme = Kernel::getService('em')\n ->getRepository('RZ\\Roadiz\\Core\\Entities\\Theme')\n ->findOneBy(['className' => $className]);\n return $theme;\n }", "public function getTheme();", "function blank_theme_get_theme_instance() {\n\treturn Blank_Theme\\Inc\\Blank_Theme::get_instance();\n}", "function mapti() {\n return MyArcadeThemeIntegration::instance();\n}", "function rovadex() {\n\treturn Rovadex_Theme::get_instance();\n}", "public function getTheme()\n\t{\n\t\t$theme = new Theme($this->theme);\n\t\treturn $theme;\n\t}", "function helper()\n{\n return TFThemeHelper::getInstance();\n}", "function bp_theme_autoloader($class) {\n\n if (strpos($class,'Theme') !== 0) {return false;}\n $class = str_replace('Theme\\\\','',$class);\n $file = strtolower(str_replace('\\\\','-',$class));\n $file = str_replace('_','-',$file);\n $file = array_unique(explode('-',$file));\n $file = implode('-',$file);\n $file = get_template_directory() . '/inc/' . $file;\n $file .= '.php';\n require $file;\n\n}", "function getClass() {\n\t\treturn $this->classname ? $this->classname : \"theme\".\"1\";//rand(1, 6);\n\t}", "public function themeFramework()\r\n\t{\r\n\t\treturn 'angular';\r\n\t}", "function init_theme() {\r\n\r\n\t\t$possible_names = self::get_theme_name();\r\n\r\n\t\tforeach( $possible_names as $type => $name ){\r\n\r\n\t\t\t$theme_class = \"WP_Job_Manager_Field_Editor_Themes_\" . ucfirst( $name );\r\n\r\n\t\t\tif( class_exists( $theme_class ) ) {\r\n\t\t\t\t$theme = new $theme_class();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "function Themecloud() {\n return Themecloud::getInstance();\n}", "public static function get_core_default_theme()\n {\n }", "public function getTheme(): ?Theme\n {\n $this->getStopwatch()->start('getTheme');\n /** @var ThemeResolverInterface $themeResolver */\n $themeResolver = $this->get(ThemeResolverInterface::class);\n if (null === $this->theme) {\n $className = new UnicodeString(static::getCalledClass());\n while (!$className->endsWith('App')) {\n $className = get_parent_class($className->toString());\n if ($className === false) {\n $className = new UnicodeString('');\n break;\n }\n $className = new UnicodeString($className);\n }\n $this->theme = $themeResolver->findThemeByClass($className->toString());\n }\n $this->getStopwatch()->stop('getTheme');\n return $this->theme;\n }", "function &my_theme() \n{\n return MY_Theme::get_instance();\n}", "protected function getTheme()\n {\n if ($this->theme == null) {\n $this->theme = new Theme($this->app['view'], $this->options['theme'], $this->options['custom']);\n }\n\n return $this->theme;\n }", "public function getTheme()\n {\n $this->appinfo['theme_vendor'] = DEF_VENDOR;\n $this->appinfo['theme_directory'] = DEF_THEME;\n $this->appinfo['theme_path'] = DIR_APP.DIRECTORY_SEPARATOR.$this->appinfo['theme_vendor'].DIRECTORY_SEPARATOR.DIR_THEMES.DIRECTORY_SEPARATOR.$this->appinfo['theme_directory'];\n $this->appinfo['theme_webpath'] = DIR_APP.'/'.$this->appinfo['theme_vendor'].'/'.DIR_THEMES.'/'.$this->appinfo['theme_directory'];\n }", "public function getTheme()\n {\n return new Kuler_Theme($this->_comment);\n }", "public function getTheme() {\n $templateFacade = $this->dependencyInjector->get('ride\\\\library\\\\template\\\\TemplateFacade');\n\n return $templateFacade->getDefaultTheme();\n }", "public static function getInstance() {\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new ThemeSetup;\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public function getDesignTheme();", "public function createTheme(): ThemeInterface;", "public function createTheme(): ThemeInterface;", "public function get_theme() {\n return $this->_theme;\n }", "function ci_theme_classes()\n{\n\t$version = str_replace('.', '-', CI_THEME_VERSION);\n\t$classes['theme'] = \"ci-\" . CI_THEME_NAME;\n\t$classes['theme_version'] = \"ci-\" . CI_THEME_NAME . '-' . $version;\n\treturn $classes;\t\n}", "function wpt_autoload($class)\n{ \n //if( strpos($class, 'WPtheme\\\\') !== 0 ) return;\n if( 0 !== strpos($class, 'WPTheme\\\\') OR strlen($class) <= 8 ) return;\n\n $class = substr($class, 8);\n \n $library = THEME_DIR . '/library';\n\n if( $class === 'Theme' )\n {\n require $library . '/theme.php';\n return;\n }\n\n $path = $library . '/classes/' . str_replace('\\\\','/',strtolower($class)) . '.php';\n\n if( is_file($path) ) \n { \n require $path;\n }\n\n}", "public static function getTheme ()\n {\n $config = Zend_Registry::get('config');\n\n return $config->app->theme;\n }", "function mu_themes_in_use(){$this->__construct();}", "function get_current_theme()\n {\n }", "public function initTheme($theme_name);", "public function createDefaultDriver()\n {\n return new Theme($this->defaultThemeName);\n }", "public function getTheme()\n {\n return $this->theme;\n }", "public function getTheme()\n {\n return $this->theme;\n }", "public function getTheme()\n {\n return $this->theme;\n }", "public function getTheme()\n\t{\n\t\treturn $this->theme;\n\t}", "public function get_theme_root()\n {\n }", "public function setup_theme()\n {\n }", "function _getThemeClassPath( $theme_name ) {\n $path = MB_CONF_PREFIX . \"/phplib/themes/$theme_name/$theme_name.php\";\n if ( ! file_exists($path) ) {\n $errstack =& PEAR_ErrorStack::singleton( 'MicroBuilder' );\n $errstack->push( MB_NONEXISTENT_THEME, \n 'fatal',\n array('theme' => $theme_name,\n 'path' => $path ) );\n return null;\n }\n\n return $path;\n }", "public function getCurrentTheme()\n {\n return $theme = $this->config->theming->theme;\n }", "public static function setup()\n {\n $theme = static::getTheme();\n\n $className = static::getCalledClass();\n\n if ($theme === null) {\n $theme = new Theme();\n $theme->setClassName($className);\n $theme->setBackendTheme(static::isBackendTheme());\n $theme->setAvailable(true);\n\n Kernel::getService('em')->persist($theme);\n Kernel::getService('em')->flush();\n\n return true;\n }\n\n return false;\n }", "public static function get_theme_class_map() {\n return self::$theme_class_map;\n }", "function get_themes()\n {\n }", "function tt_theme_customize_setup(){\n new TT_Theme_Customizer();\n}", "public function getTheme ()\r\n\t{\r\n\t\treturn Tg_Site::getTheme($this->themeId);\r\n\t}", "public function getThemeClass($suffix = null)\n\t{\n\t\t// a list of allowed suffix\n\t\t$lookup = array(\n\t\t\t'background',\n\t\t\t'color',\n\t\t);\n\n\t\tif (is_null($suffix))\n\t\t{\n\t\t\t// use all supported suffix\n\t\t\t$suffix = $lookup;\n\t\t}\n\t\telse if (!is_array($suffix))\n\t\t{\n\t\t\t// use only the specified suffix\n\t\t\t$suffix = array($suffix);\n\t\t}\n\n\t\t// get theme setting (light or dark)\n\t\t$theme = UIFactory::getConfig()->get('sitetheme', '');\n\t\t$class = array();\n\n\t\tif ($theme)\n\t\t{\n\t\t\t// iterate the specified list\n\t\t\tforeach ($suffix as $tmp)\n\t\t\t{\n\t\t\t\t// if supported, push the class suffix within the list\n\t\t\t\tif (in_array($tmp, $lookup))\n\t\t\t\t{\n\t\t\t\t\t$class[] = $theme . '-theme-' . $tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// join the classes with a blank space\n\t\treturn implode(' ', $class);\n\t}", "public function _get_def_user_theme()\n {\n if ( ! empty($this->_def_user_theme)) {\n return $this->_def_user_theme;\n }\n //\t\t$sites = conf('sites_info');\n //\t\t$first = array_shift($sites);\n //\t\tif (file_exists(PROJECT_PATH. $this->_THEMES_PATH. $first['DEFAULT_SKIN']. '/')) {\n //\t\t\t$this->_def_user_theme = $first['DEFAULT_SKIN'];\n //\t\t}\n if (empty($this->_def_user_theme)) {\n $this->_def_user_theme = 'user';\n }\n return $this->_def_user_theme;\n }", "function load_titan_pro_theme() {\n\t$GLOBALS['titan'] = new Titan;\n}", "function get_theme ()\r\n {\r\n return $_SESSION[\"theme\"];\r\n }", "function instantiate() {\n\t\t$GLOBALS['wp_customize'] = new WP_Customize_Manager();\n\t\treturn $GLOBALS['wp_customize'];\n\t}", "function wpt()\n{\n return \\WPTheme\\Theme::instance();\n}", "protected function _getCurrentTheme()\n {\n return $this->_coreRegistry->registry('current_theme');\n }", "protected static function getFacadeAccessor() { return 'themes'; }", "function HN_CustomThemeThesis()\n {\n global $HNCustomThemeThesis;\n\n if (!isset($HNCustomThemeThesis)) {\n $HNCustomThemeThesis = new CustomThemeThesis();\n }\n\n return $HNCustomThemeThesis;\n }", "public function __construct() {\n\n\t\t// Setup empty class for the global $wpex_theme object\n\t\tglobal $wpex_theme;\n\t\t$wpex_theme = new stdClass;\n\n\t\t// Defines hooks and runs actions on init\n\t\tadd_action( 'init', array( $this, 'actions' ), 0 );\n\n\t\t// Define constants\n\t\tadd_action( 'after_setup_theme', array( $this, 'constants' ), 1 );\n\n\t\t// Load all the theme addons\n\t\tadd_action( 'after_setup_theme', array( &$this, 'addons' ), 2 );\n\n\t\t// Load configuration classes (post types & 3rd party plugins)\n\t\t// Must load first so it can use hooks defined in the classes\n\t\tadd_action( 'after_setup_theme', array( &$this, 'configs' ), 3 );\n\n\t\t// Load all core theme function files\n\t\tadd_action( 'after_setup_theme', array( &$this, 'include_functions' ), 4 );\n\n\t\t// Load framework classes\n\t\tadd_action( 'after_setup_theme', array( &$this, 'classes' ), 5 );\n\n\t\t// Load custom widgets\n\t\tadd_action( 'after_setup_theme', array( &$this, 'custom_widgets' ), 5 );\n\n\t\t// Populate the global opject after all core functions are registered and after the WP object is set up\n\t\t// Would be best to use template_redirect, but need to use wp_head to fix a bug with the Visual Composer Media Grid builder...\n\t\tadd_action( 'wp_head', array( $this, 'global_object' ), 0 );\n\n\t\t// Actions & filters\n\t\tadd_action( 'after_setup_theme', array( &$this, 'add_theme_support' ) );\n\n\t\t// Flush rewrites after theme switch to prevent 404 errors\n\t\tadd_action( 'after_switch_theme', array( &$this, 'flush_rewrite_rules' ) );\n\n\t\t// Load scripts in the WP admin\n\t\tadd_action( 'admin_enqueue_scripts', array( &$this, 'admin_scripts' ) );\n\n\t\t// Load theme CSS\n\t\tadd_action( 'wp_enqueue_scripts', array( &$this, 'theme_css' ) );\n\n\t\t// Load responsive CSS - must be added last\n\t\tadd_action( 'wp_enqueue_scripts', array( &$this, 'responsive_css' ), 99 );\n\n\t\t// Load theme js\n\t\tadd_action( 'wp_enqueue_scripts', array( &$this, 'theme_js' ) );\n\n\t\t// Add meta viewport tag to header\n\t\tadd_action( 'wp_head', array( &$this, 'meta_viewport' ), 1 );\n\n\t\t // Add meta viewport tag to header\n\t\tadd_action( 'wp_head', array( &$this, 'meta_edge' ), 0 );\n\n\t\t// Loads CSS for ie8\n\t\tadd_action( 'wp_head', array( &$this, 'ie8_css' ) );\n\n\t\t// Loads html5 shiv script\n\t\tadd_action( 'wp_head', array( &$this, 'html5_shiv' ) );\n\n\t\t// Adds tracking code to the site head\n\t\tadd_action( 'wp_head', array( &$this, 'tracking' ) );\n\n\t\t// Outputs custom CSS to the head\n\t\tadd_action( 'wp_head', array( &$this, 'custom_css' ), 9999 );\n\n\t\t// register sidebar widget areas\n\t\tadd_action( 'widgets_init', array( &$this, 'register_sidebars' ) );\n\n\t\t// Define the directory URI for the gallery metabox calss\n\t\tadd_action( 'wpex_gallery_metabox_dir_uri', array( &$this, 'gallery_metabox_dir_uri' ) );\n\n\t\t// Alter tagcloud widget to display all tags with 1em font size\n\t\tadd_filter( 'widget_tag_cloud_args', array( &$this, 'widget_tag_cloud_args' ) );\n\n\t\t// Alter WP categories widget to display count inside a span\n\t\tadd_filter( 'wp_list_categories', array( &$this, 'wp_list_categories_args' ) );\n\n\t\t// Exclude categories from the blog page\n\t\tadd_filter( 'pre_get_posts', array( &$this, 'pre_get_posts' ) );\n\n\t\t// Add new social profile fields to the user dashboard\n\t\tadd_filter( 'user_contactmethods', array( &$this, 'add_user_social_fields' ) );\n\n\t\t// Add a responsive wrapper to the WordPress oembed output\n\t\tadd_filter( 'embed_oembed_html', array( &$this, 'add_responsive_wrap_to_oembeds' ), 99, 4 );\n\n\t\t// Allow for the use of shortcodes in the WordPress excerpt\n\t\tadd_filter( 'the_excerpt', 'shortcode_unautop' );\n\t\tadd_filter( 'the_excerpt', 'do_shortcode' );\n\n\t\t// Make sure the wp_get_attachment_url() function returns correct page request (HTTP or HTTPS)\n\t\tadd_filter( 'wp_get_attachment_url', array( &$this, 'honor_ssl_for_attachments' ) );\n\n\t\t// Tweak the default password protection output form\n\t\tadd_filter( 'the_password_form', array( &$this, 'custom_password_protected_form' ) );\n\n\t\t// Exclude posts with custom links from the next and previous post links\n\t\tadd_filter( 'get_previous_post_join', array( &$this, 'prev_next_join' ) );\n\t\tadd_filter( 'get_next_post_join', array( &$this, 'prev_next_join' ) );\n\t\tadd_filter( 'get_previous_post_where', array( &$this, 'prev_next_where' ) );\n\t\tadd_filter( 'get_next_post_where', array( &$this, 'prev_next_where' ) );\n\n\t\t// Redirect posts with custom links\n\t\tadd_filter( 'template_redirect', array( &$this, 'redirect_custom_links' ) );\n\n\t}", "public function getTheme()\n {\n return _THEME_NAME_;\n }", "function current_theme()\n {\n return current_theme();\n }", "public function getTheme () {\n $admin = Yii::app()->settings;\n \n if ($admin->enforceDefaultTheme && $admin->defaultTheme !== null) {\n $theme = $this->getDefaultTheme ();\n if ($theme) return $theme;\n } \n \n return $this->theme;\n }", "public function setDefaultDesignTheme();", "public function __construct( $theme = array() ) {\r\n\t\t$this->theme = $theme;\r\n\r\n\t\t$theme = wp_get_theme();\r\n\t\t$arr = array(\r\n\t\t\t'theme-name' => $theme->get( 'Name' ),\r\n\t\t\t'theme-slug' => $theme->get( 'TextDomain' ),\r\n\t\t\t'theme-version' => $theme->get( 'Version' ),\r\n\t\t);\r\n\r\n\t\t$this->theme = wp_parse_args( $this->theme, $arr );\r\n\t\t/**\r\n\t\t * If PHP Version is older than 5.3, we switch back to default theme\r\n\t\t */\r\n\t\tadd_action( 'admin_init', array( $this, 'php_version_check' ) );\r\n\t\t/**\r\n\t\t * Init epsilon dashboard\r\n\t\t */\r\n\t\tadd_filter( 'epsilon-dashboard-setup', array( $this, 'epsilon_dashboard' ) );\r\n\t\tadd_filter( 'epsilon-onboarding-setup', array( $this, 'epsilon_onboarding' ) );\r\n /**\r\n * Enqueue styles and scripts\r\n */\r\n add_action( 'wp_enqueue_scripts', array( $this, 'enqueues' ) );\r\n\t\t/**\r\n\t\t * Customizer enqueues & controls\r\n\t\t */\r\n\t\tadd_action( 'customize_register', array( $this, 'customize_register_init' ) );\r\n\t\t/**\r\n\t\t * Declare content width\r\n\t\t */\r\n\t\tadd_action( 'after_setup_theme', array( $this, 'content_width' ), 10 );\r\n\r\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'customizer_styles' ), 99 );\r\n\t\t/**\r\n\t\t * Grab all class methods and initiate automatically\r\n\t\t */\r\n\t\t$methods = get_class_methods( 'unapp' );\r\n\t\tforeach ( $methods as $method ) {\r\n\t\t\tif ( false !== strpos( $method, 'init_' ) ) {\r\n\t\t\t\t$this->$method();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function getCurrnetTheme(){\n\n\t\t\t$theme = Cache::read('currentTheme');\n\n\t\t\tif ($theme == false) {\n\t\t\t\t$theme = $this->find(\n\t\t\t\t\t'first',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t\t'Theme.active' => 1\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\tCache::write('currentTheme', $theme, 'core');\n\n\t\t\treturn $theme;\n\t\t}", "public function init(Theme $theme)\n {\n\n }", "protected function theme($theme) {\n if(is_string($theme)){\n $theme = AppTheme::load($theme);\n }\n return parent::theme($theme);\n }", "function the_core_get_the_theme_id() {\n\treturn 'the-core';\n}", "private function initStyle(){\n\t\t\t$file_style_normal = $this->root_path.'portal/realmstatus/wowclassic/styles/wowstatus.style_normal.class.php';\n\t\t\t$file_style_gdi = $this->root_path.'portal/realmstatus/wowclassic/styles/wowstatus.style_gdi.class.php';\n\t\t\t\n\t\t\t// include the files\n\t\t\tinclude_once($file_style_normal);\n\t\t\tinclude_once($file_style_gdi);\n\t\t\t\n\t\t\t// get class\n\t\t\tif ($this->config->get('gd', 'pmod_'.$this->moduleID))\n\t\t\t\t$this->style = registry::register('wowstatus_style_gdi');\n\t\t\t\telse\n\t\t\t\t\t$this->style = registry::register('wowstatus_style_normal');\n\t\t}", "function wpf_get_class( $class ) {\n\tglobal $wpf_classes;\n\t\n\tif ( isset($wpf_classes[$class]) )\n\t\treturn $wpf_classes[$class];\n\t\n\tif ( isset($wpf_classes['admin'][$class]) )\n\t\treturn $wpf_classes['admin'][$class];\n\t\n\tif ( isset($wpf_classes['static'][$class]) )\n\t\treturn $wpf_classes['static'][$class];\n\t\n\tif ( isset($wpf_classes['autoload'][$class]) )\n\t\treturn $wpf_classes['autoload'][$class];\n\t\n\tif ( isset($wpf_classes['contextual'][$class]) )\n\t\treturn $wpf_classes['contextual'][$class];\n\t\n\treturn false;\n}", "public function theme()\n {\n }", "function autodidact_theme_setup() {\n\n}", "protected function createThemeModel()\n {\n return new ThemeModel();\n }", "public function apply_theme()\n\t{\n\t\treturn 'twentyten';\n\t}", "function get_theme_mods()\n {\n }", "public static function getMyTheme()\n {\n $paramArray = (\\Config\\Site::getAllParams());\n return ($paramArray['hash'])?'Flexi':'';\n }", "public static function load_themes()\n\t{\n\t\t$config = Kohana::$config->load('site');\n\n\t\t//set admin theme based on path info\n\t\t$path = ltrim(Request::detect_uri(), '/');\n\t\tTheme::$is_admin = ( $path == \"admin\" || !strncmp($path, \"admin/\", 6) );\n\n\t\tif (Theme::$is_admin)\n\t\t{\n\t\t\t// Load the admin theme\n\t\t\tTheme::$admin_theme_name = $config->get('admin_theme', Theme::$admin_theme_name);\n\t\t\tTheme::$active = Theme::$admin_theme_name;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Load the site theme\n\t\t\tTheme::$site_theme_name = $config->get('theme', Theme::$site_theme_name);\n\t\t\tTheme::$active = Theme::$site_theme_name;\n\t\t}\n\t\n\t\t//Set mobile theme, if enabled and mobile request\n\t\tif(Request::is_mobile() AND $config->get('mobile_theme', FALSE))\n\t\t{\n\t\t\t// Load the mobile theme\n\t\t\tTheme::$site_theme_name = $config->get('mobile_theme', Theme::$site_theme_name);\n\t\t\tTheme::$active = Theme::$site_theme_name;\n\t\t}\n\t\n\t\t// Admins can override the site theme, temporarily. This lets us preview themes.\n\t\tif (User::is_admin() AND isset($_GET['theme']) AND $override = $_GET['theme'])\n\t\t{\n\t\t\tif (file_exists(THEMEPATH.$override))\n\t\t\t{\n\t\t\t\tTheme::$site_theme_name = $override;\n\t\t\t\tTheme::$admin_theme_name = $override;\n\t\t\t\tTheme::$active \t\t = $override;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tKohana::$log->add(LOG::ERROR, 'Missing override site theme: :theme', array(':theme' => $override));\n\t\t\t}\n\t\t}\n\n\t\t//Finally set the active theme\n\t\tTheme::set_theme();\n\t}", "function purity_theme_init() {\n elgg_extend_view('page/elements/head', 'purity_theme/meta');\n elgg_unregister_menu_item('topbar', 'elgg_logo');\n\telgg_register_plugin_hook_handler('index', 'system', 'purity_theme');\n}", "protected function get() : string\n\t{\n\t\treturn $this->app->config->theme;\n\t}", "public function getThemeName() {}", "protected function getTheme()\n {\n return !empty($_GET['theme']) ? $_GET['theme'] : 'basic';\n }", "public function registerTheme()\n {\n $this->app->singleton(ThemeContract::class, function ($app) {\n return new Theme($app, $this->app['view']->getFinder(), $this->app['config'], $this->app['translator']);\n });\n }", "function wp_get_theme($stylesheet = '', $theme_root = '')\n {\n }", "public function getFramework() {\r\n\t\treturn $this->context->getState('framework');\r\n\t}", "function load()\n {\n self::loadScriptsAndStyles($this->m_themeLoad ? $this->m_themeName : false);\n }", "public function ThemeEngineRender(){\n\t\t// Get the path and settings for the Theme\n\t\t$themeName = $this->config['theme']['name'];\n\t\t$themePath = RAND_INSTALL_PATH . \"/themes/{$themeName}\";\n\t\t$themeUrl = $this->request->base_url . \"themes/{$themeName}\"; \n\n\t\t//Add stylesheet\n\t\t$this->data['stylesheet'] = \"{$themeUrl}/style.css\";\n\n\t\t//Include global functions and functions.php from the theme\n\t\t$rd = &$this;\n\t\t$globalFunctions = RAND_INSTALL_PATH . \"themes/functions.php\";\n\t\tif(is_file($globalFunctions)){\n\t\t\tinclude $globalFunctions;\n\t\t}\n\t\t$functionsPath = \"{$themePath}/functions.php\";\n\t\tif(is_file($functionsPath)){\n\t\t\tinclude $functionsPath;\n\t\t}\n\n\t\textract($this->data);\n\t\tinclude(\"{$themePath}/default.tpl.php\");\n\n\n\n\t}", "public function WidgetClass(){\r\n\t\tYii::import(\"application.GWidgets.\".\".W\".$this->widget);\r\n\t\t$cname='W'.$this->widget;\r\n\t\t$widget=new $cname($this->GTemp,$this);\r\n\t\treturn $widget;\r\n\t}", "public function theme_installer()\n {\n }", "public static function getThemesRoot()\n {\n return self::$themeRoot;\n }", "public function get_theme_name(){\n\t\treturn $this->current_theme;\n\t}", "function shell_body_class( $classes ){\r\n\r\n\t/* get all registered sidebars */\r\n\tglobal $wp_registered_sidebars;\r\n\r\n\t/* if not empty sidebar */\r\n\tif ( ! empty( $wp_registered_sidebars ) ){\r\n\r\n\t\t/* foreach widget areas */\r\n\t\tforeach ( $wp_registered_sidebars as $sidebar ){\r\n\r\n\t\t\t/* add active/inactive class */\r\n\t\t\t$classes[] = is_active_sidebar( $sidebar['id'] ) ? \"sidebar-{$sidebar['id']}-active\" : \"sidebar-{$sidebar['id']}-inactive\";\r\n\t\t}\r\n\t}\r\n\r\n\t/* get all registered menus */\r\n\t$menus = get_registered_nav_menus();\r\n\r\n\t/* if not empty menus */\r\n\tif ( ! empty( $menus ) ){\r\n\r\n\t\t/* for each menus */\r\n\t\tforeach ( $menus as $menu_id => $menu ){\r\n\r\n\t\t\t/* add active/inactive class */\r\n\t\t\t$classes[] = has_nav_menu( $menu_id ) ? \"menu-{$menu_id}-active\" : \"menu-{$menu_id}-inactive\";\r\n\t\t}\r\n\t}\r\n\r\n\t/* theme layout default */\r\n\tif ( ! current_theme_supports( 'theme-layouts' ) ) {\r\n\t\t$classes[] = 'layout-default';\r\n\t}\r\n\r\n\t/* make it unique */\r\n\t$classes = array_unique( $classes );\r\n\r\n\treturn $classes;\r\n}", "function theme(): Theme\n {\n if (! $name = preference('theme')) {\n throw new RuntimeException('Unable to determine the theme.');\n }\n\n if ($theme = model(ThemeModel::class)->where('name', $name)->first()) {\n return $theme;\n }\n\n throw new RuntimeException('Unable to locate the theme: ' . $name);\n }", "public function findTheme($themeName);", "function get_theme_info(){\n\tglobal $theme;\n\treturn $theme->get_theme_info();\n}", "function wprt_preloader_class() {\n\t// Get preloader option from theme mod\n\t$class = wprt_get_mod( 'preloader', 'animsition' );\n\n\t// Return classes for element\n\treturn esc_attr( $class );\n}", "public function init() {\n\t\t//theme needs to be set TWO times...\n\t\t//$theme = Session::get(\"theme\"); if(!$theme) {$theme = \"simple\";}SSViewer::set_theme($theme);\n\t\tparent::init();\n\t\t$theme = Config::inst()->get(\"SSViewer\", \"theme\");\n\t\tif($theme == \"main\") {\n\t\t\tRequirements::themedCSS('reset');\n\t\t\tRequirements::themedCSS('layout');\n\t\t\tRequirements::themedCSS('typography');\n\t\t\tRequirements::themedCSS('form');\n\t\t\tRequirements::themedCSS('menu');\n\n\t\t\tRequirements::themedCSS('ecommerce');\n\n\t\t\tRequirements::themedCSS('individualPages');\n\t\t\tRequirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');\n\t\t}\n\t\telseif($theme == \"simple\") {\n\t\t}\n\t}", "function get_theme_url()\n{\n $theme = Theme::GetTheme();\n return !is_null($theme) ? $theme->GetURL() : '';\n}", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core theme.\n\t\t */\n\t\trequire_once 'class-custom-theme-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the public area.\n\t\t */\n\t\trequire_once 'public/class-theme-public.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once 'admin/class-theme-admin.php';\n\n\n\t\t$this->loader = new Wpt_Custom_Theme_Loader();\n\n\t}", "final public function init(){\n\t\twp_register_style( 'tify-tinymce_template', self::tFyAppUrl() . '/theme.css', array(), '1.150317' );\n\t}", "public function add_theme_support() {\n\t}", "protected function registerClassLoader()\n {\n $namespace = $this->active()->get('namespace');\n $loader = new ClassLoader();\n\n $loader->addPsr4(\"Themes\\\\{$namespace}\\\\\", theme_path(\"{$namespace}/src\"));\n $loader->register();\n }", "public function getThemes() {\n if ($this->themes !== null) {\n return $this->themes;\n }\n\n $this->themes = parent::getThemes();\n\n $themes = $this->config->get('theme');\n if (!is_array($themes)) {\n return $this->themes;\n }\n\n foreach ($themes as $name => $theme) {\n if (isset($theme['name'])) {\n $displayName = $theme['name'];\n } else {\n $displayName = $name;\n }\n\n if (isset($theme['engine'])) {\n if (is_array($theme['engine'])) {\n $engines = $theme['engine'];\n } else {\n $engines = array($theme['engine']);\n }\n } else {\n $engines = array();\n }\n\n if (isset($theme['region'])) {\n $regions = $theme['region'];\n } else {\n $regions = array();\n }\n\n if (isset($theme['parent'])) {\n $parent = $theme['parent'];\n } else {\n $parent = null;\n }\n\n $this->themes[$name] = new GenericTheme($name, $displayName, $engines, $regions, $parent);\n }\n\n return $this->themes;\n }", "public function __construct()\n\t{\n\t\t$this->setup_theme();\n\t}" ]
[ "0.81507015", "0.7469958", "0.72667664", "0.7122472", "0.6817036", "0.67762583", "0.675122", "0.67499244", "0.6720505", "0.6668172", "0.6668109", "0.6668034", "0.6641717", "0.6619503", "0.66140324", "0.6592944", "0.65808904", "0.65739137", "0.6546103", "0.65253836", "0.6517875", "0.65067554", "0.6495469", "0.6466058", "0.6466058", "0.6458624", "0.6446441", "0.6420411", "0.6361802", "0.6347988", "0.6281536", "0.6213503", "0.6180747", "0.61483204", "0.61483204", "0.61483204", "0.61420465", "0.6124629", "0.6106093", "0.6087099", "0.60734576", "0.6067375", "0.6058719", "0.6045304", "0.59829664", "0.59771115", "0.5972312", "0.5958941", "0.5944569", "0.5934093", "0.5924022", "0.59152037", "0.5912105", "0.5898941", "0.5897485", "0.58955306", "0.5890168", "0.58784974", "0.58654904", "0.58624184", "0.5858854", "0.58310103", "0.58022076", "0.5793734", "0.5778214", "0.5776834", "0.5749046", "0.57318676", "0.57301766", "0.57211757", "0.5707143", "0.5691512", "0.5687942", "0.5681091", "0.56787705", "0.56779635", "0.5668614", "0.56460285", "0.5637963", "0.56201243", "0.5615662", "0.56023216", "0.55735004", "0.5568524", "0.55685", "0.55632776", "0.55622995", "0.5559582", "0.5557566", "0.5554969", "0.5551452", "0.5542626", "0.5539885", "0.55282515", "0.55279875", "0.55209374", "0.5519524", "0.5516869", "0.55062604", "0.5503608" ]
0.77236
1
Loads BuddyPress functionality if the plugin is active. Extend or override the WPF_BP class by registering your own 'bp' class.
function wpf_maybe_bp_init() { if ( !is_bp_active() ) return false; global $wpf_classes, $wpf_theme; require_once( WPF_DIR . '/classes/wpf-bp.php' ); $bp_class = wpf_get_class( 'bp' ); return $wpf_classes['bp'] = new $bp_class(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cp_load_bp_functions() {\n\t// least BuddyPress 1.5.\n\tif ( function_exists( 'bp_get_current_group_id' ) ) {\n\t\trequire_once( CP_PLUGIN_DIR . 'includes/cp-bp.php' );\n\t}else{\n\t\t//BuddyPress is older than 1.5, display a notice\n\t\tadd_action( 'admin_notices', create_function( '', 'echo \\'<div class=\"updated fade\"><p>CollabPress BuddyPress integration requires v1.5+ of BuddyPress to work. You can download a copy on the <a href=\"http://buddypress.org/blog/\" target=\"_blank\">BuddyPress site</a>.</p><p>Not ready to upgrade to BuddyPress 1.5? No problem. You can continue to use CollabPress - you just won&#39;t get any BuddyPress integration yet.</p></div>\\';' ) );\n\t}\n}", "function ddw_bptb_init() {\n\n\t/** Set filter for WordPress languages directory */\n\t$bptb_wp_lang_dir = BPTB_PLUGIN_BASEDIR . '/../../languages/buddypress-toolbar/';\n\t$bptb_wp_lang_dir = apply_filters( 'bptb_filter_wp_lang_dir', $bptb_wp_lang_dir );\n\n\t/** Set filter for plugin's languages directory */\n\t$bptb_lang_dir = BPTB_PLUGIN_BASEDIR . '/languages/';\n\t$bptb_lang_dir = apply_filters( 'bptb_filter_lang_dir', $bptb_lang_dir );\n\n\t/** First look in WordPress' \"languages\" folder = custom & update-secure! */\n\tload_plugin_textdomain( 'buddypress-toolbar', false, $bptb_wp_lang_dir );\n\n\t/** Then look in plugin's \"languages\" folder = default */\n\tload_plugin_textdomain( 'buddypress-toolbar', false, $bptb_lang_dir );\n\n\t/** Include admin helper functions */\n\tif ( is_admin() ) {\n\t\trequire_once( BPTB_PLUGIN_DIR . '/includes/bptb-admin.php' );\n\t}\n\n\t/** Define constants and set defaults for removing all or certain sections */\n\tif ( ! defined( 'BPTB_DISPLAY' ) ) {\n\t\tdefine( 'BPTB_DISPLAY', TRUE );\n\t}\n\n\tif ( ! defined( 'BPTB_EXTENSIONS_DISPLAY' ) ) {\n\t\tdefine( 'BPTB_EXTENSIONS_DISPLAY', TRUE );\n\t}\n\n\tif ( ! defined( 'BPTB_MANAGE_GROUPS_DISPLAY' ) ) {\n\t\tdefine( 'BPTB_MANAGE_GROUPS_DISPLAY', TRUE );\n\t}\n\n\tif ( ! defined( 'BPTB_THEME_DISPLAY' ) ) {\n\t\tdefine( 'BPTB_THEME_DISPLAY', TRUE );\n\t}\n\n\tif ( ! defined( 'BPTB_RESOURCES_DISPLAY' ) ) {\n\t\tdefine( 'BPTB_RESOURCES_DISPLAY', TRUE );\n\t}\n\n\tif ( ! defined( 'BPTB_DE_DISPLAY' ) ) {\n\t\tdefine( 'BPTB_DE_DISPLAY', TRUE );\n\t}\n\n\tif ( ! defined( 'BPTB_TRANSLATIONS_DISPLAY' ) ) {\n\t\tdefine( 'BPTB_TRANSLATIONS_DISPLAY', TRUE );\n\t}\n\n\tif ( ! defined( 'BPTB_REMOVE_BPMEDIA_TOOLBAR' ) ) {\n\t\tdefine( 'BPTB_REMOVE_BPMEDIA_TOOLBAR', FALSE );\n\t}\n\n}", "function bp_ning_import_bp_init() {\n\trequire( dirname( __FILE__ ) . '/bp-functions.php' );\n}", "function bbboing_init() {\r\n do_action( \"bbboing_loaded\" );\r\n}", "function bp_setup() {\n\n /*\n * Make theme available for translation.\n * Translations can be filed in the /languages/ directory.\n * If you're building a theme based on twentyfifteen, use a find and replace\n * to change 'twentyfifteen' to the name of your theme in all the template files\n */\n load_theme_textdomain( 'bp', get_template_directory() . '/languages' );\n\n // Add RSS feed links to <head> for posts and comments.\n add_theme_support( 'automatic-feed-links' );\n\n /*\n\t * Let WordPress manage the document title.\n\t * By adding theme support, we declare that this theme does not use a\n\t * hard-coded <title> tag in the document head, and expect WordPress to\n\t * provide it for us.\n\t */\n add_theme_support( 'title-tag' );\n\n /*\n\t * Enable support for Post Thumbnails on posts and pages.\n\t *\n\t * See: https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails\n\t */\n add_theme_support( 'post-thumbnails' );\n set_post_thumbnail_size( 825, 510, true );\n\n // This theme uses wp_nav_menu() in two locations.\n register_nav_menus( array(\n 'primary-nav' => __( 'Primary Navigation', 'bp' ),\n 'top-links' => __( 'Top Bar Links', 'bp' ),\n 'footer-links' => __( 'Footer Links', 'bp'),\n ) );\n\n /*\n\t * Switch default core markup for search form, comment form, and comments\n\t * to output valid HTML5.\n\t */\n add_theme_support( 'html5', array(\n 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'\n ) );\n\n /*\n\t * Enable support for Post Formats.\n\t *\n\t * See: https://codex.wordpress.org/Post_Formats\n\t */\n add_theme_support( 'post-formats', array(\n 'aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat'\n ) );\n\n}", "function bbboing_plugin_loaded() {\r\n add_action( \"init\", \"bbboing_init\" );\r\n add_action( \"oik_loaded\", \"bbboing_oik_loaded\" );\r\n add_action( \"oik_add_shortcodes\", \"bbboing_oik_add_shortcodes\" );\r\n add_action( \"admin_notices\", \"bbboing_activation\" );\r\n}", "function bbboing_activation() {\r\n static $plugin_basename = null;\r\n if ( !$plugin_basename ) {\r\n $plugin_basename = plugin_basename(__FILE__);\r\n add_action( \"after_plugin_row_bbboing/bbboing.php\", \"bbboing_activation\" ); \r\n if ( !function_exists( \"oik_plugin_lazy_activation\" ) ) { \r\n require_once( \"admin/oik-activation.php\" );\r\n } \r\n } \r\n $depends = \"oik:2.2\";\r\n //bw_backtrace();\r\n oik_plugin_lazy_activation( __FILE__, $depends, \"oik_plugin_plugin_inactive\" );\r\n}", "function thb_is_bbpress() {\n\t\treturn class_exists( 'bbPress' );\n\t}", "function exn_wc_billplz_gateway_load() {\n if ( !class_exists( 'WC_Payment_Gateway' ) ) {\n add_action( 'admin_notices', 'exn_wc_billplz_woocommerce_fallback_notice' );\n return;\n }\n\n define( 'EXN_WC_BILLPLZ_PATH', plugin_dir_path( __FILE__ ) );\n define( 'EXN_WC_BILLPLZ_URL', plugin_dir_url( __FILE__ ) );\n\n /**\n * Require Billplz class file to ensure WooCommerce can load it\n *\n */\n require_once( 'class/class-exn-wc-billplz.php' );\n\n /**\n * Add Billplz gateway to ensure WooCommerce can load it\n *\n * @param array $methods\n * @return array\n */\n function exn_wc_billplz_add_gateway( $methods ) {\n $methods[] = 'EXN_WC_Billplz';\n return $methods;\n }\n add_filter( 'woocommerce_payment_gateways', 'exn_wc_billplz_add_gateway' );\n}", "function load_jnews_plugin_activation() {\n\t\trequire_once get_parent_theme_file_path( 'tgm/class-jnews-plugin-activation.php' );\n\t\trequire_once get_parent_theme_file_path( 'tgm/class-tgm-plugin-activation.php' );\n\n\t\t$GLOBALS['jnews_tgmpa'] = JNews_Plugin_Activation::get_instance();\n\t}", "function bbboing_oik_loaded() { \r\n //bw_add_shortcode( 'bbboing', 'bbboing_sc', oik_path( \"bbboing.inc\", \"bbboing\" ), false );\r\n}", "function bl_register_required_plugins() {\r\n\r\n $options = get_option( 'bl_beaverlodge_settings' );\r\n\r\n // Include the 404 module.\r\n if ($options['bl_404_page'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-404page/bb-sw-404page.php';\r\n }\r\n\r\n // Include the animate text module.\r\n if ($options['bl_animate_text'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-animate-text/bb-sw-animate-text.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-animate-text/includes/bb-sw-animate-text-module.php';\r\n }\r\n \r\n // Include the bar chart module.\r\n if ($options['bl_bar_chart'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-bar-chart/bb-sw-bar-chart.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-bar-chart/includes/bb-sw-bar-chart-module.php';\r\n }\r\n \r\n // Include the onclick module.\r\n if ($options['bl_bootstrap_modal'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-bootstrap-modal/bb-sw-bootstrap-modal.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-bootstrap-modal/includes/bb-sw-bootstrap-modal-module.php';\r\n }\r\n \r\n // Include the caldera forms module.\r\n if(class_exists('Caldera_Forms')) {\r\n if ($options['bl_caldera'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-caldera/bb-sw-caldera.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-caldera/includes/bb-sw-caldera-module.php';\r\n }\r\n }\r\n \r\n // Include the contactform7 module.\r\n if(class_exists('WPCF7_ContactForm')) {\r\n if ($options['bl_cf7'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-contactform7/bb-sw-contactform7.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-contactform7/includes/bb-sw-contactform7-module.php';\r\n }\r\n }\r\n \r\n // Include the countdown module.\r\n if ($options['bl_countdown'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-countdown/bb-sw-counter.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-countdown/includes/bb-sw-counter-module.php';\r\n }\r\n \r\n // Include the dual callout module.\r\n if ($options['bl_dual_callout'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-dualcallout/bb-sw-dualcallout.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-dualcallout/includes/bb-sw-dualcallout-module.php';\r\n }\r\n \r\n // Include the ecommerce menu module.\r\n if ($options['bl_ecommerce_menu'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-ecommerce-menu/bb-sw-ecommerce-menu.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-ecommerce-menu/includes/bb-sw-ecommerce-menu-module.php';\r\n }\r\n \r\n // Include the facebook module.\r\n if ($options['bl_facebook'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-facebook/bb-sw-facebook.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-facebook/includes/bb-sw-facebook-module.php';\r\n }\r\n \r\n // Include the footer module.\r\n if ($options['bl_footer'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-footer/bb-sw-footer.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-footer/includes/bb-footer-module.php';\r\n }\r\n \r\n // Include the gmap module.\r\n if ($options['bl_gmap'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-gmap/bb-sw-gmap.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-gmap/includes/bb-sw-gmap-module.php';\r\n }\r\n \r\n // Include the gmap module.\r\n if ($options['bl_heading'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-heading/bb-sw-heading.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-heading/includes/bb-sw-heading-module.php';\r\n }\r\n \r\n // Include the hero header module.\r\n if ($options['bl_hero_header'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-hero-header/bb-sw-hero-header.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-hero-header/includes/bb-sw-hero-header-module.php';\r\n }\r\n \r\n // Include the hover card module.\r\n if ($options['bl_hover_card'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-hover-card/sw-bb-hover-card.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-hover-card/includes/bb-hover-card-module.php';\r\n }\r\n \r\n // Include the hover effects module.\r\n if ($options['bl_hover_effects'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-hover-effects/bb-sw-hover-effects.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-hover-effects/includes/bb-sw-hover-effects-module.php';\r\n }\r\n \r\n // Include the instagram module.\r\n if ($options['bl_instagram'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-instagram/bb-sw-instagram.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-instagram/includes/bb-sw-instagram-module.php';\r\n }\r\n \r\n // Include the login module.\r\n if ($options['bl_login'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-login/bb-sw-login.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-login/includes/bb-sw-login-module.php';\r\n function sw_redirect_login_page() {\r\n $login_page = home_url( '/login/' );\r\n $page_viewed = basename($_SERVER['REQUEST_URI']);\r\n\r\n if( $page_viewed == \"wp-login.php\" && $_SERVER['REQUEST_METHOD'] == 'GET') {\r\n wp_redirect($login_page);\r\n exit;\r\n }\r\n }\r\n add_action('init','sw_redirect_login_page');\r\n\r\n function sw_redirect_admin_page() {\r\n $login_page = home_url( '/login/' );\r\n $page_viewed = basename($_SERVER['REQUEST_URI']);\r\n\r\n if( $page_viewed == \"wp-admin.php\" && $_SERVER['REQUEST_METHOD'] == 'GET') {\r\n wp_redirect($login_page);\r\n exit;\r\n }\r\n }\r\n add_action('init','sw_redirect_admin_page');\r\n\r\n function sw_login_failed() {\r\n $login_page = home_url( '/login/' );\r\n wp_redirect( $login_page . '?login=failed' );\r\n exit;\r\n }\r\n add_action( 'wp_login_failed', 'sw_login_failed' );\r\n\r\n function sw_verify_username_password( $user, $username, $password ) {\r\n $login_page = home_url( '/login/' );\r\n if( $username == \"\" || $password == \"\" ) {\r\n wp_redirect( $login_page . \"?login=empty\" );\r\n exit;\r\n }\r\n }\r\n add_filter( 'authenticate', 'sw_verify_username_password', 1, 3);\r\n\r\n function sw_logout_page() {\r\n $login_page = home_url( '/login/' );\r\n wp_redirect( $login_page . \"?login=false\" );\r\n exit;\r\n }\r\n add_action('wp_logout','sw_logout_page');\r\n\r\n function sw_login_page() {\r\n\r\n $title = 'Login';\r\n\r\n if (!get_page_by_title($title, 'OBJECT', 'page') ){\r\n\r\n $login_page = array(\r\n\r\n 'post_title' => $title,\r\n 'post_content' => 'Use this page to customise the Login Page.',\r\n 'post_status' => 'publish',\r\n 'post_type' => 'page',\r\n );\r\n\r\n wp_insert_post( $login_page );\r\n\r\n }\r\n\r\n }\r\n add_action('init','sw_login_page'); \r\n }\r\n \r\n // Include the masonry module.\r\n if ($options['bl_masonry'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-masonry-module/bb-sw-gallery.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-masonry-module/includes/bb-sw-masonry.php';\r\n }\r\n \r\n // Include the news ticker module.\r\n if ($options['bl_news_ticker'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-news-ticker/bb-sw-news-ticker.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-news-ticker/includes/bb-sw-news-ticker-module.php';\r\n }\r\n \r\n // Include the next page module.\r\n if ($options['bl_next_page'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-nextpage/bb-sw-nextpage.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-nextpage/includes/bb-sw-nextpage-module.php';\r\n }\r\n \r\n // Include the pinterest layout module.\r\n if ($options['bl_pinterest'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-pinterest-layout/bb-sw-pinterest-layout.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-pinterest-layout/includes/bb-sw-pinterest-layout-module.php';\r\n }\r\n \r\n // Include the popup module.\r\n if ($options['bl_popup'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-popup/bb-sw-popup.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-popup/includes/bb-sw-popup-module.php';\r\n }\r\n \r\n // Include the portfolio module.\r\n if ($options['bl_portfolio'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-portfolio/bb-sw-portfolio.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-portfolio/includes/bb-sw-portfolio-module.php';\r\n }\r\n \r\n // Include the resizer module.\r\n if ($options['bl_resizer'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-resizer/bb-sw-resizer.php';\r\n }\r\n \r\n // Include the social module.\r\n if ($options['bl_social'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/sw-bb-socialshare/sw-bb-socialshare.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/sw-bb-socialshare/includes/bb-sw-socialshare-module.php';\r\n }\r\n \r\n // Include the tables module.\r\n if ($options['bl_tables'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-tables/bb-sw-tables.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-tables/includes/bb-sw-tables-module.php';\r\n }\r\n \r\n // Include the toolbar module.\r\n if ($options['bl_toolbar_cta'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-toolbar-cta/bb-sw-toolbar-cta.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-toolbar-cta/includes/bb-sw-toolbar-cta-module.php';\r\n }\r\n \r\n // Include the tooltips module.\r\n if ($options['bl_tooltips'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-tooltips/bb-sw-tooltip.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-tooltips/includes/bb-sw-tooltip-module.php';\r\n }\r\n \r\n // Include the turbotabs module.\r\n if ($options['bl_turbotabs'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-turbotabs/bb-sw-turbotabs.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-turbotabs/includes/bb-sw-turbotabs-module.php';\r\n }\r\n \r\n // Include the timeline module.\r\n if ($options['bl_vert_timeline'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-vert-timeline/bb-sw-vert-timeline.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-vert-timeline/includes/bb-sw-vert-timeline-module.php';\r\n }\r\n \r\n // Include the viewer module.\r\n if ($options['bl_viewer'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-viewer/bb-sw-viewer.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-viewer/includes/bb-sw-viewer-module.php';\r\n }\r\n \r\n // Include the woo featured module.\r\n if ( class_exists( 'woocommerce' ) ) {\r\n if ($options['bl_woo_featured'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-woofeatured/bb-sw-woofeatured.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-woofeatured/includes/bb-sw-woofeatured-module.php';\r\n }\r\n }\r\n \r\n // Include the woo recent module.\r\n if ( class_exists( 'woocommerce' ) ) {\r\n if ($options['bl_woo_recent'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-woorecent/bb-sw-woorecent.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-woorecent/includes/bb-sw-woorecent-module.php';\r\n }\r\n }\r\n \r\n // Include the woo sale module.\r\n if ( class_exists( 'woocommerce' ) ) {\r\n if ($options['bl_woo_sale'] == '2') {\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-woosale/bb-sw-woosale.php';\r\n require_once dirname( __FILE__ ) . '/lib/modules/bb-sw-woosale/includes/bb-sw-woosale-module.php';\r\n }\r\n }\r\n \r\n}", "function load() {\n\tadd_action( 'hnf_bb_init', __NAMESPACE__ . '\\\\setup' );\n\tadd_filter( 'fl_builder_register_settings_form', __NAMESPACE__ . '\\\\settings', 10, 2 );\n}", "public function activatePlugin();", "public function init_plugin() { \n\t\tglobal $phpbbForum;\n\n\t\tif($this->has_inited()) {\n\t\t\treturn false;\n\t\t}\n\t\t$this->doneInit = true;\n\t\t\n\t\t$shouldRun = true;\n\t\t\n\t\t// this has to go prior to phpBB load so that connection can be disabled in the event of an error on activation.\n\t\t$this->process_adminpanel_actions();\n\n\t\t// disable login integration if we couldn't override pluggables\n\t\tif(defined('WPU_CANNOT_OVERRIDE')) {\n\t\t\t$this->settings['integrateLogin'] = 0;\n\t\t}\n\n\t\tif(!$this->get_setting('phpbb_path') || !$phpbbForum->can_connect_to_phpbb()) {\n\t\t\t$this->set_last_run('disconnected');\n\t\t\t$shouldRun = false;\n\t\t}\n\t\t\n\t\tif($this->get_last_run() == 'connected') {\n\t\t\t$shouldRun = false;\n\t\t}\n\t\t\n\t\tif($shouldRun) {\n\t\t\t$this->set_last_run('connected');\n\t\t}\n\t\t\n\t\t$versionCheck = $this->check_mod_version();\n\t\tif($versionCheck['result'] != 'OK') {\n\t\t\t$this->disable();\n\t\t\t$shouldRun = false;\n\t\t}\n\t\t\n\t\tif($this->is_enabled() && $shouldRun) { \n\t\t\n\t\t\t$this->load_phpbb();\n\t\t\t\n\t\t\t//Run any upgrade actions once the phpBB environment has been loaded\n\t\t\t$this->upgrade();\n\t\t\t\n\t\t\t$this->set_last_run('working');\n\t\t\n\t\t\t// Load and initialise any WP-United Extras (sub-plugins):\n\t\t\trequire_once($this->get_plugin_path() . 'extras.php');\n\t\t\t$this->extras = new WP_United_Extras_Loader();\n\t\t\t$this->extras->init();\n\t\t\t\n\t\t\t// Load default widgets:\n\t\t\trequire_once($this->get_plugin_path() . 'widgets.php');\n\t\t\tadd_action('widgets_init', array($this, 'widgets_init'));\n\t\t\t\n\t\t\t\t\n\t\t\t// The end flush action stops fwd template integration from working.\n\t\t\tif($this->should_do_action('template-w-in-p')) {\n\t\t\t\t// must match priority etc of the built-in\n\t\t\t\tremove_action('shutdown', 'wp_ob_end_flush_all', 1);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t$this->process_frontend_actions();\n\n\t\treturn true; \n\t\t\t\n\t}", "function the_champ_bp_linking(){\r\n\tadd_action('bp_template_content', 'the_champ_bp_account_linking');\r\n\tbp_core_load_template(apply_filters('bp_core_template_plugin', 'members/single/plugins'));\r\n}", "public static function activate_plugin(){\n\t\t\tadd_option('breakingnews_area_title', __('Breaking news', 'text-domain'));\n\t\t\tadd_option('breakingnews_text_color', '#F0F0F0');\n\t\t\tadd_option('breakingnews_bg_color', '#333333');\n\t\t\tadd_option('breakingnews_autoinsert', '1');\n\t\t}", "private function setBuddypressParams()\n\t{\n\t\tif ($this->buddypress_active === true && get_option($this->GrOptionDbPrefix . 'bp_registration_on'))\n\t\t{\n\t\t\tadd_action('bp_before_registration_submit_buttons', array(\n\t\t\t\t&$this,\n\t\t\t\t'AddCheckboxToBpRegistrationPage'\n\t\t\t), 5);\n\t\t\tadd_action('bp_after_registration_confirmed', array(&$this, 'SetBpActivateKey'), 5, 1);\n\t\t\tadd_action('bp_after_activation_page', array(&$this, 'addActivatedBpContactsToGr'), 5, 1);\n\t\t\tadd_action('wp_head', array(&$this, 'AddGrBpCss'));\n\t\t}\n\t}", "public function bootPlugin();", "function yourtab_incidents() {\n add_action( 'bp_template_title', 'yourtab_incidents_title' );\n add_action( 'bp_template_content', 'yourtab_incidents_content' );\n bp_core_load_template( 'buddypress/members/single/plugins' );\n}", "function ex_divi_child_theme_setup() {\n\n if ( class_exists('ET_Builder_Module')) {\n\n class ET_Builder_Module_Image2 extends ET_Builder_Module {\n function init() {\n $this->name = __( 'Banner Image', 'et_builder' );\n $this->slug = 'et_pb_image2';\n // a whole bunch of php code that defines how the class functions\n \n \n }\n }\n $et_builder_module_image2 = new ET_Builder_Module_Image2();\n add_shortcode( 'et_pb_image2', array($et_builder_module_image2, '_shortcode_callback') );\n\n }\n\n}", "public function plugins_loaded()\n\t{\n\t\t//If base plugin isn't active yet, warn the user\n\t\tif(!$this->base_plugin_active())\n\t\t{\n\t\t\t//If we are in the admin, let's print a warning then return\n\t\t\tif(is_admin())\n\t\t\t{\n\t\t\t\tadd_action('admin_notices', array($this, 'base_plugin_inactive_notice'));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif(!$this->base_plugin_version_supported())\n\t\t{\n\t\t\t//If we are in the admin, let's print a warning then return\n\t\t\tif(is_admin())\n\t\t\t{\n\t\t\t\tadd_action('admin_notices', array($this, 'base_plugin_version_unsupported_notice'));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif(is_admin() && $this->base_plugin_active() && class_exists('mtekk_adminKit'))\n\t\t{\n\t\t\t//Check to see if someone else has setup the extensions settings tab\n\t\t\tif(has_action('bcn_after_settings_tabs', 'bcn_extensions_tab') === false)\n\t\t\t{\n\t\t\t\t//All versions prior to 6.3.0 used a different extensions tab format\n\t\t\t\tif(!defined('breadcrumb_navxt::version') || version_compare(breadcrumb_navxt::version, '6.2.60', '<'))\n\t\t\t\t{\n\t\t\t\t\trequire_once(dirname(__FILE__) . '/bcn_extensions_tab_62.php');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\trequire_once(dirname(__FILE__) . '/bcn_extensions_tab.php');\n\t\t\t\t}\n\t\t\t\tadd_action('bcn_after_settings_tabs', 'bcn_extensions_tab');\n\t\t\t}\n\t\t\t$this->admin_setup();\n\t\t}\n\t}", "function the_champ_bp_loaded(){\r\n\tglobal $theChampIsBpActive;\r\n\t$theChampIsBpActive = true;\r\n}", "function divi_child_theme_setup() {\n\n if( class_exists( \"ET_Builder_Module\" ) ) {\n\t\t//include( get_stylesheet_directory() . \"/custom-modules/Blog.php\" );\n\n\t\tinclude( get_stylesheet_directory() . \"/custom-modules/WM_Video.php\" );\n\t\tinclude( get_stylesheet_directory() . \"/custom-modules/WM_Gallery.php\" );\n\t\tinclude( get_stylesheet_directory() . \"/custom-modules/WM_Evidence.php\" );\n\t\tinclude( get_stylesheet_directory() . \"/custom-modules/WM_CallToAction.php\" );\n\t\tinclude( get_stylesheet_directory() . \"/custom-modules/WM_SocialButtons.php\" );\n\t\tinclude( get_stylesheet_directory() . \"/custom-modules/WM_MenuBar.php\" );\n\t\tinclude( get_stylesheet_directory() . \"/custom-modules/WM_Map.php\" );\n\n\t\tinclude( get_stylesheet_directory() . \"/custom-modules/WM_FullwidthSlider.php\" );\n\t\tinclude( get_stylesheet_directory() . \"/custom-modules/WM_FullwidthHeadline.php\" );\n\t\tinclude( get_stylesheet_directory() . \"/custom-modules/WM_FullwidthMenuBar.php\" );\n\n\t\tinclude( get_stylesheet_directory() . \"/custom-modules/WM_Footer.php\" );\n\t\tinclude( get_stylesheet_directory() . \"/custom-modules/WM_SpecialOne.php\" );\n\t\tinclude( get_stylesheet_directory() . \"/custom-modules/WM_Offers.php\" );\n\t}\n\n //$blog = new WMT_Builder_Module_Blog();\n //remove_shortcode( 'et_pb_blog' );\n //add_shortcode( $blog->slug, array($blog, '_shortcode_callback') );\n\n $wm_video = new WMT_Builder_Module_WM_Video();\n add_shortcode( $wm_video->slug, array($wm_video, '_shortcode_callback') );\n $wm_gallery = new WMT_Builder_Module_WM_Gallery();\n add_shortcode( $wm_gallery->slug, array($wm_gallery, '_shortcode_callback') );\n $wm_evidence = new WMT_Builder_Module_WM_Evidence();\n add_shortcode( $wm_evidence->slug, array($wm_evidence, '_shortcode_callback') );\n $wm_calltoaction = new WMT_Builder_Module_WM_CallToAction();\n add_shortcode( $wm_calltoaction->slug, array($wm_calltoaction, '_shortcode_callback') );\n $wm_socialbuttons = new WMT_Builder_Module_WM_SocialButtons();\n add_shortcode( $wm_socialbuttons->slug, array($wm_socialbuttons, '_shortcode_callback') );\n $wm_menubar = new WMT_Builder_Module_WM_MenuBar();\n add_shortcode( $wm_menubar->slug, array($wm_menubar, '_shortcode_callback') );\n $wm_map = new WMT_Builder_Module_WM_Map();\n add_shortcode( $wm_map->slug, array($wm_map, '_shortcode_callback') );\n\n $wm_fw_slider = new WMT_Builder_Module_WM_Fullwidth_Slider();\n add_shortcode( $wm_fw_slider->slug, array($wm_fw_slider, '_shortcode_callback') );\n $wm_fw_headline = new WMT_Builder_Module_WM_Fullwidth_Headline();\n add_shortcode( $wm_fw_headline->slug, array($wm_fw_headline, '_shortcode_callback') );\n $wm_fw_menubar = new WMT_Builder_Module_WM_Fullwidth_MenuBar();\n add_shortcode( $wm_fw_menubar->slug, array($wm_fw_menubar, '_shortcode_callback') );\n\n $wm_footer = new WMT_Builder_Module_WM_Footer();\n add_shortcode( $wm_footer->slug, array($wm_footer, '_shortcode_callback') );\n $wm_specialone = new WMT_Builder_Module_WM_SpecialOne();\n add_shortcode( $wm_specialone->slug, array($wm_specialone, '_shortcode_callback') );\n $wm_offers = new WMT_Builder_Module_WM_Offers();\n add_shortcode( $wm_offers->slug, array($wm_offers, '_shortcode_callback') );\n}", "public function loadOnWpLoaded()\n {\n // Set enabled payment gateways\n $this->enabledGateways = $this->getEnabledPaymentGateways();\n // Register WooCommerce Payment Gateway custom titles and descriptions in Polylang's Strings translations table\n $this->registerGatewayStringsForTranslation();\n \n // Load payment gateways extensions (gateway intructions translation)\n $this->loadPaymentGatewaysExtentions();\n }", "function activate_blossomthemes_instagram_feed() {\r\n\trequire_once plugin_dir_path( __FILE__ ) . 'includes/class-blossomthemes-instagram-feed-activator.php';\r\n\tBlossomthemes_Instagram_Feed_Activator::activate();\r\n}", "function add_wp_hooks(){\n\n\t\t$comments = new WordpressConnectComments();\n\t\t$like = new WordpressConnectLikeButton();\n\n\t}", "function EDD_Per_Product_Button_load() {\n\tif( ! class_exists( 'Easy_Digital_Downloads' ) ) {\n\t\tif( ! class_exists( 'EDD_Extension_Activation' ) ) {\n\t\t\trequire_once 'includes/class.extension-activation.php';\n\t\t}\n\n\t\t$activation = new EDD_Extension_Activation( plugin_dir_path( __FILE__ ), basename( __FILE__ ) );\n\t\t$activation = $activation->run();\n\t\treturn EDD_Per_Product_Button::instance();\n\t} else {\n\t\treturn EDD_Per_Product_Button::instance();\n\t}\n}", "function bfox_bp_plans_my_plans_screen_view() {\n\tadd_action('bp_template_content', 'bfox_bp_plans_my_plans_screen_view_content');\n\tbfox_bp_core_load_template(apply_filters('bfox_bp_plans_my_plans_screen_template', 'members/single/plugins'));\n}", "function tabber_tabs_plugin_init() {\n\n\t// Loads and registers the new widget.\n\tadd_action( 'widgets_init', 'tabber_tabs_load_widget' );\n\n\t// Add Javascript if not admin area. No need to run in backend.\n\tif ( !is_admin() ) {\n\t\t\n\t};\n\n\t// Hide Tabber until page load \n\tadd_action( 'wp_head', 'tabber_tabs_temp_hide' );\n\t\t\n\t// Load css \n\tadd_action( 'wp_head', 'tabber_tabs_css' );\n\t\n}", "abstract protected function activate_plugin();", "public function inject_banner() {\n\t\t$this->banner_settings = get_option( 'cookieproCCPASettings' );\n\t\t$this->behavior_settings = get_option( 'cookieproCCPABehaviorSettings' );\n\t\t$this->floatingdata = get_option( 'CookieProCCPAButtonFloatings' );\n\t\tif( ! empty( $this->floatingdata ) ){\n\t\t\t$this->linkenable = $this->floatingdata;\n\t\t} else {\n\t\t\t$this->linkenable = $this->banner_settings;\n\t\t}\n\t\tinclude_once WP_PLUGIN_DIR . '/' . $this->plugin->name . '/assets/html/banner.php';\n\t}", "function activate_dashwp() {\n\trequire_once plugin_dir_path( __FILE__ ) . 'includes/class-dashwp-activator.php';\n\tDashWP_Activator::activate();\n}", "public function load_aps_gateway() {\n\n\t\t$gate_loader = new Gateway_Loader();\n\t\t$this->loader->add_filter( 'woocommerce_payment_gateways', $gate_loader, 'init_gateways' );\n\t\t$this->loader->add_action( 'plugins_loaded', $gate_loader, 'load_gateway_classes' );\n\t\t$this->loader->add_filter( 'woocommerce_available_payment_gateways', $gate_loader, 'aps_available_payment_gateways' );\n\t}", "function registerBBwidget(){\r\n\tregister_widget('BbWidgetArea');\r\n\t\r\n\t}", "function mycred_load_buddypress_groups_hook() {\n\tif ( class_exists( 'myCRED_BuddyPress_Groups' ) || ! class_exists( 'BuddyPress' ) ) return;\n\n\tclass myCRED_BuddyPress_Groups extends myCRED_Hook {\n\n\t\t/**\n\t\t * Construct\n\t\t */\n\t\tfunction __construct( $hook_prefs, $type = MYCRED_DEFAULT_TYPE_KEY ) {\n\n\t\t\tparent::__construct( array(\n\t\t\t\t'id' => 'hook_bp_groups',\n\t\t\t\t'defaults' => array(\n\t\t\t\t\t'create' => array(\n\t\t\t\t\t\t'creds' => 10,\n\t\t\t\t\t\t'log' => '%plural% for creating a new group',\n\t\t\t\t\t\t'min' => 0\n\t\t\t\t\t),\n\t\t\t\t\t'delete' => array(\n\t\t\t\t\t\t'creds' => '-10',\n\t\t\t\t\t\t'log' => '%singular% deduction for deleting a group'\n\t\t\t\t\t),\n\t\t\t\t\t'new_topic' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for new group topic',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'edit_topic' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for updating group topic',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'new_post' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for new group post',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'edit_post' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for updating group post',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'join' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for joining new group',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'leave' => array(\n\t\t\t\t\t\t'creds' => '-5',\n\t\t\t\t\t\t'log' => '%singular% deduction for leaving group'\n\t\t\t\t\t),\n\t\t\t\t\t'avatar' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for new group avatar',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'cover' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for new cover photo',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'comments' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for new group comment',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t), $hook_prefs, $type );\n\n\t\t}\n\n\t\t/**\n\t\t * Run\n\t\t * @since 0.1\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function run() {\n\n\t\t\tif ( $this->prefs['create']['creds'] != 0 && $this->prefs['create']['min'] == 0 )\n\t\t\t\tadd_action( 'groups_group_create_complete', array( $this, 'create_group' ) );\n\n\t\t\tif ( $this->prefs['create']['creds'] < 0 )\n\t\t\t\tadd_filter( 'bp_user_can_create_groups', array( $this, 'restrict_group_creation' ), 99, 2 );\n\n\t\t\tif ( $this->prefs['delete']['creds'] != 0 )\n\t\t\t\tadd_action( 'groups_group_deleted', array( $this, 'delete_group' ) );\n\n\t\t\tif ( $this->prefs['new_topic']['creds'] != 0 )\n\t\t\t\tadd_action( 'bp_forums_new_topic', array( $this, 'new_topic' ) );\n\n\t\t\tif ( $this->prefs['edit_topic']['creds'] != 0 )\n\t\t\t\tadd_action( 'groups_edit_forum_topic', array( $this, 'edit_topic' ) );\n\n\t\t\tif ( $this->prefs['new_post']['creds'] != 0 )\n\t\t\t\tadd_action( 'bp_forums_new_post', array( $this, 'new_post' ) );\n\n\t\t\tif ( $this->prefs['edit_post']['creds'] != 0 )\n\t\t\t\tadd_action( 'groups_edit_forum_post', array( $this, 'edit_post' ) );\n\n\t\t\tif ( $this->prefs['join']['creds'] != 0 || ( $this->prefs['create']['creds'] != 0 && $this->prefs['create']['min'] != 0 ) )\n\t\t\t\tadd_action( 'groups_join_group', array( $this, 'join_group' ), 20, 2 );\n\n\t\t\tif ( $this->prefs['join']['creds'] < 0 )\n\t\t\t\tadd_filter( 'bp_get_group_join_button', array( $this, 'restrict_joining_group' ) );\n\n\t\t\tif ( $this->prefs['leave']['creds'] != 0 )\n\t\t\t\tadd_action( 'groups_leave_group', array( $this, 'leave_group' ), 20, 2 );\n\n\t\t\tif ( $this->prefs['avatar']['creds'] != 0 )\n\t\t\t\tadd_action( 'groups_screen_group_admin_avatar', array( $this, 'avatar_upload_group' ) );\n\n\t\t\tif ( $this->prefs['cover']['creds'] != 0 )\n\t\t\t\tadd_action( 'group_cover_image_uploaded', array( $this, 'cover_change' ) );\n\n\t\t\tif ( $this->prefs['comments']['creds'] != 0 )\n\t\t\t\tadd_action( 'bp_groups_posted_update', array( $this, 'new_group_comment' ), 20, 4 );\n\n\t\t}\n\n\t\t/**\n\t\t * Creating Group\n\t\t * @since 0.1\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function create_group( $group_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'creation_of_new_group',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['create']['creds'],\n\t\t\t\t$this->prefs['create']['log'],\n\t\t\t\t$group_id,\n\t\t\t\t'bp_group',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Restrict Group Creation\n\t\t * If creating a group costs and the user does not have enough points, we restrict creations.\n\t\t * @since 0.1\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function restrict_group_creation( $can_create, $restricted ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return $can_create;\n\n\t\t\t// Check if user has enough to create a group\n\t\t\t$cost = abs( $this->prefs['create']['creds'] );\n\t\t\t$balance = $this->core->get_users_balance( $bp->loggedin_user->id, $this->mycred_type );\n\t\t\tif ( $cost > $balance ) return false;\n\n\t\t\treturn $can_create;\n\n\t\t}\n\n\t\t/**\n\t\t * Restrict Group Join\n\t\t * If joining a group costs and the user does not have enough points, we restrict joining of groups.\n\t\t * @since 0.1\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function restrict_joining_group( $button ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return $button;\n\n\t\t\t// Check if user has enough to join group\n\t\t\t$cost = abs( $this->prefs['join']['creds'] );\n\t\t\t$balance = $this->core->get_users_balance( $bp->loggedin_user->id, $this->mycred_type );\n\t\t\tif ( $cost > $balance ) return false;\n\n\t\t\treturn $button;\n\n\t\t}\n\n\t\t/**\n\t\t * Deleting Group\n\t\t * @since 0.1\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function delete_group( $group_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// If admin is removing deduct from creator\n\t\t\tif ( $bp->loggedin_user->is_super_admin )\n\t\t\t\t$user_id = $bp->groups->current_group->creator_id;\n\n\t\t\t// Else if admin but not the creator is removing\n\t\t\telseif ( $bp->loggedin_user->id != $bp->groups->current_group->creator_id )\n\t\t\t\t$user_id = $bp->groups->current_group->creator_id;\n\n\t\t\t// Else deduct from current user\n\t\t\telse\n\t\t\t\t$user_id = $bp->loggedin_user->id;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $user_id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'deletion_of_group',\n\t\t\t\t$user_id,\n\t\t\t\t$this->prefs['delete']['creds'],\n\t\t\t\t$this->prefs['delete']['log'],\n\t\t\t\t$group_id,\n\t\t\t\t'bp_group',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * New Group Forum Topic\n\t\t * @since 0.1\n\t\t * @version 1.1\n\t\t */\n\t\tpublic function new_topic( $topic_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'new_topic', 'new_group_forum_topic' ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'new_group_forum_topic', $topic_id, $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'new_group_forum_topic',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['new_topic']['creds'],\n\t\t\t\t$this->prefs['new_topic']['log'],\n\t\t\t\t$topic_id,\n\t\t\t\t'bp_ftopic',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Edit Group Forum Topic\n\t\t * @since 0.1\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function edit_topic( $topic_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'edit_topic', 'edit_group_forum_topic' ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'edit_group_forum_topic',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['edit_topic']['creds'],\n\t\t\t\t$this->prefs['edit_topic']['log'],\n\t\t\t\t$topic_id,\n\t\t\t\t'bp_ftopic',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * New Group Forum Post\n\t\t * @since 0.1\n\t\t * @version 1.1\n\t\t */\n\t\tpublic function new_post( $post_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'new_post', 'new_group_forum_post' ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'new_group_forum_post', $post_id, $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'new_group_forum_post',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['new_post']['creds'],\n\t\t\t\t$this->prefs['new_post']['log'],\n\t\t\t\t$post_id,\n\t\t\t\t'bp_fpost',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Edit Group Forum Post\n\t\t * @since 0.1\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function edit_post( $post_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'edit_post', 'edit_group_forum_post' ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'edit_group_forum_post',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['edit_post']['creds'],\n\t\t\t\t$this->prefs['edit_post']['log'],\n\t\t\t\t$post_id,\n\t\t\t\t'bp_fpost',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Joining Group\n\t\t * @since 0.1\n\t\t * @version 1.1\n\t\t */\n\t\tpublic function join_group( $group_id, $user_id ) {\n\n\t\t\t// Minimum members limit\n\t\t\tif ( $this->prefs['create']['min'] != 0 ) {\n\t\t\t\t$group = groups_get_group( array( 'group_id' => $group_id ) );\n\n\t\t\t\t// Award creator if we have reached the minimum number of members and we have not yet been awarded\n\t\t\t\tif ( $group->total_member_count >= (int) $this->prefs['create']['min'] && ! $this->core->has_entry( 'creation_of_new_group', $group_id, $group->creator_id ) )\n\t\t\t\t\t$this->core->add_creds(\n\t\t\t\t\t\t'creation_of_new_group',\n\t\t\t\t\t\t$group->creator_id,\n\t\t\t\t\t\t$this->prefs['create']['creds'],\n\t\t\t\t\t\t$this->prefs['create']['log'],\n\t\t\t\t\t\t$group_id,\n\t\t\t\t\t\t'bp_group',\n\t\t\t\t\t\t$this->mycred_type\n\t\t\t\t\t);\n\n\t\t\t\t// Clean up\n\t\t\t\tunset( $group );\n\n\t\t\t}\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $user_id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'join', 'joining_group' ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'joining_group', $group_id, $user_id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'joining_group',\n\t\t\t\t$user_id,\n\t\t\t\t$this->prefs['join']['creds'],\n\t\t\t\t$this->prefs['join']['log'],\n\t\t\t\t$group_id,\n\t\t\t\t'bp_group',\n\t\t\t\t$this->mycred_type\n\t\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Leaving Group\n\t\t * @since 0.1\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function leave_group( $group_id, $user_id ) {\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $user_id ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'leaving_group', $group_id, $user_id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'leaving_group',\n\t\t\t\t$user_id,\n\t\t\t\t$this->prefs['leave']['creds'],\n\t\t\t\t$this->prefs['leave']['log'],\n\t\t\t\t$group_id,\n\t\t\t\t\t'bp_group',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Avatar Upload for Group\n\t\t * @since 0.1\n\t\t * @version 1.1\n\t\t */\n\t\tpublic function avatar_upload_group( $group_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'avatar', 'upload_group_avatar' ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'upload_group_avatar', $group_id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'upload_group_avatar',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['avatar']['creds'],\n\t\t\t\t$this->prefs['avatar']['log'],\n\t\t\t\t$group_id,\n\t\t\t\t'bp_group',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Group Cover Upload\n\t\t * @since 1.7\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function cover_change( $group_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user is excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'cover', 'upload_group_cover', $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'upload_group_cover',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['cover']['creds'],\n\t\t\t\t$this->prefs['cover']['log'],\n\t\t\t\t$group_id,\n\t\t\t\t'bp_group',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * New Group Comment\n\t\t * @since 0.1\n\t\t * @version 1.1\n\t\t */\n\t\tpublic function new_group_comment( $content, $user_id, $group_id, $activity_id ) {\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $user_id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'comments', 'new_group_comment', $user_id ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'new_group_comment', $activity_id, $user_id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'new_group_comment',\n\t\t\t\t$user_id,\n\t\t\t\t$this->prefs['comments']['creds'],\n\t\t\t\t$this->prefs['comments']['log'],\n\t\t\t\t$activity_id,\n\t\t\t\t'bp_activity',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Preferences\n\t\t * @since 0.1\n\t\t * @version 1.3\n\t\t */\n\t\tpublic function preferences() {\n\n\t\t\t$prefs = $this->prefs;\n\n?>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'Group Creation', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-3 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'create', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'create', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'create', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['create']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->core->template_tags_general( __( 'If you use a negative value and the user does not have enough %_plural%, the \"Create Group\" button will be disabled.', 'twodayssss' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-3 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'create', 'min' ) ); ?>\"><?php _e( 'No. of Members', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'create', 'min' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'create', 'min' ) ); ?>\" value=\"<?php echo esc_attr( $prefs['create']['min'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->core->template_tags_general( __( 'The number of members a group must gain before awarding %_plural%. Use zero to award as soon as the group is created.', 'twodayssss' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'create', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'create', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'create', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['create']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'Group Deletions', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'delete', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'delete', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'delete', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['delete']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-8 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'delete', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'delete', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'delete', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['delete']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'New Group Avatar Upload', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'avatar', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'avatar', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'avatar', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['avatar']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'avatar', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'avatar', 'limit' ) ), $this->field_id( array( 'avatar', 'limit' ) ), $prefs['avatar']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'avatar', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'avatar', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'avatar', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['avatar']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'New Group Cover Upload', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'cover', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'cover', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'cover', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['cover']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'cover', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'cover', 'limit' ) ), $this->field_id( array( 'cover', 'limit' ) ), $prefs['cover']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'cover', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'cover', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'cover', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['cover']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'New Forum Topics', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'new_topic', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'new_topic', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'new_topic', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['new_topic']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'new_topic', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'new_topic', 'limit' ) ), $this->field_id( array( 'new_topic', 'limit' ) ), $prefs['new_topic']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'new_topic', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'new_topic', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'new_topic', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['new_topic']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'Editing Forum Topics', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'edit_topic', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'edit_topic', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'edit_topic', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['edit_topic']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'edit_topic', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'edit_topic', 'limit' ) ), $this->field_id( array( 'edit_topic', 'limit' ) ), $prefs['edit_topic']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'edit_topic', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'edit_topic', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'edit_topic', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['edit_topic']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'New Forum Posts', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'new_post', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'new_post', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'new_post', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['new_post']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'new_post', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'new_post', 'limit' ) ), $this->field_id( array( 'new_post', 'limit' ) ), $prefs['new_post']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'new_post', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'new_post', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'new_post', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['new_post']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'Editing Forum Posts', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'edit_post', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'edit_post', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'edit_post', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['edit_post']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'edit_post', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'edit_post', 'limit' ) ), $this->field_id( array( 'edit_post', 'limit' ) ), $prefs['edit_post']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'edit_post', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'edit_post', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'edit_post', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['edit_post']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'Joining Groups', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'join', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'join', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'join', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['join']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'join', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'join', 'limit' ) ), $this->field_id( array( 'join', 'limit' ) ), $prefs['join']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'join', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'join', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'join', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['join']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'Leaving Groups', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'leave', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'leave', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'leave', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['leave']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-8 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'leave', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'leave', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'leave', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['leave']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'New Group Comments', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'comments', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'comments', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'comments', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['comments']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'comments', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'comments', 'limit' ) ), $this->field_id( array( 'comments', 'limit' ) ), $prefs['comments']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'comments', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'comments', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'comments', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['comments']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<?php\n\n\t\t}\n\n\t\t/**\n\t\t * Sanitise Preferences\n\t\t * @since 1.6\n\t\t * @version 1.1\n\t\t */\n\t\tpublic function sanitise_preferences( $data ) {\n\n\t\t\tif ( isset( $data['new_topic']['limit'] ) && isset( $data['new_topic']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['new_topic']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['new_topic']['limit'] = $limit . '/' . $data['new_topic']['limit_by'];\n\t\t\t\tunset( $data['new_topic']['limit_by'] );\n\t\t\t}\n\n\t\t\tif ( isset( $data['edit_topic']['limit'] ) && isset( $data['edit_topic']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['edit_topic']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['edit_topic']['limit'] = $limit . '/' . $data['edit_topic']['limit_by'];\n\t\t\t\tunset( $data['edit_topic']['limit_by'] );\n\t\t\t}\n\n\t\t\tif ( isset( $data['new_post']['limit'] ) && isset( $data['new_post']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['new_post']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['new_post']['limit'] = $limit . '/' . $data['new_post']['limit_by'];\n\t\t\t\tunset( $data['new_post']['limit_by'] );\n\t\t\t}\n\n\t\t\tif ( isset( $data['edit_post']['limit'] ) && isset( $data['edit_post']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['edit_post']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['edit_post']['limit'] = $limit . '/' . $data['edit_post']['limit_by'];\n\t\t\t\tunset( $data['edit_post']['limit_by'] );\n\t\t\t}\n\n\t\t\tif ( isset( $data['join']['limit'] ) && isset( $data['join']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['join']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['join']['limit'] = $limit . '/' . $data['join']['limit_by'];\n\t\t\t\tunset( $data['join']['limit_by'] );\n\t\t\t}\n\n\t\t\tif ( isset( $data['avatar']['limit'] ) && isset( $data['avatar']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['avatar']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['avatar']['limit'] = $limit . '/' . $data['avatar']['limit_by'];\n\t\t\t\tunset( $data['avatar']['limit_by'] );\n\t\t\t}\n\n\t\t\tif ( isset( $data['cover']['limit'] ) && isset( $data['cover']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['cover']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['cover']['limit'] = $limit . '/' . $data['cover']['limit_by'];\n\t\t\t\tunset( $data['cover']['limit_by'] );\n\t\t\t}\n\n\t\t\tif ( isset( $data['comments']['limit'] ) && isset( $data['comments']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['comments']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['comments']['limit'] = $limit . '/' . $data['comments']['limit_by'];\n\t\t\t\tunset( $data['comments']['limit_by'] );\n\t\t\t}\n\n\t\t\treturn $data;\n\n\t\t}\n\n\t}\n\n}", "public function plugin_activate(){\n\t\t\n\t\t//call our custom content type function\n\t \t$this->register_location_content_type();\n\t\t//flush permalinks\n\t\tflush_rewrite_rules();\n\t}", "function activate_mfn_wp_plugin()\n{\n require_once plugin_dir_path(__FILE__) . 'includes/class-mfn-wp-plugin-activator.php';\n Mfn_Wp_Plugin_Activator::activate();\n}", "protected function initExt() {\n\t\twfProfileIn( 'BS::'.__METHOD__ );\n\n\t\t//Hooks\n\t\t$this->setHook( 'ParserFirstCallInit', 'onParserFirstCallInit' );\n\t\t$this->setHook( 'BSWidgetBarGetDefaultWidgets' );\n\t\t$this->setHook( 'BSWidgetListHelperInitKeyWords' );\n\t\t$this->setHook( 'BSStateBarAddSortBodyVars', 'onStatebarAddSortBodyVars' );\n\t\t$this->setHook( 'BSStateBarBeforeBodyViewAdd' );\n\t\t$this->setHook( 'BSInsertMagicAjaxGetData', 'onBSInsertMagicAjaxGetData' );\n\t\t$this->setHook( 'BeforePageDisplay' );\n\n\t\tglobal $wgBlueSpiceExtInfo;\n\t\t//Configuration variables\n\t\t$aMetadataDefaults = array(\n\t\t\t'creator' => 'Hallo Welt! GmbH',\n\t\t);\n\t\t$aMetadataOverrides = array(\n\t\t\t'producer' => 'UniversalExport '.$wgBlueSpiceExtInfo['version'].' (BlueSpice for MediaWiki)'\n\t\t);\n\n\t\tBsConfig::registerVar( 'MW::UniversalExport::CategoryWhitelist', $this->aCategoryWhitelist, BsConfig::LEVEL_PRIVATE|BsConfig::TYPE_ARRAY_STRING );\n\t\tBsConfig::registerVar( 'MW::UniversalExport::CategoryBlacklist', $this->aCategoryBlacklist, BsConfig::LEVEL_PRIVATE|BsConfig::TYPE_ARRAY_STRING );\n\t\tBsConfig::registerVar( 'MW::UniversalExport::MetadataDefaults', json_encode( $aMetadataDefaults ), BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_STRING|BsConfig::USE_PLUGIN_FOR_PREFS, 'bs-universalexport-pref-metadatadefaults', 'textarea' );\n\t\tBsConfig::registerVar( 'MW::UniversalExport::MetadataOverrides', json_encode( $aMetadataOverrides ), BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_STRING|BsConfig::USE_PLUGIN_FOR_PREFS, 'bs-universalexport-pref-metadataoverrides', 'textarea' );\n\t\tBsConfig::registerVar( 'MW::UniversalExport::ParamsDefaults', $this->aParamsDefaults, BsConfig::LEVEL_PRIVATE|BsConfig::TYPE_ARRAY_MIXED );\n\t\tBsConfig::registerVar( 'MW::UniversalExport::ParamsOverrides', $this->aParamsOverrides, BsConfig::LEVEL_PRIVATE|BsConfig::TYPE_ARRAY_MIXED );\n\n\t\t//Permissions\n\t\t$this->mCore->registerPermission( 'universalexport-export', array(), array( 'type' => 'namespace' ) );\n\n\t\twfProfileOut( 'BS::'.__METHOD__ );\n\t}", "public function __construct() {\n $this->version = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? time() : DOKAN_PRO_PLUGIN_VERSION;\n\n // Define all constant\n define( 'DOKAN_WC_BOOKING_PLUGIN_VERSION', '1.4.1' );\n define( 'DOKAN_WC_BOOKING_DIR', dirname( __FILE__ ) );\n define( 'DOKAN_WC_BOOKING_PLUGIN_ASSEST', plugins_url( 'assets', __FILE__ ) );\n define( 'DOKAN_WC_BOOKING_TEMPLATE_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/templates/' );\n define( 'DOKAN_WC_BOOKING_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );\n\n add_action( 'dokan_activated_module_booking', array( $this, 'activate' ) );\n // flush rewrite rules\n add_action( 'woocommerce_flush_rewrite_rules', [ $this, 'flush_rewrite_rules' ] );\n\n $this->depends_on['wc_bookings'] = array(\n 'name' => 'WC_Bookings',\n /* translators: %1$s: string %2$s: string */\n 'notice' => sprintf( __( '<b>Dokan WC Booking </b> requires %1$sWooCommerce Bookings plugin%2$s to be installed & activated!', 'dokan' ), '<a target=\"_blank\" href=\"https://woocommerce.com/products/woocommerce-bookings/\">', '</a>' ),\n );\n\n if ( ! $this->check_if_has_dependency() ) {\n add_action( 'admin_notices', array( $this, 'dependency_notice' ) );\n return;\n }\n\n add_filter( 'dokan_get_all_cap', array( $this, 'add_capabilities' ) );\n add_filter( 'dokan_get_all_cap_labels', array( $this, 'add_caps_labels' ) );\n\n // Loads frontend scripts and styles\n add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );\n\n add_action( 'init', array( $this, 'init_hooks' ) );\n\n // insert booking order into dokan_order_table if it's created by admin\n if ( is_admin() ) {\n add_action( 'woocommerce_bookings_create_booking_page_add_order_item', 'dokan_sync_insert_order' );\n }\n\n add_action( 'dokan_new_product_added', array( $this, 'save_booking_data' ), 10 );\n add_action( 'dokan_product_updated', array( $this, 'save_booking_data' ), 10 );\n\n // save per product commission for bookable product\n add_action( 'woocommerce_process_product_meta_booking', array( \\WeDevs\\DokanPro\\Products::class, 'save_per_product_commission_options' ), 20 );\n\n //ajax\n add_action( 'wp_ajax_add_new_resource', array( $this, 'add_new_resource' ) );\n add_action( 'wp_ajax_nopriv_add_new_resource', array( $this, 'add_new_resource' ) );\n add_action( 'wp_ajax_delete_resource', array( $this, 'delete_resource' ) );\n add_action( 'wp_ajax_nopriv_delete_resource', array( $this, 'delete_resource' ) );\n add_action( 'wp_ajax_dokan_wc_booking_change_status', array( $this, 'change_booking_status' ) );\n add_action( 'wp_ajax_noprivdokan_wc_booking_change_status', array( $this, 'change_booking_status' ) );\n\n add_action( 'template_redirect', array( $this, 'update_resource_data' ) );\n\n //booking modification\n add_action( 'woocommerce_new_booking', array( $this, 'add_seller_id_meta' ) );\n add_action( 'shutdown', array( $this, 'add_seller_manage_cap' ) );\n add_action( 'wp_ajax_dokan-wc-booking-confirm', array( $this, 'mark_booking_confirmed' ) );\n\n // booking person type delete\n add_action( 'wp_ajax_woocommerce_remove_bookable_person', array( $this, 'dokan_remove_bookable_person' ) );\n\n // booking page filters\n add_filter( 'dokan_booking_menu', array( $this, 'dokan_get_bookings_menu' ) );\n add_filter( 'dokan_booking_menu_title', array( $this, 'dokan_get_bookings_menu_title' ) );\n\n add_filter( 'dokan_set_template_path', array( $this, 'load_booking_templates' ), 10, 3 );\n\n // insert bookable porduct type\n add_filter( 'dokan_get_product_types', array( $this, 'insert_bookable_product_type' ) );\n add_filter( 'dokan_get_coupon_types', [ $this, 'add_booking_discount' ] );\n add_filter( 'dokan_get_edit_product_url', [ $this, 'modify_edit_product_url' ], 10, 2 );\n\n // Clear addon notices on manual booking creation\n add_action( 'template_redirect', [ $this, 'clear_addons_validation_notices' ], 10 );\n }", "function tabber_tabs_plugin_init() {\n\n\t// Loads and registers the new widget.\n\tadd_action( 'widgets_init', 'tabber_tabs_load_widget' );\n\t\n\t//Registers the new widget area.\n\tregister_sidebar(\n\t\tarray(\n\t\t\t'name' => __('WPZOOM: Tabs Widget Area'),\n\t\t\t'id' => 'tabber_tabs',\n\t\t\t'description' => __('Build your tabbed area by placing widgets here. !! DO NOT PLACE THE WPZOOM: TABS IN THIS AREA. '),\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"tabbertab %2$s\">',\n\t\t\t'after_widget' => '</div>'\n \t\t));\n\n// Hide Tabber until page load \nadd_action( 'wp_head', 'tabber_tabs_temp_hide' ); \n}", "function mycred_load_buddypress_profile_hook() {\n\tif ( class_exists( 'myCRED_BuddyPress_Profile' ) || ! class_exists( 'BuddyPress' ) ) return;\n\n\tclass myCRED_BuddyPress_Profile extends myCRED_Hook {\n\n\t\t/**\n\t\t * Construct\n\t\t */\n\t\tpublic function __construct( $hook_prefs, $type = MYCRED_DEFAULT_TYPE_KEY ) {\n\n\t\t\tparent::__construct( array(\n\t\t\t\t'id' => 'hook_bp_profile',\n\t\t\t\t'defaults' => array(\n\t\t\t\t\t'update' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for updating profile',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'removed_update' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for removing profile update',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'avatar' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for new avatar',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'cover' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for new cover photo',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'new_friend' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for new friendship',\n\t\t\t\t\t\t'block' => 0,\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'leave_friend' => array(\n\t\t\t\t\t\t'creds' => '-1',\n\t\t\t\t\t\t'log' => '%singular% deduction for losing a friend',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'new_comment' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for new comment',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'delete_comment' => array(\n\t\t\t\t\t\t'creds' => '-1',\n\t\t\t\t\t\t'log' => '%singular% deduction for comment removal'\n\t\t\t\t\t),\n\t\t\t\t\t'add_favorite' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for adding an activity to favorites',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'remove_favorite' => array(\n\t\t\t\t\t\t'creds' => '-1',\n\t\t\t\t\t\t'log' => '%singular% deduction for removing favorite activity'\n\t\t\t\t\t),\n\t\t\t\t\t'message' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for sending a message',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t),\n\t\t\t\t\t'send_gift' => array(\n\t\t\t\t\t\t'creds' => 1,\n\t\t\t\t\t\t'log' => '%plural% for sending a gift',\n\t\t\t\t\t\t'limit' => '0/x'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t), $hook_prefs, $type );\n\n\t\t}\n\n\t\t/**\n\t\t * Run\n\t\t * @since 0.1\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function run() {\n\n\t\t\tif ( $this->prefs['update']['creds'] != 0 )\n\t\t\t\tadd_action( 'bp_activity_posted_update', array( $this, 'new_update' ), 10, 3 );\n\n\t\t\tif ( $this->prefs['removed_update']['creds'] != 0 )\n\t\t\t\tadd_action( 'bp_activity_delete', array( $this, 'remove_update' ), 10, 3 );\n\n\t\t\tif ( $this->prefs['avatar']['creds'] != 0 )\n\t\t\t\tadd_action( 'xprofile_avatar_uploaded', array( $this, 'avatar_upload' ) );\n\n\t\t\tif ( $this->prefs['cover']['creds'] != 0 )\n\t\t\t\tadd_action( 'xprofile_cover_image_uploaded', array( $this, 'cover_change' ) );\n\n\t\t\tif ( $this->prefs['new_friend']['creds'] < 0 && isset( $this->prefs['new_friend']['block'] ) && $this->prefs['new_friend']['block'] == 1 ) {\n\t\t\t\tadd_action( 'wp_ajax_addremove_friend', array( $this, 'ajax_addremove_friend' ), 0 );\n\t\t\t\tadd_filter( 'bp_get_add_friend_button', array( $this, 'disable_friendship' ) );\n\t\t\t}\n\n\t\t\tif ( $this->prefs['new_friend']['creds'] != 0 )\n\t\t\t\tadd_action( 'friends_friendship_accepted', array( $this, 'friendship_join' ), 10, 3 );\n\n\t\t\tif ( $this->prefs['leave_friend']['creds'] != 0 )\n\t\t\t\tadd_action( 'friends_friendship_deleted', array( $this, 'friendship_leave' ), 10, 3 );\n\n\t\t\tif ( $this->prefs['new_comment']['creds'] != 0 )\n\t\t\t\tadd_action( 'bp_activity_comment_posted', array( $this, 'new_comment' ), 10, 2 );\n\n\t\t\tif ( $this->prefs['delete_comment']['creds'] != 0 )\n\t\t\t\tadd_action( 'bp_activity_before_action_delete_activity', array( $this, 'delete_comment' ), 10, 2 );\n\n\t\t\tif ( $this->prefs['add_favorite']['creds'] != 0 )\n\t\t\t\tadd_action( 'bp_activity_add_user_favorite', array( $this, 'add_to_favorites' ), 10, 2 );\n\n\t\t\tif ( $this->prefs['remove_favorite']['creds'] != 0 )\n\t\t\t\tadd_action( 'bp_activity_remove_user_favorite', array( $this, 'removed_from_favorites' ), 10, 2 );\n\n\t\t\tif ( $this->prefs['message']['creds'] != 0 )\n\t\t\t\tadd_action( 'messages_message_sent', array( $this, 'messages' ) );\n\n\t\t\tif ( $this->prefs['send_gift']['creds'] != 0 )\n\t\t\t\tadd_action( 'bp_gifts_send_gifts', array( $this, 'send_gifts' ), 10, 2 );\n\n\t\t}\n\n\t\t/**\n\t\t * New Profile Update\n\t\t * @since 0.1\n\t\t * @version 1.2\n\t\t */\n\t\tpublic function new_update( $content, $user_id, $activity_id ) {\n\n\t\t\t// Check if user is excluded\n\t\t\tif ( $this->core->exclude_user( $user_id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'update', 'new_profile_update', $user_id ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'new_profile_update', $activity_id, $user_id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'new_profile_update',\n\t\t\t\t$user_id,\n\t\t\t\t$this->prefs['update']['creds'],\n\t\t\t\t$this->prefs['update']['log'],\n\t\t\t\t$activity_id,\n\t\t\t\t'bp_activity',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Removing Profile Update\n\t\t * @since 1.6\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function remove_update( $args ) {\n\n\t\t\tif ( ! isset( $args['user_id'] ) || $args['user_id'] === false ) return;\n\n\t\t\t$user_id = absint( $args['user_id'] );\n\n\t\t\t// Check if user is excluded\n\t\t\tif ( $this->core->exclude_user( $user_id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'removed_update', 'deleted_profile_update', $user_id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'deleted_profile_update',\n\t\t\t\t$user_id,\n\t\t\t\t$this->prefs['removed_update']['creds'],\n\t\t\t\t$this->prefs['removed_update']['log'],\n\t\t\t\t0,\n\t\t\t\t$args,\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Avatar Upload\n\t\t * @since 0.1\n\t\t * @version 1.2\n\t\t */\n\t\tpublic function avatar_upload() {\n\n\t\t\t$user_id = apply_filters( 'bp_xprofile_new_avatar_user_id', bp_displayed_user_id() );\n\n\t\t\t// Check if user is excluded\n\t\t\tif ( $this->core->exclude_user( $user_id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'avatar', 'upload_avatar', $user_id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'upload_avatar',\n\t\t\t\t$user_id,\n\t\t\t\t$this->prefs['avatar']['creds'],\n\t\t\t\t$this->prefs['avatar']['log'],\n\t\t\t\t0,\n\t\t\t\t'',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Cover Upload\n\t\t * @since 1.7\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function cover_change( $user_id = NULL ) {\n\n\t\t\t// Check if user is excluded\n\t\t\tif ( $this->core->exclude_user( $user_id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'cover', 'upload_cover', $user_id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'upload_cover',\n\t\t\t\t$user_id,\n\t\t\t\t$this->prefs['cover']['creds'],\n\t\t\t\t$this->prefs['cover']['log'],\n\t\t\t\t0,\n\t\t\t\t'',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * AJAX: Add/Remove Friend\n\t\t * Intercept addremovefriend ajax call and block\n\t\t * action if the user can not afford new friendship.\n\t\t * @since 1.5.4\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function ajax_addremove_friend() {\n\n\t\t\t// Bail if not a POST action\n\t\t\tif ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )\n\t\t\t\treturn;\n\n\t\t\t$user_id = bp_loggedin_user_id();\n\t\t\t$balance = $this->core->get_users_balance( $user_id, $this->mycred_type );\n\t\t\t$cost = abs( $this->prefs['new_friend']['creds'] );\n\n\t\t\t// Take into account any existing requests which will be charged when the new\n\t\t\t// friend approves it. Prevents users from requesting more then they can afford.\n\t\t\t$pending_requests = $this->count_pending_requests( $user_id );\n\t\t\tif ( $pending_requests > 0 )\n\t\t\t\t$cost = $cost + ( $cost * $pending_requests );\n\n\t\t\t// Prevent BP from running this ajax call\n\t\t\tif ( $balance < $cost ) {\n\t\t\t\techo apply_filters( 'mycred_bp_declined_addfriend', __( 'Insufficient Funds', 'twodayssss' ), $this );\n\t\t\t\texit;\n\t\t\t}\n\n\t\t}\n\n\t\t/**\n\t\t * Disable Friendship\n\t\t * If we deduct points from a user for new friendships\n\t\t * we disable the friendship button if the user ca not afford it.\n\t\t * @since 1.5.4\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function disable_friendship( $button ) {\n\n\t\t\t// Only applicable for Add Friend button\n\t\t\tif ( $button['id'] == 'not_friends' ) {\n\n\t\t\t\t$user_id = bp_loggedin_user_id();\n\t\t\t\t$balance = $this->core->get_users_balance( $user_id, $this->mycred_type );\n\t\t\t\t$cost = abs( $this->prefs['new_friend']['creds'] );\n\n\t\t\t\t// Take into account any existing requests which will be charged when the new\n\t\t\t\t// friend approves it. Prevents users from requesting more then they can afford.\n\t\t\t\t$pending_requests = $this->count_pending_requests( $user_id );\n\t\t\t\tif ( $pending_requests > 0 )\n\t\t\t\t\t$cost = $cost + ( $cost * $pending_requests );\n\n\t\t\t\tif ( $balance < $cost )\n\t\t\t\t\treturn array();\n\n\t\t\t}\n\n\t\t\treturn $button;\n\n\t\t}\n\n\t\t/**\n\t\t * Count Pending Friendship Requests\n\t\t * Counts the given users pending friendship requests sent to\n\t\t * other users.\n\t\t * @since 1.5.4\n\t\t * @version 1.0\n\t\t */\n\t\tprotected function count_pending_requests( $user_id ) {\n\n\t\t\tglobal $wpdb, $bp;\n\n\t\t\treturn $wpdb->get_var( $wpdb->prepare( \"\n\t\t\t\tSELECT COUNT(*) \n\t\t\t\tFROM {$bp->friends->table_name} \n\t\t\t\tWHERE initiator_user_id = %d \n\t\t\t\tAND is_confirmed = 0;\", $user_id ) );\n\n\t\t}\n\n\t\t/**\n\t\t * New Friendship\n\t\t * @since 0.1\n\t\t * @version 1.3.1\n\t\t */\n\t\tpublic function friendship_join( $friendship_id, $initiator_user_id, $friend_user_id ) {\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( ! $this->core->exclude_user( $initiator_user_id ) && ! $this->core->has_entry( 'new_friendship', $friend_user_id, $initiator_user_id ) && ! $this->over_hook_limit( 'new_friend', 'new_friendship', $initiator_user_id ) )\n\t\t\t\t$this->core->add_creds(\n\t\t\t\t\t'new_friendship',\n\t\t\t\t\t$initiator_user_id,\n\t\t\t\t\t$this->prefs['new_friend']['creds'],\n\t\t\t\t\t$this->prefs['new_friend']['log'],\n\t\t\t\t\t$friend_user_id,\n\t\t\t\t\tarray( 'ref_type' => 'user' ),\n\t\t\t\t\t$this->mycred_type\n\t\t\t\t);\n\n\t\t\t// Points to friend (ignored if we are deducting points for new friendships)\n\t\t\tif ( $this->prefs['new_friend']['creds'] > 0 && ! $this->core->exclude_user( $friend_user_id ) && ! $this->over_hook_limit( 'new_friend', 'new_friendship', $friend_user_id ) )\n\t\t\t\t$this->core->add_creds(\n\t\t\t\t\t'new_friendship',\n\t\t\t\t\t$friend_user_id,\n\t\t\t\t\t$this->prefs['new_friend']['creds'],\n\t\t\t\t\t$this->prefs['new_friend']['log'],\n\t\t\t\t\t$initiator_user_id,\n\t\t\t\t\tarray( 'ref_type' => 'user' ),\n\t\t\t\t\t$this->mycred_type\n\t\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Ending Friendship\n\t\t * @since 0.1\n\t\t * @version 1.2\n\t\t */\n\t\tpublic function friendship_leave( $friendship_id, $initiator_user_id, $friend_user_id ) {\n\n\t\t\tif ( ! $this->core->exclude_user( $initiator_user_id ) && ! $this->core->has_entry( 'ended_friendship', $friend_user_id, $initiator_user_id ) )\n\t\t\t\t$this->core->add_creds(\n\t\t\t\t\t'ended_friendship',\n\t\t\t\t\t$initiator_user_id,\n\t\t\t\t\t$this->prefs['leave_friend']['creds'],\n\t\t\t\t\t$this->prefs['leave_friend']['log'],\n\t\t\t\t\t$friend_user_id,\n\t\t\t\t\tarray( 'ref_type' => 'user' ),\n\t\t\t\t\t$this->mycred_type\n\t\t\t\t);\n\n\t\t\tif ( ! $this->core->exclude_user( $friend_user_id ) )\n\t\t\t\t$this->core->add_creds(\n\t\t\t\t\t'ended_friendship',\n\t\t\t\t\t$friend_user_id,\n\t\t\t\t\t$this->prefs['leave_friend']['creds'],\n\t\t\t\t\t$this->prefs['leave_friend']['log'],\n\t\t\t\t\t$initiator_user_id,\n\t\t\t\t\tarray( 'ref_type' => 'user' ),\n\t\t\t\t\t$this->mycred_type\n\t\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * New Comment\n\t\t * @since 0.1\n\t\t * @version 1.2\n\t\t */\n\t\tpublic function new_comment( $comment_id, $params ) {\n\n\t\t\t$user_id = bp_loggedin_user_id();\n\n\t\t\t// Check if user is excluded\n\t\t\tif ( $this->core->exclude_user( $user_id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'new_comment', 'new_comment' ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'new_comment', $comment_id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'new_comment',\n\t\t\t\t$user_id,\n\t\t\t\t$this->prefs['new_comment']['creds'],\n\t\t\t\t$this->prefs['new_comment']['log'],\n\t\t\t\t$comment_id,\n\t\t\t\t'bp_comment',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Comment Deletion\n\t\t * @since 0.1\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function delete_comment( $activity_id, $user_id ) {\n\n\t\t\tglobal $wpdb, $bp;\n\t\t\t\n\t\t\t$activity_type = $wpdb->get_var( $wpdb->prepare( \"SELECT type FROM {$bp->activity->table_name} WHERE id = %d\", $activity_id ) );\n \n\t\t\tif( $activity_type == 'activity_comment' ) {\n\n\t\t\t // Check if user is excluded\n \t\t\tif ( $this->core->exclude_user( $user_id ) ) return;\n \n \t\t\t// Make sure this is unique event\n \t\t\tif ( $this->core->has_entry( 'comment_deletion', $activity_id ) ) return;\n \n \t\t\t// Execute\n \t\t\t$this->core->add_creds(\n \t\t\t\t'comment_deletion',\n \t\t\t\t$user_id,\n \t\t\t\t$this->prefs['delete_comment']['creds'],\n \t\t\t\t$this->prefs['delete_comment']['log'],\n \t\t\t\t$activity_id,\n \t\t\t\t'bp_comment',\n \t\t\t\t$this->mycred_type\n \t\t\t);\n\t\t\t\n\t\t\t}\n\n\t\t}\n\n\t\t/**\n\t\t * Add to Favorites\n\t\t * @since 1.7\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function add_to_favorites( $activity_id, $user_id ) {\n\n\t\t\t// Check if user is excluded\n\t\t\tif ( $this->core->exclude_user( $user_id ) ) return;\n\t\t\t//Limit\n\t\t\tif ($this->over_hook_limit( 'add_favorite', 'fave_activity' ) ) return;\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'fave_activity', $activity_id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'fave_activity',\n\t\t\t\t$user_id,\n\t\t\t\t$this->prefs['add_favorite']['creds'],\n\t\t\t\t$this->prefs['add_favorite']['log'],\n\t\t\t\t$activity_id,\n\t\t\t\t'bp_comment',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Remove from Favorites\n\t\t * @since 1.7\n\t\t * @version 1.0\n\t\t */\n\t\tpublic function removed_from_favorites( $activity_id, $user_id ) {\n\n\t\t\t// Check if user is excluded\n\t\t\tif ( $this->core->exclude_user( $user_id ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'unfave_activity', $activity_id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'unfave_activity',\n\t\t\t\t$user_id,\n\t\t\t\t$this->prefs['remove_favorite']['creds'],\n\t\t\t\t$this->prefs['remove_favorite']['log'],\n\t\t\t\t$activity_id,\n\t\t\t\t'bp_comment',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * New Message\n\t\t * @since 0.1\n\t\t * @version 1.1\n\t\t */\n\t\tpublic function messages( $message ) {\n\n\t\t\t// Check if user is excluded\n\t\t\tif ( $this->core->exclude_user( $message->sender_id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'message', 'new_message', $message->sender_id ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'new_message', $message->thread_id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'new_message',\n\t\t\t\t$message->sender_id,\n\t\t\t\t$this->prefs['message']['creds'],\n\t\t\t\t$this->prefs['message']['log'],\n\t\t\t\t$message->thread_id,\n\t\t\t\t'bp_message',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Send Gift\n\t\t * @since 0.1\n\t\t * @version 1.1\n\t\t */\n\t\tpublic function send_gifts( $to_user_id, $from_user_id ) {\n\n\t\t\t// Check if sender is excluded\n\t\t\tif ( $this->core->exclude_user( $from_user_id ) ) return;\n\n\t\t\t// Check if recipient is excluded\n\t\t\tif ( $this->core->exclude_user( $to_user_id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( ! $this->over_hook_limit( 'send_gift', 'sending_gift', $from_user_id ) )\n\t\t\t\t$this->core->add_creds(\n\t\t\t\t\t'sending_gift',\n\t\t\t\t\t$from_user_id,\n\t\t\t\t\t$this->prefs['send_gift']['creds'],\n\t\t\t\t\t$this->prefs['send_gift']['log'],\n\t\t\t\t\t$to_user_id,\n\t\t\t\t\t'bp_gifts',\n\t\t\t\t\t$this->mycred_type\n\t\t\t\t);\n\n\t\t}\n\n\t\t/**\n\t\t * Preferences\n\t\t * @since 0.1\n\t\t * @version 1.2\n\t\t */\n\t\tpublic function preferences() {\n\n\t\t\t$prefs = $this->prefs;\n\n\t\t\tif ( ! isset( $prefs['removed_update'] ) )\n\t\t\t\t$prefs['removed_update'] = array( 'creds' => 0, 'limit' => '0/x', 'log' => '%plural% deduction for removing profile update' );\n\n\t\t\t$friend_block = 0;\n\t\t\tif ( isset( $prefs['new_friend']['block'] ) )\n\t\t\t\t$friend_block = $prefs['new_friend']['block'];\n\n?>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'New Profile Activity', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'update', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'update', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'update', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['update']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'update', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'update', 'limit' ) ), $this->field_id( array( 'update', 'limit' ) ), $prefs['update']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'update', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'update', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'update', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['update']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'Deleted Profile Activity', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'removed_update', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'removed_update', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'removed_update', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['removed_update']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'removed_update', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'removed_update', 'limit' ) ), $this->field_id( array( 'removed_update', 'limit' ) ), $prefs['removed_update']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'removed_update', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'removed_update', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'removed_update', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['removed_update']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'New Profile Avatar Upload', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'avatar', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'avatar', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'avatar', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['avatar']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'avatar', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'avatar', 'limit' ) ), $this->field_id( array( 'avatar', 'limit' ) ), $prefs['avatar']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'avatar', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'avatar', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'avatar', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['avatar']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'New Profile Cover Upload', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'cover', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'cover', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'cover', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['cover']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'cover', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'cover', 'limit' ) ), $this->field_id( array( 'cover', 'limit' ) ), $prefs['cover']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'cover', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'cover', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'cover', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['cover']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'New Friendships', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'new_friend', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'new_friend', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'new_friend', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['new_friend']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'new_friend', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'new_friend', 'limit' ) ), $this->field_id( array( 'new_friend', 'limit' ) ), $prefs['new_friend']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'new_friend', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'new_friend', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'new_friend', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['new_friend']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-12 col-md-12 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<div class=\"radio\">\n\t\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'new_friend', 'block' ) ); ?>\"><input type=\"checkbox\" name=\"<?php echo $this->field_name( array( 'new_friend', 'block' ) ); ?>\"<?php checked( $friend_block, 1 ); ?> id=\"<?php echo $this->field_id( array( 'new_friend', 'block' ) ); ?>\" value=\"1\" /> <?php echo $this->core->template_tags_general( __( 'Users with zero balance can not add friends. Requires that you deduct %_plural% for adding a new friend.', 'twodayssss' ) ); ?></label>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'Ending Friendships', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'leave_friend', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'leave_friend', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'leave_friend', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['leave_friend']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'leave_friend', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'leave_friend', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'leave_friend', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['leave_friend']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'New Comment', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'new_comment', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'new_comment', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'new_comment', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['new_comment']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'new_comment', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'new_comment', 'limit' ) ), $this->field_id( array( 'new_comment', 'limit' ) ), $prefs['new_comment']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'new_comment', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'new_comment', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'new_comment', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['new_comment']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'Deleted Comment', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'delete_comment', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'delete_comment', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'delete_comment', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['delete_comment']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-8 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'delete_comment', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'delete_comment', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'delete_comment', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['delete_comment']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'Favorite Activity', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'add_favorite', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'add_favorite', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'add_favorite', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['add_favorite']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'add_favorite', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'add_favorite', 'limit' ) ), $this->field_id( array( 'add_favorite', 'limit' ) ), $prefs['add_favorite']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'add_favorite', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'add_favorite', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'add_favorite', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['add_favorite']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'Removing Favorite Activity', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'remove_favorite', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'remove_favorite', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'remove_favorite', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['remove_favorite']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-8 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'remove_favorite', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'remove_favorite', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'remove_favorite', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['remove_favorite']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'New Private Message', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'message', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'message', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'message', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['message']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'message', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'message', 'limit' ) ), $this->field_id( array( 'message', 'limit' ) ), $prefs['message']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'message', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'message', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'message', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['message']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<div class=\"hook-instance\">\n\t<h3><?php _e( 'Sending Gift', 'twodayssss' ); ?></h3>\n\t<div class=\"row\">\n\t\t<div class=\"col-lg-2 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'send_gift', 'creds' ) ); ?>\"><?php echo $this->core->plural(); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'send_gift', 'creds' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'send_gift', 'creds' ) ); ?>\" value=\"<?php echo $this->core->number( $prefs['send_gift']['creds'] ); ?>\" class=\"form-control\" />\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'send_gift', 'limit' ) ); ?>\"><?php _e( 'Limit', 'twodayssss' ); ?></label>\n\t\t\t\t<?php echo $this->hook_limit_setting( $this->field_name( array( 'send_gift', 'limit' ) ), $this->field_id( array( 'send_gift', 'limit' ) ), $prefs['send_gift']['limit'] ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n\t\t\t<div class=\"form-group\">\n\t\t\t\t<label for=\"<?php echo $this->field_id( array( 'send_gift', 'log' ) ); ?>\"><?php _e( 'Log template', 'twodayssss' ); ?></label>\n\t\t\t\t<input type=\"text\" name=\"<?php echo $this->field_name( array( 'send_gift', 'log' ) ); ?>\" id=\"<?php echo $this->field_id( array( 'send_gift', 'log' ) ); ?>\" placeholder=\"<?php _e( 'required', 'twodayssss' ); ?>\" value=\"<?php echo esc_attr( $prefs['send_gift']['log'] ); ?>\" class=\"form-control\" />\n\t\t\t\t<span class=\"description\"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n<?php\n\n\t\t}\n\n\t\t/**\n\t\t * Sanitise Preferences\n\t\t * @since 1.6\n\t\t * @version 1.1\n\t\t */\n\t\tpublic function sanitise_preferences( $data ) {\n\n\t\t\tif ( isset( $data['update']['limit'] ) && isset( $data['update']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['update']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['update']['limit'] = $limit . '/' . $data['update']['limit_by'];\n\t\t\t\tunset( $data['update']['limit_by'] );\n\t\t\t}\n\n\t\t\tif ( isset( $data['removed_update']['limit'] ) && isset( $data['removed_update']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['removed_update']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['removed_update']['limit'] = $limit . '/' . $data['removed_update']['limit_by'];\n\t\t\t\tunset( $data['removed_update']['limit_by'] );\n\t\t\t}\n\n\t\t\tif ( isset( $data['avatar']['limit'] ) && isset( $data['avatar']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['avatar']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['avatar']['limit'] = $limit . '/' . $data['avatar']['limit_by'];\n\t\t\t\tunset( $data['avatar']['limit_by'] );\n\t\t\t}\n\n\t\t\tif ( isset( $data['cover']['limit'] ) && isset( $data['cover']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['cover']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['cover']['limit'] = $limit . '/' . $data['cover']['limit_by'];\n\t\t\t\tunset( $data['cover']['limit_by'] );\n\t\t\t}\n\n\t\t\tif ( isset( $data['new_friend']['limit'] ) && isset( $data['new_friend']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['new_friend']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['new_friend']['limit'] = $limit . '/' . $data['new_friend']['limit_by'];\n\t\t\t\tunset( $data['new_friend']['limit_by'] );\n\t\t\t}\n\n\t\t\t$data['new_friend']['block'] = ( isset( $data['new_friend']['block'] ) ) ? absint( $data['new_friend']['block'] ) : 0;\n\n\t\t\tif ( isset( $data['new_comment']['limit'] ) && isset( $data['new_comment']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['new_comment']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['new_comment']['limit'] = $limit . '/' . $data['new_comment']['limit_by'];\n\t\t\t\tunset( $data['new_comment']['limit_by'] );\n\t\t\t}\n\n\t\t\tif ( isset( $data['add_favorite']['limit'] ) && isset( $data['add_favorite']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['add_favorite']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['add_favorite']['limit'] = $limit . '/' . $data['add_favorite']['limit_by'];\n\t\t\t\tunset( $data['add_favorite']['limit_by'] );\n\t\t\t}\n\n\t\t\tif ( isset( $data['message']['limit'] ) && isset( $data['message']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['message']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['message']['limit'] = $limit . '/' . $data['message']['limit_by'];\n\t\t\t\tunset( $data['message']['limit_by'] );\n\t\t\t}\n\n\t\t\tif ( isset( $data['send_gift']['limit'] ) && isset( $data['send_gift']['limit_by'] ) ) {\n\t\t\t\t$limit = sanitize_text_field( $data['send_gift']['limit'] );\n\t\t\t\tif ( $limit == '' ) $limit = 0;\n\t\t\t\t$data['send_gift']['limit'] = $limit . '/' . $data['send_gift']['limit_by'];\n\t\t\t\tunset( $data['send_gift']['limit_by'] );\n\t\t\t}\n\n\t\t\treturn $data;\n\n\t\t}\n\n\t}\n\n}", "function activator()\n{\n require_once plugin_dir_path( __FILE__ ) . 'includes/Activator.php';\n\tActivator::activate();\n}", "private function __construct() {\r\n\r\n\t\t\t// Nothing else matters if we're not on the main site\r\n\t\t\tif ( ! is_main_site() ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t//auto loader\r\n\t\t\tspl_autoload_register( array( $this, 'autoloader' ) );\r\n\t\t\t//start upgrade if needed\r\n\t\t\tif ( get_site_option( 'backwpup_version' ) != self::get_plugin_data( 'Version' ) ) {\r\n\t\t\t\tBackWPup_Install::activate();\r\n\t\t\t}\r\n\t\t\t//load pro features\r\n\t\t\tif ( class_exists( 'BackWPup_Pro' ) ) {\r\n\t\t\t\tBackWPup_Pro::get_instance();\r\n\t\t\t}\r\n\t\t\t//WP-Cron\r\n\t\t\tif ( defined( 'DOING_CRON' ) && DOING_CRON ) {\r\n\t\t\t\t//early disable caches\r\n\t\t\t\tif ( ! empty( $_GET[ 'backwpup_run' ] ) && class_exists( 'BackWPup_Job' ) ) {\r\n\t\t\t\t\tBackWPup_Job::disable_caches();\r\n\t\t\t\t}\r\n\t\t\t\t// add normal cron actions\r\n\t\t\t\tadd_action( 'backwpup_cron', array( 'BackWPup_Cron', 'run' ) );\r\n\t\t\t\tadd_action( 'backwpup_check_cleanup', array( 'BackWPup_Cron', 'check_cleanup' ) );\r\n\t\t\t\t// add action for doing thinks if cron active\r\n\t\t\t\t// must done in wp_loaded so that all is really loaded and initiated\r\n\t\t\t\tadd_action( 'wp_loaded', array( 'BackWPup_Cron', 'cron_active' ), 999 );\r\n\t\t\t\t// if in cron the rest must not needed\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t//deactivation hook\r\n\t\t\tregister_deactivation_hook( __FILE__, array( 'BackWPup_Install', 'deactivate' ) );\r\n\t\t\t//Admin bar\r\n\t\t\tif ( is_admin_bar_showing() ) {\r\n\t\t\t\tadd_action( 'init', array( 'BackWPup_Adminbar', 'get_instance' ) );\r\n\t\t\t}\r\n\t\t\t//only in backend\r\n\t\t\tif ( is_admin() && class_exists( 'BackWPup_Admin' ) ) {\r\n\t\t\t\tBackWPup_Admin::get_instance();\r\n\t\t\t}\r\n\t\t\t//work with wp-cli\r\n\t\t\tif ( defined( 'WP_CLI' ) && WP_CLI && method_exists( 'WP_CLI', 'add_command' ) ) {\r\n\t\t\t\tWP_CLI::add_command( 'backwpup', 'BackWPup_WP_CLI' );\r\n\t\t\t}\r\n\t\t}", "protected function loadModule()\n {\n require_once 'Autoload/MyPluginAutoload.php';\n\n do_action('nautzick_load_module');\n \n MyPluginAutoload::getInstance();\n }", "function __construct() {\n\t\tparent::start(\n\t\t\t'stacks',\n\t\t\t__( 'Stacks', 'buddypress' ),\n\t\t\tBP_PLUGIN_DIR\n\t\t);\n\t}", "function Plugin()\n\t{\n\t\t$this->Plugin_Base();\n\t}", "function DS_Custom_Modules(){\n if(class_exists(\"ET_Builder_Module\")){\n \t// This adds options for more contact types and, with some clever css, a more flexible usage.\n\tinclude(\"ehanhanced_divi_modules/extended_person_module.php\");\n\n\t// This creates a hybrid blurb/cta. CTA's should have the option for images and more than one button. Sheesh!\n\tinclude(\"ehanhanced_divi_modules/extended_cta.php\");\n }\n}", "public function register() {\n\t\tadd_action( 'bp_loaded', [ $this, 'registerServices' ] );\n\t}", "public function base_plugin_active()\n\t{\n\t\treturn true;\n\t}", "function activate_wp_book() {\n Inc\\Base\\Activate::activate();\n}", "public function include_global(){\n global $pagenow;\n include_once(THEME_PATH.'/includes/helpers.php');\n include_php_from_dir(THEME_PATH.'/includes/');\n\n if(class_exists('WPBakeryShortCode')){\n include_php_from_dir(THEME_PATH.'/wpbackery/');\n }\n }", "function _manually_load_plugin() {\n\t// Load plugin\n\trequire_once __DIR__ . '/../../wp-separate-user-base.php';\n}", "public function loadPaymentGatewaysExtentions()\n {\n\n // Remove the gateway construct actions to avoid duplications\n $this->removeGatewayActions();\n\n // Load our custom extensions with Polylang support\n foreach ($this->enabledGateways as $gateway) {\n switch ($gateway->id) {\n case 'bacs':\n new Gateways\\GatewayBACS();\n break;\n case 'cheque':\n new Gateways\\GatewayCheque();\n break;\n case 'cod':\n new Gateways\\GatewayCOD();\n break;\n default:\n break;\n }\n\n // Allows other plugins to load payment gateways class extentions or change the gateway object\n do_action(HooksInterface::GATEWAY_LOAD_EXTENTION.$gateway->id, $gateway, $this->enabledGateways);\n }\n }", "public function load_widgets() {\n\n /**\n * The function responsible for Widgets\n * of the plugin.\n */\n include plugin_dir_path(dirname(__FILE__)) . 'includes/widgets/recent-posts.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/widgets/newsletter.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/widgets/simple-newsletter.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/widgets/flickr.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/widgets/instagram.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/widgets/twitter.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/widgets/contact-info.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/widgets/contact-info2.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/widgets/contact-info3.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/widgets/about-info.php';\n }", "function bbboing_oik_add_shortcodes() { \r\n bw_add_shortcode( 'bbboing', 'bbboing_sc', oik_path( \"bbboing.inc\", \"bbboing\" ), false );\r\n}", "function inject_js(){\n global $bp;\n if(bp_is_group()&&bp_is_group_admin_page()&& $bp->action_variables[0]=='appearances')\n wp_enqueue_script ('bpgclite-js',plugin_dir_url(__FILE__).'js/group-customizer-lite.js',array('jquery'));\n }", "function thb_builder_load() {\n\t\tadd_action( 'thb_builder_hook', 'thb_builder' );\n\t}", "function bpfit_weight_subtab_show_screen() {\n\t\t\tadd_action( 'bp_template_title', array($this, 'bpfit_weight_subtab_function_to_show_title') );\n\t\t\tadd_action( 'bp_template_content', array($this, 'bpfit_weight_subtab_function_to_show_content') );\n\t\t\tbp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );\n\t\t}", "function positive_panels_init(){\n\t/*$display_settings = get_option('siteorigin_panels_display', array());\n\tif( isset($display_settings['bundled-widgets'] ) && !$display_settings['bundled-widgets'] ) return;*/\n\n\tinclude 'widgets/widgets.php';\n}", "function load_plugin() {\n global $fb_opt_name, $gp_opt_name, $popup_fb_page, $popup_delay, $fb_popup_box;\n \n if(is_admin()&& get_option('Activated_Plugin')=='Plugin-Slug') {\n delete_option('Activated_Plugin');\n add_option($fb_opt_name,'on');\n add_option($gp_opt_name,'on');\n add_option($popup_fb_page,'codesamplez');\n add_option($popup_delay,'2');\n add_option($fb_popup_box,'on');\n }\n}", "public function wp_loaded()\n {\n }", "function activate_sitewide_plugin()\n {\n }", "function should_load() {\n\t\tinclude_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\n\t\treturn is_plugin_active( 'revslider/revslider.php' );\n\t}", "function _cpwpdf_load_plugin() {\n \n\tif ( ! defined( 'WPDF_DIR' ) ) {\n\t\tdefine( 'WPDF_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );\n\t}\n\tif ( ! defined( 'CPWPDF_PLUGIN_BASENAME' ) ) {\n\t\t\tdefine( 'CPWPDF_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );\n\t\t}\n\n\tif ( ! defined( 'WPDF_FILE' ) ) {\n\t\tdefine( 'WPDF_FILE', __FILE__ );\n\t}\n\n\n\tif ( file_exists( WPDF_DIR . '/mpdf/vendor/autoload.php' ) ) {\n\t\t\trequire_once WPDF_DIR . '/mpdf/vendor/autoload.php';\n\t}\n\trequire_once WPDF_DIR . '/pdf-view-function.php';\n\t\n\t\n}", "function qpi_load() {\n\tadd_action( 'wp_ajax_qpi-install-plugin', 'qpi_install_plugin' );\n\tadd_action( 'wp_ajax_qpi-activate', 'qpi_activate_plugin' );\n\n\tadd_action( 'admin_enqueue_scripts', 'qpi_admin_enqueue_scripts' );\n}", "function load() {\n\tadd_action( 'after_setup_theme', __NAMESPACE__ . '\\\\setup' );\n}", "public function load_supported_features()\n {\n $root = $this->module_roots['dir'];\n // load plugin constants/data\n require_once $root . 'classes/constants.php';\n $custom_plugin_data = new Constants( $this->module_roots );\n // echo \"<pre>\";\n // print_r($custom_plugin_data);\n // echo \"</pre>\";\n // links on the main plugin index page\n require_once $root . 'classes/utility.php';\n $utility = new Utility( $this->module_roots, $custom_plugin_data );\n $plugin_data = get_plugin_data( $this->module_roots['file'], false, false );\n // data to pass to certain classes\n $new_features_json = Utility::get_new_features_json();\n $new_features_arr = Utility::filter_and_decode_json( $new_features_json );\n // functionality for free version only\n $path = $root . 'classes/hooks.php';\n \n if ( file_exists( $path ) ) {\n require_once $path;\n new Hooks( $this->module_roots );\n }\n \n // enqueue plugin scripts\n require_once $root . 'classes/enqueue-scripts.php';\n new Enqueue_Scripts(\n $this->module_roots,\n $new_features_arr,\n $plugin_data,\n $custom_plugin_data\n );\n // plugin settings pages\n require_once $root . 'classes/settings.php';\n new Settings(\n $this->module_roots,\n $plugin_data,\n $custom_plugin_data,\n $utility\n );\n require_once $root . 'classes/settings-new-features.php';\n new New_Features_Settings(\n $this->module_roots,\n $new_features_arr,\n $plugin_data,\n $custom_plugin_data,\n $utility\n );\n require_once $root . 'classes/settings-welcome.php';\n new Welcome_Settings(\n $this->module_roots,\n $plugin_data,\n $custom_plugin_data,\n $utility\n );\n // register blocks\n require_once $root . 'classes/register-blocks.php';\n new Register_Blocks( $this->module_roots );\n // [svg-flag] shortcode\n require_once $root . 'classes/shortcodes/shortcodes.php';\n new Shortcodes( $this->module_roots, $custom_plugin_data );\n // links on the main plugin index page\n require_once $root . 'classes/links.php';\n new Flags_Links(\n $this->module_roots,\n $plugin_data,\n $custom_plugin_data,\n $utility\n );\n // run upgrade routine when plugin updated to new version\n require_once $root . 'classes/upgrade.php';\n new Flags_Upgrade( $this->module_roots, $custom_plugin_data );\n // localize plugin\n require_once $root . 'classes/localize.php';\n new Localize( $this->module_roots );\n }", "function Plugin_Base()\n\t{\n\t\t// $web may actually be null if this is a page plugin loaded from\n\t\t// the commandline execution profile.\n\t\t$this->web =& Registry::get('pronto:web');\n\t\t$this->depends = new stdClass;\n\n\t\tif(method_exists($this, '__init__')) {\n\t\t\t$this->__init__();\n\t\t}\n\t}", "function widget_load() {\n\t\tregister_widget('ilgelo_wSocial');\n\t\tregister_widget('ilgelo_wTwitter');\n\t\tregister_widget('ilgelo_banner');\n\t}", "function bp_core_load_buddybar_css() {\n\tglobal $wp_styles;\n\n\tif ( bp_use_wp_admin_bar() || ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() ) || ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR ) )\n\t\treturn;\n\n\t$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';\n\n\tif ( file_exists( get_stylesheet_directory() . '/_inc/css/adminbar.css' ) ) { // Backwards compatibility\n\t\t$stylesheet = get_stylesheet_directory_uri() . '/_inc/css/adminbar.css';\n\t} else {\n\t\t$stylesheet = buddypress()->plugin_url . \"bp-core/css/buddybar{$min}.css\";\n\t}\n\n\twp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_buddybar_rtl_css', $stylesheet ), array(), bp_get_version() );\n\t$wp_styles->add_data( 'bp-admin-bar', 'rtl', true );\n\tif ( $min )\n\t\t$wp_styles->add_data( 'bp-admin-bar', 'suffix', $min );\n}", "function _init() {\n\t\n\t\t// ----------------------------------------\n\t\t// load database wrapper object \n\t\t// ----------------------------------------\n\t\n\t\t// define filename\n\t\t$class_file = 'class_commentpress_mu_db.php';\n\t\n\t\t// get path\n\t\t$class_file_path = cpmu_file_is_present( $class_file );\n\t\t\n\t\t// we're fine, include class definition\n\t\trequire_once( $class_file_path );\n\t\n\t\t// init autoload database object\n\t\t$this->db = new CommentPressMultisiteAdmin( $this );\n\t\t\n\n\n\t\t// ----------------------------------------\n\t\t// load standard multisite object \n\t\t// ----------------------------------------\n\t\n\t\t// define filename\n\t\t$class_file = 'class_commentpress_mu.php';\n\t\n\t\t// get path\n\t\t$class_file_path = cpmu_file_is_present( $class_file );\n\t\t\n\t\t// we're fine, include class definition\n\t\trequire_once( $class_file_path );\n\t\n\t\t// init multisite object\n\t\t$this->mu = new CommentPressMultisite( $this );\n\t\t\n\n\t\t\n\t\t// ----------------------------------------\n\t\t// optionally load buddypress object \n\t\t// ----------------------------------------\n\t\n\t\t// load when buddypress is loaded\n\t\tadd_action( 'bp_include', array( &$this, '_load_buddypress_object' ) );\n\n\t}", "function mmc_load_bootstrap() {\r\n\t// make sure we've got bootstrap stuff\r\n\r\n\t// bootstrap js - jquery is enqueued by WordPress by default\r\n\twp_register_script('mmc_bootstrap', plugins_url( '/vendor/bootstrap-4.1.3-dist/js/bootstrap.bundle.min.js', __FILE__), array( 'jquery') );\r\n\twp_enqueue_script('mmc_bootstrap');\r\n\r\n\r\n\t// our own js file which loads the lazy loading\r\n\twp_register_script('mmc_magic_cards', plugins_url( '/js/magic-cards-grid.js', __FILE__), array( 'jquery' ) );\r\n\twp_enqueue_script('mmc_magic_cards');\r\n\r\n\t// bootstrap CSS\r\n\twp_register_style('mmc_bootstrap', plugins_url( '/vendor/bootstrap-4.1.3-dist/css/bootstrap.min.css', __FILE__) );\r\n\twp_enqueue_style('mmc_bootstrap');\r\n\r\n\t// our own styles\r\n\twp_register_style('mmc_style', plugins_url( '/css/magic-cards-grid.css', __FILE__) );\r\n\twp_enqueue_style('mmc_style');\r\n\r\n}", "function hotpro_load_widget() {register_widget( 'data_hotpro_widget' );}", "public function __construct() {\n\n\t\t$this->load_dependencies();\n\n\t\t// Load plugin text domain\n\t\t// add_action( 'init', array( $this, 'load_plugin_textdomain' ) );\n\n\t\t// Activate plugin when new blog is added\n\t\t// add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) );\n\n\t\t// Load public-facing style sheet and JavaScript.\n\t\t// add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) );\n\t\t// add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );\n\n\t\t// Add the Restrict Content Pro management forms to the user's BP profile.\n\t\tadd_action( 'bp_setup_nav', array( $this, 'add_subscription_management_screen' ) );\n\n\t\t// Change the submit button label on the subscription upgrade form.\n\t\tadd_filter( 'rcp_registration_register_button', array( $this, 'filter_registration_button_label' ) );\n\n\t\t// We park some pieces of the plugin that we're not using.\n\t\t// Don't show the \"restrict content\" meta box on any post.\n\t\tremove_action( 'admin_menu', 'rcp_add_meta_boxes' );\n\t\t// Don't run the \"protect content\" query for premium content.\n\t\t// Note that if we wanted to use this, the exclusion would probably conflict with BP Docs.\n\t\tremove_action( 'pre_get_posts', 'rcp_hide_premium_posts', 99999 );\n\n\t\t// Filtering some variable pieces\n\n\t\tadd_filter( 'rcp_return_url', array( $this, 'filter_rcp_return_url' ), 10, 2 );\n\n\t\t// Filter the results of RCP's registration page check.\n\t\tadd_filter( 'rcp_is_registration_page', array( $this, 'filter_rcp_is_registration_page' ) );\n\n\t\tadd_action('rcp_before_registration_submit_field', array( $this, 'add_terms_of_use_field' ), 9999 );\n\t\tadd_action('rcp_form_errors', array( $this, 'check_terms_of_use' ) );\n\n\t\t// Let's monitor the sent values\n\t\tadd_filter( 'rcp_subscription_data', array( $this, 'filter_rcp_subscription_data' ) );\n\n\t\t// Limit which plans get shown to users.\n\t\tadd_filter( 'rcp_show_subscription_level', array( $this, 'filter_rcp_show_subscription_level' ), 10, 3 );\n\n\t\t// Filter the rcp_can_upgrade_subscription value\n\t\tadd_filter( 'rcp_can_upgrade_subscription', array( $this, 'filter_rcp_can_upgrade_subscription' ), 10, 2 );\n\n\t\t// Record the IPN details\n\t\tadd_action( 'rcp_valid_ipn', array( $this, 'filter_rcp_valid_ipn' ), 10, 3 );\n\n\t\t// Since we're thinking in terms of upgrades, we want the expiration date to always be based on today.\n\t\t// add_filter( 'rcp_member_renewal_expiration', array( $this, 'filter_rcp_member_renewal_expiration' ), 10, 3 );\n\t}", "function ddw_bptb_admin_bar_menu() {\n\n\tglobal $wp_admin_bar, $locale, $bptb_is_bpmg;\n\n\t/**\n\t * Allows for filtering the general user role/capability to display main & sub-level items\n\t *\n\t * Default role: 'administrator'\n\t *\n\t * @since 1.2.0\n\t */\n\t$bptb_filter_capability = apply_filters( 'bptb_filter_capability_all', 'administrator' );\n\n\t/**\n\t * Required BuddyPress/ WordPress cabability to display new admin bar entry\n\t * Only showing items if toolbar / admin bar is activated and user is logged in!\n\t *\n\t * @since 1.0.0\n\t */\n\tif ( ! is_user_logged_in()\n\t\t|| ! is_admin_bar_showing()\n\t\t|| ! current_user_can( $bptb_filter_capability )\t// allows for custom filtering the required role/capability\n\t\t|| ! BPTB_DISPLAY\t// allows for custom disabling\n\t) {\n\t\treturn;\n\t}\n\n\n\t/** Set unique prefix */\n\t$prefix = 'ddw-buddypress-';\n\t\n\t/** Create parent menu item references */\n\t$bpbar = $prefix . 'admin-bar';\t\t\t\t\t// root level\n\t\t$bpsupport = $prefix . 'bpsupport';\t\t\t\t// sub level: bp support\n\t\t$bpcodex = $prefix . 'bpcodex';\t\t\t\t\t// sub level: bp codex\n\t\t$bpsites = $prefix . 'bpsites';\t\t\t\t\t// sub level: bp sites\n\t\t$bpactivity = $prefix . 'bpactivity';\t\t\t\t// sub level: bp activity\n\t\t$bpsettings = $prefix . 'bpsettings';\t\t\t\t// sub level: bp settings\n\t\t\t$spages = $prefix . 'spages';\t\t\t\t\t// third level: component's front pages\n\t\t\t$s_bpmedia = $prefix . 's_bpmedia';\t\t\t\t// third level: bp media plugin\n\t\t$bppfields = $prefix . 'bppfields';\t\t\t\t// sub level: bp profile fields\n\t\t\t$bppfieldsbpuatl = $prefix . 'bppfieldsbpuatl';\t\t\t// third level plugin extension: bp u.acc. type lite\n\t\t$users = $prefix . 'users';\t\t\t\t\t// sub level: users\n\t\t\t$usersinviteanyone = $prefix . 'usersinviteanyone';\t\t// third level: invite anyone\n\t\t\t$usersbpprofilesstats = $prefix . 'usersbpprofilesstats';\t// third level plugin extension: bp profiles stats\n\t\t$bpmggroup = $prefix . 'bpmggroup';\t\t\t\t// sub level: \"manage groups\" group (\"hook\" place)\n\t\t\t$managegroups = $prefix . 'managegroups';\t\t// sub level: manage groups\n\t\t\t\t$bpmgbpgm = $prefix . 'bpmgbpgm';\t\t\t// third level mg: bp group management\n\t\t\t\t$bpmgbpge = $prefix . 'bpmgbpge';\t\t\t// third level mg: bp groups extras\n\t\t\t\t$bpmgcollabpress = $prefix . 'bpmgcollabpress';\t\t// third level mg: collabpress\n\t\t$extensions = $prefix . 'extensions';\t\t\t\t// sub level: extensions\n\t\t\t$extwangguard = $prefix . 'extwangguard';\t\t\t// third level plugin extension: wangguard\n\t\t\t$extbpgm = $prefix . 'extbpgm';\t\t\t\t\t// third level plugin extension: bp group management\n\t\t\t$extbpge = $prefix . 'extbpge';\t\t\t\t\t// third level plugin extension: bp groups extras\n\t\t\t$extbpdocs = $prefix . 'extbpdocs';\t\t\t\t// third level plugin extension: bp docs\n\t\t\t$extbpuatl = $prefix . 'extbpuatl';\t\t\t\t// third level plugin extension: bp u.acc. type lite\n\t\t\t$extbpprofilesstats = $prefix . 'extbpprofilesstats';\t\t// third level plugin extension: bp profiles stats\n\t\t\t$extbuddystream = $prefix . 'extbuddystream';\t\t\t// third level plugin extension: buddystream\n\t\t\t$extinviteanyone = $prefix . 'extinviteanyone';\t\t\t// third level plugin extension: invite anyone\n\t\t\t$extcollabpress = $prefix . 'extcollabpress';\t\t\t// third level plugin extension: collabpress\n\t\t\t$exteventsmanager = $prefix . 'exteventsmanager';\t\t// third level plugin extension: events manager\n\t\t\t$extseopress = $prefix . 'extseopress';\t\t\t\t// third level plugin extension: seopress\n\t\t\t$extbpprofilesearch = $prefix . 'extbpprofilesearch';\t\t// third level plugin extension: bp profile search\n\t\t\t$extbpcheckins = $prefix . 'extbpcheckins';\t\t\t// third level plugin extension: bp checkins\n\t\t\t\t$extbpcheckinsplaces = $prefix . 'extbpcheckinsplaces';\t\t// fourth level: bp checkins places\n\t\t\t\t$extbpcheckinsfoursquare = $prefix . 'extbpcheckinsfoursquare';\t// fourth level: bp checkins foursquare\n\t\t\t$extbpmedia = $prefix . 'extbpmedia';\t\t\t\t// third level plugin extension: bp media\n\t\t\t$extachievementsapp = $prefix . 'extachievementsapp';\t// third level plugin extension: achievements app\n\t\t\t$extbuddybox = $prefix . 'extbuddybox';\t\t\t\t// third level plugin extension: buddybox\n\t\t$extgroup = $prefix . 'extgroup';\t\t\t\t// sub level: extend group (\"hook\" place)\n\t\t\t$pgroup = $prefix . 'pgroup';\t\t\t\t// sub level: plugin group (\"hook\" place)\n\t\t\t$tgroup = $prefix . 'tgroup';\t\t\t\t// sub level: theme group (\"hook\" place)\n\t\t\t\t$bservicessettings = $prefix . 'bservicessettings';\t// third level theme: business services\n\t\t\t\t$threeonesevensettings = $prefix . 'threeonesevensettings';\t// third level theme: 3oneseven themes\n\t\t$bpgroup = $prefix . 'bpgroup';\t\t\t\t\t// sub level: bp group (resources)\n\t\t\t$translations = $prefix . 'translations';\t\t\t\t// third level: translations download\n\n\n\t/** Make the \"BuddyPress\" name filterable within menu items */\n\t$bptb_buddypress_name = apply_filters( 'bptb_filter_buddypress_name', __( 'BuddyPress', 'buddypress-toolbar' ) );\n\n\t/** Make the \"BuddyPress\" name's tooltip filterable within menu items */\n\t$bptb_buddypress_name_tooltip = apply_filters( 'bptb_filter_buddypress_name_tooltip', _x( 'BuddyPress', 'Translators: For the tooltip', 'buddypress-toolbar' ) );\n\n\n\t/** For the Codex search */\n\t$bptb_search_codex = __( 'Search Codex', 'buddypress-toolbar' );\n\t$bptb_go_button = '<input type=\"submit\" value=\"' . __( 'GO', 'buddypress-toolbar' ) . '\" class=\"bptb-search-go\" /></form>';\n\n\n\t/** Display these items also when BuddyPress plugin is not installed */\n\tif ( BPTB_RESOURCES_DISPLAY ) {\n\n\t\t/** Include plugin file with resources links */\n\t\trequire_once( BPTB_PLUGIN_DIR . '/includes/bptb-resources.php' );\n\n\t} // end-if constant check for displaying resources\n\n\n\t/** Display language specific links only for these locales: de_DE, de_AT, de_CH, de_LU */\n\tif ( BPTB_DE_DISPLAY && ( get_locale() == 'de_DE' || get_locale() == 'de_AT' || get_locale() == 'de_CH' || get_locale() == 'de_LU' ) ) {\n\n\t\t/** German BP forum */\n\t\t$bpgroup_menu_items['bp-forum-de'] = array(\n\t\t\t'parent' => $bpgroup,\n\t\t\t'title' => __( 'German Support Forum', 'buddypress-toolbar' ),\n\t\t\t'href' => 'http://forum.wpde.org/buddypress/',\n\t\t\t'meta' => array( 'title' => __( 'German Support Forum', 'buddypress-toolbar' ) )\n\t\t);\n\n\t\t/** German BP language packs */\n\t\t$bpgroup_menu_items['bp-languages-de'] = array(\n\t\t\t'parent' => $bpgroup,\n\t\t\t'title' => __( 'German language files', 'buddypress-toolbar' ),\n\t\t\t'href' => 'http://deckerweb.de/sprachdateien/buddypress/',\n\t\t\t'meta' => array( 'title' => __( 'German language files for BuddyPress and more BP extensions', 'buddypress-toolbar' ) )\n\t\t);\n\n\t} // end-if German locales\n\n\n\t/** Translate BuddyPress section - only display for non-English locales */\n\tif ( BPTB_TRANSLATIONS_DISPLAY && ( empty( $locale ) || !( get_locale() == 'en_US' || get_locale() == 'en_GB' || get_locale() == 'en_NZ' || get_locale() == 'en' ) ) ) {\n\n\t\t/** Translations Forum */\n\t\t$bpgroup_menu_items['translations'] = array(\n\t\t\t'parent' => $bpgroup,\n\t\t\t'title' => __( 'Translations Forum', 'buddypress-toolbar' ),\n\t\t\t'href' => 'http://buddypress.org/support/forum/localization/',\n\t\t\t'meta' => array( 'title' => _x( 'Translations Forum', 'Translators: For the tooltip', 'buddypress-toolbar' ) )\n\t\t);\n\n\t\t/** Language Packs Download */\n\t\tif ( !( get_locale() == 'de_DE' || get_locale() == 'de_AT' || get_locale() == 'de_CH' || get_locale() == 'de_LU' ) ) {\n\n\t\t\t$bpgroup_menu_items['translations-download'] = array(\n\t\t\t\t'parent' => $translations,\n\t\t\t\t'title' => __( 'Language Packs Download', 'buddypress-toolbar' ),\n\t\t\t\t'href' => 'http://codex.buddypress.org/user/translations/',\n\t\t\t\t'meta' => array( 'title' => _x( 'Language Packs Download', 'Translators: For the tooltip', 'buddypress-toolbar' ) )\n\t\t\t);\n\n\t\t} // end-if locale check\n\n\t} // end-if translate bp\n\n\n\t/** Check for active BP version to define settings links */\n\tif ( class_exists( 'BuddyPress' ) ) {\n\n\t\t/** Main settings link */\n\t\t$bp_aurl_main = is_multisite() ? network_admin_url( 'settings.php?page=bp-components' ) : admin_url( 'options-general.php?page=bp-components' );\n\t\t/** Profile fields */\n\t\t$bp_aurl_pfields = network_admin_url( 'users.php?page=bp-profile-setup' );\n\n\t} else {\n\n\t\t/** Main settings link */\n\t\t$bp_aurl_main = network_admin_url( 'admin.php?page=bp-general-settings' );\n\t\t/** Profile fields */\n\t\t$bp_aurl_pfields = network_admin_url( 'admin.php?page=bp-profile-setup' );\n\n\t} // end-if BP check\n\n\n\t/** Show these items only if BuddyPress plugin is actually installed */\n\tif ( ( function_exists( 'is_plugin_active' ) && is_plugin_active( 'buddypress/bp-loader.php' ) ) || class_exists( 'BP_Core' ) ) {\n\n\t\t/** Check for BP v1.6+ - if true, display \"Moderate Activity\" link */\n\t\tif ( class_exists( 'BuddyPress' ) && ( bp_current_user_can( 'bp_moderate' ) && current_user_can( 'manage_options' ) ) ) {\n\n\t\t\t$menu_items['bpactivity'] = array(\n\t\t\t\t'parent' => $bpbar,\n\t\t\t\t'title' => __( 'Moderate Activity', 'buddypress-toolbar' ),\n\t\t\t\t'href' => network_admin_url( 'admin.php?page=bp-activity' ),\n\t\t\t\t'meta' => array( 'target' => '', 'title' => __( 'Moderate Activity', 'buddypress-toolbar' ) )\n\n\t\t\t);\n\n\t\t} // end-if BP moderate activity check\n\n\t\t/** BP Settings section */\n\t\tif ( current_user_can( 'manage_options' ) ) {\n\n\t\t\t$menu_items['bpsettings'] = array(\n\t\t\t\t'parent' => $bpbar,\n\t\t\t\t'title' => esc_attr__( $bptb_buddypress_name ) . ' ' . __( 'Settings', 'buddypress-toolbar' ),\n\t\t\t\t'href' => $bp_aurl_main,\n\t\t\t\t'meta' => array( 'target' => '', 'title' => esc_attr__( $bptb_buddypress_name_tooltip ) . ' ' . __( 'Settings', 'buddypress-toolbar' ) )\n\t\t\t);\n\n\t\t\t$menu_items['spages'] = array(\n\t\t\t\t'parent' => $bpsettings,\n\t\t\t\t'title' => __( 'Pages for Components', 'buddypress-toolbar' ),\n\t\t\t\t'href' => network_admin_url( 'admin.php?page=bp-page-settings' ),\n\t\t\t\t'meta' => array( 'target' => '', 'title' => __( 'Pages for Components', 'buddypress-toolbar' ) )\n\t\t\t);\n\n\t\t\t/** Frontend component root pages */\n\t\t\t/** Activity */\n\t\t\tif ( function_exists( 'bp_is_active' ) && bp_is_active( 'activity' ) && function_exists( 'bp_get_activity_root_slug' ) ) {\n\n\t\t\t\t$menu_items['spages-activity'] = array(\n\t\t\t\t\t'parent' => $spages,\n\t\t\t\t\t'title' => __( 'Activity Root Page', 'buddypress-toolbar' ),\n\t\t\t\t\t'href' => get_home_url() . '/' . bp_get_activity_root_slug(),\n\t\t\t\t\t'meta' => array( 'target' => '', 'title' => _x( 'Frontend: Activity Root Page', 'Translators: For the tooltip', 'buddypress-toolbar' ) )\n\t\t\t\t);\n\n\t\t\t} // end-if activity check\n\n\t\t\t/** Blogs/Sites */\n\t\t\tif ( is_multisite() && ( function_exists( 'bp_is_active' ) && bp_is_active( 'blogs' ) && function_exists( 'bp_get_blogs_root_slug' ) ) ) {\n\n\t\t\t\t$menu_items['spages-blogs'] = array(\n\t\t\t\t\t'parent' => $spages,\n\t\t\t\t\t'title' => __( 'Blogs Root Page', 'buddypress-toolbar' ),\n\t\t\t\t\t'href' => get_home_url() . '/' . bp_get_blogs_root_slug(),\n\t\t\t\t\t'meta' => array( 'target' => '', 'title' => _x( 'Frontend: Blogs Root Page', 'Translators: For the tooltip', 'buddypress-toolbar' ) )\n\t\t\t\t);\n\n\t\t\t} // end-if blogs/sites check\n\n\t\t\t/** Groups */\n\t\t\tif ( function_exists( 'bp_is_active' ) && bp_is_active( 'groups' ) && function_exists( 'bp_get_groups_root_slug' ) ) {\n\n\t\t\t\t$menu_items['spages-groups'] = array(\n\t\t\t\t\t'parent' => $spages,\n\t\t\t\t\t'title' => __( 'Groups Root Page', 'buddypress-toolbar' ),\n\t\t\t\t\t'href' => get_home_url() . '/' . bp_get_groups_root_slug(),\n\t\t\t\t\t'meta' => array( 'target' => '', 'title' => _x( 'Frontend: Groups Root Page', 'Translators: For the tooltip', 'buddypress-toolbar' ) )\n\t\t\t\t);\n\n\t\t\t} // end-if groups check\n\n\t\t\t/** Members */\n\t\t\tif ( function_exists( 'bp_is_active' ) && bp_is_active( 'members' ) && function_exists( 'bp_get_members_root_slug' ) ) {\n\n\t\t\t\t$menu_items['spages-members'] = array(\n\t\t\t\t\t'parent' => $spages,\n\t\t\t\t\t'title' => __( 'Members Root Page', 'buddypress-toolbar' ),\n\t\t\t\t\t'href' => get_home_url() . '/' . bp_get_members_root_slug(),\n\t\t\t\t\t'meta' => array( 'target' => '', 'title' => _x( 'Frontend: Members Root Page', 'Translators: For the tooltip', 'buddypress-toolbar' ) )\n\t\t\t\t);\n\n\t\t\t} // end-if members check\n\n\t\t\t/** BP Settings continued... */\n\t\t\t$menu_items['s-moresettings'] = array(\n\t\t\t\t'parent' => $bpsettings,\n\t\t\t\t'title' => __( 'Community &amp; Groups', 'buddypress-toolbar' ),\n\t\t\t\t'href' => network_admin_url( 'admin.php?page=bp-settings' ),\n\t\t\t\t'meta' => array( 'target' => '', 'title' => __( 'Community &amp; Groups', 'buddypress-toolbar' ) )\n\t\t\t);\n\n\t\t} // end-if cap check\n\n\t\t/** Forum Setup link only for BuddyPress prior v1.6 */\n\t\tif ( ! class_exists( 'BuddyPress' ) && ( function_exists( 'bp_is_active' ) && bp_is_active( 'forums' ) && function_exists( 'bp_get_forums_root_slug' ) ) && current_user_can( 'manage_options' ) ) {\n\n\t\t\t/** Forum setup settings */\n\t\t\t$menu_items['s-forums'] = array(\n\t\t\t\t'parent' => $bpsettings,\n\t\t\t\t'title' => __( 'Forums Setup', 'buddypress-toolbar' ),\n\t\t\t\t'href' => network_admin_url( 'admin.php?page=bb-forums-setup' ),\n\t\t\t\t'meta' => array( 'target' => '', 'title' => __( 'Forums Setup', 'buddypress-toolbar' ) )\n\t\t\t);\n\n\t\t\t/** Frontend component root page */\n\t\t\t$menu_items['spages-forums'] = array(\n\t\t\t\t'parent' => $spages,\n\t\t\t\t'title' => __( 'Forums Root Page', 'buddypress-toolbar' ),\n\t\t\t\t'href' => get_home_url() . '/' . bp_get_forums_root_slug(),\n\t\t\t\t'meta' => array( 'target' => '', 'title' => _x( 'Frontend: Forums Root Page', 'Translators: For the tooltip', 'buddypress-toolbar' ) )\n\t\t\t);\n\n\t\t} // end-if BP check\n\n\t\t/** BP Settings section continued */\n\t\tif ( current_user_can( 'edit_theme_options' ) ) {\n\n\t\t\t$menu_items['s-bpwidgets'] = array(\n\t\t\t\t'parent' => $bpsettings,\n\t\t\t\t'title' => esc_attr__( $bptb_buddypress_name ) . ' ' . __( 'Widgets', 'buddypress-toolbar' ),\n\t\t\t\t'href' => admin_url( 'widgets.php' ),\n\t\t\t\t'meta' => array( 'target' => '', 'title' => esc_attr__( $bptb_buddypress_name_tooltip ) . ' ' . __( 'Widgets', 'buddypress-toolbar' ) )\n\t\t\t);\n\n\t\t} // end-if cap check\n\n\t\t/** Profile Fields section */\n\t\tif ( current_user_can( 'manage_options' ) ) {\n\n\t\t\t$menu_items['bppfields'] = array(\n\t\t\t\t'parent' => $bpbar,\n\t\t\t\t'title' => __( 'Profile Fields/Groups', 'buddypress-toolbar' ),\n\t\t\t\t'href' => $bp_aurl_pfields,\n\t\t\t\t'meta' => array( 'target' => '', 'title' => __( 'Profile Fields/Groups', 'buddypress-toolbar' ) )\n\t\t\t);\n\n\t\t\t$menu_items['bppfields-add'] = array(\n\t\t\t\t'parent' => $bppfields,\n\t\t\t\t'title' => __( 'Add new Field Group', 'buddypress-toolbar' ),\n\t\t\t\t'href' => network_admin_url( 'admin.php?page=bp-profile-setup&mode=add_group' ),\n\t\t\t\t'meta' => array( 'target' => '', 'title' => __( 'Add new Field Group', 'buddypress-toolbar' ) )\n\t\t\t);\n\n\t\t} // end-if cap check\n\n\t\t/** Users section */\n\t\tif ( current_user_can( 'edit_users' ) ) {\n\n\t\t\t$menu_items['users'] = array(\n\t\t\t\t'parent' => $bpbar,\n\t\t\t\t'title' => __( 'Users', 'buddypress-toolbar' ),\n\t\t\t\t'href' => network_admin_url( 'users.php' ),\n\t\t\t\t'meta' => array( 'target' => '', 'title' => __( 'Users', 'buddypress-toolbar' ) )\n\t\t\t);\n\n\t\t} // end-if can 'edit_users'\n\n\t\tif ( current_user_can( 'add_users' ) ) {\n\n\t\t\t$menu_items['u-add-user'] = array(\n\t\t\t\t'parent' => $users,\n\t\t\t\t'title' => __( 'Add new User', 'buddypress-toolbar' ),\n\t\t\t\t'href' => network_admin_url( 'user-new.php' ),\n\t\t\t\t'meta' => array( 'target' => '', 'title' => __( 'Add new User', 'buddypress-toolbar' ) )\n\t\t\t);\n\n\t\t} // end-if can 'add_users'\n\n\t\t/** Check for active bbPress 2.x forums - if true, display settings link */\n\t\tif ( ! function_exists( 'ddw_bbpress_aba_admin_bar_menu' ) && class_exists( 'bbPress' ) && current_user_can( 'manage_options' ) ) {\n\n\t\t\t$menu_items[ 'bpbbpress' ] = array(\n\t\t\t\t'parent' => $bpbar,\n\t\t\t\t'title' => __( 'bbPress Forums', 'buddypress-toolbar' ),\n\t\t\t\t'href' => admin_url( 'options-general.php?page=bbpress' ),\n\t\t\t\t'meta' => array( 'target' => '', 'title' => __( 'bbPress Forums', 'buddypress-toolbar' ) )\n\t\t\t);\n\n\t\t} // end-if bbPres 2.x check\n\n\t\t/** Manage Groups special items */\n\t\tif ( function_exists( 'bp_is_active' )\n\t\t\t&& bp_is_active( 'groups' )\n\t\t\t&& function_exists( 'bp_get_groups_root_slug' )\n\t\t\t&& bp_current_user_can( 'bp_moderate' )\n\t\t) {\n\n\t\t\t$bptb_groups_url = function_exists( 'bp_groups_add_admin_menu' ) ? network_admin_url( 'admin.php?page=bp-groups' ) : get_home_url() . '/' . bp_get_groups_root_slug();\n\n\t\t\t$menu_items[ 'managegroups' ] = array(\n\t\t\t\t'parent' => $bpmggroup,\n\t\t\t\t'title' => __( 'Manage Groups', 'buddypress-toolbar' ),\n\t\t\t\t'href' => $bptb_groups_url,\n\t\t\t\t'meta' => array( 'target' => '', 'title' => __( 'Manage Groups', 'buddypress-toolbar' ) . ' &raquo;' )\n\t\t\t);\n\n\t\t\tif ( function_exists( 'bp_groups_add_admin_menu' ) ) {\n\t\t\t\t\n\t\t\t\t$menu_items[ 'managegroups-add' ] = array(\n\t\t\t\t\t'parent' => $managegroups,\n\t\t\t\t\t'title' => __( 'Add new Group', 'buddypress-toolbar' ),\n\t\t\t\t\t'href' => trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create' ),\n\t\t\t\t\t'meta' => array( 'target' => '', 'title' => __( 'Add new Group', 'buddypress-toolbar' ) . ' &raquo;' )\n\t\t\t\t);\n\n\t\t\t\t$menu_items[ 'managegroups-front' ] = array(\n\t\t\t\t\t'parent' => $managegroups,\n\t\t\t\t\t'title' => __( 'View Groups Base', 'buddypress-toolbar' ),\n\t\t\t\t\t'href' => trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ),\n\t\t\t\t\t'meta' => array( 'target' => '', 'title' => __( 'View Groups Base', 'buddypress-toolbar' ) . ' &raquo;' )\n\t\t\t\t);\n\n\t\t\t} // end-if groups admin check\n\n\t\t} // end-if BP group check\n\n\t\t/**\n\t\t * Display last main item in the menu for active extensions/plugins\n\t\t * ATTENTION: This is where plugins/extensions hook in on the sub-level hierarchy\n\t\t *\n\t\t * @since 1.0.0\n\t\t */\n\t\tif ( BPTB_EXTENSIONS_DISPLAY && current_user_can( 'activate_plugins' ) ) {\n\n\t\t\t$menu_items['extensions'] = array(\n\t\t\t\t'parent' => $pgroup,\n\t\t\t\t'title' => __( 'Active Extensions', 'buddypress-toolbar' ),\n\t\t\t\t'href' => network_admin_url( 'plugins.php' ),\n\t\t\t\t'meta' => array( 'target' => '', 'title' => __( 'Active Extensions', 'buddypress-toolbar' ) )\n\t\t\t);\n\n\t\t} // end-if constant & cap check for displaying extensions\n\n\t} else {\n\n\t\t/** If BuddyPress is not active, to avoid PHP notices */\n\t\t$menu_items = $bpgroup_menu_items;\n\n\t\t/** If BuddyPress is not active and no icon filter is active, then display no icon */\n\t\tif ( ! has_filter( 'bptb_filter_main_icon' ) ) {\n\t\t\tadd_filter( 'bptb_filter_main_item_icon_display', '__bptb_no_icon_display' );\n\t\t}\n\n\t\t/** If BuddyPress is not active \"void\" main settings link */\n\t\t$bp_aurl_main = false;\n\n\t} // end-if BP conditional\n\n\n\t/**\n\t * Display links to active BuddyPress specific themes settings' pages\n\t *\n\t * @since 1.0.0\n\t */\n\t\t/** Include plugin file with theme support links */\n\t\trequire_once( BPTB_PLUGIN_DIR . '/includes/bptb-themes.php' );\n\n\n\t/**\n\t * Display links to active BuddyPress specific plugins/extensions settings' pages\n\t *\n\t * @since 1.0.0\n\t */\n\t\t/** Include plugin file with plugin support links */\n\t\trequire_once( BPTB_PLUGIN_DIR . '/includes/bptb-plugins.php' );\n\n\n\t/** Allow menu items to be filtered, but pass in parent menu item IDs */\n\t$menu_items = (array) apply_filters( 'ddw_bptb_menu_items', $menu_items,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$bpgroup_menu_items,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$prefix,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$bpbar, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$bpsupport,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$bpcodex,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$bpsites,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$bpactivity,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$bpsettings, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$users,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$usersinviteanyone,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$usersbpprofilesstats,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$bppfields,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$bppfieldsbpuatl, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$extensions,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$extwangguard,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$extbpge,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$extbpdocs,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$extbpuatl,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$extbpprofilesstats, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$extbuddystream,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$extinviteanyone,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$extcollabpress,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$exteventsmanager,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$extseopress, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$extbpprofilesearch,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$extbpcheckins,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$extbpcheckinsplaces,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$extbpcheckinsfoursquare,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$extbpmedia,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$extachievementsapp,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$extbuddybox,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$bpmggroup,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$managegroups,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$bpmgbpgm,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$bpmgbpge,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$bpmgcollabpress, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$extgroup,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$pgroup,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tgroup,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$bservicessettings,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$threeonesevensettings, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$bpgroup,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$translations\n\t); // end of array\n\n\n\t/**\n\t * Add the BuddyPress top-level menu item\n\t *\n\t * @since 1.0.0\n\t *\n\t * @param $bptb_main_item_title\n\t * @param $bptb_main_item_title_tooltip\n\t * @param $bptb_main_item_icon_display\n\t */\n\t\t/** Filter the main item name */\n\t\t$bptb_main_item_title = apply_filters( 'bptb_filter_main_item', __( 'BuddyPress', 'buddypress-toolbar' ) );\n\n\t\t/** Filter the main item name's tooltip */\n\t\t$bptb_main_item_title_tooltip = apply_filters( 'bptb_filter_main_item_tooltip', _x( 'BuddyPress', 'Translators: For the tooltip', 'buddypress-toolbar' ) );\n\n\t\t/** Filter the main item icon's class/display */\n\t\t$bptb_main_item_icon_display = apply_filters( 'bptb_filter_main_item_icon_display', 'icon-buddypress' );\n\n\t\t$wp_admin_bar->add_menu( array(\n\t\t\t'id' => $bpbar,\n\t\t\t'title' => esc_attr__( $bptb_main_item_title ),\n\t\t\t'href' => $bp_aurl_main,\n\t\t\t'meta' => array(\n\t\t\t\t\t\t'class' => esc_attr( $bptb_main_item_icon_display ),\n\t\t\t\t\t\t'title' => esc_attr__( $bptb_main_item_title_tooltip ) )\n\t\t) );\n\n\n\t/** Loop through the menu items */\n\tforeach ( $menu_items as $id => $menu_item ) {\n\t\t\n\t\t/** Add in the item ID */\n\t\t$menu_item['id'] = $prefix . $id;\n\n\t\t/** Add meta target to each item where it's not already set, so links open in new window/tab */\n\t\tif ( ! isset( $menu_item['meta']['target'] ) ) {\n\t\t\t$menu_item['meta']['target'] = '_blank';\n\t\t}\n\n\t\t/** Add class to links that open up in a new window/tab */\n\t\tif ( '_blank' === $menu_item['meta']['target'] ) {\n\n\t\t\tif ( ! isset( $menu_item['meta']['class'] ) ) {\n\n\t\t\t\t$menu_item['meta']['class'] = '';\n\n\t\t\t}\n\n\t\t\t$menu_item['meta']['class'] .= $prefix . 'bptb-new-tab';\n\n\t\t}\n\n\t\t/** Add menu items */\n\t\t$wp_admin_bar->add_menu( $menu_item );\n\n\t} // end foreach menu items\n\n\n\t/**\n\t * Action Hook 'bptb_custom_main_items'\n\t * allows for hooking other main items in\n\t *\n\t * @since 1.2.0\n\t */\n\tdo_action( 'bptb_custom_main_items' );\n\n\n\t/** \"Manage Groups\" Group: Main Entry */\n\tif ( function_exists( 'bp_group_class' ) ) {\n\t\t$bptb_is_bpmg = 'bpmg_yes';\n\t}\n\n\tif ( BPTB_MANAGE_GROUPS_DISPLAY && ( ( function_exists( 'bp_is_active' ) && bp_is_active( 'groups' ) ) && $bptb_is_bpmg == 'bpmg_yes' ) ) {\n\n\t\t$wp_admin_bar->add_group( array(\n\t\t\t'parent' => $bpbar,\n\t\t\t'id' => $bpmggroup,\n\t\t) );\n\n\t} // end-if groups check\n\n\n\t/** Extend Group: Main Entry */\n\t$wp_admin_bar->add_group( array(\n\t\t'parent' => $bpbar,\n\t\t'id' => $extgroup,\n\t) );\n\n\t\t/** Plugin Group: Main Entry */\n\t\t$wp_admin_bar->add_group( array(\n\t\t\t'parent' => $extgroup,\n\t\t\t'id' => $pgroup,\n\t\t) );\n\n\n\t\t/**\n\t\t * Action Hook 'bptb_custom_extension_items'\n\t\t * allows for hooking other extension-related items in\n\t\t *\n\t\t * @since 1.2.0\n\t\t */\n\t\tdo_action( 'bptb_custom_extension_items' );\n\n\n\t\t/** Theme Group: Main Entry */\n\t\tif ( BPTB_THEME_DISPLAY && ( current_user_can( 'manage_options' ) || current_user_can( 'edit_theme_options' ) || current_user_can( 'switch_themes' ) ) ) {\n\n\t\t\t$wp_admin_bar->add_group( array(\n\t\t\t\t'parent' => $extgroup,\n\t\t\t\t'id' => $tgroup,\n\t\t\t) );\n\n\t\t} // end-if constant check for displaying theme group\n\n\n\t\t/**\n\t\t * Action Hook 'bptb_custom_theme_items'\n\t\t * allows for hooking other theme-related items in\n\t\t *\n\t\t * @since 1.2.0\n\t\t */\n\t\tdo_action( 'bptb_custom_theme_items' );\n\n\n\t/** BuddyPress Group: Main Entry */\n\t$wp_admin_bar->add_group( array(\n\t\t'parent' => $bpbar,\n\t\t'id' => $bpgroup,\n\t\t'meta' => array( 'class' => 'ab-sub-secondary' )\n\t) );\n\n\n\t/** BuddyPress Group: Loop through the group menu items */\n\tforeach ( $bpgroup_menu_items as $id => $bpgroup_menu_item ) {\n\t\t\n\t\t/** BuddyPress Group: Add in the item ID */\n\t\t$bpgroup_menu_item['id'] = $prefix . $id;\n\n\t\t/** BuddyPress Group: Add meta target to each item where it's not already set, so links open in new window/tab */\n\t\tif ( ! isset( $bpgroup_menu_item['meta']['target'] ) ) {\n\n\t\t\t$bpgroup_menu_item['meta']['target'] = '_blank';\n\n\t\t}\n\n\t\t/** BuddyPress Group: Add class to links that open up in a new window/tab */\n\t\tif ( '_blank' === $bpgroup_menu_item['meta']['target'] ) {\n\n\t\t\tif ( ! isset( $bpgroup_menu_item['meta']['class'] ) ) {\n\n\t\t\t\t$bpgroup_menu_item['meta']['class'] = '';\n\n\t\t\t}\n\n\t\t\t$bpgroup_menu_item['meta']['class'] .= $prefix . 'bptb-new-tab';\n\n\t\t}\n\n\t\t/** BuddyPress Group: Add menu items */\n\t\t$wp_admin_bar->add_menu( $bpgroup_menu_item );\n\n\t} // end foreach BuddyPress Group\n\n\n\t/**\n\t * Action Hook 'bptb_custom_group_items'\n\t * allows for hooking other BuddyPress Group items in\n\t *\n\t * @since 1.2.0\n\t */\n\tdo_action( 'bptb_custom_group_items' );\n\n}", "function activate_cps() {\n\trequire_once plugin_dir_path( __FILE__ ) . 'includes/class-cps-activator.php';\n\tcps_Activator::activate();\n}", "private function load_whip() {\n\t\tif ( 'index.php' !== $GLOBALS['pagenow'] && current_user_can( 'manage_options' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\trequire_once TOOLSET_COMMON_PATH . '/lib/whip/src/facades/wordpress.php';\n\n\t\tadd_filter( 'whip_hosting_page_url_wordpress', '__return_true' );\n\t\twhip_wp_check_versions( array( 'php' => '>=5.3' ) );\n\t}", "public static function activate() {\n if ( is_wp_error( self::load_instagram_class() ) ) {\n deactivate_plugins( plugin_basename( __FILE__ ) );\n $error_msg = __( 'Unable to load <code>Instagram</code> PHP class, most likely due to the git submodule not being present. Please view the README file for solutions. In the meantime the plugin has been deactivated.', 'bii-instagram' );\n $error_msg .= sprintf( '<br><br><a href=\"%s\">%s</a>', admin_url( 'plugins.php' ), __( 'Return to the plugins page', 'bii-instagram' ) );\n wp_die( $error_msg );\n return;\n }\n return true;\n }", "public function __construct() {\n\t\t/*Define Autoloader class for plugin*/\n\t\t$autoloader_path = 'includes/class-autoloader.php';\n\t\t/**\n\t\t * Include autoloader class to load all of classes inside this plugin\n\t\t */\n\t\trequire_once trailingslashit( plugin_dir_path( __FILE__ ) ) . $autoloader_path;\n\n\t\t/*Define required constant for plugin*/\n\t\tConstant::define_constant();\n\n\t\t/**\n\t\t * Register activation hook.\n\t\t * Register activation hook for this plugin by invoking activate\n\t\t * in Restaurant_Booking_Plugin class.\n\t\t *\n\t\t * @param string $file path to the plugin file.\n\t\t * @param callback $function The function to be run when the plugin is activated.\n\t\t */\n\t\tregister_activation_hook(\n\t\t\t__FILE__,\n\t\t\tfunction () {\n\t\t\t\t$this->activate(\n\t\t\t\t\tnew Activator()\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t\t/**\n\t\t * Register deactivation hook.\n\t\t * Register deactivation hook for this plugin by invoking deactivate\n\t\t * in Restaurant_Booking_Plugin class.\n\t\t *\n\t\t * @param string $file path to the plugin file.\n\t\t * @param callback $function The function to be run when the plugin is deactivated.\n\t\t */\n\t\tregister_deactivation_hook(\n\t\t\t__FILE__,\n\t\t\tfunction () {\n\t\t\t\t$this->deactivate(\n\t\t\t\t\tnew Deactivator()\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t\t/**\n\t\t * Register uninstall hook.\n\t\t * Register uninstall hook for this plugin by invoking uninstall\n\t\t * in Restaurant_Booking_Plugin class.\n\t\t *\n\t\t * @param string $file path to the plugin file.\n\t\t * @param callback $function The function to be run when the plugin is uninstalled.\n\t\t */\n\t\tregister_uninstall_hook(\n\t\t\t__FILE__,\n\t\t\tarray( 'Restaurant_Booking_Plugin', 'uninstall' )\n\t\t);\n\t}", "function db099_load_builder_on_builder_plugin_cpts($should_load) {\r\n\tif (defined('ET_BUILDER_PLUGIN_ACTIVE') && ET_BUILDER_PLUGIN_ACTIVE) {\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\t// Do nothing\r\n\treturn $should_load;\r\n}", "function include_wbf_autoloader(){\n\t$wbf_path = get_wbf_path();\n\n\tif(!is_dir($wbf_path)){\n\t\t$wbf_path = ABSPATH.\"wp-content/plugins/wbf\";\n\t}\n\n\t//Require the base autoloader\n\t$wbf_base_autoloader = $wbf_path.\"/wbf-autoloader.php\";\n\tif(is_file($wbf_base_autoloader)){\n\t\trequire_once $wbf_base_autoloader;\n\t}\n}", "public function load_wordpress() {\n\t\t\tif ( version_compare( get_bloginfo( 'version' ), '3.9', '<' ) ) {\n\t\t\t\tinclude_once( plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-compatibility-wordpress.php' );\n\t\t\t\tself::$wordpress = Black_Studio_TinyMCE_Compatibility_Wordpress::instance();\n\t\t\t}\n\t\t}", "protected function _Load_Helpers() {\r\n $dir = untrailingslashit( plugin_dir_path(__FILE__ ) );\r\n // Recurssively load the directory\r\n $this->_Recusive_Load_Dir($dir.'/helpers');\r\n // Fire the shortcode init action\r\n do_action('vcff_supports_helper_init',$this);\r\n }", "function bones_ahoy() {\n\n\t// let's get language support going, if you need it\n\tload_theme_textdomain( 'bonestheme', get_template_directory() . '/library/translation' );\n\n\t// launching operation cleanup\n\tadd_action( 'init', 'bones_head_cleanup' );\n\t// remove WP version from RSS\n\tadd_filter( 'the_generator', 'bones_rss_version' );\n\t// remove pesky injected css for recent comments widget\n\tadd_filter( 'wp_head', 'bones_remove_wp_widget_recent_comments_style', 1 );\n\t// clean up comment styles in the head\n\tadd_action( 'wp_head', 'bones_remove_recent_comments_style', 1 );\n\t// clean up gallery output in wp\n\tadd_filter( 'gallery_style', 'bones_gallery_style' );\n\n\t// enqueue base scripts and styles\n\tadd_action( 'wp_enqueue_scripts', 'bones_scripts_and_styles', 999 );\n\t// ie conditional wrapper\n\n\t// launching this stuff after theme setup\n\tbones_theme_support();\n\n\t// adding sidebars to Wordpress (these are created in functions.php)\n\tadd_action( 'widgets_init', 'bones_register_sidebars' );\n\n\t// cleaning up random code around images\n\tadd_filter( 'the_content', 'bones_filter_ptags_on_images' );\n\t// cleaning up excerpt\n\tadd_filter( 'excerpt_more', 'bones_excerpt_more' );\n\n}", "function load() {\n\tadd_action( 'after_setup_theme', __NAMESPACE__ . '\\\\setup' );\n\tadd_action( 'after_setup_theme', __NAMESPACE__ . '\\\\setup_theme', 100 );\n}", "function fuzzloc_load() {\n\n\t/**\n\t * \n\t * Our plugin will attach in three places.\n\t * The first is just prior to storing a local post.\n\t *\n\t */\n\n\tregister_hook('post_local', 'addon/fuzzloc/fuzzloc.php', 'fuzzloc_post_hook');\n\n\t/**\n\t *\n\t * Then we'll attach into the plugin settings page, and also the \n\t * settings post hook so that we can create and update\n\t * user preferences.\n\t *\n\t */\n\n\tregister_hook('feature_settings', 'addon/fuzzloc/fuzzloc.php', 'fuzzloc_settings');\n\tregister_hook('feature_settings_post', 'addon/fuzzloc/fuzzloc.php', 'fuzzloc_settings_post');\n\n\tlogger(\"loaded fuzzloc\");\n}", "function abc_load_widget()\n{\n register_widget('awesome_bmi_widget');\n}", "function gumlet_plugin_activate()\n{\n if (!get_option('gumlet_settings')) {\n update_option('gumlet_settings', [\"lazy_load\" => 1, \"original_images\" => 1, \"auto_compress\"=> 1, \"server_webp\"=> 0]);\n }\n}", "function plugins_loaded(){\r\n\r\n\t\t$this->plugin_integration();\r\n\r\n\t\tWP_Job_Manager_Field_Editor_Job_Writepanels::get_instance();\r\n\t\tif( $this->wprm_active() ) WP_Job_Manager_Field_Editor_Resume_Writepanels::get_instance();\r\n\t}", "function register_page_bpposts_widget() {\n\tadd_action('widgets_init', create_function('', 'return register_widget(\"BP_Paginated_Posts_Widget\");') );\n}", "public function widgets_init() {\n\t\t\t\n\t\t// init default widgets\n\t\twpu_widgets_init();\n\t\t\n\t\t// register any sub-plugin widget\n\t\tif($this->is_working() && is_object($this->extras)) {\n\t\t\t$this->extras->widgets_init();\n\t\t}\n\t}", "function load_wp_auto_tagging(){\n\t\tif ( is_admin() ) {\n\t\t\tif ( apply_filters( 'wp_auto_tag_pre_check', class_exists( 'wp_auto_tagging' ) && wp_auto_tagging::prerequisites() ) ) {\n\t\t\t\trequire_once 'settings.php';\n\t\t\t\tregister_activation_hook( __FILE__, array('wp_auto_tagging_settings', 'register_defaults'));\n\t\t\t\tadd_action('init', array('wp_auto_tagging', 'instance'), -100, 0); \n\t\t\t} else {\n\t\t\t\t// let the user know prerequisites weren't met\n\t\t\t\tadd_action('admin_head', array('wp_auto_tagging', 'fail_notices'), 0, 0);\n\t\t\t}\n\t\t}\n\t}", "public function __construct(){\n\t\tigk_wp_registerlib(IGK_CGT_PLUGIN_DIR.\"/\");\t\n\t}", "function etivite_bp_activity_block_init() {\n\trequire( dirname( __FILE__ ) . '/bp-activity-block.php' );\n\tif ( file_exists( dirname( __FILE__ ) . '/languages/' . get_locale() . '.mo' ) ) {\n\t\tload_textdomain( 'bp-activity-block', dirname( __FILE__ ) . '/languages/' . get_locale() . '.mo' );\n\t}\n}", "function load_widget_plugin_name() {\n register_widget( 'widget_plugin_name' );\n}", "function WordpressConnect(){\n\n\t\t$this->add_init_hook();\n\n\t}", "function activate_plugins_rss_feed() {\n\trequire_once plugin_dir_path( __FILE__ ) . 'includes/class-plugins_rss_feed-activator.php';\n\tPlugins_rss_feed_Activator::activate();\n}", "function bp_forum_extras_bbcode_setup_globals() {\r\n\r\n\tadd_filter('group_forum_topic_text_before_save', 'bp_forum_extras_bbcode_it',7, 1);\r\n\tadd_filter('group_forum_post_text_before_save', 'bp_forum_extras_bbcode_it',7, 1);\r\n\tadd_filter('bp_forum_extras_signatures_text_before_save', 'bp_forum_extras_bbcode_it', 1);\r\n\r\n\tif ( is_user_logged_in() && ( bp_is_group_forum() || bp_forum_extras_forumsdirectory_component() ) && bb_get_option( 'bp_bbcode_buttons') ) {\r\n\r\n\t\trequire_once( dirname( __FILE__ ) . '/includes/bp-forum-extras-bbcode-buttons.php' );\r\n\r\n\t\tadd_action('bp_group_after_edit_forum_topic','bp_forum_extras_bbcode_buttons',11);\r\n\t\tadd_action('bp_group_after_edit_forum_post','bp_forum_extras_bbcode_buttons',11);\r\n\t\tadd_action('groups_forum_new_reply_after','bp_forum_extras_bbcode_buttons',11);\r\n\t\tadd_action('groups_forum_new_topic_after','bp_forum_extras_bbcode_buttons',11);\r\n\t\tadd_action('bp_after_group_forum_post_new','bp_forum_extras_bbcode_buttons',11);\r\n\r\n\t\tadd_action('bp_head','bp_forum_extras_bbcode_insert_head');\r\n\t}\r\n\r\n}", "function wds_bb_custom_field_hook() {\n\tif ( ! class_exists( 'FLBuilder' ) ) {\n\t\treturn;\n\t}\n\n\t$plugin = wds_bb_custom_field_plugin();\n\t$plugin->register_hooks();\n}" ]
[ "0.72114223", "0.7006273", "0.63638926", "0.62610966", "0.6205068", "0.61940837", "0.615495", "0.6072002", "0.5979279", "0.5963867", "0.5955536", "0.58913064", "0.5888569", "0.583691", "0.5825228", "0.5803712", "0.57871234", "0.5783144", "0.57779217", "0.5773288", "0.5745474", "0.569806", "0.5681495", "0.56802475", "0.56793696", "0.5678673", "0.5668253", "0.56671304", "0.566225", "0.5662018", "0.5657704", "0.5644262", "0.56386465", "0.56273043", "0.56181276", "0.55952334", "0.5594616", "0.5581163", "0.5576865", "0.5575599", "0.5556369", "0.55477923", "0.552033", "0.5486882", "0.54838365", "0.5479705", "0.547306", "0.5469742", "0.54474807", "0.5435451", "0.5432457", "0.54261047", "0.5425071", "0.5401142", "0.53925896", "0.53464526", "0.5329312", "0.5322535", "0.5317994", "0.5317673", "0.5313387", "0.5306404", "0.53054017", "0.5304954", "0.5298863", "0.52987397", "0.52826715", "0.5279473", "0.52776915", "0.5272565", "0.5271855", "0.52663445", "0.52593625", "0.52387416", "0.5236102", "0.5233918", "0.52313924", "0.522594", "0.5223769", "0.52194405", "0.5218803", "0.5216843", "0.52024484", "0.5195068", "0.51921535", "0.51911306", "0.5189399", "0.51873505", "0.5184745", "0.5183686", "0.5179663", "0.51733565", "0.516958", "0.5155904", "0.51544166", "0.5147341", "0.5147215", "0.5140331", "0.5139095", "0.51373696" ]
0.7385117
0
Registers a WP Framework class.
function wpf_register_class( $handle, $class, $autoload = false ) { global $wpf_classes; $type = $autoload ? 'autoload' : 'static'; $wpf_classes[$type][$handle] = $class; return $wpf_classes[$type][$handle]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register($class);", "function register_class()\n\t{\n\t\t\n\t\t// NO LONGER NEEDED\n\t}", "protected abstract function registerClasses(): void;", "private function registerClass(string $class = null)\n {\n if(class_exists($class)){\n $this->app->register($class);\n }\n }", "function wpf_autoload_classes() {\n\tglobal $wpf_classes;\n\n\tif ( isset( $wpf_classes['autoload'] ) ) {\n\t\tforeach ( (array) $wpf_classes['autoload'] as $handle => $class ) {\n\t\t\tif ( !isset($wpf_classes[$handle]) ) {\n\t\t\t\t$wpf_classes[$handle] = new $class;\n\t\t\t}\n\t\t}\n\t}\n}", "public static function register() {\n\t register_widget( __CLASS__ );\n\t}", "function wpt_autoload($class)\n{ \n //if( strpos($class, 'WPtheme\\\\') !== 0 ) return;\n if( 0 !== strpos($class, 'WPTheme\\\\') OR strlen($class) <= 8 ) return;\n\n $class = substr($class, 8);\n \n $library = THEME_DIR . '/library';\n\n if( $class === 'Theme' )\n {\n require $library . '/theme.php';\n return;\n }\n\n $path = $library . '/classes/' . str_replace('\\\\','/',strtolower($class)) . '.php';\n\n if( is_file($path) ) \n { \n require $path;\n }\n\n}", "static function register(){\r\n\t\tspl_autoload_register(array(__CLASS__,'Autoload'));\r\n\t}", "public function register() {\n\t\t/*\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t| Codestar Framework option pages\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t|\n\t\t*/\n\n\t\tif (!class_exists('CSF')) {\n\t\t\t$this->wpHelper->WpRegister('plugins/codestar/codestar-framework');\n\t\t\t$this->wpHelper->WpRegister('plugins/codestar/config');\n\t\t}\n\t\t/*\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t| visualcomposer\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t|\n\t\t*/\n\t\t$this->wpHelper->WpRegister('plugins/visualcomposer/Vc');\n\n\t\t/*\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t| Metaboxes\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t|\n\t\t*/\n\t\t$this->wpHelper->WpRegister('plugins/meta-box/meta-box');\n\t\t$this->wpHelper->WpRegister('plugins/meta-box/metaboxes-config');\n\n\t\t/** Add FrontEnd Widget **/\n\t\t$this->wpHelper\n\t\t\t->addWidget(\n\t\t\t\t\\App\\Widgets\\ExampleFrontEndWidget::class\n\t\t\t);\n\n\t\t/** Add Plugin Links to Admin > Plugins Page Entry **/\n\t\t$this->wpHelper\n\t\t\t->addPluginLinks(array(\n\t\t\t\t'<a href=\"admin.php?page=lumen_page\">Settings</a>',\n\t\t\t));\n\t\t/** Add Admin Bar Nodes **/\n\t\t$this->wpHelper\n\t\t\t->addAdminBarNode(\n\t\t\t\tfalse,\n\t\t\t\t'lumen_bar_node2',\n\t\t\t\t'Lumen Bar Node',\n\t\t\t\t'#'\n\t\t\t)->addAdminBarNode(\n\t\t\t'lumen_bar_node2',\n\t\t\t'lumen_bar_node2_child1',\n\t\t\t'Node Child 1',\n\t\t\t'#'\n\t\t)->addAdminBarNode(\n\t\t\t'lumen_bar_node2',\n\t\t\t'lumen_bar_node2_child2',\n\t\t\t'Node Child 2',\n\t\t\t'#'\n\t\t)->addAdminBarNode(\n\t\t\t'lumen_bar_node2',\n\t\t\t'lumen_bar_node2_child3',\n\t\t\t'Node Child 2',\n\t\t\t'#'\n\t\t);\n\n\t\t/** Add Shortcodes **/\n\t\t$this->wpHelper\n\t\t\t->addShortcode(\n\t\t\t\t'auth_register',\n\t\t\t\tfunction ($parameters, $content) {\n\t\t\t\t\treturn $this->app->call('\\App\\Http\\Controllers\\Auth\\RegisterShortcodeController@template', compact('parameters', 'content'));\n\t\t\t\t}\n\t\t\t)\n\t\t\t->addShortcode(\n\t\t\t\t'auth_login',\n\t\t\t\tfunction ($parameters, $content) {\n\t\t\t\t\treturn $this->app->call('\\App\\Http\\Controllers\\Auth\\LoginShortcodeController@template', compact('parameters', 'content'));\n\t\t\t\t}\n\t\t\t);\n\n\t\t/** Add Nav Menu MetaBoxes **/\n\t\t$this->wpHelper->addMetaBox(\n\t\t\t'example_menu_meta_box',\n\t\t\t'Truediv Routes',\n\t\t\tfunction ($object, $arguments) {\n\t\t\t\t$this->lumenHelper\n\t\t\t\t\t->response($this->app->call('\\App\\Http\\Controllers\\ExampleMetaBoxController@menuMetaBox', compact('object', 'arguments')))\n\t\t\t\t\t->sendContent();\n\t\t\t},\n\t\t\t'nav-menus',\n\t\t\t'side',\n\t\t\t'default',\n\t\t\t2\n\t\t);\n\n\t\t/** Add Dashboard Widget **/\n\n\t\t$this->wpHelper\n\t\t\t->addAdminPanel(\n\t\t\t\t'lumen_page',\n\t\t\t\t'Larash',\n\t\t\t\t'Larash',\n\t\t\t\tfunction () {\n\t\t\t\t\t$this->lumenHelper\n\t\t\t\t\t\t->response($this->lumenHelper->view('admin-intro'))\n\t\t\t\t\t\t->sendContent();\n\t\t\t\t},\n\t\t\t\t'manage_options',\n\t\t\t\t'',\n\t\t\t\tnull\n\t\t\t)\n\t\t\t->addAdminSubPanel(\n\t\t\t\t'lumen_page',\n\t\t\t\t'lumen_sub_page',\n\t\t\t\t'WpPost Demo',\n\t\t\t\t'WpPost Demo',\n\t\t\t\tfunction () {\n\t\t\t\t\t$this->lumenHelper\n\t\t\t\t\t\t->response($this->app->call('\\App\\Http\\Controllers\\ExampleAdminController@template'))\n\t\t\t\t\t\t->sendContent();\n\t\t\t\t},\n\t\t\t\t'manage_options'\n\t\t\t)->addAdminSubPanel(\n\t\t\t'lumen_page',\n\t\t\t'lumen_settings',\n\t\t\t'Settings',\n\t\t\t'Settings',\n\t\t\tfunction () {\n\t\t\t\t$this->lumenHelper\n\t\t\t\t\t->response($this->app->call('\\App\\Http\\Controllers\\SettingsController@template'))\n\t\t\t\t\t->sendContent();\n\t\t\t},\n\t\t\t'manage_options'\n\t\t);\n\n\t\t/** Add WP Rest API Route **/\n// $this->wpHelper\n\t\t// ->addRestRoute('wp-lumen/api/v1', '/test', array(\n\t\t// 'methods' => ['get'],\n\t\t// 'callback' => function(){\n\t\t// return $this->app->call('\\App\\Http\\Controllers\\ExampleWpRestRouteController@get');\n\t\t// },\n\t\t// ));\n\n\t\t/** Add CSS & Scripts **/\n\t\t$this->wpHelper\n\t\t\t->enqueueStyle(\n\t\t\t\t'lumen',\n\t\t\t\t$this->lumenHelper->asset('resources/assets/build/Main.css'),\n\t\t\t\tarray(),\n\t\t\t\t'1.0.0',\n\t\t\t\t'all'\n\t\t\t)\n\t\t\t->enqueueScript(\n\t\t\t\t'lumen',\n\t\t\t\t$this->lumenHelper->asset('resources/assets/build/Main.js'),\n\t\t\t\tarray('jquery'),\n\t\t\t\t'1.0.0',\n\t\t\t\ttrue\n\t\t\t)\n\n\t\t// admin\n\t\t\t->enqueueStyle('datatablecss', $this->lumenHelper->asset('resources/assets/src/admin/datatables/datatables.min.css'), array(), '1.0.0', 'all', 'admin')\n\t\t\t->enqueueScript('datatablejs', $this->lumenHelper->asset('resources/assets/src/admin/datatables/datatables.min.js'), array('jquery'), '1.0.0', true, 'admin');\n\n\t}", "protected function registerClassLoader()\n {\n $namespace = $this->active()->get('namespace');\n $loader = new ClassLoader();\n\n $loader->addPsr4(\"Themes\\\\{$namespace}\\\\\", theme_path(\"{$namespace}/src\"));\n $loader->register();\n }", "public function register () {\r\n\t\tspl_autoload_register( array( $this, 'loadClass' ) );\r\n\t}", "public static function register(){\n spl_autoload_register(array(__CLASS__, 'autoload'));\n }", "public static function register(){\n spl_autoload_register(array(__CLASS__, 'autoload'));\n }", "static public function register()\n {\n spl_autoload_register(array(self::instance(), 'doAutoload'));\n }", "function acf_register_admin_tool($class)\n{\n}", "static public function register()\r\n {\r\n spl_autoload_register(array(self::instance(), 'autoload'));\r\n }", "public static function register( ) {\n\t\tif ( version_compare( phpversion(), '5.3.0', '>=' ) ) {\n\t\t\tspl_autoload_register( array( new self(), 'autoload' ), true, false );\n\t\t} else {\n\t\t\tspl_autoload_register( array( new self(), 'autoload' ) );\n\t\t}\n\n\t}", "function get_theme_framework() {\n\treturn \\Classy\\Classy::get_instance();\n}", "public static function register() {\n ini_set('unserialize_callback_func', 'spl_autoload_call');\n spl_autoload_register(array(new self, 'autoload'));\n }", "public static function registerAutoloader() {\n spl_autoload_register(__NAMESPACE__ . \"\\\\Framework::autoload\");\n }", "function RegisterMyClassName($className, $classPath)\n{\n $PublicClassName = PublicLibManager::getInstance();\n $PublicClassName->RegisterMyClassName($className, $classPath);\n}", "public function register()\n\t{\n\t\tspl_autoload_register(array($this, 'loadClass'));\n\t}", "static function register(){\n\n /**\n * Il y a deux arguments: la classe actuelle et la fonction que l'on souhaite appeler ()\n */\n spl_autoload_register(array(__CLASS__,'autoload'));\n }", "function register_field_type($class)\n {\n }", "public function register()\n\t{\n\t\tspl_autoload_register(array($this, \"autoloadClass\"));\n\t}", "function WPF() {\n\tglobal $wpf_classes;\n\n\t$theme_class = wpf_get_class( 'theme' );\n\n\treturn $wpf_classes['theme'] = new $theme_class;\n}", "abstract public function register_plugin();", "function acf_register_field_type($class)\n{\n}", "public function register()\r\n\t{\r\n $namespace = FANCY_NAME;\r\n $wordpress = $this->app[\"$namespace.wordpress\"];\r\n\r\n if(Wordpress::available()) {\r\n \\Event::listen('fancy::scripts.initialize', function() use($wordpress) {\r\n global $pagenow;\r\n\r\n if(!($wordpress->is_admin() && ($pagenow === 'post.php' || $pagenow === 'post-new.php'))) return;\r\n\r\n return array(\r\n 'ace' => array(\r\n 'src' => 'public/packages/fancy/ace/js/vendor/ace/ace.js',\r\n 'in_admin' => true\r\n ),\r\n 'ace-textarea' => array(\r\n 'src' => 'public/packages/fancy/ace/js/vendor/jquery-ace-textarea.js',\r\n 'in_admin' => true\r\n ),\r\n\r\n 'fancy-ace' => array(\r\n 'src' => 'public/packages/fancy/ace/js/plugin.js',\r\n 'in_admin' => true\r\n )\r\n );\r\n });\r\n }\r\n\t}", "public function registerMyLibrary()\n {\n $this->Application()->Loader()->registerNamespace(\n 'ShopwarePlugins\\\\Connect',\n $this->Path()\n );\n\n $this->registerCustomModels();\n }", "public function register()\n {\n spl_autoload_register([$this, 'loadClass']);\n }", "function wpf_register_contextual_class( $handle, $class ) {\n\tglobal $wpf_classes;\n\n\t$wpf_classes['contextual'][$handle] = $class;\n\n\treturn $wpf_classes['contextual'][$handle];\n}", "public function register()\n {\n spl_autoload_register($this);\n }", "public function register()\n {\n return array(T_CLASS);\n\n }", "public function register() {\n\t\tadd_action( 'bp_loaded', [ $this, 'registerServices' ] );\n\t}", "protected function registerMainClass()\n {\n $this->app['themify'] = $this->app->share(function ($app) {\n return new Themify(\n $app['themify.resolver'],\n $app['view.finder'],\n $app['events'],\n $app['config']\n );\n });\n }", "public function register()\n {\n spl_autoload_register(array($this, 'loadClass'));\n }", "public function register( ) {\n\n\t\tspl_autoload_register( array( $this, 'load' ));\n\t}", "public function register(): void {\n\t\t\\spl_autoload_register( [ $this, self::AUTOLOAD_METHOD ] );\n\t}", "function register_tool($class)\n {\n }", "public function registerAutoloader(): void\n {\n spl_autoload_register(function(string $class_name): void {\n if (!strpos($class_name, \"Factory\")) {\n return;\n }\n $len = strlen($class_name);\n $facLen = strlen(\"Factory\");\n\n if (substr($class_name, $len - $facLen) !== \"Factory\") {\n return;\n }\n\n // Check if this is a namespace that Magento will create factories for\n $namespaces = static::getModuleNamespaces();\n $validNamespace = false;\n foreach ($namespaces as $namespace) {\n if (strpos($class_name, $namespace) === 0) {\n $validNamespace = true;\n break;\n }\n }\n\n if (!$validNamespace) {\n return;\n }\n\n // Get the class's base name\n $base = substr($class_name, 0, $len - $facLen);\n\n if (!class_exists($base)) {\n return;\n }\n\n $this->createMockFactory($base);\n });\n }", "public function add_class($class_name)\n {\n }", "function commonwp_autoloader( $class ) {\n\t$pairs = [\n\t\t'WP_Temporary' => '/lib/wp-temporary/class-wp-temporary.php',\n\t\t'Temporary_Command' => '/lib/wp-temporary/cli/Temporary_Command.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Clean' => '/inc/Clean.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Expiration' => '/inc/Expiration.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Lock' => '/inc/Lock.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Main' => '/inc/Main.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\NPM' => '/inc/NPM.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Paths' => '/inc/Paths.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Privacy' => '/inc/Privacy.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Process' => '/inc/Process.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Queue' => '/inc/Queue.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Rewrite' => '/inc/Rewrite.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Singleton' => '/inc/Singleton.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\SRI' => '/inc/SRI.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Store' => '/inc/Store.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Utils' => '/inc/Utils.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Versions' => '/inc/Versions.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\WPCLI' => '/inc/WPCLI.php',\n\t\t'dimadin\\WP\\Library\\Backdrop\\Main' => '/lib/backdrop/inc/Main.php',\n\t\t'dimadin\\WP\\Library\\Backdrop\\Server' => '/lib/backdrop/inc/Server.php',\n\t\t'dimadin\\WP\\Library\\Backdrop\\Task' => '/lib/backdrop/inc/Task.php',\n\t];\n\n\tif ( array_key_exists( $class, $pairs ) ) {\n\t\tinclude __DIR__ . $pairs[ $class ];\n\t}\n}", "public function register()\n {\n spl_autoload_register( array( $this, 'loadClass' ) );\n }", "function bp_theme_autoloader($class) {\n\n if (strpos($class,'Theme') !== 0) {return false;}\n $class = str_replace('Theme\\\\','',$class);\n $file = strtolower(str_replace('\\\\','-',$class));\n $file = str_replace('_','-',$file);\n $file = array_unique(explode('-',$file));\n $file = implode('-',$file);\n $file = get_template_directory() . '/inc/' . $file;\n $file .= '.php';\n require $file;\n\n}", "public function register_class($class_name, $path)\n\t{\n\t\t$class_name = strtolower($class_name);\n\t\tif ($path[0]!=DIRECTORY_SEPARATOR) $path = $this->get_modules_dir().DIRECTORY_SEPARATOR.$path;\n\t\t$this->classes[$class_name] = $path;\n\t}", "abstract public function register_type();", "public function __construct(){\n\t\tigk_wp_registerlib(IGK_CGT_PLUGIN_DIR.\"/\");\t\n\t}", "public function register() {\n\t\tself::wpcd_app_register_post_and_taxonomy();\n\n\t\t$this->set_post_taxonomy( 'wpcd_app_group' );\n\n\t\t$this->set_group_key( 'wpcd_app_group' );\n\n\t\t$this->set_post_type( 'wpcd_app' );\n\n\t}", "static function register()\n\t{\n\n\t\tspl_autoload_register(array(__CLASS__,'autoload'));\n\n\t}", "static function init() {\n\t\t\t$classname = get_called_class();\n\t\t\tadd_action( 'widgets_init', $classname . '::register_widget' );\n\t\t\tadd_shortcode( $classname, $classname . '::register_shortcode' );\n\t\t}", "public function register()\n {\n foreach ($this->shortcodes as $shortcode) {\n $this->registerInWordpress($shortcode);\n }\n }", "public function register(){\n add_action('admin_enqueue_scripts',array($this,'enqueue'));\n //load front end wp css & js\n add_action('wp_enqueue_scripts',array($this,'enqueue'));\n }", "protected static function register() {}", "public static function register($class){\n self::$callbacks[] = $class;\n }", "public static function register() {\n\t\tstatic::registerStyles();\n\t\tstatic::registerScripts();\n\t\tstatic::registerDOM();\n\t}", "public static function register()\n\t{\n\t\tif ( ! static::$registered)\n\t\t{\n\t\t\tstatic::$registered = spl_autoload_register(array('\\Illuminate\\Support\\ClassLoader', 'load'));\n\t\t}\n\t}", "public function register() {\n foreach ($this->info as $scheme => $info) {\n $this->registerWrapper($scheme, $info['class'], $info['type']);\n }\n }", "function wponion_load( $framework_path = __DIR__, $version = false ) {\n\t\tWPOnion_Loader::instance()->add( $framework_path, $version );\n\t}", "public static function register() {\r\n spl_autoload_register('Zeeye\\Util\\Autoloader\\Autoloader::autoload');\r\n }", "public function register()\n {\n\n if( ! $this->activated( 'cf_manager' ) ) return;\n\n\n $this->settings = new SettingsApi();\n\n $this->callbacks = new AdminCallbacks();\n\n $this->cf_callbacks = new CfCallbacks();\n\n $this->setSubpages();\n\n $this->metaBoxes = array();\n\n\n $this->setSettings();\n $this->setSections();\n $this->setFields();\n\n\n $this->settings->addSubPages( $this->subpages )->register();\n\n\n $this->showPosts();\n\n if( ! empty( $this->metaBoxes ) ) {\n\n add_action( 'add_meta_boxes', array( $this, 'addMultipleMetaBoxes' ) );\n\n }\n\n }", "public function register() {\n $this->remove();\n\n global $is_dev, $current_url;\n\n $dev = $is_dev ? '' : '.min';\n $vendor = 'node_modules';\n\n // Adobe Typekit\n wp_register_style( 'typekit', 'https://use.typekit.net/dvm4pvz.css', false, null, 'all' );\n\n \t// Default `style.css`\n \twp_register_style( 'style', get_template_directory_uri() . '/dist/assets/css/app.css', false, get_file_version( 'dist/assets/css/app.css' ), 'all' );\n\n // Replace `underscore` with `lodash`\n wp_deregister_script( 'underscore' );\n wp_register_script( 'underscore', includes_url( \"js/dist/vendor/lodash$dev.js\" ), array(), LODASH, true );\n\n // Deregister jQuery and re-register jQuery core.\n wp_deregister_script( 'jquery' );\n wp_register_script( 'jquery', includes_url( 'js/jquery/jquery.js' ), array(), '1.12.14', true );\n\n // Fullpage.js\n wp_register_script( 'parallax', get_template_directory_uri() . '/dist/assets/libs/fullpage/fullpage.parallax.min.js', array( 'jquery' ), '0.1.1', true );\n //wp_register_script( 'parallax', get_template_directory_uri() . '/dist/assets/libs/parallax/parallax.min.js', array( 'jquery' ), '1.5.0', true );\n wp_register_script( 'fullpage', get_template_directory_uri() . '/dist/assets/libs/fullpage/fullpage.extensions.min.js', array( 'jquery', 'parallax' ), '3.0.8', true );\n\n // MmenuLight.js\n //wp_register_script( 'mmenu-light-polyfills', get_template_directory_uri() . '/dist/assets/libs/mmenuLight/mmenu-light.polyfills.js', array( 'jquery' ), '3.0.1', true );\n //wp_register_script( 'mmenu-light', get_template_directory_uri() . '/dist/assets/libs/mmenuLight/mmenu-light.js', array( 'mmenu-light-polyfills', 'jquery' ), '3.0.1', true );\n\n \t// Bundle JS\n \twp_register_script( 'app-js', get_template_directory_uri() . '/dist/assets/js/app.js', array( 'jquery', 'fullpage'/*, 'mmenu-light'*/ ), get_file_version( 'dist/assets/js/app.js' ), true );\n }", "public static function register()\n {\n ini_set('unserialize_callback_func', 'spl_autoload_call');\n spl_autoload_register(array('app\\framework\\queue\\Autoloader', 'autoload'));\n }", "function acf_register_location_type($class_name)\n{\n}", "public function register(): void\n {\n $fields = include get_stylesheet_directory() . '/src/config/kirki.php';\n \n foreach ($fields as $field) {\n new $field();\n }\n }", "public function register() {\n spl_autoload_register([$this, 'autoLoad']);\n }", "public function register() {\n\t\tadd_action( 'plugins_loaded', [ $this, 'register_services' ] );\n\t\tadd_action( 'init', [ $this, 'register_assets_handler' ] );\n\t}", "public function register($prepend = false)\n\t{\n\t\t\\spl_autoload_register(array($this, 'loadClass'), true, $prepend);\n\t}", "public static function register()\n {\n self::loadFile('sgContext', realpath(dirname(__FILE__) . '/sgContext.class.php'));\n self::loadFile('sgConfiguration', realpath(dirname(__FILE__) . '/sgConfiguration.class.php'));\n spl_autoload_register(array(__CLASS__, 'loadClass'));\n }", "public function register() {\n\t\tadd_action( 'wp_enqueue_scripts', [ $this, 'enqueue_scripts' ] );\n\t\tadd_action( 'wp_enqueue_scripts', [ $this, 'enqueue_styles' ] );\n\n\t\tadd_action( 'init', [ $this, 'init' ] );\n\t\tadd_action( 'admin_init', [ $this, 'admin_init' ] );\n\t}", "public function register(): void {\n\t\t// Bindings.\n\n\t\t$this->container->singleton( Breezy::class, Breezy::class );\n\t\t$this->container->singleton( Steps\\Loader::class, Steps\\Loader::class );\n\n\t\t// Initializations.\n\n\t\t$this->initialize_themes();\n\t\t$this->hooks();\n\t}", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "static function register()\r\n {\r\n spl_autoload_register(array(__CLASS__, 'autoload'));\r\n }", "public function register($prepend = false)\n\t{\n\t\tspl_autoload_register([$this, 'loadClass'], true, $prepend);\n\t}", "static function register()\n {\n spl_autoload_register(array(__CLASS__, 'autoload'));\n }", "public static function load_extra_classes() {\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-elementor.php';\n\t\tElementor::init();\n\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-woo.php';\n\t\tWoo::init();\n\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-facebook.php';\n\t\tFacebook::init();\n\t}", "protected function registerClasses()\n {\n // register helpers\n if ($path = $this->app->path->path('zlpath:helpers')) {\n $this->app->path->register($path, 'helpers');\n $this->app->loader->register('ZlHelper', 'helpers:zlhelper.php');\n }\n\n // register helpers\n if ($path = $this->app->path->path('zlfw:helpers')) {\n $this->app->path->register($path, 'helpers');\n $this->app->loader->register('zlfwHelper', 'helpers:zlfwhelper.php');\n $this->app->loader->register('ZLDependencyHelper', 'helpers:zldependency.php');\n $this->app->loader->register('ZlStringHelper', 'helpers:zlstring.php');\n $this->app->loader->register('ZlFilesystemHelper', 'helpers:zlfilesystem.php');\n $this->app->loader->register('ZlPathHelper', 'helpers:zlpath.php');\n $this->app->loader->register('ZlModelHelper', 'helpers:model.php');\n $this->app->loader->register('ZLXmlHelper', 'helpers:zlxmlhelper.php');\n $this->app->loader->register('ZLFieldHTMLHelper', 'helpers:zlfieldhtml.php');\n }\n\n // register classes\n if ($path = $this->app->path->path('zlfw:classes')) {\n $this->app->path->register($path, 'classes');\n $this->app->loader->register('ZLStorage', 'classes:zlstorage/ZLStorage.php');\n }\n\n // register elements fields\n if ($path = $this->app->path->path('zlfw:zlfield')) {\n $this->app->path->register($path, 'zlfield'); // used since ZLFW 2.5.8\n $this->app->path->register($path . '/fields/elements', 'zlfields'); // temporal until all ZL Extensions adapted\n $this->app->path->register($path . '/fields/elements', 'fields'); // necessary since ZOO 2.5.13\n }\n\n // register elements - order is important!\n if ($path = $this->app->path->path('zlfw:elements')) {\n $this->app->path->register($path, 'elements'); // register elements path\n\n $this->app->loader->register('ElementPro', 'elements:pro/pro.php');\n $this->app->loader->register('ElementRepeatablepro', 'elements:repeatablepro/repeatablepro.php');\n $this->app->loader->register('ElementFilespro', 'elements:filespro/filespro.php');\n }\n }", "public function register(array $paths = array())\n\t{\n\t\t$this->_include_paths = $paths;\n\t\tspl_autoload_register(array($this, 'load_class'));\n\t}", "public static function register()\n\t{\n\t\tRichText_AdminModule::register();\n//\t\tRichText_FrontModule::register();\n\t}", "function RegisterMyClasses(array $classes)\n{\n $PublicClassName = PublicLibManager::getInstance();\n $PublicClassName->RegisterMyClasses($classes);\n}", "public function register(){}", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }" ]
[ "0.6936034", "0.6533095", "0.63863593", "0.63039184", "0.61995655", "0.60920054", "0.595233", "0.5909843", "0.5888458", "0.58864194", "0.58539045", "0.5801427", "0.5801427", "0.5798436", "0.57482165", "0.57342285", "0.57314354", "0.56831926", "0.568296", "0.56808436", "0.56780714", "0.56654966", "0.5661336", "0.5653936", "0.56469184", "0.56423986", "0.56337935", "0.56205314", "0.5618046", "0.5609248", "0.5606071", "0.5597957", "0.55971783", "0.5595081", "0.5565879", "0.55657256", "0.5555458", "0.5551603", "0.55451566", "0.55442345", "0.55309063", "0.5528525", "0.5521328", "0.551746", "0.5515491", "0.5506024", "0.55027956", "0.54960984", "0.5485686", "0.54847014", "0.5484223", "0.5480614", "0.5477154", "0.5475574", "0.5475274", "0.5473157", "0.5455974", "0.5455798", "0.54538655", "0.545381", "0.54496664", "0.5446215", "0.5444796", "0.5440007", "0.5439646", "0.5423271", "0.5414918", "0.541473", "0.54146826", "0.5411312", "0.5403188", "0.5402948", "0.5402948", "0.5402948", "0.5402948", "0.5402948", "0.5402948", "0.5402948", "0.5402948", "0.5387283", "0.53862786", "0.53845197", "0.53770673", "0.537428", "0.53735346", "0.53717494", "0.53706104", "0.53680354", "0.5367266", "0.5367266", "0.5367266", "0.5367266", "0.5367266", "0.5367266", "0.5367266", "0.5367266", "0.5367266", "0.5367266", "0.5367266", "0.5367266" ]
0.69073486
1
Registers a contextual WP Framework class. Contextual classes will get loaded after the 'wp' action is fired.
function wpf_register_contextual_class( $handle, $class ) { global $wpf_classes; $wpf_classes['contextual'][$handle] = $class; return $wpf_classes['contextual'][$handle]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wpf_load_contextual_classes() {\n\tglobal $wpf_classes, $wpf_theme;\n\n\tif ( isset($wpf_classes['contextual']) && !empty( $wpf_classes['contextual'] ) ) {\n\t\t$methods = array();\n\n\t\t// Get the context, but not in the admin.\n\t\tif ( !is_admin() ) {\n\t\t\t$context = array_reverse( (array) wpf_get_request() );\n\n\t\t\tif ( !empty($context) ) {\n\t\t\t\tforeach ( $context as $method ) {\n\t\t\t\t\t$methods[] = str_replace( '-', '_', $method );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tforeach ( (array) $wpf_classes['contextual'] as $handle => $class ) {\n\t\t\tif ( isset($wpf_classes[$handle]) )\n\t\t\t\tcontinue;\n\n\t\t\t// Call the admin method if we're in the admin area.\n\t\t\tif ( is_admin() ) {\n\t\t\t\t$wpf_theme->callback( $wpf_classes['contextual'][$handle], 'admin' );\n\n\t\t\t} else {\n\n\t\t\t\t// Call the constructor method if we're not in the admin,\n\t\t\t\t// pass all the methods that are valid for this page request.\n\t\t\t\t$wpf_classes[$handle] = new $class( $methods );\n\t\t\t}\n\n\t\t\t// Call all the contextual methods.\n\t\t\tif ( !empty( $methods ) ) {\n\t\t\t\tforeach( $methods as $method ) {\n\t\t\t\t\t$wpf_theme->callback( $wpf_classes[$handle], $method );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function wpf_register_class( $handle, $class, $autoload = false ) {\n\tglobal $wpf_classes;\n\n\t$type = $autoload ? 'autoload' : 'static';\n\n\t$wpf_classes[$type][$handle] = $class;\n\n\treturn $wpf_classes[$type][$handle];\n}", "function wpf_autoload_classes() {\n\tglobal $wpf_classes;\n\n\tif ( isset( $wpf_classes['autoload'] ) ) {\n\t\tforeach ( (array) $wpf_classes['autoload'] as $handle => $class ) {\n\t\t\tif ( !isset($wpf_classes[$handle]) ) {\n\t\t\t\t$wpf_classes[$handle] = new $class;\n\t\t\t}\n\t\t}\n\t}\n}", "public function register($class);", "function register_class()\n\t{\n\t\t\n\t\t// NO LONGER NEEDED\n\t}", "public static function load_extra_classes() {\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-elementor.php';\n\t\tElementor::init();\n\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-woo.php';\n\t\tWoo::init();\n\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-facebook.php';\n\t\tFacebook::init();\n\t}", "protected function registerMainClass()\n {\n $this->app['themify'] = $this->app->share(function ($app) {\n return new Themify(\n $app['themify.resolver'],\n $app['view.finder'],\n $app['events'],\n $app['config']\n );\n });\n }", "function shell_theme_context_setup() {\r\n\r\n\t/* Additional Body class */\r\n\tadd_filter( 'body_class','shell_body_class');\r\n\r\n\t/* Additional css classes for widgets */\r\n\tadd_filter( 'dynamic_sidebar_params', 'shell_widget_classes' );\r\n\r\n\t/* Hybrid Core Context */\r\n\tadd_filter( 'hybrid_context', 'shell_hybrid_context' );\r\n\r\n\t/* Atomic Widget Plugin Context */\r\n\tadd_filter( 'atomic_widget_context', 'shell_atomic_widgets_context' );\r\n\r\n\t/* Post format singular template */\r\n\tadd_filter( 'single_template', 'shell_post_format_singular_template', 11 );\r\n}", "function WPF() {\n\tglobal $wpf_classes;\n\n\t$theme_class = wpf_get_class( 'theme' );\n\n\treturn $wpf_classes['theme'] = new $theme_class;\n}", "protected abstract function registerClasses(): void;", "public function define_hooks()\n\t{\n\t\t$base = new Base;\n\t\t$this->loader->add_action('init', $base, 'add_post_types');\n\t}", "function load() {\n\tadd_action( 'after_setup_theme', __NAMESPACE__ . '\\\\setup' );\n}", "function load() {\n\tadd_action( 'after_setup_theme', __NAMESPACE__ . '\\\\setup' );\n\tadd_action( 'after_setup_theme', __NAMESPACE__ . '\\\\setup_theme', 100 );\n}", "function get_theme_framework() {\n\treturn \\Classy\\Classy::get_instance();\n}", "protected function registerClassLoader()\n {\n $namespace = $this->active()->get('namespace');\n $loader = new ClassLoader();\n\n $loader->addPsr4(\"Themes\\\\{$namespace}\\\\\", theme_path(\"{$namespace}/src\"));\n $loader->register();\n }", "function wpt_autoload($class)\n{ \n //if( strpos($class, 'WPtheme\\\\') !== 0 ) return;\n if( 0 !== strpos($class, 'WPTheme\\\\') OR strlen($class) <= 8 ) return;\n\n $class = substr($class, 8);\n \n $library = THEME_DIR . '/library';\n\n if( $class === 'Theme' )\n {\n require $library . '/theme.php';\n return;\n }\n\n $path = $library . '/classes/' . str_replace('\\\\','/',strtolower($class)) . '.php';\n\n if( is_file($path) ) \n { \n require $path;\n }\n\n}", "function acf_register_admin_tool($class)\n{\n}", "public static function init()\n\t{\n\t\t$classname = get_called_class();\n\n\t\t// register our shortcode and its handler\n\t\tadd_shortcode( self::SHORTCODE_TAG, array( $classname, 'shortcodeHandler' ) );\n\n\t\t// Shortcode UI, if supported\n\t\tadd_action(\n\t\t\t'register_shortcode_ui',\n\t\t\tarray( $classname, 'shortcodeUI' ),\n\t\t\t5,\n\t\t\t0\n\t\t);\n\n\t\tif ( ! is_admin() ) {\n\t\t\t// unhook the WordPress Core oEmbed handler\n\t\t\twp_oembed_remove_provider( static::OEMBED_CORE_REGEX );\n\t\t\t// pass a Tweet detail URL through the Tweet shortcode handler\n\t\t\twp_embed_register_handler(\n\t\t\t\tself::SHORTCODE_TAG,\n\t\t\t\tstatic::URL_REGEX,\n\t\t\t\tarray( $classname, 'linkHandler' ),\n\t\t\t\t1\n\t\t\t);\n\t\t}\n\t}", "public static function register()\n {\n self::loadFile('sgContext', realpath(dirname(__FILE__) . '/sgContext.class.php'));\n self::loadFile('sgConfiguration', realpath(dirname(__FILE__) . '/sgConfiguration.class.php'));\n spl_autoload_register(array(__CLASS__, 'loadClass'));\n }", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core theme.\n\t\t */\n\t\trequire_once 'class-custom-theme-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the public area.\n\t\t */\n\t\trequire_once 'public/class-theme-public.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once 'admin/class-theme-admin.php';\n\n\n\t\t$this->loader = new Wpt_Custom_Theme_Loader();\n\n\t}", "public function register()\r\n\t{\r\n $namespace = FANCY_NAME;\r\n $wordpress = $this->app[\"$namespace.wordpress\"];\r\n\r\n if(Wordpress::available()) {\r\n \\Event::listen('fancy::scripts.initialize', function() use($wordpress) {\r\n global $pagenow;\r\n\r\n if(!($wordpress->is_admin() && ($pagenow === 'post.php' || $pagenow === 'post-new.php'))) return;\r\n\r\n return array(\r\n 'ace' => array(\r\n 'src' => 'public/packages/fancy/ace/js/vendor/ace/ace.js',\r\n 'in_admin' => true\r\n ),\r\n 'ace-textarea' => array(\r\n 'src' => 'public/packages/fancy/ace/js/vendor/jquery-ace-textarea.js',\r\n 'in_admin' => true\r\n ),\r\n\r\n 'fancy-ace' => array(\r\n 'src' => 'public/packages/fancy/ace/js/plugin.js',\r\n 'in_admin' => true\r\n )\r\n );\r\n });\r\n }\r\n\t}", "public function register () {\r\n\t\tspl_autoload_register( array( $this, 'loadClass' ) );\r\n\t}", "protected function _Load_Context() {\r\n $dir = untrailingslashit( plugin_dir_path(__FILE__ ) );\r\n // Recurssively load the directory\r\n $this->_Recusive_Load_Dir($dir.'/context');\r\n // Fire the shortcode init action\r\n do_action('vcff_supports_context_init',$this);\r\n }", "public function register() {\n\t\tadd_action( 'plugins_loaded', [ $this, 'register_services' ] );\n\t\tadd_action( 'init', [ $this, 'register_assets_handler' ] );\n\t}", "public function register() {\n\t\t/** @var \\wpdb $wpdb */\n\t\tglobal $wpdb;\n\t\t$this->container->bind( 'wpdb', $wpdb );\n\t}", "function commonwp_autoloader( $class ) {\n\t$pairs = [\n\t\t'WP_Temporary' => '/lib/wp-temporary/class-wp-temporary.php',\n\t\t'Temporary_Command' => '/lib/wp-temporary/cli/Temporary_Command.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Clean' => '/inc/Clean.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Expiration' => '/inc/Expiration.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Lock' => '/inc/Lock.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Main' => '/inc/Main.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\NPM' => '/inc/NPM.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Paths' => '/inc/Paths.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Privacy' => '/inc/Privacy.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Process' => '/inc/Process.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Queue' => '/inc/Queue.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Rewrite' => '/inc/Rewrite.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Singleton' => '/inc/Singleton.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\SRI' => '/inc/SRI.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Store' => '/inc/Store.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Utils' => '/inc/Utils.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\Versions' => '/inc/Versions.php',\n\t\t'dimadin\\WP\\Plugin\\commonWP\\WPCLI' => '/inc/WPCLI.php',\n\t\t'dimadin\\WP\\Library\\Backdrop\\Main' => '/lib/backdrop/inc/Main.php',\n\t\t'dimadin\\WP\\Library\\Backdrop\\Server' => '/lib/backdrop/inc/Server.php',\n\t\t'dimadin\\WP\\Library\\Backdrop\\Task' => '/lib/backdrop/inc/Task.php',\n\t];\n\n\tif ( array_key_exists( $class, $pairs ) ) {\n\t\tinclude __DIR__ . $pairs[ $class ];\n\t}\n}", "public function register() {\n\t\tadd_action( 'bp_loaded', [ $this, 'registerServices' ] );\n\t}", "public function __Init_Context() {\r\n $this->_Load_Context();\r\n // Fire the shortcode init action\r\n do_action('vcff_supports_init_context',$this);\r\n }", "public function __construct() {\n\n\t\t// Setup empty class for the global $wpex_theme object\n\t\tglobal $wpex_theme;\n\t\t$wpex_theme = new stdClass;\n\n\t\t// Defines hooks and runs actions on init\n\t\tadd_action( 'init', array( $this, 'actions' ), 0 );\n\n\t\t// Define constants\n\t\tadd_action( 'after_setup_theme', array( $this, 'constants' ), 1 );\n\n\t\t// Load all the theme addons\n\t\tadd_action( 'after_setup_theme', array( &$this, 'addons' ), 2 );\n\n\t\t// Load configuration classes (post types & 3rd party plugins)\n\t\t// Must load first so it can use hooks defined in the classes\n\t\tadd_action( 'after_setup_theme', array( &$this, 'configs' ), 3 );\n\n\t\t// Load all core theme function files\n\t\tadd_action( 'after_setup_theme', array( &$this, 'include_functions' ), 4 );\n\n\t\t// Load framework classes\n\t\tadd_action( 'after_setup_theme', array( &$this, 'classes' ), 5 );\n\n\t\t// Load custom widgets\n\t\tadd_action( 'after_setup_theme', array( &$this, 'custom_widgets' ), 5 );\n\n\t\t// Populate the global opject after all core functions are registered and after the WP object is set up\n\t\t// Would be best to use template_redirect, but need to use wp_head to fix a bug with the Visual Composer Media Grid builder...\n\t\tadd_action( 'wp_head', array( $this, 'global_object' ), 0 );\n\n\t\t// Actions & filters\n\t\tadd_action( 'after_setup_theme', array( &$this, 'add_theme_support' ) );\n\n\t\t// Flush rewrites after theme switch to prevent 404 errors\n\t\tadd_action( 'after_switch_theme', array( &$this, 'flush_rewrite_rules' ) );\n\n\t\t// Load scripts in the WP admin\n\t\tadd_action( 'admin_enqueue_scripts', array( &$this, 'admin_scripts' ) );\n\n\t\t// Load theme CSS\n\t\tadd_action( 'wp_enqueue_scripts', array( &$this, 'theme_css' ) );\n\n\t\t// Load responsive CSS - must be added last\n\t\tadd_action( 'wp_enqueue_scripts', array( &$this, 'responsive_css' ), 99 );\n\n\t\t// Load theme js\n\t\tadd_action( 'wp_enqueue_scripts', array( &$this, 'theme_js' ) );\n\n\t\t// Add meta viewport tag to header\n\t\tadd_action( 'wp_head', array( &$this, 'meta_viewport' ), 1 );\n\n\t\t // Add meta viewport tag to header\n\t\tadd_action( 'wp_head', array( &$this, 'meta_edge' ), 0 );\n\n\t\t// Loads CSS for ie8\n\t\tadd_action( 'wp_head', array( &$this, 'ie8_css' ) );\n\n\t\t// Loads html5 shiv script\n\t\tadd_action( 'wp_head', array( &$this, 'html5_shiv' ) );\n\n\t\t// Adds tracking code to the site head\n\t\tadd_action( 'wp_head', array( &$this, 'tracking' ) );\n\n\t\t// Outputs custom CSS to the head\n\t\tadd_action( 'wp_head', array( &$this, 'custom_css' ), 9999 );\n\n\t\t// register sidebar widget areas\n\t\tadd_action( 'widgets_init', array( &$this, 'register_sidebars' ) );\n\n\t\t// Define the directory URI for the gallery metabox calss\n\t\tadd_action( 'wpex_gallery_metabox_dir_uri', array( &$this, 'gallery_metabox_dir_uri' ) );\n\n\t\t// Alter tagcloud widget to display all tags with 1em font size\n\t\tadd_filter( 'widget_tag_cloud_args', array( &$this, 'widget_tag_cloud_args' ) );\n\n\t\t// Alter WP categories widget to display count inside a span\n\t\tadd_filter( 'wp_list_categories', array( &$this, 'wp_list_categories_args' ) );\n\n\t\t// Exclude categories from the blog page\n\t\tadd_filter( 'pre_get_posts', array( &$this, 'pre_get_posts' ) );\n\n\t\t// Add new social profile fields to the user dashboard\n\t\tadd_filter( 'user_contactmethods', array( &$this, 'add_user_social_fields' ) );\n\n\t\t// Add a responsive wrapper to the WordPress oembed output\n\t\tadd_filter( 'embed_oembed_html', array( &$this, 'add_responsive_wrap_to_oembeds' ), 99, 4 );\n\n\t\t// Allow for the use of shortcodes in the WordPress excerpt\n\t\tadd_filter( 'the_excerpt', 'shortcode_unautop' );\n\t\tadd_filter( 'the_excerpt', 'do_shortcode' );\n\n\t\t// Make sure the wp_get_attachment_url() function returns correct page request (HTTP or HTTPS)\n\t\tadd_filter( 'wp_get_attachment_url', array( &$this, 'honor_ssl_for_attachments' ) );\n\n\t\t// Tweak the default password protection output form\n\t\tadd_filter( 'the_password_form', array( &$this, 'custom_password_protected_form' ) );\n\n\t\t// Exclude posts with custom links from the next and previous post links\n\t\tadd_filter( 'get_previous_post_join', array( &$this, 'prev_next_join' ) );\n\t\tadd_filter( 'get_next_post_join', array( &$this, 'prev_next_join' ) );\n\t\tadd_filter( 'get_previous_post_where', array( &$this, 'prev_next_where' ) );\n\t\tadd_filter( 'get_next_post_where', array( &$this, 'prev_next_where' ) );\n\n\t\t// Redirect posts with custom links\n\t\tadd_filter( 'template_redirect', array( &$this, 'redirect_custom_links' ) );\n\n\t}", "public static function registerClassLoadingInformation() {}", "public function register() {\n\t\t/*\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t| Codestar Framework option pages\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t|\n\t\t*/\n\n\t\tif (!class_exists('CSF')) {\n\t\t\t$this->wpHelper->WpRegister('plugins/codestar/codestar-framework');\n\t\t\t$this->wpHelper->WpRegister('plugins/codestar/config');\n\t\t}\n\t\t/*\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t| visualcomposer\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t|\n\t\t*/\n\t\t$this->wpHelper->WpRegister('plugins/visualcomposer/Vc');\n\n\t\t/*\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t| Metaboxes\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t|\n\t\t*/\n\t\t$this->wpHelper->WpRegister('plugins/meta-box/meta-box');\n\t\t$this->wpHelper->WpRegister('plugins/meta-box/metaboxes-config');\n\n\t\t/** Add FrontEnd Widget **/\n\t\t$this->wpHelper\n\t\t\t->addWidget(\n\t\t\t\t\\App\\Widgets\\ExampleFrontEndWidget::class\n\t\t\t);\n\n\t\t/** Add Plugin Links to Admin > Plugins Page Entry **/\n\t\t$this->wpHelper\n\t\t\t->addPluginLinks(array(\n\t\t\t\t'<a href=\"admin.php?page=lumen_page\">Settings</a>',\n\t\t\t));\n\t\t/** Add Admin Bar Nodes **/\n\t\t$this->wpHelper\n\t\t\t->addAdminBarNode(\n\t\t\t\tfalse,\n\t\t\t\t'lumen_bar_node2',\n\t\t\t\t'Lumen Bar Node',\n\t\t\t\t'#'\n\t\t\t)->addAdminBarNode(\n\t\t\t'lumen_bar_node2',\n\t\t\t'lumen_bar_node2_child1',\n\t\t\t'Node Child 1',\n\t\t\t'#'\n\t\t)->addAdminBarNode(\n\t\t\t'lumen_bar_node2',\n\t\t\t'lumen_bar_node2_child2',\n\t\t\t'Node Child 2',\n\t\t\t'#'\n\t\t)->addAdminBarNode(\n\t\t\t'lumen_bar_node2',\n\t\t\t'lumen_bar_node2_child3',\n\t\t\t'Node Child 2',\n\t\t\t'#'\n\t\t);\n\n\t\t/** Add Shortcodes **/\n\t\t$this->wpHelper\n\t\t\t->addShortcode(\n\t\t\t\t'auth_register',\n\t\t\t\tfunction ($parameters, $content) {\n\t\t\t\t\treturn $this->app->call('\\App\\Http\\Controllers\\Auth\\RegisterShortcodeController@template', compact('parameters', 'content'));\n\t\t\t\t}\n\t\t\t)\n\t\t\t->addShortcode(\n\t\t\t\t'auth_login',\n\t\t\t\tfunction ($parameters, $content) {\n\t\t\t\t\treturn $this->app->call('\\App\\Http\\Controllers\\Auth\\LoginShortcodeController@template', compact('parameters', 'content'));\n\t\t\t\t}\n\t\t\t);\n\n\t\t/** Add Nav Menu MetaBoxes **/\n\t\t$this->wpHelper->addMetaBox(\n\t\t\t'example_menu_meta_box',\n\t\t\t'Truediv Routes',\n\t\t\tfunction ($object, $arguments) {\n\t\t\t\t$this->lumenHelper\n\t\t\t\t\t->response($this->app->call('\\App\\Http\\Controllers\\ExampleMetaBoxController@menuMetaBox', compact('object', 'arguments')))\n\t\t\t\t\t->sendContent();\n\t\t\t},\n\t\t\t'nav-menus',\n\t\t\t'side',\n\t\t\t'default',\n\t\t\t2\n\t\t);\n\n\t\t/** Add Dashboard Widget **/\n\n\t\t$this->wpHelper\n\t\t\t->addAdminPanel(\n\t\t\t\t'lumen_page',\n\t\t\t\t'Larash',\n\t\t\t\t'Larash',\n\t\t\t\tfunction () {\n\t\t\t\t\t$this->lumenHelper\n\t\t\t\t\t\t->response($this->lumenHelper->view('admin-intro'))\n\t\t\t\t\t\t->sendContent();\n\t\t\t\t},\n\t\t\t\t'manage_options',\n\t\t\t\t'',\n\t\t\t\tnull\n\t\t\t)\n\t\t\t->addAdminSubPanel(\n\t\t\t\t'lumen_page',\n\t\t\t\t'lumen_sub_page',\n\t\t\t\t'WpPost Demo',\n\t\t\t\t'WpPost Demo',\n\t\t\t\tfunction () {\n\t\t\t\t\t$this->lumenHelper\n\t\t\t\t\t\t->response($this->app->call('\\App\\Http\\Controllers\\ExampleAdminController@template'))\n\t\t\t\t\t\t->sendContent();\n\t\t\t\t},\n\t\t\t\t'manage_options'\n\t\t\t)->addAdminSubPanel(\n\t\t\t'lumen_page',\n\t\t\t'lumen_settings',\n\t\t\t'Settings',\n\t\t\t'Settings',\n\t\t\tfunction () {\n\t\t\t\t$this->lumenHelper\n\t\t\t\t\t->response($this->app->call('\\App\\Http\\Controllers\\SettingsController@template'))\n\t\t\t\t\t->sendContent();\n\t\t\t},\n\t\t\t'manage_options'\n\t\t);\n\n\t\t/** Add WP Rest API Route **/\n// $this->wpHelper\n\t\t// ->addRestRoute('wp-lumen/api/v1', '/test', array(\n\t\t// 'methods' => ['get'],\n\t\t// 'callback' => function(){\n\t\t// return $this->app->call('\\App\\Http\\Controllers\\ExampleWpRestRouteController@get');\n\t\t// },\n\t\t// ));\n\n\t\t/** Add CSS & Scripts **/\n\t\t$this->wpHelper\n\t\t\t->enqueueStyle(\n\t\t\t\t'lumen',\n\t\t\t\t$this->lumenHelper->asset('resources/assets/build/Main.css'),\n\t\t\t\tarray(),\n\t\t\t\t'1.0.0',\n\t\t\t\t'all'\n\t\t\t)\n\t\t\t->enqueueScript(\n\t\t\t\t'lumen',\n\t\t\t\t$this->lumenHelper->asset('resources/assets/build/Main.js'),\n\t\t\t\tarray('jquery'),\n\t\t\t\t'1.0.0',\n\t\t\t\ttrue\n\t\t\t)\n\n\t\t// admin\n\t\t\t->enqueueStyle('datatablecss', $this->lumenHelper->asset('resources/assets/src/admin/datatables/datatables.min.css'), array(), '1.0.0', 'all', 'admin')\n\t\t\t->enqueueScript('datatablejs', $this->lumenHelper->asset('resources/assets/src/admin/datatables/datatables.min.js'), array('jquery'), '1.0.0', true, 'admin');\n\n\t}", "public function register() {\n\t\tadd_action( 'wp_enqueue_scripts', [ $this, 'enqueue_scripts' ] );\n\t\tadd_action( 'wp_enqueue_scripts', [ $this, 'enqueue_styles' ] );\n\n\t\tadd_action( 'init', [ $this, 'init' ] );\n\t\tadd_action( 'admin_init', [ $this, 'admin_init' ] );\n\t}", "private function registerClass(string $class = null)\n {\n if(class_exists($class)){\n $this->app->register($class);\n }\n }", "public static function wpInit() {}", "function bp_theme_autoloader($class) {\n\n if (strpos($class,'Theme') !== 0) {return false;}\n $class = str_replace('Theme\\\\','',$class);\n $file = strtolower(str_replace('\\\\','-',$class));\n $file = str_replace('_','-',$file);\n $file = array_unique(explode('-',$file));\n $file = implode('-',$file);\n $file = get_template_directory() . '/inc/' . $file;\n $file .= '.php';\n require $file;\n\n}", "public function __construct()\n {\n add_action('init', [__CLASS__, 'register_post_types']);\n }", "public function Load_Shortcodes() {\r\n $contexts = $this->contexts;\r\n // If no contexts were returned\r\n if (!$contexts || !is_array($contexts)) { return; }\r\n // Loop through each of the found contexts\r\n foreach ($contexts as $_type => $_context) { \r\n // Add the render function\r\n add_shortcode($_type, array($this,'Render_Shortcode'));\r\n }\r\n // Fire the shortcode init action\r\n do_action('vcff_supports_shortcode_init',$this);\r\n }", "static function init() {\n\t\t\t$classname = get_called_class();\n\t\t\tadd_action( 'widgets_init', $classname . '::register_widget' );\n\t\t\tadd_shortcode( $classname, $classname . '::register_shortcode' );\n\t\t}", "public function register(): void {\n\t\t// Bindings.\n\n\t\t$this->container->singleton( Breezy::class, Breezy::class );\n\t\t$this->container->singleton( Steps\\Loader::class, Steps\\Loader::class );\n\n\t\t// Initializations.\n\n\t\t$this->initialize_themes();\n\t\t$this->hooks();\n\t}", "function setup() {\n\t$n = function ( $function ) {\n\t\treturn __NAMESPACE__ . \"\\\\$function\";\n\t};\n\n\t// NOTE: Uncomment to activate post type\n\tadd_action( 'init', $n( 'register_work' ) );\n\n}", "public function register( ) {\n\n\t\tspl_autoload_register( array( $this, 'load' ));\n\t}", "public static function init()\n\t{\n\t\t$classname = get_called_class();\n\n\t\tadd_shortcode( static::SHORTCODE_TAG, array( $classname, 'shortcodeHandler' ) );\n\n\t\t// convert a URL into the shortcode equivalent\n\t\twp_embed_register_handler(\n\t\t\tstatic::SHORTCODE_TAG,\n\t\t\tstatic::URL_REGEX,\n\t\t\tarray( $classname, 'linkHandler' ),\n\t\t\t1\n\t\t);\n\n\t\t// Shortcode UI, if supported\n\t\tadd_action(\n\t\t\t'register_shortcode_ui',\n\t\t\tarray( $classname, 'shortcodeUI' ),\n\t\t\t5,\n\t\t\t0\n\t\t);\n\t}", "public static function load_module() {\n // Register taxonomy\n add_action('init', [__CLASS__, 'register_taxonomy']);\n }", "function flux_add_post_class( $wp_classes = array(), $class = '', $post_id = 0 ) {\n\n\t// The special flux body classes\n\t$flux_classes = array();\n\n\t// Add special flux classes\n\t$flux_classes[] = 'flux';\n\t$flux_classes[] = 'flux-timestamp-' . get_the_time( 'U', $post_id );\n\n\t// Merge WP classes with Flux classes and remove duplicates\n\t$classes = array_unique( array_merge( (array) $flux_classes, (array) $wp_classes ) );\n\n\treturn apply_filters( 'flux_add_post_class', $classes, $flux_classes, $wp_classes, $class, $post_id );\n}", "public static function add_classes() {\n\t\t// if ( get_theme_mod('wsu_wds_site_content_is_full_width', false) ) {\n\n\t\t// \tself::add_class('wsu-c-content-width--full');\n\n\t\t// }\n\n\t\t// Add future checks here ...\n\n\t}", "public static function register(){\n spl_autoload_register(array(__CLASS__, 'autoload'));\n }", "public static function register(){\n spl_autoload_register(array(__CLASS__, 'autoload'));\n }", "public function init() {\n\t\tdo_action( get_called_class() . '_before_init' );\n\t\tdo_action( get_called_class() . '_after_init' );\n\t\tadd_action( 'wp_enqueue_scripts', array( get_called_class(), 'enqueue_scripts' ), 20 );\n\t\tnew Display();\n\t\tnew Term_Meta();\n\t}", "public function __construct(){\n\t\tigk_wp_registerlib(IGK_CGT_PLUGIN_DIR.\"/\");\t\n\t}", "public function init()\n {\n add_action('after_setup_theme', [$this, 'themeSetup']);\n }", "public function register()\n\t{\n\t\tspl_autoload_register(array($this, 'loadClass'));\n\t}", "private static function init_hooks() {\n\t\tself::$initiated = true;\n\t\tadd_action( 'wp_head', array( 'mptheme_functions', 'theme_styles' ) );\n\t\tadd_action( 'wp_enqueue_scripts', array('mptheme_functions', 'mptheme_enqueue') );\n\n\t\t// If a Google Analytics ID is defined, add the code to the head\n\t\tif ( get_option( 'mptheme_google_analytics_id' ) ){\n\t\t\tadd_action( 'wp_head', array( 'mptheme_functions', 'mptheme_google_analytics_code' ) );\n\t\t}\n\n\t\t// If a Facebook Pixel ID is defined, add the code to the head\n\t\tif ( get_option( 'mptheme_facebook_pixel_id' ) ){\n\t\t\tadd_action( 'wp_head', array( 'mptheme_functions', 'mptheme_facebook_pixel_code' ) );\n\t\t}\n\n\t}", "public static function register() {\n ini_set('unserialize_callback_func', 'spl_autoload_call');\n spl_autoload_register(array(new self, 'autoload'));\n }", "public function init()\n {\n // Register the loader method\n spl_autoload_register(array(__CLASS__, '_loadClasses'));\n }", "function xb_classifieds_init() {\n\tregister_activation_hook ( __FILE__, 'xb_classifieds_build_permissions' );\n\t\n\tadd_action('admin_init', 'my_admin_init');\n\tadd_action('admin_menu', 'home_create_menu');\n}", "public function register(){\n add_action('admin_enqueue_scripts',array($this,'enqueue'));\n //load front end wp css & js\n add_action('wp_enqueue_scripts',array($this,'enqueue'));\n }", "public function register()\n {\n spl_autoload_register([$this, 'loadClass']);\n }", "public static function __classLoaded()\n {\n\t\tif (empty(static::$layers) && class_exists('Git')) {\n\t\t\tstatic::$layers = \\Git::$repositories;\n\t\t}\n }", "public function register() {\n\t\tself::wpcd_app_register_post_and_taxonomy();\n\n\t\t$this->set_post_taxonomy( 'wpcd_app_group' );\n\n\t\t$this->set_group_key( 'wpcd_app_group' );\n\n\t\t$this->set_post_type( 'wpcd_app' );\n\n\t}", "function register_tool($class)\n {\n }", "public function register()\n\t{\n\t\tspl_autoload_register(array($this, \"autoloadClass\"));\n\t}", "static function register(){\r\n\t\tspl_autoload_register(array(__CLASS__,'Autoload'));\r\n\t}", "public static function register() {\n\t register_widget( __CLASS__ );\n\t}", "public function __construct() {\n require_once __DIR__ . '/vendor/autoload.php';\n $this->define_constants();\n register_activation_hook( __FILE__, array( $this, 'activate' ) ); \n add_action( 'plugins_loaded', array( $this, 'init_plugin' ) ); \n }", "function flawless_module_class( $custom_class = '' ) {\r\n global $flawless, $wp_query, $post;\r\n\r\n //** Load Post Classes if this is a post */\r\n $classes = get_post_class( '', $post->ID );\r\n\r\n $classes[] = $custom_class;\r\n $classes[] = 'cfct-module';\r\n\r\n $classes = apply_filters( 'flawless::module_class', $classes );\r\n\r\n echo implode( ' ', ( array ) $classes );\r\n\r\n }", "public function register()\n {\n\n if( ! $this->activated( 'cf_manager' ) ) return;\n\n\n $this->settings = new SettingsApi();\n\n $this->callbacks = new AdminCallbacks();\n\n $this->cf_callbacks = new CfCallbacks();\n\n $this->setSubpages();\n\n $this->metaBoxes = array();\n\n\n $this->setSettings();\n $this->setSections();\n $this->setFields();\n\n\n $this->settings->addSubPages( $this->subpages )->register();\n\n\n $this->showPosts();\n\n if( ! empty( $this->metaBoxes ) ) {\n\n add_action( 'add_meta_boxes', array( $this, 'addMultipleMetaBoxes' ) );\n\n }\n\n }", "public function load()\n {\n // Register initialization method.\n add_action('init', [$this, 'init'], 10, 0);\n }", "function utcw_wp_loaded() {\n\tglobal $utcw_allowed_taxonomies, $utcw_allowed_post_types;\n\n\t$utcw_allowed_taxonomies = get_taxonomies();\n\t$utcw_allowed_post_types = get_post_types(array('public' => true));\n}", "public function injectViewClasses() {\n\t\t$controller = $this->_controller();\n\t\tforeach ($this->config('viewClasses') as $type => $class) {\n\t\t\t$controller->RequestHandler->viewClassMap($type, $class);\n\t\t}\n\t}", "public function wp_loaded()\n {\n }", "function add_wp_hooks(){\n\n\t\t$comments = new WordpressConnectComments();\n\t\t$like = new WordpressConnectLikeButton();\n\n\t}", "private function loadClasses()\n\t\t{\n\t\t\t// foreach($GLOBALS['classes'] as $var => $class)\n\t\t\t// {\n\t\t\t\t// $this->$var = $class;\n\t\t\t// }\n\t\t\t\n\t\t\t// $this->load = _new('loader');\n\t\t\t\n\t\t\t/** Registramos todos os objetos que serão necessários **/\n\t\t\tforeach(Registry::getAll() as $var => $object)\n\t\t\t{\n\t\t\t\t$this->$var = $object;\n\t\t\t}\n\t\t\t\n\t\t\t// E também a classe loader\n\t\t\t$this->load = Registry::get('loader');\n\t\t}", "function registerHooks()\n{\n add_action('after_setup_theme', 'setupTheme');\n add_action('rest_api_init', 'registerEndpoints');\n}", "public function __construct(){\n\n $this->define_theme_globals();\n $this->define_theme_supports();\n $this->define_image_sizes();\n $this->replace_3rd_party_pugins_hooks();\n $this->remove_actions();\n $this->init_hooks();\n $this->include_global();\n\n if( $this->is_request( 'frontend' )){\n add_action('wp_head', array('theme_construct_page', 'init'));\n }\n\n if( $this->is_request( 'admin' )){\n // $this->include_admin();\n }\n }", "public function load_wordpress() {\n\t\t\tif ( version_compare( get_bloginfo( 'version' ), '3.9', '<' ) ) {\n\t\t\t\tinclude_once( plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-compatibility-wordpress.php' );\n\t\t\t\tself::$wordpress = Black_Studio_TinyMCE_Compatibility_Wordpress::instance();\n\t\t\t}\n\t\t}", "public function registerHooks()\n {\n add_action('wp_enqueue_scripts', [$this, 'load_scripts_n_styles']);\n add_action('after_setup_theme', [$this, 'add_theme_support']);\n add_action('widgets_init', [$this, 'tf_widgets_init']);\n add_action('after_setup_theme', [$this, 'register_menus']);\n\n if( function_exists('acf_add_options_page') ) {\n acf_add_options_page();\n }\n }", "private static function onLoad($_class) {\n\t\tforeach (explode('|',self::$global['AUTOLOAD']) as $_auto) {\n\t\t\t// Allow namespaced classes\n\t\t\t$_file=$_auto.self::fixSlashes($_class).'.php';\n\t\t\t// Case-insensitive check for file presence\n\t\t\t$_glob=glob(dirname($_file).'/*.php');\n\t\t\t$_fkey=array_search(\n\t\t\t\tstrtolower($_file),array_map('strtolower',$_glob)\n\t\t\t);\n\t\t\tif (is_int($_fkey)) {\n\t\t\t\tinclude $_glob[$_fkey];\n\t\t\t\tif (method_exists($_class,'onLoad'))\n\t\t\t\t\tcall_user_func(array($_class,'onLoad'));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tself::$global['CONTEXT']=$_class;\n\t\ttrigger_error(self::TEXT_Class);\n\t}", "static public function register()\r\n {\r\n spl_autoload_register(array(self::instance(), 'autoload'));\r\n }", "static public function init() {\n\n\t\tadd_action( 'plugins_loaded', __CLASS__ . '::setup_hooks' );\n\t}", "public function register()\n {\n spl_autoload_register( array( $this, 'loadClass' ) );\n }", "public function register()\n {\n return array(T_CLASS);\n\n }", "static public function register()\n {\n spl_autoload_register(array(self::instance(), 'doAutoload'));\n }", "public static function register()\n\t{\n\t\tif ( ! static::$registered)\n\t\t{\n\t\t\tstatic::$registered = spl_autoload_register(array('\\Illuminate\\Support\\ClassLoader', 'load'));\n\t\t}\n\t}", "public function add_theme_support() {\n\t}", "public static function init() {\n\t\tadd_action( 'init', array( __CLASS__, 'register_post_type' ), 1 );\n\t}", "public function register()\n {\n spl_autoload_register(array($this, 'loadClass'));\n }", "public static function init () : void\n {\n add_action(\"init\", function () {\n self::register_post_type();\n });\n }", "function humcore_activate() {\n\n\thumcore_check_dependencies();\n\n\thumcore_register_post_type();\n\thumcore_add_rewrite_rule();\n\tglobal $wp_rewrite;\n\tflush_rewrite_rules();\n}", "public static function init()\n {\n add_action('plugins_loaded', array(self::instance(), '_setup'));\n }", "public function register(): void {\n\t\t\\spl_autoload_register( [ $this, self::AUTOLOAD_METHOD ] );\n\t}", "public function wpide() {\r\n\t\t$this->__construct();\r\n\t}", "public function register() {\n spl_autoload_register([$this, 'autoLoad']);\n }", "function register_navwalker(){\r\n require_once get_template_directory() . '/class-wp-bootstrap-navwalker.php';\r\n \r\n}", "function register_navwalker(){\r\n\trequire_once get_template_directory() . '/class-wp-bootstrap-navwalker.php';\r\n}", "protected function registerClasses()\n {\n // register helpers\n if ($path = $this->app->path->path('zlpath:helpers')) {\n $this->app->path->register($path, 'helpers');\n $this->app->loader->register('ZlHelper', 'helpers:zlhelper.php');\n }\n\n // register helpers\n if ($path = $this->app->path->path('zlfw:helpers')) {\n $this->app->path->register($path, 'helpers');\n $this->app->loader->register('zlfwHelper', 'helpers:zlfwhelper.php');\n $this->app->loader->register('ZLDependencyHelper', 'helpers:zldependency.php');\n $this->app->loader->register('ZlStringHelper', 'helpers:zlstring.php');\n $this->app->loader->register('ZlFilesystemHelper', 'helpers:zlfilesystem.php');\n $this->app->loader->register('ZlPathHelper', 'helpers:zlpath.php');\n $this->app->loader->register('ZlModelHelper', 'helpers:model.php');\n $this->app->loader->register('ZLXmlHelper', 'helpers:zlxmlhelper.php');\n $this->app->loader->register('ZLFieldHTMLHelper', 'helpers:zlfieldhtml.php');\n }\n\n // register classes\n if ($path = $this->app->path->path('zlfw:classes')) {\n $this->app->path->register($path, 'classes');\n $this->app->loader->register('ZLStorage', 'classes:zlstorage/ZLStorage.php');\n }\n\n // register elements fields\n if ($path = $this->app->path->path('zlfw:zlfield')) {\n $this->app->path->register($path, 'zlfield'); // used since ZLFW 2.5.8\n $this->app->path->register($path . '/fields/elements', 'zlfields'); // temporal until all ZL Extensions adapted\n $this->app->path->register($path . '/fields/elements', 'fields'); // necessary since ZOO 2.5.13\n }\n\n // register elements - order is important!\n if ($path = $this->app->path->path('zlfw:elements')) {\n $this->app->path->register($path, 'elements'); // register elements path\n\n $this->app->loader->register('ElementPro', 'elements:pro/pro.php');\n $this->app->loader->register('ElementRepeatablepro', 'elements:repeatablepro/repeatablepro.php');\n $this->app->loader->register('ElementFilespro', 'elements:filespro/filespro.php');\n }\n }", "public function plugin_classes() {\r\n\t\t$this->filesystem = new PDT_Filesystem( $this );\r\n\t\t$this->auth = new PDT_Auth( $this );\r\n\t\t$this->api = new PDT_Api( $this );\r\n\t\t$this->plugins = new PDT_Plugins( $this );\r\n\t\t$this->installed = new PDT_Installed( $this );\r\n\t\t$this->cases = new PDT_Cases( $this );\r\n\t\t$this->clues = new PDT_Clues( $this );\r\n\t\t$this->detective = new PDT_Detective( $this );\r\n\t}", "public function plugin_classes() {\n\t\t$this->options = new Options( $this ) ;\n\t\t$this->helpers = new Helpers( $this );\n\t\t$this->core = new Core( $this );\n\t}", "function classes() {\n\tcore();\n}", "function setup() {\n\tadd_action( 'die_setup_theme', __NAMESPACE__ . '\\\\i18n' );\n\tadd_action( 'die_setup_theme', __NAMESPACE__ . '\\\\theme_support' );\n\tadd_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\\\\scripts' );\n\tadd_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\\\\styles' );\n}", "function spl_autoload_call(string $class): void {}" ]
[ "0.69766647", "0.6301805", "0.6150954", "0.60740936", "0.60070145", "0.5975842", "0.576748", "0.575994", "0.5708206", "0.570109", "0.5674487", "0.5663401", "0.56627935", "0.5647846", "0.5638921", "0.5634577", "0.5602806", "0.55562526", "0.54975724", "0.54952604", "0.5492512", "0.549158", "0.54882216", "0.5480726", "0.5478642", "0.54671186", "0.5454866", "0.5448127", "0.5443632", "0.5414702", "0.5398364", "0.53870296", "0.53621465", "0.5328545", "0.531772", "0.53155714", "0.53003055", "0.52907085", "0.5289404", "0.52804476", "0.5276262", "0.5266621", "0.5264923", "0.5253527", "0.5253122", "0.524126", "0.524126", "0.5217222", "0.52092177", "0.52063704", "0.5204177", "0.5186523", "0.5185657", "0.5180437", "0.5176364", "0.51748055", "0.5173646", "0.51703906", "0.5170143", "0.51650906", "0.51649916", "0.5161208", "0.5159335", "0.5156638", "0.51514256", "0.51391125", "0.5122315", "0.51190054", "0.51175374", "0.5117232", "0.51144296", "0.51029587", "0.5101596", "0.5094148", "0.5093515", "0.5089509", "0.5079655", "0.5067824", "0.5065908", "0.50557274", "0.50552386", "0.50548035", "0.50500226", "0.5049889", "0.5049321", "0.5046428", "0.5043318", "0.5042989", "0.50426364", "0.5041545", "0.50378495", "0.5024736", "0.5017398", "0.5015832", "0.50103605", "0.5009459", "0.5008219", "0.5006906", "0.5002385", "0.49974728" ]
0.69067645
1
Registers an admin class in WP Framework. An admin class allows you to create administrative pages in WordPress.
function wpf_register_admin_class( $menu_slug, $class ) { global $wpf_classes; $wpf_classes['admin'][$menu_slug] = $class; return $wpf_classes['admin'][$menu_slug]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wpf_load_admin_pages() {\n\tif ( !is_admin() )\n\t\treturn;\n\n\tglobal $wpf_classes;\n\n\tif ( isset($wpf_classes['admin']) && !empty($wpf_classes['admin']) ) {\n\t\tforeach ( $wpf_classes['admin'] as $handle => $class ) {\n\t\t\tif ( !isset($wpf_classes[$handle]) ) {\n\t\t\t\t$wpf_classes[$handle] = new $class;\n\t\t\t}\n\t\t}\n\t}\n}", "public function register_admin_page()\n {\n }", "public function wp_plugin_admin(): void\n {\n $class = sprintf('%s\\\\Admin\\\\%s_Admin', $this->get_namespace(), $this->get_package());\n $this->_admin = Singleton::get_instance($class, [$this]);\n }", "function acf_register_admin_tool($class)\n{\n}", "public function register(){\n add_filter('plugin_action_links_'.GAW_PLUGIN_NAME , [$this, 'addPluginLinks']);\n $this->activate();\n $admin = new AdminPages;\n $admin->addAdminMenu();\n $this->registerPostTypes();\n }", "function classicpress_register_admin_page() {\n\tadd_management_page(\n\t\t__( 'Switch to ClassicPress', 'switch-to-classicpress' ),\n\t\t__( 'Switch to ClassicPress', 'switch-to-classicpress' ),\n\t\t'read',\n\t\t'switch-to-classicpress',\n\t\t'classicpress_show_admin_page'\n\t);\n}", "function register() {\n\tadd_action( 'admin_menu', '\\\\Sgdd\\\\Admin\\\\AdminPage\\\\add_menu' );\n\tadd_action( 'admin_init', '\\\\Sgdd\\\\Admin\\\\AdminPage\\\\action_handler' );\n\tadd_action( 'admin_enqueue_scripts', '\\\\Sgdd\\\\Admin\\\\AdminPage\\\\register_style' );\n\n\t\\Sgdd\\Admin\\SettingsPages\\Basic\\register();\n\t\\Sgdd\\Admin\\SettingsPages\\Advanced\\register();\n\t\\Sgdd\\Admin\\Editor\\register();\n}", "function add_admin_panel(){\n\n\t\t$this->adminPanel = new WordpressConnectAdminPanel();\n\n\t}", "private function instantiate_admin_pages() {\n $this->admin_objs[ 'menu' ] = new HRHS_Admin_Menu();\n }", "function registerAdminPage($sName, $sClass, $sCategory, $sTitle, $sDescription, $sFilename) {\n $sFullname = $sCategory . '/' . $sName;\n $sFilename = $this->_fixFilename($sFilename);\n $this->_aAdminPages[$sFullname] = array($sName, $sClass, $sCategory, $sTitle, $sDescription, $sFilename, null, $this->sNamespace);\n }", "private function dc_define_admin_hooks() {\n\n\t\t$plugin_admin = new Dorancafe_Admin( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'dc_enqueue_styles' );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'dc_enqueue_scripts' );\n\n\t}", "private function define_admin_hooks() {\n\n\t\t$plugin_admin = new Admin_Hook( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n\n\t}", "public function admin_init ( )\n\t{\n\t\tif ( ! function_exists('curl_init') )\n return false;\n\t\t\n\t\t$admin_class = get_class($this) . 'Admin';\n\t\t$this->admin = new $admin_class($this->icon_small);\n\t}", "private function define_admin_hooks() {\n\n\t\t//$theme_admin = new Wpt_Custom_Theme_Admin( $this->get_theme_name(), $this->get_version() );\n\n\t\t//$this->loader->add_action( 'admin_enqueue_scripts', $theme_admin, 'enqueue_styles' );\n\n\t}", "public function add_page() {\n\t\tadd_theme_page(\n\t\t\t\t__('Manage Sidebars', self::TEXT_DOMAIN),\n\t\t\t\t__('Manage Sidebars', self::TEXT_DOMAIN),\n\t\t\t\t'edit_theme_options',\n\t\t\t\t'ups_sidebars',\n\t\t\t\tarray( $this, 'admin_page' )\n\t\t\t);\n\t}", "private function define_admin_hooks() {\n\n\t\t$plugin_admin = new Service_Tracker_Admin( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'localize_scripts' );\n\n\t\t$this->loader->add_action( 'admin_menu', $plugin_admin, 'admin_page' );\n\n\t}", "private function define_admin_hooks() {\n\n\t\t$plugin_admin = new APS_Admin( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n\n\t}", "public static function registerAdminPages()\n {\n // First add main pages\n if (static::$adminPages) {\n $adminPages = new Collection(static::$adminPages);\n\n foreach ($adminPages as $adminPage) {\n add_menu_page(\n array_get($adminPage, 'label'),\n array_get($adminPage, 'title'),\n array_get($adminPage, 'capability'),\n array_get($adminPage, 'route'),\n array_get($adminPage, 'callback'),\n array_get($adminPage, 'icon'),\n array_get($adminPage, 'position')\n );\n }\n }\n\n // Then add sub pages\n if (static::$adminSubPages) {\n // Order by position\n usort(static::$adminSubPages, function($a, $b) {\n return $a['position'] > $b['position'];\n });\n\n // Add pages\n foreach (static::$adminSubPages as $adminSubPage) {\n $route = array_get($adminSubPage, 'route');\n $url = array_get($adminSubPage, 'options.url');\n\n if (! $route and $url) {\n add_submenu_page(\n array_get($adminSubPage, 'parent'),\n array_get($adminSubPage, 'title'),\n array_get($adminSubPage, 'label'),\n array_get($adminSubPage, 'capability'),\n $url\n );\n } else {\n add_submenu_page(\n array_get($adminSubPage, 'parent'),\n array_get($adminSubPage, 'title'),\n array_get($adminSubPage, 'label'),\n array_get($adminSubPage, 'capability'),\n $route,\n array_get($adminSubPage, 'callback')\n );\n }\n }\n }\n\n // We also need to rename the first item in the navigation\n global $submenu;\n\n if (isset($submenu['op-suite'])) {\n $submenu['op-suite'][0][0] = __('Dashboard', 'op3');\n }\n }", "function register_admin_screen () {\n \n $this->admin_page = add_submenu_page('edit.php?post_type=transaction', __( 'Settings', 'colabsthemes' ), __( 'Settings', 'colabsthemes' ), 'manage_options', $this->token, array( &$this, 'admin_screen' ) );\n \n add_action( \"admin_print_styles-\".$this->admin_page, 'colabs_admin_styles' );\n add_action( \"admin_print_scripts-\".$this->admin_page, 'colabs_load_only' ); \n add_action( \"admin_head-\".$this->admin_page, array( $this, 'save_options') ); \n }", "function bit_admin_page() {\n\t//Creates admin page\n}", "public function instantiate() {\n\n\t\trequire_once $this->plugin_dir_path . 'includes/class-genesis-simple-hooks-admin.php';\n\t\t$this->admin = new Genesis_Simple_Hooks_Admin();\n\t\t$this->admin->init();\n\n\t}", "public function add_admin() {\n $current_pages = array();\n\n $permission = 'manage_options';\n if (defined('SWPM_MANAGEMENT_PERMISSION')){\n $permission = SWPM_MANAGEMENT_PERMISSION;\n }\n \n $current_pages['swpm'] = add_submenu_page('simple_wp_membership', __('Form Builder', 'simple-membership'), __('Form Builder', 'simple-membership'), $permission, 'swpm-form-builder', array(&$this, 'admin'));\n // All plugin page load hooks\n foreach ($current_pages as $key => $page) {\n // Load the jQuery and CSS we need if we're on our plugin page\n add_action(\"load-$page\", array(&$this, 'admin_scripts'));\n\n // Load the Help tab on all pages\n add_action(\"load-$page\", array(&$this, 'help'));\n }\n // Save pages array for filter/action use throughout plugin\n $this->_admin_pages = $current_pages;\n\n // Adds a Screen Options tab to the Entries screen\n add_action('load-' . $current_pages['swpm'], array(&$this, 'screen_options'));\n\n // Add meta boxes to the form builder admin page\n add_action('load-' . $current_pages['swpm'], array(&$this, 'add_meta_boxes'));\n\n add_action('load-' . $current_pages['swpm'], array(&$this, 'include_forms_list'));\n }", "function add_admin_menu() {\r\n\t\tadd_management_page( __( 'RegenThumbs Stamina', 'regenthumbs-stamina' ), __( 'RegenThumbs Stamina', 'regenthumbs-stamina' ), 'manage_options', 'regenthumbs-stamina', array(&$this, 'regenerate_interface') );\r\n\t}", "private function define_admin_hooks() {\n\n $admin = new Online_Magazine_Manager_Admin( $this->version );\n\n $this->loader->add_action( 'admin_menu', $admin, 'register_admin_menu' );\n $this->loader->add_action( 'init', $admin, 'register_issue_post_type' );\n $this->loader->add_action( 'init', $admin, 'register_issue_article_post_type' );\n $this->loader->add_action( 'init', $admin, 'init_rewrite_rules' );\n $this->loader->add_action( 'parent_file', $admin, 'taxonomy_submenu_correction' );\n\n }", "public function init()\n {\n new Admin(); // Admin class\n }", "function theme_add_admin_page() {\r\n\tadd_menu_page(\r\n\t\t'Theme Options', // page_title\r\n\t\t'Site Data', // menu_title\r\n\t\t'manage_options', // capability\r\n\t\t'vw-slug', // menu_slug\r\n\t\t'theme_create_admin_page', // function\r\n\t\t'dashicons-welcome-write-blog', // icon_url\r\n\t\t110 // position\r\n\t);\r\n\r\n\tadd_action( 'admin_init', 'theme_custom_settings' );\r\n}", "public static function register() {\n\t\t$plugin = new self();\n\n\t\tadd_action( 'network_admin_menu', [ $plugin, 'add_network_admin_pages' ] );\n\n\t\tadd_action( 'admin_menu', [ $plugin, 'add_admin_pages' ] );\n\n\t\tadd_action( 'admin_menu', [ $plugin, 'modify_admin_menu' ] );\n\t\tadd_action( 'edit_form_after_title', [ $plugin, 'print_meta_boxes_after_title' ], 0 );\n\n\t\tadd_action( 'load-comment.php', [ $plugin, 'manage_comments_page_access' ] );\n\t\tadd_action( 'load-edit-comments.php', [ $plugin, 'manage_comments_page_access' ] );\n\n\t\t// Enable when we need redirects.\n\t\t//add_action( 'admin_init', [ $plugin, 'download_redirects' ] );\n\n\t}", "public static function admin()\n {\n HRHarvardTheme::get_template_part( 'admin', 'nav-widget' );\n }", "public function add_admin_pages() {\n\n\t\tif ( ! function_exists( 'acf_add_options_page' ) ) {\n\t\t\t$this->add_default_options_page();\n\t\t\treturn;\n\t\t}\n\n\t\tacf_add_options_page(\n\t\t\t[\n\t\t\t\t'page_title' => self::OPTIONS_TITLE,\n\t\t\t\t'menu_title' => self::OPTIONS_MENU_TITLE,\n\t\t\t\t'capability' => self::OPTIONS_USER_CAP,\n\t\t\t\t'menu_slug' => self::OPTIONS_MENU_SLUG,\n\t\t\t] );\n\n\t\t$this->add_acf_fields();\n\t}", "function WPVM_Admin()\n\t\t{\t$this->__construct();\n\t\t}", "public function admin_init() {\n\t\t$meta_type = papi_get_meta_type();\n\t\t$meta_type = ucfirst( $meta_type );\n\t\t$class_name = 'Papi_Admin_Entry_' . $meta_type;\n\n\t\t// A custom class is not required, e.g\n\t\t// options don't have one.\n\t\tif ( class_exists( $class_name ) ) {\n\t\t\t$class = call_user_func( [$class_name, 'instance'] );\n\n\t\t\tif ( ! $class->setup() ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Setup entry type.\n\t\tif ( $entry_type = $this->get_entry_type() ) {\n\t\t\t$entry_type->setup();\n\t\t}\n\t}", "function ywig_add_admin_page() {\n\n\tadd_menu_page(\n\t\t'YWIG Theme Options',\n\t\t'YWIG Settings', // Name of page (displayed on admin menu).\n\t\t'manage_options', // Capability. manage_options ~= admin.\n\t\t'ywig_site_settings', // id/slug. ie 'admin.php?page=ywig_site_settings'. See also ywig-admin.php do_settings_sections().\n\t\t'ywig_create_settings_page_cb'\n\t);\n\n\t// Do custom settings only if the admin page has been created.\n\tadd_action( 'admin_init', 'ywig_custom_settings' );\n}", "function admin_init() {\r\n register_setting($this->optionsName, $this->optionsName);\r\n wp_register_style('custom-page-extensions-admin-css', $this->pluginURL . '/includes/custom-page-extensions-admin.css');\r\n wp_register_script('custom-page-extensions-js', $this->pluginURL . '/js/custom-page-extensions.js');\r\n }", "function xb_classifieds_init() {\n\tregister_activation_hook ( __FILE__, 'xb_classifieds_build_permissions' );\n\t\n\tadd_action('admin_init', 'my_admin_init');\n\tadd_action('admin_menu', 'home_create_menu');\n}", "private function define_admin_hooks() {\n\t\t$plugin_admin = new MySuperCalendar_Admin( $this->get_plugin_name() );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n\t\t$this->loader->add_action( 'init', $plugin_admin, 'register_Calendar_post_type' );\n\t\t$this->loader->add_action( 'add_meta_boxes', $plugin_admin, 'add_datepicker_meta_box' );\n\t\t$this->loader->add_action( 'save_post', $plugin_admin, 'save_calendar_post' );\n\t\t$this->loader->add_action( 'admin_menu', $plugin_admin, 'register_plugin_menu_page' );\n\n\n\t}", "private function define_admin_hooks() {\n\t\t$plugin_admin = new TTR66_Admin( $this->get_plugin_name(), $this->get_version() );\n\n\t\t// Add the TTR66 dash widget and XML upload page/menu\n\t\t$this->loader->add_action( 'wp_dashboard_setup', $plugin_admin, 'add_dashboard_widget');\n\t\t$this->loader->add_action( 'admin_menu', $plugin_admin, 'register_custom_menu_page' );\n\t}", "public static function registerAdmin($app, $page) {\n\t\t\\OC_App::registerAdmin($app, $page);\n\t}", "function startup_admin() {\n\treturn startup_Admin::get_instance();\n}", "public function register_admin_bar_menu(\\WP_Admin_Bar $admin_bar)\n {\n }", "public function add_plugin_page(){\n\t\tadd_options_page(\n\t\t\t'Settings Admin',\n\t\t\t'myStickymenu',\n\t\t\t'manage_options',\n\t\t\t'my-stickymenu-settings',\n\t\t\tarray( $this, 'create_admin_page' )\n\t\t);\n\t}", "function jumpoff_admin_body_class( $classes ){ \n\n global $post;\n\n if( !is_object($post) ) \n return;\n \n // Make sure we're getting $post object\n setup_postdata( $post );\n\n // Returns an object that includes the screen’s ID, base, post type, taxonomy\n // @see https://developer.wordpress.org/reference/functions/get_current_screen\n $screen = get_current_screen();\n\n // Construct class form the post_name\n $page_name = 'admin-'.$post->post_name;\n \n // Construct class from post id\n $post_id = 'admin-post-'.$post->ID;\n \n // If post\n if ( 'post' == $screen->base ) {\n $classes .= ' ' . $screen->post_type . ' ' . $post_id . ' ' . $page_name;\n }\n\n // if default page.php\n if(basename(get_page_template()) === 'page.php'){\n $classes .= ' admin-page';\n }\n \n // Return our admin classes\n return $classes;\n \n // Reset\n wp_reset_postdata( $post );\n}", "function add_admin() {\n\t\t\t$this->pagehook = add_options_page(\n\t\t\t\t\t__( \"Subpages as Tabs\" )\n\t\t\t\t\t, __( \"Subpages as Tabs\" )\n\t\t\t\t\t, 'manage_options'\n\t\t\t\t\t, 'subpage_tabs_plugin'\n\t\t\t\t\t, array( $this, 'plugin_options_page' )\n\t\t\t\t);\n\n\t\t\t//register callback to gets call prior your options_page rendering\n\t\t\tadd_action( 'load-' . $this->pagehook, array( &$this, 'add_the_meta_boxes' ) );\n\t\t}", "function register_admin_scripts_and_styles() {\n\t\t\n\t}", "public function admin_init() {}", "function thirty_eight_add_admin_page(){\n\n //Generate Admin Page\n add_menu_page( 'thirty eight Options', 'thirty', 'manage_options', 'thirty_eight', 'thirty_eight_website_menu_page', 'dashicons-analytics', 101);\n\n //Generat Admin Subpages\n add_submenu_page( 'thirty_eight', 'Sidebar Options', 'Sidebar', 'manage_options', 'thirty_eight', 'thirty_eight_website_menu_page' );\n add_submenu_page( 'thirty_eight', 'Theme Options', 'Theme Options', 'manage_options', 'thirty_eight_theme', 'thirty_eight_theme_sub_page' );\n add_submenu_page( 'thirty_eight', 'Contact Form', 'Contact Form', 'manage_options', 'thirty_eight_contact', 'thirty_eight_contact_sub_page' );\n\n //Activate Custom script_concat_settings\n add_action( 'admin_init', 'thirty_eight_custom_Settings' );\n}", "static function admin_menu()\n\t{\n\t\t$icon = plugins_url( 'jumplead/assets/jumplead-icon.png' );\n\n\t\t// Main Menu\n\t\tadd_menu_page( 'Jumplead', 'Jumplead', 'edit_pages', 'jumplead', 'Jumplead::show_page_jumplead', $icon );\n\n\t\t// Subpages\n\t\tadd_submenu_page( 'jumplead', 'Integrations', 'Integrations', 'edit_pages', 'jumplead_integrations', 'Jumplead::show_page_integrations' );\n\t\tadd_submenu_page( 'jumplead', 'Settings', 'Settings', 'edit_pages', 'jumplead_settings', 'Jumplead::show_page_settings' );\n\t}", "public function register(){\n add_action('admin_enqueue_scripts',array($this,'enqueue'));\n //load front end wp css & js\n add_action('wp_enqueue_scripts',array($this,'enqueue'));\n }", "function admin_init()\n {\n // vars\n $version = '1.0.0';\n\n // scripts\n wp_register_script( 'admin', _24_TEMPLATE_PATH . '/library/assets/admin/admin.js', array('jquery'), $version );\n\n // styles\n wp_register_style( 'admin', _24_TEMPLATE_PATH . '/library/assets/admin/admin.css', false, $version );\n }", "public function admin_menu(): void {\n\t\tif ( is_plugin_active_for_network( plugin_basename( WP_SENTRY_PLUGIN_FILE ) ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tadd_management_page(\n\t\t\t'WP Sentry test',\n\t\t\t'WP Sentry test',\n\t\t\t'activate_plugins',\n\t\t\tself::ADMIN_PAGE_SLUG,\n\t\t\t[ $this, 'render_admin_page' ]\n\t\t);\n\t}", "function adminPage() {\n // Args: title of page to create/tab title, title used in settings menu, necessary permissions, slug for new page, function to output html content\n add_options_page('Word Count Settings', esc_html__('Word Count', 'wcpdomain'), 'manage_options', 'word-count-settings-page', array($this, 'ourHTML'));\n }", "public function add_pages() {\n\t\t$admin_page = add_theme_page( __('Theme Options'), __('Theme Options'), 'manage_options', 'eaboot_options', array(&$this, 'display_page'));\n\n\t\tadd_action('admin_print_scripts-' . $admin_page, array(&$this, 'scripts'));\n\t\tadd_action('admin_print_styles-' . $admin_page, array(&$this, 'styles'));\n\t}", "function __construct(){\n\t\t\trequire_once('class-sp-theme-admin.php');\n\t\t\t$this->admin = new SP_THEME_ADMIN;\n\n\t\t\t/* LOAD ASSETS */\n\t\t\tadd_action('wp_enqueue_scripts', array( $this, 'assets' ) );\n\n\t\t}", "public function add_page() {\n\t\t\tadd_submenu_page(\n\t\t\t\tWPEX_THEME_PANEL_SLUG,\n\t\t\t\t__( 'Theme Skins', 'wpex' ),\n\t\t\t\t__( 'Theme Skins', 'wpex' ),\n\t\t\t\t'administrator',\n\t\t\t\tWPEX_THEME_PANEL_SLUG .'-skins',\n\t\t\t\tarray( $this, 'create_admin_page' )\n\t\t\t);\n\t\t}", "public function add_plugin_page() {\n add_options_page(\n 'Bing for WordPress', \n 'Bing for WordPress', \n 'manage_options', \n 'bing-for-wordpress-admin', \n array( $this, 'create_admin_page' )\n );\n }", "public static function admin_init() {\n load_plugin_textdomain(MEDIUM_TEXTDOMAIN);\n\n wp_enqueue_script(\"medium_admin_js\", MEDIUM_PLUGIN_URL . \"js/admin.js\", array(), MEDIUM_VERSION);\n wp_enqueue_style(\"medium_admin_css\", MEDIUM_PLUGIN_URL . \"css/admin.css\", array(), MEDIUM_VERSION);\n }", "private function admin_includes() {\n\n\t\t// load admin classes\n\t\t$this->admin = $this->load_class( '/includes/admin/class-wc-pip-admin.php', 'WC_PIP_Admin' );\n\t\t$this->orders_admin = $this->load_class( '/includes/admin/class-wc-pip-orders-admin.php', 'WC_PIP_Orders_Admin' );\n\t}", "public function admin_init() {\n\n\t\t\t$name = $this->options['slug'];\n\t\t\t$this->slug = strtolower(THEME_NAME.'_'.$name);\n\t\t\n\t\t\tadd_option($this->slug.'_fields', '', '', 'yes');\n\t\t\tupdate_option($this->slug.'_fields', $this->options['options']);\n\n\t\t\tadd_action('post_edit_form_tag', array($this, 'set_form_multipart'), 10, 1);\n\t\t\tadd_action('add_meta_boxes'.'_'.$this->screen, array($this, 'register_meta_box'));\n\t\t}", "public function __construct() {\n if(!is_admin()) return;\n // Add menu item\n add_action('admin_menu', [$this, 'add_admin_page']);\n // Register settings\n add_action('admin_init', [$this, 'add_settings']);\n // Make sure we're on the IZA SDG settings page\n if(isset($_GET['page']) && $_GET['page'] === 'iza-sdg') {\n // Register editor style\n add_filter('tiny_mce_before_init', [$this, 'editor_style']);\n }\n }", "public function register()\r\n {\r\n $this->getContainer()->add('RocketLazyLoadPlugin\\Admin\\AdminPage')\r\n ->withArgument($this->getContainer()->get('options'))\r\n ->withArgument($this->getContainer()->get('RocketLazyLoadPlugin\\Options\\OptionArray'))\r\n ->withArgument($this->getContainer()->get('template_path'));\r\n }", "function registerAdminPanels() {\n\t\t// You will need to have a file called \"exampleSettings.php\" in the example\n\t\t// folder for this to register\n\t\t$this->addAdminPanel(array( 'do' \t\t\t=> 'example.exampleSettings', \n\t\t\t\t\t\t\t\t\t'priviledge' \t=> 'admin', \n\t\t\t\t\t\t\t\t\t'anchortext' \t=> 'Hello World!',\n\t\t\t\t\t\t\t\t\t'group'\t\t\t=> 'example',\n\t\t\t\t\t\t\t\t\t'order'\t\t\t=> 1));\n\t\t\n\t\t\t\t\t\t\t\t\t\n\t\treturn;\n\t\t\n\t}", "function admin() {\n \n add_action( 'genesis_theme_settings_metaboxes', array( $this, 'register_metabox' ) );\n add_filter( 'cmb_meta_boxes', array( $this, 'create_metaboxes' ) );\n add_action( 'init', array( $this, 'initialize_cmb_meta_boxes' ), 50 );\n \n }", "private function define_admin_hooks()\n {\n\n $plugin_admin = new myFOSSIL_Resources_Admin( $this->get_plugin_name(),\n $this->get_version() );\n\n $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin,\n 'enqueue_styles' );\n $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin,\n 'enqueue_scripts' );\n\n\t\t$this->loader->add_action( 'admin_menu', $plugin_admin, 'register_menus' );\n\n /* Custom Post Types */\n $this->loader->add_action( 'init', $plugin_admin, 'create_events' );\n\n /* AJAX */\n $this->loader->add_action( 'wp_ajax_myfossil_resources_load_data', $plugin_admin,\n 'ajax_handler' );\n\n /* Advanced Custom Fields */\n\t\t$this->loader->add_filter( 'acf/settings/path', $plugin_admin, 'acf_settings_path' );\n\t\t$this->loader->add_filter( 'acf/settings/dir', $plugin_admin, 'acf_settings_dir' );\n add_filter('acf/settings/show_admin', '__return_false');\n }", "function __construct() {\n add_action( 'admin_menu', [$this, 'register_menu'] );\n }", "public function register() {\n $this->setSettings();\n $this->setSections();\n $this->setFields();\n\n // build the admin menu\n $this->settings->addPages( $this->pages )->withSubPage('Admin')->addSubPages( $this->subpages )->register();\n }", "abstract public function\r\n\t\tget_admin_page_class_name();", "private function set_admin_menu() {\n $TSB_settings_admin_menu = new Admin_Menu( Initial_Value::TSB_main_settings_page() );\n $this->loader->add_action( 'admin_menu', $TSB_settings_admin_menu, 'add_admin_menu_page' );\n\n// $plugin_name_sample_admin_sub_menu1 = new Admin_Sub_Menu( Initial_Value::sample_sub_menu_page1() );\n// $this->loader->add_action( 'admin_menu', $plugin_name_sample_admin_sub_menu1, 'add_admin_sub_menu_page' );\n//\n// $plugin_name_sample_admin_sub_menu2 = new Admin_Sub_Menu( Initial_Value::sample_sub_menu_page2() );\n// $this->loader->add_action( 'admin_menu', $plugin_name_sample_admin_sub_menu2, 'add_admin_sub_menu_page' );\n\n }", "protected function _registerAdminPages()\n \t{\n \t\tadd_submenu_page(\n \t\t\t$this->the_plugin->alias,\n \t\t\t$this->the_plugin->alias . \" \" . __('Media Smushit', $this->the_plugin->localizationName),\n\t __('Media Smushit', $this->the_plugin->localizationName),\n\t 'manage_options',\n\t $this->the_plugin->alias . \"_smushit\",\n\t array($this, 'display_index_page')\n\t );\n\n\t\t\treturn $this;\n\t\t}", "public function admin_bar($wp_admin_bar) {\n $wp_admin_bar->add_menu(array(\n 'parent' => 'new-content',\n 'id' => 'new-h5p-content',\n 'title' => __('H5P Content', $this->plugin_slug),\n 'href' => admin_url('admin.php?page=h5p_new')\n ));\n }", "public function register_admin_menu() {\n\n\t\t\t$page_header_capability = apply_filters( 'astra_page_header_capability', 'edit_theme_options' );\n\n\t\t\tadd_submenu_page(\n\t\t\t\t'themes.php',\n\t\t\t\t__( 'Page Headers', 'astra-addon' ),\n\t\t\t\t__( 'Page Headers', 'astra-addon' ),\n\t\t\t\t$page_header_capability,\n\t\t\t\t'edit.php?post_type=astra_adv_header'\n\t\t\t);\n\t\t}", "public function register() {\n\t\t/*\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t| Codestar Framework option pages\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t|\n\t\t*/\n\n\t\tif (!class_exists('CSF')) {\n\t\t\t$this->wpHelper->WpRegister('plugins/codestar/codestar-framework');\n\t\t\t$this->wpHelper->WpRegister('plugins/codestar/config');\n\t\t}\n\t\t/*\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t| visualcomposer\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t|\n\t\t*/\n\t\t$this->wpHelper->WpRegister('plugins/visualcomposer/Vc');\n\n\t\t/*\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t| Metaboxes\n\t\t\t|--------------------------------------------------------------------------\n\t\t\t|\n\t\t*/\n\t\t$this->wpHelper->WpRegister('plugins/meta-box/meta-box');\n\t\t$this->wpHelper->WpRegister('plugins/meta-box/metaboxes-config');\n\n\t\t/** Add FrontEnd Widget **/\n\t\t$this->wpHelper\n\t\t\t->addWidget(\n\t\t\t\t\\App\\Widgets\\ExampleFrontEndWidget::class\n\t\t\t);\n\n\t\t/** Add Plugin Links to Admin > Plugins Page Entry **/\n\t\t$this->wpHelper\n\t\t\t->addPluginLinks(array(\n\t\t\t\t'<a href=\"admin.php?page=lumen_page\">Settings</a>',\n\t\t\t));\n\t\t/** Add Admin Bar Nodes **/\n\t\t$this->wpHelper\n\t\t\t->addAdminBarNode(\n\t\t\t\tfalse,\n\t\t\t\t'lumen_bar_node2',\n\t\t\t\t'Lumen Bar Node',\n\t\t\t\t'#'\n\t\t\t)->addAdminBarNode(\n\t\t\t'lumen_bar_node2',\n\t\t\t'lumen_bar_node2_child1',\n\t\t\t'Node Child 1',\n\t\t\t'#'\n\t\t)->addAdminBarNode(\n\t\t\t'lumen_bar_node2',\n\t\t\t'lumen_bar_node2_child2',\n\t\t\t'Node Child 2',\n\t\t\t'#'\n\t\t)->addAdminBarNode(\n\t\t\t'lumen_bar_node2',\n\t\t\t'lumen_bar_node2_child3',\n\t\t\t'Node Child 2',\n\t\t\t'#'\n\t\t);\n\n\t\t/** Add Shortcodes **/\n\t\t$this->wpHelper\n\t\t\t->addShortcode(\n\t\t\t\t'auth_register',\n\t\t\t\tfunction ($parameters, $content) {\n\t\t\t\t\treturn $this->app->call('\\App\\Http\\Controllers\\Auth\\RegisterShortcodeController@template', compact('parameters', 'content'));\n\t\t\t\t}\n\t\t\t)\n\t\t\t->addShortcode(\n\t\t\t\t'auth_login',\n\t\t\t\tfunction ($parameters, $content) {\n\t\t\t\t\treturn $this->app->call('\\App\\Http\\Controllers\\Auth\\LoginShortcodeController@template', compact('parameters', 'content'));\n\t\t\t\t}\n\t\t\t);\n\n\t\t/** Add Nav Menu MetaBoxes **/\n\t\t$this->wpHelper->addMetaBox(\n\t\t\t'example_menu_meta_box',\n\t\t\t'Truediv Routes',\n\t\t\tfunction ($object, $arguments) {\n\t\t\t\t$this->lumenHelper\n\t\t\t\t\t->response($this->app->call('\\App\\Http\\Controllers\\ExampleMetaBoxController@menuMetaBox', compact('object', 'arguments')))\n\t\t\t\t\t->sendContent();\n\t\t\t},\n\t\t\t'nav-menus',\n\t\t\t'side',\n\t\t\t'default',\n\t\t\t2\n\t\t);\n\n\t\t/** Add Dashboard Widget **/\n\n\t\t$this->wpHelper\n\t\t\t->addAdminPanel(\n\t\t\t\t'lumen_page',\n\t\t\t\t'Larash',\n\t\t\t\t'Larash',\n\t\t\t\tfunction () {\n\t\t\t\t\t$this->lumenHelper\n\t\t\t\t\t\t->response($this->lumenHelper->view('admin-intro'))\n\t\t\t\t\t\t->sendContent();\n\t\t\t\t},\n\t\t\t\t'manage_options',\n\t\t\t\t'',\n\t\t\t\tnull\n\t\t\t)\n\t\t\t->addAdminSubPanel(\n\t\t\t\t'lumen_page',\n\t\t\t\t'lumen_sub_page',\n\t\t\t\t'WpPost Demo',\n\t\t\t\t'WpPost Demo',\n\t\t\t\tfunction () {\n\t\t\t\t\t$this->lumenHelper\n\t\t\t\t\t\t->response($this->app->call('\\App\\Http\\Controllers\\ExampleAdminController@template'))\n\t\t\t\t\t\t->sendContent();\n\t\t\t\t},\n\t\t\t\t'manage_options'\n\t\t\t)->addAdminSubPanel(\n\t\t\t'lumen_page',\n\t\t\t'lumen_settings',\n\t\t\t'Settings',\n\t\t\t'Settings',\n\t\t\tfunction () {\n\t\t\t\t$this->lumenHelper\n\t\t\t\t\t->response($this->app->call('\\App\\Http\\Controllers\\SettingsController@template'))\n\t\t\t\t\t->sendContent();\n\t\t\t},\n\t\t\t'manage_options'\n\t\t);\n\n\t\t/** Add WP Rest API Route **/\n// $this->wpHelper\n\t\t// ->addRestRoute('wp-lumen/api/v1', '/test', array(\n\t\t// 'methods' => ['get'],\n\t\t// 'callback' => function(){\n\t\t// return $this->app->call('\\App\\Http\\Controllers\\ExampleWpRestRouteController@get');\n\t\t// },\n\t\t// ));\n\n\t\t/** Add CSS & Scripts **/\n\t\t$this->wpHelper\n\t\t\t->enqueueStyle(\n\t\t\t\t'lumen',\n\t\t\t\t$this->lumenHelper->asset('resources/assets/build/Main.css'),\n\t\t\t\tarray(),\n\t\t\t\t'1.0.0',\n\t\t\t\t'all'\n\t\t\t)\n\t\t\t->enqueueScript(\n\t\t\t\t'lumen',\n\t\t\t\t$this->lumenHelper->asset('resources/assets/build/Main.js'),\n\t\t\t\tarray('jquery'),\n\t\t\t\t'1.0.0',\n\t\t\t\ttrue\n\t\t\t)\n\n\t\t// admin\n\t\t\t->enqueueStyle('datatablecss', $this->lumenHelper->asset('resources/assets/src/admin/datatables/datatables.min.css'), array(), '1.0.0', 'all', 'admin')\n\t\t\t->enqueueScript('datatablejs', $this->lumenHelper->asset('resources/assets/src/admin/datatables/datatables.min.js'), array('jquery'), '1.0.0', true, 'admin');\n\n\t}", "public function page_setup(){\n add_menu_page( PLUGIN_NAME, PLUGIN_NAME, 'manage_options', sanitize_key(PLUGIN_NAME), array($this, 'admin_page'), $this->icon, 3 );\n }", "public function __construct(){\n add_action( 'admin_enqueue_scripts', array( &$this,'admin_scripts' ) );\n \n }", "function register_plugin_page(){\n wp_create_category('casoClinico');\n add_menu_page( 'Admin Quiz', 'Admin Quiz', 'edit_others_posts', __DIR__.'/views/admin/quizAdmin.php', '','dashicons-welcome-write-blog' );;\n}", "public static function createAdmin()\r\n\t{\r\n\t\treturn new Admin();\r\n\t}", "public function __construct() {\n\t\tnew PageHooks();\n\t\tif ( is_admin() ) {\n\t\t\tnew LeadinAdmin();\n\t\t}\n\t}", "function admin_landing_page() {\n add_menu_page( 'Welcome | All Cycles Admin', 'Welcome', 'manage_options', 'admin_landing_page', 'create_admin_page', 'dashicons-menu', 5 );\n}", "public function acfedu_add_admin_pages() {\n\t\t\t\tadd_options_page( 'ACF Faculty Selector', 'Faculty Selector', 'manage_options', 'acfedu-options', 'acfedu_options' );\n\t\t\t\tadd_submenu_page( null, 'Settings', 'Settings', 'manage_options', 'acfedu-settings', 'acfedu_settings' );\n\t\t\t\tadd_submenu_page( null, 'Pro', 'Pro', 'manage_options', 'acfedu-pro', 'acfedu_pro' );\n\t\t\t}", "public function __construct() {\n \tadd_action( 'admin_menu', array( $this, 'create_plugin_settings_page' ) );\n }", "public static function add_admin_menu() {\n\t\t\tadd_menu_page(\n\t\t\t\tesc_html__( 'Theme Settings', 'text-domain' ),\n\t\t\t\tesc_html__( 'Theme Settings', 'text-domain' ),\n\t\t\t\t'manage_options',\n\t\t\t\t'theme-settings',\n\t\t\t\tarray( 'IODD_Theme_Options', 'create_admin_page' )\n\t\t\t);\n\t\t}", "function add_to_admin_body_class($classes) {\n\t\t// get the global post variable\n\t\tglobal $post;\n\t\t// instantiate, should be overwritten\n\t\t$mode = '';\n\t\t// get the current page's URI (the part /after/ your domain name)\n\t\t$uri = $_SERVER[\"REQUEST_URI\"];\n\t\t// get the post type from WP\n\t\t$post_type = get_post_type($post->ID);\n\t\t// set the $mode variable to reflect the editorial /list/ page...\n\t\tif (strstr($uri,'edit.php')) {\n\t\t\t$mode = 'edit-list-';\n\t\t}\n\t\t// or the actual editor page\n\t\tif (strstr($uri,'post.php')) {\n\t\t\t$mode = 'edit-page-';\n\t\t}\n\t\t// append our new mode/post_type class to any existing classes\n\t\t$classes .= $mode . $post_type;\n\t\t// and send them back to WP\n\t\treturn $classes;\n\t}", "function __construct()\n {\n if( is_admin()) {\n add_action( 'admin_enqueue_scripts', array( &$this, 'rsg_load_admin_script' ) );\n }\n\n // add_submenu_page('edit.php?post_type=cities', __('Test Settings','menu-test'), __('Test Settings','menu-test'), 'manage_options', 'testsettings', 'mt_settings_page');\n\n add_action( 'init', array( $this, 'custom_post_type'), 0 );\n // add_action( 'add_meta_boxes_city', array( $this, 'adding_custom_meta_boxes') );\n add_action('add_meta_boxes', array( $this, 'add_custom_meta_boxes'), 10, 2);\n add_action('save_post_cities', array( $this, 'get_meta_save'));\n\n register_activation_hook( _FILE_, array($this,'insert_page'));\n }", "private function define_admin_hooks()\n {\n $this->loader->add_action('init',$this,'load_options');\n $this->loader->add_action('plugins_loaded','WordPress_Reactro_Admin', 'load_framework');\n }", "protected function _registerAdminPages()\n \t{\n \t\tif ( $this->the_plugin->capabilities_user_has_module('google_pagespeed') ) {\n\t \t\tadd_submenu_page(\n\t \t\t\t$this->the_plugin->alias,\n\t \t\t\t$this->the_plugin->alias . \" \" . __('PageSpeed Insights', 'psp'),\n\t\t __('PageSpeed Insights', 'psp'),\n\t\t 'read',\n\t\t $this->the_plugin->alias . \"_PageSpeedInsights\",\n\t\t array($this, 'display_index_page')\n\t\t );\n \t\t}\n\n\t\t\treturn $this;\n\t\t}", "public function admin_page()\n {\n }", "public function admin_page()\n {\n }", "public function register_admin_menu(){\r\n $all_modules = HW_TGM_Module_Activation::get_register_modules();\r\n $module = $this->_option('module');\r\n $name = $module->module_name;\r\n $label = isset($all_modules[$name])? $all_modules[$name]['name'] : $name;\r\n\r\n $this->add_help_content(self::load_settings_page_hook_slug(HW_Module_Settings_page::PAGE_SLUG) ,$name , $label);\r\n }", "public static function register() {\n\t\t$plugin = new self();\n\n\t\t// Return data to AJAX.\n\t\tadd_action( 'wp_ajax_conf_sch_get_users', [ $plugin, 'ajax_get_users' ] );\n\t\tadd_action( 'wp_ajax_conf_sch_get_terms', [ $plugin, 'ajax_get_terms' ] );\n\t\tadd_action( 'wp_ajax_conf_sch_get_posts', [ $plugin, 'ajax_get_posts' ] );\n\t\tadd_action( 'wp_ajax_conf_sch_get_group_events', [ $plugin, 'ajax_get_group_events' ] );\n\t\tadd_action( 'wp_ajax_conf_sch_clear_proposal_cache', [ $plugin, 'ajax_clear_proposal_cache' ] );\n\n\t\t// Add styles and scripts for the tools page.\n\t\tadd_action( 'admin_enqueue_scripts', [ $plugin, 'enqueue_styles_scripts' ], 20 );\n\n\t\t// Add regular settings page.\n\t\tadd_action( 'admin_menu', [ $plugin, 'add_subpages' ] );\n\n\t\t// Register our settings.\n\t\tadd_action( 'admin_init', [ $plugin, 'register_settings' ], 1 );\n\n\t\t// Add our settings meta boxes.\n\t\tadd_action( 'admin_head-schedule_page_conf-schedule-settings', [ $plugin, 'add_settings_meta_boxes' ] );\n\n\t\t// Add admin notices.\n\t\tadd_action( 'admin_notices', [ $plugin, 'print_admin_notice' ] );\n\n\t\t// Add meta boxes.\n\t\tadd_action( 'add_meta_boxes', [ $plugin, 'add_meta_boxes' ], 1, 2 );\n\t\tadd_action( 'edit_form_after_title', [ $plugin, 'print_meta_boxes_after_title' ], 0 );\n\n\t\t// Save meta box data.\n\t\tadd_action( 'save_post', [ $plugin, 'save_meta_box_data_pre' ], 0, 3 );\n\t\tadd_action( 'save_post', [ $plugin, 'save_meta_box_data' ], 20, 3 );\n\n\t\t// Set it up so we can do file uploads.\n\t\tadd_action( 'post_edit_form_tag', [ $plugin, 'post_edit_form_tag' ] );\n\n\t\t// Add custom columns.\n\t\tadd_filter( 'manage_posts_columns', [ $plugin, 'add_posts_columns' ], 10, 2 );\n\n\t\t// Populate our custom admin columns.\n\t\tadd_action( 'manage_schedule_posts_custom_column', [ $plugin, 'populate_posts_columns' ], 10, 2 );\n\t\tadd_action( 'manage_speakers_posts_custom_column', [ $plugin, 'populate_posts_columns' ], 10, 2 );\n\n\t\t// Populate ACF field choices.\n\t\tadd_filter( 'acf/load_field/name=proposal', [ $plugin, 'load_proposal_field_choices' ] );\n\t\tadd_filter( 'acf/load_field/name=sponsor', [ $plugin, 'load_sponsor_field_choices' ] );\n\n\t\t// Process downloads.\n\t\tadd_action( 'admin_init', [ $plugin, 'process_dwnld_session_info' ] );\n\t\tadd_action( 'admin_init', [ $plugin, 'process_dwnld_hootsuite_template' ] );\n\n\t}", "public function addAdminMenu()\n\t {\n\t add_menu_page('Create Metas', 'Create Metas', 'manage_options', 'create-metas', array( $this, 'optionsPage' ), 'dashicons-admin-tools', 66 );\n\t }", "private function admin_includes() {\n\n\t\t// admin\n\t\t$this->admin = $this->load_class( '/includes/admin/class-wc-cog-admin.php', 'WC_COG_Admin' );\n\n\t\t// reports\n\t\t$this->admin_reports = $this->load_class( '/includes/admin/class-wc-cog-admin-reports.php', 'WC_COG_Admin_Reports' );\n\n\t\t// import/export handler\n\t\t$this->import_export_handler = $this->load_class( '/includes/class-wc-cog-import-export-handler.php', 'WC_COG_Import_Export_Handler' );\n\t}", "public function register()\n {\n\n if( ! $this->activated( 'cf_manager' ) ) return;\n\n\n $this->settings = new SettingsApi();\n\n $this->callbacks = new AdminCallbacks();\n\n $this->cf_callbacks = new CfCallbacks();\n\n $this->setSubpages();\n\n $this->metaBoxes = array();\n\n\n $this->setSettings();\n $this->setSections();\n $this->setFields();\n\n\n $this->settings->addSubPages( $this->subpages )->register();\n\n\n $this->showPosts();\n\n if( ! empty( $this->metaBoxes ) ) {\n\n add_action( 'add_meta_boxes', array( $this, 'addMultipleMetaBoxes' ) );\n\n }\n\n }", "public function admin_setup()\n\t{\n\t\t\n\t}", "function admin_init()\n {\n }", "public function adminMenu()\r\n {\r\n add_meta_box('wpGoogleMaps', 'Google Maps for WordPress', array($this, 'insertForm'), 'post', 'normal');\r\n add_meta_box('wpGoogleMaps', 'Google Maps for WordPress', array($this, 'insertForm'), 'page', 'normal');\r\n if ( function_exists('add_submenu_page') ) {\r\n $page = add_submenu_page('plugins.php', __('wpGoogleMaps Configuration'), __('wpGoogleMaps Configuration'), 'manage_options', 'wpGoogleMaps-config', array($this, 'configPage'));\r\n add_action( 'admin_print_scripts-'.$page, array($this, 'printScripts') );\r\n }\r\n }", "function adminer_object() {\r\n include_once \"./plugins/plugin.php\";\r\n \r\n // autoloader\r\n foreach (glob(\"plugins/*.php\") as $filename) {\r\n include_once \"./$filename\";\r\n }\r\n \r\n $plugins = array(\r\n // specify enabled plugins here\r\n // new AdminerDumpXml,\r\n // new AdminerTinymce,\r\n // new AdminerFileUpload(\"data/\"),\r\n // new AdminerSlugify,\r\n // new AdminerTranslation,\r\n // new AdminerForeignSystem,\r\n // new AdminerLoginPasswordLess(password_hash(\"\", PASSWORD_DEFAULT)),\r\n );\r\n \r\n /* It is possible to combine customization and plugins:\r\n class AdminerCustomization extends AdminerPlugin {\r\n }\r\n return new AdminerCustomization($plugins);\r\n */\r\n class AdminerCustomization extends AdminerPlugin {\r\n function login($login, $password) {\r\n // validate user submitted credentials\r\n return true;\r\n }\r\n }\r\n return new AdminerCustomization($plugins);\r\n \r\n // return new AdminerPlugin($plugins);\r\n}", "public function addAdminMenuEntries(): void {\n foreach ($this->adminPages as $page) {\n (new $page($this->container));\n }\n }", "public function load_admin_page()\n {\n include 'admin-page.html';\n }", "function __construct() {\n\t\t\n\t\t// Add hooks.\n\t\tadd_action( 'admin_menu', \t\t\t\tarray( $this, 'admin_menu' ) );\n\t\tadd_action( 'admin_enqueue_scripts',\tarray( $this, 'admin_enqueue_scripts' ) );\n\t\tadd_action( 'admin_body_class', \t\tarray( $this, 'admin_body_class' ) );\n\t}", "function wpms_classifieds_init() {\n\tregister_activation_hook ( __FILE__, 'wpms_classifieds_build_permissions' );\n//\tif (isset($_GET['page']) && $_GET['page'] == 'settings_page_wp-multilingual-slider') {\n// \t add_action('admin_init', 'wpms_register');\n//\t}\n\tadd_action('admin_init', 'wpms_init');\n\tadd_action('admin_init', 'wpms_register_mysettings');\n\tadd_action('admin_menu', 'wpms_home_create_menu');\n//\tload_plugin_textdomain( 'wp-multilingual-slider', 'wp-content/plugins/wp-multilingual-slider/languages/');\n}", "public function __construct() {\n\n\t\t\t// Call to admin page render function and register new settings \n\t\t\tif ( is_admin() ) {\t\n\t\t\t\tadd_action( 'admin_init', array( 'ELMT_theme_options', 'register_settings' ) );\n\t\t\t}\n\n\t\t}", "function admin_menu() {\n\t\tif ( class_exists( 'Jetpack' ) )\n\t\t\tadd_action( 'jetpack_admin_menu', array( $this, 'load_menu' ) );\n\t\telse\n\t\t\t$this->load_menu();\n\t}" ]
[ "0.7339452", "0.72882724", "0.712093", "0.6799967", "0.6779054", "0.6738659", "0.6655753", "0.6629349", "0.66095227", "0.6414337", "0.64028126", "0.63994914", "0.6372456", "0.6367179", "0.633664", "0.6325589", "0.6311613", "0.6310715", "0.6301967", "0.62916535", "0.62611717", "0.62607497", "0.6222913", "0.6180629", "0.617311", "0.6167768", "0.61598104", "0.615918", "0.6146941", "0.6124743", "0.61244094", "0.6118243", "0.61149406", "0.6099599", "0.60836995", "0.60808176", "0.60769606", "0.6061727", "0.6048207", "0.603824", "0.6003485", "0.5989658", "0.59842986", "0.5983098", "0.59791505", "0.597913", "0.59778476", "0.59732604", "0.5939346", "0.5933784", "0.59298587", "0.5924293", "0.5916945", "0.5912573", "0.5905563", "0.58991796", "0.5892373", "0.58725816", "0.58642083", "0.58585227", "0.5847946", "0.5846349", "0.5841282", "0.5840928", "0.58407617", "0.58399624", "0.58398974", "0.583883", "0.58372384", "0.5827", "0.58116215", "0.581102", "0.5808289", "0.58078957", "0.5807353", "0.5806886", "0.58017254", "0.5801201", "0.57967573", "0.57954407", "0.5793094", "0.5792182", "0.5790363", "0.5787886", "0.5787886", "0.57774734", "0.57748014", "0.5773421", "0.5771319", "0.57713014", "0.5764662", "0.57640386", "0.57606846", "0.57548684", "0.5751026", "0.5745816", "0.5735956", "0.5730171", "0.5729975", "0.5722237" ]
0.71028244
3
Retrieves a registered WP Framework class.
function wpf_get_class( $class ) { global $wpf_classes; if ( isset($wpf_classes[$class]) ) return $wpf_classes[$class]; if ( isset($wpf_classes['admin'][$class]) ) return $wpf_classes['admin'][$class]; if ( isset($wpf_classes['static'][$class]) ) return $wpf_classes['static'][$class]; if ( isset($wpf_classes['autoload'][$class]) ) return $wpf_classes['autoload'][$class]; if ( isset($wpf_classes['contextual'][$class]) ) return $wpf_classes['contextual'][$class]; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_theme_framework() {\n\treturn \\Classy\\Classy::get_instance();\n}", "function WPF() {\n\tglobal $wpf_classes;\n\n\t$theme_class = wpf_get_class( 'theme' );\n\n\treturn $wpf_classes['theme'] = new $theme_class;\n}", "public function fetch_class()\n\t{\n\t\treturn $this->route_stack[self::SEG_CLASS];\n\t}", "public function get_class()\n {\n return $this->class;\n }", "public function getApiClass(): string\n {\n return $this->apiClass;\n }", "public static function get_class(){\n return self::class;}", "public static function getClass()\n {\n return get_class(new static);\n }", "public static function getHandlerClass(): string;", "public function getFramework() {\r\n\t\treturn $this->context->getState('framework');\r\n\t}", "public function getClass(): ?string\r\n {\r\n return $this->class;\r\n }", "public static function getClass()\n {\n $type = explode('\\\\', get_called_class());\n\n return $type[count($type) - 1];\n }", "public function getFeatureClass ($feature);", "function get_class() {\n\t\t$args = func_get_args();\n\t\treturn strtolower(call_user_func_array(\"get_class\", $args));\n\t}", "protected function getApiClass(): string {\n\t\treturn ExternalReference::class;\n\t}", "function getClass() {\n\t\treturn $this->classname ? $this->classname : \"theme\".\"1\";//rand(1, 6);\n\t}", "function acf_get_instance($class = '')\n{\n}", "function getReflectionClass();", "function get_class($classid){\r\n\t\r\n}", "public static function __getClass()\n {\n return __CLASS__;\n }", "protected function getClass()\n {\n return __CLASS__;\n }", "protected function getApiClass(): string {\n\t\treturn CurrentUser::class;\n\t}", "public function getClass() : ?string\n {\n\n return $this->parsed['class'];\n }", "public function getClass() {\n\t\t$classPath = explode('\\\\', get_class());\n\t\treturn end($classPath);\n\t}", "public function getClass() {\n\t\t$classPath = explode('\\\\', get_class());\n\t\treturn end($classPath);\n\t}", "public function getClass()\n {\n if (is_null($this->_class)) {\n $this->_class = $this->_getClassName();\n }\n return $this->_class;\n }", "public static function getTheme()\n {\n $className = static::getCalledClass();\n while (!StringHandler::endsWith($className, \"App\")) {\n $className = get_parent_class($className);\n if ($className === false) {\n $className = \"\";\n break;\n }\n if (strpos($className, \"\\\\\") !== 0) {\n $className = \"\\\\\" . $className;\n }\n }\n $theme = Kernel::getService('em')\n ->getRepository('RZ\\Roadiz\\Core\\Entities\\Theme')\n ->findOneBy(['className' => $className]);\n return $theme;\n }", "function wpt_autoload($class)\n{ \n //if( strpos($class, 'WPtheme\\\\') !== 0 ) return;\n if( 0 !== strpos($class, 'WPTheme\\\\') OR strlen($class) <= 8 ) return;\n\n $class = substr($class, 8);\n \n $library = THEME_DIR . '/library';\n\n if( $class === 'Theme' )\n {\n require $library . '/theme.php';\n return;\n }\n\n $path = $library . '/classes/' . str_replace('\\\\','/',strtolower($class)) . '.php';\n\n if( is_file($path) ) \n { \n require $path;\n }\n\n}", "public function fetchClass()\n {\n return $this->class;\n }", "public static function __getClass()\r\n\t{\r\n\t\treturn __CLASS__;\r\n\t}", "public function getClass(): ReflectionClass;", "function wpf_autoload_classes() {\n\tglobal $wpf_classes;\n\n\tif ( isset( $wpf_classes['autoload'] ) ) {\n\t\tforeach ( (array) $wpf_classes['autoload'] as $handle => $class ) {\n\t\t\tif ( !isset($wpf_classes[$handle]) ) {\n\t\t\t\t$wpf_classes[$handle] = new $class;\n\t\t\t}\n\t\t}\n\t}\n}", "public function getClass(string $class);", "function get_instance($class)\n {\n }", "public function GetControllerClass ();", "protected function getPaymentPluginClass()\r\n {\r\n return get_called_class();\r\n }", "public static function getClassName(){\n $parts = explode('\\\\', static::class);\n return end($parts);\n }", "public function get_class() {\n\t\tif ( ! $this->is_class_set ) {\n\t\t\t$this->set_class( $this->derive_class() );\n\t\t}\n\t\treturn $this->class;\n\t}", "function wpf_register_class( $handle, $class, $autoload = false ) {\n\tglobal $wpf_classes;\n\n\t$type = $autoload ? 'autoload' : 'static';\n\n\t$wpf_classes[$type][$handle] = $class;\n\n\treturn $wpf_classes[$type][$handle];\n}", "public function getResourceClass();", "public function getReflectionClass();", "protected static function getSingletonClass()\n {\n return get_called_class();\n }", "private function get_serviceClass()\n\t{\n\t\treturn $this->m_serviceClass;\n\t}", "function blank_theme_get_theme_instance() {\n\treturn Blank_Theme\\Inc\\Blank_Theme::get_instance();\n}", "public function getClass(): string\n {\n return $this->class;\n }", "public static function get_class_post_type()\n {\n return self::$post_type;\n }", "public static function get_class_post_type()\n {\n return self::$post_type;\n }", "public function getClass($name = null);", "public function getTemplateClass();", "protected function getClassLoaderService()\n {\n $this->services['class_loader'] = $instance = new \\phpbb\\class_loader('phpbb\\\\', './../includes/', 'php');\n\n $instance->register();\n $instance->set_cache(${($_ = isset($this->services['cache.driver']) ? $this->services['cache.driver'] : ($this->services['cache.driver'] = new \\phpbb\\cache\\driver\\file())) && false ?: '_'});\n\n return $instance;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "final public static function getClass(){\n return get_called_class();\n }", "public function getClass() {\n \treturn $this->_class;\n }", "public static function getClass() {\n return Singleton::$_class;\n }", "public static function inst()\n {\n return static::get_one(__CLASS__);\n }", "function GetClass() {\n\t\tswitch($this->type) {\n\t\t\tcase BLOCK_PAGE: return \"page\";\n\t\t\tcase \"T_FUNCTION\": return \"function\";\n\t\t\tcase \"T_CLASS\": return \"class\";\n\t\t\tcase \"T_INTERFACE\": return \"interface\";\n\t\t\tcase \"T_STRING\": return \"define\";\n\t\t\tcase \"T_INCLUDE\": case \"T_INCLUDE_ONCE\": case \"T_REQUIRE\": case \"T_REQUIRE_ONCE\": return \"include\";\n\t\t}\n\t\treturn \"\";\n\t}", "public function getClass()\n {\n return $this->class;\n }", "public function GetToolClass ();", "public function getClass() {\n return $this->class;\n }", "function Themecloud() {\n return Themecloud::getInstance();\n}", "public function getProviderClass(): ?string;", "public static function requestClass(): string;", "function getClass();", "function wpt()\n{\n return \\WPTheme\\Theme::instance();\n}", "public static function getWebsiteClassPrefix()\r\n {\r\n return self::$placeholderClassPrefixes[1];\r\n }", "public function getClass() {\r\n\t\treturn $this->class;\r\n\t}", "public function getClass()\n {\n \treturn $this->class;\n }", "public function getFamilyClass() {}", "public static function getInternalClass();", "public function getClass()\n\t{\n\t\treturn $this->_class;\n\t}", "public function getClass()\n\t{\n\t\treturn $this->_class;\n\t}", "function getClass(){\n\t\treturn $this->_class;\n\t}", "function bp_theme_autoloader($class) {\n\n if (strpos($class,'Theme') !== 0) {return false;}\n $class = str_replace('Theme\\\\','',$class);\n $file = strtolower(str_replace('\\\\','-',$class));\n $file = str_replace('_','-',$file);\n $file = array_unique(explode('-',$file));\n $file = implode('-',$file);\n $file = get_template_directory() . '/inc/' . $file;\n $file .= '.php';\n require $file;\n\n}", "public function class()\n {\n // @codingStandardsIgnoreLine\n return $this->class ?? \"\";\n }", "public function getFactoryClass($class) {\n\t\treturn isset($this->map[$class]) ? $this->map[$class] : null;\n\t}", "public function getType()\n {\n return new ReflectionClass($this);\n }", "public function getType()\n {\n return new ReflectionClass($this);\n }", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "protected function getFacadeClass()\n {\n return Httplug::class;\n }", "function getJSClass() {\n\t\treturn '$.pkp.classes.features.InfiniteScrollingFeature';\n\t}", "private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}", "static public function getClass();", "public static function staticGetClassName()\n {\n return __CLASS__;\n }", "public function GetRouterClass ();" ]
[ "0.7011855", "0.640041", "0.6098989", "0.60446626", "0.60026187", "0.59867233", "0.59741884", "0.59540665", "0.5922518", "0.5904633", "0.5895844", "0.5883491", "0.5873019", "0.58629584", "0.5801695", "0.5786168", "0.5783887", "0.578086", "0.5745775", "0.57083106", "0.5707408", "0.56996113", "0.5696194", "0.5696194", "0.56925935", "0.5686693", "0.5683955", "0.5672231", "0.5667377", "0.56564164", "0.56530815", "0.5649274", "0.56417894", "0.5629381", "0.56265444", "0.56012726", "0.5589552", "0.5585662", "0.5565675", "0.5561797", "0.55459625", "0.5537634", "0.5536934", "0.55357444", "0.55185664", "0.55185664", "0.5512646", "0.55085576", "0.5505957", "0.5504135", "0.5504135", "0.5504135", "0.5504135", "0.5504135", "0.5504135", "0.5504135", "0.5504135", "0.5504135", "0.5504135", "0.5504135", "0.5504135", "0.5504135", "0.54933155", "0.54916936", "0.5487904", "0.54857904", "0.54801005", "0.5479964", "0.5477293", "0.54768705", "0.54756594", "0.54753214", "0.5472466", "0.54690677", "0.5467208", "0.54657394", "0.5460593", "0.54530996", "0.5448203", "0.5445736", "0.54398733", "0.54398733", "0.5438815", "0.5438351", "0.5434472", "0.54330033", "0.5419493", "0.5419493", "0.5402213", "0.5402213", "0.5402213", "0.5402213", "0.5402213", "0.5402213", "0.5397834", "0.5389004", "0.5387756", "0.53869605", "0.5385759", "0.53857255" ]
0.65581596
1
Loops through all the registered autoloaded classes and instantiates them.
function wpf_autoload_classes() { global $wpf_classes; if ( isset( $wpf_classes['autoload'] ) ) { foreach ( (array) $wpf_classes['autoload'] as $handle => $class ) { if ( !isset($wpf_classes[$handle]) ) { $wpf_classes[$handle] = new $class; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loadAllClassesIncrementally()\n {\n }", "public function loadClasses(){\n spl_autoload_register(function($className){\n require_once preg_replace(\"/\\\\\\\\/\", \"/\", $className).\".php\";\n });\n }", "public static function init() {\r\n\t\r\n\t\tforeach(self::$_classes as $var=>$class) {\r\n\t\t\t\t\r\n\t\t\t$$var = new $class();\r\n\t\t}\r\n\t}", "private function init()\n\t{\n\t\tforeach (isLoadedClass() as $objName)\n\t\t{\n\t\t\t$this->$objName =& loadClass('', '', $objName);\n\t\t}\n\t}", "private function loadClasses()\n\t\t{\n\t\t\t// foreach($GLOBALS['classes'] as $var => $class)\n\t\t\t// {\n\t\t\t\t// $this->$var = $class;\n\t\t\t// }\n\t\t\t\n\t\t\t// $this->load = _new('loader');\n\t\t\t\n\t\t\t/** Registramos todos os objetos que serão necessários **/\n\t\t\tforeach(Registry::getAll() as $var => $object)\n\t\t\t{\n\t\t\t\t$this->$var = $object;\n\t\t\t}\n\t\t\t\n\t\t\t// E também a classe loader\n\t\t\t$this->load = Registry::get('loader');\n\t\t}", "public static function load()\n {\n spl_autoload_register(array('AutoLoader', 'autoloadGenericClasses'));\n spl_autoload_register(array('AutoLoader', 'autoloadPhpdocx'));\n spl_autoload_register(array('AutoLoader', 'autoloadLog4php'));\n spl_autoload_register(array('AutoLoader', 'autoloadZetaComponents'));\n spl_autoload_register(array('AutoLoader', 'autoloadTcpdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadPdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadDompdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadMht'));\n }", "private function loadClass() {\n $this->_instances = array();\n\n $this->_instances['log'] = new Log();\n if(ENVIRONMENT == self::ENVIRONMENT_DEV) {\n $this->_instances['debug'] = new Debug();\n $this->_instances['panel'] = new Panel();\n }\n $this->_instances['controller'] = null;\n $this->_instances['configuration'] = new Configuration();\n $this->_instances['routing'] = new Routing();\n }", "public static function load()\n {\n spl_autoload_register(array('AutoLoader', 'autoloadGenericClasses'));\n }", "public function load(): void\n {\n $requested = 0;\n $loaded = 0;\n foreach ($this->storage->loadClassList() as $class) {\n ++$requested;\n if ($this->accept($class) && !class_exists($class, false)) {\n ++$loaded;\n if ($this->verbose) {\n echo \"[Preloader] Loading {$class}\" . PHP_EOL;\n }\n class_exists($class, true);\n }\n }\n\n if ($this->verbose) {\n echo \"[Preloader] Preloaded {$loaded}/{$requested} classes\" . PHP_EOL;\n }\n }", "public static function autoload() {\n // autoload\n include('cache/classes.yml.php');\n foreach($return as $class) {\n require_once($class);\n }\n }", "protected function loadClassFiles() {}", "public function init()\n {\n // Register the loader method\n spl_autoload_register(array(__CLASS__, '_loadClasses'));\n }", "public static function autoload()\n {\n spl_autoload_register(array(__CLASS__,'load'));\n }", "protected abstract function registerClasses(): void;", "protected function getRegisteredClasses() {}", "public static function init_autoload() {\n spl_autoload_register(function ($class) {\n self::autoload_path($class);\n });\n }", "static public function autoload() {\n spl_autoload_register(array(__CLASS__, 'loader'));\n }", "function autoloader($class_name) {\n\n $array_paths = [\n '/models/',\n '/components/',\n '/controllers/',\n ];\n\n foreach ($array_paths as $path) {\n\n $path = ROOT . $path . $class_name . '.php';\n\n if (is_file($path)) {\n include_once $path;\n }\n }\n}", "public static function registerClassLoadingInformation() {}", "function classes() {\n\tcore();\n}", "public static function AutoLoad(){\n spl_autoload_register(function ($file_name){\n $name = preg_replace('~(.*[\\\\\\\\]([A-Z]\\w+))~im', '$2', $file_name);\n MyAutoload::loadControllers($name);//'HomeController'\n MyAutoload::loadModules($name);//'Controller'\n MyAutoload::loadModules($name);//'Model'\n MyAutoload::loadModules($name);//'Config'\n MyAutoload::loadModels($name);//'Tasks'\n MyAutoload::loadRoutes();//'Tasks'\n });\n }", "public static function load_extra_classes() {\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-elementor.php';\n\t\tElementor::init();\n\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-woo.php';\n\t\tWoo::init();\n\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-facebook.php';\n\t\tFacebook::init();\n\t}", "public function load()\n {\n if( $this->autoload ) {\n $loader = new BasePathClassLoader( $this->paths );\n $loader->useEnvPhpLib();\n $loader->register();\n }\n\n foreach( $this->paths as $path ) {\n $di = new RecursiveDirectoryIterator($path);\n $ita = new RecursiveIteratorIterator($di);\n $regex = new RegexIterator($ita, '/^.+\\.php$/i', \n RecursiveRegexIterator::GET_MATCH);\n\n foreach( $regex as $matches ) foreach( $matches as $match ) {\n try {\n require_once $match;\n } \n catch ( Exception $e ) {\n echo \"$match class load failed.\\n\";\n }\n }\n }\n }", "function __autoload($classname)\n {\n classesAutoload($classname);\n }", "private function _autoloadPluginClasses(BasePlugin $plugin)\n\t{\n\t\tforeach ($this->autoloadClasses as $classSuffix)\n\t\t{\n\t\t\t// *Controller's live in controllers/, etc.\n\t\t\t$classSubfolder = mb_strtolower($classSuffix).'s';\n\t\t\t$classes = $this->getPluginClasses($plugin, $classSubfolder, $classSuffix, true);\n\n\t\t\tif ($classSuffix == 'Service')\n\t\t\t{\n\t\t\t\t$this->_registerPluginServices($classes);\n\t\t\t}\n\t\t}\n\t}", "function class_autoloader($class_name) {\n include 'classes/' .$class_name . '.php';\n}", "public function registerAutoloader(): void\n {\n spl_autoload_register(function(string $class_name): void {\n if (!strpos($class_name, \"Factory\")) {\n return;\n }\n $len = strlen($class_name);\n $facLen = strlen(\"Factory\");\n\n if (substr($class_name, $len - $facLen) !== \"Factory\") {\n return;\n }\n\n // Check if this is a namespace that Magento will create factories for\n $namespaces = static::getModuleNamespaces();\n $validNamespace = false;\n foreach ($namespaces as $namespace) {\n if (strpos($class_name, $namespace) === 0) {\n $validNamespace = true;\n break;\n }\n }\n\n if (!$validNamespace) {\n return;\n }\n\n // Get the class's base name\n $base = substr($class_name, 0, $len - $facLen);\n\n if (!class_exists($base)) {\n return;\n }\n\n $this->createMockFactory($base);\n });\n }", "protected function loadAutoloader()\n {\n new Autoloader();\n }", "public function load()\n {\n $this->_retrievedFiles = $this->getRetrievedFiles();\n $this->_loadedClasses = [];\n\n $manifestRepository = $this->_registry->getManifestRepository();\n $providerRepository = $this->_registry->getProviderRepository();\n\n $loadedClasses = [];\n\n // loop through files and find the classes declared by loading the file\n foreach ($this->_retrievedFiles as $file) {\n if(is_dir($file)) {\n continue;\n }\n\n $classesLoadedBefore = get_declared_classes();\n $oldLevel = error_reporting(E_ALL | ~E_STRICT); // remove strict so that other packages wont throw warnings\n // should we lint the files here? i think so\n include_once $file;\n error_reporting($oldLevel); // restore old error level\n $classesLoadedAfter = get_declared_classes();\n $loadedClasses = array_merge($loadedClasses, array_diff($classesLoadedAfter, $classesLoadedBefore));\n }\n\n // loop through the loaded classes and ensure that\n foreach ($loadedClasses as $loadedClass) {\n\n // reflect class to see if its something we want to load\n $reflectionClass = new ReflectionClass($loadedClass);\n if ($reflectionClass->implementsInterface('Zend_Tool_Framework_Manifest_Interface')\n && !$reflectionClass->isAbstract())\n {\n $manifestRepository->addManifest($reflectionClass->newInstance());\n $this->_loadedClasses[] = $loadedClass;\n }\n\n if ($reflectionClass->implementsInterface('Zend_Tool_Framework_Provider_Interface')\n && !$reflectionClass->isAbstract()\n && !$providerRepository->hasProvider($reflectionClass->getName(), false))\n {\n $providerRepository->addProvider($reflectionClass->newInstance());\n $this->_loadedClasses[] = $loadedClass;\n }\n\n }\n\n return $this->_loadedClasses;\n }", "function spl_autoload_register($class_name)\n{\n try {\n include $class_name . '.php';\n include $class_name . '_db.php';\n include 'model/classes/' . $class_name . '.php';\n include 'model/' . $class_name . '.php';\n include 'model/' . $class_name . '_db.php';\n } catch (Exception $e) {\n if ($debug = true) {\n print_r($e);\n }\n }\n}", "function load_my_classes($_cls)\n{\n //echo '<hr />' . $_cls . '<hr />';\n $PATH_SEPARATOR = DIRECTORY_SEPARATOR;\n //$ROOTPATH = $_SERVER[\"DOCUMENT_ROOT\"];\n\t$ROOTPATH = dirname($_SERVER[\"SCRIPT_FILENAME\"]);\n\t\n\t//print_r($_SERVER);\n \n\t\n\n\n if(class_exists($_cls))\n {\n //doe niks, het is een ingebouwde class zoals \\SplObjectStorage o.i.d.\n }\n elseif(strpos($_cls, 'Exception') !== false)\n {\n $candidate_class_file = $ROOTPATH . $PATH_SEPARATOR . 'common' . $PATH_SEPARATOR . 'classes' . $PATH_SEPARATOR . 'Exceptions.php';\n if(file_exists($candidate_class_file))\n {\n require_once($candidate_class_file);\n //echo($candidate_class_file . ' found in ' . $candidate_class_file . '<br />');\n }\n else\n {\n //echo($candidate_class_file . ' does not exist!<br />');\n }\n }\n elseif(strpos($_cls, 'Common') === false)\n {\n $dirsToLookIn = Array(\"controller\", \"core\", \"model\", \"view\");\n \n foreach($dirsToLookIn as $dir)\n {\n if(strpos($_cls, __NAMESPACE__) !== false)\n {\n //namespace eraf strippen anders komt die mee in de padverwijzingen\n $_cls = substr($_cls, strlen(__NAMESPACE__)+1); \n }\n \n \n $candidate_class_file = $ROOTPATH . $PATH_SEPARATOR . $dir . $PATH_SEPARATOR . $_cls . '.php';\n if(file_exists($candidate_class_file))\n {\n require_once($candidate_class_file);\n //echo($candidate_class_file . ' found in ' . $candidate_class_file . '<br />');\n }\n else\n {\n //echo($candidate_class_file . ' does not exist!<br />');\n }\n }\n }\n else\n {\n $_cls = substr($_cls, 7);\n $candidate_class_file = $ROOTPATH . $PATH_SEPARATOR . 'common' . $PATH_SEPARATOR . 'classes' . $PATH_SEPARATOR . $_cls . '.php';\n \n if(file_exists($candidate_class_file))\n {\n require_once($candidate_class_file);\n //echo($candidate_class_file . ' found in ' . $candidate_class_file . '<br />');\n }\n else\n {\n //echo($candidate_class_file . ' does not exist!<br />');\n }\n }\n //echo '<hr />';\n}", "protected function loadCoreClasses() {\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Config.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Router.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Loader.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Controller.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Database.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Model.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Library.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'View.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Request.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Response.php';\r\n }", "function __autoload($class_name) {include $class_name . '.php';}", "public function mapClasses() {\n // TODO: this is needed when the class map is not created yet (i.e. at very first install).\n if (!is_dir($this->dir['tmp'])) {\n mkdir($this->dir['tmp']);\n }\n $fop = fopen(CLASS_MAP_FILE, 'w+');\n\n foreach ($this->modules_loaded as $module) {\n $autoload_paths = array('Common', 'Qtags');\n foreach ($autoload_paths as $autoload_path) {\n $full_autoload_path = $module['path'] . '/classes/' . $autoload_path;\n /**\n * Autoload module's qtags.\n */\n if (is_dir($full_autoload_path)) {\n $classes = $this->scanDirectory($full_autoload_path);\n foreach ($classes as $class) {\n // Parse the Qtag.\n $exp1 = explode('/', $class);\n $exp2 = explode('.', $exp1[count($exp1) - 1]);\n $item_name = $exp2[0];\n $this->class_map[$autoload_path][$item_name] = $full_autoload_path . '/' . $class;\n }\n }\n }\n }\n fwrite($fop, serialize($this->class_map));\n fclose($fop);\n }", "public function testClassesExist() {\n foreach($this->classes as $class) {\n if (class_exists($class)) {\n $this->pass(\"$class was loaded.\");\n }\n else {\n $this->fail(\"$class was not loaded.\");\n }\n }\n }", "function __autoload($class) {\n global $classesDirs;\n\n foreach ($classesDirs as $directory) {\n $filename = $directory . $class . '.php';\n\n if (file_exists($filename)) {\n require_once($filename);\n return;\n }\n }\n}", "public function plugin_classes() {\r\n\t\t$this->filesystem = new PDT_Filesystem( $this );\r\n\t\t$this->auth = new PDT_Auth( $this );\r\n\t\t$this->api = new PDT_Api( $this );\r\n\t\t$this->plugins = new PDT_Plugins( $this );\r\n\t\t$this->installed = new PDT_Installed( $this );\r\n\t\t$this->cases = new PDT_Cases( $this );\r\n\t\t$this->clues = new PDT_Clues( $this );\r\n\t\t$this->detective = new PDT_Detective( $this );\r\n\t}", "private function load_classes() {\n\n\t\t\trequire_once ASCRIPTA_ENGINE_ADMIN_PATH . 'class-ae-settings.php';\n\n\t\t}", "private function autoload($className)\r\n {\r\n }", "function __autoload($className){\n include_once \"Classes/$className.php\";\n}", "function autoLoad() {\n\t$path = dirname(__FILE__);\n\n\t// Autoload manual important files\n\t$Autoload = array();\n\t$Autoload[] = $path . DIRECTORY_SEPARATOR . 'Utils' . DIRECTORY_SEPARATOR . 'lexa-xml-serialization.php';\n\t$Autoload[] = $path . DIRECTORY_SEPARATOR . 'Client' . DIRECTORY_SEPARATOR . 'Builder' . DIRECTORY_SEPARATOR . 'PartyBuilder.php';\n\t$Autoload[] = $path . DIRECTORY_SEPARATOR . 'ServiceConnection' . DIRECTORY_SEPARATOR . 'ServiceConnection.php';\n\t$Autoload[] = $path . DIRECTORY_SEPARATOR . 'ServiceConnection' . DIRECTORY_SEPARATOR . 'Communication.php';\n\t$Autoload[] = $path . DIRECTORY_SEPARATOR . 'Client' . DIRECTORY_SEPARATOR . 'Party.php';\n\n\n\tforeach ($Autoload as &$a) {\n\t\tif (file_exists($a)) {\n\t\t\trequire_once($a);\n\t\t}\n\t}\n\n\n\t$objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST);\n\tforeach ($objects as $name => $object) {\n\t\tif (substr($object->getBasename(), strpos($object->getBasename(), \".\")) == '.php') {\n\t\t\tif (!stristr($object->getBasename(), 'test')) {\n\t\t\t\trequire_once($object->getPath() . DIRECTORY_SEPARATOR . $object->getBasename());\n\t\t\t}\n\t\t}\n\t}\n}", "protected function registerAutoload()\n {\n spl_autoload_register(function($class)\n {\n foreach ($this->foldersToAutoload as $folder)\n {\n if (file_exists(getcwd() . \"/$folder/$class.php\"))\n {\n /** @noinspection PhpIncludeInspection */\n require_once getcwd() . \"/$folder/$class.php\";\n }\n }\n });\n }", "static function _shfw_autoloader()\n {\n\t\tinclude_once(BASEPATH.'config'.DIRECTORY_SEPARATOR.'autoload.php');\n\n\t\tif ( ! isset($autoload))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Autoload helpers.\n\t\tforeach ($autoload['helper'] as $type)\n\t\t{\t\t\t\n\t\t\tself::loadHelper($type);\n\t\t}\n\n\t\t// Autoload core components.\n\t\tforeach ($autoload['core'] as $type)\n\t\t{\t\t\t\n\t\t\tself::initCoreComponent($type);\n\t\t}\n\n\t\t/*\n\t\tif(SHIN_Core::$_benchmark){\n\t\t\tSHIN_Core::$_benchmark->mark('code_start');\n\t\t}\n\t\t*/\n\t\t\n\t\t// Autoload libraries.\n\t\tforeach ($autoload['libraries'] as $type)\n\t\t{\n\t\t\tself::loadLibrary($type, TRUE);\n\t\t}\n\n\t\t// Autoload models.\n\t\tforeach ($autoload['models'] as $type)\n\t\t{\n\t\t\tself::loadModel($type, TRUE);\n\t\t}\n\t}", "abstract protected static function autoload($class);", "private function instantiateAll() {\n $this->Corporations = new Corporations($this);\n $this->MemberTracking = new MemberTracking($this);\n $this->Characters = new Characters($this);\n $this->Stations = new Stations($this);\n $this->Facilities = new Facilities($this);\n $this->Industry = new Industry($this);\n $this->Markets = new Markets($this);\n $this->Universe = new Universe($this);\n $this->Contracts = new Contracts($this);\n $this->Wallet = new Wallet($this);\n $this->Assets = new Assets($this);\n $this->Killmails = new Killmails($this);\n $this->Status = new Status($this);\n $this->Usage = new Usage($this);\n }", "function __autoload($class_name) {\n include 'classes/' . $class_name . '.php';\n}", "public static function register_autoloader()\n {\n }", "public static function init()\n {\n // Autoloader.\n spl_autoload_register(\n function ($class) {\n // Does the class use this namespace prefix?\n $found = false;\n $baseDir = '';\n $classLen = 0;\n\n foreach (Autoloader::$registeredNamespaces as $prefix => $path) {\n $len = mb_strlen($prefix);\n if (strncmp($prefix, $class, $len) == 0) {\n $found = true;\n $baseDir = $path;\n $classLen = $len;\n } //end if\n }//end foreach\n\n if ($found === false) {\n // The namespace is not registered for this autoloader.\n return;\n }//end if\n\n $relativeClass = mb_substr($class, $classLen);\n\n $endpath = str_replace('\\\\', '/', $relativeClass).'.php';\n $file = $baseDir.$endpath;\n\n // Try the public folders.\n if (file_exists($file) === true) {\n include $file;\n\n return;\n }\n\n // Try the admin folder.\n if (defined('ADMINPAGE') === true) {\n $file = $baseDir.ADMIN_FOLDER.$endpath;\n if (file_exists($file) === true) {\n include $file;\n\n return;\n }\n }\n\n throw new \\Exception('Class '.$class.' not found.');\n }\n );\n }", "public static function registerAutoloaders()\n {\n $modules = self::getModsTable();\n unset($modules[0]);\n foreach ($modules as $module) {\n $base = ($module['type'] == self::TYPE_MODULE) ? 'modules' : 'system';\n $path = \"$base/$module[directory]/lib\";\n ZLoader::addAutoloader($module['directory'], $path);\n }\n }", "static function loadClass()\n {\n $list_arg = func_get_args();\n if (!empty($list_arg))\n {\n foreach (func_get_args() as $item)\n {\n include_once \"system/classes/{$item}.class.php\";\n }\n }\n }", "public static function register(): void\r\n {\r\n // Run the SPL autoloader\r\n spl_autoload_register([self::class, 'loadClass']);\r\n\r\n // Iterate through the PSR4 namespace array\r\n $namespaces = array_filter(self::$psr4);\r\n if ( ! empty($namespaces) ) {\r\n foreach ( self::$psr4 as $psr4 => $path ) {\r\n self::addNamespace($psr4, $path);\r\n }\r\n }\r\n // Iterate through the PSR4 classmap array\r\n $classmap = array_filter(self::$classmap);\r\n if ( ! empty($classmap) ) {\r\n foreach ( self::$classmap as $class => $file) {\r\n self::requireFiles(strpos($file, '.php')? $file: $file . '.php');\r\n }\r\n }\r\n }", "public function auto_load() {\n\n spl_autoload_register(function ($class) {\n\n // Getting the file path for checking if it exists.\n\n require_once ROOT . '/app/controllers/' . $class . '.php';\n\n });\n }", "function __autoload($class_name) {\n include \"classes/\" . $class_name . \".class.php\";\n}", "protected function initClasses()\n {\n $classList = __DIR__ . DS . 'classes.txt';\n if(file_exists($classList)) {\n $contents = file_get_contents($classList);\n $classes = explode(',', $contents);\n foreach($classes as $class)\n $this->classes[] = trim($class);\n }\n\n }", "public function registerAutoloaders()\n {\n }", "function __autoload($class_name) {\n include $class_name . '.php';\n}", "function __autoload($class_name) {\n include $class_name . '.php';\n}", "function __autoload($class_name) {\n include $class_name . '.php';\n}", "public function ensureClassLoadingInformationExists() {}", "function classes_autoloader($class) {\n\t\n\t$subforder = '';\n\t\n\tif (substr($class, -9) === 'Converter') {\n\t\t$subforder = 'converters/';\n\t} else if (substr($class, -4) === 'Skin') {\n\t\t$subforder = 'skins/';\n\t} else if (substr($class, -5) === 'Model') {\n\t\t$subforder = 'models/';\n\t} else if (substr($class, -9) === 'Validator') {\n\t\t$subforder = 'validators/';\n\t} else if (substr($class, -10) === 'Controller') {\n\t\t$subforder = 'actions/';\n\t} else if (substr($class, -7) === 'Service') {\n\t\t$subforder = 'services/';\n\t} else if (substr($class, -3) === 'Job') {\n\t\t$subforder = 'jobs/';\n\t} else if (substr($class, -11) === 'LoginMethod') {\n\t\t$subforder = 'loginmethods/';\n\t} else if (substr($class, -5) === 'Event') {\n\t\t$subforder = 'events/';\n\t} else if (substr($class, -6) === 'Plugin') {\n\t\t$subforder = 'plugins/';\n\t}\n\t\n\t@include(BASE_FOLDER . '/classes/' . $subforder . $class . '.class.php');\n}", "function do_autoload() {\n\tinit_files();\n}", "function loader($class){\n $class_file = DIR. DS . $class . '.php';\n\n if(file_exists($class_file)){\n require_once($class_file);\n }else{\n foreach (AUTOLOAD_CLASSES as $path){\n $class_file = $path . DS . $class . '.php';\n if(file_exists($class_file)) require_once($class_file);\n }\n }\n}", "function __autoload($class_name) {\n\t$inc = ['sys/core/', 'sys/libs/'];\n\tforeach ($inc as $in) {\n\t\t$path = APP_DIR . $in . $class_name . '.php';\n\t\tif (file_exists($path)) {\n\t\t\tinclude $path;\n\t\t}\n\t}\n}", "public function registerAutoloaders()\n {\n $loader = new Loader();\n \n $loader->setNamespaces(array(\n 'App\\Install\\Controllers' => __DIR__ . '/controllers/',\n 'App\\Install\\Tags' => __DIR__ . '/tags/'\n ));\n $loader->register();\n }", "public static function autoload() {\n spl_autoload_register(function($class) {\n $prefix = __CLASS__ . '\\\\';\n if (strpos($class, $prefix) === 0) {\n // Remove vendor from name.\n $class = substr($class, strlen(__NAMESPACE__) + 1);\n // Convert namespace separator to directory ones.\n $class = str_replace('\\\\', DIRECTORY_SEPARATOR, $class);\n // Prefix with this file's directory.\n $class = __DIR__ . DIRECTORY_SEPARATOR . $class;\n\n require \"$class.php\";\n\n return true;\n }\n\n return false;\n });\n }", "public function loadFactoriesClassNames(): array;", "private function setAutoLoader() {\n \n spl_autoload_register(array('self', 'autoLoader'));\n \n }", "private function prepare(){\r\n \r\n $autoload = &$this->settings->autoload; \r\n \r\n if(isset($autoload)){\r\n \r\n foreach($autoload AS $key => $class){\r\n \r\n $settings = &$this->settings->{$key};\r\n \r\n if(isset($settings)){\r\n\r\n $this->{$key} = new $class($settings);\r\n }\r\n }\r\n }\r\n }", "function autoloader()\n {\n spl_autoload_register(function ($className) {\n\n # DIRECTORY SEPARATORS varies in various platforms\n $ds = DIRECTORY_SEPARATOR;\n\n # Current Working Directory\n $dir = __DIR__;\n\n # replace namespace separator with directory separator (prolly not required)\n $className = str_replace('\\\\', $ds, $className);\n\n # get full name of file containing the required class\n $file = \"{$dir}{$ds}{$className}.php\";\n\n # get file if it is readable\n if (is_readable($file)) {\n require_once $file;\n }\n });\n }", "function __autoload($name){\n require_once './class/' . $name . \".class.php\";\n}", "function __autoload($className) {\n if (Inform8Context::getClassRegistry()->getClass($className) != NULL) { \n include Inform8Context::getClassRegistry()->getClass($className); \n }\n }", "function __autoload($className)\n{\n require_once \"webcore.reflection.php\";\n \n ClassLoader::loadClass($className);\n}", "private function includeFiles(){\n foreach($this->files as $file){\n require implode('', $file);\n $class_name = $this->getClassNameFromFileName($file);\n $this->classes[$file['name']] = new $class_name();\n }\n }", "private function setAllLoaded()\n {\n $class_reflection = new ReflectionClass(get_class($this));\n do {\n if ($class_reflection->isInstantiable())\n $this->setLoadedFromDb($class_reflection->getName());\n\n } while (($class_reflection = $class_reflection->getParentClass()) && # get the parent\n $class_reflection->getName() != __CLASS__); # check that we're not hitting the top\n }", "private function load_services() {\n\t\tforeach ( $this->get_services() as $service_classname ) {\n\t\t\t$this->load_service( $service_classname );\n\t\t}\n\t}", "function __autoload($class_name)\n{\n if (file_exists(\"classes/class.$class_name.php\"))\n {\n require_once \"classes/class.$class_name.php\";\n }else{echo'can not load';}\n}", "function __autoload($className) {\n $paths = array(\n ROOT . \"/lib/\",\n ROOT . \"/admin/controller/\",\n ROOT . \"/admin/model/\",\n ROOT . \"/home/controller/\"\n );\n\n foreach($paths as $path) {\n if(file_exists($path . $className . \".class.php\")){\n require_once($path . $className . \".class.php\");\n break;\n }\n }\n}", "function __autoload($className)\n{\n if (preg_match('/.*Dao$/', $className) > 0) {\n # Dao class\n if (file_exists(realpath(dirname(__FILE__)) . '/../dao/' . $className . '.php')) {\n include_once(realpath(dirname(__FILE__)) . '/../dao/' . $className . '.php');\n }\n } elseif (preg_match('/.*Manager$/', $className) > 0) {\n # Managers interfaces\n if (file_exists(realpath(dirname(__FILE__)) . '/../managers/' . $className . '.php')) {\n include_once(realpath(dirname(__FILE__)) . '/../managers/' . $className . '.php');\n }\n } elseif (preg_match('/.*Module$/', $className) > 0) {\n # Get the module name\n $moduleName = strtolower(preg_replace('/^(.*)Module$/', '\\1', $className));\n if (file_exists(realpath(dirname(__FILE__)) . '/../../modules/' . $moduleName . '/' . $className . '.php')) {\n include_once(realpath(dirname(__FILE__)) . '/../../modules/' . $moduleName . '/' . $className . '.php');\n }\n } else {\n # Models\n if (file_exists(realpath(dirname(__FILE__)) . '/../model/' . $className . '.php')) {\n include_once(realpath(dirname(__FILE__)) . '/../model/' . $className . '.php');\n }\n }\n Utils::log(LOG_DEBUG, \"Class $className loaded\", __FILE__, __LINE__);\n}", "function class_autoload($params){\n\tstatic $entries_count = 0;\n\tif($entries_count>0){ return; }\n\t$entries_count++;\n\tif(is_string($params)){\n\t\t__class_autoload__(array(\"directory\" => $params));\n\t}elseif(is_array($params)){\n\t\t__class_autoload__(array(\"filenames_by_class\" => $params));\n\t}\n\t$entries_count--;\n}", "function spl_autoload_call(string $class): void {}", "public function registerAutoloaders()\n {\n\n $loader = new Loader();\n\n $loader->registerNamespaces(array(\n 'Ns\\Core\\Controllers' => __DIR__ . '/controllers/',\n 'Ns\\Core\\Models' => __DIR__ . '/models/',\n 'Ns\\Core\\Libraries' => __DIR__ . '/libraries/',\n ));\n\n $loader->register();\n }", "function autoloader_perso($className)\n{\n //var_dump($className);\n require_once($className . '.php');\n //die('Test autoloader');\n}", "public function autoload($class) {\n if (isset(static::$map[$class])){\n $pathInfo = static::$map[$class];\n Yaf_Loader::import(sprintf('%s%s',$pathInfo[0], $pathInfo[1]));\n } else if (strpos($class, 'Builder') === strlen($class) - 7){\n Yaf_Loader::import(sprintf('%s/application/views/builder/%s.php', APPLICATION_PATH, $class));\n } else if (strpos($class, 'Pagelet') === strlen($class) - 7){\n Yaf_Loader::import(sprintf('%s/application/pagelets/%s.php', APPLICATION_PATH, $class));\n } else if (strpos($class, 'Halo') === 0){\n Yaf_Loader::import(sprintf('%s/halo/%s.php',LIB_PATH,$class));\n } else if (strpos($class, 'Util') == strlen($class) - 4 || strpos($class, 'Utils') == strlen($class) - 5){\n Yaf_Loader::import(sprintf('%s/utils/%s.php',LIB_PATH,$class));\n } else if (strpos($class, 'Model') === strlen($class) - 5){\n Yaf_Loader::import(sprintf('%s/application/models/%s.php',APPLICATION_PATH,$class));\n } else if (strpos($class, 'Service') === strlen($class) - 7){\n Yaf_Loader::import(sprintf('%s/application/service/%s.php',APPLICATION_PATH,$class));\n } else if (strpos($class, 'HTMLPurifier') !== false){\n Yaf_Loader::import(sprintf('%s/htmlpurifier/HTMLPurifier.safe-includes.php',LIB_PATH));\n }else if (strpos($class, 'Api') === strlen($class) - 3){\n Yaf_Loader::import(sprintf('%s/application/Api/%s.php',APPLICATION_PATH,$class));\n }else if (strpos($class, 'Object') === strlen($class) - 6){\n Yaf_Loader::import(sprintf('%s/application/objects/%s.php',APPLICATION_PATH,$class));\n }else if (strpos($class, 'MemCache') === 0){\n// var_dump('================');\n// /Users/worker/php/wk/wcontact_cache/lib/wcontact/MemCacheBase.php\n Yaf_Loader::import(sprintf('%s/wzhaopin/%s.php',LIB_PATH, $class));\n }\n }", "protected function registerClassAutoloader($paths)\n {\n spl_autoload_register(function ($class) use ($paths) {\n // Traverse in registered plugin paths\n foreach ((array)array_keys($paths) as $namespace) {\n if ($namespace != '' && mb_strpos($class, $namespace) === 0) {\n // Parse real file path\n $path = $paths[$namespace] . Str::replaceFirst($namespace, '', $class) . \".php\";\n $path = str_replace('\\\\', '/', $path);\n\n if (file_exists($path)) {\n // Include class file if it exists\n include $path;\n }\n }\n }\n });\n }", "function __autoload($class_name){\n require_once \"../cls/\".$class_name.'.php';\n}", "function classAutoload($class_name) {\n if (file_exists( __DIR__ . '/includes/classes/' . $class_name . '.php')) {\n require_once __DIR__ . '/includes/classes/' . $class_name . '.php';\n }\n}", "function __autoload($className){\n if (file_exists(\"core/$className.php\")){\n include_once \"core/$className.php\";\n }\n}", "public function registerAutoLoad() {\n spl_autoload_register(array($this, \"load\"), true, true);\n }", "public static function LOADER(){\n spl_autoload_register(array(__CLASS__, \"requireClass\"));\n }", "function my_autoloader($class) {\r\n\t require_once ($class.'.php');\r\n\t}", "function __autoload($class){\n require \"classes/\".$class.\".php\";\n }", "public function plugin_classes() {\n\t\t$this->options = new Options( $this ) ;\n\t\t$this->helpers = new Helpers( $this );\n\t\t$this->core = new Core( $this );\n\t}", "public static function start()\n\t{\n\t\tspl_autoload_register('Autoloader::init', true, true);\n\t}", "function __autoload( $classname )\n{\n global $_classFiles, $debug;\n\n if ( $_classFiles === null )\n {\n $_classFiles = array();\n\n // Map files in reverse of this order\n $searchPaths = array( '../Base/', '../Site/' );\n foreach ( $searchPaths as $path )\n {\n mapClassFiles( realpath( $path ) );\n }\n }\n\n // Check that the file is mapped\n if ( isset( $_classFiles[$classname] ) )\n {\n // If debugging is working, add a debug message\n if ( is_object( $debug ) )\n {\n $debug->addMessage( \"Autoloading Object: $classname\" );\n }\n // Since the user should never be requiring a file, no need for require_once\n require( $_classFiles[$classname] );\n }\n}", "protected function __construct() {\r\n $types = Array('classes', isset($_SERVER['SHELL']) ? 'classes_shell' : 'classes_web');\r\n foreach($types as $type) {\r\n foreach(self::$config->$type as $class) {\r\n $class = __NAMESPACE__ . \"\\\\\" . $class;\r\n $this->add(new $class());\r\n }\r\n }\r\n }", "function my_autoloader($class_name) \n\t{\n \tinclude '../classes/' . $class_name . '.class.php';\n\t}", "function import_classes(){\n\t\n\tclass_exists('Database') || require('classes/class.Database.php');\n\tclass_exists('Response') || require('classes/class.Response.php');\n\tclass_exists('User') || require('classes/class.User.php');\n\tclass_exists('GUI') || require('classes/class.GUI.php');\n\tclass_exists('FileItem') || require('classes/class.FileItem.php');\n\tclass_exists('Comment') || require('classes/class.Comment.php');\n\tclass_exists('MLLib') || require('classes/class.MLLib.php');\n}", "function __autoload($class_name) {\n require_once '/' . $class_name . '.php';\n}", "function my_autoloader($class) {\n if ( $class != \"ACF\" )\n include 'classes/' . $class . '.class.php';\n }", "static function autoload()\r\n\t{\r\n\t\t\r\n\t}" ]
[ "0.74964607", "0.7352997", "0.73162746", "0.7309988", "0.7286737", "0.7285625", "0.70561725", "0.7001084", "0.6968005", "0.69340587", "0.68373317", "0.6798649", "0.67362565", "0.6714632", "0.67132294", "0.67006814", "0.65996164", "0.65904033", "0.65809554", "0.65732133", "0.6567174", "0.6541745", "0.6527769", "0.6508805", "0.6504874", "0.64580446", "0.6446972", "0.6419401", "0.641357", "0.638209", "0.63795424", "0.63709044", "0.63655275", "0.63649845", "0.636302", "0.6357221", "0.6346641", "0.63445616", "0.6338682", "0.63365495", "0.6328945", "0.63214904", "0.63085395", "0.6303228", "0.6303016", "0.6297815", "0.6292722", "0.62793595", "0.6274038", "0.62732446", "0.6265011", "0.6258221", "0.62526643", "0.6248126", "0.62290514", "0.6203321", "0.6203321", "0.6203321", "0.6202506", "0.6200976", "0.6193314", "0.6193305", "0.61877435", "0.6183082", "0.6169004", "0.6157036", "0.61568373", "0.61556405", "0.6153084", "0.6150339", "0.6146483", "0.6143658", "0.61421645", "0.61393833", "0.613905", "0.6134221", "0.61319184", "0.6129199", "0.61266166", "0.6122546", "0.6121609", "0.61157924", "0.6111116", "0.6107935", "0.61075705", "0.6106396", "0.6103378", "0.61033475", "0.6098805", "0.6083413", "0.60791826", "0.607885", "0.6070578", "0.6062729", "0.6056329", "0.60520583", "0.6048157", "0.60472655", "0.60456204", "0.60444343" ]
0.7234444
6
Loops through all the registered contextual classes and attempts to call classs methods based on wpf_get_request().
function wpf_load_contextual_classes() { global $wpf_classes, $wpf_theme; if ( isset($wpf_classes['contextual']) && !empty( $wpf_classes['contextual'] ) ) { $methods = array(); // Get the context, but not in the admin. if ( !is_admin() ) { $context = array_reverse( (array) wpf_get_request() ); if ( !empty($context) ) { foreach ( $context as $method ) { $methods[] = str_replace( '-', '_', $method ); } } } foreach ( (array) $wpf_classes['contextual'] as $handle => $class ) { if ( isset($wpf_classes[$handle]) ) continue; // Call the admin method if we're in the admin area. if ( is_admin() ) { $wpf_theme->callback( $wpf_classes['contextual'][$handle], 'admin' ); } else { // Call the constructor method if we're not in the admin, // pass all the methods that are valid for this page request. $wpf_classes[$handle] = new $class( $methods ); } // Call all the contextual methods. if ( !empty( $methods ) ) { foreach( $methods as $method ) { $wpf_theme->callback( $wpf_classes[$handle], $method ); } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getContextClasses();", "public function handledClass();", "public function injectViewClasses() {\n\t\t$controller = $this->_controller();\n\t\tforeach ($this->config('viewClasses') as $type => $class) {\n\t\t\t$controller->RequestHandler->viewClassMap($type, $class);\n\t\t}\n\t}", "function wpf_autoload_classes() {\n\tglobal $wpf_classes;\n\n\tif ( isset( $wpf_classes['autoload'] ) ) {\n\t\tforeach ( (array) $wpf_classes['autoload'] as $handle => $class ) {\n\t\t\tif ( !isset($wpf_classes[$handle]) ) {\n\t\t\t\t$wpf_classes[$handle] = new $class;\n\t\t\t}\n\t\t}\n\t}\n}", "function classes() {\n\tcore();\n}", "public function registerRouters () {\n\t\tif ( !current_user_can( 'manage_options' ) )\n\t\t\treturn;\n\n\t\tforeach ( $this->classes as $class ) {\n\t\t\t\\Maven\\Core\\HookManager::instance()->addFilter( 'json_endpoints', array( $class, 'registerRoutes' ) );\n\t\t}\n\t}", "function wpf_register_contextual_class( $handle, $class ) {\n\tglobal $wpf_classes;\n\n\t$wpf_classes['contextual'][$handle] = $class;\n\n\treturn $wpf_classes['contextual'][$handle];\n}", "public static function load_extra_classes() {\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-elementor.php';\n\t\tElementor::init();\n\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-woo.php';\n\t\tWoo::init();\n\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-facebook.php';\n\t\tFacebook::init();\n\t}", "protected function getRegisteredClasses() {}", "public function action_methods()\n\t{\n\t\t$this->runTest('gcc', 100000, 'get_called_class every time');\n\t\t$this->runTest('gcc_cached', 100000, 'caching get_called_class');\n\t}", "public function availableClasses()\n {\n }", "abstract protected function getSupportedClasses();", "protected abstract function registerClasses(): void;", "private function loadClasses()\n\t\t{\n\t\t\t// foreach($GLOBALS['classes'] as $var => $class)\n\t\t\t// {\n\t\t\t\t// $this->$var = $class;\n\t\t\t// }\n\t\t\t\n\t\t\t// $this->load = _new('loader');\n\t\t\t\n\t\t\t/** Registramos todos os objetos que serão necessários **/\n\t\t\tforeach(Registry::getAll() as $var => $object)\n\t\t\t{\n\t\t\t\t$this->$var = $object;\n\t\t\t}\n\t\t\t\n\t\t\t// E também a classe loader\n\t\t\t$this->load = Registry::get('loader');\n\t\t}", "public function hasContextClass($class);", "private function setAllLoaded()\n {\n $class_reflection = new ReflectionClass(get_class($this));\n do {\n if ($class_reflection->isInstantiable())\n $this->setLoadedFromDb($class_reflection->getName());\n\n } while (($class_reflection = $class_reflection->getParentClass()) && # get the parent\n $class_reflection->getName() != __CLASS__); # check that we're not hitting the top\n }", "public function process() : void\n {\n // Filter all classes, before processing.\n $class_list = apply_filters(\\PC_Headless_Blog_1AA\\PinkCrab\\Core\\Application\\Hooks::APP_INIT_REGISTRATION_CLASS_LIST, $this->class_list);\n foreach ($this->middleware as $middleware) {\n // Pass each class to the middleware.\n foreach ($class_list as $class) {\n // Construct class using container,\n //if valid object process via current middleware\n $class_instance = $this->di_container->create($class);\n if (\\is_object($class_instance)) {\n $middleware->process($class_instance);\n }\n }\n }\n }", "private function findSubContextClasses() {\n $class_names = array();\n\n // Initialize any available sub-contexts.\n if (isset($this->parameters['subcontexts'])) {\n $paths = array();\n // Drivers may specify paths to subcontexts.\n if ($this->parameters['subcontexts']['autoload']) {\n foreach ($this->drupal->getDrivers() as $name => $driver) {\n if ($driver instanceof SubDriverFinderInterface) {\n $paths += $driver->getSubDriverPaths();\n }\n }\n }\n\n // Additional subcontext locations may be specified manually in behat.yml.\n if (isset($this->parameters['subcontexts']['paths'])) {\n $paths = array_merge($paths, $this->parameters['subcontexts']['paths']);\n }\n\n // Load each class.\n foreach ($paths as $path) {\n if ($subcontexts = $this->findAvailableSubContexts($path)) {\n $this->loadSubContexts($subcontexts);\n }\n }\n\n // Find all subcontexts, excluding abstract base classes.\n $classes = get_declared_classes();\n foreach ($classes as $class) {\n $reflect = new \\ReflectionClass($class);\n if (!$reflect->isAbstract() && $reflect->implementsInterface('Drupal\\DrupalExtension\\Context\\DrupalSubContextInterface')) {\n $class_names[] = $class;\n }\n }\n\n }\n\n return $class_names;\n }", "public function run()\n {\n// $this->Truncate();\n\n foreach ($this->classes as $class)\n {\n $this->call($class);\n }\n\n }", "abstract protected function get_activatable_classes();", "private function getAlreadyProposedMethods($contextClass)\n {\n return self::$proposedMethods[$contextClass] ?? array();\n }", "private static function onLoad($_class) {\n\t\tforeach (explode('|',self::$global['AUTOLOAD']) as $_auto) {\n\t\t\t// Allow namespaced classes\n\t\t\t$_file=$_auto.self::fixSlashes($_class).'.php';\n\t\t\t// Case-insensitive check for file presence\n\t\t\t$_glob=glob(dirname($_file).'/*.php');\n\t\t\t$_fkey=array_search(\n\t\t\t\tstrtolower($_file),array_map('strtolower',$_glob)\n\t\t\t);\n\t\t\tif (is_int($_fkey)) {\n\t\t\t\tinclude $_glob[$_fkey];\n\t\t\t\tif (method_exists($_class,'onLoad'))\n\t\t\t\t\tcall_user_func(array($_class,'onLoad'));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tself::$global['CONTEXT']=$_class;\n\t\ttrigger_error(self::TEXT_Class);\n\t}", "static public function dispatch()\n {\n $request = Url::getURI();\n $method = Request::getMethod();\n foreach (self::$routes[$method] as $route)\n {\n preg_match($route['pattern'], $request, $params);\n if (isset($params[0]))\n {\n unset($params[0]);\n $controller = $route['controller'];\n $action = $route['action'];\n $class = new $controller();\n call_user_func_array([$class, $action], $params);\n return;\n }\n }\n }", "function load_my_classes($_cls)\n{\n //echo '<hr />' . $_cls . '<hr />';\n $PATH_SEPARATOR = DIRECTORY_SEPARATOR;\n //$ROOTPATH = $_SERVER[\"DOCUMENT_ROOT\"];\n\t$ROOTPATH = dirname($_SERVER[\"SCRIPT_FILENAME\"]);\n\t\n\t//print_r($_SERVER);\n \n\t\n\n\n if(class_exists($_cls))\n {\n //doe niks, het is een ingebouwde class zoals \\SplObjectStorage o.i.d.\n }\n elseif(strpos($_cls, 'Exception') !== false)\n {\n $candidate_class_file = $ROOTPATH . $PATH_SEPARATOR . 'common' . $PATH_SEPARATOR . 'classes' . $PATH_SEPARATOR . 'Exceptions.php';\n if(file_exists($candidate_class_file))\n {\n require_once($candidate_class_file);\n //echo($candidate_class_file . ' found in ' . $candidate_class_file . '<br />');\n }\n else\n {\n //echo($candidate_class_file . ' does not exist!<br />');\n }\n }\n elseif(strpos($_cls, 'Common') === false)\n {\n $dirsToLookIn = Array(\"controller\", \"core\", \"model\", \"view\");\n \n foreach($dirsToLookIn as $dir)\n {\n if(strpos($_cls, __NAMESPACE__) !== false)\n {\n //namespace eraf strippen anders komt die mee in de padverwijzingen\n $_cls = substr($_cls, strlen(__NAMESPACE__)+1); \n }\n \n \n $candidate_class_file = $ROOTPATH . $PATH_SEPARATOR . $dir . $PATH_SEPARATOR . $_cls . '.php';\n if(file_exists($candidate_class_file))\n {\n require_once($candidate_class_file);\n //echo($candidate_class_file . ' found in ' . $candidate_class_file . '<br />');\n }\n else\n {\n //echo($candidate_class_file . ' does not exist!<br />');\n }\n }\n }\n else\n {\n $_cls = substr($_cls, 7);\n $candidate_class_file = $ROOTPATH . $PATH_SEPARATOR . 'common' . $PATH_SEPARATOR . 'classes' . $PATH_SEPARATOR . $_cls . '.php';\n \n if(file_exists($candidate_class_file))\n {\n require_once($candidate_class_file);\n //echo($candidate_class_file . ' found in ' . $candidate_class_file . '<br />');\n }\n else\n {\n //echo($candidate_class_file . ' does not exist!<br />');\n }\n }\n //echo '<hr />';\n}", "public function processApi(){\r\n\t\t\t$service = explode(\"/\", $_GET['x']);\r\n\t\t\t$this->entity = ucfirst($service[0]);\r\n\t\t\t$this->methode = $service[1];\r\n\t\t\t$func = $this->methode.$this->entity;\r\n\t\t\t$this->addLog('--'.$this->methode.$this->entity);\r\n\t\t\tif((int)method_exists($this,$func) > 0)\r\n\t\t\t\t$this->$func();\r\n\t\t\telse\r\n\t\t\t\t$this->response('',404); // If the method not exist with in this class \"Page not found\".\r\n\t\t\t\t\r\n\t\t}", "function get_class_methods() {\n\t\t$args = func_get_args();\n\t\t$result=call_user_func_array(\"get_class_methods\", $args);\n\t\tif (is_array($result))\n\t\t\tforeach ($result as $key=>$value) {\n\t\t\t\t$result[$key]=strtolower($value);\n\t\t\t}\n\t\treturn $result;\n\t}", "protected function callHandlers()\n {\n // Iterate handlers and run them\n foreach ($this->handlers as $i => $handler) {\n // Create handler params array with first parameter pointing to this query object\n $params = array(& $this);\n\n // Combine params with existing ones in one array\n $params = array_merge($params, $this->params[$i]);\n\n // Execute handler\n call_user_func_array($handler, $params);\n }\n }", "abstract public function processClass (ReflectionClass $class);", "function dispatch() {\n $app = $this->app;\n $db = $this->db;\n $u = $this->user;\n $cl = $this;\n foreach ($this->pages as $i => $p) {\n $app->group('/'.$p, function () use ($app, $db, $p, $u) {\n $class = 'includes/pages/class.'.$p.'.php';\n if (file_exists($class)) {\n require_once($class);\n $cn = '\\\\'.ucfirst($p);\n $pg = new $cn($app, $db, $u);\n }\n });\n }\n\n $this->app->notFound(function() use($app) {\n $app->halt(404, json_encode(array('status' => 404, 'message' => 'not found')));\n });\n\n $app->run();\n }", "function wpf_get_class( $class ) {\n\tglobal $wpf_classes;\n\t\n\tif ( isset($wpf_classes[$class]) )\n\t\treturn $wpf_classes[$class];\n\t\n\tif ( isset($wpf_classes['admin'][$class]) )\n\t\treturn $wpf_classes['admin'][$class];\n\t\n\tif ( isset($wpf_classes['static'][$class]) )\n\t\treturn $wpf_classes['static'][$class];\n\t\n\tif ( isset($wpf_classes['autoload'][$class]) )\n\t\treturn $wpf_classes['autoload'][$class];\n\t\n\tif ( isset($wpf_classes['contextual'][$class]) )\n\t\treturn $wpf_classes['contextual'][$class];\n\t\n\treturn false;\n}", "private function init()\n\t{\n\t\tforeach (isLoadedClass() as $objName)\n\t\t{\n\t\t\t$this->$objName =& loadClass('', '', $objName);\n\t\t}\n\t}", "protected function loadWidgetContexts() {}", "private function bind_object_class(): void\n\t{\n\t\tPrototype::from(Prototyped::class)['get_app'] = function() {\n\n\t\t\treturn $this;\n\n\t\t};\n\t}", "public function processApi() {\n $func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['request'])));\n if ((int) method_exists($this, $func) > 0)\n $this->$func();\n else\n $this->response('', 404); // If the method not exist with in this class, response would be \"Page not found\".\n }", "abstract protected function requestClass(): string;", "public function processApi(){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['x'])));\n//echo $func;\t\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->response('',404); // If the method not exist with in this class \"Page not found\".\n\t\t}", "public function processApi(){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['x'])));\n\t\t\tif((int)method_exists($this,$func) > 0) {\n $this->$func();\n }\n\t\t\telse {\n $this->response('',404); // If the method not exist with in this class \"Page not found\". \n }\n\t\t\t\t\n\t\t}", "public function processApi(){\n\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['x'])));\n\tif((int)method_exists($this,$func) > 0)\n\t\t$this->$func();\n\telse\n\t\t$this->response('',404); // If the method not exist with in this class \"Page not found\".\n}", "public function init_classes() {\n\t\tnew ProductFlow_Admin();\n\t}", "function wpf_load_admin_pages() {\n\tif ( !is_admin() )\n\t\treturn;\n\n\tglobal $wpf_classes;\n\n\tif ( isset($wpf_classes['admin']) && !empty($wpf_classes['admin']) ) {\n\t\tforeach ( $wpf_classes['admin'] as $handle => $class ) {\n\t\t\tif ( !isset($wpf_classes[$handle]) ) {\n\t\t\t\t$wpf_classes[$handle] = new $class;\n\t\t\t}\n\t\t}\n\t}\n}", "public function handler_wp_body_class( array $classes )\n\t\t{\n\t\t\tif( defined( 'REST_REQUEST' ) )\n\t\t\t{\n\t\t\t\t$classes[] = 'avia-rest-request';\n\t\t\t}\n\n\t\t\tif( defined( 'IFRAME_REQUEST' ) )\n\t\t\t{\n\t\t\t\t$classes[] = 'avia-iframe-request';\n\t\t\t}\n\n\t\t\treturn $classes;\n\t\t}", "abstract public function getClasses();", "public function process( object $class ): object {\n\t\tif ( is_a( $class, Ajax::class )\n\t\t&& is_admin()\n\t\t&& wp_doing_ajax()\n\t\t) {\n\t\t\t$this->dispatcher->add_ajax_call( $class );\n\t\t}\n\t\treturn $class;\n\t}", "public function Load_Shortcodes() {\r\n $contexts = $this->contexts;\r\n // If no contexts were returned\r\n if (!$contexts || !is_array($contexts)) { return; }\r\n // Loop through each of the found contexts\r\n foreach ($contexts as $_type => $_context) { \r\n // Add the render function\r\n add_shortcode($_type, array($this,'Render_Shortcode'));\r\n }\r\n // Fire the shortcode init action\r\n do_action('vcff_supports_shortcode_init',$this);\r\n }", "public function run()\n {\n $this->call(specialites::class);\n $this->call(cancers::class);\n $this->call(organes::class);\n $this->call(wilayas::class);\n $this->call(dairas::class);\n $this->call(communes::class);\n $this->call(employes::class);\n $this->call(permissions::class);\n $this->call(roles::class);\n $this->call(users::class);\n }", "public function processApi()\n {\n $data = array('404'=>'requested method not available');\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['mode'])));\n if((int)method_exists($this,$func) > 0)\n $this->$func();\n else\n $this->response($this->json($data),'404');\n // If the method not exist with in this class, response would be \"Page not found\".\n }", "public function getMethods($class);", "public function getHandlers(): array\n\t{\n\t\treturn $this->classes;\n\t}", "public function plugin_classes() {\r\n\t\t$this->filesystem = new PDT_Filesystem( $this );\r\n\t\t$this->auth = new PDT_Auth( $this );\r\n\t\t$this->api = new PDT_Api( $this );\r\n\t\t$this->plugins = new PDT_Plugins( $this );\r\n\t\t$this->installed = new PDT_Installed( $this );\r\n\t\t$this->cases = new PDT_Cases( $this );\r\n\t\t$this->clues = new PDT_Clues( $this );\r\n\t\t$this->detective = new PDT_Detective( $this );\r\n\t}", "protected static function bootMethods()\n {\n $class = static::class;\n foreach (preg_grep('/^boot[A-Z](\\w+)/i', get_class_methods($class)) as $method) {\n if ($method === __FUNCTION__) {\n continue;\n }\n forward_static_call([$class, $method]);\n }\n }", "public static function load($classes)\r\n {\r\n foreach ($classes as $connector => $arguments) \r\n {\r\n $class = 'Kernel\\\\Loader\\\\'.ucfirst($connector);\r\n if (class_exists($class))\r\n {\r\n call_user_func_array([new $class, 'trigger'], $arguments);\r\n }\r\n }\r\n }", "public function processApi() {\n\n $func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['rquest'])));\n\n if ((int) method_exists($this, $func) > 0) {\n $this->$func();\n } else {\n $this->response('Method not Found', 404); // If the method not exist with in this class, response would be \"Page not found\".*/\n\t}\n\n }", "public function classes() {\n\t\t$this->ApiClass = ClassRegistry::init('ApiGenerator.ApiClass');\n\t\t$classIndex = $this->ApiClass->getClassIndex();\n\t\t$this->set('classIndex', $classIndex);\n\t}", "protected function processSourceTree () {\n\t\t$this->processFileTree();\n\t\tforeach (get_declared_interfaces() as $interface) {\n\t\t$ref = new ReflectionClass($interface);\n\t\t\tif ($ref->isUserDefined()) {\n\t\t\t\t$this->classes[] = $ref;\n\t\t\t}\n\t\t}\n\t\tforeach (get_declared_classes() as $class) {\n\t\t\t$ref = new ReflectionClass($class);\n\t\t\tif ($ref->isUserDefined() && !preg_match('/^Spd/', $class)) {\n\t\t\t\t$this->classes[] = $ref;\n\t\t\t}\n\t\t}\n\t}", "public function any(){\n return call_user_func_array($this->fetchStaticClassName() . '::' . __FUNCTION__, func_get_args());\n }", "private function callClassMethod(array $classFromCollection, array $args) {\n if(class_exists($classFromCollection[\"controller\"])) {\n $controller = new $classFromCollection[\"controller\"];\n $method = $classFromCollection[\"method\"];\n\n call_user_func_array(array($controller,$method), $args);\n }\n }", "public function getClasses();", "public function getClasses();", "public function getClasses();", "public function run()\n {\n Model::unguard();\n\n $this->call(FB_api_mode::class);\n $this->call(FB_page_edge::class);\n $this->call(FB_field::class);\n $this->call(FB_page_edge_node::class);\n $this->call(FB_edge_edgeNode::class);\n $this->call(FB_field_followingrequest::class);\n $this->call(FB_parent_field::class);\n $this->call(Provider::class);\n $this->call(User::class);\n $this->call(News::class);\n $this->call(InfoApiCost::class);\n $this->call(MediaApiCost::class);\n $this->call(ForumSection::class);\n $this->call(CheckoutFlow::class);\n $this->call(ApiDiscount::class);\n $this->call(UserPayment::class);\n $this->call(FB_api_group_full_mode_and_statistics::class);\n\n Model::reguard();\n }", "public function processApi()\n {\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['mode'])));\n if((int)method_exists($this,$func) > 0)\n {\n $this->$func();\n } \n else\n {\n $data = array('code' => \"404\", 'status' => \"failure\", \"msg\" => \"requested method not available\", \"data\" => array());\n $this->response($this->json($data)); \n }\n \n // If the method not exist with in this class, response would be \"Page not found\".\n }", "public function apiHandling() {\r\n $data = empty($_POST) ? $_GET : $_POST;\r\n $controllerName = empty($data['control_type']) ? \"\" : $data['control_type'];\r\n $apiRequest = empty($data['api_name']) ? \"\" : $data['api_name'];\r\n $controllerName = ucwords($controllerName).\"_Controller\";\r\n Common::loadClass(CONTROLLERS_PATH);\r\n if ($_SERVER['SERVER_NAME'] == Constants::MAIN_SERVER_URL && !empty($controllerName) && !empty($apiRequest) && file_exists(CONTROLLERS_PATH.$controllerName.\".php\") ) {\r\n $classobj = new $controllerName();\r\n if(method_exists($classobj, $apiRequest)){\r\n call_user_func([$classobj, $apiRequest]);\r\n } else {\r\n $this->wrongAPiHit();\r\n }\r\n } else {\r\n $this->wrongAPiHit();\r\n }\r\n }", "public function processApi(){\n\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['rquest'])));\n\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t$this->$func();\n\t\telse\n\t\t\t$this->response('',404);\t// If the method not exist with in this class, response would be \"Page not found\".\n\t}", "private function _callToDefault()\n {\n foreach (get_class_methods($this) as $method) {\n try {\n $that = new ReflectionMethod($this, $method);\n } catch (ReflectionException $exception) {\n break;\n }\n if (\n $that->isProtected()\n && !array_key_exists($method, $this->query())\n ) {\n $this->{$method}($this->builder);\n }\n }\n }", "protected function init() {\n\t\t$routes = $this->routePluginManager;\n\t\tforeach ( array (\n\t\t\t\t'hostname' => __NAMESPACE__ . '\\Hostname',\n\t\t\t\t'literal' => __NAMESPACE__ . '\\Literal',\n\t\t\t\t'part' => __NAMESPACE__ . '\\Part',\n\t\t\t\t'regex' => __NAMESPACE__ . '\\Regex',\n\t\t\t\t'scheme' => __NAMESPACE__ . '\\Scheme',\n\t\t\t\t'segment' => __NAMESPACE__ . '\\Segment',\n\t\t\t\t'wildcard' => __NAMESPACE__ . '\\Wildcard',\n\t\t\t\t'query' => __NAMESPACE__ . '\\Query',\n\t\t\t\t'method' => __NAMESPACE__ . '\\Method' \n\t\t) as $name => $class ) {\n\t\t\t$routes->setInvokableClass ( $name, $class );\n\t\t}\n\t\t;\n\t}", "function sellegance_body_classes( $classes ) {\n\n\t// add boxed layout class if selected\n\tif ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {\n\t\n\t// Modify the array $classes to your needs\n\tif( is_page() )\n\t{\n\t\t$classes[] = 'woocommerce';\n\t\t$classes[] = 'woocommerce-page';\n\t} \n\treturn $classes;\n\t}\n\n}", "public static function get_post_type_controller_classes()\n {\n\n // TODO: looks like we are not using this at all?\n\n $hook = 'rp_sub_custom_post_type_controllers';\n\n // Too early\n if (!has_filter($hook)) {\n RightPress_Help::doing_it_wrong(__METHOD__, 'Method should not be called before callbacks for action hook _rp_sub_custom_post_type_controllers are set up.', '3.0');\n }\n\n // Allow other classes to register post type controllers\n return apply_filters($hook, array());\n }", "public function load(...$classes)\n\t{\n\t\tforeach ($classes as $key => $routes) \n\t\t{\n\t\t\t$this->getValidatorInstance($routes);\n\t\t}\n\t}", "protected function _callSmartyMethods()\n\t{\n foreach ($this->_smartyMethods as $methodName => $call) {\n\t\t\tforeach ($call as $args) {\n\t\t\t\t$this->_setSmartyMethod($methodName, $args);\n\t\t\t}\n }\n\t\tunset($this->_smartyMethods);\n\t}", "public function hooks()\n {\n foreach ($this->getActions() as $key => $action) {\n switch (true) {\n case $action instanceof HooksAdminInterface:\n if (is_admin()) {\n $action->hooks();\n }\n break;\n case $action instanceof HooksFrontInterface:\n if (!is_admin()) {\n $action->hooks();\n }\n break;\n case $action instanceof HooksInterface:\n $action->hooks();\n break;\n }\n }\n }", "public function processApi(){\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['rquest'])));\n if((int)method_exists($this,$func) > 0)\n $this->$func();\n else\n $this->response('',404);\t\t\t\t// If the method not exist with in this class, response would be \"Page not found\".\n }", "public function processApi(){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['rquest'])));\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->response('',404);\t\t\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t\t}", "protected function runInitializers()\n {\n $methodName = 'init';\n \n # Run ApplicationController's init method.\n if ($inits = $this->getAppControllersMethod($methodName)) {\n foreach ($inits as $init) {\n $init = $init->bindTo($this);\n $init();\n }\n }\n \n $method = $this->getReflection()->getMethod($methodName);\n if ($method->getDeclaringClass()->getName() == get_called_class()) {\n $this->$methodName();\n }\n }", "public function plugin_classes() {\n\t\t$this->options = new Options( $this ) ;\n\t\t$this->helpers = new Helpers( $this );\n\t\t$this->core = new Core( $this );\n\t}", "static function body_class() {\n\t\t$config = self::config();\n\n\t\tif ( ! empty( $config['body-classes'] ) ) {\n\t\t\t$classes = array();\n\t\t\t$handlers_results = array();\n\t\t\tforeach ( $config['body-classes'] as $classname => $resolution ) {\n\t\t\t\tif ( is_string( $resolution ) ) {\n\t\t\t\t\t// ensure handler is executed; and only executed once\n\t\t\t\t\tif ( ! isset( $handlers_results[ $resolution ] ) ) {\n\t\t\t\t\t\t$handlers_results[ $resolution ] = call_user_func( $resolution );\n\t\t\t\t\t}\n\t\t\t\t\t// process result of handler\n\t\t\t\t\tif ( $handlers_results[ $resolution ] ) {\n\t\t\t\t\t\t$classes[] = $classname;\n\t\t\t\t\t}\n\t\t\t\t} else { // assume boolean\n\t\t\t\t\tif ( $resolution ) {\n\t\t\t\t\t\t$classes[] = $classname;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $classes;\n\t\t} else { // no body class handlers\n\t\t\treturn null;\n\t\t}\n\t}", "public function constructClasses() {\r\n\t\t\r\n\t\t$this->_mergeControllerVars();\r\n\t\t\r\n\t\tunset($this->components['Auth']);\r\n\t\t\r\n\t\t$this->Components->init($this);\r\n\t\tif ($this->uses) {\r\n\t\t\t$this->uses = (array) $this->uses;\r\n\t\t\tlist(, $this->modelClass) = pluginSplit(current($this->uses));\r\n\t\t}\r\n\t\treturn true;\r\n\t\t\r\n\t}", "private function activate_classes( $network_wide ) {\n\n\t\tforeach ( $this->get_activatable_classes() as $class ) {\n\t\t\t$class::get_instance()->activate( $network_wide );\n\t\t}\n\t}", "protected function traverseTypes(): void\n {\n if (isset($this->definition->tca['types']) && is_array($this->definition->tca['types'])) {\n foreach ($this->definition->tca['types'] as $type => $def) {\n $this->registerHandlerDefinitions($this->definition->tableName, $def);\n }\n }\n }", "public function getRegisteredRequestHandlerClassNames() {}", "public static function add_classes() {\n\t\t// if ( get_theme_mod('wsu_wds_site_content_is_full_width', false) ) {\n\n\t\t// \tself::add_class('wsu-c-content-width--full');\n\n\t\t// }\n\n\t\t// Add future checks here ...\n\n\t}", "public static function register_help(){\r\n $args = func_get_args();\r\n foreach($args as $class){\r\n //all help class of module should be lowercase\r\n if(class_exists('HW_HOANGWEB') && self::get($class)) {\r\n if(file_exists(self::get($class)->help_path)) {\r\n //HW_HOANGWEB::register_class('HW_HELP_'.strtoupper($class),HW_HELP_PATH.'helps/'.strtolower($class).'.php');\r\n HW_HOANGWEB::register_class('HW_HELP_'.strtoupper($class),rtrim(self::get($class)->help_path,'/').'/'.strtolower($class).'.php');\r\n\r\n }\r\n\r\n }\r\n }\r\n\r\n }", "public function initPhpContext()\r\n {\r\n $this->initAbstractContext();\r\n }", "public function wrapperClasses($extra_classes = []){\n global $post;\n if($this->hasErrors()) return false;\n $default_classes = [\n $this->prefix($this->module, '-'),\n $this->prefix($this->type, '-'),\n $this->prefix($this->location, '-'),\n $this->prefix($this->module, '-').'-'.$this->location.'-'.$this->type,\n $this->prefix($this->location, '-').'-'.$this->type,\n ];\n\n //If the current module is a flexible module, go ahead and load in the default module classes before adding extra classes\n if(!$this->isPartial() && ModuleLoader::isFlexible($this->module)) $default_classes = wp_parse_args($default_classes, $this->getModuleDefaultClasses());\n\n //Load in extra classes\n $classes = wp_parse_args($default_classes, $extra_classes);\n $classes = $this->getWrapperClasses(apply_filters($this->prefix('template_wrapper_classes'), $classes, $classes, $this));\n if(!$this->isPartial() || $this->location != 'wrapper'){\n $classes = 'class=\"'.$classes.'\"';\n }\n else{\n $classes = post_class($classes, $post);\n }\n\n return $classes;\n }", "public function dispatch()\n {\n try {\n list($this->controller, $this->method) = $this->getRegisteredControllerAndMethod();\n\n\n $this->parameters = $this->matchedRoute->attributes;\n\n $this->getReflectionClass($this->controller)\n ->getMethod($this->method)\n ->invokeArgs(\n new $this->controller($this->container),\n $this->parameters\n );\n } catch (\\ReflectionException $e) {\n throw new CfarException(\n CfarException::INVALID_DECLARATION . \". \" . $e->getMessage()\n );\n }\n }", "public static function init() {\r\n\t\r\n\t\tforeach(self::$_classes as $var=>$class) {\r\n\t\t\t\t\r\n\t\t\t$$var = new $class();\r\n\t\t}\r\n\t}", "protected function call($class){\n\t\t$this->plow( new $class );\n }", "function shell_body_class( $classes ){\r\n\r\n\t/* get all registered sidebars */\r\n\tglobal $wp_registered_sidebars;\r\n\r\n\t/* if not empty sidebar */\r\n\tif ( ! empty( $wp_registered_sidebars ) ){\r\n\r\n\t\t/* foreach widget areas */\r\n\t\tforeach ( $wp_registered_sidebars as $sidebar ){\r\n\r\n\t\t\t/* add active/inactive class */\r\n\t\t\t$classes[] = is_active_sidebar( $sidebar['id'] ) ? \"sidebar-{$sidebar['id']}-active\" : \"sidebar-{$sidebar['id']}-inactive\";\r\n\t\t}\r\n\t}\r\n\r\n\t/* get all registered menus */\r\n\t$menus = get_registered_nav_menus();\r\n\r\n\t/* if not empty menus */\r\n\tif ( ! empty( $menus ) ){\r\n\r\n\t\t/* for each menus */\r\n\t\tforeach ( $menus as $menu_id => $menu ){\r\n\r\n\t\t\t/* add active/inactive class */\r\n\t\t\t$classes[] = has_nav_menu( $menu_id ) ? \"menu-{$menu_id}-active\" : \"menu-{$menu_id}-inactive\";\r\n\t\t}\r\n\t}\r\n\r\n\t/* theme layout default */\r\n\tif ( ! current_theme_supports( 'theme-layouts' ) ) {\r\n\t\t$classes[] = 'layout-default';\r\n\t}\r\n\r\n\t/* make it unique */\r\n\t$classes = array_unique( $classes );\r\n\r\n\treturn $classes;\r\n}", "private static function getActions()\n {\n // get the called class\n $calledClass\t\t= get_called_class();\n if (!$calledClass) {\n return array();\n }\n\n if (isset(self::$actions[$calledClass])) {\n return self::$actions[$calledClass];\n }\n\n self::$actions[$calledClass] = array();\n\n // reflect in and find all public static functions defined by that class\n $reflectionClass \t= new \\ReflectionClass($calledClass);\n foreach ($reflectionClass->getMethods() as $method) {\n if ($method->isStatic() && $method->isPublic() && $method->class == $calledClass) {\n self::$actions[$calledClass][] = $method->name;\n }\n }\n\n return self::$actions[$calledClass];\n }", "function mostraTodasClasses() {\r\n\t$arrayClasses = get_declared_classes();\r\n\t\r\n\tif (count($arrayClasses)) {\r\n\t\tforeach ($arrayClasses as $classe) {\r\n\t\t\techo \"Métodos da classe {$classe}<br/>\";\r\n\t\t\t\r\n\t\t\t$metodos = get_class_methods($classe);\r\n\t\t\tif (!count($metodos)) {\r\n\t\t\t\techo \"Classe não possui nenhum método<br/>\";\r\n\t\t\t} else {\r\n\t\t\t\tforeach ($metodos as $metodo) {\r\n\t\t\t\t\techo \"Método: {$metodo} <br/>\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo \"Propriedades:<br />\";\r\n\t\t\t$properties = get_class_vars($classe);\r\n\t\t\tif (!count($properties)) {\r\n\t\t\t\techo \"<i>Não possui</i><br />\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tforeach($properties as $propriedade => $valor) {\r\n\t\t\t\t\techo \"Propriedade: {$propriedade}, Valor: {$valor} <br />\";\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo \"<hr/>\";\r\n\t\t}\r\n\t}\r\n}", "public function supportsClass($class);", "public function supportsClass($class);", "function reflect() {\n $return = array();\n $class = new \\ReflectionClass($this->testingClass);\n $return []= $class;\n\n if (func_num_args() > 0) {\n $args = func_get_args();\n\n foreach ($args as $name) {\n if (Text::beginsWith($name, 'method:')) {\n $property = $class->getMethod(Text::getSubstringAfter($name, 'method:'));\n }\n else {\n $property = $class->getProperty($name);\n }\n $property->setAccessible(true);\n $return []= $property;\n }\n }\n if (count($return) === 1) {\n return $class;\n }\n return $return;\n }", "public function run()\n {\n $this->call(SocialIcons::class);\n $this->call(BackgroundImages::class);\n $this->call(UserAdminAcount::class);\n }", "public function processApi() {\n\t\t$func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['rquest'])));\n\t\tif ((int) method_exists($this, $func) > 0)\n\t\t\t$this -> $func();\n\t\telse\n\t\t\t$this -> response('', 404);\n\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t}", "public function processApi() {\n\t\t$func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['rquest'])));\n\t\tif ((int) method_exists($this, $func) > 0)\n\t\t\t$this -> $func();\n\t\telse\n\t\t\t$this -> response('', 404);\n\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t}", "public function routeScans()\n {\n if ($this->scanEverything) {\n return $this->getAllClasses();\n }\n\n $classes = $this->scanRoutes;\n\n // scan the controllers namespace if the flag is set\n if ($this->scanControllers) {\n $classes = array_merge(\n $classes,\n $this->getClassesFromNamespace($this->getAppNamespace().'Http\\\\Controllers')\n );\n }\n\n return $classes;\n }", "public function processApi(){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['value'])));\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->response('',404);\t\t\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t\t}", "public function processApi() {\n if (isset($_REQUEST['x']) && $_REQUEST['x'] != \"\") {\n $func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['x'])));\n if ((int)method_exists($this, $func) > 0) {\n $this->$func();\n } else {\n echo 'method not exist';\n exit;\n }\n } else {\n echo 'method not exist';\n exit;\n }\n }", "public static function requestClass(): string;", "public function getActiveMethods();" ]
[ "0.5964458", "0.5905702", "0.5806874", "0.553885", "0.5505963", "0.54662776", "0.5438572", "0.53977716", "0.5393653", "0.53520226", "0.53430855", "0.5314377", "0.5312421", "0.53078485", "0.5297082", "0.5234723", "0.5225102", "0.5224057", "0.51966256", "0.5140371", "0.51292986", "0.51266843", "0.51255935", "0.5090067", "0.5077513", "0.5071468", "0.50686044", "0.50417703", "0.5036222", "0.50213104", "0.5017623", "0.49968007", "0.4995186", "0.4992514", "0.49784708", "0.4975769", "0.49633992", "0.49600857", "0.49401233", "0.4936221", "0.4918771", "0.49131984", "0.49069354", "0.49062046", "0.48891664", "0.4863825", "0.4857937", "0.48538014", "0.48493615", "0.48486558", "0.48486456", "0.4848407", "0.48435426", "0.48391613", "0.48354918", "0.4829917", "0.4815109", "0.4815109", "0.4815109", "0.481177", "0.4795319", "0.47950348", "0.47938702", "0.4791473", "0.47840852", "0.47813964", "0.47595292", "0.47473016", "0.47406232", "0.47367966", "0.4734136", "0.47324675", "0.4730177", "0.47198537", "0.47150242", "0.47127202", "0.47109795", "0.4703979", "0.46926585", "0.46893597", "0.4685153", "0.467141", "0.46551314", "0.46504748", "0.4649161", "0.46453077", "0.4639114", "0.46386522", "0.46379343", "0.46375293", "0.46375293", "0.46345383", "0.4634088", "0.46331033", "0.46331033", "0.46302685", "0.46211585", "0.46177357", "0.46161038", "0.46138617" ]
0.77806777
0
Loops through all the registered admin pages and attempts to call classs methods based on wpf_get_request().
function wpf_load_admin_pages() { if ( !is_admin() ) return; global $wpf_classes; if ( isset($wpf_classes['admin']) && !empty($wpf_classes['admin']) ) { foreach ( $wpf_classes['admin'] as $handle => $class ) { if ( !isset($wpf_classes[$handle]) ) { $wpf_classes[$handle] = new $class; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setupAdminRoutes() {\n if ( class_exists('GetStartedController') ) {\n add_action('wp_ajax_getstarted', 'GetStartedController::pageAjax');\n add_action('wp_ajax_nopriv_getstarted', 'GetStartedController::pageAjax');\n }\n if ( class_exists('PricingController') ) {\n add_action('wp_ajax_pricing', 'PricingController::pageAjax');\n add_action('wp_ajax_nopriv_pricing', 'PricingController::pageAjax');\n }\n if ( class_exists('AppearanceController') ) {\n add_action('wp_ajax_appearance', 'AppearanceController::pageAjax');\n add_action('wp_ajax_nopriv_appearance', 'AppearanceController::pageAjax');\n }\n if ( class_exists('AccountController') ) {\n add_action('wp_ajax_account', 'AccountController::pageAjax');\n add_action('wp_ajax_nopriv_account', 'AccountController::pageAjax');\n }\n }", "public function acfedu_load_admin_pages() {\n\t\t\t\tinclude( 'inc/dashboard-page.php' );\n\t\t\t\tinclude( 'inc/settings-page.php' );\n\t\t\t\tinclude( 'inc/pro-page.php' );\n\t\t\t}", "function admin_page_load() {\n\t\t$this->jetpack->admin_page_load();\n\t}", "private function instantiate_admin_pages() {\n $this->admin_objs[ 'menu' ] = new HRHS_Admin_Menu();\n }", "abstract public function\r\n\t\tget_admin_page_class_name();", "public function admin_menu() {\n\t\t// Load abstract page class.\n\t\trequire_once SF_ABSPATH . '/includes/settings/class-socialflow-admin-settings-page.php';\n\t\t// Load page classes.\n\t\trequire_once SF_ABSPATH . '/includes/settings/class-socialflow-admin-settings-general.php';\n\t\trequire_once SF_ABSPATH . '/includes/settings/class-socialflow-admin-settings-accounts.php';\n\t\trequire_once SF_ABSPATH . '/includes/settings/class-socialflow-admin-settings-messages.php';\n\t\trequire_once SF_ABSPATH . '/includes/settings/class-socialflow-admin-settings-categories.php';\n\n\t\t// Init menu classes.\n\t\tnew SocialFlow_Admin_Settings_General();\n\t\tnew SocialFlow_Admin_Settings_Accounts();\n\t\t// new SocialFlow_Admin_Settings_Categories.\n\t\t// new SocialFlow_Admin_Settings_Messages.\n\t}", "public function admin_page()\n {\n }", "public function admin_page()\n {\n }", "protected function admin_page_action() {\n\n\t\tif ( $this->is_admin_request_for_users_forget() ) {\n\t\t\t$this->users_forget();\n\t\t}\n\n\t\tif ( $this->is_admin_request_for_users_send_email() ) {\n\t\t\t$this->users_send_email();\n\t\t}\n\n\t\tif ( $this->is_admin_request_for_users_remove() ) {\n\t\t\t$this->users_remove_from_list();\n\t\t}\n\n\t\t/* Default settings page */\n\t\t$this->add_view_option( 'data', $this->get_all_requested_users_data( $confirmed_only = true ) );\n\n\t}", "public function addAdminMenuEntries(): void {\n foreach ($this->adminPages as $page) {\n (new $page($this->container));\n }\n }", "public static function registerAdminPages()\n {\n // First add main pages\n if (static::$adminPages) {\n $adminPages = new Collection(static::$adminPages);\n\n foreach ($adminPages as $adminPage) {\n add_menu_page(\n array_get($adminPage, 'label'),\n array_get($adminPage, 'title'),\n array_get($adminPage, 'capability'),\n array_get($adminPage, 'route'),\n array_get($adminPage, 'callback'),\n array_get($adminPage, 'icon'),\n array_get($adminPage, 'position')\n );\n }\n }\n\n // Then add sub pages\n if (static::$adminSubPages) {\n // Order by position\n usort(static::$adminSubPages, function($a, $b) {\n return $a['position'] > $b['position'];\n });\n\n // Add pages\n foreach (static::$adminSubPages as $adminSubPage) {\n $route = array_get($adminSubPage, 'route');\n $url = array_get($adminSubPage, 'options.url');\n\n if (! $route and $url) {\n add_submenu_page(\n array_get($adminSubPage, 'parent'),\n array_get($adminSubPage, 'title'),\n array_get($adminSubPage, 'label'),\n array_get($adminSubPage, 'capability'),\n $url\n );\n } else {\n add_submenu_page(\n array_get($adminSubPage, 'parent'),\n array_get($adminSubPage, 'title'),\n array_get($adminSubPage, 'label'),\n array_get($adminSubPage, 'capability'),\n $route,\n array_get($adminSubPage, 'callback')\n );\n }\n }\n }\n\n // We also need to rename the first item in the navigation\n global $submenu;\n\n if (isset($submenu['op-suite'])) {\n $submenu['op-suite'][0][0] = __('Dashboard', 'op3');\n }\n }", "public function register_admin_page()\n {\n }", "function wpf_load_contextual_classes() {\n\tglobal $wpf_classes, $wpf_theme;\n\n\tif ( isset($wpf_classes['contextual']) && !empty( $wpf_classes['contextual'] ) ) {\n\t\t$methods = array();\n\n\t\t// Get the context, but not in the admin.\n\t\tif ( !is_admin() ) {\n\t\t\t$context = array_reverse( (array) wpf_get_request() );\n\n\t\t\tif ( !empty($context) ) {\n\t\t\t\tforeach ( $context as $method ) {\n\t\t\t\t\t$methods[] = str_replace( '-', '_', $method );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tforeach ( (array) $wpf_classes['contextual'] as $handle => $class ) {\n\t\t\tif ( isset($wpf_classes[$handle]) )\n\t\t\t\tcontinue;\n\n\t\t\t// Call the admin method if we're in the admin area.\n\t\t\tif ( is_admin() ) {\n\t\t\t\t$wpf_theme->callback( $wpf_classes['contextual'][$handle], 'admin' );\n\n\t\t\t} else {\n\n\t\t\t\t// Call the constructor method if we're not in the admin,\n\t\t\t\t// pass all the methods that are valid for this page request.\n\t\t\t\t$wpf_classes[$handle] = new $class( $methods );\n\t\t\t}\n\n\t\t\t// Call all the contextual methods.\n\t\t\tif ( !empty( $methods ) ) {\n\t\t\t\tforeach( $methods as $method ) {\n\t\t\t\t\t$wpf_theme->callback( $wpf_classes[$handle], $method );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "public function load_admin_page() {\n\t \t\n\t\t// determine the action from either the GET parameter (for sub-menu entries, and the main admin menu entry)\n\t\t$action = ( ! empty( $_GET['action'] ) ) ? $_GET['action'] : 'list'; // default action is list\n\t\t\n\t\tif ( $this->is_top_level_page ) {\n\t\t\t// or for sub-menu entry of an admin menu \"IggoGrid\" entry, get it from the \"page\" GET parameter\n\t\t\tif ( 'iggogrid' !== $_GET['page'] ) {\n\t\t\t\t\n\t\t\t\t// actions that are top-level entries, but don't have an action GET parameter (action is after last _ in string)\n\t\t\t\t$action = substr( $_GET['page'], 9 ); // $_GET['page'] has the format 'iggogrid_{$action}'\n\t\t\t}\n\t\t} else {\n\t\t\t// do this here in the else-part, instead of adding another if ( ! $this->is_top_level_page ) check\n\t\t\t$this->init_i18n_support(); // done here, as for sub menu admin pages this is the first time translated strings are needed\n\t\t\t$this->init_view_actions(); // for top-level menu entries, this has been done above, just like init_i18n_support()\n\t\t}\n\t\t\n\t\t// check if action is a supported action, and whether the user is allowed to access this screen\n\t\tif ( ! isset( $this->view_actions[ $action ] ) || ! current_user_can( $this->view_actions[ $action ]['required_cap'] ) ) {\n\t\t\twp_die( __( 'You do not have sufficient permissions to access this page.', 'default' ) );\n\t\t}\n\t\t\n\t\t// changes current screen ID and pagenow variable in JS, to enable automatic meta box JS handling\n\t\tset_current_screen( \"iggogrid_{$action}\" );\n\n\t\t// pre-define some table data\n\t\t$data = array(\n\t\t\t'view_actions' => $this->view_actions,\n\t\t\t'message' => ( ! empty( $_GET['message'] ) ) ? $_GET['message'] : false,\n\t\t);\n\t\t\n\t\t// depending on action, load more necessary data for the corresponding view\n\t\tswitch ( $action ) {\n\t\t\tcase 'list':\n\t\t\t\t$data['table_id'] = ( ! empty( $_GET['table_id'] ) ) ? $_GET['table_id'] : false;\n\t\t\t\t$data['table_ids'] = IggoGrid::$model_table->load_all( true ); // Prime the post meta cache for cached loading of last_editor\n\t\t\t\t$data['messages']['first_visit'] = IggoGrid::$model_options->get( 'message_first_visit' );\n\t\t\t\tif ( current_user_can( 'iggogrid_import_tables_wptr' ) ) {\n\t\t\t\t\t$data['messages']['wp_table_reloaded_warning'] = is_plugin_active( 'wp-table-reloaded/wp-table-reloaded.php' ); // check if WP-Table Reloaded is activated\n\t\t\t\t} else {\n\t\t\t\t\t$data['messages']['wp_table_reloaded_warning'] = false;\n\t\t\t\t}\n\t\t\t\t$data['messages']['show_plugin_update'] = IggoGrid::$model_options->get( 'message_plugin_update' );\n\t\t\t\t$data['messages']['plugin_update_message'] = IggoGrid::$model_options->get( 'message_plugin_update_content' );\n\t\t\t\t$data['messages']['donation_message'] = $this->maybe_show_donation_message();\n\t\t\t\t$data['table_count'] = count( $data['table_ids'] );\n\t\t\t\tbreak;\n\t\t\tcase 'about':\n\t\t\t\t$data['plugin_languages'] = $this->get_plugin_languages();\n\t\t\t\t$data['first_activation'] = IggoGrid::$model_options->get( 'first_activation' );\n// \t\t\t\t$exporter = IggoGrid::load_class( 'IggoGrid_Export', 'class-export.php', 'classes' );\n// \t\t\t\t$data['zip_support_available'] = $exporter->zip_support_available;\n\t\t\t\tbreak;\n\t\t\tcase 'options':\n\t\t\t\t// Maybe try saving \"Custom CSS\" to a file:\n\t\t\t\t// (called here, as the credentials form posts to this handler again, due to how request_filesystem_credentials() works)\n\t\t\t\tif ( isset( $_GET['item'] ) && 'save_custom_css' == $_GET['item'] ) {\n\t\t\t\t\tIggoGrid::check_nonce( 'options', $_GET['item'] ); // nonce check here, as we don't have an explicit handler, and even viewing the screen needs to be checked\n\t\t\t\t\t$action = 'options_custom_css'; // to load a different view\n\t\t\t\t\t// try saving \"Custom CSS\" to a file, otherwise this gets the HTML for the credentials form\n\t\t\t\t\t$iggogrid_css = IggoGrid::load_class( 'IggoGrid_CSS', 'class-css.php', 'classes' );\n\t\t\t\t\t$result = $iggogrid_css->save_custom_css_to_file_plugin_options( IggoGrid::$model_options->get( 'custom_css' ), IggoGrid::$model_options->get( 'custom_css_minified' ) );\n\t\t\t\t\tif ( is_string( $result ) ) {\n\t\t\t\t\t\t$data['credentials_form'] = $result; // this will only be called if the save function doesn't do a redirect\n\t\t\t\t\t} elseif ( true === $result ) {\n\t\t\t\t\t\t// at this point, saving was successful, so enable usage of CSS in files again,\n\t\t\t\t\t\t// and also increase the \"Custom CSS\" version number (for cache busting)\n\t\t\t\t\t\tIggoGrid::$model_options->update( array(\n\t\t\t\t\t\t\t'use_custom_css_file' => true,\n\t\t\t\t\t\t\t'custom_css_version' => IggoGrid::$model_options->get( 'custom_css_version' ) + 1,\n\t\t\t\t\t\t) );\n\t\t\t\t\t\tIggoGrid::redirect( array( 'action' => 'options', 'message' => 'success_save' ) );\n\t\t\t\t\t} else { // leaves only $result = false\n\t\t\t\t\t\tIggoGrid::redirect( array( 'action' => 'options', 'message' => 'success_save_error_custom_css' ) );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$data['frontend_options']['use_custom_css'] = IggoGrid::$model_options->get( 'use_custom_css' );\n\t\t\t\t$data['frontend_options']['custom_css'] = IggoGrid::$model_options->get( 'custom_css' );\n\t\t\t\t$data['user_options']['parent_page'] = $this->parent_page;\n\t\t\t\t$data['user_options']['plugin_language'] = IggoGrid::$model_options->get( 'plugin_language' );\n\t\t\t\t$data['user_options']['plugin_languages'] = $this->get_plugin_languages();\n\t\t\t\tbreak;\n\t\t\tcase 'edit':\n\t\t\t\tif ( ! empty( $_GET['table_id'] ) ) {\n\t\t\t\t\t$data['table'] = IggoGrid::$model_table->load( $_GET['table_id'], true, true ); // Load table, with table data, options, and visibility settings\n// \t\t\t\t\tprint_r($data['table']);die;\n\t\t\t\t\tif ( is_wp_error( $data['table'] ) ) {\n\t\t\t\t\t\tIggoGrid::redirect( array( 'action' => 'list', 'message' => 'error_load_table' ) );\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! current_user_can( 'iggogrid_edit_table', $_GET['table_id'] ) ) {\n\t\t\t\t\t\twp_die( __( 'You do not have sufficient permissions to access this page.', 'default' ) );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tIggoGrid::redirect( array( 'action' => 'list', 'message' => 'error_no_table' ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Filter the data that is passed to the current IggoGrid View.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param array $data Data for the view.\n\t\t * @param string $action The current action for the view.\n\t\t */\n\t\t$data = apply_filters( 'iggogrid_view_data', $data, $action );\n\t\t\n\t\t// prepare and initialize the view\n\t\t$this->view = IggoGrid::load_view( $action, $data );\n\t}", "private function admin_ajax_routing() {\n\n\t\t// Load API injection\n\t\t$this->add_action( 'wp_ajax_flowdrive_get_profile', $this->api, 'getUserProfile');\n\t\t$this->add_action( 'wp_ajax_flowdrive_get_base_folders', $this->api, 'getBaseFolders');\n\t\t$this->add_action( 'wp_ajax_flowdrive_get_layer', $this->api, 'getLayer');\n\t\t$this->add_action( 'wp_ajax_flowdrive_compare', $this->api, 'compare');\n\t\t$this->add_action( 'wp_ajax_flowdrive_get_folder_contents', $this->api, 'getFolderContents');\n\t\t$this->add_action( 'wp_ajax_flowdrive_post_item', $this->api, 'postItem');\n\t}", "public function admin_page()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n echo $this->return_admin_page();\n }", "public function addAdminMenuPage()\n\t{\n\t\t$menuPage = &ModelAdminMenu::getScheme();\n\n\t\tforeach ( $menuPage as $menu ) {\n\t\t\t$callback = array_keys( $menu );\n\t\t\t$paramArr = array_values( $menu );\n\n\t\t\t$this->_adminMenuPage( $callback[0], $paramArr[0]['parameters'] );\n\t\t}\n\t}", "public function startup() {\n\t\tA('AdminInterface')->bind('GatherAdminPages', array(\n\t\t\t'Core Settings' => array(\n\t\t\t\t'config' => $this->config,\n\t\t\t\t'fields' => array(\n\t\t\t\t\tSETTING_DEFAULT_BASE_PATH => array( \n\t\t\t\t\t\t'title' => 'Base Path',\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'value' => $this->config->getConfigValue(SETTING_DEFAULT_BASE_PATH)),\n\t\t\t\t\tSETTING_SITE_URL => array(\n\t\t\t\t\t\t'title' => 'Base URL',\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'value' => $this->config->getConfigValue(SETTING_SITE_URL, '')),\t\n\t\t\t\t\tSETTING_ENVIRONMENT => array(\n\t\t\t\t\t\t'title' => 'Environment',\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'values' => array(\"Development\" => ENV_DEVELOPMENT, \"Test\" => ENV_TEST, \"Production\" => ENV_PRODUCTION),\n\t\t\t\t\t\t'selected' => $this->config->getConfigValue(SETTING_ENVIRONMENT)),\n\t\t\t\t),\n\t\t\t)\n\t\t));\n\t}", "private function process_frontend_actions() {\n\t\t\n\t\tif(is_admin()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif($this->is_working() && is_object($this->extras)) {\n\t\t\t$this->extras->page_load_actions();\n\t\t}\n\n\t\n\t}", "function printAdminPage() {\n require ('adminPage.php');\n adminPage($this);\n }", "private static function admin_pages() {\n\t\tglobal $wpseo_admin_pages;\n\n\t\treturn $wpseo_admin_pages;\n\t}", "function fatherly_fcr_process_admin_page()\n{\n include_once(__DIR__ . '/inc/classes/ContentRecirculation.php');\n $pageData = FCR\\ContentRecirculation::init()->getAdminPageData();\n include(__DIR__ . '/inc/pages/feed-content-recirculation.php');\n}", "function bit_admin_page() {\n\t//Creates admin page\n}", "public function admin_menu(): void {\n\t\tif ( is_plugin_active_for_network( plugin_basename( WP_SENTRY_PLUGIN_FILE ) ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tadd_management_page(\n\t\t\t'WP Sentry test',\n\t\t\t'WP Sentry test',\n\t\t\t'activate_plugins',\n\t\t\tself::ADMIN_PAGE_SLUG,\n\t\t\t[ $this, 'render_admin_page' ]\n\t\t);\n\t}", "private function process_adminpanel_actions() {\n\n\t\tif(is_admin()) {\n\t\t\t\n\t\t\trequire_once($this->get_plugin_path() . 'settings-panel.php');\n\t\t\t\n\t\t\t// the settings page has detected an error and asked to abort\n\t\t\tif( isset($_POST['wpudisable']) && check_ajax_referer( 'wp-united-disable') ) {\n\t\t\t\t$this->ajax_auto_disable();\n\t\t\t}\t\n\n\t\t\t// the user wants to manually disable\n\t\t\tif( isset($_POST['wpudisableman']) && check_ajax_referer( 'wp-united-disable') ) {\n\t\t\t\t$this->ajax_manual_disable();\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\tif($this->is_working() && is_object($this->extras)) {\n\t\t\t\t$this->extras->admin_load_actions();\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "private function admin_includes() {\n\n\t\t// admin\n\t\t$this->admin = $this->load_class( '/includes/admin/class-wc-cog-admin.php', 'WC_COG_Admin' );\n\n\t\t// reports\n\t\t$this->admin_reports = $this->load_class( '/includes/admin/class-wc-cog-admin-reports.php', 'WC_COG_Admin_Reports' );\n\n\t\t// import/export handler\n\t\t$this->import_export_handler = $this->load_class( '/includes/class-wc-cog-import-export-handler.php', 'WC_COG_Import_Export_Handler' );\n\t}", "static function adminMenuPage()\n {\n // Include the view for this menu page.\n include PROJECTEN_PLUGIN_ADMIN_VIEWS_DIR . '/admin_main.php';\n }", "public function admin_page()\n {\n echo $this->return_admin_page();\n }", "private function Dispatch()\n {\n /*\n * for the security of the admin portal we will check every time here before any class get called if\n * this user is logged in or not, if not logged in then we will take him to the login,\n * else let him continue to the admin dashboard.\n * and same goes for the users. by this we ensure that no one will be able to access\n * any portal unless he is logged in with the right credentials.\n * also if the user tries to go to the login page and he's already logged in then we will\n * take him to the homepage, no logged in user should be able to go to the login page.\n * */\n// if ($this->_controller == 'admin') {\n// if (Session::Exists('logged_in') !== true || Session::Get('logged_in')->role !== 'admin') {\n// $this->_controller = 'login';\n// $this->_action = 'default';\n//// Redirect::To('login/login', true);\n// }\n// } elseif ($this->_controller == 'user') {\n// if (Session::Exists('logged_in') !== true || Session::Get('logged_in')->role !== 'user') {\n// $this->_controller = 'login';\n// $this->_action = 'default';\n//// Redirect::To('login/default', true);\n// }\n// } elseif ($this->_controller == 'login') {\n// if (Session::Exists('logged_in') == true) {\n// Redirect::Home();\n// }\n// }\n\n /*\n * first we make the controller name we got from the url full, which means add to it the namespace first,\n * then make the first litter of the class capital case (which is what we will do in all our classes),\n * then at the end add the work 'Controller'.\n * so now for example the work index we got from the URL will become: Qiggs\\Controllers\\IndexController\n * in this case, the autoload class will be able to know which class is this.\n * */\n $controllerClassName = 'Framework\\Controllers\\\\' . ucfirst($this->_controller) . 'Controller';\n\n /*\n * for the frontcontroller to be able to call a function at the controller automatically just by splitting the url,\n * we have to add Action after the function/action name, it's like a secret code between us so it can be able to\n * identify an action method and call it.\n * the DefaultAction get called if the url is: www.x.com/index/default ->\n * index: the controller class name,\n * default: the action/function's name\n */\n $actionName = ucfirst($this->_action) . 'Action';\n\n // check first if this controller class exists, if not then take him to the not found class\n if (!class_exists($controllerClassName)) {\n $controllerClassName = self::NOT_FOUND_CONTROLLER;\n }\n\n // if everything is ok so far then initiate the class\n $controller = new $controllerClassName();\n\n // check if the function (action) exists in that initiated class, if not then display 404 not found (not found action).\n if (!method_exists($controller, $actionName)) {\n $this->_action = $actionName = self::NOT_FOUND_ACTION;\n }\n\n // inside of the class that got initiated (in their parent class to be specific, inside Abstract Controller)\n // set these variables (the name of the controller and action and parameters)\n // in case of we needed to use them there and of course inside the controller class we don't have access\n // to this class so this is the perfect way to parse these values there.\n $controller->SetContActParam($this->_controller, $this->_action, $this->_params);\n\n // finally call the function (action) at the class (controller) that got initiated.\n $controller->$actionName();\n\n // now we called a class and also called an action/function in that class so this file will now go to the\n // called class and action.\n }", "public function admin_init()\n\t{\n\t\tforeach( (array) $this->InstanceRegistred as $id => $args ) :\n\t\t\t\\register_setting( $this->page, $args['name'] );\n\t\tendforeach;\n\t}", "public function onAdminMenu()\n {\n foreach( $this->pages as $slug => $page ) {\n add_submenu_page(\n $page['parent'], L10n::__( $page['title'] ), \n L10n::__( $page['title_menu'] ), $page['capability'], \n $slug, array( $this, 'page' . ucfirst( $slug ) )\n );\n }\n }", "function jumpoff_admin_body_class( $classes ){ \n\n global $post;\n\n if( !is_object($post) ) \n return;\n \n // Make sure we're getting $post object\n setup_postdata( $post );\n\n // Returns an object that includes the screen’s ID, base, post type, taxonomy\n // @see https://developer.wordpress.org/reference/functions/get_current_screen\n $screen = get_current_screen();\n\n // Construct class form the post_name\n $page_name = 'admin-'.$post->post_name;\n \n // Construct class from post id\n $post_id = 'admin-post-'.$post->ID;\n \n // If post\n if ( 'post' == $screen->base ) {\n $classes .= ' ' . $screen->post_type . ' ' . $post_id . ' ' . $page_name;\n }\n\n // if default page.php\n if(basename(get_page_template()) === 'page.php'){\n $classes .= ' admin-page';\n }\n \n // Return our admin classes\n return $classes;\n \n // Reset\n wp_reset_postdata( $post );\n}", "public function controlActions(){\n // Check if the tables are created.\n $this->mode = 'admin';\n $this->object = new $this->type();\n $this->titlePage = __((string)$this->object->info->info->form->title);\n $this->layout = (string)$this->object->info->info->form->layout;\n $this->menuInside = $this->menuInside();\n $ui = new NavigationAdmin_Ui($this);\n switch ($this->action) {\n default:\n header('Location: '.url($this->type.'/listAdmin', true));\n exit();\n break;\n case 'listAdmin':\n /**\n * This is the main action for the BackEnd. If we are in DEBUG mode\n * it will create the table automatically.\n */\n $this->checkLoginAdmin();\n $this->content = $this->listAdmin();\n return $ui->render();\n break;\n case 'insertView':\n /**\n * This is the action that shows the form to insert a record in the BackEnd.\n */\n $this->checkLoginAdmin();\n $this->content = $this->insertView();\n return $ui->render();\n break;\n case 'insert':\n /**\n * This is the action that inserts a record in the BackEnd.\n * If the insertion is successful it shows a form to check the record,\n * if not it creates a form with the errors to correct.\n */\n $this->checkLoginAdmin();\n $insert = $this->insert();\n if ($insert['success']=='1') {\n header('Location: '.url($this->type.'/insertCheck/'.$insert['id'], true));\n exit();\n } else {\n $this->messageError = __('errorsForm');\n $this->content = $insert['html'];\n return $ui->render();\n }\n break;\n case 'modifyView':\n case 'modifyViewCheck':\n case 'insertCheck':\n /**\n * This is the action that shows the form to check a record insertion.\n */\n $this->checkLoginAdmin();\n $this->message = ($this->action=='insertCheck' || $this->action=='modifyViewCheck') ? __('savedForm') : '';\n $this->content = $this->modifyView();\n return $ui->render();\n break;\n case 'modifyViewNested':\n /**\n * This is the action that shows the form to modify a record.\n */\n $this->checkLoginAdmin();\n $this->object = $this->object->readObject($this->id);\n $uiObjectName = $this->type.'_Ui';\n $uiObject = new $uiObjectName($this->object);\n $values = array_merge($this->object->valuesArray(), $this->values);\n $this->content = $uiObject->renderForm(array_merge(\n array('values'=>$values,\n 'action'=>url($this->type.'/modifyNested', true),\n 'class'=>'formAdmin formAdminModify',\n 'nested'=>true),\n array()));\n return $ui->render();\n break;\n case 'modify':\n case 'modifyNested':\n /**\n * This is the action that updates a record when updating it.\n */\n $this->checkLoginAdmin();\n $nested = ($this->action == 'modifyNested') ? true : false;\n $modify = $this->modify($nested);\n if ($modify['success']=='1') {\n if (isset($this->values['submit-saveCheck'])) {\n header('Location: '.url($this->type.'/modifyViewCheck/'.$modify['id'], true));\n } else {\n header('Location: '.url($this->type.'/listAdmin', true));\n }\n exit();\n } else {\n $this->messageError = __('errorsForm');\n $this->content = $modify['html'];\n return $ui->render();\n }\n break;\n case 'delete':\n /**\n * This is the action that deletes a record.\n */\n $this->checkLoginAdmin();\n if ($this->id != '') {\n $type = new $this->type();\n $object = $type->readObject($this->id);\n $object->delete();\n }\n header('Location: '.url($this->type.'/listAdmin', true));\n exit();\n break;\n case 'sortSave':\n /**\n * This is the action that saves the order of a list of records.\n * It is used when sorting using the BackEnd.\n */\n $this->checkLoginAdmin();\n $this->mode = 'ajax';\n $object = new $this->type();\n $newOrder = (isset($this->values['newOrder'])) ? $this->values['newOrder'] : array();\n $object->updateOrder($newOrder);\n break;\n case 'sortList':\n /**\n * This is the action that changes the order of the list.\n */\n $this->checkLoginAdmin();\n $object = new $this->type();\n $info = explode('_', $this->id);\n if (isset($info[1]) && $object->attributeInfo($info[1])!='') {\n $orderType = ($info[0]=='asc') ? 'asc' : 'des';\n Session::set('ord_'.$this->type, $orderType.'_'.$info[1]);\n }\n header('Location: '.url($this->type, true));\n exit();\n break;\n case 'addSimple':\n /**\n * This is the action that adds a simple record.\n */\n $this->checkLoginAdmin();\n $this->mode = 'ajax';\n $formObject = $this->type.'_Form';\n $form = new $formObject();\n return $form->createFormFieldMultiple();\n break;\n case 'multiple-delete':\n /**\n * This is the action that deletes multiple records at once.\n */\n $this->checkLoginAdmin();\n $this->mode = 'ajax';\n if (isset($this->values['list-ids'])) {\n $type = new $this->type();\n foreach ($this->values['list-ids'] as $id) {\n $object = $type->readObject($id);\n $object->delete();\n }\n }\n break;\n case 'multiple-activate':\n case 'multiple-deactivate':\n /**\n * This is the action that activates or deactivates multiple records at once.\n * It just works on records that have an attribute named \"active\",\n */\n $this->checkLoginAdmin();\n $this->mode = 'ajax';\n if (isset($this->values['list-ids'])) {\n $primary = (string)$this->object->info->info->sql->primary;\n $where = '';\n foreach ($this->values['list-ids'] as $id) {\n $where .= $primary.'=\"'.$id.'\" OR ';\n }\n $where = substr($where, 0, -4);\n $active = ($this->action == 'multiple-activate') ? '1' : '0';\n $query = 'UPDATE '.Db::prefixTable($this->type).' SET active=\"'.$active.'\" WHERE '.$where;\n Db::execute($query);\n }\n break;\n case 'autocomplete':\n /**\n * This is the action that returns a json string with the records that match a search string.\n * It is used for the autocomplete text input.\n */\n $this->mode = 'json';\n $autocomplete = (isset($_GET['term'])) ? $_GET['term'] : '';\n if ($autocomplete!='') {\n $where = '';\n $concat = '';\n $items = explode('_', $this->id);\n foreach ($items as $itemIns) {\n $item = $this->object->attributeInfo($itemIns);\n $name = (string)$item->name;\n if (is_object($item) && $name!='') {\n $concat .= $name.',\" \",';\n $where .= $name.' LIKE \"%'.$autocomplete.'%\" OR ';\n }\n }\n $where = substr($where, 0, -4);\n $concat = 'CONCAT('.substr($concat, 0, -5).')';\n if ($where!='') {\n $query = 'SELECT '.(string)$this->object->info->info->sql->primary.' as idItem, \n '.$concat.' as infoItem\n FROM '.Db::prefixTable($this->type).'\n WHERE '.$where.'\n ORDER BY '.$name.' LIMIT 20';\n $results = array();\n $resultsAll = Db::returnAll($query);\n foreach ($resultsAll as $result) {\n $resultsIns = array();\n $resultsIns['id'] = $result['idItem'];\n $resultsIns['value'] = $result['infoItem'];\n $resultsIns['label'] = $result['infoItem'];\n array_push($results, $resultsIns);\n }\n return json_encode($results); \n }\n }\n break;\n case 'search':\n /**\n * This is the action that does the default \"search\" on a content object.\n */\n $this->checkLoginAdmin();\n if ($this->id != '') {\n $this->content = $this->listAdmin();\n return $ui->render();\n } else {\n if (isset($this->values['search']) && $this->values['search']!='') {\n $searchString = urlencode(html_entity_decode($this->values['search']));\n header('Location: '.url($this->type.'/search/'.$searchString, true));\n } else {\n header('Location: '.url($this->type.'/listAdmin', true));\n } \n }\n break;\n case 'export-json':\n /**\n * This is the action that exports the complete list of objects in JSON format.\n */\n $this->mode = 'ajax';\n $query = 'SELECT * FROM '.Db::prefixTable($this->type);\n $items = Db::returnAll($query);\n $file = $this->type.'.json';\n $options = array('content'=>json_encode($items), 'contentType'=>'application/json');\n File::download($file, $options);\n return '';\n break;\n }\n }", "private function admin_hooks() {\n\t\t\n\t\t// Actions\n\t\t// Load Nav injection\n\t\t$this->add_action ('admin_menu', $this->nav, 'plugin_menu' );\n\t\t\n\t\t// Load Dashboard widget\n\t\t$this->add_action ('wp_dashboard_setup', $this->admin, 'dashboard');\n\t\t\n\t\t// Load Edit Post additions\n\t\t// $this->add_action ('add_meta_boxes', $this->admin, 'post_edit' );\n\n\t\t// Load social toggles on submitbox, if the setting is available\n\t\t// if (get_option('smmp_view_submitbox'))\n\t\t//\t$this->add_action ('post_submitbox_misc_actions', $this->admin, 'admin_post_submitbox' );\n\t\t\n\t\t// On post update/save\n\t\t// $this->add_action ('save_post', $this->admin, 'admin_post_submitbox_submit');\n\t\t\n\t\t\n\t\t// Load Expired Account notice\n\t\t/*try {$this->admin->validate_accounts (); }\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$this->add_action ('admin_notices', $this->admin, 'notice_accounts' );\n\t\t}*/\n\t\t\n\t\t// Filters\n\t\t// Prevent inner links for flow-drive images\n\t\t$this->add_action ('image_downsize', $this->admin, 'filter_image_downsize', 10, 3);\n\t}", "public function registerRouters () {\n\t\tif ( !current_user_can( 'manage_options' ) )\n\t\t\treturn;\n\n\t\tforeach ( $this->classes as $class ) {\n\t\t\t\\Maven\\Core\\HookManager::instance()->addFilter( 'json_endpoints', array( $class, 'registerRoutes' ) );\n\t\t}\n\t}", "private function admin_includes() {\n\n\t\t// load admin classes\n\t\t$this->admin = $this->load_class( '/includes/admin/class-wc-pip-admin.php', 'WC_PIP_Admin' );\n\t\t$this->orders_admin = $this->load_class( '/includes/admin/class-wc-pip-orders-admin.php', 'WC_PIP_Orders_Admin' );\n\t}", "public function page_test() {\n\n\t\tprint_r($this->permissions->check(\"can_view_admin\"));\n\t}", "private function define_admin_hooks() {\n\n $admin = new Online_Magazine_Manager_Admin( $this->version );\n\n $this->loader->add_action( 'admin_menu', $admin, 'register_admin_menu' );\n $this->loader->add_action( 'init', $admin, 'register_issue_post_type' );\n $this->loader->add_action( 'init', $admin, 'register_issue_article_post_type' );\n $this->loader->add_action( 'init', $admin, 'init_rewrite_rules' );\n $this->loader->add_action( 'parent_file', $admin, 'taxonomy_submenu_correction' );\n\n }", "public function page() {\n\t\t$this->page = $this->plugin->factory->adminPage;\n\t\t$this->page->show();\n\t}", "public function onWpAdminMenu() {\n\t}", "function registerPages() {\n\t \\Idno\\Core\\site()->addPageHandler('\\_known/callback', '\\IdnoPlugins\\Known\\Pages\\Callback');\n\t // Register admin settings\n\t \\Idno\\Core\\site()->addPageHandler('admin/known', '\\IdnoPlugins\\Known\\Pages\\Admin');\n\t // Register settings page\n\t \\Idno\\Core\\site()->addPageHandler('account/known', '\\IdnoPlugins\\Known\\Pages\\Account');\n\n\t /** Template extensions */\n\t // Add menu items to account & administration screens\n\t \\Idno\\Core\\site()->template()->extendTemplate('admin/menu/items', 'admin/known/menu');\n\t \\Idno\\Core\\site()->template()->extendTemplate('account/menu/items', 'account/known/menu');\n\t}", "function dispatch() {\n $app = $this->app;\n $db = $this->db;\n $u = $this->user;\n $cl = $this;\n foreach ($this->pages as $i => $p) {\n $app->group('/'.$p, function () use ($app, $db, $p, $u) {\n $class = 'includes/pages/class.'.$p.'.php';\n if (file_exists($class)) {\n require_once($class);\n $cn = '\\\\'.ucfirst($p);\n $pg = new $cn($app, $db, $u);\n }\n });\n }\n\n $this->app->notFound(function() use($app) {\n $app->halt(404, json_encode(array('status' => 404, 'message' => 'not found')));\n });\n\n $app->run();\n }", "function admin_menu() {\n\t\tif ( class_exists( 'Jetpack' ) )\n\t\t\tadd_action( 'jetpack_admin_menu', array( $this, 'load_menu' ) );\n\t\telse\n\t\t\t$this->load_menu();\n\t}", "public function get_admin_pages() {\n\t\treturn apply_filters( 'pslug_admin_pages_object', array(\n\t\t\t'settings' => array(\n\t\t\t\t'general',\n\t\t\t),\n\t\t) );\n\t}", "public function load_admin_page()\n {\n include 'admin-page.html';\n }", "public function __construct()\n\t{\n\t\tWT()->autoloader->addNamespace(self::$_systemPagesNamespace, SYSTEM_DIR . '/classes/AdminPages');\n\n\t\t// Force error handler details — only if user is logged in.\n\t\tif (WT()->session->isUserLoggedIn() and WT()->settings->adminPanelForceShowErrors) {\n\t\t\tWT()->errors->setShowDetails(true);\n\t\t}\n\n\t\t$pageName = $_GET['c'] ?? WT()->settings->adminPanelDefaultPage;\n\t\t$controller = self::$_registeredPages[$pageName] ?? self::$_systemPagesNamespace . '\\\\'. ucfirst($pageName);\n\n\t\tif (!class_exists($controller)) {\n\t\t\t$this->_redirect(null);\n\t\t}\n\n\t\t// Create instance of real admin panel page controller.\n\t\t$this->_realAdminPanelPage = new $controller;\n\t}", "function ozh_yourls_gsb_admin_page() {\n include_once dirname( __FILE__ ) . '/includes/admin-page.php';\n ozh_yourls_gsb_display_page();\n}", "function omn_superadmin_overview_page() {\n\n\tif( isset($_REQUEST['action']) ) {\n $action = $_REQUEST['action'];\n } else {\n $action = 'default';\n }\n \n switch( $action ) {\n case 'add':\n \tomn_superadmin_overview_page_add();\n \tbreak;\n case 'delete-notification':\n \tomn_delete_notification( $_GET['user'], $_GET['message'] );\n \tomn_superadmin_overview_page_default();\n \tbreak;\n case 'expire-message':\n \tomn_delete_notifications( $_GET['id'] );\n \tomn_superadmin_overview_page_default();\n \tbreak;\n case 'delete-message':\n \tomn_delete_message( $_GET['id'] );\n \tomn_superadmin_overview_page_default();\n \tbreak;\n default:\n \tomn_superadmin_overview_page_default();\n \tbreak;\n }\n}", "public function adminInit()\n {\n if (true === isset($_GET['page'])) {\n switch ($_GET['page']) {\n case 'gf_settings':\n // add our settings page to the Gravity Forms settings menu\n RGForms::add_settings_page('BitPay Payments', array($this, 'optionsAdmin'));\n break;\n default:\n // not used\n }\n }\n }", "public function addActions() {\n\t\t\tadd_action( 'load-toplevel_page_' . Muut::SLUG, array( $this, 'saveSettings' ) );\n\t\t\tadd_action( 'admin_notices', array( $this, 'prepareAdminNotices' ), 9 );\n\t\t\tadd_action( 'admin_notices', array( $this, 'maybeShowReviewRequestNotice' ), 8 );\n\t\t\tadd_action( 'admin_print_scripts', array( $this, 'printJsFieldNames') );\n\t\t}", "public function add_admin_pages() {\n\n\t\tif ( ! function_exists( 'acf_add_options_page' ) ) {\n\t\t\t$this->add_default_options_page();\n\t\t\treturn;\n\t\t}\n\n\t\tacf_add_options_page(\n\t\t\t[\n\t\t\t\t'page_title' => self::OPTIONS_TITLE,\n\t\t\t\t'menu_title' => self::OPTIONS_MENU_TITLE,\n\t\t\t\t'capability' => self::OPTIONS_USER_CAP,\n\t\t\t\t'menu_slug' => self::OPTIONS_MENU_SLUG,\n\t\t\t] );\n\n\t\t$this->add_acf_fields();\n\t}", "public function initializeAdminPanel() {}", "function admin_routing(){\n\tglobal $arpt_adminmenus_slug;\n\t$currenturl = trimslash( get_clean_url() );\n\n\t$admimenus_slug = array_values( $arpt_adminmenus_slug );\n\n\tforeach( $admimenus_slug as $slug ) :\n\t\tforeach( $slug as $subslug ) :\n\t\t\tif( strpos( $currenturl , trimslash( get_admin_url( $subslug['slug'] ) ) ) !== false ) :\n\t\t\t\t$datas = $subslug;\n\t\t\t\tbreak 2;\n\t\t\tendif;\n\t\tendforeach;\n\tendforeach; \n\n\tif( isset( $datas ) ) :\n\t\tif( currentusercan( $datas['access'] ) ) :\n\t\t\techo '<div class=\"admin-' . strtok( $datas['slug'] , '/' ) . '\" data-route=\"'.$datas['slug'].'\">';\n\t\t\techo '<h1 class=\"page-header\">' . get_realname_submenu( $datas['name'] ) . '</h1>';\n\t\t\tcall_user_func( $datas['function'] );\n\t\t\techo '</div>';\n\t\telse :\n\t\t\tcall_user_func( 'adminpage_overview' );\n\t\tendif;\n\telse :\n\t\tcall_user_func( 'adminpage_overview' );\n\tendif;\n}", "function mod_core_admin() {\n\t\tglobal $NeptuneCore;\n\t\tglobal $NeptuneSQL;\n\t\tglobal $NeptuneAdmin;\n\t\t\n\t\tif (!isset($NeptuneCore)) {\n\t\t\t$NeptuneCore = new NeptuneCore();\n\t\t}\t\n\t\tif (!isset($NeptuneSQL)) {\n\t\t\t$NeptuneSQL = new NeptuneSQL();\n\t\t}\t\n\t\tif (!isset($NeptuneAdmin)) {\n\t\t\t$NeptuneAdmin = new NeptuneAdmin();\n\t\t}\t\n\t\t\n\t\t\n\t\tif (neptune_get_permissions() >= 3) {\n\t\t\t$query = $NeptuneCore->var_get(\"system\",\"query\");\n\t\t\tif (@isset($query[1]) && @isset($query[2])) {\n\t\t\t\t$AdminFunction = \"acp_\" . $query[1] . \"_\" . $query[2];\n\t\t\t\t\n\t\t\t\t$AdminFunction();\n\t\t\t} else {\n\t\t\t\t$NeptuneAdmin->run();\n\t\t\t}\n\t\t} else {\n\t\t\t$NeptuneCore->title($NeptuneCore->var_get(\"locale\",\"accessdenied\"));\n\t\t\t$NeptuneCore->neptune_echo(\"<p>\" . $NeptuneCore->var_get(\"locale\",\"nopermission\") . \"</p>\");\n\t\t\t\n\t\t\theader(\"HTTP/1.1 403 Forbidden\");\n\t\t}\n\t}", "public function admin() {\n // Check the arguments\n $args = func_get_args();\n\n if (count($args) == 1) {\n if ($this->isPHPScript($args[0])) {\n $this->_adminPanel = array('script' => $args[0]);\n } else {\n $this->_adminPanel = $args[0];\n }\n } elseif (count($args) == 2) {\n // @TODO\n }\n // Implemented by extended classes\n }", "private function actions() {\n\n $this->prefix = CUSTOM_LOGIN_OPTION;\n\n register_activation_hook( CUSTOM_LOGIN_FILE, array( $this, 'activate' ) );\n\n add_action( 'login_head', array( $this, 'cl_version_in_header' ), 1 );\n add_action( 'wp_head', array( $this, 'cl_version_in_header' ) );\n add_action( 'admin_menu', array( $this, 'admin_menu' ), 9 );\n add_action( 'admin_init', array( $this, 'load_settings' ), 8 );\n add_action( $this->prefix . '_after_sanitize_options', array( $this, 'delete_transients' ), 8 );\n\n add_action( 'admin_notices', array( $this, 'show_notifications' ) );\n add_action( 'admin_init', array( $this, 'notification_ignore' ) );\n\n do_action( $this->prefix . '_actions' );\n }", "function ecapi_admin_intercept() {\r\n\tif( $_SERVER['REQUEST_METHOD'] === 'POST' \r\n\t\t&& array_key_exists('page', $_POST) && 'ecapi-config' === $_POST['page'] ) \r\n\t\tecapi_config_page();\r\n}", "function user_can_access_admin_page()\n {\n }", "function index_action()\n {\n $this->object->enqueue_backend_resources();\n if ($token = $this->object->is_authorized_request()) {\n // Get each form. Validate it and save any changes if this is a post\n // request\n $tabs = array();\n $errors = array();\n $action = $this->object->_get_action();\n $success = $this->param('message');\n if ($success) {\n $success = $this->object->get_success_message();\n } else {\n $success = $this->object->is_post_request() ? $this->object->get_success_message() : '';\n }\n // First, process the Post request\n if ($this->object->is_post_request() && $this->has_method($action)) {\n $this->object->{$action}($this->object->param($this->context));\n }\n $index_template = $this->object->index_template();\n foreach ($this->object->get_forms() as $form) {\n $form->page = $this->object;\n $form->enqueue_static_resources();\n if ($this->object->is_post_request()) {\n if ($form->has_method($action)) {\n $form->{$action}($this->object->param($form->context));\n }\n }\n // This is a strange but necessary hack: this seemingly extraneous use of to_accordion_tab() normally\n // just means that we're rendering the admin content twice but NextGen Pro's pricelist and coupons pages\n // actually depend on echo'ing the $tabs variable here, unlike the 'nextgen_admin_page' template which\n // doesn't make use of the $tabs parameter at all.\n // TLDR: The next two lines are necessary for the pricelist and coupons pages.\n if ($index_template !== 'photocrati-nextgen_admin#nextgen_admin_page') {\n $tabs[] = $this->object->to_accordion_tab($form);\n }\n $forms[] = $form;\n if ($form->has_method('get_model') && $form->get_model()) {\n if ($form->get_model()->is_invalid()) {\n if ($form_errors = $this->object->show_errors_for($form->get_model(), TRUE)) {\n $errors[] = $form_errors;\n }\n $form->get_model()->clear_errors();\n }\n }\n }\n // Render the view\n $index_params = array('page_heading' => $this->object->get_page_heading(), 'tabs' => $tabs, 'forms' => $forms, 'errors' => $errors, 'success' => $success, 'form_header' => FALSE, 'header_message' => $this->object->get_header_message(), 'nonce' => M_Security::create_nonce($this->object->get_required_permission()), 'show_save_button' => $this->object->show_save_button(), 'model' => $this->object->has_method('get_model') ? $this->get_model() : NULL, 'logo' => $this->get_router()->get_static_url('photocrati-nextgen_admin#imagely_icon.png'));\n $index_params = array_merge($index_params, $this->object->get_index_params());\n $this->render_partial($index_template, $index_params);\n } else {\n $this->render_view('photocrati-nextgen_admin#not_authorized', array('name' => $this->object->name, 'title' => $this->object->get_page_title()));\n }\n }", "function mmf_admin() {\n\t\tinclude('mmf_admin_page.php');\n\t}", "public function connect() {\n\t\t\t$result_id = $this->getResultId();\n\n\t\t\t$this->hidden = apply_filters( 'wbcr_factory_000_page_is_hidden_' . $result_id, $this->hidden );\n\n\t\t\tif ( $this->hidden ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$this->internal = apply_filters( 'wbcr_factory_000_page_is_internal_' . $result_id, $this->internal );\n\n\t\t\tif ( $this->internal ) {\n\t\t\t\t$this->menu_target = null;\n\t\t\t\t$this->menu_post_type = null;\n\t\t\t}\n\n\t\t\t// makes redirect to the page\n\t\t\t$controller = $this->request->get( 'fy_page', null, true );\n\n\t\t\tif ( $controller && $controller == $this->id ) {\n\t\t\t\t$plugin = $this->request->get( 'fy_plugin', null, true );\n\n\t\t\t\tif ( $this->plugin->getPluginName() == $plugin ) {\n\n\t\t\t\t\t$action = $this->request->get( 'fy_action', 'index', true );\n\t\t\t\t\t$is_ajax = $this->request->get( 'fy_ajax', false );\n\n\t\t\t\t\tif ( $is_ajax ) {\n\t\t\t\t\t\t$this->executeByName( $action );\n\t\t\t\t\t\texit;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t$params = (array) $this->request->getAll( true );\n\n\t\t\t\t\t\tunset( $params['fy_page'] );\n\t\t\t\t\t\tunset( $params['fy_plugin'] );\n\t\t\t\t\t\tunset( $params['fy_action'] );\n\n\t\t\t\t\t\t$this->redirectToAction( $action, $params );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// calls scripts and styles, adds pages to menu\n\t\t\tif ( $this->request->get( 'page', 'none' ) == $result_id ) {\n\t\t\t\t$this->assets( $this->scripts, $this->styles );\n\n\t\t\t\tif ( ! $this->scripts->isEmpty( 'bootstrap' ) || ! $this->styles->isEmpty( 'bootstrap' ) ) {\n\t\t\t\t\tadd_action( 'wbcr_factory_000_bootstrap_enqueue_scripts_' . $this->plugin->getPluginName(), [\n\t\t\t\t\t\t$this,\n\t\t\t\t\t\t'actionAdminBootstrapScripts'\n\t\t\t\t\t] );\n\t\t\t\t}\n\n\t\t\t\t// includes styles and scripts\n\t\t\t\tif ( ! $this->scripts->isEmpty() || ! $this->styles->isEmpty() ) {\n\t\t\t\t\tadd_action( 'admin_enqueue_scripts', [ $this, 'actionAdminScripts' ] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if this page for a custom menu page\n\t\t\tif ( $this->menu_post_type ) {\n\t\t\t\t$this->menu_target = 'edit.php?post_type=' . $this->menu_post_type;\n\n\t\t\t\tif ( empty( $this->capabilitiy ) ) {\n\t\t\t\t\t$this->capabilitiy = 'edit_' . $this->menu_post_type;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// sets default capabilities\n\t\t\tif ( empty( $this->capabilitiy ) ) {\n\t\t\t\t$this->capabilitiy = 'manage_options';\n\t\t\t}\n\n\t\t\t// submenu\n\t\t\tif ( $this->menu_target ) {\n\t\t\t\tadd_submenu_page( $this->menu_target, $this->getPageTitle(), $this->getMenuTitle(), $this->capabilitiy, $result_id, [\n\t\t\t\t\t$this,\n\t\t\t\t\t'show'\n\t\t\t\t] );\n\t\t\t\t// global menu\n\t\t\t} else {\n\t\t\t\tadd_menu_page( $this->getPageTitle(), $this->getMenuTitle(), $this->capabilitiy, $result_id, [\n\t\t\t\t\t$this,\n\t\t\t\t\t'show'\n\t\t\t\t], null, $this->menu_position );\n\n\t\t\t\tif ( ! empty( $this->menu_sub_title ) ) {\n\n\t\t\t\t\tadd_submenu_page( $result_id, $this->menu_sub_title, $this->menu_sub_title, $this->capabilitiy, $result_id, [\n\t\t\t\t\t\t$this,\n\t\t\t\t\t\t'show'\n\t\t\t\t\t] );\n\t\t\t\t}\n\n\t\t\t\tadd_action( 'admin_head', [ $this, 'actionAdminHead' ] );\n\t\t\t}\n\n\t\t\t// executes an action\n\t\t\tif ( $this->current() ) {\n\t\t\t\tob_start();\n\t\t\t\t$action = $this->request->get( 'action', 'index', true );\n\t\t\t\t$this->executeByName( $action );\n\t\t\t\t$this->result = ob_get_contents();\n\t\t\t\tob_end_clean();\n\t\t\t}\n\t\t}", "function create_AdminPages()\n\t{\t\t\n\t\t$parentSlug = \"edit.php?post_type=imperial_topic\";\n\t\t$page_title=\"Settings\";\n\t\t$menu_title=\"Settings\";\n\t\t$menu_slug=\"topic-settings\";\n\t\t$function= array( $this, 'drawTopicSettings' );\n\t\t$myCapability = \"manage_options\";\n\t\tadd_submenu_page($parentSlug, $page_title, $menu_title, $myCapability, $menu_slug, $function);\n\n\t\t\n\t\t\n\t}", "function showAdmins() {\n // permissions...\n if(!Current_User::isDeity()) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Menu.php');\n $error = 'Uh Uh Uh! You didn\\'t say the magic word!';\n Sysinventory_Menu::showMenu($error);\n return;\n }\n // see if we need to do anything to the db\n if(isset($_REQUEST['newadmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->department_id = $_REQUEST['department_id'];\n $admin->username = $_REQUEST['username'];\n $admin->save();\n }else if (isset($_REQUEST['deladmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->id = $_REQUEST['id'];\n $admin->delete();\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Administrators';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of admins\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $adminList = Sysinventory_Admin::generateAdminList();\n // get the list of departments\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Department.php');\n $depts = Sysinventory_Department::getDepartmentsByUsername();\n\n // build the array for the department drop-down box\n $deptIdSelect = array();\n foreach($depts as $dept) {\n $deptIdSelect[$dept['id']] = $dept['description'];\n }\n\n // make the form for adding a new admin\n $form = new PHPWS_Form('add_admin');\n $form->addSelect('department_id',$deptIdSelect);\n $form->setLabel('department_id','Department');\n $form->addText('username');\n $form->setLabel('username','Username');\n $form->addSubmit('submit','Create Admin');\n $form->setAction('index.php?module=sysinventory&action=edit_admins');\n $form->addHidden('newadmin','add');\n\n $tpl['PAGER'] = $adminList;\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_admin.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }", "function showAdmins() {\n // permissions...\n if(!Current_User::isDeity()) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Menu.php');\n $error = 'Uh Uh Uh! You didn\\'t say the magic word!';\n Sysinventory_Menu::showMenu($error);\n return;\n }\n // see if we need to do anything to the db\n if(isset($_REQUEST['newadmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->department_id = $_REQUEST['department_id'];\n $admin->username = $_REQUEST['username'];\n $admin->save();\n }else if (isset($_REQUEST['deladmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->id = $_REQUEST['id'];\n $admin->delete();\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Administrators';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of admins\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $adminList = Sysinventory_Admin::generateAdminList();\n // get the list of departments\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Department.php');\n $depts = Sysinventory_Department::getDepartmentsByUsername();\n\n // build the array for the department drop-down box\n $deptIdSelect = array();\n foreach($depts as $dept) {\n $deptIdSelect[$dept['id']] = $dept['description'];\n }\n\n // make the form for adding a new admin\n $form = new PHPWS_Form('add_admin');\n $form->addSelect('department_id',$deptIdSelect);\n $form->setLabel('department_id','Department');\n $form->addText('username');\n $form->setLabel('username','Username');\n $form->addSubmit('submit','Create Admin');\n $form->setAction('index.php?module=sysinventory&action=edit_admins');\n $form->addHidden('newadmin','add');\n\n $tpl['PAGER'] = $adminList;\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_admin.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }", "public function onPagesInitialized()\n {\n // Don't proceed if we are in the admin plugin\n if ($this->isAdmin()) {\n $this->active = false;\n return;\n }\n // Do not act upon empty POST payload or any POST not for this plugin\n $post = $_POST;\n if (!$post || ! isset($post['ce_data_post']) ) {\n return;\n }\n // Preemtively handle review edits ajax call\n if ($post['action'] == 'ceReviewEdits') {\n $output = $this->grav['twig']->processTemplate(\n 'partials/data-manager/content-edit/item.html.twig',\n [ 'itemData' => CompiledYamlFile::instance(DATA_DIR . $this->edits_loc . DS . $post['file'])->content() ]\n );\n } else {\n $pages = $this->grav['pages'];\n $page = $pages->dispatch($post['page'] , true);\n if ($post['language'] && $post['language'] != 'Default' ) {\n $fn = preg_match('/^(.+)\\..+?\\.md$/', $page->name(), $matches);\n if ($fn) {\n $fileP = $page->path() . DS . $matches[1] . '.' . $post['language'] . '.md';\n $route = $page->route();\n $page = new Page();\n $page->init(new \\SplFileInfo($fileP), $post['language'] . '.md');\n }\n }\n switch ($post['action']) {\n case 'ceTransferContent': // Transfer the md for the page\n $hd = $page->header();\n $menuExists = property_exists($hd,'menu') && $hd->menu !== null;\n $output = [ 'data' => $page->rawMarkdown(), 'menu' => $page->menu(), 'menuexists' => $menuExists ];\n break;\n case 'ceSaveContent': // Save markdown content\n $output = $this->saveContent($post, $page);\n break;\n case 'cePreviewContent': // Preview a route\n $r = ( $post['language'] == 'Default' ? '' : $post['language'] ) . $post['page'] ;\n $this->grav->redirect($r);\n break;\n case 'ceFileUpload': // Handle a file (or image) upload\n $output = $this->saveFile($post, $page);\n break;\n case 'ceFileDelete': // Deleting a file or images\n $output = $this->deleteFile($post, $page);\n break;\n default:\n return;\n }\n }\n $this->setHeaders();\n echo json_encode($output);\n exit;\n }", "function admin_load()\n {\n }", "public function actions() {\n\t\tadd_action( 'wp_loaded', array( $this, 'generate_data' ) );\n\t\tadd_action( 'wp_loaded', array( $this, 'update_storage_site' ) );\n\t\tadd_action( 'wp_loaded', array( $this, 'update_storage_network' ) );\n\t}", "function add_admin_pages () {\n define( \"CLRANGER_PATHS\", ['clarity-ranger'] );\n add_menu_page( 'Marc Moeller Clarity Ranger', 'Clarity Ranger', 'manage_options', 'clarity-ranger', array($this, 'clranger_internal_links_page') , CLARITY_URL . '/images/icon2.png' , 6 );\n\t\t\n\t\tadd_submenu_page( 'clarity-ranger', 'Reverse Silo', 'Reverse Silo','manage_options', 'clarity-reverse-silo' ,array($this, 'clranger_reverse_silo_page') );\n }", "public function admin_init() {}", "function startup_admin() {\n\treturn startup_Admin::get_instance();\n}", "function showAdmins() {\n // permissions...\n if(!Current_User::isDeity()) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Error.php');\n $error = 'Uh Uh Uh! You didn\\'t say the magic word!';\n Sysinventory_Error::error($error);\n return;\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Administrators';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of admins\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $adminList = Sysinventory_Admin::generateAdminList();\n // get the list of departments\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Department.php');\n $depts = Sysinventory_Department::getDepartmentsByUsername();\n\n // build the array for the department drop-down box\n $deptIdSelect = array();\n foreach($depts as $dept) {\n $deptIdSelect[$dept['id']] = $dept['description'];\n }\n\n // make the form for adding a new admin\n $form = new PHPWS_Form('add_admin');\n $form->addSelect('department_id',$deptIdSelect);\n $form->setLabel('department_id','Department');\n $form->addText('username');\n $form->setLabel('username','Username');\n $form->addSubmit('submit','Create Admin');\n $form->setAction('index.php?module=sysinventory&action=edit_admins');\n $form->addHidden('newadmin','add');\n\n $tpl['PAGER'] = $adminList;\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_admin.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }", "public function page(){\n\t\t$pageLoader = $this->plugin->library('Page');\n\t\t$pageLoader->load('admin/settings');\n\t}", "public function acfedu_add_admin_pages() {\n\t\t\t\tadd_options_page( 'ACF Faculty Selector', 'Faculty Selector', 'manage_options', 'acfedu-options', 'acfedu_options' );\n\t\t\t\tadd_submenu_page( null, 'Settings', 'Settings', 'manage_options', 'acfedu-settings', 'acfedu_settings' );\n\t\t\t\tadd_submenu_page( null, 'Pro', 'Pro', 'manage_options', 'acfedu-pro', 'acfedu_pro' );\n\t\t\t}", "function page_admincontrol() {\r\n\t\tglobal $admin_lang;\r\n\t\t//\r\n\t\t// get the coutnt of all pages\r\n\t\t//\r\n\t\t$sitedata_result = db_result(\"SELECT page_id FROM \" . DB_PREFIX . \"pages_content\");\r\n\t\t$page_count = mysql_num_rows($sitedata_result);\r\n\t\t//\r\n\t\t// get the count of all registered users\r\n\t\t//\r\n\t\t$users_result = db_result(\"SELECT user_id FROM \" . DB_PREFIX . \"users\");\r\n\t\t$users_count = mysql_num_rows($users_result);\r\n\t\t//\r\n\t\t// get the size of all tables with the prefix DB_PREFIX\r\n\t\t//\r\n\t\t$table_infos_result = db_result(\"SHOW TABLE STATUS\");\r\n\t\t$data_size = 0;\r\n\t\twhile($table_infos = mysql_fetch_object($table_infos_result)) {\r\n\t\t\tif(substr($table_infos->Name, 0, strlen(DB_PREFIX)) == DB_PREFIX)\r\n\t\t\t\t$data_size += $table_infos->Data_length + $table_infos->Index_length;\r\n\t\t}\r\n\t\r\n\t\t$out = \"<h3>AdminControl</h3><hr />\r\n\t<table>\r\n\t\t<tr><td>\" . $admin_lang['online since'] . \"</td><td>#DATUM</td></tr>\r\n\t\t<tr><td>\" . $admin_lang['registered users'] . \"</td><td>\" . $users_count . \"</td></tr>\r\n\t\t<tr><td>\" . $admin_lang['created pages'] . \"</td><td>\" . $page_count . \"</td></tr>\r\n\t\t<tr><td>\" . $admin_lang['database size'] . \"</td><td>\" . kbormb($data_size) . \"</td></tr>\r\n\t</table>\r\n\t\r\n\t<h3>Aktuelle Besucher</h3><hr />\r\n\t<table>\r\n\t\t<tr>\r\n\t\t\t<td>\".$admin_lang['name'].\"</td>\r\n\t\t\t<td>\".$admin_lang['page'].\"</td>\r\n\t\t\t<td>\".$admin_lang['last action'].\"</td>\r\n\t\t\t<td>\".$admin_lang['language'].\"</td>\r\n\t\t\t<td>\".$admin_lang['ip'].\"</td>\r\n\t\t\t<td>\".$admin_lang['host'].\"</td>\r\n\t\t</tr>\";\r\n\t\t\t//output all visitors surfing on the site\r\n\t\t\t$users_online_result = db_result(\"SELECT userid, page, lastaction, lang, ip, host FROM \" . DB_PREFIX . \"online\");\r\n\t\t\twhile($users_online = mysql_fetch_object($users_online_result)) {\r\n\t\t\t\tif($users_online->userid == 0)\r\n\t\t\t\t\t$username = $admin_lang['not registered'];\r\n\t\t\t\telse\r\n\t\t\t\t\t$username = getUserById($users_online->userid);\r\n\t\t\t\t//\r\n\t\t\t\t// FIXME: gethostbyaddr needes to much time if there are many users online\r\n\t\t\t\t//\r\n\t\t\t\t$out .= \"\\t\\t\\t<tr>\r\n\t\t\t<td>\".$username.\"</td>\r\n\t\t\t<td><a href=\\\"index.php?page=\".$users_online->page.\"\\\">\".$users_online->page.\"</a></td>\r\n\t\t\t<td>\" . date(\"d.m.Y H:i:s\", $users_online->lastaction).\"</td>\r\n\t\t\t<td>\" . $admin_lang[$users_online->lang] . \"</td>\r\n\t\t\t<td>\" . $users_online->ip . \"</td>\r\n\t\t\t<td>\" . $users_online->host . \"</td>\r\n\t\t</tr>\\r\\n\";\r\n\t\t\t}\r\n\r\n\t\t$out .= \"</table>\";\r\n\t\r\n\t\treturn $out;\r\n\t}", "public\tfunction\tadminMenues() {\n\t\t\t/**\n\t\t\t * Menu Pages.\n\t\t\t */\n\t\t\t\n\t\t\t//Create a new menu page.\n\t\t\t$this -> pages[]\t=\tadd_menu_page(\n\t\t\t\t\t'FrozenPlugin', //Page title. \n\t\t\t\t\t'FrozenPlugin', //Menu title.\n\t\t\t\t\t'activate_plugins', //Capability.\n\t\t\t\t\t'FrozenPlugin-home', //Slug.\n\t\t\t\t\tarray($this, 'panelHome'), //Function. \n\t\t\t\t\t'dashicons-admin-generic', //Dashicon. \n\t\t\t\t\t68 //Default position underneath plugins. \n\t\t\t);\n\t\t\t\n\t\t\t/**\n\t\t\t * Submenu Pages\n\t\t\t */\n\t\t\t\n\t\t\t//Create a submenu page. \n\t\t\t$this -> pages[]\t=\tadd_submenu_page(\n\t\t\t\t\t'FrozenPlugin-home', //Parent slug.\n\t\t\t\t\t'FrozenPlugin', //Page title.\n\t\t\t\t\t'FP Home', //Menu title. \n\t\t\t\t\t'activate_plugins', //Capability.\n\t\t\t\t\t'FrozenPlugin-home', //Slug - note this is identical to the parent slug. \n\t\t\t\t\tarray($this, 'panelHome') //Function.\n\t\t\t\t\t);\n\t\t\t\n\t\t\t//Create a submenu page.\n\t\t\t$this -> pages[]\t=\tadd_submenu_page(\n\t\t\t\t\t'FrozenPlugin-home', //Parent slug.\n\t\t\t\t\t'FrozenPlugin', //Page title.\n\t\t\t\t\t'Settings', //Menu title.\n\t\t\t\t\t'activate_plugins', //Capability.\n\t\t\t\t\t'FrozenPlugin-settings', //Slug - note this is identical to the parent slug.\n\t\t\t\t\tarray($this, 'panelSettings') //Function.\n\t\t\t\t\t);\n\t\t\t\n\t\t\t/**\n\t\t\t * Actions, filters, and hooks that rely on the current page go here. \n\t\t\t */\n\t\t\t\n\t\t\t//For each page.\n\t\t\tforeach($this -> pages as $page) {\n\t\t\t\t//Add an action to load the help page.\n\t\t\t\tadd_action(\"load-$page\", array($this, 'helpMenu'));\n\t\t\t\t\n\t\t\t\t//Add an action to load admin area related content.\n\t\t\t\tadd_action(\"admin_print_styles-$page\", array($this, 'enqueueAdmin'));\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}", "function admin()\n{\n global $app;\n\n $app->render('admin.html', [\n 'page' => mkPage(getMessageString('admin'), 0, 1),\n 'isadmin' => is_admin()]);\n}", "public function register_admin_page_and_actions() {\n\t\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tadd_action( 'woocommerce_order_action_omise_charge_capture', array( Omise_Hooks::get_instance(), 'charge_capture' ) );\n\t\t\tadd_action( 'admin_post_omise_create_transfer', array( $this, 'create_transfer' ) );\n\t\t\tadd_action( 'admin_post_nopriv_omise_create_transfer', array( $this, 'no_op' ) );\n\t\t\tadd_action( 'admin_menu', array( $this, 'add_dashboard_omise_menu' ) );\n\t\t}", "private function hooks() {\n\t\t$this->include_tabs();\n\t\t$this->include_tabs_server();\n\n\t\t// Enable the REST API if the settings allow for it.\n\t\tif ( true === (bool) wpcd_get_early_option( 'wordpress_app_rest_api_enable' ) ) {\n\t\t\t$this->include_rest_api();\n\t\t}\n\n\t\t// Make sure WordPress loads up our css and js scripts.\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'wpapp_enqueue_scripts' ), 10, 1 );\n\n\t\t// Show any admin notices related to upgrades.\n\t\tadd_action( 'admin_notices', array( $this, 'wpapp_upgrades_admin_notice' ) );\n\n\t\t// Actions send from the front-end when installing servers and sites.\n\t\tadd_action( \"wpcd_server_{$this->get_app_name()}_action\", array( &$this, 'do_instance_action' ), 10, 3 );\n\t\tadd_action( \"wpcd_app_{$this->get_app_name()}_action\", array( &$this, 'do_app_action' ), 10, 3 );\n\n\t\tadd_filter( \"wpcd_command_{$this->get_app_name()}_logs_done\", array( &$this, 'get_logs_done' ), 10, 4 );\n\t\tadd_filter( \"wpcd_command_{$this->get_app_name()}_logs_intermed\", array( &$this, 'get_logs_intermed' ), 10, 4 );\n\t\tadd_action( \"wpcd_command_{$this->get_app_name()}_completed\", array( &$this, 'command_completed' ), 10, 2 );\n\t\tadd_filter( 'wpcd_server_script_args', array( $this, 'add_script_args_server' ), 10, 2 );\n\t\tadd_filter( 'wpcd_app_script_args', array( $this, 'add_script_args_app' ), 10, 2 );\n\t\tadd_filter( 'wpcd_actions', array( $this, 'add_post_actions' ), 10, 2 );\n\t\tadd_filter( \"wpcd_script_placeholders_{$this->get_app_name()}\", array( $this, 'script_placeholders' ), 10, 6 );\n\t\tadd_filter( 'wpcd_app_server_admin_list_local_status_column', array( &$this, 'app_server_admin_list_local_status_column' ), 10, 2 ); // Show the server status.\n\t\tadd_filter( 'wpcd_app_server_admin_list_local_status_column', array( &$this, 'app_server_admin_list_upgrade_status' ), 11, 2 ); // Show the upgrade status in the local status column - function located in trait file upgrade.php.\n\t\tadd_filter( 'wpcd_app_admin_list_summary_column', array( &$this, 'app_admin_list_upgrade_status' ), 11, 2 ); // Show the upgrade status in the TITLE column of the app list - function located in trait file upgrade.php.\n\n\t\t// Push commands and callbacks from servers.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_server_status_completed\", array( &$this, 'push_command_server_status_completed' ), 10, 4 ); // When a server sends us it's daily status report, part 1 - see bash script #24.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_sites_status_completed\", array( &$this, 'push_command_sites_status_completed' ), 10, 4 ); // When a server sends us it's daily status report, part 2 - see bash script #24.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_maldet_scan_completed\", array( &$this, 'push_command_maldet_scan_completed' ), 10, 4 ); // When a server sends us a report of maldet scan results - see bash script #26.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_server_restart_completed\", array( &$this, 'push_command_server_restart_completed' ), 10, 4 ); // When a server sends us a report of restart or shutdown.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_monit_log_completed\", array( &$this, 'push_command_monit_log_completed' ), 10, 4 ); // When a server sends us a monit alert or report.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_start_domain_backup_completed\", array( &$this, 'push_command_domain_backup_v1_started' ), 10, 4 ); // When a server sends us a notification telling us a scheduled backup was started for a domain.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_end_domain_backup_completed\", array( &$this, 'push_command_domain_backup_v1_completed' ), 10, 4 ); // When a server sends us a notification telling us a scheduled backup was completed for a domain.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_server_config_backup_completed\", array( &$this, 'push_command_server_config_backup' ), 10, 4 ); // When a server sends us a notification telling us a backup of the server configuration has started or ended.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_test_rest_api_completed\", array( &$this, 'push_command_test_rest_api_completed' ), 10, 4 ); // When a server sends us a test notification (initiated from the TOOLS tab on a server screen).\n\n\t\t// Push commands and callbacks from sites.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_schedule_site_sync_completed\", array( &$this, 'push_command_schedule_site_sync' ), 10, 4 ); // When a scheduled site sync has started or ended.\n\n\t\t// After server prepare action hooks.\n\t\t$this->wpcd_after_server_prepare_action_hooks();\n\n\t\t// When we're querying to find out the status of a server.\n\t\tadd_filter( 'wpcd_is_server_available_for_commands', array( &$this, 'wpcd_is_server_available_for_commands' ), 10, 2 );\n\n\t\t// When an app cleanup script is being run.\n\t\tadd_action( 'wpcd_cleanup_app_after', array( $this, 'wpcd_cleanup_app_after' ), 10, 1 );\n\n\t\t// When a server cleanup script is being run.\n\t\tadd_action( 'wpcd_cleanup_server_after', array( $this, 'wpcd_cleanup_server_after' ), 10, 1 );\n\n\t\t// When WP has been installed, add temp domain to DNS if configured.\n\t\tadd_action( 'wpcd_command_wordpress-app_completed_after_cleanup', array( $this, 'wpcd_wpapp_install_complete' ), 10, 4 );\n\n\t\t// Ajax Hooks.\n\t\tadd_action( \"wp_ajax_wpcd_{$this->get_app_name()}\", array( &$this, 'ajax_server' ) ); // For ajax calls dealing with servers in wp-admin.\n\t\tadd_action( \"wp_ajax_wpcd_app_{$this->get_app_name()}\", array( &$this, 'ajax_app' ) ); // for ajax calls dealing with apps in wp-admin.\n\t\tif ( wpcd_is_woocommerce_activated() ) {\n\t\t\tadd_action( 'wp_ajax_wpcd_wpapp_frontend', array( &$this, 'ajax_wpapp_frontend' ) ); // for ajax calls from the front-end - code in trait files.\n\t\t}\n\n\t\t// Add welcome message to the settings screen.\n\t\tadd_filter( 'wpcd_general_settings_after_welcome_message', array( $this, 'welcome_message_settings' ), 10, 1 );\n\n\t\t// Add some additional instructions to the \"no application servers found\" message.\n\t\tadd_filter( 'wpcd_no_app_servers_found_msg', array( $this, 'no_app_servers_found_msg' ), 10, 1 );\n\n\t\t// Add a state called \"WordPress\" to the app when its shown on the app list.\n\t\tadd_filter( 'display_post_states', array( $this, 'display_post_states' ), 20, 2 );\n\n\t\t// Background actions for SERVER.\n\t\tadd_action( 'wpcd_wordpress_deferred_actions_for_server', array( $this, 'do_deferred_actions_for_server' ), 10 );\n\n\t\t// Background actions for APPS.\n\t\tadd_action( 'wpcd_wordpress_deferred_actions_for_apps', array( $this, 'do_deferred_actions_for_app' ), 10 );\n\n\t\t// Delete temp log files.\n\t\tadd_action( 'wpcd_wordpress_file_watcher', array( $this, 'file_watcher_delete_temp_files' ) );\n\n\t\t/* Do not allow WooCommerce to redirect to their account page */\n\t\tadd_filter( 'woocommerce_prevent_admin_access', array( $this, 'wc_subscriber_admin_access' ), 20, 1 );\n\n\t\t/*********************************************\n\t\t* Hooks and filters for screens in wp-admin\n\t\t*/\n\n\t\t// Filter hook to add new columns to the APP list.\n\t\tadd_filter( 'manage_wpcd_app_posts_columns', array( $this, 'app_posts_app_table_head' ), 10, 1 );\n\n\t\t// Action hook to add values in new columns in the APP list.\n\t\tadd_action( 'manage_wpcd_app_posts_custom_column', array( $this, 'app_posts_app_table_content' ), 10, 2 );\n\n\t\t// Filter hook to add new columns to the SERVER list.\n\t\tadd_filter( 'manage_wpcd_app_server_posts_columns', array( $this, 'app_server_table_head' ), 10, 1 );\n\n\t\t// Show some app details in the wp-admin list of apps.\n\t\tadd_filter( 'wpcd_app_admin_list_summary_column', array( &$this, 'app_admin_list_summary_column' ), 10, 2 );\n\n\t\t// Add the INSTALL WordPress button to the server list.\n\t\tadd_filter( 'wpcd_app_server_table_content', array( &$this, 'app_server_table_content' ), 10, 3 );\n\n\t\t// Filter hook to add a REMOVE SITE link to the hover action on an app.\n\t\tadd_filter( 'post_row_actions', array( $this, 'post_row_actions' ), 10, 2 );\n\n\t\t// Meta box display callback.\n\t\tadd_action( 'add_meta_boxes_wpcd_app', array( $this, 'app_admin_add_meta_boxes' ) );\n\n\t\t// Save Meta Values.\n\t\tadd_action( 'save_post', array( $this, 'app_admin_save_meta_values' ), 10, 2 );\n\n\t\t// Add Metabox.IO metaboxes for the WordPress app into the APP details CPT screen.\n\t\tadd_filter( \"wpcd_app_{$this->get_app_name()}_metaboxes\", array( $this, 'add_meta_boxes' ), 10, 1 );\n\n\t\t// Add Metabox.IO metaboxes for the SERVER CPT into the server details CPT screen.\n\t\tadd_filter( 'rwmb_meta_boxes', array( $this, 'register_server_metaboxes' ), 10, 1 ); // Register application metabox stub with filter. Note that this is a METABOX.IO filter, not a core WP filter.\n\t\tadd_filter( \"wpcd_server_{$this->get_app_name()}_metaboxes\", array( $this, 'add_meta_boxes_server' ), 10, 1 );\n\n\t\t// Action hook to fire on new site created on WP Multisite.\n\t\tadd_action( 'wp_initialize_site', array( $this, 'wpapp_schedule_events_for_new_site' ), 10, 2 );\n\n\t\t// Action hook to set transient if directory is readable and .txt files are accessible.\n\t\tadd_action( 'admin_init', array( $this, 'wpapp_admin_init' ) );\n\n\t\t// Action hook to handle ajax request to set transient if user closed the readable notice check.\n\t\tadd_action( 'wp_ajax_set_readable_check', array( $this, 'set_readable_check' ) );\n\n\t\t// Action hook to handle ajax request to set transient if user clicked the \"check again\" option in the \"readable check\" notice.\n\t\tadd_action( 'wp_ajax_readable_check_again', array( $this, 'readable_check_again' ) );\n\n\t\t// Action hook to extend admin filter options.\n\t\tadd_action( 'restrict_manage_posts', array( $this, 'wpapp_wpcd_app_table_filtering' ) );\n\n\t\t// Filter hook to filter app listing on custom meta data.\n\t\tadd_filter( 'parse_query', array( $this, 'wpapp_wpcd_app_parse_query' ), 10, 1 );\n\n\t\t// Action hook to handle ajax request to set transient if user closed the notice for cron check.\n\t\tadd_action( 'wp_ajax_set_cron_check', array( $this, 'set_cron_check' ) );\n\t}", "protected function _registerAdminPages()\n \t{\n \t\tif ( $this->the_plugin->capabilities_user_has_module('google_pagespeed') ) {\n\t \t\tadd_submenu_page(\n\t \t\t\t$this->the_plugin->alias,\n\t \t\t\t$this->the_plugin->alias . \" \" . __('PageSpeed Insights', 'psp'),\n\t\t __('PageSpeed Insights', 'psp'),\n\t\t 'read',\n\t\t $this->the_plugin->alias . \"_PageSpeedInsights\",\n\t\t array($this, 'display_index_page')\n\t\t );\n \t\t}\n\n\t\t\treturn $this;\n\t\t}", "public function admin_init ( )\n\t{\n\t\tif ( ! function_exists('curl_init') )\n return false;\n\t\t\n\t\t$admin_class = get_class($this) . 'Admin';\n\t\t$this->admin = new $admin_class($this->icon_small);\n\t}", "public static function admin_controller() {\n\t\tif ( ! current_user_can( TVE_DASH_CAPABILITY ) ) {\n\t\t\twp_die( '' );\n\t\t}\n\t\tinclude_once TD_NM()->path( 'includes/admin/class-td-nm-admin-ajax-controller.php' );\n\t\t$response = TD_NM_Admin_Ajax_Controller::instance()->handle();\n\t\twp_send_json( $response );\n\t}", "protected function adminMenu()\n {\n \\add_submenu_page(\n 'options-general.php',\n \\esc_html__('WP REST API Cache', 'wp-rest-api-cache'),\n \\esc_html__('REST API Cache', 'wp-rest-api-cache'),\n self::CAPABILITY,\n self::MENU_SLUG,\n function () {\n $this->renderPage();\n }\n );\n }", "protected function runAdmin()\n {\n parent::runAdmin();\n \n $f3 = \\Base::instance();\n \n // register the template'e module positions\n \\Modules\\Factory::registerPositions( array(\n 'homepage1-promo1', 'homepage1-promo2', \n 'homepage1-shipping', 'homepage1-featured1', 'homepage1-featured2', 'homepage1-featured3',\n 'homepage2-slider',\n 'homepage2-shipping', 'homepage2-featured1', 'homepage2-featured2', 'homepage2-featured3', \n ) );\n\n // register the modules path\n \\Modules\\Factory::registerPath( $f3->get('PATH_ROOT') . \"apps/Amrita/Modules/\" );\n \n // register event listeners\n \\Dsc\\System::instance()->getDispatcher()->addListener(\\Amrita\\Admin\\Listeners\\Shop::instance());\n \\Dsc\\System::instance()->getDispatcher()->addListener(\\Amrita\\Site\\Listeners\\Shop::instance());\n \n // register shipping methods\n \\Shop\\Models\\ShippingMethods::register( array(\n (new \\Shop\\Models\\ShippingMethods( array(\n 'id' => 'amrita.domestic.standard',\n 'name' => 'Continental U.S. - Standard'\n ) ) )->cast(),\n (new \\Shop\\Models\\ShippingMethods( array(\n 'id' => 'amrita.domestic.2_day',\n 'name' => 'Continental U.S. - 2nd Day',\n ) ) )->cast(),\n (new \\Shop\\Models\\ShippingMethods( array(\n 'id' => 'amrita.domestic.1_day',\n 'name' => 'Continental U.S. - Overnight',\n ) ) )->cast(),\n (new \\Shop\\Models\\ShippingMethods( array(\n 'id' => 'amrita.domestic_non-continental.standard',\n 'name' => 'Non-Continental U.S. - Standard',\n ) ) )->cast(),\n (new \\Shop\\Models\\ShippingMethods( array(\n 'id' => 'amrita.international.standard',\n 'name' => 'International - Standard',\n ) ) )->cast(),\n (new \\Shop\\Models\\ShippingMethods( array(\n 'id' => 'amrita.international.express',\n 'name' => 'International - Express',\n ) ) )->cast()\n ) ); \n \n // register reports\n \\Shop\\Models\\Reports::register('\\Amrita\\ShopReports\\OrdersInNetsuite', array(\n 'title'=>'Orders - in Netsuite',\n 'icon'=>'fa fa-inbox',\n 'type'=>'amrita',\n 'slug'=>'orders-in-netsuite'\n ));\n\n // register reports\n \\Shop\\Models\\Reports::register('\\Amrita\\ShopReports\\BadlyRelatedProducts', array(\n 'title'=>'Badly Related Products',\n 'icon'=>'fa fa-ambulance',\n 'type'=>'amrita',\n 'slug'=>'badly-related-products'\n ));\n }", "function admin_menu() {\n\t\t// The designation of add_MANAGEMENT_page causes the menu item to be listed under the Tools menu!\n\t\tadd_management_page('Revitalize Orders Output', 'Revitalize Orders', 'edit_posts', basename(__FILE__), array(&$this, 'page_handler'));\n\t}", "function run()\n\t{\n\t\trequire_code('templates_donext');\n\t\trequire_code('menus');\n\n\t\trequire_all_lang();\n\n\t\t$type=get_param('type','misc');\n\n\t\tif (((!has_specific_permission(get_member(),'avoid_simplified_adminzone_look')) || ($GLOBALS['FORUM_DRIVER']->is_super_admin(get_member()))) && (num_staff_icons()<MIN_STAFF_ICONS_BEFORE_COLLAPSE))\n\t\t{\n\t\t\tif ($type=='misc') return do_next_manager_admin_simplified();\n\t\t}\n\n\t\t// Warning about whether the Setup Wizard still needs running\n\t\tif ((get_param_integer('cancel_sw_warn',0)==1) || (!addon_installed('setupwizard')))\n\t\t{\n\t\t\tset_value('setup_wizard_completed','1');\n\t\t} else\n\t\t{\n\t\t\t$_done_sw_once=get_value('setup_wizard_completed');\n\t\t\t$done_sw_once=!is_null($_done_sw_once);\n\t\t\tif ((!$done_sw_once) && (get_param('page','')!='admin_setupwizard') && (has_actual_page_access(get_member(),'admin_setupwizard')))\n\t\t\t{\n\t\t\t\t$setup_wizard_url=build_url(array('page'=>'admin_setupwizard'),get_module_zone('admin_setupwizard'));\n\t\t\t\t$cancel_sw_url=get_self_url(false,false,array('cancel_sw_warn'=>1));\n\t\t\t\tattach_message(do_lang_tempcode('SETUP_WIZARD_NOT_RUN',escape_html($setup_wizard_url->evaluate()),escape_html($cancel_sw_url->evaluate())),'notice');\n\t\t\t}\n\t\t}\n\n\t\tswitch ($type)\n\t\t{\n\t\t\tcase 'misc':\n\t\t\t\treturn do_next_manager_hooked('ADMIN_ZONE','DOC_ADMIN_ZONE','');\n\t\t\tcase 'structure':\n\t\t\t\treturn do_next_manager_hooked('STRUCTURE','DOC_STRUCTURE','structure');\n\t\t\tcase 'usage':\n\t\t\t\treturn do_next_manager_hooked('USAGE','DOC_USAGE','usage');\n\t\t\tcase 'style':\n\t\t\t\treturn do_next_manager_hooked('STYLE','DOC_STYLE','style');\n\t\t\tcase 'setup':\n\t\t\t\treturn do_next_manager_hooked('SETUP','DOC_SETUP','setup');\n\t\t\tcase 'tools':\n\t\t\t\treturn do_next_manager_hooked('TOOLS','DOC_TOOLS','tools');\n\t\t\tcase 'security':\n\t\t\t\treturn do_next_manager_hooked('SECURITY','DOC_SECURITY','security');\n\n\t\t\tcase 'search':\n\t\t\t\treturn $this->search();\n\t\t}\n\n\t\treturn new ocp_tempcode();\n\t}", "public static function adminPage(){\n\t\tif(!self::isAdmin()){\n\t\t\theader(\"Location: index.php\");\n\t\t\texit;\n\t\t}\n\t}", "protected function runAdmin()\n {\n parent::runAdmin();\n\n $f3 = \\Base::instance();\n \n // Tell the admin that this is an available front-end theme\n \\Dsc\\System::instance()->get('theme')->registerTheme('Theme', $f3->get('PATH_ROOT') . 'apps/Theme/' );\n \n // register this theme's module positions with the admin\n \\Modules\\Factory::registerPositions( array('theme-head', 'theme-below-header', 'theme-above-footer', 'theme-below-footer', 'theme-above-content', 'theme-below-content', 'theme-left-content', 'theme-right-content', 'product-finalsale') );\n }", "private function define_admin_hooks() {\n\n\t\t$plugin_admin = new APS_Admin( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n\n\t}", "private function define_admin_hooks() {\n\n\t\t//$theme_admin = new Wpt_Custom_Theme_Admin( $this->get_theme_name(), $this->get_version() );\n\n\t\t//$this->loader->add_action( 'admin_enqueue_scripts', $theme_admin, 'enqueue_styles' );\n\n\t}", "public static function init() {\n\t\tadd_action( 'admin_menu', array( __CLASS__, 'add_submenu_page' ), 20 );\n\t\tadd_action( 'wp_ajax_wprm_wpurp_nutrition', array( __CLASS__, 'ajax_wpurp_nutrition' ) );\n\t}", "function xanthia_admin_main()\n{\n\t/** Security check - important to do this as early as possible to avoid\n\t* potential security holes or just too much wasted processing. For the\n\t* main function we want to check that the user has at least edit privilege\n\t* for some item within this component, or else they won't be able to do\n\t* anything and so we refuse access altogether. The lowest level of access\n\t* for administration depends on the particular module, but it is generally\n\t* either 'edit' or 'delete'\n\t*/\n if (!pnSecAuthAction(0, 'Xanthia::', '::', ACCESS_EDIT)) {\n return pnVarPrepHTMLDisplay(_MODULENOAUTH);\n }\n // Load user API\n\tif (!pnModAPILoad('Xanthia','user')) {\t \n pnSessionSetVar('errormsg', pnVarPrepHTMLDisplay(_XA_APILOADFAILED));\n pnRedirect(pnModURL('Xanthia', 'admin', 'view'));\n return true;\n\t}\n // Return the Admin View Function\n\t//return xanthia_adminmenu();\n\treturn xanthia_admin_view();\n}", "public function testAdministratorAccessAllPages()\n\t{\n\t\t$this->login($this->users['sample1']['varName'], $this->passwordAdmin);\n\n\t\t$this->open('accounting');\n\t\t$this->assertTextNotPresent('You don\\'t have access to this section.');\n\t\t$this->assertTextNotPresent('Unable to resolve the request');\n\n\t\t$this->open('user');\n\t\t$this->assertTextNotPresent('You don\\'t have access to this section.');\n\t\t$this->assertTextNotPresent('Unable to resolve the request');\n\n\t\t$this->open('setting');\n\t\t$this->assertTextNotPresent('You don\\'t have access to this section.');\n\t\t$this->assertTextNotPresent('Unable to resolve the request');\n\n\t\t// edit himself information\n\t\t$this->open('/user/edit/' . $this->users['sample1']['intUserID']);\n\t\t$this->assertTextNotPresent('You don\\'t have access to this section.');\n\t\t$this->assertTextNotPresent('Unable to resolve the request');\n\t\t$this->assertTextPresent('Edit user');\n\n\t\t// edit manager information\n\t\t$this->open('/user/edit/' . $this->users['sample2']['intUserID']);\n\t\t$this->assertTextNotPresent('You don\\'t have access to this section.');\n\t\t$this->assertTextNotPresent('Unable to resolve the request');\n\t\t$this->assertTextPresent('Edit user');\n\t}", "public function getPageHandler();", "public function checkAccess()\n {\n $list = $this->getPages();\n\n /**\n * Settings controller is available directly if the $page request variable is provided\n * if the $page is omitted, the controller must be the subclass of Settings main one.\n *\n * The inner $page variable must be in the getPages() array\n */\n return parent::checkAccess()\n && isset($list[$this->page])\n && (\n ($this instanceof \\XLite\\Controller\\Admin\\Settings && isset(\\XLite\\Core\\Request::getInstance()->page))\n || is_subclass_of($this, '\\XLite\\Controller\\Admin\\Settings')\n );\n }", "protected function _registerAdminPages()\n \t{ \n \t\tif ( $this->the_plugin->capabilities_user_has_module('remote_support') ) {\n\t \t\tadd_submenu_page(\n\t \t\t\t$this->the_plugin->alias,\n\t \t\t\t$this->the_plugin->alias . \" \" . __('AA-Team Remote Support', 'psp'),\n\t\t __('Remote Support', 'psp'),\n\t\t 'read',\n\t\t $this->the_plugin->alias . \"_remote_support\",\n\t\t array($this, 'display_index_page')\n\t\t );\n \t\t}\n\n\t\t\treturn $this;\n\t\t}", "public static function init_on_demand() {\n\t\tglobal $pagenow;\n\n\t\tif (empty($pagenow))\n\t\t\treturn;\n\n\t\tself::$page_base = basename($pagenow, '.php');\n\n\t\t$admin_pages = array(\n\t\t\t'post',\n\t\t\t'post-new',\n\t\t\t'plugins',\n\t\t);\n\t\tif (! is_admin()|| in_array(self::$page_base, $admin_pages))\n\t\t\tadd_action('wp_loaded', array(self::$instance, 'init'));\n\t}", "private function define_admin_hooks() {\n\t\t$plugin_admin = new Soisy_Pagamento_Rateale_Admin( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n $this->loader->add_filter( 'woocommerce_payment_gateways', $plugin_admin, 'payment_methods' );\n\t\t\n $this->loader->add_filter( 'soisy_settings', $plugin_admin, 'soisy_vars' );\n\t\t\n\t\t$this->loader->add_filter('plugin_action_links', $plugin_admin,'add_soisy_action_links', 10, 2);\n\t\t\n\t\t/*\n\t\t * Payments Gateways extend WC_Payment_Gateway\n\t\t * To have them work properly they must be hooked to 'plugins_loaded'\n\t\t */\n add_action( 'plugins_loaded', 'init_Soisy_Pagamento_Rateale_Gateway_Settings');\n\t}", "public function actions() {\n\t\trequire_once( WPEX_FRAMEWORK_DIR .'hooks/hooks.php' );\n\t\trequire_once( WPEX_FRAMEWORK_DIR .'hooks/actions.php' );\n\t\trequire_once( WPEX_FRAMEWORK_DIR .'hooks/partials.php' );\n\t}", "public function add_admin() {\n $current_pages = array();\n\n $permission = 'manage_options';\n if (defined('SWPM_MANAGEMENT_PERMISSION')){\n $permission = SWPM_MANAGEMENT_PERMISSION;\n }\n \n $current_pages['swpm'] = add_submenu_page('simple_wp_membership', __('Form Builder', 'simple-membership'), __('Form Builder', 'simple-membership'), $permission, 'swpm-form-builder', array(&$this, 'admin'));\n // All plugin page load hooks\n foreach ($current_pages as $key => $page) {\n // Load the jQuery and CSS we need if we're on our plugin page\n add_action(\"load-$page\", array(&$this, 'admin_scripts'));\n\n // Load the Help tab on all pages\n add_action(\"load-$page\", array(&$this, 'help'));\n }\n // Save pages array for filter/action use throughout plugin\n $this->_admin_pages = $current_pages;\n\n // Adds a Screen Options tab to the Entries screen\n add_action('load-' . $current_pages['swpm'], array(&$this, 'screen_options'));\n\n // Add meta boxes to the form builder admin page\n add_action('load-' . $current_pages['swpm'], array(&$this, 'add_meta_boxes'));\n\n add_action('load-' . $current_pages['swpm'], array(&$this, 'include_forms_list'));\n }", "public function load_option_pages()\n {\n if (is_admin() || is_admin_bar_showing()) {\n include OXY_THEME_DIR . 'inc/option-pages.php';\n }\n }" ]
[ "0.67111236", "0.66846746", "0.66776764", "0.65621316", "0.6506575", "0.6469161", "0.6377735", "0.6377735", "0.63446647", "0.63446504", "0.6237714", "0.6211898", "0.61917865", "0.6156982", "0.6115275", "0.6050643", "0.6041598", "0.5972208", "0.59684485", "0.5964318", "0.59367734", "0.59272635", "0.59035474", "0.589693", "0.5882868", "0.5874437", "0.58648413", "0.5855155", "0.585507", "0.58541286", "0.5848254", "0.5847898", "0.58379674", "0.58327895", "0.5832128", "0.5805079", "0.5803703", "0.58007276", "0.57844377", "0.5777263", "0.5769181", "0.57601804", "0.57420117", "0.57380277", "0.57344127", "0.5729693", "0.57251304", "0.57078826", "0.57060057", "0.5704791", "0.5698717", "0.56844234", "0.56816703", "0.5664121", "0.56511426", "0.56500983", "0.5642081", "0.563938", "0.5621027", "0.561318", "0.56116325", "0.5608389", "0.56078094", "0.56078094", "0.5602697", "0.56017053", "0.55996794", "0.55992585", "0.5590359", "0.5589569", "0.5574745", "0.5571465", "0.5570797", "0.5570595", "0.5570279", "0.55673146", "0.5565076", "0.5564469", "0.55615306", "0.5560797", "0.5558108", "0.55504674", "0.554697", "0.55467516", "0.55443704", "0.5542083", "0.5538535", "0.5538208", "0.55307776", "0.55299866", "0.55266106", "0.55169874", "0.55151516", "0.55111164", "0.5510654", "0.55081004", "0.55078954", "0.5506", "0.55022466", "0.54882294" ]
0.78827757
0
Checks to see if any metaboxes are registered to a post type.
function wpf_load_post_type_metaboxes() { global $wpf_classes; $metabox_class = wpf_get_class( 'metaboxes' ); return $wpf_classes['metaboxes'] = new $metabox_class(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function admin_metaboxes() {\r\n\r\n// \t\t\t/** Check if wpeo_log_select_post_type exist */\r\n// \t\t\tif( !empty(\t$this->wpeologs_settings['post_type'] ) ) {\r\n// \t\t\t\tforeach ( $this->wpeologs_settings['post_type'] as $post_type ) {\r\n\r\n// \t\t\t\t\t//add_meta_box( 'wpeologs_metabox_' . $post_type, __( 'Logs', 'wpeologs-i18n'), array( &$this, 'associated_post_type_metabox' ), $post_type, 'normal' );\r\n// \t\t\t\t}\r\n// \t\t\t}\r\n\t\t}", "function wtfdivi099_add_meta_boxes() {\r\n\tforeach(get_post_types() as $pt) {\r\n\t\tif (post_type_supports($pt, 'editor') and function_exists('et_single_settings_meta_box')) {\r\n\t\t\tadd_meta_box('et_settings_meta_box', __('Divi Custom Post Settings', 'Divi'), 'et_single_settings_meta_box', $pt, 'side', 'high');\r\n\t\t}\r\n\t} \r\n}", "public function registerMetaBoxes()\n\t {\n\t \t$dataMetas = self::getDataMetas();\n\n\t \tif ( !empty($dataMetas) ) {\n\t \t\tforeach ($dataMetas as $key => $meta) {\n\t \t\t\t/* CHECK IF HAS PAGES */\n\t \t\t\tif ( isset($meta[\"_pages\"]) && !empty($meta[\"_pages\"][0]) ) {\n\t \t\t\t\tself::createMetasPages($meta);\n\t \t\t\t}\n\n\t \t\t\t/* POSTS TYPES REGISTER METAS */\n\t \t\t\tif ( isset($meta[\"_posts_types\"]) && !empty($meta[\"_posts_types\"][0]) ) {\n\t \t\t\t\tself::createMetasPostTypes($meta);\n\t \t\t\t}\n\n\t \t\t\t/* CHECK IF ALL POSTS IS true */\n\t \t\t\tif ( isset($meta[\"_all_posts\"]) && $meta['_all_posts'] == 'yes' ) {\n\t \t\t\t\tself::createMetasPosts($meta);\n\t \t\t\t}\n\t \t\t}\n\t \t}\n\n\t }", "public function has_public_taxonomies( $post ) {\n\t\t$taxonomies = get_object_taxonomies( $post, 'objects' );\n\t\t// Only get taxonomies that have a UI.\n\t\t$taxonomies = array_filter(\n\t\t\t$taxonomies,\n\t\t\tfunction ( $tax ) {\n\t\t\t\treturn $tax->show_ui;\n\t\t\t}\n\t\t);\n\n\t\treturn ! empty( $taxonomies );\n\t}", "function register_and_do_post_meta_boxes($post)\n {\n }", "function TS_VCSC_RemoveMetaBoxesPostTypeGlobal() {\r\n\t\t\tforeach ($this->TS_VCSC_PostTypeMenuNames_Default as $key => $value) {\r\n\t\t\t\tif (post_type_exists($key)) {\r\n\t\t\t\t\t$this->TS_VCSC_RemoveMetaBoxesPostTypeSingle($key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "function df_meta_boxes( ) {\n\t\tglobal $post, $df_box_objects;\n\t\tforeach( $df_box_objects as $df_box ) {\n\t\t\t\n\t\t\t//Get current post type. If is a revision - get parent post type.\n\t\t\t$post_type = get_post_type( $post->ID );\n\t\t\tif( $post_type == 'revision' ) {\n\t\t\t\tglobal $post;\n\t\t\t\t$post_type = get_post_type( $post->post_parent );\n\t\t\t}\t\t\n\t\t\t\n\t\t\tif( in_array( $post_type, $df_box->post_types ) ) :\n\t\t\t\tforeach( $df_box->post_types as $post_type ) {\n\t\t\t\t\tadd_meta_box( $df_box->id . \"_box\", $df_box->title, 'df_meta_fields', $post_type, 'side', 'low', $df_box );\n\t\t\t\t}\n\t\t\tendif;\n\t\t}\n\t}", "function wp_nav_menu_post_type_meta_boxes()\n {\n }", "private function is_valid_post_type() {\n\t\t\n\t\t/**\n\t\t * Includes our array of post types\n\t\t */\n\t\tinclude_once( 'q-and-a-post-types.php' );\n\t\t\n\t\treturn ! empty( $_POST['post_type'] ) && ( in_array( get_current_screen()->post_type, $q_and_a_post_types ) );\n\t}", "function add_meta_boxes() {\n\t\t$post_types = get_post_types();\n\t\tif($post_types) :\n\t\t\tforeach($post_types as $post_type) :\n\t\t\t\tif(post_type_supports($post_type,'sliders')) :\n\t\t\t\t\t//It's supported!\n\t\t\t\t\tadd_meta_box('tw-sliders-box',__('Sliders','tw-sliders'),array($this,'manage_sliders'),$post_type,'normal','high');\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\tendif;\n\t}", "function add_meta_boxes($post_type, $post)\n {\n }", "public function add_meta_boxes() {\n\t\t// init tooltips here since at this time the meta-box pre-registration is done,\n\t\t// we already know the current screen and the 'condition()' has been checked\n\t\t$this->init_tooltips();\n\n\t\t// Avoid appearance own meta fields on the standard Custom Fields metabox.\n\t\tadd_filter( 'is_protected_meta', array( $this, 'is_protected_meta' ), 10, 2 );\n\t}", "protected function check_is_post_type_allowed($post_type)\n {\n }", "private function add_meta_boxes() {\n\t\t$post_types = $this->post->get_types();\n\n\t\tforeach ( $post_types as $post_type => $value ) {\n\t\t\tadd_meta_box( 'subway_comment_metabox',\n\t\t\t\tesc_html__( 'Memberships Discussion', 'subway' ),\n\t\t\t\tfunction ( $post ) {\n\t\t\t\t\t$this->discussion( $post );\n\t\t\t\t},\n\t\t\t\t$post_type, 'side', 'high'\n\t\t\t);\n\t\t\tadd_meta_box( 'subway_visibility_metabox',\n\t\t\t\tesc_html__( 'Memberships Access', 'subway' ),\n\t\t\t\tfunction ( $post ) {\n\t\t\t\t\t$this->visibility( $post );\n\t\t\t\t},\n\t\t\t\t$post_type, 'side', 'high'\n\t\t\t);\n\t\t}\n\n\t}", "function moutheme_register_meta_boxes()\n{\n\tglobal $meta_boxes;\n\n\t// Make sure there's no errors when the plugin is deactivated or during upgrade\n\tif ( class_exists( 'RW_Meta_Box' ) ) {\n\t\tforeach ( $meta_boxes as $meta_box ) {\n\t\t\tnew RW_Meta_Box( $meta_box );\n\t\t}\n\t}\n}", "public function metaboxes()\n\t{\n\t\t$this->admin()->metaboxes();\n\t}", "function add_meta_box() {\n global $post;\n\n $post_types = get_post_types( array( 'public' => true ) );\n\n if ( !empty( $post ) ) {\n if ( $this->check_user_analytics_exist( $post ) ) {\n foreach ( $post_types as $post_type ) {\n add_meta_box( 'show_user_analytics', __( 'Post Author Analytics Info', 'wpuf-pro' ), array( $this, 'render_meta_box_content' ), $post_type, 'advanced', 'high' );\n }\n }\n }\n }", "function master_sidebar_post_type_meta_boxes() {\n\t\n\t$post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'object' );\n\t$admin_page_name = 'appearance_page_custom_theme_sidebars';\n\n\tif ( ! $post_types ) {\n\t\treturn;\n\t}\n\n\t// Add metabox for each posttype\n\tforeach ( $post_types as $post_type ) {\n\t\t$post_type = apply_filters( 'master_sidebar_meta_box_object', $post_type );\n\t\tif ( $post_type ) {\n\t\t\t$id = $post_type->name;\n\t\t\tadd_meta_box( \n\t\t\t\t\"master-add-{$id}\", \n\t\t\t\t$post_type->labels->name, \n\t\t\t\t'master_sidebar_item_post_type_meta_box', \n\t\t\t\t$admin_page_name, \n\t\t\t\t'side', \n\t\t\t\t'default', \n\t\t\t\t$post_type \n\t\t\t);\n\t\t}\n\t}\n}", "public function register()\n\t\t{\n\t\t\tif( empty($this->_postType) ) {\n\t\t\t\twp_die( 'Empty metabox post type.' );\n\t\t\t}\n\n\t\t\t$all_empty = true;\n\n\t\t\tforeach( $this->getTabs() as $tab ) {\n\t\t\t\tif ( ! $this->_alwaysDisplay && $tab->getContainers()->size() == 0 ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tforeach ( $tab->getContainers() as $container ) {\n\t\t\t\t\tif ( ! $this->_alwaysDisplay && $container->getFields()->size() == 0 ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$all_empty = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif( $all_empty ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$this->_id = \"metabox_{$this->_postType}_{$this->_slug}\";\n\n\t\t\tadd_meta_box(\n\t\t\t\t$this->_id,\n\t\t\t\t$this->_title,\n\t\t\t\tarray($this, 'render'),\n\t\t\t\t$this->_postType,\n\t\t\t\t$this->_position,\n\t\t\t\t$this->_priority\n\t\t\t);\n\n\t\t\tadd_action( 'admin_head', array($this, 'disableHideMetaboxes') );\n\t\t}", "public function add_meta_boxes()\n \t{\n\n \t\t// Add this metabox to every selected post\n \t\tadd_meta_box( \n \t\t\tsprintf('WP_Custom_Login_Profile_%s_section', self::POST_TYPE),\n \t\t\tsprintf('%s Information', ucwords(str_replace(\"_\", \" \", self::POST_TYPE))),\n \t\t\tarray(&$this, 'add_inner_meta_boxes'),\n \t\t\tself::POST_TYPE\n \t );\t\n\n \t}", "public function add_meta_boxes($post_type) {\n\n if ($post_type == 'post') {\n \tadd_meta_box(\n\t\t\t\t'post_metabox_hide_fields_for_post'\n\t\t\t\t,__('Hide fields',THEME_NAME)\n\t\t\t\t,array($this, 'render_meta_hide_fields_for_post')\n\t\t\t\t,$post_type\n\t\t\t\t,'side'\n\t\t\t\t,'default'\n\t\t\t);\n \t\n }elseif($post_type == 'page') {\n \tadd_meta_box(\n\t\t\t\t'post_metabox_hide_fields_for_page'\n\t\t\t\t,__('Hide fields',THEME_NAME)\n\t\t\t\t,array($this, 'render_metabox_hide_fields_for_page')\n\t\t\t\t,$post_type\n\t\t\t\t,'side'\n\t\t\t\t,'default'\n\t\t\t);\n }\n\n if ( in_array( $post_type, array('post','page') )) {\n\n\t\t\tadd_meta_box(\n\t\t\t\t'post_metabox_feature'\n\t\t\t\t,__('Feature',THEME_NAME)\n\t\t\t\t,array($this, 'render_meta_box_feature')\n\t\t\t\t,$post_type\n\t\t\t\t,'normal'\n\t\t\t\t,'high'\n\t\t\t);\n }\n\t}", "public function add_meta_boxes()\n \t{\n \t\t// Add this metabox to every selected post\n \t\tadd_meta_box( \n \t\t\tsprintf('wp_plugin_template_%s_section', self::POST_TYPE),\n \t\t\tsprintf('%s Information', ucwords(str_replace(\"_\", \" \", self::POST_TYPE))),\n \t\t\tarray($this, 'add_inner_meta_boxes'),\n \t\t\tself::POST_TYPE\n \t );\t\t\t\t\t\n \t}", "public function isCustom()\n {\n $all_custom_post_types = get_post_types(array('_builtin' => false));\n\n // there are no custom post types\n if (empty($all_custom_post_types)) {\n return false;\n }\n\n $custom_types = array_keys($all_custom_post_types);\n $current_post_type = get_post_type($this->get());\n\n // could not detect current type\n if (!$current_post_type) {\n return false;\n }\n\n return in_array($current_post_type, $custom_types);\n }", "final public function add_meta_boxes()\n {\n foreach ((array)$this->GetHooks() as $hook) :\n if (!$hook['edit']) {\n continue;\n }\n foreach ((array)$hook['permalink'] as $post_type) :\n remove_meta_box('tagsdiv-' . $this->Archive, $post_type, 'side');\n remove_meta_box($this->Archive . 'div', $post_type, 'side');\n endforeach;\n endforeach;\n }", "function tabify_add_meta_boxes($post_type)\n {\n }", "function get_all_post_type_supports($post_type)\n {\n }", "public function add_post_metaboxes() {\n\t\tif( empty( $this->push_syndicate_settings['selected_post_types'] ) )\n\t\t\treturn;\n\n\t\tif( !$this->current_user_can_syndicate() )\n\t\t\treturn;\n\n\t\t$selected_post_types = $this->push_syndicate_settings[ 'selected_post_types' ];\n\t\tforeach( $selected_post_types as $selected_post_type ) {\n\t\t\tadd_meta_box( 'syndicatediv', __( ' Syndicate ' ), array( $this, 'add_syndicate_metabox' ), $selected_post_type, 'side', 'high' );\n\t\t\t//add_meta_box( 'syndicationstatusdiv', __( ' Syndication Status ' ), array( $this, 'add_syndication_status_metabox' ), $selected_post_type, 'normal', 'high' );\n\t\t}\n\n\t}", "function is_custom_post_type( $post = NULL ){\n $all_custom_post_types = get_post_types( array ( '_builtin' => FALSE ) );\n\n // there are no custom post types\n if ( empty ( $all_custom_post_types ) )\n return FALSE;\n\n $custom_types = array_keys( $all_custom_post_types );\n $current_post_type = get_post_type( $post );\n\n // could not detect current type\n if ( ! $current_post_type )\n return FALSE;\n\n return in_array( $current_post_type, $custom_types );\n }", "public function register_meta_boxes()\n {\n }", "function testPostTypeExistsGenerateExpectsMetaBoxAdded() {\n\t\t// Arrange\n\t\t$form = new TestValidBox();\n\t\t\\WP_Mock::wpFunction('post_type_exists', array(\n\t\t\t'times' => 1,\n\t\t\t'args' => $form->post_type,\n\t\t\t'return' => true,\n\t\t\t)\n\t\t);\n\t\t\\WP_Mock::wpPassthruFunction('sanitize_key');\n\t\t\\WP_Mock::wpFunction('add_meta_box', array(\n\t\t\t'times' => 1,\n\t\t\t'return' => true,\n\t\t\t)\n\t\t);\n\n\t\t// act\n\t\t$form->generate();\n\n\t\t// Assert: test will fail if add_meta_box is not called, or called more than once\n\t}", "function ncl_add_post_meta_boxes() {\n\t$post_types = get_post_types();\n\tforeach ( $post_types as $post_type ) {\n\t\tadd_meta_box( 'ncl-current-location', 'Current Location', 'ncl_current_location_meta_box', $post_type, 'side', 'default' );\n\t}\n}", "function snax_mashshare_add_post_types_to_metaboxes( $metaboxes ) {\n\t$metaboxes[0]['pages'][] = 'snax_quiz';\n\treturn $metaboxes;\n}", "function wck_settings_page_add_meta_boxes() {\r\n global $post;\r\n\t\tdo_action( 'add_meta_boxes', $this->hookname, $post );\r\n\t}", "public function getMetaboxes()\n\t{\n\t\treturn $this->_metaboxes;\n\t}", "function tower_register_meta_boxes() {\n foreach (TOWER_CUSTOM_POSTS as $key => $custom_type) {\n $meta = $custom_type['meta'];\n add_meta_box(\n $meta['handle'],\n $meta['title'],\n $meta['callback'],\n $key\n );\n }\n}", "function ce_register_meta_boxes()\n{\n\t// Make sure there's no errors when the plugin is deactivated or during upgrade\n\tif ( !class_exists( 'RW_Meta_Box' ) )\n\t\treturn;\n\n\tglobal $meta_boxes;\n\tforeach ( $meta_boxes as $meta_box )\n\t{\n\t\tnew RW_Meta_Box( $meta_box );\n\t}\n}", "function qode_lms_include_custom_post_types_meta_boxes() {\n\t\tif ( qode_lms_theme_installed() ) {\n\t\t\tforeach ( glob( QODE_LMS_CPT_PATH . '/*/admin/meta-boxes/*.php' ) as $meta_boxes_map ) {\n\t\t\t\tinclude_once $meta_boxes_map;\n\t\t\t}\n\t\t}\n\t}", "public static function adminHeadCheck()\n {\n global $post;\n if (\n !$post\n ||\n !property_exists($post, 'post_type')\n ||\n $post->post_type != 'event'\n ) {\n return true;\n }\n // Force a setup_postdata.\n setup_postdata($post);\n return true;\n }", "function custom_meta_box($object)\n {\n wp_nonce_field(basename(__FILE__), \"meta-box-nonce\");\n\n ?>\n <div class=\"MetaHeader\"><p><b>Appear Post</b></p>\n <div>\n\n <label for=\"Main_Posts\">Main Posts</label>\n <?php\n /*------- Add CheckBox To Appear The Post In Main Posts Area --------*/\n $Main_value = get_post_meta($object->ID, \"Main_Posts\", true);\n\n if($Main_value == \"\")\n {\n ?>\n <input name=\"Main_Posts\" type=\"checkbox\" value=\"main\">\n <?php\n }\n else if($Main_value == \"main\")\n {\n ?> \n <input name=\"Main_Posts\" type=\"checkbox\" value=\"main\" checked>\n <?php\n }\n ?>\n </div>\n\n <div>\n\n <label for=\"Features_Posts\">Features Posts</label>\n <?php\n /*------- Add CheckBox To Appear The Post In Feature Posts Area --------*/\n $Feature_value = get_post_meta($object->ID, \"Features_Posts\", true);\n\n if($Feature_value == \"\")\n {\n ?>\n <input name=\"Features_Posts\" type=\"checkbox\" value=\"feature\">\n <?php\n }\n else if($Feature_value == \"feature\")\n {\n ?> \n <input name=\"Features_Posts\" type=\"checkbox\" value=\"feature\" checked>\n <?php\n }\n ?>\n </div>\n <p><b>Type Of Post</b></p>\n <div>\n\n <label for=\"Local_Posts\">Local Posts</label>\n <?php\n /*------- Add CheckBox To Check If The Type Of The Post Is Local --------*/\n $Local_value = get_post_meta($object->ID, \"Local_Posts\", true);\n\n if($Local_value == \"\")\n {\n ?>\n <input name=\"Local_Posts\" type=\"checkbox\" value=\"local\">\n <?php\n }\n else if($Local_value == \"local\")\n {\n ?> \n <input name=\"Local_Posts\" type=\"checkbox\" value=\"local\" checked>\n <?php\n }\n ?>\n </div>\n\n <div>\n\n <label for=\"World_Posts\">World Posts</label>\n <?php\n /*------- Add CheckBox To Check If The Type Of The Post Is World --------*/\n $World_value = get_post_meta($object->ID, \"World_Posts\", true);\n \n if($World_value == \"\")\n {\n ?>\n <input name=\"World_Posts\" type=\"checkbox\" value=\"world\">\n <?php\n }\n else if($World_value == \"world\")\n {\n ?> \n <input name=\"World_Posts\" type=\"checkbox\" value=\"world\" checked>\n <?php\n }\n ?>\n </div>\n </div>\n <?php \n }", "public function hasTaxonomies() {\n return $this->_has(1);\n }", "function klippe_core_include_custom_post_types_meta_boxes() {\n\t\tif ( klippe_core_theme_installed() ) {\n\t\t\tforeach ( glob( MIKADO_CORE_CPT_PATH . '/*/admin/meta-boxes/*.php' ) as $meta_boxes_map ) {\n\t\t\t\tinclude_once $meta_boxes_map;\n\t\t\t}\n\t\t}\n\t}", "function siteorigin_panels_metaboxes() {\n\tforeach( siteorigin_panels_setting( 'post-types' ) as $type ){\n\t\tadd_meta_box( 'so-panels-panels', __( 'Page Builder', 'positive-panels' ), 'siteorigin_panels_metabox_render', $type, 'advanced', 'high' );\n\t}\n}", "function remove_person_meta_box() {\n $post_types = get_post_types( '', 'names' );\n foreach ( $post_types as $post_type ) {\n remove_meta_box( 'tagsdiv-person', ''. $post_type .'', 'side' );\n }\n}", "public function isValidPostType() {\n if ( $this->post_type === get_post_type() ) {\n return true;\n }\n return false;\n }", "function remove_yoast_meta_boxes() {\n\t$post_types = array(\n\t\t'ucf_resource_link',\n\t\t'ucf_section'\n\t);\n\tforeach ( $post_types as $post_type ) {\n\t\tremove_meta_box( 'wpseo_meta', $post_type, 'normal' );\n\t}\n}", "function _bpp__register_meta_boxes()\n{\n\tglobal $meta_boxes;\n\n\t// Make sure there's no errors when the plugin is deactivated or during upgrade\n\tif ( class_exists( 'RW_Meta_Box' ) )\n\t{\n\t\tforeach ( $meta_boxes as $meta_box )\n\t\t{\n\t\t\tnew RW_Meta_Box( $meta_box );\n\t\t}\n\t}\n}", "function wp_nav_menu_taxonomy_meta_boxes()\n {\n }", "function is_post_type($type){\n\tglobal $wp_query;\n\tif($type == get_post_type($wp_query->post->ID)) return true;\n\treturn false;\n}", "function customize_meta_boxes()\n{\n // These remove meta boxes from POSTS\n //remove_post_type_support(\"post\",\"excerpt\"); //Remove Excerpt Support\n //remove_post_type_support(\"post\",\"author\"); //Remove Author Support\n //remove_post_type_support(\"post\",\"revisions\"); //Remove Revision Support\n //remove_post_type_support(\"post\",\"comments\"); //Remove Comments Support\n //remove_post_type_support(\"post\",\"trackbacks\"); //Remove trackbacks Support\n //remove_post_type_support(\"post\",\"editor\"); //Remove Editor Support\n //remove_post_type_support(\"post\",\"custom-fields\"); //Remove custom-fields Support\n //remove_post_type_support(\"post\",\"title\"); //Remove Title Support\n\n\n // These remove meta boxes from PAGES\n //remove_post_type_support(\"page\",\"revisions\"); //Remove Revision Support\n //remove_post_type_support(\"page\",\"comments\"); //Remove Comments Support\n //remove_post_type_support(\"page\",\"author\"); //Remove Author Support\n //remove_post_type_support(\"page\",\"trackbacks\"); //Remove trackbacks Support\n //remove_post_type_support(\"page\",\"custom-fields\"); //Remove custom-fields Support\n\n}", "function agnosia_post_meta_boxes_setup() {\r\n\r\n\t\t/* Add meta boxes on the 'add_meta_boxes' hook. */\r\n\t\tadd_action( 'add_meta_boxes', 'agnosia_add_post_meta_boxes' );\r\n\r\n\t\t/* Save post meta on the 'save_post' hook. */\r\n\t\tadd_action( 'save_post', 'agnosia_save_post_meta', 10 , 2 );\r\n\r\n\t}", "public static function register_meta_boxes() {\n // Get meta boxes to register.\n $meta_boxes = apply_filters( 'rwmb_meta_boxes', array() );\n\n\n if ( is_array( $meta_boxes ) ) {\n // Load all custom fields.\n static $loaded;\n\n if ( ! isset( $loaded ) ) {\n foreach ( glob( implode( '/', array_slice( explode( '/', str_replace( '\\\\', '/', __FILE__ ) ), 0, -1 ) ) . '/fields/*.php' ) as $file ) {\n include_once $file;\n }\n\n $loaded = true;\n }\n\n // Instantiate all meta boxes.\n foreach ( $meta_boxes as $meta_box ) {\n $meta_box = new self( $meta_box );\n }\n }\n }", "function wpb_add_custom_meta_boxes() {\n\tglobal $post;\n\tif ('134' == $post -> ID) { \n\t\tadd_meta_box(\n\t\t\t'league_table',\n\t\t\t'League Table',\n\t\t\t'league_table_callback',\n\t\t\t'page'\n\t\t);\n\t}\n\n\tif ('136' == $post -> ID) { \n\t\tadd_meta_box(\n\t\t\t'league_table',\n\t\t\t'League Table',\n\t\t\t'league_table_callback',\n\t\t\t'page'\n\t\t);\n\t}\n\n\tif ('138' == $post -> ID) { \n\t\tadd_meta_box(\n\t\t\t'league_table',\n\t\t\t'League Table',\n\t\t\t'league_table_callback',\n\t\t\t'page'\n\t\t);\n\t}\n}", "public function hasType(){\n return !empty($this->type);\n }", "public function has_person_types() {\n return !empty( $this->person_types );\n }", "function blokco_register_meta_boxes() {\n global $meta_boxes;\n // Make sure there's no errors when the plugin is deactivated or during upgrade\n if (class_exists('RW_Meta_Box')) {\n foreach ($meta_boxes as $meta_box) {\n new RW_Meta_Box($meta_box);\n }\n }\n}", "public function isEcommerce() {\r\n if (isset($this->eTypes)) {\r\n return $this->eTypes;\r\n }\r\n\r\n\r\n $this->eTypes = array('product', 'wpsc-product');\r\n foreach ($this->eTypes as $key => $type) {\r\n if (!in_array($type, get_post_types())) {\r\n unset($this->eTypes[$key]);\r\n }\r\n }\r\n\r\n if (!empty($this->eTypes)) {\r\n return $this->eTypes;\r\n }\r\n\r\n return false;\r\n }", "public function is_needed() {\n\t\treturn is_singular( PostType::get_instance()->get_post_type() );\n\t}", "function vcex_theme_post_types() {\n\tif ( function_exists( 'wpex_theme_post_types' ) ) {\n\t\treturn wpex_theme_post_types();\n\t}\n\treturn array();\n}", "function post_meta_boxes_setup() {\n\n\t\tadd_action( 'add_meta_boxes', array($this, 'add_post_meta_boxes') );\n\t}", "function registry_post_meta_boxes_setup() {\n\n /* Add meta boxes on the 'add_meta_boxes' hook. */\n add_action( 'add_meta_boxes', 'registry_add_post_meta_boxes', 1 );\n\n /* Save post info meta on the 'save_post' hook. */\n add_action( 'save_post', 'registry_save_coz_info_meta', 10, 2 );\n \n /* Save post info meta on the 'save_post' hook. */\n add_action( 'save_post', 'registry_save_coz_num_meta', 10, 2 );\n \n}", "public function add_meta_boxes( $post_type ) {\n\n\t\t$this->form_options = array();\n\t\tforeach ( $this->widget_form_fields as $widget_id => $post_type_form_fields ) {\n\t\t\tforeach( $post_type_form_fields as $form_fields ) {\n\t\t\t\tif ( in_array( 'all', $form_fields['post_types'] ) || in_array( $post_type, $form_fields['post_types'] ) ) {\n\t\t\t\t\tforeach ( $form_fields['fields'] as $field_name => $field ) {\n\t\t\t\t\t\t$this->form_options[$widget_id . '_' . $field_name] = $field;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $this->form_options ) ) {\n\t\t\tadd_meta_box(\n\t\t\t\t'siteorigin-widgets-meta-box',\n\t\t\t\t__( 'Widgets Bundle Post Meta Data', 'so-widgets-bundle' ),\n\t\t\t\tarray( $this, 'render_widgets_meta_box' ),\n\t\t\t\t$post_type,\n\t\t\t\t'advanced'\n\t\t\t);\n\n\t\t}\n\t}", "public function remove_meta_boxes() {\n\n\t\t// Remove the event types taxonomy meta box.\n\t\tremove_meta_box( 'tagsdiv-event_types', 'schedule', 'side' );\n\n\t\t// Remove the session categories taxonomy meta box.\n\t\tremove_meta_box( 'tagsdiv-session_categories', 'schedule', 'side' );\n\n\t}", "function add_meta_boxes() {\r\n\t\tglobal $post;\r\n\t\t$code = get_post_meta($post->ID, $this->meta_value_key, true);\r\n\t\tif (empty($code) && $this->check_genesis())\treturn false;\r\n\t\t\r\n\t\t$screens = array('page', 'post');\r\n\t\tforeach ($screens as $screen) {\r\n\t\t\tadd_meta_box('embed_js', 'Embed JS (eg, Adwords Conversion Code)', array($this,'metabox_embed_js'), $screen, 'normal', 'low');\r\n\t\t}\r\n\t}", "function registry_add_post_meta_boxes() {\n\n add_meta_box(\n 'registry-info', // Unique ID\n 'When did you complete the Cozmeena Shawl?', // Title\n 'registry_coz_info_meta_box', // Callback function\n 'coz_registry', // Admin page (or post type)\n 'side', // Context\n 'core' // Priority\n );\n\n global $current_user;\n if($current_user->roles[0] == 'administrator') {\n add_meta_box(\n\t\t'registry-num', // Unique ID\n\t\t'International Cozmeena Registration Number', // Title\n\t\t'registry_coz_num_meta_box', // Callback function\n\t\t'coz_registry', // Admin page (or post type)\n\t\t'normal', // Context\n\t\t'low' // Priority\n\t\t);\n }\n}", "function checktags() {\n\t\t\n\t\tglobal $post;\n\t\t$tag_ids = wp_get_post_tags( $post->ID, array( 'fields' => 'ids' ) );\n\t\t\n\t\tif ( !empty($tag_ids) ) {\n\t\t\t\n\t\t\treturn true;\n\t\t\n\t\t} else {\n\t\t\t\n\t\t\treturn false;\n\t\t\n\t\t}\n\t\t\n\t}", "function mobile_kiosk_post_meta_boxes_setup() {\n\t// hook adding the meta boxes \n\tadd_action( 'add_meta_boxes', 'mobile_kiosk_add_post_meta_boxes' );\n\t\n\t// Hook saving the meta boxes\n\tadd_action('save_post', 'mobile_kiosk_save_post_meta_boxes', 10, 2);\n}", "public function metabox() {\n\n\t\t/**\n\t\t * Initialize the metabox\n\t\t */\n\t\t$cmb = new_cmb2_box( [\n\t\t\t'id' => 'expedia_hotel_data_metabox',\n\t\t\t'title' => __( 'Expedia Hotel Data', 'cmb2' ),\n\t\t\t'object_types' => [ 'hawaii-hotels' ], // Post type\n\t\t\t'context' => 'normal',\n\t\t\t'priority' => 'low',\n\t\t\t'show_names' => false, // Show field names on the left\n\t\t\t'closed' => true, // Metabox is closed by default\n\t\t\t'show_on_cb' => [ $this, 'excludeFromPages' ],\n\t\t] );\n\t}", "private function requested_post_is_valid(){\n return (get_post_type((int) $_GET['post_id']) === $this->post_type && get_post_status((int) $_GET['post_id']) === 'publish');\n }", "public function add_inner_meta_boxes($post)\n\t\t{\t\t\n\t\t\t// Render the job order metabox\n\t\t\t//include(sprintf(\"%s/../templates/%s_metabox.php\", dirname(__FILE__), self::POST_TYPE));\t\t\t\n\t\t}", "function add_meta_boxes()\n {\n }", "function ilusix_my_custom_meta_box() {\n global $myMetaBoxPostTypes;\n\n foreach($myMetaBoxPostTypes as $postType) {\n add_meta_box(\n 'my_custom_meta_box_identifier' . '-' . $postType,\n 'Meta box title',\n 'ilusix_my_custom_meta_box_callback',\n $postType,\n 'normal',\n 'default'\n );\n }\n}", "private function post_types() {\n\t\t$this->section_data['general_post_types'] = array(\n\t\t\t'name' \t\t\t\t\t=> 'general_post_types',\n\t\t\t'label' \t\t\t\t=> __( 'Post types', 'fixedtoc' ),\n\t\t\t'default' \t\t\t=> array( 'post', 'page' ),\n\t\t\t'type' \t\t\t\t\t=> 'multi_checkbox',\n\t\t\t'choices'\t\t\t\t=> $this->obj_field_data->get_posttype_choices(),\n\t\t\t'des'\t\t\t\t\t\t=> __( 'Check the post types to be applied. Multiple choice.', 'fixedtoc' )\n\t\t);\n\t}", "static function is_requested_post_type()\n {\n $retval = FALSE;\n $screen = get_current_screen();\n foreach (self::get_instance()->get_all() as $slug => $properties) {\n // Are we rendering a NGG post type?\n if (isset($properties['post_type']) && $screen->post_type == $properties['post_type']) {\n $retval = $slug;\n break;\n }\n }\n return $retval;\n }", "function check_user_analytics_exist( $post ) {\n\n $form_id = get_post_meta( $post->ID, '_wpuf_form_id', true );\n $user_analytics_info = get_post_meta( $post->ID, 'user_analytics_info', true );\n\n if ( empty( $form_id ) && empty( $user_analytics_info ) ) {\n return false;\n }\n\n return true;\n }", "public function setMetaboxes() {\n $metaboxTemp = new Metabox();\n\n $args = array(\n // ## Certification ##\n array(\n 'id' => self::MTB_CERT,\n 'title' => 'Certification Type',\n 'callback' => array($metaboxTemp, 'certification'),\n 'screen' => self::POST_TYPE_BADGES,\n 'context' => 'side',\n 'priority' => 'high',\n ),\n // ## Target ##\n array(\n 'id' => self::MTB_TARGET,\n 'title' => 'Target Type',\n 'callback' => array($metaboxTemp, 'target'),\n 'screen' => self::POST_TYPE_BADGES,\n 'context' => 'side',\n 'priority' => 'high',\n ),\n );\n\n $this->settings->loadMetaBoxes($args);\n }", "Function Wp_meta_box_store(){\n\n\t$mult_posts = array( 'post', 'page' );\n\n\tforeach ($mult_posts as $mult_post) {\n\t\tadd_meta_box(\n\t\t\t'meta_box_id', \t\t\t\t\t# metabox id\n\t\t\t__('Author Bio', 'textdomain'),\t# Title \n\t\t\t'wp_meta_box_call_back_func_store', \t# Callback Function \n\t\t\t$mult_post, \t\t\t\t\t# Post Type\n\t\t\t'normal'\t\t\t\t\t\t# textcontent\n\t\t);\n\t}\n\t\n}", "function create_meta_box() {\n\n\tglobal $postmetas;\n\t\n\tif(!isset($_GET['post_type']) OR empty($_GET['post_type']))\n\t{\n\t\tif(isset($_GET['post']) && !empty($_GET['post']))\n\t\t{\n\t\t\t$post_obj = get_post($_GET['post']);\n\t\t\t$_GET['post_type'] = $post_obj->post_type;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$_GET['post_type'] = 'post';\n\t\t}\n\t}\n\t\n\tif ( function_exists('add_meta_box') && isset($postmetas) && count($postmetas) > 0 ) { \n\t\tforeach($postmetas as $key => $postmeta)\n\t\t{\n\t\t\tif($_GET['post_type']==$key)\n\t\t\t{\n\t\t\t\tadd_meta_box( 'metabox', ucfirst($key).' Options', 'new_meta_box', $key, 'side', 'high' ); \n\t\t\t}\n\t\t}\n\t}\n\n}", "private function hasCustomFields()\r\n\t{\r\n\t\tforeach ($this->fields as $field)\r\n\t\t{\r\n\t\t\tif ($field instanceOf CustomField)\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "protected function hasPostType($name)\n {\n return post_type_exists($name);\n }", "function remove_metaboxes() {\n\t// Examples:\n\t// Removes the featured image meta box from all pages\n\tremove_meta_box( 'postimagediv', 'page', 'side' );\n\t// Removes the comments meta box from all pages\n\tremove_meta_box( 'commentsdiv', 'page', 'normal' );\n\t// Removes the comments meta box from all posts\n\t// remove_meta_box( 'commentsdiv', 'post', 'normal' );\n}", "function be_metabox_show_on_child_of( $display, $meta_box ) {\r\n if ( ! isset( $meta_box['show_on']['key'], $meta_box['show_on']['value'] ) ) {\r\n return $display;\r\n }\r\n\r\n if ( 'child_of' !== $meta_box['show_on']['key'] ) {\r\n return $display;\r\n }\r\n\r\n $post_id = 0;\r\n\r\n // If we're showing it based on ID, get the current ID\r\n if ( isset( $_GET['post'] ) ) {\r\n $post_id = $_GET['post'];\r\n } elseif ( isset( $_POST['post_ID'] ) ) {\r\n $post_id = $_POST['post_ID'];\r\n }\r\n\r\n if ( ! $post_id ) {\r\n return $display;\r\n }\r\n\r\n $pageids = array();\r\n foreach( (array) $meta_box['show_on']['value'] as $parent_id ) {\r\n $pages = get_pages( array(\r\n 'child_of' => $parent_id,\r\n 'post_status' => 'publish,draft,pending',\r\n ) );\r\n\r\n if ( $pages ) {\r\n foreach( $pages as $page ){\r\n $pageids[] = $page->ID;\r\n }\r\n }\r\n }\r\n $pageids_unique = array_unique( $pageids );\r\n\r\n return in_array( $post_id, $pageids_unique );\r\n}", "public static function canDisplayMilestoneTypesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_MILESTONE_TYPE);\n\t}", "function siteorigin_panels_options_field_post_types( $panels_post_types ){\n\t$all_post_types = array_values( array_merge( array( 'page' => 'page', 'post' => 'post' ), get_post_types( array( '_builtin' => false ) ) ) );\n\n\t// These are post types we know we don't want to show\n\t$all_post_types = array_diff($all_post_types, array(\n\t\t// Meta Slider\n\t\t'ml-slider'\n\t) );\n\n\tforeach($all_post_types as $type){\n\t\t$info = get_post_type_object($type);\n\t\tif(empty($info->labels->name)) continue;\n\t\t$checked = in_array(\n\t\t\t$type,\n\t\t\t$panels_post_types\n\t\t);\n\n\t\t?>\n\t\t<label>\n\t\t\t<input type=\"checkbox\" name=\"siteorigin_panels_post_types[<?php echo esc_attr($type) ?>]\" <?php checked($checked) ?> />\n\t\t\t<?php echo esc_html($info->labels->name) ?>\n\t\t</label><br/>\n\t\t<?php\n\t}\n\n\t?><p class=\"description\">Post types that will have the page builder available</p><?php\n}", "public function register_post_types() {\n\n\t\t// FAQ\n\t\tif (!MKB_Options::option('disable_faq')) {\n\t\t\t$this->register_faq_cpt();\n\t\t\t$this->register_faq_taxonomy();\n\t\t}\n\t}", "public function hasType(){\r\n return $this->_has(1);\r\n }", "function meus_posts_type()\n{\n // Depoimentos\n register_post_type(\n 'depoimentos',\n array(\n 'labels' => array(\n 'name' => __('Depoimentos'),\n 'singular_name' => __('Depoimento'),\n ),\n 'public' => true,\n 'has_archive' => false,\n 'menu_icon' => 'dashicons-format-quote',\n 'supports' => array('title', 'editor', 'thumbnail', 'page-attributes'),\n )\n );\n\n // Serviços\n register_post_type(\n 'servicos',\n array(\n 'labels' => array(\n 'name' => __('Serviços'),\n 'singular_name' => __('Serviço'),\n ),\n 'public' => true,\n 'has_archive' => false,\n 'menu_icon' => 'dashicons-admin-appearance',\n 'supports' => array('title', 'editor', 'thumbnail', 'page-attributes'),\n 'taxonomies' => array('category'),\n )\n );\n\n // Empresas\n register_post_type(\n 'empresas',\n array(\n 'labels' => array(\n 'name' => __('Empresas'),\n 'singular_name' => __('Empresa'),\n ),\n 'public' => true,\n 'has_archive' => false,\n 'menu_icon' => 'dashicons-format-image',\n 'supports' => array('title', 'editor', 'thumbnail', 'page-attributes'),\n 'taxonomies' => array('category'),\n )\n );\n}", "public function add_meta_box(){\n\t\t\n\t\t/**\n\t\t * Includes our array of post types\n\t\t */\n\t\tinclude( 'q-and-a-post-types.php' );\n\t\t\n\t\tforeach ( $q_and_a_post_types as $post_type ) {\n\t\t\tadd_meta_box(\n\t\t\t\t'q-and-a',\n\t\t\t\t'Questions and Answers',\n\t\t\t\tarray( $this, 'display_meta_box' ),\n\t\t\t\t$post_type, \n\t\t\t\t'normal',\n\t\t\t\t'default'\n\t\t\t);\n\t\t}\n\t}", "function YOUR_PREFIX_register_meta_boxes() {\r\n global $meta_boxes;\r\n\r\n // Make sure there's no errors when the plugin is deactivated or during upgrade\r\n if (class_exists('RW_Meta_Box')) {\r\n foreach ($meta_boxes as $meta_box) {\r\n new RW_Meta_Box($meta_box);\r\n }\r\n }\r\n}", "public function addMultipleMetaBoxes()\n {\n\n $options = get_option( 'niloy_plugin_cf' ) ?: array();\n\n add_meta_box( 'field_options', 'Field Options', array( $this, 'renderMultipleMetaBoxes'), $options['related_posts'], 'normal', 'default' );\n\n }", "function _beans_is_post_meta_conditions( $conditions ) {\n\n\t// Check if it is a new post and treat it as such.\n\tif ( stripos( $_SERVER['REQUEST_URI'], 'post-new.php' ) !== false ) {\n\n\t\tif ( !$current_post_type = beans_get( 'post_type' ) )\n\t\t\tif ( in_array( 'post', (array) $conditions ) )\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\n\t} else {\n\n\t\t// Try to get id from $_GET.\n\t\tif ( $id = beans_get( 'post' ) )\n\t\t\t$post_id = $id;\n\t\t// Try to get id from $_POST.\n\t\telseif ( $id = beans_post( 'post_ID' ) )\n\t\t\t$post_id = $id;\n\n\t\tif ( !isset( $post_id ) )\n\t\t\treturn false;\n\n\t\t$current_post_type = get_post_type( $post_id );\n\n\t}\n\n\t$statements = array(\n\t\t$conditions === true,\n\t\tin_array( $current_post_type, (array) $conditions ), // Check post type.\n\t\tisset( $post_id) && in_array( $post_id, (array) $conditions ), // Check post id.\n\t\tisset( $post_id) && in_array( get_post_meta( $post_id, '_wp_page_template', true ), (array) $conditions ) // Check page template.\n\t);\n\n\t// Return true if any condition is met, otherwise false.\n\treturn in_array( true, $statements );\n\n}", "function grve_check_portfolio_details() {\n\tglobal $post;\n\t$post_id = $post->ID;\n\n\t$grve_portfolio_details = grve_post_meta( 'grve_portfolio_details', '' );\n\t$portfolio_fields = get_the_terms( $post_id, 'portfolio_field' );\n\tif ( !empty( $grve_portfolio_details ) || ! empty( $portfolio_fields ) ) {\n\t\treturn true;\n\t}\n\treturn false;\n\n}", "function testPostTypeNotExistsCheckPostTypeExpectsPostTypeNameReturned() {\n\t\t// Arrange\n\t\t\\WP_Mock::wpFunction('sanitize_key', array(\n\t\t\t'times' => 0,\n\t\t\t)\n\t\t);\n\t\t\\WP_Mock::wpFunction('post_type_exists', array(\n\t\t\t'times' => 1,\n\t\t\t'return' => false\n\t\t\t)\n\t\t);\n\t\t$form = new TestValidBox();\n\t\t$expected = false;\n\t\t// act\n\t\t$actual = $form->check_post_type($form->post_type);\n\t\t// Assert\n\t\t$this->assertEquals($expected, $actual, 'Post type did not verify correctly');\n\t}", "function addPostMetaboxes() {\n\t\t$assignment_meta = get_post_meta($_GET['post'], '_lepress-assignment-meta', true);\n\t\tif($this->checkPermissions() && !isSet($_GET['p']) && !$assignment_meta) {\n\t\t\tadd_meta_box('lepress-assignment-metabox', 'Assignment', array(&$this, 'fillAssignmentMetabox'), 'post', 'side', 'high');\n\t\t}\n\t}", "function check_if_metal_types_exist()\r\n{\r\n\twrite_log(\"Checking Metal Types Exist\");\r\n\t$term = term_exists('gold', 'metal_type');\r\n\tif ($term === null) {\r\n\t\twrite_log(\"Making GOLD\");\r\n\r\n\t\twp_insert_term(\r\n\t\t 'Gold', // the term \r\n\t\t 'metal_type', // the taxonomy\r\n\t\t array(\r\n\t\t\t'description'=> 'Gold Metal',\r\n\t\t\t'slug' => 'gold',\r\n\t\t\t'parent'=> 0 // get numeric term id\r\n\t\t )\r\n\t\t);\r\n\t}\r\n\t\r\n\t$term = term_exists('silver', 'metal_type');\r\n\tif ($term === null) {\r\n\t\twrite_log(\"Making SILVER\");\r\n\r\n\t\twp_insert_term(\r\n\t\t 'Silver', // the term \r\n\t\t 'metal_type', // the taxonomy\r\n\t\t array(\r\n\t\t\t'description'=> 'Silver Metal',\r\n\t\t\t'slug' => 'silver',\r\n\t\t\t'parent'=> 0 // get numeric term id\r\n\t\t )\r\n\t\t);\r\n\t}\r\n\r\n\t$term = term_exists('platinum', 'metal_type');\r\n\tif ($term === null) {\r\n\t\twrite_log(\"Making Platinum\");\r\n\r\n\t\twp_insert_term(\r\n\t\t 'Platinum', // the term \r\n\t\t 'metal_type', // the taxonomy\r\n\t\t array(\r\n\t\t\t'description'=> 'Platinum Metal',\r\n\t\t\t'slug' => 'platinum',\r\n\t\t\t'parent'=> 0 // get numeric term id\r\n\t\t )\r\n\t\t);\r\n\t}\r\n\r\n\t$term = term_exists('palladium', 'metal_type');\r\n\tif ($term === null) {\r\n\t\twrite_log(\"Making Palladium\");\r\n\r\n\t\twp_insert_term(\r\n\t\t 'Palladium', // the term \r\n\t\t 'metal_type', // the taxonomy\r\n\t\t array(\r\n\t\t\t'description'=> 'Palladium Metal',\r\n\t\t\t'slug' => 'palladium',\r\n\t\t\t'parent'=> 0 // get numeric term id\r\n\t\t )\r\n\t\t);\r\n\t}\r\n\t\r\n\t\r\n\twrite_log(\"End of Metal Types Exist\");\t\t\t\r\n}", "function YOUR_PREFIX_register_meta_boxes()\n{\n\t// Make sure there's no errors when the plugin is deactivated or during upgrade\n\tif ( !class_exists( 'RW_Meta_Box' ) )\n\t\treturn;\n\n\tglobal $meta_boxes;\n\tforeach ( $meta_boxes as $meta_box )\n\t{\n\t\tnew RW_Meta_Box( $meta_box );\n\t}\n}", "function ncl_post_meta_boxes_setup() {\n\n\t/* Add meta boxes on the 'add_meta_boxes' hook. */\n\tadd_action( 'add_meta_boxes', 'ncl_add_post_meta_boxes' );\n\n\t/* Save post meta on the 'save_post' hook. */\n\tadd_action( 'save_post', 'ncl_save_current_location_meta', 10, 2 );\n}", "function ir_register_post_metabox() {\n\tglobal $post;\n\t$related_food_id = 0;\n\tif ( isset( $_GET['post'] ) ) {\n\t\t$related_food_id = get_post_meta( $_GET['post'], 'ir_related_food', true );\n\t}\n\t$prefix = 'ir_';\n\t/**\n\t * Sample metabox to demonstrate each field type included\n\t */\n\t$cmb_post = new_cmb2_box( array(\n\t\t'id' => $prefix . 'post_metabox',\n\t\t'title' => esc_html__( 'Material data', 'cmb2' ),\n\t\t'object_types' => array( 'post' ),\n\t) );\n\t// Add new field\n\t$cmb_post->add_field( array(\n\t\t'name' => __( 'Liittyvä raaka-aine', 'cmb2' ),\n\t\t'id' => $prefix . 'related_food',\n\t\t'desc' => __( 'Klikkaa hakuikonia tai syötä kenttään suoraan raaka-aineen id', 'cmb2' ),\n\t\t'type' => 'post_search_text', // This field type\n\t\t// post type also as array\n\t\t'post_type' => 'food',\n\t\t// Default is 'checkbox', used in the modal view to select the post type\n\t\t'select_type' => 'radio',\n\t\t// Will replace any selection with selection from modal. Default is 'add'\n\t\t'select_behavior' => 'replace',\n\t) );\n\t$cmb_post->add_field( array(\n\t\t'name' => 'Näytettävät ravintoarvot?',\n\t\t'type' => 'title',\n\t\t'id' => $prefix . 'nutrients_title',\n\t) );\n\t$cmb_post->add_field( array(\n\t\t'name' => 'Perusravintoaineet',\n\t\t'id' => $prefix . 'perusravintoaineet',\n\t\t'type' => 'multicheck',\n\t\t'desc' => 'Valitse mitkä ravintoarvot haluat näyttää kirjoituksen yhteydessä',\n\t\t'options' => array(\n\t\t\t$prefix . 'energy' => __( 'Energia, laskennallinen', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_energy' ),\n\t\t\t$prefix . 'hiilihydraatti' => __( 'Hiilihydraatti', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_hiilihydraatti' ),\n\t\t\t$prefix . 'proteiini' => __( 'Proteiini', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_proteiini' ),\n\t\t\t$prefix . 'rasva' => __( 'Rasva', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_rasva' ),\n\t\t),\n\t) );\n\t$cmb_post->add_field( array(\n\t\t'name' => 'Hiilihydraattifraktiot',\n\t\t'id' => $prefix . 'hiilihydraattifraktiot',\n\t\t'type' => 'multicheck',\n\t\t'desc' => 'Valitse mitkä ravintoarvot haluat näyttää kirjoituksen yhteydessä',\n\t\t'options' => array(\n\t\t\t$prefix . 'sokeri' => __( 'Kuitu', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_sokeri' ),\n\t\t\t$prefix . 'kuitu' => __( 'Sokerit', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_kuitu' ),\n\t\t),\n\t) );\n\t$cmb_post->add_field( array(\n\t\t'name' => 'Vitamiinit',\n\t\t'id' => $prefix . 'vitamiinit',\n\t\t'type' => 'multicheck',\n\t\t'desc' => 'Valitse mitkä ravintoarvot haluat näyttää kirjoituksen yhteydessä',\n\t\t'options' => array(\n\t\t\t$prefix . 'folaatti' => __( 'Folaatti', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_folaatti' ),\n\t\t\t$prefix . 'niasiiniekvivalentti' => __( 'Niasiiniekvivalentti NE', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_niasiiniekvivalentti' ),\n\t\t\t$prefix . 'niasiini' => __( 'Niasiini (nikotiinihappo + nikotiiniamidi)', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_niasiini' ),\n\t\t\t$prefix . 'b6' => __( 'Pyridoksiini vitameerit (vetykloridi) (B6)', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_b6' ),\n\t\t\t$prefix . 'b2' => __( 'Riboflaviini (B2)', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_b2' ),\n\t\t\t$prefix . 'b1' => __( 'Tiamiini (B1)', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_b1' ),\n\t\t\t$prefix . 'b12' => __( 'B12-vitamiini (kobalamiini)', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_b12' ),\n\t\t\t$prefix . 'C' => __( 'C-vitamiini', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_C' ),\n\t\t\t$prefix . 'A_RAE' => __( 'A-vitamiini', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_A_RAE' ),\n\t\t\t$prefix . 'karotenoidit' => __( 'Karotenoidit', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_karotenoidit' ),\n\t\t\t$prefix . 'D' => __( 'D-vitamiini', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_D' ),\n\t\t\t$prefix . 'E' => __( 'E-vitamiini alfatokoferoli', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_E' ),\n\t\t\t$prefix . 'K' => __( 'K-vitamiini', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_K' ),\n\t\t),\n\t\t'display_cb' => 'yourprefix_display_text_small_column', // Output the display of the column values through a callback.\n\t) );\n\t$cmb_post->add_field( array(\n\t\t'name' => 'Kivennäis- ja hivenaineet',\n\t\t'id' => $prefix . 'kivennaisaineet',\n\t\t'type' => 'multicheck',\n\t\t'desc' => 'Valitse mitkä ravintoarvot haluat näyttää kirjoituksen yhteydessä',\n\t\t'options' => array(\n\t\t\t$prefix . 'kalsium' => __( 'Kalsium', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_kalsium' ),\n\t\t\t$prefix . 'rauta' => __( 'Rauta', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_rauta' ),\n\t\t\t$prefix . 'jodidi' => __( 'Jodidi', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_jodidi' ),\n\t\t\t$prefix . 'kalium' => __( 'Kalium', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_kalium' ),\n\t\t\t$prefix . 'magnesium' => __( 'Magnesium', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_magnesium' ),\n\t\t\t$prefix . 'natrium' => __( 'Natrium', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_natrium' ),\n\t\t\t$prefix . 'suola' => __( 'Suola', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_suola' ),\n\t\t\t$prefix . 'fosfori' => __( 'Fosfori', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_fosfori' ),\n\t\t\t$prefix . 'seleeni' => __( 'Seleeni', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_seleeni' ),\n\t\t\t$prefix . 'sinkki' => __( 'Sinkki', 'cmb2' ) . \\App\\get_value_and_unit( $related_food_id, 'ir_sinkki' ),\n\t\t),\n\t) );\n}", "public function add_meta_boxes( $post_type, $post ) {\n\n\t\tswitch( $post_type ) {\n\n\t\t\tcase 'schedule':\n\n\t\t\t\t// Event Details.\n\t\t\t\tadd_meta_box(\n\t\t\t\t\t'conf-schedule-event-details',\n\t\t\t\t\t__( 'Event Details', 'conf-schedule' ),\n\t\t\t\t\tarray( $this, 'print_meta_boxes' ),\n\t\t\t\t\t$post_type,\n\t\t\t\t\t'normal',\n\t\t\t\t\t'high'\n\t\t\t\t);\n\n\t\t\t\t// Get session fields.\n\t\t\t\t$session_fields = conference_schedule()->get_session_fields();\n\n\t\t\t\t// Session Details.\n\t\t\t\tif ( ! empty( $session_fields ) ) {\n\t\t\t\t\tadd_meta_box(\n\t\t\t\t\t\t'conf-schedule-session-details',\n\t\t\t\t\t\t__( 'Session Details', 'conf-schedule' ),\n\t\t\t\t\t\tarray( $this, 'print_meta_boxes' ),\n\t\t\t\t\t\t$post_type,\n\t\t\t\t\t\t'normal',\n\t\t\t\t\t\t'high'\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Social Media.\n\t\t\t\tadd_meta_box(\n\t\t\t\t\t'conf-schedule-social-media',\n\t\t\t\t\t__( 'Social Media', 'conf-schedule' ),\n\t\t\t\t\tarray( $this, 'print_meta_boxes' ),\n\t\t\t\t\t$post_type,\n\t\t\t\t\t'normal',\n\t\t\t\t\t'high'\n\t\t\t\t);\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'speakers':\n\n\t\t\t\t// Speaker Details.\n\t\t\t\tadd_meta_box(\n\t\t\t\t\t'conf-schedule-speaker-details',\n\t\t\t\t\t__( 'Speaker Details', 'conf-schedule' ),\n\t\t\t\t\tarray( $this, 'print_meta_boxes' ),\n\t\t\t\t\t$post_type,\n\t\t\t\t\t'normal',\n\t\t\t\t\t'high'\n\t\t\t\t);\n\n\t\t\t\t// Social Media.\n\t\t\t\tadd_meta_box(\n\t\t\t\t\t'conf-schedule-speaker-social-media',\n\t\t\t\t\t__( 'Social Media', 'conf-schedule' ),\n\t\t\t\t\tarray( $this, 'print_meta_boxes' ),\n\t\t\t\t\t$post_type,\n\t\t\t\t\t'normal',\n\t\t\t\t\t'high'\n\t\t\t\t);\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'locations':\n\n\t\t\t\t// Location Details.\n\t\t\t\tadd_meta_box(\n\t\t\t\t\t'conf-schedule-location-details',\n\t\t\t\t\t__( 'Location Details', 'conf-schedule' ),\n\t\t\t\t\tarray( $this, 'print_meta_boxes' ),\n\t\t\t\t\t$post_type,\n\t\t\t\t\t'normal',\n\t\t\t\t\t'high'\n\t\t\t\t);\n\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}", "function admin_speedup_remove_post_meta_box() {\n\tglobal $post_type;\n\tif ( is_admin() && post_type_supports( $post_type, 'custom-fields' )) {\n\t\tremove_meta_box( 'postcustom', $post_type, 'normal' );\n\t}\n}", "public function meta_boxes() {\n\n\t\t// Add TEAM Assignemtns meta box into Team custom post type.\n\t\tadd_meta_box(\n\t\t\t'wpcd_team_detail',\n\t\t\t__( 'Team Assignments', 'wpcd' ),\n\t\t\tarray( $this, 'render_team_details_meta_box' ),\n\t\t\t'wpcd_team',\n\t\t\t'advanced',\n\t\t\t'low'\n\t\t);\n\n\t}" ]
[ "0.65834457", "0.6506478", "0.64784276", "0.63321954", "0.63312566", "0.6326825", "0.6285749", "0.6255533", "0.62434715", "0.62212604", "0.6179277", "0.61769634", "0.6154691", "0.60869616", "0.6083316", "0.6076926", "0.6040087", "0.60141736", "0.6004935", "0.5982903", "0.5967726", "0.59601104", "0.59588695", "0.59480315", "0.59411037", "0.5938769", "0.5937576", "0.5925669", "0.59061587", "0.5873371", "0.5844965", "0.583878", "0.5820218", "0.5805656", "0.57994676", "0.5797021", "0.57936615", "0.5772636", "0.5737878", "0.57291746", "0.5726009", "0.5705604", "0.5701351", "0.5699594", "0.5693779", "0.56910557", "0.56750655", "0.56574357", "0.56500036", "0.5638626", "0.56333315", "0.56280595", "0.56261206", "0.56132275", "0.5604386", "0.55899936", "0.5570067", "0.5550461", "0.55456537", "0.5542126", "0.5539248", "0.5538018", "0.55155796", "0.55082536", "0.5506734", "0.54995126", "0.54970855", "0.54967976", "0.5493179", "0.54871804", "0.54857737", "0.54799205", "0.54709816", "0.5464135", "0.54628086", "0.54611766", "0.5460061", "0.5458103", "0.5456109", "0.5454348", "0.54520905", "0.54494864", "0.544191", "0.5438821", "0.542693", "0.5426384", "0.54246193", "0.5422656", "0.5415044", "0.5408664", "0.5403728", "0.54028976", "0.5397606", "0.53971267", "0.53959614", "0.5394259", "0.5391656", "0.5379872", "0.53759825", "0.53672427" ]
0.59122217
28
Function for profiling your theme.
function wpf_timer_start( $id = 0 ) { global $wpf_profiler; $mtime = explode( ' ', microtime() ); $wpf_profiler[$id]['start'] = $mtime[1] + $mtime[0]; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function profile()\n\t{\n\t\t// Return the view\n\t\treturn View::factory('benchmark/profile')\n\t\t\t->set('memory', (memory_get_usage() - START_MEMORY) / 1024)\n\t\t\t->set('time', round(microtime(TRUE) - START_TIME, 5))\n\t\t\t->set('memory_limit', 131072) // 128M\n\t\t\t->set('time_limit', 30)\n\t\t\t->render();\n\t}", "function display_themes()\n {\n }", "public function stats()\r\n\t{\r\n\t\treturn ProfilerToolbar::render(FALSE);\r\n\t}", "function preview_theme()\n {\n }", "public static function profile() {\r\n $args = func_get_args();\r\n $key = array_shift($args);\r\n $closure = array_shift($args);\r\n $start = microtime(true);\r\n $mem = memory_get_usage();\r\n $result = call_user_func_array($closure, $args);\r\n $mem = memory_get_usage() - $mem;\r\n self::count( $key . '.memory', memory_get_usage() - $mem);\r\n self::time( $key . '.duration', round((microtime(true) - $start) * 1000));\r\n return $result;\r\n }", "function execute(&$vars) {\n \tstat_google_analytics_start();\n\t /*\n $contexts = context_active_contexts();\n $classes = array();\n\n foreach ($contexts as $k => $v) {\n if (!empty($v->reactions[$this->plugin]['theme'])) {\n global $custom_theme;\n $custom_theme = $v->reactions[$this->plugin]['theme'];\n }\n }\n\t\t*/\n }", "function wp_paused_themes()\n {\n }", "public function stats()\n\t{\n\t\t$stat = View::factory('profiler/stats');\n\t\t// echo $stat;\n\t}", "function current_theme_info()\n {\n }", "function display_theme($theme)\n {\n }", "public function start_previewing_theme()\n {\n }", "function prof_print()\r\n{\r\n global $prof_timing, $prof_names, $profiling;\r\n $size = count($prof_timing);\r\n for($i=0;$i<$size - 1; $i++)\r\n {\r\n \tif($profiling)\r\n \t{\r\n \techo \"{$prof_names[$i]}\\n\";\r\n \techo sprintf(\" %f\\n\", $prof_timing[$i+1]-$prof_timing[$i]);\r\n \t}\r\n }\r\n if($profiling)\r\n {\r\n \techo \"{$prof_names[$size-1]}\\n\";\r\n\t}\r\n}", "function wp_update_themes($extra_stats = array())\n {\n }", "function init_performance_info() {\n\n global $PERF, $CFG, $USER;\n\n $PERF = new object();\n $PERF->logwrites = 0;\n if (function_exists('microtime')) {\n $PERF->starttime = microtime();\n }\n if (function_exists('memory_get_usage')) {\n $PERF->startmemory = memory_get_usage();\n }\n if (function_exists('posix_times')) {\n $PERF->startposixtimes = posix_times();\n }\n if (function_exists('apd_set_pprof_trace')) {\n // APD profiling\n if ($USER->id > 0 && $CFG->perfdebug >= 15) {\n $tempdir = $CFG->dataroot . '/temp/profile/' . $USER->id;\n mkdir($tempdir);\n apd_set_pprof_trace($tempdir);\n $PERF->profiling = true;\n }\n }\n}", "function performance( $visible = false ) {\n\n $stat = sprintf( '%d queries in %.3f seconds, using %.2fMB memory',\n get_num_queries(),\n timer_stop( 0, 3 ),\n memory_get_peak_usage() / 1024 / 1024\n );\n\n echo $visible ? $stat : \"<!-- {$stat} -->\" ;\n}", "public function createProfile()\n {\n if (self::$hook_statistics) {\n $profile = '';\n $profile .= 'Page' . ': ' . wa()->getConfig()->getCurrentUrl() . \"\\r\\n\";\n $profile .= \"----------------\\r\\n\";\n\n foreach (self::$hook_statistics as $hook_name => $hook) {\n $profile .= \"\\r\\n\";\n\n // Общие данные по хуку\n $profile .= $this->addLogCount('Hook', $hook_name, $hook['count'], $hook['time']);\n\n // Список точек наблюдения\n if (!empty($hook['points'])) {\n $profile .= \"Points:\\r\\n\";\n $profile .= $this->addLogPoints($hook) . \"\\r\\n\";\n }\n\n // Данные о вызовах\n if (!empty($hook['caller'])) {\n ksort($hook['caller']);\n $profile .= \"Callers:\\r\\n\";\n foreach ($hook['caller'] as $caller_id => $caller) {\n $profile .= self::TAB;\n $caller_name = $this->getCallerName($caller);\n $profile .= $this->addLogCount($caller_name['title'], $caller_name['name'], $caller['count'], $caller['time']);\n\n // Методы\n if (!empty($caller['calls'])) {\n $profile .= $this->addLogCallerCalls($caller);\n }\n\n // Точки\n if (!empty($hook['points'])) {\n $profile .= $this->addLogPoints($caller, self::TAB);\n }\n }\n }\n }\n\n waLog::log($profile, self::PROFILE_FILE);\n }\n }", "function getProfile()\n{\n\tglobal $time_start, $db;\n\n\t$start = $time_start;\n\t$end = gettimeofday();\n\t$dbcalls = count($db->queries);\n\t$dbtime = $db->time;\n\n\t$total = (float)($end['sec'] - $start['sec']) + ((float)($end['usec'] - $start['usec'])/1000000);\n\t$script = $total - $dbtime;\n\t$scriptper = $script / $total;\n\n\t$ret = round($total, 3) . 's, ' . round(100 * $scriptper, 1) . '% PHP, ' . round(100* (1 - $scriptper), 1) . '% SQL with ' . $dbcalls . ' ' . makeLink('queries', $_SERVER['QUERY_STRING'] . '&sqlprofile');\n\n\treturn $ret;\n}", "function performance( $visible = false ) {\n\n $stat = sprintf( '%d queries in %.3f seconds, using %.2fMB memory',\n get_num_queries(),\n timer_stop( 0, 3 ),\n memory_get_peak_usage() / 1024 / 1024\n );\n\n echo $visible ? $stat : \"<!-- {$stat} -->\" ;\n}", "function prof_flag($str)\r\n{\r\n global $prof_timing, $prof_names;\r\n $prof_timing[] = microtime(true);\r\n $prof_names[] = $str;\r\n}", "function initProfiler()\r\n{\r\n global $TIME_START;\r\n $TIME_START=microtime(1);\r\n global $DB_ITEMS_LOADED;\r\n $DB_ITEMS_LOADED=0;\r\n\r\n global $g_count_db_statements;\r\n $g_count_db_statements = 0;\r\n}", "function enableProfiler(){\t\t\n\t\t$CI = &get_instance();\n\t\t$CI->output->enable_profiler( config_item('enable_profiling') );\t\t\n\t}", "function get_themes()\n {\n }", "function load_titan_pro_theme() {\n\t$GLOBALS['titan'] = new Titan;\n}", "function ois_statistics() {\n ois_include_d3_scripts();\n \n\tois_section_title('Compare Skin Performance', 'Which which skins convert the best', '');\n\t\n\tglobal $wpdb;\n\t$table_name = $wpdb->prefix . 'optinskin';\n\t$sql = \"SELECT * FROM $table_name \" .\n\t// The data must come only from the last 30 days\n \"WHERE (ts > DATE_SUB(now(), INTERVAL 30 DAY));\";\n\t$rows = $wpdb->get_results($sql);\n\t$all_stats = array();\n\tif (!empty($rows)) {\n \tforeach ($rows as $row) {\n \t\t$new_stat = array(\n \t\t\t's' => $row->skin,\n \t\t\t'm' => $row->submission,\n \t\t);\n \t\tarray_push($all_stats, $new_stat);\n \t} // foreach\n\t} // if\n\t$skins = get_option('ois_skins');\n\t$stats_range = 10;\n\t$uri = explode('?', $_SERVER['REQUEST_URI']);\n\t$page_url = $uri[0] . '?page=ois-';\n\t\n\t$title_and_rate = array();\n?>\n\t<table class=\"widefat\">\n\t\t<thead>\n\t\t\t<th>Skin Name</th>\n\t\t\t<th>Impressions</th>\n\t\t\t<th>Submits</th>\n\t\t\t<th>Conversion Rate</th>\n\t\t</thead>\n\t<?php\n\tif (!empty($all_stats)) {\n\t\tforeach ($skins as $skin) {\n\t\t $skin_title = $skin['title'];\n\t\t\t\techo '<tr>';\n\t\t\t\techo '<th><a href=\"' . $page_url . $skin['id'] . '\" >' . $skin_title . '</a></th>';\n\t\t\t\t$impressions = array();\n\t\t\t\t$submits = array();\n\t\t\t\t\n\t\t\t\tforeach ($all_stats as $stats) {\n\t\t\t\t\tif (!empty($stats['s'])) {\n\t\t\t\t\t\tif ($stats['s'] == $skin['id']) {\n\t\t\t\t\t\t\tif (!empty($stats['m'])) {\n\t\t\t\t\t\t\t\tarray_push($submits, $stats);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tarray_push($impressions, $stats);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$num_imp = count($impressions);\n\t\t\t\t$num_sub = count($submits);\n\t\t\t\techo '<td>' . $num_imp . '</td>';\n\t\t\t\techo '<td>' . $num_sub . '</td>';\n\t\t\t\tif (count($impressions) != 0) {\n\t\t\t\t $rate = round(100 * $num_sub/$num_imp, 2);\n\t\t\t\t\techo '<td>' . $rate . '%</td>';\n\t\t\t\t} else {\n\t\t\t\t $rate = 0;\n\t\t\t\t\techo '<td>Unknown</td>';\n\t\t\t\t} // else\n\t\t\t\tif ($rate > 0) {\n \t\t\t\tarray_push($title_and_rate, array ( 'title' => $skin_title, 'rate' => $rate ));\n\t\t\t\t} // if\n\t\t\t\techo '</tr>';\n\t\t} // foreach\n\t} // if\n?>\n\t</table>\n\t\n\t<h3>Top Performing Skins by Conversion Rate</h3>\n\t<div id=\"skinsPie\"></div>\n\t\n\t<script type=\"text/javascript\">\n var w = 360, //width\n h = 380, //height\n r = 160, //radius\n //colors = d3.scale.category20c();\n color = d3.scale.category20c();\n\n honorsData = <?php echo json_encode($title_and_rate) ?>;\n var vis = d3.select(\"#skinsPie\")\n .append(\"svg:svg\")\n .data([honorsData])\n .attr(\"width\", w)\n .attr(\"height\", h)\n .append(\"svg:g\")\n .attr(\"transform\", \"translate(\" + r + \",\" + (r + 10) + \")\")\n var arc = d3.svg.arc()\n .outerRadius(r);\n var pie = d3.layout.pie()\n .value(function(d) {\n return d.rate;\n });\n var arcs = vis.selectAll(\"g.slice\")\n .data(pie)\n .enter()\n .append(\"svg:g\")\n .attr(\"class\", \"slice\");\n arcs.append(\"svg:path\")\n .attr(\"fill\", function(d, i) {\n return color(i);\n })\n .attr(\"d\", arc);\n arcs.append(\"svg:text\")\n .attr(\"transform\", function(d) {\n d.innerRadius = 0;\n d.outerRadius = r;\n return \"translate(\" + arc.centroid(d) + \")\";\n })\n .attr(\"text-anchor\", \"middle\")\n .attr(\"fill\", \"#fff\")\n .text(function(d, i) {\n return honorsData[i].title;\n });\n </script>\n\t<?php\n\tois_section_end();\n}", "private function Benchmark()\r\n\t{\t\t\r\n\t}", "public function startProfiling($label) {}", "function showProfile(){\r\n\t\tif( $profiles = $this->getArrayRow( \"SHOW profiles\" ) ){\r\n\t\t\t$html = '<table cellspacing=\"1\" cellpadding=\"10\" bgcolor=\"#cccccc\" style=\"font:11px Helvetica;\"><tr style=\"font-weight:bold\"><td>Query ID</td><td>exec time</td><td width=\"150\">%</td><td>Query</td></tr>';\r\n\t\t\tfor( $i=0, $execution_time = 0, $n=count($profiles); $i<$n; $i++ )\r\n\t\t\t\t$execution_time += $profiles[$i]['Duration'];\r\n\r\n\t\t\tforeach($profiles as $i => $p ){\r\n\t\t\t\t$perc = round( ( $p['Duration'] / $execution_time ) * 100, 2 );\r\n\t\t\t\t$width = ceil( $perc * 2 );\r\n\t \t\t\t$html .= '<tr bgcolor=\"#eeeeee\"><td>'.$p['Query_ID'].'</td><td>'.$p['Duration'].'</td><td><div style=\"float:left;width:50px;\">'.$perc.'%</div> <div style=\"display:inline; margin-top:3px;float:left;background:#ff0000;width:'.$width.'px;height:10px;\"></td><td>'.$p['Query'].'</td></tr>';\r\n\t\t\t}\r\n\t\t\treturn $html .= '</table>';\t\r\n\t\t}\r\n\t}", "function memory_trace_point($name=NULL)\n{\n\tglobal $MEMORY_POINTS;\n\tif (is_null($name)) $name='#'.integer_format(count($MEMORY_POINTS)+1);\n\t$MEMORY_POINTS[]=array(memory_get_usage(),$name);\n}", "protected function getFunctionReport() {\n\t\t$this->collateData();\n\n\t\t$width = 140;\n\t\t$nameWidth = $width - 65;\n\t\t$format = \"%-{$nameWidth}s %6d %13.3f %13.3f %13.3f%% %9d (%13.3f -%13.3f) [%d]\\n\";\n\t\t$titleFormat = \"%-{$nameWidth}s %6s %13s %13s %13s %9s\\n\";\n\t\t$prof = \"\\nProfiling data\\n\";\n\t\t$prof .= sprintf( $titleFormat, 'Name', 'Calls', 'Total', 'Each', '%', 'Mem' );\n\n\t\t$total = isset( $this->mCollated['-total'] )\n\t\t\t? $this->mCollated['-total']['real']\n\t\t\t: 0;\n\n\t\tforeach ( $this->mCollated as $fname => $data ) {\n\t\t\t$calls = $data['count'];\n\t\t\t$percent = $total ? 100 * $data['real'] / $total : 0;\n\t\t\t$memory = $data['memory'];\n\t\t\t$prof .= sprintf( $format,\n\t\t\t\tsubstr( $fname, 0, $nameWidth ),\n\t\t\t\t$calls,\n\t\t\t\t(float)( $data['real'] * 1000 ),\n\t\t\t\t(float)( $data['real'] * 1000 ) / $calls,\n\t\t\t\t$percent,\n\t\t\t\t$memory,\n\t\t\t\t( $data['min_real'] * 1000.0 ),\n\t\t\t\t( $data['max_real'] * 1000.0 ),\n\t\t\t\t$data['overhead']\n\t\t\t);\n\t\t}\n\t\t$prof .= \"\\nTotal: $total\\n\\n\";\n\n\t\treturn $prof;\n\t}", "function stats() {\n\t\techo '<h2>Summary</h2>';\n\t\techo '<p>';\n\t\techo '<strong>Engine</strong>: ' . Cache::engine_name( $this->_config->get_string( array( 'fragmentcache', 'engine' ) ) ) . '<br />';\n\t\techo '<strong>Caching</strong>: ' . ( $this->_caching ? 'enabled' : 'disabled' ) . '<br />';\n\n\t\tif ( !$this->_caching ) {\n\t\t\techo '<strong>Reject reason</strong>: ' . $this->cache_reject_reason . '<br />';\n\t\t}\n\n\t\techo '<strong>Total calls</strong>: ' . $this->cache_total . '<br />';\n\t\techo '<strong>Cache hits</strong>: ' . $this->cache_hits . '<br />';\n\t\techo '<strong>Cache misses</strong>: ' . $this->cache_misses . '<br />';\n\t\techo '<strong>Total time</strong>: '. round( $this->time_total, 4 ) . 's';\n\t\techo '</p>';\n\n\t\techo '<h2>Cache info</h2>';\n\n\t\tif ( $this->_debug ) {\n\t\t\techo '<table cellpadding=\"0\" cellspacing=\"3\" border=\"1\">';\n\t\t\techo '<tr><td>#</td><td>Status</td><td>Source</td><td>Data size (b)</td><td>Query time (s)</td><td>ID:Group</td></tr>';\n\n\t\t\tforeach ( $this->debug_info as $index => $debug ) {\n\t\t\t\techo '<tr>';\n\t\t\t\techo '<td>' . ( $index + 1 ) . '</td>';\n\t\t\t\techo '<td>' . ( $debug['cached'] ? 'cached' : 'not cached' ) . '</td>';\n\t\t\t\techo '<td>' . ( $debug['internal'] ? 'internal' : 'persistent' ) . '</td>';\n\t\t\t\techo '<td>' . $debug['data_size'] . '</td>';\n\t\t\t\techo '<td>' . round( $debug['time'], 4 ) . '</td>';\n\t\t\t\techo '<td>' . sprintf( '%s:%s', $debug['id'], $debug['group'] ) . '</td>';\n\t\t\t\techo '</tr>';\n\t\t\t}\n\n\t\t\techo '</table>';\n\t\t} else {\n\t\t\techo '<p>Enable debug mode.</p>';\n\t\t}\n\t}", "function paused_themes_notice()\n {\n }", "function prof_flag($str)\n{\n global $prof_timing, $prof_names;\n $prof_timing[] = microtime(true);\n $prof_names[] = $str;\n}", "function prof_print()\n{\n global $prof_timing, $prof_names;\n $size = count($prof_timing);\n for ($i = 0; $i < $size - 1; $i++) {\n echo \"<b>{$prof_names[$i]}</b><br>\";\n echo sprintf(\"&nbsp;&nbsp;&nbsp;%f<br>\", $prof_timing[$i + 1] - $prof_timing[$i]);\n }\n echo \"<b>{$prof_names[$size - 1]}</b><br>\";\n}", "public function iniPerformance(){\n $this->tiempo = microtime(true);\n $this->memoria = memory_get_usage();\n }", "protected function renderStats() {\n\t\t$stats = WCF::getCache()->get('stat');\n\t\tWCF::getTPL()->assign('stats', $stats);\n\t}", "public function profilerStart()\n {\n if (extension_loaded('xhprof')) {\n include_once($this->xhprofLibPath . 'utils/xhprof_lib.php');\n include_once($this->xhprofLibPath . 'utils/xhprof_runs.php');\n xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);\n }\n }", "function setProfiling(){\r\n\t\t$this->query(\"SET profiling=1\");\r\n\t}", "public static function &profile() {\n\t\t$_profile=self::$global['PROFILE'];\n\t\t// Compute elapsed time\n\t\t$_profile['TIME']['start']=&self::$global['TIME'];\n\t\t$_profile['TIME']['elapsed']=microtime(TRUE)-self::$global['TIME'];\n\t\t// Reset PHP's stat cache\n\t\tforeach (get_included_files() as $_file)\n\t\t\t// Gather includes\n\t\t\t$_profile['FILES']['includes']\n\t\t\t\t[basename($_file)]=filesize($_file);\n\t\t// Compute memory consumption\n\t\t$_profile['MEMORY']['current']=memory_get_usage();\n\t\t$_profile['MEMORY']['peak']=memory_get_peak_usage();\n\t\treturn $_profile;\n\t}", "function training_performance_callback() {\n global $user;\n $obj = new stdClass();\n $obj->some_var = rand(1, 500);\n $cid = 'cache_for_user_' . $user->uid;\n cache_set($cid, $obj, 'cache_training_performance', CACHE_PERMANENT);\n //cache_clear_all($cid, 'cache_training_performance');\n dpm(cache_get($cid, 'cache_training_performance'));\n $output = 'Test cache!' . rand(1, 500);\n\n return array(\n array(\n '#type' => 'markup',\n '#markup' => $output,\n ),\n );\n}", "function dumpOptimizationReport($testPath, $run, $cached, $includeHeader = false)\r\n{\r\n // load the raw results\r\n $cachedText='';\r\n if((int)$cached == 1)\r\n $cachedText='_Cached';\r\n $fileName = $testPath . '/' . $run . $cachedText . '_optimization.txt';\r\n $lines = file($fileName, FILE_IGNORE_NEW_LINES);\r\n if( $lines)\r\n {\r\n if( $includeHeader )\r\n echo '<h3>Statistics:</h3>';\r\n \r\n $needsClose = true;\r\n $display = false;\r\n echo '<p class=\"indented1\">';\r\n\r\n // loop through each line in the file\r\n foreach($lines as $linenum => $line) \r\n {\r\n $line = htmlspecialchars(trim($line));\r\n if( !strcmp($line,\"Enable browser caching of static assets:\") ||\r\n !strcmp($line,\"Use one CDN for all static assets:\") ||\r\n !strcmp($line,\"Combine static CSS and JS files:\") ||\r\n !strncmp($line,\"GZIP encode all appropriate text assets (text responses > 1400 bytes):\", 20) ||\r\n !strcmp($line,\"Compress Images:\") ||\r\n !strcmp($line,\"Use persistent connections (keep alive):\") ||\r\n !strcmp($line,\"Proper cookie usage:\") ||\r\n !strcmp($line,\"Minify JS:\") ||\r\n !strcmp($line,\"JQuery Selectors not descended from an ID:\") ||\r\n !strcmp($line,\"No ETag headers (ETag headers should generally not be used unless you have an explicit reason to need them):\") )\r\n {\r\n if( $needsClose )\r\n echo '</p>';\r\n\r\n echo \"<h3>\" . $line . '</h3><p class=\"indented1\">' . \"\\n\";\r\n $needsClose = true;\r\n $display = true;\r\n }\r\n else\r\n {\r\n if( !$display && $includeHeader && (strpos($line, 'Page load time:') !== false) )\r\n $display = true;\r\n \r\n if( $display )\r\n {\r\n if( strpos($line, \"Cache score :\") !== false || \r\n strpos($line, \"CDN score (static objects) :\") !== false || \r\n strpos($line, \"Combine score :\") !== false || \r\n strpos($line, \"GZIP score :\") !== false || \r\n strpos($line, \"Image Compression score :\") !== false || \r\n strpos($line, \"Keep-Alive score :\") !== false || \r\n strpos($line, \"Cookie score :\") !== false || \r\n strpos($line, \"Minify score :\") !== false || \r\n strpos($line, \"ETag score :\") !== false )\r\n {\r\n echo '<br><b>' . $line . \"</b><br>\\n\";\r\n }\r\n elseif( !strncmp($line, 'cookie:', 7) || !strncmp($line, 'Line ', 5) || !strncmp($line, '...', 3) )\r\n {\r\n echo '<span class=\"indented1\">' . $line . \"</span><br>\\n\";\r\n }\r\n else\r\n {\r\n echo $line . \"<br>\\n\";\r\n }\r\n }\r\n }\r\n }\r\n if( $needsClose )\r\n echo '</p>';\r\n }\r\n}", "public function generateStats()\n {\n $this->cache = json_decode (file_get_contents ($this->cfg_cache_file), true);\n if (!is_array ($this->cache)) $this->cache = array();\n if (!isset ($this->cache['index'])) $this->cache['index'] = array();\n if (!isset ($this->cache['total'])) $this->cache['total'] = 0;\n if (!isset ($this->cache['size'])) $this->cache['size'] = 0;\n $edited = false;\n if (!isset ($this->cache['timecache']))\n {\n //print \"No cache\";\n $this->generateTimeInterval();\n $this->cache['timecache'] = array (\n \"generated\" => date (\"d-m-Y\"),\n \"day\" => $this->stats->screenshots_per_day,\n \"month\" => $this->stats->screenshots_per_month\n );\n }\n else\n {\n $today = date (\"d-m-Y\");\n $gen_month = false; $gen_day = false;\n if (substr ($today, 3) != substr ($this->cache['timecache']['generated'], 3))\n $gen_month = true;\n if ($today != $this->cache['timecache']['generated'])\n $gen_day = true;\n if ($gen_day || $gen_month)\n {\n $this->generateTimeInterval ($gen_month, $gen_day);\n //print \"Generating timecache: [{$gen_month} / {$gen_day}]\";\n $this->cache['timecache']['generated'] = $today;\n if ($gen_day)\n $this->cache['timecache']['day'] = $this->stats->screenshots_per_day;\n else\n $this->stats->screenshots_per_day = $this->cache['timecache']['day'];\n if ($gen_month)\n $this->cache['timecache']['month'] = $this->stats->screenshots_per_month;\n else\n $this->stats->screenshots_per_month = $this->cache['timecache']['month'];\n $edited = true;\n }\n else\n {\n $this->stats->screenshots_per_day = $this->cache['timecache']['day'];\n $this->stats->screenshots_per_month = $this->cache['timecache']['month'];\n }\n }\n // $this->cache = array ( 'total' => n, 'size' => n, 'index' => array ('name' => date)) )\n $flist = glob (\"{$this->cfg_img_path}/*.{{$this->cfg_extensions}}\", GLOB_BRACE);\n foreach ($flist as $file)\n {\n if (!isset ($this->cache['index'][$file]))\n {\n $edited = true;\n $_stat = stat ($file);\n $this->cache['index'][$file] = date ('d-m-Y', $_stat['mtime']) . '/' . $_stat['size'];\n $this->cache['size'] += $_stat['size'];\n $this->cache['total'] += 1;\n }\n $_date = substr ($this->cache['index'][$file], 0, strpos ($this->cache['index'][$file], '/'));\n $month = substr ($_date, 3);\n if (isset ($this->stats->screenshots_per_day[$_date]))\n $this->stats->screenshots_per_day[$_date]++;\n if (isset ($this->stats->screenshots_per_month[$month]))\n $this->stats->screenshots_per_month[$month]++;\n }\n if ($this->cfg_check_deleted)\n {\n foreach (array_diff (array_keys ($this->cache['index']), $flist) as $deleted)\n {\n $edited = true;\n $this->cache['size'] -= intval (substr ($this->cache['index'][$deleted], strpos ($this->cache['index'][$deleted], '/') + 1));\n $this->cache['total'] -= 1;\n unset ($this->cache['index'][$deleted]);\n }\n }\n $this->stats->total_files = $this->cache['total'];\n $this->stats->used_space = $this->cache['size'];\n //print_r ($this->stats->screenshots_per_day);\n //print($edited);\n if ($edited)\n file_put_contents ($this->cfg_cache_file, json_encode ($this->cache));\n return $this;\n }", "public function render()\n\t{\n\t\tinclude_once __DIR__ . '/templates/go-profiler-mustache-template.php';\n\t\t?>\n\t\t<table id='debug-aggregate-table'>\n\t\t\t<tr>\n\t\t\t\t<td colspan=\"3\"> Filter: <input type='text' class='go-profiler-search'/></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th>hook</th>\n\t\t\t\t<th>calls</th>\n\t\t\t\t<th>memory usage</th>\n\t\t\t\t<th>time</th>\n\t\t\t</tr>\n\t\t</table>\n\t\t<?php\n\t}", "function ajan_core_print_generation_time() {\n?>\n\n<!-- Generated in <?php timer_stop(1); ?> seconds. (<?php echo get_num_queries(); ?> q) -->\n\n\t<?php\n}", "function basey_query_load_time() {\n\n\tif (current_user_can( 'manage_options' )) { ?>\n\t\t<div class=\"uk-container uk-margin-bottom\">\n\t\t\t<div class=\"uk-panel uk-panel-box\">\n\t\t\t\t<strong><?php echo get_num_queries(); ?></strong> queries in <strong><?php timer_stop(1); ?></strong> seconds\n\t\t\t</div>\n\t\t</div>\n\t<?php }\n}", "public function finPerformance(){\n $memoria = memory_get_usage() - $this->memoria;\n $tiempo = microtime(true) - $this->tiempo;\n\n echo \"<pre>\";\n print_r(array(\"memoria\" => $memoria.\" bytes \", \"tiempo\" => $tiempo.\" segundos\" ));\n die;\n }", "static function measure($name='std'){\n\t\t$next = count(self::$measures[$name]);\n\t\tself::$measures[$name][$next]['time'] = microtime(true);\n\t\tself::$measures[$name][$next]['mem'] = memory_get_usage();\n\t\tself::$measures[$name][$next]['peakMem'] = memory_get_peak_usage();\n\t}", "public function preApplyTheme()\n {\n //...\n }", "public function theme_info($theme = \\null)\n {\n }", "function charity_head_profile() {\n $content = '<head profile=\"http://gmpg.org/xfn/11\">' . \"\\n\";\n echo apply_filters('charity_head_profile', $content);\n}", "function _visit_profile() {\n if (!$this->staff && !$this->has_arg('visit')) $this->_error('Access Denied', 403);\n\n $where = '';\n $args = array();\n\n if ($this->has_arg('bl')) {\n $where .= ' AND s.beamlinename LIKE :'. (sizeof($args)+1);\n array_push($args, $this->arg('bl'));\n }\n if ($this->has_arg('run')) {\n $where .= ' AND vr.runid = :' . (sizeof($args)+1);\n array_push($args, $this->arg('run'));\n }\n\n if ($this->has_arg('visit')) {\n $where .= \" AND CONCAT(CONCAT(CONCAT(p.proposalcode,p.proposalnumber), '-'), s.visit_number) LIKE :\".(sizeof($args)+1);\n array_push($args, $this->arg('visit'));\n }\n\n $dp = $this->db->pq(\"SELECT count(case when r.status='CRITICAL' then 1 end) as ccount, count(case when r.status!='SUCCESS' then 1 end) as ecount, count(case when r.status!='SUCCESS' then 1 end)/count(r.status)*100 as epc, count(case when r.status='CRITICAL' then 1 end)/count(r.status)*100 as cpc, count(r.status) as total, r.dewarlocation \n FROM robotaction r \n INNER JOIN blsession s on r.blsessionid=s.sessionid \n INNER JOIN proposal p ON p.proposalid = s.proposalid \n INNER JOIN v_run vr ON s.startdate BETWEEN vr.startdate AND vr.enddate\n WHERE r.actiontype LIKE 'LOAD' AND r.dewarlocation != 99 $where\n GROUP BY r.dewarlocation \n ORDER BY r.dewarlocation\", $args);\n \n \n $profile = array(array(\n array('label' => 'Total Loads', 'data' => array()),\n array('label' => '% Errors', 'data' => array(), 'yaxis' => 2),\n array('label' => '% Critical', 'data' => array(), 'yaxis' => 2),\n ),\n array());\n \n foreach ($dp as $e) {\n array_push($profile[0][0]['data'], array($e['DEWARLOCATION'], $e['TOTAL']));\n array_push($profile[0][2]['data'], array($e['DEWARLOCATION'], $e['CPC']));\n array_push($profile[0][1]['data'], array($e['DEWARLOCATION'], $e['EPC']));\n }\n \n $this->_output($profile);\n }", "public function generateReport()\n {\n $activities = '';\n // General information.\n $totalExecution = $this->getActivityDetails(DFullProfiler::ACTIVITY_TOTAL);\n $report = '<h2>General Performance Details</h2>';\n $report .= '<table><tbody>';\n $report .= sprintf(\"\\t<th width=\\\"180px\\\">Total Execution Time</th><td>%0.4f sec</td></tr>\\n\",\n $totalExecution[ DFullProfiler::ACTIVITY_POINT_END ][ DFullProfiler::ACTIVITY_VALUE_TIME ]);\n $report .= sprintf(\"\\t<th width=\\\"180px\\\">Query Execution Time</th><td>%0.4f sec (%0.1f%%)</td></tr>\\n\",\n $this->queryExecutionTime,\n ($this->queryExecutionTime / $totalExecution[ DFullProfiler::ACTIVITY_POINT_END ][ DFullProfiler::ACTIVITY_VALUE_TIME ] * 100));\n $report .= sprintf(\"\\t<th width=\\\"180px\\\">Query Processing Time</th><td>%0.4f sec (%0.1f%%)</td></tr>\\n\",\n $this->queryProcessingTime,\n ($this->queryProcessingTime / $totalExecution[ DFullProfiler::ACTIVITY_POINT_END ][ DFullProfiler::ACTIVITY_VALUE_TIME ] * 100));\n $report .= sprintf(\"\\t<tr><th width=\\\"180px\\\">Memory Cache Usage</th><td>%0.4f sec (%0.1f%%) [%d Hits, %d Missed, %d Added, %d Removed, %d Invalidations]</td></tr>\\n\",\n $this->memoryCacheActivity[ DFullProfiler::MEMORY_CACHE_EXECUTION_TIME ],\n ($this->memoryCacheActivity[ DFullProfiler::MEMORY_CACHE_EXECUTION_TIME ] / $totalExecution[ DFullProfiler::ACTIVITY_POINT_END ][ DFullProfiler::ACTIVITY_VALUE_TIME ] * 100),\n $this->memoryCacheActivity[ DFullProfiler::MEMORY_CACHE_HIT ],\n $this->memoryCacheActivity[ DFullProfiler::MEMORY_CACHE_MISS ],\n $this->memoryCacheActivity[ DFullProfiler::MEMORY_CACHE_ADD ],\n $this->memoryCacheActivity[ DFullProfiler::MEMORY_CACHE_REMOVE ],\n $this->memoryCacheActivity[ DFullProfiler::MEMORY_CACHE_INVALIDATION ]);\n $report .= \"\\t<tr><th width=\\\"180px\\\">Peak Memory Usage</th><td>\" . DFile::bytesToString(memory_get_peak_usage(),\n 5) . \" (\" . DFile::bytesToString(DFile::stringToBytes(ini_get('memory_limit'))) . \" available)</td></tr>\\n\";\n $report .= '</tbody></table>';\n // Activity times.\n foreach ($this->activities as $name => $activity) {\n $end =& $activity[ DFullProfiler::ACTIVITY_POINT_END ];\n $length = $end[ DFullProfiler::ACTIVITY_VALUE_TIME ];\n $memory = DFile::bytesToString($end[ DFullProfiler::ACTIVITY_VALUE_MEMORY ], 2);\n $peakMemory = DFile::bytesToString($activity['peakMemory'], 2);\n $queries = $end[ DFullProfiler::ACTIVITY_VALUE_QUERIES ];\n $modelsMemory = $activity[ DFullProfiler::ACTIVITY_POINT_MODEL ][ DFullProfiler::MODEL_LOAD_MEMORY ];\n $modelsCache = $activity[ DFullProfiler::ACTIVITY_POINT_MODEL ][ DFullProfiler::MODEL_LOAD_CACHE ];\n $modelsDatabase = $activity[ DFullProfiler::ACTIVITY_POINT_MODEL ][ DFullProfiler::MODEL_LOAD_DATABASE ];\n $cacheHit = $activity[ DFullProfiler::ACTIVITY_POINT_CACHE ][ DCacheHandler::ACTION_HIT ];\n $cacheMiss = $activity[ DFullProfiler::ACTIVITY_POINT_CACHE ][ DCacheHandler::ACTION_MISS ];\n $iterations = $activity[ DFullProfiler::ACTIVITY_VALUE_ITERATIONS ];\n if ($iterations > 1) {\n $iterationLength = $length / $iterations;\n $iterationMemory = DFile::bytesToString($end[ DFullProfiler::ACTIVITY_VALUE_MEMORY ] / $iterations, 2);\n $iterationQueries = $queries / $iterations;\n $iterationObjectsMemory = $modelsMemory / $iterations;\n $iterationObjectsCache = $modelsCache / $iterations;\n $iterationObjectsDatabase = $modelsDatabase / $iterations;\n $iterationCacheHit = $cacheHit / $iterations;\n $iterationCacheMiss = $cacheMiss / $iterations;\n $activities .= sprintf(\"\\t<tr><th>%s</th><td class=\\\"good\\\">%0.4f sec<br />(%0.4f sec)</td><td class=\\\"good\\\">%s<br />(%s)</td><td class=\\\"good\\\">%s</td><td class=\\\"good\\\">%d<br />(%d)</td><td class=\\\"good\\\">%d<br />(%d)</td><td class=\\\"good\\\">%d<br />(%d)</td><td class=\\\"%s\\\">%d<br />(%d)</td><td class=\\\"good\\\">%d<br />(%d)</td><td class=\\\"%s\\\">%d<br />(%d)</td><td class=\\\"good\\\">%d</td></tr>\\n\",\n $name, $length, $iterationLength, $memory, $iterationMemory, $peakMemory,\n $queries, $iterationQueries, $modelsMemory, $iterationObjectsMemory,\n $modelsCache, $iterationObjectsCache, $modelsDatabase == 0 ? 'good' : 'bad',\n $modelsDatabase, $iterationObjectsDatabase, $cacheHit, $iterationCacheHit,\n $cacheMiss == 0 ? 'good' : 'bad', $cacheMiss, $iterationCacheMiss, $iterations);\n } else {\n $activities .= sprintf(\"\\t<tr><th>%s</th><td class=\\\"good\\\">%0.4f sec</td><td class=\\\"good\\\">%s</td><td class=\\\"good\\\">%s</td><td class=\\\"good\\\">%d</td><td class=\\\"good\\\">%d</td><td class=\\\"good\\\">%d</td><td class=\\\"%s\\\">%d</td><td class=\\\"good\\\">%d</td><td class=\\\"%s\\\">%d</td><td class=\\\"good\\\">%d</td></tr>\\n\",\n $name, $length, $memory, $peakMemory, $queries, $modelsMemory, $modelsCache,\n $modelsDatabase == 0 ? 'good' : 'bad', $modelsDatabase, $cacheHit,\n $cacheMiss == 0 ? 'good' : 'bad', $cacheMiss, $iterations);\n }\n }\n $report .= '<h2>Performance Break-down</h2>';\n $report .= sprintf('<table><thead><tr><th width=\"100px\" rowspan=\"2\">Activity</th><th rowspan=\"2\">Execution Time</td><th rowspan=\"2\">Memory Usage<br />Differential</th><th rowspan=\"2\">Memory Usage<br />Peak</th><th rowspan=\"2\">Queries</th><th colspan=\"3\">Loaded Models</th><th colspan=\"2\">Cache Activity</th><th rowspan=\"2\">Iterations</th></tr><tr><th>Memory</th><th>Cache</th><th>Database</th><th>Hit</th><th>Miss</th></tr></thead><tbody>%s</tbody></table>',\n $activities);\n // Query information.\n $report .= $this->generateQueryReport();\n // Cache information.\n $report .= $this->generateCachesReport() . '<br />';\n $url = DRequest::load()->getUrl();\n\n return \"<h1 id=\\\"\" . count(DErrorHandler::$profiling) . \"\\\">Profiler ({$url})</h1>{$report}\";\n }", "public function theme()\n {\n }", "function log_stats($page_id)\n {\n global $app, $HTTP_USER_AGENT, $REMOTE_ADDR;\n\t\t$app[current_page] = $page_id;\n\t\t$year = date('Y');\n $hour = date('g a');\n $week = date('w');\n $month = date('F');\n\n\t\t## total hit \n $sql = \"select * from {$app[table][stats_hit]}\n where year = '$year'\";\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_hit]} \n set counter = counter + 1\n where year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_hit]} (counter, year) values(1,'$year')\";\n endif;\n db::qry($sql);\n \n ## by page\n $sql = \"select * from {$app[table][stats_page]}\n where page_id = '$page_id' and year = '$year'\";\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_page]} \n \tset counter = counter + 1\n\t\t\t\t\twhere page_id = '$page_id' and year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_page]} (page_id, counter, year) values('$page_id',1,'$year')\";\n endif;\n db::qry($sql);\n\t\n ## by browser\n if (eregi(\"Nav\", $HTTP_USER_AGENT) || eregi(\"Gold\", $HTTP_USER_AGENT) || eregi(\"X11\", $HTTP_USER_AGENT) || eregi(\"en-US\", $HTTP_USER_AGENT) || eregi(\"Netscape\", $HTTP_USER_AGENT) || eregi(\"Mozilla/4.74\", $HTTP_USER_AGENT)):\n $browser = \"Netscape\";\n elseif (eregi(\"Lynx\", $HTTP_USER_AGENT)): \n $browser = \"Lynx\";\n elseif (eregi(\"Opera\", $HTTP_USER_AGENT)): \n $browser = \"Opera\";\n elseif (eregi(\"Konqueror\", $HTTP_USER_AGENT)): \n $browser = \"Konqueror\";\n elseif (eregi(\"Bot\", $HTTP_USER_AGENT) || eregi(\"Google\", $HTTP_USER_AGENT) || eregi(\"Slurp\", $HTTP_USER_AGENT) || eregi(\"Scooter\", $HTTP_USER_AGENT) || eregi(\"Spider\", $HTTP_USER_AGENT) || eregi(\"Infoseek\", $HTTP_USER_AGENT)):\n $browser = \"Bot\";\n elseif (eregi(\"MSIE\", $HTTP_USER_AGENT)):\n $browser = \"MSIE\";\n else:\n $browser = \"Other\";\n endif;\n \n $sql = \"select * from {$app[table][stats_browser]}\n where browser = '$browser' and year = '$year'\";\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_browser]} \n set counter = counter + 1\n where browser = '$browser' and year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_browser]} (browser, counter, year) values('$browser',1,'$year')\";\n endif; \n db::qry($sql); \n\t\n ## by OS\n if (eregi(\"Win\", $HTTP_USER_AGENT)):\n $os = \"Windows\";\n elseif (eregi(\"Mac\", $HTTP_USER_AGENT)): \n $os = \"Mac\";\n elseif (eregi(\"PPC\", $HTTP_USER_AGENT)): \n $os = \"Mac\";\n elseif (eregi(\"Linux\", $HTTP_USER_AGENT)): \n $os = \"Linux\";\n elseif (eregi(\"FreeBSD\", $HTTP_USER_AGENT)): \n $os = \"FreeBSD\";\n elseif (eregi(\"SunOS\", $HTTP_USER_AGENT)):\n $os = \"SunOS\";\n elseif (eregi(\"IRIX\", $HTTP_USER_AGENT)):\n $os = \"IRIX\";\n elseif (eregi(\"BeOS\", $HTTP_USER_AGENT)):\n $os = \"BeOS\";\n elseif (eregi(\"OS/2\", $HTTP_USER_AGENT)):\n $os = \"OS2\";\n elseif (eregi(\"AIX\", $HTTP_USER_AGENT)):\n $os = \"AIX\";\n else:\n $os = \"Other\";\n endif;\n \n $sql = \"select * from {$app[table][stats_os]}\n where os = '$os' and year = '$year'\";\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_os]} \n set counter = counter + 1\n where os = '$os' and year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_os]} (os, counter, year) values('$os',1,'$year')\";\n endif;\n\t\tdb::qry($sql);\n\t\n\t\t## by hour\n\t\t$sql = \"select * from {$app[table][stats_hour]}\n where jam = '$hour' and year = '$year'\";\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_hour]} \n set counter = counter + 1\n where jam = '$hour' and year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_hour]} (jam, counter, year) values('$hour',1,'$year')\";\n endif;\n\t\tdb::qry($sql);\n\t\t\n\t\t## by weekday\n\t\t$sql = \"select * from {$app[table][stats_week]}\n where hari = '$week' and year = '$year'\";\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_week]} \n set counter = counter + 1\n where hari = '$week' and year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_week]} (hari, counter, year) values('$week',1,'$year')\";\n endif;\n\t\tdb::qry($sql);\n\t\t\t\n ## by month\n $sql = \"select * from {$app[table][stats_month]}\n where bulan = '$month' and year = '$year'\";\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_month]} \n set counter = counter + 1\n where bulan = '$month' and year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_month]} (bulan, counter, year) values('$month',1,'$year')\";\n endif;\n\t\tdb::qry($sql);\n \t\n \t## by IP\n \t$ip = $REMOTE_ADDR;\n \t#$hostname = @gethostbyaddr($ip);\n\t\t$hostname = $ip;\n\t\t$sql = \"select * from {$app[table][stats_ip]} where ip = '$ip' and year = '$year'\";\n\t\t#echo $sql;exit;\n db::query($sql, $rs, $nr);\n if ($nr):\n $sql = \"update {$app[table][stats_ip]} \n set counter = counter + 1\n where ip = '$ip' and year = '$year'\";\n else:\n $sql = \"insert into {$app[table][stats_ip]} (ip, hostname, counter, year) values('$ip','$hostname', 1, '$year')\";\n endif;\n db::qry($sql);\n\t}", "private function profilerInit(): void\n {\n\n Profiler::init();\n Profiler::xhprofStart();\n\n }", "function get_theme_updates()\n {\n }", "private function warmUp()\r\n\t{\r\n\t\t$this->loadPage( 1 );\r\n }", "function list_theme_updates()\n {\n }", "public function Action_foo()\n\t{\n\t if (Kohana::$profiling === TRUE)\n\t {\n\t // Start a new benchmark\n\t $benchmark = Profiler::start('my_group', __FUNCTION__);\n\t }\n\t for($i=0;$i<1000000;$i++){\n\t \techo $i;\n\t }\n\t // Do some stuff\n\t if (isset($benchmark))\n\t {\n\t // Stop the benchmark\n\t Profiler::stop($benchmark);\n\t }\n\t echo View::factory('profiler/stats');\n\t}", "function printResults () {\n\n if (! $this->isActive()) { return; }\n\n $unstoppedTasks = array_keys($this->startTime);\n if (count($unstoppedTasks)) {\n Tht::error('Unstopped Perf task: `' . $unstoppedTasks[0] . '`');\n }\n\n $results = $this->results();\n\n // Have to do this outside of results() or the audit calls will show up in the perf tasks.\n // $results['imageAudit'] = Tht::module('Image')->auditImages(Tht::path('public'));\n\n $thtDocLink = Tht::getThtSiteUrl('/reference/perf-panel');\n $compileMessage = Compiler::getDidCompile() ? '<div class=\"bench-compiled\">Files were updated. Refresh to see compiled results.</div>' : '';\n\n $table = OTypeString::getUntyped(\n Tht::module('Web')->u_table(OList::create($results['single']),\n OList::create([ 'task', 'durationMs', 'memoryMb', 'value' ]),\n OList::create([ 'Task', 'Duration (ms)', 'Peak Memory (MB)', 'Detail' ]),\n OMap::create(['class' => 'bench-result'])\n ), 'html');\n\n $tableGroup = OTypeString::getUntyped(\n Tht::module('Web')->u_table(OList::create($results['group']),\n OList::create([ 'task', 'durationMs', 'memoryMb', 'numCalls' ]),\n OList::create([ 'Task', 'Duration (ms)', 'Memory (MB)', 'Calls' ]),\n OMap::create(['class' => 'bench-result'])\n ), 'html');\n\n\n $opCache = '';\n if (Tht::isOpcodeCacheEnabled()) {\n $opCache = '<span style=\"color: #393\">ON</span>';\n }\n else {\n $opCache = '<span style=\"color: #c33\">OFF</span>';\n }\n\n $appCache = Tht::module('Cache')->u_get_driver();\n if ($appCache == 'file') {\n $appCache = '<span style=\"color: #c33\">' . $appCache . '</span>';\n }\n else {\n $appCache = '<span style=\"color: #393\">' . $appCache . '</span>';\n }\n\n\n\n $phpVersion = phpVersion();\n\n\n echo $this->perfPanelCss();\n echo $this->perfPanelJs($results['scriptTime']);\n\n ?>\n <div id=\"perf-score-container\">\n\n <div class=\"perfSection\">\n <div class='perfHeader'>Perf Score: <span id='perfScoreTotalLabel'></span><span id='perfScoreTotal'></span></div>\n\n <div class=\"perfHelp\"><a href=\"<?= $thtDocLink ?>\" style=\"font-weight:bold\">About This Score</a></div>\n </div>\n\n <?= $compileMessage ?>\n\n <div class=\"perfSection\">\n <div class=\"perfTotals\">\n <div>Server - Page Execution: <span id=\"perfScoreServer\"><?= $results['scriptTime'] ?> ms</span></div>\n <div>Network - Transfer: <span id='perfScoreNetwork'></span></div>\n <div>Browser - window.onload: <span id='perfScoreClient'></span></div>\n </div>\n </div>\n\n <div class=\"perfSection\">\n <div class=\"perfTotals\">\n <div>Server - Peak Memory: <span><?= $results['peakMemory'] ?> MB</span></div>\n </div>\n </div>\n\n <div class=\"perfSection tasksGrouped\">\n <div class=\"perfSubHeader\">Top Tasks (Grouped)</div>\n <?= $tableGroup ?>\n </div>\n\n <div class=\"perfSection\">\n <div class=\"perfSubHeader\">Top Tasks (Individual)</div>\n <?= $table ?>\n <div style='text-align:center; margin-top:48px;'>\n <p style=\"font-size: 80%\"> Sub-task time is not included in parent tasks.</p>\n </div>\n </div>\n\n\n\n <div class=\"perfSection\">\n <div class=\"perfHeader\">PHP Info</div>\n\n <div style=\"text-align: left; width: 300px; display: inline-block; margin-top: 32px\">\n <li>PHP Version: <b><?= $phpVersion ?></b></li>\n <li>Opcode Cache: <b><?= $opCache ?></b></li>\n <li>App Cache Driver: <b><?= $appCache ?></b></li>\n </div>\n </div>\n\n <div class=\"perfSection\">\n Perf Panel only visible to localhost or <code>devIp</code> in <code>config/app.jcon</code>\n </div>\n\n </div>\n <?php\n\n }", "function generate( $name ) \n {\n $this->render( 'xhprof.php' , $name . '.php' , array( \n 'name' => $name,\n ));\n }", "public static function display()\n {\n $display = '';\n if (self::$_sessionBenchmarkOn) {\n $display = '<div style=\"\n color: #FFFFFF;\n background-color: #3d3d3d;\n border-color: #FFFFFF;\n border-width: 1px;\n border-style: solid;\n margin-left: auto;\n margin-right: auto;\n width: 90%;\n text-align: center;\n margin-bottom:25px;\n margin-top:25px;\n \">';\n\n $benchmarkStartTime = self::$_sessionBenchmarkStart;\n $benchmarkEndTime = self::$_sessionBenchmarkFinish;\n $total = ($benchmarkEndTime - $benchmarkStartTime) *1000;\n $formatTime = number_format($total, 5, '.', ' ');\n $memoryUsage = memory_get_usage()/1024;\n\n $display .= '\n Total application runtime: ' . $formatTime . ' ms&nbsp;&nbsp;&nbsp;&nbsp;\n Total memory usage: '. number_format($memoryUsage, 3, ',', '')\n . ' kB<br /><br />';\n\n $display .= 'Marker times:<br /><table style=\"width:100%\">'.\"\\n\";\n\n foreach (self::$_sessionBenchmarkMarkers as $marker) {\n if ($marker['marker_color']) {\n $additionalColor = 'background-color:#' . dechex($marker['marker_color']);\n } else {\n $additionalColor = '';\n }\n\n if ($marker['marker_time'] === '') {\n $time = '-';\n $percent = '-';\n $ram = '-';\n } else {\n $ram = ($marker['marker_memory'] - self::$_sessionMemoryStart) / 1024;\n $ram = number_format($ram, 3, ',', '');\n $percent = ($marker['marker_time'] / $total) *100000;\n $percent = number_format($percent, 5);\n $time = number_format(\n $marker['marker_time'] *1000,\n 5,\n '.',\n ' '\n );\n $time .= ' ms';\n $percent .= ' %';\n $ram .= ' kB';\n }\n\n $display .= '<tr style=\"' . $additionalColor . '\">\n <td style=\"width:40%;color:#fff\">' . $marker['marker_name'] . '</td>' . \"\\n\";\n $display .= '<td style=\"width:20%\">' . $time . '</td>'.\"\\n\";\n $display .= '<td style=\"width:20%\">' . $percent . '</td>'.\"\\n\";\n $display .= '<td style=\"width:20%;color:#fff\">' . $ram . '</td>\n </tr>' . \"\\n\";\n }\n $display .= '</table></div>';\n }\n return $display;\n }", "function get_theme_data($theme_file)\n {\n }", "function xhprof_disable()\n{\n}", "function pantomime_num_queries(){\n\techo '<p id=\"footer-num-queries\">';\n\t_e('Generated from '. get_num_queries() .' queries in '. timer_stop(0,3) .' seconds.', 'pantomime');\n\techo '</p>';\n}", "function debug($tab){\n\techo '<div style=\"color: white; padding: 20px; font-weight: bold; background:#' . rand(111111, 999999) . '\">';\n\n\t$trace = debug_backtrace(); // Retourne les infos sur l'emplace ou est executee une fonction\n\techo 'Le debug a ete demande dans le fichier : ' . $trace[0]['file'] . ' à la ligne : ' . $trace[0]['line'] . '</hr>';\n\n\n\n\n\n echo '<pre>';\n print_r($tab);\n echo '</pre>';\n\n\n echo '</div>';\n\n}", "function projectMetrics($ProjectName,$currbilling,$nop=\"\",$not=\"\"){\n\n\t$projectName=$ProjectName;\n\t$cur =$currbilling;\n\techo \"<SCRIPT LANGUAGE=\\\"Javascript\\\" SRC=\\\"./includes/FusionCharts.js\\\"></SCRIPT>\";\n\techo \"<br><br><br>\";\n\t$i=0;\n\t$j=13;\n\n\t$sql=\" SELECT Distinct (b.`BillingcutoffDate`), SUM(WorkingHours)as Billing_Hours, (SELECT fte FROM pmdb_fte_metrics where ProjectName Like \\\"$projectName\\\" AND b.`BillingcutoffDate`= pmdb_fte_metrics.BillingcutoffDate)as FTE,\n\t\t\t\tSUM(b.`Workinghours`)* (SELECT fte FROM pmdb_fte_metrics where ProjectName Like \\\"$projectName\\\" AND b.`BillingcutoffDate`= pmdb_fte_metrics.BillingcutoffDate)+.1*SUM(b.`Workinghours`)* (SELECT fte FROM pmdb_fte_metrics where ProjectName Like \\\"$projectName\\\" AND b.`BillingcutoffDate`= pmdb_fte_metrics.BillingcutoffDate)as Demand_hrs,\n\t\t\t\t(SELECT SUM(p.`Actual_Hrs`+ p.`Illustration_Hrs`) from `$projectName` p where b.`BillingcutoffDate`= p.Billing_Cutoff_dt AND tech_gate NOT Like \\\"Rejected\\\")as Actual_hrs,\n\t\t\t\t(SELECT COUNT(*) from `$projectName` p where b.`BillingcutoffDate`= p.Billing_Cutoff_dt AND tech_gate NOT Like \\\"Rejected\\\")as No_of_tasks,\n\t\t\t\t(SELECT SUM(p.`No_of_Pages`) from `$projectName` p where b.`BillingcutoffDate`= p.Billing_Cutoff_dt AND tech_gate NOT Like \\\"Rejected\\\")as No_of_pages,\n\t\t\t\t(SELECT ROUND((SUM(p.`Actual_Hrs`)*60/SUM(p.`No_of_Pages`)),2) from `$projectName` p where b.`BillingcutoffDate`= p.Billing_Cutoff_dt AND tech_gate NOT Like \\\"Rejected\\\")as Minperpage\n\t\t\t\tFROM billing b\n\t\t\t\tWHERE YEAR(b.`BillingcutoffDate`) = YEAR('$currbilling')\n\t\t\t\tgroup by b.`BillingcutoffDate`\n\t\t\t\torder by b.`BillingcutoffDate`;\";\n\t$result = dbi_query($sql);\n\t$i=0;\n\twhile($row = dbi_fetch_row($result))\n\t{\n\t\t$billingcutoffdates[$i]= $row[0];\n\t\tif($billingcutoffdates[$i]==$cur)\n\t\t$j=$i;\n\t\t$billingDt[$i]=date(\"d-M-Y\", strtotime(\"$billingcutoffdates[$i]\"));\n\t\t$billingDates[$i]=date(\"m:F(d-M-y)\", strtotime(\"$billingcutoffdates[$i]\"));\n\t\t$billingMonth[$i]=date(\"M-Y\", strtotime(\"$billingcutoffdates[$i]\"));\n\t\t$standardHours[$i]=$row[1];\n\t\t$goalFte[$i]=$row[2];\n\t\tif(!empty($row[3]))\n\t\t$demandHours[$i]=$row[3];\n\t\telse\n\t\t$demandHours[$i]=0;\n\t\tif(!empty($row[4]))\n\t\t$actualHours[$i]=$row[4];\n\t\telse\n\t\t$actualHours[$i]=0;\n\t\tif(!empty($row[5]))\n\t\t$noOfTasks[$i]= $row[5];\n\t\telse\n\t\t$noOfTasks[$i]= 0;\n\t\tif(!empty($row[6]))\n\t\t$noOfPages[$i]= $row[6];\n\t\telse\n\t\t$noOfPages[$i]= 0;\n\t\t$i++;\n\t}\n\tdbi_free_result ( $result );\n\t$j++;\n\t\n\t$firstDay=substr($billingcutoffdates[0],0,3);\n\t$firstDay.=\"-01-01\";\n\tfor($k=0;$k<$j;$k++){\n\t\t$s=\"Select SUM(`sapprojectwise`.hours)as Hours from `sapprojectwise`\n \t\tinner join pmdb_project_mapping ON `sapprojectwise`.level2WBSdescription = `pmdb_project_mapping`.level2WBSdescription\n \t\t\twhere `pmdb_project_mapping`.projectname Like '$projectName' AND YEAR(YearofPrj) = YEAR('$currbilling') \";\n\t\t\t\n\t\tif($k==0)\n\t\t$s.=\"AND `sapprojectwise`.`date` BETWEEN '$firstDay' AND '$billingcutoffdates[0]'\";\n\t\telse{\n\t\t\t$l=$k-1;\n\t\t\t$s.=\"AND `sapprojectwise`.`date` BETWEEN ADDDATE('$billingcutoffdates[$l]',1) AND ADDDATE('$billingcutoffdates[$k]',1)\";\n\t\t}\n\t\t\t\n\t\t$res = dbi_query($s);\n\t\twhile($row = dbi_fetch_row($res))\t{\n\t\t\tif(!empty($row[0]))\n\t\t\t$actualHrs[$k]=$row[0];\n\t\t\telse\n\t\t\t$actualHrs[$k]=0;\n\t\t}\n\n\n\t}\n\t// getting the dollar vale from a variable in init.php\n\n\tfor($k=0;$k<$t;$k++){\n\t\t$totaldemand+=$demandHours[$k];\n\t\t$totalact+=$actualHours[$k];\n\t}\n\n\n\n\t// XML For Project Metrics Chart\n\n\t$srtrXML = \"\";\n\t$srtrXML .= \"<chart labelDisplay='ROTATE' adjustDiv='1' plotGradientColor='000222' placeValuesInside='1' rotateValues='1' numberprtrendline = '50' zeroPlaneAlpha='5' slantLabels='1' SYAxisName='$nop' PYAxisName='$not' caption='$projectName Metrics' bgColor='d9e1e4' xAxisName='Billing cutoff Dates' showValues='$chartValues' animation='1' formatNumberScale='0' showBorder='1'\";\n\t$srtrXML .= \"exportEnabled='1' exportAtClient='0' exportAction='download' exportHandler='http://ie11dt7twqr1s.global.ds.honeywell.com/pmdb/includes/PHP/FCExporter.php' exportFileName='MyFileName'>\";\n\t$srtrXML .= \"<categories>\";\n\tFor($i=0;$i<$j;$i++)\n\t$srtrXML .= \"<category label='$billingDt[$i]' />\";\n\t$srtrXML .= \"</categories>\";\n\n\t$srtrXML .= \"<dataset seriesName='$nop' parentYAxis='S'>\";\n\tFor($i=0;$i<$j;$i++){\n\t\t$srtrXML .= \"<set value='$noOfPages[$i]' \";\n\t\tif(($noOfTasks[$i]==\"0\")&& ($noOfPages[$i]==\"0\"))\n\t\t$srtrXML .= \" displayValue='No Work' \";\n\t\t//\t\t\t\t\t\t\t\telse\n\t\t//\t\t\t\t\t\t\t\t\t$srtrXML .= \" displayValue=' ' \";\n\t\t$srtrXML .= \" />\";\n\t}\n\t$srtrXML .= \"</dataset>\";\n\n\t$srtrXML .= \"<dataset seriesName='$not' >\";\n\tFor($i=0;$i<$j;$i++){\n\t\t$srtrXML .= \"<set value='$noOfTasks[$i]' \";\n\t\tif(($noOfTasks[$i]==\"0\")&& ($noOfPages[$i]==\"0\"))\n\t\t$srtrXML .= \" displayValue=' ' \";\n\t\t//\t\t\t\t\t\t\t\telse\n\t\t//\t\t\t\t\t\t\t\t\t$srtrXML .= \" displayValue=' ' \";\n\t\t$srtrXML .= \" />\";\n\t}\n\t$srtrXML .= \"</dataset>\";\n\t$srtrXML .= \"</chart>\";\n\n\n\n\t// This is for BA chart\n\t$srtXML = \"\";\n\t$srtXML .= \"<chart labelDisplay='ROTATE' adjustDiv='1' plotGradientColor='000222' placeValuesInside='1' rotateValues='1' numberprtrendline = '50' zeroPlaneAlpha='5' slantLabels='1' SYAxisName='$nop' PYAxisName='$not' caption='$projectName Metrics' bgColor='d9e1e4' xAxisName='Billing cutoff Dates' showValues='$chartValues' formatNumberScale='0' showBorder='1'\";\n\t$srtXML .= \"exportEnabled='1' exportAtClient='0' exportAction='download' exportHandler='http://ie11dt7twqr1s.global.ds.honeywell.com/pmdb/includes/PHP/FCExporter.php' exportFileName='MyFileName'>\";\n\t$srtXML .= \"<categories>\";\n\tFor($i=0;$i<$j;$i++)\n\t$srtXML .= \"<category label='$billingMonth[$i]' />\";\n\t$srtXML .= \"</categories>\";\n\n\t$srtXML .= \"<dataset seriesName='Demand Hours' >\";\n\tFor($i=0;$i<$j;$i++){\n\t\t$srtXML .= \"<set value='$demandHours[$i]' />\";\n\t}\n\t$srtXML .= \"</dataset>\";\n\n\t//\t\t\t\t\t\t\t$srtXML .= \"<dataset seriesName='Aewa Hours' renderAs='Line'>\";\n\t//\t\t\t\t\t\t\tFor($i=0;$i<$j;$i++){\n\t//\t\t\t\t\t\t\t$srtXML .= \"<set value='$aewa[$i]' />\";\n\t//\t\t\t\t\t\t\t}\n\t//\t\t\t\t\t\t\t$srtXML .= \"</dataset>\";\n\n\t$srtXML .= \"<dataset seriesName='SAP Charged Hours'>\";\n\tFor($i=0;$i<$j;$i++){\n\t\t//\n\t\t$srtXML .= \"<set value='$actualHrs[$i]' />\";\n\t\t//\n\t}\n\t$srtXML .= \"</dataset>\";\n\n\n\t$srtXML .= \"<dataset seriesName='Actual FTE' parentYAxis='S'>\";\n\tFor($i=0;$i<$j;$i++){\n\t\t$actualFte[$i]=($actualHrs[$i]*$goalFte[$i])/$demandHours[$i];\n\t\t$actualFte[$i]=ROUND($actualFte[$i],2);\n\t\t$srtXML .= \"<set value='$actualFte[$i]' />\";\n\t}\n\t$srtXML .= \"</dataset>\";\n\n\t$srtXML .= \"<dataset seriesName='Goal FTE' parentYAxis='S'>\";\n\tFor($i=0;$i<$j;$i++){\n\t\t$srtXML .= \"<set value='$goalFte[$i]' />\";\n\t}\n\t$srtXML .= \"</dataset>\";\n\n\t$srtXML .= \"</chart>\";\n\n\t// Create the chart - Column 3D Chart with data from strXML variable using dataXML method\n\techo \"<div id=\\\"Multiple\\\" >\";\n\techo \"<div id=\\\"Left\\\" >\";\n\tif(($ProjectName!=\"AeroPDM_Activity\")||($ProjectName!=\"AVEL_MRO_DOC\"))\n\techo renderChart(\"./Charts/ScrollCombiDY2D.swf\", \"\", $srtrXML, \"myNext1\",600, 400, 0, 0);\n\techo \"</div>\";\n\techo \"<div id=\\\"Left\\\" >\";\n\n\techo renderChart(\"./Charts/ScrollCombiDY2D.swf\", \"\", $srtXML, \"myNext\",600, 400, 0, 0);\n\techo \"</div>\";\n\techo \"</div>\";\n}", "function trace(){\n\t\techo($this->get_trace()/(1024*1024).\" MB\");\n\t}", "function run()\n\t{\n\t\tif ((get_param('keep_lang',NULL)===NULL) || (get_param('keep_theme',NULL)===NULL))\n\t\t{\n\t\t\t// We need to run this for each language and for each theme\n\t\t\t$langs=find_all_langs();\n\t\t\trequire_code('themes2');\n\t\t\t$themes=find_all_themes();\n\t\t\tforeach (array_keys($langs) as $lang)\n\t\t\t{\n\t\t\t\tforeach (array_keys($themes) as $theme)\n\t\t\t\t{\n\t\t\t\t\tif (($theme=='default') || (has_category_access(get_member(),'theme',$theme)))\n\t\t\t\t\t{\n\t\t\t\t\t\t$where=array('c_theme'=>$theme,'c_lang'=>$lang);\n\t\t\t\t\t\t$count=$GLOBALS['SITE_DB']->query_value('cron_caching_requests','COUNT(*)',$where);\n\t\t\t\t\t\tif ($count>0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$url=get_base_url().'/data/cron_bridge.php?limit_hook=block_caching&keep_lang='.urlencode($lang).'&keep_theme='.urlencode($theme);\n\t\t\t\t\t\t\thttp_download_file($url,NULL,false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Force re-loading of values that we use to mark progress (as above calls probably resulted in changes happening)\n\t\t\tglobal $VALUES;\n\t\t\t$VALUES=$GLOBALS['SITE_DB']->query_select('values',array('*'));\n\t\t\t$VALUES=list_to_map('the_name',$VALUES);\n\n\t\t\treturn;\n\t\t}\n\n\t\t$where=array('c_theme'=>$GLOBALS['FORUM_DRIVER']->get_theme(),'c_lang'=>user_lang());\n\t\t$requests=$GLOBALS['SITE_DB']->query_select('cron_caching_requests',array('id','c_codename','c_map','c_timezone','c_is_bot','c_in_panel','c_interlock','c_store_as_tempcode'),$where);\n\t\tforeach ($requests as $request)\n\t\t{\n\t\t\t$GLOBALS['NO_QUERY_LIMIT']=true;\n\n\t\t\t$codename=$request['c_codename'];\n\t\t\t$map=unserialize($request['c_map']);\n\n\t\t\t$object=do_block_hunt_file($codename,$map);\n\t\t\tif (is_object($object))\n\t\t\t{\n\t\t\t\tglobal $LANGS_REQUESTED,$JAVASCRIPTS,$CSSS,$LANGS_REQUESTED,$DO_NOT_CACHE_THIS,$TIMEZONE_MEMBER_CACHE;\n\n\t\t\t\t$backup_langs_requested=$LANGS_REQUESTED;\n\t\t\t\t$backup_javascripts=$JAVASCRIPTS;\n\t\t\t\t$backup_csss=$CSSS;\n\t\t\t\tget_users_timezone();\n\t\t\t\t$backup_timezone=$TIMEZONE_MEMBER_CACHE[get_member()];\n\t\t\t\t$LANGS_REQUESTED=array();\n\t\t\t\t$JAVASCRIPTS=array('javascript'=>1,'javascript_thumbnails'=>1);\n\t\t\t\t$CSSS=array('no_cache'=>1,'global'=>1);\n\t\t\t\t$cache=$object->run($map);\n\t\t\t\t$TIMEZONE_MEMBER_CACHE[get_member()]=$backup_timezone;\n\t\t\t\t$cache->handle_symbol_preprocessing();\n\t\t\t\tif (!$DO_NOT_CACHE_THIS)\n\t\t\t\t{\n\t\t\t\t\tif (method_exists($object,'cacheing_environment'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$info=$object->cacheing_environment();\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$info=array();\n\t\t\t\t\t\t$info['cache_on']='array($map,$GLOBALS[\\'FORUM_DRIVER\\']->get_members_groups(get_member()))';\n\t\t\t\t\t\t$info['ttl']=60*24;\n\t\t\t\t\t}\n\t\t\t\t\t$ttl=$info['ttl'];\n\n\t\t\t\t\t$_cache_identifier=array();\n\t\t\t\t\t$cache_on=$info['cache_on'];\n\t\t\t\t\tif (is_array($cache_on))\n\t\t\t\t\t{\n\t\t\t\t\t\t$_cache_identifier=call_user_func($cache_on[0],$map);\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\tif (($cache_on!='') && (!defined('HIPHOP_PHP')))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_cache_on=eval('return '.$cache_on.';'); // NB: This uses $map, as $map is referenced inside $cache_on\n\t\t\t\t\t\t\tif (is_null($_cache_on)) return NULL;\n\t\t\t\t\t\t\tforeach ($_cache_on as $on)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$_cache_identifier[]=$on;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif (defined('HIPHOP_PHP')) return NULL;\n\t\t\t\t\t}\n\t\t\t\t\t$_cache_identifier[]=$request['c_timezone'];\n\t\t\t\t\t$_cache_identifier[]=$request['c_is_bot']==0;\n\t\t\t\t\t$_cache_identifier[]=strval($request['c_in_panel']);\n\t\t\t\t\t$_cache_identifier[]=strval($request['c_interlock']);\n\t\t\t\t\t$cache_identifier=serialize($_cache_identifier);\n\n\t\t\t\t\trequire_code('caches2');\n\t\t\t\t\tif ($request['c_store_as_tempcode']==1) $cache=make_string_tempcode($cache->evaluate());\n\t\t\t\t\tput_into_cache($codename,$ttl,$cache_identifier,$cache,array_keys($LANGS_REQUESTED),array_keys($JAVASCRIPTS),array_keys($CSSS),true);\n\t\t\t\t}\n\t\t\t\t$LANGS_REQUESTED+=$backup_langs_requested;\n\t\t\t\t$JAVASCRIPTS+=$backup_javascripts;\n\t\t\t\t$CSSS+=$backup_csss;\n\t\t\t}\n\n\t\t\t$GLOBALS['SITE_DB']->query_delete('cron_caching_requests',$request);\n\t\t}\n\t}", "function show_profile($args) {\n $options = get_option(\"rp_options\");\n if (!is_array( $options ))\n {\n $options = array(\n 'title' => 'My Character',\n 'name' => 'Stealth_Ltd',\n\t\t\t'data' => $data\n ); \n }\n extract($args);\n echo $before_widget;\n echo $before_title . $options['title'] . $after_title;\n //* The fun *//\n $player = $options['data'];\n $stats = str_replace(\"-1\", \"Unranked\", $player);\n $stats = explode(\"\\n\",$stats);\n $skill['Overall']= explode(\",\",$stats[0]);\n $skill['Attack'] = explode(\",\",$stats[1]);\n $skill['Defence'] = explode(\",\",$stats[2]);\n $skill['Strength'] = explode(\",\",$stats[3]);\n $skill['Hitpoints'] = explode(\",\",$stats[4]);\n $skill['Range'] = explode(\",\",$stats[5]);\n $skill['Prayer'] = explode(\",\",$stats[6]);\n $skill['Magic'] = explode(\",\",$stats[7]);\n $skill['Cooking']= explode(\",\",$stats[8]);\n $skill['Woodcutting']= explode(\",\",$stats[9]);\n $skill['Flretching']= explode(\",\",$stats[10]);\n $skill['Fishing']= explode(\",\",$stats[11]);\n $skill['Fire Making']= explode(\",\",$stats[12]);\n $skill['Crafting']= explode(\",\",$stats[13]);\n $skill['Smithing']= explode(\",\",$stats[14]);\n $skill['Mining']= explode(\",\",$stats[15]);\n $skill['Herblore']= explode(\",\",$stats[16]);\n $skill['Agility']= explode(\",\",$stats[17]);\n $skill['Thieving']= explode(\",\",$stats[18]);\n $skill['Slayer']= explode(\",\",$stats[19]);\n $skill['Faring']= explode(\",\",$stats[20]);\n $skill['Runecrafting']= explode(\",\",$stats[21]);\n $skill['Hunter']= explode(\",\",$stats[22]);\n $skill['Construction']= explode(\",\",$stats[23]);\n $skill['Summoning']= explode(\",\",$stats[24]);\n $skill['Duel']= explode(\",\",$stats[25]);\n $skill['Bounty']= explode(\",\",$stats[26]);\n $skill['Rogue']= explode(\",\",$stats[27]);\n $skill['Fist of guthix']= explode(\",\",$stats[28]);\n echo '<table style=\"width: 100%; text-align: left;\">';\n foreach($skill as $key => $value){\n echo '<tr><td style=\"width: 49%;\">'. $key .'</td><td style=\"width: 49%; text-align: right;\">'. $value[1] .'</td></tr>';\n }\n echo '</table>';\n echo $after_widget;\n}", "function projectMetricsProgram($ProjectName,$currbilling,$nop=\"\",$not=\"\"){\n\n\t$projectName=$ProjectName;\n\t$currentBilling =$currbilling;\n\techo \"<SCRIPT LANGUAGE=\\\"Javascript\\\" SRC=\\\"./includes/FusionCharts.js\\\"></SCRIPT>\";\n\t//\tif(empty($nop))\n\t//\t$nop=\"No of Pages\";\n\t//\tif(empty($not))\n\t//\t$not=\"No of Tasks\";\n\techo \"<br><br><br>\";\n\t$sql=\" SELECT Distinct (b.`BillingcutoffDate`), SUM(WorkingHours)as Billing_Hours, (SELECT fte FROM pmdb_fte_metrics where ProjectName Like \\\"$projectName\\\" AND b.`BillingcutoffDate`= pmdb_fte_metrics.BillingcutoffDate)as FTE,\n\t\t\t\t\t\t\tSUM(b.`Workinghours`)* (SELECT fte FROM pmdb_fte_metrics where ProjectName Like \\\"$projectName\\\" AND b.`BillingcutoffDate`= pmdb_fte_metrics.BillingcutoffDate)+.1*SUM(b.`Workinghours`)* (SELECT fte FROM pmdb_fte_metrics where ProjectName Like \\\"$projectName\\\" AND b.`BillingcutoffDate`= pmdb_fte_metrics.BillingcutoffDate)as Demand_hrs,\n\t\t\t\t\t\t\t(SELECT SUM(p.`Actual_Hrs`+ p.`Illustration_Hrs`) from `$projectName` p where b.`BillingcutoffDate`= p.Billing_Cutoff_dt AND tech_gate NOT Like \\\"Rejected\\\")as Actual_hrs\n\t\t\t\t\t\t\tFROM billing b\n\t\t\t\t\t\t\tgroup by b.`BillingcutoffDate`\n\t\t\t\t\t\t\torder by b.`BillingcutoffDate`;\";\n\t$result = dbi_query($sql);\n\t$i=0;\n\twhile($row = dbi_fetch_row($result))\n\t{\n\t\t$billingcutoffdates[$i]= $row[0];\n\t\tif($billingcutoffdates[$i]==$currentBilling)\n\t\t$j=$i;\n\t\t$billingDt[$i]=date(\"d-M-Y\", strtotime(\"$billingcutoffdates[$i]\"));\n\t\t$billingDates[$i]=date(\"m:F(d-M-y)\", strtotime(\"$billingcutoffdates[$i]\"));\n\t\t$billingMonth[$i]=date(\"M-Y\", strtotime(\"$billingcutoffdates[$i]\"));\n\t\t$standardHours[$i]=$row[1];\n\t\t$goalFte[$i]=$row[2];\n\t\tif(!empty($row[3]))\n\t\t$demandHours[$i]=$row[3];\n\t\telse\n\t\t$demandHours[$i]=0;\n\t\tif(!empty($row[4]))\n\t\t$actualHours[$i]=$row[4];\n\t\telse\n\t\t$actualHours[$i]=0;\n\t\t$i++;\n\t}\n\tdbi_free_result ( $result );\n\t$sql=\" SELECT Program_name, COUNT(No_of_Pages)as Docs,SUM(No_of_Pages) as Pages\n\t\t\t\t\t\t\t FROM `$projectName` p \n\t\t\t\t\t\t\t Where DATE_FORMAT(Billing_Cutoff_dt,'%Y') = '2010' AND `Tech_gate` not like \\\"Rejected\\\"\n\t\t\t\t\t\t\t Group by Program_name\n\t\t\t\t\t\t\t order by Program_name DESC\";\n\t$result = dbi_query($sql);\n\t$i=0;\n\twhile($row = dbi_fetch_row($result))\n\t{\n\t\t$programs[$i]=$row[0];\n\t\t$noOfPages[$i]=$row[2];\n\t\t$noOfTasks[$i]=$row[1];\n\t\t$i++;\n\t}\n\tfor($k=0;$k<$j;$k++){\n\t\t$s=\"Select SUM(`sapprojectwise`.hours)as Hours from `sapprojectwise`\n\t\t\t\t\t\t\t \t\t\tinner join pmdb_project_mapping ON `sapprojectwise`.level2WBSdescription = `pmdb_project_mapping`.level2WBSdescription\n\t\t\t\t\t\t\t \t\t\t\twhere `pmdb_project_mapping`.projectname Like '$projectName' \";\n\t\t\t\n\t\tif($k==0)\n\t\t$s.=\"AND `sapprojectwise`.`date` BETWEEN '2010-01-04' AND '2010-01-17'\";\n\t\telse{\n\t\t\t$l=$k-1;\n\t\t\t$s.=\"AND `sapprojectwise`.`date` BETWEEN ADDDATE('$billingcutoffdates[$l]',1) AND ADDDATE('$billingcutoffdates[$k]',1)\";\n\t\t}\n\t\t\t\n\t\t$res = dbi_query($s);\n\t\twhile($row = dbi_fetch_row($res))\t{\n\t\t\tif(!empty($row[0]))\n\t\t\t$actualHrs[$k]=$row[0];\n\t\t\telse\n\t\t\t$actualHrs[$k]=0;\n\t\t}\n\n\n\t}\n\t// getting the dollar vale from a variable in init.php\n\n\t// XML For Project Metrics Chart\n\n\t$srtrXML = \"\";\n\t$srtrXML .= \"<chart labelDisplay='ROTATE' adjustDiv='1' plotGradientColor='000222' placeValuesInside='1' rotateValues='1' numberprtrendline = '50' zeroPlaneAlpha='5' slantLabels='1' SYAxisName='$nop' PYAxisName='$not' caption='$projectName Metrics' bgColor='d9e1e4' xAxisName='Billing cutoff Dates' showValues='$chartValues' formatNumberScale='0' showBorder='1'\";\n\t$srtrXML .= \"exportEnabled='1' exportAtClient='0' exportAction='download' exportHandler='http://ie11dt7twqr1s.global.ds.honeywell.com/pmdb/includes/PHP/FCExporter.php' exportFileName='MyFileName'>\";\n\t$srtrXML .= \"<categories>\";\n\tFor($i=0;$i<Count($programs);$i++)\n\t$srtrXML .= \"<category label='$programs[$i]' />\";\n\t$srtrXML .= \"</categories>\";\n\n\t$srtrXML .= \"<dataset seriesName='$nop' parentYAxis='S'>\";\n\tFor($i=0;$i<$j;$i++)\n\t$srtrXML .= \"<set value='$noOfPages[$i]' />\";\n\t$srtrXML .= \"</dataset>\";\n\n\t$srtrXML .= \"<dataset seriesName='$not' >\";\n\tFor($i=0;$i<$j;$i++)\n\t$srtrXML .= \"<set value='$noOfTasks[$i]' />\";\n\t$srtrXML .= \"</dataset>\";\n\t$srtrXML .= \"</chart>\";\n\n\n\n\t// This is for BA chart\n\t$srtXML = \"\";\n\t$srtXML .= \"<chart labelDisplay='ROTATE' adjustDiv='1' plotGradientColor='000000' placeValuesInside='1' rotateValues='1' numberprtrendline = '50' zeroPlaneAlpha='5' slantLabels='1' PYAxisName='Hours' SYAxisName='FTE' caption='$projectName Budget Vs Actual Chart' bgColor='d9e1e4' xAxisName='Billing cutoff Dates' showValues='$chartValues' formatNumberScale='0' showBorder='1'\";\n\t$srtXML .= \"exportEnabled='1' exportAtClient='0' exportAction='download' exportHandler='http://ie11dt7twqr1s.global.ds.honeywell.com/pmdb/includes/PHP/FCExporter.php' exportFileName='MyFileName'>\";\n\t$srtXML .= \"<categories>\";\n\tFor($i=0;$i<$j;$i++)\n\t$srtXML .= \"<category label='$billingMonth[$i]' />\";\n\t$srtXML .= \"</categories>\";\n\n\t$srtXML .= \"<dataset seriesName='Demand Hours' >\";\n\tFor($i=0;$i<$j;$i++){\n\t\t$srtXML .= \"<set value='$demandHours[$i]' />\";\n\t}\n\t$srtXML .= \"</dataset>\";\n\n\n\t$srtXML .= \"<dataset seriesName='SAP Charged Hours'>\";\n\tFor($i=0;$i<$j;$i++){\n\t\t//\n\t\t$srtXML .= \"<set value='$actualHrs[$i]' />\";\n\t\t//\n\t}\n\t$srtXML .= \"</dataset>\";\n\n\n\t$srtXML .= \"<dataset seriesName='Actual FTE' parentYAxis='S'>\";\n\tFor($i=0;$i<$j;$i++){\n\t\t$actualFte[$i]=($actualHrs[$i]*$goalFte[$i])/$demandHours[$i];\n\t\t$actualFte[$i]=ROUND($actualFte[$i],2);\n\t\t$srtXML .= \"<set value='$actualFte[$i]' />\";\n\t}\n\t$srtXML .= \"</dataset>\";\n\n\t$srtXML .= \"<dataset seriesName='Goal FTE' parentYAxis='S'>\";\n\tFor($i=0;$i<$j;$i++){\n\t\t$srtXML .= \"<set value='$goalFte[$i]' />\";\n\t}\n\t$srtXML .= \"</dataset>\";\n\n\t$srtXML .= \"</chart>\";\n\n\t// Create the chart - Column 3D Chart with data from strXML variable using dataXML method\n\techo \"<div id=\\\"Multiple\\\" >\";\n\techo \"<div id=\\\"Left\\\" >\";\n\tif(($ProjectName!=\"AeroPDM_Activity\")||($ProjectName!=\"AVEL_MRO_DOC\"))\n\techo renderChart(\"./Charts/MSCombiDY2D.swf\", \"\", $srtrXML, \"myNext1\",600, 400, 0, 0);\n\techo \"</div>\";\n\techo \"<div id=\\\"Left\\\" >\";\n\n\techo renderChart(\"./Charts/MSCombiDY2D.swf\", \"\", $srtXML, \"myNext\",600, 400, 0, 0);\n\techo \"</div>\";\n\techo \"</div>\";\n}", "function xhprof_sample_disable()\n{\n}", "function tt_theme_customize_setup(){\n new TT_Theme_Customizer();\n}", "function calcRunTime($totalSheets, $color, $class) {\n\tif ($class == 1) {\n\t\tswitch ($color){\n\t\t\tcase \"4/4\":\n\t\t\t\t$runTime = ($totalSheets / 1000);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t\n\t\t\tcase \"4/1\":\n\t\t\t\t$runTime = ($totalSheets / 1600);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t\n\t\t\tcase \"4/0\":\n\t\t\t\t$runTime = ($totalSheets / 2000);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"1/1\":\n\t\t\t\t$runTime = ($totalSheets / 4000);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"1/0\":\n\t\t\t\t$runTime = ($totalSheets / 8000);\t\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tif ($class == 2) {\n\t\tswitch ($color){\n\t\t\tcase \"4/4\":\n\t\t\t\t$runTime = ($totalSheets / 666);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t\n\t\t\tcase \"4/1\":\n\t\t\t\t$runTime = ($totalSheets / 888);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t\n\t\t\tcase \"4/0\":\n\t\t\t\t$runTime = ($totalSheets / 1333);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"1/1\":\n\t\t\t\t$runTime = ($totalSheets / 1333);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"1/0\":\n\t\t\t\t$runTime = ($totalSheets / 2666);\t\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tif ($class == 3) {\n\t\tswitch ($color){\n\t\t\tcase \"4/4\":\n\t\t\t\t$runTime = ($totalSheets / 666);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t\n\t\t\tcase \"4/1\":\n\t\t\t\t$runTime = ($totalSheets / 888);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t\n\t\t\tcase \"4/0\":\n\t\t\t\t$runTime = ($totalSheets / 1333);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"1/1\":\n\t\t\t\t$runTime = ($totalSheets / 1333);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"1/0\":\n\t\t\t\t$runTime = ($totalSheets / 2666);\t\n\t\t\t\tbreak;\n\t\t}\t\t\n\n}\nreturn $runTime;\n\n}", "public function new_measure() {\r\n\r\n\t\t$this->_bodyData['watches'] = $this->watch->getWatches(\r\n\t\t\t$this->session->userdata('userId'));\r\n\r\n\t\t$this->event->add(MEASURE_LOAD);\r\n\r\n\t\tarray_push($this->_headerData['javaScripts'], \"input.time.logic\", \"time.api\");\r\n\r\n\t\t$this->_headerData['headerClass'] = 'blue';\r\n\t\t$this->load->view('header', $this->_headerData);\r\n\r\n\t\t$this->load->view('measure/new-measure', $this->_bodyData);\r\n\r\n\t\t$this->load->view('footer');\r\n\t}", "function install_theme_information()\n {\n }", "function draw_interface() {\n\t\t$result = array();\n\n\t\t// Iterate through all variables\n\t\tforeach ($this->watches as $v)\n\t\t\t// NOTE: PHP variables must start with '$', else assumed smarty variable\n\t\t\t$result[] = array(\n\t\t\t\t\"var\" => $v,\n\t\t\t\t\"value\" => ((substr($v, 0, 1) == '$') ? $this->value_of_php_var($v) : $this->value_of_smarty_var($v))\n\t\t\t);\n\n\t\t//\n\t\tglobal $smarty;\n\t\t$smarty->assign_by_ref('watchlist', $result);\n\t\treturn $smarty->fetch(\"plugins/tiki-debug_watch_tab.tpl\");\n\t}", "function themeinfo( $arg ) {\n\n\t$theme_data = get_theme_data( get_bloginfo( 'stylesheet_url' ) );\n\n\treturn $theme_data[$arg];\n}", "function wp_clean_theme_json_cache()\n {\n }", "public function stats()\n {\n }", "public static function loadTheme()\n\t{\n\t\tglobal $context;\n\n\t\tloadLanguage('QuickSpoiler/');\n\n\t\tif (isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'showoperations')\n\t\t\treturn;\n\n\t\tloadCSSFile('quick_spoiler.css');\n\n\t\tif (!in_array($context['current_action'], array('helpadmin', 'printpage')))\n\t\t\tloadJavaScriptFile('quick_spoiler.js', array('minimize' => true));\n\t}", "function get_theme_info(){\n\tglobal $theme;\n\treturn $theme->get_theme_info();\n}", "public function beginProfile($token, $category='application'){\n\t\t$log = array(\"Begin Profiling $token\", 8, $category, microtime(true));\n\t\t$this->_logs[] = $log;\n\t\t$this->_profiles[$token] = $log;\n\t\t$this->_profiles[$token]['startmem'] = $this->memory_used();\n\t}", "function latto_get_info($theme_name) {\n $info = drupal_static(__FUNCTION__, array());\n if (empty($info)) {\n $lt = list_themes();\n foreach ($lt as $key => $value) {\n if ($theme_name == $key) {\n $info = $lt[$theme_name]->info;\n }\n }\n }\n\n return $info;\n}", "protected function getTwig_ProfileService()\n {\n return $this->services['twig.profile'] = new \\Twig_Profiler_Profile();\n }", "public function stats() {\n\t\techo \"<p>\";\n\t\techo \"<strong>Cache Hits:</strong> {$this->cache_hits}<br />\";\n\t\techo \"<strong>Cache Misses:</strong> {$this->cache_misses}<br />\";\n\t\techo \"</p>\";\n\t\techo '<ul>';\n\t\tforeach ( $this->cache as $group => $cache ) {\n\t\t\techo \"<li><strong>Group:</strong> $group - ( \" . number_format( strlen( serialize( $cache ) ) / 1024, 2 ) . 'k )</li>';\n\t\t}\n\t\techo '</ul>';\n\t}", "public function logPerformance();", "public function logPerformance();", "public function getProf(){\n return $this->prof;\n }", "public function setup_theme()\n {\n }", "function theme_action_handler( $theme ) {\n\t\t$this->add_ping( 'themes', array( 'theme' => get_option( 'stylesheet' ) ) );\n\t}", "private function _metrics()\n\t{\n\t\t$this->metrics['favoriteWeapon'] = $this->bg->queryFontMetrics($this->bigText, $this->favoriteWeapon);\n\t\t$this->metrics['spartan'] = $this->bg->queryFontMetrics($this->bigText, rawurldecode($this->spartan));\n\t\t$this->metrics['weaponChoice'] = $this->bg->queryFontMetrics($this->text, 'WEAPON OF CHOICE');\n\t}", "public function devToolbarCallback($tb) {\r\n\t\t$arr = array();\r\n\t\t$log = $this->getLog();\r\n\t\t$time = 0;\r\n\t\tforeach ($log as $line) {\r\n\t\t\t$t = $line['time'];\r\n\t\t\t$text = $this->highlight($this->formatQuery($line['sql']));\r\n\t\t\tif ($t) {\r\n\t\t\t\t$color = 'Silver';\r\n\t\t\t\tif ($t > 0.1) {\r\n\t\t\t\t\t$color = 'PaleTurquoise';\r\n\t\t\t\t} elseif ($t > 1) {\r\n\t\t\t\t\t$color = 'deeppink';\r\n\t\t\t\t}\r\n\t\t\t\t$text = '<span style=\"color:' . $color . '\">[' . $tb->formatTime($t) . ']</span> ' . $text;\r\n\t\t\t} else {\r\n\t\t\t\t$text = '<span style=\"color:deeppink\">[error]</span> ' . $text;\r\n\t\t\t}\r\n\t\t\t$arr[] = $text;\r\n\t\t\t$time += $t;\r\n\t\t}\r\n\t\tarray_unshift($arr, count($this->getLog()) . ' queries in ' . $tb->formatTime($time));\r\n\r\n\t\treturn $arr;\r\n\t}", "function theme_sleat_get_pre_scss($theme) {\n global $CFG;\n $scss = '';\n $configurable = [\n // Config key => [variableName, ...].\n 'brandprimary' => ['theme-brand-primary'],\n 'textcolour' => ['theme-text-color'],\n 'linkcolour' => ['theme-link-color'],\n 'linkhovercolour' => ['theme-link-hover-color'],\n 'content_bgcolour' => ['theme-content-background-color'],\n 'backgroundcolour' => ['theme-page-background-color'],\n 'frontpage_slideroverlaycolour' => ['slide-overlay-color'],\n 'sitewidth' => ['theme-sitewidth'],\n 'footer_section_text_colour' => ['theme-footer-text-color'],\n 'footer_section_link_colour' => ['theme-footer-link-color'],\n 'footer_section_link_hover_colour' => ['theme-footer-link-hover-color'],\n 'frontpage_logo_carousel_logo_height' => ['theme-logo-carousel-logo-height'],\n 'frontpage_slider_height' => ['theme-slider-height']\n ];\n // Prepend variables first.\n foreach ($configurable as $configkey => $targets) {\n $value = isset($theme->settings->{$configkey}) ? $theme->settings->{$configkey} : null;\n if (empty($value)) {\n continue;\n }\n array_map(function($target) use (&$scss, $value) {\n $scss .= '$' . $target . ': ' . $value . \";\\n\";\n }, (array) $targets);\n }\n // Prepend pre-scss.\n if (!empty($theme->settings->scsspre)) {\n $scss .= $theme->settings->scsspre;\n }\n // Set the background image for the page.\n $loginbackground = $theme->setting_file_url('login_background_image', 'login_background_image');\n if (isset($loginbackground)) {\n $scss .= '$loginbackground: url(\"'.$loginbackground.'\");';\n }\n return $scss;\n}", "function L_PageLoadTime() {\n\t\n\t/*\n\t\t$time = microtime();\n\t\t$time = explode(' ', $time);\n\t\t$time = $time[1] + $time[0];\n\t\t$finish = $time;\n\t\t$total_time = round(($finish - $start), 4);\n\t\t\n\t*/\n\t\n\t/*\n\t\t$end_time = microtime(TRUE);\n\t\t$time_taken = $end_time - $start_time;\n\t\t$time_taken = round($time_taken,5);\n\t\t\n\t*/\n\t\n\t\t// Start of code\n\t\t$time = microtime(true); // Gets microseconds\n\n\t\t// End of code\n\t\t$time_taken = (microtime(true) - $time);\n\t\t\n\t\treturn _e('Page generated in ' . $time_taken . ' seconds.','leonite');\n\n\t}", "function theme_profile_analytics($profile_pid) {\n\tglobal $wpdb, $post, $current_user;\n\n\t$profile_author = get_user_by('slug', $profile_pid);\n\t$profile_author_id = $profile_author->ID;\n $site_url = get_site_url();\n $template_url = get_bloginfo('template_url');\n\t\n\tif ( ( ( is_user_logged_in() ) && ( $current_user->ID == $profile_author->ID ) ) || get_user_role( array('administrator') ) ) {} else {return;}\n\n\trequire '/var/www/production/www.greenpag.es/wordpress/wp-content/themes/gp-au-theme/ga/analytics.class.php';\n\t\n\t$total = \"SELECT COUNT(*) as count \n\t\t\tFROM $wpdb->posts \" . \n\t\t\t\t$wpdb->prefix . \"posts, \n\t\t\t\t$wpdb->postmeta \" . \n\t\t\t\t$wpdb->prefix . \"postmeta \n\t\t\tWHERE \" . $wpdb->prefix . \"posts.ID = \" . \n\t\t\t\t$wpdb->prefix . \"postmeta.post_id and \" . \n\t\t\t\t$wpdb->prefix . \"posts.post_status = 'publish' and (\" . \n\t\t\t\t\t$wpdb->prefix . \"posts.post_type = 'gp_news' or \" . \n\t\t\t\t\t$wpdb->prefix . \"posts.post_type = 'gp_events' or \" . \n\t\t\t\t\t$wpdb->prefix . \"posts.post_type = 'gp_advertorial' or \" . \n\t\t\t\t\t$wpdb->prefix . \"posts.post_type = 'gp_projects' or \" . \n\t\t\t\t\t$wpdb->prefix . \"posts.post_type = 'gp_competitions' or \" . \n\t\t\t\t\t$wpdb->prefix . \"posts.post_type = 'gp_people') \n\t\t\t\tand \" . \n\t\t\t\t$wpdb->prefix . \"postmeta.meta_key = '_thumbnail_id' and \" . \n\t\t\t\t$wpdb->prefix . \"postmeta.meta_value >= 1 and \" . \n\t\t\t\t$wpdb->prefix . \"posts.post_author = '\" . $profile_author->ID . \"'\";\n\t\t\t\t\n\t$totalposts = $wpdb->get_results($total, OBJECT);\n\n\t$ppp = intval(get_query_var('posts_per_page'));\n\t$wp_query->found_posts = $totalposts[0]->count;\n\t$wp_query->max_num_pages = ceil($wp_query->found_posts / $ppp);\t\t\n\t$on_page = intval(get_query_var('paged'));\t\n\n\tif($on_page == 0){ $on_page = 1; }\t\t\n\t$offset = ($on_page-1) * $ppp;\n\t\n\t$querystr = \"SELECT \" . $wpdb->prefix . \"posts.* \n\t\t\t\tFROM $wpdb->posts \" . \n\t\t\t\t\t$wpdb->prefix . \"posts, \n\t\t\t\t\t$wpdb->postmeta \" . \n\t\t\t\t\t$wpdb->prefix . \"postmeta \n\t\t\t\tWHERE \" . $wpdb->prefix . \"posts.ID = \" . \n\t\t\t\t\t$wpdb->prefix . \"postmeta.post_id and \" . \n\t\t\t\t\t$wpdb->prefix . \"posts.post_status = 'publish' and (\" . \n\t\t\t\t\t\t$wpdb->prefix . \"posts.post_type = 'gp_news' or \" . \n\t\t\t\t\t\t$wpdb->prefix . \"posts.post_type = 'gp_events' or \" . \n\t\t\t\t\t\t$wpdb->prefix . \"posts.post_type = 'gp_advertorial' or \" . \n\t\t\t\t\t\t$wpdb->prefix . \"posts.post_type = 'gp_projects' or \" . \n\t\t\t\t\t\t$wpdb->prefix . \"posts.post_type = 'gp_competitions' or \" . \n\t\t\t\t\t\t$wpdb->prefix . \"posts.post_type = 'gp_people') \n\t\t\t\t\tand \" . \n\t\t\t\t\t$wpdb->prefix . \"postmeta.meta_key = '_thumbnail_id' and \" . \n\t\t\t\t\t$wpdb->prefix . \"postmeta.meta_value >= 1 and \" . \n\t\t\t\t\t$wpdb->prefix . \"posts.post_author = '\" . $profile_author->ID . \"' \n\t\t\t\tORDER BY \" . $wpdb->prefix . \"posts.post_date DESC\";\n\t\t\t\t\t\n\t$pageposts = $wpdb->get_results($querystr, OBJECT);\n\t\n\t# Profile meta variables for getting specific analytics data\n\t$old_crm_id = $profile_author->old_crm_id;\n\t$directory_page_url = $profile_author->directory_page_url;\n\t$facebook = $profile_author->facebook;\n\t$linkedin = $profile_author->linkedin;\n\t$twitter = $profile_author->twitter;\n\t$skype = $profile_author->skype;\n\t$url = $profile_author->user_url;\n\t\n\tif (!$pageposts && !empty($old_crm_id) ) {\n\t\t?>\n\t\t<div id=\"my-analytics\">\n\t\t <br />\n\t\t\t<?php theme_advertorialcreate_post(); ?>\n\t\t\t<p>Create your first Product of the Week Advertorial to unlock your Analytics.</p>\n\t\t</div>\n\t\t<?php \n\t\treturn;\n\t}\n\t\n\tif (!$pageposts) {\n\t\t?>\n\t\t<div id=\"my-analytics\"></div>\n\t\t<?php \n\t\treturn;\n\t}\n\t\n\t# TABLE HEADINGS FOR POST ANALYTICS\n\t?>\n\t<div id=\"my-analytics\">\n\t\t<h2>Post Analytics</h2>\t\t\t\n\t\t<table class=\"author_analytics\">\n\t\t\t<tr>\n\t\t\t\t<td class=\"author_analytics_title\">Title</td>\t\t\n\t\t\t\t<td class=\"author_analytics_type\">Post Type</td>\n\t\t\t\t<td class=\"author_analytics_cost\">Value</td>\n\t\t\t\t<td class=\"author_analytics_date\">Date Posted</td> \n\t\t\t\t<td class=\"author_analytics_category_impressions\">Category Impressions</td>\n\t\t\t\t<td class=\"author_analytics_page_impressions\">Page Views</td>\n\t\t\t\t<td class=\"author_analytics_clicks\">Clicks</td>\n\t\t\t</tr>\n\t<?php\t\n\t\n\t$analytics = new analytics('[email protected]', 'greenpages01'); //sign in and grab profile\t\t\t\n \t$analytics->setProfileById('ga:42443499'); \t\t\t//$analytics->setProfileByName('Stage 1 - Green Pages');\n\t\t\t\t\n\tif ($pageposts) {\t\t\n\t \t\n\t $total_sumURL = 0;\n\t \n\t\tforeach ($pageposts as $post) {\n\t\t\tsetup_postdata($post);\n\t\t\n\t\t\t$post_url_ext = $post->post_name; //Need to get post_name for URL. Gets ful URl, but we only need /url extention for Google API\t\t\t\n\t\t\t$type = get_post_type($post->ID);\n\t\t\t\t\n\t\t\t$post_type_map = getPostTypeSlug($type);\n\t\t\t\t\n\t\t\t$post_url_end = '/' . $post_type_map . '/' . $post_url_ext . '/';\n\t\t\t#echo $post_url_end . '<br />$post_url_end<br />';\t\t\t\t\n\n\t\t\t$post_date = get_the_time('Y-m-d'); \t\t\t\t//Post Date\n\t\t\t#echo $post_date . ' ';\n\t\t\t$today_date = date('Y-m-d'); \t\t\t\t\t\t//Todays Date\n\t\t\t#echo $today_date . ' ';\n\n \t\t\t$analytics->setDateRange($post_date, $today_date); \t//Set date in GA $analytics->setMonth(date('$post_date'), date('$new_date'));\n\t\t\t\t\n \t\t\t#print_r($analytics->getVisitors()); \t\t\t\t//get array of visitors by day\n\n \t\t\t$pageViewURL = ($analytics->getPageviewsURL($post_url_end));\t//Page views for specific URL\n \t\t\t#echo $pageViewURL . ' $pageViewURL';\n \t\t\t#var_dump ($pageViewURL);\n \t\t\t$sumURL = 0;\n \t\t\tforeach ($pageViewURL as $data) {\n \t\t\t$sumURL = $sumURL + $data;\n \t\t\t$total_sumURL = $total_sumURL + $data;\n \t\t\t}\n \t\t\t#echo ' <br />*** ' . $sumURL . ' ***<br /> ';\t\t\t\n\t\t\t\n \t\t\t$pageViewType = ($analytics->getPageviewsURL('/' . $post_type_map . '/'));\t//Page views for the section landing page, e.g. the news page\n \t\t\t$sumType = 0;\n \t\t\tforeach ($pageViewType as $data) {\n \t\t\t$sumType = $sumType + $data;\n \t\t\t}\n \t\t\t\t\n \t\t\t$keywords = $analytics->getData(array(\n \t'dimensions' => 'ga:keyword',\n \t \t'metrics' => 'ga:visits',\n \t'sort' => 'ga:keyword'\n \t)\n \t);\t\n \t\n \t#SET UP POST ID AND AUTHOR ID DATA, POST DATE, GET LINK CLICKS DATA FROM GA \n \t$post_date_au = get_the_time('j-m-y');\n\t \t\t$post_id = $post->ID;\n\t \t\t$click_track_tag = '/yoast-ga/' . $post_id . '/' . $profile_author_id . '/outbound-article/';\n\t\t\t$clickURL = ($analytics->getPageviewsURL($click_track_tag));\n \t\t\t$sumClick = 0;\n\t\t\tforeach ($clickURL as $data) {\n \t\t\t$sumClick = $sumClick + $data;\n \t\t\t}\n\t\t\t\n\t\t\tswitch (get_post_type()) {\t\t# CHECK POST TYPE AND ASSIGN APPROPRIATE TITLE, URL, COST AND GET BUTTON CLICKS DATA\n\t\t\t \n\t\t\t\tcase 'gp_advertorial':\n\t\t\t\t\t$post_title = 'Products';\n\t\t\t\t\t$post_url = '/eco-friendly-products';\n\t\t\t\t\t$post_price = '$89.00';\n\t\t\t \t\t$custom = get_post_custom($post->ID);\n\t \t\t\t\t$product_url = $custom[\"gp_advertorial_product_url\"][0];\t\n\t \t\t\t\tif ( !empty($product_url) ) {\t\t# IF 'BUY IT' BUTTON ACTIVATED, GET CLICKS\n\t \t\t\t\t\t$click_track_tag_product_button = '/outbound/product-button/' . $post_id . '/' . $profile_author_id . '/' . $product_url . '/'; \n \t\t\t\t\t\t$clickURL_product_button = ($analytics->getPageviewsURL($click_track_tag_product_button));\n \t\t\t\t\t\tforeach ($clickURL_product_button as $data) {\n \t\t\t\t\t\t$sumClick = $sumClick + $data;\n \t\t\t\t\t\t}\n\t \t\t\t\t}\n\t \t\t\t\t# GET PAGE IMPRESSIONS FOR OLD PRODUCT POSTS FROM BEFORE WE CHANGED URL AND ADD TO TOTAL\n\t\t\t\t \t$old_post_url_end = '/new-stuff/' . $post_url_ext . '/';\n\t \t\t\t\t$old_PageViewURL = ($analytics->getPageviewsURL($old_post_url_end));\t//Page views for specific old URL\n \t\t\t\t\tforeach ($old_PageViewURL as $data) {\n \t\t\t\t\t$sumURL = $sumURL + $data;\n \t\t\t\t\t$total_sumURL = $total_sumURL + $data;\n \t\t\t\t\t}\n\t\t \t\tbreak;\n\t\t\t\tcase 'gp_competitions':\n\t\t\t\t\t$post_title = 'Competitions';\n\t\t\t\t\t$post_url = '/competitions';\n\t\t\t\t\t$post_price = '$250.00';\n\t\t \t\tbreak;\n\t\t \t\tcase 'gp_events':\n\t\t \t\t\t$post_title = 'Events';\n\t\t \t\t\t$post_url = '/events';\n\t\t \t\t\t$post_price = 'N/A';\n\t\t \t\tbreak;\n\t\t \tcase 'gp_news':\n\t\t\t\t \t$post_title = 'News';\n\t\t \t\t\t$post_url = '/news';\n\t\t \t\t\t$post_price = 'N/A';\t\t \t\t\t\n\t\t \t\tbreak;\n\t\t \tcase 'gp_projects':\n\t\t\t \t$post_title = 'Projects';\n\t\t\t \t$post_url = '/projects';\n\t\t\t \t$post_price = 'N/A';\n\t\t\t break;\n\t\t\t}\n\t\t\t\n\t\t \tif ($sumClick == 0) {\t\t\t#IF NO CLICKS YET, DISPLAY 'Unavailable'\n \t\t\t$sumClick = 'Unavailable';\n \t\t}\n\t\t\t\n\t\t\t# DISPLAY ROW OF ANALYTICS DATA FOR EACH POST BY THIS AUTHOR (PAGE IMPRESSIONS ETC)\n\t\t\techo '<tr>\t\t\t\t\n\t\t\t\t\t<td class=\"author_analytics_title\"><a href=\"' . get_permalink($post->ID) . '\" title=\"' . \n\t\t\t\t\tesc_attr(get_the_title($post->ID)) . '\" rel=\"bookmark\">' . get_the_title($post->ID) . '</a></td>\t\t\t\t\n\t\t\t\t\t<td class=\"author_analytics_type\"><a href=\"' . $post_url . '\">' . $post_title . '</a></td>\t\t\t\t\t\n\t\t\t\t\t<td class=\"author_analytics_cost\">' . $post_price . '</td>\t\t\t\t\n\t\t\t\t\t<td class=\"author_analytics_date\">' . $post_date_au . '</td>\n\t\t\t\t\t<td class=\"author_analytics_category_impressions\">' . $sumType . '</td>\n\t\t\t\t\t<td class=\"author_analytics_page_impressions\">' . $sumURL . '</td>\t\n\t\t\t\t\t<td class=\"author_analytics_clicks\">' . $sumClick . '</td>\t\t\t\t\t\t\t\t\n\t\t\t\t</tr>';\n\t\t}\n\t}\t\n\t?>\n\t\t</table>\t\t\t\n\n\t\t<p>Your posts have been viewed a total of</p> \n\t\t<p><span class=\"big-number\"><?php echo $total_sumURL;?></span> times!</p>\t\n\t\t<p></p>\n\t\t\n\t\t\n\t\t<?php \t# DIRECTORY PAGE ANALYTICS FOR ADVERTISERS WHO HAVE (OR HAVE HAD) A DIRECTORY PAGE\n\t\tif (!empty($old_crm_id)) {\n\t\t?>\n\t\t\t<h2>Directory Page Analytics</h2>\n\t\t\t<table class=\"author_analytics\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=\"author_analytics_title\">Title</td>\n\t\t\t\t\t<td class=\"author_analytics_cost\">Value</td>\n\t\t\t\t\t<td class=\"author_analytics_category_impressions\">Category Impressions</td>\n\t\t\t\t\t<td class=\"author_analytics_page_impressions\">Page views</td>\n\t\t\t\t\t<td class=\"author_analytics_clicks\">Clicks</td>\n\t\t\t\t</tr>\t\n\n\t\t\t\t<?php \t\t\n\t\t\t\t# SET AND RESET SOME VARIABLES AND GET DIRECTORY PAGE DATA FROM GA\n\t\t\t\t$start_date = '2012-01-01'; \t// Click tracking of Directory Pages began just after this Date\n\t\t\t\t$today_date = date('Y-m-d'); \t// Todays Date\n\t\t\t\t\n\t \t\t\t$analytics->setDateRange($start_date, $today_date); //Set date in GA $analytics->setMonth(date('$post_date'), date('$new_date'));\n\t \t\t\t\n\t\t\t\t$gp_legacy = new gp_legacy();\n\t\t\t\t$results = $gp_legacy->getDirectoryPages($old_crm_id);\n\n\t\t\t\t$dir_sumURL = 0;\n\t\t\t\t$list_sumURL = 0;\n\t\t\t\t$totaldir_sumURL = 0;\n\t\t\t\t$totallist_sumURL = 0;\n\t\t\t\t$directory_trail = '';\n\t\t\t\t$directory_trails = '';\n\t\t\t\t\n\t\t\t\tif (array_key_exists('listing_title', $results)) {\n\t\t\t\t\t$listing_title = $results['listing_title'];\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif (array_key_exists('listing_path_example', $results)) {\n\t\t\t\t\t$listing_path = '<a href=\"http://directory.thegreenpages.com.au' . $results[\"listing_path_example\"] . '\">' . $listing_title . '</a>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (array_key_exists('listing_expired', $results)) {\n\t\t\t\t\tif (!$results['listing_expired']) {\n\t\t\t\t\t\t$listing_expired = ' <span class=\"listing_status active\">(Active)</span>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$listing_expired = ' <span class=\"listing_status expired\">(Expired on ' . date(\"d/m/Y\", $results['listing_expired']) . ')</span>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (array_key_exists('directory', $results)) {\n\t\t\t\t\t$i = 0;\n\t\t\t\t\tforeach ($results[\"directory\"] as $value) {\n\t\t\t\t\t\tif ($value[\"directory_path\"]) {\n\t\t\t\t\t\t\t$dir_pageViewURL = ($analytics->getPageviewsURL(urlencode($value[\"directory_path\"])));\n\t\t\t\t\t\t\t$dir_sumURL = 0;\n\t\t\t\t\t\t\tforeach ($dir_pageViewURL as $data) {\n\t\t\t\t\t\t\t\t$dir_sumURL = $dir_sumURL + (int)$data;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$totaldir_sumURL = $totaldir_sumURL + $dir_sumURL;\n\t \t\t\t\t\t}\n\t \t\t\t\t\t\n\t\t\t\t\t\tif ($value[\"listing_path\"]) {\n\t\t\t\t\t\t\t$list_pageViewURL = ($analytics->getPageviewsURL(urlencode($value[\"listing_path\"])));\n\t\t\t\t\t\t\t$list_sumURL = 0;\n\t\t\t\t\t\t\tforeach ($list_pageViewURL as $data) {\n\t\t\t\t\t\t\t\t$list_sumURL = $list_sumURL + (int)$data;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$totallist_sumURL = $totallist_sumURL + $list_sumURL;\n\t \t\t\t\t\t}\n\t\n\t\t\t\t\t\tif (is_array($value[\"directory_trail\"])) {\n\t\t\t\t\t\t\t$j = 0;\n\t\t\t\t\t\t\tforeach ($value[\"directory_trail\"] as $crumb) {\n\t\t\t\t\t\t\t\tif (is_array($crumb)) {\n\t\t\t\t\t\t\t\t\tif (++$j > 1) {\n\t\t\t\t\t\t\t\t\t\t$directory_trail = $directory_trail . $crumb['title'] . \" &gt; \";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ($directory_trail != '') {\n\t\t\t\t\t\t\t\t$directory_trails = $directory_trails . '<br />&nbsp;&nbsp;<a href=\"http://directory.thegreenpages.com.au' . $value[\"directory_path\"] . '\">' . substr($directory_trail, 0, -6) . '</a>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$directory_trail = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\t\t\n\t \t\t\t\n\t \t\t\t# GET CLICK DATA\t \t\t\t\n\t\t\t\t$click_track_tag = '/outbound/directory/' . $profile_author_id . '/';\n \t\t\t\t$clickURL = ($analytics->getPageviewsURL($click_track_tag));\n \t\t\t\t$sumClick = 0;\n\t\t\t\tforeach ($clickURL as $data) {\n \t\t\t\t$sumClick = $sumClick + $data;\t\t// Clicks for that button from all posts\n\t \t\t\t}\n\t \t\t\t\n \t\t\t\tif ($sumClick == 0) {\t\t\t\t\t#IF NO CLICKS YET, DISPLAY 'Unavailable'\n \t\t\t\t$sumClick = 'Unavailable';\n \t\t\t}\n \t\t\t?>\n \t\t\t<tr>\n \t\t\t\t<td class=\"author_analytics_title\"><?php echo $listing_path . $listing_expired . \"<br /><span class=\\\"author-analytics-featuredin\\\">Featured in:</span>\" . $directory_trails; ?></td>\n \t\t\t\t<td class=\"author_analytics_cost\">$39 per month</td>\n \t\t\t\t<td class=\"author_analytics_category_impressions\"><?php echo $totaldir_sumURL; ?></td>\n \t\t\t\t<td class=\"author_analytics_page_impressions\"><?php echo $totallist_sumURL; ?></td>\n \t\t\t\t<td class=\"author_analytics_clicks\"><?php echo $sumClick; ?></td>\n \t\t\t</tr>\n \t\t</table>\n \t\t<div id=\"post-filter\">The ability to edit your Directory Page details yourself will be ready soon! In the meantime:</div>\n \t\t<div id=\"post-filter\">\n \t\t\t<a href=\"mailto:[email protected]?Subject=Please%20Update%20My%20Directory%20Page%20Details\" >Update my Directory Page details here</a>\n \t\t</div>\n \t\t<div id=\"post-filter\"></div>\n \t\t<?php \t\t\n\t\t}\t\n\t\t?>\n\t\t\n\t\t<?php # FOR CONTRIBUTORS / CONTENT PARTNERS - DISPLAY ACTIVIST BAR / DONATE JOIN BUTTON ANALYTICS DATA\n\t\tif ( get_user_role( array('contributor') ) || get_user_role( array($rolecontributor, 'administrator') ) ) {\n\t\t\t\n\t\t\t# SET AND RESET SOME VARIABLES AND GET ACTIVIST BAR DATA FROM GA\n\t\t\t$start_date = '2012-01-01'; \t// Click tracking of activist buttons began just after this Date\n\t\t\t$today_date = date('Y-m-d'); \t// Todays Date\n\t\t\t\t\n \t\t\t$analytics->setDateRange($start_date, $today_date); //Set date in GA $analytics->setMonth(date('$post_date'), date('$new_date'));\n\n \t\t\t$donate_url = $profile_author->contributors_donate_url;\n\t\t\t$join_url = $profile_author->contributors_join_url;\n\t\t\t$petition_url = $profile_author->contributors_petition_url;\n\t\t\t$volunteer_url = $profile_author->contributors_volunteer_url;\n\t\t\t\n \t\t\t$button_labels = array('donate' => $donate_url, \n \t\t\t\t\t\t\t\t\t'join' => $join_url,\n \t\t\t\t\t\t\t\t\t'petition' => $petition_url, \n \t\t\t\t\t\t\t\t\t'volunteer' => $volunteer_url);\n \t\t\t$activist_clicks_sum = 0;\n \t\t\t \t\t\t\n\t\t\t?>\n\t\t\t<h2>Activist Bar Analytics</h2>\n\t\t\t<table class=\"author_analytics\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=\"author_analytics_title\">Activist Buttons</td>\n\t\t\t\t\t<td class=\"author_analytics_activist\">Clicks</td>\t\n\t\t\t\t</tr>\n\n\t\t\t\t<?php #DISPLAY TABLE ROWS WITH CLICK DATA FOR ACTIVIST BAR BUTTONS\n\t\t \t\tforeach ($button_labels as $label => $label_url) {\n\t\t \t\t\tif (!empty($label_url)) {\n \t\t\t\t\t $click_track_tag = '/outbound/activist-' . $label .'-button/' . $profile_author_id . '/' . $label_url . '/';\n\t\t\t\t\t #var_dump($click_track_tag);\n \t\t\t\t\t $clickURL = ($analytics->getPageviewsURL($click_track_tag));\n \t\t\t\t\t $sumClick = 0;\n\t\t\t\t\t foreach ($clickURL as $data) {\n \t\t\t\t\t $sumClick = $sumClick + $data;\t\t\t\t\t\t\t// Clicks for that button from all posts\n \t\t\t\t\t $activist_clicks_sum = $activist_clicks_sum + $data;\t// Total clicks for all activist bar buttons\n \t\t\t\t\t }\n \t\t\t\t\t if ($sumClick == 0) {\t\t\t#IF NO CLICKS YET, DISPLAY 'Unavailable'\n \t\t\t\t\t $sumClick = 'Unavailable';\n \t\t\t\t }\n \t\t\t\t\t echo '<tr>\n \t\t\t\t\t \t <td class=\"author_analytics_title\">' . $label . '</td>\n \t\t\t\t\t \t <td class=\"author_analytics_activist\">' . $sumClick . '</td>\n \t\t\t\t\t \t </tr>';\n\t\t \t\t\t}\n \t\t\t\t}\n\t\t \t\tif ($activist_clicks_sum == 0) {\t\t\t#IF NO CLICKS YET, DISPLAY 'Unavailable'\n \t\t\t\t$activist_clicks_sum = 'Unavailable';\n \t\t\t}\n\t\t\t\t?>\n\t\t\t\t\t\t\n\t\t\t</table>\n\t\t\t<?php\n\t\t\ttheme_profilecreate_post();\n\t\t\tif($activist_clicks_sum != 0) { \t#IF CLICKS DATA RETURNED, DISPLAY TOTAL\n\t\t\t?>\n\t\t\t\t<p>Your activist buttons have been clicked a total of</p> \n\t\t\t\t<p><span class=\"big-number\"><?php echo $activist_clicks_sum;?></span> times!</p>\t\n\t\t\t\t<br />\n\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t\t<div class=\"post-details\"><a href=\"<?php echo $site_url; ?>/wp-admin/profile.php\">Enter or update urls for Activist Bar buttons</a></div>\n\t\t\t<br />\n\t\t\t<div class=\"clear\"></div>\n\t\t\t<?php \n\t\t} \n\t\t?>\n\t\t\n\t\t<?php # Profile page analytics if profile contact fields data present\n\t\t\t\t\n\t\tif (!empty($facebook) || !empty($linkedin) || !empty($twitter) || !empty($skype) || !empty($url)) {\n\n\t\t# SET AND RESET SOME VARIABLES AND GET PROFILE PAGE DATA FROM GA\n\t\t$start_date = '2012-07-01'; \t// Click tracking of profile page contact fields began just after this Date\n\t\t$today_date = date('Y-m-d'); \t// Todays Dat\t\t\n \t\t$analytics->setDateRange($start_date, $today_date); //Set date in GA $analytics->setMonth(date('$post_date'), date('$new_date'));\t\t\t\n\t\t?>\n\t\t\t<h2>Profile Page Analytics</h2>\n\t\t\t<table class=\"author_analytics\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=\"author_analytics_title\">Profile Page </td>\n\t\t\t\t\t<td class=\"author_analytics_activist\">Clicks</td>\t\n\t\t\t\t</tr>\n\n\t\t\t\t<?php \t\t\t\t \t\t\t\n \t\t\t\t$profile_labels = array('facebook' => $facebook, \n \t\t\t\t\t\t\t\t\t\t'linkedin' => $linkedin, \n \t\t\t\t\t\t\t\t\t\t'twitter' => $twitter, \n \t\t\t\t\t\t\t\t\t\t'skype' => $skype, \n \t\t\t\t\t\t\t\t\t\t'website' => $url);\n \t\t\t\t$profile_clicks_sum = 0;\n\t\t \n\t\t\t\tforeach ($profile_labels as $label => $label_url) {\n\t\t\t\t\tif (!empty($label_url)) {\n\t\t\t\t\t $click_track_tag = '/outbound/profile-' . $label .'/' . $profile_author_id .'/';\n\t\t\t\t\t #var_dump($click_track_tag);\n \t\t\t\t\t $clickURL = ($analytics->getPageviewsURL($click_track_tag));\n \t\t\t\t\t $sumClick = 0;\n\t\t\t\t\t foreach ($clickURL as $data) {\n \t\t\t\t\t $sumClick = $sumClick + $data;\t\t\t\t\t\t\t// Clicks for that button from all posts\n \t\t\t\t\t $profile_clicks_sum = $profile_clicks_sum + $data;\t// Total clicks for all activist bar buttons\n \t\t\t\t\t }\n \t\t\t\t\t if ($sumClick == 0) {\t\t\t#IF NO CLICKS YET, DISPLAY 'Unavailable'\n \t\t\t\t\t $sumClick = 'Unavailable';\n \t\t\t\t }\n \t\t\t\t\techo '<tr>\n \t\t\t\t\t \t <td class=\"author_analytics_title\">' . $label . '</td>\n \t\t\t\t\t \t <td class=\"author_analytics_activist\">' . $sumClick . '</td>\n \t\t\t\t\t \t </tr>';\n\t\t\t\t\t}\n \t\t\t\t}\n\t\t \t\tif ($profile_clicks_sum == 0) {\t\t\t#IF NO CLICKS YET, DISPLAY 'Unavailable'\n \t\t\t\t$profile_clicks_sum = 'Unavailable';\n \t\t\t}\n \t\t\t ?> \n </table>\n <?php \n if($profile_clicks_sum != 0) { \t#IF CLICKS DATA RETURNED, DISPLAY TOTAL\n\t\t\t\t?>\n\t\t\t\t<p>Your Profile Page contact buttons have been clicked a total of</p> \n\t\t\t\t<p><span class=\"big-number\"><?php echo $profile_clicks_sum;?></span> times!</p>\t\n\t\t\t\t<br />\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t\t<div class=\"post-details\"><a href=\"<?php echo $site_url; ?>/wp-admin/profile.php\">Enter or update urls/ids for Profile Page contact buttons</a></div>\n\t\t\t<br />\n\t\t\t<div id=\"post-details\"></div> \n <?php \n\t\t}\n \t?>\t\t\n\t</div>\n<?php \n}", "public function add_profile_page_styling() {\n\t\twp_enqueue_style( 'itsec-two-factor-profile-page', plugins_url( 'css/profile-page.css', __FILE__ ), array(), ITSEC_Core::get_plugin_build() );\n\n\t\t$this->load_helper();\n\t\t$this->helper->get_enabled_provider_instances();\n\t}", "function csco_activated_theme() {\n\tcsco_plugin_set_options( 'post-views-counter' );\n\tcsco_plugin_set_options( 'wp-seo' );\n}", "function _preview_theme_template_filter()\n {\n }", "function ibm_apim_theme_process_page(&$vars) {\r\n // Hook into the color module.\r\n if (module_exists('color')) {\r\n _color_page_alter($vars);\r\n }\r\n}", "public static function logDailyBenchmarks() {\n\n\t\t$dbprefix = elgg_get_config('dbprefix');\n\n\t\t$svc = new LoggingService();\n\n\t\t$ia = elgg_set_ignore_access();\n\n\t\t$users = elgg_get_entities([\n\t\t\t'types' => 'user',\n\t\t\t'count' => true,\n\t\t]);\n\n\t\t$svc->logBenchmark([\n\t\t\t'target_guid' => elgg_get_site_entity()->guid,\n\t\t\t'metric' => 'users:total',\n\t\t\t'value' => $users,\n\t\t]);\n\n\t\t$banned = elgg_get_entities([\n\t\t\t'types' => 'user',\n\t\t\t'count' => true,\n\t\t\t'joins' => [\n\t\t\t\t\"JOIN {$dbprefix}users_entity ue ON ue.guid = e.guid\",\n\t\t\t],\n\t\t\t'wheres' => [\n\t\t\t\t\"ue.banned = 'yes'\",\n\t\t\t],\n\t\t]);\n\n\t\t$svc->logBenchmark([\n\t\t\t'target_guid' => elgg_get_site_entity()->guid,\n\t\t\t'metric' => 'users:banned',\n\t\t\t'value' => $banned,\n\t\t]);\n\n\t\t$validated = elgg_get_entities_from_metadata([\n\t\t\t'types' => 'user',\n\t\t\t'count' => true,\n\t\t\t'metadata_name_value_pairs' => [\n\t\t\t\t'validated' => true,\n\t\t\t],\n\t\t]);\n\n\t\t$svc->logBenchmark([\n\t\t\t'target_guid' => elgg_get_site_entity()->guid,\n\t\t\t'metric' => 'users:validated',\n\t\t\t'value' => $validated,\n\t\t]);\n\n\t\t$groups = elgg_get_entities([\n\t\t\t'types' => 'group',\n\t\t\t'count' => true,\n\t\t]);\n\n\t\t$svc->logBenchmark([\n\t\t\t'target_guid' => elgg_get_site_entity()->guid,\n\t\t\t'metric' => 'groups:total',\n\t\t\t'value' => $groups,\n\t\t]);\n\n\t\t$posts = elgg_get_entities([\n\t\t\t'types' => 'object',\n\t\t\t'count' => true,\n\t\t]);\n\n\t\t$svc->logBenchmark([\n\t\t\t'target_guid' => elgg_get_site_entity()->guid,\n\t\t\t'metric' => 'posts:total',\n\t\t\t'value' => $posts,\n\t\t]);\n\n\t\t$subtypes = get_registered_entity_types('object');\n\n\t\tforeach ($subtypes as $subtype) {\n\t\t\t$posts = elgg_get_entities([\n\t\t\t\t'types' => 'object',\n\t\t\t\t'subtypes' => $subtype,\n\t\t\t\t'count' => true,\n\t\t\t]);\n\n\t\t\t$svc->logBenchmark([\n\t\t\t\t'target_guid' => elgg_get_site_entity()->guid,\n\t\t\t\t'metric' => \"posts:$subtype\",\n\t\t\t\t'value' => $posts,\n\t\t\t]);\n\t\t}\n\n\t\telgg_set_ignore_access($ia);\n\t}", "function teamplatic_view_counter()\r\n{\r\n $settings = get_option( \"templatic_settings\" ); \t\r\n if(isset($settings['templatic_view_counter']) && $settings['templatic_view_counter']=='Yes')\r\n {\t\r\n\t\tglobal $post;\r\n\t\tview_counter_single_post($post->ID);\r\n\t\tview_count('');\r\n } \r\n //view_sharing_buttons('');\r\n tevolution_socialmedia_sharelink();\r\n\t\r\n}" ]
[ "0.63129854", "0.5836551", "0.57720166", "0.5771761", "0.56465095", "0.56314003", "0.559709", "0.5548445", "0.55414134", "0.5492557", "0.5482903", "0.54655904", "0.545102", "0.542166", "0.5398588", "0.53959435", "0.5391367", "0.53855264", "0.53514105", "0.5347607", "0.5337121", "0.5331763", "0.53249866", "0.53195775", "0.52941287", "0.5290112", "0.52829796", "0.5262289", "0.5239912", "0.5234889", "0.52292186", "0.5228691", "0.5212078", "0.5192664", "0.5181587", "0.5176689", "0.5154364", "0.5143471", "0.5131208", "0.51236635", "0.5109587", "0.5101282", "0.50957215", "0.5087388", "0.5079297", "0.5074031", "0.50533026", "0.5043495", "0.50383604", "0.50383043", "0.50362915", "0.5027106", "0.50259185", "0.5022526", "0.499349", "0.49885392", "0.49874467", "0.49862555", "0.49798727", "0.49741977", "0.49434617", "0.49424326", "0.493903", "0.49334687", "0.49117175", "0.49078327", "0.4898688", "0.48957416", "0.4888802", "0.48634532", "0.48288608", "0.48213625", "0.481787", "0.48143008", "0.48135915", "0.4812391", "0.4806068", "0.480209", "0.47975624", "0.4797114", "0.47962445", "0.47907805", "0.47849178", "0.478459", "0.47772726", "0.47640538", "0.47640538", "0.47590855", "0.47544843", "0.47543487", "0.47522277", "0.47514528", "0.4744378", "0.47409672", "0.4734", "0.47308058", "0.47234708", "0.4721306", "0.47115692", "0.4709083", "0.47073582" ]
0.0
-1
Get the results of your profile.
function wpf_timer_stop( $id = 0, $echo = 0, $precision = 3 ) { // if called like timer_stop(1), will echo $timetotal global $wpf_profiler; if ( !isset($wpf_profiler[$id]) ) return false; $mtime = microtime(); $mtime = explode( ' ', $mtime ); $wpf_profiler[$id]['stop'] = $mtime[1] + $mtime[0]; $total = $wpf_profiler[$id]['stop'] - $wpf_profiler[$id]['start']; $wpf_profiler[$id]['total'] = ( function_exists( 'number_format_i18n' ) ) ? number_format_i18n( $total, $precision ) : number_format( $total, $precision ); return ( $echo ) ? print $wpf_profiler[$id]['total'] : $wpf_profiler[$id]['total']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getResults();", "function printResults(&$results) {\n // the profile name and total sessions.\n if (count($results->getRows()) > 0) {\n\n // Get the profile name.\n $profileName = $results->getProfileInfo()->getProfileName();\n\n // Get the entry for the first entry in the first row.\n $rows = $results->getRows();\n $sessions = $rows[0][0];\n\n // Print the results.\n print \"First view (profile) found: $profileName\\n\";\n print \"Total sessions: $sessions\\n\";\n } else {\n print \"No results found.\\n\";\n }\n}", "public function Results(){\r\n\t\treturn self::get_results();\r\n\t}", "function printResults(&$results) {\n\t // the profile name and total sessions.\n\t if (count($results->getRows()) > 0) {\n\n\t // Get the profile name.\n\t $profileName = $results->getProfileInfo()->getProfileName();\n\n\t // Get the entry for the first entry in the first row.\n\t $rows = $results->getRows();\n\t $sessions = $rows[0][0];\n\n\t // Print the results.\n\t print \"First view (profile) found: $profileName\\n\";\n\t print \"Total sessions: $sessions\\n\";\n\t } else {\n\t print \"No results found.\\n\";\n\t }\n\t}", "public abstract function getResults();", "public function index(){\n $this->existing_profile=$this->profile_model->read_highest_rank_profiles(1);\n \n //Fetch this profile with the api and ensure it matches\n $test_name=\"Checking API can be used to fetch the top profile\";\n $test1=$this->checkingApiCanFetchAProfile($this->existing_profile[0]['user_id']);\n $expected_result=TRUE;\n echo $this->unit->run($test1,$expected_result,$test_name,$notes=\"Assumes atleast 1 account is created\");\n\n //Fetch the same profile by searching for it using its first_name\n $test_name=\"Checking API can be used to fetch same profile using search\";\n $test2=$this->checkingApiCanFetchProfileUsingSearch($this->existing_profile[0]['first_name']);\n $expected_result=TRUE;\n echo $this->unit->run($test2,$expected_result,$test_name,$notes=\"Assumes first result found has identical first name\");\n \n }", "public function getResults()\n {\n return $this->get ();\n }", "public function getResults()\n {\n return $this->get('Results');\n }", "public function getResults()\n {\n return $this->get();\n }", "function showProfile(){\r\n\t\tif( $profiles = $this->getArrayRow( \"SHOW profiles\" ) ){\r\n\t\t\t$html = '<table cellspacing=\"1\" cellpadding=\"10\" bgcolor=\"#cccccc\" style=\"font:11px Helvetica;\"><tr style=\"font-weight:bold\"><td>Query ID</td><td>exec time</td><td width=\"150\">%</td><td>Query</td></tr>';\r\n\t\t\tfor( $i=0, $execution_time = 0, $n=count($profiles); $i<$n; $i++ )\r\n\t\t\t\t$execution_time += $profiles[$i]['Duration'];\r\n\r\n\t\t\tforeach($profiles as $i => $p ){\r\n\t\t\t\t$perc = round( ( $p['Duration'] / $execution_time ) * 100, 2 );\r\n\t\t\t\t$width = ceil( $perc * 2 );\r\n\t \t\t\t$html .= '<tr bgcolor=\"#eeeeee\"><td>'.$p['Query_ID'].'</td><td>'.$p['Duration'].'</td><td><div style=\"float:left;width:50px;\">'.$perc.'%</div> <div style=\"display:inline; margin-top:3px;float:left;background:#ff0000;width:'.$width.'px;height:10px;\"></td><td>'.$p['Query'].'</td></tr>';\r\n\t\t\t}\r\n\t\t\treturn $html .= '</table>';\t\r\n\t\t}\r\n\t}", "public function getResults()\n {\n }", "public function run()\n {\n /** @var $userProfile UserProfileEntity.php */\n $userProfile = new $this->modelClass();\n\n return $userProfile->getProfileInformation(Yii::$app->user->identity->getId());\n }", "function profile_info() {\n $parameters = array(\n 'method' => __FUNCTION__\n );\n return $this->get_data($parameters);\n }", "public function getResults(){\n $this->results;\n }", "public function index()\n {\n $user_id = Auth::id();\n $user_info = Profile::where('user_id', $user_id)->get();\n\n return $user_info;\n }", "public function getResults()\n\t{\n\t\t# code...\n\t\treturn $this->results;\n\t}", "public function getProfileResult($token){\n\t\treturn $this->_profiles[$token];\n\t}", "public function get_results()\n {\n }", "public function get_results()\n {\n }", "public function getResults() {\n\t\t$this->$results_ = $this->resultSource_->getResults();\n\t\treturn $this->$results_;\n }", "public function index()\n {\n $profiles = Profiles::Latest()->paginate(20);\n return $profiles;\n }", "public function getResults()\n {\n return $this->results;\n }", "public function index()\n {\n $profiles = Profile::all();\n return $this->showAll($profiles);\n }", "public function profileDetails()\n {\n $processReaction = $this->userEngine->prepareProfileDetails();\n\n return __processResponse($processReaction, [], null, true);\n }", "public function getResults()\n {\n return $this->Results;\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }" ]
[ "0.7098757", "0.70228946", "0.6810991", "0.67479026", "0.6729603", "0.653728", "0.6534414", "0.65166706", "0.65046155", "0.6494315", "0.6455292", "0.64502", "0.6423929", "0.63932794", "0.63813674", "0.6358365", "0.63516736", "0.63495755", "0.6348161", "0.6302663", "0.62943554", "0.62938833", "0.6268166", "0.62149763", "0.61951", "0.61774933", "0.61774933", "0.61774933", "0.61774933", "0.61774933", "0.61774933", "0.61774933", "0.61774933", "0.61774933", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764", "0.61772764" ]
0.0
-1
/ This was used for testing from class notes
public function practice1() { return ("practice 1"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function __() {\n }", "private function __construct()\t{}", "protected function __init__() { }", "final private function __construct() {}", "final private function __construct() {}", "private function __construct () {}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "public function helper()\n\t{\n\t\n\t}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct( )\n {\n\t}", "final private function __construct(){\r\r\n\t}", "private final function __construct() {}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct() {\r\n\t\t\r\n\t}", "private function _i() {\n }", "private function __construct() {\r\n\t\r\n\t}", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }", "private function __construct() { }" ]
[ "0.6285775", "0.6282427", "0.6236656", "0.6231755", "0.6231755", "0.6227087", "0.6198354", "0.6198354", "0.6198354", "0.619217", "0.61603737", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.6159724", "0.61568666", "0.61568666", "0.61548704", "0.6122962", "0.61028826", "0.6084799", "0.6084799", "0.6084799", "0.6084799", "0.6084799", "0.6084799", "0.6084799", "0.6084799", "0.6084799", "0.6084799", "0.6084799", "0.6084799", "0.6084799", "0.6084799", "0.6084799", "0.6084799", "0.6084799", "0.6080108", "0.60629463", "0.6058125", "0.60495764", "0.60495764", "0.60495764", "0.60495764", "0.60495764", "0.60495764", "0.60495764", "0.60495764", "0.60495764" ]
0.0
-1
This method is called on any attempt to compile a function call
public function compileFunction() { $params = func_get_args(); $name = array_shift($params); array_pop($params); if (function_exists($name)) { return $name . '('. join(", ", $params) . ')'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function compile ();", "function compilerError()\r\n{\r\n\t$this->model->compilerView=1;\r\n\techo '<br />COMPILER ERROR....'.$this->compiler();\r\n \r\n\r\n}", "function compile ($src);", "public function compile($value);", "public function convert()\n {\n $cFunctionCallIndexes = array();\n\n $classMap = $this->getClassMap();\n\n $cSourceCodeMap = array();\n\n foreach($classMap as $className => $classInfo) {\n for ($index = $classInfo->startLine; $index <= $classInfo->endLine; $index++) {\n if (preg_match(\"/call_c_function\\(.*\\)/\", $this->codeLines[$index], $matches)) {\n if(count($matches) == 1) {\n $codeLine = str_replace(array(\"call_c_function\",\"(\",\")\",\";\",\"$\"),\"\",trim($this->codeLines[$index]));\n $lineComps = explode(\"=\",$codeLine);\n $lineCompsCount = count($lineComps);\n $resultVarName = \"\";\n if ($lineCompsCount == 1) { //this means we just call the c function and do not have a return variable\n $cFunctionCallComps = explode(\",\",$lineComps[0]);\n $cFunctionCallComps = explode(\",\",$lineComps[1]);\n foreach($cFunctionCallComps as $idx => $comp) {\n $cFunctionCallComps[$idx] = trim(str_replace(\"$\",\"\",$cFunctionCallComps[$idx]));\n }\n } else if ($lineCompsCount > 1) { //this means we call the c function and then store the result in a return variable \n $resultVarName = trim(str_replace(\"$\",\"\",$lineComps[0]));\n $cFunctionCallComps = explode(\",\",$lineComps[1]);\n foreach($cFunctionCallComps as $idx => $comp) {\n $cFunctionCallComps[$idx] = trim(str_replace(\"$\",\"\",$cFunctionCallComps[$idx]));\n }\n }\n\n if (count($cFunctionCallComps) > 0) {\n $firstComp = array_shift($cFunctionCallComps);\n $cSourceFile = str_replace(array(\"'\",'\"'),\"\",$firstComp);\n $secondComp = array_shift($cFunctionCallComps);\n $cFUnctionName = str_replace(array(\"'\",'\"'),\"\",$secondComp);\n $cFUnctionInputParamsStr = \"\";\n if (count($cFunctionCallComps) > 0) {\n $cFUnctionInputParamsStr = implode(\", \",$cFunctionCallComps); \n }\n\n $cFunctionCallCode = \"\";\n $cFunctionCallCode .= \"let $resultVarName = null;\\n\"; //initialize result var\n $cFunctionCallCode .= \"\\n%{\\n\";\n if (strlen($resultVarName) == 0) {\n $cFunctionCallCode .= $cFUnctionName.\"($cFUnctionInputParamsStr);\"; \n } else {\n $cFunctionCallCode .= \"$resultVarName = \".$cFUnctionName.\"($cFUnctionInputParamsStr);\";\n }\n $cFunctionCallCode .= \"\\n}%\\n\";\n\n $expectedZephirCode = 'let '.$resultVarName.' = call_c_function('.$firstComp.', '.$secondComp.', '.implode(\", \",$cFunctionCallComps).');';\n $this->postSearchAndReplace($expectedZephirCode,$cFunctionCallCode);\n\n //now, inject the c source code to the top of the class \n $namespace = $classInfo->namespace;\n $classPureName = array_pop(explode(\"\\\\\",$className));\n $originalCode = \"namespace $namespace;\\n\\n\".\"class $classPureName\\n\";\n if (!isset($cSourceCodeMap[$cSourceFile])) {\n $cSourceCode = file_get_contents($this->inputDir.\"/\".$cSourceFile);\n $cSourceCodeMap[$cSourceFile] = $cSourceCode;\n $withCSourceCode = \"%{\\n\".$cSourceCodeMap[$cSourceFile].\"\\n}%\\n\".$originalCode; \n $this->postSearchAndReplace($originalCode, $withCSourceCode);\n }\n }\n\n }\n\n }\n }\n\n }\n }", "public function call();", "public function call();", "function yy_r177(){ $this->_retvalue = new Stmt\\Expr('CALL', $this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor); }", "function yy_r138()\n {\n if (! $this->security || $this->compiler->context->smarty->security_policy->isTrustedPhpFunction($this->yystack[$this->yyidx + - 3]->minor, $this->compiler)) {\n if (is_callable($this->yystack[$this->yyidx + - 3]->minor)) {\n $this->_retvalue = $this->yystack[$this->yyidx + - 3]->minor . \"(\" . implode(',', $this->yystack[$this->yyidx + - 1]->minor) . \")\";\n } else {\n $this->compiler->error(\"unknown function \\\"\" . $this->yystack[$this->yyidx + - 3]->minor . \"\\\"\");\n }\n }\n }", "abstract public function __call($fnc, $args);", "final public function __invoke(): \\Exception\n {\n throw new \\BadFunctionCallException();\n }", "public function compile()\n\t{\n\t\tif ($this->dirty() and $this->compile)\n\t\t{\n\t\t\t$compiler = new Compiler($this, $this->app);\n\t\t\t$this->contents = $compiler->run();\n\t\t}\n\t}", "public function asCompiled();", "function yy_r107(){if (!$this->template->security || $this->smarty->security_handler->isTrustedPhpFunction($this->yystack[$this->yyidx + -3]->minor, $this->compiler)) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t if ($this->yystack[$this->yyidx + -3]->minor == 'isset' || $this->yystack[$this->yyidx + -3]->minor == 'empty' || $this->yystack[$this->yyidx + -3]->minor == 'array' || is_callable($this->yystack[$this->yyidx + -3]->minor)) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . \"(\". $this->yystack[$this->yyidx + -1]->minor .\")\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t } else {\r\n $this->compiler->trigger_template_error (\"unknown function \\\"\" . $this->yystack[$this->yyidx + -3]->minor . \"\\\"\");\r\n }\r\n } }", "public function GetCompiled ();", "protected function compile()\n {\n $this->addImageToTemplate($this->Template, $this->arrData);\n }", "public function compile()\n {\n if (!isset($this->class))\n {\n return $this->function;\n }\n\n if (is_string($this->class))\n {\n return $this->class . '::' . $this->function;\n }\n\n return array($this->class, $this->function);\n }", "function yy_r108(){ $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . \"(\". $this->yystack[$this->yyidx + -1]->minor .\")\"; }", "function generateError()\n{\n unknownFunction();\n // END\n}", "function cc()\n{\n $numArgs = func_num_args();\n $args = func_get_args();\n $func = $args[0];\n\n $functionFile = getProjectPath('/resource/ccHelper/' . $func . '.php');\n if (!file_exists($functionFile)) {\n throw new Exception('Error: cc helper \"'. $func .'\" function not fount!');\n }\n include_once ($functionFile);\n\n $name = 'ccHelper_'. $func;\n\n switch ($numArgs)\n {\n case 1: return $name(); exit;\n case 2: return $name( $args[1] ); exit;\n case 3: return $name( $args[1], $args[2] ); exit;\n case 4: return $name( $args[1], $args[2], $args[3]); exit;\n case 5: return $name( $args[1], $args[2], $args[3], $args[4] ); exit;\n default:\n throw new Exception('Error: cc helper arguments to much');\n }\n}", "public function func()\n {\n if ($this->lookahead->type == ControlFunctionLexer::NAME) {\n if (array_key_exists($this->lookahead->text, FunctionDispatcher::$functionNames)) {\n $this->function_name = $this->lookahead->text;\n //$this->function_index = FunctionDispatcher::$functionNames[$this->lookahead->text];\n $this->function_index = FunctionDispatcher::functionIndex($this->lookahead->text);\n } else {\n throw new \\Exception(\"Функция <$this->function_name> не существует\");\n }\n $this->root = new ControlFunctionParseTree($this->lookahead->type, $this->function_name);\n //$this->root = $this->currentNode;\n $this->match(ControlFunctionLexer::NAME);\n $this->cargs();\n } else {\n throw new \\Exception(\n \"Ожидалось объявление функции контроля (сравнение, зависимость ...). Получено \" .\n ControlFunctionLexer::$tokenNames[$this->lookahead->type]\n );\n }\n }", "public function & SetCompiled ($compiled = '');", "private function aFunc()\n {\n }", "public static function compile($path = null)\n {\n }", "public function compile()\n {\n\n $this->buildPage();\n\n if (defined('DEBUG_MARKUP') && DEBUG_MARKUP) {\n ob_start();\n $checkXml = new DOMDocument();\n\n if ($this instanceof LibTemplateAjax)\n $checkXml->loadXML($this->compiled);\n else\n $checkXml->loadHTML($this->compiled);\n\n $errors = ob_get_contents();\n ob_end_clean();\n\n // nur im fehlerfall loggen\n if ('' !== trim($errors)) {\n\n $this->getResponse()->addWarning('Invalid XML response');\n\n SFiles::write(PATH_GW.'log/tpl_xml_errors.html', $errors.'<pre>'.htmlentities($this->compiled).'</pre>');\n SFiles::write(PATH_GW.'log/tpl_xml_errors_'.date('Y-md-H-i_s').'.html', $errors.'<pre>'.htmlentities($this->compiled).'</pre>');\n }\n }\n\n if ($this->keyCachePage) {\n $this->writeCachedPage($this->keyCachePage , $this->compiled);\n }\n\n $this->output = $this->compiled;\n\n\n }", "function __call($func, $args) {\r\n pdo_trigger_error(\"pdo_dummy::{$func}() {$this->msg}\", E_USER_WARNING);\r\n }", "function Smarty_Method_DisableForceCompile($smarty)\r\n{\r\n $smarty->force_compile = false;\r\n return;\r\n}", "function runkit_function_redefine($funcname, $arglist, $code)\n{\n}", "function yy_r15(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor,$this->yystack[$this->yyidx + -1]->minor); }", "public function functionCall(){\n try {\n // Sparql11query.g:236:3: ( iriRef argList ) \n // Sparql11query.g:237:3: iriRef argList \n {\n $this->pushFollow(self::$FOLLOW_iriRef_in_functionCall810);\n $this->iriRef();\n\n $this->state->_fsp--;\n\n $this->pushFollow(self::$FOLLOW_argList_in_functionCall812);\n $this->argList();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function IsConstructCall(): bool\n {\n }", "protected function compile()\n {\n $parUri = '';\n\n $this->log('Detail: ' . $parUri . ' - ' . $this->Input->get(self::$strDetailKey), 'compile()', 'Probenplan');\n $this->log('Delete: ' . $parUri . ' - ' . $this->Input->get(self::$strDeleteKey), 'compile()', 'Probenplan');\n $this->log('View : ' . $parUri . ' - ' . $this->Input->get(self::$strViewKey), 'compile()', 'Probenplan');\n\n if ($this->Input->get(self::$strDetailKey)) {\n $parUri = 'ins';\n }\n if ($this->Input->get(self::$strDeleteKey)) {\n $parUri = 'del';\n }\n if ($this->Input->get(self::$strViewKey)) {\n $parUri = 'view';\n }\n if (!$this->Input->get(self::$strDetailKey) && !$this->Input->get(self::$strDeleteKey) && !$this->Input->get(self::$strViewKey)) {\n $parUri = '';\n }\n\n $this->log('parUri: ' . $parUri . ' - ' . $this->Input->get(self::$strDetailKey), 'compile()', 'Probenplan');\n\n switch ($parUri) {\n case 'ins':\n $this->compileEditTemplate();\n break;\n case 'del':\n $this->compileDeleteData($this->Input->get(self::$strDeleteKey));\n $this->compileListTemplate();\n break;\n case 'vie':\n $this->compileViewTemplate();\n break;\n default:\n $this->compileListTemplate();\n break;\n }\n\n }", "public function __construct(){\n\t\t$this->setCompiler();\n\t}", "protected function compile()\n\t{\n\t\tif (TL_MODE == 'BE')\n\t\t{\n\t\t\t$this->strTemplate = 'be_wildcard';\n\t\t\t$this->Template = new \\BackendTemplate($this->strTemplate);\n\t\t}\n\t}", "function yy_r9(){$this->_retvalue = $this->cacher->processNocacheCode($this->yystack[$this->yyidx + 0]->minor, $this->compiler,false); }", "function create_function(string $args, string $code): string\n{\n error_clear_last();\n $safeResult = \\create_function($args, $code);\n if ($safeResult === false) {\n throw FunchandException::createFromPhpError();\n }\n return $safeResult;\n}", "function yy_r17(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -4]->minor,array_merge(array('object_methode'=>$this->yystack[$this->yyidx + -2]->minor),$this->yystack[$this->yyidx + -1]->minor)); }", "public static function make($callFunctionName): self;", "public function compile()\n\t{\n\t\t$value = $this->value();\n\n\t\tif ( ! empty($this->parameters))\n\t\t{\n\t\t\t$params = $this->parameters;\n\t\t\t$value = strtr($value, $params);\n\t\t}\n\n\t\treturn $value;\n\t}", "function callFunction(Callable $func )\r\n{\r\n\t$func();\r\n}", "protected function compile() {\n if (TL_MODE == 'BE') {\n $this->genBeOutput();\n } else {\n $this->genFeOutput();\n }\n }", "protected function _preExec()\n {\n }", "function yy_r106(){ $this->_retvalue = '->'.$this->yystack[$this->yyidx + 0]->minor; }", "public static function compileString($value)\n {\n }", "function yy_r98(){$this->_retvalue = '('.$this->yystack[$this->yyidx + -1]->minor.')'; }", "public function __invoke()\n {\n }", "function dummyErrorFunc() { }", "function yy_r105(){ $this->_retvalue = '->{\\''.$this->yystack[$this->yyidx + -4]->minor.'\\'.'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; }", "function yy_r68(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor; }", "function yy_r16(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor,array()); }", "private function _compile_data()\n {\n $this->_set_platform();\n\n foreach (array('_set_robot', '_set_browser', '_set_mobile') as $function)\n {\n if ($this->$function() === TRUE)\n {\n break;\n }\n }\n }", "private function compile($content) { //was display function here\r\n\t\r\n\t\t\t//loop \r\n\t\t\t$content = preg_replace_callback('#{loop[^>]([a-zA-Z0-9\\_\\-\\+\\./]+)(.*?)\\}(.*?){\\/loop\\}#is',array(&$this,'loop_bt'), $content);\r\n\t\t\t//if and her sisters\r\n\t\t\t$content = preg_replace_callback('#{(if|elseif)[^>]([a-zA-Z0-9\\_\\-\\+\\./]+)[^>]([a-zA-Z\\=\\!\\>\\%\\&\\|\\</]{1,3})[^>](.*?)\\}#i',array(&$this,'if_expr'), $content);\r\n\r\n\t\t\t//matchs ..\r\n\t\t\t$matchs\t= array(\r\n\t\t\t\t\t\t\t\t'#{include_tpl[^>](.*?)\\}#i',\r\n\t\t\t\t\t\t\t\t'#{include_script[^>](.*?)\\}#i',\r\n\t\t\t\t\t\t\t\t'#{if[^>]([a-zA-Z0-9\\_\\-\\+\\./]+)\\}#i',\r\n\t\t\t\t\t\t\t\t'#{elseif[^>]([a-zA-Z0-9\\_\\-\\+\\./]+)\\}#i',\r\n\t\t\t\t\t\t\t\t'#{else\\}#i',\r\n\t\t\t\t\t\t\t\t'#{\\/if\\}#i',\r\n\t\t\t\t\t\t\t\t($this->php_compile == 'on') ? '#{php\\}(.*?){\\/php\\}#is' : '##',\r\n\t\t\t\t\t\t\t\t($this->global_vars == 'on') ? '#{([a-zA-Z0-9\\_\\-\\+\\./]+)}#' : '##',\r\n\t\t\t\t\t\t\t\t'#{assets[^>]([a-zA-Z0-9\\_\\-\\+\\./]+)}#is',\r\n\t\t\t\t\t\t\t);\r\n\t\t\t//replaces\t\t\t\t\r\n\t\t\t$replaces = array ( \r\n\t\t\t\t\t\t\t\t\t'<?php $this->include_tpl(\\'\\\\1\\'); ?>',\r\n\t\t\t\t\t\t\t\t\t'<?php include(\\'\\\\1\\'); ?>',\r\n\t\t\t\t\t\t\t\t\t'<?php if($this->vars[\\'\\\\1\\']){ ?>',\r\n\t\t\t\t\t\t\t\t\t'<?php } elseif(\\\\1){?>',\r\n\t\t\t\t\t\t\t\t\t'<?php } else { ?>',\r\n\t\t\t\t\t\t\t\t\t'<?php } ?>',\r\n\t\t\t\t\t\t\t\t\t($this->php_compile == 'on') ? '<?php \\\\1 ?>' : '',\r\n\t\t\t\t\t\t\t\t\t($this->global_vars == 'on') ? '<?php print $this->vars[\\'\\\\1\\'];?>' : '',\r\n\t\t\t\t\t\t\t\t\t'<?php echo $this->assets(\\'\\\\1\\'); ?>',\r\n\t\t\t\t\t\t\t\t);\r\n\t\t//show time ..\r\n\t\t$content = preg_replace($matchs,$replaces, $content);\r\n\t\t\r\n\t\tif($this->global_vars != 'on'){ \r\n\t\t\t$content = preg_replace_callback('#{([a-zA-Z0-9\\_\\-\\+\\./]+)}#',array(&$this,'assign_if_global_off'), $content);\r\n\t\t}\r\n\t\t\r\n\t\treturn $content; \r\n }", "public function compile($path): void\n {\n $this->compileWith($path);\n }", "protected function compile(): void\n {\n if (System::getContainer()->get('contao.routing.scope_matcher')->isBackendRequest(System::getContainer()->get('request_stack')->getCurrentRequest() ?? Request::create(''))) {\n $this->strTemplate = 'be_wildcard';\n $this->Template = new BackendTemplate($this->strTemplate);\n }\n\n $this->Template->tabsElement = $this->tabs_element;\n }", "public function __invoke();", "public function __invoke();", "public function __invoke();", "public function __invoke();", "public function getClosure()\n\t{\n\t\tthrow new Exception\\RuntimeException('Cannot invoke invalid functions', Exception\\RuntimeException::UNSUPPORTED, $this);\n\t}", "function yy_r123()\n {\n $this->_retvalue = '::' . $this->yystack[$this->yyidx + 0]->minor;\n }", "function yy_r72(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor; }", "public function resolveCallProvider()\n {\n $simpleNameElement = function (string $functionName): Node {\n return new Node(\n AST_NAME,\n NAME_NOT_FQ,\n ['name' => $functionName]\n );\n };\n\n // Takes an array and turns it into an AST_ARRAY\n $arrayToAst = function (array $array): Node {\n $elements = [];\n\n foreach ($array as $key => $value) {\n $elements[] = new Node(\n AST_ARRAY_ELEM,\n 0,\n [\n 'key' => $key,\n 'value' => $value,\n ]\n );\n }\n\n return new Node(\n AST_ARRAY,\n ARRAY_SYNTAX_SHORT,\n $elements\n );\n };\n\n // Takes a functionname and an array of arguments, and turns that into an AST_CALL Node\n $astCall = function (string $functionName, array $arguments) use ($simpleNameElement, $arrayToAst): Node {\n foreach ($arguments as $i => $argument) {\n if (is_array($argument)) {\n $arguments[$i] = $arrayToAst($argument);\n }\n }\n\n return new Node(\n AST_CALL,\n 0,\n [\n 'expr' => $simpleNameElement($functionName),\n 'args' => new Node(\n AST_ARG_LIST,\n 0,\n $arguments\n )\n ]\n );\n };\n\n return [\n [$astCall('file_get_contents', []), 'originalFile'],\n [$astCall('reset', [['a']]), 'a'],\n [$astCall('youcandoitnot', []), $astCall('youcandoitnot', [])],\n [$astCall('base64_decode', ['aGVuaw==']), 'henk'],\n ];\n }", "function yy_r148(){ $this->_retvalue = new Stmt\\Expr('expr', $this->yystack[$this->yyidx + -1]->minor); }", "public function invoke();", "protected function compile()\n\t{\n\t\t$this->Template->anchor = standardize($this->headline) . '-' . $this->id;\n\t}", "public function __destruct() { \n $this->compile(); \n }", "protected function compile()\n {\n if (TL_MODE == 'BE')\n {\n $this->strTemplate = 'be_wildcard';\n $this->Template = new \\BackendTemplate($this->strTemplate);\n }\n\n if (empty(self::$wrappers))\n {\n return;\n }\n\n foreach (array_pop(self::$wrappers) as $key => $value)\n {\n $this->Template->{$key} = $value;\n }\n }", "public function beforeCompile(): ?array;", "function yy_r119(){$this->_retvalue = '!'.$this->yystack[$this->yyidx + 0]->minor; }", "public static function extend(callable $compiler)\n {\n }", "public function __call($_func,array $_args) {\n\t\tF3::$global['CONTEXT']=$_func;\n\t\ttrigger_error(F3::TEXT_Method);\n\t}", "function yy_r66(){ $this->_retvalue = str_replace(array('.\"\".','\"\".','.\"\"'),array('.','',''),'\"'.$this->yystack[$this->yyidx + -1]->minor.'\"'); }", "function yy_r73(){ $this->_retvalue = $this->yystack[$this->yyidx + -4]->minor.'::$'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }", "function yy_r153(){ $this->_retvalue = new Stmt\\Expr(@$this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor); }", "function yy_r64(){ $this->_retvalue = \"(\". $this->yystack[$this->yyidx + -1]->minor .\")\"; }", "function yy_r74(){ $this->_retvalue = $this->yystack[$this->yyidx + -5]->minor.'::$'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }", "function yy_r43(){ $this->_retvalue = ''; }", "function yy_r103(){ $this->_retvalue = '->{'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; }", "public function f01()\n {\n }", "protected function preprocessInternal()\n\t{\n\t\t// void\n\t}", "function yy_r154(){ $this->_retvalue = new Stmt\\Expr($this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor); }", "function yy_r104(){ $this->_retvalue = '->{'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; }", "function testCallable() {}", "public function __invoke()\n {\n\n }", "function compiled($file=null)\n { \n if ($file) {\n return $this->_methodWrapper($file,'compiled');\n }\n return $this->_objectPool[$this->_lastUsedObjectKey]->compiled();\n }", "function yy_r174(){ $this->_retvalue = new Stmt\\Expr('expr', $this->yystack[$this->yyidx + 0]->minor); }", "function compile($code, $do_not_echo = false, $retvar = '')\n\t{\n\t\t$code = ' ?' . '>' . $this->compile_code('', $code, true) . '<' . '?php' . \"\\n\";\n\t\tif($do_not_echo)\n\t\t{\n\t\t\t$code = \"ob_start();\\n\". $code. \"\\n\\${$retvar} = ob_get_contents();\\nob_end_clean();\\n\";\n\t\t}\n\t\treturn $code;\n\t}", "abstract public function __invoke(): void;", "function yy_r111(){ return; }", "function yy_r102(){ $this->_retvalue = '->'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }", "protected function compile()\n {\n $arrModules = $this->Config->getActiveModules();\n\n if ($this->Input->get('act') == 'generate') {\n $strModule = $this->Input->get('module');\n $strComp = $this->Input->get('comp');\n $strLanguage = $this->Input->get('language');\n\n $strSourceFile = sprintf('system/modules/%s/languages/%s/%s.php',\n $strModule,\n $strLanguage,\n $strComp);\n $strTargetFile = sprintf('system/modules/%s/languages/%s/%s.xlf',\n $strModule,\n $strLanguage,\n $strComp);\n\n if (!file_exists(TL_ROOT . '/' . $strSourceFile)) {\n $_SESSION['TL_ERROR'][] = 'Missing source file ' . $strSourceFile . '!';\n }\n\n else {\n unset($GLOBALS['TL_LANG']);\n require(TL_ROOT . '/' . $strSourceFile);\n $arrSourceLanguage = deserialize(serialize($GLOBALS['TL_LANG']));\n\n $doc = Xliff::getInstance()->generateXliff(\n $strSourceFile,\n 'php',\n filemtime(TL_ROOT . '/' . $strSourceFile),\n '',\n $strLanguage,\n $arrSourceLanguage,\n $strLanguage\n );\n\n // output should formated\n $doc->formatOutput = true;\n\n // generate the xml for output\n $xml = $doc->saveXML();\n\n // generate directories\n $this->mkdirs(dirname($strTargetFile));\n\n // write the file\n $objFile = new File($strTargetFile);\n $objFile->write($xml);\n $objFile->close();\n\n $_SESSION['TL_INFO'][] = sprintf('Create new file %s.', $strTargetFile);\n }\n\n $this->redirect('contao/main.php?do=xliff');\n }\n\n $GLOBALS['TL_CSS']['xliff'] = 'system/modules/xliff/public/backend.css';\n $GLOBALS['TL_JAVASCRIPT']['xliff'] = 'system/modules/xliff/public/backend.js';\n\n $arrFiles = array();\n $arrLanguages = array();\n foreach ($arrModules as $strModule) {\n if (in_array($strModule, array('calendar', 'comments', 'core', 'devtools', 'faq', 'listing', 'news', 'newsletter', 'repository'))) {\n continue;\n }\n\n $strLanguagesPath = TL_ROOT . '/system/modules/' . $strModule . '/languages';\n if (is_dir($strLanguagesPath)) {\n $arrModuleLanguages = scan($strLanguagesPath);\n\n foreach ($arrModuleLanguages as $strLanguage) {\n $arrLanguages[] = $strLanguage;\n\n $strLanguagePath = $strLanguagesPath . '/' . $strLanguage;\n\n if (is_dir($strLanguagePath)) {\n $arrLanguageFiles = scan($strLanguagePath);\n\n foreach ($arrLanguageFiles as $strLanguageFile) {\n // absolute path to the php file\n $strLanguageFile = $strLanguagePath . '/' . $strLanguageFile;\n\n if (preg_match('#\\.(xlf|php)$#', $strLanguageFile, $arrMatch)\n ) {\n // extract the language key (first part of the TL_LANG array\n $strLanguageKey = basename($strLanguageFile, '.' . $arrMatch[1]);\n\n // store the php file timestamp\n $arrFiles[$strModule][$strLanguageKey][$strLanguage][$arrMatch[1]]['mtime'] = filemtime($strLanguageFile);\n }\n }\n }\n }\n }\n }\n\n natcasesort($arrModules);\n ksort($arrFiles);\n $arrLanguages = array_unique(array_filter(array_values($arrLanguages)));\n natcasesort($arrLanguages);\n\n $this->Template->modules = $arrModules;\n $this->Template->files = $arrFiles;\n $this->Template->languages = $arrLanguages;\n }", "function runkit_function_add($funcname, $arglist, $code)\n{\n}", "public function call()\n {\n // TODO: Implement call() method.\n }", "function yy_r94(){$this->_retvalue = ''; }", "function standardize($callnum, $adjust = false)\n{\n $callnum = process($callnum);\n\n $extracted = code_extract($callnum);\n $generated = code_generate($extracted);\n\n if ($adjust) {\n fill_z_behind($generated);\n } else {\n replace_hash_to_zero($generated);\n }\n\n return $generated;\n}", "public function assembler() {\n }", "public function compile() {\r\n\t\tif(file_exists($this->result_file)) {\r\n\t\t\tunlink($this->result_file);\r\n\t\t\tclearstatcache();\r\n\t\t\tif(file_exists($this->result_file)) {\r\n\t\t\t\tthrow new exceptions\\filecompile(\"Failed to delete older compiled file during compilation\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tswitch($this->type) {\r\n\t\t\tcase self::TYPE_CSS:\r\n\t\t\t\t$this->compileCss();\r\n\t\t\t\tbreak;\r\n\t\t\tcase self::TYPE_JS:\r\n\t\t\t\t$this->compileJs();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tthrow new exceptions\\source(\"Failed to compile resources: unknown resource type\");\r\n\t\t}\r\n\t\tclearstatcache();\r\n\t\treturn file_exists($this->result_file);\r\n\t}", "function yy_r155(){ $this->_retvalue = new Stmt\\Expr($this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + -2]->minor, new Stmt\\Expr('expr', $this->yystack[$this->yyidx + 0]->minor)); }", "function yy_r97(){$this->_retvalue = '\\''.$this->yystack[$this->yyidx + 0]->minor.'\\''; }", "abstract public function OnCall(Command $command);" ]
[ "0.69419795", "0.61325204", "0.5955069", "0.59365463", "0.59245855", "0.5775194", "0.5775194", "0.5712132", "0.5697203", "0.56928015", "0.55633956", "0.55367476", "0.5532094", "0.5497999", "0.54901546", "0.5483242", "0.5465166", "0.54448915", "0.5415019", "0.54076415", "0.5390817", "0.5354499", "0.53302175", "0.52673227", "0.52611", "0.5243273", "0.5232346", "0.522068", "0.5217957", "0.52052844", "0.5201052", "0.51979285", "0.51940244", "0.5187625", "0.5169671", "0.5169126", "0.5159965", "0.51566184", "0.5151408", "0.5148691", "0.5148281", "0.51456684", "0.51412797", "0.51233655", "0.51184446", "0.5115614", "0.51144135", "0.5104879", "0.51022464", "0.5077952", "0.50761276", "0.5073455", "0.50698143", "0.5060452", "0.50548637", "0.50548637", "0.50548637", "0.50548637", "0.50528115", "0.5051453", "0.5049851", "0.5048477", "0.504784", "0.50449485", "0.5041504", "0.5040327", "0.5039565", "0.5037705", "0.503761", "0.503602", "0.5034119", "0.5027649", "0.5018799", "0.5018449", "0.5017026", "0.5015718", "0.5014292", "0.5013757", "0.4997371", "0.49949804", "0.4994858", "0.49921688", "0.49903342", "0.4989266", "0.49864876", "0.49825406", "0.4971174", "0.49605584", "0.49560806", "0.49523267", "0.4948234", "0.4946151", "0.494495", "0.49391142", "0.4932944", "0.49321884", "0.49265882", "0.49246547", "0.49198234", "0.4912595" ]
0.60480255
2
Validates the password. This method serves as the inline validation for password.
public function validatePassword() { if (!$this->hasErrors()) { $user = $this->getUser(); if (!$user || !$user->validatePassword($this->password)) { $this->addError('password', Yii::t('app','Falscher Benutzername oder falsches Passwort.')); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validatePassword()\n {\n /* @var $user User */\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->password)) {\n $this->addError('password', 'Incorrect password.');\n }\n }", "public function validatePassword()\n {\n $validator = new Validator(array(\n 'password' => $this->password,\n 'password2' => $this->password2,\n self::$primaryKey => $this->id(),\n ));\n\n $validator\n ->required()\n ->set('password2', 'Confirm password');\n\n $validator\n ->required()\n ->minLength(6)\n ->callback(function ($password, $password2) {\n return $password === $password2;\n }, 'Password is not matching confirm password', array($this->password2))\n ->set('password', 'Password');\n\n return $validator->validate();\n }", "public function validatePassword()\n {\n /* @var $user User */\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->oldPassword)) {\n $this->addError('oldPassword', 'Incorrect old password.');\n }\n }", "public function validatePassword() {\n if (!$this->hasErrors()) {\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->password_old)) {\n // $this->addError('password_old', 'Incorrect current password.');\n }\n }\n }", "public function validatePassword()\n {\n $result = false;\n if (strlen($this->password) >= 5) {\n $result = true;\n }\n return $result;\n }", "public function validatePassword()\n {\n if (!$this->hasErrors()) {\n if (!$this->user->validatePassword($this->old_password)) {\n $this->addError('old_password', 'Incorrect email or password.');\n }\n }\n }", "function validatePassword() : bool\n {\n if($this->Password && preg_match('/^[[:alnum:]]{6,20}$/', $this->Password)) // solo numeri-lettere da 6 a 20\n {\n return true;\n }\n else\n return false;\n }", "function passwordValid($password) {\n\treturn true;\n}", "private function valid_password() {\n return (strlen($this->password) == 6);\n }", "public function validate_password()\n\t{\n\t\t//Load language from user component\n\t\t$lang = JFactory::getLanguage();\n\t\t$tag = $lang->getTag();\n\n\t\tif (!$tag)\n\t\t{\n\t\t\t$tag = 'en-GB';\n\t\t}\n\n\t\t$lang->load('com_users', JPATH_ROOT, $tag);\n\t\t$value = $this->input->get('fieldValue', '', 'none');\n\t\t$validateId = $this->input->get('fieldId', '', 'none');\n\t\t$params = JComponentHelper::getParams('com_users');\n\t\t$minimumIntegers = $params->get('minimum_integers');\n\t\t$minimumSymbols = $params->get('minimum_symbols');\n\t\t$minimumUppercase = $params->get('minimum_uppercase');\n\t\t$validPassword = true;\n\t\t$errorMessage = '';\n\n\t\tif (!empty($minimumIntegers))\n\t\t{\n\t\t\t$nInts = preg_match_all('/[0-9]/', $value, $imatch);\n\n\t\t\tif ($nInts < $minimumIntegers)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_INTEGERS_N', $minimumIntegers);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\t\tif ($validPassword && !empty($minimumSymbols))\n\t\t{\n\t\t\t$nsymbols = preg_match_all('[\\W]', $value, $smatch);\n\n\t\t\tif ($nsymbols < $minimumSymbols)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_SYMBOLS_N', $minimumSymbols);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\n\t\tif ($validPassword && !empty($minimumUppercase))\n\t\t{\n\t\t\t$nUppercase = preg_match_all(\"/[A-Z]/\", $value, $umatch);\n\n\t\t\tif ($nUppercase < $minimumUppercase)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_UPPERCASE_LETTERS_N', $minimumUppercase);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\t\t$arrayToJs = array();\n\t\t$arrayToJs[0] = $validateId;\n\n\t\tif (!$validPassword)\n\t\t{\n\t\t\t$arrayToJs[1] = false;\n\t\t\t$arrayToJs[2] = $errorMessage;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arrayToJs[1] = true;\n\t\t}\n\n\t\techo json_encode($arrayToJs);\n\n\t\t$this->app->close();\n\t}", "public function testInvalidLengthPassword()\n {\n $password = \"23d3\";\n $response = $this->user->isValidPassword($password);\n\n $this->assertFalse($response);\n }", "public function checkPassword($value);", "public function validatePassword($password)\n {\n return $this->hashPassword($password)===$this->password;\n }", "public function testValidLengthPassword()\n {\n $password = \"accepted\";\n\n $response = $this->user->isValidPassword($password);\n\n $this->assertTrue($response);\n }", "public function passwordEntryIsValid() {\r\n \r\n //todo put logic here (same as email)\r\n // also check if it matches confirmpassword\r\n // set the var equal to function call of getpassword\r\n $password = $this->getPassword();\r\n // If the fields empty\r\n if ( empty($password) ) {\r\n // Will send it to errors as username and display the message to user\r\n $this->errors[\"password\"] = \"Password is missing.\";\r\n } \r\n // Calls the password function above and if its not equal to the orgincal password returns error\r\n else if ( $this->getConfirmpassword() !== $this->getPassword() ){\r\n // Message displayed to user\r\n $this->errors[\"password\"] = \"Password does not match confirmation password.\";\r\n }\r\n // Also goes test the password against the password is valid function in the validator class\r\n else if ( !Validator::passwordIsValid($this->getPassword()) ) {\r\n $this->errors[\"password\"] = \"Password is not valid.\"; \r\n }\r\n //Will return if its empty and whether any errors are contained\r\n return ( empty($this->errors[\"password\"]) ? true : false ) ;\r\n }", "public function validatePassword(User $user, $password);", "public function isPasswordField() {}", "public function validatePassword($password)\n {\n // return $password == $this->password;\n return Yii::$app->getSecurity()->validatePassword($password, $this->password);\n }", "function validPassword($password){\t\r\n \tglobal $API;\r\n return $API->userValidatePassword($this->username,$password); \r\n }", "private function validate_password($password){\n\t\treturn TRUE;\n\t}", "public function validatePassword($password) {\r\n return $this->password===$password;\r\n\r\n }", "public function check_password($password)\n {\n }", "function validatePassword($pass) {\n\t\t$l = getOption('min_password_lenght');\n\t\tif ($l > 0) {\n\t\t\tif (strlen($pass) < $l) return sprintf(gettext('Password must be at least %u characters'), $l);\n\t\t}\n\t\t$p = getOption('password_pattern');\n\t\tif (!empty($p)) {\n\t\t\t$strong = false;\n\t\t\t$p = str_replace('\\|', \"\\t\", $p);\n\t\t\t$patterns = explode('|', $p);\n\t\t\t$p2 = '';\n\t\t\tforeach ($patterns as $pat) {\n\t\t\t\t$pat = trim(str_replace(\"\\t\", '|', $pat));\n\t\t\t\tif (!empty($pat)) {\n\t\t\t\t\t$p2 .= '{<em>'.$pat.'</em>}, ';\n\n\t\t\t\t\t$patrn = '';\n\t\t\t\t\tforeach (array('0-9','a-z','A-Z') as $try) {\n\t\t\t\t\t\tif (preg_match('/['.$try.']-['.$try.']/', $pat, $r)) {\n\t\t\t\t\t\t\t$patrn .= $r[0];\n\t\t\t\t\t\t\t$pat = str_replace($r[0],'',$pat);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$patrn .= addcslashes($pat,'\\\\/.()[]^-');\n\t\t\t\t\tif (preg_match('/(['.$patrn.'])/', $pass)) {\n\t\t\t\t\t\t$strong = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!$strong)\treturn sprintf(gettext('Password must contain at least one of %s'), substr($p2,0,-2));\n\t\t}\n\t\treturn false;\n\t}", "protected function validatePassword($password) \n {\n if (!empty($password)) {\n if (strlen($password) < '8') {\n $this->errors[] = PASSWORD_TOO_SHORT;\n }\n if (!preg_match(\"#[0-9]+#\", $password)) {\n $this->errors[] = PASSWORD_NEEDS_NUMBER;\n }\n if (!preg_match(\"#[A-Z]+#\", $password)) {\n $this->errors[] = PASSWORD_NEEDS_UPPERCASE;\n }\n if (!preg_match(\"#[a-z]+#\", $password)) {\n $this->errors[] = PASSWORD_NEEDS_LOWERCASE;\n }\n } else {\n $this->errors[] = PASSWORD_MISSING;\n }\n }", "public function isPassword($password);", "public function validatePassword($attribute, $params)\n\t{\n\t\tif ($this->password !== $this->repeatePassword) {\n\t\t\t$this->addError($attribute, 'Пароль не совпадает.');\n\t\t}\n\t}", "public function validatePassword($password)\t{\n\t\treturn crypt($password,$this->password) === $this->password;\n\t}", "public static function validatePassword($password) {\n if (\n (strlen($password) > 8 || strlen($password) < 4) || // Check Length\n (!preg_match(\"#[0-9]+#\", $password)) || // Contains a number.\n (!preg_match(\"#[a-zA-Z]+#\", $password)) || // Contains a letter.\n (!preg_match(\"/^[a-z0-9]+$/i\",$password))) // No special characters.\n {\n // Password did not meet one of the requirements.\n return false; \n } else {\n // Password meets all requirements.\n return true;\n }\n }", "public function validatePassword($password) {\t \r\n\t\treturn self::hashPassword($password, $this->salt) === $this->password;\r\n\t}", "private function AddPasswordField()\n {\n $name = 'Password';\n \n $this->AddField(Input::Password($name));\n //Password needs contain lower case letter, upper case letter, and a digit\n //$validator = new RegExp('/((?=.*\\d)(?=.*[a-z])(?=.*[A-Z]))/');\n //$this->AddValidator($name, $validator);\n $this->AddValidator($name, new StringLength(6, 20));\n if (Request::PostData('PasswordRepeat') || !$this->user->Exists())\n {\n $this->SetRequired($name);\n }\n }", "public static function validatePassword($password){\r\n\t\tif(strlen($password) >= self::$minPassLength){\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function isValidPassword($uid, $password);", "public function validatePassword($password)\n {\n return \\Yii::$app->security->validatePassword($password, $this->password_hash);\n }", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function validatePassword($password) \n {\n return CPasswordHelper::verifyPassword($password, $this->password);\n }", "function validate_password($password)\r\n\t{\r\n\t\tif($this->dont_allow_3_in_a_row($password) === FALSE)\r\n\t\t{\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\tif(preg_match(REGEX_PASSWORD, $password) !== 1)\r\n\t\t{\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t}", "public static function renderPassword();", "function validatePassword($password, $retypedPassword)\n\t\t{\n\t\t\t// include the Password Validator Class and create a validator with 5-15 characters long\n\t\t\tinclude(\"class_libraries/PasswordValidator.php\");\n\t\t\t$passwordValidator = new PasswordValidator(5, 15);\n\t\t\t\n\t\t\t// validate the password\n\t\t\t$result = $passwordValidator -> validatePassword($password, $retypedPassword);\n\t\t\t\n\t\t\t// check the result\n\t\t\tif($result == false)\n\t\t\t{\n\t\t\t\t// get the error and return the result\n\t\t\t\treturn $passwordValidator -> getErrors();\n\t\t\t}\n\t\t\t\n\t\t\treturn;\n\t\t}", "public function validatePassword($passPassword) \n {\n\n if(preg_match('/^[a-zA-Z0-9\\s]+$/',$passPassword)) \n {\n\n return true;\n }\n else \n {\n return false;\n }\n }", "public function testInvalidConfirmPassword()\n\t{\n\t\t$this->validator->isPassword(self::USER1_PASSWORD, self::INVALID_PASSWORD);\n\t}", "public function isPasswordValid(string $encoded, string $raw);", "public function validatePassword($password)\n {\n return CPasswordHelper::verifyPassword($password,$this->clave);\n }", "public function check() {\n // Use preg_match() with a regular expression to check the password for whitespace.\n if (preg_match('/\\s/', $this->_password)) {\n // if there is a whitespace, an error message is stored in the current instance's $_errors array property.\n $this->_errors[] = 'Password cannot contain spaces.';\t\n }\n \n // Check that the value in the current instance's $_password property is less than our set minimum.\n if (strlen($this->_password) < $this->_minimumChars) {\n\t $this->_errors[] = \"Password must be at least $this->_minimumChars characters.\";\n } \n \n // This runs only if the requireMixedCase method is called before check().\n // If $_mixedCase is set to true\n\tif ($this->_mixedCase) {\n // Create a regex pattern to match the value against (checks for characters that are upper and lowercase).\n\t $pattern = '/(?=.*[a-z])(?=.*[A-Z])/';\n // Using preg_match, test characters inside the current instance's $_password property for upper and lowercase.\n\t if (!preg_match($pattern, $this->_password)) {\n\t\t$this->_errors[] = 'Password should include uppercase and lowercase characters.';\n\t }\n\t}\n \n // This runs only if the requireNumbers method is called before check().\n\tif ($this->_minimumNumbers) { \n // Create a regex pattern to check the value in $_password against.\n\t $pattern = '/\\d/'; \n\t $found = preg_match_all($pattern, $this->_password, $matches); // number of matches stored in $found\n \n // If the number of matches is less than the set minimum number property, an error message is passed to the \n // current instance's $_errors property.\n\t if ($found < $this->_minimumNumbers) {\n\t\t$this->_errors[] = \"Password should include at least $this->_minimumNumbers number(s).\";\n\t }\n\t}\n \n // If $_errors has values, check() returns false, indicating the password failed validation; otherwise check() returns true.\n\treturn $this->_errors ? false : true;\n }", "public function validatePassword($password)\n {\n return GlobalHelper::HashMe($password, PASSWORD_SALT)===$this->password;\n }", "public function validate_password($password){\nif(!preg_match('%\\A(?=[-_a-zA-Z0-9]*?[A-Z)(?=[-_a-zA-Z0-9]*?[a-z])(?=[-_a-zA-Z0-9]*?[0-9])\\S{6,}\\z%', $password)){\n\treturn false;\n\t}else{\n\t\treturn true;\n\t\t}\n}", "public function passwordIsValid($password)\n {\n $config = $this->getPasswordConfig();\n\n /**\n * Count lowercase characters, including multibyte characters.\n *\n * @param string $string\n */\n $countLowercase = function ($string) {\n $stringUppercase = mb_strtoupper($string);\n $similar = similar_text($string, $stringUppercase);\n return strlen($string) - $similar;\n };\n /**\n * Count uppercase characters, including multibyte characters.\n *\n * @param string $string\n */\n $countUppercase = function ($string) {\n $stringLowercase = mb_strtolower($string);\n $similar = similar_text($string, $stringLowercase);\n return strlen($string) - $similar;\n };\n\n // Validate minimum password length.\n if (isset($config['min_length']) && is_numeric($config['min_length'])) {\n if (strlen($password) < $config['min_length']) {\n return false;\n }\n }\n // Validate minimum lowercase character count.\n if (isset($config['min_lowercase']) && is_numeric($config['min_lowercase'])) {\n if ($countLowercase($password) < $config['min_lowercase']) {\n return false;\n }\n }\n // Validate minimum uppercase character count.\n if (isset($config['min_uppercase']) && is_numeric($config['min_uppercase'])) {\n if ($countUppercase($password) < $config['min_uppercase']) {\n return false;\n }\n }\n // Validate minimum number character count.\n if (isset($config['min_number']) && is_numeric($config['min_number'])) {\n if (preg_match_all('/[0-9]/', $password) < $config['min_number']) {\n return false;\n }\n }\n // Validate minimum symbol character count.\n if (isset($config['min_symbol']) && is_numeric($config['min_symbol'])\n && isset($config['symbol_list']) && is_string($config['symbol_list'])\n && strlen($config['symbol_list'])\n ) {\n $symbolCount = 0;\n foreach (str_split($config['symbol_list']) as $symbol) {\n $symbolCount += substr_count($password, $symbol);\n }\n if ($symbolCount < $config['min_symbol']) {\n return false;\n }\n }\n\n // The password is valid.\n return true;\n }", "public function password()\n {\n }", "public function password(){\n $_error = \"enter the password\";\n\t\treturn $_error;\n\t}", "public function validatePasswords()\n {\n $passwd = $this->_sanitized_data['password'];\n $passwd2 = $this->_sanitized_data['password2'];\n\n if ($passwd == '' || $passwd2 == '') {\n $this->_addErrorMessage(\"Missing passwords\");\n return false;\n }\n\n if ($passwd !== $passwd2) {\n $this->_addErrorMessage(\"The submitted passwords do not match\");\n return false;\n }\n\n if (strlen($passwd) < 5 && strlen($passwd2) < 5) {\n $this->_addErrorMessage(\"The submitted password must be at least 5 characters long\");\n return false;\n }\n\n return true;\n }", "public function password_verifies() {\n\t\treturn AuthComponent::password($this->data[$this->alias]['old_password']) === $this->data[$this->alias]['password'];\n\t}", "public function valida_password($password){\n\t\tif (preg_match(\"/^.*(?=.{8,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).*$/\", $password)) \n\t\t\techo \"Su password es seguro.\"; \n\t\telse echo \"Su password no es seguro.\";\n\n\t}", "private function validatePassword($password)\n {\n if (strlen($password) < $this->password_length) {\n $this->user_status_message = 'Password must have at least eight characters.';\n return false;\n }\n if (preg_match(\"/(?=[a-zA-Z]*[0-9])(?=[0-9]*[a-zA-Z])([a-zA-Z0-9]+)/\", $password)) {\n return true;\n } else {\n $this->user_status_message = 'Password must heave letters and numbers.';\n return false;\n }\n }", "public function invalidPassword() {\n\t\t$this->messages[] = \"Lösenorden har för få tecken. Minst 6 tecken.\";\n\t}", "function validate_password($field) {\n\t\tif ($field == \"\") return \"No Password was entered.<br>\";\n\t\telse if (strlen($field) < 6)\n\t\t\treturn \"Password must be at least 6 characters.<br>\";\n\t\telse if (!preg_match(\"/[a-z]/\",$field) || !preg_match(\"/[A-Z]/\",$field) || !preg_match(\"/[0-9]/\",$field) )\n\t\t\treturn \"Password require one each of a-z, A-Z,0-9.<br>\";\n\t\treturn \"\";\n\t}", "function testPasswordErr($password) {\n if (empty($password)) {\n $passwordErr = 'Password required';\n } else {\n $password = test_input($password);\n //VALIDATE PASSWORD\n if (!filter_var($password, FILTER_VALIDATE_REGEXP, array(\"options\" => array(\"regexp\" => \"((?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{4,10})\")))) {\n //da 4 a 10 caratteri, deve contenere maiuscole, minuscole e numeri\n $passwordErr = \"Invalid Password format\";\n } else\n $passwordErr = \"*\";\n }\n return $passwordErr;\n }", "public function validatePassword(string $value): bool\n {\n return $this->user->validatePassword($value);\n }", "function validatePassword($password, $retypedPassword)\n {\n // include the password validator class and validate the password and retyped password minimum of 5 and max of 15 characters\n include(\"../includes/class_libraries/PasswordValidator.php\");\n $passwordValidator = new PasswordValidator(5,15);\n \n // validate the password\n $result = $passwordValidator -> validatePassword($password, $retypedPassword);\n \n // check the result\n if($result == false)\n {\n // get the error and return it\n return $passwordValidator -> getErrors();\n }\n \n return;\n }", "function validate_password($password)\n {\n $reg1='/[A-Z]/'; //Upper case Check\n $reg2='/[a-z]/'; //Lower case Check\n $reg3='/[^a-zA-Z\\d\\s]/'; // Special Character Check\n $reg4='/[0-9]/'; // Number Digit Check\n $reg5='/[\\s]/'; // Number Digit Check\n\n if(preg_match_all($reg1,$password, $out)<1) \n return \"There should be atleast one Upper Case Letter...\";\n\n if(preg_match_all($reg2,$password, $out)<1) \n return \"There should be atleast one Lower Case Letter...\";\n\n if(preg_match_all($reg3,$password, $out)<1) \n return \"There should be atleast one Special Character...\";\n\n if(preg_match_all($reg4,$password, $out)<1) \n return \"There should be atleast one numeric digit...\";\n \n if(preg_match_all($reg5,$password, $out)>=1) \n return \"Spaces are not allowed...\";\n\n if(strlen($password) <= 8 || strlen($password) >= 16 ) \n return \"Password Length should be between 8 and 16\";\n\n return \"OK\";\n }", "private function password()\n {\n $element = new Password('password');\n $element->setLabel('Password');\n $element->setAttribute('class', 'form-control');\n $element->setAttribute('placeholder', 'Password');\n $element->addValidators(array(\n new PresenceOf(array('message' => 'Password is required'))\n ));\n $this->add($element);\n }", "public function testValidatePassword()\n\t{\n\t\t$return = $this->auth->register($this->email, $this->password, $this->password . $this->shortPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang(\"Auth.password_nomatch\"));\n\n\t\t// using short password\n\t\t$return = $this->auth->register($this->email, $this->shortPassword, $this->shortPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.password_short'));\n\n\t\t// using weak password\n\t\t$return = $this->auth->register($this->email, $this->weakPassword, $this->weakPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.password_weak'));\n\t}", "public static function validatePassword()\n {\n return array(\n new Main\\Entity\\Validator\\Length(null, 11),\n );\n }", "public function enforceRulePassword($data){\n if (strlen($data) >= 8){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}\n\t\t\t\n\t\t\t/*if (preg_match (\"/^.*(?=.{8,})(?=.*\\d)(?=.*[a-zA-Z]).*$/\", $data)){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}*/\n\t\t\t\n\t\t\treturn $validPassword;\n }", "public function check_password($password)\n {\n return FALSE;\n }", "public function validatePassword($password) {\n return CommonProcess::hashPassword($password, $this->temp_password) === $this->password_hash;\n }", "public function password($password)\n\t{\n\t\tif (\n\t\t\t! $this->hasMinLength($password) ||\n\t\t\t! $this->hasCapitalLetter($password) ||\n\t\t\t! $this->hasNumber($password) ||\n\t\t\t! $this->hasSymbol($password) ||\n\t\t\t $this->hasWhitespace($password)\n\t\t)\n\t\t{\n\t\t\treturn 'Invalid';\n\t\t}\n\n\t\treturn 'Valid';\n\t}", "function isValidPassword($password)\n{\n $len = strlen($password);\n if ($len < MIN_PASSWORD) {\n return false;\n }\n return true;\n}", "public function password_required() {\n\t\treturn post_password_required($this->ID);\n\t}", "public function passwordValidation($data)\n {\n $rules = array(\n 'password' => 'required | min:6 | max:20 | same:confirm',\n 'confirm' => 'required | same:password'\n );\n\n $messages = array(\n 'password.required' => 'the :attribute is required.',\n 'password.min' => 'the :attribute must between 6 and 20 characters.',\n 'password.max' => 'the :attribute must between 6 and 20 characters.',\n 'password.same' => 'the fields :attribute and confirm password must be the same.',\n 'confirm.required' => 'the :attribute is required.',\n 'confirm.same' => 'the fields password and confirm password must be the same.'\n );\n $validator = Validator::make($data, $rules, $messages);\n return $validator;\n }", "public function validatePassword($attribute, $params)\r\n { \r\n \r\n if (!$this->hasErrors()) {\r\n $user = $this->getUser(); \r\n if (!$user || !$user->validatePassword($this->pwd)) {\r\n $this->addError($attribute, '旧密码不正确.');\r\n }\r\n }\r\n }", "public function validPassword($element, $value, $message) {\n if (strlen($value) < 10) {\n $this->errors[$element] = $message . \"The password has to be at least 10 characters long.\";\n }\n // At most 128 chars long\n else if (strlen($value) > 128) {\n $this->errors[$element] = $message . \"The password has to be at most 128 characters long.\";\n }\n // At least 1 uppercase\n else if (!preg_match('/[A-Z]/', $value)){\n $this->errors[$element] = $message . \"The password has to contain at least 1 uppercase character.\";\n }\n\n // At least 1 lowercase\n else if (!preg_match('/[a-z]/', $value)) {\n $this->errors[$element] = $message . \"The password has to contain at least 1 lowercase character.\";\n }\n // At least 1 digit\n else if (!preg_match('/\\d/', $value)) {\n $this->errors[$element] = $message . \"The password has to contain at least 1 digit.\";\n }\n // Not more than 2 identical chars in a row\n else if ($this->identicalCharsInRow($value)) {\n $this->errors[$element] = $message . \"The password can not contain more than two identical characters in a row.\";\n }\n }", "public function hasPassword() : bool;", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "public static function password($data=''){\n\t\t\treturn true;\n\t\t}", "public function testPasswordIsValid($data)\n {\n $pattern = \"/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/\";\n\n $this->assertMatchesRegularExpression($pattern,$data);\n\n }", "function is_valid_password($password)\n{\n if (is_null($password) || strlen($password) < 6 || strlen($password) > 40)\n {\n return false;\n }\n $pattern = \"/^[a-z0-9~`!@#\\$%\\^&\\*\\-_\\+=\\(\\)\\{\\}\\[\\]\\|:;\\\"\\'\\<\\>\\.,\\?\\/]{6,40}$/i\";\n\n return (preg_match($pattern, $password) == 1);\n}", "public function passwordValidate($password)\n {\n\n $length = strlen($password);\n\n if ($length < 5) {\n return false;\n } else {\n return true;\n }\n }", "function testPassword()\n {\n $this->f->_isSubmitted = true;\n $this->assertEquals(\"\", $this->f->password());\n $this->assertEquals(\"V\", $this->f->password(\"L\", \"H\", \"V\"));\n $val = &$this->f->password(\"L\", \"H\", \"V\");\n $this->f->error();\n $this->assertTrue($this->f->_hasErrors);\n $this->assertEquals(\"\", $val);\n }", "function validatePassword($pwd) {\r\n\t\treturn (strlen($pwd) >= 6 && preg_match_all(\"/[0-9]/\", $pwd) >= 2);\r\n\t}", "public function validatePassword($attribute, $params)\n {\n if (!$this->hasErrors()) {\n $user = $this->getUser();\n\n if (!$user || $user->password != sha1($this->password)) {\n $this->addError($attribute, Yii::t('app', 'Incorrect username or password.'));\n }\n }\n }", "public function check_password_strength($password){\n // Validate password strength\n $uppercase = preg_match('@[A-Z]@', $password);\n $lowercase = preg_match('@[a-z]@', $password);\n $number = preg_match('@[0-9]@', $password);\n $specialChars = preg_match('@[^\\w]@', $password);\n\n if(!$uppercase || !$lowercase || !$number || !$specialChars || strlen($password) < 8) {\n $GLOBALS['error_message'] = 'Password should be at least 8 characters in length and should include at least one upper case letter, one number, and one special character.';\n return false;\n }else{\n return true;\n }\n }", "function check_password($password)\n{\n if (strlen($password) < 8) {\n throw new Exception(\"password_short.\", 1);\n return false;\n }\n if (!preg_match(\"/[0-9]{1,}/\", $password) || !preg_match(\"/[A-Z]{1,}/\", $password)) {\n throw new Exception(\"password_bad\", 1);\n return false;\n }\n return true;\n}", "public function validatePassword($password)\n {\n if ($this->password === crypt($password, 'DontTry')) {\n return true;\n }\n else {\n return false;\n }\n }", "function sanitizePassword() {\n // If there is a password confirmation we put it to the checker, too\n $passCheckerInput = (strlen($this->passwordConf) > 0) ?\n array($this->password, $this->passwordConf) : $this->password;\n $passwordChecker = new PasswordChecker($passCheckerInput);\n if ($passwordChecker->getRelevance()) {\n $this->password = htmlspecialchars($this->password);\n } else {\n die(\"Error. Check your form data\");\n }\n }", "public function validatePassword($password)\n {\n return $this->hashPassword($password) === $this->password;\n }", "public function validatePassword($password)\n {\n return $this->hashPassword($password) === $this->password;\n }", "public function validatePassword($password)\n {\n return password_verify($password, $this->pass);\n }", "public function validatePassword($password): bool\n {\n return password_verify($password, $this->password);\n }", "function valid_pass($password)\n {\n $r2 = '/[A-z]/'; //lowercase\n $r3 = '/[0-9]/'; //numbers\n $r4 = '/[~!@#$%^&*()\\-_=+{};:<,.>?]/'; // special char\n\n /*if (preg_match_all($r1, $candidate, $o) < 1) {\n $msg = \"密码必须包含至少一个大写字母,请返回修改!\";\n return FALSE;\n }*/\n if (preg_match_all($r2, $password, $o) < 1) {\n $msg = \"密码必须包含至少一个字母,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n if (preg_match_all($r3, $password, $o) < 1) {\n $msg = \"密码必须包含至少一个数字,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n /*if (preg_match_all($r4, $candidate, $o) < 1) {\n $msg = \"密码必须包含至少一个特殊符号:[~!@#$%^&*()\\-_=+{};:<,.>?],请返回修改!\";\n return FALSE;\n }*/\n if (strlen($password) < 8) {\n $msg = \"密码必须包含至少含有8个字符,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n return ['code' => 0, 'msg' => 'success'];\n }", "function validatePasswordLength(&$Model, $data, $compare) {\r\n\t\t$key = key($data);\r\n\t\t$value = $data[$key];\r\n\t\t$compare = $Model->data[$Model->alias][$this->settings[$Model->alias]['fields']['password']];\r\n\t\t$length = strlen($compare);\r\n\t\tif ($length < $this->settings[$Model->alias]['passwordPolicies'][$this->settings[$Model->alias]['passwordPolicy']]['length']) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function password()\n {\n $this->isUser();\n\n $this->data['noCabinetOrAdmin'] = true;\n\n if ($_POST) {\n\n if (!$_POST['old-password'] && !$_POST['new-password']) {\n\n $userModel = new UserModel();\n\n $validateResult = $userModel->validate($_POST);\n\n if ($validateResult === true) {\n\n $checkPassword = $userModel->checkOldPassword($_POST['old-password']);\n\n if ($checkPassword) {\n\n if ($userModel->refreshPassword($_POST)) {\n\n $this->data['success'] = 'Пароль успешно изменен';\n\n } else {\n\n $this->data['warning'] = 'Произошла ошибка';\n }\n\n } else {\n\n $this->data['warning'] = 'Старый пароль введен не правильно';\n }\n\n } else {\n\n $this->data['warning'] = $validateResult;\n }\n\n } else {\n\n $this->data['warning'] = 'Все поля должны быть заполнены';\n }\n }\n\n $this->render('password');\n }", "public function getPassword() {}", "public function provideValidatePassword()\n {\n return [\n [123456, 234567, true],\n [\"123457\", 234567, true],\n [\"12345v\", 234567, false],\n ['asdfgh', 'asdfgh', false]\n ];\n }", "public function isValid($password)\n {\n if ($this->_minLength) {\n $len = strlen($password);\n if ($len < $this->_minLength) {\n return $this->_setInvalidReason(self::REASON_TOO_SHORT, array(\n 'minimum length' => $this->_minLength,\n 'password length' => $len,\n ));\n }\n }\n if ($this->_minStrength) {\n $strength = $this->calculateStrength($password);\n if ($strength < $this->_minStrength) {\n return $this->_setInvalidReason(self::REASON_TOO_WEAK, array(\n 'minimum strength' => $this->_minStrength,\n 'password strength' => $strength,\n ));\n }\n }\n if ($this->_minEntropy) {\n $entropy = $this->calculateEntropy($password);\n if ($entropy < $this->_minEntropy) {\n return $this->_setInvalidReason(self::REASON_INSUFFICIENT_ENTROPY, array(\n 'minimum entropy' => $this->_minEntropy,\n 'password entropy' => $entropy,\n ));\n }\n }\n foreach ($this->_requiredCharValidators as $validator) {\n list ($chars, $numRequired) = $validator;\n // http://www.php.net/manual/en/function.mb-split.php#99851\n $charArr = preg_split('/(?<!^)(?!$)/u', $chars);\n str_replace($charArr, ' ', $password, $count);\n if ($count < $numRequired) {\n return $this->_setInvalidReason(self::REASON_MISSING_REQUIRED_CHARS, array(\n 'required chars' => $chars,\n 'num required' => $numRequired,\n 'num found' => $count,\n ));\n }\n }\n foreach ($this->_validators as $validator) {\n list($type, $thing) = $validator;\n if ($type === 'callable') {\n $func = $thing;\n } else {\n $func = array($thing, 'isValid');\n }\n $result = call_user_func($func, $password);\n if (! $result) {\n return $this->_setInvalidReason(self::REASON_FAILED_VALIDATOR, array(\n 'validator' => $thing,\n ));\n }\n }\n if ($this->_passwordLists) {\n $file = $this->findPassword($password);\n if ($file) {\n return $this->_setInvalidReason(self::REASON_FOUND_IN_LIST, array(\n 'list file' => $file,\n ));\n }\n }\n return true;\n }", "public function validatePassword($password)\r\n\t{\t\t\r\n return md5(md5($password).$this->ec_salt) === $this->password;\t\t\r\n\t}", "public function setPasswordcheck($password)\n {\n // Do nothing\n }", "public function validatePassword($password)\n\t{\n\t\treturn sha1($this->salt.$password)===$this->password_hash;\n\t}" ]
[ "0.7863859", "0.769698", "0.7534779", "0.7386753", "0.73385555", "0.729721", "0.72783655", "0.7157424", "0.71568894", "0.71119124", "0.70852286", "0.7073094", "0.706855", "0.70403856", "0.7031329", "0.7007179", "0.70014006", "0.6987082", "0.69784933", "0.6942016", "0.6909618", "0.6885369", "0.68549573", "0.6844131", "0.68378824", "0.68307155", "0.6822213", "0.6808202", "0.67812276", "0.6777873", "0.67777073", "0.6767409", "0.6766287", "0.6758151", "0.6758151", "0.6758151", "0.6754834", "0.67350936", "0.6724942", "0.6716739", "0.67099977", "0.6703174", "0.6685911", "0.6685753", "0.66831595", "0.66746056", "0.6669286", "0.6662316", "0.6659452", "0.66584516", "0.6651509", "0.6650127", "0.66430885", "0.66139627", "0.6608701", "0.6607714", "0.6600628", "0.65946597", "0.6590917", "0.6580017", "0.6579153", "0.65758115", "0.65738374", "0.6573616", "0.6571357", "0.65588", "0.65443236", "0.6543257", "0.6538904", "0.65358174", "0.6534368", "0.6531868", "0.65269274", "0.6523349", "0.6523349", "0.6523349", "0.6522634", "0.6517276", "0.6515076", "0.6513071", "0.6509943", "0.6481748", "0.6477925", "0.647535", "0.64741015", "0.6462822", "0.6446817", "0.64463514", "0.64463514", "0.6444233", "0.6444193", "0.64337873", "0.64272434", "0.64265376", "0.6413112", "0.6406371", "0.64057463", "0.6396669", "0.63954604", "0.63931084" ]
0.73903596
3
Validates the password. This method serves as the inline validation for password.
public function validateStatus() { if (!$this->hasErrors()) { $user = $this->getUser(); if ($user->status==User::STATUS_BLOCKED || $user->status==User::STATUS_DELETED) { $this->addError('password', Yii::t('app','Your account is blocked, please contact support.')); } if ($user->status==User::STATUS_EMAIL_VALIDATION) { $this->addError('password', Yii::t('app','Du hast Deine Registrierung noch nicht abgeschlossen. Prüfe Deine E-Mails, dort findest Du eine E-Mail mit dem Bestätigungslink. Bitte klicke auf diesen Link um Deine Registrierung abzuschliessen.')); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validatePassword()\n {\n /* @var $user User */\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->password)) {\n $this->addError('password', 'Incorrect password.');\n }\n }", "public function validatePassword()\n {\n $validator = new Validator(array(\n 'password' => $this->password,\n 'password2' => $this->password2,\n self::$primaryKey => $this->id(),\n ));\n\n $validator\n ->required()\n ->set('password2', 'Confirm password');\n\n $validator\n ->required()\n ->minLength(6)\n ->callback(function ($password, $password2) {\n return $password === $password2;\n }, 'Password is not matching confirm password', array($this->password2))\n ->set('password', 'Password');\n\n return $validator->validate();\n }", "public function validatePassword()\n {\n /* @var $user User */\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->oldPassword)) {\n $this->addError('oldPassword', 'Incorrect old password.');\n }\n }", "public function validatePassword()\n {\n if (!$this->hasErrors()) {\n $user = $this->getUser();\n\n if (!$user || !$user->validatePassword($this->password)) {\n $this->addError('password', Yii::t('app','Falscher Benutzername oder falsches Passwort.'));\n }\n }\n }", "public function validatePassword() {\n if (!$this->hasErrors()) {\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->password_old)) {\n // $this->addError('password_old', 'Incorrect current password.');\n }\n }\n }", "public function validatePassword()\n {\n $result = false;\n if (strlen($this->password) >= 5) {\n $result = true;\n }\n return $result;\n }", "public function validatePassword()\n {\n if (!$this->hasErrors()) {\n if (!$this->user->validatePassword($this->old_password)) {\n $this->addError('old_password', 'Incorrect email or password.');\n }\n }\n }", "function validatePassword() : bool\n {\n if($this->Password && preg_match('/^[[:alnum:]]{6,20}$/', $this->Password)) // solo numeri-lettere da 6 a 20\n {\n return true;\n }\n else\n return false;\n }", "function passwordValid($password) {\n\treturn true;\n}", "private function valid_password() {\n return (strlen($this->password) == 6);\n }", "public function validate_password()\n\t{\n\t\t//Load language from user component\n\t\t$lang = JFactory::getLanguage();\n\t\t$tag = $lang->getTag();\n\n\t\tif (!$tag)\n\t\t{\n\t\t\t$tag = 'en-GB';\n\t\t}\n\n\t\t$lang->load('com_users', JPATH_ROOT, $tag);\n\t\t$value = $this->input->get('fieldValue', '', 'none');\n\t\t$validateId = $this->input->get('fieldId', '', 'none');\n\t\t$params = JComponentHelper::getParams('com_users');\n\t\t$minimumIntegers = $params->get('minimum_integers');\n\t\t$minimumSymbols = $params->get('minimum_symbols');\n\t\t$minimumUppercase = $params->get('minimum_uppercase');\n\t\t$validPassword = true;\n\t\t$errorMessage = '';\n\n\t\tif (!empty($minimumIntegers))\n\t\t{\n\t\t\t$nInts = preg_match_all('/[0-9]/', $value, $imatch);\n\n\t\t\tif ($nInts < $minimumIntegers)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_INTEGERS_N', $minimumIntegers);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\t\tif ($validPassword && !empty($minimumSymbols))\n\t\t{\n\t\t\t$nsymbols = preg_match_all('[\\W]', $value, $smatch);\n\n\t\t\tif ($nsymbols < $minimumSymbols)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_SYMBOLS_N', $minimumSymbols);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\n\t\tif ($validPassword && !empty($minimumUppercase))\n\t\t{\n\t\t\t$nUppercase = preg_match_all(\"/[A-Z]/\", $value, $umatch);\n\n\t\t\tif ($nUppercase < $minimumUppercase)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_UPPERCASE_LETTERS_N', $minimumUppercase);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\t\t$arrayToJs = array();\n\t\t$arrayToJs[0] = $validateId;\n\n\t\tif (!$validPassword)\n\t\t{\n\t\t\t$arrayToJs[1] = false;\n\t\t\t$arrayToJs[2] = $errorMessage;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arrayToJs[1] = true;\n\t\t}\n\n\t\techo json_encode($arrayToJs);\n\n\t\t$this->app->close();\n\t}", "public function testInvalidLengthPassword()\n {\n $password = \"23d3\";\n $response = $this->user->isValidPassword($password);\n\n $this->assertFalse($response);\n }", "public function checkPassword($value);", "public function validatePassword($password)\n {\n return $this->hashPassword($password)===$this->password;\n }", "public function testValidLengthPassword()\n {\n $password = \"accepted\";\n\n $response = $this->user->isValidPassword($password);\n\n $this->assertTrue($response);\n }", "public function passwordEntryIsValid() {\r\n \r\n //todo put logic here (same as email)\r\n // also check if it matches confirmpassword\r\n // set the var equal to function call of getpassword\r\n $password = $this->getPassword();\r\n // If the fields empty\r\n if ( empty($password) ) {\r\n // Will send it to errors as username and display the message to user\r\n $this->errors[\"password\"] = \"Password is missing.\";\r\n } \r\n // Calls the password function above and if its not equal to the orgincal password returns error\r\n else if ( $this->getConfirmpassword() !== $this->getPassword() ){\r\n // Message displayed to user\r\n $this->errors[\"password\"] = \"Password does not match confirmation password.\";\r\n }\r\n // Also goes test the password against the password is valid function in the validator class\r\n else if ( !Validator::passwordIsValid($this->getPassword()) ) {\r\n $this->errors[\"password\"] = \"Password is not valid.\"; \r\n }\r\n //Will return if its empty and whether any errors are contained\r\n return ( empty($this->errors[\"password\"]) ? true : false ) ;\r\n }", "public function validatePassword(User $user, $password);", "public function isPasswordField() {}", "public function validatePassword($password)\n {\n // return $password == $this->password;\n return Yii::$app->getSecurity()->validatePassword($password, $this->password);\n }", "function validPassword($password){\t\r\n \tglobal $API;\r\n return $API->userValidatePassword($this->username,$password); \r\n }", "private function validate_password($password){\n\t\treturn TRUE;\n\t}", "public function validatePassword($password) {\r\n return $this->password===$password;\r\n\r\n }", "public function check_password($password)\n {\n }", "function validatePassword($pass) {\n\t\t$l = getOption('min_password_lenght');\n\t\tif ($l > 0) {\n\t\t\tif (strlen($pass) < $l) return sprintf(gettext('Password must be at least %u characters'), $l);\n\t\t}\n\t\t$p = getOption('password_pattern');\n\t\tif (!empty($p)) {\n\t\t\t$strong = false;\n\t\t\t$p = str_replace('\\|', \"\\t\", $p);\n\t\t\t$patterns = explode('|', $p);\n\t\t\t$p2 = '';\n\t\t\tforeach ($patterns as $pat) {\n\t\t\t\t$pat = trim(str_replace(\"\\t\", '|', $pat));\n\t\t\t\tif (!empty($pat)) {\n\t\t\t\t\t$p2 .= '{<em>'.$pat.'</em>}, ';\n\n\t\t\t\t\t$patrn = '';\n\t\t\t\t\tforeach (array('0-9','a-z','A-Z') as $try) {\n\t\t\t\t\t\tif (preg_match('/['.$try.']-['.$try.']/', $pat, $r)) {\n\t\t\t\t\t\t\t$patrn .= $r[0];\n\t\t\t\t\t\t\t$pat = str_replace($r[0],'',$pat);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$patrn .= addcslashes($pat,'\\\\/.()[]^-');\n\t\t\t\t\tif (preg_match('/(['.$patrn.'])/', $pass)) {\n\t\t\t\t\t\t$strong = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!$strong)\treturn sprintf(gettext('Password must contain at least one of %s'), substr($p2,0,-2));\n\t\t}\n\t\treturn false;\n\t}", "protected function validatePassword($password) \n {\n if (!empty($password)) {\n if (strlen($password) < '8') {\n $this->errors[] = PASSWORD_TOO_SHORT;\n }\n if (!preg_match(\"#[0-9]+#\", $password)) {\n $this->errors[] = PASSWORD_NEEDS_NUMBER;\n }\n if (!preg_match(\"#[A-Z]+#\", $password)) {\n $this->errors[] = PASSWORD_NEEDS_UPPERCASE;\n }\n if (!preg_match(\"#[a-z]+#\", $password)) {\n $this->errors[] = PASSWORD_NEEDS_LOWERCASE;\n }\n } else {\n $this->errors[] = PASSWORD_MISSING;\n }\n }", "public function isPassword($password);", "public function validatePassword($attribute, $params)\n\t{\n\t\tif ($this->password !== $this->repeatePassword) {\n\t\t\t$this->addError($attribute, 'Пароль не совпадает.');\n\t\t}\n\t}", "public function validatePassword($password)\t{\n\t\treturn crypt($password,$this->password) === $this->password;\n\t}", "public static function validatePassword($password) {\n if (\n (strlen($password) > 8 || strlen($password) < 4) || // Check Length\n (!preg_match(\"#[0-9]+#\", $password)) || // Contains a number.\n (!preg_match(\"#[a-zA-Z]+#\", $password)) || // Contains a letter.\n (!preg_match(\"/^[a-z0-9]+$/i\",$password))) // No special characters.\n {\n // Password did not meet one of the requirements.\n return false; \n } else {\n // Password meets all requirements.\n return true;\n }\n }", "public function validatePassword($password) {\t \r\n\t\treturn self::hashPassword($password, $this->salt) === $this->password;\r\n\t}", "private function AddPasswordField()\n {\n $name = 'Password';\n \n $this->AddField(Input::Password($name));\n //Password needs contain lower case letter, upper case letter, and a digit\n //$validator = new RegExp('/((?=.*\\d)(?=.*[a-z])(?=.*[A-Z]))/');\n //$this->AddValidator($name, $validator);\n $this->AddValidator($name, new StringLength(6, 20));\n if (Request::PostData('PasswordRepeat') || !$this->user->Exists())\n {\n $this->SetRequired($name);\n }\n }", "public static function validatePassword($password){\r\n\t\tif(strlen($password) >= self::$minPassLength){\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function isValidPassword($uid, $password);", "public function validatePassword($password)\n {\n return \\Yii::$app->security->validatePassword($password, $this->password_hash);\n }", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function validatePassword($password) \n {\n return CPasswordHelper::verifyPassword($password, $this->password);\n }", "function validate_password($password)\r\n\t{\r\n\t\tif($this->dont_allow_3_in_a_row($password) === FALSE)\r\n\t\t{\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\tif(preg_match(REGEX_PASSWORD, $password) !== 1)\r\n\t\t{\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t}", "public static function renderPassword();", "function validatePassword($password, $retypedPassword)\n\t\t{\n\t\t\t// include the Password Validator Class and create a validator with 5-15 characters long\n\t\t\tinclude(\"class_libraries/PasswordValidator.php\");\n\t\t\t$passwordValidator = new PasswordValidator(5, 15);\n\t\t\t\n\t\t\t// validate the password\n\t\t\t$result = $passwordValidator -> validatePassword($password, $retypedPassword);\n\t\t\t\n\t\t\t// check the result\n\t\t\tif($result == false)\n\t\t\t{\n\t\t\t\t// get the error and return the result\n\t\t\t\treturn $passwordValidator -> getErrors();\n\t\t\t}\n\t\t\t\n\t\t\treturn;\n\t\t}", "public function validatePassword($passPassword) \n {\n\n if(preg_match('/^[a-zA-Z0-9\\s]+$/',$passPassword)) \n {\n\n return true;\n }\n else \n {\n return false;\n }\n }", "public function testInvalidConfirmPassword()\n\t{\n\t\t$this->validator->isPassword(self::USER1_PASSWORD, self::INVALID_PASSWORD);\n\t}", "public function isPasswordValid(string $encoded, string $raw);", "public function validatePassword($password)\n {\n return CPasswordHelper::verifyPassword($password,$this->clave);\n }", "public function check() {\n // Use preg_match() with a regular expression to check the password for whitespace.\n if (preg_match('/\\s/', $this->_password)) {\n // if there is a whitespace, an error message is stored in the current instance's $_errors array property.\n $this->_errors[] = 'Password cannot contain spaces.';\t\n }\n \n // Check that the value in the current instance's $_password property is less than our set minimum.\n if (strlen($this->_password) < $this->_minimumChars) {\n\t $this->_errors[] = \"Password must be at least $this->_minimumChars characters.\";\n } \n \n // This runs only if the requireMixedCase method is called before check().\n // If $_mixedCase is set to true\n\tif ($this->_mixedCase) {\n // Create a regex pattern to match the value against (checks for characters that are upper and lowercase).\n\t $pattern = '/(?=.*[a-z])(?=.*[A-Z])/';\n // Using preg_match, test characters inside the current instance's $_password property for upper and lowercase.\n\t if (!preg_match($pattern, $this->_password)) {\n\t\t$this->_errors[] = 'Password should include uppercase and lowercase characters.';\n\t }\n\t}\n \n // This runs only if the requireNumbers method is called before check().\n\tif ($this->_minimumNumbers) { \n // Create a regex pattern to check the value in $_password against.\n\t $pattern = '/\\d/'; \n\t $found = preg_match_all($pattern, $this->_password, $matches); // number of matches stored in $found\n \n // If the number of matches is less than the set minimum number property, an error message is passed to the \n // current instance's $_errors property.\n\t if ($found < $this->_minimumNumbers) {\n\t\t$this->_errors[] = \"Password should include at least $this->_minimumNumbers number(s).\";\n\t }\n\t}\n \n // If $_errors has values, check() returns false, indicating the password failed validation; otherwise check() returns true.\n\treturn $this->_errors ? false : true;\n }", "public function validatePassword($password)\n {\n return GlobalHelper::HashMe($password, PASSWORD_SALT)===$this->password;\n }", "public function validate_password($password){\nif(!preg_match('%\\A(?=[-_a-zA-Z0-9]*?[A-Z)(?=[-_a-zA-Z0-9]*?[a-z])(?=[-_a-zA-Z0-9]*?[0-9])\\S{6,}\\z%', $password)){\n\treturn false;\n\t}else{\n\t\treturn true;\n\t\t}\n}", "public function passwordIsValid($password)\n {\n $config = $this->getPasswordConfig();\n\n /**\n * Count lowercase characters, including multibyte characters.\n *\n * @param string $string\n */\n $countLowercase = function ($string) {\n $stringUppercase = mb_strtoupper($string);\n $similar = similar_text($string, $stringUppercase);\n return strlen($string) - $similar;\n };\n /**\n * Count uppercase characters, including multibyte characters.\n *\n * @param string $string\n */\n $countUppercase = function ($string) {\n $stringLowercase = mb_strtolower($string);\n $similar = similar_text($string, $stringLowercase);\n return strlen($string) - $similar;\n };\n\n // Validate minimum password length.\n if (isset($config['min_length']) && is_numeric($config['min_length'])) {\n if (strlen($password) < $config['min_length']) {\n return false;\n }\n }\n // Validate minimum lowercase character count.\n if (isset($config['min_lowercase']) && is_numeric($config['min_lowercase'])) {\n if ($countLowercase($password) < $config['min_lowercase']) {\n return false;\n }\n }\n // Validate minimum uppercase character count.\n if (isset($config['min_uppercase']) && is_numeric($config['min_uppercase'])) {\n if ($countUppercase($password) < $config['min_uppercase']) {\n return false;\n }\n }\n // Validate minimum number character count.\n if (isset($config['min_number']) && is_numeric($config['min_number'])) {\n if (preg_match_all('/[0-9]/', $password) < $config['min_number']) {\n return false;\n }\n }\n // Validate minimum symbol character count.\n if (isset($config['min_symbol']) && is_numeric($config['min_symbol'])\n && isset($config['symbol_list']) && is_string($config['symbol_list'])\n && strlen($config['symbol_list'])\n ) {\n $symbolCount = 0;\n foreach (str_split($config['symbol_list']) as $symbol) {\n $symbolCount += substr_count($password, $symbol);\n }\n if ($symbolCount < $config['min_symbol']) {\n return false;\n }\n }\n\n // The password is valid.\n return true;\n }", "public function password()\n {\n }", "public function password(){\n $_error = \"enter the password\";\n\t\treturn $_error;\n\t}", "public function validatePasswords()\n {\n $passwd = $this->_sanitized_data['password'];\n $passwd2 = $this->_sanitized_data['password2'];\n\n if ($passwd == '' || $passwd2 == '') {\n $this->_addErrorMessage(\"Missing passwords\");\n return false;\n }\n\n if ($passwd !== $passwd2) {\n $this->_addErrorMessage(\"The submitted passwords do not match\");\n return false;\n }\n\n if (strlen($passwd) < 5 && strlen($passwd2) < 5) {\n $this->_addErrorMessage(\"The submitted password must be at least 5 characters long\");\n return false;\n }\n\n return true;\n }", "public function password_verifies() {\n\t\treturn AuthComponent::password($this->data[$this->alias]['old_password']) === $this->data[$this->alias]['password'];\n\t}", "public function valida_password($password){\n\t\tif (preg_match(\"/^.*(?=.{8,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).*$/\", $password)) \n\t\t\techo \"Su password es seguro.\"; \n\t\telse echo \"Su password no es seguro.\";\n\n\t}", "private function validatePassword($password)\n {\n if (strlen($password) < $this->password_length) {\n $this->user_status_message = 'Password must have at least eight characters.';\n return false;\n }\n if (preg_match(\"/(?=[a-zA-Z]*[0-9])(?=[0-9]*[a-zA-Z])([a-zA-Z0-9]+)/\", $password)) {\n return true;\n } else {\n $this->user_status_message = 'Password must heave letters and numbers.';\n return false;\n }\n }", "public function invalidPassword() {\n\t\t$this->messages[] = \"Lösenorden har för få tecken. Minst 6 tecken.\";\n\t}", "function validate_password($field) {\n\t\tif ($field == \"\") return \"No Password was entered.<br>\";\n\t\telse if (strlen($field) < 6)\n\t\t\treturn \"Password must be at least 6 characters.<br>\";\n\t\telse if (!preg_match(\"/[a-z]/\",$field) || !preg_match(\"/[A-Z]/\",$field) || !preg_match(\"/[0-9]/\",$field) )\n\t\t\treturn \"Password require one each of a-z, A-Z,0-9.<br>\";\n\t\treturn \"\";\n\t}", "function testPasswordErr($password) {\n if (empty($password)) {\n $passwordErr = 'Password required';\n } else {\n $password = test_input($password);\n //VALIDATE PASSWORD\n if (!filter_var($password, FILTER_VALIDATE_REGEXP, array(\"options\" => array(\"regexp\" => \"((?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{4,10})\")))) {\n //da 4 a 10 caratteri, deve contenere maiuscole, minuscole e numeri\n $passwordErr = \"Invalid Password format\";\n } else\n $passwordErr = \"*\";\n }\n return $passwordErr;\n }", "public function validatePassword(string $value): bool\n {\n return $this->user->validatePassword($value);\n }", "function validatePassword($password, $retypedPassword)\n {\n // include the password validator class and validate the password and retyped password minimum of 5 and max of 15 characters\n include(\"../includes/class_libraries/PasswordValidator.php\");\n $passwordValidator = new PasswordValidator(5,15);\n \n // validate the password\n $result = $passwordValidator -> validatePassword($password, $retypedPassword);\n \n // check the result\n if($result == false)\n {\n // get the error and return it\n return $passwordValidator -> getErrors();\n }\n \n return;\n }", "function validate_password($password)\n {\n $reg1='/[A-Z]/'; //Upper case Check\n $reg2='/[a-z]/'; //Lower case Check\n $reg3='/[^a-zA-Z\\d\\s]/'; // Special Character Check\n $reg4='/[0-9]/'; // Number Digit Check\n $reg5='/[\\s]/'; // Number Digit Check\n\n if(preg_match_all($reg1,$password, $out)<1) \n return \"There should be atleast one Upper Case Letter...\";\n\n if(preg_match_all($reg2,$password, $out)<1) \n return \"There should be atleast one Lower Case Letter...\";\n\n if(preg_match_all($reg3,$password, $out)<1) \n return \"There should be atleast one Special Character...\";\n\n if(preg_match_all($reg4,$password, $out)<1) \n return \"There should be atleast one numeric digit...\";\n \n if(preg_match_all($reg5,$password, $out)>=1) \n return \"Spaces are not allowed...\";\n\n if(strlen($password) <= 8 || strlen($password) >= 16 ) \n return \"Password Length should be between 8 and 16\";\n\n return \"OK\";\n }", "private function password()\n {\n $element = new Password('password');\n $element->setLabel('Password');\n $element->setAttribute('class', 'form-control');\n $element->setAttribute('placeholder', 'Password');\n $element->addValidators(array(\n new PresenceOf(array('message' => 'Password is required'))\n ));\n $this->add($element);\n }", "public function testValidatePassword()\n\t{\n\t\t$return = $this->auth->register($this->email, $this->password, $this->password . $this->shortPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang(\"Auth.password_nomatch\"));\n\n\t\t// using short password\n\t\t$return = $this->auth->register($this->email, $this->shortPassword, $this->shortPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.password_short'));\n\n\t\t// using weak password\n\t\t$return = $this->auth->register($this->email, $this->weakPassword, $this->weakPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.password_weak'));\n\t}", "public static function validatePassword()\n {\n return array(\n new Main\\Entity\\Validator\\Length(null, 11),\n );\n }", "public function enforceRulePassword($data){\n if (strlen($data) >= 8){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}\n\t\t\t\n\t\t\t/*if (preg_match (\"/^.*(?=.{8,})(?=.*\\d)(?=.*[a-zA-Z]).*$/\", $data)){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}*/\n\t\t\t\n\t\t\treturn $validPassword;\n }", "public function check_password($password)\n {\n return FALSE;\n }", "public function validatePassword($password) {\n return CommonProcess::hashPassword($password, $this->temp_password) === $this->password_hash;\n }", "public function password($password)\n\t{\n\t\tif (\n\t\t\t! $this->hasMinLength($password) ||\n\t\t\t! $this->hasCapitalLetter($password) ||\n\t\t\t! $this->hasNumber($password) ||\n\t\t\t! $this->hasSymbol($password) ||\n\t\t\t $this->hasWhitespace($password)\n\t\t)\n\t\t{\n\t\t\treturn 'Invalid';\n\t\t}\n\n\t\treturn 'Valid';\n\t}", "function isValidPassword($password)\n{\n $len = strlen($password);\n if ($len < MIN_PASSWORD) {\n return false;\n }\n return true;\n}", "public function password_required() {\n\t\treturn post_password_required($this->ID);\n\t}", "public function passwordValidation($data)\n {\n $rules = array(\n 'password' => 'required | min:6 | max:20 | same:confirm',\n 'confirm' => 'required | same:password'\n );\n\n $messages = array(\n 'password.required' => 'the :attribute is required.',\n 'password.min' => 'the :attribute must between 6 and 20 characters.',\n 'password.max' => 'the :attribute must between 6 and 20 characters.',\n 'password.same' => 'the fields :attribute and confirm password must be the same.',\n 'confirm.required' => 'the :attribute is required.',\n 'confirm.same' => 'the fields password and confirm password must be the same.'\n );\n $validator = Validator::make($data, $rules, $messages);\n return $validator;\n }", "public function validatePassword($attribute, $params)\r\n { \r\n \r\n if (!$this->hasErrors()) {\r\n $user = $this->getUser(); \r\n if (!$user || !$user->validatePassword($this->pwd)) {\r\n $this->addError($attribute, '旧密码不正确.');\r\n }\r\n }\r\n }", "public function validPassword($element, $value, $message) {\n if (strlen($value) < 10) {\n $this->errors[$element] = $message . \"The password has to be at least 10 characters long.\";\n }\n // At most 128 chars long\n else if (strlen($value) > 128) {\n $this->errors[$element] = $message . \"The password has to be at most 128 characters long.\";\n }\n // At least 1 uppercase\n else if (!preg_match('/[A-Z]/', $value)){\n $this->errors[$element] = $message . \"The password has to contain at least 1 uppercase character.\";\n }\n\n // At least 1 lowercase\n else if (!preg_match('/[a-z]/', $value)) {\n $this->errors[$element] = $message . \"The password has to contain at least 1 lowercase character.\";\n }\n // At least 1 digit\n else if (!preg_match('/\\d/', $value)) {\n $this->errors[$element] = $message . \"The password has to contain at least 1 digit.\";\n }\n // Not more than 2 identical chars in a row\n else if ($this->identicalCharsInRow($value)) {\n $this->errors[$element] = $message . \"The password can not contain more than two identical characters in a row.\";\n }\n }", "public function hasPassword() : bool;", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "public static function password($data=''){\n\t\t\treturn true;\n\t\t}", "public function testPasswordIsValid($data)\n {\n $pattern = \"/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/\";\n\n $this->assertMatchesRegularExpression($pattern,$data);\n\n }", "function is_valid_password($password)\n{\n if (is_null($password) || strlen($password) < 6 || strlen($password) > 40)\n {\n return false;\n }\n $pattern = \"/^[a-z0-9~`!@#\\$%\\^&\\*\\-_\\+=\\(\\)\\{\\}\\[\\]\\|:;\\\"\\'\\<\\>\\.,\\?\\/]{6,40}$/i\";\n\n return (preg_match($pattern, $password) == 1);\n}", "public function passwordValidate($password)\n {\n\n $length = strlen($password);\n\n if ($length < 5) {\n return false;\n } else {\n return true;\n }\n }", "function testPassword()\n {\n $this->f->_isSubmitted = true;\n $this->assertEquals(\"\", $this->f->password());\n $this->assertEquals(\"V\", $this->f->password(\"L\", \"H\", \"V\"));\n $val = &$this->f->password(\"L\", \"H\", \"V\");\n $this->f->error();\n $this->assertTrue($this->f->_hasErrors);\n $this->assertEquals(\"\", $val);\n }", "function validatePassword($pwd) {\r\n\t\treturn (strlen($pwd) >= 6 && preg_match_all(\"/[0-9]/\", $pwd) >= 2);\r\n\t}", "public function validatePassword($attribute, $params)\n {\n if (!$this->hasErrors()) {\n $user = $this->getUser();\n\n if (!$user || $user->password != sha1($this->password)) {\n $this->addError($attribute, Yii::t('app', 'Incorrect username or password.'));\n }\n }\n }", "public function check_password_strength($password){\n // Validate password strength\n $uppercase = preg_match('@[A-Z]@', $password);\n $lowercase = preg_match('@[a-z]@', $password);\n $number = preg_match('@[0-9]@', $password);\n $specialChars = preg_match('@[^\\w]@', $password);\n\n if(!$uppercase || !$lowercase || !$number || !$specialChars || strlen($password) < 8) {\n $GLOBALS['error_message'] = 'Password should be at least 8 characters in length and should include at least one upper case letter, one number, and one special character.';\n return false;\n }else{\n return true;\n }\n }", "function check_password($password)\n{\n if (strlen($password) < 8) {\n throw new Exception(\"password_short.\", 1);\n return false;\n }\n if (!preg_match(\"/[0-9]{1,}/\", $password) || !preg_match(\"/[A-Z]{1,}/\", $password)) {\n throw new Exception(\"password_bad\", 1);\n return false;\n }\n return true;\n}", "public function validatePassword($password)\n {\n if ($this->password === crypt($password, 'DontTry')) {\n return true;\n }\n else {\n return false;\n }\n }", "function sanitizePassword() {\n // If there is a password confirmation we put it to the checker, too\n $passCheckerInput = (strlen($this->passwordConf) > 0) ?\n array($this->password, $this->passwordConf) : $this->password;\n $passwordChecker = new PasswordChecker($passCheckerInput);\n if ($passwordChecker->getRelevance()) {\n $this->password = htmlspecialchars($this->password);\n } else {\n die(\"Error. Check your form data\");\n }\n }", "public function validatePassword($password)\n {\n return $this->hashPassword($password) === $this->password;\n }", "public function validatePassword($password)\n {\n return $this->hashPassword($password) === $this->password;\n }", "public function validatePassword($password)\n {\n return password_verify($password, $this->pass);\n }", "public function validatePassword($password): bool\n {\n return password_verify($password, $this->password);\n }", "function valid_pass($password)\n {\n $r2 = '/[A-z]/'; //lowercase\n $r3 = '/[0-9]/'; //numbers\n $r4 = '/[~!@#$%^&*()\\-_=+{};:<,.>?]/'; // special char\n\n /*if (preg_match_all($r1, $candidate, $o) < 1) {\n $msg = \"密码必须包含至少一个大写字母,请返回修改!\";\n return FALSE;\n }*/\n if (preg_match_all($r2, $password, $o) < 1) {\n $msg = \"密码必须包含至少一个字母,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n if (preg_match_all($r3, $password, $o) < 1) {\n $msg = \"密码必须包含至少一个数字,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n /*if (preg_match_all($r4, $candidate, $o) < 1) {\n $msg = \"密码必须包含至少一个特殊符号:[~!@#$%^&*()\\-_=+{};:<,.>?],请返回修改!\";\n return FALSE;\n }*/\n if (strlen($password) < 8) {\n $msg = \"密码必须包含至少含有8个字符,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n return ['code' => 0, 'msg' => 'success'];\n }", "function validatePasswordLength(&$Model, $data, $compare) {\r\n\t\t$key = key($data);\r\n\t\t$value = $data[$key];\r\n\t\t$compare = $Model->data[$Model->alias][$this->settings[$Model->alias]['fields']['password']];\r\n\t\t$length = strlen($compare);\r\n\t\tif ($length < $this->settings[$Model->alias]['passwordPolicies'][$this->settings[$Model->alias]['passwordPolicy']]['length']) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function password()\n {\n $this->isUser();\n\n $this->data['noCabinetOrAdmin'] = true;\n\n if ($_POST) {\n\n if (!$_POST['old-password'] && !$_POST['new-password']) {\n\n $userModel = new UserModel();\n\n $validateResult = $userModel->validate($_POST);\n\n if ($validateResult === true) {\n\n $checkPassword = $userModel->checkOldPassword($_POST['old-password']);\n\n if ($checkPassword) {\n\n if ($userModel->refreshPassword($_POST)) {\n\n $this->data['success'] = 'Пароль успешно изменен';\n\n } else {\n\n $this->data['warning'] = 'Произошла ошибка';\n }\n\n } else {\n\n $this->data['warning'] = 'Старый пароль введен не правильно';\n }\n\n } else {\n\n $this->data['warning'] = $validateResult;\n }\n\n } else {\n\n $this->data['warning'] = 'Все поля должны быть заполнены';\n }\n }\n\n $this->render('password');\n }", "public function getPassword() {}", "public function provideValidatePassword()\n {\n return [\n [123456, 234567, true],\n [\"123457\", 234567, true],\n [\"12345v\", 234567, false],\n ['asdfgh', 'asdfgh', false]\n ];\n }", "public function isValid($password)\n {\n if ($this->_minLength) {\n $len = strlen($password);\n if ($len < $this->_minLength) {\n return $this->_setInvalidReason(self::REASON_TOO_SHORT, array(\n 'minimum length' => $this->_minLength,\n 'password length' => $len,\n ));\n }\n }\n if ($this->_minStrength) {\n $strength = $this->calculateStrength($password);\n if ($strength < $this->_minStrength) {\n return $this->_setInvalidReason(self::REASON_TOO_WEAK, array(\n 'minimum strength' => $this->_minStrength,\n 'password strength' => $strength,\n ));\n }\n }\n if ($this->_minEntropy) {\n $entropy = $this->calculateEntropy($password);\n if ($entropy < $this->_minEntropy) {\n return $this->_setInvalidReason(self::REASON_INSUFFICIENT_ENTROPY, array(\n 'minimum entropy' => $this->_minEntropy,\n 'password entropy' => $entropy,\n ));\n }\n }\n foreach ($this->_requiredCharValidators as $validator) {\n list ($chars, $numRequired) = $validator;\n // http://www.php.net/manual/en/function.mb-split.php#99851\n $charArr = preg_split('/(?<!^)(?!$)/u', $chars);\n str_replace($charArr, ' ', $password, $count);\n if ($count < $numRequired) {\n return $this->_setInvalidReason(self::REASON_MISSING_REQUIRED_CHARS, array(\n 'required chars' => $chars,\n 'num required' => $numRequired,\n 'num found' => $count,\n ));\n }\n }\n foreach ($this->_validators as $validator) {\n list($type, $thing) = $validator;\n if ($type === 'callable') {\n $func = $thing;\n } else {\n $func = array($thing, 'isValid');\n }\n $result = call_user_func($func, $password);\n if (! $result) {\n return $this->_setInvalidReason(self::REASON_FAILED_VALIDATOR, array(\n 'validator' => $thing,\n ));\n }\n }\n if ($this->_passwordLists) {\n $file = $this->findPassword($password);\n if ($file) {\n return $this->_setInvalidReason(self::REASON_FOUND_IN_LIST, array(\n 'list file' => $file,\n ));\n }\n }\n return true;\n }", "public function validatePassword($password)\r\n\t{\t\t\r\n return md5(md5($password).$this->ec_salt) === $this->password;\t\t\r\n\t}", "public function setPasswordcheck($password)\n {\n // Do nothing\n }", "public function validatePassword($password)\n\t{\n\t\treturn sha1($this->salt.$password)===$this->password_hash;\n\t}" ]
[ "0.7863859", "0.769698", "0.7534779", "0.73903596", "0.7386753", "0.73385555", "0.729721", "0.72783655", "0.7157424", "0.71568894", "0.71119124", "0.70852286", "0.7073094", "0.706855", "0.70403856", "0.7031329", "0.7007179", "0.70014006", "0.6987082", "0.69784933", "0.6942016", "0.6909618", "0.6885369", "0.68549573", "0.6844131", "0.68378824", "0.68307155", "0.6822213", "0.6808202", "0.67812276", "0.6777873", "0.67777073", "0.6767409", "0.6766287", "0.6758151", "0.6758151", "0.6758151", "0.6754834", "0.67350936", "0.6724942", "0.6716739", "0.67099977", "0.6703174", "0.6685911", "0.6685753", "0.66831595", "0.66746056", "0.6669286", "0.6662316", "0.6659452", "0.66584516", "0.6651509", "0.6650127", "0.66430885", "0.66139627", "0.6608701", "0.6607714", "0.6600628", "0.65946597", "0.6590917", "0.6580017", "0.6579153", "0.65758115", "0.65738374", "0.6573616", "0.6571357", "0.65588", "0.65443236", "0.6543257", "0.6538904", "0.65358174", "0.6534368", "0.6531868", "0.65269274", "0.6523349", "0.6523349", "0.6523349", "0.6522634", "0.6517276", "0.6515076", "0.6513071", "0.6509943", "0.6481748", "0.6477925", "0.647535", "0.64741015", "0.6462822", "0.6446817", "0.64463514", "0.64463514", "0.6444233", "0.6444193", "0.64337873", "0.64272434", "0.64265376", "0.6413112", "0.6406371", "0.64057463", "0.6396669", "0.63954604", "0.63931084" ]
0.0
-1
Logs in a user using the provided username and password.
public function login() { $user=$this->getUser(); $this->setScenario('normal'); if ($user && $user->failed_logins>=3) $this->setScenario('withCaptcha'); if ($this->validate()) { $user->failed_logins=0; $user->save(); return Yii::$app->user->login($user, $this->rememberMe ? 3600*24*30 : 0); } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function LogIn ($userName = '', $password = '');", "public function login($username, $password);", "public function login($userName, $password);", "function login($username, $password = null)\n {\n $f3->get('user')->copyfrom('POST');\n k($f3);\n $user = self::load(\"name = $username\");\n k($user);\n }", "public function logIntoAdmin($username, $password)\n {\n $this->getHelperCommon()->type('id=username', $username);\n $this->getHelperCommon()->type('id=login', $password);\n $this->getHelperCommon()->getElement($this->getLoginForm())->submit();\n }", "public function logIntoAdmin($username, $password)\n {\n $this->getHelperCommon()->type('id=username', $username);\n $this->getHelperCommon()->type('id=login', $password);\n $this->getHelperCommon()->getElement($this->getLoginForm())->submit();\n }", "public function it_logs_in_the_user()\n {\n $user = factory(User::class)->create([\n 'password' => '123123',\n ]);\n\n $this->browse(function ($browser) use ($user) {\n $browser->visit(new Login)\n ->type('@email', $user->email)\n ->type('@password', '123123')\n ->click('@submit')\n ->assertPathIs('/app');\n });\n }", "public function login ( $username, $password ) { return $this->server->login( $username, $password ); }", "public function login($user, $pass, $persistent);", "public function login($name, $password);", "public function login()\n\t{\n\t\t//Compute the hash code of the password submited by user\n\t\t$user_password_hash = $this->passwordEncrypt($this->user_info['user_password']);\n\t\t\n\t\t//Do datebase query to get the hash code of the password\n\t\t$db = BFL_Database :: getInstance();\n\t\t$stmt = $db->factory('select `user_id`,`user_password` from '.DB_TABLE_USER.' WHERE `user_name` = :user_name');\n\t\t$stmt->bindParam(':user_name', $this->user_info['user_name']);\n\t\t$stmt->execute();\n\t\t$rs = $stmt->fetch();\n\t\tif (empty($rs))\n\t\t\tthrow new MDL_Exception_User_Passport('user_name');\n\t\t\n\t\tif ($rs['user_password'] != $user_password_hash)\n\t\t\tthrow new MDL_Exception_User_Passport('user_password');\n\n\t\t//Set user session\n\t\t$auth = BFL_ACL :: getInstance();\n\t\t$auth->setUserID($rs['user_id']);\n\t}", "public static function attempt($username, $password)\n {\n $auth = new Log();\n\n if ($username == 'guest' && password_verify('password', self::$pass)){\n $_SESSION[\"LOGGED_IN_USER\"] = $username;\n // Use the Log class to log an info message: \"User $username logged in.\"\n $auth -> info(\"$username logged in.\");\n } else {\n echo \"Login Failed.\";\n //If username or password are incorrect, log an error: \"User $username failed to log in!\".\n $auth->error(\"Incorrect username or password; failed to log in\");\n }\n }", "public static function logIn($username, $password)\n {\n // Load the user from the database\n $user = User::loadByCredentials($username, $password);\n if ($user) {\n // Valid credentials\n self::startSession();\n // Store the user in the session, but without the password\n $_SESSION['user'] = $user;\n return true;\n } else {\n // Invalid credentials, login fail\n return false;\n }\n }", "public function login($username) {\n $this->username = $username;\n }", "public function loginUser()\n {\n $request = new Request();\n\n $email = $request->input('email');\n $password = $request->input('password');\n\n // Check email\n if (!$email) {\n $this->showLoginForm(['Please enter email']);\n }\n // Check password\n if (!$password) {\n $this->showLoginForm(['Please enter password']);\n }\n\n // Check user exist and then password\n $user = $this->getUser($email);\n $password = md5($password);\n if (!$user || $password !== $user['password']) {\n $this->showLoginForm(['Error on login']);\n }\n\n // Save login details to cookies\n if (!defined('APP_USERS_COOKIES_EMAIL')\n || !defined('APP_USERS_COOKIES_PASSWORD')) {\n $this->showLoginForm(['Error on login']);\n }\n setcookie(APP_USERS_COOKIES_EMAIL, $email);\n setcookie(APP_USERS_COOKIES_PASSWORD, $password);\n\n // Redirect to endpoint\n header(\"Location: \" . self::ENDPOINTS['success_login']);\n }", "final public function login($username, $password)\n {\n $this->username = $username;\n $this->password = $password;\n\n return $this->doLogin($username, $password);\n }", "public function login($username, $password)\n {\n $mysqlQuery = new mysqlQuery();\n $user = $mysqlQuery->sqlQuery(\"SELECT username, password FROM users WHERE username='\".$username.\"'\");\n $path = __DIR__ . '/../Service/PasswordService.php';\n //require($path);\n if (!function_exists('hash_equals')) {\n function hash_equals($str1, $str2)\n {\n if (strlen($str1) != strlen($str2)) {\n return false;\n } else {\n $res = $str1 ^ $str2;\n $ret = 0;\n for ($i = strlen($res) - 1; $i >= 0; $i--) {\n $ret |= ord($res[$i]);\n }\n return !$ret;\n }\n }\n }\n if ($user != [] && hash_equals($user['0']['password'], crypt($password, $user['0']['password']))) {\n if (!isset($_SESSION)) {\n session_start();\n }\n $_SESSION['auth'] = $user['0']['username'];\n } else {\n $DefaultController = new DefaultController();\n die($DefaultController->error(403));\n }\n }", "public function login() {\r\n if (!empty($_POST)) {\r\n $username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING);\r\n $password = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);\r\n\r\n $hash = hash('sha512', $password . Configuration::USER_SALT);\r\n unset($password);\r\n\r\n $user = UserModel::getByUsernameAndPasswordHash($username, $hash);\r\n unset($hash);\r\n\r\n if ($user) {\r\n Session::set('user_id', $user->user_id);\r\n Session::set('username', $username);\r\n Session::set('ip', filter_input(INPUT_SERVER, 'REMOTE_ADDR'));\r\n Session::set('ua', filter_input(INPUT_SERVER, 'HTTP_USER_AGENT', FILTER_SANITIZE_STRING));\r\n\r\n Misc::redirect('');\r\n } else {\r\n $this->set('message', 'Nisu dobri login parametri.');\r\n sleep(1);\r\n }\r\n }\r\n }", "public function login($username, $password)\r\n\t{\r\n\t\t// Make sure we have something to work with\r\n\t\tif(!strlen($username) || !strlen($password)) return $this->user = false;\r\n\t\t\r\n\t\t// Check who the user is and if the password is right\r\n\t\t$username = mysql_real_escape_string($username);\r\n\t\t$password = hash(HASH_ALGO, $password . $username);\r\n\t\t$query = 'SELECT id,username,userlevel,email,realname,country,linkedin_id,linkedin_url FROM users WHERE username=\"' . $username\r\n\t\t\t\t\t. '\" AND password=\"' . $password . '\" LIMIT 1';\r\n\t\t$res = mysql_query($query) or die('Bad SQL Query on login attempt');\r\n\t\t$res = mysql_fetch_array($res);\r\n\t\tif($res === false) return $this->user = false;\r\n\r\n\t\t// Credentials OK. Approve the login.\r\n\t\t$this->user = new User();\r\n\t\t$this->user->id = $res['id'];\r\n\t\t$this->user->username = $res['username'];\r\n\t\t$this->user->email = $res['email'];\r\n\t\t$this->user->userlevel = $res['userlevel'];\r\n\t\t$this->user->realname = $res['realname'];\r\n\t\t$this->user->country = $res['country'];\r\n\t\t$this->user->linkedin_id = $res['linkedin_id'];\r\n\t\t$this->user->linkedin_url = $res['linkedin_url'];\r\n\t\t\r\n\t\t$query = 'UPDATE users SET fingerprint=\"' . genPrint() . '\" WHERE id=' . $this->user->id . ' LIMIT 1';\r\n\t\t$res = mysql_query($query) or die('Bad SQL Query on login approval');\r\n\t\tsetcookie('qw_login', $this->user->id, time()+60*60*24*365, '/');\r\n\t\treturn true;\r\n\t}", "function login() {\n\n $this->visitPath('/user/login');\n\n $loginForm = $this->getSession()->getPage()->findById('user-login-form');\n if (is_null($loginForm)) {\n throw new ExpectationException('Cannot find the login form.', $this->getSession()->getDriver());\n }\n\n $usernameField = $loginForm->findById('edit-name');\n $passwdField = $loginForm->findById('edit-pass');\n\n if (is_null($usernameField) or is_null($passwdField)) {\n throw new ExpectationException('Cannot find the authentication fields.', $this->getSession()->getDriver());\n }\n\n $usernameField->setValue($this->admin_username);\n $passwdField->setValue($this->admin_passwd);\n $loginForm->submit();\n\n $this->assertSession()->elementNotExists('css', '.messages--error');\n }", "private function _logUserIn($inputs)\n\t{\n\t\tCraft::log('Logging in user.');\n\n\t\tif (craft()->userSession->login($inputs['username'], $inputs['password']))\n\t\t{\n\t\t\tCraft::log('User logged in successfully.');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCraft::log('Could not log the user in.', LogLevel::Warning);\n\t\t}\n\t}", "public function log_in() {\n\n // Check if the user exists on the database\n if (!$this->does_exist('username')) {\n return \"Username does not exist\";\n }\n\n $user = User::find($this->username, 'username');\n\n // If password matches\n if ($user->password !== $this->password) {\n return \"Sorry, password does not match\";\n }\n\n return true;\n }", "private function doLogin($username, $password, $asAdmin=false){\n\t\t\tif(is_string($username) === false){\n\t\t\t\tthrow new InvalidArgumentException('Username must be string.');\n\t\t\t}else if(trim($username) === ''){\n\t\t\t\tthrow new InvalidArgumentException('Username was an empty string');\n\t\t\t}else if(is_string($password) === false){\n\t\t\t\tthrow new InvalidArgumentException('Password must be a string');\n\t\t\t}else if(trim($password) === ''){\n\t\t\t\tthrow new InvalidArgumentException('Password was an empty string');\n\t\t\t}\n\t\t\t$password = '$1$' . md5($password); // this is required so we don't have to transmit the plaintext password.\n\t\t\t$result = $this->makeCallToAPI($asAdmin ? 'AdminLogin' : 'Login', false, array('Name' => $username, 'Password' => $password), array(\n\t\t\t\t'Verified' => array('boolean'=>array())\n\t\t\t));\n\t\t\tif($result->Verified === false){\n\t\t\t\tthrow new InvalidArgumentException('Credentials incorrect');\n\t\t\t}else if(isset($result->UUID, $result->FirstName, $result->LastName) === false){\n\t\t\t\tthrow new UnexpectedValueException('API call was made, credentials were correct but required response properties were missing');\n\t\t\t}\n\t\t\treturn WebUI\\genUser::r($result->UUID, $result->FirstName, $result->LastName); // we're leaving validation up to the genUser class.\n\t\t}", "public static function login($usuario, $password = false);", "public function login($username=null, $password=null) {\r\n\t\t$this->logout();\r\n\t\tif (!$user_id = $this->getuid($username)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$users = $this->search(array(\r\n\t\t\t'user_id'\t=> $user_id,\r\n\t\t\t'password'\t=> $password\r\n\t\t));\r\n\t\tif (count($users) > 0) {\r\n\t\t\t$user = $users[0];\r\n\t\t\t\r\n\t\t\t$this->get_rolls($user->user_id);\r\n\t\t\t// get auth id\r\n\t\t\t$this->update(array(\r\n\t\t\t\t'username'\t\t=> $user->username,\r\n\t\t\t\t'last_access'\t=> date('Y-m-d H:i:s'),\r\n\t\t\t\t'last_ip'\t\t=> $this->get_ip_address()\r\n\t\t\t));\t\r\n\t\t\t$session_value = $this->mk_session_value(array(\r\n\t\t\t\t$user->user_id,\r\n\t\t\t\t$user->username,\r\n\t\t\t\t$user->email\r\n\t\t\t));\r\n\t\t\t// set session entry\r\n\t\t\t$this->session->set_userdata($this->sess_login_key, $session_value);\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\t$this->logout();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function signInAction()\n {\n $userData = $this->manager->findOneBy(['username' => $this->httpParameters['login']]);\n\n //If no user were found, redirects\n if(empty($userData))\n {\n $this->response->redirect('/auth',HttpResponse::WRONG_LOGIN);\n }\n\n //Instantiates the user\n $user = new User($userData);\n\n //Checks if typed password matches user's password\n if($this->passwordMatch($this->httpParameters['loginPassword'],$user,'/auth'))\n {\n //Sets the user instance as a the new $_SESSION['user']\n $_SESSION['user'] = $user;\n\n $this->response->redirect('/admin');\n }\n }", "public function login($username, $password, $token);", "public function login($username=null,$mail=null,$pwd=null){\n\t}", "public function login()\n {\n //$this->username = $username; // we are gonnna use the above property: $username here\n //$this->password = $password;\n // we want to call authuser from within login so\n $this->auth_user(); // we don't need to pass any arguments here because we know the class properties above this line\n\n }", "public static function login($username, $password) {\n $user = Auth::getUser($username);\n\n if(empty($user)) {\n return Helper::throwError(['username' => 'This user does not exist']);\n }\n\n $user = $user[0];\n\n $check = Hash::check($password, $user['password']);\n\n if(!$check) {\n return Helper::throwError(['password' => 'Invalid Password']);\n }\n\n // This user is legit bro\n unset($user['password']);\n Session::put('user', $user);\n return ['status' => 1, 'message' => 'User successfully logged in', 'user_id' => $user['id']];\n }", "function login($username, $password)\n {\n $andWhere = array();\n $andWhere[] = $this->table->where('lower(username) = ?', strtolower($username));\n $andWhere[] = $this->table->where('active = ?', 1);\n\n $recordset = $this->table->select('username, password',\n $this->table->andWhereArray($andWhere));\n\n if (!$recordset) return false;\n\n if ($this->validatePassword($password, $recordset[0]['password'])) {\n $user = $this->getUserByUsername($recordset[0]['username']);\n\n $_SESSION['MFW_authenticated_user'] = $user;\n\n return true;\n }\n\n return false;\n }", "public function login(string $email, string $password);", "public static function login(string $username, string $password, string $server, ?string $cwd = null)\n {\n self::runCommand(sprintf('login --username %s --password %s %s', $username, $password, $server), $cwd);\n }", "public function login_user() {\n\n // Grab the username and password from the form POST\n $username = $this->input->post('username');\n $pass = $this->input->post('password');\n\n //Ensure values exist for username and pass, and validate the user's credentials\n if( $username && $pass && $this->validate_user($username,$pass)) {\n // If the user is valid, redirect to the main view\n redirect(base_url());\n } else {\n // Otherwise show the login screen with an error message.\n $this->show_login(true);\n }\n }", "public function login() {\n\t\tif(!empty(Session::get('http_response'))) {\n\t\t\thttp_response_code(Session::get('http_response'));\n\t\t\tSession::delete('http_response');\n\t\t}\n\t\tif($_POST && isset($_POST['login']) && isset($_POST['password'])) {\n\t\t\t$user = $this->_model->getLogin(strtolower($_POST['login']));\n\t\t\tif($user && $user->enabled) {\n\t\t\t\tif(hash_equals($user->password,crypt($_POST['password'],$user->password))) {\n\t\t\t\t\tif($user->blocked) {\n\t\t\t\t\t\thttp_response_code(403);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is blocked\"));\n\t\t\t\t\t} elseif($user->verified) {\n\t\t\t\t\t\tSession::set('user',$user);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'success','icon'=>'check','text'=>\"User has logged in successfully\"));\n\t\t\t\t\t\t$redirect = Session::get('login_redirect');\n\t\t\t\t\t\tRouter::redirect(Session::get('login_redirect'));\n\t\t\t\t\t} else {\n\t\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is not yet confirmed\"));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thttp_response_code(401);\n\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t}\t\n\t\t}\n\t}", "public function login($username, $password) {\n return $this->send($this->to_single(\n parent::login($username, $password),\n 'loginReturn'));\n }", "public function actionLogin() {\n\t\tif (Yii::app()->user->isGuest) {\n\t\t\t$userLogin = new UserLogin;\n\t\t\t$this->performAjaxValidation($userLogin, 'login-user-form');\n\t\t\t// collect user input data\n\t\t\tif (isset($_POST['UserLogin'])) {\n\t\t\t\t$userLogin->attributes = $_POST['UserLogin'];\n\t\t\t\t// validate that the username and password are valid\n\t\t\t\tif ($userLogin->login()) {\n\t\t\t\t\t$this->redirect(Yii::app()->user->returnUrl);\n\t\t\t\t}else{\n\t\t\t\t\t// check domain\n\t\t\t\t\tif($userLogin->isValidButWrongDomain()){\n\t\t\t\t\t\t$this->transferToDomain($userLogin->getUserIdentity());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// display the login form\n\t\t\t$this->render('login', array('model' => $userLogin));\n\t\t} else {\n\t\t\t$this->redirect(Yii::app()->user->returnUrl);\n\t\t}\n\t}", "public function login( $login, $password ) {\r\n\t\t\t$this->setUserEntity( new UserEntity( $login, $password ) );\r\n\t\t\t$this->reconstruct( $password );\r\n\t\t}", "function user_action_login($env, $vars) {\n $username = array_pop($vars['data']['username']);\n // We allow also using email for logging in.\n if (valid_email($username)) {\n $username = UserFactory::getUserFromField($env, 'email', $username);\n }\n\n // Initialize an user object.\n $tmp_user = new User($env, $username);\n // Attempt to log in the user.\n $login = $tmp_user->logIn(array_pop($vars['data']['password']));\n exit($login);\n}", "public function Login($username, $password){\n\t\t\treturn $this->doLogin($username, $password);\n\t\t}", "public function loginUser($username, $password){\n\t\t$loginResult = $this->db->loginUser($username, $password);\n\t\tif($loginResult == true){\n\t\t\t$_SESSION[self::$session] = $username;\n\t\t}\n\t\t\n\t\treturn $loginResult;\t\n\t}", "protected function login($username, $password)\n {\n $this->app->boot();\n $input = array(\n 'username' => $username,\n 'email' => $username,\n 'password' => $password,\n );\n\n $user = \\App\\Core\\Models\\User::oldLogin($input['username'], $input['password']);\n if ($user || Confide::logAttempt($input, Config::get('confide::signup_confirm'))) {\n return Confide::user();\n }\n\n return false;\n }", "public function login (){\n\t\t$user = $this->get_by(array(\n\t\t\t'email' => $this->input->post('email'),\n\t\t\t'password' => $this->hash($this->input->post('password')),\n\t\t\t), TRUE);\n\t\t\n\t\tif (count($user)) {\n\t\t\t// Log in user\n\t\t\t$data = array(\n\t\t\t\t'username' => $user->username,\n\t\t\t\t'email' => $user->email,\n\t\t\t\t'id' => $user->id,\n\t\t\t\t'loggedin' => TRUE,\n\t\t\t);\n\t\t\t$this->session->set_userdata($data);\n\t\t}\n\t\t}", "public function loginUser($username, $password, $params = array())\n\t{\n\t\t$credentials = array(\n\t\t\t'username'\t=> $username,\n\t\t\t'password'\t=> $password,\n\t\t);\n\n\t\t$result = \\JFactory::getApplication()->login($credentials, $params);\n\n\t\tif (is_object($result) && ($result instanceof \\JError))\n\t\t{\n\t\t\tthrow new \\Exception($result->getError(), 403);\n\t\t}\n\t}", "public function login($username,$password){\n $data = '{\"device_id\":\"'.$this->device_id.'\",\"guid\":\"'.$this->guid.'\",\"username\":\"'.$username.'\",\"password\":\"'.$password.'\",\"Content-Type\":\"application/x-www-form-urlencoded; charset=UTF-8\"}';\n $sig = $this->generateSignature($data,$this->secret);\n $data = 'signed_body='.$sig.'.'.urlencode($data).'&ig_sig_key_version=6';\n $login = $this->sendRequest('accounts/login/', true, $data, $this->agent, false);\n if(is_array($login) && count($login)==2 && $login[0] == 200 && is_object(json_decode($login[1]))){\n $account = json_decode($login[1]);\n return $account->logged_in_user;\n }else{\n $error = json_decode($login[1]);\n $this->log($error);\n }\n }", "public function do_login()\n {\n $this->userObject = new User();\n\n // grab the uID of the person signing in\n $uid = $this->userObject->checkUser($_POST['user_email'], $_POST['user_password']);\n\n // if the uID exists\n if ($uid) {\n\n $this->set('message', 'You logged in!');\n\n // grab the array of user-data from the database\n $user = $this->userObject->getUser($uid);\n\n // leave out the password\n unset($user['password']);\n unset($user[4]);\n\n // if (strlen($_SESSION['redirect']i) > 0) { // basically, if someone types in the url with the funciton after,\n // // supposed to redirect people to the pages they want.\n // $view = $_SESSION['redirect'];\n // unset($_SESSION['redirect']);\n // header('Location: ' . BASE_URL . $view);\n\n // make the SESSION key 'user' and set it equal to the aray of user-data\n $_SESSION['user'] = $user;\n\n header('Location: /index.php/');\n\n } else {\n\n $this->set('error', 'Sorry! Looks like something might be messed up with your Username or Password! :p');\n }\n }", "private function login() {\n //Look for this username in the database\n $params = array($this->auth_username);\n $sql = \"SELECT id, password, salt \n FROM user \n WHERE username = ? \n AND deleted = 0\";\n //If there is a User with this name\n if ($row = $this->db->fetch_array($sql, $params)) {\n //And if password matches\n if (password_verify($this->auth_password.$row[0] ['salt'], $row[0] ['password'])) {\n $params = array(\n session_id(), //Session ID\n $row[0] ['id'], //User ID\n self::ISLOGGEDIN, //Login Status\n time() //Timestamp for last action\n );\n $sql = \"INSERT INTO user_session (session_id, user_id, logged_in, last_action) \n VALUES (?,?,?,?)\";\n $this->db->query($sql, $params);\n header('Location: ' . $_SERVER['HTTP_REFERER']);\n //User now officially logged in\n }\n //If password doesn't match\n else {\n //Send user back to login with error\n $this->login_form(self::ERR_NOUSERFOUND);\n }\n }\n //If there isn't a User with this name\n else {\n //Send user back to login with error\n $this->login_form(self::ERR_NOUSERFOUND);\n }\n }", "public function login($username, $password){\n\t\t\n\t\t$sql = \"\n\t\t\tSELECT \n\t\t\t\taccount.id as account_id,\t\t\t\t \n\t\t\t\taccount.password as password\n\t\t\tFROM account\t\t\t\n\t\t\tWHERE username = :username\n\t\t\";\n\t\t/*echo $sql;\n\t\t//prepare\n\t\t$stmt = $this->db->prepare($sql);\n\t\t//execute\n\t\t$stmt->execute(['username'=>$username]);\n\t\t//feth the executed code this should only return an associative array because we are using :FETCH_ASSOC.\n\t\t$result = $stmt->fetch(PDO::FETCH_ASSOC); */\n\n\t\t\t$result = $this->executeQuery('select', $sql, ['username'=>$username]);\n\t\t\tprint_r($result);\n\n\n\t\t//CHECK IF $result is an array\n\t\tif(is_array($result)){\n\t\t\t\n\t\t\tif(count($result) > 0){\n\t\t\t\t\n\t\t\t\t$hashed_password = $result['password'];\n\t\t\t\tvar_dump( password_verify($password, $hashed_password));\n\n\t\t\t\t// verify if user exists and that given password is the same as the hashed password.\n\t\t\t\tif($username && password_verify($password, $hashed_password)){\n\t\t\t\t\t\n\t\t\t\t\t//start the session\n\t\t\t\t\tsession_start();\n\n\t\t\t\t\t//store the userdata in session variable\n\t\t\t\t\t$_SESSION['account_id'] = $result['account_id'];\n\t\t\t\t\t$_SESSION['username'] = $username;\n\t\t\t\t\t$_SESSION['loggedin'] = true;\n\n\t\t\t\t\t//after the user will be logged in this page will show \n\t\t\t\t\theader(\"location: welcome.php\");\t\t\t\t\t\t\n\t\t\t\t\texit;\n\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\treturn \"Incorrect username and/or password. Please change your input and try again.\";\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t// no matching user found in db. Make sure not to tell the user directly.\n\t\t\treturn \"Failed to login. Please try again\";\n\t\t}\n\t}", "public function login()\n {\n $username = $this->getAttribute('username');\n\n $this->_user = $this->db->select(Db::TABLE_USER, array(\n 'username' => $username,\n 'password' => UserAuth::hash(\n $this->getAttribute('password')\n ),\n ));\n\n if(!empty($this->_user)) {\n\n $identity = new UserAuth();\n $identity->login($username);\n\n return true;\n } else {\n $this->addError('password','Incorrect username or password');\n }\n\n return false;\n }", "public function login(string $username, $password)\n {\n return Auth::attempt([\"user_pickname\" => $username, \"password\" => $password]);\n }", "public function log_in()\n\t{\n\t\tif( isset( $_POST['user_login'] ) && wp_verify_nonce( $_POST['login_nonce'], 'login-nonce') ) \n\t\t{\n\t\t\t/** Error when no password enter */\n\t\t\tif( ! isset( $_POST['user_pass']) || $_POST['user_pass'] == '') {\n\t\t\t\t$this->system_message['error'][] = __('Please enter a password');\n\t\t\t\treturn false;\n\t\t\t}\n\t \t\t\n\t\t\t// this returns the user ID and other info from the user name\n\t\t\t$user = get_user_by('login', $_POST['user_login'] );\n \n\t\t\tif( ! $user ) \n\t\t\t{\t\t\t\t\n\t\t\t\t$this->system_message['error'][] = __('Invalid ID or password');\n\t\t\t\treturn false;\n\t\t\t}\n\t \n\t\t\t// check the user's login with their password\n\t\t\tif( ! wp_check_password( $_POST['user_pass'], $user->user_pass, $user->ID) ) {\n\t\t\t\t// if the password is incorrect for the specified user\n\t\t\t\t$this->system_message['error'][] = __('Invalid ID or password');\n\t\t\t}\n\t \n\t\t\t// only log the user in if there are no errors\n\t\t\tif( empty( $this->system_message['error'] )) \n\t\t\t{\n\t\t\t\twp_set_auth_cookie( $user->ID, false, true );\n\t\t\t\twp_set_current_user( $user->ID );\t\n\t\t\t\tdo_action('wp_login', $_POST['user_login']);\n\t \n\t\t\t\twp_redirect( home_url() ); exit;\n\t\t\t}\n\t\t}\n\t}", "function user_login ($username, $password) {\n global $CFG, $DB;\n\t$program = $this->config->program;\n\t$handle = popen($program, 'w');\n\tfwrite($handle, \"$username\\n$password\\n\");\n\tfflush($handle);\n\t$result = pclose($handle);\n return $result == 0;\n }", "public function doLogin()\r\n {\r\n $input = Request::all();\r\n \r\n if (Auth::attempt(['username' => $input['email'], 'password' => $input['password'], 'deleted_at' => null, 'user_type' => 1]))\r\n {\r\n \r\n $user = Auth::user();\r\n Session::set('current_user_id',$user->id);\r\n return Redirect::intended('/dashboard');\r\n }\r\n else { \r\n Session::flash(\r\n 'systemMessages', ['error' => Lang::get('pages.login.errors.wrong_credentials')]\r\n );\r\n return Redirect::action('UserController@login')\r\n ->withInput(Request::except('password'));\r\n }\r\n }", "function login_user( $user, $password )\n {\n //Unimplemented\n }", "public function loginUser($userID, $username) {\r\n\t\t$this->coreAuthenticationFactory->loginUser ( $userID, $username );\r\n\t}", "public function login($_username, $_password)\n {\n $this->m_username = $_username;\n $this->m_password = $_password;\n }", "function login($userName, $password)\n{\n\tif (!is_string($userName) or !is_string($password)) {\n\t\tthrow new AuthException(\"Invalid username or password.\");\n\t}\n\n\t$user = $this->getUser($userName);\n\n\t$result = 'LOGIN_OK';\n\n\tif (!$user) $result = 'User does not exists!';\n\telse {\n\t\tif (!$user->isValid()) $result = 'Invalid user!';\n\t\tif (!$user->passwordVerify($password)) $result = 'Invalid password!';\t\n\t}\n\t\n\tif ($result == 'LOGIN_OK') {\n\t\t$this->setLoggedUser($user);\n\t\t$user->values['IP'] = $this->getUserIp($user);\n\t\t$user->values['LAST_LOGIN'] = date('Y-m-d H:i:s');\n\t\t$this->getStorage()->setUser($user);\n\t\t$this->onAfterLogin($user);\n\t}\n\telse {\n\t\t$this->setError($result);\n\t\tif ($user) {\n\t\t\t$this->log('AUTH_NOTICE', $result, null, $user->values['ID']);\n\t\t}\n\t\telse {\n\t\t\t$this->log('AUTH_NOTICE', $result, \"Failed login of user '$userName'\");\n\t\t}\n\t}\n\n\treturn ($result == 'LOGIN_OK');\n}", "function user_login($username,$password,$redirect='/'){\n\t$app = \\Jolt\\Jolt::getInstance();\n\t$user = $app->db->findOne('user', array('login'=>$username) );\n\tif( $user['pass'] == passhash($password) ){\n\t\t$app->store( \"user\",$user['_id'] );\n\t\t$app->redirect( $redirect );\n\t}else{\n\t\t$app->redirect( $app->getBaseUri().'/login');\n\t}\n\n}", "public function login()\n {\n\t\t$login = Input::get('login');\n\t\t$password = Input::get('password');\n\t\ttry{\n\t\t\n\t\t\t$user = Auth::authenticate([\n\t\t\t\t'login' => $login,\n\t\t\t\t'password' => $password\n\t\t\t]);\n\t\t\t$this->setToken($user);\n\t\t\treturn $this->sendResponse('You are now logged in');\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\treturn $this->sendResponse($e->getMessage());\n\t\t}\n }", "function login($username, $password) {\n $user_exists = DAO_user::DAO_user_exists($username);\n if (!$user_exists) return -1;\n $password = md5($password);\n $logged = DAO_user::DAO_login($username, $password);\n if ($logged != -1) return $logged;\n else return -2;\n }", "public function login($username, $password){\n \n //build query to find all users\n $sql = \"SELECT * FROM users WHERE username = '$username' \";\n \n //run query to find specific user\n if ($result = $this->db->queryRow($sql) ){\n if ($result['password'] == $password ){\n $_SESSION['username'] = $username;\n $_SESSION['loggedIn'] = true;\n } \n else{\n $result = false;\n }\n \n }\n return $result;\n }", "public function loginAction() {\n\n\n $login = $this->getRequest()->getPost();\n if (!isset($login['username']) || !isset($login['password'])) {\n return $this->showMsg(-1, '用户名或者密码不能为空.');\n }\n\n\n $ret = Admin_Service_User::login($login['username'], $login['password']);\n\n\n if (Common::isError($ret)) return $this->showMsg($ret['code'], $ret['msg']);\n if (!$ret) $this->showMsg(-1, '登录失败.');\n $this->redirect('/Admin/Index/index');\n }", "public function login()\n\t{\n\t\t$mtg_login_failed = I18n::__('mtg_login_failed');\n\t\tR::selectDatabase('oxid');\n\t\t$sql = 'SELECT oxid, oxfname, oxlname FROM oxuser WHERE oxusername = ? AND oxactive = 1 AND oxpassword = MD5(CONCAT(?, UNHEX(oxpasssalt)))';\n\t\t$users = R::getAll($sql, array(\n\t\t\tFlight::request()->data->uname,\n\t\t\tFlight::request()->data->pw\n\t\t));\n\t\tR::selectDatabase('default');//before doing session stuff we have to return to db\n\t\tif ( ! empty($users) && count($users) == 1) {\n\t\t\t$_SESSION['oxuser'] = array(\n\t\t\t\t'id' => $users[0]['oxid'],\n\t\t\t\t'name' => $users[0]['oxfname'].' '.$users[0]['oxlname']\n\t\t\t);\n\t\t} else {\n\t\t\t$_SESSION['msg'] = $mtg_login_failed;\n\t\t}\n\t\t$this->redirect(Flight::request()->data->goto, true);\n\t}", "function loginUser($username,$password,$return=true);", "public static function login($username, $password)\r\n {\r\n\t\t//\\Config::load('db', true);\r\n\t\t//$active_db = \\Config::get('db.active');\r\n\t\t//print_r($active_db); \r\n\t\t$call_to_db = \\quotes\\Model_Quote::get_nmi_section($username, $password);exit;\r\n\t\t$sql\t=\t\"SELECT EM1_Username, EM1_EmployeeID_pk from t_Employee1, EM1_Password where EM1_Username = ? and EM1_Password = ?\";\r\n $sql = \\NMI::Db()->prepare($sql);\r\n\t\tprint_r($sql);log::error($sql); \r\n\t\t\r\n $stmt->execute(array($username,$password));\r\n $meta = $stmt->fetch();\r\n print_r($meta);exit;\r\n foreach ($meta as $u)\r\n {\r\n $user_id = $u['EM1_EmployeeID_pk'];\r\n $user_name = $u['EM1_Username'];\r\n\t\t $password = $u['EM1_Password'];\r\n }\r\n\t\t\r\n \\Session::set('user_id', $user_id);\r\n\t\t\\Session::set('username', $username);\r\n\t\t\\Session::set('password', $password);\r\n\t\t\\Session::set('authed', 'validated');\r\n\t\t\r\n\t\tif(count($user>0)){return 1;}else{return 0;}\r\n }", "public function login() {\n $this->db->sql = 'SELECT * FROM '.$this->db->dbTbl['users'].' WHERE username = :username LIMIT 1';\n\n $user = $this->db->fetch(array(\n ':username' => $this->getData('un')\n ));\n\n if($user['hash'] === $this->hashPw($user['salt'], $this->getData('pw'))) {\n $this->sessionId = md5($user['id']);\n $_SESSION['user'] = $user['username'];\n $_SESSION['valid'] = true;\n $this->output = array(\n 'success' => true,\n 'sKey' => $this->sessionId\n );\n } else {\n $this->logout();\n $this->output = array(\n 'success' => false,\n 'key' => 'WfzBq'\n );\n }\n\n $this->renderOutput();\n }", "function login() {\n\t\tif (isset($_REQUEST['username']) && !empty($_REQUEST['username'])) {\n\t\t\t$username = $_REQUEST['username'];\n\n\t\t\t$userDAO = implementationUserDAO_Dummy::getInstance();\n\t\t\t$users = $userDAO->getUsers();\n\n\t\t\tforeach ($users as $key => $user) {\n\t\t\t\tif ($user->getUsername() === $username) {\n\t\t\t\t\t$userFound = $user;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($userFound) && $userFound != null) {\n\n\t\t\t\tif (isset($_REQUEST['password']) && !empty($_REQUEST['password'])) {\n\t\t\t\t\t$password = $_REQUEST['password'];\n\n\t\t\t\t\tif ($userFound->getPassword() === $password) {\n\n\t\t\t\t\t\tsession_start();\n\t\t\t\t\t\t$_SESSION['USERNAME']= $username;\n\n\t\t\t\t\t\t$url = getPreviousUrl();\n\t\t\t\t\t\t$newUrl = substr($url, 0, strpos($url, \"?\"));\n\n\t\t\t\t\t\tredirectToUrl($newUrl);\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\t// redirecting to login with bad password alert\n\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t\t}\n\t\t}\n\n\t\telse {\n\t\t\t// redirecting to login page with bad username alert\n\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t}\n\n\n\t}", "public function doLogin()\n\t{\n $userData = array(\n 'username' => \\Input::get('username'),\n 'password' => \\Input::get('password'),\n );\n\t\t\n\t\t$rememberMe = \\Input::get('remember-me');\n\t\t\n // Declare the rules for the form validation.\n $rules = array(\n 'username' => 'Required',\n 'password' => 'Required'\n );\n\n // Validate the inputs.\n $validator = \\Validator::make($userData, $rules);\n\n // Check if the form validates with success.\n if ($validator->passes())\n {\n // Try to log the user in.\n if (\\Auth::attempt($userData, (bool)$rememberMe))\n {\n // Redirect to dashboard\n\t\t\t\treturn \\Redirect::intended(route('dashboard'));\n }\n else\n {\n // Redirect to the login page.\n return \\Redirect::route('login')->withErrors(array('password' => \\Lang::get('site.password-incorrect')))->withInput(\\Input::except('password'));\n }\n }\n\n // Something went wrong.\n return \\Redirect::route('login')->withErrors($validator)->withInput(\\Input::except('password'));\n\t}", "public function login($username, $password)\n\t{\n $password = md5($username . $password); // THIS IS NOT SECURE. DO NOT USE IN PRODUCTION.\n $sql = 'SELECT * FROM user WHERE username = ? AND password = ? LIMIT 1';\n $user = $this->db->execute($sql, [$username, $password]);\n if(count($user) > 0) {\n return $this->db->fetchOne($sql, [$username, $password]); \n }\n\t}", "protected function login( )\r\n {\r\n $this->sendData( 'USER', $this->_nick, $this->_nick . ' ' . $this->_user . ' : ' . $this->_realName );\r\n \r\n $this->sendData( 'NICK', $this->_nick );\r\n \r\n $this->_loggedOn = true;\r\n }", "public static function login($username, $password)\n {\n $user = User::findByUsername($username);\n if (password_verify($password, $user->getPassword())) {\n if (password_needs_rehash($user->password, PASSWORD_DEFAULT)) {\n $user->password = password_hash($password, PASSWORD_DEFAULT);\n $user->update();\n }\n $_SESSION['user'] = $user;\n return true;\n } else {\n return false;\n }\n }", "public function login($username, $password) {\n\t\t\t$user = $this->dao->findUserByUsername($username);\n\t if ($user === FALSE) {\n\t\t\t\t$_POST['error'] = TRUE;\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t // Check if user made more than 3 consecutive invalid login attempts\n\t\t if (($user->getInvalidLoginAttempts() > 3)\n\t\t\t // Check if 5 minutes has passed since last attempt in case of user lock out\n\t\t\t && (($user->getLastLoginAttemptTime() + 60*5) < date(\"Y-m-d H:i:s\") )) {\n\t\t\t\t\t$_POST['locked'] = TRUE;\n\t\t\t \treturn FALSE;\n\t\t }\n\n\t\t\t// Check database for matching password\n\t $hash = $user->getPassword();\n\t if (password_verify($password, $hash) === FALSE) {\n\t\t\t\t// Failed authentication, increment attempts and update user's lastLoginAttemptTime\n\t\t\t\t$attempts = $user->getInvalidLoginAttempts();\n\t\t\t\t$user->setInvalidLoginAttempts($attempts+1);\n $user->setLastLoginAttemptTime(date(\"Y-m-d H:i:s\"));\n\t\t\t\t$this->dao->updateLastLoginAttemptByUser($user);\n\t\t\t\t$_POST['error'] = TRUE;\n\t\t return FALSE;\n\t }\n\n\t\t\t// Successful authentication, set login attempts to 0\n\t\t\t$user->setInvalidLoginAttempts(0);\n\t\t\t$this->dao->resetLoginAttemptsForUser($user);\n\t\t\t$this->dao->updateLastLoginAttemptByUser($user);\n\t\t //put $user name in session to check if user is logged in\n\t\t $this->saveInSession($username);\n\n\t\t\treturn TRUE;\n\n\t\t}", "function Login()\n{\n\tglobal $txt, $context;\n\n\t// You're not a guest, why are you here?\n\tif (we::$is_member)\n\t\tredirectexit();\n\n\t// We need to load the Login template/language file.\n\tloadLanguage('Login');\n\tloadTemplate('Login');\n\twetem::load('login');\n\n\t// Get the template ready.... not really much else to do.\n\t$context['page_title'] = $txt['login'];\n\t$context['default_username'] =& $_REQUEST['u'];\n\t$context['default_password'] = '';\n\t$context['never_expire'] = false;\n\t$context['robot_no_index'] = true;\n\n\t// Add the login chain to the link tree.\n\tadd_linktree($txt['login'], '<URL>?action=login');\n\n\t// Set the login URL - will be used when the login process is done (but careful not to send us to an attachment).\n\tif (isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'dlattach') === false && strhas($_SESSION['old_url'], array('board=', 'topic=', 'board,', 'topic,')))\n\t\t$_SESSION['login_url'] = $_SESSION['old_url'];\n\telse\n\t\tunset($_SESSION['login_url']);\n}", "public function signIn($username='',$password='')\n\t{\n\t\t$_SESSION['username'] = $username;\n\t\t$_SESSION['password'] = $password;\n\t\t$this->request($this->signin_url,'','signInSubmit');\n\t}", "final public function login(string $username, string $password): bool\n {\n if (!$this->loginImpl($username, $password)) {\n $this->context->getLogger()->logSys(\n get_class($this) . '::' . __FUNCTION__,\n 'Login failed for user \"' . $username . '\"',\n \\Ptf\\Util\\Logger::INFO\n );\n $this->logout();\n\n return false;\n }\n $this->context->getLogger()->logSys(\n get_class($this) . '::' . __FUNCTION__,\n 'User \"' . $username . '\" has logged in',\n \\Ptf\\Util\\Logger::INFO\n );\n\n $data = $this->session->authData;\n $data['username'] = $username;\n $data['expiry'] = time() + $this->config->getIdletime();\n $data['checkhash'] = md5($username . $data['expiry'] . $this->config->getSalt());\n $this->session->authData = $data;\n\n return true;\n }", "public function login($username, $password, $rememberMe = true)\n\t{\n\t\t$username = $this->sanitize($username);\n\t\t$password = $this->sanitize($password);\n\t\t\n\t\t$result = $this->checkCredentials($username, $password);\n\t\t#we also want to make sure that if $result returns more than one row, it fails. This still needs to be added.\n\t\tif( $result )\n\t\t{\n\t\t\t$info = $this->getInfo($username);\n\t\t\tif( session_id() == '')\n\t\t\t{\n\t\t\t\tsession_start(); #it might be a good idea to make a session class, we'll see how things go.\n\t\t\t}\n\t\t\t$_SESSION['username'] = $info['username'];\n\t\t\t$_SESSION['password'] = $info['password'];\n\n\t\t\tif($rememberMe)\n\t\t\t{\n\t\t\t\t//Don't forget that cookies must be set before any output, might need to use output buffering to achieve that.\n\t\t\t\tsetcookie('username', $info['username']);\n\t\t\t\tsetcookie('password', $info['password']);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\t\n\t\t}\n\t}", "public function login();", "public function login();", "protected function login($userName = null, $password = null)\n {\n if (is_null($userName)) {\n $userName = $this->userName;\n }\n if (is_null($password)) {\n $password = $this->password;\n }\n $this->request->setMethod('POST')\n ->setPost(array(\n 'login' => array(\n 'username' => $userName,\n 'password' => $password,\n )\n ));\n\n $this->dispatch('admin/index/login');\n }", "public static function login($username,$password) { \n $db = Database::getDB();\n //query the users table for a row with a username AND password\n\t\t//the query will only return a row if a row exists with both the username and password\n\t\t$query = \"SELECT * FROM users\n WHERE username = '$username'\n\t\t\t\t AND password = '$password'\";\n //execute the query\n\t\t$result = $db->query($query);\n\t\t$row = $result->fetch();\n\t\t//if $row = true (meaning a row was found)\n\t\tif ($row){\t \n\t\t\t//create a new User object for the user\n\t\t\t$user = new User($row['userID'],\n\t\t\t\t\t\t\t $row['userName'],\n $row['password'],\n\t\t\t\t\t\t $row['firstName'],\n\t\t\t\t\t\t $row['lastName'],\n\t\t\t\t\t\t $row['email']);\t\n\t\t//create a session variable isLoggedIn and set it to 1\n\t\t$_SESSION['isLoggedIn'] = \"1\";\n\t\t//create a session variable userID and set it equal to the userID of the current user\n\t\t$_SESSION['userID'] = $row['userID'];\n\t\t//create a session variable username and set it equal to the username of the current user\n\t\t$_SESSION['username'] = $row['userName'];\n\t\t//create a session variable firstname and set it equal to the firstname of the current user\n\t\t$_SESSION['firstName'] = $row['firstName'];\n\t\t//return the new user object\n\t\treturn $user;\n }\n\t //if now row was found (meaning the users credentials were not matched in the database\n\t else{\n\t\t//throw an exception\n\t\tthrow new Exception(\"No user found.\");\n\t }\n\t}", "public function doLogin()\n {\n\n //check if all the fields were filled\n if (!Request::checkVars(Request::postData(), array('username', 'password'))) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"Complete all the fields!\", \"type\" => \"error\")));\n exit;\n }\n\n //create the user entity with the spcific login data\n $userEntity = new User(array('username' => Request::post('username'), 'password' => Request::post('password'), 'email' => null, 'name' => null));\n\n //check if the user exists and get it as entity if exists\n if (!$userEntity = $this->repository->findUser($userEntity)) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The username does not exist!\", \"type\" => \"error\")));\n exit;\n }\n\n //get the user ID from database\n $userEntity->setAttr('access', $this->repository->getAccessByUsername(Request::post('username')));\n\n //check if the login credentials are correct for login\n if (!$this->repository->checkLogin($userEntity, Request::post('password'))) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The user/email is incorrect!\", \"type\" => \"error\")));\n exit;\n }\n\n $userEntity->setAttr('access', $this->repository->getAccessByUsername(Request::post('username')));\n\n //set the session using the user data\n $this->session->setSession($userEntity);\n\n echo json_encode(\n array(\n \"swal\" => array(\"title\" => \"Success!\", \"text\" => \"You successfully logged in!\", \"type\" => \"success\", \"hideConfirmButton\" => true),\n \"redirect\" => array(\"url\" => BASE_URL . '/index.php?page=home', 'time' => 1)\n )\n );\n }", "public function login()\n {\n if(is_logged_in()) {\n redirect_to(url('thread/index'));\n }\n\n $user = new User;\n $page = Param::get('page_next', 'login');\n\n switch($page) {\n case 'login':\n break;\n\n case 'lobby':\n $user->username = Param::get('username');\n $user->password = Param::get('password');\n\n try {\n $user = $user->verify();\n $_SESSION['id'] = $user['id'];\n } catch (UserNotFoundException $e) {\n $page = 'login';\n }\n break;\n\n default:\n throw new UserNotFoundException(\"User not found\");\n }\n\n $this->set(get_defined_vars());\n $this->render($page);\n }", "public function loginUser() {\n self::$isLoggedIn = true;\n $this->session->setLoginSession(self::$storedUserId, self::$isLoggedIn);\n $this->session->setFlashMessage(1);\n }", "private function login(){\n\t\tif (empty($_POST['username'])) {\n\t\t\t$this->errors[] = \"Username field was empty.\";\n } elseif (empty($_POST['password'])) {\n $this->errors[] = \"Password field was empty.\";\n } elseif (!empty($_POST['username']) && !empty($_POST['password'])) { \n\t\t\t$this->username = filter_var($_POST['username'], FILTER_SANITIZE_STRING);\t\t\t\n \t\n\t\t\t//prepared statement to login user\n\t\t\t$sel = \"SELECT * FROM users WHERE username = ? OR email = ? \";\n \tif($stmt = $this->connection->prepare($sel)){\n \t\t$stmt->bind_param(\"ss\", $this->username, $this->username);\n \t\t$stmt->execute();\n \t\t//$stmt->bind_result();\n \t\t$res = $stmt->get_result();\n \t\t$user_info = $res->fetch_object();\n \t}\n\t\t\t\t\t\t\t\t\t\n\t\t\tif (password_verify($_POST['password'], $user_info->password)) {\n\t\t\t\t$_SESSION['username'] = $user_info->username;\n\t\t\t\t$_SESSION['email'] = $user_info->email;\n\t\t\t\t$_SESSION['user_login_status'] = 1;\n\t\t\t} else if(empty($user_info)){\n\t\t\t\t$this->errors[] = \"Wrong User name. Please try again\";\n\t\t\t} else {\n\t\t\t\t$this->errors[] = \"Wrong password. Please try again\";\n\t\t\t}\n\t\t}\n\t}", "public function login()\n {\n if (isset($_POST['signIn'])) {\n $userExist = $this->checkIfUserExist($_POST['login']);\n var_dump($userExist);\n \n if ($userExist === false) {\n header('Location: auth&alert=NotUser');\n exit();\n } else {\n $authUser = $this->usersManager->getAuthUser($_POST['login']);\n if (password_verify($_POST['password'], $authUser[0]->userPassword())) {\n $this->usersManager->setLastConnexionUser($authUser[0]->userId());\n $this->openSession($authUser[0]);\n } else {\n header('Location: auth&alert=Login');\n exit();\n }\n }\n } else {\n throw new Exception($this->datasError);\n }\n }", "static public function login($username, $password)\n\t{\n $handler = Database::query('SELECT * FROM users WHERE user=\"'.$username.'\"');\n\n $userInfo = $handler->fetch();\n if(sha1($password.$userInfo['created']) == $userInfo['pass'])\n {\n \tSession::set('username', $username);\n\t\t\tDatabase::query('UPDATE users SET updated='.time().' WHERE user=\"'.$username.'\"');\t\n return array('success' => true);\n }\n else\n {\n return array('error' => \"The username and password didn't match\");\n }\n\n\t}", "public static function login($username, $password) {\n\t\t$db = self::db_connect();\n\n\t\t// Hash the password with the correct function\n\t\t$password = self::hashpass($password);\n\n\t\t// Check the database\n\t\t$query = \"SELECT * FROM \" . mysql_real_escape_string(self::$user_table_name) . \" WHERE \" . mysql_real_escape_string(self::$username_field) . \"='\" . mysql_real_escape_string($username) . \"' AND \" . mysql_real_escape_string(self::$password_field) . \"='\" . mysql_real_escape_string($password) . \"'\";\n\n\t\t$result = mysql_query($query) or die(\"Couldn't run: $query\");\n\n\t\tif (mysql_numrows($result)) { \n\t\t\t// We're logged in, set the session variable\n\t\t\t$logged_in = true;\n\t\t\t$_SESSION['alibaba_' . self::$app_name . '_username'] = $username;\n\t\t} else {\n\t\t\t// Login failed, wipe the session variable\n\t\t\t$logged_in = false;\n\t\t\t$_SESSION['alibaba_' . self::$app_name . '_username'] = '';\n\t\t}\n\n\t\tself::db_close($db);\n\n\t\treturn $logged_in;\n\t}", "public function login($username, $password) {\n\n // Iterate through users array\n foreach ($this->users as $user) {\n\n // If a match is found\n if ($user['username'] === $username) {\n\n // Validate the password using sha1\n if (sha1($password) === $user['password']) {\n\n // Setup a new session array\n $session = ['loggedIn' => true, 'id' => $user['id'], 'username' => $user['username']];\n\n // Use userData to store data.\n $this->session->setUserData($session);\n\n // Set the class identity variable.\n $this->setIdentity($user);\n return true;\n }\n\n // Example of how to set error.\n $this->error = 'Incorrect password';\n return false;\n }\n }\n\n // Example of how to set error.\n $this->error = 'User does not exist';\n return false;\n }", "public function login()\n {\n if ($this->getCurrentUser()->get('id')) {\n $this->redirect($this->Auth->redirectUrl());\n }\n\n if ($user = $this->Auth->identify()) {\n $this->Auth->setUser($user);\n\n // set cookie\n if (!empty($this->getRequest()->getData('remember_me'))) {\n if ($CookieAuth = $this->Auth->getAuthenticate('Lil.Cookie')) {\n $CookieAuth->createCookie($this->getRequest()->getData());\n }\n }\n } else {\n if ($this->getRequest()->is('post') || env('PHP_AUTH_USER')) {\n $this->Flash->error(__d('lil', 'Invalid username or password, try again'));\n }\n }\n\n if ($this->getCurrentUser()->get('id')) {\n $redirect = $this->Auth->redirectUrl();\n $event = new Event('Lil.Auth.afterLogin', $this->Auth, [$redirect]);\n $this->getEventManager()->dispatch($event);\n\n return $this->redirect($redirect);\n }\n }", "public function authenticateByUsernamePassword(string $username, string $password): self;", "protected function login()\n {\n $this->send(Response::nick($this->config['nick']));\n $this->send(Response::user(\n $this->config['nick'],\n $this->config['hostname'],\n $this->config['servername'],\n $this->config['realname']\n ));\n }", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->UserName,$this->passWd);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tuser()->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function login($username, $password) {\n if (isset($username) && isset($password)) {\n $user = User::where('username', '=', $username)->first();\n if (($user)) {\n if (Hash::check($password, $user->password)) {\n Session::put('id', $user->_id);\n Session::put('username', $username);\n return Response::json(\n array('reason' => 'correct validation', 'status' => 0))->setCallback(Input::get('callback'));\n }\n return Response::json(\n array('reason' => 'invalid or inexistent username or password ', 'status' => 1))->setCallback(Input::get('callback'));\n }\n return Response::json(\n array('reason' => 'invalid or inexistent username or password', 'status' => 2))->setCallback(Input::get('callback'));\n }\n return Response::json(\n array('reason' => 'empty field', 'status' => 3))->setCallback(Input::get('callback'));\n }", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->username,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function action_login()\n {\n if(\\Auth::check())\n {\n \\Response::redirect('admin/dashboard');\n }\n\n // Set validation\n $val = \\Validation::forge('login');\n $val->add_field('username', 'Name', 'required');\n $val->add_field('password', 'Password', 'required');\n\n // Run validation\n if($val->run())\n {\n if(\\Auth::instance()->login($val->validated('username'), $val->validated('password')))\n {\n \\Session::set_flash('success', \\Lang::get('nvadmin.public.login_success'));\n \\Response::redirect('admin/dashboard');\n }\n else\n {\n $this->data['page_values']['errors'] = \\Lang::get('nvadmin.public.login_error');\n }\n }\n else\n {\n $this->data['page_values']['errors'] = $val->show_errors();\n }\n\n // Set templates variables\n $this->data['template_values']['subtitle'] = 'Login';\n $this->data['template_values']['description'] = \\Lang::get('nvadmin.public.login');\n $this->data['template_values']['keywords'] = 'login, access denied';\n }", "public function loginAction(){\n\t\t$form = new Admin_Form_FormLogin();\n\t\t\n\t\tif($this->_request->isPost()){\n\t\t\t$data = $this->_request->getPost();\n\t\t\tif($form->isValid($data)){\n\t\t\t\t$modelUser = new Admin_Model_User();\n\t\t\t\tif($modelUser->login($data['Username'], $data['Password'])){\n\t\t\t\t\t$this->_redirect($this->view->url(array('module' => 'admin', 'controller' => 'index', \n\t\t\t\t\t\t\t'action' => 'index'), null, true));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->view->form = $form;\n\t}", "public function loginAction()\n {\n $data = $this->getRequestData();\n if ($this->getDeviceSession(false)) {\n $this->setErrorResponse('Your device is already running a session. Please logout first.');\n }\n $session = Workapp_Session::login($data['username'], $data['password']);\n if (!$session) {\n $this->setErrorResponse('No user with such username and password');\n }\n $session->registerAction($_SERVER['REMOTE_ADDR']);\n $this->_helper->json(array('session_uid' => $session->getSessionUid()));\n }", "public function p_login() {\n\n\t\t# Sanitize the user entered data to prevent any funny-business (re: SQL Injection Attacks)\n\t\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n\t\t# Hash submitted password so we can compare it against one in the db\n\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t\t# Search the db for this email and password\n\t\t# Retrieve the token if it's available\n\t\t$q = \"SELECT token \n\t\t\tFROM users \n\t\t\tWHERE email = '\".$_POST['email'].\"' \n\t\t\tAND password = '\".$_POST['password'].\"'\";\n\n\t\t$token = DB::instance(DB_NAME)->select_field($q);\n\n\t\t# If we didn't find a matching token in the database, it means login failed\n\t\tif(!$token) {\n\n\t\t\t# Send them back to the login page\n\t\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t# But if we did, login succeeded! \n\t\t} else {\n\t\t\tsetcookie(\"token\", $token, strtotime('+1 year'), '/');\n\t\t\t# Send them to the main page - or whever you want them to go\n\t\t\tRouter::redirect(\"/\");\n\t\t}\n\t}", "public static function login()\n {\n (new Authenticator(request()))->login();\n }", "public static function login($username, $password) {\n\t\t$conn = new mysqli ( $GLOBALS ['dbservername'], $GLOBALS ['dbusername'], $GLOBALS ['dbpassword'], $GLOBALS ['dbname'] );\n\t\t$sql = \"SELECT * FROM user WHERE username='$username'and password='$password'\";\n\t\techo $sql;\n\t\tif (empty ( $conn->query ( $sql ) ) === TRUE) {\n\t\t\techo \"No such user login fail\";\n\t\t\treturn false;\n\t\t} else {\n\t\t\techo \"login successful\";\n\t\t\treturn true;\n\t\t}\n\t\t$conn->close ();\n\t}", "function Login($username, $password){\n\t\t\tif ($username == \"Admin\" && $password == \"blah\") {\n\t\t\t\techo \"<p>$username is logged in! </p>\";\n\t\t\t\t$loggedIn=true;\n\t\t\t} else {\n\t\t\t\techo \"<p> Login Error! </p>\";\n\n\t\t\t}\n\n\t\t\n\t\t}" ]
[ "0.8009955", "0.76665884", "0.7506839", "0.72778517", "0.7117188", "0.7117188", "0.7021765", "0.7019218", "0.7009057", "0.70061266", "0.69893014", "0.6988763", "0.6982939", "0.69742745", "0.69383377", "0.69098395", "0.6898184", "0.6867491", "0.6866067", "0.6857612", "0.6856264", "0.68270844", "0.6801804", "0.6795494", "0.6779376", "0.67472637", "0.67305267", "0.6725017", "0.6711873", "0.67034596", "0.6697504", "0.6668953", "0.66573197", "0.66566646", "0.66495955", "0.66418606", "0.66334885", "0.66289955", "0.6619838", "0.6610873", "0.6588566", "0.65846264", "0.65803397", "0.6576855", "0.656389", "0.6561842", "0.6557815", "0.6553727", "0.65526354", "0.6552233", "0.65345925", "0.65344596", "0.65237397", "0.65168655", "0.6514749", "0.65101063", "0.6500872", "0.6497192", "0.6496067", "0.6488323", "0.6479195", "0.6478785", "0.64731413", "0.64583963", "0.645792", "0.6456636", "0.64542234", "0.6443291", "0.6442071", "0.6438548", "0.64368814", "0.6435895", "0.6430861", "0.64254665", "0.6422098", "0.6417115", "0.64155835", "0.64155835", "0.6412875", "0.6411584", "0.6410334", "0.64013124", "0.63966846", "0.63793516", "0.6379238", "0.63780445", "0.63749754", "0.6373335", "0.63730603", "0.63694394", "0.63673156", "0.6360233", "0.6357459", "0.6357408", "0.63527554", "0.6349767", "0.6348876", "0.63482857", "0.6343269", "0.6342693", "0.6342311" ]
0.0
-1
Finds user by [[username]]
public function getUser() { if ($this->_user === false) { $this->_user = \app\models\User::findByUsername($this->username); } return $this->_user; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findUserByUsername($username);", "public function findUserByUsername($username);", "public function findUserByUsername($username);", "public function getUserWithUsername($username);", "public function findByUsername(string $username);", "public function fetchUserByUserName($username);", "function Find($username='')\n\t{\n\t\tif (!$username) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->GetDb();\n\n\t\t$query = \"SELECT userid FROM [|PREFIX|]users WHERE username='\" . $this->Db->Quote($username) . \"'\";\n\t\t$result = $this->Db->Query($query);\n\t\tif (!$result) {\n\t\t\tlist($error, $level) = $this->Db->GetError();\n\t\t\ttrigger_error($error, $level);\n\t\t\treturn false;\n\t\t}\n\t\t$row = $this->Db->Fetch($result);\n\t\tif (empty($row)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $row['userid'];\n\t}", "private static function _FindUserByUsername(string $username) {\r\n \r\n $db = DbClass::getInstance();\r\n \r\n $sql = 'SELECT * FROM users WHERE username=:username';\r\n $data = [':username' => $username];\r\n\r\n $query_st = $db->singleQueryRetStatement($sql, $data);\r\n\r\n $user = $query_st->fetchObject('User');\r\n \r\n return $user;\r\n }", "function search($username) {\n $user = $this->user->getByUsername($username);\n\n //if not exists on database, search on api\n if($user === null) {\n $url = 'https://api.github.com/users/' . $username;\n $output = self::makeRequest($url);\n\n return $this->user->create(json_decode($output, true));\n } else {\n //return the user on database using get method\n return $user;\n }\n }", "public function find($username) {\n $sql = \"select * from user where user_id=?\";\n $row = $this->getDb()->fetchAssoc($sql, array($username));\n\n if ($row)\n return $this->buildDomainObject($row);\n else\n throw new UsernameNotFoundException(sprintf('User \"%s\" not found.', $username));\n }", "public function find_user_with_username($username)\n {\n $result = array(\n \"status\" => \"\",\n \"body\" => array(),\n \"error\" => array()\n );\n $stmt = $this->db->prepare(\"SELECT * FROM users WHERE username LIKE ?\");\n if (!($stmt))\n {\n trigger_error(\"Prepare failed: (\" . $this->db->errno . \") \" . $this->db->error,\n E_USER_ERROR);\n }\n if (!$stmt->bind_param('s', $username)){\n trigger_error(\"Binding parameters failed: (\" . $stmt->errno . \") \" . $stmt->error,\n E_ERROR);\n }\n if (!$stmt->execute()) {\n trigger_error(\"Execute failed: (\" . $stmt->errno . \") \" . $stmt->error,\n E_CORE_ERROR);\n $result[\"error\"] = $stmt->error;\n }\n $res = $stmt->get_result();\n $row = $res->fetch_assoc();\n if ($row[\"id\"] != null){\n $result[\"status\"] = \"Query successful\";\n $result[\"body\"] = array(\n \"user\" => array(\n \"id\" => $row[\"id\"],\n \"url\" => $row[\"url\"],\n \"username\" => $row[\"username\"],\n \"email\" => $row[\"email\"],\n \"firstName\" => $row[\"firstName\"],\n \"lastName\" => $row[\"lastName\"],\n \"fullName\" => $row[\"fullName\"],\n \"bio\" => $row[\"bio\"],\n \"isAdmin\" => $row[\"isAdmin\"],\n \"password\" => $row[\"password\"],\n \"created\" => $row[\"created\"],\n \"lastUpdated\" => $row[\"lastUpdated\"]\n )\n );\n return $result;\n } else {\n $result['status'] = \"No user with that username exists\";\n }\n return $result;\n }", "public static function findByUsername($username)\n {\n $user = User::find()->where(['username' => $username])->one();//I don't know if this is correct i am //checing value 'becky' in username column of my user table.\n return $user;\n }", "public function findUserByName($username) {\n /** @var User $user */\n $user = $this->findOneBy([\"name\" => $username]);\n return $user;\n }", "function lookupUser($username)\n { \n try {\n $connection = Doctrine_Manager::connection();\n $query = \"SELECT username, access_token FROM constant_contact WHERE username='\".$username.\"' ORDER BY id DESC LIMIT 1\";\n $statement = $connection->execute($query);\n $statement->execute();\n\n $resultset = $statement->fetch(PDO::FETCH_OBJ);\n \n if (empty($resultset)) {\n $returnUser = false;\n throw new Exception('Username '.$username.' not found in datastore');\n }\n else {\n $fields = array();\n foreach ($resultset as $k => $v) $fields[$k] = $v;\n $returnUser = $fields;\n }\n\n }\n catch(Exception $e) {\n echo 'OAuth Exception: '.$e->getMessage();\n }\n return $returnUser;\n }", "function getUserByUsername($username, $users)\n {\n foreach ($users as $user)\n {\n if ($user['username'] == $username)\n {\n return $user;\n }\n }\n return NULL;\n }", "protected function findUser($username)\n {\n return $this->findUserByUsernameOrEmail($username);\n }", "public function loadUserByUsername($username);", "public function search_by_username($username) {\n\n // first, get all users\n $method = \"users.list\";\n $payload = array();\n $result = $this->apicall($method, $payload);\n $users = $result['members'];\n\n $this->debug(\"userlist.json\", json_encode($users));\n\n $key = array_search($username, array_column($users, 'name'));\n\n $this->debug(\"user.json\", json_encode($users[$key]));\n\n return $users[$key];\n\n\n }", "function cicleinscription_get_user_by_username($username){\n\tglobal $DB;\n\treturn $DB->get_record('user', array('username'=>$username));\n}", "function people_findByUsername ($username) {\n $response = $this->execute(array('method' => 'flickr.people.findByUsername', 'username' => $username));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['user']['nsid'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function get_user_by_username($username) {\n $read_json = file_get_contents(__DIR__ . '/data_users.json');\n $data = json_decode($read_json, JSON_OBJECT_AS_ARRAY);\n\n // iterate over db, if username is found, return user\n foreach ($data as $user){\n if ($user[\"username\"] == $username){\n return $user;\n }\n }\n return false;\n}", "public function retrieveByUsername($username);", "public function getUser($username){\n return $this->findOneByName($username);\n }", "public function GetByUsername($username);", "public function findUserByUsername($username)\n {\n return $this->findUser(['username' => $username])->one();\n }", "public static function GetByUserName ($userName);", "public function findByUserName(String $username): User;", "static public function find_by_username($userName, $password) {\n\t$sql = \"SELECT * FROM \" . static::$table_name;\n\t$sql .= \" WHERE userName='\" . self::$database->escape_string($userName) . \"' AND password='\" . self::$database->escape_string($password) . \"'\";\n\t$obj_array = static::find_by_sql($sql);\n\tif(!empty($obj_array)){\n\t\treturn array_shift($obj_array);\n\n\t} else {\n\t\treturn false;\n\t}\n}", "public static function findByUsername($username) {\n $status_active = Status::getActive();\n\n if (strpos($username, '@')) {\n return self::findWithCheckOrganizationStatus(static::find()->where(['email' => $username, 'status' => $status_active])->limit(1)->one());\n // return self::findWithCheckOrganizationStatus(static::findOne(['email' => $username, 'status' => $status_active]));\n // return static::findOne(['email' => $username, 'status' => $status_active]);\n }\n\n if (strlen($username) > self::MAGIC_USERID_LEN) {\n $u_part = substr($username, -self::MAGIC_USERID_LEN);\n $o_part = substr($username, 0, strlen($username) - self::MAGIC_USERID_LEN);\n $user_id = 1 * $u_part;\n $org_id = 1 * $o_part;\n $sql = \"SELECT {{users}}.* FROM {{users}}\n INNER JOIN {{org_employees}} ON {{org_employees}}.[[user_id]] = {{users}}.[[id]]\n WHERE {{users}}.[[id]] = :user_id AND {{org_employees}}.[[org_id]] = :org_id\n AND {{users}}.[[status]] = :status_active AND {{org_employees}}.[[status]] = :status_active\";\n // return static::findBySql($sql, [':user_id' => $user_id, ':org_id' => $org_id,\n // ':status_active' => $status_active])->limit(1)->one();\n return self::findWithCheckOrganizationStatus(static::findBySql($sql, [':user_id' => $user_id, ':org_id' => $org_id,\n ':status_active' => $status_active])->limit(1)->one());\n }\n\n $user_id = 1 * $username;\n\n // return json_encode(static::findOne(['id' => $user_id, 'status' => $status_active]));\n return self::findWithCheckOrganizationStatus(static::findOne(['id' => $user_id, 'status' => $status_active]));\n }", "public function findUserByUsername($username) {\n $this->db->query('SELECT * FROM users WHERE username = :username');\n\n // Bind value\n $this->db->bind(':username', $username);\n\n $row = $this->db->single();\n\n // Check row\n if($this->db->rowCount() > 0){\n return true;\n } else {\n return false;\n }\n }", "public function getByUsername($username)\r\n {\r\n }", "function auth_user_exists($username)\n{\n return dbFetchCell(\"SELECT * FROM `users` WHERE `username` = ?\", array($username));\n}", "public static function findByUsername($username)\n\t{\n\t\t//Yii::info('+ BaseUser::findByUsername() username: '.$username);\n\t\t// checks if $username fits saved username \n\t\t$userByName = self::find()->where(['username' => $username])->one();\n\t\tif (isset($userByName)) {\n\t\t\t//Yii::info('- BaseUser::findByUsername() found user: '.$userByName->id.' name:'.$userByName->username);\n\t\t\treturn $userByName;\n\t\t}\n\t\t\n\t\t// checks if $username fits saved mail address \n\t\t$userByMail = self::find()->where(['email' => $username])->one();\n\t\tif (isset($userByMail)) {\n\t\t\t//Yii::info('- BaseUser::findByUsername() found user: '.$userByMail->id.' mail:'.$userByMail->email);\n\t\t\treturn $userByMail;\n\t\t}\n\t\t\n\t\t//Yii::info('- BaseUser::findByUsername() NOT found!');\n\t\treturn null;\n\t}", "public function findUserByUsername($username)\n {\n $this->db->query('SELECT * FROM user WHERE username = :username');\n $this->db->bind(':username', $username);\n $row = $this->db->single();\n if($this->db->rowCount() > 0){\n return true;\n }else{\n return false;\n }\n }", "public function loadUserByUsername($username)\n { \n $user = $this->_em->getRepository('Entity\\User\\User')->findOneBy(array('username' => $username));\n\n if($user != null)\n return $user;\n\n throw new UsernameNotFoundException(\"Compte introuvable\");\n }", "function getUserByName($username) {\n $sql = \"select * from users where username = :username\";\n try {\n $stmnt = $this->conn->prepare($sql);\n $params = [\n 'username' => $username\n ];\n $stmnt->execute($params);\n return $stmnt->fetch();\n }\n Catch (PDOException $e) {\n $e = new ErrorView([\n 'message' => $e->getMessage(),\n 'code' => $e->getCode()\n ]);\n }\n }", "public function findUserByUsernameOrEmail($usernameOrEmail);", "public function findUserByUsernameOrEmail($usernameOrEmail);", "public function findUserByUsernameOrEmail($usernameOrEmail);", "public function findUserByUsernameOrThrowException($username);", "function FindUser($User) {\n $User = str_replace('ZZ ', '', $User);\n\n //separa o primeiro nome do sobrenome\n $name_complete = explode(' ', $User);\n $user_name = array_shift($name_complete);\n $user_lastname = implode(' ', $name_complete);\n\n $Read = new WsUsers();\n\n $Read->setUser_name($user_name);\n $Read->setUser_lastname($user_lastname);\n $Result = $Read->Execute()->Query(\"user_name like '%{$user_name}%' AND user_lastname like '%{$user_lastname}%'\");\n\n if (!empty($Result)):\n return $Result[0]->user_id;\n endif;\n}", "public static function findByUsername($username)\n { \n return static::findOne(['login' => $username]);\n //(RegisterForm::find()->andWhere('login=:login',[':login'=>$username])->one()){\n }", "public static function findByUsername($username)\n {\n return User::findOne(['username' => $username]);\n\n }", "public static function findByUsername($username)\n {\n return static::findOne(['username' => $username]);\n //return $userInfo = UserInfo::findOne(['user_name' => $username]);\n// if(!empty($userInfo)){\n// return User::findOne(['user_no' => $userInfo->usr_no]);\n// }\n// return null;\n /*\n if(!empty($userInfo)){\n $user_no = $userInfo->usr_no;\n }\n\n return static::findOne(['usr_nm' => $username]);\n */\n /*\n foreach (self::$users as $user) {\n if (strcasecmp($user['username'], $username) === 0) {\n return new static($user);\n }\n }\n\n return null;\n */\n }", "public function findUserByUsername($username)\n {\n /** @var UserInterface|null $result */\n $result = $this->createClass()\n ->newQuery()\n ->where($this->username, '=', $username)\n ;\n\n return $result;\n }", "function getUserByName($username)\n {\n return $this->data->getUserByName($username);\n }", "public function findUserByUsername( $username ) {\n\t\t$user = $this->em->getRepository( $this->classes[Configuration::USER] )->findOneBy( [ 'username' => $username ] );\n\n\t\treturn $user;\n\t}", "public function loadUserByUsername($username)\n {\n $sql = \"select * from user where user_email=?\";\n $row = $this->getDb()->fetchAssoc($sql, array($username));\n\n if ($row)\n return $this->buildDomainObject($row);\n else\n throw new UsernameNotFoundException(sprintf('User \"%s\" not found.', $username));\n }", "public function findUserById($id)\n {\n $sql = \"SELECT rowid, * FROM USER WHERE rowid=?\";\n $row = $this->getDb()->fetchAssoc($sql, array($id));\n if ($row){\n return $this->buildDomainObject($row);\n }else{\n throw new UsernameNotFoundException('User not found.');\n }\n }", "public function loadUserByUsername($username)\n {\n }", "public function getByUsername($username) {\n\n\t\t// get database\n\t\t$db = $this->app->database;\n\n\t\t// search username\n\t\tif ($id = $db->queryResult('SELECT id FROM #__users WHERE username = '.$db->Quote($username))) {\n\t\t\treturn $this->get($id);\n\t\t}\n\n\t\treturn null;\n\t}", "public function retrieve($username);", "function get_user_by_username($username) {\n\t\t$this->db->where('LOWER(username)=', strtolower($username));\n\n\t\t$query = $this->db->get($this->table_name);\n\t\tif ($query->num_rows() == 1) {\n\t\t\treturn $query->row();\n\t\t}\n\n\t\treturn NULL;\n\t}", "private function findUser ($where) {\n return $this->db->extended->autoExecute(\n 'users',\n null, // SELECT queries do not need manipulation values\n MDB2_AUTOQUERY_SELECT,\n $where,\n null, true, true\n );\n }", "public function findForPassport($username): User\n {\n return $this->where('firstname', $username)->first();\n }", "public function selectUserbyName($username){\n\n $this->result = @$this->dbConnection->query(\"SELECT * FROM Users WHERE User_name = '$username' \");\n if(!$this->result)\n {\n die('Could not retrieve records from the CMS Database: ' .\n $this->dbConnection->error);\n }\n\n }", "public function searchUser()\n\t{\n\t\t$url = sprintf('%sUserSearch/search', self::HTTP_URL);\n\t\t$args = array(\n\t\t\t'query'\t\t=>\t$query,\n\t\t\t'offset'\t=>\t$offset\n\t\t);\n\n\t\t$this->setResultType(PlurkResponseParser::RESULT_SEARCH_USER);\n\t\treturn $this->sendRequest($url, $args);\n\t}", "private static function usernameExists($username) {\n return \\Drupal::entityQuery('user')->condition('name', $username)->execute();\n }", "public function findById($id) {\n $sql = \"select * from user where user_id=?\";\n $row = $this->getDb()->fetchAssoc($sql, array($id));\n\n if ($row)\n return $this->buildDomainObject($row);\n else\n throw new UsernameNotFoundException(sprintf('User \"%s\" not found.', \"log error\"));\n }", "public function retrieveUserByUsername($username)\n {\n return $this->start()->uri(\"/api/user\")\n ->urlParameter(\"username\", $username)\n ->get()\n ->go();\n }", "public static function findByUsername($username)\n {\n // mencari user berdasarkan username dan yang dicari haya 1\n $user = TbUser::find()->where(['username' => $username])->one();\n\n if ($user != null) {\n return $user;\n }else{\n return null;\n }\n }", "static function searchUserByName() : string\n {\n return \"SELECT *\n FROM users\n WHERE LOCATE( :Name , nickname) > 0;\";\n }", "public function findUsers();", "public function findUsers();", "public static function findByUsername($username) {\n// foreach (self::$users as $user) {\n// if (strcasecmp($user['username'], $username) === 0) {\n// return new static($user);\n// }\n// }\n\n return static::findOne(['username' => $username]);\n }", "public function findUser(){\n\t\t$val = $_POST['user'];\n\n $pieces = explode(\" \", $val);\n\t\tif(count($pieces) > 1){\n\n\t\t\t$sql = \"SELECT * FROM user WHERE fname=:fn AND lname=:ln\";\n if($stmt = $this->_db->prepare($sql)){\n $stmt->bindParam(\":fn\", $pieces[0], PDO::PARAM_STR);\n $stmt->bindParam(\":ln\", $pieces[1], PDO::PARAM_STR);\n $stmt->execute();\n\n }\n else{\n return \"Something went wrong deleting the user.\";\n }\n\n\t\t}\n\t\telse{\n\t\t\t$sql = \"SELECT * FROM user WHERE uname=:u\";\n\n if($stmt = $this->_db->prepare($sql)){\n $stmt->bindParam(\":u\", $pieces[0], PDO::PARAM_STR);\n\n $stmt->execute();\n }\n else{\n return \"Something went wrong deleting the user.\";\n }\n\t\t}\n\t\tif($stmt->rowCount()>0){\n \t$row = $stmt->fetch();\n\n \theader(\"Location: /yumme/userprofile.php?u=\".$row['UID'].\"&uname=\".$row['UName']);\n\n\t\t}\n\t\telse{\n\t\t\theader(\"Location: /yumme/index.php\");\n\t\t}\n\n\t}", "public function loadUserByUsername($username)\n {\n $user = $this->em->getRepository('AppBundle:User')->findOneBy([\"fullname\"=>$username]);\n if (!$user){\n throw new UsernameNotFoundException(\"User not found\");\n }\n\n return $user;\n }", "public function getUserByUsername($username){\r\n\t\t$result = $this->query(\"SELECT * FROM user where username = '$username';\");\r\n\t\treturn $this->fetchSingleRow($result);\r\n\t}", "public static function findByUsername($username)\n {\n $db = Base::getConnection();\n\n $stmt = $db->prepare(\"SELECT * FROM users WHERE username=:username ;\");\n $stmt->bindParam(\":username\", $username, PDO::PARAM_STR);\n $stmt->execute();\n\n $response = $stmt->fetch();\n\n if ($response) {\n $u = new User();\n $u->id = $response['user_id'];\n $u->username = $response['username'];\n $u->password = $response['password'];\n $u->email = $response['email'];\n $u->setIsVisitor(false);\n $stmt->closeCursor();\n return $u;\n } else {\n return false;\n }\n }", "public function findUser($userId);", "public static function findByUsername($username)\n {\n return static::findOne(['usuario' => $username]);\n }", "private function /*bool*/ findUsername(/*string*/ $name) {\n\t\t$variations = array(\n\t\t\t$name,\n\t\t\tstrtolower($name[0]) . substr($name, 1),\n\t\t\tstr_replace(\" \", \"_\", $name),\n\t\t);\n\n\t\t$crowd = $this->getCrowd();\n\t\tforeach ($variations as $v) {\n\t\t\ttry {\n\t\t\t\t$crowd->findPrincipalByName(array(\"in0\" => $this->token, \"in1\" => $v));\n\t\t\t\treturn $v;\n\t\t\t} catch (Exception $e) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public function recherche_user() {\n\t\t$this->onDebug ( __METHOD__, 1 );\n\t\t$userdata = $this->creer_definition_user_get_ws ();\n\t\t$this->onDebug ( $userdata, 1 );\n\t\treturn $this->getObjetZabbixWsclient ()\n\t\t\t->userGet ( $userdata );\n\t}", "public function getUserByUsername($username)\n {\n return $this->findBy('username', $username, [\n 'id',\n 'username',\n 'first_name',\n 'last_name',\n 'email',\n 'profile_description',\n 'personal_website',\n 'twitter_username',\n 'github_username',\n 'place_of_employment',\n 'job_title',\n 'hometown',\n 'country_flag',\n 'for_hire',\n ]);\n }", "public static function findByUsername($username)\n {\n// return null;\n }", "public function findMemberByUsername(string $username)\n {\n if (! $this->members) {\n // This supports pagination in chunks of 1000 by setting the\n // 'after' parameter to the last member user id. I don't think\n // we need to worry about this yet.\n $this->members = $this->client->guild->listGuildMembers([\n 'guild.id' => $this->guildId,\n 'limit' => 1000,\n ]);\n }\n\n // Evolving Usernames on Discord\n // https://discord.com/blog/usernames\n // https://support-dev.discord.com/hc/en-us/articles/13667755828631\n //\n // They decided to remove the discriminator component and just\n // have a single username - this can be removed once they've\n // completed that change\n if (str_contains($username, '#')) {\n // A discord username is made up of the user's chosen username,\n // and a randomly generated discriminator. The discriminator\n // is a four digit number and the two are stuck together with\n // a # character.\n $parts = explode('#', $username);\n $userPart = $parts[0];\n $discrPart = (int) $parts[1];\n\n foreach ($this->members as $member) {\n if ($member->user->username == $userPart ||\n $member->user->discriminator == $discrPart) {\n return $member;\n }\n }\n } else {\n foreach ($this->members as $member) {\n if ($member->user->username == $username) {\n return $member;\n }\n }\n }\n\n return null;\n }", "public function findByUsername($username)\n {\n $query = $this->createQuery();\n $query = $query->matching($query->equals('username', $username));\n $objects = $query->execute();\n\n return $objects->getFirst();\n }", "public function lookForUserByUsername($username)\n {\n self::connectToDB(); /* Using DB connection */\n\n $this->sql = \"SELECT username FROM users WHERE username = ?\";\n\n try\n {\n $this->query = $this->handler->prepare($this->sql);\n $this->query->execute(array($username));\n $this->result = $this->query->fetchAll(PDO::FETCH_ASSOC);\n\n /**\n * Closing DB connection\n */\n $this->query->closeCursor();\n $this->handler = null;\n\n return $this->result;\n }\n catch (Exception $e)\n {\n echo \"Error: query failure\";\n return false;\n }\n }", "function user_find_id($username) {\n $db = connectDB();\n \n // Look up user\n $stmt = $db->prepare('\n SELECT\n user_id\n FROM\n users\n WHERE\n username = :username\n LIMIT\n 1\n ;\n ');\n $stmt->execute([':username' => $username]);\n $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);\n \n if (empty($rows)) {\n return NULL;\n } else {\n return $rows[0]['user_id'];\n }\n}", "protected function _findUser($username, $password = null) {\n\t\t$userModel = $this->settings['userModel'];\n\t\tlist(, $model) = pluginSplit($userModel);\n\t\t$fields = $this->settings['fields'];\t\t\n\t\tif (is_array($username)) {\n\t\t\t$conditions = $username;\n\t\t} else {\n\t\t\t$conditions = array(\n\t\t\t\t\"BINARY \" . $model . '.' . $fields['username'] . \"='\" . $username.\"' \"\n\t\t\t);\n\t\t}\t\t\n\t\tif (!empty($this->settings['scope'])) {\n\t\t\t$conditions = array_merge($conditions, $this->settings['scope']);\n\t\t}\n\n\t\t$result = ClassRegistry::init($userModel)->find('first', array(\n\t\t\t'conditions' => $conditions,\n\t\t\t'recursive' => $this->settings['recursive'],\n\t\t\t'contain' => $this->settings['contain'],\n\t\t));\n\t\tif (empty($result[$model])) {\n\t\t\t$this->passwordHasher()->hash($password);\n\t\t\treturn false;\n\t\t}\n\n\t\t$user = $result[$model];\n\t\tif ($password !== null) {\n\t\t\tif (!$this->passwordHasher()->check($password, $user[$fields['password']])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tunset($user[$fields['password']]);\n\t\t}\n\n\t\tunset($result[$model]);\n\t\treturn array_merge($user, $result);\n\t}", "protected function _findUser($username, $password = null) {\n $userModel = $this->settings['userModel'];\n\t\t$userModel = 'AdminUser.AdminUser';\n list($plugin, $model) = pluginSplit($userModel);\n $fields = $this->settings['fields'];\n\n $conditions = array(\n $model . '.' . $fields['username'] => $username\n );\n if (!empty($this->settings['scope'])) {\n $conditions = array_merge($conditions, $this->settings['scope']);\n }\n // $result = ClassRegistry::init($userModel)->find('first', array(\n\t $result = ClassRegistry::init($model)->find('first', array(\n 'conditions' => $conditions,\n 'recursive' => $this->settings['recursive']\n ));\n if (empty($result) || empty($result[$model])) {\n return false;\n }\n\n // If the user's password hash doesn't match the results, return false\n if (!static::check($password, $result[$model][$fields['password']])) {\n return false;\n }\n\n unset($result[$model][$fields['password']]);\n return $result[$model];\n }", "public function findForUser($userId);", "public function findForUser($userId);", "public static function findByUsername($username)\n {\n return static::findOne(['email' => $username]);\n }", "public function loadUserByUsername($username)\n {\n return $this->createQueryBuilder('u')\n ->where('u.username = :username OR u.email = :email')\n ->setParameter('username', $username)\n ->setParameter('email', $username)\n ->getQuery()\n ->getOneOrNullResult();\n }", "public function user_exists($username){\n\t\t$if_user_exists_query = \"SELECT username FROM appuser WHERE username = $1;\"; //make query\n\t\t$if_user = pg_prepare($this->con, \"my_query\", $if_user_exists_query); //prepare query\n\t\t$if_user = pg_execute($this->con, \"my_query\", array($username)); //execute query\n\t\treturn $if_user;\n\t\t}", "public function username($username);", "public static function retrieveByUsername( $username ){\r\n \r\n return UserQuery::create()\r\n ->usesfGuardUserQuery()\r\n ->filterByUsername( $username )\r\n ->endUse()\r\n ->findOne();\r\n\r\n }", "public function getUserByName(string $username)\n {\n $sql = ('SELECT * FROM user WHERE pseudo = ?');\n $result = $this->sql($sql, [$username]);\n \n return $result->fetch();\n }", "protected function getUserByName(string $username)\n {\n if (! $user = User::whereUsername($username)->first()) {\n abort(404, \"User ${username} not found\");\n }\n return $user;\n }", "public static function findByUsername($username)\n {\n return static::findOne(['login_name' => $username]);\n }", "public static function getByUsername($username) {\n $r= self::getPeer()->doSelect(new Criteria(array('username', $username, EQUAL)));\n return $r ? $r[0] : NULL;\n }", "public function loadUserByUsername($username)\n {\n return $this->repository->findByNickname($username)->getOrThrow(new UsernameNotFoundException());\n }", "function getUserId($user_name){\n return sqlSelectOne(\"SELECT * FROM users WHERE user_username='$user_name'\", 'user_id');\n}", "static public function getUser($username)\n {\n $user = User::where('username', $username)->first();\n if(!$user){\n $user = User::where('email', $username)->first();\n }\n return $user;\n }", "public function getUser($username)\r\n {\r\n\r\n $stmt = $this->connection()->prepare(\"SELECT * FROM users WHERE username=? OR email=?\");\r\n \r\n $stmt->execute([$username,$username]);\r\n if($stmt->rowCount())\r\n {\r\n return true;\r\n }\r\n else{\r\n return false;\r\n }\r\n }", "public static function findByUsername($username)\n {\n return static::findOne(['login' => $username]);\n }", "function getUserInformationByUsername($username)\n\t{\n\t\t$response = '';\n\n\t\tif( $this->token != '' )\n\t\t{\n\t\t\t$filter_arguments = array(\n\t\t\t\t\"filter\" => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t\"portal_name\" => array(\n\t\t\t\t\t\t\t'$equals' => $username,\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t\"offset\" => 0,\n\t\t\t\t\"fields\" => \"id,portal_name,portal_password,email,treat_hematology_patients_c,specialty_c\",\n\t\t\t);\n\t\t\t$url = $this->url . \"/Contacts/filter\";\n\t\t\t$response = self::call($url, $this->token, 'GET', $filter_arguments);\n\t\t}\n\n\t\t$isUser = $response->records[0]->portal_name;\n\n\t\tif( $isUser == $username )\n\t\t{\n\t\t\treturn $response;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getByUsername($username)\n {\n return $this->getUserRepository()->findByUsername($username);\n }", "function getUserExists($username)\n\t{\n\t\tif( $this->token != '' )\n\t\t{\n\t\t\t$filter_arguments = array(\n\t\t\t\t\"filter\" => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t\"portal_name\" => array( '$equals' => $username,\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t\"offset\" => 0,\n\t\t\t\t\"fields\" => \"id,portal_name\",\n\t\t\t);\n\n\t\t\t$url = $this->url.\"/Contacts/filter\";\n\n\t\t\t$response = self::call($url, $this->token, 'POST', $filter_arguments);\n\n\t\t\t$isUser = $response->records[0]->portal_name;\n\n\t\t\tif($isUser == $username)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public function loadUserByUsername($username): UserInterface\n {\n $repository = $this->getDoctrine()->getRepository(User::class);\n\n $userData = $repository->findOneBy(['username' => $username]);\n\n if ($userData) {\n return $userData;\n }\n\n throw new UsernameNotFoundException(sprintf('Le pseudo \"%s\" n\\'existe pas.', $username));\n }" ]
[ "0.7941892", "0.7941892", "0.7941892", "0.7617345", "0.75134575", "0.7474061", "0.74112356", "0.7314069", "0.72018313", "0.71878403", "0.7180881", "0.71486443", "0.7132451", "0.7121639", "0.7098833", "0.70721287", "0.7070608", "0.7060042", "0.7044413", "0.70383894", "0.70237184", "0.7019674", "0.70118743", "0.69980127", "0.69480574", "0.6945469", "0.6929106", "0.6925388", "0.69195473", "0.68471354", "0.68335474", "0.68297297", "0.68239504", "0.68163687", "0.6813489", "0.68003297", "0.67759484", "0.67759484", "0.67759484", "0.6772869", "0.67301184", "0.67287105", "0.6705895", "0.6695845", "0.66952187", "0.66872585", "0.6671536", "0.66693586", "0.66636384", "0.66630805", "0.6656326", "0.66498095", "0.6643498", "0.6616453", "0.661632", "0.65968406", "0.6591954", "0.6591513", "0.6578988", "0.6567622", "0.6550203", "0.6544914", "0.65443385", "0.65443385", "0.65435004", "0.6540258", "0.6535061", "0.6532528", "0.65324277", "0.6528035", "0.65203893", "0.65082645", "0.6508137", "0.6505793", "0.6502075", "0.64867043", "0.64825433", "0.6468088", "0.64619005", "0.6450676", "0.64473003", "0.6441999", "0.6441999", "0.64401186", "0.64391804", "0.6416843", "0.6401307", "0.6396389", "0.639551", "0.63856363", "0.637916", "0.63743705", "0.63700575", "0.6368085", "0.6364405", "0.6361454", "0.63533014", "0.63509", "0.63489866", "0.63304037", "0.63274235" ]
0.0
-1
Display a listing of the resource.
public function index() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(CommentsRequest $request, Guard $auth) { $data = $request->only('username','email','content','post_id'); if($auth->user()){ $data['user_id'] = $auth->user()->id; } Comment::create($data); return redirect()->back()->with('success', 'Merci pour votre commentaire'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
make $file_name relative and $full_file_path full
public function paths($file_dir, $file_name) { if (stripos($file_name, $file_dir) === 0) { $full_file_path = $file_name; $file_name = implode('/', array_diff(explode('/', $file_name), explode('/', $file_dir))); } else { $full_file_path = $file_dir . '/' . $file_name; } $this->logger->debug(__METHOD__ . ' ' . $file_name . ' or ' . $full_file_path); return [$file_name, $full_file_path]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function makeFull($uri, $file_name) {\n\t\t$key = sprintf('full/%s', $file_name);\n\t\t$this->makeImageFit($key, $uri, $file_name, 726);\n\t}", "function make_filename($filename, $xs_include = false)\n\t{\n\t\t// Check replacements list\n\t\tif(isset($this->replace[$filename]))\n\t\t{\n\t\t\tif(!$xs_include)\n\t\t\t{\n\t\t\t\t$filename = $this->replace[$filename];\n\t\t\t\tif($filename === false)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif($this->replace[$filename] === false)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// Check if it's an absolute or relative path.\n\t\tif ((substr($filename, 0, 1) !== '/') && (substr($filename, 1, 1) !== ':'))\n\t\t{\n\t\t\treturn $this->root . '/' . $filename;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn str_replace('\\\\', '/', $filename);\n\t\t}\n\t}", "protected function generateFullPathToUploadFile()\n {\n // $this->fullPathToUploadFile = str_replace(\"/\", \"\\\\\", storage_path('app/' . $this->pathToFile));\n $this->fullPathToUploadFile = storage_path('app/' . $this->pathToFile);\n }", "public function relativePath($fullPath, $fileName, $basePath = null);", "public function get_full_relative_path(){\n\t\treturn $this->dir . '/' . $this->get_full_name();\n\t}", "function getFileFullPath($fileName) {\n\tglobal $GrunPath;\n\treturn $GrunPath.\"/\".$fileName;\n}", "function make_filename($filename)\n\t{\n\t\tif (substr($filename, 0, 1) != '/')\n\t\t{\n// \t\t$filename = phpbb_realpath($this->root . '/' . $filename);\n \t\t$filename = $this->root . '/' . $filename;\n\t\t}\n\n\t\tif (!file_exists($filename))\n\t\t{\n\t\t\tdie(\"Template->make_filename(): Error - file $filename does not exist\");\n\t\t}\n\n\t\treturn $filename;\n\t}", "public function getFileAbsolutePath($file);", "public function getFullPath($name);", "function absolute_to_relative($filepath) {\n\treturn str_replace(__CHV_ROOT_DIR__, __CHV_RELATIVE_ROOT__, str_replace('\\\\', '/', $filepath));\n}", "function relative_to_absolute($filepath) {\n\treturn str_replace(__CHV_RELATIVE_ROOT__, __CHV_ROOT_DIR__, str_replace('\\\\', '/', $filepath));\n}", "private function un_ms_file_rewrite_path($url_to_file){\n\t\t\n\t\t$basedir = wp_upload_dir();\n\t\t$basedir = $basedir['basedir'];\n\t\t$date_folder = NULL;\n\t\tpreg_match('#/[0-9]{4}/[0-1]{1}[0-9]{1}#', $url_to_file, $date_folder);\n\t\t$path_to_file = $basedir . $date_folder[0] . '/' . basename($url_to_file);\n\t\t//at this point, we have the full unix path to the file. This is bad on the internet.\n\t\t\n\t\t//strip the unnecessary unix stuff at the beginning and replace it with the domain name\n\t\t$path_to_file = strstr($path_to_file, 'wp-content');\n\t\t\n\t\t//build the domain-based path\n\t\t$url_build = get_site_url();\n\t\t\n\t\treturn $url_build .'/'. $path_to_file;\n\t}", "protected function fileOptionToFullPath($relativePath){\n return getcwd() . '/' . ltrim($relativePath, '/');\n }", "function FileName($fullDir) {\n\n $slash = strrpos($fullDir, '/'); //find the last slash in the directory\n\n if($slash == false)//if unable to find the forward slash\n $slash = strrpos($fullDir, '\\\\');//find the backslash (for localhost)\n\n return substr($fullDir, $slash + 1, strlen($fullDir));//get the file name\n}", "function cap_make_path_relative_to ($path, $base)\n{\n $base = rtrim ($base, '/') . '/';\n if (strncmp ($path, $base, strlen ($base)) == 0) {\n return substr ($path, strlen ($base));\n }\n return $path;\n}", "function shortFileName($filename)\r\n{\r\n\t$i = LastIndexOf($filename,'/');\r\n\tif($i < 0 ) $i= LastIndexOf($filename,'\\\\');\r\n\tif($i < 0 ) return $filename;\r\n\treturn substr($filename,$i+1);\r\n}", "protected function prepareFile($file)\n {\n return ltrim(str_replace('\\\\', '/', $file), '/');\n }", "function __sfPageContentTask_rel2abs_replace($file,$url){\n if(preg_match(\"|^/|\",$url)) return $url;\n if(preg_match(\"|^#|\",$url)) return $url;\n if(preg_match(\"|^https?://|\",$url)) return $url;\n if(preg_match(\"|^mailto:|\",$url)) return $url;\n $abs = \"/\" . dirname($file).\"/\".$url;\n $abs = str_replace(\"/./\",\"/\",$abs);\n do{\n $abs = preg_replace(\"|/[^/]+/../|\",\"/\",$abs,-1,$c);\n }while($c);\n return $abs;\n}", "private function normalizeFile($file)\n {\n if(substr($file, -1) !=='/') {\n $file = $file.'/';\n }\n\n return $file;\n }", "public function setFull_Filename(){\n \t $this->filename = $this->setDestination().'/'.$this->id.'.'.$this->ext;; \n\t}", "protected function getRelativePath($filename) {\n\t\treturn str_replace('EXT:', t3lib_extMgm::siteRelPath('supersized'), $filename);\n\t}", "public function generatePath($filename);", "function filetourl($file) {\r\n\t\t\treturn str_replace(ABSPATH , get_site_url().'/' ,$file);\r\n\t\t}", "public function realpath($file);", "protected function shortFileName($filename){\n\t\t$i = $this->lastIndexOf($filename,'/');\n\t\tif($i < 0 ) $i= $this->lastIndexOf($filename,'\\\\');\n\t\tif($i < 0 ) return $filename;\n\t\treturn substr($filename,$i+1);\n\t}", "function _getTemplateFullpath($file)\n {\n \t$cfg\t=& CFactory::getConfig();\n \tif(!JString::strpos($file, '.php'))\n \t{\n \t\t$filename\t= $file;\n \t\t\n \t\t// Test if template override exists in joomla's template folder\n \t\t$mainframe\t\t=& JFactory::getApplication();\n\t\t\t\n \t\t$overridePath\t= JPATH_ROOT . DS . 'templates' . DS . $mainframe->getTemplate() . DS . 'html';\n \t\t$overrideExists\t= JFolder::exists( $overridePath . DS . 'com_community' );\n\t\t\t$template\t\t= COMMUNITY_COM_PATH . DS . 'templates' . DS . $cfg->get('template') . DS . $filename . '.php';\n \n \t\t// Test override path first\n \t\tif( JFile::exists( $overridePath . DS . 'com_community' . DS . $filename . '.php') )\n \t\t{\n \t\t\t// Load the override template.\n\t\t\t\t$file\t= $overridePath . DS . 'com_community' . DS . $filename . '.php';\n\t\t\t}\n \t\telse if( JFile::exists( $template ) && !$overrideExists )\n \t\t{\n\t \t\t\t// If override fails try the template set in config\n\t\t\t\t$file\t= $template;\n \t\t}\n \t\telse\n \t\t{\n \t\t\t// We assume to use the default template\n \t\t\t$file\t= COMMUNITY_COM_PATH . DS . 'templates' . DS . 'default' . DS . $filename . '.php';\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t \t\t\t\n\t\t\t}\n \t}\n \t\n \treturn $file;\n\t}", "static public function uploadFile(&$file, $path_relative = '', $pre_name = \"\")\n {\n\n #Verify directory name\n if (!file_exists(IMAGES)) {\n mkdir(IMAGES, 0777);\n }\n\n if ( !file_exists(IMAGES . $path_relative) ) {\n mkdir(IMAGES . $path_relative, 0777);\n }\n\n $imagen_url = '';\n\n if (!empty($file['name']))\n {\n $name = $file['name'] ;\n # extension file\n $info = new SplFileInfo($name);\n $extension = $info->getExtension();\n\n # new name and url imgen\n $new_name = $pre_name.date('YmdHms',time()).mt_rand(1000,9999) .\".{$extension}\" ;\n\n if(!empty($path_relative)) {\n $imagen_url = \"{$path_relative}/{$new_name}\" ;\n }\n else{\n $imagen_url = \"{$new_name}\" ;\n }\n\n $imagen_url = IMAGES_DIR. \"/{$imagen_url}\" ;\n\n # ruta destino(donde se movera el archivo )\n $ruta_destino = IMAGES.'../'.\"{$imagen_url}\";\n // echo $ruta_destino ;\n\n // echo $ruta_destino ;\n $file_ok = move_uploaded_file($file['tmp_name'], $ruta_destino);\n\n $imagen_url = $imagen_url ;\n\n }elseif ($file[\"error\"] > 0)\n {\n // echo \"Error: \" . $file['error'] . \"<br>\";\n $imagen_url = \"\";\n }\n\n return $imagen_url ;\n\n }", "function relative_to_url($filepath) {\n\treturn str_replace(__CHV_RELATIVE_ROOT__, __CHV_BASE_URL__, str_replace('\\\\', '/', $filepath));\n}", "private function shorten_path($path, $file)\n {\n $flen = strlen($file);\n $res = (strlen($path)>64-$flen) ? substr($path, 0, 64-$flen).\"...\" : $path;\n return $res;\n }", "static function filename2url($filename) {\n\t\t$slashPos = -1;\n\t\twhile(($slashPos = strpos($filename, \"/\", $slashPos+1)) !== false) {\n\t\t\tif(substr($filename, 0, $slashPos) == substr($_SERVER['SCRIPT_FILENAME'],0,$slashPos)) {\n\t\t\t\t$commonLength = $slashPos;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$urlBase = substr($_SERVER['PHP_SELF'], 0, -(strlen($_SERVER['SCRIPT_FILENAME']) - $commonLength));\n\t\t$url = $urlBase . substr($filename, $commonLength);\n\t\t$protocol = $_SERVER['HTTPS'] ? \"https\" : \"http\";\n\t\treturn \"$protocol://\". $_SERVER['HTTP_HOST'] . $url;\n\n\t\t// Count the number of extra folders the script is in.\n\t\t// $prefix = str_repeat(\"../\", substr_count(substr($_SERVER[SCRIPT_FILENAME],$commonBaseLength)));\n\t}", "public function getFullPath();", "protected function createPath($file)\n\t{\n\t\treturn str_replace(DIRECTORY_SEPARATOR, '/', dirname(__DIR__)) . '/' . $file;\n\t}", "protected function getFullPath(string $file): string\n {\n for ($i = 0;\n !file_exists(\n $fullPath = __DIR__ . '/' . str_repeat('../', $i) . $file\n ) && $i < 100;\n $i++) {\n }\n return $fullPath;\n }", "public function realPath($relativeFilename) { \n // Check for absolute path \n if (realpath($relativeFilename) == $relativeFilename) return $relativeFilename; \n \n // Otherwise, treat as relative path \n $paths = explode(PATH_SEPARATOR, get_include_path()); \n foreach ($paths as $path) { \n $path = str_replace('\\\\', '/', $path); \n $path = rtrim($path, '/') . '/'; \n $fullpath = realpath($path . $relativeFilename); \n if ($fullpath) return $fullpath; \n } \n \n return false; \n }", "public static function file($file, $index = NO) {\n\t\tif(strpos($file, '://') === NO) {\n\t\t\t// Add the base URL to the filename\n\t\t\t$file = url::base($index).$file;\n\t\t}\n\n\t\treturn $file;\n\t}", "private static function absolutize( $path, $base ) {\n\t\tif ( ! empty( $path ) && ! \\WP_CLI\\Utils\\is_path_absolute( $path ) ) {\n\t\t\t$path = $base . DIRECTORY_SEPARATOR . $path;\n\t\t}\n\t\treturn $path;\n\t}", "function getFullPath( $file, $relative = NULL, $check = true )\n\t{\n\t\t$inConfigDir\t=\tfalse;\n\t\t//\tis it a relative path\n\t\tif( strncmp( $file, '/', 1 ) != 0 )\n\t\t{\n\t\t\tif( $relative !== NULL )\n\t\t\t{\n\t\t\t\t$path\t\t=\tdirname( $relative ) . '/' . $file;\n\t\t\t}\n\t\t\t//\tno other file and no absolute path => the file should be located in config Dir\n\t\t\telse\n\t\t\t{\n\t\t\t\t$path\t\t\t=\t$file;\n\t\t\t\t$inConfigDir\t=\ttrue;\n\t\t\t}\n\t\t}\n\t\t//\tabsolute path\n\t\telse\n\t\t{\n\t\t\t$path\t\t\t=\tsubstr( $file, 1 );\n\t\t\t$inConfigDir\t=\ttrue;\n\t\t}\n\t\tif( $inConfigDir )\n\t\t{\n\t\t\tif( !empty( $this->configDir ) )\n\t\t\t\t$fullPath\t=\t$this->configDir.'/'. $path;\n\t\t\telse\n\t\t\t\t$fullPath\t=\t$path;\n\t\t}\n\t\telse\n\t\t\t$fullPath\t=\t$path;\n\n\t\tif( $check )\n\t\t{\n\t\t\t$realPath\t=\trealpath( $fullPath );\n\t\t\tif( empty( $realPath ) )\n\t\t\t{\n\t\t\t\treturn patErrorManager::raiseError(\n\t\t\t\t\t\t\t\t\t\t\tPATCONFIGURATION_ERROR_FILE_NOT_FOUND,\n\t\t\t\t\t\t\t\t\t\t\t'Could not resolve full path for path: \\''.$file.'\\' (relative to \\''.$relative.'\\') - please check the path syntax.'\n\t\t\t\t\t\t\t\t\t\t\t );\n\t\t\t}\n\n\t\t\tif( !is_readable( $realPath ) )\n\t\t\t{\n\t\t\t\treturn patErrorManager::raiseError(\n\t\t\t\t\t\t\t\t\t\t\tPATCONFIGURATION_ERROR_FILE_NOT_READABLE,\n\t\t\t\t\t\t\t\t\t\t\t$file.' is not readable'\n\t\t\t\t\t\t\t\t\t\t\t );\n\t\t\t}\n\t\t\treturn\t$realPath;\n\t\t}\n\n\t\treturn\t$fullPath;\n\t}", "public function getAbsolutePath ($filename)\n {\n $filename = str_replace('/../', '/', $filename); // TODO improve\n return $this->getHelpRootDir ().$filename.'.mkd';\n }", "function make_filename_cache($file)\n\t{\n\t\t$str = str_replace($this->cache_search, $this->cache_replace, $file);\n\t\tif(substr($file, 0, $this->tpldir_len) !== $this->tpldir || empty($this->tpl))\n\t\t{\n\t\t\treturn $this->cachedir . XS_TPL_PREFIX2 . $str;\n\t\t}\n\t\t// removing not needed part\n\t\t$file = substr($file, $this->tpldir_len, strlen($file));\n\t\t// creating filename\n\t\treturn $this->cachedir . XS_TPL_PREFIX . str_replace($this->cache_search, $this->cache_replace, $file);\n\t}", "function completePath(){\n \treturn $this->path . $this->name;\n }", "function absolute_to_url($filepath) {\n\tif(__CHV_ROOT_DIR__===__CHV_RELATIVE_ROOT__) {\n\t\treturn __CHV_BASE_URL__.ltrim($filepath, '/');\n\t}\n\treturn str_replace(__CHV_ROOT_DIR__, __CHV_BASE_URL__, str_replace('\\\\', '/', $filepath));\n}", "private function get_relative_file( $file ) {\n\t\treturn ltrim( str_replace( dirname( app()->plugin_file ), '', $file ), '/' );\n\t}", "function format_url($file_path)\n{\n $path_component = explode('/', $file_path);\n $path_component = array_map('rawurlencode', $path_component);\n\n return implode('/', $path_component);\n}", "function _makeAbsolutePath($path, $sourcePath, $parentPath)\n\t{\n\t\tif (!preg_match('|^[a-z]+://|i', $path)) {\n\t\t\tif (substr($path, 0, 1) == \"/\") {\n\t\t\t\t// if href is an absolute URL convert it into a relative URL\n\t\t\t\t$path = makeRelativePath($sourcePath, $path);\n\t\t\t} else \n\t\t\t\tif (substr($path, 0, 2) == \"./\") {\n\t\t\t\t\t// if href is a relative URL starting with \"./\" remove the \"./\"\n\t\t\t\t\t$path = substr($path, 2);\n\t\t\t\t}\n\t\t\t// Make absolute Path out of it\n\t\t\twhile (substr($path, 0, 3) == \"../\" && strlen($parentPath) > 0 && $parentPath != \"/\") {\n\t\t\t\t$parentPath = dirname($parentPath);\n\t\t\t\t$path = substr($path, 3);\n\t\t\t}\n\t\t\tif (substr($parentPath, -1) != \"/\") {\n\t\t\t\t$parentPath = $parentPath . \"/\";\n\t\t\t}\n\t\t\treturn $parentPath . $path;\n\t\t}\n\t\treturn $path;\n\t}", "function file_upload_path($original_filename, $upload_subfolder_name = 'uploads') \n\t {\n\t $current_folder = dirname(__FILE__);\n\t \n\t $path_segments = [$current_folder, $upload_subfolder_name, basename($original_filename)];\n\n\t return join(DIRECTORY_SEPARATOR, $path_segments);\n\t }", "abstract public function getLocalPath(File $file);", "function generateSubPathFolder($filename) {\n \t$photo_subpath = '';\n \t$sub_part = explode('-',$filename);\n \t\n \tif(!empty($sub_part[1])) {\n\t\t\t$photo_subpath = substr($sub_part[1], 0, 1);\n\t\t}\n \t\n \treturn (string)$photo_subpath;\n }", "public function translatePath($fileName)\n\t{\n\t\t$fileName = str_replace('\\\\', '/', $fileName);\n\n\t\t$realDir = rtrim($this->directory, '/');\n\t\t$realDir .= '/' . dirname($fileName);\n\t\t$realDir = '/' . ltrim($realDir, '/');\n\n\t\t$fileName = $realDir . '/' . basename($fileName);\n\n\t\treturn $fileName;\n\t}", "function getTargetFileName() ;", "function translatePath($file) {\n // // // // //\n // // /// ///\n ////// // // ///\n // // /////// // //\n // // // // // //\n return substr($file, strlen(dirname($_SERVER['SCRIPT_FILENAME']))+1);\n }", "function absolute_to_relative_path($path)\n{\n $pathParts = explode(DIRECTORY_SEPARATOR, $path);\n $pathParts = array_reverse($pathParts);\n array_splice($pathParts, 5);\n $pathParts = array_reverse($pathParts);\n $returnPath = CCTVALIASPATH . DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $pathParts);\n $returnPath = str_replace('\\\\', '/', $returnPath);\n return $returnPath;\n}", "static function url2fullPath( $url )\n {\n $url = self::normalize( $url );\n\n $uri = isset( $_SERVER[ 'SCRIPT_NAME' ] )\n ? $_SERVER[ 'SCRIPT_NAME' ] : ( isset( $_SERVER[ 'PHP_SELF' ] )\n ? $_SERVER[ 'PHP_SELF' ]\n : false );\n\n $uri = self::normalize( $uri );\n\n if( substr( $url, 0, 1 ) !== \"/\" ){\n if( $uri === false ) return false;\n $url = dirname( $uri ) . \"/$url\";\n }\n\n if( isset( $_SERVER[ 'DOCUMENT_ROOT' ] ) ){\n return self::normalize( $_SERVER[ 'DOCUMENT_ROOT' ] . \"/$url\" );\n\n } else{\n if( $uri === false ) return false;\n\n if( isset( $_SERVER[ 'SCRIPT_FILENAME' ] ) ){\n $scr_filename = self::normalize( $_SERVER[ 'SCRIPT_FILENAME' ] );\n return self::normalize( substr( $scr_filename, 0, -strlen( $uri ) ) . \"/$url\" );\n }\n\n $count = count( explode( '/', $uri ) ) - 1;\n for( $i = 0, $chdir = \"\"; $i < $count; $i++ )\n $chdir .= \"../\";\n $chdir = self::normalize( $chdir );\n\n $dir = getcwd();\n if( ( $dir === false ) || !@chdir( $chdir ) )\n return false;\n $rdir = getcwd();\n chdir( $dir );\n return ( $rdir !== false ) ? self::normalize( $rdir . \"/$url\" ) : false;\n }\n }", "function papi_get_file_path( $file ) {\n\tif ( empty( $file ) || ! is_string( $file ) ) {\n\t\treturn;\n\t}\n\n\t$directories = papi_filter_settings_directories();\n\t$file = '/' . str_replace( ' ', '-', str_replace( '_', '-', $file ) );\n\n\tforeach ( $directories as $directory ) {\n\t\tif ( file_exists( $directory . $file ) ) {\n\t\t\treturn $directory . $file;\n\t\t}\n\n\t\tif ( file_exists( $directory . $file . '.php' ) ) {\n\t\t\treturn $directory . $file . '.php';\n\t\t}\n\t}\n}", "private function format_path($path, $file)\n {\n // Use consistent slashes\n if(DIRECTORY_SEPARATOR == '/')\n $path = str_replace('\\\\', '/', $path);\n else if(DIRECTORY_SEPARATOR == '\\\\')\n $path = str_replace('/', '\\\\', $path);\n\n if($this->shorten)\n {\n $path = $this->shorten_path($path, $file);\n }\n\n return $path.DIRECTORY_SEPARATOR.$file;\n }", "public function makeRelativePath($path, $base)\n\t{\n\t\treturn str_replace($base . '/', '', $path);\n\t}", "public function getFullPath(): string;", "public static function getFullPath($fileResource)\n {\n $extensionManager = OntoWiki::getInstance()->extensionManager;\n $privateConfig = $extensionManager->getPrivateConfig('files');\n $path = $privateConfig->path;\n\n return _OWROOT . $path . DIRECTORY_SEPARATOR . md5($fileResource);\n }", "public function getFullFilePath()\n {\n return $this->basePath . $this->mediaFile->getFileName();\n }", "private function buildFilePath (array $directories, string $fileName) : string\n {\n $dir = !empty($directories)\n ? \"/\" . \\implode(\"/\", $directories)\n : \"\";\n\n $file = \"\" !== $fileName\n ? \"/{$fileName}\"\n : \"\";\n\n return $dir . $file;\n }", "public static function absolutize($base, $relative)\n {\n }", "public static function absolutize($base, $relative)\n {\n }", "function url_to_filename($url_full)\n{\n require_code('urls2');\n return _url_to_filename($url_full);\n}", "function _wp_get_attachment_relative_path($file)\n {\n }", "public function get_full_file_name() {\r\n return (string) $this->full_file;\r\n }", "function quail_server_build_absolute($absolute, $relative) {\n $p = parse_url($relative);\n if ($p[\"scheme\"]) {\n return $relative;\n }\n extract(parse_url($absolute));\n \n $path = dirname($path); \n \n if ($relative{0} == '/') {\n $c_parts = array_filter(explode(\"/\", $relative));\n }\n else {\n $a_parts = array_filter(explode(\"/\", $path));\n $r_parts = array_filter(explode(\"/\", $relative));\n $c_parts = array_merge($a_parts, $r_parts);\n foreach ($c_parts as $i => $part) {\n if ($part == '.') {\n $c_parts[$i] = NULL;\n }\n if ($part == '..') {\n $c_parts[$i - 1] = NULL;\n $c_parts[$i] = NULL;\n }\n }\n $c_parts = array_filter($c_parts);\n }\n $path = implode(\"/\", $c_parts);\n $url = \"\";\n if ($scheme) {\n $url = \"$scheme://\";\n }\n if ($user) {\n $url .= \"$user\";\n if ($pass) {\n $url .= \":$pass\";\n }\n $url .= \"@\";\n }\n if ($host) {\n $url .= \"$host/\";\n }\n $url .= $path;\n return $url;\n\n}", "function adjust_relative_path($path = false, $relative_path = false) {\r\n\t\tif($path === false) {\r\n\t\t\tprint('Path: ' . $path . ' or relative path: ' . $relative_path . ' for function resolve_relative_path was imporperly specifed.');\r\n\t\t}\r\n\t\t//$exploded_file_path = explode('/', $this->file);\r\n\t\t$exploded_path = explode('/', $path);\r\n\t\t$exploded_relative_path = explode('/', $relative_path);\r\n\t\t$path_counter = 0;\r\n\t\twhile($exploded_path[$path_counter] === '..') {\r\n\t\t\t$path_counter++;\r\n\t\t}\r\n\t\t$part_to_keep = '';\r\n\t\t$path_counter2 = $path_counter;\r\n\t\twhile($path_counter2 < sizeof($exploded_path)) {\r\n\t\t\t$part_to_keep .= '/' . $exploded_path[$path_counter2];\r\n\t\t\t$path_counter2++;\r\n\t\t}\r\n\t\t$relative_path_counter = sizeof($exploded_relative_path);\r\n\t\twhile($path_counter > -1) {\r\n\t\t\t$relative_path_counter--;\r\n\t\t\t$path_counter--;\r\n\t\t}\r\n\t\t$part_to_keep2 = '';\r\n\t\t$relative_path_counter2 = 0;\r\n\t\twhile($relative_path_counter > 0) {\r\n\t\t\t$part_to_keep2 .= '../';\r\n\t\t\t$relative_path_counter2++;\r\n\t\t\t$relative_path_counter--;\r\n\t\t}\r\n\t\t$resolved_path = substr($part_to_keep2, 0, strlen($part_to_keep2) - 1) . $part_to_keep;\r\n\t\t//print('$path, $relative_path, $resolved_path: ');var_dump($path, $relative_path, $resolved_path);\r\n\t\treturn $resolved_path;\r\n\t}", "private function getFullFileName($name)\n {\n return config('filesystems.disks.public.root') . DIRECTORY_SEPARATOR . $this->imagesFolder . DIRECTORY_SEPARATOR . $name;\n }", "function getTargetFile() ;", "function assets_path( $relative, $file )\n {\n // Preparation\n $route = preg_replace( '/\\\\\\\\/', '/', $file );\n $path = rtrim( preg_replace( '/\\\\\\\\/', '/', get_wp_home_path() ), '/' );\n // Clean base path\n $route = preg_replace( '/.+?(?=wp-content)/', '', $route );\n // Clean project relative path\n $route = preg_replace( '/\\/app[\\/\\\\\\\\A-Za-z0-9\\.\\-]+/', '', $route );\n $route = preg_replace( '/\\/assets[\\/\\\\\\\\A-Za-z0-9\\.\\-]+/', '', $route );\n $route = preg_replace( '/\\/vendor[\\/\\\\\\\\A-Za-z0-9\\.\\-]+/', '', $route );\n return $path.'/'.apply_filters( 'app_route_path', $route ).'/assets/'.$relative;\n }", "public function calculateFullPath($start_path)\n {\n \treturn $start_path . $this->getPath() . \"/\" ;\n }", "protected function formatUploadPath( $root_path, $target_name, $src_ext, $target_ext='', $sub_dir='' )\n\t{\n\t\t/* format destination image path */\n\t\tif ($target_ext==\"\") {\n\t\t\t$target_ext=$src_ext;\n\t\t}\n\t\t$target_name = substr($target_name, 0, strrpos($target_name,\".\")).\".\".$target_ext;\n\t\treturn($root_path.$this->image_dir.$sub_dir.$target_name);\n\t}", "private function get_real_filename( $file_url )\n {\n $path = $this->getConfig( 'content_dir' ) . $file_url . $this->getConfig( 'content_ext' );\n return realpath( $path );\n }", "protected function getTargetFile() {\r\n\t\treturn str_replace('%s', $this->currentDate, $this->file);\r\n\t}", "private function denormalizeFileUri(string $uri): string\n {\n $filesystem = new SymfonyFileSystem();\n if (!$filesystem->isAbsolutePath($uri)) {\n $uri = sprintf('%s%s%s', $this->filesDir, DIRECTORY_SEPARATOR, ltrim($uri, DIRECTORY_SEPARATOR));\n }\n\n return $uri;\n }", "protected function contcatPath($path, $file) {\n return rtrim($path, '/') . '/' . ltrim($file, '/');\n }", "public static function relativePath($filename = null)\n {\n $path = 'uploads/'.auth()->id();\n\n if (is_string($filename)) {\n $path .= '/'.$filename;\n }\n\n return $path;\n }", "public function buildFilepath(Smarty $smarty = null)\n {\n }", "function file_newname($path, $filename){\n if ($pos = strrpos($filename, '.')) {\n $name = substr($filename, 0, $pos);\n $ext = substr($filename, $pos);\n } else {\n $name = $filename;\n }\n\n $newpath = $path.'/'.$filename;\n $newname = $filename;\n $counter = 0;\n while (file_exists($newpath)) {\n $newname = $name .'_'. $counter . $ext;\n $newpath = $path.'/'.$newname;\n $counter++;\n }\n\n return $newname;\n }", "public function getAbsolutePath()\n\t{\n\t\treturn rtrim($this->UploadDestination->server_path, '/') . '/_' . $this->short_name . '/';\n\t}", "function _wp_relative_upload_path($path)\n {\n }", "public function getRelativeMediaPath($fileName)\n {\n return str_replace(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA), Mage_Core_Model_Store::URL_TYPE_MEDIA . '/', $fileName);\n }", "function tfuse_get_file_uri($file) {\r\n $file = ltrim($file, '/');\r\n if (file_exists(STYLESHEETPATH . '/' . $file))\r\n return get_stylesheet_directory_uri() . '/' . $file;\r\n else if (file_exists(get_template_directory() . '/' . $file))\r\n return get_template_directory_uri() . '/' . $file;\r\n else\r\n return $file;\r\n }", "private static function _dsFixFile($filename) {\n\t\t$ds = DS;\n\t\t$notDs = DS == '/' ? '\\\\' : '/';\n\t\t$filename = str_replace($notDs, $ds, $filename);\n\t\t$filename = str_replace($ds . $ds, $ds, $filename);\n\t\treturn $filename;\n\t}", "private function buildFilePath($serverAddress, $path, $dir, $file) {\n return $serverAddress . '/' . $dir . '/' . $file . '?' . filemtime($path . '/' . $dir . '/' . $file);\n }", "public function get_thumb_relative_path(){\n\t\treturn $this->dir . '/' . $this->get_thumb_name();\n\t}", "function _get_template_edit_filename($fullpath, $containingfolder)\n {\n }", "private function trimFilename($file)\n {\n return ltrim(str_replace($this->basePath, '', $file->getPathname()), '/');\n }", "function resolve_relative_path($path = false, $relative_path = false) {\r\n\t\tif($path === false) {\r\n\t\t\tprint('Path: ' . $path . ' or relative path: ' . $relative_path . ' for function resolve_relative_path was imporperly specifed.');\r\n\t\t}\r\n\t\t//$exploded_file_path = explode('/', $this->file);\r\n\t\t$exploded_path = explode('/', $path);\r\n\t\t$exploded_relative_path = explode('/', $relative_path);\r\n\t\t$path_counter = 0;\r\n\t\twhile($exploded_path[$path_counter] === '..') {\r\n\t\t\t$path_counter++;\r\n\t\t}\r\n\t\t$part_to_keep = '';\r\n\t\t$path_counter2 = $path_counter;\r\n\t\twhile($path_counter2 < sizeof($exploded_path)) {\r\n\t\t\t$part_to_keep .= '/' . $exploded_path[$path_counter2];\r\n\t\t\t$path_counter2++;\r\n\t\t}\r\n\t\t$relative_path_counter = sizeof($exploded_relative_path);\r\n\t\twhile($path_counter > -1) {\r\n\t\t\t$relative_path_counter--;\r\n\t\t\t$path_counter--;\r\n\t\t}\r\n\t\t$part_to_keep2 = '';\r\n\t\t$relative_path_counter2 = 0;\r\n\t\twhile($relative_path_counter > 0) {\r\n\t\t\t$part_to_keep2 .= $exploded_relative_path[$relative_path_counter2] . '/';\r\n\t\t\t$relative_path_counter2++;\r\n\t\t\t$relative_path_counter--;\r\n\t\t}\r\n\t\t$resolved_path = substr($part_to_keep2, 0, strlen($part_to_keep2) - 1) . $part_to_keep;\r\n\t\t//print('$path, $relative_path, $resolved_path: ');var_dump($path, $relative_path, $resolved_path);\r\n\t\treturn $resolved_path;\r\n\t}", "function fn_find_file($prefix, $file, $company_id = null)\n{\n $file = Bootstrap::stripSlashes($file);\n\n // Url\n if (strpos($file, '://') !== false) {\n return $file;\n }\n\n $prefix = fn_normalize_path(rtrim($prefix, '/'));\n $file = fn_normalize_path($file);\n $files_path = fn_get_files_dir_path($company_id);\n\n // Absolute path\n if (is_file($file) && strpos($file, $files_path) === 0) {\n return $file;\n }\n\n // Path is relative to files directory\n if (is_file($files_path . $file)) {\n return $files_path . $file;\n }\n\n // Path is relative to prefix inside files directory\n if (is_file($files_path . $prefix . '/' . $file)) {\n return $files_path . $prefix . '/' . $file;\n }\n\n // Prefix is absolute path\n if (strpos($prefix, $files_path) === 0 && is_file($prefix . '/' . $file)) {\n return $prefix . '/' . $file;\n }\n\n return false;\n}", "private function getNewResourceName(\r\n\t\t\t$wp) {\r\n\t\t$massagedFileName = str_replace ( ' ', '_', \r\n\t\t\t\tstr_replace ( '-', '_', strtolower ( strip_tags ( $_FILES [\"file1\"] [\"name\"] ) ) ) );\r\n\t\twhile ( true ) {\r\n\t\t\tif (strpos ( $massagedFileName, '__' ) === false)\r\n\t\t\t\tbreak;\r\n\t\t\t$massagedFileName = str_replace ( '__', '_', $massagedFileName );\r\n\t\t}\r\n\t\tif ($massagedFileName->length > 190) {\r\n\t\t\treturn substr ( $massagedFileName, 0, 80 ) . '_' . substr ( $massagedFileName, \r\n\t\t\t\t\t$massagedFileName->length - 81, 80 );\r\n\t\t} else {\r\n\t\t\treturn $massagedFileName;\r\n\t\t}\r\n\t}", "static public function makeContentFilePath($num, $full = true) {\n\t\t$realnum = $num;\n\t\t$num = (int) $num;\n\t\t$word = 4; // a word is four bytes long\n\t\t$bin_in_hex = 4; // one hex character corresponds to four binary digits\n\t\t$path = str_repeat('+/', $num >> ($word * $bin_in_hex));\n\t\t$hex = str_pad(dechex($num), $word, '0', STR_PAD_LEFT);\n\t\t$hex = substr($hex, -$word); // take last $word characters\n\t\t$path .= substr($hex, 0, 2) . '/';\n\t\tif ($full) {\n\t\t\t$path .= $realnum;\n\t\t}\n\n\t\treturn $path;\n\t}", "function dest_path_and_file()\r\n{ \r\n global $xoopsDB, $xoopsUser;\r\n \r\n // Initialize magic_number. This number is used to create unique file names in order to guarantee that 2 file names\r\n // will not be identical if 2 users upload a file at the exact same time. 100000 will allow almost 100000 users to use\r\n // this system. Ok, the odds of this happening are slim; but, I want the odds to be zero.\r\n $magic_number = 100000; \r\n \r\n // Get the location of the document repository\r\n $query = \"SELECT data from \".$xoopsDB->prefix(\"dms_config\").\" WHERE name='doc_path'\";\r\n $file_sys_root = mysql_result(mysql_query($query),'data');\r\n \r\n // Get the current value of max_file_sys_counter\r\n $query = \"SELECT data from \".$xoopsDB->prefix(\"dms_config\").\" WHERE name='max_file_sys_counter'\";\r\n $max_file_sys_counter = (integer) mysql_result(mysql_query($query),'data');\r\n \r\n // Determine the path and filename of the new file\r\n $query = \"SELECT * from \".$xoopsDB->prefix(\"dms_file_sys_counters\");\r\n $dms_file_sys_counters = mysql_fetch_array(mysql_query($query));\r\n \r\n $file_sys_dir_1 = $dms_file_sys_counters['layer_1'];\r\n $file_sys_dir_2 = $dms_file_sys_counters['layer_2'];\r\n $file_sys_dir_3 = $dms_file_sys_counters['layer_3'];\r\n $file_sys_file = $dms_file_sys_counters['file'];\r\n $file_sys_file_name = ($file_sys_file * $magic_number) + $xoopsUser->getVar('uid');\r\n \r\n $dir_path_1 = $file_sys_root.\"/\".$file_sys_dir_1;\r\n $dir_path_2 = $file_sys_root.\"/\".$file_sys_dir_1.\"/\".$file_sys_dir_2;\r\n $dir_path_3 = $file_sys_root.\"/\".$file_sys_dir_1.\"/\".$file_sys_dir_2.\"/\".$file_sys_dir_3;\r\n \r\n //$doc_path = $file_sys_root.\"/\".$file_sys_dir_1.\"/\".$file_sys_dir_2.\"/\".$file_sys_dir_3;\r\n $path_and_file = $file_sys_dir_1.\"/\".$file_sys_dir_2.\"/\".$file_sys_dir_3.\"/\".$file_sys_file_name;\r\n //$dest_path_and_file = $doc_path.\"/\".$file_sys_file_name;\r\n \r\n //print $path_and_file;\r\n //exit(0);\r\n \r\n // Determine the next file system counter values and save them for future use.\r\n $file_sys_file++;\r\n if ($file_sys_file > $max_file_sys_counter) \r\n {\r\n\t$file_sys_file = 1;\r\n\t$file_sys_dir_3++;\r\n\t} \r\n \r\n if ($file_sys_dir_3 > $max_file_sys_counter)\r\n {\r\n\t$file_sys_dir_3 = 1;\r\n\t$file_sys_dir_2++;\r\n\t}\r\n\t\r\n if ($file_sys_dir_2 > $max_file_sys_counter)\r\n {\r\n\t$file_sys_dir_2 = 1;\r\n\t$file_sys_dir_1++;\r\n\t}\r\n\t\r\n $query = \"UPDATE \".$xoopsDB->prefix(\"dms_file_sys_counters\").\" SET \";\r\n $query .= \"layer_1 = '\".(integer) $file_sys_dir_1.\"', \";\r\n $query .= \"layer_2 = '\".(integer) $file_sys_dir_2.\"', \";\r\n $query .= \"layer_3 = '\".(integer) $file_sys_dir_3.\"', \";\r\n $query .= \"file = '\".(integer) $file_sys_file. \"' \";\r\n \r\n mysql_query($query); \r\n\r\n // Ensure that the final destination directories exist...if not, then create the directory or directories.\r\n if (!is_dir($dir_path_1)) \r\n {\r\n\tmkdir($dir_path_1,0775);\r\n chmod($dir_path_1,0777);\r\n\t}\r\n \r\n if (!is_dir($dir_path_2))\r\n {\r\n\tmkdir($dir_path_2,0775); \r\n chmod($dir_path_2,0777);\r\n }\r\n\t\r\n if (!is_dir($dir_path_3)) \r\n {\r\n\tmkdir($dir_path_3,0775);\r\n chmod($dir_path_3,0777);\r\n\t}\r\n\t\r\n return($path_and_file);\r\n}", "function getTemplateFullPath( $basename ) {\n if ( ! is_string( $basename ) ) {\n return '';\n }\n foreach ( $this->getDirectories() as $directory ) {\n if ( ! is_string( $directory ) ) {\n continue;\n }\n $path = trailingslashit( $directory ) . $basename;\n if ( is_file( $path ) ) {\n return $path;\n }\n }\n\n return '';\n }", "static public function getFilePath($file, $base_path = null)\n {\n // If this is already a correct path, return it\n if (@is_file($file) && @is_readable($file)) {\n return realpath($file);\n }\n\n // Determine the application path\n $app = JRequest::getInt('app', JFactory::getApplication()->getClientId());\n if ($app == 1) {\n $app_path = JPATH_ADMINISTRATOR;\n } else {\n $app_path = JPATH_SITE;\n }\n\n // Make sure the basepath is not a file\n if (@is_file($base_path)) {\n $base_path = dirname($base_path);\n }\n\n // Determine the basepath\n if (empty($base_path)) {\n if (substr($file, 0, 1) == '/') {\n $base_path = JPATH_SITE;\n } else {\n $base_path = $app_path;\n }\n }\n\n // Append the base_path\n if (strstr($file, $base_path) == false && !empty($base_path)) {\n $file = $base_path.'/'.$file;\n }\n\n // Detect the right application-path\n if (JFactory::getApplication()->isAdmin()) {\n if (strstr($file, JPATH_ADMINISTRATOR) == false && @is_file(JPATH_ADMINISTRATOR.'/'.$file)) {\n $file = JPATH_ADMINISTRATOR.'/'.$file;\n } else if (strstr($file, JPATH_SITE) == false && @is_file(JPATH_SITE.'/'.$file)) {\n $file = JPATH_SITE.'/'.$file;\n }\n } else {\n if (strstr($file, JPATH_SITE) == false && @is_file(JPATH_SITE.'/'.$file)) {\n $file = JPATH_SITE.'/'.$file;\n }\n }\n\n // If this is not a file, return empty\n if (@is_file($file) == false || @is_readable($file) == false) {\n return null;\n }\n\n // Return the file\n return realpath($file);\n }", "function _infinite_base_file_transliteration($fid, $baseurl = false) {\n $file = file_load($fid);\n if(!$file){\n return FALSE;\n }\n\n $uri_old = $file->getFileUri();\n\n $values = [\n 'uid' => $file->get('uid'),\n 'status' => $file->get('status'),\n 'filename' => $file->getFilename(),\n 'uri' => $uri_old,\n 'filesize' => $file->getSize(),\n 'filemime' => $file->getMimeType()\n ];\n $file_new = File::create($values);\n\n $basename = basename($uri_old);\n\n $pattern = '/(.+:\\/\\/)(([^\\/]*\\/)*)'.preg_quote($basename).'/';\n $uri_new = preg_replace($pattern, '$1${2}'.$file_new->getFilename(), $uri_old);\n\n if($uri_old != $uri_new) {\n\n $move = TRUE;\n if(is_string($baseurl) && strlen($baseurl)){\n $GLOBALS['base_url'] = $baseurl;\n }\n $url = file_create_url($uri_old);\n if (!file_exists($uri_old)) {\n $ch = curl_init($url);\n $move = curl_exec($ch);\n curl_close($ch);\n }\n\n if ($move) {\n file_move($file, $uri_new);\n }\n\n }\n else {\n return FALSE;\n }\n\n return FALSE;\n}", "protected abstract function createUrl($file);", "public function getAbsolutePath(){\n\t \treturn $this->getAbsoluteDirname().'/'.$this->filename.'.'.$this->extension;\n\t }", "protected function buildPath()\n\t{\n\t\treturn $this->getDir() . DIRECTORY_SEPARATOR . $this->getSubDir()\n\t\t\t. DIRECTORY_SEPARATOR . $this->getName();\n\t}", "public static function make(string ...$parts)\n {\n return realpath(join(DIRECTORY_SEPARATOR, $parts));\n }", "public function getAbsoluteFilePath($fileName)\n {\n return $fileName === null ? null : $this->getAbsoluteFolderPath($fileName) . '/' . $fileName;\n }", "function slug_filename($filename,$name,$random) {\n $data = pathinfo($filename);\n $result = $this->slug($name).$this->slug_random($random).'.'.$data['extension'];\n return strtolower($result);\n\t}" ]
[ "0.64439505", "0.6418991", "0.63201076", "0.62451184", "0.6200759", "0.6131148", "0.611718", "0.6064574", "0.60638446", "0.60485125", "0.60387415", "0.5945617", "0.589638", "0.5878426", "0.5852989", "0.58377206", "0.58322936", "0.58228767", "0.5811291", "0.5788694", "0.5787363", "0.5748258", "0.57354295", "0.5703757", "0.5685115", "0.5666425", "0.56487715", "0.5644269", "0.5639029", "0.56388146", "0.5586818", "0.55770254", "0.55758923", "0.555854", "0.5537503", "0.5536312", "0.553061", "0.5524905", "0.55203974", "0.54855454", "0.5474935", "0.54670435", "0.5467042", "0.5460343", "0.5451536", "0.54511887", "0.5448062", "0.5445026", "0.54351664", "0.5424251", "0.54154176", "0.5414087", "0.53898543", "0.53898346", "0.5368879", "0.5346128", "0.53427076", "0.5336088", "0.5321934", "0.5320636", "0.5319755", "0.53169173", "0.53042156", "0.5292218", "0.52902746", "0.5270795", "0.5266646", "0.5246337", "0.52418154", "0.52412784", "0.52329415", "0.52328426", "0.52311236", "0.5225682", "0.5224669", "0.5219149", "0.5217341", "0.52020514", "0.52011347", "0.5195966", "0.5193199", "0.51927555", "0.5185766", "0.5182326", "0.51795083", "0.5176537", "0.5175208", "0.51738703", "0.5168437", "0.5166219", "0.51567364", "0.51545376", "0.5153496", "0.5148867", "0.5141122", "0.5132063", "0.513192", "0.512575", "0.51249504", "0.51202995", "0.51167953" ]
0.0
-1
relationship with "blog category" model
public function blog_category(){ return $this->hasOne(Blog_category::class, 'id', 'category_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function blogOfBlogCategories()\n {\n return $this->hasMany(Blog::class, 'blog_category_id');\n }", "public function categories()\n {\n return $this->belongsToMany(BlogCategory::class, 'blog_map_categories', 'blog_id', 'category_id');\n }", "public function category()\n {\n \treturn $this->belongsTo('App\\Post_Category', 'category_id');\n }", "public function blogs()\n {\n return $this->belongsToMany(Blog::class, 'blog_category', 'blog_id', 'category_id');\n }", "public function category(){\n return $this->belongsTo('Backpack\\NewsCRUD\\app\\Models\\Category', 'category_id');\n }", "public function category() {\n # Define an inverse one-to-many relationship.\n \treturn $this->belongsTo('Category');\n }", "public function category()\n\t{\n\t\treturn $this->belongsTo('App\\Model\\Content\\Category');\n\t}", "public function categories()\n {\n \treturn $this->belongsToMany('App\\Category', 'category_post', 'post_id', 'category_id');\n }", "public function category() {\n return $this->belongsTo('Category','catID','catID');\n\n }", "public function category() {\n return $this->belongsTo('App\\Models\\category','cat_id');\n }", "public function CategoryPost()\n {\n \treturn $this->hasMany('App\\Posts', 'category_id_fkey', 'id');\n }", "public function category(){\n \treturn $this->belongsTo(\"Category\",\"category_id\");\n }", "public function category(){\n return $this->belongsTo('App\\Category', 'cat-id');\n }", "public function cat(){\n return $this->belongsTo(Cat::class);\n }", "public function category()\n {\n \treturn $this->belongsTo('App\\Category');\n }", "public function post()\n {\n return $this->hasMany('App\\Models\\Blog\\PostModel', 'category_id', 'category_id');\n }", "public function getCategories()\n\t{\n\t\treturn BlogCategory::all();\t\n\t}", "public function category()\n {\n \treturn $this->belongsTo(Category::class);\n }", "public function category()\n {\n \treturn $this->belongsTo(Category::class);\n }", "public function cat(){\n return $this->hasOne(Category::class, 'id','category_id');\n }", "public function category() {\n\t\treturn $this->belongsToMany('Category');\n\t}", "public function postCategory($slug) {\n // 'name' che è il nome per esteso della categoria\n // 'slug' che è lo slug ricavato dal nome per esteso della categoria\n // questa funzione riceve in ingresso lo slug ($slug) della categoria\n // e deve ricavare l'elenco di tutti i posts che hanno quella categoria associata\n // identificati dallo slug ricevuto come parametro in ingresso.\n // Poi la funzione richiama una view e le passa l'elenco di tutti i posts trovati\n // e l'oggetto categoria, quella identificata dallo slug ricevuto in ingresso\n\n // cerco nella colonna 'slug' della mia tabella 'categories', la categoria (record) con slug uguale al parametro ricevuto\n $category = Category::where('slug', $slug)->first();\n\n // verifico se la select fatta sul DB mi ha ritornato qualcosa per la categoria ricercata tramite slug\n // ad esempio l'utente potrebbe modificare la stringa nella barra indirizzi, alterando il nome\n // dello slug e scrivendo un qualcosa che non esiste e non corrisponde a nessuna categoria del DB\n if (!empty($category)) {\n // qui sfrutto la relazione fra categorie e posts, cioè la relazione fra le entità/modelli\n // Category e Post. Nella classe Category è definito un metodo posts()\n // (cioè col nome dell'entità verso la quale è definita la relazione)\n // posts() ritorna $this->hasMany('App\\Post');\n // chiamo la proprietà posts (in questa maniera'$category->posts')\n // che restituisce i post che sono legati da relazione in base alla categoria\n $posts_by_category = $category->posts;\n\n // chiamo una view per visualizzare tutti i post della categoria ricercata,\n // gli passo la categoria e l'elenco dei posts\n return view('public.posts.posts-by-category', [\n 'category' => $category,\n 'posts' => $posts_by_category\n ]);\n } else {\n // ritorno la pagina di errore \"Page not found\" poichè lo slug ricevuto in ingresso\n // non corrisponde a nessuna categoria presente nel mio DB (tabella 'categories')\n return abort(404);\n }\n }", "public function category()\n {\n\n return $this->belongsTo(Category::class);\n\n }", "public function category(){\n return $this->belongsTo('App\\Models\\Category');\n }", "public function category(){\n return $this->belongsTo('App\\Models\\Category');\n }", "public function getCategory()\n{\n return $this->hasOne(Category::className(), ['id' => 'category']);\n}", "public function blogCats()\n {\n $social_links = Social_link::LeftJoin('social_links_translations','social_links_translations.social_id','=','social_links.id')\n ->select('social_links_translations.title as title' ,'social_links.id as id' ,'social_links.icon')\n ->where('locale',App::getLocale())->get();\n\n $countries = Country::leftJoin('countries_translations','countries_translations.country_id','=','countries.id')\n ->select('countries_translations.title as title' ,'countries.id as id')\n ->where('locale',App::getLocale())->get();\n\n $blogCats = BlogCategory::where('main' ,\"!=\", 1)->orderBy('id', 'desc')->paginate(12);\n return view('front/blogs/blog_categories' , compact('blogCats','social_links','countries'));\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category(){\n return $this->belongsTo(Category::class);\n }", "public function category(){\n return $this->belongsTo(Category::class);\n }", "public function category(){\n return $this->belongsTo(Category::class);\n }", "public function category(){\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category() {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n \treturn $this->belongsTo('App\\Category','category_id','id');\n }", "public function categories() {\n return $this->belongsToMany('App\\Models\\Category', 'category_post', 'post_id', 'category_id');\n }", "public function category() {\n return $this->belongsTo(Category::class);\n }", "public function category() {\n return $this->belongsTo(Category::class);\n }", "public function category() {\n return $this->belongsTo(Category::class);\n }", "public function category()\n{\n return $this->belongsTo(Category::class);\n}", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function getCategory() {\n return $this->hasOne(Category::className(), ['id' => 'category_id']); // second - field in dependent table\n }", "public function categories()\n {\n \treturn $this->belongsTo( 'App\\Category', 'category_id');\n }", "public function categories(){\n return $this->belongsTo('App\\Category');\n }", "public function categories()\n {\n \treturn $this->hasMany('App\\Category');\n }", "public function blogs()\n {\n return $this->belongsToMany('App\\Models\\Blog');\n }", "public function category()\n {\n return $this->belongsTo(Categories::class);\n }", "public function category(){\n return $this->belongsTo('App\\Category', 'category_id');\n }", "public function category()\n\t{\n\t return $this->belongsTo(Category::class);\n\t}", "public function category()\n {\n return $this->belongsTo('App\\Category','category_id');\n\n\n }", "public function category(){\n return $this->belongsTo('App\\Models\\MainCategory','category_id','id');\n }", "public function category() {\n\t\treturn $this->belongsTo(Category::class, 'category_id', 'id');\n\t}", "public function category()\n\t{\n\t\treturn $this->belongsTo(Category::class);\n\t}", "public function RelationBetweenCategory()\n {\n return $this->hasOne('App\\Models\\Category', 'id', 'category_id');\n }", "public function category()\n {\n $this->belongsTo(Category::class, 'category_id');\n }", "public function category()\n\t{\n\t\treturn $this->belongsTo('SongCategory','category');\n\t}", "public function category()\n {\n return $this->belongsTo('App\\Models\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Models\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Models\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function category()\n {\n return $this->belongsTo('App\\DescriptionCategory');\n }", "public function category()\n {\n return $this->belongsTo('\\App\\Category');\n }", "public function Category()\n { \n return $this->hasOne('App\\Models\\Category', 'category_id', 'category_id');\n }", "public function category()\n {\n return $this->belongsTo('TypiCMS\\Modules\\Categories\\Models\\Category');\n }", "public function category()\n {\n return $this->hasOne('Antares\\Customfields\\Model\\FieldCategory', 'id', 'category_id');\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n // hasOne, hasMany, belongsTo, belongsToMany\n return $this->belongsTo(Category::class);\n }", "public function getCategory() \n {\n return $this->hasOne(Category::className(), ['id' => 'category_id']); \n }", "public function categoryName(){\n \treturn $this->belongsTo('App\\Backend\\Category', 'category_id', 'category_id');\n }", "public function categories() {\n return $this->belongsToMany('App\\PodcastMetaData', 'podcast_metas', 'podcast_id', 'meta_id')->where('meta_type', 'podcast_category');\n }", "public function articles() {\n return $this->hasMany('Drstock\\Article','category_id');}", "public function websiteShareOnCategory()\n {\n \t// hasOne(RelatedModel, foreignKeyOnRelatedModel = cate_id, localKey = cate_id)\n \treturn $this->hasOne('App\\WebsiteShareOnCategory','cate_id','cate_id');\n }", "public function category()\n {\n return $this->hasOne('fooCart\\src\\Category', 'category_id', 'category_id');\n }" ]
[ "0.7414309", "0.69312376", "0.6893894", "0.6814409", "0.6693148", "0.65869457", "0.65548813", "0.6418212", "0.6417245", "0.640472", "0.6403494", "0.63852495", "0.6372016", "0.6371271", "0.6365774", "0.6365243", "0.6364318", "0.63403493", "0.63403493", "0.6333624", "0.63282716", "0.6314677", "0.62589675", "0.6252908", "0.6252908", "0.6251254", "0.62375957", "0.62259346", "0.62250006", "0.62250006", "0.62250006", "0.62250006", "0.62239534", "0.62177664", "0.6212705", "0.6203051", "0.6197091", "0.6197091", "0.6197091", "0.61943364", "0.61867416", "0.61766833", "0.6176346", "0.6175779", "0.6174898", "0.6168099", "0.6166878", "0.61643773", "0.6161288", "0.61575824", "0.6153953", "0.6149846", "0.61427736", "0.6131942", "0.6130579", "0.61293334", "0.61261475", "0.61261475", "0.61261475", "0.61251485", "0.61251485", "0.61251485", "0.61251485", "0.61251485", "0.61251485", "0.61251485", "0.61251485", "0.61251485", "0.61251485", "0.61251485", "0.61251485", "0.61251485", "0.6113834", "0.6113737", "0.61070645", "0.6106565", "0.61021364", "0.60963094", "0.6096128", "0.6096128", "0.6096128", "0.6096128", "0.6096128", "0.6096128", "0.6096128", "0.6096128", "0.6096128", "0.6096128", "0.6096128", "0.6096128", "0.6096128", "0.6096128", "0.6096128", "0.6089745", "0.60862905", "0.6068591", "0.60635597", "0.6060108", "0.605322", "0.6050983" ]
0.76548684
0
/ $data = array('senderid'=>$sender, 'contacts'=>sizeof($numbers), 'message'=>$msg, 'totalcharge'=>$totalcharge, 'email'=>$email);
public function bulk_sms_email($data = null) { $url = 'http://spectrumug.com/bulk_sms_notifications.php'; $options = array ( CURLOPT_URL => $url, CURLOPT_POST => 1, CURLOPT_POSTFIELDS => $data, ); $curl = curl_init(); curl_setopt_array($curl, $options); $response = curl_exec($curl); if (!$response) { $response = curl_error($curl); } curl_close($curl); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function arr() {\n $customer_msgs = array();\n /* for ($i = 1; $i <= 10; $i++) {\n /* $msgs = array(); */\n /* $msgs[$i] = \"Message \" . $i;\n /* array_push($arrs, $msgs); */\n /* } */\n $customer_msgs['1'] = \"This Email is not Registered\";\n $customer_msgs['2'] = \"Name is required\";\n $customer_msgs['3'] = \"Age is required\";\n $customer_msgs['4'] = \"Breed is required\";\n $customer_msgs['5'] = \"Seassion token was expired.\"; /* token */\n $customer_msgs['6'] = \"Your unique id is missing\";\n $customer_msgs['7'] = \"Image is required\";\n $customer_msgs['8'] = \"Invalid Input\";\n $customer_msgs['9'] = \"Token Expired\";\n $customer_msgs['10'] = \"Owner ID not Found\";\n $customer_msgs['11'] = \"Not a valid token\";\n $customer_msgs['12'] = \"No Dogs Found\";\n $customer_msgs['13'] = \"Driver not Found\";\n $customer_msgs['14'] = 'PayPal unique id is missing.';\n $customer_msgs['15'] = 'Contact numbers are required.';\n $customer_msgs['16'] = 'Your ETA is required.';\n $customer_msgs['17'] = 'No Credit Found';\n $customer_msgs['18'] = 'Successfully Log-Out';\n $customer_msgs['19'] = \"Id of Request is required\";\n $customer_msgs['20'] = \"Already Rated\";\n $customer_msgs['21'] = \"Walk is not completed\";\n $customer_msgs['22'] = \"Walk ID doesnot matches with Dog ID\";\n $customer_msgs['23'] = \"Walk ID Not Found\";\n $customer_msgs['24'] = 'Invalid Phone Number';\n $customer_msgs['25'] = 'Phone number must be required.';\n $customer_msgs['26'] = 'Social Login unique id must be required.';\n $customer_msgs['27'] = 'Email ID already Registred';\n $customer_msgs['28'] = 'Password field is required.';\n $customer_msgs['29'] = 'Email field is required';\n $customer_msgs['30'] = 'Name field is required.';\n $customer_msgs['31'] = 'Last Name field is required.';\n $customer_msgs['32'] = 'Push notification token is required.';\n $customer_msgs['33'] = 'Device type must be android or ios';\n $customer_msgs['34'] = 'Login type is required.';\n $customer_msgs['35'] = 'Login by mismatch';\n $customer_msgs['36'] = 'Invalid Username and Password';\n $customer_msgs['37'] = 'Not a Registered User';\n $customer_msgs['38'] = 'Not a valid social registration User';\n $customer_msgs['39'] = 'Card number\\'s last four digits are missing.';\n $customer_msgs['40'] = 'Unique payment token is missing.';\n $customer_msgs['41'] = 'Could not create client ID';\n $customer_msgs['42'] = 'Unique card ID is missing.';\n $customer_msgs['43'] = 'Card ID and ' . Config::get('app.generic_keywords.User') . ' ID Doesnot matches';\n $customer_msgs['44'] = 'Card not found';\n $customer_msgs['45'] = 'This user does not have a referral code';\n $customer_msgs['46'] = 'No Card Found';\n $customer_msgs['47'] = 'Invalid Old Password';\n $customer_msgs['48'] = 'Old Password must not be blank';\n $customer_msgs['49'] = \"location points are missing\";\n $customer_msgs['50'] = '' . Config::get('app.generic_keywords.User') . 'ID not Found';\n $customer_msgs['51'] = 'Request ID doesnot matches with' . Config::get('app.generic_keywords.User') . ' ID';\n $customer_msgs['52'] = 'Request ID Not Found';\n $customer_msgs['53'] = '' . Config::get('app.generic_keywords.User') . ' ID not Found';\n $customer_msgs['54'] = 'No walker found';\n $customer_msgs['55'] = 'No ' . Config::get('app.generic_keywords.Provider') . ' found matching the service type'; /* remaining from here */\n $customer_msgs['56'] = 'No ' . Config::get('app.generic_keywords.Provider') . ' found';\n $customer_msgs['57'] = 'Selected provider\\'s unique id is missing.';\n $customer_msgs['58'] = 'Your previous Request is Pending.';\n $customer_msgs['59'] = 'Please add card first for payment.';\n $customer_msgs['60'] = 'No ' . Config::get('app.generic_keywords.Provider') . ' found matching the service type for scheduled request.';\n $customer_msgs['61'] = 'Invalid Promo Code';\n $customer_msgs['62'] = 'You can not apply multiple code for single trip.';\n $customer_msgs['63'] = 'Promotional code successfully applied.';\n $customer_msgs['64'] = 'Promotional code is not available';\n $customer_msgs['65'] = 'Promotional code already used.';\n $customer_msgs['66'] = 'Promotion feature is not active on card payment.';\n $customer_msgs['67'] = 'Promotion feature is not active on cash payment.';\n $customer_msgs['68'] = 'Promotion feature is not active.';\n $customer_msgs['69'] = 'You can\\'t apply promotional code without creating request.';\n $customer_msgs['70'] = 'Payment mode is paypal';\n $customer_msgs['71'] = 'No ' . Config::get('app.generic_keywords.Provider') . ' found for the selected service in your area currently';\n $customer_msgs['72'] = 'You are already in debt';\n $customer_msgs['73'] = 'Distance is required.';\n $customer_msgs['74'] = 'Time is required.';\n $customer_msgs['75'] = 'Request ID doesnot matches with ' . Config::get('app.generic_keywords.User') . ' ID';\n $customer_msgs['76'] = 'On going ' . Config::get('app.generic_keywords.Trip') . '.';\n $customer_msgs['77'] = 'No on going ' . Config::get('app.generic_keywords.Trip') . ' found.';\n $customer_msgs['78'] = 'Searching for ' . Config::get('app.generic_keywords.Provider') . 's.';\n $customer_msgs['79'] = 'No ' . Config::get('app.generic_keywords.Provider') . 's are available currently. Please try after sometime.';\n $customer_msgs['80'] = '' . Config::get('app.generic_keywords.Provider') . ' not Confirmed yet';\n $customer_msgs['81'] = 'No ' . Config::get('app.generic_keywords.Provider') . ' found around you.';\n $customer_msgs['82'] = 'Time-Zone is required';\n $customer_msgs['83'] = 'Schedule date and time must be required.';\n $customer_msgs['84'] = \"Sorry, You can't create schedule morethen two week faar from today.\";\n $customer_msgs['85'] = 'update successfully';\n $customer_msgs['86'] = 'Payment mode not updated';\n $customer_msgs['87'] = \"Destination Set Successfully\";\n $customer_msgs['88'] = 'Sorry You can\\'t create event earlier then 14 days.';\n $customer_msgs['89'] = 'Yo have invited maximum members for event.';\n $customer_msgs['90'] = 'Please change braintree as default gateway';\n $customer_msgs['91'] = \"Sorry, You have apready apply the refereel code.\";\n $customer_msgs['92'] = 'Referral process successfully completed.';\n $customer_msgs['93'] = \"Sorry, You can't apply your refereel code.\";\n $customer_msgs['94'] = 'Invalid referral code';\n $customer_msgs['95'] = 'You have skipped for referral process';\n $customer_msgs['96'] = 'No Dog Found';\n $customer_msgs['97'] = 'Payment type must be required.';\n $customer_msgs['98'] = 'Event Unique Id is missing.';\n $customer_msgs['99'] = 'Sorry you can\\'t delte past or ongoing event.';\n $customer_msgs['100'] = 'Event not found.';\n $customer_msgs['101'] = 'Event successfully deleted.';\n /* print_r($customer_msgs); */\n $provider_msgs = array();\n $provider_msgs['1'] = \"This Email is not Registered\";\n $provider_msgs['2'] = 'Password field is required.';\n $provider_msgs['3'] = 'Email field is required';\n $provider_msgs['4'] = 'Name field is required.';\n $provider_msgs['5'] = 'Last Name field is required.';\n $provider_msgs['6'] = 'Image is required';\n $provider_msgs['7'] = 'Push notification token is required.';\n $provider_msgs['8'] = 'Device type must be android or ios';\n $provider_msgs['9'] = 'Login type is required.';\n $provider_msgs['10'] = 'Phone number must be required.';\n $provider_msgs['11'] = 'Social Login unique id must be required.';\n $provider_msgs['12'] = 'Invalid Input';\n $provider_msgs['13'] = 'Invalid Phone Number';\n $provider_msgs['14'] = 'Email ID already Registred';\n $provider_msgs['15'] = 'Login by mismatch';\n $provider_msgs['16'] = 'Invalid Username and Password';\n $provider_msgs['17'] = 'Not a Registered User';\n $provider_msgs['18'] = 'Not a valid social registration User';\n $provider_msgs['19'] = 'Id of Request is required.';\n $provider_msgs['20'] = 'Your unique id is missing.';\n $provider_msgs['21'] = 'Already Rated';\n $provider_msgs['22'] = 'Service ID doesnot matches with ' . Config::get('app.generic_keywords.Provider') . ' ID';\n $provider_msgs['23'] = 'Service ID Not Found';\n $provider_msgs['24'] = 'Token Expired';\n $provider_msgs['25'] = '' . Config::get('app.generic_keywords.Provider') . ' ID not Found';\n $provider_msgs['26'] = 'Not a valid token';\n $provider_msgs['27'] = 'Service Already Started';\n $provider_msgs['28'] = 'location points are missing.';\n $provider_msgs['29'] = 'accept or reject must be required.';\n $provider_msgs['30'] = 'Request ID does not matches' . Config::get('app.generic_keywords.Provider') . ' ID';\n $provider_msgs['31'] = 'Request Canceled.';\n $provider_msgs['32'] = 'Request ID Not Found';\n $provider_msgs['33'] = '' . Config::get('app.generic_keywords.Provider') . ' not yet confirmed';\n $provider_msgs['34'] = 'Service not yet started';\n $provider_msgs['35'] = '' . Config::get('app.generic_keywords.Provider') . ' not yet arrived';\n $provider_msgs['36'] = 'Distance is required.';\n $provider_msgs['37'] = 'Time is required.';\n $provider_msgs['38'] = 'Invalid Old Password';\n $provider_msgs['39'] = 'Old Password must not be blank';\n $provider_msgs['40'] = 'Successfully Log-Out';\n\n\n foreach ($customer_msgs as $key => $value) {\n echo '<string name=\"error_' . $key . '\">' . $value . '</string>';\n }\n echo \"\\n ################################################################################ \\n\";\n foreach ($provider_msgs as $key => $value) {\n echo '<string name=\"error_' . $key . '\">' . $value . '</string>';\n }\n /* $i = 0;\n foreach ($customer_msgs as $customer_msg) {\n\n echo '<string name=\"error_' . $i . '\">' . $customer_msg . '</string>';\n $i++;\n } */\n exit;\n /* $response_array = array('success' => false, 'error' => 'Invalid Input', 'error_code' => 401, 'error_messages_client' => $customer_msgs, 'error_messages_provider' => $provider_msgs);\n $response_code = 200;\n $response = Response::json($response_array, $response_code);\n return $response; */\n }", "function add_quick_contact(){\n\t$user_id=$_POST['user_id'];\n\t$contact_list=$_POST['user_contacts'];\n\t$contact_name=$_POST['user_name'];\n\tif(!empty($contact_list) && !empty($user_id)){\n\t\tfor($i=0;$i<count($contact_list);$i++){\n\t\t\t$contact=$_POST['user_contacts'][$i];\n\t\t\t$contactname=$_POST['user_name'][$i];\n\t\t\t$add_contacts = $this -> conn -> insertnewrecords('quick_contacts','quick_contact_user_id, quick_contacts_name,quick_contacts_number', '\"' . $user_id . '\",\"' . $contactname . '\",\"' . $contact . '\"');\n\t\t\tif(!empty($add_contacts)){\n\t\t\t\t$posts[] = array(\"user_contacts\"=>$_POST['user_contacts'][$i],\"user_name\"=>$_POST['user_name'][$i]);\n\t\t\t}else{\n\t\t\t\t$posts = array('status' => \"false\",\"message\" => \"Error in adding contacts\");\n\t\t\t}\n\t\t\t\n\t\t}\n$post=array('status'=>'true','quick_contacts'=>$posts);\n\t}else{\n\t\t$post = array('status' => \"false\",\"message\" => \"Missing parameter\",'user_id'=>$user_id,'contacts'=>$contact_list);\n\t}\n\techo $this -> json($post);\n}", "function &sms_addressbook_list($start=NULL, $limit=NULL, $direction=0, $where=NULL)\n\n {\n\n global $database, $user;\n\n \n\n\t $message_array = array();\n\n \n\n\t // MAKE SURE MESSAGES ARE ALLOWED\n\n\t \n\n \n\n // BEGIN MESSAGE QUERY\n\n $sql = \"\n\n SELECT\n\n *\n\n FROM\n\n se_sms\n\n WHERE\n\n username='{$user->user_info['user_username']}'\n\n \";\n\n // EXECUTE QUERY\n\n $resource = $database->database_query($sql);\n\n \n\n // GET MESSAGES\n\n\t while( $message_info=$database->database_fetch_assoc($resource) )\n\n {\n\n // CREATE AN OBJECT FOR MESSAGE AUTHOR/RECIPIENT\n\n $pm_user = new SEUser();\n\n $pm_user->user_info['id'] = $message_info['id'];\n\n $pm_user->user_info['username'] = $message_info['username'];\n\n $pm_user->user_info['message'] = $message_info['message'];\n\n $pm_user->user_info['date'] = $message_info['date'];\n\n $pm_user->user_info['tono'] = $message_info['tono'];\n $pm_user->user_info['fromno'] = $message_info['fromno'];\n $pm_user->user_displayname();\n\n \n\n // Remove breaks for preview\n\n $message_info['pm_body'] = str_replace(\"<br>\", \"\", $message_info['pm_body']);\n\n \n\n // SET MESSAGE ARRAY\n\n $message_array[] = array(\n\n 'pmconvo_id' => $message_info['id'],\n\n 'pmconvo_username' => $message_info['username'],\n\n 'pm_message' => $message_info['message'],\n\n 'pm_date' => $message_info['date'],\n\t\t'pm_body' => $message_info['pm_body'],\n\t\t 'pm_tono' => $message_info['tono'],\n\t\t \n 'pm_fromno' => $message_info['fromno']\n \n\n );\n\n \n\n unset($pm_user);\n\n }\n\n \n\n return $message_array;\n\n }", "function num_recipients($address_list)\n{\n\t$num_recipients = 0;\n\n\tforeach ($address_list as $field => $adr_ary)\n\t{\n\t\t$num_recipients += sizeof($adr_ary);\n\t}\n\n\treturn $num_recipients;\n}", "function getRecipientCount(){\n return sizeof( $this->to );\n }", "function insert_subscriber($data, $number){\n $new_data = array();\n\n if($number == 1){\n $new_data['id'] = $data[0]['id'];\n $new_data['email'] = $data[0]['email'];\n $new_data['date'] = $data[0]['date'];\n insertRecord(TAB_SUBSCRIBERS, $new_data);\n }else{\n foreach($data as $data_element){\n $new_data['id'] = $data_element['id'];\n $new_data['email'] = $data_element['email'];\n $new_data['date'] = $data_element['date'];\n insertRecord(TAB_SUBSCRIBERS, $new_data);\n }\n }\n}", "public function show_notification_by_count_post()\n {\n $response = new StdClass();\n $result = new StdClass();\n $staff_mobile_no=$this->input->post('staff_mobile_no');\n $resdata = $this->Supervisor->check_total_count_notifications($staff_mobile_no);\n if($resdata>0)\n { \n $data1->count=$resdata;\n $data1->status ='1';\n array_push($result,$data1);\n $response->data = $data1;\n }\n else if($resdata==0)\n {\n $data1->count ='';\n $data1->status = '1';\n array_push($result,$data1);\n $response->data = $data1;\n }\n else \n {\n $data1->status ='0';\n $data1->message = 'failed';\n array_push($result,$data1);\n $response->data = $data1;\n }\n \n echo json_output($response);\n }", "function sendJson($databaseInformation, $msg, $newElementID, $amountOfPages,$currentPage)\n{\n $elementsToSend = [];\n if (isset($databaseInformation)) {\n $elementsToSend['db'] = $databaseInformation;\n }\n if (isset($msg)) {\n $elementsToSend['msg'] = $msg;\n }\n if (isset($newElementID)) {\n $elementsToSend['id'] = $newElementID;\n }\n if(isset($amountOfPages)){\n $elementsToSend['amountOfPages'] = $amountOfPages;\n }\n if(isset($currentPage)){\n $elementsToSend['currentPage'] = $currentPage;\n }\n echo json_encode($elementsToSend, JSON_FORCE_OBJECT);\n}", "function smsaddressbook($direction=0, $where=NULL, $do_joins=FALSE)\n\n {\n\n global $database, $user;\n\n \n\n $message_total = 0;\n\n \n\n\t // MAKE SURE MESSAGES ARE ALLOWED\n\n\t\n\n \n\n // BEGIN MESSAGE QUERY\n\n $sql = \"\n\n SELECT\n\n COUNT(id) as pm_total\n\n FROM\n\n se_sms\n\n WHERE\n\n username='{$user->user_info['user_username']}'\n\n \";\n // RUN QUERY AND RETURN\n\n $resource = $database->database_query($sql);\n\n $result = $database->database_fetch_assoc($resource);\n\n \n\n //return (int) $database->database_num_rows($resource);\n\n return (int) $result['pm_total'];\n\n }", "public function setValuesFromDataArray($dataArray) {\n $this->commId = (isset($dataArray['commId']) ? $dataArray['commId'] \n : (isset($dataArray['communicationId']) ? $dataArray['communicationId'] : 0));\n $this->recipientId = (isset($dataArray['recipient']) ? $dataArray['recipient'] \n : (isset($dataArray['recipientId']) ? $dataArray['recipientId'] \n : (isset($dataArray['personId']) ? $dataArray['personId'] : 0)));\n $this->recipientName = (isset($dataArray['name']) ? $dataArray['name'] \n : (isset($dataArray['recipientName']) ? $dataArray['recipientName'] : 0));\n/* $this->sent = ((isset($dataArray['sent'])) \n ? ($dataArray['sent'] == 1) \n : (isset($dataArray['artistInformedOfMediaReceipt']) \n ? ($dataArray['artistInformedOfMediaReceipt'] == 1) \n : false)); */\n $this->dateSent = ((isset($dataArray['dateSent'])) \n ? $dataArray['dateSent'] \n : (isset($dataArray['artistInformedOfMediaReceiptDate']) \n ? $dataArray['artistInformedOfMediaReceiptDate']\n : ''));\n $this->commType = (isset($dataArray['type']) ? $dataArray['type'] : '');\n $this->sender = (isset($dataArray['sender']) ? $dataArray['sender'] : 0);\n $this->to = (isset($dataArray['emailTo']) ? $dataArray['emailTo'] \n : ((isset($dataArray['to'])) ? $dataArray['to'] : ''));\n if ($this->to =='') {\n $name = (isset($dataArray['name']) && $dataArray['name'] !='') ? $dataArray['name'] : '';\n $email = (isset($dataArray['email']) && $dataArray['email'] !='') ? $dataArray['email'] : '';\n $this->setToFieldFromNameAndEmail($name, $email);\n }\n $this->from = (isset($dataArray['emailFrom']) ? $dataArray['emailFrom'] \n : ((isset($dataArray['from'])) ? $dataArray['from'] : ''));\n $this->subject = (isset($dataArray['emailSubject']) ? $dataArray['emailSubject'] : '');\n $this->message =(isset($dataArray['contentText']) ? $dataArray['contentText'] : '');\n $this->inResponseTo = (isset($dataArray['inResponseTo']) ? $dataArray['inResponseTo'] : 0);\n // $this->referencedWorks is unaffected.\n // $this->emailWidgetId is unaffected.\n // $this->bcc is unaffected.\n }", "public function sendMessage(array $collection, array $params){ \n try {\n $stateConnect=$this->getConnection();\n // $states=array(); \n $dataSend = array(); $totalSmsSend = 0; $reponseSend = 1; //pendiente\n $totalSmsAgend = 0; $smscount = 0;\n if($stateConnect){\n\n $params['collection'] = $collection;\n $countsms = $this->validateCredit($params);\n\n foreach ($collection as $obj) {\n $smscount++;\n// \n if(!empty($obj[2])){\n if($smscount <= $countsms){\n $this->sendMQ($obj);\n $totalSmsAgend++;\n }\n }else{\n $remitter = isset($obj[3])?$obj[3]:'123456789';\n $codeCountry = $params['codCountry'];\n // if($this->validateCredit($params)){\n if($smscount <= $countsms){\n //$states[$obj[1]]=$this->_connection->send_long($remitter, $obj[0], $obj[1]);\n \n $getOperatorPhone = new \\validateNum();\n $operatorPhone= $getOperatorPhone->getOperadorNum($obj[0]);\n \n if($operatorPhone['id'] != 4){\n $reponseSend = $this->_connection->send_long\n ($remitter, $codeCountry.$obj[0], $obj[1], 0, 0, false);\n $reponseSend = ((int)$reponseSend == 0) ?2:4;\n }else{\n $reponseSend = 2;\n }\n \n \n if($reponseSend == 4){\n $totalSmsSend += 1;\n }\n }\n }\n $dataSend[] = $this->dataSMS($obj, $params, $reponseSend);\n $reponseSend = 1;\n }\n // var_dump($dataSend);exit;\n $response = \\Sms::insert($dataSend);\n $update = \\User::find($params['idUser']);\n $update->credit = ($update->credit + ($countsms - ($totalSmsSend + $totalSmsAgend)));\n $update->save();\n\n $updateCompany = \\Company::find($params['idcompany']);\n $updateCompany->credit = ($updateCompany->credit - ($totalSmsSend + $totalSmsAgend));\n $updateCompany->save();\n\n $this->_connection->close();\n // return $states;\n return $response;\n }\n return $stateConnect;\n } catch (Exception $exc) {\n return array('state'=> 0, 'msj' => $exc->getMessage());\n }\n }", "public function useJSON($url, $username, $apikey, $flash, $sendername, $messagetext, $recipients) {\r\n $gsm = array();\r\n $country_code = '234';\r\n $arr_recipient = explode(',', $recipients);\r\n foreach ($arr_recipient as $recipient) {\r\n $mobilenumber = trim($recipient);\r\n if (substr($mobilenumber, 0, 1) == '0'){\r\n $mobilenumber = $country_code . substr($mobilenumber, 1);\r\n }\r\n elseif (substr($mobilenumber, 0, 1) == '+'){\r\n $mobilenumber = substr($mobilenumber, 1);\r\n }\r\n $generated_id = uniqid('int_', false);\r\n $generated_id = substr($generated_id, 0, 30);\r\n $gsm['gsm'][] = array('msidn' => $mobilenumber, 'msgid' => $generated_id);\r\n }\r\n $message = array(\r\n 'sender' => $sendername,\r\n 'messagetext' => $messagetext,\r\n 'flash' => \"{$flash}\",\r\n );\r\n\r\n $request = array('SMS' => array(\r\n 'auth' => array(\r\n 'username' => $username,\r\n 'apikey' => $apikey\r\n ),\r\n 'message' => $message,\r\n 'recipients' => $gsm\r\n ));\r\n $json_data = json_encode($request);\r\n if ($json_data) {\r\n $response = $this->doPostRequest($url, $json_data, array('Content-Type: application/json'));\r\n $result = json_decode($response);\r\n return $result->response->status;\r\n } else {\r\n return false;\r\n }\r\n}", "public function store(Request $request)\n { \n $id = $request->get('send_to'); \n $message = $request->get('message'); \n $event = Event::find($id); \n\n $mobileNumberPersonnelBelongsToCollege = Personnel::getPersonnelNumberUnderCollege($event->participant_collge);\n $personelNumbers = Personnel::composeNumberAsArray($event->sponsor_personnels); \n $studentNumbers = Student::getStudentEventMobileNumbers($event->participant_collge, $event->participant_year); \n\n if(!empty($personelNumbers) and !empty($studentNumbers)) { \n $arrayNumbers = array_merge($personelNumbers, $studentNumbers);\n } else if(!empty($personelNumbers)) { \n $arrayNumbers = $personelNumbers;\n } else if(!empty($studentNumbers)) { \n $arrayNumbers = $studentNumbers;\n } else {\n $arrayNumbers = [''];\n }\n\n if(!empty($mobileNumberPersonnelBelongsToCollege)) {\n $arrayNumbers = array_merge($arrayNumbers, $mobileNumberPersonnelBelongsToCollege);\n }\n\n // print \"<pre>\";\n // print_r($arrayNumbers);\n //\n // exit;\n\n // $arrayNumbers = Sms::mergeNumbers($student, $personnel); \n // print_r( $personelNumbers); \n // print_r( $studentNumbers); \n // exit; \n // $arrayNumbers [] = '+639069262984'; \n // $message = \"test\"; \n // print \"<pre>\";\n // print_r($arrayNumbers);\n // exit; \n $tatus = Sms::sendSms($arrayNumbers, env('SMS_DEVICE_ID'), env('SMS_USER'), env('SMS_PASS'), $message);\n // print_r($tatus);\n // exit; \n return redirect()->back()->with('status', 'message is comming to students and faculty soon..'); \n }", "function getData()\n{\n$data = array();\n$data[0]=$_POST['Name'];\n$data[1]=$_POST['DOB'];\n$data[2]=$_POST['Address'];\n$data[3]=$_POST['Postcode'];\n$data[4]=$_POST['Phone'];\n$data[5]=$_POST['email'];\n$data[6]=$_POST['MemberID'];\nreturn $data;\n}", "public function chatting_history(){\n $mid = $_POST[\"my_email\"];\n $fid = $_POST[\"frnd_id\"];\n $uid = $_POST[\"uid\"];\n $APITOKEN = $_POST[\"APITOKEN\"];\n if(check_api_token($uid, $APITOKEN)){\n $s_email = $mid;\n $json = array('status'=>false, 'msg'=>'Data load faild!!!');\n if(filter_var($fid, FILTER_VALIDATE_EMAIL)){\n $where = \"(`receiver_id` = '$mid' AND `sender_id` = '$fid') OR (`sender_id` = '$mid' AND `receiver_id` = '$fid')\";\n $this->db->where($where);\n $this->db->order_by('id');\n $result = $this->db->get(\"crm_message\")->result();\n }\n elseif(is_numeric($fid)){\n $where = \"crm_message.receiver_id = '$fid' AND FIND_IN_SET('$mid', `crm_message_group`.`group_member`)\";\n $this->db->from('crm_message');\n $this->db->join('crm_message_group', 'crm_message.receiver_id = crm_message_group.group_id');\n $this->db->where($where);\n $this->db->order_by('id');\n $result = $this->db->get()->result();\n }\n $i = 0;\n if(count($result)>0){\n $json[\"data\"] = array();\n foreach($result as $row){\n if($row->sender_id == $mid){\n array_push($json[\"data\"], array('msgid'=> $row->id, 'groupId'=> $fid, 'drawNew' => 'yes', 'type' => 'right', 'msg' => base64_decode($row->msg), 'time' => $row->time, 'msgtype' => $row->msg_type, 'msg_status'=> $row->status));\n }\n elseif($row->receiver_id == $mid){\n array_push($json[\"data\"], array('msgid'=> $row->id, 'groupId'=> $fid, 'drawNew' => 'yes', 'type' => 'left', 'msg' => base64_decode($row->msg), 'time' => $row->time, 'msgtype' => $row->msg_type, 'fimg'=>'', 'fname'=>'', 'msg_status'=> $row->status));\n }\n elseif($row->receiver_id == $fid AND !(filter_var($fid, FILTER_VALIDATE_EMAIL))){\n $finfo = $this->db->get_where(\"crm_users\", array(\"email\"=>$row->sender_id))->result();\n array_push($json[\"data\"], array('msgid'=> $row->id, 'groupId'=> $fid, 'drawNew' => 'yes', 'type' => 'left', 'msg' => base64_decode($row->msg), 'time' => $row->time, 'msgtype' => $row->msg_type, 'fimg'=>$finfo[0]->img, 'fname'=>$finfo[0]->display_name, 'msg_status'=> $row->status));\n }\n \n $i++;\n }\n if(filter_var($fid, FILTER_VALIDATE_EMAIL) AND $fid == $s_email){\n $this->db->where($where);\n $this->db->update(\"crm_message\", array(\"status\"=>0));\n }\n elseif(is_numeric($fid)){\n $this->db->query(\"UPDATE crm_message SET status = REPLACE(status, '$mid', '') WHERE status LIKE '%$mid%'\");\n }\n $json['status'] = true;\n $json['msg'] = 'Data load success...';\n }\n\n header('Content-type: application/json');\n echo json_encode($json);\n }else{\n $json = array('status'=>false, 'msg'=>'Data load faild!!!');\n header('Content-type: application/json');\n echo json_encode($json);\n }\n }", "public function msg_sent()\n {\n \n $sent = $this->Model_messages_sent->get_datatables();\n $data = array();\n $no = $_POST['start'];\n\n foreach ($sent as $msg_) \n {\n $sent_to = $msg_->send_to; \n $subject_send = $msg_->subject_send;\n $subject_send = character_limiter($subject_send, 20);\n $text_msg = $msg_->msg_send;\n $text_msg = character_limiter($text_msg, 50);\n\n $current = time();\n $date = strtotime($msg_->date_send);\n $units = 1;\n $msg_date = timespan($date, $current, $units) . ' ago';\n\n $no++;\n $row = array();\n $row[] = '<input type=\"checkbox\" class=\"sent\" name=\"sent[]\" value=\"' . $msg_->msg_sent_id . '\" />';\n $row[] = $sent_to;\n $row[] = $subject_send;\n $row[] = $text_msg;\n $row[] = $msg_date;\n\n $row[] = '\n <div class=\"action-buttons\">\n <a class=\"text-blue\" href=\"javascript:void(0)\" onclick=\"open_sent('.\"'\".$msg_->msg_sent_id.\"'\".')\" title=\"Open\">\n <i class=\"ace-icon fa fa-search bigger-130\"></i>\n </a>\n <a class=\"text-red\" href=\"javascript:void(0)\" onclick=\"delete_sent('.\"'\".$msg_->msg_sent_id.\"'\".')\" title=\"Delete\">\n <i class=\"ace-icon fa fa-trash-o bigger-130\"></i>\n </a>\n </div>';\n \n $data[] = $row;\n }\n \n $output = array(\n \"draw\" => $_POST['draw'],\n \"recordsTotal\" => $this->Model_messages_sent->count_all(),\n \"recordsFiltered\" => $this->Model_messages_sent->count_filtered(),\n \"data\" => $data,\n );\n\n echo json_encode($output);\n }", "function _osg_singout_notifier_prep_message($info,$data) {\n global $base_url;\n $message = array();\n $separator = md5(time());\n // carriage return type (we use a PHP end of line constant)\n $eol = PHP_EOL;\n\n //$params['to'] = $record['email'];\n $recipient = $info['first_name'].' '.$info['last_name'].' <[email protected]'.'>';\n $sender = variable_get('site_mail', '[email protected]');\n $message['subject'] = 'These Performances are available for registration.';\n $fudge = count($data) > 2?'s':'';\n $fudge = \"Please visit <a href=\\\"$base_url\\\">\".variable_get('site_name','[Some Cool Site]').\"</a>\"\n .\" and indicate your attendance plan for the following event$fudge:\";\n $data[0] = $fudge;\n $body = implode(\"<br>\",$data);\n\n\n\n $message['body'] = $body;\n\n debug($message,'$message');\n //drupal_mail($module, $key, $to, $language, $params = array(), $from = NULL, $send = TRUE)\n drupal_mail('osg_singout_notifier'\n , 'registration_needed'\n , $recipient\n , language_default()\n , $message\n , $sender\n );\n\n}", "public function sendContactsAction($header_data,$post_data){ \n// if(!isset($post_data['contact_numbers'])) {\n// Library::logging('alert',\"API : sendContacts : \".ERROR_INPUT.\": user_id : \".$header_data['id'].' '.$post_data['contact_numbers']);\n// Library::output(false, '0', ERROR_INPUT, null);\n// } else {\n if( empty($post_data['contact_numbers']) ){\n $post_data['contact_numbers'] = array();\n }\n try {\n $user = Users::findById($header_data['id']);\n $user->contact_numbers = $post_data['contact_numbers'];\n $user->save();\n Library::output(true, '1', CONTACTS_SAVED, null);\n } catch(Exception $e) {\n Library::logging('error',\"API : sendContacts : \".$e.\" \".\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_REQUEST, null);\n }\n// }\n }", "public function getRegisteredNumbersAction($header_data){\n try {\n $user = Users::findById($header_data['id']);\n if($header_data['os'] == 1) {\n $contact_numbers = json_decode($user->contact_numbers);\n } else {\n $contact_numbers = $user->contact_numbers;\n }\n $i = 0;\n $register = array();\n foreach($contact_numbers as $contacts) {\n $get_contacts = str_replace(' ', '', $contacts); \n $get_contacts = str_replace('+91', '', $contacts); \n if(substr($get_contacts, 0, 1) == \"0\") {\n $get_contacts = substr($get_contacts, 1);\n //$get_contacts = preg_replace('/0/', '', $get_contacts, 1); \n }\n $filter_contacts= preg_replace('/[^0-9\\-]/', '', $get_contacts);\n $filter_contacts = str_replace('-', '', $filter_contacts); \n if( $user->mobile_no == $filter_contacts ){\n continue;\n }\n $db = Library::getMongo();\n $record = $db->execute('return db.users.find({\"mobile_no\":{$in:[\"'.$filter_contacts.'\", \"+'.$filter_contacts.'\"]}, \"is_active\":1, \"is_deleted\":0}).toArray()');\n if(!empty($record['retval'][0])) {\n \n if( !empty($user->hidden_contacts) && in_array((string)$record['retval'][0]['_id'], $user->hidden_contacts) ){\n continue;\n }\n if(empty($record['retval'][0][\"is_mobile_searchable\"])) {\n continue;\n }\n if(isset($user->running_groups)) {\n $isFriend = false;\n foreach($user->running_groups as $user_ids) {\n if($user_ids['user_id'] == (string)$record['retval'][0]['_id']) {\n $isFriend = true; \n break;\n }\n }\n if( $isFriend ){\n continue;\n }\n }\n if( isset($user->request_sent) ) {\n $isFriendRequested = false;\n foreach($user->request_sent as $user_ids) {\n if($user_ids['user_id'] == (string)$record['retval'][0]['_id']) {\n $isFriendRequested = true; \n break;\n }\n }\n if( $isFriendRequested ){\n continue;\n }\n }\n if(isset($user->request_pending)) {\n $isRequestPending = false;\n foreach($user->request_pending as $user_ids) {\n if($user_ids['user_id'] == (string)$record['retval'][0]['_id']) {\n $isRequestPending = true; \n break;\n }\n }\n if( $isRequestPending ){\n continue;\n }\n }\n \n $register[$i]['mobile_no'] = $contacts;\n $register[$i]['user_id'] = (string)$record['retval'][0]['_id'];\n $register[$i]['username'] = $record['retval'][0]['username'];\n $register[$i]['jaxl_id'] = $record['retval'][0]['jaxl_id'];\n $register[$i]['profile_image'] = isset($record['retval'][0]['profile_image']) ? FORM_ACTION.$record['retval'][0]['profile_image'] : 'http://www.gettyimages.in/CMS/StaticContent/1391099126452_hero1.jpg';\n $register[$i]['request_sent'] = 0;\n if(isset($user->request_sent)) {\n foreach($user->request_sent as $request_sent) {\n// if($request_sent['is_active'] == 1) {\n// $j = 1;\n// }\n if($request_sent['user_id'] == (string)$record['retval'][0]['_id']) {\n $register[$i]['request_sent'] = 1;\n $register[$i]['is_active'] = $request_sent['is_active'];\n break;\n }\n }\n }\n $i++;\n }\n }\n if(empty($register)) {\n $result = array();\n Library::output(true, '1', \"No Error\", $result);\n } else {\n Library::output(true, '1', \"No Error\", $register);\n }\n } catch (Exception $e) {\n Library::logging('error',\"API : setContextIndicator : \".$e.\" \".\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_REQUEST, null);\n }\n }", "public function store()\n\t{\n\t\t$data = Input::json();\n\n\t\t$utils = UtilController::getInstance();\n\t\t$numberStructure = $utils->nStruct;\n\n\t\t$newNumber = new ContactNumber;\n\t\tforeach ($data as $key => $value) {\n\t\t\t$newNumber->$numberStructure[$key] = $value;\n\t\t}\n\n\t\t$newNumber->save();\n\t\tif ($newNumber) {\n\t\t\treturn Response::json($newNumber) ;\n\t\t}else\n\t\t{\n\t\t\treturn Response::make(\"error\", 500);\n\t\t}\n\t}", "function sendBulkSMS($username, $encryp_password, $senderid, $message, $mobileNos, $deptSecureKey) {\n $key = hash('sha512', trim($username) . trim($senderid) . trim($message) . trim($deptSecureKey));\n $data = array(\n \"username\" => trim($username),\n \"password\" => trim($encryp_password),\n \"senderid\" => trim($senderid),\n \"content\" => trim($message),\n \"smsservicetype\" => \"bulkmsg\",\n \"bulkmobno\" => trim($mobileNos),\n \"key\" => trim($key)\n );\n post_to_url(\"https://msdgweb.mgov.gov.in/esms/sendsmsrequest\", $data); //calling post_to_url to send bulk sms \n}", "function &subscription_list($start=NULL, $limit=NULL, $direction=0, $where=NULL)\n\n {\n\n global $database, $user;\n\n \n\n\t $message_array = array();\n\n \n\n\t // MAKE SURE MESSAGES ARE ALLOWED\n\n\t $set_sql = \"select currency_sign from se_global_sms where id='1'\";\n\t $set_resource = $database->database_query($set_sql);\n $set_result = $database->database_fetch_assoc($set_resource);\n\t $currency_sign = $set_result[currency_sign];\n\n // BEGIN MESSAGE QUERY\n\n $sql = \"\n\n SELECT\n\n *\n\n FROM\n\n se_subscription\n\n \";\n\n // EXECUTE QUERY\n\n $resource = $database->database_query($sql);\n\n \n\n // GET MESSAGES\n\n\t while( $message_info=$database->database_fetch_assoc($resource) )\n\n {\n\n // CREATE AN OBJECT FOR MESSAGE AUTHOR/RECIPIENT\n\n $pm_user = new SEUser();\n\n $pm_user->user_info['sno'] = $message_info['sno'];\n\n $pm_user->user_info['text'] = $message_info['text'];\n\n $pm_user->user_info['value'] = $message_info['value'];\n\t\n\t $pm_user->user_info['sms_credit'] = $message_info['sms_credit'];\n\t \n $pm_user->user_displayname();\n\n \n\n // Remove breaks for preview\n\n $message_info['pm_body'] = str_replace(\"<br>\", \"\", $message_info['pm_body']);\n\n \n\n // SET MESSAGE ARRAY\n\n $message_array[] = array(\n\n 'pmconvo_sno' => $message_info['sno'],\n\t\t'pmconvo_destext' => $message_info['text'],\n 'pmconvo_text' => $message_info['text'].\" - \".$currency_sign.$message_info['value'].\" For \".$message_info['sms_credit'].\" SMS \",\n 'pm_value' => $message_info['value'],\n\t\t'pm_body' => $message_info['pm_body'] \n\n );\n\n \n\n unset($pm_user);\n\n }\n\n \n\n return $message_array;\n\n }", "function CreateNewReqest($data) {\n if ($data['keyword'] == \"CC\" || $data['keyword'] == \"CR\") {\n $this->CheckEmailRecord($data);\n }\n $res_array = array();\n $smpprequest = $this->Choices->find('all', array('conditions' => array('smpp_request' => $data['keyword'])))->toArray();\n $res_array['request_id'] = $this->RecordRequest($data, $smpprequest);\n if ($smpprequest[0]['is_chargable'] == \"Yes\") {\n $res_array['tid'] = $this->RecordTransaction($data, $smpprequest, $res_array['request_id']);\n $res_array['amount'] = $smpprequest[0]['amount'];\n }\n\n return $res_array;\n }", "function returnJsonPayload($contacts, $numRows)\n {\n $payload = array('NumRows' => $numRows, 'Contacts' => $contacts, 'Error' => '');\n echo json_encode($payload);\n }", "public function exchanegArray($_data)\n {\n $this->page_no = (int) gv('page_no', $_data);\n $this->category_no = (int) gv('category_no', $_data);\n $this->controller_no = (int) gv('controller_no', $_data);\n $this->page_title = (string) gv('page_title', $_data);\n $this->page_uri = (string) gv('page_uri', $_data);\n $this->page_description = (string) gv('page_description', $_data);\n $this->icon = (string) gv('icon', $_data);\n $this->order_no = (int) gv('order_no', $_data);\n $this->use_mobile = (int) gv('use_mobile', $_data);\n $this->update_time = (string) gv('update_time', $_data);\n }", "function get_number_info() {\n\n $CallSid = $_POST['fieldname'];\n $AccountSid=$_POST['fieldname'];\n $CallFrom=$_POST['fieldname'];\n $CallTo=$_POST['fieldname'];\n $CallStatus=$_POST['fieldname'];\n $ApiVersion=$_POST['fieldname'];\n $Direction=$_POST['fieldname'];\n\n if (isset($_POST['fieldname'])) {\n $FromCity=$_POST['fieldname'];\n $FromState=$_POST['fieldname'];\n $FromZip=$_POST['fieldname'];\n $FromCountry=$_POST['fieldname'];\n } else {\n $FromCity=\"\";\n $FromState=\"\";\n $FromZip=\"\";\n $FromCountry=\"\";\n }\n $ToCity=$_POST['fieldname'];\n $ToState=$_POST['fieldname'];\n $ToZip=$_POST['fieldname'];\n $ToCountry=$_POST['fieldname'];\n\n $vars = array($CallSid,$AccountSid,$CallFrom,$CallTo,$CallStatus,$ApiVersion,$Direction,$FromCity,$FromState,$FromZip,$FromCountry,$ToCity,$ToState,$ToZip,$ToCountry);\n return $vars;\n }", "public function sendToAll2($orderId, $trype, $suppliers, $delivery, $orderdata = null, $cart_id = null, $user_id = null) {\n $id_of_the_order = $orderId;\n $products_model = $this->loadModel('Products');\n $suppliers_model = $this->loadModel('Suppliers');\n $delivery_model = $this->loadModel('Delivery');\n $order_products_model = $this->loadModel('OrderProducts');\n $order_model = $this->loadModel('Orders');\n $order_products = $order_products_model->find('all', ['conditions' => ['order_id' => $orderId]])->toArray(); //for web, mobile\n $orderdata['product_name'] = array_map(create_function('$o', 'return $o->product_id;'), $order_products); //not name, ids\n $orderdata['product_supplier'] = array_map(create_function('$o', 'return $o->supplier_id;'), $order_products);\n $orderdata['product_quantity'] = array_map(create_function('$o', 'return $o->product_quantity;'), $order_products);\n\n /* print '<pre>';\n print_r($orderdata);\n echo '<br>';\n print_r($orderdata);\n echo '<br>';\n\n echo '<br>';\n die(); */\n\n\n //$countedval = $this->processdata ( $orderdata );//for erp\n $countedval = $this->processdata($orderdata); //web and mobile\n\n $sub_total = $countedval ['subTotal'];\n $total = $countedval ['total'];\n $tax = $countedval ['tax'];\n $discount = $countedval ['discount'];\n\n\n $total_string = \"<br><table border='1'><tr>\" . \"<th>Sub Total</th>\" . \"<td>\" . $sub_total . \"</td></tr>\" . \"<tr><th>Tax</th>\" . \"<td>\" . $tax . \"</td></tr>\" . \"<tr><th>Discount</th>\" . \"<td>\" . $discount . \"</td></tr>\" . \"<tr><th>Total</th>\" . \"<td>\" . $total . \"</td></tr>\" . \"</tr></table><br><hr>\";\n\n $orderId = \"<h4>Order ID: \" . $orderId . \"</h4>\";\n $sup_string = \"<hr><br><table border='1'>\" . \"<tr>\" .\n /* \"<th>#</th>\". */\n \"<th>Supplier Id</th>\" . \"<th>Supplier name</th>\" . \"<th>Address</th>\" . \"<th>City</th>\" .\n /* \"<th>Email</th>\". */\n \"<th>Contact No.</th>\" . \"<th>Mobile No.</th>\" . \"<th>Product Id</th>\" . \"<th>Product name</th>\" . \"<th>Product price</th>\" . \"<th>Package</th>\" . \"<th>Quantity</th>\" . \"<th>Ammount</th>\" . \"</tr>\";\n $sup_string_end = \"</table>\";\n $row = \"\";\n $supliers_email = [];\n $delivery_mail = [];\n $delivery_mail_string = $orderId . $sup_string;\n\n foreach ($suppliers as $suplier) {\n $count = 1;\n $sup_email = \"\";\n for ($i = 0; $i < sizeof($orderdata ['product_name']); $i ++) {\n if ($suplier == $orderdata ['product_supplier'] [$i]) {\n $product_details = $products_model->get($orderdata ['product_name'] [$i], [\n 'contain' => [\n 'packageType'\n ]\n ]);\n $quntity = $orderdata ['product_quantity'] [$i];\n $supplier_details = $suppliers_model->get($orderdata ['product_supplier'] [$i], [\n 'contain' => 'city'\n ]);\n\n $row .= \"<tr style='min-height:35px'>\";\n $colspan = 1;\n if ($count == 1) {\n\n /* $row.=\"<td rowspan='2'>\".($i+1).\"</td>\"; */\n\n $row .= \"<td rowspan='\" . $colspan . \"'>\" . $supplier_details->id . \"</td>\"; // price for the orderd quantity\n $row .= \"<td rowspan='\" . $colspan . \"'>\" . $supplier_details->firstName . \" \" . $supplier_details->lastName . \"</td>\"; // name\n $row .= \"<td rowspan='\" . $colspan . \"'>\" . $supplier_details->address . \"</td>\"; // address\n $row .= \"<td rowspan='\" . $colspan . \"'>\" . $supplier_details->cid->cname . \"</td>\"; // city\n /* $row.=\"<td>\".$supplier_details->email.\"</td>\";//email */\n $row .= \"<td rowspan='\" . $colspan . \"'>\" . $supplier_details->contactNo . \"</td>\"; // contact\n $row .= \"<td rowspan='\" . $colspan . \"'>\" . $supplier_details->mobileNo . \"</td>\"; // mobile\n $sup_email = $supplier_details->email;\n } else {\n $row .= \"<td></td><td></td><td></td><td></td><td></td><td></td>\";\n }\n\n $row .= \"<td>\" . $product_details->id . \"</td>\"; // product id\n $row .= \"<td>\" . $product_details->name . \"</td>\"; // name\n $row .= \"<td>\" . $product_details->price . \"</td>\"; // price of a unit\n $row .= \"<td>\" . $product_details->package_type->type . \"</td>\"; // unit\n $row .= \"<td>\" . $quntity . \"</td>\"; // number of unit ordered\n $row .= \"<td>\" . $product_details->price * $quntity . \"</td>\"; // price for the orderd quantity\n\n $row .= \"</tr>\";\n\n $count ++;\n }\n }\n $colspan = $count;\n $delivery_mail_string .= $row;\n $supliers_email [$sup_email] = $orderId . $sup_string . $row . $sup_string_end;\n $row = \"\";\n }\n $delivery_mail_string .= $sup_string_end . $total_string;\n $delivery_mail_addrrss = $delivery_model->get($delivery, [\n 'fields' => [\n 'email'\n ]\n ]);\n // echo $delivery_mail_addrrss['email'];\n // \n $admin_mail_address = Configure::read('admin_email');\n //$customer=$order_model->find('all',['conditions'=>['Orders.id'=>$orderId],'contain'=>['Customers']])->first();\t\t\n //$customer_mail_address=$customer->customers['email'];//\"[email protected]\"\n //$customer_mail_address=\"[email protected]\";\n $order_data = (new OrdersController ())->__getOrderMailData($id_of_the_order);\n\n $user = $this->Cart->Users->get($user_id);\n $customer_mail [$user->username] = $order_data;\n //$customer_mail [$this->Auth->user('username')] = $order_data;\n $admin_mail [$admin_mail_address] = $order_data;\n $delivery_mail [$delivery_mail_addrrss ['email']] = $delivery_mail_string;\n\n\n /*\n * print_r($emails[4]);\n * print_r($emails[3]);\n * echo $delivery_mail_string;\n * die();\n */\n /*\n * print '<pre>';\n *\n * print_r(['del'=>$delivery_mail,'sup'=>$supliers_email]);\n * die();\n */\n\n // return ['del'=>$delivery_mail,'sup'=>$supliers_email];\n /*\n * print_r($supliers_email);\n * print_r($delivery_mail);\n */\n /* \tprint '<pre>';\n print_r($supliers_email);\n echo \"<br>\";\n print_r($delivery_mail);\n echo \"<br>\";\n print_r($admin_mail);echo \"<br>\";\n print_r($customer_mail);\n die(); */\n\n //$this->sendemail('new', $supliers_email, 'sup'); // suppliers email\n $this->sendemail('new', $delivery_mail, 'del'); // delivery email\n $this->sendemail2('new', $admin_mail, 'admin'); // delivery email\n $this->sendemail2('new', $customer_mail, 'cus'); // delivery email\n // die();\n }", "function add_quick_contact() {\n\t\t$user_id = $_POST['user_id'];\n\t\t$contact_list = $_POST['user_contacts'];\n\t\t$contact_name = $_POST['user_name'];\n\t\tif (!empty($contact_list) && !empty($user_id)) {\n\t\t\tfor ($i = 0; $i < count($contact_list); $i++) {\n\t\t\t\t$contact = $_POST['user_contacts'][$i];\n\t\t\t\t$contactname = $_POST['user_name'][$i];\n\t\t\t\t$add_contacts = $this -> conn -> insertnewrecords('quick_contacts', 'quick_contact_user_id, quick_contacts_name,quick_contacts_number', '\"' . $user_id . '\",\"' . $contactname . '\",\"' . $contact . '\"');\n\t\t\t\tif (!empty($add_contacts)) {\n\t\t\t\t\t$posts[] = array(\"user_contacts\" => $_POST['user_contacts'][$i], \"user_name\" => $_POST['user_name'][$i]);\n\t\t\t\t} else {\n\t\t\t\t\t$posts = array('status' => \"false\", \"message\" => \"Error in adding contacts\");\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t$post = array('status' => 'true', 'quick_contacts' => $posts);\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing parameter\", 'user_id' => $user_id, 'contacts' => $contact_list);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function count_post()\n{\n $pdata = file_get_contents(\"php://input\");\n $data = json_decode($pdata,true);\n\n // if(isset($data['company_id']))\n // {\n // $id = $data['company_id'];\n // }\n\n $totalCustomer = $this->model->getcount('users', array(\n 'user_role' => '2'));\n $todayOrders = $this->model->getcount('orders', array(\n 'DATE(created_at)' => date('Y-m-d')));\n $order_list = $this->model->GetJoinRecord('orders', 'user_id', 'users', 'id', 'COUNT(orders.id) as total_orders',array('orders.id!='=>'0'));\n\n $totalOrders = !empty($order_list) ? $order_list[0]->total_orders : 0;\n $pending_order = $this->model->getcount('orders',array('status='=>'placed'));\n $delivered_order = $this->model->getcount('orders',array('status='=>'delivered'));\n $cancel_order = $this->model->getcount('orders',array('status='=>'Cancel'));\n $processing_order = $this->model->getcount('orders',array('status='=>'Progress'));\n $dispatch_order = $this->model->getcount('orders',array('status='=>'Dispatched'));\n \n $resp = array(\n 'rccode' => 200,\n 'message' =>'success',\n 'total_customer' =>$totalCustomer,\n 'today_order' =>$todayOrders,\n 'total_order' => $totalOrders,\n 'pending_order' => $pending_order,\n 'delivered' =>$delivered_order,\n 'Cancel' => $cancel_order,\n 'Packing' => $processing_order,\n 'shipping' => $dispatch_order\n );\n$this->response($resp);\n}", "protected function makeData()\n {\n return Arr::collapse([\n $this->template->getQueryData(),\n [\n 'apiKey' => $this->apiKey,\n 'to' => implode(', ', (array) $this->getRecipientEmails())\n ]\n ]);\n }", "private function saveSmsData(){\n\t$arrSmsData = array();\n\t$status = explode('#', $this->returnMessageFromapi);\n\t$this->messageId = $status[0];\n\t$this->messageStatusText = $status[1];\n\t// prepare Data To save in to Data base;\n\t$arrSmsData = array(\n\t'to'=>$this->msisdn,\n\t'message'=>$this->message,\n\t'sendtime'=>date('Y-m-d H:i:s', time()),\n\t'messageId'=>$this->messageId,\n\t'messagestatustext'=>$this->messageStatusText,\n\t//'messagestatus'=>$this->delieverStatusReport(),\n\t'customer_id'=>($_SESSION['customer_id'])?$_SESSION['customer_id']:'0'\n\t);\n\treturn $arrSmsData;\n}", "function createContact($sfConn, $dataArray){\n\t\techo(\"<P> createContact <P>\");\n $sObjects = array();\n foreach ($dataArray as $fieldset)\n {\n\t\techo(\"<P> Set records to Contact <P>\");\n $sObject = new sObject();\n $sObject->type = 'Contact'; \n $sObject->fields = $fieldset;\n array_push($sObjects, $sObject);\n }\n\t\techo(\"<P> Ready to roll <P>\");\n $success = create_multiple($sfConn, $sObjects);\n return $success; \n }", "protected function _find_contacts( $data )\n { \n if( !is_array($data) ) {\n $this->_sendResponse(200, array(\"code\"=>'0','data'=>$data,'message'=>\"This functionality is not yet implemented.\"));\n }\n \n $friends = array();\n $tt_friends = array();\n $emailsString = '';\n $phonesString = '';\n foreach( $data as $contact ) {\n \n if(isset($contact['e']) && !empty ($contact['e'])) {\n $emailsString .= implode('\",\"', $contact['e']) . '\",\"';\n }\n \n $clean_numbers = array();\n foreach($contact['p'] as $number) {\n $clean_numbers[] = Users::strip_format($number);\n }\n $phonesString .= implode('\",\"', $clean_numbers) . '\",\"';\n } \n \n $emailsString = rtrim($emailsString, \"\\\"\\\",\");\n $phonesString = rtrim($phonesString, \"\\\"\\\",\");\n \n $result = array();\n \n $pairedCount = 0;\n $results = Users::find_by_emails_phones( $emailsString , $phonesString);\n \n if($results) \n foreach($results as $value) {\n\n if( isset( $value['person_id'] ) ) {\n $result['person_id'] = intval( $value['person_id'] );\n }\n if( isset( $value['user_id'] ) ) {\n $result['user_id'] = intval( $value['user_id'] );\n }\n\n if( !is_null( $result['user_id'] ) ) \n {\n if(self::$user->checkAndCreateContact($result[\"user_id\"])) {\n /*\n * @todo send push notification to paired user\n */\n $devices = Devices::model()->findAll( array('condition' => \n 'push_token!=\"\" AND push_token IS NOT NULL\n AND user_id=' . $result[\"user_id\"] ) );\n \n $alert = self::$user->person->first_name.\" is now your friend.\";\n\n $extra = array(\n \"action\" => 'friend',\n );\n\n $badge = Messages::get_unread_message_count($result[\"user_id\"]);\n PUSH::send($devices, $alert, $extra, $badge);\n $pairedCount ++;\n }\n $tt_friends[] = $result; \n } else {\n $friends[] = $result;\n }\n }\n \n return $pairedCount;\n }", "public function index(){\n\n\t\t$viewDataController = new ViewDataController();\n\t\t$data = $viewDataController->buildData();\n\n\t\tif( isset($data['profile_img_loc']) ){\n\t\t\t$data['profile_img_loc'] = 'https://s3-us-west-2.amazonaws.com/asset.plexuss.com/users/images/'.$data['profile_img_loc'];\n\t\t}\n\n\t\tif( $data['is_agency'] == 1 ){\n\t\t\t$type = 'agency';\n\t\t}else{\n\t\t\t$type = 'admin';\n\n $is_admin_premium = $this->validateAdminPremium();\n\n if (!$is_admin_premium) {\n return redirect( '/admin/premium-plan-request' );\n }\n\t\t}\n\n\t\t$data['title'] = 'Group Messaging';\n\t\t$data['currentPage'] = $type.'-groupmsg';\n\t\t$data['adminType'] = $type;\n\n\t\t//student list generated from approval page for group messaging\n\t\t$data['student_list'] = array();\n\t\t$data['student_count'] = 0;\n\t\t$data['campaign_count'] = 0;\n\n\t\tif( Cache::has(env('ENVIRONMENT').'_'.$data['user_id'].'_studentList') ){\n\t\t\t$data['student_list'] = Cache::pull(env('ENVIRONMENT').'_'.$data['user_id'].'_studentList');\n\t\t\t$data['student_count'] = count($data['student_list']);\n\t\t\t// var_dump($data['student_list']);\n\t\t\t// dd($data['student_count']);\n\t\t}\n\n\t\t// $user_id_arr = '';\n\t\t// foreach ($data['student_list'] as $key) {\n\n\t\t// \tif (isset($key['id'])) {\n\t\t// \t\t$user_id_arr .= Crypt::decrypt($key['id']).\",\";\n\t\t// \t}\n\t\t// \tif (isset($key['user_id'])) {\n\t\t// \t\t$user_id_arr .= Crypt::decrypt($key['user_id']).\",\";\n\t\t// \t}\t\t\n\n\t\t// }\n\n\t\t// $data['recipients'] = array();\n\n\t\t// if ($user_id_arr !='') {\n\t\t// \t$tmp = $this->getRecipientName($data, $user_id_arr);\n\n\t\t// \tforeach ($tmp as $key) {\n\t\t// \t\t$arr = array();\n\t\t// \t\t$arr['user_id'] = Crypt::encrypt($key['user_id']);\n\t\t// \t\t$arr['fname'] = $key['fname'];\n\t\t// \t\t$arr['lname'] = $key['lname'];\n\t\t// \t\t$arr['json'] = json_encode($key);\n\t\t// \t\t$arr['json'] = str_replace(\"'\", \"&lsquo;\", $key);\n\t\t// \t\t$arr['json'] = json_encode($arr['json']);\n\n\t\t// \t\t$data['recipients'][] = $arr;\n\t\t// \t}\n\n\t\t// }\n\t\t// generate list of campaigns\n\t\t$data = $this->generateListOfCampaigns($data, 0);\n\n\t\t//get templates\n\t\t$data = $this->getMessageTemplates($data);\n\n\t\t$org = new Organization;\n\t\t$org = $org->getThisOrgInfo($data['org_branch_id']);\n\t\t$this_org_user_ids = array();\n\t\tforeach ($org as $key) {\n\t\t\t$this_org_user_ids[] = $key->user_id;\n\t\t}\n\n\t\t$cmt = new CollegeMessageThreads;\n\t\t$data['total_num_campaign_messages'] = $cmt->getTotalNumOfCampaignMessages($data['tmp_campaign_ids'], $this_org_user_ids);\n\t\t$data['total_num_campaign_read_messages'] = $cmt->getTotalNumOfCampaignReadMessages($data['tmp_campaign_ids'], $this_org_user_ids);\n\t\t$data['total_num_campaign_replied_messages'] = $cmt->getTotalNumOfCampaignRepliedMessages($data['tmp_campaign_ids'], $this_org_user_ids);\n\t\t$data['read_response_rate'] = isset($data['total_num_campaign_messages']) && $data['total_num_campaign_messages'] > 0 ? number_format(($data['total_num_campaign_read_messages']/ $data['total_num_campaign_messages']) * 100, 2) : 0;\n\t\t$data['replied_response_rate'] = isset($data['total_num_campaign_messages']) && $data['total_num_campaign_messages'] > 0 ? number_format(($data['total_num_campaign_replied_messages']/ $data['total_num_campaign_messages']) * 100, 2) : 0;\n\n\t\t$data['total_num_campaign_messages'] = number_format($data['total_num_campaign_messages']);\n\t\t$data['total_num_campaign_read_messages'] = number_format($data['total_num_campaign_read_messages']);\n\t\t$data['total_num_campaign_replied_messages'] = number_format($data['total_num_campaign_replied_messages']);\n\t\t\n\t\t$ob = OrganizationBranch::on('rds1')->where('id', $data['org_branch_id'])\n\t\t\t\t\t\t\t\t\t\t\t->select('pending_auto_campaign', 'handshake_auto_campaign')\n\t\t\t\t\t\t\t\t\t\t\t->first();\n\n\t\t$data['pending_auto_campaign'] = $ob->pending_auto_campaign == 1 ? true : false;\n\t\t$data['handshake_auto_campaign'] = $ob->handshake_auto_campaign == 1 ? true : false;\n\n\n\t\t// echo \"<pre>\";\n\t\t// print_r($data);\n\t\t// echo \"</pre>\";\n\t\t// exit();\n\t\t// dd($data['campaigns']);\n\n\t\treturn View('groupMessaging.index', $data);\n\t}", "public function displayAjax()\n\t{\n\t\t// -------------------------\n\t\t$guid_import = (string)Tools::getValue('guid_import');\n\t\tif (empty($guid_import))\n\t\t\tdie('ended');\n\n\t\t// Get a bloc of 500 customers (formated)\n\t\t// --------------------------------------\n\t\t$req = new DbQuery();\n\t\t$req->select('*');\n\t\t$req->from('expressmailing_sms_recipients');\n\t\t$req->where('campaign_id = '.$this->campaign_id);\n\t\t$req->where('uploaded = \\'0\\'');\n\t\t$req->limit(1500);\n\n\t\t$recipients_list = Db::getInstance()->executeS($req, true, false);\n\n\t\tif (count($recipients_list) == 0)\n\t\t\tdie($this->finalizeImport($guid_import));\n\n\t\t$uploaded_id = array ();\n\t\t$formated_recipients = array ();\n\n\t\tforeach ($recipients_list as $recipient)\n\t\t{\n\t\t\t$uploaded_id[] = (int)$recipient['id'];\n\t\t\t$data = array ('Target' => $recipient['target']);\n\n\t\t\tif (!empty($recipient['col_0']))\n\t\t\t\t$data['Col_0'] = $recipient['col_0'];\n\t\t\tif (!empty($recipient['col_1']))\n\t\t\t\t$data['Col_1'] = $recipient['col_1'];\n\t\t\tif (!empty($recipient['col_2']))\n\t\t\t\t$data['Col_2'] = $recipient['col_2'];\n\t\t\tif (!empty($recipient['col_3']))\n\t\t\t\t$data['Col_3'] = $recipient['col_3'];\n\t\t\tif (!empty($recipient['col_4']))\n\t\t\t\t$data['Col_4'] = $recipient['col_4'];\n\t\t\tif (!empty($recipient['col_5']))\n\t\t\t\t$data['Col_5'] = $recipient['col_5'];\n\t\t\tif (!empty($recipient['col_6']))\n\t\t\t\t$data['Col_6'] = $recipient['col_6'];\n\t\t\tif (!empty($recipient['col_7']))\n\t\t\t\t$data['Col_7'] = $recipient['col_7'];\n\t\t\tif (!empty($recipient['col_8']))\n\t\t\t\t$data['Col_8'] = $recipient['col_8'];\n\t\t\tif (!empty($recipient['col_9']))\n\t\t\t\t$data['Col_9'] = $recipient['col_9'];\n\t\t\tif (!empty($recipient['col_10']))\n\t\t\t\t$data['Col_10'] = $recipient['col_10'];\n\t\t\tif (!empty($recipient['col_11']))\n\t\t\t\t$data['Col_11'] = $recipient['col_11'];\n\t\t\tif (!empty($recipient['col_12']))\n\t\t\t\t$data['Col_12'] = $recipient['col_12'];\n\t\t\tif (!empty($recipient['col_13']))\n\t\t\t\t$data['Col_13'] = $recipient['col_13'];\n\t\t\tif (!empty($recipient['col_14']))\n\t\t\t\t$data['Col_14'] = $recipient['col_14'];\n\t\t\tif (!empty($recipient['col_15']))\n\t\t\t\t$data['Col_15'] = $recipient['col_15'];\n\t\t\tif (!empty($recipient['col_16']))\n\t\t\t\t$data['Col_16'] = $recipient['col_16'];\n\t\t\tif (!empty($recipient['col_17']))\n\t\t\t\t$data['Col_17'] = $recipient['col_17'];\n\t\t\tif (!empty($recipient['col_18']))\n\t\t\t\t$data['Col_18'] = $recipient['col_18'];\n\t\t\tif (!empty($recipient['col_19']))\n\t\t\t\t$data['Col_19'] = $recipient['col_19'];\n\n\t\t\t$formated_recipients[] = $data;\n\t\t}\n\n\t\t// Upload the bloc\n\t\t// ---------------\n\t\t$response_array = array ();\n\t\t$parameters = array (\n\t\t\t'operation' => $guid_import,\n\t\t\t'recipients' => $formated_recipients\n\t\t);\n\n\t\tif ($this->session_api->call('sms', 'campaign', 'sendpart_recipients_from_file', $parameters, $response_array))\n\t\t{\n\t\t\t// Mark as uploaded the recipients treated\n\t\t\t// ---------------------------------------\n\t\t\tif (Db::getInstance()->update('expressmailing_sms_recipients', array (\n\t\t\t\t\t'uploaded' => '1'\n\t\t\t\t\t), 'campaign_id = '.$this->campaign_id.' AND id IN ('.join(',', $uploaded_id).')', 0, false, false\n\t\t\t\t))\n\t\t\t\tdie('continue');\n\n\t\t\techo Db::getInstance()->getMsgError();\n\t\t}\n\n\t\t// Return the error to the AJAX process\n\t\t// ------------------------------------\n\t\tdie(sprintf($this->module->l('Error during communication with Express-Mailing API : %s', 'adminmarketingsstep5'), $this->session_api->getError()));\n\t}", "private function dataInit($data) {\n\n\t\t\t//Default From\n\t\t\t$data['from']\t\t= empty($data['from']) ? $this->default['from'] : $data['from'];\n\t\t\t$data['complaint']\t= empty($data['complaint']) ? $this->default['returnPath'] : $data['complaint'];\n\t\t\t$data['reply']\t\t= empty($data['reply']) ? array($this->default['returnPath']) : $data['reply'];\n\t\t\t$data['cc']\t\t\t= empty($data['cc']) ? array() : $data['cc'];\n\t\t\t$data['bcc']\t\t= empty($data['bcc']) ? array() : $data['bcc'];\n\t\t\treturn $data;\n\t\t}", "public function add_contact($data)\n {\n $aid = false;\n\n $add = array();\n foreach (array(\n 'nick' => '\"\"', 'firstname' => '\"\"', 'lastname' => '\"\"', 'thirdname' => '\"\"',\n 'title' => '\"\"', 'company' => '\"\"', 'comp_dep' => '\"\"', 'comp_role' => '\"\"',\n 'comp_address' => '\"\"', 'comp_address2' => '\"\"', 'comp_street' => '\"\"',\n 'comp_zip' => '\"\"', 'comp_cellular' => '\"\"', 'comp_www' => '\"\"',\n 'comp_fax' => '\"\"', 'comp_location' => '\"\"', 'comp_region' => '\"\"',\n 'comp_country' => '\"\"', 'address' => '\"\"', 'address2' => '\"\"',\n 'street' => '\"\"', 'zip' => '\"\"', 'location' => '\"\"', 'region' => '\"\"',\n 'country' => '\"\"', 'email1' => '\"\"', 'email2' => '\"\"', 'bday_cal_evt_id' => 'NULL',\n 'tel_private' => '\"\"', 'tel_business' => '\"\"','cellular' => '\"\"', 'fax' => '\"\"', 'www' => '\"\"',\n 'birthday' => '\"\"', 'customer_number' => '\"\"', 'comments' => '\"\"') as $k => $v) {\n $add[] = (isset($data[$k])) ? $k.'=\"'.$this->esc($data[$k]).'\"' : $k.'='.$v;\n }\n if (!empty($add)) {\n $add[] = 'owner='.$this->uid;\n if ($this->query('INSERT '.$this->Tbl['adb_address'].' SET `uuid`=\"'.basics::uuid().'\",' . implode(',', $add))) {\n $aid = $this->insertid();\n if (isset($data['group']) && !empty($data['group'])) {\n foreach ($data['group'] as $gid) {\n $this->query('INSERT '.$this->Tbl['adb_adr_group'].' SET `aid`='.$aid.', `gid`='.intval($gid).', `uid`='.intval($this->uid));\n }\n }\n }\n }\n if (!empty($aid) && !empty($data['free'])) {\n foreach ($data['free'] as $type => $value) {\n $this->query('INSERT '.$this->Tbl['adb_freefield'].' SET `aid`='.$aid.', `type_id`='.intval($type).', `value`=\"'.$this->esc($value).'\"');\n }\n }\n\n return $aid;\n }", "function &user_addressbook_list($start=NULL, $limit=NULL, $direction=0, $where=NULL)\n\n {\n\n global $database, $user;\n\n \n\n\t $message_array = array();\n\n \n\n\t // MAKE SURE MESSAGES ARE ALLOWED\n\n\t \n\n \n\n // BEGIN MESSAGE QUERY\n\n $sql = \"\n\n SELECT\n\n *\n\n FROM\n\n se_addressbook\n\n WHERE\n\n se_addressbook.owner='{$user->user_info['user_username']}'\n\n \";\n\n // EXECUTE QUERY\n\n $resource = $database->database_query($sql);\n\n \n\n // GET MESSAGES\n\n\t while( $message_info=$database->database_fetch_assoc($resource) )\n\n {\n\n // CREATE AN OBJECT FOR MESSAGE AUTHOR/RECIPIENT\n\n $pm_user = new SEUser();\n\n $pm_user->user_info['id'] = $message_info['id'];\n\n $pm_user->user_info['nickname'] = $message_info['nickname'];\n\n $pm_user->user_info['full_name'] = $message_info['first'].\" \".$message_info['last'];\n\n $pm_user->user_info['email'] = $message_info['email'];\n\n $pm_user->user_info['phone'] = $message_info['phone'];\n $pm_user->user_info['grup '] = $message_info['grup'];\n $pm_user->user_displayname();\n\n \n\n // Remove breaks for preview\n\n $message_info['pm_body'] = str_replace(\"<br>\", \"\", $message_info['pm_body']);\n\n \n\n // SET MESSAGE ARRAY\n\n $message_array[] = array(\n\n 'pmconvo_id' => $message_info['id'],\n\n 'pmconvo_nickname' => $message_info['nickname'],\n\n 'pm_fullname' => $message_info['first'].\" \".$message_info['last'],\n\n 'pm_email' => $message_info['email'],\n\t\t 'pm_body' => $message_info['pm_body'],\n 'pm_grup' => $message_info['grup'],\n 'pm_replied' => $message_info['phone']\n\n );\n\n \n\n unset($pm_user);\n\n }\n\n \n\n return $message_array;\n\n }", "public function get_contactus_details() {\r\n $data=$this->Adminusermodel->get_contactus_details();\r\n if(!empty($data)){\r\n foreach($data as $key => $value)\r\n {\r\n $data[$key] = (array) $value;\r\n }\r\n $data=array('contactus'=>$data);\r\n }\r\n //print_r($data);\r\n $this->load->view('contactus_view',$data);\r\n //print_r($data);\r\n }", "public function contactUs($data) {\n $name = $data[0];\n $email = $data[1];\n $phone=$data[2];\n $question = $data[3];\n $this->Email->from(array($email => $name));\n $this->Email->bcc(array($this->concierge => 'Concierge'));\n $this->Email->to(Configure::read('Email.contact'));\n $this->Email->emailFormat('both');\n $this->Email->subject('New message from Contact');\n $this->Email->template('contactUs');\n $this->Email->viewVars(array('messageData' => $data));\n return $this->Email->send();\n }", "public function buildAddParams() {\n\t\t$lang = \\Lib\\Registry::getInstance()->get('lang');\n\t\t// get user id from session\n\t\t$params['uid'] = $uid = \\Lib\\session::get('uid');\n\t\t$GLOBALS['appLog']->log('uid: ' . $uid, \\Lib\\appLogger::INFO, __METHOD__);\n\n\t\t$c = array();\n\t\tforeach($_POST as $key => $value) {\n\t\t\tif ($key != 'submit')\n\t\t\t\t$c[$key] = $value; // put profile data in another array\n\t\t}\n\n\t\t$c['userid'] = $uid;\n\t\t$GLOBALS['appLog']->log('$c : ' . print_r($c,1), \\Lib\\appLogger::INFO, __METHOD__);\n\n\t\t$errorMessages = $this->validateFields($c);\n\n\t\tif (count($errorMessages) == 0)\n\t\t{\n\t\t\t$this->contactdoa->insertData($c);\n\t\t\t$GLOBALS['appLog']->log('New Contact was added', \\Lib\\appLogger::INFO, __METHOD__);\n\t\t\t$status = $this->consts['successful'];\n\t\t\t$displayMsg = $lang['CONTACTADDED'];\n\t\t\t$c = array(); // clear the contact data so blank form will be displayed to user\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$GLOBALS['appLog']->log('error messages to display', \\Lib\\appLogger::INFO, __METHOD__);\n\t\t\t$status = $this->consts['errors'];\n\t\t\t$displayMsg = $errorMessages;\n\t\t}\n\n\t\t$params = array(\n\t\t\t\t'lang' => $lang,\n\t\t\t\t'consts' => $this->consts,\n\t\t\t\t'submit' => $_POST['submit'],\n\t\t\t\t'action' => $this->consts['add'],\n\t\t\t\t'status' => $status,\n\t\t\t\t'displayMsg' => $displayMsg,\n\t\t\t\t'contactData' => $c \n\t\t\t\t);\n\t\treturn $params;\n\t}", "protected function prepare_data() {\n\t\t$data = array();\n\n\t\t$data['From'] = $this->sender;\n\t\t\n\t\tif (!is_null($this->reply_to)) {\n\t\t\t$data['ReplyTo'] = $this->reply_to;\n\t\t}\n\n\t\t$data['To'] = $this->recipient;\n\n\t\tif (!empty($this->cc)) {\n\t\t\t$data['Cc'] = implode(',', $this->cc);\n\t\t}\n\n\t\tif (!empty($this->bcc)) {\n\t\t\t$data['Bcc'] = implode(',', $this->bcc);\n\t\t}\n\n\t\t$data['Subject'] = $this->subject;\n\n\t\tif (!empty($this->tags)) {\n\t\t\t$data['Tag'] = $this->tags[0];\n\t\t}\n\n switch ($this->content_type) {\n case 'multipart/mixed':\n $data['HtmlBody'] = $this->message;\n $data['TextBody'] = (!empty($this->alt_message)) ? $this->alt_message : strip_tags($this->message);\n break;\n case 'text/html':\n $data['HtmlBody'] = $this->message;\n break;\n case 'text/plain':\n $data['TextBody'] = $this->message;\n break;\n default:\n throw new Exception('Failed to send email because mime type is unknown.');\n break;\n }\n\n if (!empty($this->attachments)) {\n $data['Attachments'] = $this->attachments;\n }\n\n\t\treturn $data;\n\t}", "public function store(Request $request)\n {\n\n\n\n\n$this->validate($request,[\n\n'message'=>'required'\n\n\n ]);\n\n\n\n\n\n// $this->validate($request,[\n\n// 'message'=>'required'\n\n// ]);\n\n $theme=$request->get('theme');\n $contacts=$request->get('contact');\n\n $lists=$request->get('list');\n $subject=$request->get('subject');\n\n\n\n$m=$request->get('message');\n$to=$request->get('to');\n\n $user=[];\n $listacc=[];\n if(!empty($contacts))\n\n {\n\n foreach ($contacts as $contact) {\n\n\n $user[]=$contact;\n\n\n }\n\n\n\n }\nif(!empty($to)){\n\n\n$user[]=$to;\n\n\n}\n\n\nif(!empty($lists)){\n\nforeach ($lists as $key => $list) {\n $listacc[]=$list;\n\n\n\n}\n\n\n\n}\n\n\n\n\nforeach($listacc as $key=>$list){\n\n//echo $list.\"<br/>\";\n\n$real=Lists::where('l_name',$list)->first();\n//print_r($real);\n\n\n\n\n// echo \"<br/>\";\n\n \n\n\n// echo \"<br/>\";\n//echo(\"----------------------------------------\");\n\n\nforeach($real->contacts as $ll){\n\n\n\n\n //echo $ll->c_mail;\n$user[]=$ll->c_mail;\n\n //echo \"<br/>\";\n}\n}\n\n//echo\"all users<br/>\";\n// foreach($user as $l){\n\n\n// echo $l;\n// echo \"<br>\";\n\n// }\n\n// echo $message.\"---\".$subject;\n\n// // }\n\n\n\n\nif(!empty($m) and !empty($user)){\n\n Mail::send('template.mail', ['m'=>$m,'subject'=>$subject,'user'=>$user], function ($message) use ($subject,$m,$user) {\n $message->from(\"[email protected]\", \"Cayshly Trading Network\");\n\n $message->to($user)->subject($subject);\n });\n\n\n\nfor ($i=0;$i<count($user);$i++) {\n # code...\n\nMails::create([\n\n\"person\"=>$user[$i],\n\"subject\"=>$subject,\n\"message\"=>$m,\n\"theme\"=>$theme\n\n\n\n\n\n ]);\n}//end foreach\n\n\nreturn redirect('mail');\n}else {\n echo '<script>';\necho 'alert(\"you must choose at least one contact\")';\necho '</script>';\n}\n\n// \n\n// }\n\n\n// if(!empty($user)){\n\n\n\n// foreach ($user as $key => $value) {\n\n\n\n// $data=['message'=>$message];\n\n\n// Mail::send('template.mail', ['message'=>$message], function($message) use($data) {\n\n// $message->from('[email protected]',\"cayshly\");\n// $message->to(\"[email protected]\")->subject('Welcome!');\n// });\n\n\n\n\n\n// }\n\n\n\n\n \n// }\n\n\n\n\n\n\n\n// return redirect('mail');\n\n\n\n\n\n\n//return dd($listacc);\n \n }", "function sendnow() {\n \t\t\n \t\tset_time_limit(0);\n \t\tini_set('memory_limit', '256M');\n \t\t\n \t\t$this->checkAccess('bulksms');\n \t\t\n \t\tif(isset($this->data)) {\n \t\t\t\n \t\t\tif(BULK_SMS_SERVER_DOWN) {\n \t\t\t\t$error[] = UNAVAILABLE_MESSAGE;\n \t\t\t}\n\n\t\t\tif($this->data['type'] && NINE_TO_NINE_ACTIVATED) {\n\t \t\t\t$error[] = NINE_TO_NINE_ACTIVATED_MESSAGE;\n\t \t\t}\t\t\t\n \t\t\t\n \t\t\t// Sender ID is optional\n \t\t\tif(isset($this->data['bulk_senderid_id'])) $bulk_senderid_id = filter_var(trim($this->data['bulk_senderid_id']), FILTER_VALIDATE_INT);\n \t\t\telse $bulk_senderid_id = 0;\n \t\t\t\n \t\t\t$bulk_group_id = filter_var(trim($this->data['bulk_group_id']), FILTER_VALIDATE_INT);\n \t\t\t$bulk_tag_id = filter_var(trim($this->data['bulk_tag_id']), FILTER_VALIDATE_INT);\n \t\t\t$message = urldecode(trim($this->data['message']));\n \t\t\t$number = filter_var(trim($this->data['number']), FILTER_SANITIZE_STRING);\n \t\t\t$day = filter_var(trim($this->data['day']), FILTER_VALIDATE_INT);\n \t\t\t$month = filter_var(trim($this->data['month']), FILTER_VALIDATE_INT);\n \t\t\t$year = filter_var(trim($this->data['year']), FILTER_VALIDATE_INT);\n \t\t\t$hours = filter_var(trim($this->data['hours']), FILTER_VALIDATE_INT);\n \t\t\t$minutes = filter_var(trim($this->data['minutes']), FILTER_VALIDATE_INT);\n \t\t\t\n \t\t\t/*\tCorrect Encoding\t*/\n \t\t\t$message = iconv('UTF-8', 'ASCII//TRANSLIT', $message);\n \t\t\t\n \t\t\tif(empty($message)) $error[] = 'Message Cannot Be Empty';\n \t\t\t//if(empty($bulk_group_id)) $error[] = 'Invalid Group';\n \t\t\t//if(empty($bulk_tag_id)) $error[] = 'Invalid Tag';\n \t\t\t\n \t\t\t$n = 0;\n \t\t\tif(empty($number) && empty($bulk_group_id)) $error[] = 'Enter Mobile Numbers or select a Group';\n \t\t\telse {\n \t\t\t\tif(!empty($number)) {\n \t\t\t\t\t$n = explode(',', $number);\n \t\t\t\t\t$n = array_filter($n);\n \t\t\t\t\tforeach($n as $k => $v) {\n \t\t\t\t\t\t$v = trim($v);\n \t\t\t\t\t\tif(!$this->checkNumber($v)) $inv_num[] = $v;\n \t\t\t\t\t\t$new_n[] = $v; \n \t\t\t\t\t}\n \t\t\t\t\t$n = $new_n;\n \t\t\t\t\tif(isset($inv_num)) $error[] = 'Invalid Mobile Number(s) '.implode(',', $inv_num);\n \t\t\t\t\t\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif(!empty($bulk_group_id) && !$this->checkBulkGroupId($bulk_group_id)) $error[] = 'Invalid Group ID';\n\n \t\t\t}\n \t\t\t\n \t\t\tif(!empty($bulk_senderid_id) && !$this->checkBulkSenderId($bulk_senderid_id)) $error[] = 'Invalid Sender ID';\n \t\t\t//if(!$this->checkBulkGroupId($bulk_group_id)) $error[] = 'Invalid Group ID';\n \t\t\tif(!$this->checkBulkTagId($bulk_tag_id)) $error[] = 'Invalid Tag ID';\n \t\t\t\n \t\t\t//check if the group empty or not\n \t\t\tif(!empty($bulk_group_id)) {\n\t \t\t\t$c['BulkAddressbook.bulk_group_id'] = $bulk_group_id;\n\t \t\t\t$c['BulkAddressbook.status'] = '0';\n\t \t\t\tif($this->BulkAddressbook->find('count', array('conditions'=>$c)) == '0') {\n\t \t\t\t\t$error[] = 'Group is empty';\n\t \t\t\t} else {\n \t\t\t\t\t\n\t \t\t\t\t// Get mobile numbers\n\t \t\t\t\tif(isset($this->data['mobile_list'])) $mobile_list = $this->data['mobile_list'];\n\t \t\t\t\telse {\n\t \t\t\t\t\t$mc['conditions']['BulkAddressbook.bulk_group_id'] = $bulk_group_id;\n\t \t\t\t\t\t$mc['conditions']['BulkAddressbook.status'] = '0';\n\t \t\t\t\t\t$mc['fields'] = array('BulkAddressbook.id');\n\t \t\t\t\t\t$mobile_list = $this->BulkAddressbook->find('list', $mc);\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t\t//SEND NOW\n \t\t\t\t\tif($this->data['type']) {\n\t \t\t\t\t\t$mc['conditions']['BulkAddressbook.id'] = $mobile_list;\n\t \t\t\t\t\t$mc['conditions']['BulkAddressbook.bulk_group_id'] = $bulk_group_id;\n\t \t\t\t\t\t$mc['conditions']['BulkAddressbook.status'] = '0';\n\t \t\t\t\t\t$mc['fields'] = array('BulkAddressbook.mobile');\n\t \t\t\t\t\t$mobile_list = $this->BulkAddressbook->find('list', $mc);\n\t \t\t\t\t\t\n\t \t\t\t\t\tunset($new_n);\n\t \t\t\t\t\tforeach($mobile_list as $k => $v) {\n\t \t\t\t\t\t\t$new_n[] = $v; \n\t \t\t\t\t\t}\n\t \t\t\t\t\t$n = !empty($n) ? array_merge($n, $new_n) : $new_n;\n \t\t\t\t\t\n \t\t\t\t\t} else {\n \t\t\t\t\t\t\n \t\t\t\t\t}\n\t \t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\t//SEND NOW\n \t\t\tif($this->data['type']) {\n \t\t\t\t\n \t\t\t\tif(!isset($error)) {\n \t\t\t\t\t\n \t\t\t\t\tif(strlen($message) > MAX_CHARS)\n \t\t\t\t\t\t$message = substr($message, 0, MAX_CHARS);\n \t\t\t\t\t\n \t\t\t\t\t//get sms vendor details\n\t\t \t\t\t$this->getBulkSmsVendor($this->Session->read('user_id'));\n\t\t \t\t\t//pr($this->sms_vendor_details);\n \t\t\t\t\t\n \t\t\t\t\tunset($v);\n \t\t\t\t\t$v['message'] = $message;\n \t\t\t\t\t$v['bulk_user_id'] = $this->Session->read('user_id');\n \t\t\t\t\t$v['sms_count'] = $this->sms_count($message);\n \t\t\t\t\t$v['numbers'] = !empty($n) ? implode(', ', $n) : '0';\n \t\t\t\t\t$v['bulk_senderid_id'] = $bulk_senderid_id;\n \t\t\t\t\t$v['bulk_group_id'] = empty($bulk_group_id) ? '0' : $bulk_group_id;\n \t\t\t\t\t$v['bulk_tag_id'] = $bulk_tag_id;\n \t\t\t\t\t$v['ip'] = ip2long($_SERVER['REMOTE_ADDR']);\n \t\t\t\t\t$v['sms_vendor_id'] = $this->sms_vendor_id;\n \t\t\t\t\t$this->BulkSmsLog->save($v);\n \t\t\t\t\t$bulk_sms_log_lid = $this->BulkSmsLog->getLastInsertId();\n \t\t\t\t\t\n \t\t\t\t\tif(count($n) < BULK_SMS_CLI_DECIDER) {\n \t\t\t\t\t\t\n\t\t\t\t\t\t//SEND SMS\n \t\t\t\t\t\t$this->_sendBulkMessage($bulk_group_id, $bulk_senderid_id, $message, $bulk_sms_log_lid, $this->Session->read('user_id'), $n, false, $this->sms_vendor_id);\n \t\t\t\t\t\n \t\t\t\t\t} else {\n\n \t\t\t\t\t\t//SAVE SMS IN TEMP TABLE\n\t \t\t\t\t\tunset($v);\n\t \t\t\t\t\t$v['message'] = $message;\n\t \t\t\t\t\t$v['numbers'] = !empty($n) ? implode(', ', $n) : '0';\n\t \t\t\t\t\t$v['bulk_user_id'] = $this->Session->read('user_id');\n\t\t\t\t\t\t$v['bulk_senderid_id'] = $bulk_senderid_id;\n \t\t\t\t\t\t$v['bulk_group_id'] = empty($bulk_group_id) ? '0' : $bulk_group_id;\n \t\t\t\t\t\t$v['bulk_sms_log_id'] = $bulk_sms_log_lid;\n \t\t\t\t\t\t$v['sms_vendor_id'] = $this->sms_vendor_id;\n \t\t\t\t\t\t$this->BulkSmsCli->save($v);\n\t \t\t\t\t\t$lastinsertid = $this->BulkSmsCli->getLastInsertId();\n \t\t\t\t\t\n \t\t\t\t\t\n \t\t\t\t\t\t//CALL CLI TO SEND SMS\n \t\t\t\t\t\t$path = \"php \" . WWW_ROOT . \"cron_dispatcher.php /bulksms/send_using_cli/\".$lastinsertid;\n \t\t\t\t\t\t$outputfile = \"/tmp/output.cli.\".$lastinsertid;\n \t\t\t\t\t\t$pidfile = \"/tmp/pid.cli.\".$lastinsertid;\n \t\t\t\t\t\texec(sprintf(\"%s > %s 2>&1 & echo $! >> %s\", $path, $outputfile, $pidfile));\n \t\t\t\t\t\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t//GET GROUP NAME\n \t\t\t\t\t$groupname = $number = '';\n \t\t\t\t\tif(!empty($bulk_group_id)) {\n\t \t\t\t\t\t$this->BulkGroup->id = $bulk_group_id;\n\t \t\t\t\t\t$groupname = '<br/>Contact(s) from '.$this->BulkGroup->field('name') . ' Group';\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\tif(!empty($n)) {\n \t\t\t\t\t\t$number = '<br/>Mobile Numbers(s) '.implode(', ', $n);\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t$return_data = 'Message Successfully Send To:'.$groupname.$number;\n\t\t\t \t\tif(strlen($return_data) > 250) $return_data = substr($return_data, 0, 200).'..';\n\t\t\t \t\t\n\t\t\t \t\t$return_data .= '<br/><a href=\"/bulksms/showdetailedreport/'.$bulk_sms_log_lid.'\">View Detailed Delivery Report</a>';\n\t\t\t \t\t\n \t\t\t\t\t$this->Session->write('success', $return_data);\n \t\t\t\t\t$this->redirect('/bulksms/sendnow');\n \t\t\t\t\texit;\n \t\t\t\t\t\n \t\t\t\t} else {\n \t\t\t\t\t$this->set('error', $error);\n \t\t\t\t\t$this->set('message', $message);\n \t\t\t\t\t$this->set('number', $number);\n \t\t\t\t\t$this->set('day', $day);\n \t\t\t\t\t$this->set('month', $month);\n \t\t\t\t\t$this->set('year', $year);\n \t\t\t\t\t$this->set('hour', $hours);\n \t\t\t\t\t$this->set('minutes', $minutes);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t//SCHEDULE\t\n \t\t\t} else {\n \t\t\t\t\n \t\t\t\t/*if($day == '' || $month == '' || $year == '' || $hours == '' || $minutes == '') { \n \t\t\t\t\t$error[] = 'Invalid Date Entered';\n \t\t\t\t} else {*/\n \t\t\t\t\t$date = date('Y-m-d H:i:s', mktime($hours, $minutes, '0', $month, $day, $year));\n \t\t\t\t\tif($date < date('Y-m-d H:i:s')) $error[] = 'Please select a future date';\n \t\t\t\t//}\n \t\t\t\t\n\t\t\t\tif(!($hours > '08' && $hours < '21')) {\n \t\t\t\t\t$error[] = NINE_TO_NINE_ACTIVATED_MESSAGE;\n \t\t\t\t}\n\n \t\t\t\tif(isset($mobile_list) && !empty($mobile_list)) {\n\t \t\t\t\tunset($c);\n\t \t\t\t\tif(count($mobile_list) == 1) $mobile_list = $mobile_list['0'];\n\t \t\t\t\t$c['conditions']['BulkAddressbook.bulk_group_id'] = $bulk_group_id;\n\t \t\t\t\t$c['conditions']['BulkAddressbook.id NOT'] = $mobile_list;\n\t \t\t\t\t$c['conditions']['BulkAddressbook.status'] = '0';\n\t \t\t\t\t$c['fields'] = array('BulkAddressbook.id');\n\t \t\t\t\t$not_included = $this->BulkAddressbook->find('list', $c);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif(!isset($error)) {\n \t\t\t\t\t\n \t\t\t\t\t$date = date('Y-m-d H:i:s', mktime($hours, $minutes, '0', $month, $day, $year));\n \t\t\t\t\t$udate = date('jS M, Y g:i a', strtotime($date));\n \t\t\t\t\t\n \t\t\t\t\tunset($v);\n \t\t\t\t\t$v['message'] = $message;\n \t\t\t\t\t$v['bulk_user_id'] = $this->Session->read('user_id');\n \t\t\t\t\t$v['numbers'] = !empty($n) ? implode(',', $n) : '0';\n \t\t\t\t\t$v['not_included'] = !empty($not_included) ? implode(',', $not_included) : '0';\n \t\t\t\t\t$v['scheduledate'] = $date;\n \t\t\t\t\t$v['bulk_senderid_id'] = $bulk_senderid_id;\n \t\t\t\t\t$v['bulk_group_id'] = empty($bulk_group_id) ? '0' : $bulk_group_id;\n \t\t\t\t\t$v['bulk_tag_id'] = $bulk_tag_id;\n \t\t\t\t\t$v['ip'] = ip2long($_SERVER['REMOTE_ADDR']);\n \t\t\t\t\t$this->BulkSmsSchedule->save($v);\n \t\t\t\t\t\n \t\t\t\t\t$this->Session->write('success', 'Message Successfully Scheduled on '.$udate);\n \t\t\t\t\t$this->redirect('/bulksms/sendnow');\n \t\t\t\t\texit;\n \t\t\t\t\t\n \t\t\t\t} else {\n \t\t\t\t\t$this->set('error', $error);\n \t\t\t\t\t$this->set('message', $message);\n \t\t\t\t\t$this->set('number', $number);\n \t\t\t\t\t$this->set('day', $day);\n \t\t\t\t\t$this->set('month', $month);\n \t\t\t\t\t$this->set('year', $year);\n \t\t\t\t\t$this->set('hour', $hours);\n \t\t\t\t\t$this->set('minutes', $minutes);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t}\n \t\t\n \t\tunset($cond);\n \t\t$cond['conditions']['status'] = '0';\n\t \t$cond['conditions']['bulk_user_id'] = $this->Session->read('user_id');\n\t \t$group = $this->BulkGroup->find('list', $cond);\n\t \t$groupname = '<option value=\"0\">Select Group</option>';\n\t \t\n\t \tforeach($group as $key => $value) {\n\t \t\t$groupname .= '<option value=\"'.$key.'\">'.$value.'</option>';\n\t \t}\n\t \t$this->set('groupname', $groupname);\n\t \t\n\t \tunset($cond);\n\t \t$cond['conditions']['status'] = '0';\n\t \t$cond['conditions']['publish'] = '1';\n\t \t$cond['conditions']['bulk_user_id'] = $this->Session->read('user_id');\n\t \t$sender = $this->BulkSenderid->find('list', $cond);\n\t \t$senderid = '';\n\t \t\n\t \tforeach($sender as $key => $value) {\n\t \t\t$senderid .= '<option value=\"'.$key.'\">'.$value.'</option>';\n\t \t}\n\t \t$this->set('senderid', $senderid);\n\t \t\n\t \tunset($cond);\n\t \t$cond['conditions']['status'] = '0';\n\t \t$cond['conditions']['bulk_user_id'] = $this->Session->read('user_id');\n\t \t$data = $this->BulkSmsTag->find('list', $cond);\n\t \t$tag = '';\n\t \t\n\t \tforeach($data as $key => $value) {\n\t \t\t$tag .= '<option value=\"'.$key.'\">'.$value.'</option>';\n\t \t}\n\t \t$this->set('tag', $tag);\n\t \t\n\t \tunset($cond);\n\t \t$cond['conditions']['BulkAccount.status'] = '0';\n\t \t$cond['conditions']['BulkAccount.bulk_user_id'] = $this->Session->read('user_id');\n\t \t$quantity = $this->BulkAccount->field('BulkAccount.quantity', $cond['conditions']);\n\t \t$this->set('quantity', $quantity);\n\t \t\n \t\t$this->layout = 'bulksms';\n \t\t$this->set('tab', array('2'));\n\t\t//$this->getFeedback();\n\t\t\n \t\tif($this->Session->check('success')) {\n \t\t\t$this->set('success', $this->Session->read('success'));\n \t\t\t$this->Session->delete('success');\n \t\t}\n \n \t}", "function recive_sms(){\n // 'originalsenderid' => '+19179354988',\n // 'body' => 'Chat with you started 5157248',\n // 'message' => 'Chat with you started 5157248',\n // 'sms' => '+16102231415',\n // 'custom_string' => '',\n // 'to' =>'+16102231415',\n // 'original_message_id' => '',\n // 'originalmessageid' => '',\n // 'customstring' => '',\n // 'from' => '+918591041420',\n // 'originalmessage' => '',\n // 'user_id' => '73872',\n // 'subaccount_id' => '86325',\n // 'original_body' => '',\n // 'timestamp' => '1556179523',\n // 'message_id' => 'FBF799B1-2BDC-4D29-86EE-4F9EC69931D7',\n // );\n App::save_data('log_data',array('log_type'=>'sms_receive','log_data'=> json_encode($_POST) ) );\n if(isset($_POST['to'] ) ){\n $to_sms = $_POST['to'];\n $from_sms = $_POST['message'];\n $raw = json_encode($_POST);\n $timestamp = $_POST['timestamp'];\n $datetime = date('Y:m:d H:i:s');\n \n // $from_sms_api = (array) App::get_by_where('leads_sms', array('sms_to'=>$to_sms) );\n \n $newstring = substr($to_sms, -10);\n $this->db->select('*');\n $this->db->from('leads');\n $this->db->like(\"phone\",\"$newstring\");\n $query=$this->db->get();\n $from_sms_api = $query->row();\n \n $leadData = array(\n 'lead_id' =>$from_sms_api->id,\n 'sms_text' => $from_sms,\n 'sms_to' => $to_sms,\n 'sms_type' => 'in',\n 'sms_time' => $datetime,\n );\n App::save_data( 'leads_sms',$leadData);\n App::create_activity('lead_activity',$from_sms_api->id,'SMS Received',json_encode($_POST));\n }\n }", "public function POSTindex()\n\t{\n\t\t/* Make sure there is a valid sender */\n\t\tif ( !isset( \\IPS\\Request::i()->from ) OR !\\IPS\\Member::load( (int) \\IPS\\Request::i()->from )->member_id )\n\t\t{\n\t\t\tthrow new \\IPS\\Api\\Exception( 'INVALID_SENDER', '1C374/2', 404 );\n\t\t}\n\n\t\t/* Verify there are recipients and all the recipients are valid */\n\t\tif( !isset( \\IPS\\Request::i()->to ) OR !\\is_array( \\IPS\\Request::i()->to ) OR !\\count( \\IPS\\Request::i()->to ) )\n\t\t{\n\t\t\tthrow new \\IPS\\Api\\Exception( 'INVALID_RECIPIENT', '1C374/3', 404 );\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach( \\IPS\\Request::i()->to as $to )\n\t\t\t{\n\t\t\t\tif( !\\IPS\\Member::load( (int) $to )->member_id )\n\t\t\t\t{\n\t\t\t\t\tthrow new \\IPS\\Api\\Exception( 'INVALID_RECIPIENT', '1C374/4', 404 );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* Make sure we have a title and body */\n\t\tif( !isset( \\IPS\\Request::i()->title ) OR !isset( \\IPS\\Request::i()->body ) )\n\t\t{\n\t\t\tthrow new \\IPS\\Api\\Exception( 'MISSING_TITLE_OR_BODY', '1C374/5', 404 );\n\t\t}\n\n\t\t/* Create the conversation */\n\t\t$item = \\IPS\\core\\Messenger\\Conversation::createItem( \\IPS\\Member::load( (int) \\IPS\\Request::i()->from ), \\IPS\\Request::i()->ipAddress(), \\IPS\\DateTime::create(), NULL );\n\t\t$item->title\t= \\IPS\\Request::i()->title;\n\t\t$item->to_count\t= \\count( \\IPS\\Request::i()->to );\n\t\t$item->save();\n\n\t\t/* Create the first message */\n\t\t$postContents = \\IPS\\Text\\Parser::parseStatic( \\IPS\\Request::i()->body, TRUE, NULL, \\IPS\\Member::load( (int) \\IPS\\Request::i()->from ), 'core_Messaging' );\n\n\t\t$commentClass = $item::$commentClass;\n\t\t$post = $commentClass::create( $item, $postContents, TRUE, NULL, NULL, \\IPS\\Member::load( (int) \\IPS\\Request::i()->from ), \\IPS\\DateTime::create() );\n\t\t\n\t\t$item->first_msg_id = $post->id;\n\t\t$item->save();\n\n\t\t/* Authorize sender and recipients */\n\t\t$item->authorize( array_map( function( $member ) { return (int) $member; }, array_merge( array( \\IPS\\Request::i()->from ), \\IPS\\Request::i()->to ) ) );\n\n\t\t/* Send notifications */\n\t\t$post->sendNotifications();\n\n\t\treturn new \\IPS\\Api\\Response( 201, $item->id );\n\t}", "protected function create(array $data)\n {\n\n $pin = substr(time(), 4);\n if (isset($data['affiliate_id'])) {\n $position = ['L', 'R'];\n $ref_id = $data['user_id'];\n $poss = array_random($position);\n $posid = getLastChildOfLR($ref_id, $poss);\n }\n\n // $general = General::first();\n\n $message = '<tr>';\n $message .= '<td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\">';\n $message .= '<p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;color:green;\">Our warmest congratulations on your new account opening! This only shows that you have grown your business well. I pray for your prosperous.</p>';\n\n $message .= '<p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">You have taken this path knowing that you can do it. Good luck with your new business. I wish you all the success and fulfillment towards your goal.</p>';\n $message .= '<p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">Your username is ' . $data['username'] . ' .</p>';\n\n $message .= '<p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">Your password is ' . $data['password'] . ' .</p>';\n\n $message .= '<p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px; color:red;\">Remember, never share your password with otherone. And you are agree with our Terms and Policy.</p>';\n $message .= '</td>';\n $message .= '</tr>';\n\n send_email($data['email'], 'Account Created Successfully', $data['first_name'], $message);\n\n $sms = 'Congratulation, for registration. Your username is ' . $data['username'] . '. Your password is ' . $data['password'] . '';\n send_sms($data['mobile'], $sms);\n $affiliate_id = str_random(15);\n $check_affilate = User::where('affiliate_id', $affiliate_id)->count();\n while ($check_affilate > 0) {\n $affiliate_id = str_random(15);\n $check_affilate = User::where('affiliate_id', $affiliate_id)->count();\n if (!$check_affilate > 0) {\n break;\n }\n $check_affilate = $check_affilate - 1;\n }\n if (!$check_affilate > 0) {\n if (isset($data['affiliate_id'])) {\n // Add 20% COMMISION TO THE REFFERAL'S ACCOUNT\n $package_id = $data['package'];\n $package_info = Package::find($package_id);\n $package_price = $package_info->price;\n $commision = (20 / 100) * $package_price;\n $user = User::find($data['user_id']);\n $user_name = $user->first_name . $user->last_name;\n // Income::create([\n // 'user_id' => $data['user_id'],\n // 'amount' => $commision,\n // 'description' => 'Refferal Income By' . $user_name,\n // 'type' => 'R',\n // ]);\n // echo \"Resister With Affiliate\";\n return User::create([\n 'email' => $data['email'],\n 'password' => bcrypt($data['password']),\n 'referrer_id' => $data['user_id'],\n 'position' => $poss,\n 'first_name' => $data['first_name'],\n 'last_name' => $data['last_name'],\n 'mobile' => $data['mobile'],\n 'street_address' => $data['street_address'],\n 'city' => $data['city'],\n //'post_code' => $data['post_code'],\n 'country' => $data['country'],\n 'username' => $data['username'],\n 'birth_day' => date('Y-m-d', strtotime($data['birth_day'])),\n 'join_date' => Carbon::today(),\n 'balance' => 0,\n 'status' => 0,\n 'paid_status' => 0,\n 'ver_status' => 1,\n 'ver_code' => $pin,\n 'forget_code' => 0,\n 'posid' => $posid,\n 'tauth' => 0,\n 'tfver' => 1,\n 'emailv' => 1,\n 'smsv' => 1,\n 'affiliate_id' => $affiliate_id,\n 'package_id' => $data['package'],\n 'expiry_date' => date('Y-m-d', strtotime('+4 months')),\n ]);\n } else {\n // echo \"Resister With Common\";date('Y-m-d', strtotime('+4 months'));\n return User::create([\n 'email' => $data['email'],\n 'password' => bcrypt($data['password']),\n //'referrer_id' => $data['referrer_id'],\n //'position' => $data['position'],\n 'first_name' => $data['first_name'],\n 'last_name' => $data['last_name'],\n 'mobile' => $data['mobile'],\n 'street_address' => $data['street_address'],\n 'city' => $data['city'],\n //'post_code' => $data['post_code'],\n 'country' => $data['country'],\n 'username' => $data['username'],\n 'birth_day' => date('Y-m-d', strtotime($data['birth_day'])),\n 'join_date' => Carbon::today(),\n 'balance' => 0,\n 'status' => 0,\n 'paid_status' => 0,\n 'ver_status' => 1,\n 'ver_code' => $pin,\n 'forget_code' => 0,\n //'posid' => $posid,\n 'tauth' => 0,\n 'tfver' => 1,\n 'emailv' => 1,\n 'smsv' => 1,\n 'affiliate_id' => $affiliate_id,\n 'package_id' => $data['package'],\n 'expiry_date' => date('Y-m-d', strtotime('+4 months')),\n ]);\n }\n }\n }", "public function processCommentData() {\n$varray = array();\n\n\t$newItems = array();\n$total_price =0;\n$count = 0;\n$username = $this->username;\n$data = $this->getCommentData();\n\n\n $usd = $this->getSBD();\n$curr = $this->getCURR();\t \n$eth = $this->getETH();\t \n$btc = $this->getBTC();\t \n\t\nif (!empty($_GET['curr'])){\t\nif ($_GET['curr'] == 'eur'){$mult = round($curr[\"EUR\"]*$usd,2); $ext = 'EUR'; }\nelse if ($_GET['curr'] == 'zar'){$mult = round($curr[\"ZAR\"]*$usd,2); $ext = 'RANDS';}\nelse if ($_GET['curr'] == 'ghs'){$mult = round($curr[\"GHS\"]*$usd,2); $ext = 'CEDIS';}\nelse if ($_GET['curr'] == 'ngn'){$mult = round($curr[\"NGN\"]*$usd,2); $ext = 'NAIRA';}\nelse if ($_GET['curr'] == 'cad'){$$mult = round($curr[\"CAD\"]*$usd,2); $ext = 'C$';}\nelse if ($_GET['curr'] == 'gbp'){$mult = round($curr[\"GBP\"]*$usd,2); $ext = 'POUNDS';}\nelse if ($_GET['curr'] == 'dollars'){$mult = round($usd,2); $ext = 'DOLLAR';}\n\nelse if ($_GET['curr'] == 'btc'){$mult = round($usd/$btc,6); $ext = 'BTC';}\nelse if ($_GET['curr'] == 'eth'){$mult = round($usd/$btc,6); $ext = 'ETH';}\n\nelse if ($_GET['curr'] == 'aed'){$mult = round($curr[\"AED\"]*$usd,2); $ext = 'DIRHAMS';}\nelse if ($_GET['curr'] == 'inr'){$mult = round($curr[\"INR\"]*$usd,2); $ext = 'Indian Rupees';}\nelse if ($_GET['curr'] == 'pkr'){$mult = round($curr[\"PKR\"]*$usd,2); $ext = 'Pakistani Rupees';}\nelse if ($_GET['curr'] == 'php'){$mult = round($curr[\"PHP\"]*$usd,2); $ext = 'Philippine Pesos';}\n}\nelse {$mult = 1; $ext = 'sbd';}\n\t \n\t \nforeach ($data as $item) {\n\t\n\t\t\n\t\tif(!($item[\"pending_payout_value\"]==\"0.000 SBD\") && $username == $item[\"author\"])\n\t\t{\n\t\t\t\n\t\t\t\t$post_link = \"https://www.steemit.com/@\".$item[\"author\"].\"/\".$item[\"permlink\"];\n\t\t\t\n\t\t\t$author_link = \"https://www.steemit.com/@\".$item[\"author\"];\n\n\t\t\t$post_title = substr($item[\"root_title\"],0,44).'...';\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$price = str_replace(\" SBD\", \"\", $item[\"pending_payout_value\"]);\n\t\n\t\t\t\n\t\t\t\n\t\t\t//Adjustment For 75% Returns for Authors\n\t\t\tif ($username == $item[\"author\"]){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$each_pay = $price * 0.375;\n\t\t\t\t\t\t$total_price =$total_price + $each_pay;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$each_pay = $each_pay*$mult.' '.$ext;\n\t\t\t\t\n\t\t\t\n\t\t\t\t$newItems[$count]['author_link'] = $author_link;\n\t\t\t\t$newItems[$count]['author'] = $item[\"author\"];\n\t\t\t\t$newItems[$count]['post_link'] = $post_link;\n\t\t\t\t$newItems[$count]['post_title'] = $post_title;\n\t\t\t\t$newItems[$count]['pending_payout_value'] = $item[\"pending_payout_value\"];\n\t\t\t\t$newItems[$count]['each_pay'] = $each_pay;\n\t\t\t\t$newItems[$count]['parent_permlink'] = $item[\"parent_permlink\"];\n\t\t\t\t$newItems[$count]['voters'] = $item[\"active_votes\"];\n\t\t\t\t$newItems[$count]['vcount'] = count($item[\"active_votes\"]);\n\t\t\t\n\t\t\t $this->array_sort_by_column($newItems[$count]['voters'], 'rshares');\n\t\t\t\t\n\t\t\t\t$rshares_sum = array_sum(array_map(function($var) {\n return $var['rshares'];\n}, $newItems[$count]['voters']));\n\n\n$key = 0;\n\nforeach($newItems[$count]['voters'] as $csm)\n { $aMoney = $price;\n\t $vFraction = $csm['rshares']/ $rshares_sum;\n\t $vMoney = $vFraction * $aMoney;\n $newItems[$count]['voters'][$key]['money'] = $vMoney * $mult;\n $newItems[$count]['voters'][$key]['percent'] = $newItems[$count]['voters'][$key]['percent'] / 100;\n \n $vname =$newItems[$count]['voters'][$key]['voter'];\n \n if (array_key_exists($vname,$varray)){\n$varray[$vname]['amount'] = $varray[$vname]['amount'] + $vMoney * $mult; \n$varray[$vname]['count'] = $varray[$vname]['count'] + 1; \n }\n else {\n$varray[$vname]['name'] = $newItems[$count]['voters'][$key]['voter'];\n$varray[$vname]['amount'] = $vMoney * $mult;\n$varray[$vname]['count'] = 1;\n$varray[$vname]['type'] = 'cumVote';\n }\n \n $key++;\n }\n\t\t\t\t\n\t\t\t\t$nT = str_replace(\"T\",\" \",$item[\"created\"]);\n\t\t\t\t$nT = strtotime($nT);\n\t\t\t\t$newItems[$count]['created'] = $this->fancy_date($nT);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t//Final Payment\t\t\n$newItems[$count]['pending_payout_value'] = str_replace(\" SBD\", \"\", $newItems[$count]['pending_payout_value']);\t\n$newItems[$count]['pending_payout_value'] = $newItems[$count]['pending_payout_value'] * $mult;\n$newItems[$count]['pending_payout_value'] = $newItems[$count]['pending_payout_value'].' '.$ext;\n\t\t\t}\n\t\t\t\t\n$count++;\n}\n\n$newItems['total'] = $total_price * $mult;\n$newItems['usd'] = $this->getSBD();\n\n$this->CVA = $varray;\n\n\n\n\nreturn $newItems;\n }", "function get_recipients($address_list, $num_recipients = 1)\n{\n\t$recipient = array();\n\n\t$count = 0;\n\tforeach ($address_list as $field => $adr_ary)\n\t{\n\t\tforeach ($adr_ary as $id => $type)\n\t\t{\n\t\t\tif ($count >= $num_recipients)\n\t\t\t{\n\t\t\t\tbreak 2;\n\t\t\t}\n\t\t\t$recipient[$field][$id] = $type;\n\t\t\t$count++;\n\t\t}\n\t}\n\n\treturn $recipient;\n}", "function create_push_message($product_id = '', $retailer_id = '', $store_type_id = '', $store_id = '', $product_name = '', $retailer_name = '', $store_name = '', $store_type_name = '', $special_count = 0, $special_price = 0, $special_name = '', $success_count = 0, $store_array = array(), $product_array = array(), $store_detail_array = array()) {\n $multiple_insert = [];\n $CI = &get_instance();\n $CI -> load -> model('admin/specialproductmodel');\n\n //Create a general message\n $message = $special_name . ', ';\n if ($success_count > 1) { //if the product count is more than one\n $product_id = '';\n $retailer_id = '';\n $store_type_id = '';\n $store_id = '';\n $message .= $success_count . ' products. From ' . $retailer_name;\n }\n else { //if only one product is addded\n $message .= $product_name . ' from: ' . $retailer_name . ', ' . $store_name . ', ';\n if ($special_count > 1) {\n $message .= $special_price . '(' . $special_count . ')';\n }\n else {\n $message .= $special_price . '.';\n }\n }\n $message .= ' Don\\'t miss it!';\n\n\n $user_ids = $CI -> specialproductmodel -> get_device_user_ids(); //Get the registered device IDs now available in DB\n $users_have_store = [];\n $user_have_price_alert = [];\n $price_change_array = [];\n $price_change_count = [];\n $retailer_special_message = [];\n $retailer_count_arr = [];\n $user_add = [];\n $comp_available_stores = [];\n $product_names = []; // Array to store product names\n $productNameMessage = \"\";\n $store_names = []; // Array to store name of the stores\n $storeNameMessage = \"\";\n\n if (!empty($user_ids)) {//If users available to send the notifications\n foreach ($user_ids as $user_id) {\n \n $comp_available_stores = [];\n if ($user_id['PrefLatitude'] && $user_id['PrefLongitude'] && $user_id['PrefDistance']) {\n $store_det = $CI -> specialproductmodel -> get_device_user_stores($user_id['PrefLatitude'], $user_id['PrefLongitude'], $user_id['PrefDistance'], $store_array, $user_id['state']);\n $store_name = isset($store_det[0]['StoreName']) ? $store_det[0]['StoreName'] : '';\n $store_get_id = isset($store_det[0]['StoreId']) ? $store_det[0]['StoreId'] : '';\n $special_notifications = $CI -> specialproductmodel -> get_special_enabled_user_store();\n $special_user_list = [];\n if ($special_notifications) {\n foreach ($special_notifications as $special_users) {\n $special_user_list[$special_users['UserId']] = array(\n 'StoreId' => $special_users['StoreId'],\n 'Specials' => $special_users['Specials'],\n 'PreferredStoreOnly' => $special_users['PreferredStoreOnly']\n );\n }\n }\n if (!empty($store_det)) {\n foreach ($store_det as $store_de) {\n if (in_array($store_de['Id'], $store_array)) {\n $comp_available_stores[] = $store_de['Id'];\n }\n }\n }\n\n if ($store_name && $store_get_id) {\n if (!in_array($user_id['UserId'], $users_have_store)) {\n //Adding the user devices, in which they have the stores added in DB\n\n if (!empty($special_user_list)) {\n if (isset($special_user_list[$user_id['UserId']])) {\n if ($special_user_list[$user_id['UserId']]['StoreId'] == $store_get_id && ($special_user_list[$user_id['UserId']]['Specials'] == 1 || $special_user_list[$user_id['UserId']]['PreferredStoreOnly'] == 1)) {\n $users_have_store[$user_id['UserId']] = array(\n 'UserId' => $user_id['UserId'],\n 'StoreName' => $store_name,\n 'StoreId' => $store_get_id\n );\n if (!in_array($user_id['UserId'], $user_add)) {\n $user_add[] = $user_id['UserId'];\n }\n }\n else {\n \n }\n }\n }\n else {\n if (!in_array($user_id['UserId'], $user_add)) {\n $user_add[] = $user_id['UserId'];\n }\n $users_have_store[$user_id['UserId']] = array(\n 'UserId' => $user_id['UserId'],\n 'StoreName' => $store_name,\n 'StoreId' => $store_get_id\n );\n }\n }\n }\n }\n if (!isset($users_have_store[$user_id['UserId']])) {\n if (!empty($comp_available_stores)) {\n $user_notification_settings = $CI -> specialproductmodel -> get_user_notification_settings($user_id['UserId']);\n $user_preferred_brands = $CI -> specialproductmodel -> get_user_preferred_brands($user_id['UserId']);\n if ($user_notification_settings) {\n if ($user_notification_settings['Specials'] == 1) {\n if ($user_notification_settings['PreferredStoreOnly'] == 1) {\n if (in_array($user_preferred_brands['StoreId'], $comp_available_stores)) {\n $users_have_store[$user_id['UserId']] = array(\n 'UserId' => $user_id['UserId'],\n 'StoreName' => '',\n 'StoreId' => $user_preferred_brands['StoreId']\n );\n }\n }\n else {\n $users_have_store[$user_id['UserId']] = array(\n 'UserId' => $user_id['UserId'],\n 'StoreName' => '',\n 'StoreId' => $comp_available_stores[0]\n );\n }\n }\n }\n }\n }\n }\n if (!empty($users_have_store)) { //if there are users with stores, then send push notification to them\n $notification_array = array(\n 'title' => 'Hurry! Specials Added',\n 'message' => $message,\n 'product_id' => $product_id,\n 'retailer_id' => $retailer_id,\n 'store_type_id' => $store_type_id,\n 'store_id' => $store_id,\n 'is_special' => '1',\n 'is_location_message' => '0',\n 'is_location_near_message' => '0'\n );\n if (!empty($product_array)) {\n //Checking for price alert enabled\n //If for a single product for single user, then will send the message with all the product details\n //If user have multiple alerts, then a general message will send\n\n foreach ($product_array as $index => $product) {\n foreach ($users_have_store as $user_get) {\n $multiple_single_insert = [];\n $is_alert_available = $CI -> specialproductmodel -> check_price_alert($product['id'], $user_get['UserId']);\n $is_alert_available = 0 ; // Temporary\n if ($is_alert_available) { \n if (!array_key_exists($user_get['UserId'], $price_change_array)) {\n # set product names according to users\n $product_names[$user_get['UserId']][] = $product['name']; \n \n $price_change_count[$user_get['UserId']] = 1;\n $price_change_array[$user_get['UserId']] = array(\n 'title' => 'Price Change Alert',\n 'message' => $product['name'] . ' from: ' . $store_detail_array[$index]['retailerName'] . ', ' . $store_detail_array[$index]['name'],\n 'product_id' => $product['id'],\n 'retailer_id' => $store_detail_array[$index]['retailer'],\n 'store_type_id' => $store_detail_array[$index]['storeType'],\n 'store_id' => $store_detail_array[$index]['id'],\n 'is_special' => '0',\n 'is_location_message' => '0',\n 'is_location_near_message' => '0'\n );\n }\n else {\n # set product names according to users\n $product_names[$user_get['UserId']][] = $product['name']; \n \n $price_change_count[$user_get['UserId']] += 1;\n $price_change_array[$user_get['UserId']] = array(\n 'title' => 'Price Change Alert',\n 'message' => $price_change_count[$user_get['UserId']] . ' products from: ' . $store_detail_array[$index]['retailerName'] . ', ' . $store_detail_array[$index]['name'],\n 'product_id' => '',\n 'retailer_id' => $store_detail_array[$index]['retailer'],\n 'store_type_id' => '',\n 'store_id' => '',\n 'is_special' => '0',\n 'is_location_message' => '0',\n 'is_location_near_message' => '0'\n );\n }\n// $notification_array1 = array(\n// 'title' => 'Price Change Alert',\n// 'message' => $product['name'] . ' from: ' . $store_detail_array[$index]['retailerName'] . ', ' . $store_detail_array[$index]['name'],\n// 'product_id' => $product['id'],\n// 'retailer_id' => $store_detail_array[$index]['retailer'],\n// 'store_type_id' => $store_detail_array[$index]['storeType'],\n// 'store_id' => $store_detail_array[$index]['id'],\n// 'is_special' => '1'\n// );\n// $multiple_single_insert[] = array(\n// 'Title' => $notification_array1['title'],\n// 'Message' => $notification_array1['message'],\n// 'UserId' => $user_get['UserId'],\n// 'CreatedOn' => date('Y-m-d H:i:s')\n// );\n// send_push_notification($notification_array1, array($user_get['UserId']), $multiple_single_insert);\n }\n else {\n \n if (!array_key_exists($store_detail_array[$index]['id'] . ':' . $user_get['UserId'], $retailer_special_message)) {\n if (!isset($retailer_count_arr[$user_get['UserId']])) {\n $retailer_count_arr[$user_get['UserId']] = 1;\n # Get stores names\n $store_names[$user_get['UserId']][]=$store_detail_array[$index]['name'];\n }\n else {\n $retailer_count_arr[$user_get['UserId']] += 1;\n \n # Get stores names\n $store_names[$user_get['UserId']][]=$store_detail_array[$index]['name'];\n }\n $retailer_special_message[$store_detail_array[$index]['id'] . ':' . $user_get['UserId']] = array(\n// 'title' => 'Special Added',\n 'title' => $store_detail_array[$index]['retailerName'].' - '.$special_name,\n 'message' => 'Specials added from: ' . $store_detail_array[$index]['retailerName'] . ', ' . $store_detail_array[$index]['name'],\n 'product_id' => $product['id'],\n 'retailer_id' => $store_detail_array[$index]['retailer'],\n 'store_type_id' => $store_detail_array[$index]['storeType'],\n 'store_id' => $store_detail_array[$index]['id'],\n 'is_special' => '0',\n 'is_location_message' => '0',\n 'is_location_near_message' => '0'\n );\n }\n \n \n \n }\n }\n }\n \n \n \n \n $retailer_count_arr['237'] = 5;\n $retailer_final_array = [];\n if (!empty($retailer_special_message) && !empty($retailer_count_arr)) {\n foreach ($retailer_special_message as $store_user_id => $val) {\n \n // Send notification from here\n $store_user_arr = explode(':', $store_user_id);\n if (isset($retailer_count_arr[$store_user_arr[1]])) {\n if ($retailer_count_arr[$store_user_arr[1]] > 1) {\n $retailer_final_array[$store_user_arr[1]] = array(\n// 'title' => 'Special Added',\n 'title' => $store_detail_array[$index]['retailerName'].' - '.$special_name,\n 'message' => 'Specials added: ' . $retailer_count_arr[$store_user_arr[1]] . ' Stores from ' . $store_detail_array[$index]['retailerName'],\n 'product_id' => '0',\n 'retailer_id' => $val['retailer_id'],\n 'store_type_id' => '0',\n 'store_id' => '0',\n 'is_special' => '0',\n 'is_location_message' => '0',\n 'is_location_near_message' => '0'\n );\n }\n }\n \n \n \n \n // Send not\n }\n }\n \n \n \n //checking the price alert array and send the notifications\n if (!empty($price_change_array)) {\n foreach ($price_change_array as $price_user_id => $price_array) {\n \n //Get product Names\n if(isset($product_names[$price_user_id])){\n $productNameMessage = implode(\",\" ,$product_names[$price_user_id]);\n }\n \n $finalMessage = \"\";\n $msg = explode(\"products from:\",$price_array['message']);\n $finalMessage = $productNameMessage.\" products from: \".$msg[1];\n \n /* \n $multiple_single_insert[] = array(\n 'Title' => $price_array['title'],\n 'Message' => $price_array['message'],\n 'UserId' => $price_user_id,\n 'CreatedOn' => date('Y-m-d H:i:s')\n ); \n */\n \n \n $multiple_single_insert[] = array(\n 'Title' => $price_array['title'],\n 'Message' => $finalMessage,\n 'UserId' => $price_user_id,\n 'CreatedOn' => date('Y-m-d H:i:s')\n );\n \n \n \n //send_push_notification($price_array, array($price_user_id), $multiple_single_insert);\n }\n }\n if (!empty($retailer_final_array)) {\n foreach ($retailer_final_array as $special_user_id => $special_array) {\n \n /*\n echo \"<pre>\";\n //echo \"retailer_final_array\";\n //print_r($retailer_final_array);\n echo \"special_array\";\n print_r($special_array);\n echo \"store_names[$special_user_id]\";\n print_r($store_names[$special_user_id]);\n */\n \n \n \n //Get Stores Names\n if(isset($store_names[$special_user_id])){\n //$storeNameMessage = implode(\",\" ,$store_names[$special_user_id]);\n $userStores = $store_names[$special_user_id];\n \n foreach($userStores as $userStore)\n {\n //echo \"<br>\".$userStore;\n }\n \n \n }\n \n $finalStoreMessage = \"\";\n $storeMsg = explode(\"Stores from\",$special_array['message']);\n $finalStoreMessage = 'Specials added: '.$storeNameMessage.\" Stores from \".$storeMsg[1]; \n \n $multiple_special_insert[] = array(\n 'Title' => $special_array['title'],\n 'Message' => $finalStoreMessage,\n 'UserId' => $special_user_id,\n 'CreatedOn' => date('Y-m-d H:i:s')\n );\n /*\n $multiple_special_insert[] = array(\n 'Title' => $special_array['title'],\n 'Message' => $special_array['message'],\n 'UserId' => $special_user_id,\n 'CreatedOn' => date('Y-m-d H:i:s')\n ); \n */\n \n echo \"<pre>\";\n echo \"retailer_final_array\";\n print_r($retailer_final_array);\n echo \"special_array\";\n print_r($special_array);\n echo \"multiple_special_insert\";\n print_r($multiple_special_insert);\n exit;\n \n send_push_notification($special_array, array($special_user_id), $multiple_special_insert);\n }\n }\n }\n foreach ($users_have_store as $us_st) {\n $multiple_insert[] = array(\n 'Title' => $notification_array['title'],\n 'Message' => $notification_array['message'],\n 'UserId' => $us_st['UserId'],\n 'CreatedOn' => date('Y-m-d H:i:s')\n );\n }\n send_push_notification($notification_array, $user_add, $multiple_insert);\n }\n }\n}", "public static function data()\n {\n $model = new \\app\\modules\\systems\\models\\Email;\n\n $data = $model->getList();\n $emailData = [];\n\n foreach ($data as $key => $value) {\n $emailAddress = strtolower(trim($value['emailaddress']));\n $emailData[$emailAddress] = $value;\n// if($value['is_encrypt']){\n// $emailData[$emailAddress]['tls'] = true;\n// }else{\n// $emailData[$emailAddress]['tls'] = false;\n// }\n//\t\t\tif($value['ssl'] == 1)\n//\t\t\t{\n//\t\t\t\t$emailData[$emailAddress]['ssl'] = true;\n//\t\t\t}\n//\t\t\telse\n//\t\t\t{\n//\t\t\t\t$emailData[$emailAddress]['ssl'] = false;\n//\t\t\t}\n }\n return $emailData;\n /*\t\treturn [\n '[email protected]' => [\n 'imap_server' => 'imap.163.com',\n 'smtp_server' => 'smtp.163.com',\n 'imap_protocol' => 'imap',\n 'smtp_protocol' => 'smtp',\n 'imap_port' => '993',\n 'smtp_port' => '25',\n 'ssl' => true,\n 'emailaddress' => '[email protected]',\n 'accesskey' => 'comeon666',\n ],\n '[email protected]' => [\n 'imap_server' => 'imap.163.com',\n 'smtp_server' => 'smtp.163.com',\n 'imap_protocol' => 'imap',\n 'smtp_protocol' => 'smtp',\n 'imap_port' => '993',\n 'smtp_port' => '25',\n 'ssl' => true,\n 'emailaddress' => '[email protected]',\n 'accesskey' => 'comeon888',\n ],\n '[email protected]' => [\n 'imap_server' => 'imap.163.com',\n 'smtp_server' => 'smtp.163.com',\n 'imap_protocol' => 'imap',\n 'smtp_protocol' => 'smtp',\n 'imap_port' => '993',\n 'smtp_port' => '25',\n 'ssl' => true,\n 'emailaddress' => '[email protected]',\n 'accesskey' => 'comeon777',\n ],\n ];\t\t\t*/\n }", "public function getMutualMessages()\n {\n $limit = $this->input->get('limit');\n $to = $this->input->get('sender_id');\n $from = $this->input->get('reciever_id');\n\n ($limit)\n ? $limit\n : $limit = 10;\n\n $offset = 0;\n $message = '';\n\n if ($this->input->get('offset')) {\n $offset = $this->input->get('offset');\n }\n $response = $this->chat_model->getMutualMessages($from, $to, $limit, $offset);\n\n if ($response) {\n header('Content-Type: application/json');\n echo json_encode($response);\n } else {\n header('Content-Type: application/json');\n $message = _l('chat_no_more_messages_in_database');\n echo json_encode($message);\n }\n }", "public function CounterMail(){\n\n $CantidadMails = ($this->ConfigModelo->select('rowCountWhere', 'Mensajes', 'estado', '0', 'Id', 'Id'));\n\n return $CantidadMails;\n\n }", "function fetch_contact(){ \n\n $fetch_data = $this->crud_model->make_datatables_contact(); \n $data = array(); \n foreach($fetch_data as $row) \n { \n\n if ($row->fichier != '') {\n $etat = '<a href=\"'.base_url().'upload/contact/'.$row->fichier.'\" class=\"badge badge-white\"><i class=\"fa fa-file\"></i></a>';\n }\n else{\n $etat = '';\n }\n\n $sub_array = array();\n\n $sub_array[] = '\n <input type=\"checkbox\" class=\"delete_checkbox\" value=\"'.$row->email.'\" />\n '; \n \n $sub_array[] = nl2br(substr($row->nom, 0,20)).'...'; \n $sub_array[] = nl2br(substr($row->sujet, 0,20)).'...'; \n $sub_array[] = $row->email; \n $sub_array[] = nl2br(substr($row->message, 0,50)).'...';\n $sub_array[] = substr(date(DATE_RFC822, strtotime($row->created_at)), 0, 23);\n\n $sub_array[] = $etat; \n\n $sub_array[] = '<button type=\"button\" name=\"delete\" idcontact=\"'.$row->id.'\" class=\"btn btn-dark btn-circle btn-sm update\"><i class=\"fa fa-comment-o\"></i></button>'; \n\n $sub_array[] = '<button type=\"button\" name=\"delete\" idcontact=\"'.$row->id.'\" class=\"btn btn-danger btn-circle btn-sm delete\"><i class=\"fa fa-trash\"></i></button>'; \n $data[] = $sub_array; \n } \n $output = array( \n \"draw\" => intval($_POST[\"draw\"]), \n \"recordsTotal\" => $this->crud_model->get_all_data_contact(), \n \"recordsFiltered\" => $this->crud_model->get_filtered_data_contact(), \n \"data\" => $data \n ); \n echo json_encode($output); \n }", "function smsSending($mobile, $sign, $args = array(), $templateId = 'SMS_585014') {\n $smssettings = unserialize(variable_get('smssettings'));\n $c = new TopClient;\n $c->format = 'json';\n $c->appkey = $smssettings['appkey'];//$appkey;\n $c->secretKey = $smssettings['secret'];//$secret;\n $req = new AlibabaAliqinFcSmsNumSendRequest;\n $req->setExtend(\"\");\n $req->setSmsType(\"normal\");\n $req->setSmsFreeSignName($sign);\n $param = json_encode($args);\n $req->setSmsParam($param);\n $req->setRecNum($mobile);\n $req->setSmsTemplateCode($templateId);//\n $resp = $c->execute($req);\n return $resp;\n}", "public function sentCount();", "public function batchEmail($sender)\n\t{\n\t\t$total = 0;\n\t\t$success = 0;\n\t\t$mailer = Yii::app()->email;\n\n\t\tforeach($this->emailList as $record)\n\t\t{\n\t\t\tif (!empty($record->emailAddress) && $mailer->send(\n\t\t\t\t$record->emailAddress,\n\t\t\t\t$this->emailSubject, \n\t\t\t\t$this->emailContent, \n\t\t\t\t$sender,\n\t\t\t\t$this->attachments\n\t\t\t))\n\t\t\t\t$success++;\n\t\t\telse if (!empty($record->alternateEmail) && $mailer->send(\n\t\t\t\t$record->alternateEmail,\n\t\t\t\t$this->emailSubject, \n\t\t\t\t$this->emailContent, \n\t\t\t\t$sender,\n\t\t\t\t$this->attachments\n\t\t\t))\n\t\t\t\t$success++;\n\t\t\t$total++;\n\t\t}\n\t\treturn array (\n\t\t\t'count' => $success,\n\t\t\t'total' => $total\n\t\t);\n\t}", "function createMsg($restaurant) {\r\n \r\n $total_sum = 0;\r\n \r\n $msg = $restaurant[\"name_he\"] . \"\r\n\";\r\n $msg .= $restaurant[\"whatsapp_group_name\"] . \"\r\n\";\r\n $msg .= $restaurant[\"whatsapp_group_creator\"] . \"\r\n\r\n\";\r\n \r\n $msg .= \"רשימת הזמנות היום\" . \"\r\n\r\n\";\r\n \r\n foreach($restaurant[\"orders\"] as $order) {\r\n $total_sum = $total_sum + $order[\"sum_order\"];\r\n \r\n $dateArr = explode('-', $order[\"date\"]);\r\n $day = $dateArr[0];\r\n $month = $dateArr[1];\r\n $year = $dateArr[2];\r\n $msg .= \"תאריך \" . $year . \"-\" . $month . \"-\" . $day . \"*\r\n\";\r\n $msg .= \"זמן \" . $order[\"time\"] . \"\r\n\";\r\n $msg .= \"מספר הזמנה \" . $order[\"id\"] . \"\r\n\";\r\n $msg .= \"סכום ההזמנה \" . $order[\"sum_order\"] . \"\r\n\r\n\";\r\n }\r\n $msg .= \"\r\n\";\r\n $msg .= \"-----------------\" . \"\r\n\";\r\n\r\n $msg .= \"סה״כ הזמנות \" . count($restaurant[\"orders\"]) . \"\r\n\";\r\n $msg .= \"סכום סה״כ הזמנות \" .$total_sum . \"\r\n\r\n\";\r\n \r\n $msg .= \"יתרה \" . $restaurant[\"balance\"];\r\n\r\n\r\n return $msg;\r\n}", "public function get_notification_list_for_order_post()\n {\n $response = new StdClass();\n $result = array();\n $staff_mobile_no=$this->input->post('staff_mobile_no');\n $get_notification_data = $this->Supervisor->get_notification_data($staff_mobile_no);\n if(!empty($get_notification_data))\n {\n foreach ($get_notification_data as $row)\n {\n $data['order_id'] = $row['order_id'];\n $data['customer_mobile_no'] = $row['customer_mobile_no'];\n $data['date_time'] = $row['date_time'];\n $data['title'] = $row['title'];\n $data['message'] = $row['message'];\n $data['status'] ='1';\n\n array_push($result,$data);\n\n } \n \n $response->data = $result;\n }\n else\n {\n $data['message'] = 'failed';\n $data['status'] ='0';\n array_push($result , $data);\n }\n $response->data = $result;\n echo json_output($response);\n }", "public function validate_contact(){\n\t\t$er_flag = true;\t\t\n\t\tfor($i = 0; $i < $this->request->data['Client']['contact_count']; $i++){\n\t\t\tif($this->request->data['Client']['first_name_'.$i] == ''){\n\t\t\t\t$error[$i]['fname'] = 'Please enter the first name';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t\tif($this->request->data['Client']['mobile_'.$i] == ''){\n\t\t\t\t$error[$i]['mobile'] = 'Please enter the mobile';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t\t$mobile = $this->request->data['Client']['mobile_'.$i];\n\t\t\tif(!is_numeric($mobile)){\n\t\t\t\t$error[$i]['mobile'] = 'Please enter the numeric only';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t\tif(strlen($mobile) < 10){\n\t\t\t\t$error[$i]['mobile'] = 'Mobile no. must be min. 10 digits';\n\t\t\t\t$er_flag = false;\n\t\t\t}\t\t\t\t\t\t\n\t\t\tif($this->request->data['Client']['email_'.$i] == ''){\n\t\t\t\t$error[$i]['email'] = 'Please enter the email address';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t\t// validate email\n\t\t\tif($this->Functions->email_validation($this->request->data['Client']['email_'.$i])){\n\t\t\t\t$error[$i]['email'] = 'Please enter valid email address';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t\tif($this->request->data['Client']['title_'.$i] == ''){\n\t\t\t\t$error[$i]['title'] = 'Please select the title';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t\tif($this->request->data['Client']['designation_'.$i] == ''){\n\t\t\t\t$error[$i]['designation'] = 'Please select the designation';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t\tif($this->request->data['Client']['branch_'.$i] == ''){\n\t\t\t\t$error[$i]['branch'] = 'Please select the branch';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t}\n\t\t$this->set('errorData', $error);\n\t\treturn $er_flag;\n\t}", "private function deliverySms($type,$state,$messageID,$from,$to,$message,$count){\n $datum = Date(\"Y-m-d\");\n $count = $count + 1;\n\n if (isset($this->_stateIDs[$state])){\n $stateId = $this->_stateIDs[$state]; \n } else {\n $stateId = 0;\n }\n \n /*\n * Uncomment if is needed to disable sending at specific time\n */\n // $sleep_time = date('H');\n // $sleep = array('21', '22','23','00','01','02','03','04','05','06');\n\n // if not between 21:00 - 07:00\n // if(!in_array($sleep_time, $sleep)){\n\n if ($type !== \"bulk\") { \n $to = $this->cleanMob($to, $state);\n if ($to == false) { \n return \"wrong number\";\n }\n }\n //ucitavanje liste odjava \n if ($type == \"reorder\") { \n $suppression = $this->getSuppressionList($state);\n $supArr = array();\n\n foreach ($suppression as $sNumber){\n array_push($supArr, $sNumber['number']);\n }\n\n if (in_array($to, $supArr) == true) {\n return \"number unsubscribed\";\n }\n } \n\n // konacno filtriranje samo brojeva \n $to = preg_replace('/[^0-9]/', '', $to);\n\n $firstTwo = substr($to, 0, 2);\n\n if ($state == \"XK\" && $firstTwo == \"49\") {\n $responsePhone = \"+386\".$to; \n $to = \"00386\".$to;\n } else {\n $responsePhone = \"+\".$this->_areaCodes[$state].$to; \n $to = \"00\".$this->_areaCodes[$state].$to;\n }\n\n \n $message = strip_tags($message);\n\n $msg = $this->cleanUTF($message, $state);\n $ch = curl_init('http://bulk.mobile-gw.com:9000/?');\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"username=*******&password=*********&allow_adaption=1&messageid={$messageID}&status_report=3&origin={$from}&call-number={$to}&text=\".urlencode($msg));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n curl_setopt($ch, CURLOPT_HEADER, 1);\n $send_response = curl_exec ($ch);\n curl_close ($ch);\n\n $getRow = explode(\"\\n\", $send_response);\n //******** Hvatanje SMSID broja\n // $getId = explode(\":\", $getRow[2]);\n // $smsId = trim($getId[1]);\n\n\n $getId = explode(\":\", $getRow[2]);\n $smsIdRaw = trim($getId[1]);\n\n $countSeparator = substr_count($smsIdRaw,\";\");\n $messageNumber = $countSeparator + 1;\n $smsIdExploaded = explode(\";\", $smsIdRaw);\n\n $smsId = $smsIdExploaded[0];\n //******** Hvatanje Statusa slanja\n $getSecond = explode(\":\", $getRow[6]); \n $getCode = explode(\",\", $getSecond[1]);\n $statusCode = trim($getCode[0]);\n\n $statusNum = 0;\n if ($statusCode == \"00\"){\n $statusNum = 1;\n } else {\n $statusNum = 3;\n }\n\n $this->insertMessage($smsId,$from,$to,$messageID,$msg,$statusNum,$messageNumber,$stateId); \n if($type == \"bulk\"){\n //echo json_encode(array(\"count\"=>$count, \"number\"=>$to, \"response\"=>$send_response));\n $writeFile ='{\"MessageId\":\"'.$messageID.'\",\"SenderId\":\"'.$from.'\",\"Recipient\":\"'.$to.'\",\"Response\":\"'.$send_response.'\",\"Message\":\"'.$msg.'\"},\\n';\n $file = fopen($this->_logRoot.\"reports/bulk/\".$messageID.\".txt\", \"a\");\n file_put_contents($this->_logRoot.\"reports/bulk/\".$messageID.\".txt\", $writeFile, FILE_APPEND);\n fclose($file);\n } else if ($type == \"reorder\"){\n //echo json_encode(array(\"count\"=>$count, \"number\"=>$to, \"response\"=>$send_response));\n $writeFile ='{\"MessageId\":\"'.$messageID.'\",\"SenderId\":\"'.$from.'\",\"Recipient\":\"'.$to.'\",\"Response\":\"'.$send_response.'\",\"Message\":\"'.$msg.'\"},\\n';\n $file = fopen($this->_logRoot.\"reports/reorder/\".$messageID.\".txt\", \"a\");\n file_put_contents($this->_logRoot.\"reports/reorder/\".$messageID.\".txt\", $writeFile, FILE_APPEND);\n fclose($file);\n } else {\n $writeFile ='{\"MessageId\":\"'.$messageID.'\",\"SenderId\":\"'.$from.'\",\"Recipient\":\"'.$to.'\",\"Response\":\"'.$send_response.'\",\"Message\":\"'.$msg.'\",\"Quantity\":\"'.$messageNumber.'\"},\\n';\n $existCount2 = 0;\n if (file_exists($this->_logRoot.\"reports/orders/\".$datum.\".txt\")){\n $existCount2 = 1;\n }\n\n $file = fopen($this->_logRoot.\"reports/orders/\".$datum.\".txt\", \"a\");\n file_put_contents($this->_logRoot.\"reports/orders/\".$datum.\".txt\", $writeFile, FILE_APPEND);\n fclose($file);\n\n if ($existCount2 == 0){\n chmod($this->_logRoot.\"reports/orders/\".$datum.\".txt\", 0777);\n }\n }\n $responseJson = '{\"status\":\"'.$statusNum.'\",\"msisdn\":\"'.$responsePhone.'\"}';\n return $responseJson;\n // }else{\n // return 'sleep time';\n // }\n }", "public function pushContacts()\n {\n if(isset($_POST['send_mail']))\n {\n $this->_genCSV();\n $csvFile = Mage::getBaseDir() . '/var/export/contacts.csv';\n $baseUrl = 'https://api.dotmailer.com';\n $url = $baseUrl . \"/v2/address-books/\" . $this->dmAddressBook . \"/contacts/import\";\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt(\n $ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: multipart/form-data')\n );\n curl_setopt($ch, CURLAUTH_BASIC, CURLAUTH_DIGEST);\n curl_setopt(\n $ch, CURLOPT_USERPWD,\n $this->apiUsername . ':' . $this->apiPassword\n );\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false);\n $args['file'] = curl_file_create(\n $csvFile, 'text/csv'\n );\n curl_setopt($ch, CURLOPT_POSTFIELDS, $args);\n $response = json_decode(curl_exec($ch));\n var_dump($response);\n } else {\n echo $this->_html();\n }\n }", "public function update_contact($data)\n {\n $add = array();\n foreach (array('nick', 'firstname', 'lastname', 'thirdname', 'title', 'company', 'comp_dep', 'comp_role'\n ,'comp_address', 'comp_address2', 'comp_street', 'comp_zip', 'comp_location', 'comp_region'\n ,'comp_country', 'comp_cellular', 'comp_www', 'comp_fax', 'address', 'address2', 'street', 'zip'\n ,'location', 'region', 'country', 'email1', 'email2', 'bday_cal_evt_id', 'tel_private', 'tel_business'\n ,'cellular', 'fax', 'www', 'birthday', 'customer_number', 'comments') as $k) {\n if (isset($data[$k])) {\n $add[] = $k . '=\"' . $this->esc($data[$k]) . '\"';\n }\n }\n if (isset($data['group'])) {\n $this->query('DELETE FROM '.$this->Tbl['adb_adr_group'].' WHERE `aid`='.intval($data['aid']).' AND uid='.$this->uid);\n foreach ($data['group'] as $gid) {\n $this->query('INSERT '.$this->Tbl['adb_adr_group'].' SET `aid`='.intval($data['aid']).', `gid`='.intval($gid).', `uid`='.intval($this->uid));\n }\n }\n foreach (array_keys($this->get_freefield_types($this->uid)) as $type) {\n if (empty($data['free'][$type])) {\n $this->query('DELETE FROM '.$this->Tbl['adb_freefield'].' WHERE `aid`='.intval($data['aid']).' AND type_id='.intval($type));\n } else {\n $this->query('REPLACE INTO '.$this->Tbl['adb_freefield'].' SET `aid`='.intval($data['aid']).', `type_id`='.intval($type).', `value`=\"'.$this->esc($data['free'][$type]).'\"');\n }\n }\n\n if (!empty($add)) {\n $where = 'aid='.intval($data['aid']).' AND owner='.intval($this->uid);\n if (isset($data['own_vcf'])) {\n list ($adrid) = $this->fetchrow($this->query('SELECT u.contactid FROM '.$this->Tbl['user'].' u,'.$this->Tbl['adb_address'].' a'\n .' WHERE u.uid='.intval($this->uid).' AND a.aid=u.contactid'));\n if (0 != $adrid) {\n $where = 'aid='.intval($adrid);\n }\n }\n $query = 'UPDATE '.$this->Tbl['adb_address'].' SET `uuid`=\"'.basics::uuid().'\"'.','.implode(',', $add).' WHERE '.$where;\n return $this->query($query);\n }\n return false;\n }", "public function getClientCountInfo()\n {\n $payload = JWTAuth::parseToken()->getPayload();\n $logged_userid = $payload['login_db_userid']; \n $c_account_key = $payload['c_acc_key'];\n $db_name = $payload['db_name'];\n $agency_id = $payload['agencyid'];\n $qry_profpic = DB::select(\"SELECT * FROM [$db_name].[dbo].[user_accounts] \n WHERE user_id = \".$logged_userid);\n $userid = $qry_profpic[0]->user_id;\n $cw_Puserid = $qry_profpic[0]->case_worker_parent_user_id;\n $cw_agency_id = $qry_profpic[0]->agency_id;\n \n $dashclientarr= [array('responsecount' => $userid,'msgcount' => $cw_agency_id,'opencasecount' => $cw_Puserid )];\n \n return $dashclientarr;\n }", "public function getData()\n {\n $this->validateData();\n $data = array(\n \"service\" => $this->getService(),\n \"partner\" => $this->getPartner(),\n \"_input_charset\" => $this->getInputCharset(),\n \"notify_url\" => $this->getNotifyUrl(),\n \"account_name\" => $this->getAccountName(),\n \"email\" => $this->getEmail(),\n \"detail_data\" => $this->getDetailData(),\n \"batch_no\" => $this->getBatchNo(),\n \"batch_num\" => $this->getBatchNum(),\n \"batch_fee\" => $this->getBatchFee(),\n \"pay_date\" => $this->getPayDate(),\n );\n $data = array_filter($data);\n $data['sign'] = $this->getParamsSignature($data);\n $data['sign_type'] = $this->getSignType();\n return $data;\n }", "function getCount ($data){\nreturn count($data);\n \n}", "static function getCountAllNewMessage_inbox()\r\n\t{\r\n\t\t//$arrAllStatus[] = funcs::getCountNewMessage_inbox(\"sms\");\r\n\t\t//$arrAllStatus[] = funcs::getCountNewMessage_inbox(\"email\");\r\n\t\t$arrAllStatus[] = 0;\r\n\t\t$arrAllStatus[] = 0;\r\n\t\t$arrAllStatus[] = funcs::getCountNewMessage_inbox();\r\n\t\t$arrAllStatus[] = 0;\r\n\t\t//$arrAllStatus[] = funcs::getCountNewSuggetion_inbox();\r\n\r\n\t\treturn $arrAllStatus;\r\n\t}", "function messages( $array ) {\n\t\t$this->messages_list = $array;\n\t\t}", "public function setValuesFromDataArray($dataArray) {\n self::$debugger->belch(\"48 setValuesFromDataArray() dataArray\", $dataArray, -1);\n self::$debugger->belchTrace('49 from setValuesFromDataArray() dataArray', $dataArray, -1);\n $this->commId = (isset($dataArray['commId']) ? $dataArray['commId'] \n : (isset($dataArray['communicationId']) ? $dataArray['communicationId'] : 0));\n $this->recipientId = (isset($dataArray['recipient']) ? $dataArray['recipient'] \n : (isset($dataArray['recipientId']) ? $dataArray['recipientId'] \n : (isset($dataArray['personId']) ? $dataArray['personId'] : 0)));\n $this->recipientName = (isset($dataArray['name']) ? $dataArray['name'] \n : (isset($dataArray['recipientName']) ? $dataArray['recipientName'] : 0));\n $this->dateSent = ((isset($dataArray['dateSent'])) ? $dataArray['dateSent'] : '');\n $this->sender = (isset($dataArray['sender']) ? $dataArray['sender'] : 0);\n $this->to = (isset($dataArray['emailTo']) ? $dataArray['emailTo'] \n : ((isset($dataArray['to'])) ? $dataArray['to'] : ''));\n if ($this->to =='') {\n $name = (isset($dataArray['name']) && $dataArray['name'] !='') ? $dataArray['name'] : '';\n $email = (isset($dataArray['email']) && $dataArray['email'] !='') ? $dataArray['email'] : '';\n $this->setToFieldFromNameAndEmail($name, $email);\n }\n $this->message =(isset($dataArray['contentText']) ? $dataArray['contentText'] : '');\n $this->inResponseTo = (isset($dataArray['inResponseTo']) ? $dataArray['inResponseTo'] : 0);\n // mrEmailWidgetId may have been pre-set by the caller, so do not override the current value. // WHAT? 7/15/10\n if (isset($dataArray['emailWidgetId']) && ($this->mrEmailWidgetId() == '')) $this->setMrEmailWidgetId($dataArray['emailWidgetId']); // added conjunctive clause 7/17/10\n // The following attributes may have been pre-set by beMediaReceived(), so do not override the current value. // WHAT? 7/15/10\n if (isset($dataArray['type'])) $this->commType = $dataArray['type'];\n else if (isset($dataArray['commType'])) $this->commType = $dataArray['commType'];\n if (isset($dataArray['emailFrom'])) $this->from = $dataArray['emailFrom'];\n else if (isset($dataArray['from'])) $this->from = $dataArray['from'];\n if (isset($dataArray['emailSubject'])) $this->subject = $dataArray['emailSubject'];\n if (isset($dataArray['bcc'])) $this->bcc = $dataArray['bcc'];\n self::$debugger->belch(\"50 setValuesFromDataArray() this\", $this, 0);\n // $this->referencedWorks is unaffected.\n }", "public function __construct( array $numbers ,$message)\n {\n\n $this->numbers = $numbers;\n $this->message = $message;\n\n }", "public static function nbContactsTotal() {\n $total = \\Phonebook\\Models\\CoreModel::findAll();\n $full_contacts = Count($total);\n return $full_contacts;\n echo $this->templates->render('home');\n }", "private function memberAddOrder($data){\n $fields = array(\n 'app_id' => $this->appId,\n 'data' => array(\n 'msg_type' => 'order_add',\n 'order_id' => $data['order_id']\n ),\n 'headings' => [\n 'en' => '你有新的訂單',\n 'zh-Hant' => '你有新的訂單'\n ],\n 'contents' => [\n 'en' => '你有新的訂單待處理',\n 'zh-Hant' => '你有新的訂單待處理'\n ],\n 'small_icon' => 'ic_stat_onesignal_default',\n 'ios_badgeType' => 'Increase',\n 'ios_badgeCount' => 1,\n 'filters' => array(\n array(\n 'field' => 'tag',\n 'key' => 'id',\n 'relation' => '=',\n 'value' => $data['store_id']\n )\n )\n );\n return $fields;\n }", "public function sendlaneSubscribe($data = array())\n {\n \n if(count($data) && $this->checkCache()){\n Log::info('Subscribing '.$data['email'].' to list '.$data['list_id']);\n $return = array();\n $return['result'] = 'error';\n $api_key = env('SENDLANE_API_KEY');\n $hash_key = env('SENDLANE_HASH_KEY');\n $api_url = env('SENDLANE_API_URL');\n $command = 'list-subscriber-add';\n $url = $api_url.$command;\n $post = array('api' => $api_key, 'hash' => $hash_key, 'list_id' => $data['list_id'], 'email' => $data['email'], 'first_name' => $data['first_name'], 'last_name' => $data['last_name']);\n $ch = curl_init();\n Log::info('cUrl initiated');\n curl_setopt($ch,CURLOPT_URL, $url);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n $result = curl_exec($ch);\n if (!curl_errno($ch)) {\n $info = curl_getinfo($ch);\n if($info['http_code'] == 200){\n Log::info( 'Took '. $info['total_time']. ' seconds to send a request to '. $info['url']. \"\\n\");\n $return['result'] = 'OK';\n $stuff = json_decode($result);\n $return['response'] = $stuff;\n return json_encode($return);\n }else{\n\n Log::error('Failed getting '.$info['url'].' : response code '.$info['http_code']);\n }\n }\n return $return; \n\n }\n }", "public function getAll() \r\n { \r\n $a['number'] = $this->number;\r\n $a['name'] = $this->name;\r\n $a['email'] = $this->email;\r\n $a['address'] = $this->address;\r\n $a['postalcode'] = $this->postalcode;\r\n $a['city'] = $this->city;\r\n $a['country'] = $this->country;\r\n $a['ean'] = $this->ean;\r\n $a['website'] = $this->website;\r\n $a['dgh'] = $this->dgh;\r\n $a['phone'] = $this->phone;\r\n return $a;\r\n }", "private function recipients()\n {\n if (request('type') === 'bulk') {\n return $recipients = count(Contact::active()->where('group_id', request('recipients'))->pluck('mobile'));\n } elseif (request('type') === 'single') {\n return $recipients = 1;\n }\n }", "public function GetProgress($primary_id,$data)\n\t{\n\n\t\t$result = $this->index($primary_id);\n\n\t\tif ($result->count() > 0) {\n\t\t\t$delete_phone = $this->deletWhere('contactinfo_id',$primary_id);\n\t\t}\n\n\t\t$save = [];\n\t\tforeach ($data['phone'] as $key => $value) {\n if($value != ''){\n $save = $this->model->create([\n \t'contactinfo_id'=>$primary_id,\n \t'phone'=>$value\n ]);\n }\n }\n return $save;\n\t}", "public function exportNewCustomer($data) {\n\t\t$err = 0;\n\t\t$this->load->language('extension/module/sendpulse');\n\t\tif(isset($data['newsletter']) && $data['newsletter'] = 1 && $this->config->get('sendpulse_auto_add') == 1 && $this->config->get('sendpulse_book_default') > 0){\t\t\n\t\t\t$emails = array();\n\t\t\t$emails[] = array(\n\t\t\t\t\t'email' => $data['email'],\n\t\t\t\t\t'variables' => array(\n\t\t\t\t\t\t'Phone' => $data['telephone'],\n\t\t\t\t\t\t//$this->language->get('entry_firstname') => $data['firstname'].' '.$data['lastname'],\n\t\t\t\t\t\t'name' => $data['firstname'].' '.$data['lastname'],\n\t\t\t\t\t\t$this->language->get('entry_fax') => $data['fax'],\n\t\t\t\t\t\t$this->language->get('entry_status') => 1\n\t\t\t\t\t)\n\t\t\t);\n\n\t\t\ttry {\n\t\t\t\t$api = new SendpulseApi( $this->config->get('sendpulse_id'), $this->config->get('sendpulse_secret'), TOKEN_STORAGE );\n\t\t\t\t$result = $api->addEmails( $this->config->get('sendpulse_book_default'), $emails );\n\t\t\t\t\n\t\t\t\tif (isset($result->is_error) && $result->is_error) {\n\t\t\t\t$msg = isset($result->message) ? $result->message : 'Something went wrong';\n\t\t\t\tthrow new Exception( $msg );\n\t\t\t\t}\n\t\t\t\t$err = 1;\n\t\t\t\t$this->db->query(\"UPDATE \" . DB_PREFIX . \"setting SET value = value+ 1 WHERE `key` = 'sendpulse_count'\");\n\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$err = 0;\n\t\t\t}\n\t\t}\n\n\t\treturn $err;\n\t}", "public function getRecipientsData(Request $request)\n {\n if ($request->has('client_group_ids')) {\n $client_group_ids = $request->client_group_ids;\n if (is_array($client_group_ids) && count($client_group_ids) > 0) {\n $count = Client::whereIn('groupid', $client_group_ids)->count();\n return response()->json(['status' => 'success', 'data' => $count]);\n } else {\n return response()->json(['status' => 'success', 'data' => 0]);\n }\n } elseif ($request->has('contact_list_ids')) {\n $contact_list_ids = $request->contact_list_ids;\n if (is_array($contact_list_ids) && count($contact_list_ids) > 0) {\n $count = ContactList::whereIn('pid', $contact_list_ids)->count();\n return response()->json(['status' => 'success', 'data' => $count]);\n } else {\n return response()->json(['status' => 'success', 'data' => 0]);\n }\n } else {\n return response()->json(['status' => 'success', 'data' => 0]);\n }\n }", "function RequestData () {\n\n\t\t//create GRequest object + post xml (googlecart.php line: 962)\n\t\trequire_once('library/googlerequest.php');\n\t\t$GRequest = new GoogleRequest($this->merchant_id, $this->merchant_key);\n\n\t\twhile($this->has_more_notifications == \"true\") {\n\t\t\t$this->poll_request_xml = $this->GetPollRequestXML();\n\t\t\t$this->poll_result = $GRequest->SendReq($this->server_url,\n\t\t\t\t$GRequest->GetAuthenticationHeaders(), $this->poll_request_xml);\n\n\t\t\t//Check response code\n\t\t\tif($this->poll_result[0] == \"200\") {\n\t\t\t\t$this->ExtractNotifications();\n\t\t\t}\n\t\t\telse return false;\n\n\t\t\tif($this->get_all_notifications == false) {\n\t\t\t\t$this->has_more_notifications == \"false\";\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function get_new_conversation_count($request)\n{\n global $redis_server;\n\n if(!validate_fields($request, array('user'))) {\n die(bad_request('missing field'));\n }\n\n $client = new Predis\\Client($redis_server);\n $count = $client->scard(\"user-{$request->data['user']}-new-conversations\");\n \n return json_encode(array('code' => '1', 'count' => $count, 'user' => $request->data['user'])); \n}", "public function retain_contact_list(){\n\t\t$contact_data = array();\t\t\n\t\tforeach($this->request->data['Client'] as $key => $data){ \n\t\t\t// for the form fields\n\t\t\tif($new_key = $this->get_key_val($key)){ \n\t\t\t\t$contact_data['Contact'][$new_key][] = $data;\n\t\t\t}\t\t\t\n\t\t}\n\t\t$this->request->data['Contact'] = '1';\n\t\t$this->set('contact_list', $contact_data);\n\t}", "function sendlistGet($arrayRestInputs){\n if((file_exists($arrayRestInputs['enginebasedir'] . '/lib/Send.php')) && (file_exists($arrayRestInputs['enginebasedir'] . '/lib/NodeToken.php')) ){\n require_once($arrayRestInputs['enginebasedir'] . '/lib/Send.php');\n require_once($arrayRestInputs['enginebasedir'] . '/lib/NodeToken.php');\n $objectToken = new NodeToken ();\n if($objectToken->retrieveToken($arrayRestInputs['token'])){\n $objectSend = new Send();\n $sendlistReturn = $objectSend->getSendList($objectToken->uid);\n if($sendlistReturn < 0){\n return '';\n }\n else{\n if(is_array($sendlistReturn)){\n $limit = count($sendlistReturn);\n for($i = 0; $i < $limit; $i++){\n $sendlistReturn[$i]['selfsenddate'] = date(DATE_ATOM, $sendlistReturn[$i]['selfsenddate']);\n $sendlistReturn[$i]['selfseen'] = date(DATE_ATOM, $sendlistReturn[$i]['selfseen']);\n $sendlistReturn[$i]['othersenddate'] = date(DATE_ATOM, $sendlistReturn[$i]['othersenddate']);\n $sendlistReturn[$i]['otherseen'] = date(DATE_ATOM, $sendlistReturn[$i]['otherseen']);\n }\n }\n return $sendlistReturn;\n }\n }\n else{\n return '';\n }\n }\n else{\n return '';\n }\n}", "private function _send_to_campaign_monitor($data, $settings)\n\t{\n\t\t// Campaign Monitor\n\t\trequire_once('libraries/csrest_subscribers.php');\n\n\t\t$api_key = $settings->api_key;\n\t\t$list_id = $settings->list_id;\n\t\t\n\t\t$campaign_monitor = new CS_REST_Subscribers($list_id, $api_key);\n\t\t\n\t\t// Setup array of custom field tags and values for Campaign Monitor\n\t\t// Needs to have the CM custom field tag as the index the field's value as the array's value\n\t\t\n\t\t$custom_field_values = array();\n\t\tforeach (unserialize($settings->custom_fields) as $custom_field_settings) \n\t\t{\n\t\t\tif ( ! empty($custom_field_settings['name']) \n\t\t\t\tAND ! empty($custom_field_settings['tag']))\n\t\t\t{\n\t\t\t\t// If this is a multiple option field we need to split things up\n\t\t\t\tif (isset($custom_field_settings['multiple']) \n\t\t\t\t\tAND $custom_field_settings['multiple'] == 'yes')\n\t\t\t\t{\n\t\t\t\t\tif ( ! is_array($data[$custom_field_settings['name']]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$data[$custom_field_settings['name']] = preg_split(\"/(?:,|\\n|\\r)/\", $data[$custom_field_settings['name']], -1, PREG_SPLIT_NO_EMPTY);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add a custom field value for each item\n\t\t\t\t\tforeach ($data[$custom_field_settings['name']] as $index => $value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$custom_field_values[] = array(\n\t\t\t\t\t\t\t'Key' => $custom_field_settings['tag'],\n\t\t\t\t\t\t\t'Value' => trim($data[$custom_field_settings['name']][$index])\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$custom_field_values[] = array(\n\t\t\t\t\t\t'Key' => $custom_field_settings['tag'],\n\t\t\t\t\t\t'Value' => $data[$custom_field_settings['name']]\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$result = $campaign_monitor->add(array(\n\t\t\t'EmailAddress' => $data[$settings->email_field],\n\t\t\t'Name' => $data[$settings->name_field],\n\t\t\t'CustomFields' => $custom_field_values,\n\t\t\t'Resubscribe' => true\n\t\t));\n\n\t\tif ( ! $result->was_successful())\n\t\t{\n\t\t\t$this->EE->load->library('logger');\n\t\t\t$message = (isset($result->response->Message)) ? $result->response->Message : $result->response['message'];\n\t\t\t$this->EE->logger->log_action(\"Subscriber Campaign Monitor API Error: \".$result->http_status_code.\": \".$message);\n\t\t}\n\t}", "function widraw_amount_request_mail($send_data)\n {\n $to_email_address = $send_data['sender_email'];\n $subject = $send_data['subject'];\n $message = 'Hi, '.ucfirst($send_data['sender_name']).' '.$send_data['message'];\n $data['msg'] = $message;\n $mess = $this->load->view('mailer/email_template', $data, true);\n $result_dfee = $this->common_model->sendEmails($to_email_address, $subject, $mess);\n if ($result_dfee) {\n return true;\n } else {\n return false;\n }\n }", "public function buildData()\n {\n $message = $this->getMessage();\n\n if ($this->data == []) {\n return [\n 'success' => false,\n 'message' => $message\n ];\n }\n\n return [\n 'success' => false,\n 'message' => $message,\n 'data' => (object) $this->data\n ];\n }", "public function getData()\n {\n if (empty($this->getFeeType())) {\n $this->setFeeType('CNY');\n }\n\n $this->validate(\n 'mch_id',\n 'api_key',\n 'body',\n 'out_trade_no',\n 'total_fee',\n 'notify_url',\n 'trade_type',\n 'spbill_create_ip',\n 'device_info',\n 'auth_code'\n );\n\n $data = array(\n 'appid' => $this->getAppId(),//*\n 'mch_id' => $this->getMchId(),\n 'sub_appid' => $this->getSubAppId(),\n 'sub_mch_id' => $this->getSubMchId(),\n 'device_info' => $this->getDeviceInfo(),//*\n 'body' => $this->getBody(),//*\n 'attach' => $this->getAttach(),\n 'out_trade_no' => $this->getOutTradeNo(),//*\n 'fee_type' => $this->getFeeType(),\n 'total_fee' => $this->getTotalFee(),//*\n 'spbill_create_ip' => $this->getSpbillCreateIp(),//*\n 'notify_url' => $this->getNotifyUrl(), //*\n 'trade_type' => $this->getTradeType(), //*\n 'limit_pay' => $this->getLimitPay(),\n 'promotion_tag' => $this->getPromotionTag(),\n 'nonce_str' => md5(uniqid()),//*\n 'auth_code' => $this->getAuthCode()\n );\n\n $data = array_filter($data);\n\n $data['sign'] = Helper::sign($data, $this->getApiKey());\n\n return $data;\n }", "public function userAskToBeNotified(){\n// $message = new Message();\n// $message->setHeure(\"19h50\");\n// $message->setVille(\"TO\");\n// $message->setStatue(\"Retart\");\n// $message->setPhoneNumber(\"+15143468023\");\n// $message->setMessage(\"Salut je fait un test\");\n// $messagemodel->sendSMS($message);\n $arryNotif [0]= $_POST[\"vol\"];\n $arryNotif[1] = $_POST[\"phone\"];\n $arryNotif[2] = $_POST[\"date\"];\n $arryNotif[3] = $_POST[\"status\"];\n $notifDAO = new NotifyDAO();\n $notifDAO->create($arryNotif);\n\n }", "function sendBulkUnicode($username, $encryp_password, $senderid, $messageUnicode, $mobileNos, $deptSecureKey) {\n $finalmessage = string_to_finalmessage(trim($messageUnicode));\n $key = hash('sha512', trim($username) . trim($senderid) . trim($finalmessage) . trim($deptSecureKey));\n $data = array(\n \"username\" => trim($username), \"password\" => trim($encryp_password),\n \"senderid\" => trim($senderid),\n \"content\" => trim($finalmessage),\n \"smsservicetype\" => \"unicodemsg\",\n \"bulkmobno\" => trim($mobileNos),\n \"key\" => trim($key)\n );\n post_to_url_unicode(\"https://msdgweb.mgov.gov.in/esms/sendsmsrequest\", $data); //calling post_to_url_unicode to send bulk unicode sms \n}", "public function build_data() {\n $this->total_collection = (int)count($this->feeds);\n $redis_total_set = (int)$this->redis->hget($this->key_name, 'total:set'); \n \n $key = $this->redis->hgetall($this->key_name);\n $hosted_feeds = $this->group_and_build(); \n\n if(!$key || $redis_total_set !== $this->total_collection) {\n //echo \"Processing: Insert Data into Redis\";\n //insert data into redis\n $this->redis->hset($this->key_name, 'total:set', $this->total_collection);\n $page = 0;\n foreach($hosted_feeds as $feed_group => $feed_list) {\n $page_number = ++$page;\n $spring_data = Array($feed_group => $feed_list);\n $this->redis->hset($this->key_name, \"set:$page_number\", json_encode($spring_data));\n $spring_data = Null;\n }\n } \n \n }", "public function sendPaymentNotification(){\n\n $sms_recipients=\"0712345648\";//empty string\n $username = Constants::$username;\n $apiKey = Constants::$apiKey;\n $from = Constants::$from;\n // dd($apiKey);\n\n $AT = new AfricasTalking($username, $apiKey);\n // // Get one of the services\n $recipients=\"\";\n $sms = $AT->sms();\n //user has a valid mobile number\n $phone = substr($sms_recipients,1);\n $recipients='+254'.$phone;//$data['phone'];//'+254712345678'\n // dd($recipients);\n\n // // Set the numbers you want to send to in international format\n \n // // Set your message\n $message = \"Testing SMS.\";\n\n // // Set your shortCode or senderId\n \n // Get one of the services\n try {\n // Thats it, hit send and we'll take care of the rest\n $result = $sms->send([\n 'to' => $recipients,\n 'message' => $message,\n 'from' => $from\n ]);\n\n print_r($result);\n \n } catch (Exception $e) {\n //echo \"Error: \".$e->getMessage();\n $result=$e->getMessage();\n print_r($result);\n }\n\n \n }", "public function getData() {\n\t\treturn [\n\t\t\t16 => [\"type\" => 0, \"value\" => $this->size]\n\t\t];\n\t}", "public function store(Request $request)\n {\n if (!Auth::check()) return Redirect::route('home');\n $mobiles =$request->number;\n foreach ($mobiles as $value) {\n $send = new send;\n $send->schedule_id = $request->campain;\n $send->user_id = Auth::id();\n $send->mobile = $value;\n $send->save();\n }\n $contact=user::find( Auth::id());\n return view('campain.sendSms',compact('contact'));\n }", "function send($accessToken, $jsonData){\n // https://graph.facebook.com/v2.6/me/messages?access_token=<PAGE_ACCESS_TOKEN>\n $url = \"https://graph.facebook.com/v2.6/me/messages?access_token=\".$accessToken;\n $ch =curl_init($url);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);\n curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, True);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, False);\n// if(!empty($input[\"entry\"][0][\"messaging\"][0][\"message\"])) {\n curl_exec($ch);\n\n $errors = curl_error($ch);\n $dataCourseponse = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\n var_dump($errors);\n var_dump($dataCourseponse);\n\n curl_close($ch);\n// }\n\n }", "public function formatData(){\n $from = $this->dataObject->getFrom();\n\n // prepare array for counterxmlbuild with vendor informations\n $data = array(\n 'Report' => array (\n 0 => array(\n // Report attributes\n 'Created' => date('Y-m-d\\TH:i:s'),\n 'ID' => 'ID01', //TODO\n 'Version' => $this->dataObject->getVersion(),\n 'Name' => $this->dataObject->getReportName(),\n 'Title' => $this->dataObject->getReportTitle(),\n // Vendor node\n 'Vendor' => array(\n 'Name' => VENDOR_NAME,\n 'ID' => VENDOR_ID,\n 'Contact' => array(\n 0 => array(\n 'Contact' => VENDOR_CONTACT_NAME,\n 'E-mail' => VENDOR_CONTACT_MAIL\n ),\n ),\n 'WebSiteUrl' => VENDOR_WEBSITEURL,\n 'LogoUrl' => VENDOR_LOGOURL,\n ),\n ),\n ),\n );\n\n // prepare with customer informations\n $data['Report'][0]['Customer'][0] = $this->dataObject->getCustomerInfo();\n\n $j=0; // ReportItem\n $y=0; // ItemPerfomance\n $previousIdentifier = '';\n $count = 0;\n\n foreach ($this->dataObject->getData() as $row) {\n if (!($row['identifier'] == $previousIdentifier)) {\n // next Reportitem\n $j++;\n // reset ItemPerfomance\n $y=0;\n\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPlatform'] = 'TODO'; //TODO\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemDataType'] = 'TODO'; //TODO\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemName'] = $row['identifier'];\n }\n\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPerformance'][$y]['Period']['Begin'] = date('Y-m-d', strtotime($row['date']));\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPerformance'][$y]['Period']['End'] = date('Y-m-d', strtotime('last day of this month', strtotime($row['date'])));\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPerformance'][$y]['Category'] = 'TODO'; //TODO\n\n // check for different counts\n $x=0; // Instance\n\n // TODO: implement/translate format for different metric types\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPerformance'][$y]['Instance'][$x]['MetricType'] = 'ft_total';\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPerformance'][$y]['Instance'][$x]['Count'] = $row['counter'];\n\n $y++; //next ItemPerformance\n $previousIdentifier = $row['identifier'];\n $count++;\n }\n\n $counterxmlbuild = new CounterXMLBuilder();\n $counterxmlbuild->setIndentString(\"\\t\");\n $counterxmlbuild->start();\n $counterxmlbuild->add_reports($data);\n $counterxmlbuild->done();\n return $this->formattedData = $counterxmlbuild->outputMemory();\n }", "public function vxMessageCreateCheck() {\n\t\t$rt = array();\n\t\t\n\t\t$rt['errors'] = 0;\n\t\t\n\t\t$rt['msg_receivers_value'] = '';\n\t\t/* receivers: raw */\n\t\t$rt['msg_receivers_a'] = array();\n\t\t/* receivers: validated */\n\t\t$rt['msg_receivers_v'] = array();\n\t\t/* receivers: validated names */\n\t\t$rt['msg_receivers_n'] = array();\n\t\t/* msg_receivers_error:\n\t\t0 => no error\n\t\t1 => empty\n\t\t2 => not exist\n\t\t999 => unspecific */\n\t\t$rt['msg_receivers_error'] = 0;\n\t\t$rt['msg_receivers_error_msg'] = array(1 => '你忘记写收件人了', 2 => '你写的一位或多位收件人不存在');\n\t\t\n\t\tif (isset($_POST['msg_receivers'])) {\n\t\t\t$rt['msg_receivers_value'] = make_single_safe($_POST['msg_receivers']);\n\t\t\tif (strlen($rt['msg_receivers_value']) > 0) {\n\t\t\t\t$rt['msg_receivers_a'] = explode(',', $rt['msg_receivers_value']);\n\t\t\t\tforeach ($rt['msg_receivers_a'] as $msg_receiver) {\n\t\t\t\t\t$msg_receiver = trim($msg_receiver);\n\t\t\t\t\t$sql = \"SELECT usr_id, usr_nick FROM babel_user WHERE usr_nick = '{$msg_receiver}'\";\n\t\t\t\t\t$rs = mysql_query($sql, $this->db);\n\t\t\t\t\tif (mysql_num_rows($rs) == 1) {\n\t\t\t\t\t\t$User = mysql_fetch_object($rs);\n\t\t\t\t\t\tmysql_free_result($rs);\n\t\t\t\t\t\tif ($User->usr_id != $this->User->usr_id) {\n\t\t\t\t\t\t\tif (!in_array($User->usr_id, $rt['msg_receivers_v'])) {\n\t\t\t\t\t\t\t\t$rt['msg_receivers_v'][] = $User->usr_id;\n\t\t\t\t\t\t\t\t$rt['msg_receivers_n'][] = $User->usr_nick;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmysql_free_result($rs);\n\t\t\t\t\t\t$rt['msg_receivers_error'] = 2;\n\t\t\t\t\t\t$rt['errors']++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($rt['msg_receivers_error'] == 0) {\n\t\t\t\t\tif (count($rt['msg_receivers_v']) == 0) {\n\t\t\t\t\t\t$rt['msg_receivers_value'] = '';\n\t\t\t\t\t\t$rt['msg_receivers_error'] = 1;\n\t\t\t\t\t\t$rt['errors']++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$rt['msg_receivers_value'] = implode(',', $rt['msg_receivers_n']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$rt['msg_receivers_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['msg_receivers_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t}\n\t\t\n\t\t$rt['msg_body_value'] = '';\n\t\t$rt['msg_body_error'] = 0;\n\t\t$rt['msg_body_error_msg'] = array(1 => '你忘记写消息内容了', 2 => '你写的消息内容超出长度限制了');\n\t\t\n\t\tif (isset($_POST['msg_body'])) {\n\t\t\t$rt['msg_body_value'] = make_multi_safe($_POST['msg_body']);\n\t\t\t$rt['msg_body_length'] = mb_strlen($rt['msg_body_value'], 'UTF-8');\n\t\t\tif ($rt['msg_body_length'] > 0) {\n\t\t\t\tif ($rt['msg_body_length'] > 200) {\n\t\t\t\t\t$rt['msg_body_error'] = 2;\n\t\t\t\t\t$rt['errors']++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$rt['msg_body_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['msg_body_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t}\n\t\t\n\t\treturn $rt;\n\t}", "public static function sendEmail($data) {\r\n\r\n // get user data to fill in automatically\r\n $user = Auth::getUser();\r\n // Email Settings\r\n // Send email back to user and the home store \r\n $cc[] = $user->email;\r\n\r\n // Live Address\r\n $to = '[email protected]';\r\n // Test address\r\n //$to = '[email protected]';\r\n\r\n // getting the From store email\r\n $allStores = Helpers::getStores();\r\n foreach ($allStores as $store) {\r\n if ($store['storeNumber'] == $user->storeNumber){\r\n //uncomment for Live\r\n //$cc[] = ($store['storeEmail']);\r\n $storeName = $store['storeName'];\r\n }\r\n\r\n }\r\n // HTML Email Version\r\n $partCount = count($data['catNum']);\r\n $msgHeader = '<b>Store Requesting: &emsp;</b>' . $storeName . '<br />';\r\n $msgHeader .= '<b>Requestor: &emsp;</b>' . $user->name . '<br />';\r\n $msgHeader .= '<b><h3>If Stolen</h3></b>';\r\n $msgHeader .= '<b>Police Department: &emsp;</b>' . $data['policeDepartment'] . '<br />';\r\n $msgHeader .= '<b>Date Reported to Police: &emsp;</b>' . $data['policeDate'] . '<br />';\r\n $msgHeader .= '<b>Police Report Number: &emsp;</b>' . $data['reportNum'] . '<br />';\r\n $msgHeader .= '<b>Reported to NER by: &emsp;</b>' . $data['nerReportBy'] . '<br />';\r\n $msgHeader .= '<b>Date Reported to NER: &emsp;</b>' . $data['nerDate'] . '<br />';\r\n $msgHeader .= '<b>Reported to Manufacturer by: &emsp;</b>' . $data['mfgReportBy'] . '<br />';\r\n $msgHeader .= '<b>Date Reported to Manufacturer: &emsp;</b>' . $data['mfgDate'] . '<br />';\r\n\r\n $msgFooter = '<h3>Details of the Disposal</h3>' . $data['disposal_comments'];\r\n $msg = '<h3>Disposal Item Line Details</h3>';\r\n $msg .= '<table border=\"1\"><tr><b><td>Cat Num</td><td>Item Num</td><td>Serial Num</td><td>Manufacturer</td><td>Qty</td><td>Disposal Type</td></b></tr>';\r\n for ($i = 0;$i<$partCount; $i++){\r\n $msg .= \"<tr>\";\r\n $msg .= \"<td>\" . $data['catNum'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['itmNum'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['serialNum'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['mfg'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['quantity'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['disposalCode'][$i] . \"</td>\";\r\n $msg .= \"</tr>\";\r\n }\r\n $msg .=\"</table>\";\r\n\r\n // Text only part of the email\r\n\r\n $textHeader = \"Store Requesting: \" . $storeName . \"\\r\\n\";\r\n $textHeader .= \"Requestor: \" . $user->name . \"\\r\\n\\r\\n\";\r\n $textHeader .= \"If Stolen: \\r\\n\\r\\n\";\r\n $textHeader .= \"Police Department: \" . $data['policeDepartment'] . \"\\r\\n\";\r\n $textHeader .= \"Date Reported to Police\" . $data['policeDate'] . \"\\r\\n\";\r\n $textHeader .= \"Police Report Number: \" . $data['reportNum'] . \"\\r\\n\";\r\n $textHeader .= \"Reported to NER by: \" . $data['nerReportBy'] . \"\\r\\n\";\r\n $textHeader .= \"Date Reported to NER\" . $data['nerDate'] . \"\\r\\n\";\r\n $textHeader .= \"Reported to Manufacturer by: \" . $data['mfgReportBy'] . \"\\r\\n\";\r\n $textHeader .= \"Date Reported to Manufacturer: \" . $data['mfgDate'] . \"\\r\\n\";\r\n\r\n $textFooter = 'Details of the Disposal \\r\\n' . $data['disposal_comments'];\r\n $textBody = \"Cat # Item # Serial # Manufacturer Quantity Disposal Type\";\r\n\r\n for ($i = 0; $i<$partCount; $i++){\r\n $textBody .= $data['catNum'][$i] . ' ';\r\n $textBody .= $data['itmNum'][$i] . ' ';\r\n $textBody .= $data['serialNum'][$i] . ' ';\r\n $textBody .= $data['mfg'][$i] . ' ';\r\n $textBody .= $data['quantity'][$i] . ' ';\r\n $textBody .= $data['disposalCode'][$i] . ' ';\r\n }\r\n\r\n $subject = 'New Disposal Request';\r\n $text = $textHeader . $textBody . $textFooter;\r\n $html = $msgHeader . $msg . $msgFooter;\r\n\r\n Mail::send($to, $subject, $text, $html, $cc);\r\n \r\n // remove after saveDisposal() is written\r\n\r\n }", "function DF_extra_contact_info($contactmethods) {\r\n //unset($contactmethods['aim']);\r\n //unset($contactmethods['yim']);\r\n //unset($contactmethods['jabber']);\r\n $contactmethods['googleplus'] = 'Google+ Account Url';\r\n\r\n\r\n return $contactmethods;\r\n}", "function addressbook($direction=0, $where=NULL, $do_joins=FALSE)\n\n {\n\n global $database, $user;\n\n \n\n $message_total = 0;\n\n \n\n\t // MAKE SURE MESSAGES ARE ALLOWED\n\n\t \n\n \n\n // BEGIN MESSAGE QUERY\n\n $sql = \"\n\n SELECT\n\n COUNT(id) as pm_total\n\n FROM\n\n se_addressbook\n\n WHERE\n\n se_addressbook.owner='{$user->user_info['user_username']}'\n\n \";\n // RUN QUERY AND RETURN\n\n $resource = $database->database_query($sql);\n\n $result = $database->database_fetch_assoc($resource);\n\n \n\n //return (int) $database->database_num_rows($resource);\n\n return (int) $result['pm_total'];\n\n }", "function mailchimp_list(){\n\t\t$list = $this->mailchimp->lists(array(), 0, 25);\n\t\tif($list) {\n\t\t\t$this->sci->assign('maindata' , $list['data']);\n\t\t\t$this->sci->assign('total' , $list['total']);\n\t\t}\n\t\t//print_r($list);\n\t\t$this->sci->da('mailchimp_list.htm');\n\t}", "function storeallpayment(){\n // $headers .= 'Content-type:text/html;charset=UTF-8' . \"\\r\\n\";\n // $from = \"[email protected]\";\n // $to = \"[email protected]\";\n // // $to = \"[email protected]\";\n // $subject = 'Price Inquiry';\n // $message = $body;\n // $headers .= 'From: '.$from. \"\\r\\n\".\"X-Mailer: PHP/\" . phpversion();\n\n // mail($to,$subject,$message,$headers);\n\t$piece= implode(\",,,,\",$_SESSION['sale']);\n\t\t$products= implode(\",,,,\",$_SESSION['productDetail']['addtocart']);\n\t\t$userId = $_SESSION['userId'];\n\t\t// print_r($userId);die;\n\t\t$last_id = $this->db->query(\"SELECT ID FROM dbo.order_detail ORDER BY ID DESC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY\")->row();\n\t\t// print_r();die;\n\t\t$new_id = $last_id->ID +1;\n\t\tif(empty($userId) || $userId == 0){\n\t\t\t$userId = 0;\n\t\t\t$_SESSION['userId'] = 0;\n\t\t}\n\n\t$newstring = substr($_SESSION['payment']['cardnumber'], -4);\n\t$data = array(\n\t\t// \"ID\" =>$new_id,\n\t\t'guest_userid'=>$new_id,\n\t\t\"order_date\"=>date(\"Y-m-d h:i:s\"),\n\t\t\t\t\t\"ListID\"=>$products,\n\t\t\t\t\t\"UserId\"=>$userId,\n\t\t\t\t\t\"piece\"=>$piece,\n\t\t\t\t\t\"shippingfirstname\"=>$_SESSION['shipping']['firstname'],\n\t\t\t\t\t\"shippinglastname\"=>$_SESSION['shipping']['lastname'],\n\t\t\t\t\t\"shippingcompanyname\"=>$_SESSION['shipping']['companyname'],\n\t\t\t\t\t\"shippingareacode\"=>$_SESSION['shipping']['areacode'],\n\t\t\t\t\t\"shippingprimaryphone\"=>$_SESSION['shipping']['primaryphone'],\n\t\t\t\t\t\"shippingstreetadress\"=>$_SESSION['shipping']['streetadress'],\n\t\t\t\t\t\"shippingstate\"=>$_SESSION['shipping']['state'],\n\t\t\t\t\t\"shippingcity\"=>$_SESSION['shipping']['city'],\n\t\t\t\t\t\"shippingzipcode\"=>$_SESSION['shipping']['zipcode'],\n\t\t\t\t\t\"shippinghome\"=>$_SESSION['shipping']['home'],\n\t\t\t\t\t\"transactionId\"=>$_SESSION['shipping']['transactionId'],\n\t\t\t\t\t\"billingfirstname\"=>$_SESSION['payment']['firstname'],\n\t\t\t\t\t\"billinglastnames\"=>$_SESSION['payment']['lastnames'],\n\t\t\t\t\t\"billingareacodes\"=>$_SESSION['payment']['areacodes'],\n\t\t\t\t\t\"billingprimaryphone\"=>$_SESSION['payment']['primaryphone'],\n\t\t\t\t\t\"billingemail\"=>$_SESSION['payment']['email'],\n\t\t\t\t\t\"billingcompanys\"=>$_SESSION['payment']['companys'],\n\t\t\t\t\t\"billingstreetadd\"=>$_SESSION['payment']['streetadd'],\n\t\t\t\t\t\"billingsuite\"=>$_SESSION['payment']['suite'],\n\t\t\t\t\t\"billingstates\"=>$_SESSION['payment']['states'],\n\t\t\t\t\t\"billingcity\"=>$_SESSION['payment']['city'],\n\t\t\t\t\t\"billingzipcode\"=>$_SESSION['payment']['zipcode'],\n\t\t\t\t\t\"billingallpayment\"=>$_SESSION['payment']['allpayment'],\n\t\t\t\t\t\"paymenttype\"=>$_SESSION['payment']['paymenttype'],\n\t\t\t\t\t\"cardtype\"=>$_SESSION['payment']['cardtype'],\n\t\t\t\t\t\"cardholder\"=>$_SESSION['payment']['cardholder'],\n\t\t\t\t\t\"cardnumber\"=>$newstring,\n\t\t\t\t\t\"cardcvv\"=>$_SESSION['payment']['cardcvv'],\n\t\t\t\t\t\"cardmonth\"=>$_SESSION['payment']['cardmonth'],\n\t\t\t\t\t\"cardyear\"=>$_SESSION['payment']['cardyear'],\n\t\t\t\t\t\"allshipcharge\"=>$_SESSION['payment']['allshipcharge'],\n\t\t\t\t\t\"allmainpayment\"=>$_SESSION['payment']['allmainpayment'],\n\t\t\t);\n\t\tif(isset($_SESSION['shipping']['buisness'])){\n\t\t\t$data['buisness'] = 1;\n\t\t}\n\t\telse{\n\t\t\t$data['buisness'] = 0;\n\t\t}\n\n\t\t$this->db->insert(\"dbo.order_detail\",$data);\n\t\t$_SESSION['insert_id'] = $this->db->insert_id();\n\t\t\t $order = $this->orderall();\n\n\t$body = \"<p>Thank you for placing your order with Global Fitness!</p>\n <p style=''>This email is to confirm your recent order.</p>\n <p> Date \".date('m/d/Y').\"</p>\n <p> Order Number : \".$order[0]->ID.\" </p>\n \";\n\n if($_SESSION['shipping']['home']!=2)\n {\n\t $body.=\"<p><b>Shipping address</b></p>\n\t\t <p>\".$_SESSION['shipping']['firstname'].\" \".$_SESSION['shipping']['lastname'].\"</p>\n\t\t <p>\".$_SESSION['shipping']['areacode'].\"-\".$_SESSION['shipping']['primaryphone'].\"</p>\n\t\t <p style=''>\".$_SESSION['shipping']['companyname'].\"</p>\n\t\t <p>\".$_SESSION['shipping']['streetadress'].\"</p>\n\t\t <p>\".$_SESSION['shipping']['state'].\", \".$_SESSION['shipping']['city'].\" \".$_SESSION['shipping']['zipcode'].\"</p>\n\t\t <p>United States</p>\n\t\t <p></p>\";\n }\n\n $body.=\"<p><b>Billing address</b></p>\n \t\t\t <p>\".$_SESSION['payment']['firstname'].\" \".$_SESSION['payment']['lastnames'].\"</p>\n \t\t\t <p>\".$_SESSION['payment']['areacodes'].\"-\".$_SESSION['shipping']['primaryphone'].\"</p>\n\t\t <p style=''>\".$_SESSION['payment']['companys'].\"</p>\n\t\t <p>\".$_SESSION['payment']['streetadress'].\"</p>\n\t\t <p>\".$_SESSION['payment']['states'].\", \".$_SESSION['payment']['city'].\" \".$_SESSION['payment']['zipcode'].\"</p>\n\t\t <p>United States</p>\n\t\t <p></p>\";\n\n\n\n\n\n for($i=0; $i<$_SESSION['productDetail']['count'];$i++){\n\t $product = $this->Site_model->productdetail($_SESSION['productDetail']['addtocart'][$i]);\n\t\tforeach($product as $live){\n\t\t\t$thisPrice = preg_replace('/[^A-Za-z0-9\\-(.)]/', '', $live->Price);\n\n\t\t\t $body.=\"<p style=''>\".$_SESSION['sale'][$i].\"x \".$live->ProductName.\" for $\".$thisPrice.\" each</p>\";\n\t\t}\n }\n\n\n\n\t$body.=\"<p style=''>Subtotal : $\".$_SESSION['payment']['allmainpayment'].\" USD</p>\n\n <p style=''>Shipping : $\".$_SESSION['payment']['allshipcharge'].\" USD</p>\";\n\n if($_SESSION['shipping']['home']==\"0\"){\n\t\t\t$body.=\"<p style=''>$300 USD White Glove Delivery</p>\";\n\t\t}\n\n $body.=\"<p style=''>Total : $\".$_SESSION['payment']['allpayment'].\" USD</p>\n <p> Please allow 1 - 2 business days to process through our warehouse. Please note that most U.S. orders ship within 3-7 business days from receipt unless contacted by our staff otherwise. </p><p><a href='\".base_url('site/orderall?orderID=').base64_encode($_SESSION['insert_id']).\"'>View Your Order Here.</a></p>\" ;\n\n $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-type:text/html;charset=UTF-8' . \"\\r\\n\";\n\n $from = \"[email protected]\";\n if (isset($_SESSION['email'])) {\n \t# code...\n \t$to = $_SESSION['email'];\n }else{\n \t$to = $_SESSION['payment']['email'];\n }\n // $cc =\"[email protected]\";\n $subject = 'Global Fitness Order Confirmation';\n $message = $body;\n // More headers\n $headers .= 'From: '.$from. \"\\r\\n\".\"X-Mailer: PHP/\" . phpversion();\n $headers .= 'Bcc: '.$to.\"\\r\\n\";\n //$headers .= 'Bcc: '.$cc.\"\\r\\n\";\n mail($to,$subject,$message,$headers);\n\n\n\n $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-type:text/html;charset=UTF-8' . \"\\r\\n\";\n\n $from = \"[email protected]\";\n $to = \"[email protected]\";\n //$to =\"[email protected]\";\n $subject = 'Online Order Confirmation';\n $message = $body;\n // More headers\n $headers .= 'From: '.$from. \"\\r\\n\".\"X-Mailer: PHP/\" . phpversion();\n $headers .= 'Bcc: '.$to.\"\\r\\n\";\n mail($to,$subject,$message,$headers);\n\n\n\t\tunset($_SESSION['productDetail']);\n\t\tunset($_SESSION['sale']);\n\t\tunset($_SESSION['shipping']);\n\t\tunset($_SESSION['payment']);\n\t}", "public function createSms()\n {\n $messages = array();\n $totalSplits = count($this->getBody());\n foreach ($this->getBody() as $key => $body) {\n $Message = new Message();\n $Message->originator = $this->getOriginator();\n $Message->recipients = $this->getRecipients();\n $Message->body = $body;\n if ($totalSplits > 1) {\n $total = sprintf(\"%02d\", $totalSplits);\n $current = sprintf(\"%02d\", $key+1);\n $udh = self::BASEUDH.$total.$current;\n $Message->type = 'binary';\n $Message->typeDetails = array(\"udh\" => $udh);\n }\n $messages[] = $Message;\n }\n\n return $messages;\n }" ]
[ "0.62533647", "0.5743465", "0.56329346", "0.5573669", "0.55223763", "0.5502547", "0.54882234", "0.54698354", "0.54574937", "0.54380506", "0.54141843", "0.53982735", "0.53954774", "0.5393847", "0.53888494", "0.5384328", "0.53806674", "0.53795004", "0.537855", "0.5363607", "0.53546375", "0.53499174", "0.5348085", "0.5328948", "0.5314028", "0.53107965", "0.5294666", "0.52918017", "0.5287263", "0.5281212", "0.5277977", "0.525679", "0.5247905", "0.52374274", "0.52317554", "0.5230621", "0.5223556", "0.5222306", "0.5203426", "0.51981974", "0.51979107", "0.5197854", "0.5161839", "0.5144765", "0.5143712", "0.51375705", "0.51289636", "0.5116935", "0.5108187", "0.5094098", "0.5093226", "0.50868064", "0.50855416", "0.5084005", "0.5078602", "0.50740916", "0.50721794", "0.50713074", "0.50679654", "0.5059751", "0.505613", "0.50503975", "0.5045462", "0.5035782", "0.5033481", "0.50292337", "0.50214773", "0.5019323", "0.5016736", "0.5009103", "0.5006801", "0.500222", "0.500207", "0.49990952", "0.49967098", "0.4989032", "0.49885586", "0.49825722", "0.4981799", "0.49763298", "0.49756095", "0.4973964", "0.49684575", "0.49671724", "0.4966881", "0.49635878", "0.49573314", "0.49570423", "0.49472108", "0.49467668", "0.49384907", "0.49362206", "0.49343196", "0.49324903", "0.493245", "0.49317434", "0.49301353", "0.492975", "0.49171647", "0.491678", "0.49153265" ]
0.0
-1
/ $data = array('senderid'=>$sender, 'contacts'=>sizeof($numbers), 'message'=>$msg, 'totalcharge'=>$totalcharge, 'email'=>$email);
public function send_notification($data = null) { $url = base_url() . 'notifications.php'; $options = array ( CURLOPT_URL => $url, CURLOPT_POST => 1, CURLOPT_POSTFIELDS => $data, ); $curl = curl_init(); curl_setopt_array($curl, $options); $response = curl_exec($curl); if (!$response) { $response = curl_error($curl); } curl_close($curl); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function arr() {\n $customer_msgs = array();\n /* for ($i = 1; $i <= 10; $i++) {\n /* $msgs = array(); */\n /* $msgs[$i] = \"Message \" . $i;\n /* array_push($arrs, $msgs); */\n /* } */\n $customer_msgs['1'] = \"This Email is not Registered\";\n $customer_msgs['2'] = \"Name is required\";\n $customer_msgs['3'] = \"Age is required\";\n $customer_msgs['4'] = \"Breed is required\";\n $customer_msgs['5'] = \"Seassion token was expired.\"; /* token */\n $customer_msgs['6'] = \"Your unique id is missing\";\n $customer_msgs['7'] = \"Image is required\";\n $customer_msgs['8'] = \"Invalid Input\";\n $customer_msgs['9'] = \"Token Expired\";\n $customer_msgs['10'] = \"Owner ID not Found\";\n $customer_msgs['11'] = \"Not a valid token\";\n $customer_msgs['12'] = \"No Dogs Found\";\n $customer_msgs['13'] = \"Driver not Found\";\n $customer_msgs['14'] = 'PayPal unique id is missing.';\n $customer_msgs['15'] = 'Contact numbers are required.';\n $customer_msgs['16'] = 'Your ETA is required.';\n $customer_msgs['17'] = 'No Credit Found';\n $customer_msgs['18'] = 'Successfully Log-Out';\n $customer_msgs['19'] = \"Id of Request is required\";\n $customer_msgs['20'] = \"Already Rated\";\n $customer_msgs['21'] = \"Walk is not completed\";\n $customer_msgs['22'] = \"Walk ID doesnot matches with Dog ID\";\n $customer_msgs['23'] = \"Walk ID Not Found\";\n $customer_msgs['24'] = 'Invalid Phone Number';\n $customer_msgs['25'] = 'Phone number must be required.';\n $customer_msgs['26'] = 'Social Login unique id must be required.';\n $customer_msgs['27'] = 'Email ID already Registred';\n $customer_msgs['28'] = 'Password field is required.';\n $customer_msgs['29'] = 'Email field is required';\n $customer_msgs['30'] = 'Name field is required.';\n $customer_msgs['31'] = 'Last Name field is required.';\n $customer_msgs['32'] = 'Push notification token is required.';\n $customer_msgs['33'] = 'Device type must be android or ios';\n $customer_msgs['34'] = 'Login type is required.';\n $customer_msgs['35'] = 'Login by mismatch';\n $customer_msgs['36'] = 'Invalid Username and Password';\n $customer_msgs['37'] = 'Not a Registered User';\n $customer_msgs['38'] = 'Not a valid social registration User';\n $customer_msgs['39'] = 'Card number\\'s last four digits are missing.';\n $customer_msgs['40'] = 'Unique payment token is missing.';\n $customer_msgs['41'] = 'Could not create client ID';\n $customer_msgs['42'] = 'Unique card ID is missing.';\n $customer_msgs['43'] = 'Card ID and ' . Config::get('app.generic_keywords.User') . ' ID Doesnot matches';\n $customer_msgs['44'] = 'Card not found';\n $customer_msgs['45'] = 'This user does not have a referral code';\n $customer_msgs['46'] = 'No Card Found';\n $customer_msgs['47'] = 'Invalid Old Password';\n $customer_msgs['48'] = 'Old Password must not be blank';\n $customer_msgs['49'] = \"location points are missing\";\n $customer_msgs['50'] = '' . Config::get('app.generic_keywords.User') . 'ID not Found';\n $customer_msgs['51'] = 'Request ID doesnot matches with' . Config::get('app.generic_keywords.User') . ' ID';\n $customer_msgs['52'] = 'Request ID Not Found';\n $customer_msgs['53'] = '' . Config::get('app.generic_keywords.User') . ' ID not Found';\n $customer_msgs['54'] = 'No walker found';\n $customer_msgs['55'] = 'No ' . Config::get('app.generic_keywords.Provider') . ' found matching the service type'; /* remaining from here */\n $customer_msgs['56'] = 'No ' . Config::get('app.generic_keywords.Provider') . ' found';\n $customer_msgs['57'] = 'Selected provider\\'s unique id is missing.';\n $customer_msgs['58'] = 'Your previous Request is Pending.';\n $customer_msgs['59'] = 'Please add card first for payment.';\n $customer_msgs['60'] = 'No ' . Config::get('app.generic_keywords.Provider') . ' found matching the service type for scheduled request.';\n $customer_msgs['61'] = 'Invalid Promo Code';\n $customer_msgs['62'] = 'You can not apply multiple code for single trip.';\n $customer_msgs['63'] = 'Promotional code successfully applied.';\n $customer_msgs['64'] = 'Promotional code is not available';\n $customer_msgs['65'] = 'Promotional code already used.';\n $customer_msgs['66'] = 'Promotion feature is not active on card payment.';\n $customer_msgs['67'] = 'Promotion feature is not active on cash payment.';\n $customer_msgs['68'] = 'Promotion feature is not active.';\n $customer_msgs['69'] = 'You can\\'t apply promotional code without creating request.';\n $customer_msgs['70'] = 'Payment mode is paypal';\n $customer_msgs['71'] = 'No ' . Config::get('app.generic_keywords.Provider') . ' found for the selected service in your area currently';\n $customer_msgs['72'] = 'You are already in debt';\n $customer_msgs['73'] = 'Distance is required.';\n $customer_msgs['74'] = 'Time is required.';\n $customer_msgs['75'] = 'Request ID doesnot matches with ' . Config::get('app.generic_keywords.User') . ' ID';\n $customer_msgs['76'] = 'On going ' . Config::get('app.generic_keywords.Trip') . '.';\n $customer_msgs['77'] = 'No on going ' . Config::get('app.generic_keywords.Trip') . ' found.';\n $customer_msgs['78'] = 'Searching for ' . Config::get('app.generic_keywords.Provider') . 's.';\n $customer_msgs['79'] = 'No ' . Config::get('app.generic_keywords.Provider') . 's are available currently. Please try after sometime.';\n $customer_msgs['80'] = '' . Config::get('app.generic_keywords.Provider') . ' not Confirmed yet';\n $customer_msgs['81'] = 'No ' . Config::get('app.generic_keywords.Provider') . ' found around you.';\n $customer_msgs['82'] = 'Time-Zone is required';\n $customer_msgs['83'] = 'Schedule date and time must be required.';\n $customer_msgs['84'] = \"Sorry, You can't create schedule morethen two week faar from today.\";\n $customer_msgs['85'] = 'update successfully';\n $customer_msgs['86'] = 'Payment mode not updated';\n $customer_msgs['87'] = \"Destination Set Successfully\";\n $customer_msgs['88'] = 'Sorry You can\\'t create event earlier then 14 days.';\n $customer_msgs['89'] = 'Yo have invited maximum members for event.';\n $customer_msgs['90'] = 'Please change braintree as default gateway';\n $customer_msgs['91'] = \"Sorry, You have apready apply the refereel code.\";\n $customer_msgs['92'] = 'Referral process successfully completed.';\n $customer_msgs['93'] = \"Sorry, You can't apply your refereel code.\";\n $customer_msgs['94'] = 'Invalid referral code';\n $customer_msgs['95'] = 'You have skipped for referral process';\n $customer_msgs['96'] = 'No Dog Found';\n $customer_msgs['97'] = 'Payment type must be required.';\n $customer_msgs['98'] = 'Event Unique Id is missing.';\n $customer_msgs['99'] = 'Sorry you can\\'t delte past or ongoing event.';\n $customer_msgs['100'] = 'Event not found.';\n $customer_msgs['101'] = 'Event successfully deleted.';\n /* print_r($customer_msgs); */\n $provider_msgs = array();\n $provider_msgs['1'] = \"This Email is not Registered\";\n $provider_msgs['2'] = 'Password field is required.';\n $provider_msgs['3'] = 'Email field is required';\n $provider_msgs['4'] = 'Name field is required.';\n $provider_msgs['5'] = 'Last Name field is required.';\n $provider_msgs['6'] = 'Image is required';\n $provider_msgs['7'] = 'Push notification token is required.';\n $provider_msgs['8'] = 'Device type must be android or ios';\n $provider_msgs['9'] = 'Login type is required.';\n $provider_msgs['10'] = 'Phone number must be required.';\n $provider_msgs['11'] = 'Social Login unique id must be required.';\n $provider_msgs['12'] = 'Invalid Input';\n $provider_msgs['13'] = 'Invalid Phone Number';\n $provider_msgs['14'] = 'Email ID already Registred';\n $provider_msgs['15'] = 'Login by mismatch';\n $provider_msgs['16'] = 'Invalid Username and Password';\n $provider_msgs['17'] = 'Not a Registered User';\n $provider_msgs['18'] = 'Not a valid social registration User';\n $provider_msgs['19'] = 'Id of Request is required.';\n $provider_msgs['20'] = 'Your unique id is missing.';\n $provider_msgs['21'] = 'Already Rated';\n $provider_msgs['22'] = 'Service ID doesnot matches with ' . Config::get('app.generic_keywords.Provider') . ' ID';\n $provider_msgs['23'] = 'Service ID Not Found';\n $provider_msgs['24'] = 'Token Expired';\n $provider_msgs['25'] = '' . Config::get('app.generic_keywords.Provider') . ' ID not Found';\n $provider_msgs['26'] = 'Not a valid token';\n $provider_msgs['27'] = 'Service Already Started';\n $provider_msgs['28'] = 'location points are missing.';\n $provider_msgs['29'] = 'accept or reject must be required.';\n $provider_msgs['30'] = 'Request ID does not matches' . Config::get('app.generic_keywords.Provider') . ' ID';\n $provider_msgs['31'] = 'Request Canceled.';\n $provider_msgs['32'] = 'Request ID Not Found';\n $provider_msgs['33'] = '' . Config::get('app.generic_keywords.Provider') . ' not yet confirmed';\n $provider_msgs['34'] = 'Service not yet started';\n $provider_msgs['35'] = '' . Config::get('app.generic_keywords.Provider') . ' not yet arrived';\n $provider_msgs['36'] = 'Distance is required.';\n $provider_msgs['37'] = 'Time is required.';\n $provider_msgs['38'] = 'Invalid Old Password';\n $provider_msgs['39'] = 'Old Password must not be blank';\n $provider_msgs['40'] = 'Successfully Log-Out';\n\n\n foreach ($customer_msgs as $key => $value) {\n echo '<string name=\"error_' . $key . '\">' . $value . '</string>';\n }\n echo \"\\n ################################################################################ \\n\";\n foreach ($provider_msgs as $key => $value) {\n echo '<string name=\"error_' . $key . '\">' . $value . '</string>';\n }\n /* $i = 0;\n foreach ($customer_msgs as $customer_msg) {\n\n echo '<string name=\"error_' . $i . '\">' . $customer_msg . '</string>';\n $i++;\n } */\n exit;\n /* $response_array = array('success' => false, 'error' => 'Invalid Input', 'error_code' => 401, 'error_messages_client' => $customer_msgs, 'error_messages_provider' => $provider_msgs);\n $response_code = 200;\n $response = Response::json($response_array, $response_code);\n return $response; */\n }", "function add_quick_contact(){\n\t$user_id=$_POST['user_id'];\n\t$contact_list=$_POST['user_contacts'];\n\t$contact_name=$_POST['user_name'];\n\tif(!empty($contact_list) && !empty($user_id)){\n\t\tfor($i=0;$i<count($contact_list);$i++){\n\t\t\t$contact=$_POST['user_contacts'][$i];\n\t\t\t$contactname=$_POST['user_name'][$i];\n\t\t\t$add_contacts = $this -> conn -> insertnewrecords('quick_contacts','quick_contact_user_id, quick_contacts_name,quick_contacts_number', '\"' . $user_id . '\",\"' . $contactname . '\",\"' . $contact . '\"');\n\t\t\tif(!empty($add_contacts)){\n\t\t\t\t$posts[] = array(\"user_contacts\"=>$_POST['user_contacts'][$i],\"user_name\"=>$_POST['user_name'][$i]);\n\t\t\t}else{\n\t\t\t\t$posts = array('status' => \"false\",\"message\" => \"Error in adding contacts\");\n\t\t\t}\n\t\t\t\n\t\t}\n$post=array('status'=>'true','quick_contacts'=>$posts);\n\t}else{\n\t\t$post = array('status' => \"false\",\"message\" => \"Missing parameter\",'user_id'=>$user_id,'contacts'=>$contact_list);\n\t}\n\techo $this -> json($post);\n}", "function &sms_addressbook_list($start=NULL, $limit=NULL, $direction=0, $where=NULL)\n\n {\n\n global $database, $user;\n\n \n\n\t $message_array = array();\n\n \n\n\t // MAKE SURE MESSAGES ARE ALLOWED\n\n\t \n\n \n\n // BEGIN MESSAGE QUERY\n\n $sql = \"\n\n SELECT\n\n *\n\n FROM\n\n se_sms\n\n WHERE\n\n username='{$user->user_info['user_username']}'\n\n \";\n\n // EXECUTE QUERY\n\n $resource = $database->database_query($sql);\n\n \n\n // GET MESSAGES\n\n\t while( $message_info=$database->database_fetch_assoc($resource) )\n\n {\n\n // CREATE AN OBJECT FOR MESSAGE AUTHOR/RECIPIENT\n\n $pm_user = new SEUser();\n\n $pm_user->user_info['id'] = $message_info['id'];\n\n $pm_user->user_info['username'] = $message_info['username'];\n\n $pm_user->user_info['message'] = $message_info['message'];\n\n $pm_user->user_info['date'] = $message_info['date'];\n\n $pm_user->user_info['tono'] = $message_info['tono'];\n $pm_user->user_info['fromno'] = $message_info['fromno'];\n $pm_user->user_displayname();\n\n \n\n // Remove breaks for preview\n\n $message_info['pm_body'] = str_replace(\"<br>\", \"\", $message_info['pm_body']);\n\n \n\n // SET MESSAGE ARRAY\n\n $message_array[] = array(\n\n 'pmconvo_id' => $message_info['id'],\n\n 'pmconvo_username' => $message_info['username'],\n\n 'pm_message' => $message_info['message'],\n\n 'pm_date' => $message_info['date'],\n\t\t'pm_body' => $message_info['pm_body'],\n\t\t 'pm_tono' => $message_info['tono'],\n\t\t \n 'pm_fromno' => $message_info['fromno']\n \n\n );\n\n \n\n unset($pm_user);\n\n }\n\n \n\n return $message_array;\n\n }", "function num_recipients($address_list)\n{\n\t$num_recipients = 0;\n\n\tforeach ($address_list as $field => $adr_ary)\n\t{\n\t\t$num_recipients += sizeof($adr_ary);\n\t}\n\n\treturn $num_recipients;\n}", "function getRecipientCount(){\n return sizeof( $this->to );\n }", "function insert_subscriber($data, $number){\n $new_data = array();\n\n if($number == 1){\n $new_data['id'] = $data[0]['id'];\n $new_data['email'] = $data[0]['email'];\n $new_data['date'] = $data[0]['date'];\n insertRecord(TAB_SUBSCRIBERS, $new_data);\n }else{\n foreach($data as $data_element){\n $new_data['id'] = $data_element['id'];\n $new_data['email'] = $data_element['email'];\n $new_data['date'] = $data_element['date'];\n insertRecord(TAB_SUBSCRIBERS, $new_data);\n }\n }\n}", "public function show_notification_by_count_post()\n {\n $response = new StdClass();\n $result = new StdClass();\n $staff_mobile_no=$this->input->post('staff_mobile_no');\n $resdata = $this->Supervisor->check_total_count_notifications($staff_mobile_no);\n if($resdata>0)\n { \n $data1->count=$resdata;\n $data1->status ='1';\n array_push($result,$data1);\n $response->data = $data1;\n }\n else if($resdata==0)\n {\n $data1->count ='';\n $data1->status = '1';\n array_push($result,$data1);\n $response->data = $data1;\n }\n else \n {\n $data1->status ='0';\n $data1->message = 'failed';\n array_push($result,$data1);\n $response->data = $data1;\n }\n \n echo json_output($response);\n }", "function sendJson($databaseInformation, $msg, $newElementID, $amountOfPages,$currentPage)\n{\n $elementsToSend = [];\n if (isset($databaseInformation)) {\n $elementsToSend['db'] = $databaseInformation;\n }\n if (isset($msg)) {\n $elementsToSend['msg'] = $msg;\n }\n if (isset($newElementID)) {\n $elementsToSend['id'] = $newElementID;\n }\n if(isset($amountOfPages)){\n $elementsToSend['amountOfPages'] = $amountOfPages;\n }\n if(isset($currentPage)){\n $elementsToSend['currentPage'] = $currentPage;\n }\n echo json_encode($elementsToSend, JSON_FORCE_OBJECT);\n}", "function smsaddressbook($direction=0, $where=NULL, $do_joins=FALSE)\n\n {\n\n global $database, $user;\n\n \n\n $message_total = 0;\n\n \n\n\t // MAKE SURE MESSAGES ARE ALLOWED\n\n\t\n\n \n\n // BEGIN MESSAGE QUERY\n\n $sql = \"\n\n SELECT\n\n COUNT(id) as pm_total\n\n FROM\n\n se_sms\n\n WHERE\n\n username='{$user->user_info['user_username']}'\n\n \";\n // RUN QUERY AND RETURN\n\n $resource = $database->database_query($sql);\n\n $result = $database->database_fetch_assoc($resource);\n\n \n\n //return (int) $database->database_num_rows($resource);\n\n return (int) $result['pm_total'];\n\n }", "public function setValuesFromDataArray($dataArray) {\n $this->commId = (isset($dataArray['commId']) ? $dataArray['commId'] \n : (isset($dataArray['communicationId']) ? $dataArray['communicationId'] : 0));\n $this->recipientId = (isset($dataArray['recipient']) ? $dataArray['recipient'] \n : (isset($dataArray['recipientId']) ? $dataArray['recipientId'] \n : (isset($dataArray['personId']) ? $dataArray['personId'] : 0)));\n $this->recipientName = (isset($dataArray['name']) ? $dataArray['name'] \n : (isset($dataArray['recipientName']) ? $dataArray['recipientName'] : 0));\n/* $this->sent = ((isset($dataArray['sent'])) \n ? ($dataArray['sent'] == 1) \n : (isset($dataArray['artistInformedOfMediaReceipt']) \n ? ($dataArray['artistInformedOfMediaReceipt'] == 1) \n : false)); */\n $this->dateSent = ((isset($dataArray['dateSent'])) \n ? $dataArray['dateSent'] \n : (isset($dataArray['artistInformedOfMediaReceiptDate']) \n ? $dataArray['artistInformedOfMediaReceiptDate']\n : ''));\n $this->commType = (isset($dataArray['type']) ? $dataArray['type'] : '');\n $this->sender = (isset($dataArray['sender']) ? $dataArray['sender'] : 0);\n $this->to = (isset($dataArray['emailTo']) ? $dataArray['emailTo'] \n : ((isset($dataArray['to'])) ? $dataArray['to'] : ''));\n if ($this->to =='') {\n $name = (isset($dataArray['name']) && $dataArray['name'] !='') ? $dataArray['name'] : '';\n $email = (isset($dataArray['email']) && $dataArray['email'] !='') ? $dataArray['email'] : '';\n $this->setToFieldFromNameAndEmail($name, $email);\n }\n $this->from = (isset($dataArray['emailFrom']) ? $dataArray['emailFrom'] \n : ((isset($dataArray['from'])) ? $dataArray['from'] : ''));\n $this->subject = (isset($dataArray['emailSubject']) ? $dataArray['emailSubject'] : '');\n $this->message =(isset($dataArray['contentText']) ? $dataArray['contentText'] : '');\n $this->inResponseTo = (isset($dataArray['inResponseTo']) ? $dataArray['inResponseTo'] : 0);\n // $this->referencedWorks is unaffected.\n // $this->emailWidgetId is unaffected.\n // $this->bcc is unaffected.\n }", "public function sendMessage(array $collection, array $params){ \n try {\n $stateConnect=$this->getConnection();\n // $states=array(); \n $dataSend = array(); $totalSmsSend = 0; $reponseSend = 1; //pendiente\n $totalSmsAgend = 0; $smscount = 0;\n if($stateConnect){\n\n $params['collection'] = $collection;\n $countsms = $this->validateCredit($params);\n\n foreach ($collection as $obj) {\n $smscount++;\n// \n if(!empty($obj[2])){\n if($smscount <= $countsms){\n $this->sendMQ($obj);\n $totalSmsAgend++;\n }\n }else{\n $remitter = isset($obj[3])?$obj[3]:'123456789';\n $codeCountry = $params['codCountry'];\n // if($this->validateCredit($params)){\n if($smscount <= $countsms){\n //$states[$obj[1]]=$this->_connection->send_long($remitter, $obj[0], $obj[1]);\n \n $getOperatorPhone = new \\validateNum();\n $operatorPhone= $getOperatorPhone->getOperadorNum($obj[0]);\n \n if($operatorPhone['id'] != 4){\n $reponseSend = $this->_connection->send_long\n ($remitter, $codeCountry.$obj[0], $obj[1], 0, 0, false);\n $reponseSend = ((int)$reponseSend == 0) ?2:4;\n }else{\n $reponseSend = 2;\n }\n \n \n if($reponseSend == 4){\n $totalSmsSend += 1;\n }\n }\n }\n $dataSend[] = $this->dataSMS($obj, $params, $reponseSend);\n $reponseSend = 1;\n }\n // var_dump($dataSend);exit;\n $response = \\Sms::insert($dataSend);\n $update = \\User::find($params['idUser']);\n $update->credit = ($update->credit + ($countsms - ($totalSmsSend + $totalSmsAgend)));\n $update->save();\n\n $updateCompany = \\Company::find($params['idcompany']);\n $updateCompany->credit = ($updateCompany->credit - ($totalSmsSend + $totalSmsAgend));\n $updateCompany->save();\n\n $this->_connection->close();\n // return $states;\n return $response;\n }\n return $stateConnect;\n } catch (Exception $exc) {\n return array('state'=> 0, 'msj' => $exc->getMessage());\n }\n }", "public function useJSON($url, $username, $apikey, $flash, $sendername, $messagetext, $recipients) {\r\n $gsm = array();\r\n $country_code = '234';\r\n $arr_recipient = explode(',', $recipients);\r\n foreach ($arr_recipient as $recipient) {\r\n $mobilenumber = trim($recipient);\r\n if (substr($mobilenumber, 0, 1) == '0'){\r\n $mobilenumber = $country_code . substr($mobilenumber, 1);\r\n }\r\n elseif (substr($mobilenumber, 0, 1) == '+'){\r\n $mobilenumber = substr($mobilenumber, 1);\r\n }\r\n $generated_id = uniqid('int_', false);\r\n $generated_id = substr($generated_id, 0, 30);\r\n $gsm['gsm'][] = array('msidn' => $mobilenumber, 'msgid' => $generated_id);\r\n }\r\n $message = array(\r\n 'sender' => $sendername,\r\n 'messagetext' => $messagetext,\r\n 'flash' => \"{$flash}\",\r\n );\r\n\r\n $request = array('SMS' => array(\r\n 'auth' => array(\r\n 'username' => $username,\r\n 'apikey' => $apikey\r\n ),\r\n 'message' => $message,\r\n 'recipients' => $gsm\r\n ));\r\n $json_data = json_encode($request);\r\n if ($json_data) {\r\n $response = $this->doPostRequest($url, $json_data, array('Content-Type: application/json'));\r\n $result = json_decode($response);\r\n return $result->response->status;\r\n } else {\r\n return false;\r\n }\r\n}", "public function store(Request $request)\n { \n $id = $request->get('send_to'); \n $message = $request->get('message'); \n $event = Event::find($id); \n\n $mobileNumberPersonnelBelongsToCollege = Personnel::getPersonnelNumberUnderCollege($event->participant_collge);\n $personelNumbers = Personnel::composeNumberAsArray($event->sponsor_personnels); \n $studentNumbers = Student::getStudentEventMobileNumbers($event->participant_collge, $event->participant_year); \n\n if(!empty($personelNumbers) and !empty($studentNumbers)) { \n $arrayNumbers = array_merge($personelNumbers, $studentNumbers);\n } else if(!empty($personelNumbers)) { \n $arrayNumbers = $personelNumbers;\n } else if(!empty($studentNumbers)) { \n $arrayNumbers = $studentNumbers;\n } else {\n $arrayNumbers = [''];\n }\n\n if(!empty($mobileNumberPersonnelBelongsToCollege)) {\n $arrayNumbers = array_merge($arrayNumbers, $mobileNumberPersonnelBelongsToCollege);\n }\n\n // print \"<pre>\";\n // print_r($arrayNumbers);\n //\n // exit;\n\n // $arrayNumbers = Sms::mergeNumbers($student, $personnel); \n // print_r( $personelNumbers); \n // print_r( $studentNumbers); \n // exit; \n // $arrayNumbers [] = '+639069262984'; \n // $message = \"test\"; \n // print \"<pre>\";\n // print_r($arrayNumbers);\n // exit; \n $tatus = Sms::sendSms($arrayNumbers, env('SMS_DEVICE_ID'), env('SMS_USER'), env('SMS_PASS'), $message);\n // print_r($tatus);\n // exit; \n return redirect()->back()->with('status', 'message is comming to students and faculty soon..'); \n }", "function getData()\n{\n$data = array();\n$data[0]=$_POST['Name'];\n$data[1]=$_POST['DOB'];\n$data[2]=$_POST['Address'];\n$data[3]=$_POST['Postcode'];\n$data[4]=$_POST['Phone'];\n$data[5]=$_POST['email'];\n$data[6]=$_POST['MemberID'];\nreturn $data;\n}", "public function chatting_history(){\n $mid = $_POST[\"my_email\"];\n $fid = $_POST[\"frnd_id\"];\n $uid = $_POST[\"uid\"];\n $APITOKEN = $_POST[\"APITOKEN\"];\n if(check_api_token($uid, $APITOKEN)){\n $s_email = $mid;\n $json = array('status'=>false, 'msg'=>'Data load faild!!!');\n if(filter_var($fid, FILTER_VALIDATE_EMAIL)){\n $where = \"(`receiver_id` = '$mid' AND `sender_id` = '$fid') OR (`sender_id` = '$mid' AND `receiver_id` = '$fid')\";\n $this->db->where($where);\n $this->db->order_by('id');\n $result = $this->db->get(\"crm_message\")->result();\n }\n elseif(is_numeric($fid)){\n $where = \"crm_message.receiver_id = '$fid' AND FIND_IN_SET('$mid', `crm_message_group`.`group_member`)\";\n $this->db->from('crm_message');\n $this->db->join('crm_message_group', 'crm_message.receiver_id = crm_message_group.group_id');\n $this->db->where($where);\n $this->db->order_by('id');\n $result = $this->db->get()->result();\n }\n $i = 0;\n if(count($result)>0){\n $json[\"data\"] = array();\n foreach($result as $row){\n if($row->sender_id == $mid){\n array_push($json[\"data\"], array('msgid'=> $row->id, 'groupId'=> $fid, 'drawNew' => 'yes', 'type' => 'right', 'msg' => base64_decode($row->msg), 'time' => $row->time, 'msgtype' => $row->msg_type, 'msg_status'=> $row->status));\n }\n elseif($row->receiver_id == $mid){\n array_push($json[\"data\"], array('msgid'=> $row->id, 'groupId'=> $fid, 'drawNew' => 'yes', 'type' => 'left', 'msg' => base64_decode($row->msg), 'time' => $row->time, 'msgtype' => $row->msg_type, 'fimg'=>'', 'fname'=>'', 'msg_status'=> $row->status));\n }\n elseif($row->receiver_id == $fid AND !(filter_var($fid, FILTER_VALIDATE_EMAIL))){\n $finfo = $this->db->get_where(\"crm_users\", array(\"email\"=>$row->sender_id))->result();\n array_push($json[\"data\"], array('msgid'=> $row->id, 'groupId'=> $fid, 'drawNew' => 'yes', 'type' => 'left', 'msg' => base64_decode($row->msg), 'time' => $row->time, 'msgtype' => $row->msg_type, 'fimg'=>$finfo[0]->img, 'fname'=>$finfo[0]->display_name, 'msg_status'=> $row->status));\n }\n \n $i++;\n }\n if(filter_var($fid, FILTER_VALIDATE_EMAIL) AND $fid == $s_email){\n $this->db->where($where);\n $this->db->update(\"crm_message\", array(\"status\"=>0));\n }\n elseif(is_numeric($fid)){\n $this->db->query(\"UPDATE crm_message SET status = REPLACE(status, '$mid', '') WHERE status LIKE '%$mid%'\");\n }\n $json['status'] = true;\n $json['msg'] = 'Data load success...';\n }\n\n header('Content-type: application/json');\n echo json_encode($json);\n }else{\n $json = array('status'=>false, 'msg'=>'Data load faild!!!');\n header('Content-type: application/json');\n echo json_encode($json);\n }\n }", "public function msg_sent()\n {\n \n $sent = $this->Model_messages_sent->get_datatables();\n $data = array();\n $no = $_POST['start'];\n\n foreach ($sent as $msg_) \n {\n $sent_to = $msg_->send_to; \n $subject_send = $msg_->subject_send;\n $subject_send = character_limiter($subject_send, 20);\n $text_msg = $msg_->msg_send;\n $text_msg = character_limiter($text_msg, 50);\n\n $current = time();\n $date = strtotime($msg_->date_send);\n $units = 1;\n $msg_date = timespan($date, $current, $units) . ' ago';\n\n $no++;\n $row = array();\n $row[] = '<input type=\"checkbox\" class=\"sent\" name=\"sent[]\" value=\"' . $msg_->msg_sent_id . '\" />';\n $row[] = $sent_to;\n $row[] = $subject_send;\n $row[] = $text_msg;\n $row[] = $msg_date;\n\n $row[] = '\n <div class=\"action-buttons\">\n <a class=\"text-blue\" href=\"javascript:void(0)\" onclick=\"open_sent('.\"'\".$msg_->msg_sent_id.\"'\".')\" title=\"Open\">\n <i class=\"ace-icon fa fa-search bigger-130\"></i>\n </a>\n <a class=\"text-red\" href=\"javascript:void(0)\" onclick=\"delete_sent('.\"'\".$msg_->msg_sent_id.\"'\".')\" title=\"Delete\">\n <i class=\"ace-icon fa fa-trash-o bigger-130\"></i>\n </a>\n </div>';\n \n $data[] = $row;\n }\n \n $output = array(\n \"draw\" => $_POST['draw'],\n \"recordsTotal\" => $this->Model_messages_sent->count_all(),\n \"recordsFiltered\" => $this->Model_messages_sent->count_filtered(),\n \"data\" => $data,\n );\n\n echo json_encode($output);\n }", "function _osg_singout_notifier_prep_message($info,$data) {\n global $base_url;\n $message = array();\n $separator = md5(time());\n // carriage return type (we use a PHP end of line constant)\n $eol = PHP_EOL;\n\n //$params['to'] = $record['email'];\n $recipient = $info['first_name'].' '.$info['last_name'].' <[email protected]'.'>';\n $sender = variable_get('site_mail', '[email protected]');\n $message['subject'] = 'These Performances are available for registration.';\n $fudge = count($data) > 2?'s':'';\n $fudge = \"Please visit <a href=\\\"$base_url\\\">\".variable_get('site_name','[Some Cool Site]').\"</a>\"\n .\" and indicate your attendance plan for the following event$fudge:\";\n $data[0] = $fudge;\n $body = implode(\"<br>\",$data);\n\n\n\n $message['body'] = $body;\n\n debug($message,'$message');\n //drupal_mail($module, $key, $to, $language, $params = array(), $from = NULL, $send = TRUE)\n drupal_mail('osg_singout_notifier'\n , 'registration_needed'\n , $recipient\n , language_default()\n , $message\n , $sender\n );\n\n}", "public function sendContactsAction($header_data,$post_data){ \n// if(!isset($post_data['contact_numbers'])) {\n// Library::logging('alert',\"API : sendContacts : \".ERROR_INPUT.\": user_id : \".$header_data['id'].' '.$post_data['contact_numbers']);\n// Library::output(false, '0', ERROR_INPUT, null);\n// } else {\n if( empty($post_data['contact_numbers']) ){\n $post_data['contact_numbers'] = array();\n }\n try {\n $user = Users::findById($header_data['id']);\n $user->contact_numbers = $post_data['contact_numbers'];\n $user->save();\n Library::output(true, '1', CONTACTS_SAVED, null);\n } catch(Exception $e) {\n Library::logging('error',\"API : sendContacts : \".$e.\" \".\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_REQUEST, null);\n }\n// }\n }", "public function getRegisteredNumbersAction($header_data){\n try {\n $user = Users::findById($header_data['id']);\n if($header_data['os'] == 1) {\n $contact_numbers = json_decode($user->contact_numbers);\n } else {\n $contact_numbers = $user->contact_numbers;\n }\n $i = 0;\n $register = array();\n foreach($contact_numbers as $contacts) {\n $get_contacts = str_replace(' ', '', $contacts); \n $get_contacts = str_replace('+91', '', $contacts); \n if(substr($get_contacts, 0, 1) == \"0\") {\n $get_contacts = substr($get_contacts, 1);\n //$get_contacts = preg_replace('/0/', '', $get_contacts, 1); \n }\n $filter_contacts= preg_replace('/[^0-9\\-]/', '', $get_contacts);\n $filter_contacts = str_replace('-', '', $filter_contacts); \n if( $user->mobile_no == $filter_contacts ){\n continue;\n }\n $db = Library::getMongo();\n $record = $db->execute('return db.users.find({\"mobile_no\":{$in:[\"'.$filter_contacts.'\", \"+'.$filter_contacts.'\"]}, \"is_active\":1, \"is_deleted\":0}).toArray()');\n if(!empty($record['retval'][0])) {\n \n if( !empty($user->hidden_contacts) && in_array((string)$record['retval'][0]['_id'], $user->hidden_contacts) ){\n continue;\n }\n if(empty($record['retval'][0][\"is_mobile_searchable\"])) {\n continue;\n }\n if(isset($user->running_groups)) {\n $isFriend = false;\n foreach($user->running_groups as $user_ids) {\n if($user_ids['user_id'] == (string)$record['retval'][0]['_id']) {\n $isFriend = true; \n break;\n }\n }\n if( $isFriend ){\n continue;\n }\n }\n if( isset($user->request_sent) ) {\n $isFriendRequested = false;\n foreach($user->request_sent as $user_ids) {\n if($user_ids['user_id'] == (string)$record['retval'][0]['_id']) {\n $isFriendRequested = true; \n break;\n }\n }\n if( $isFriendRequested ){\n continue;\n }\n }\n if(isset($user->request_pending)) {\n $isRequestPending = false;\n foreach($user->request_pending as $user_ids) {\n if($user_ids['user_id'] == (string)$record['retval'][0]['_id']) {\n $isRequestPending = true; \n break;\n }\n }\n if( $isRequestPending ){\n continue;\n }\n }\n \n $register[$i]['mobile_no'] = $contacts;\n $register[$i]['user_id'] = (string)$record['retval'][0]['_id'];\n $register[$i]['username'] = $record['retval'][0]['username'];\n $register[$i]['jaxl_id'] = $record['retval'][0]['jaxl_id'];\n $register[$i]['profile_image'] = isset($record['retval'][0]['profile_image']) ? FORM_ACTION.$record['retval'][0]['profile_image'] : 'http://www.gettyimages.in/CMS/StaticContent/1391099126452_hero1.jpg';\n $register[$i]['request_sent'] = 0;\n if(isset($user->request_sent)) {\n foreach($user->request_sent as $request_sent) {\n// if($request_sent['is_active'] == 1) {\n// $j = 1;\n// }\n if($request_sent['user_id'] == (string)$record['retval'][0]['_id']) {\n $register[$i]['request_sent'] = 1;\n $register[$i]['is_active'] = $request_sent['is_active'];\n break;\n }\n }\n }\n $i++;\n }\n }\n if(empty($register)) {\n $result = array();\n Library::output(true, '1', \"No Error\", $result);\n } else {\n Library::output(true, '1', \"No Error\", $register);\n }\n } catch (Exception $e) {\n Library::logging('error',\"API : setContextIndicator : \".$e.\" \".\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_REQUEST, null);\n }\n }", "public function store()\n\t{\n\t\t$data = Input::json();\n\n\t\t$utils = UtilController::getInstance();\n\t\t$numberStructure = $utils->nStruct;\n\n\t\t$newNumber = new ContactNumber;\n\t\tforeach ($data as $key => $value) {\n\t\t\t$newNumber->$numberStructure[$key] = $value;\n\t\t}\n\n\t\t$newNumber->save();\n\t\tif ($newNumber) {\n\t\t\treturn Response::json($newNumber) ;\n\t\t}else\n\t\t{\n\t\t\treturn Response::make(\"error\", 500);\n\t\t}\n\t}", "function sendBulkSMS($username, $encryp_password, $senderid, $message, $mobileNos, $deptSecureKey) {\n $key = hash('sha512', trim($username) . trim($senderid) . trim($message) . trim($deptSecureKey));\n $data = array(\n \"username\" => trim($username),\n \"password\" => trim($encryp_password),\n \"senderid\" => trim($senderid),\n \"content\" => trim($message),\n \"smsservicetype\" => \"bulkmsg\",\n \"bulkmobno\" => trim($mobileNos),\n \"key\" => trim($key)\n );\n post_to_url(\"https://msdgweb.mgov.gov.in/esms/sendsmsrequest\", $data); //calling post_to_url to send bulk sms \n}", "function &subscription_list($start=NULL, $limit=NULL, $direction=0, $where=NULL)\n\n {\n\n global $database, $user;\n\n \n\n\t $message_array = array();\n\n \n\n\t // MAKE SURE MESSAGES ARE ALLOWED\n\n\t $set_sql = \"select currency_sign from se_global_sms where id='1'\";\n\t $set_resource = $database->database_query($set_sql);\n $set_result = $database->database_fetch_assoc($set_resource);\n\t $currency_sign = $set_result[currency_sign];\n\n // BEGIN MESSAGE QUERY\n\n $sql = \"\n\n SELECT\n\n *\n\n FROM\n\n se_subscription\n\n \";\n\n // EXECUTE QUERY\n\n $resource = $database->database_query($sql);\n\n \n\n // GET MESSAGES\n\n\t while( $message_info=$database->database_fetch_assoc($resource) )\n\n {\n\n // CREATE AN OBJECT FOR MESSAGE AUTHOR/RECIPIENT\n\n $pm_user = new SEUser();\n\n $pm_user->user_info['sno'] = $message_info['sno'];\n\n $pm_user->user_info['text'] = $message_info['text'];\n\n $pm_user->user_info['value'] = $message_info['value'];\n\t\n\t $pm_user->user_info['sms_credit'] = $message_info['sms_credit'];\n\t \n $pm_user->user_displayname();\n\n \n\n // Remove breaks for preview\n\n $message_info['pm_body'] = str_replace(\"<br>\", \"\", $message_info['pm_body']);\n\n \n\n // SET MESSAGE ARRAY\n\n $message_array[] = array(\n\n 'pmconvo_sno' => $message_info['sno'],\n\t\t'pmconvo_destext' => $message_info['text'],\n 'pmconvo_text' => $message_info['text'].\" - \".$currency_sign.$message_info['value'].\" For \".$message_info['sms_credit'].\" SMS \",\n 'pm_value' => $message_info['value'],\n\t\t'pm_body' => $message_info['pm_body'] \n\n );\n\n \n\n unset($pm_user);\n\n }\n\n \n\n return $message_array;\n\n }", "function CreateNewReqest($data) {\n if ($data['keyword'] == \"CC\" || $data['keyword'] == \"CR\") {\n $this->CheckEmailRecord($data);\n }\n $res_array = array();\n $smpprequest = $this->Choices->find('all', array('conditions' => array('smpp_request' => $data['keyword'])))->toArray();\n $res_array['request_id'] = $this->RecordRequest($data, $smpprequest);\n if ($smpprequest[0]['is_chargable'] == \"Yes\") {\n $res_array['tid'] = $this->RecordTransaction($data, $smpprequest, $res_array['request_id']);\n $res_array['amount'] = $smpprequest[0]['amount'];\n }\n\n return $res_array;\n }", "function returnJsonPayload($contacts, $numRows)\n {\n $payload = array('NumRows' => $numRows, 'Contacts' => $contacts, 'Error' => '');\n echo json_encode($payload);\n }", "public function exchanegArray($_data)\n {\n $this->page_no = (int) gv('page_no', $_data);\n $this->category_no = (int) gv('category_no', $_data);\n $this->controller_no = (int) gv('controller_no', $_data);\n $this->page_title = (string) gv('page_title', $_data);\n $this->page_uri = (string) gv('page_uri', $_data);\n $this->page_description = (string) gv('page_description', $_data);\n $this->icon = (string) gv('icon', $_data);\n $this->order_no = (int) gv('order_no', $_data);\n $this->use_mobile = (int) gv('use_mobile', $_data);\n $this->update_time = (string) gv('update_time', $_data);\n }", "function get_number_info() {\n\n $CallSid = $_POST['fieldname'];\n $AccountSid=$_POST['fieldname'];\n $CallFrom=$_POST['fieldname'];\n $CallTo=$_POST['fieldname'];\n $CallStatus=$_POST['fieldname'];\n $ApiVersion=$_POST['fieldname'];\n $Direction=$_POST['fieldname'];\n\n if (isset($_POST['fieldname'])) {\n $FromCity=$_POST['fieldname'];\n $FromState=$_POST['fieldname'];\n $FromZip=$_POST['fieldname'];\n $FromCountry=$_POST['fieldname'];\n } else {\n $FromCity=\"\";\n $FromState=\"\";\n $FromZip=\"\";\n $FromCountry=\"\";\n }\n $ToCity=$_POST['fieldname'];\n $ToState=$_POST['fieldname'];\n $ToZip=$_POST['fieldname'];\n $ToCountry=$_POST['fieldname'];\n\n $vars = array($CallSid,$AccountSid,$CallFrom,$CallTo,$CallStatus,$ApiVersion,$Direction,$FromCity,$FromState,$FromZip,$FromCountry,$ToCity,$ToState,$ToZip,$ToCountry);\n return $vars;\n }", "public function sendToAll2($orderId, $trype, $suppliers, $delivery, $orderdata = null, $cart_id = null, $user_id = null) {\n $id_of_the_order = $orderId;\n $products_model = $this->loadModel('Products');\n $suppliers_model = $this->loadModel('Suppliers');\n $delivery_model = $this->loadModel('Delivery');\n $order_products_model = $this->loadModel('OrderProducts');\n $order_model = $this->loadModel('Orders');\n $order_products = $order_products_model->find('all', ['conditions' => ['order_id' => $orderId]])->toArray(); //for web, mobile\n $orderdata['product_name'] = array_map(create_function('$o', 'return $o->product_id;'), $order_products); //not name, ids\n $orderdata['product_supplier'] = array_map(create_function('$o', 'return $o->supplier_id;'), $order_products);\n $orderdata['product_quantity'] = array_map(create_function('$o', 'return $o->product_quantity;'), $order_products);\n\n /* print '<pre>';\n print_r($orderdata);\n echo '<br>';\n print_r($orderdata);\n echo '<br>';\n\n echo '<br>';\n die(); */\n\n\n //$countedval = $this->processdata ( $orderdata );//for erp\n $countedval = $this->processdata($orderdata); //web and mobile\n\n $sub_total = $countedval ['subTotal'];\n $total = $countedval ['total'];\n $tax = $countedval ['tax'];\n $discount = $countedval ['discount'];\n\n\n $total_string = \"<br><table border='1'><tr>\" . \"<th>Sub Total</th>\" . \"<td>\" . $sub_total . \"</td></tr>\" . \"<tr><th>Tax</th>\" . \"<td>\" . $tax . \"</td></tr>\" . \"<tr><th>Discount</th>\" . \"<td>\" . $discount . \"</td></tr>\" . \"<tr><th>Total</th>\" . \"<td>\" . $total . \"</td></tr>\" . \"</tr></table><br><hr>\";\n\n $orderId = \"<h4>Order ID: \" . $orderId . \"</h4>\";\n $sup_string = \"<hr><br><table border='1'>\" . \"<tr>\" .\n /* \"<th>#</th>\". */\n \"<th>Supplier Id</th>\" . \"<th>Supplier name</th>\" . \"<th>Address</th>\" . \"<th>City</th>\" .\n /* \"<th>Email</th>\". */\n \"<th>Contact No.</th>\" . \"<th>Mobile No.</th>\" . \"<th>Product Id</th>\" . \"<th>Product name</th>\" . \"<th>Product price</th>\" . \"<th>Package</th>\" . \"<th>Quantity</th>\" . \"<th>Ammount</th>\" . \"</tr>\";\n $sup_string_end = \"</table>\";\n $row = \"\";\n $supliers_email = [];\n $delivery_mail = [];\n $delivery_mail_string = $orderId . $sup_string;\n\n foreach ($suppliers as $suplier) {\n $count = 1;\n $sup_email = \"\";\n for ($i = 0; $i < sizeof($orderdata ['product_name']); $i ++) {\n if ($suplier == $orderdata ['product_supplier'] [$i]) {\n $product_details = $products_model->get($orderdata ['product_name'] [$i], [\n 'contain' => [\n 'packageType'\n ]\n ]);\n $quntity = $orderdata ['product_quantity'] [$i];\n $supplier_details = $suppliers_model->get($orderdata ['product_supplier'] [$i], [\n 'contain' => 'city'\n ]);\n\n $row .= \"<tr style='min-height:35px'>\";\n $colspan = 1;\n if ($count == 1) {\n\n /* $row.=\"<td rowspan='2'>\".($i+1).\"</td>\"; */\n\n $row .= \"<td rowspan='\" . $colspan . \"'>\" . $supplier_details->id . \"</td>\"; // price for the orderd quantity\n $row .= \"<td rowspan='\" . $colspan . \"'>\" . $supplier_details->firstName . \" \" . $supplier_details->lastName . \"</td>\"; // name\n $row .= \"<td rowspan='\" . $colspan . \"'>\" . $supplier_details->address . \"</td>\"; // address\n $row .= \"<td rowspan='\" . $colspan . \"'>\" . $supplier_details->cid->cname . \"</td>\"; // city\n /* $row.=\"<td>\".$supplier_details->email.\"</td>\";//email */\n $row .= \"<td rowspan='\" . $colspan . \"'>\" . $supplier_details->contactNo . \"</td>\"; // contact\n $row .= \"<td rowspan='\" . $colspan . \"'>\" . $supplier_details->mobileNo . \"</td>\"; // mobile\n $sup_email = $supplier_details->email;\n } else {\n $row .= \"<td></td><td></td><td></td><td></td><td></td><td></td>\";\n }\n\n $row .= \"<td>\" . $product_details->id . \"</td>\"; // product id\n $row .= \"<td>\" . $product_details->name . \"</td>\"; // name\n $row .= \"<td>\" . $product_details->price . \"</td>\"; // price of a unit\n $row .= \"<td>\" . $product_details->package_type->type . \"</td>\"; // unit\n $row .= \"<td>\" . $quntity . \"</td>\"; // number of unit ordered\n $row .= \"<td>\" . $product_details->price * $quntity . \"</td>\"; // price for the orderd quantity\n\n $row .= \"</tr>\";\n\n $count ++;\n }\n }\n $colspan = $count;\n $delivery_mail_string .= $row;\n $supliers_email [$sup_email] = $orderId . $sup_string . $row . $sup_string_end;\n $row = \"\";\n }\n $delivery_mail_string .= $sup_string_end . $total_string;\n $delivery_mail_addrrss = $delivery_model->get($delivery, [\n 'fields' => [\n 'email'\n ]\n ]);\n // echo $delivery_mail_addrrss['email'];\n // \n $admin_mail_address = Configure::read('admin_email');\n //$customer=$order_model->find('all',['conditions'=>['Orders.id'=>$orderId],'contain'=>['Customers']])->first();\t\t\n //$customer_mail_address=$customer->customers['email'];//\"[email protected]\"\n //$customer_mail_address=\"[email protected]\";\n $order_data = (new OrdersController ())->__getOrderMailData($id_of_the_order);\n\n $user = $this->Cart->Users->get($user_id);\n $customer_mail [$user->username] = $order_data;\n //$customer_mail [$this->Auth->user('username')] = $order_data;\n $admin_mail [$admin_mail_address] = $order_data;\n $delivery_mail [$delivery_mail_addrrss ['email']] = $delivery_mail_string;\n\n\n /*\n * print_r($emails[4]);\n * print_r($emails[3]);\n * echo $delivery_mail_string;\n * die();\n */\n /*\n * print '<pre>';\n *\n * print_r(['del'=>$delivery_mail,'sup'=>$supliers_email]);\n * die();\n */\n\n // return ['del'=>$delivery_mail,'sup'=>$supliers_email];\n /*\n * print_r($supliers_email);\n * print_r($delivery_mail);\n */\n /* \tprint '<pre>';\n print_r($supliers_email);\n echo \"<br>\";\n print_r($delivery_mail);\n echo \"<br>\";\n print_r($admin_mail);echo \"<br>\";\n print_r($customer_mail);\n die(); */\n\n //$this->sendemail('new', $supliers_email, 'sup'); // suppliers email\n $this->sendemail('new', $delivery_mail, 'del'); // delivery email\n $this->sendemail2('new', $admin_mail, 'admin'); // delivery email\n $this->sendemail2('new', $customer_mail, 'cus'); // delivery email\n // die();\n }", "function add_quick_contact() {\n\t\t$user_id = $_POST['user_id'];\n\t\t$contact_list = $_POST['user_contacts'];\n\t\t$contact_name = $_POST['user_name'];\n\t\tif (!empty($contact_list) && !empty($user_id)) {\n\t\t\tfor ($i = 0; $i < count($contact_list); $i++) {\n\t\t\t\t$contact = $_POST['user_contacts'][$i];\n\t\t\t\t$contactname = $_POST['user_name'][$i];\n\t\t\t\t$add_contacts = $this -> conn -> insertnewrecords('quick_contacts', 'quick_contact_user_id, quick_contacts_name,quick_contacts_number', '\"' . $user_id . '\",\"' . $contactname . '\",\"' . $contact . '\"');\n\t\t\t\tif (!empty($add_contacts)) {\n\t\t\t\t\t$posts[] = array(\"user_contacts\" => $_POST['user_contacts'][$i], \"user_name\" => $_POST['user_name'][$i]);\n\t\t\t\t} else {\n\t\t\t\t\t$posts = array('status' => \"false\", \"message\" => \"Error in adding contacts\");\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t$post = array('status' => 'true', 'quick_contacts' => $posts);\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing parameter\", 'user_id' => $user_id, 'contacts' => $contact_list);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function count_post()\n{\n $pdata = file_get_contents(\"php://input\");\n $data = json_decode($pdata,true);\n\n // if(isset($data['company_id']))\n // {\n // $id = $data['company_id'];\n // }\n\n $totalCustomer = $this->model->getcount('users', array(\n 'user_role' => '2'));\n $todayOrders = $this->model->getcount('orders', array(\n 'DATE(created_at)' => date('Y-m-d')));\n $order_list = $this->model->GetJoinRecord('orders', 'user_id', 'users', 'id', 'COUNT(orders.id) as total_orders',array('orders.id!='=>'0'));\n\n $totalOrders = !empty($order_list) ? $order_list[0]->total_orders : 0;\n $pending_order = $this->model->getcount('orders',array('status='=>'placed'));\n $delivered_order = $this->model->getcount('orders',array('status='=>'delivered'));\n $cancel_order = $this->model->getcount('orders',array('status='=>'Cancel'));\n $processing_order = $this->model->getcount('orders',array('status='=>'Progress'));\n $dispatch_order = $this->model->getcount('orders',array('status='=>'Dispatched'));\n \n $resp = array(\n 'rccode' => 200,\n 'message' =>'success',\n 'total_customer' =>$totalCustomer,\n 'today_order' =>$todayOrders,\n 'total_order' => $totalOrders,\n 'pending_order' => $pending_order,\n 'delivered' =>$delivered_order,\n 'Cancel' => $cancel_order,\n 'Packing' => $processing_order,\n 'shipping' => $dispatch_order\n );\n$this->response($resp);\n}", "protected function makeData()\n {\n return Arr::collapse([\n $this->template->getQueryData(),\n [\n 'apiKey' => $this->apiKey,\n 'to' => implode(', ', (array) $this->getRecipientEmails())\n ]\n ]);\n }", "private function saveSmsData(){\n\t$arrSmsData = array();\n\t$status = explode('#', $this->returnMessageFromapi);\n\t$this->messageId = $status[0];\n\t$this->messageStatusText = $status[1];\n\t// prepare Data To save in to Data base;\n\t$arrSmsData = array(\n\t'to'=>$this->msisdn,\n\t'message'=>$this->message,\n\t'sendtime'=>date('Y-m-d H:i:s', time()),\n\t'messageId'=>$this->messageId,\n\t'messagestatustext'=>$this->messageStatusText,\n\t//'messagestatus'=>$this->delieverStatusReport(),\n\t'customer_id'=>($_SESSION['customer_id'])?$_SESSION['customer_id']:'0'\n\t);\n\treturn $arrSmsData;\n}", "function createContact($sfConn, $dataArray){\n\t\techo(\"<P> createContact <P>\");\n $sObjects = array();\n foreach ($dataArray as $fieldset)\n {\n\t\techo(\"<P> Set records to Contact <P>\");\n $sObject = new sObject();\n $sObject->type = 'Contact'; \n $sObject->fields = $fieldset;\n array_push($sObjects, $sObject);\n }\n\t\techo(\"<P> Ready to roll <P>\");\n $success = create_multiple($sfConn, $sObjects);\n return $success; \n }", "protected function _find_contacts( $data )\n { \n if( !is_array($data) ) {\n $this->_sendResponse(200, array(\"code\"=>'0','data'=>$data,'message'=>\"This functionality is not yet implemented.\"));\n }\n \n $friends = array();\n $tt_friends = array();\n $emailsString = '';\n $phonesString = '';\n foreach( $data as $contact ) {\n \n if(isset($contact['e']) && !empty ($contact['e'])) {\n $emailsString .= implode('\",\"', $contact['e']) . '\",\"';\n }\n \n $clean_numbers = array();\n foreach($contact['p'] as $number) {\n $clean_numbers[] = Users::strip_format($number);\n }\n $phonesString .= implode('\",\"', $clean_numbers) . '\",\"';\n } \n \n $emailsString = rtrim($emailsString, \"\\\"\\\",\");\n $phonesString = rtrim($phonesString, \"\\\"\\\",\");\n \n $result = array();\n \n $pairedCount = 0;\n $results = Users::find_by_emails_phones( $emailsString , $phonesString);\n \n if($results) \n foreach($results as $value) {\n\n if( isset( $value['person_id'] ) ) {\n $result['person_id'] = intval( $value['person_id'] );\n }\n if( isset( $value['user_id'] ) ) {\n $result['user_id'] = intval( $value['user_id'] );\n }\n\n if( !is_null( $result['user_id'] ) ) \n {\n if(self::$user->checkAndCreateContact($result[\"user_id\"])) {\n /*\n * @todo send push notification to paired user\n */\n $devices = Devices::model()->findAll( array('condition' => \n 'push_token!=\"\" AND push_token IS NOT NULL\n AND user_id=' . $result[\"user_id\"] ) );\n \n $alert = self::$user->person->first_name.\" is now your friend.\";\n\n $extra = array(\n \"action\" => 'friend',\n );\n\n $badge = Messages::get_unread_message_count($result[\"user_id\"]);\n PUSH::send($devices, $alert, $extra, $badge);\n $pairedCount ++;\n }\n $tt_friends[] = $result; \n } else {\n $friends[] = $result;\n }\n }\n \n return $pairedCount;\n }", "public function index(){\n\n\t\t$viewDataController = new ViewDataController();\n\t\t$data = $viewDataController->buildData();\n\n\t\tif( isset($data['profile_img_loc']) ){\n\t\t\t$data['profile_img_loc'] = 'https://s3-us-west-2.amazonaws.com/asset.plexuss.com/users/images/'.$data['profile_img_loc'];\n\t\t}\n\n\t\tif( $data['is_agency'] == 1 ){\n\t\t\t$type = 'agency';\n\t\t}else{\n\t\t\t$type = 'admin';\n\n $is_admin_premium = $this->validateAdminPremium();\n\n if (!$is_admin_premium) {\n return redirect( '/admin/premium-plan-request' );\n }\n\t\t}\n\n\t\t$data['title'] = 'Group Messaging';\n\t\t$data['currentPage'] = $type.'-groupmsg';\n\t\t$data['adminType'] = $type;\n\n\t\t//student list generated from approval page for group messaging\n\t\t$data['student_list'] = array();\n\t\t$data['student_count'] = 0;\n\t\t$data['campaign_count'] = 0;\n\n\t\tif( Cache::has(env('ENVIRONMENT').'_'.$data['user_id'].'_studentList') ){\n\t\t\t$data['student_list'] = Cache::pull(env('ENVIRONMENT').'_'.$data['user_id'].'_studentList');\n\t\t\t$data['student_count'] = count($data['student_list']);\n\t\t\t// var_dump($data['student_list']);\n\t\t\t// dd($data['student_count']);\n\t\t}\n\n\t\t// $user_id_arr = '';\n\t\t// foreach ($data['student_list'] as $key) {\n\n\t\t// \tif (isset($key['id'])) {\n\t\t// \t\t$user_id_arr .= Crypt::decrypt($key['id']).\",\";\n\t\t// \t}\n\t\t// \tif (isset($key['user_id'])) {\n\t\t// \t\t$user_id_arr .= Crypt::decrypt($key['user_id']).\",\";\n\t\t// \t}\t\t\n\n\t\t// }\n\n\t\t// $data['recipients'] = array();\n\n\t\t// if ($user_id_arr !='') {\n\t\t// \t$tmp = $this->getRecipientName($data, $user_id_arr);\n\n\t\t// \tforeach ($tmp as $key) {\n\t\t// \t\t$arr = array();\n\t\t// \t\t$arr['user_id'] = Crypt::encrypt($key['user_id']);\n\t\t// \t\t$arr['fname'] = $key['fname'];\n\t\t// \t\t$arr['lname'] = $key['lname'];\n\t\t// \t\t$arr['json'] = json_encode($key);\n\t\t// \t\t$arr['json'] = str_replace(\"'\", \"&lsquo;\", $key);\n\t\t// \t\t$arr['json'] = json_encode($arr['json']);\n\n\t\t// \t\t$data['recipients'][] = $arr;\n\t\t// \t}\n\n\t\t// }\n\t\t// generate list of campaigns\n\t\t$data = $this->generateListOfCampaigns($data, 0);\n\n\t\t//get templates\n\t\t$data = $this->getMessageTemplates($data);\n\n\t\t$org = new Organization;\n\t\t$org = $org->getThisOrgInfo($data['org_branch_id']);\n\t\t$this_org_user_ids = array();\n\t\tforeach ($org as $key) {\n\t\t\t$this_org_user_ids[] = $key->user_id;\n\t\t}\n\n\t\t$cmt = new CollegeMessageThreads;\n\t\t$data['total_num_campaign_messages'] = $cmt->getTotalNumOfCampaignMessages($data['tmp_campaign_ids'], $this_org_user_ids);\n\t\t$data['total_num_campaign_read_messages'] = $cmt->getTotalNumOfCampaignReadMessages($data['tmp_campaign_ids'], $this_org_user_ids);\n\t\t$data['total_num_campaign_replied_messages'] = $cmt->getTotalNumOfCampaignRepliedMessages($data['tmp_campaign_ids'], $this_org_user_ids);\n\t\t$data['read_response_rate'] = isset($data['total_num_campaign_messages']) && $data['total_num_campaign_messages'] > 0 ? number_format(($data['total_num_campaign_read_messages']/ $data['total_num_campaign_messages']) * 100, 2) : 0;\n\t\t$data['replied_response_rate'] = isset($data['total_num_campaign_messages']) && $data['total_num_campaign_messages'] > 0 ? number_format(($data['total_num_campaign_replied_messages']/ $data['total_num_campaign_messages']) * 100, 2) : 0;\n\n\t\t$data['total_num_campaign_messages'] = number_format($data['total_num_campaign_messages']);\n\t\t$data['total_num_campaign_read_messages'] = number_format($data['total_num_campaign_read_messages']);\n\t\t$data['total_num_campaign_replied_messages'] = number_format($data['total_num_campaign_replied_messages']);\n\t\t\n\t\t$ob = OrganizationBranch::on('rds1')->where('id', $data['org_branch_id'])\n\t\t\t\t\t\t\t\t\t\t\t->select('pending_auto_campaign', 'handshake_auto_campaign')\n\t\t\t\t\t\t\t\t\t\t\t->first();\n\n\t\t$data['pending_auto_campaign'] = $ob->pending_auto_campaign == 1 ? true : false;\n\t\t$data['handshake_auto_campaign'] = $ob->handshake_auto_campaign == 1 ? true : false;\n\n\n\t\t// echo \"<pre>\";\n\t\t// print_r($data);\n\t\t// echo \"</pre>\";\n\t\t// exit();\n\t\t// dd($data['campaigns']);\n\n\t\treturn View('groupMessaging.index', $data);\n\t}", "public function displayAjax()\n\t{\n\t\t// -------------------------\n\t\t$guid_import = (string)Tools::getValue('guid_import');\n\t\tif (empty($guid_import))\n\t\t\tdie('ended');\n\n\t\t// Get a bloc of 500 customers (formated)\n\t\t// --------------------------------------\n\t\t$req = new DbQuery();\n\t\t$req->select('*');\n\t\t$req->from('expressmailing_sms_recipients');\n\t\t$req->where('campaign_id = '.$this->campaign_id);\n\t\t$req->where('uploaded = \\'0\\'');\n\t\t$req->limit(1500);\n\n\t\t$recipients_list = Db::getInstance()->executeS($req, true, false);\n\n\t\tif (count($recipients_list) == 0)\n\t\t\tdie($this->finalizeImport($guid_import));\n\n\t\t$uploaded_id = array ();\n\t\t$formated_recipients = array ();\n\n\t\tforeach ($recipients_list as $recipient)\n\t\t{\n\t\t\t$uploaded_id[] = (int)$recipient['id'];\n\t\t\t$data = array ('Target' => $recipient['target']);\n\n\t\t\tif (!empty($recipient['col_0']))\n\t\t\t\t$data['Col_0'] = $recipient['col_0'];\n\t\t\tif (!empty($recipient['col_1']))\n\t\t\t\t$data['Col_1'] = $recipient['col_1'];\n\t\t\tif (!empty($recipient['col_2']))\n\t\t\t\t$data['Col_2'] = $recipient['col_2'];\n\t\t\tif (!empty($recipient['col_3']))\n\t\t\t\t$data['Col_3'] = $recipient['col_3'];\n\t\t\tif (!empty($recipient['col_4']))\n\t\t\t\t$data['Col_4'] = $recipient['col_4'];\n\t\t\tif (!empty($recipient['col_5']))\n\t\t\t\t$data['Col_5'] = $recipient['col_5'];\n\t\t\tif (!empty($recipient['col_6']))\n\t\t\t\t$data['Col_6'] = $recipient['col_6'];\n\t\t\tif (!empty($recipient['col_7']))\n\t\t\t\t$data['Col_7'] = $recipient['col_7'];\n\t\t\tif (!empty($recipient['col_8']))\n\t\t\t\t$data['Col_8'] = $recipient['col_8'];\n\t\t\tif (!empty($recipient['col_9']))\n\t\t\t\t$data['Col_9'] = $recipient['col_9'];\n\t\t\tif (!empty($recipient['col_10']))\n\t\t\t\t$data['Col_10'] = $recipient['col_10'];\n\t\t\tif (!empty($recipient['col_11']))\n\t\t\t\t$data['Col_11'] = $recipient['col_11'];\n\t\t\tif (!empty($recipient['col_12']))\n\t\t\t\t$data['Col_12'] = $recipient['col_12'];\n\t\t\tif (!empty($recipient['col_13']))\n\t\t\t\t$data['Col_13'] = $recipient['col_13'];\n\t\t\tif (!empty($recipient['col_14']))\n\t\t\t\t$data['Col_14'] = $recipient['col_14'];\n\t\t\tif (!empty($recipient['col_15']))\n\t\t\t\t$data['Col_15'] = $recipient['col_15'];\n\t\t\tif (!empty($recipient['col_16']))\n\t\t\t\t$data['Col_16'] = $recipient['col_16'];\n\t\t\tif (!empty($recipient['col_17']))\n\t\t\t\t$data['Col_17'] = $recipient['col_17'];\n\t\t\tif (!empty($recipient['col_18']))\n\t\t\t\t$data['Col_18'] = $recipient['col_18'];\n\t\t\tif (!empty($recipient['col_19']))\n\t\t\t\t$data['Col_19'] = $recipient['col_19'];\n\n\t\t\t$formated_recipients[] = $data;\n\t\t}\n\n\t\t// Upload the bloc\n\t\t// ---------------\n\t\t$response_array = array ();\n\t\t$parameters = array (\n\t\t\t'operation' => $guid_import,\n\t\t\t'recipients' => $formated_recipients\n\t\t);\n\n\t\tif ($this->session_api->call('sms', 'campaign', 'sendpart_recipients_from_file', $parameters, $response_array))\n\t\t{\n\t\t\t// Mark as uploaded the recipients treated\n\t\t\t// ---------------------------------------\n\t\t\tif (Db::getInstance()->update('expressmailing_sms_recipients', array (\n\t\t\t\t\t'uploaded' => '1'\n\t\t\t\t\t), 'campaign_id = '.$this->campaign_id.' AND id IN ('.join(',', $uploaded_id).')', 0, false, false\n\t\t\t\t))\n\t\t\t\tdie('continue');\n\n\t\t\techo Db::getInstance()->getMsgError();\n\t\t}\n\n\t\t// Return the error to the AJAX process\n\t\t// ------------------------------------\n\t\tdie(sprintf($this->module->l('Error during communication with Express-Mailing API : %s', 'adminmarketingsstep5'), $this->session_api->getError()));\n\t}", "private function dataInit($data) {\n\n\t\t\t//Default From\n\t\t\t$data['from']\t\t= empty($data['from']) ? $this->default['from'] : $data['from'];\n\t\t\t$data['complaint']\t= empty($data['complaint']) ? $this->default['returnPath'] : $data['complaint'];\n\t\t\t$data['reply']\t\t= empty($data['reply']) ? array($this->default['returnPath']) : $data['reply'];\n\t\t\t$data['cc']\t\t\t= empty($data['cc']) ? array() : $data['cc'];\n\t\t\t$data['bcc']\t\t= empty($data['bcc']) ? array() : $data['bcc'];\n\t\t\treturn $data;\n\t\t}", "public function add_contact($data)\n {\n $aid = false;\n\n $add = array();\n foreach (array(\n 'nick' => '\"\"', 'firstname' => '\"\"', 'lastname' => '\"\"', 'thirdname' => '\"\"',\n 'title' => '\"\"', 'company' => '\"\"', 'comp_dep' => '\"\"', 'comp_role' => '\"\"',\n 'comp_address' => '\"\"', 'comp_address2' => '\"\"', 'comp_street' => '\"\"',\n 'comp_zip' => '\"\"', 'comp_cellular' => '\"\"', 'comp_www' => '\"\"',\n 'comp_fax' => '\"\"', 'comp_location' => '\"\"', 'comp_region' => '\"\"',\n 'comp_country' => '\"\"', 'address' => '\"\"', 'address2' => '\"\"',\n 'street' => '\"\"', 'zip' => '\"\"', 'location' => '\"\"', 'region' => '\"\"',\n 'country' => '\"\"', 'email1' => '\"\"', 'email2' => '\"\"', 'bday_cal_evt_id' => 'NULL',\n 'tel_private' => '\"\"', 'tel_business' => '\"\"','cellular' => '\"\"', 'fax' => '\"\"', 'www' => '\"\"',\n 'birthday' => '\"\"', 'customer_number' => '\"\"', 'comments' => '\"\"') as $k => $v) {\n $add[] = (isset($data[$k])) ? $k.'=\"'.$this->esc($data[$k]).'\"' : $k.'='.$v;\n }\n if (!empty($add)) {\n $add[] = 'owner='.$this->uid;\n if ($this->query('INSERT '.$this->Tbl['adb_address'].' SET `uuid`=\"'.basics::uuid().'\",' . implode(',', $add))) {\n $aid = $this->insertid();\n if (isset($data['group']) && !empty($data['group'])) {\n foreach ($data['group'] as $gid) {\n $this->query('INSERT '.$this->Tbl['adb_adr_group'].' SET `aid`='.$aid.', `gid`='.intval($gid).', `uid`='.intval($this->uid));\n }\n }\n }\n }\n if (!empty($aid) && !empty($data['free'])) {\n foreach ($data['free'] as $type => $value) {\n $this->query('INSERT '.$this->Tbl['adb_freefield'].' SET `aid`='.$aid.', `type_id`='.intval($type).', `value`=\"'.$this->esc($value).'\"');\n }\n }\n\n return $aid;\n }", "function &user_addressbook_list($start=NULL, $limit=NULL, $direction=0, $where=NULL)\n\n {\n\n global $database, $user;\n\n \n\n\t $message_array = array();\n\n \n\n\t // MAKE SURE MESSAGES ARE ALLOWED\n\n\t \n\n \n\n // BEGIN MESSAGE QUERY\n\n $sql = \"\n\n SELECT\n\n *\n\n FROM\n\n se_addressbook\n\n WHERE\n\n se_addressbook.owner='{$user->user_info['user_username']}'\n\n \";\n\n // EXECUTE QUERY\n\n $resource = $database->database_query($sql);\n\n \n\n // GET MESSAGES\n\n\t while( $message_info=$database->database_fetch_assoc($resource) )\n\n {\n\n // CREATE AN OBJECT FOR MESSAGE AUTHOR/RECIPIENT\n\n $pm_user = new SEUser();\n\n $pm_user->user_info['id'] = $message_info['id'];\n\n $pm_user->user_info['nickname'] = $message_info['nickname'];\n\n $pm_user->user_info['full_name'] = $message_info['first'].\" \".$message_info['last'];\n\n $pm_user->user_info['email'] = $message_info['email'];\n\n $pm_user->user_info['phone'] = $message_info['phone'];\n $pm_user->user_info['grup '] = $message_info['grup'];\n $pm_user->user_displayname();\n\n \n\n // Remove breaks for preview\n\n $message_info['pm_body'] = str_replace(\"<br>\", \"\", $message_info['pm_body']);\n\n \n\n // SET MESSAGE ARRAY\n\n $message_array[] = array(\n\n 'pmconvo_id' => $message_info['id'],\n\n 'pmconvo_nickname' => $message_info['nickname'],\n\n 'pm_fullname' => $message_info['first'].\" \".$message_info['last'],\n\n 'pm_email' => $message_info['email'],\n\t\t 'pm_body' => $message_info['pm_body'],\n 'pm_grup' => $message_info['grup'],\n 'pm_replied' => $message_info['phone']\n\n );\n\n \n\n unset($pm_user);\n\n }\n\n \n\n return $message_array;\n\n }", "public function get_contactus_details() {\r\n $data=$this->Adminusermodel->get_contactus_details();\r\n if(!empty($data)){\r\n foreach($data as $key => $value)\r\n {\r\n $data[$key] = (array) $value;\r\n }\r\n $data=array('contactus'=>$data);\r\n }\r\n //print_r($data);\r\n $this->load->view('contactus_view',$data);\r\n //print_r($data);\r\n }", "public function contactUs($data) {\n $name = $data[0];\n $email = $data[1];\n $phone=$data[2];\n $question = $data[3];\n $this->Email->from(array($email => $name));\n $this->Email->bcc(array($this->concierge => 'Concierge'));\n $this->Email->to(Configure::read('Email.contact'));\n $this->Email->emailFormat('both');\n $this->Email->subject('New message from Contact');\n $this->Email->template('contactUs');\n $this->Email->viewVars(array('messageData' => $data));\n return $this->Email->send();\n }", "protected function prepare_data() {\n\t\t$data = array();\n\n\t\t$data['From'] = $this->sender;\n\t\t\n\t\tif (!is_null($this->reply_to)) {\n\t\t\t$data['ReplyTo'] = $this->reply_to;\n\t\t}\n\n\t\t$data['To'] = $this->recipient;\n\n\t\tif (!empty($this->cc)) {\n\t\t\t$data['Cc'] = implode(',', $this->cc);\n\t\t}\n\n\t\tif (!empty($this->bcc)) {\n\t\t\t$data['Bcc'] = implode(',', $this->bcc);\n\t\t}\n\n\t\t$data['Subject'] = $this->subject;\n\n\t\tif (!empty($this->tags)) {\n\t\t\t$data['Tag'] = $this->tags[0];\n\t\t}\n\n switch ($this->content_type) {\n case 'multipart/mixed':\n $data['HtmlBody'] = $this->message;\n $data['TextBody'] = (!empty($this->alt_message)) ? $this->alt_message : strip_tags($this->message);\n break;\n case 'text/html':\n $data['HtmlBody'] = $this->message;\n break;\n case 'text/plain':\n $data['TextBody'] = $this->message;\n break;\n default:\n throw new Exception('Failed to send email because mime type is unknown.');\n break;\n }\n\n if (!empty($this->attachments)) {\n $data['Attachments'] = $this->attachments;\n }\n\n\t\treturn $data;\n\t}", "public function buildAddParams() {\n\t\t$lang = \\Lib\\Registry::getInstance()->get('lang');\n\t\t// get user id from session\n\t\t$params['uid'] = $uid = \\Lib\\session::get('uid');\n\t\t$GLOBALS['appLog']->log('uid: ' . $uid, \\Lib\\appLogger::INFO, __METHOD__);\n\n\t\t$c = array();\n\t\tforeach($_POST as $key => $value) {\n\t\t\tif ($key != 'submit')\n\t\t\t\t$c[$key] = $value; // put profile data in another array\n\t\t}\n\n\t\t$c['userid'] = $uid;\n\t\t$GLOBALS['appLog']->log('$c : ' . print_r($c,1), \\Lib\\appLogger::INFO, __METHOD__);\n\n\t\t$errorMessages = $this->validateFields($c);\n\n\t\tif (count($errorMessages) == 0)\n\t\t{\n\t\t\t$this->contactdoa->insertData($c);\n\t\t\t$GLOBALS['appLog']->log('New Contact was added', \\Lib\\appLogger::INFO, __METHOD__);\n\t\t\t$status = $this->consts['successful'];\n\t\t\t$displayMsg = $lang['CONTACTADDED'];\n\t\t\t$c = array(); // clear the contact data so blank form will be displayed to user\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$GLOBALS['appLog']->log('error messages to display', \\Lib\\appLogger::INFO, __METHOD__);\n\t\t\t$status = $this->consts['errors'];\n\t\t\t$displayMsg = $errorMessages;\n\t\t}\n\n\t\t$params = array(\n\t\t\t\t'lang' => $lang,\n\t\t\t\t'consts' => $this->consts,\n\t\t\t\t'submit' => $_POST['submit'],\n\t\t\t\t'action' => $this->consts['add'],\n\t\t\t\t'status' => $status,\n\t\t\t\t'displayMsg' => $displayMsg,\n\t\t\t\t'contactData' => $c \n\t\t\t\t);\n\t\treturn $params;\n\t}", "public function store(Request $request)\n {\n\n\n\n\n$this->validate($request,[\n\n'message'=>'required'\n\n\n ]);\n\n\n\n\n\n// $this->validate($request,[\n\n// 'message'=>'required'\n\n// ]);\n\n $theme=$request->get('theme');\n $contacts=$request->get('contact');\n\n $lists=$request->get('list');\n $subject=$request->get('subject');\n\n\n\n$m=$request->get('message');\n$to=$request->get('to');\n\n $user=[];\n $listacc=[];\n if(!empty($contacts))\n\n {\n\n foreach ($contacts as $contact) {\n\n\n $user[]=$contact;\n\n\n }\n\n\n\n }\nif(!empty($to)){\n\n\n$user[]=$to;\n\n\n}\n\n\nif(!empty($lists)){\n\nforeach ($lists as $key => $list) {\n $listacc[]=$list;\n\n\n\n}\n\n\n\n}\n\n\n\n\nforeach($listacc as $key=>$list){\n\n//echo $list.\"<br/>\";\n\n$real=Lists::where('l_name',$list)->first();\n//print_r($real);\n\n\n\n\n// echo \"<br/>\";\n\n \n\n\n// echo \"<br/>\";\n//echo(\"----------------------------------------\");\n\n\nforeach($real->contacts as $ll){\n\n\n\n\n //echo $ll->c_mail;\n$user[]=$ll->c_mail;\n\n //echo \"<br/>\";\n}\n}\n\n//echo\"all users<br/>\";\n// foreach($user as $l){\n\n\n// echo $l;\n// echo \"<br>\";\n\n// }\n\n// echo $message.\"---\".$subject;\n\n// // }\n\n\n\n\nif(!empty($m) and !empty($user)){\n\n Mail::send('template.mail', ['m'=>$m,'subject'=>$subject,'user'=>$user], function ($message) use ($subject,$m,$user) {\n $message->from(\"[email protected]\", \"Cayshly Trading Network\");\n\n $message->to($user)->subject($subject);\n });\n\n\n\nfor ($i=0;$i<count($user);$i++) {\n # code...\n\nMails::create([\n\n\"person\"=>$user[$i],\n\"subject\"=>$subject,\n\"message\"=>$m,\n\"theme\"=>$theme\n\n\n\n\n\n ]);\n}//end foreach\n\n\nreturn redirect('mail');\n}else {\n echo '<script>';\necho 'alert(\"you must choose at least one contact\")';\necho '</script>';\n}\n\n// \n\n// }\n\n\n// if(!empty($user)){\n\n\n\n// foreach ($user as $key => $value) {\n\n\n\n// $data=['message'=>$message];\n\n\n// Mail::send('template.mail', ['message'=>$message], function($message) use($data) {\n\n// $message->from('[email protected]',\"cayshly\");\n// $message->to(\"[email protected]\")->subject('Welcome!');\n// });\n\n\n\n\n\n// }\n\n\n\n\n \n// }\n\n\n\n\n\n\n\n// return redirect('mail');\n\n\n\n\n\n\n//return dd($listacc);\n \n }", "function sendnow() {\n \t\t\n \t\tset_time_limit(0);\n \t\tini_set('memory_limit', '256M');\n \t\t\n \t\t$this->checkAccess('bulksms');\n \t\t\n \t\tif(isset($this->data)) {\n \t\t\t\n \t\t\tif(BULK_SMS_SERVER_DOWN) {\n \t\t\t\t$error[] = UNAVAILABLE_MESSAGE;\n \t\t\t}\n\n\t\t\tif($this->data['type'] && NINE_TO_NINE_ACTIVATED) {\n\t \t\t\t$error[] = NINE_TO_NINE_ACTIVATED_MESSAGE;\n\t \t\t}\t\t\t\n \t\t\t\n \t\t\t// Sender ID is optional\n \t\t\tif(isset($this->data['bulk_senderid_id'])) $bulk_senderid_id = filter_var(trim($this->data['bulk_senderid_id']), FILTER_VALIDATE_INT);\n \t\t\telse $bulk_senderid_id = 0;\n \t\t\t\n \t\t\t$bulk_group_id = filter_var(trim($this->data['bulk_group_id']), FILTER_VALIDATE_INT);\n \t\t\t$bulk_tag_id = filter_var(trim($this->data['bulk_tag_id']), FILTER_VALIDATE_INT);\n \t\t\t$message = urldecode(trim($this->data['message']));\n \t\t\t$number = filter_var(trim($this->data['number']), FILTER_SANITIZE_STRING);\n \t\t\t$day = filter_var(trim($this->data['day']), FILTER_VALIDATE_INT);\n \t\t\t$month = filter_var(trim($this->data['month']), FILTER_VALIDATE_INT);\n \t\t\t$year = filter_var(trim($this->data['year']), FILTER_VALIDATE_INT);\n \t\t\t$hours = filter_var(trim($this->data['hours']), FILTER_VALIDATE_INT);\n \t\t\t$minutes = filter_var(trim($this->data['minutes']), FILTER_VALIDATE_INT);\n \t\t\t\n \t\t\t/*\tCorrect Encoding\t*/\n \t\t\t$message = iconv('UTF-8', 'ASCII//TRANSLIT', $message);\n \t\t\t\n \t\t\tif(empty($message)) $error[] = 'Message Cannot Be Empty';\n \t\t\t//if(empty($bulk_group_id)) $error[] = 'Invalid Group';\n \t\t\t//if(empty($bulk_tag_id)) $error[] = 'Invalid Tag';\n \t\t\t\n \t\t\t$n = 0;\n \t\t\tif(empty($number) && empty($bulk_group_id)) $error[] = 'Enter Mobile Numbers or select a Group';\n \t\t\telse {\n \t\t\t\tif(!empty($number)) {\n \t\t\t\t\t$n = explode(',', $number);\n \t\t\t\t\t$n = array_filter($n);\n \t\t\t\t\tforeach($n as $k => $v) {\n \t\t\t\t\t\t$v = trim($v);\n \t\t\t\t\t\tif(!$this->checkNumber($v)) $inv_num[] = $v;\n \t\t\t\t\t\t$new_n[] = $v; \n \t\t\t\t\t}\n \t\t\t\t\t$n = $new_n;\n \t\t\t\t\tif(isset($inv_num)) $error[] = 'Invalid Mobile Number(s) '.implode(',', $inv_num);\n \t\t\t\t\t\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif(!empty($bulk_group_id) && !$this->checkBulkGroupId($bulk_group_id)) $error[] = 'Invalid Group ID';\n\n \t\t\t}\n \t\t\t\n \t\t\tif(!empty($bulk_senderid_id) && !$this->checkBulkSenderId($bulk_senderid_id)) $error[] = 'Invalid Sender ID';\n \t\t\t//if(!$this->checkBulkGroupId($bulk_group_id)) $error[] = 'Invalid Group ID';\n \t\t\tif(!$this->checkBulkTagId($bulk_tag_id)) $error[] = 'Invalid Tag ID';\n \t\t\t\n \t\t\t//check if the group empty or not\n \t\t\tif(!empty($bulk_group_id)) {\n\t \t\t\t$c['BulkAddressbook.bulk_group_id'] = $bulk_group_id;\n\t \t\t\t$c['BulkAddressbook.status'] = '0';\n\t \t\t\tif($this->BulkAddressbook->find('count', array('conditions'=>$c)) == '0') {\n\t \t\t\t\t$error[] = 'Group is empty';\n\t \t\t\t} else {\n \t\t\t\t\t\n\t \t\t\t\t// Get mobile numbers\n\t \t\t\t\tif(isset($this->data['mobile_list'])) $mobile_list = $this->data['mobile_list'];\n\t \t\t\t\telse {\n\t \t\t\t\t\t$mc['conditions']['BulkAddressbook.bulk_group_id'] = $bulk_group_id;\n\t \t\t\t\t\t$mc['conditions']['BulkAddressbook.status'] = '0';\n\t \t\t\t\t\t$mc['fields'] = array('BulkAddressbook.id');\n\t \t\t\t\t\t$mobile_list = $this->BulkAddressbook->find('list', $mc);\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t\t//SEND NOW\n \t\t\t\t\tif($this->data['type']) {\n\t \t\t\t\t\t$mc['conditions']['BulkAddressbook.id'] = $mobile_list;\n\t \t\t\t\t\t$mc['conditions']['BulkAddressbook.bulk_group_id'] = $bulk_group_id;\n\t \t\t\t\t\t$mc['conditions']['BulkAddressbook.status'] = '0';\n\t \t\t\t\t\t$mc['fields'] = array('BulkAddressbook.mobile');\n\t \t\t\t\t\t$mobile_list = $this->BulkAddressbook->find('list', $mc);\n\t \t\t\t\t\t\n\t \t\t\t\t\tunset($new_n);\n\t \t\t\t\t\tforeach($mobile_list as $k => $v) {\n\t \t\t\t\t\t\t$new_n[] = $v; \n\t \t\t\t\t\t}\n\t \t\t\t\t\t$n = !empty($n) ? array_merge($n, $new_n) : $new_n;\n \t\t\t\t\t\n \t\t\t\t\t} else {\n \t\t\t\t\t\t\n \t\t\t\t\t}\n\t \t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\t//SEND NOW\n \t\t\tif($this->data['type']) {\n \t\t\t\t\n \t\t\t\tif(!isset($error)) {\n \t\t\t\t\t\n \t\t\t\t\tif(strlen($message) > MAX_CHARS)\n \t\t\t\t\t\t$message = substr($message, 0, MAX_CHARS);\n \t\t\t\t\t\n \t\t\t\t\t//get sms vendor details\n\t\t \t\t\t$this->getBulkSmsVendor($this->Session->read('user_id'));\n\t\t \t\t\t//pr($this->sms_vendor_details);\n \t\t\t\t\t\n \t\t\t\t\tunset($v);\n \t\t\t\t\t$v['message'] = $message;\n \t\t\t\t\t$v['bulk_user_id'] = $this->Session->read('user_id');\n \t\t\t\t\t$v['sms_count'] = $this->sms_count($message);\n \t\t\t\t\t$v['numbers'] = !empty($n) ? implode(', ', $n) : '0';\n \t\t\t\t\t$v['bulk_senderid_id'] = $bulk_senderid_id;\n \t\t\t\t\t$v['bulk_group_id'] = empty($bulk_group_id) ? '0' : $bulk_group_id;\n \t\t\t\t\t$v['bulk_tag_id'] = $bulk_tag_id;\n \t\t\t\t\t$v['ip'] = ip2long($_SERVER['REMOTE_ADDR']);\n \t\t\t\t\t$v['sms_vendor_id'] = $this->sms_vendor_id;\n \t\t\t\t\t$this->BulkSmsLog->save($v);\n \t\t\t\t\t$bulk_sms_log_lid = $this->BulkSmsLog->getLastInsertId();\n \t\t\t\t\t\n \t\t\t\t\tif(count($n) < BULK_SMS_CLI_DECIDER) {\n \t\t\t\t\t\t\n\t\t\t\t\t\t//SEND SMS\n \t\t\t\t\t\t$this->_sendBulkMessage($bulk_group_id, $bulk_senderid_id, $message, $bulk_sms_log_lid, $this->Session->read('user_id'), $n, false, $this->sms_vendor_id);\n \t\t\t\t\t\n \t\t\t\t\t} else {\n\n \t\t\t\t\t\t//SAVE SMS IN TEMP TABLE\n\t \t\t\t\t\tunset($v);\n\t \t\t\t\t\t$v['message'] = $message;\n\t \t\t\t\t\t$v['numbers'] = !empty($n) ? implode(', ', $n) : '0';\n\t \t\t\t\t\t$v['bulk_user_id'] = $this->Session->read('user_id');\n\t\t\t\t\t\t$v['bulk_senderid_id'] = $bulk_senderid_id;\n \t\t\t\t\t\t$v['bulk_group_id'] = empty($bulk_group_id) ? '0' : $bulk_group_id;\n \t\t\t\t\t\t$v['bulk_sms_log_id'] = $bulk_sms_log_lid;\n \t\t\t\t\t\t$v['sms_vendor_id'] = $this->sms_vendor_id;\n \t\t\t\t\t\t$this->BulkSmsCli->save($v);\n\t \t\t\t\t\t$lastinsertid = $this->BulkSmsCli->getLastInsertId();\n \t\t\t\t\t\n \t\t\t\t\t\n \t\t\t\t\t\t//CALL CLI TO SEND SMS\n \t\t\t\t\t\t$path = \"php \" . WWW_ROOT . \"cron_dispatcher.php /bulksms/send_using_cli/\".$lastinsertid;\n \t\t\t\t\t\t$outputfile = \"/tmp/output.cli.\".$lastinsertid;\n \t\t\t\t\t\t$pidfile = \"/tmp/pid.cli.\".$lastinsertid;\n \t\t\t\t\t\texec(sprintf(\"%s > %s 2>&1 & echo $! >> %s\", $path, $outputfile, $pidfile));\n \t\t\t\t\t\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t//GET GROUP NAME\n \t\t\t\t\t$groupname = $number = '';\n \t\t\t\t\tif(!empty($bulk_group_id)) {\n\t \t\t\t\t\t$this->BulkGroup->id = $bulk_group_id;\n\t \t\t\t\t\t$groupname = '<br/>Contact(s) from '.$this->BulkGroup->field('name') . ' Group';\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\tif(!empty($n)) {\n \t\t\t\t\t\t$number = '<br/>Mobile Numbers(s) '.implode(', ', $n);\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t$return_data = 'Message Successfully Send To:'.$groupname.$number;\n\t\t\t \t\tif(strlen($return_data) > 250) $return_data = substr($return_data, 0, 200).'..';\n\t\t\t \t\t\n\t\t\t \t\t$return_data .= '<br/><a href=\"/bulksms/showdetailedreport/'.$bulk_sms_log_lid.'\">View Detailed Delivery Report</a>';\n\t\t\t \t\t\n \t\t\t\t\t$this->Session->write('success', $return_data);\n \t\t\t\t\t$this->redirect('/bulksms/sendnow');\n \t\t\t\t\texit;\n \t\t\t\t\t\n \t\t\t\t} else {\n \t\t\t\t\t$this->set('error', $error);\n \t\t\t\t\t$this->set('message', $message);\n \t\t\t\t\t$this->set('number', $number);\n \t\t\t\t\t$this->set('day', $day);\n \t\t\t\t\t$this->set('month', $month);\n \t\t\t\t\t$this->set('year', $year);\n \t\t\t\t\t$this->set('hour', $hours);\n \t\t\t\t\t$this->set('minutes', $minutes);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t//SCHEDULE\t\n \t\t\t} else {\n \t\t\t\t\n \t\t\t\t/*if($day == '' || $month == '' || $year == '' || $hours == '' || $minutes == '') { \n \t\t\t\t\t$error[] = 'Invalid Date Entered';\n \t\t\t\t} else {*/\n \t\t\t\t\t$date = date('Y-m-d H:i:s', mktime($hours, $minutes, '0', $month, $day, $year));\n \t\t\t\t\tif($date < date('Y-m-d H:i:s')) $error[] = 'Please select a future date';\n \t\t\t\t//}\n \t\t\t\t\n\t\t\t\tif(!($hours > '08' && $hours < '21')) {\n \t\t\t\t\t$error[] = NINE_TO_NINE_ACTIVATED_MESSAGE;\n \t\t\t\t}\n\n \t\t\t\tif(isset($mobile_list) && !empty($mobile_list)) {\n\t \t\t\t\tunset($c);\n\t \t\t\t\tif(count($mobile_list) == 1) $mobile_list = $mobile_list['0'];\n\t \t\t\t\t$c['conditions']['BulkAddressbook.bulk_group_id'] = $bulk_group_id;\n\t \t\t\t\t$c['conditions']['BulkAddressbook.id NOT'] = $mobile_list;\n\t \t\t\t\t$c['conditions']['BulkAddressbook.status'] = '0';\n\t \t\t\t\t$c['fields'] = array('BulkAddressbook.id');\n\t \t\t\t\t$not_included = $this->BulkAddressbook->find('list', $c);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif(!isset($error)) {\n \t\t\t\t\t\n \t\t\t\t\t$date = date('Y-m-d H:i:s', mktime($hours, $minutes, '0', $month, $day, $year));\n \t\t\t\t\t$udate = date('jS M, Y g:i a', strtotime($date));\n \t\t\t\t\t\n \t\t\t\t\tunset($v);\n \t\t\t\t\t$v['message'] = $message;\n \t\t\t\t\t$v['bulk_user_id'] = $this->Session->read('user_id');\n \t\t\t\t\t$v['numbers'] = !empty($n) ? implode(',', $n) : '0';\n \t\t\t\t\t$v['not_included'] = !empty($not_included) ? implode(',', $not_included) : '0';\n \t\t\t\t\t$v['scheduledate'] = $date;\n \t\t\t\t\t$v['bulk_senderid_id'] = $bulk_senderid_id;\n \t\t\t\t\t$v['bulk_group_id'] = empty($bulk_group_id) ? '0' : $bulk_group_id;\n \t\t\t\t\t$v['bulk_tag_id'] = $bulk_tag_id;\n \t\t\t\t\t$v['ip'] = ip2long($_SERVER['REMOTE_ADDR']);\n \t\t\t\t\t$this->BulkSmsSchedule->save($v);\n \t\t\t\t\t\n \t\t\t\t\t$this->Session->write('success', 'Message Successfully Scheduled on '.$udate);\n \t\t\t\t\t$this->redirect('/bulksms/sendnow');\n \t\t\t\t\texit;\n \t\t\t\t\t\n \t\t\t\t} else {\n \t\t\t\t\t$this->set('error', $error);\n \t\t\t\t\t$this->set('message', $message);\n \t\t\t\t\t$this->set('number', $number);\n \t\t\t\t\t$this->set('day', $day);\n \t\t\t\t\t$this->set('month', $month);\n \t\t\t\t\t$this->set('year', $year);\n \t\t\t\t\t$this->set('hour', $hours);\n \t\t\t\t\t$this->set('minutes', $minutes);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t}\n \t\t\n \t\tunset($cond);\n \t\t$cond['conditions']['status'] = '0';\n\t \t$cond['conditions']['bulk_user_id'] = $this->Session->read('user_id');\n\t \t$group = $this->BulkGroup->find('list', $cond);\n\t \t$groupname = '<option value=\"0\">Select Group</option>';\n\t \t\n\t \tforeach($group as $key => $value) {\n\t \t\t$groupname .= '<option value=\"'.$key.'\">'.$value.'</option>';\n\t \t}\n\t \t$this->set('groupname', $groupname);\n\t \t\n\t \tunset($cond);\n\t \t$cond['conditions']['status'] = '0';\n\t \t$cond['conditions']['publish'] = '1';\n\t \t$cond['conditions']['bulk_user_id'] = $this->Session->read('user_id');\n\t \t$sender = $this->BulkSenderid->find('list', $cond);\n\t \t$senderid = '';\n\t \t\n\t \tforeach($sender as $key => $value) {\n\t \t\t$senderid .= '<option value=\"'.$key.'\">'.$value.'</option>';\n\t \t}\n\t \t$this->set('senderid', $senderid);\n\t \t\n\t \tunset($cond);\n\t \t$cond['conditions']['status'] = '0';\n\t \t$cond['conditions']['bulk_user_id'] = $this->Session->read('user_id');\n\t \t$data = $this->BulkSmsTag->find('list', $cond);\n\t \t$tag = '';\n\t \t\n\t \tforeach($data as $key => $value) {\n\t \t\t$tag .= '<option value=\"'.$key.'\">'.$value.'</option>';\n\t \t}\n\t \t$this->set('tag', $tag);\n\t \t\n\t \tunset($cond);\n\t \t$cond['conditions']['BulkAccount.status'] = '0';\n\t \t$cond['conditions']['BulkAccount.bulk_user_id'] = $this->Session->read('user_id');\n\t \t$quantity = $this->BulkAccount->field('BulkAccount.quantity', $cond['conditions']);\n\t \t$this->set('quantity', $quantity);\n\t \t\n \t\t$this->layout = 'bulksms';\n \t\t$this->set('tab', array('2'));\n\t\t//$this->getFeedback();\n\t\t\n \t\tif($this->Session->check('success')) {\n \t\t\t$this->set('success', $this->Session->read('success'));\n \t\t\t$this->Session->delete('success');\n \t\t}\n \n \t}", "function recive_sms(){\n // 'originalsenderid' => '+19179354988',\n // 'body' => 'Chat with you started 5157248',\n // 'message' => 'Chat with you started 5157248',\n // 'sms' => '+16102231415',\n // 'custom_string' => '',\n // 'to' =>'+16102231415',\n // 'original_message_id' => '',\n // 'originalmessageid' => '',\n // 'customstring' => '',\n // 'from' => '+918591041420',\n // 'originalmessage' => '',\n // 'user_id' => '73872',\n // 'subaccount_id' => '86325',\n // 'original_body' => '',\n // 'timestamp' => '1556179523',\n // 'message_id' => 'FBF799B1-2BDC-4D29-86EE-4F9EC69931D7',\n // );\n App::save_data('log_data',array('log_type'=>'sms_receive','log_data'=> json_encode($_POST) ) );\n if(isset($_POST['to'] ) ){\n $to_sms = $_POST['to'];\n $from_sms = $_POST['message'];\n $raw = json_encode($_POST);\n $timestamp = $_POST['timestamp'];\n $datetime = date('Y:m:d H:i:s');\n \n // $from_sms_api = (array) App::get_by_where('leads_sms', array('sms_to'=>$to_sms) );\n \n $newstring = substr($to_sms, -10);\n $this->db->select('*');\n $this->db->from('leads');\n $this->db->like(\"phone\",\"$newstring\");\n $query=$this->db->get();\n $from_sms_api = $query->row();\n \n $leadData = array(\n 'lead_id' =>$from_sms_api->id,\n 'sms_text' => $from_sms,\n 'sms_to' => $to_sms,\n 'sms_type' => 'in',\n 'sms_time' => $datetime,\n );\n App::save_data( 'leads_sms',$leadData);\n App::create_activity('lead_activity',$from_sms_api->id,'SMS Received',json_encode($_POST));\n }\n }", "public function POSTindex()\n\t{\n\t\t/* Make sure there is a valid sender */\n\t\tif ( !isset( \\IPS\\Request::i()->from ) OR !\\IPS\\Member::load( (int) \\IPS\\Request::i()->from )->member_id )\n\t\t{\n\t\t\tthrow new \\IPS\\Api\\Exception( 'INVALID_SENDER', '1C374/2', 404 );\n\t\t}\n\n\t\t/* Verify there are recipients and all the recipients are valid */\n\t\tif( !isset( \\IPS\\Request::i()->to ) OR !\\is_array( \\IPS\\Request::i()->to ) OR !\\count( \\IPS\\Request::i()->to ) )\n\t\t{\n\t\t\tthrow new \\IPS\\Api\\Exception( 'INVALID_RECIPIENT', '1C374/3', 404 );\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach( \\IPS\\Request::i()->to as $to )\n\t\t\t{\n\t\t\t\tif( !\\IPS\\Member::load( (int) $to )->member_id )\n\t\t\t\t{\n\t\t\t\t\tthrow new \\IPS\\Api\\Exception( 'INVALID_RECIPIENT', '1C374/4', 404 );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* Make sure we have a title and body */\n\t\tif( !isset( \\IPS\\Request::i()->title ) OR !isset( \\IPS\\Request::i()->body ) )\n\t\t{\n\t\t\tthrow new \\IPS\\Api\\Exception( 'MISSING_TITLE_OR_BODY', '1C374/5', 404 );\n\t\t}\n\n\t\t/* Create the conversation */\n\t\t$item = \\IPS\\core\\Messenger\\Conversation::createItem( \\IPS\\Member::load( (int) \\IPS\\Request::i()->from ), \\IPS\\Request::i()->ipAddress(), \\IPS\\DateTime::create(), NULL );\n\t\t$item->title\t= \\IPS\\Request::i()->title;\n\t\t$item->to_count\t= \\count( \\IPS\\Request::i()->to );\n\t\t$item->save();\n\n\t\t/* Create the first message */\n\t\t$postContents = \\IPS\\Text\\Parser::parseStatic( \\IPS\\Request::i()->body, TRUE, NULL, \\IPS\\Member::load( (int) \\IPS\\Request::i()->from ), 'core_Messaging' );\n\n\t\t$commentClass = $item::$commentClass;\n\t\t$post = $commentClass::create( $item, $postContents, TRUE, NULL, NULL, \\IPS\\Member::load( (int) \\IPS\\Request::i()->from ), \\IPS\\DateTime::create() );\n\t\t\n\t\t$item->first_msg_id = $post->id;\n\t\t$item->save();\n\n\t\t/* Authorize sender and recipients */\n\t\t$item->authorize( array_map( function( $member ) { return (int) $member; }, array_merge( array( \\IPS\\Request::i()->from ), \\IPS\\Request::i()->to ) ) );\n\n\t\t/* Send notifications */\n\t\t$post->sendNotifications();\n\n\t\treturn new \\IPS\\Api\\Response( 201, $item->id );\n\t}", "protected function create(array $data)\n {\n\n $pin = substr(time(), 4);\n if (isset($data['affiliate_id'])) {\n $position = ['L', 'R'];\n $ref_id = $data['user_id'];\n $poss = array_random($position);\n $posid = getLastChildOfLR($ref_id, $poss);\n }\n\n // $general = General::first();\n\n $message = '<tr>';\n $message .= '<td style=\"font-family: sans-serif; font-size: 14px; vertical-align: top;\">';\n $message .= '<p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;color:green;\">Our warmest congratulations on your new account opening! This only shows that you have grown your business well. I pray for your prosperous.</p>';\n\n $message .= '<p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">You have taken this path knowing that you can do it. Good luck with your new business. I wish you all the success and fulfillment towards your goal.</p>';\n $message .= '<p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">Your username is ' . $data['username'] . ' .</p>';\n\n $message .= '<p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;\">Your password is ' . $data['password'] . ' .</p>';\n\n $message .= '<p style=\"font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px; color:red;\">Remember, never share your password with otherone. And you are agree with our Terms and Policy.</p>';\n $message .= '</td>';\n $message .= '</tr>';\n\n send_email($data['email'], 'Account Created Successfully', $data['first_name'], $message);\n\n $sms = 'Congratulation, for registration. Your username is ' . $data['username'] . '. Your password is ' . $data['password'] . '';\n send_sms($data['mobile'], $sms);\n $affiliate_id = str_random(15);\n $check_affilate = User::where('affiliate_id', $affiliate_id)->count();\n while ($check_affilate > 0) {\n $affiliate_id = str_random(15);\n $check_affilate = User::where('affiliate_id', $affiliate_id)->count();\n if (!$check_affilate > 0) {\n break;\n }\n $check_affilate = $check_affilate - 1;\n }\n if (!$check_affilate > 0) {\n if (isset($data['affiliate_id'])) {\n // Add 20% COMMISION TO THE REFFERAL'S ACCOUNT\n $package_id = $data['package'];\n $package_info = Package::find($package_id);\n $package_price = $package_info->price;\n $commision = (20 / 100) * $package_price;\n $user = User::find($data['user_id']);\n $user_name = $user->first_name . $user->last_name;\n // Income::create([\n // 'user_id' => $data['user_id'],\n // 'amount' => $commision,\n // 'description' => 'Refferal Income By' . $user_name,\n // 'type' => 'R',\n // ]);\n // echo \"Resister With Affiliate\";\n return User::create([\n 'email' => $data['email'],\n 'password' => bcrypt($data['password']),\n 'referrer_id' => $data['user_id'],\n 'position' => $poss,\n 'first_name' => $data['first_name'],\n 'last_name' => $data['last_name'],\n 'mobile' => $data['mobile'],\n 'street_address' => $data['street_address'],\n 'city' => $data['city'],\n //'post_code' => $data['post_code'],\n 'country' => $data['country'],\n 'username' => $data['username'],\n 'birth_day' => date('Y-m-d', strtotime($data['birth_day'])),\n 'join_date' => Carbon::today(),\n 'balance' => 0,\n 'status' => 0,\n 'paid_status' => 0,\n 'ver_status' => 1,\n 'ver_code' => $pin,\n 'forget_code' => 0,\n 'posid' => $posid,\n 'tauth' => 0,\n 'tfver' => 1,\n 'emailv' => 1,\n 'smsv' => 1,\n 'affiliate_id' => $affiliate_id,\n 'package_id' => $data['package'],\n 'expiry_date' => date('Y-m-d', strtotime('+4 months')),\n ]);\n } else {\n // echo \"Resister With Common\";date('Y-m-d', strtotime('+4 months'));\n return User::create([\n 'email' => $data['email'],\n 'password' => bcrypt($data['password']),\n //'referrer_id' => $data['referrer_id'],\n //'position' => $data['position'],\n 'first_name' => $data['first_name'],\n 'last_name' => $data['last_name'],\n 'mobile' => $data['mobile'],\n 'street_address' => $data['street_address'],\n 'city' => $data['city'],\n //'post_code' => $data['post_code'],\n 'country' => $data['country'],\n 'username' => $data['username'],\n 'birth_day' => date('Y-m-d', strtotime($data['birth_day'])),\n 'join_date' => Carbon::today(),\n 'balance' => 0,\n 'status' => 0,\n 'paid_status' => 0,\n 'ver_status' => 1,\n 'ver_code' => $pin,\n 'forget_code' => 0,\n //'posid' => $posid,\n 'tauth' => 0,\n 'tfver' => 1,\n 'emailv' => 1,\n 'smsv' => 1,\n 'affiliate_id' => $affiliate_id,\n 'package_id' => $data['package'],\n 'expiry_date' => date('Y-m-d', strtotime('+4 months')),\n ]);\n }\n }\n }", "public function processCommentData() {\n$varray = array();\n\n\t$newItems = array();\n$total_price =0;\n$count = 0;\n$username = $this->username;\n$data = $this->getCommentData();\n\n\n $usd = $this->getSBD();\n$curr = $this->getCURR();\t \n$eth = $this->getETH();\t \n$btc = $this->getBTC();\t \n\t\nif (!empty($_GET['curr'])){\t\nif ($_GET['curr'] == 'eur'){$mult = round($curr[\"EUR\"]*$usd,2); $ext = 'EUR'; }\nelse if ($_GET['curr'] == 'zar'){$mult = round($curr[\"ZAR\"]*$usd,2); $ext = 'RANDS';}\nelse if ($_GET['curr'] == 'ghs'){$mult = round($curr[\"GHS\"]*$usd,2); $ext = 'CEDIS';}\nelse if ($_GET['curr'] == 'ngn'){$mult = round($curr[\"NGN\"]*$usd,2); $ext = 'NAIRA';}\nelse if ($_GET['curr'] == 'cad'){$$mult = round($curr[\"CAD\"]*$usd,2); $ext = 'C$';}\nelse if ($_GET['curr'] == 'gbp'){$mult = round($curr[\"GBP\"]*$usd,2); $ext = 'POUNDS';}\nelse if ($_GET['curr'] == 'dollars'){$mult = round($usd,2); $ext = 'DOLLAR';}\n\nelse if ($_GET['curr'] == 'btc'){$mult = round($usd/$btc,6); $ext = 'BTC';}\nelse if ($_GET['curr'] == 'eth'){$mult = round($usd/$btc,6); $ext = 'ETH';}\n\nelse if ($_GET['curr'] == 'aed'){$mult = round($curr[\"AED\"]*$usd,2); $ext = 'DIRHAMS';}\nelse if ($_GET['curr'] == 'inr'){$mult = round($curr[\"INR\"]*$usd,2); $ext = 'Indian Rupees';}\nelse if ($_GET['curr'] == 'pkr'){$mult = round($curr[\"PKR\"]*$usd,2); $ext = 'Pakistani Rupees';}\nelse if ($_GET['curr'] == 'php'){$mult = round($curr[\"PHP\"]*$usd,2); $ext = 'Philippine Pesos';}\n}\nelse {$mult = 1; $ext = 'sbd';}\n\t \n\t \nforeach ($data as $item) {\n\t\n\t\t\n\t\tif(!($item[\"pending_payout_value\"]==\"0.000 SBD\") && $username == $item[\"author\"])\n\t\t{\n\t\t\t\n\t\t\t\t$post_link = \"https://www.steemit.com/@\".$item[\"author\"].\"/\".$item[\"permlink\"];\n\t\t\t\n\t\t\t$author_link = \"https://www.steemit.com/@\".$item[\"author\"];\n\n\t\t\t$post_title = substr($item[\"root_title\"],0,44).'...';\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$price = str_replace(\" SBD\", \"\", $item[\"pending_payout_value\"]);\n\t\n\t\t\t\n\t\t\t\n\t\t\t//Adjustment For 75% Returns for Authors\n\t\t\tif ($username == $item[\"author\"]){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$each_pay = $price * 0.375;\n\t\t\t\t\t\t$total_price =$total_price + $each_pay;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$each_pay = $each_pay*$mult.' '.$ext;\n\t\t\t\t\n\t\t\t\n\t\t\t\t$newItems[$count]['author_link'] = $author_link;\n\t\t\t\t$newItems[$count]['author'] = $item[\"author\"];\n\t\t\t\t$newItems[$count]['post_link'] = $post_link;\n\t\t\t\t$newItems[$count]['post_title'] = $post_title;\n\t\t\t\t$newItems[$count]['pending_payout_value'] = $item[\"pending_payout_value\"];\n\t\t\t\t$newItems[$count]['each_pay'] = $each_pay;\n\t\t\t\t$newItems[$count]['parent_permlink'] = $item[\"parent_permlink\"];\n\t\t\t\t$newItems[$count]['voters'] = $item[\"active_votes\"];\n\t\t\t\t$newItems[$count]['vcount'] = count($item[\"active_votes\"]);\n\t\t\t\n\t\t\t $this->array_sort_by_column($newItems[$count]['voters'], 'rshares');\n\t\t\t\t\n\t\t\t\t$rshares_sum = array_sum(array_map(function($var) {\n return $var['rshares'];\n}, $newItems[$count]['voters']));\n\n\n$key = 0;\n\nforeach($newItems[$count]['voters'] as $csm)\n { $aMoney = $price;\n\t $vFraction = $csm['rshares']/ $rshares_sum;\n\t $vMoney = $vFraction * $aMoney;\n $newItems[$count]['voters'][$key]['money'] = $vMoney * $mult;\n $newItems[$count]['voters'][$key]['percent'] = $newItems[$count]['voters'][$key]['percent'] / 100;\n \n $vname =$newItems[$count]['voters'][$key]['voter'];\n \n if (array_key_exists($vname,$varray)){\n$varray[$vname]['amount'] = $varray[$vname]['amount'] + $vMoney * $mult; \n$varray[$vname]['count'] = $varray[$vname]['count'] + 1; \n }\n else {\n$varray[$vname]['name'] = $newItems[$count]['voters'][$key]['voter'];\n$varray[$vname]['amount'] = $vMoney * $mult;\n$varray[$vname]['count'] = 1;\n$varray[$vname]['type'] = 'cumVote';\n }\n \n $key++;\n }\n\t\t\t\t\n\t\t\t\t$nT = str_replace(\"T\",\" \",$item[\"created\"]);\n\t\t\t\t$nT = strtotime($nT);\n\t\t\t\t$newItems[$count]['created'] = $this->fancy_date($nT);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t//Final Payment\t\t\n$newItems[$count]['pending_payout_value'] = str_replace(\" SBD\", \"\", $newItems[$count]['pending_payout_value']);\t\n$newItems[$count]['pending_payout_value'] = $newItems[$count]['pending_payout_value'] * $mult;\n$newItems[$count]['pending_payout_value'] = $newItems[$count]['pending_payout_value'].' '.$ext;\n\t\t\t}\n\t\t\t\t\n$count++;\n}\n\n$newItems['total'] = $total_price * $mult;\n$newItems['usd'] = $this->getSBD();\n\n$this->CVA = $varray;\n\n\n\n\nreturn $newItems;\n }", "function get_recipients($address_list, $num_recipients = 1)\n{\n\t$recipient = array();\n\n\t$count = 0;\n\tforeach ($address_list as $field => $adr_ary)\n\t{\n\t\tforeach ($adr_ary as $id => $type)\n\t\t{\n\t\t\tif ($count >= $num_recipients)\n\t\t\t{\n\t\t\t\tbreak 2;\n\t\t\t}\n\t\t\t$recipient[$field][$id] = $type;\n\t\t\t$count++;\n\t\t}\n\t}\n\n\treturn $recipient;\n}", "public static function data()\n {\n $model = new \\app\\modules\\systems\\models\\Email;\n\n $data = $model->getList();\n $emailData = [];\n\n foreach ($data as $key => $value) {\n $emailAddress = strtolower(trim($value['emailaddress']));\n $emailData[$emailAddress] = $value;\n// if($value['is_encrypt']){\n// $emailData[$emailAddress]['tls'] = true;\n// }else{\n// $emailData[$emailAddress]['tls'] = false;\n// }\n//\t\t\tif($value['ssl'] == 1)\n//\t\t\t{\n//\t\t\t\t$emailData[$emailAddress]['ssl'] = true;\n//\t\t\t}\n//\t\t\telse\n//\t\t\t{\n//\t\t\t\t$emailData[$emailAddress]['ssl'] = false;\n//\t\t\t}\n }\n return $emailData;\n /*\t\treturn [\n '[email protected]' => [\n 'imap_server' => 'imap.163.com',\n 'smtp_server' => 'smtp.163.com',\n 'imap_protocol' => 'imap',\n 'smtp_protocol' => 'smtp',\n 'imap_port' => '993',\n 'smtp_port' => '25',\n 'ssl' => true,\n 'emailaddress' => '[email protected]',\n 'accesskey' => 'comeon666',\n ],\n '[email protected]' => [\n 'imap_server' => 'imap.163.com',\n 'smtp_server' => 'smtp.163.com',\n 'imap_protocol' => 'imap',\n 'smtp_protocol' => 'smtp',\n 'imap_port' => '993',\n 'smtp_port' => '25',\n 'ssl' => true,\n 'emailaddress' => '[email protected]',\n 'accesskey' => 'comeon888',\n ],\n '[email protected]' => [\n 'imap_server' => 'imap.163.com',\n 'smtp_server' => 'smtp.163.com',\n 'imap_protocol' => 'imap',\n 'smtp_protocol' => 'smtp',\n 'imap_port' => '993',\n 'smtp_port' => '25',\n 'ssl' => true,\n 'emailaddress' => '[email protected]',\n 'accesskey' => 'comeon777',\n ],\n ];\t\t\t*/\n }", "function create_push_message($product_id = '', $retailer_id = '', $store_type_id = '', $store_id = '', $product_name = '', $retailer_name = '', $store_name = '', $store_type_name = '', $special_count = 0, $special_price = 0, $special_name = '', $success_count = 0, $store_array = array(), $product_array = array(), $store_detail_array = array()) {\n $multiple_insert = [];\n $CI = &get_instance();\n $CI -> load -> model('admin/specialproductmodel');\n\n //Create a general message\n $message = $special_name . ', ';\n if ($success_count > 1) { //if the product count is more than one\n $product_id = '';\n $retailer_id = '';\n $store_type_id = '';\n $store_id = '';\n $message .= $success_count . ' products. From ' . $retailer_name;\n }\n else { //if only one product is addded\n $message .= $product_name . ' from: ' . $retailer_name . ', ' . $store_name . ', ';\n if ($special_count > 1) {\n $message .= $special_price . '(' . $special_count . ')';\n }\n else {\n $message .= $special_price . '.';\n }\n }\n $message .= ' Don\\'t miss it!';\n\n\n $user_ids = $CI -> specialproductmodel -> get_device_user_ids(); //Get the registered device IDs now available in DB\n $users_have_store = [];\n $user_have_price_alert = [];\n $price_change_array = [];\n $price_change_count = [];\n $retailer_special_message = [];\n $retailer_count_arr = [];\n $user_add = [];\n $comp_available_stores = [];\n $product_names = []; // Array to store product names\n $productNameMessage = \"\";\n $store_names = []; // Array to store name of the stores\n $storeNameMessage = \"\";\n\n if (!empty($user_ids)) {//If users available to send the notifications\n foreach ($user_ids as $user_id) {\n \n $comp_available_stores = [];\n if ($user_id['PrefLatitude'] && $user_id['PrefLongitude'] && $user_id['PrefDistance']) {\n $store_det = $CI -> specialproductmodel -> get_device_user_stores($user_id['PrefLatitude'], $user_id['PrefLongitude'], $user_id['PrefDistance'], $store_array, $user_id['state']);\n $store_name = isset($store_det[0]['StoreName']) ? $store_det[0]['StoreName'] : '';\n $store_get_id = isset($store_det[0]['StoreId']) ? $store_det[0]['StoreId'] : '';\n $special_notifications = $CI -> specialproductmodel -> get_special_enabled_user_store();\n $special_user_list = [];\n if ($special_notifications) {\n foreach ($special_notifications as $special_users) {\n $special_user_list[$special_users['UserId']] = array(\n 'StoreId' => $special_users['StoreId'],\n 'Specials' => $special_users['Specials'],\n 'PreferredStoreOnly' => $special_users['PreferredStoreOnly']\n );\n }\n }\n if (!empty($store_det)) {\n foreach ($store_det as $store_de) {\n if (in_array($store_de['Id'], $store_array)) {\n $comp_available_stores[] = $store_de['Id'];\n }\n }\n }\n\n if ($store_name && $store_get_id) {\n if (!in_array($user_id['UserId'], $users_have_store)) {\n //Adding the user devices, in which they have the stores added in DB\n\n if (!empty($special_user_list)) {\n if (isset($special_user_list[$user_id['UserId']])) {\n if ($special_user_list[$user_id['UserId']]['StoreId'] == $store_get_id && ($special_user_list[$user_id['UserId']]['Specials'] == 1 || $special_user_list[$user_id['UserId']]['PreferredStoreOnly'] == 1)) {\n $users_have_store[$user_id['UserId']] = array(\n 'UserId' => $user_id['UserId'],\n 'StoreName' => $store_name,\n 'StoreId' => $store_get_id\n );\n if (!in_array($user_id['UserId'], $user_add)) {\n $user_add[] = $user_id['UserId'];\n }\n }\n else {\n \n }\n }\n }\n else {\n if (!in_array($user_id['UserId'], $user_add)) {\n $user_add[] = $user_id['UserId'];\n }\n $users_have_store[$user_id['UserId']] = array(\n 'UserId' => $user_id['UserId'],\n 'StoreName' => $store_name,\n 'StoreId' => $store_get_id\n );\n }\n }\n }\n }\n if (!isset($users_have_store[$user_id['UserId']])) {\n if (!empty($comp_available_stores)) {\n $user_notification_settings = $CI -> specialproductmodel -> get_user_notification_settings($user_id['UserId']);\n $user_preferred_brands = $CI -> specialproductmodel -> get_user_preferred_brands($user_id['UserId']);\n if ($user_notification_settings) {\n if ($user_notification_settings['Specials'] == 1) {\n if ($user_notification_settings['PreferredStoreOnly'] == 1) {\n if (in_array($user_preferred_brands['StoreId'], $comp_available_stores)) {\n $users_have_store[$user_id['UserId']] = array(\n 'UserId' => $user_id['UserId'],\n 'StoreName' => '',\n 'StoreId' => $user_preferred_brands['StoreId']\n );\n }\n }\n else {\n $users_have_store[$user_id['UserId']] = array(\n 'UserId' => $user_id['UserId'],\n 'StoreName' => '',\n 'StoreId' => $comp_available_stores[0]\n );\n }\n }\n }\n }\n }\n }\n if (!empty($users_have_store)) { //if there are users with stores, then send push notification to them\n $notification_array = array(\n 'title' => 'Hurry! Specials Added',\n 'message' => $message,\n 'product_id' => $product_id,\n 'retailer_id' => $retailer_id,\n 'store_type_id' => $store_type_id,\n 'store_id' => $store_id,\n 'is_special' => '1',\n 'is_location_message' => '0',\n 'is_location_near_message' => '0'\n );\n if (!empty($product_array)) {\n //Checking for price alert enabled\n //If for a single product for single user, then will send the message with all the product details\n //If user have multiple alerts, then a general message will send\n\n foreach ($product_array as $index => $product) {\n foreach ($users_have_store as $user_get) {\n $multiple_single_insert = [];\n $is_alert_available = $CI -> specialproductmodel -> check_price_alert($product['id'], $user_get['UserId']);\n $is_alert_available = 0 ; // Temporary\n if ($is_alert_available) { \n if (!array_key_exists($user_get['UserId'], $price_change_array)) {\n # set product names according to users\n $product_names[$user_get['UserId']][] = $product['name']; \n \n $price_change_count[$user_get['UserId']] = 1;\n $price_change_array[$user_get['UserId']] = array(\n 'title' => 'Price Change Alert',\n 'message' => $product['name'] . ' from: ' . $store_detail_array[$index]['retailerName'] . ', ' . $store_detail_array[$index]['name'],\n 'product_id' => $product['id'],\n 'retailer_id' => $store_detail_array[$index]['retailer'],\n 'store_type_id' => $store_detail_array[$index]['storeType'],\n 'store_id' => $store_detail_array[$index]['id'],\n 'is_special' => '0',\n 'is_location_message' => '0',\n 'is_location_near_message' => '0'\n );\n }\n else {\n # set product names according to users\n $product_names[$user_get['UserId']][] = $product['name']; \n \n $price_change_count[$user_get['UserId']] += 1;\n $price_change_array[$user_get['UserId']] = array(\n 'title' => 'Price Change Alert',\n 'message' => $price_change_count[$user_get['UserId']] . ' products from: ' . $store_detail_array[$index]['retailerName'] . ', ' . $store_detail_array[$index]['name'],\n 'product_id' => '',\n 'retailer_id' => $store_detail_array[$index]['retailer'],\n 'store_type_id' => '',\n 'store_id' => '',\n 'is_special' => '0',\n 'is_location_message' => '0',\n 'is_location_near_message' => '0'\n );\n }\n// $notification_array1 = array(\n// 'title' => 'Price Change Alert',\n// 'message' => $product['name'] . ' from: ' . $store_detail_array[$index]['retailerName'] . ', ' . $store_detail_array[$index]['name'],\n// 'product_id' => $product['id'],\n// 'retailer_id' => $store_detail_array[$index]['retailer'],\n// 'store_type_id' => $store_detail_array[$index]['storeType'],\n// 'store_id' => $store_detail_array[$index]['id'],\n// 'is_special' => '1'\n// );\n// $multiple_single_insert[] = array(\n// 'Title' => $notification_array1['title'],\n// 'Message' => $notification_array1['message'],\n// 'UserId' => $user_get['UserId'],\n// 'CreatedOn' => date('Y-m-d H:i:s')\n// );\n// send_push_notification($notification_array1, array($user_get['UserId']), $multiple_single_insert);\n }\n else {\n \n if (!array_key_exists($store_detail_array[$index]['id'] . ':' . $user_get['UserId'], $retailer_special_message)) {\n if (!isset($retailer_count_arr[$user_get['UserId']])) {\n $retailer_count_arr[$user_get['UserId']] = 1;\n # Get stores names\n $store_names[$user_get['UserId']][]=$store_detail_array[$index]['name'];\n }\n else {\n $retailer_count_arr[$user_get['UserId']] += 1;\n \n # Get stores names\n $store_names[$user_get['UserId']][]=$store_detail_array[$index]['name'];\n }\n $retailer_special_message[$store_detail_array[$index]['id'] . ':' . $user_get['UserId']] = array(\n// 'title' => 'Special Added',\n 'title' => $store_detail_array[$index]['retailerName'].' - '.$special_name,\n 'message' => 'Specials added from: ' . $store_detail_array[$index]['retailerName'] . ', ' . $store_detail_array[$index]['name'],\n 'product_id' => $product['id'],\n 'retailer_id' => $store_detail_array[$index]['retailer'],\n 'store_type_id' => $store_detail_array[$index]['storeType'],\n 'store_id' => $store_detail_array[$index]['id'],\n 'is_special' => '0',\n 'is_location_message' => '0',\n 'is_location_near_message' => '0'\n );\n }\n \n \n \n }\n }\n }\n \n \n \n \n $retailer_count_arr['237'] = 5;\n $retailer_final_array = [];\n if (!empty($retailer_special_message) && !empty($retailer_count_arr)) {\n foreach ($retailer_special_message as $store_user_id => $val) {\n \n // Send notification from here\n $store_user_arr = explode(':', $store_user_id);\n if (isset($retailer_count_arr[$store_user_arr[1]])) {\n if ($retailer_count_arr[$store_user_arr[1]] > 1) {\n $retailer_final_array[$store_user_arr[1]] = array(\n// 'title' => 'Special Added',\n 'title' => $store_detail_array[$index]['retailerName'].' - '.$special_name,\n 'message' => 'Specials added: ' . $retailer_count_arr[$store_user_arr[1]] . ' Stores from ' . $store_detail_array[$index]['retailerName'],\n 'product_id' => '0',\n 'retailer_id' => $val['retailer_id'],\n 'store_type_id' => '0',\n 'store_id' => '0',\n 'is_special' => '0',\n 'is_location_message' => '0',\n 'is_location_near_message' => '0'\n );\n }\n }\n \n \n \n \n // Send not\n }\n }\n \n \n \n //checking the price alert array and send the notifications\n if (!empty($price_change_array)) {\n foreach ($price_change_array as $price_user_id => $price_array) {\n \n //Get product Names\n if(isset($product_names[$price_user_id])){\n $productNameMessage = implode(\",\" ,$product_names[$price_user_id]);\n }\n \n $finalMessage = \"\";\n $msg = explode(\"products from:\",$price_array['message']);\n $finalMessage = $productNameMessage.\" products from: \".$msg[1];\n \n /* \n $multiple_single_insert[] = array(\n 'Title' => $price_array['title'],\n 'Message' => $price_array['message'],\n 'UserId' => $price_user_id,\n 'CreatedOn' => date('Y-m-d H:i:s')\n ); \n */\n \n \n $multiple_single_insert[] = array(\n 'Title' => $price_array['title'],\n 'Message' => $finalMessage,\n 'UserId' => $price_user_id,\n 'CreatedOn' => date('Y-m-d H:i:s')\n );\n \n \n \n //send_push_notification($price_array, array($price_user_id), $multiple_single_insert);\n }\n }\n if (!empty($retailer_final_array)) {\n foreach ($retailer_final_array as $special_user_id => $special_array) {\n \n /*\n echo \"<pre>\";\n //echo \"retailer_final_array\";\n //print_r($retailer_final_array);\n echo \"special_array\";\n print_r($special_array);\n echo \"store_names[$special_user_id]\";\n print_r($store_names[$special_user_id]);\n */\n \n \n \n //Get Stores Names\n if(isset($store_names[$special_user_id])){\n //$storeNameMessage = implode(\",\" ,$store_names[$special_user_id]);\n $userStores = $store_names[$special_user_id];\n \n foreach($userStores as $userStore)\n {\n //echo \"<br>\".$userStore;\n }\n \n \n }\n \n $finalStoreMessage = \"\";\n $storeMsg = explode(\"Stores from\",$special_array['message']);\n $finalStoreMessage = 'Specials added: '.$storeNameMessage.\" Stores from \".$storeMsg[1]; \n \n $multiple_special_insert[] = array(\n 'Title' => $special_array['title'],\n 'Message' => $finalStoreMessage,\n 'UserId' => $special_user_id,\n 'CreatedOn' => date('Y-m-d H:i:s')\n );\n /*\n $multiple_special_insert[] = array(\n 'Title' => $special_array['title'],\n 'Message' => $special_array['message'],\n 'UserId' => $special_user_id,\n 'CreatedOn' => date('Y-m-d H:i:s')\n ); \n */\n \n echo \"<pre>\";\n echo \"retailer_final_array\";\n print_r($retailer_final_array);\n echo \"special_array\";\n print_r($special_array);\n echo \"multiple_special_insert\";\n print_r($multiple_special_insert);\n exit;\n \n send_push_notification($special_array, array($special_user_id), $multiple_special_insert);\n }\n }\n }\n foreach ($users_have_store as $us_st) {\n $multiple_insert[] = array(\n 'Title' => $notification_array['title'],\n 'Message' => $notification_array['message'],\n 'UserId' => $us_st['UserId'],\n 'CreatedOn' => date('Y-m-d H:i:s')\n );\n }\n send_push_notification($notification_array, $user_add, $multiple_insert);\n }\n }\n}", "public function CounterMail(){\n\n $CantidadMails = ($this->ConfigModelo->select('rowCountWhere', 'Mensajes', 'estado', '0', 'Id', 'Id'));\n\n return $CantidadMails;\n\n }", "public function getMutualMessages()\n {\n $limit = $this->input->get('limit');\n $to = $this->input->get('sender_id');\n $from = $this->input->get('reciever_id');\n\n ($limit)\n ? $limit\n : $limit = 10;\n\n $offset = 0;\n $message = '';\n\n if ($this->input->get('offset')) {\n $offset = $this->input->get('offset');\n }\n $response = $this->chat_model->getMutualMessages($from, $to, $limit, $offset);\n\n if ($response) {\n header('Content-Type: application/json');\n echo json_encode($response);\n } else {\n header('Content-Type: application/json');\n $message = _l('chat_no_more_messages_in_database');\n echo json_encode($message);\n }\n }", "function fetch_contact(){ \n\n $fetch_data = $this->crud_model->make_datatables_contact(); \n $data = array(); \n foreach($fetch_data as $row) \n { \n\n if ($row->fichier != '') {\n $etat = '<a href=\"'.base_url().'upload/contact/'.$row->fichier.'\" class=\"badge badge-white\"><i class=\"fa fa-file\"></i></a>';\n }\n else{\n $etat = '';\n }\n\n $sub_array = array();\n\n $sub_array[] = '\n <input type=\"checkbox\" class=\"delete_checkbox\" value=\"'.$row->email.'\" />\n '; \n \n $sub_array[] = nl2br(substr($row->nom, 0,20)).'...'; \n $sub_array[] = nl2br(substr($row->sujet, 0,20)).'...'; \n $sub_array[] = $row->email; \n $sub_array[] = nl2br(substr($row->message, 0,50)).'...';\n $sub_array[] = substr(date(DATE_RFC822, strtotime($row->created_at)), 0, 23);\n\n $sub_array[] = $etat; \n\n $sub_array[] = '<button type=\"button\" name=\"delete\" idcontact=\"'.$row->id.'\" class=\"btn btn-dark btn-circle btn-sm update\"><i class=\"fa fa-comment-o\"></i></button>'; \n\n $sub_array[] = '<button type=\"button\" name=\"delete\" idcontact=\"'.$row->id.'\" class=\"btn btn-danger btn-circle btn-sm delete\"><i class=\"fa fa-trash\"></i></button>'; \n $data[] = $sub_array; \n } \n $output = array( \n \"draw\" => intval($_POST[\"draw\"]), \n \"recordsTotal\" => $this->crud_model->get_all_data_contact(), \n \"recordsFiltered\" => $this->crud_model->get_filtered_data_contact(), \n \"data\" => $data \n ); \n echo json_encode($output); \n }", "function smsSending($mobile, $sign, $args = array(), $templateId = 'SMS_585014') {\n $smssettings = unserialize(variable_get('smssettings'));\n $c = new TopClient;\n $c->format = 'json';\n $c->appkey = $smssettings['appkey'];//$appkey;\n $c->secretKey = $smssettings['secret'];//$secret;\n $req = new AlibabaAliqinFcSmsNumSendRequest;\n $req->setExtend(\"\");\n $req->setSmsType(\"normal\");\n $req->setSmsFreeSignName($sign);\n $param = json_encode($args);\n $req->setSmsParam($param);\n $req->setRecNum($mobile);\n $req->setSmsTemplateCode($templateId);//\n $resp = $c->execute($req);\n return $resp;\n}", "public function sentCount();", "public function batchEmail($sender)\n\t{\n\t\t$total = 0;\n\t\t$success = 0;\n\t\t$mailer = Yii::app()->email;\n\n\t\tforeach($this->emailList as $record)\n\t\t{\n\t\t\tif (!empty($record->emailAddress) && $mailer->send(\n\t\t\t\t$record->emailAddress,\n\t\t\t\t$this->emailSubject, \n\t\t\t\t$this->emailContent, \n\t\t\t\t$sender,\n\t\t\t\t$this->attachments\n\t\t\t))\n\t\t\t\t$success++;\n\t\t\telse if (!empty($record->alternateEmail) && $mailer->send(\n\t\t\t\t$record->alternateEmail,\n\t\t\t\t$this->emailSubject, \n\t\t\t\t$this->emailContent, \n\t\t\t\t$sender,\n\t\t\t\t$this->attachments\n\t\t\t))\n\t\t\t\t$success++;\n\t\t\t$total++;\n\t\t}\n\t\treturn array (\n\t\t\t'count' => $success,\n\t\t\t'total' => $total\n\t\t);\n\t}", "function createMsg($restaurant) {\r\n \r\n $total_sum = 0;\r\n \r\n $msg = $restaurant[\"name_he\"] . \"\r\n\";\r\n $msg .= $restaurant[\"whatsapp_group_name\"] . \"\r\n\";\r\n $msg .= $restaurant[\"whatsapp_group_creator\"] . \"\r\n\r\n\";\r\n \r\n $msg .= \"רשימת הזמנות היום\" . \"\r\n\r\n\";\r\n \r\n foreach($restaurant[\"orders\"] as $order) {\r\n $total_sum = $total_sum + $order[\"sum_order\"];\r\n \r\n $dateArr = explode('-', $order[\"date\"]);\r\n $day = $dateArr[0];\r\n $month = $dateArr[1];\r\n $year = $dateArr[2];\r\n $msg .= \"תאריך \" . $year . \"-\" . $month . \"-\" . $day . \"*\r\n\";\r\n $msg .= \"זמן \" . $order[\"time\"] . \"\r\n\";\r\n $msg .= \"מספר הזמנה \" . $order[\"id\"] . \"\r\n\";\r\n $msg .= \"סכום ההזמנה \" . $order[\"sum_order\"] . \"\r\n\r\n\";\r\n }\r\n $msg .= \"\r\n\";\r\n $msg .= \"-----------------\" . \"\r\n\";\r\n\r\n $msg .= \"סה״כ הזמנות \" . count($restaurant[\"orders\"]) . \"\r\n\";\r\n $msg .= \"סכום סה״כ הזמנות \" .$total_sum . \"\r\n\r\n\";\r\n \r\n $msg .= \"יתרה \" . $restaurant[\"balance\"];\r\n\r\n\r\n return $msg;\r\n}", "public function get_notification_list_for_order_post()\n {\n $response = new StdClass();\n $result = array();\n $staff_mobile_no=$this->input->post('staff_mobile_no');\n $get_notification_data = $this->Supervisor->get_notification_data($staff_mobile_no);\n if(!empty($get_notification_data))\n {\n foreach ($get_notification_data as $row)\n {\n $data['order_id'] = $row['order_id'];\n $data['customer_mobile_no'] = $row['customer_mobile_no'];\n $data['date_time'] = $row['date_time'];\n $data['title'] = $row['title'];\n $data['message'] = $row['message'];\n $data['status'] ='1';\n\n array_push($result,$data);\n\n } \n \n $response->data = $result;\n }\n else\n {\n $data['message'] = 'failed';\n $data['status'] ='0';\n array_push($result , $data);\n }\n $response->data = $result;\n echo json_output($response);\n }", "public function validate_contact(){\n\t\t$er_flag = true;\t\t\n\t\tfor($i = 0; $i < $this->request->data['Client']['contact_count']; $i++){\n\t\t\tif($this->request->data['Client']['first_name_'.$i] == ''){\n\t\t\t\t$error[$i]['fname'] = 'Please enter the first name';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t\tif($this->request->data['Client']['mobile_'.$i] == ''){\n\t\t\t\t$error[$i]['mobile'] = 'Please enter the mobile';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t\t$mobile = $this->request->data['Client']['mobile_'.$i];\n\t\t\tif(!is_numeric($mobile)){\n\t\t\t\t$error[$i]['mobile'] = 'Please enter the numeric only';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t\tif(strlen($mobile) < 10){\n\t\t\t\t$error[$i]['mobile'] = 'Mobile no. must be min. 10 digits';\n\t\t\t\t$er_flag = false;\n\t\t\t}\t\t\t\t\t\t\n\t\t\tif($this->request->data['Client']['email_'.$i] == ''){\n\t\t\t\t$error[$i]['email'] = 'Please enter the email address';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t\t// validate email\n\t\t\tif($this->Functions->email_validation($this->request->data['Client']['email_'.$i])){\n\t\t\t\t$error[$i]['email'] = 'Please enter valid email address';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t\tif($this->request->data['Client']['title_'.$i] == ''){\n\t\t\t\t$error[$i]['title'] = 'Please select the title';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t\tif($this->request->data['Client']['designation_'.$i] == ''){\n\t\t\t\t$error[$i]['designation'] = 'Please select the designation';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t\tif($this->request->data['Client']['branch_'.$i] == ''){\n\t\t\t\t$error[$i]['branch'] = 'Please select the branch';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t}\n\t\t$this->set('errorData', $error);\n\t\treturn $er_flag;\n\t}", "private function deliverySms($type,$state,$messageID,$from,$to,$message,$count){\n $datum = Date(\"Y-m-d\");\n $count = $count + 1;\n\n if (isset($this->_stateIDs[$state])){\n $stateId = $this->_stateIDs[$state]; \n } else {\n $stateId = 0;\n }\n \n /*\n * Uncomment if is needed to disable sending at specific time\n */\n // $sleep_time = date('H');\n // $sleep = array('21', '22','23','00','01','02','03','04','05','06');\n\n // if not between 21:00 - 07:00\n // if(!in_array($sleep_time, $sleep)){\n\n if ($type !== \"bulk\") { \n $to = $this->cleanMob($to, $state);\n if ($to == false) { \n return \"wrong number\";\n }\n }\n //ucitavanje liste odjava \n if ($type == \"reorder\") { \n $suppression = $this->getSuppressionList($state);\n $supArr = array();\n\n foreach ($suppression as $sNumber){\n array_push($supArr, $sNumber['number']);\n }\n\n if (in_array($to, $supArr) == true) {\n return \"number unsubscribed\";\n }\n } \n\n // konacno filtriranje samo brojeva \n $to = preg_replace('/[^0-9]/', '', $to);\n\n $firstTwo = substr($to, 0, 2);\n\n if ($state == \"XK\" && $firstTwo == \"49\") {\n $responsePhone = \"+386\".$to; \n $to = \"00386\".$to;\n } else {\n $responsePhone = \"+\".$this->_areaCodes[$state].$to; \n $to = \"00\".$this->_areaCodes[$state].$to;\n }\n\n \n $message = strip_tags($message);\n\n $msg = $this->cleanUTF($message, $state);\n $ch = curl_init('http://bulk.mobile-gw.com:9000/?');\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"username=*******&password=*********&allow_adaption=1&messageid={$messageID}&status_report=3&origin={$from}&call-number={$to}&text=\".urlencode($msg));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n curl_setopt($ch, CURLOPT_HEADER, 1);\n $send_response = curl_exec ($ch);\n curl_close ($ch);\n\n $getRow = explode(\"\\n\", $send_response);\n //******** Hvatanje SMSID broja\n // $getId = explode(\":\", $getRow[2]);\n // $smsId = trim($getId[1]);\n\n\n $getId = explode(\":\", $getRow[2]);\n $smsIdRaw = trim($getId[1]);\n\n $countSeparator = substr_count($smsIdRaw,\";\");\n $messageNumber = $countSeparator + 1;\n $smsIdExploaded = explode(\";\", $smsIdRaw);\n\n $smsId = $smsIdExploaded[0];\n //******** Hvatanje Statusa slanja\n $getSecond = explode(\":\", $getRow[6]); \n $getCode = explode(\",\", $getSecond[1]);\n $statusCode = trim($getCode[0]);\n\n $statusNum = 0;\n if ($statusCode == \"00\"){\n $statusNum = 1;\n } else {\n $statusNum = 3;\n }\n\n $this->insertMessage($smsId,$from,$to,$messageID,$msg,$statusNum,$messageNumber,$stateId); \n if($type == \"bulk\"){\n //echo json_encode(array(\"count\"=>$count, \"number\"=>$to, \"response\"=>$send_response));\n $writeFile ='{\"MessageId\":\"'.$messageID.'\",\"SenderId\":\"'.$from.'\",\"Recipient\":\"'.$to.'\",\"Response\":\"'.$send_response.'\",\"Message\":\"'.$msg.'\"},\\n';\n $file = fopen($this->_logRoot.\"reports/bulk/\".$messageID.\".txt\", \"a\");\n file_put_contents($this->_logRoot.\"reports/bulk/\".$messageID.\".txt\", $writeFile, FILE_APPEND);\n fclose($file);\n } else if ($type == \"reorder\"){\n //echo json_encode(array(\"count\"=>$count, \"number\"=>$to, \"response\"=>$send_response));\n $writeFile ='{\"MessageId\":\"'.$messageID.'\",\"SenderId\":\"'.$from.'\",\"Recipient\":\"'.$to.'\",\"Response\":\"'.$send_response.'\",\"Message\":\"'.$msg.'\"},\\n';\n $file = fopen($this->_logRoot.\"reports/reorder/\".$messageID.\".txt\", \"a\");\n file_put_contents($this->_logRoot.\"reports/reorder/\".$messageID.\".txt\", $writeFile, FILE_APPEND);\n fclose($file);\n } else {\n $writeFile ='{\"MessageId\":\"'.$messageID.'\",\"SenderId\":\"'.$from.'\",\"Recipient\":\"'.$to.'\",\"Response\":\"'.$send_response.'\",\"Message\":\"'.$msg.'\",\"Quantity\":\"'.$messageNumber.'\"},\\n';\n $existCount2 = 0;\n if (file_exists($this->_logRoot.\"reports/orders/\".$datum.\".txt\")){\n $existCount2 = 1;\n }\n\n $file = fopen($this->_logRoot.\"reports/orders/\".$datum.\".txt\", \"a\");\n file_put_contents($this->_logRoot.\"reports/orders/\".$datum.\".txt\", $writeFile, FILE_APPEND);\n fclose($file);\n\n if ($existCount2 == 0){\n chmod($this->_logRoot.\"reports/orders/\".$datum.\".txt\", 0777);\n }\n }\n $responseJson = '{\"status\":\"'.$statusNum.'\",\"msisdn\":\"'.$responsePhone.'\"}';\n return $responseJson;\n // }else{\n // return 'sleep time';\n // }\n }", "public function pushContacts()\n {\n if(isset($_POST['send_mail']))\n {\n $this->_genCSV();\n $csvFile = Mage::getBaseDir() . '/var/export/contacts.csv';\n $baseUrl = 'https://api.dotmailer.com';\n $url = $baseUrl . \"/v2/address-books/\" . $this->dmAddressBook . \"/contacts/import\";\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt(\n $ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: multipart/form-data')\n );\n curl_setopt($ch, CURLAUTH_BASIC, CURLAUTH_DIGEST);\n curl_setopt(\n $ch, CURLOPT_USERPWD,\n $this->apiUsername . ':' . $this->apiPassword\n );\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false);\n $args['file'] = curl_file_create(\n $csvFile, 'text/csv'\n );\n curl_setopt($ch, CURLOPT_POSTFIELDS, $args);\n $response = json_decode(curl_exec($ch));\n var_dump($response);\n } else {\n echo $this->_html();\n }\n }", "public function update_contact($data)\n {\n $add = array();\n foreach (array('nick', 'firstname', 'lastname', 'thirdname', 'title', 'company', 'comp_dep', 'comp_role'\n ,'comp_address', 'comp_address2', 'comp_street', 'comp_zip', 'comp_location', 'comp_region'\n ,'comp_country', 'comp_cellular', 'comp_www', 'comp_fax', 'address', 'address2', 'street', 'zip'\n ,'location', 'region', 'country', 'email1', 'email2', 'bday_cal_evt_id', 'tel_private', 'tel_business'\n ,'cellular', 'fax', 'www', 'birthday', 'customer_number', 'comments') as $k) {\n if (isset($data[$k])) {\n $add[] = $k . '=\"' . $this->esc($data[$k]) . '\"';\n }\n }\n if (isset($data['group'])) {\n $this->query('DELETE FROM '.$this->Tbl['adb_adr_group'].' WHERE `aid`='.intval($data['aid']).' AND uid='.$this->uid);\n foreach ($data['group'] as $gid) {\n $this->query('INSERT '.$this->Tbl['adb_adr_group'].' SET `aid`='.intval($data['aid']).', `gid`='.intval($gid).', `uid`='.intval($this->uid));\n }\n }\n foreach (array_keys($this->get_freefield_types($this->uid)) as $type) {\n if (empty($data['free'][$type])) {\n $this->query('DELETE FROM '.$this->Tbl['adb_freefield'].' WHERE `aid`='.intval($data['aid']).' AND type_id='.intval($type));\n } else {\n $this->query('REPLACE INTO '.$this->Tbl['adb_freefield'].' SET `aid`='.intval($data['aid']).', `type_id`='.intval($type).', `value`=\"'.$this->esc($data['free'][$type]).'\"');\n }\n }\n\n if (!empty($add)) {\n $where = 'aid='.intval($data['aid']).' AND owner='.intval($this->uid);\n if (isset($data['own_vcf'])) {\n list ($adrid) = $this->fetchrow($this->query('SELECT u.contactid FROM '.$this->Tbl['user'].' u,'.$this->Tbl['adb_address'].' a'\n .' WHERE u.uid='.intval($this->uid).' AND a.aid=u.contactid'));\n if (0 != $adrid) {\n $where = 'aid='.intval($adrid);\n }\n }\n $query = 'UPDATE '.$this->Tbl['adb_address'].' SET `uuid`=\"'.basics::uuid().'\"'.','.implode(',', $add).' WHERE '.$where;\n return $this->query($query);\n }\n return false;\n }", "public function getClientCountInfo()\n {\n $payload = JWTAuth::parseToken()->getPayload();\n $logged_userid = $payload['login_db_userid']; \n $c_account_key = $payload['c_acc_key'];\n $db_name = $payload['db_name'];\n $agency_id = $payload['agencyid'];\n $qry_profpic = DB::select(\"SELECT * FROM [$db_name].[dbo].[user_accounts] \n WHERE user_id = \".$logged_userid);\n $userid = $qry_profpic[0]->user_id;\n $cw_Puserid = $qry_profpic[0]->case_worker_parent_user_id;\n $cw_agency_id = $qry_profpic[0]->agency_id;\n \n $dashclientarr= [array('responsecount' => $userid,'msgcount' => $cw_agency_id,'opencasecount' => $cw_Puserid )];\n \n return $dashclientarr;\n }", "public function getData()\n {\n $this->validateData();\n $data = array(\n \"service\" => $this->getService(),\n \"partner\" => $this->getPartner(),\n \"_input_charset\" => $this->getInputCharset(),\n \"notify_url\" => $this->getNotifyUrl(),\n \"account_name\" => $this->getAccountName(),\n \"email\" => $this->getEmail(),\n \"detail_data\" => $this->getDetailData(),\n \"batch_no\" => $this->getBatchNo(),\n \"batch_num\" => $this->getBatchNum(),\n \"batch_fee\" => $this->getBatchFee(),\n \"pay_date\" => $this->getPayDate(),\n );\n $data = array_filter($data);\n $data['sign'] = $this->getParamsSignature($data);\n $data['sign_type'] = $this->getSignType();\n return $data;\n }", "function getCount ($data){\nreturn count($data);\n \n}", "static function getCountAllNewMessage_inbox()\r\n\t{\r\n\t\t//$arrAllStatus[] = funcs::getCountNewMessage_inbox(\"sms\");\r\n\t\t//$arrAllStatus[] = funcs::getCountNewMessage_inbox(\"email\");\r\n\t\t$arrAllStatus[] = 0;\r\n\t\t$arrAllStatus[] = 0;\r\n\t\t$arrAllStatus[] = funcs::getCountNewMessage_inbox();\r\n\t\t$arrAllStatus[] = 0;\r\n\t\t//$arrAllStatus[] = funcs::getCountNewSuggetion_inbox();\r\n\r\n\t\treturn $arrAllStatus;\r\n\t}", "function messages( $array ) {\n\t\t$this->messages_list = $array;\n\t\t}", "public function setValuesFromDataArray($dataArray) {\n self::$debugger->belch(\"48 setValuesFromDataArray() dataArray\", $dataArray, -1);\n self::$debugger->belchTrace('49 from setValuesFromDataArray() dataArray', $dataArray, -1);\n $this->commId = (isset($dataArray['commId']) ? $dataArray['commId'] \n : (isset($dataArray['communicationId']) ? $dataArray['communicationId'] : 0));\n $this->recipientId = (isset($dataArray['recipient']) ? $dataArray['recipient'] \n : (isset($dataArray['recipientId']) ? $dataArray['recipientId'] \n : (isset($dataArray['personId']) ? $dataArray['personId'] : 0)));\n $this->recipientName = (isset($dataArray['name']) ? $dataArray['name'] \n : (isset($dataArray['recipientName']) ? $dataArray['recipientName'] : 0));\n $this->dateSent = ((isset($dataArray['dateSent'])) ? $dataArray['dateSent'] : '');\n $this->sender = (isset($dataArray['sender']) ? $dataArray['sender'] : 0);\n $this->to = (isset($dataArray['emailTo']) ? $dataArray['emailTo'] \n : ((isset($dataArray['to'])) ? $dataArray['to'] : ''));\n if ($this->to =='') {\n $name = (isset($dataArray['name']) && $dataArray['name'] !='') ? $dataArray['name'] : '';\n $email = (isset($dataArray['email']) && $dataArray['email'] !='') ? $dataArray['email'] : '';\n $this->setToFieldFromNameAndEmail($name, $email);\n }\n $this->message =(isset($dataArray['contentText']) ? $dataArray['contentText'] : '');\n $this->inResponseTo = (isset($dataArray['inResponseTo']) ? $dataArray['inResponseTo'] : 0);\n // mrEmailWidgetId may have been pre-set by the caller, so do not override the current value. // WHAT? 7/15/10\n if (isset($dataArray['emailWidgetId']) && ($this->mrEmailWidgetId() == '')) $this->setMrEmailWidgetId($dataArray['emailWidgetId']); // added conjunctive clause 7/17/10\n // The following attributes may have been pre-set by beMediaReceived(), so do not override the current value. // WHAT? 7/15/10\n if (isset($dataArray['type'])) $this->commType = $dataArray['type'];\n else if (isset($dataArray['commType'])) $this->commType = $dataArray['commType'];\n if (isset($dataArray['emailFrom'])) $this->from = $dataArray['emailFrom'];\n else if (isset($dataArray['from'])) $this->from = $dataArray['from'];\n if (isset($dataArray['emailSubject'])) $this->subject = $dataArray['emailSubject'];\n if (isset($dataArray['bcc'])) $this->bcc = $dataArray['bcc'];\n self::$debugger->belch(\"50 setValuesFromDataArray() this\", $this, 0);\n // $this->referencedWorks is unaffected.\n }", "public function __construct( array $numbers ,$message)\n {\n\n $this->numbers = $numbers;\n $this->message = $message;\n\n }", "public static function nbContactsTotal() {\n $total = \\Phonebook\\Models\\CoreModel::findAll();\n $full_contacts = Count($total);\n return $full_contacts;\n echo $this->templates->render('home');\n }", "public function sendlaneSubscribe($data = array())\n {\n \n if(count($data) && $this->checkCache()){\n Log::info('Subscribing '.$data['email'].' to list '.$data['list_id']);\n $return = array();\n $return['result'] = 'error';\n $api_key = env('SENDLANE_API_KEY');\n $hash_key = env('SENDLANE_HASH_KEY');\n $api_url = env('SENDLANE_API_URL');\n $command = 'list-subscriber-add';\n $url = $api_url.$command;\n $post = array('api' => $api_key, 'hash' => $hash_key, 'list_id' => $data['list_id'], 'email' => $data['email'], 'first_name' => $data['first_name'], 'last_name' => $data['last_name']);\n $ch = curl_init();\n Log::info('cUrl initiated');\n curl_setopt($ch,CURLOPT_URL, $url);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n $result = curl_exec($ch);\n if (!curl_errno($ch)) {\n $info = curl_getinfo($ch);\n if($info['http_code'] == 200){\n Log::info( 'Took '. $info['total_time']. ' seconds to send a request to '. $info['url']. \"\\n\");\n $return['result'] = 'OK';\n $stuff = json_decode($result);\n $return['response'] = $stuff;\n return json_encode($return);\n }else{\n\n Log::error('Failed getting '.$info['url'].' : response code '.$info['http_code']);\n }\n }\n return $return; \n\n }\n }", "private function memberAddOrder($data){\n $fields = array(\n 'app_id' => $this->appId,\n 'data' => array(\n 'msg_type' => 'order_add',\n 'order_id' => $data['order_id']\n ),\n 'headings' => [\n 'en' => '你有新的訂單',\n 'zh-Hant' => '你有新的訂單'\n ],\n 'contents' => [\n 'en' => '你有新的訂單待處理',\n 'zh-Hant' => '你有新的訂單待處理'\n ],\n 'small_icon' => 'ic_stat_onesignal_default',\n 'ios_badgeType' => 'Increase',\n 'ios_badgeCount' => 1,\n 'filters' => array(\n array(\n 'field' => 'tag',\n 'key' => 'id',\n 'relation' => '=',\n 'value' => $data['store_id']\n )\n )\n );\n return $fields;\n }", "public function getAll() \r\n { \r\n $a['number'] = $this->number;\r\n $a['name'] = $this->name;\r\n $a['email'] = $this->email;\r\n $a['address'] = $this->address;\r\n $a['postalcode'] = $this->postalcode;\r\n $a['city'] = $this->city;\r\n $a['country'] = $this->country;\r\n $a['ean'] = $this->ean;\r\n $a['website'] = $this->website;\r\n $a['dgh'] = $this->dgh;\r\n $a['phone'] = $this->phone;\r\n return $a;\r\n }", "private function recipients()\n {\n if (request('type') === 'bulk') {\n return $recipients = count(Contact::active()->where('group_id', request('recipients'))->pluck('mobile'));\n } elseif (request('type') === 'single') {\n return $recipients = 1;\n }\n }", "public function GetProgress($primary_id,$data)\n\t{\n\n\t\t$result = $this->index($primary_id);\n\n\t\tif ($result->count() > 0) {\n\t\t\t$delete_phone = $this->deletWhere('contactinfo_id',$primary_id);\n\t\t}\n\n\t\t$save = [];\n\t\tforeach ($data['phone'] as $key => $value) {\n if($value != ''){\n $save = $this->model->create([\n \t'contactinfo_id'=>$primary_id,\n \t'phone'=>$value\n ]);\n }\n }\n return $save;\n\t}", "public function exportNewCustomer($data) {\n\t\t$err = 0;\n\t\t$this->load->language('extension/module/sendpulse');\n\t\tif(isset($data['newsletter']) && $data['newsletter'] = 1 && $this->config->get('sendpulse_auto_add') == 1 && $this->config->get('sendpulse_book_default') > 0){\t\t\n\t\t\t$emails = array();\n\t\t\t$emails[] = array(\n\t\t\t\t\t'email' => $data['email'],\n\t\t\t\t\t'variables' => array(\n\t\t\t\t\t\t'Phone' => $data['telephone'],\n\t\t\t\t\t\t//$this->language->get('entry_firstname') => $data['firstname'].' '.$data['lastname'],\n\t\t\t\t\t\t'name' => $data['firstname'].' '.$data['lastname'],\n\t\t\t\t\t\t$this->language->get('entry_fax') => $data['fax'],\n\t\t\t\t\t\t$this->language->get('entry_status') => 1\n\t\t\t\t\t)\n\t\t\t);\n\n\t\t\ttry {\n\t\t\t\t$api = new SendpulseApi( $this->config->get('sendpulse_id'), $this->config->get('sendpulse_secret'), TOKEN_STORAGE );\n\t\t\t\t$result = $api->addEmails( $this->config->get('sendpulse_book_default'), $emails );\n\t\t\t\t\n\t\t\t\tif (isset($result->is_error) && $result->is_error) {\n\t\t\t\t$msg = isset($result->message) ? $result->message : 'Something went wrong';\n\t\t\t\tthrow new Exception( $msg );\n\t\t\t\t}\n\t\t\t\t$err = 1;\n\t\t\t\t$this->db->query(\"UPDATE \" . DB_PREFIX . \"setting SET value = value+ 1 WHERE `key` = 'sendpulse_count'\");\n\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$err = 0;\n\t\t\t}\n\t\t}\n\n\t\treturn $err;\n\t}", "public function getRecipientsData(Request $request)\n {\n if ($request->has('client_group_ids')) {\n $client_group_ids = $request->client_group_ids;\n if (is_array($client_group_ids) && count($client_group_ids) > 0) {\n $count = Client::whereIn('groupid', $client_group_ids)->count();\n return response()->json(['status' => 'success', 'data' => $count]);\n } else {\n return response()->json(['status' => 'success', 'data' => 0]);\n }\n } elseif ($request->has('contact_list_ids')) {\n $contact_list_ids = $request->contact_list_ids;\n if (is_array($contact_list_ids) && count($contact_list_ids) > 0) {\n $count = ContactList::whereIn('pid', $contact_list_ids)->count();\n return response()->json(['status' => 'success', 'data' => $count]);\n } else {\n return response()->json(['status' => 'success', 'data' => 0]);\n }\n } else {\n return response()->json(['status' => 'success', 'data' => 0]);\n }\n }", "function RequestData () {\n\n\t\t//create GRequest object + post xml (googlecart.php line: 962)\n\t\trequire_once('library/googlerequest.php');\n\t\t$GRequest = new GoogleRequest($this->merchant_id, $this->merchant_key);\n\n\t\twhile($this->has_more_notifications == \"true\") {\n\t\t\t$this->poll_request_xml = $this->GetPollRequestXML();\n\t\t\t$this->poll_result = $GRequest->SendReq($this->server_url,\n\t\t\t\t$GRequest->GetAuthenticationHeaders(), $this->poll_request_xml);\n\n\t\t\t//Check response code\n\t\t\tif($this->poll_result[0] == \"200\") {\n\t\t\t\t$this->ExtractNotifications();\n\t\t\t}\n\t\t\telse return false;\n\n\t\t\tif($this->get_all_notifications == false) {\n\t\t\t\t$this->has_more_notifications == \"false\";\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function retain_contact_list(){\n\t\t$contact_data = array();\t\t\n\t\tforeach($this->request->data['Client'] as $key => $data){ \n\t\t\t// for the form fields\n\t\t\tif($new_key = $this->get_key_val($key)){ \n\t\t\t\t$contact_data['Contact'][$new_key][] = $data;\n\t\t\t}\t\t\t\n\t\t}\n\t\t$this->request->data['Contact'] = '1';\n\t\t$this->set('contact_list', $contact_data);\n\t}", "function get_new_conversation_count($request)\n{\n global $redis_server;\n\n if(!validate_fields($request, array('user'))) {\n die(bad_request('missing field'));\n }\n\n $client = new Predis\\Client($redis_server);\n $count = $client->scard(\"user-{$request->data['user']}-new-conversations\");\n \n return json_encode(array('code' => '1', 'count' => $count, 'user' => $request->data['user'])); \n}", "function sendlistGet($arrayRestInputs){\n if((file_exists($arrayRestInputs['enginebasedir'] . '/lib/Send.php')) && (file_exists($arrayRestInputs['enginebasedir'] . '/lib/NodeToken.php')) ){\n require_once($arrayRestInputs['enginebasedir'] . '/lib/Send.php');\n require_once($arrayRestInputs['enginebasedir'] . '/lib/NodeToken.php');\n $objectToken = new NodeToken ();\n if($objectToken->retrieveToken($arrayRestInputs['token'])){\n $objectSend = new Send();\n $sendlistReturn = $objectSend->getSendList($objectToken->uid);\n if($sendlistReturn < 0){\n return '';\n }\n else{\n if(is_array($sendlistReturn)){\n $limit = count($sendlistReturn);\n for($i = 0; $i < $limit; $i++){\n $sendlistReturn[$i]['selfsenddate'] = date(DATE_ATOM, $sendlistReturn[$i]['selfsenddate']);\n $sendlistReturn[$i]['selfseen'] = date(DATE_ATOM, $sendlistReturn[$i]['selfseen']);\n $sendlistReturn[$i]['othersenddate'] = date(DATE_ATOM, $sendlistReturn[$i]['othersenddate']);\n $sendlistReturn[$i]['otherseen'] = date(DATE_ATOM, $sendlistReturn[$i]['otherseen']);\n }\n }\n return $sendlistReturn;\n }\n }\n else{\n return '';\n }\n }\n else{\n return '';\n }\n}", "private function _send_to_campaign_monitor($data, $settings)\n\t{\n\t\t// Campaign Monitor\n\t\trequire_once('libraries/csrest_subscribers.php');\n\n\t\t$api_key = $settings->api_key;\n\t\t$list_id = $settings->list_id;\n\t\t\n\t\t$campaign_monitor = new CS_REST_Subscribers($list_id, $api_key);\n\t\t\n\t\t// Setup array of custom field tags and values for Campaign Monitor\n\t\t// Needs to have the CM custom field tag as the index the field's value as the array's value\n\t\t\n\t\t$custom_field_values = array();\n\t\tforeach (unserialize($settings->custom_fields) as $custom_field_settings) \n\t\t{\n\t\t\tif ( ! empty($custom_field_settings['name']) \n\t\t\t\tAND ! empty($custom_field_settings['tag']))\n\t\t\t{\n\t\t\t\t// If this is a multiple option field we need to split things up\n\t\t\t\tif (isset($custom_field_settings['multiple']) \n\t\t\t\t\tAND $custom_field_settings['multiple'] == 'yes')\n\t\t\t\t{\n\t\t\t\t\tif ( ! is_array($data[$custom_field_settings['name']]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$data[$custom_field_settings['name']] = preg_split(\"/(?:,|\\n|\\r)/\", $data[$custom_field_settings['name']], -1, PREG_SPLIT_NO_EMPTY);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add a custom field value for each item\n\t\t\t\t\tforeach ($data[$custom_field_settings['name']] as $index => $value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$custom_field_values[] = array(\n\t\t\t\t\t\t\t'Key' => $custom_field_settings['tag'],\n\t\t\t\t\t\t\t'Value' => trim($data[$custom_field_settings['name']][$index])\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$custom_field_values[] = array(\n\t\t\t\t\t\t'Key' => $custom_field_settings['tag'],\n\t\t\t\t\t\t'Value' => $data[$custom_field_settings['name']]\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$result = $campaign_monitor->add(array(\n\t\t\t'EmailAddress' => $data[$settings->email_field],\n\t\t\t'Name' => $data[$settings->name_field],\n\t\t\t'CustomFields' => $custom_field_values,\n\t\t\t'Resubscribe' => true\n\t\t));\n\n\t\tif ( ! $result->was_successful())\n\t\t{\n\t\t\t$this->EE->load->library('logger');\n\t\t\t$message = (isset($result->response->Message)) ? $result->response->Message : $result->response['message'];\n\t\t\t$this->EE->logger->log_action(\"Subscriber Campaign Monitor API Error: \".$result->http_status_code.\": \".$message);\n\t\t}\n\t}", "function widraw_amount_request_mail($send_data)\n {\n $to_email_address = $send_data['sender_email'];\n $subject = $send_data['subject'];\n $message = 'Hi, '.ucfirst($send_data['sender_name']).' '.$send_data['message'];\n $data['msg'] = $message;\n $mess = $this->load->view('mailer/email_template', $data, true);\n $result_dfee = $this->common_model->sendEmails($to_email_address, $subject, $mess);\n if ($result_dfee) {\n return true;\n } else {\n return false;\n }\n }", "public function buildData()\n {\n $message = $this->getMessage();\n\n if ($this->data == []) {\n return [\n 'success' => false,\n 'message' => $message\n ];\n }\n\n return [\n 'success' => false,\n 'message' => $message,\n 'data' => (object) $this->data\n ];\n }", "public function getData()\n {\n if (empty($this->getFeeType())) {\n $this->setFeeType('CNY');\n }\n\n $this->validate(\n 'mch_id',\n 'api_key',\n 'body',\n 'out_trade_no',\n 'total_fee',\n 'notify_url',\n 'trade_type',\n 'spbill_create_ip',\n 'device_info',\n 'auth_code'\n );\n\n $data = array(\n 'appid' => $this->getAppId(),//*\n 'mch_id' => $this->getMchId(),\n 'sub_appid' => $this->getSubAppId(),\n 'sub_mch_id' => $this->getSubMchId(),\n 'device_info' => $this->getDeviceInfo(),//*\n 'body' => $this->getBody(),//*\n 'attach' => $this->getAttach(),\n 'out_trade_no' => $this->getOutTradeNo(),//*\n 'fee_type' => $this->getFeeType(),\n 'total_fee' => $this->getTotalFee(),//*\n 'spbill_create_ip' => $this->getSpbillCreateIp(),//*\n 'notify_url' => $this->getNotifyUrl(), //*\n 'trade_type' => $this->getTradeType(), //*\n 'limit_pay' => $this->getLimitPay(),\n 'promotion_tag' => $this->getPromotionTag(),\n 'nonce_str' => md5(uniqid()),//*\n 'auth_code' => $this->getAuthCode()\n );\n\n $data = array_filter($data);\n\n $data['sign'] = Helper::sign($data, $this->getApiKey());\n\n return $data;\n }", "public function userAskToBeNotified(){\n// $message = new Message();\n// $message->setHeure(\"19h50\");\n// $message->setVille(\"TO\");\n// $message->setStatue(\"Retart\");\n// $message->setPhoneNumber(\"+15143468023\");\n// $message->setMessage(\"Salut je fait un test\");\n// $messagemodel->sendSMS($message);\n $arryNotif [0]= $_POST[\"vol\"];\n $arryNotif[1] = $_POST[\"phone\"];\n $arryNotif[2] = $_POST[\"date\"];\n $arryNotif[3] = $_POST[\"status\"];\n $notifDAO = new NotifyDAO();\n $notifDAO->create($arryNotif);\n\n }", "function sendBulkUnicode($username, $encryp_password, $senderid, $messageUnicode, $mobileNos, $deptSecureKey) {\n $finalmessage = string_to_finalmessage(trim($messageUnicode));\n $key = hash('sha512', trim($username) . trim($senderid) . trim($finalmessage) . trim($deptSecureKey));\n $data = array(\n \"username\" => trim($username), \"password\" => trim($encryp_password),\n \"senderid\" => trim($senderid),\n \"content\" => trim($finalmessage),\n \"smsservicetype\" => \"unicodemsg\",\n \"bulkmobno\" => trim($mobileNos),\n \"key\" => trim($key)\n );\n post_to_url_unicode(\"https://msdgweb.mgov.gov.in/esms/sendsmsrequest\", $data); //calling post_to_url_unicode to send bulk unicode sms \n}", "public function sendPaymentNotification(){\n\n $sms_recipients=\"0712345648\";//empty string\n $username = Constants::$username;\n $apiKey = Constants::$apiKey;\n $from = Constants::$from;\n // dd($apiKey);\n\n $AT = new AfricasTalking($username, $apiKey);\n // // Get one of the services\n $recipients=\"\";\n $sms = $AT->sms();\n //user has a valid mobile number\n $phone = substr($sms_recipients,1);\n $recipients='+254'.$phone;//$data['phone'];//'+254712345678'\n // dd($recipients);\n\n // // Set the numbers you want to send to in international format\n \n // // Set your message\n $message = \"Testing SMS.\";\n\n // // Set your shortCode or senderId\n \n // Get one of the services\n try {\n // Thats it, hit send and we'll take care of the rest\n $result = $sms->send([\n 'to' => $recipients,\n 'message' => $message,\n 'from' => $from\n ]);\n\n print_r($result);\n \n } catch (Exception $e) {\n //echo \"Error: \".$e->getMessage();\n $result=$e->getMessage();\n print_r($result);\n }\n\n \n }", "public function build_data() {\n $this->total_collection = (int)count($this->feeds);\n $redis_total_set = (int)$this->redis->hget($this->key_name, 'total:set'); \n \n $key = $this->redis->hgetall($this->key_name);\n $hosted_feeds = $this->group_and_build(); \n\n if(!$key || $redis_total_set !== $this->total_collection) {\n //echo \"Processing: Insert Data into Redis\";\n //insert data into redis\n $this->redis->hset($this->key_name, 'total:set', $this->total_collection);\n $page = 0;\n foreach($hosted_feeds as $feed_group => $feed_list) {\n $page_number = ++$page;\n $spring_data = Array($feed_group => $feed_list);\n $this->redis->hset($this->key_name, \"set:$page_number\", json_encode($spring_data));\n $spring_data = Null;\n }\n } \n \n }", "public function store(Request $request)\n {\n if (!Auth::check()) return Redirect::route('home');\n $mobiles =$request->number;\n foreach ($mobiles as $value) {\n $send = new send;\n $send->schedule_id = $request->campain;\n $send->user_id = Auth::id();\n $send->mobile = $value;\n $send->save();\n }\n $contact=user::find( Auth::id());\n return view('campain.sendSms',compact('contact'));\n }", "public function getData() {\n\t\treturn [\n\t\t\t16 => [\"type\" => 0, \"value\" => $this->size]\n\t\t];\n\t}", "function send($accessToken, $jsonData){\n // https://graph.facebook.com/v2.6/me/messages?access_token=<PAGE_ACCESS_TOKEN>\n $url = \"https://graph.facebook.com/v2.6/me/messages?access_token=\".$accessToken;\n $ch =curl_init($url);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);\n curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, True);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, False);\n// if(!empty($input[\"entry\"][0][\"messaging\"][0][\"message\"])) {\n curl_exec($ch);\n\n $errors = curl_error($ch);\n $dataCourseponse = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\n var_dump($errors);\n var_dump($dataCourseponse);\n\n curl_close($ch);\n// }\n\n }", "public function vxMessageCreateCheck() {\n\t\t$rt = array();\n\t\t\n\t\t$rt['errors'] = 0;\n\t\t\n\t\t$rt['msg_receivers_value'] = '';\n\t\t/* receivers: raw */\n\t\t$rt['msg_receivers_a'] = array();\n\t\t/* receivers: validated */\n\t\t$rt['msg_receivers_v'] = array();\n\t\t/* receivers: validated names */\n\t\t$rt['msg_receivers_n'] = array();\n\t\t/* msg_receivers_error:\n\t\t0 => no error\n\t\t1 => empty\n\t\t2 => not exist\n\t\t999 => unspecific */\n\t\t$rt['msg_receivers_error'] = 0;\n\t\t$rt['msg_receivers_error_msg'] = array(1 => '你忘记写收件人了', 2 => '你写的一位或多位收件人不存在');\n\t\t\n\t\tif (isset($_POST['msg_receivers'])) {\n\t\t\t$rt['msg_receivers_value'] = make_single_safe($_POST['msg_receivers']);\n\t\t\tif (strlen($rt['msg_receivers_value']) > 0) {\n\t\t\t\t$rt['msg_receivers_a'] = explode(',', $rt['msg_receivers_value']);\n\t\t\t\tforeach ($rt['msg_receivers_a'] as $msg_receiver) {\n\t\t\t\t\t$msg_receiver = trim($msg_receiver);\n\t\t\t\t\t$sql = \"SELECT usr_id, usr_nick FROM babel_user WHERE usr_nick = '{$msg_receiver}'\";\n\t\t\t\t\t$rs = mysql_query($sql, $this->db);\n\t\t\t\t\tif (mysql_num_rows($rs) == 1) {\n\t\t\t\t\t\t$User = mysql_fetch_object($rs);\n\t\t\t\t\t\tmysql_free_result($rs);\n\t\t\t\t\t\tif ($User->usr_id != $this->User->usr_id) {\n\t\t\t\t\t\t\tif (!in_array($User->usr_id, $rt['msg_receivers_v'])) {\n\t\t\t\t\t\t\t\t$rt['msg_receivers_v'][] = $User->usr_id;\n\t\t\t\t\t\t\t\t$rt['msg_receivers_n'][] = $User->usr_nick;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmysql_free_result($rs);\n\t\t\t\t\t\t$rt['msg_receivers_error'] = 2;\n\t\t\t\t\t\t$rt['errors']++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($rt['msg_receivers_error'] == 0) {\n\t\t\t\t\tif (count($rt['msg_receivers_v']) == 0) {\n\t\t\t\t\t\t$rt['msg_receivers_value'] = '';\n\t\t\t\t\t\t$rt['msg_receivers_error'] = 1;\n\t\t\t\t\t\t$rt['errors']++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$rt['msg_receivers_value'] = implode(',', $rt['msg_receivers_n']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$rt['msg_receivers_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['msg_receivers_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t}\n\t\t\n\t\t$rt['msg_body_value'] = '';\n\t\t$rt['msg_body_error'] = 0;\n\t\t$rt['msg_body_error_msg'] = array(1 => '你忘记写消息内容了', 2 => '你写的消息内容超出长度限制了');\n\t\t\n\t\tif (isset($_POST['msg_body'])) {\n\t\t\t$rt['msg_body_value'] = make_multi_safe($_POST['msg_body']);\n\t\t\t$rt['msg_body_length'] = mb_strlen($rt['msg_body_value'], 'UTF-8');\n\t\t\tif ($rt['msg_body_length'] > 0) {\n\t\t\t\tif ($rt['msg_body_length'] > 200) {\n\t\t\t\t\t$rt['msg_body_error'] = 2;\n\t\t\t\t\t$rt['errors']++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$rt['msg_body_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['msg_body_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t}\n\t\t\n\t\treturn $rt;\n\t}", "public static function sendEmail($data) {\r\n\r\n // get user data to fill in automatically\r\n $user = Auth::getUser();\r\n // Email Settings\r\n // Send email back to user and the home store \r\n $cc[] = $user->email;\r\n\r\n // Live Address\r\n $to = '[email protected]';\r\n // Test address\r\n //$to = '[email protected]';\r\n\r\n // getting the From store email\r\n $allStores = Helpers::getStores();\r\n foreach ($allStores as $store) {\r\n if ($store['storeNumber'] == $user->storeNumber){\r\n //uncomment for Live\r\n //$cc[] = ($store['storeEmail']);\r\n $storeName = $store['storeName'];\r\n }\r\n\r\n }\r\n // HTML Email Version\r\n $partCount = count($data['catNum']);\r\n $msgHeader = '<b>Store Requesting: &emsp;</b>' . $storeName . '<br />';\r\n $msgHeader .= '<b>Requestor: &emsp;</b>' . $user->name . '<br />';\r\n $msgHeader .= '<b><h3>If Stolen</h3></b>';\r\n $msgHeader .= '<b>Police Department: &emsp;</b>' . $data['policeDepartment'] . '<br />';\r\n $msgHeader .= '<b>Date Reported to Police: &emsp;</b>' . $data['policeDate'] . '<br />';\r\n $msgHeader .= '<b>Police Report Number: &emsp;</b>' . $data['reportNum'] . '<br />';\r\n $msgHeader .= '<b>Reported to NER by: &emsp;</b>' . $data['nerReportBy'] . '<br />';\r\n $msgHeader .= '<b>Date Reported to NER: &emsp;</b>' . $data['nerDate'] . '<br />';\r\n $msgHeader .= '<b>Reported to Manufacturer by: &emsp;</b>' . $data['mfgReportBy'] . '<br />';\r\n $msgHeader .= '<b>Date Reported to Manufacturer: &emsp;</b>' . $data['mfgDate'] . '<br />';\r\n\r\n $msgFooter = '<h3>Details of the Disposal</h3>' . $data['disposal_comments'];\r\n $msg = '<h3>Disposal Item Line Details</h3>';\r\n $msg .= '<table border=\"1\"><tr><b><td>Cat Num</td><td>Item Num</td><td>Serial Num</td><td>Manufacturer</td><td>Qty</td><td>Disposal Type</td></b></tr>';\r\n for ($i = 0;$i<$partCount; $i++){\r\n $msg .= \"<tr>\";\r\n $msg .= \"<td>\" . $data['catNum'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['itmNum'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['serialNum'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['mfg'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['quantity'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['disposalCode'][$i] . \"</td>\";\r\n $msg .= \"</tr>\";\r\n }\r\n $msg .=\"</table>\";\r\n\r\n // Text only part of the email\r\n\r\n $textHeader = \"Store Requesting: \" . $storeName . \"\\r\\n\";\r\n $textHeader .= \"Requestor: \" . $user->name . \"\\r\\n\\r\\n\";\r\n $textHeader .= \"If Stolen: \\r\\n\\r\\n\";\r\n $textHeader .= \"Police Department: \" . $data['policeDepartment'] . \"\\r\\n\";\r\n $textHeader .= \"Date Reported to Police\" . $data['policeDate'] . \"\\r\\n\";\r\n $textHeader .= \"Police Report Number: \" . $data['reportNum'] . \"\\r\\n\";\r\n $textHeader .= \"Reported to NER by: \" . $data['nerReportBy'] . \"\\r\\n\";\r\n $textHeader .= \"Date Reported to NER\" . $data['nerDate'] . \"\\r\\n\";\r\n $textHeader .= \"Reported to Manufacturer by: \" . $data['mfgReportBy'] . \"\\r\\n\";\r\n $textHeader .= \"Date Reported to Manufacturer: \" . $data['mfgDate'] . \"\\r\\n\";\r\n\r\n $textFooter = 'Details of the Disposal \\r\\n' . $data['disposal_comments'];\r\n $textBody = \"Cat # Item # Serial # Manufacturer Quantity Disposal Type\";\r\n\r\n for ($i = 0; $i<$partCount; $i++){\r\n $textBody .= $data['catNum'][$i] . ' ';\r\n $textBody .= $data['itmNum'][$i] . ' ';\r\n $textBody .= $data['serialNum'][$i] . ' ';\r\n $textBody .= $data['mfg'][$i] . ' ';\r\n $textBody .= $data['quantity'][$i] . ' ';\r\n $textBody .= $data['disposalCode'][$i] . ' ';\r\n }\r\n\r\n $subject = 'New Disposal Request';\r\n $text = $textHeader . $textBody . $textFooter;\r\n $html = $msgHeader . $msg . $msgFooter;\r\n\r\n Mail::send($to, $subject, $text, $html, $cc);\r\n \r\n // remove after saveDisposal() is written\r\n\r\n }", "public function formatData(){\n $from = $this->dataObject->getFrom();\n\n // prepare array for counterxmlbuild with vendor informations\n $data = array(\n 'Report' => array (\n 0 => array(\n // Report attributes\n 'Created' => date('Y-m-d\\TH:i:s'),\n 'ID' => 'ID01', //TODO\n 'Version' => $this->dataObject->getVersion(),\n 'Name' => $this->dataObject->getReportName(),\n 'Title' => $this->dataObject->getReportTitle(),\n // Vendor node\n 'Vendor' => array(\n 'Name' => VENDOR_NAME,\n 'ID' => VENDOR_ID,\n 'Contact' => array(\n 0 => array(\n 'Contact' => VENDOR_CONTACT_NAME,\n 'E-mail' => VENDOR_CONTACT_MAIL\n ),\n ),\n 'WebSiteUrl' => VENDOR_WEBSITEURL,\n 'LogoUrl' => VENDOR_LOGOURL,\n ),\n ),\n ),\n );\n\n // prepare with customer informations\n $data['Report'][0]['Customer'][0] = $this->dataObject->getCustomerInfo();\n\n $j=0; // ReportItem\n $y=0; // ItemPerfomance\n $previousIdentifier = '';\n $count = 0;\n\n foreach ($this->dataObject->getData() as $row) {\n if (!($row['identifier'] == $previousIdentifier)) {\n // next Reportitem\n $j++;\n // reset ItemPerfomance\n $y=0;\n\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPlatform'] = 'TODO'; //TODO\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemDataType'] = 'TODO'; //TODO\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemName'] = $row['identifier'];\n }\n\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPerformance'][$y]['Period']['Begin'] = date('Y-m-d', strtotime($row['date']));\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPerformance'][$y]['Period']['End'] = date('Y-m-d', strtotime('last day of this month', strtotime($row['date'])));\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPerformance'][$y]['Category'] = 'TODO'; //TODO\n\n // check for different counts\n $x=0; // Instance\n\n // TODO: implement/translate format for different metric types\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPerformance'][$y]['Instance'][$x]['MetricType'] = 'ft_total';\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPerformance'][$y]['Instance'][$x]['Count'] = $row['counter'];\n\n $y++; //next ItemPerformance\n $previousIdentifier = $row['identifier'];\n $count++;\n }\n\n $counterxmlbuild = new CounterXMLBuilder();\n $counterxmlbuild->setIndentString(\"\\t\");\n $counterxmlbuild->start();\n $counterxmlbuild->add_reports($data);\n $counterxmlbuild->done();\n return $this->formattedData = $counterxmlbuild->outputMemory();\n }", "function DF_extra_contact_info($contactmethods) {\r\n //unset($contactmethods['aim']);\r\n //unset($contactmethods['yim']);\r\n //unset($contactmethods['jabber']);\r\n $contactmethods['googleplus'] = 'Google+ Account Url';\r\n\r\n\r\n return $contactmethods;\r\n}", "function addressbook($direction=0, $where=NULL, $do_joins=FALSE)\n\n {\n\n global $database, $user;\n\n \n\n $message_total = 0;\n\n \n\n\t // MAKE SURE MESSAGES ARE ALLOWED\n\n\t \n\n \n\n // BEGIN MESSAGE QUERY\n\n $sql = \"\n\n SELECT\n\n COUNT(id) as pm_total\n\n FROM\n\n se_addressbook\n\n WHERE\n\n se_addressbook.owner='{$user->user_info['user_username']}'\n\n \";\n // RUN QUERY AND RETURN\n\n $resource = $database->database_query($sql);\n\n $result = $database->database_fetch_assoc($resource);\n\n \n\n //return (int) $database->database_num_rows($resource);\n\n return (int) $result['pm_total'];\n\n }", "function mailchimp_list(){\n\t\t$list = $this->mailchimp->lists(array(), 0, 25);\n\t\tif($list) {\n\t\t\t$this->sci->assign('maindata' , $list['data']);\n\t\t\t$this->sci->assign('total' , $list['total']);\n\t\t}\n\t\t//print_r($list);\n\t\t$this->sci->da('mailchimp_list.htm');\n\t}", "function storeallpayment(){\n // $headers .= 'Content-type:text/html;charset=UTF-8' . \"\\r\\n\";\n // $from = \"[email protected]\";\n // $to = \"[email protected]\";\n // // $to = \"[email protected]\";\n // $subject = 'Price Inquiry';\n // $message = $body;\n // $headers .= 'From: '.$from. \"\\r\\n\".\"X-Mailer: PHP/\" . phpversion();\n\n // mail($to,$subject,$message,$headers);\n\t$piece= implode(\",,,,\",$_SESSION['sale']);\n\t\t$products= implode(\",,,,\",$_SESSION['productDetail']['addtocart']);\n\t\t$userId = $_SESSION['userId'];\n\t\t// print_r($userId);die;\n\t\t$last_id = $this->db->query(\"SELECT ID FROM dbo.order_detail ORDER BY ID DESC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY\")->row();\n\t\t// print_r();die;\n\t\t$new_id = $last_id->ID +1;\n\t\tif(empty($userId) || $userId == 0){\n\t\t\t$userId = 0;\n\t\t\t$_SESSION['userId'] = 0;\n\t\t}\n\n\t$newstring = substr($_SESSION['payment']['cardnumber'], -4);\n\t$data = array(\n\t\t// \"ID\" =>$new_id,\n\t\t'guest_userid'=>$new_id,\n\t\t\"order_date\"=>date(\"Y-m-d h:i:s\"),\n\t\t\t\t\t\"ListID\"=>$products,\n\t\t\t\t\t\"UserId\"=>$userId,\n\t\t\t\t\t\"piece\"=>$piece,\n\t\t\t\t\t\"shippingfirstname\"=>$_SESSION['shipping']['firstname'],\n\t\t\t\t\t\"shippinglastname\"=>$_SESSION['shipping']['lastname'],\n\t\t\t\t\t\"shippingcompanyname\"=>$_SESSION['shipping']['companyname'],\n\t\t\t\t\t\"shippingareacode\"=>$_SESSION['shipping']['areacode'],\n\t\t\t\t\t\"shippingprimaryphone\"=>$_SESSION['shipping']['primaryphone'],\n\t\t\t\t\t\"shippingstreetadress\"=>$_SESSION['shipping']['streetadress'],\n\t\t\t\t\t\"shippingstate\"=>$_SESSION['shipping']['state'],\n\t\t\t\t\t\"shippingcity\"=>$_SESSION['shipping']['city'],\n\t\t\t\t\t\"shippingzipcode\"=>$_SESSION['shipping']['zipcode'],\n\t\t\t\t\t\"shippinghome\"=>$_SESSION['shipping']['home'],\n\t\t\t\t\t\"transactionId\"=>$_SESSION['shipping']['transactionId'],\n\t\t\t\t\t\"billingfirstname\"=>$_SESSION['payment']['firstname'],\n\t\t\t\t\t\"billinglastnames\"=>$_SESSION['payment']['lastnames'],\n\t\t\t\t\t\"billingareacodes\"=>$_SESSION['payment']['areacodes'],\n\t\t\t\t\t\"billingprimaryphone\"=>$_SESSION['payment']['primaryphone'],\n\t\t\t\t\t\"billingemail\"=>$_SESSION['payment']['email'],\n\t\t\t\t\t\"billingcompanys\"=>$_SESSION['payment']['companys'],\n\t\t\t\t\t\"billingstreetadd\"=>$_SESSION['payment']['streetadd'],\n\t\t\t\t\t\"billingsuite\"=>$_SESSION['payment']['suite'],\n\t\t\t\t\t\"billingstates\"=>$_SESSION['payment']['states'],\n\t\t\t\t\t\"billingcity\"=>$_SESSION['payment']['city'],\n\t\t\t\t\t\"billingzipcode\"=>$_SESSION['payment']['zipcode'],\n\t\t\t\t\t\"billingallpayment\"=>$_SESSION['payment']['allpayment'],\n\t\t\t\t\t\"paymenttype\"=>$_SESSION['payment']['paymenttype'],\n\t\t\t\t\t\"cardtype\"=>$_SESSION['payment']['cardtype'],\n\t\t\t\t\t\"cardholder\"=>$_SESSION['payment']['cardholder'],\n\t\t\t\t\t\"cardnumber\"=>$newstring,\n\t\t\t\t\t\"cardcvv\"=>$_SESSION['payment']['cardcvv'],\n\t\t\t\t\t\"cardmonth\"=>$_SESSION['payment']['cardmonth'],\n\t\t\t\t\t\"cardyear\"=>$_SESSION['payment']['cardyear'],\n\t\t\t\t\t\"allshipcharge\"=>$_SESSION['payment']['allshipcharge'],\n\t\t\t\t\t\"allmainpayment\"=>$_SESSION['payment']['allmainpayment'],\n\t\t\t);\n\t\tif(isset($_SESSION['shipping']['buisness'])){\n\t\t\t$data['buisness'] = 1;\n\t\t}\n\t\telse{\n\t\t\t$data['buisness'] = 0;\n\t\t}\n\n\t\t$this->db->insert(\"dbo.order_detail\",$data);\n\t\t$_SESSION['insert_id'] = $this->db->insert_id();\n\t\t\t $order = $this->orderall();\n\n\t$body = \"<p>Thank you for placing your order with Global Fitness!</p>\n <p style=''>This email is to confirm your recent order.</p>\n <p> Date \".date('m/d/Y').\"</p>\n <p> Order Number : \".$order[0]->ID.\" </p>\n \";\n\n if($_SESSION['shipping']['home']!=2)\n {\n\t $body.=\"<p><b>Shipping address</b></p>\n\t\t <p>\".$_SESSION['shipping']['firstname'].\" \".$_SESSION['shipping']['lastname'].\"</p>\n\t\t <p>\".$_SESSION['shipping']['areacode'].\"-\".$_SESSION['shipping']['primaryphone'].\"</p>\n\t\t <p style=''>\".$_SESSION['shipping']['companyname'].\"</p>\n\t\t <p>\".$_SESSION['shipping']['streetadress'].\"</p>\n\t\t <p>\".$_SESSION['shipping']['state'].\", \".$_SESSION['shipping']['city'].\" \".$_SESSION['shipping']['zipcode'].\"</p>\n\t\t <p>United States</p>\n\t\t <p></p>\";\n }\n\n $body.=\"<p><b>Billing address</b></p>\n \t\t\t <p>\".$_SESSION['payment']['firstname'].\" \".$_SESSION['payment']['lastnames'].\"</p>\n \t\t\t <p>\".$_SESSION['payment']['areacodes'].\"-\".$_SESSION['shipping']['primaryphone'].\"</p>\n\t\t <p style=''>\".$_SESSION['payment']['companys'].\"</p>\n\t\t <p>\".$_SESSION['payment']['streetadress'].\"</p>\n\t\t <p>\".$_SESSION['payment']['states'].\", \".$_SESSION['payment']['city'].\" \".$_SESSION['payment']['zipcode'].\"</p>\n\t\t <p>United States</p>\n\t\t <p></p>\";\n\n\n\n\n\n for($i=0; $i<$_SESSION['productDetail']['count'];$i++){\n\t $product = $this->Site_model->productdetail($_SESSION['productDetail']['addtocart'][$i]);\n\t\tforeach($product as $live){\n\t\t\t$thisPrice = preg_replace('/[^A-Za-z0-9\\-(.)]/', '', $live->Price);\n\n\t\t\t $body.=\"<p style=''>\".$_SESSION['sale'][$i].\"x \".$live->ProductName.\" for $\".$thisPrice.\" each</p>\";\n\t\t}\n }\n\n\n\n\t$body.=\"<p style=''>Subtotal : $\".$_SESSION['payment']['allmainpayment'].\" USD</p>\n\n <p style=''>Shipping : $\".$_SESSION['payment']['allshipcharge'].\" USD</p>\";\n\n if($_SESSION['shipping']['home']==\"0\"){\n\t\t\t$body.=\"<p style=''>$300 USD White Glove Delivery</p>\";\n\t\t}\n\n $body.=\"<p style=''>Total : $\".$_SESSION['payment']['allpayment'].\" USD</p>\n <p> Please allow 1 - 2 business days to process through our warehouse. Please note that most U.S. orders ship within 3-7 business days from receipt unless contacted by our staff otherwise. </p><p><a href='\".base_url('site/orderall?orderID=').base64_encode($_SESSION['insert_id']).\"'>View Your Order Here.</a></p>\" ;\n\n $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-type:text/html;charset=UTF-8' . \"\\r\\n\";\n\n $from = \"[email protected]\";\n if (isset($_SESSION['email'])) {\n \t# code...\n \t$to = $_SESSION['email'];\n }else{\n \t$to = $_SESSION['payment']['email'];\n }\n // $cc =\"[email protected]\";\n $subject = 'Global Fitness Order Confirmation';\n $message = $body;\n // More headers\n $headers .= 'From: '.$from. \"\\r\\n\".\"X-Mailer: PHP/\" . phpversion();\n $headers .= 'Bcc: '.$to.\"\\r\\n\";\n //$headers .= 'Bcc: '.$cc.\"\\r\\n\";\n mail($to,$subject,$message,$headers);\n\n\n\n $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-type:text/html;charset=UTF-8' . \"\\r\\n\";\n\n $from = \"[email protected]\";\n $to = \"[email protected]\";\n //$to =\"[email protected]\";\n $subject = 'Online Order Confirmation';\n $message = $body;\n // More headers\n $headers .= 'From: '.$from. \"\\r\\n\".\"X-Mailer: PHP/\" . phpversion();\n $headers .= 'Bcc: '.$to.\"\\r\\n\";\n mail($to,$subject,$message,$headers);\n\n\n\t\tunset($_SESSION['productDetail']);\n\t\tunset($_SESSION['sale']);\n\t\tunset($_SESSION['shipping']);\n\t\tunset($_SESSION['payment']);\n\t}", "public function createSms()\n {\n $messages = array();\n $totalSplits = count($this->getBody());\n foreach ($this->getBody() as $key => $body) {\n $Message = new Message();\n $Message->originator = $this->getOriginator();\n $Message->recipients = $this->getRecipients();\n $Message->body = $body;\n if ($totalSplits > 1) {\n $total = sprintf(\"%02d\", $totalSplits);\n $current = sprintf(\"%02d\", $key+1);\n $udh = self::BASEUDH.$total.$current;\n $Message->type = 'binary';\n $Message->typeDetails = array(\"udh\" => $udh);\n }\n $messages[] = $Message;\n }\n\n return $messages;\n }" ]
[ "0.6253744", "0.5744378", "0.5634905", "0.5574809", "0.55232424", "0.55026037", "0.54877603", "0.5469375", "0.5458612", "0.54386073", "0.54148287", "0.53987205", "0.53955066", "0.53931653", "0.5389932", "0.5384851", "0.5381555", "0.5379972", "0.53794414", "0.53633803", "0.5354739", "0.5351228", "0.5346896", "0.5328629", "0.53134274", "0.53111714", "0.5294255", "0.5292588", "0.5286551", "0.5281338", "0.5278009", "0.52579427", "0.52482504", "0.5237618", "0.52317214", "0.5230166", "0.52242196", "0.5224131", "0.5204336", "0.5198711", "0.51982135", "0.51980656", "0.5163786", "0.514479", "0.5144365", "0.51382166", "0.5128238", "0.5116203", "0.51096433", "0.5094361", "0.5094212", "0.5086711", "0.50866395", "0.5084366", "0.50791025", "0.507423", "0.50738364", "0.50715363", "0.50681454", "0.50610083", "0.5056564", "0.5051358", "0.5045805", "0.50359106", "0.50325274", "0.5028471", "0.5022898", "0.50211966", "0.5017033", "0.50092983", "0.5007278", "0.50024873", "0.5001402", "0.50002694", "0.49979663", "0.4988394", "0.49877593", "0.49825194", "0.4980624", "0.49775967", "0.49762562", "0.49746022", "0.49687797", "0.4967111", "0.496601", "0.496193", "0.49579233", "0.49569485", "0.49476486", "0.49471647", "0.49368542", "0.49367034", "0.49344423", "0.49333552", "0.4932298", "0.49315298", "0.49315003", "0.49305424", "0.49185526", "0.49166822", "0.4915252" ]
0.0
-1
Includes the widget through its Index.html template and renders it.
public function indexAction() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $this->view->widget = $this->_getWidget();\n }", "public static function widget() {\n require_once( 'includes/widget.php' );\n }", "public function frontend_render()\n {\n $user_selected_language = get_user_lang();\n $widget_saved_values = $this->get_settings();\n\n $widget_title = $widget_saved_values['widget_title_' . $user_selected_language] ?? '';\n\n $output = $this->widget_before(); //render widget before content\n\n if (!empty($widget_title)) {\n $output .= '<h4 class=\"widget-title\">' . purify_html($widget_title) . '</h4>';\n }\n $output .='<div class=\"widget widget_search\">\n <form action=\"'.route('frontend.blog.search').'\" method=\"get\" class=\"search-form\">\n <div class=\"form-group\">\n <input type=\"text\" class=\"form-control\" name=\"search\" placeholder=\"'.__('Write your keyword...').'\">\n </div>\n <button class=\"submit-btn\" type=\"submit\"><i class=\"fa fa-search\"></i></button>\n </form>\n </div>';\n\n $output .= $this->widget_after(); // render widget after content\n\n return $output;\n }", "public function index()\n {\n $widgetsFrontend = Widgets::frontend()->all();\n $widgetsBackend = Widgets::backend()->all();\n\n return view_backend('widget.index', compact('widgetsFrontend', 'widgetsBackend'));\n }", "public function render_widget() {\n\n return Widget::render($this->settings);\n\n }", "public static function widget() {\n //require_once( 'widget.php' );\n require_once get_stylesheet_directory() . '/inc/templates/statistics_widget.php';\n }", "public function run()\n {\n $this->render('search-triple-widget');\n }", "public function index()\n\t{\n $widget = Widget::first();\n\n\t\treturn view('admin.widget', compact('widget'));\n\t}", "public function actionIndex()\n {\n return $this->render('@gilek/gtreetable/views/widget', ['options'=>[\n 'manyroots' => true,\n 'draggable' => true\n ]]);\n }", "public function render() {\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/dashboard.php';\n\n\t\t\t// Include the partial.\n\t\t\tinclude __DIR__ . '/templates/dashboard.php';\n\t\t}", "public function render()\n {\n return view('components.covid-widget');\n }", "public function index() {\n\t\t\t$this->render();\n\t\t}", "public function action_index()\n {\n $this->request->response = $this->render_layout($this->widget_sites());\n }", "public function index()\n {\n return $this->render('base.html.twig');\n }", "public function index()\n {\n Template::render();\n }", "public function index()\n {\n Template::render();\n }", "private function renderPage()\n {\n $content = <<<EOD\n<div id=\"layout-block\">\n{$this->searchForm->render()}\n{$this->renderLegend()}\n{$this->renderPools()}\n</div>\nEOD;\n return $this->renderBaseTemplate($content);\n }", "public function render() {\n\t\techo '<div id=\"neve-dashboard\"></div>';\n\t}", "public function run()\n {\n $categories = \\App\\Models\\Category::with('categories')->where('id_parent', 0)->where('status', 1)->orderBy('sort')->get();\n\n return view(\"widgets.catalog_widget\", [\n 'config' => $this->config, 'categories' => $categories\n ]);\n }", "private function _render()\n {\n $content = '';\n\n if (is_array($this->widgets)) {\n // clean path vars\n self::_clean_paths();\n\n foreach ($this->widgets as $parts) {\n\n $content = '';\n\n $type = (array_key_exists('type', $parts)) ? $parts['type'] : '';\n $src = (array_key_exists('src', $parts)) ? $parts['src'] : '';\n $title = (array_key_exists('title', $parts)) ? $parts['title'] : '';\n $alt = (array_key_exists('alt', $parts)) ? $parts['alt'] : 1;\n $cols = (array_key_exists('cols', $parts)) ? $parts['cols'] : 1;\n\n // process action commands (these don't follow the convention of standard widgets)\n switch ($type) {\n case 'clear':\n // push content directly into dashboard array\n $content = \"<div style='clear:both'></div>\";\n $this->_dashboard[] = $content;\n continue 2;\n break;\n }\n\n // check if individual keys supplied instead of an array of values\n if (array_key_exists('src', $parts)) {\n\n // individual keys supplied so construct appropriate array\n $parts = array(array('type'=>$type, 'src'=>$src, 'alt'=>$alt));\n }\n\n // process each part\n foreach ($parts as $part) {\n\n if (! is_array($part)) continue;\n\n // add any part-specific sub-headings as <H3>\n $content .= (array_key_exists('title', $part)) ? \"<\".$this->widget_subheading.\">\".$part['title'].\"</\".$this->widget_subheading.\">\" : '';\n\n switch ($part['type']) {\n //======================================\n case 'oop':\n //======================================\n\n // run an external controller to produce widget contents\n if ($this->oop_alt) {\n // alternative location will be:\n // [oop_path]/[dashboard_folder]/[dashboard_name]/[controller_name].[ext]\n // eg. [application/controllers]/[dashboard]/[safety]/[test_dash].[php]\n $file_name = $this->_makepath($this->oop_path, $this->dash_fldr, $this->dash).$part['src'].EXT;\n\n } else {\n\n // normal location will be\n // [oop_path]/[dashboard_name]/[dashboard_folder]/[controller_name].[ext]\n // eg. [application/controllers]/[safety]/[dashboard]/[test_dash].[php]\n $file_name = $this->_makepath($this->oop_path, $this->dash, $this->dash_fldr).$part['src'].EXT;\n }\n\n if (file_exists($file_name)) {\n\n include_once $file_name;\n\n // create an instance of the controller so we can run it\n $cname = ucfirst($part['src']);\n $c = new $cname;\n\n // always run the index() method to build content\n $content .= $c->index();\n\n } else {\n\n $content .= 'WARNING: Unable to find controller: '.$file_name;\n }\n\n break;\n\n //======================================\n case 'html':\n //======================================\n\n // html or text content being directly supplied from controller\n $content .= $part['src'];\n\n break;\n\n //======================================\n case 'curl':\n //======================================\n\n // html or text content being directly supplied from controller\n $content .= $this->_curl_response($part['src']);\n\n break;\n\n //======================================\n case 'img':\n //======================================\n\n // create an <img> tag widget referencing an external image file\n // $img_file = (array_key_exists('src', $part)) ? $this->_makepath($this->asset_path, $this->img_path.PS.$this->dash.PS.$this->dash_fldr.PS.$part['src'] : '';\n $img_file = (array_key_exists('src', $part)) ? $this->_makepath($this->asset_path, $this->img_path, $this->dash, $this->dash_fldr).$part['src'] : '';\n $img_alt = (array_key_exists('alt', $part)) ? $part['alt'] : '';\n\n if (file_exists(FCPATH.$img_file)) {\n\n $content .= \"<img src='\".$img_file.\"' width='100%' alt='{$img_alt}' title='{$img_alt}' class='modalview' type='image' />\";\n\n } else {\n\n $content = 'WARNING: Unable to find img: '.FCPATH.$img_file;\n }\n\n break;\n\n //======================================\n case 'file':\n //======================================\n\n // pull widget contents directly from an external file\n $file_name = (array_key_exists('src', $part)) ? $this->_makepath(FCPATH.$this->asset_path, $this->file_path, $this->dash, $this->dash_fldr).$part['src'] : '';\n\n if (file_exists($file_name)) {\n $content .= file_get_contents($file_name);\n\n } else {\n\n $content .= 'WARNING: Unable to find file: '.$file_name;\n }\n\n break;\n }\n }\n\n // add this widget to dashboard\n $this->_dashboard[] = $this->_widget($title, $content, $cols);\n }\n }\n\n return $content;\n }", "public function run()\n {\n Html::addCssClass($this->wrapperOptions, 'page-header');\n\n echo Html::beginTag(\"div\", $this->wrapperOptions);\n\n if (!empty($this->buttons)) {\n echo ButtonGroup::widget(\n [\n 'options' => $this->buttonGroupOptions,\n 'buttons' => $this->buttons,\n ]\n );\n }\n\n echo Html::tag(\"h1\", $this->title, $this->titleOptions);\n\n echo Html::endTag(\"div\");\n }", "public function widgets()\n {\n return view('pages.widgets');\n }", "public function index() {\n\t $this->registry->template->show();\n\t}", "private function renderTemplate()\n {\n $this->html = view($this->template, [$this->contextAs => $this->viewData])->render();\n\n // We may try to minify the html before storing it in cache to save space.\n if (env('WIDGET_MINIFICATION', false)) {\n $this->minifyHtml();\n }\n\n // We add some comments to be able to easily identify the widget in browser's developer tool.\n if(env('WIDGET_IDENTIFIER',false)){\n $this->addIdentifierToHtml();\n }\n\n return $this->html;\n }", "public function render_widget() {\n\t\t$this->get_db_values();\n\t\tif ( wponion_is_callable( $this->option( 'callback' ) ) ) {\n\t\t\techo wponion_callback( $this->option( 'callback' ), array( $this->get_db_values(), $this ) );\n\t\t}\n\t}", "public function index(){\n $this->viewManager->renderTemplate(\"index.twig.html\");\n\n }", "public function html()\n {\n $random_quote = $this->randomQuote();\n $cp_path = CP_ROUTE;\n return $this->view('widget', compact('random_quote','cp_path'))->render();\n }", "public function indexAction()\n {\n $contentTypes = $this->contentTypes();\n $model = $this->getModel('widget');\n $rowset = $model->select(array('type' => array_keys($contentTypes)));\n $widgets = array();\n foreach ($rowset as $row) {\n $widgets[$row->block] = $row->toArray();\n }\n if ($widgets) {\n $blocks = Pi::model('block_root')\n ->select(array('id' => array_keys($widgets)))->toArray();\n foreach ($blocks as $block) {\n $widgets[$block['id']]['block'] = $block;\n }\n }\n\n $data = array(\n 'widgets' => array_values($widgets)\n );\n\n $this->view()->assign('data', $data);\n $this->view()->setTemplate('ng');\n }", "public function render()\n {\n return view('adminhub::livewire.pages.brands.index')\n ->layout('adminhub::layouts.app', [\n 'title' => 'Brands',\n ]);\n }", "public function Index() {\n $this->Render();\n }", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "protected function render()\n {\n $params = ['title' => $this->title, 'content' => $this->content];\n $html = $this->template('Views/v_main.php', $params);\n echo $html;\n }", "function index() {\n\n $this->view->render();\n\n }", "protected function render()\n {\n $settings = $this->get_settings_for_display();\n\n $posts = get_posts(\n array(\n 'post_type' => 'post',\n 'numberposts' => $settings['posts'],\n 'orderby' => 'date',\n )\n );\n\n include PLUGIN_DIR . '/templates/widgets/recent-posts.php';\n }", "public function render() {\n\t\t//$masthead->loggedIn = $this->loggedIn;\n\t\t//$masthead->username = $this->username;\n\t\t////$masthead->google = $this->google->render();\n\t\t//return $masthead->render('Template_Widget_Masthead.php');\n\t\t\n\t\t$this->isLoggedIn = $this->_session->login_check($this->mysqli);\n\t\t\n\t\tif(!$this->isLoggedIn)\n\t\t{\n\t\t\t//throw new Exception_Permission(\"Not logged in.\");\n\t\t\treturn \"widget requires you be logged in\";\n\t\t}else{\n\t\t\t$this->permissions = $this->_session->getPermissions($this->mysqli);\n\t\t\t$isAdmin = in_array(\"admin\",$this->permissions); // need to be more strict? bool for that\n\t\t\tif(!$isAdmin)\n\t\t\t{\n\t\t\t\t//throw new Exception_Permission(\"Not authorized.\");\n\t\t\t\treturn \"not authorized for this widget\";\n\t\t\t}else{\n\t\t\t\n\t\t\t\tif ($result = $this->mysqli->query(\"SELECT m.id, m.username, m.email FROM members m\")) {\n\t\t\t\t\t$rows = array();\n\t\t\t\t\t\n\t\t\t\t\twhile($row = $result->fetch_row())\n\t\t\t\t\t{\n\t\t\t\t\t\t$rows[]=$row;\n\t\t\t\t\t}\n\t\t\t\t\t$result->close();\n\t\t\t\t\t\n\t\t\t\t\t$template = new Template();\n\t\t\t\t\t$template->userdata = $rows;\n\t\t\t\t\treturn $template->render('Template_Widget_AdminUsersPanel.php');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function indexAction()\n {\n $brandBlock = $this->getLayout()\n ->createBlock('testimonials_clients_adminhtml/client');\n $this->loadLayout()\n ->_addContent($brandBlock)\n ->renderLayout();\n }", "public function run()\r\n\t{\r\n $this->render('SearchBar');\r\n\t}", "public function dashboard_widget_content() {\n\t\t$is_authed = ( MonsterInsights()->auth->is_authed() || MonsterInsights()->auth->is_network_authed() );\n\n\t\tif ( ! $is_authed ) {\n\t\t\t$this->widget_content_no_auth();\n\t\t} else {\n\t\t\tmonsterinsights_settings_error_page( 'monsterinsights-dashboard-widget', '', '0' );\n\t\t\tmonsterinsights_settings_inline_js();\n\t\t}\n\n\t}", "public function widgets() {\r\n\t\t// Make sure the user has capability.\r\n\t\tif ( Permission::user_can( 'analytics' ) || ! is_admin() ) {\r\n\t\t\t// Most popular contents.\r\n\t\t\tregister_widget( Widgets\\Popular::instance() );\r\n\t\t}\r\n\t}", "public function index()\n\t{\n\t\t$this->layout->render();\n\t}", "public function index()\n\t{\n $this->view->render();\n\t}", "public function action_index()\n {\n $this->request->response = $this->render_layout($this->widget_privileges());\n }", "function index() {\n $this->renderView(\"index\");\n }", "public static function widget() {\n \n\t\t$start = self::get_dashboard_widget_option(self::wid, 'starting_conversion');\n\t\t$remaining_days = self::get_dashboard_widget_option(self::wid, 'starting_conversion');\n\t\t\n\t\t// Display Dashboard widget\n\t\trequire_once( 'red-flag-parking-display.php' );\n }", "public function index() {\n $this->view->render('index/index', null, null);\n }", "public function render() {\n echo \"<!DOCTYPE html>\\n\";\n echo \"<html>\\n\";\n $this->show_head();\n \n echo\"\\n<body>\\n\";\n echo $this->show_contents();\n\n echo \"\\n</body>\";\n echo \"\\n</html>\\n\\n\";\n }", "public function run()\n {\n $period = Period::create(Carbon::today()->subWeek(), Carbon::today());\n $result = $this->topPagesWithInformations($period, 10);\n return view('analytics::application.google.widgets.top_pages_widget', [\n 'top_pages' => $result,\n 'config' => $this->config,\n ]);\n }", "public function index()\n {\n return $this->render('home/index.html.twig');\n }", "protected function render()\n {\n $settings = $this->get_settings_for_display();\n require dirname(__FILE__) . '/' . $settings['layout'] . '.php';\n }", "public function indexAction()\n {\n View::renderTemplate('Tvshows/index.html');\n }", "public function renderWidgets()\r\n {\r\n foreach ($this->_widgets as $widget)\r\n {\r\n echo current($widget);\r\n }\r\n\r\n }", "public function index() {\n $this->template->attach($this->resours);\n $this->template->draw('index/index', true);\n }", "public function indexAction()\n {\n $this->render('/views/index.html');\n }", "public function view() {\n \n // Get the user's plan\n $user_plan = get_user_option( 'plan', $this->CI->user_id );\n \n // Get plan end\n $plan_end = get_user_option( 'plan_end', $this->CI->user_id );\n \n // Get plan data\n $plan_data = $this->CI->plans->get_plan( $user_plan );\n \n // Set widgets\n $widgets = array();\n \n // Get default widgets\n $default_widgets = array();\n \n if ( get_option('app_dashboard_left_side_position') && get_option('app_dashboard_enable_default_widgets') ) {\n\n $full_size = 'col-xl-5';\n\n $plan_data[0]['size'] = 6;\n\n } else {\n\n $full_size = 'col-xl-12';\n\n $plan_data[0]['size'] = 3;\n\n } \n\n if ( get_option('app_dashboard_enable_default_widgets') ) {\n \n foreach ( glob(MIDRUB_DASHBOARD_APP_PATH . '/widgets/*.php') as $filename ) {\n\n $className = str_replace( array( MIDRUB_DASHBOARD_APP_PATH . '/widgets/', '.php' ), '', $filename );\n\n // Create an array\n $array = array(\n 'MidrubApps',\n 'Collection',\n 'Dashboard',\n 'Widgets',\n ucfirst($className)\n ); \n\n // Implode the array above\n $cl = implode('\\\\',$array);\n\n // Instantiate the class\n $response = (new $cl())->display_widget( $this->CI->user_id, $plan_end, $plan_data );\n\n // Add widget to $default_widgets array\n $default_widgets[$response['order']] = $response['widget'];\n\n }\n\n arsort($default_widgets);\n \n if ( $default_widgets ) {\n \n $widgets[0] = '<div class=\"' . $full_size . ' col-lg-12 col-md-12 stats\">'\n . '<div class=\"row\">';\n\n $i = 0;\n \n foreach ( $default_widgets as $widget ) {\n \n if ( get_option('app_dashboard_left_side_position') && $i % 1 ) {\n \n $widgets[0] .= '</div><div class=\"row\">';\n \n }\n \n $widgets[0] .= $widget;\n \n $i++;\n \n }\n \n $widgets[0] .= '</div>'\n . '</div>';\n \n }\n \n }\n \n $apps_widgets = array();\n \n foreach ( glob( MIDRUB_APPS_PATH . '/collection/*') as $directory ) {\n\n $dir = str_replace( MIDRUB_APPS_PATH . '/collection/', '', $directory );\n \n if ( !get_option('app_' . $dir . '_enable') || !plan_feature('app_' . $dir) ) {\n continue;\n }\n\n if ( $dir === 'dashboard' ) {\n \n continue;\n \n } else {\n \n // Create an array\n $array = array(\n 'MidrubApps',\n 'Collection',\n ucfirst($dir),\n 'Main'\n ); \n\n // Implode the array above\n $cl = implode('\\\\',$array);\n\n // Instantiate the class\n $response = (new $cl())->widgets( $this->CI->user_id, $plan_end, $plan_data );\n \n foreach ( $response as $key => $value ) {\n \n // Add widget to $apps_widgets array\n $apps_widgets[$key] = $value;\n \n }\n \n }\n\n }\n\n if ( $apps_widgets ) {\n \n arsort($apps_widgets);\n \n $e = 0;\n \n foreach ( $apps_widgets as $key_w => $value_w ) {\n\n if ( $full_size === 'col-xl-5' && $e === 0 ) {\n\n if ( !isset($widgets[0]) ) {\n $widgets[0] = '';\n }\n \n $widgets[0] .= str_replace( '[xl]', '7', $value_w['widget'] );\n \n } else {\n \n $widgets[$key_w] = str_replace( '[xl]', '12', $value_w['widget'] );\n \n }\n \n if ( $value_w['styles_url'] && !in_array( $value_w['styles_url'], $this->css_urls_widgets ) ) {\n $this->css_urls_widgets[] = $value_w['styles_url'];\n }\n \n if ( $value_w['js_url'] && !in_array( $value_w['js_url'], $this->js_urls_widgets ) ) {\n $this->js_urls_widgets[] = $value_w['js_url'];\n } \n \n $e++;\n \n }\n \n }\n \n $this->CI->user_header = user_header();\n \n $this->CI->user_header['app'] = 'dashboard';\n \n $expired = 0;\n \n $expires_soon = 0;\n \n if ( $plan_end ) {\n \n if ( strtotime($plan_end) < time() ) {\n \n $this->CI->plans->delete_user_plan($this->CI->user_id);\n redirect('user/app/dashboard');\n \n } elseif ( strtotime($plan_end) < time() + 432000 ) {\n \n $expires_soon = 1;\n \n }\n \n }\n \n // Making temlate and send data to view.\n $this->CI->template['header'] = $this->CI->load->view('user/layout/header', array('app_styles' => $this->assets_css(), 'title' => $this->CI->lang->line('dashboard')), true);\n $this->CI->template['left'] = $this->CI->load->view('user/layout/left', $this->CI->user_header, true);\n $this->CI->template['body'] = $this->CI->load->ext_view( MIDRUB_DASHBOARD_APP_PATH . '/views', 'main', array('widgets' => $widgets, 'expired' => $expired, 'expires_soon' => $expires_soon), true);\n $this->CI->template['footer'] = $this->CI->load->view('user/layout/footer', array('app_scripts' => $this->assets_js()), true);\n $this->CI->load->ext_view( MIDRUB_DASHBOARD_APP_PATH . '/views/layout', 'index', $this->CI->template);\n \n }", "public function render(): void {\r\n $pages = MJKGTAPI::pages();\r\n $wp_cron = get_option('cron');\r\n\r\n $this->render_css();\r\n\r\n printf('<div class=\"wrap\">');\r\n $this->output_intro();\r\n printf('<div id=\"%s\">', self::id_main);\r\n $this->output_sections($pages, $wp_cron);\r\n printf('</div></div>');\r\n }", "public function indexAction()\n {\n $form = $this->getForm();\n\n return $this->twig->render('app/index.html.twig', [\n 'form' => $form->createView()\n ]);\n }", "public static function widget() {\n\t\t$username = self::get_dashboard_widget_option(self::wid, 'username');\n\t\t$apikey = self::get_dashboard_widget_option(self::wid, 'apikey');\n\t\t$project_id = self::get_dashboard_widget_option(self::wid, 'project_id');\n\t\t$ref_url = 'http://go.endcore.64905.digistore24.com/';\n\t\t$check = ($username && $apikey && $project_id ? true : false);\n \n\t\tif(!$check) {\n\t\t\techo '<h4 style=\"text-align:right; padding-right: 40px; padding-top: 10px\">' . __( 'Bitte prüfe die Einstellungen &and;', 'affiliatetheme-backend' ) . '</h4>&nbsp;';\n ?>\n <div class=\"rankalyst-text\">\n <a href=\"<?php echo $ref_url; ?>\" target=\"_blank\"><img src=\"<?php echo get_template_directory_uri(); ?>/_/img/rankalyst.png\"></a>\n <p><?php printf(__('Mit <a href=\"%s\" target=\"_blank\">Rankalyst</a> kannst du 10 Keywords kostenlos tracken!', 'affiliatetheme-backend'), $ref_url); ?></p>\n <a href=\"<?php echo $ref_url; ?>\" target=\"_blank\" class=\"button button-primary\"><?php _e('Kostenlos starten', 'affiliatetheme-backend'); ?></a>\n </div>\n <?php\n\t\t}\n\t\t\n\t\t/* @TODO Rankingchange <span class=\"plus\">+</span> bzw Minus ausgeben, jenachdem ob Change positiv oder negativ. */\n\n ?>\n <div class=\"rankalyst-data\">\n <ul class=\"rankalyst-tabs\">\n <li><a href=\"#\" data-type=\"organic\" class=\"active\"><?php _e('Organic', 'affiliatetheme-backend'); ?></a></li>\n <li><a href=\"#\" data-type=\"mobile\"><?php _e('Mobile', 'affiliatetheme-backend'); ?></a></li>\n <li><a href=\"#\" data-type=\"local\"><?php _e('Local', 'affiliatetheme-backend'); ?></a></li>\n </ul>\n\n <div class=\"rankalyst-tab active\" data-type=\"organic\">\n <?php\n $rankalyst = new AT_Rankalyst_API($username, $apikey, $project_id, 1);\n if($rankalyst) {\n\t $response = $rankalyst->data();\n\t if($response) {\n\t\t if ( $response->status != 'success' ) {\n\t\t\t echo '<div class=\"rankalyst-text\"><p style=\"color: #c01313; margin-top: 10px\">' . $response->message . '</p></div>';\n\t\t } else {\n\t\t\t if ( $response->data ) {\n\t\t\t\t $data = $response->data->items;\n\t\t\t\t $rankalyst->output( $data );\n\t\t\t }\n\t\t }\n\t }\n }\n ?>\n </div>\n\n <div class=\"rankalyst-tab\" data-type=\"mobile\">\n <?php\n $rankalyst = new AT_Rankalyst_API($username, $apikey, $project_id, 2);\n if($rankalyst) {\n\t $response = $rankalyst->data();\n\t if($response) {\n\t\t if ( $response->status != 'success' ) {\n\t\t\t echo '<div class=\"rankalyst-text\"><p style=\"color: #c01313; margin-top: 10px\">' . $response->message . '</p></div>';\n\t\t } else {\n\t\t\t if ( $response->data ) {\n\t\t\t\t $data = $response->data->items;\n\t\t\t\t $rankalyst->output( $data );\n\t\t\t }\n\t\t }\n\t }\n }\n ?>\n </div>\n\n <div class=\"rankalyst-tab\" data-type=\"local\">\n <?php\n $rankalyst = new AT_Rankalyst_API($username, $apikey, $project_id, 3);\n if($rankalyst) {\n\t $response = $rankalyst->data();\n\t if($response) {\n\t\t if ( $response->status != 'success' ) {\n\t\t\t echo '<div class=\"rankalyst-text\"><p style=\"color: #c01313; margin-top: 10px\">' . $response->message . '</p></div>';\n\t\t } else {\n\t\t\t if ( $response->data ) {\n\t\t\t\t $data = $response->data->items;\n\t\t\t\t $rankalyst->output( $data );\n\t\t\t }\n\t\t }\n\t }\n }\n ?>\n </div>\n </div>\n <?php\n }", "public function run()\n {\n $restaurants = Restaurant::all();\n\n return view(\"widgets.restaurants_widget\", [\n 'config' => $this->config,\n 'restaurants' => $restaurants\n ]);\n }", "public function indexAction()\n {\n View::renderTemplate('Advertiser/index.html');\n }", "public function run() {\n\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.core.widgets');\n\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\t\tif(\\Yii::app()->user->isGuest === true) {\n\t\t\techo $content;\n\t\t} else {\n\t\t\t$this->render('header');\n\t\t}\n\t}", "public function render( ) {\n wp_nonce_field( 'metabox_' . $this->id, 'metabox_' . $this->id . '_nonce' );\n if( ! isset( $this->template ) || $this->template === null ) {\n echo '<p>' . __( 'There are no settings on this page.', 'textdomain' ) . '</p>';\n return;\n }\n //var_dump($this->template);\n //die();\n include $this->template;\n }", "public function render()\n {\n if (is_archive()) {\n // Archive stuff\n } else {\n // Get Template vars\n $context = Timber::get_context();\n $post = new \\TimberPost();\n $context['post'] = $post;\n // Render Template\n Timber::render('pages/single-book.twig', $context);\n }\n }", "public function index()\n\t{\n\t\t$this->template\n\t\t\t->title('')\n\t\t\t->build('admin/index');\n\t}", "public function renderWidget($widgetName)\r\n {\r\n echo $this->getWidget($widgetName);\r\n }", "public function indexAction()\n {\n return $this->twig->render('index.html.twig');\n }", "public function index()\n {\n\n\n $this->view->render();\n }", "function msdlab_homepage_widgets(){\n\tprint '<div id=\"homepage-widgets\" class=\"widget-area\">';\n\tprint '<div class=\"wrap\"><div class=\"row\">';\n dynamic_sidebar('homepage-widgets');\n \tprint '</div></div>';\n\tprint '</div>';\n}", "public function index()\n {\n View::renderTemplate('header', $data);\n View::render('admin/index', $data);\n View::renderTemplate('footer', $data);\n }", "public function render() {\r\n require_once '../template/front.php';\r\n }", "protected function render() {\n\t\tglobal $product;\n\t\t$product_id = $product->get_id();\n\t\t$settings = $this->get_settings_for_display();\n\t\t$this->add_inline_editing_attributes( 'content', 'advanced' );\n\t\t?>\n\t\t<div class=\"product-page-header-widget\">\n\t\t\t<div class=\"content-inner\">\n\t\t\t\t<div class=\"product-page-header\" style=\"background:url(<?= $settings['image']['url'] ?>) no-repeat center center;\">\n\t\t\t\t\t<div class=\"pph-content\">\n\t\t\t\t\t\t<div class=\"pph-content-inner\">\n\t\t\t\t\t\t\t<div class=\"pph-wrapper\">\n\t\t\t\t\t\t\t\t<div class=\"triangle-strip\">\n\t\t\t\t\t\t\t\t\t<div class=\"t1\"></div>\n\t\t\t\t\t\t\t\t\t<div class=\"t2\"></div>\n\t\t\t\t\t\t\t\t\t<div class=\"t3\"></div>\n\t\t\t\t\t\t\t\t\t<div class=\"t4\"></div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"text-wrapper\">\n\t\t\t\t\t\t\t\t\t<h2 class=\"p-name\"><?= $product->get_name() ?></h2>\n\t\t\t\t\t\t\t\t\t<div class=\"text-wysiwyg\">\n\t\t\t\t\t\t\t\t\t\t<?= wpautop( $settings['content'] ) ?>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<a href=\"<?= do_shortcode('[add_to_cart_url id=\"'.$product_id.'\"]'); ?>\" data-quantity=\"1\" data-product_id=\"<?= $product_id ?>\" class=\"add-to-cart-btn w-btn\">BUY NOW</a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}", "public function output_widget_control_templates()\n {\n }", "public function render()\n {\n $html = System::template('admin/v_main.php', [\n 'title' => $this->title,\n 'content' => $this->content,\n ]);\n \n return $html;\n }", "public function render()\n {\n include_once __DIR__ . '/templates/back.php';\n }", "function index() {\r\n $this->view->render('worldclock/index');\r\n }", "public function widget()\n {\n # Load view\n $view = View::make('admin.files_library.grid');\n\n # Fetch all files\n $files = FileLibrary::select('*')->withLanguage(LANG);\n\n # Filtration\n if (Input::has('yearmonth')) {\n $files->whereRaw('DATE_FORMAT(uploaded_date, \"%y%m\") = ?', [Input::get('yearmonth')]);\n }\n\n # Ordering\n $files->orderBy('uploaded_date', 'desc');\n\n # Pagination\n $per_page = 12;\n $records = $files->paginate($per_page);\n\n $view->with('files', $records);\n\n # Get files archive\n $view->with('archives', FileLibrary::archiveList());\n\n return $view;\n }", "public function index()\n {\n return $this->render('index', [\n 'model' => $this->model,\n ]);\n }", "public function indexAction()\n {\n return $this->render('PollPollBundle:Default:index.html.twig');\n }", "public function render()\n {\n return view('components.dashboard.main');\n }", "public function render()\n {\n $content = $this->__layoutContent();\n\n extract($this->getViewData());\n ob_start();\n include $content;\n ob_get_flush();\n }", "public function index()\n {\n return new WidgetResource(Widget::all());\n }", "public function render()\n {\n return view('components.clients.index');\n }", "public function run() {\r\n\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.core.widgets');\r\n\t\t$contents=ob_get_contents();\r\n\t\tob_end_clean();\r\n\t\tif($this->activeDataProvider === null) {\r\n\t\t\techo $contents;\r\n\t\t} else {\r\n\t\t\tif(($this->hideOnEmpty === true) && ($this->activeDataProvider->totalItemCount == 0)) {\r\n\t\t\t\techo $contents;\r\n\t\t\t} else {\r\n\t\t\t\t$this->render('TableWidget', array(\r\n\t\t\t\t\t'activeDataProvider' => $this->activeDataProvider,\r\n\t\t\t\t\t'fields' => $this->getFields(),\r\n\t\t\t\t\t'title' => $this->title,\r\n\t\t\t\t\t'pagination' => $this->enablePagination,\r\n\t\t\t\t\t'catalog' => $this->getCatalog(),\r\n\t\t\t\t\t'htmlOptions' => $this->htmlOptions,\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function wf_template_widget($retData=false) {\n\t\tglobal $post;\n\t\t\n\t\t$error = 'Error while adding the widget, please report to <a href=\"http://blog.wanderfly.com/wordpress-plugin/\">http://blog.wanderfly.com/wordpress-plugin/</a>.';\n\t\t$widgetHTML = false;\n\t\t\n\t\tif($post) {\n\t\t\t//Get the Destination ID from the post's metas,\n\t\t\t$wf_meta = get_post_meta($post->ID, \"wf_destination\", true);\n\t\t\t\n\t\t\t//Display the wanderfly widget,\n\t\t\tif($wf_meta) {\n\t\t\t\t$wf_metas = explode(':', $wf_meta);\n\t\t\t\t$widgetHTML = wf_widget($wf_metas[0]);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//Echo the widget,\n\t\tif($widgetHTML !== false) {\n\t\t\tif($retData) { return $widgetHTML; }\n\t\t\telse { echo $widgetHTML; }\n\t\t}\n\t\t//Return the widget's HTML,\n\t\telse {\n\t\t\tif($retData) { return $widgetHTML; }\n\t\t\telse { echo $error; }\n\t\t}\n\t\t\n\t}", "public function index()\n {\n return view('@Socializr/index.twig', [\n 'sets' => $this->getSets(),\n 'shares' => $this->getShares(),\n ]);\n }", "public function index()\n {\n return $this->render('quotes.index');\n }", "public function index()\n {\n //\n $theme = $this->theme;\n return $theme->scope('site.index')->render();\n }", "function cdn_do_home_inside_loop_widget() {\n\tgenesis_widget_area( 'cdn-home-inside-loop-widget', array(\n\t\t\t'before' => '<aside class=\"widget-area inside-loop-widget\">' . genesis_sidebar_title( 'cdn-home-inside-loop-widget' ),\n\t\t\t'after' => '</aside>',\n\t) );\n}", "function run()\r\n {\r\n // Run parent CWidget run function.\r\n parent::run();\r\n echo '<!-- AddThis Button BEGIN -->';\r\n echo CHtml::openTag('div', $this->htmlOptions) . \"\\n\";\r\n if ($this->singleButton) {\r\n $img = CHtml::image(\"http://s7.addthis.com/static/btn/v2/lg-share-{$this->config['ui_language']}.gif\", Yii::t('addThis', 'Bookmark and Share'));\r\n echo CHtml::link($img, \"http://www.addthis.com/bookmark.php?v=300&amp;#pubid={$this->pubid}\", $this->singleButtonOptions);\r\n }\r\n\r\n // Check what services to show.\r\n if (!$this->singleButton && !empty($this->services)) {\r\n while ($item = current($this->services)) {\r\n is_array($item) ? $service = array('name' => key($this->services), 'htmlOptions' => $item) : $service = array('name' => $item, 'htmlOptions' => array());\r\n next($this->services);\r\n\r\n if ($service['name'] == 'vk_like') {\r\n if (!empty($this->vkApiId) && is_int($this->vkApiId)) {\r\n $service['htmlOptions']['id'] = 'vk_like';\r\n echo CHtml::tag('a', $service['htmlOptions'], '');\r\n }\r\n } else {\r\n $service['htmlOptions']['class'] = \"addthis_button_{$service['name']}\";\r\n echo CHtml::tag('a', $service['htmlOptions'], '');\r\n }\r\n }\r\n }\r\n echo CHtml::closeTag('div');\r\n echo '<!-- AddThis Button END -->';\r\n }", "public function render()\n {\n return view('adminhub::livewire.components.customers.index')\n ->layout('adminhub::layouts.base');\n }", "public function render_page() {\n\t\t$this->render_template();\n\t}", "public function render() {\n echo $this->getHtml();\n }", "public function index()\n {\n\n return $this->twig->render('Home/index.html.twig');\n }", "function index(){\n\t\t$this->template->run();\n\t}", "private function renderInWrapper () {\n\t\t//open the generic application wrapper template\n\t\t/*\n\t\t$C = __CLASS__;\n\t\t$st = new $C();\n\t\t$st->init(null, \"wrapper\");\n\t\t$st->set(\"content\", $this->fetch());\n\t\t$st->render(true);\n\t\t*/\n\t}", "public function indexAction()\n {\n $this->_initAction()\n ->renderLayout();\n }", "public function actionIndex()\n {\n return $this->render('index.twig');\n }", "function widget_wrap()\n{\n\tregister_widget('ag_pag_familie_w');\n\tregister_widget('ag_social_widget_container');\n\tregister_widget('ag_agenda_widget');\n}", "public function run()\n {\n $userLinks = $this->getLinksCreatedByUser();\n\n return view('export-link::widgets.export_with_link_widget', [\n 'config' => $this->config,\n 'domain' => $this->config['domain'],\n 'module' => $this->config['module'],\n 'user' => $this->config['user'],\n 'userLinks' => $userLinks,\n ]);\n }", "public function run() {\n\n $this->render(\"search\");\n }", "public function register_widget() {\n register_widget( 'WPP_Widget' );\n }" ]
[ "0.72744167", "0.7114352", "0.70486623", "0.6887091", "0.68819404", "0.6737131", "0.66932714", "0.665074", "0.6540014", "0.6521818", "0.6512254", "0.6439191", "0.64290595", "0.6423115", "0.6412786", "0.6412786", "0.63969195", "0.6373364", "0.63591665", "0.6326835", "0.6314734", "0.63028353", "0.6291742", "0.6287065", "0.6253103", "0.6250482", "0.6250474", "0.6237287", "0.6234021", "0.62210155", "0.62139446", "0.62139446", "0.6211689", "0.6185232", "0.61769956", "0.6171252", "0.61703247", "0.61499906", "0.61157095", "0.6112289", "0.6111435", "0.61099315", "0.6092153", "0.6076006", "0.605736", "0.60411716", "0.60309756", "0.60255265", "0.6021075", "0.6019784", "0.60156757", "0.6014141", "0.60060394", "0.60052145", "0.59971803", "0.5992687", "0.59892124", "0.5987016", "0.59852076", "0.59826773", "0.5967802", "0.59418225", "0.5937775", "0.5933604", "0.5933075", "0.59305805", "0.5928762", "0.59178364", "0.5913083", "0.5907546", "0.5902884", "0.5893491", "0.58920157", "0.588453", "0.5880023", "0.5860224", "0.5859", "0.58385664", "0.58375424", "0.5837009", "0.58366543", "0.58334166", "0.58294815", "0.58269674", "0.5821079", "0.58151585", "0.5811954", "0.58005404", "0.57996684", "0.57962924", "0.57956684", "0.5785066", "0.5775216", "0.57721853", "0.5770782", "0.5759927", "0.575835", "0.5754789", "0.5754069", "0.5753918", "0.57525563" ]
0.0
-1
Renders and returns the URI pointing to the widget for an AJAX call.
public function widgetUriAction() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getAjaxUri(): string\n {\n $arguments = $this->arguments['arguments'] ?? $this->argumentDefinitions['arguments']->getDefaultValue();\n\n if (!$this->hasArgument('action')) {\n $arguments['@action'] = $this->controllerContext->getRequest()->getControllerActionName();\n }\n if ($this->hasArgument('format')) {\n $arguments['@format'] = $this->arguments['format'];\n }\n /** @var $widgetContext WidgetContext */\n $widgetContext = $this->controllerContext->getRequest()->getInternalArgument('__widgetContext');\n if (!$widgetContext instanceof WidgetContext) {\n throw new WidgetContextNotFoundException('Widget context not found in <f:widget.link>', 1307450686);\n }\n if ($this->hasArgument('includeWidgetContext') && $this->arguments['includeWidgetContext'] === true) {\n $serializedWidgetContext = serialize($widgetContext);\n $arguments['__widgetContext'] = $this->hashService->appendHmac($serializedWidgetContext);\n } else {\n $arguments['__widgetId'] = $widgetContext->getAjaxWidgetIdentifier();\n }\n return '?' . http_build_query($arguments, null, '&');\n }", "protected function getAjaxUri() {}", "protected function getAjaxUri() {}", "protected function getWidgetUri() {}", "protected function getWidgetUri() {}", "public function ajaxAction() {\n\t\t$options = (isset($this->widgetConfiguration['option1']) ? '\"' . $this->widgetConfiguration['option1'] . '\"' : '\"\"') . ', ';\n\t\t$options .= (isset($this->widgetConfiguration['option2']) ? '\"' . $this->widgetConfiguration['option2'] . '\"' : '\"\"') . '';\n\t\treturn sprintf('SomeAjaxController::ajaxAction(%s)', $options);\n\t}", "protected function getWidgetUri(): string\n {\n $uriBuilder = $this->controllerContext->getUriBuilder();\n\n $argumentsToBeExcludedFromQueryString = [\n '@package',\n '@subpackage',\n '@controller'\n ];\n\n $uriBuilder\n ->reset()\n ->setSection($this->arguments['section'] ?? $this->argumentDefinitions['section']->getDefaultValue())\n ->setCreateAbsoluteUri(true)\n ->setArgumentsToBeExcludedFromQueryString($argumentsToBeExcludedFromQueryString)\n ->setFormat($this->arguments['format'] ?? $this->argumentDefinitions['format']->getDefaultValue());\n try {\n $uri = $uriBuilder->uriFor($this->arguments['action'] ?? $this->argumentDefinitions['action']->getDefaultValue(), $this->arguments['arguments'] ?? $this->argumentDefinitions['arguments']->getDefaultValue(), '', '', '');\n } catch (\\Exception $exception) {\n throw new ViewHelper\\Exception($exception->getMessage(), $exception->getCode(), $exception);\n }\n return $uri;\n }", "public function ajax_url() {\n\t\treturn admin_url( 'admin-ajax.php', 'relative' );\n\t}", "public function render_widget() {\n\t\t$this->get_db_values();\n\t\tif ( wponion_is_callable( $this->option( 'callback' ) ) ) {\n\t\t\techo wponion_callback( $this->option( 'callback' ), array( $this->get_db_values(), $this ) );\n\t\t}\n\t}", "public function getRemoteCallLinkTemplate() {\n\t\treturn '<a href=\"%s\" onclick=\"var ajax = new XMLHttpRequest(); ajax.open(\\'GET\\', this.href); ajax.send(null); return false\">%s</a>';\n\t}", "public function getWidgetJsUrl() {\n return check_url(variable_get(AddThis::WIDGET_JS_URL_KEY, AddThis::DEFAULT_WIDGET_JS_URL));\n }", "public function render_widget() {\n\n return Widget::render($this->settings);\n\n }", "public function getAjaxURL()\n {\n return AJAX_URL;\n }", "public function renderUri();", "public function widgets_url(){\n return $this->plugin_url() . 'widgets/';\n }", "public function actionAjaxq()\n {\n return $this->render('ajaxq');\n }", "public function render()\n {\n if (defined('DOING_AJAX') && DOING_AJAX) {\n $check = $this->formData->check();\n $check or wp_send_json_error();\n $this->buildContext($check);\n $data = [\n 'success' => true,\n 'data' => ['content' => do_shortcode($check['content'])],\n ];\n @header('Content-Type: application/json; charset='.get_option('blog_charset'));\n echo wp_json_encode($data, JSON_PRETTY_PRINT);\n wp_die();\n }\n }", "public static function getAjaxURL()\r\n\t{\r\n\t\tif (!JLanguageMultilang::isEnabled())\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n \r\n\t\t$lang = JFactory::getLanguage()->getTag();\r\n\t\t$app = JFactory::getApplication();\r\n\t\t$sitemenu= $app->getMenu();\r\n\t\t$thismenuitem = $sitemenu->getActive();\r\n\r\n\t\t// if we haven't got an active menuitem, or we're currently on a menuitem \r\n\t\t// with view=category or note = \"Ajax\", then just stay on it\r\n\t\tif (!$thismenuitem || strpos($thismenuitem->link, \"view=category\") !== false || $thismenuitem->note == \"Ajax\")\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\t// look for a menuitem with the right language, and a note field of \"Ajax\"\r\n\t\t$menuitem = $sitemenu->getItems(array('language','note'), array($lang, \"Ajax\"));\r\n\t\tif ($menuitem)\r\n\t\t{\r\n\t\t\t$itemid = $menuitem[0]->id; \r\n\t\t\t$url = JRoute::_(\"index.php?Itemid=$itemid&view=helloworld&format=json\");\r\n\t\t\treturn $url;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public function getAjaxUrl()\n {\n $token = $this->getApiKey();\n if ($token) {\n $token = $this->encryptor->decrypt($token);\n $apiUrl = $this->getBaseUrl().\"/v1/site.drivenjson?apiKey=\".$token;\n return $apiUrl;\n }\n return false;\n }", "function wp_ajax_update_widget()\n {\n }", "function renderToClient();", "protected function get_admin_ajax_base_uri()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->get_admin_form_uri();\n }", "public function getAjaxUrl()\n {\n return $this->getUrl('authnetcim/system_config/initWebhooks');\n }", "public function fetchWidget() {\n $html = '';\n $in_dashboard = $readonly = true;\n $store_in_session = false;\n $html .= $this->fetchCharts($this->report->getMatchingIds(), $in_dashboard, $readonly, $store_in_session);\n $html .= $this->fetchWidgetGoToReport();\n return $html;\n }", "public function wp_ajax_update_widget()\n {\n }", "function siteorigin_panels_ajax_widget_form(){\n\t$request = array_map('stripslashes_deep', $_REQUEST);\n\tif( empty( $request['widget'] ) ) exit();\n\n\techo siteorigin_panels_render_form( $request['widget'], !empty($request['instance']) ? json_decode( $request['instance'], true ) : array(), $_REQUEST['raw'] );\n\texit();\n}", "public function displayAjax()\n {\n http_response_code(400);\n $this->ajaxRenderJson(['error' => 'Invalid endpoint']);\n }", "abstract public function ajaxAction(): string;", "function wp_ajax_dashboard_widgets()\n {\n }", "protected function buildUi() {\n if (empty($this->reloadDiv)) {\n $this->reloadDiv = 'div-' . Yii::$app->uniqueId;\n }\n\n $url = Url::to(['/notify/default/notify-tool']);\n $options = $this->options;\n $options['id'] = $this->reloadDiv;\n $options['data-url'] = $url;\n $view = \\Yii::$app->getView();\n $view->registerJs(\"\n getUiAjax('{$url}', '{$this->reloadDiv}');\n \");\n\n return Html::tag('div', '<div class=\"sdloader\"><i class=\"sdloader-icon\"></i></div>', $options);\n }", "static function wck_fep_print_ajax_url() {\n\t\t/* ajax url for frontend */\n\t\techo '<script type=\"text/javascript\">var wckAjaxurl = \"'. admin_url('admin-ajax.php') .'\";</script>';\n\t}", "public function __toString()\n\t{\n\t\t$widget->jsRendered = true;\n\t\t$config = json_encode($this->config);\n\t\treturn 'jQuery('\n\t\t. self::quote('#' . $this->match) . ').'\n\t\t. $this->getJSName() . '(' . $config . ')'\n\t\t;\n\t}", "public function widgetPopupHtml()\n {\n $widgetId = ipRequest()->getQuery('widgetId');\n $widgetRecord = \\Ip\\Internal\\Content\\Model::getWidgetRecord($widgetId);\n $widgetData = $widgetRecord['data'];\n\n // Populate form with proper fields\n switch ($widgetRecord['name']) {\n case 'ContentSection':\n //create form prepopulated with current widget data\n $form = $this->contentSectionManagementForm($widgetData);\n break;\n case 'ThreeItemListSection':\n $form = $this->threeItemManagementForm($widgetData);\n break;\n\n case 'Slider':\n $form = $this->sliderManagementForm($widgetData);\n break;\n case 'TopThreeSection':\n $form = $this->topThreeSectionManagementForm($widgetData);\n break;\n case 'ThumbnailCard':\n $form = $this->cardManagementForm($widgetData);\n break;\n default:\n $err = new \\Ip\\Response\\Json([\n 'error' => 'Unknown widget',\n 'widget' => $widgetRecord\n ]);\n $err->setStatusCode(400);\n return $err;\n }\n\n //Render form and popup HTML\n $viewData = array(\n 'form' => $form\n );\n $popupHtml = ipView('view/editPopup.php', $viewData)->render();\n $data = array(\n 'popup' => $popupHtml\n );\n //Return rendered widget management popup HTML in JSON format\n return new \\Ip\\Response\\Json($data);\n }", "public function render()\n {\n $this->view->setData(call_user_func($this->getUrlGenerator(), $this->getGrid()->getCurrentRow()));\n return SolidRow::render();\n }", "public function requestAction()\n {\n return $this->returnAjaxResponse(self::REQUEST);\n }", "public static function getViewLink() {\n global $CFG_GLPI;\n\n $out = \"<a id='view_telemetry' href='{$CFG_GLPI['root_doc']}/ajax/telemetry.php'>\" . __('See what would be sent...') . \"</a>\";\n $out .= Html::scriptBlock(\"\n $('#view_telemetry').on('click', function(e) {\n e.preventDefault();\n\n $.ajax({\n url: $(this).attr('href'),\n success: function(data) {\n var _elt = $('<div></div>');\n _elt.append(data);\n $('body').append(_elt);\n\n _elt.dialog({\n title: '\" . addslashes(__('Telemetry data')) . \"',\n buttons: {\n \".addslashes(__('OK')).\": function() {\n $(this).dialog('close');\n }\n },\n dialogClass: 'glpi_modal',\n maxHeight: $(window).height(),\n open: function(event, ui) {\n $(this).dialog('option', 'maxHeight', $(window).height());\n $(this).parent().prev('.ui-widget-overlay').addClass('glpi_modal');\n },\n close: function(){\n $(this).remove();\n },\n draggable: true,\n modal: true,\n resizable: true,\n width: '50%'\n });\n }\n\n });\n });\");\n return $out;\n }", "public function loadWidgetData(){\n\t\tswitch($this->input->get('widget_id')){\n\t\t\tcase 3:\n\t\t\t\t$data = array(\n\t\t\t\t\t'color' => 'blue_green',\n\t\t\t\t\t'icon' => 'fa-check-square-o',\n\t\t\t\t\t'value1' => 'Bloog Glucose',\n\t\t\t\t\t'value2' => '223',\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$data = array(\n\t\t\t\t\t'color' => 'blue_green',\n\t\t\t\t\t'icon' => 'fa-check-square-o',\n\t\t\t\t\t'value1' => 'Unknown widget',\n\t\t\t\t\t'value2' => '?',\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t}\n\t\t$this->ajaxResponse($data);\n\t}", "public function echoAjaxContent() {\n\t\t\n\t\t$sSection = trim( $_GET[ 'section' ] );\n\t\t$sMethod = '';\n\t\t\n\t\tif ( $sSection ) {\n\t\t\t$sMethod = sprintf( 'get%sAjax', Geko_Inflector::camelize( $sSection ) );\n\t\t\tif ( !method_exists( $this, $sMethod ) ) $sMethod = '';\n\t\t}\n\t\t\n\t\tif ( $sMethod ) {\n\t\t\t$aAjaxResponse = $this->$sMethod();\n\t\t\techo Zend_Json::encode( $aAjaxResponse );\n\t\t}\n\t}", "public function getStatusUrl()\n {\n return Mage::helper('oro_ajax')->getAjaxStatusUrl($this->_urlParams);\n }", "protected function get_admin_ajax_base_uri()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->get_ajax_base_uri().'?utest_string=admin';\n }", "public function actionIndex() {\n\t\treturn $this->render('ajax');\n\t}", "public function getAjaxBaseUrl() {\r\n\t\treturn admin_url(\"admin-ajax.php\");\r\n\t}", "function wp_ajax_save_widget()\n {\n }", "protected function get_ajax_base_uri()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n $port = $_SERVER['SERVER_PORT'] ;\n // IIS puts \"off\" in the HTTPS field, so we need to test for that.\n $https = (!empty($_SERVER['HTTPS']) && (($_SERVER['HTTPS'] !== 'off') || ($port == 443)));\n $server_path = $_SERVER['SERVER_NAME'];\n $my_path = $_SERVER['PHP_SELF'];\n $server_path .= trim((($https && ($port != 443)) || (!$https && ($port != 80))) ? ':'.$port : '', '/');\n $server_path = 'http'.($https ? 's' : '').'://'.$server_path.$my_path;\n return $server_path;\n }", "public function getURL() {\n\n\t\t$url = \"\";\n\t\t$type = $this->getType();\n\t\t$subtype = $this->getSubtype();\n\n\t\t// @todo remove when elgg_register_extender_url_handler() has been removed\n\t\tif ($this->id) {\n\t\t\tglobal $CONFIG;\n\n\t\t\t$function = \"\";\n\t\t\tif (isset($CONFIG->extender_url_handler[$type][$subtype])) {\n\t\t\t\t$function = $CONFIG->extender_url_handler[$type][$subtype];\n\t\t\t}\n\t\t\tif (isset($CONFIG->extender_url_handler[$type]['all'])) {\n\t\t\t\t$function = $CONFIG->extender_url_handler[$type]['all'];\n\t\t\t}\n\t\t\tif (isset($CONFIG->extender_url_handler['all']['all'])) {\n\t\t\t\t$function = $CONFIG->extender_url_handler['all']['all'];\n\t\t\t}\n\t\t\tif (is_callable($function)) {\n\t\t\t\t$url = call_user_func($function, $extender);\n\t\t\t}\n\n\t\t\tif ($url) {\n\t\t\t\t$url = elgg_normalize_url($url);\n\t\t\t}\n\t\t}\n\n\t\t$params = array('extender' => $this);\n\t\t$url = elgg_trigger_plugin_hook('extender:url', $type, $params, $url);\n\n\t\treturn elgg_normalize_url($url);\n\t}", "public function render() {\n \t\tif (isset($_GET['eventId']) )\n\t\t\t$this->allElements[$_GET['eventId']]->callOnClickPreRenderFn();\n\n\t\tparent::render();\n \t\t\n\t\tif (isset($_GET['eventId']) )\n\t\t\t$this->allElements[$_GET['eventId']]->callOnClickPostRenderFn();\n\n\t}", "public function render()\n {\n $dataAttribs = $this->_retrieveFormattedDataAttributes();\n $href = $this->_getHref();\n $followButton = <<<HTML\n<a href=\"{$href}\" class=\"{$this->_buttonType} {$this->_extraClasses}\" {$dataAttribs}>@{$this->_twitterAccount}</a>\n<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=\"//platform.twitter.com/widgets.js\";fjs.parentNode.insertBefore(js,fjs);}}(document,\"script\",\"twitter-wjs\");</script>\nHTML;\n return $followButton;\n }", "protected function renderJavascript(){\n \n return sprintf(\n '<script type=\"text/javascript\" src=\"%s\"></script>',\n $this->getField('url')\n );\n \n }", "public static function widget() {\n\t\t$username = self::get_dashboard_widget_option(self::wid, 'username');\n\t\t$apikey = self::get_dashboard_widget_option(self::wid, 'apikey');\n\t\t$project_id = self::get_dashboard_widget_option(self::wid, 'project_id');\n\t\t$ref_url = 'http://go.endcore.64905.digistore24.com/';\n\t\t$check = ($username && $apikey && $project_id ? true : false);\n \n\t\tif(!$check) {\n\t\t\techo '<h4 style=\"text-align:right; padding-right: 40px; padding-top: 10px\">' . __( 'Bitte prüfe die Einstellungen &and;', 'affiliatetheme-backend' ) . '</h4>&nbsp;';\n ?>\n <div class=\"rankalyst-text\">\n <a href=\"<?php echo $ref_url; ?>\" target=\"_blank\"><img src=\"<?php echo get_template_directory_uri(); ?>/_/img/rankalyst.png\"></a>\n <p><?php printf(__('Mit <a href=\"%s\" target=\"_blank\">Rankalyst</a> kannst du 10 Keywords kostenlos tracken!', 'affiliatetheme-backend'), $ref_url); ?></p>\n <a href=\"<?php echo $ref_url; ?>\" target=\"_blank\" class=\"button button-primary\"><?php _e('Kostenlos starten', 'affiliatetheme-backend'); ?></a>\n </div>\n <?php\n\t\t}\n\t\t\n\t\t/* @TODO Rankingchange <span class=\"plus\">+</span> bzw Minus ausgeben, jenachdem ob Change positiv oder negativ. */\n\n ?>\n <div class=\"rankalyst-data\">\n <ul class=\"rankalyst-tabs\">\n <li><a href=\"#\" data-type=\"organic\" class=\"active\"><?php _e('Organic', 'affiliatetheme-backend'); ?></a></li>\n <li><a href=\"#\" data-type=\"mobile\"><?php _e('Mobile', 'affiliatetheme-backend'); ?></a></li>\n <li><a href=\"#\" data-type=\"local\"><?php _e('Local', 'affiliatetheme-backend'); ?></a></li>\n </ul>\n\n <div class=\"rankalyst-tab active\" data-type=\"organic\">\n <?php\n $rankalyst = new AT_Rankalyst_API($username, $apikey, $project_id, 1);\n if($rankalyst) {\n\t $response = $rankalyst->data();\n\t if($response) {\n\t\t if ( $response->status != 'success' ) {\n\t\t\t echo '<div class=\"rankalyst-text\"><p style=\"color: #c01313; margin-top: 10px\">' . $response->message . '</p></div>';\n\t\t } else {\n\t\t\t if ( $response->data ) {\n\t\t\t\t $data = $response->data->items;\n\t\t\t\t $rankalyst->output( $data );\n\t\t\t }\n\t\t }\n\t }\n }\n ?>\n </div>\n\n <div class=\"rankalyst-tab\" data-type=\"mobile\">\n <?php\n $rankalyst = new AT_Rankalyst_API($username, $apikey, $project_id, 2);\n if($rankalyst) {\n\t $response = $rankalyst->data();\n\t if($response) {\n\t\t if ( $response->status != 'success' ) {\n\t\t\t echo '<div class=\"rankalyst-text\"><p style=\"color: #c01313; margin-top: 10px\">' . $response->message . '</p></div>';\n\t\t } else {\n\t\t\t if ( $response->data ) {\n\t\t\t\t $data = $response->data->items;\n\t\t\t\t $rankalyst->output( $data );\n\t\t\t }\n\t\t }\n\t }\n }\n ?>\n </div>\n\n <div class=\"rankalyst-tab\" data-type=\"local\">\n <?php\n $rankalyst = new AT_Rankalyst_API($username, $apikey, $project_id, 3);\n if($rankalyst) {\n\t $response = $rankalyst->data();\n\t if($response) {\n\t\t if ( $response->status != 'success' ) {\n\t\t\t echo '<div class=\"rankalyst-text\"><p style=\"color: #c01313; margin-top: 10px\">' . $response->message . '</p></div>';\n\t\t } else {\n\t\t\t if ( $response->data ) {\n\t\t\t\t $data = $response->data->items;\n\t\t\t\t $rankalyst->output( $data );\n\t\t\t }\n\t\t }\n\t }\n }\n ?>\n </div>\n </div>\n <?php\n }", "public function RenderContentAjax(): void {\n $this->showContent(TRUE);\n }", "public function run()\n {\n if (Yii::app()->request->isAjaxRequest)\n {\n $action = isset($_GET['action']) ? $_GET['action'] : null;\n\n if (empty($action))\n {\n echo 'Param missing: action';\n Yii::app()->end();\n }\n\n switch ($action)\n {\n\n /* case 'ruleupdate':\n $this->renderRuleUpdate();\n break;*/\n\n case 'listpreviewrule':\n $this->renderRuleListPreview();\n break;\n\n case 'listpreviewrules':\n $this->renderRulesListPreview();\n break;\n\n case 'calpreviewrule':\n $this->renderFullCalendarRulePreview();\n break;\n\n case 'calpreviewrules':\n $this->renderFullCalendarRulesPreview();\n break;\n\n case 'addrule':\n $this->renderAddRule();\n break;\n\n default:\n echo 'Unknown action: ' . $action;\n }\n\n Yii::app()->end();\n }\n }", "public function actionIndex(){ \n echo 'REST API';\n //echo \\admin\\components\\GoogleURLShortner::widget([\"url\" => \"http://www.google.com\"]);\n }", "public function ajaxRequest()\n {\n return view('ajaxRequest');\n }", "public function checkWidgetAction()\n {\n $response = ['show_widget' => true];\n $shippingMethod = $this->getRequest()->getParam('shipping_method');\n if (strpos($shippingMethod, '_') === false) {\n $shippingMethod = $shippingMethod . '_' . $shippingMethod;\n }\n if (!$this->_getRouteHelper()->isShippingMethodAllowed($shippingMethod)) {\n $response = ['show_widget' => false];\n }\n $this->getResponse()->setBody(\n $this->_getCoreHelper()->jsonEncode(\n $response\n )\n );\n }", "public function render()\n {\n //rafraichir le chat\n if($_GET['function'] == 'refresh')\n {\n $this->model->refreshTchat();\n }\n \n // ajouter les commentaires\n else if($_GET['function'] == 'add') \n {\n $this->model->saveTchat();\n }\n\n //rafraichir le score\n else if($_GET['function'] == 'score')\n {\n $this->model->recupReponse();\n }\n\n require ROOT.\"/App/View/AjaxView.php\";\n }", "function training_ajax_callback() {\n ctools_include('ajax');\n $output = ctools_ajax_text_button('Click me!', 'training/ctools/ajax/callback-text', 'Click');\n\n return $output;\n}", "public function getTaxRateLoadUrl()\n {\n return $this->getUrl('tax/rate/ajaxLoad/');\n }", "function ajax_message() {\n\t\t$message_path = $this->get_message_path();\n\t\t$query_string = _http_build_query( $_GET, '', ',' );\n\t\t$current_screen = wp_unslash( $_SERVER['REQUEST_URI'] );\n\t\t?>\n\t\t<div class=\"jetpack-jitm-message\"\n\t\t\t data-nonce=\"<?php echo wp_create_nonce( 'wp_rest' ); ?>\"\n\t\t\t data-message-path=\"<?php echo esc_attr( $message_path ); ?>\"\n\t\t\t data-query=\"<?php echo urlencode_deep( $query_string ); ?>\"\n\t\t\t data-redirect=\"<?php echo urlencode_deep( $current_screen ); ?>\"\n\t\t></div>\n\t\t<?php\n\t}", "public function actionAjaxLoad()\r\n {\r\n \treturn $this->render('ajax-load');\r\n }", "function medigroup_mikado_set_ajax_url() {\n echo '<script type=\"application/javascript\">var MikadoAjaxUrl = \"'.admin_url('admin-ajax.php').'\"</script>';\n }", "public function html()\n {\n $random_quote = $this->randomQuote();\n $cp_path = CP_ROUTE;\n return $this->view('widget', compact('random_quote','cp_path'))->render();\n }", "protected function _getFormUrl() {\n $params = array();\n if (Mage::app()->getStore()->isCurrentlySecure()) {\n // Modern browsers require the Ajax request protocol to match the protocol used for initial request,\n // so force Magento to generate a secure URL if the request was secure.\n $params['_forced_secure'] = true;\n }\n return $this->getUrl('cloudiq/callme/request', $params);\n }", "public static function ajax_callback(){\r\n\t\tif(empty($_GET['hid'])){ wp_die('hid is required'); }\r\n\t\tunset($_GET['action']);\r\n\t\tdie(file_get_contents(SpecialOffersSnippet::calculate_url($_GET)));\r\n\t}", "public function handleAjaxRequest();", "public function buildFrontendUri() {}", "public function render(): string\n {\n parent::enqueue();\n $json = $this->jsonMain();\n return twig_render('page_main', $json);\n }", "function generate_frontend_HTML( $shape ) {\n\t\tif ( !$this->is_active() ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t/**\n\t\t * Each network is responsible for its own fetching and processing.\n\t\t * If the value is fresh we already have it.\n\t\t * Else, the network makes a new request.\n\t\t *\n\t\t * In the case of new requests, do them all THEN save the results.\n\t\t *\n\t\t */\n\t\t$this->establish_follow_count();\n\t\t$this->establish_display_settings();\n\n\t\t$style_variations_block = array('block', 'pill', 'shift', 'leaf' );\n\n\t\tif ( in_array( $shape, $style_variations_block ) ) {\n\t\t\t// Add the vendor prefix to prevent selector collision.\n\t\t\treturn $this->generate_block_HTML( 'swfw_'.$shape.'_button' );\n\t\t}\n\n\t\t// Create the callback function as a string, then call it.\n\t\t$generate_x_HTML = \"generate_\" . $shape . \"_HTML\";\n\n\t\treturn $this->$generate_x_HTML();\n\t}", "function ajax_render_location_rule()\n {\n }", "protected function renderAsJavascript() {}", "public function ajax_get_content() {\n\n\t\t\tif ( ! function_exists( 'jet_engine' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tadd_filter( 'jet-engine/listing/grid/posts-query-args', array( $this, 'add_query_args' ), 10, 2 );\n\t\t\tadd_filter( 'jet-engine/listing/grid/custom-settings', array( $this, 'add_settings' ), 10, 2 );\n\n\t\t\tif ( ! class_exists( 'Elementor\\Jet_Listing_Grid_Widget' ) ) {\n\t\t\t\tif ( version_compare( jet_engine()->get_version(), '2.0', '<' ) ) {\n\t\t\t\t\trequire_once jet_engine()->plugin_path( 'includes/listings/static-widgets/grid.php' );\n\t\t\t\t} else {\n\t\t\t\t\trequire_once jet_engine()->plugin_path( 'includes/components/elementor-views/static-widgets/grid.php' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! class_exists( 'Elementor\\Jet_Listing_Calendar_Widget' ) ) {\n\t\t\t\tif ( version_compare( jet_engine()->get_version(), '2.0', '<' ) ) {\n\t\t\t\t\trequire_once jet_engine()->modules->modules_path( 'calendar/calendar.php' );\n\t\t\t\t} else {\n\t\t\t\t\trequire_once jet_engine()->modules->modules_path( 'calendar/widget.php' );\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tElementor\\Plugin::instance()->frontend->start_excerpt_flag( null );\n\n\t\t\t$widget = new Elementor\\Jet_Listing_Calendar_Widget( array(\n\t\t\t\t'id' => null,\n\t\t\t\t'elType' => 'widget',\n\t\t\t\t'settings' => jet_smart_filters()->query->get_query_settings(),\n\t\t\t\t'elements' => array(),\n\t\t\t\t'widgetType' => 'jet-listing-calendar',\n\t\t\t), array() );\n\n\t\t\t$widget->render_posts();\n\n\t\t}", "protected function RenderAjax() {\r\n\t\t\t$strToReturn = '<controls>';\r\n\r\n\t\t\t// Include each control (if applicable) that has been changed/modified\r\n\t\t\tforeach ($this->GetAllControls() as $objControl)\r\n\t\t\t\tif (!$objControl->ParentControl)\r\n//\t\t\t\t\t$strToReturn .= $objControl->RenderAjax(false) . \"\\r\\n\";\r\n\t\t\t\t\t$strToReturn .= $this->RenderAjaxHelper($objControl);\r\n\r\n\t\t\t$strCommands = '';\r\n\t\t\t\r\n\t\t\t// Look to the Application object for any commands to run\r\n\t\t\tforeach (QApplication::$AlertMessageArray as $strAlert) {\r\n\t\t\t\t$strAlert = QString::XmlEscape(sprintf('alert(\"%s\");', addslashes($strAlert)));\r\n\t\t\t\t$strCommands .= sprintf('<command>%s</command>', $strAlert);\r\n\t\t\t}\r\n\t\t\tforeach (QApplication::$JavaScriptArrayHighPriority as $strJavaScript) {\r\n\t\t\t\t$strJavaScript = trim($strJavaScript);\r\n\t\t\t\t\r\n\t\t\t\tif (strlen($strJavaScript)) {\r\n\t\t\t\t\tif (QString::LastCharacter($strJavaScript) != ';')\r\n\t\t\t\t\t\t$strJavaScript .= ';';\r\n\t\t\t\t\t$strCommands .= sprintf('<command>%s</command>', QString::XmlEscape($strJavaScript));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tforeach (QApplication::$JavaScriptArray as $strJavaScript) {\r\n\t\t\t\t$strJavaScript = trim($strJavaScript);\r\n\t\t\t\tif (strlen($strJavaScript)) {\r\n\t\t\t\t\tif (QString::LastCharacter($strJavaScript) != ';')\r\n\t\t\t\t\t\t$strJavaScript .= ';';\r\n\t\t\t\t\t$strCommands .= sprintf('<command>%s</command>', QString::XmlEscape($strJavaScript));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$strRegCJavaScript = '';\r\n\t\t\tforeach ($this->GetAllControls() as $objControl) {\r\n\t\t\t\tif ($objControl->Rendered) {\r\n\t\t\t\t\t$strRegCJavaScript .= sprintf('qc.regC(\"%s\"); ', $objControl->ControlId);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif ($strRegCJavaScript)\r\n\t\t\t\t$strCommands .= sprintf('<command>%s</command>', QString::XmlEscape($strRegCJavaScript));\r\n\r\n\t\t\tforeach ($this->GetAllControls() as $objControl) {\r\n\t\t\t\tif ($objControl->Rendered) {\r\n\t\t\t\t\t$strJavaScript = $objControl->GetEndScript();\r\n\t\t\t\t\tif (strlen($strJavaScript))\r\n\t\t\t\t\t\t$strCommands .= sprintf('<command>%s</command>', QString::XmlEscape($objControl->GetEndScript()));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tforeach ($this->objGroupingArray as $objGrouping) {\r\n\t\t\t\t$strRender = $objGrouping->Render();\r\n\t\t\t\tif (trim($strRender))\r\n\t\t\t\t\t$strCommands .= sprintf('<command>%s</command>', QString::XmlEscape($strRender));\r\n\t\t\t}\r\n\r\n\t\t\t// Add in the form state\r\n\t\t\t// DO SOMETHING DIFFERENT IF FORM IS UseSession\r\n\t\t\t$strFormState = QForm::Serialize($this);\r\n\t\t\t$strToReturn .= sprintf('<control id=\"Qform__FormState\">%s</control>', $strFormState);\r\n\r\n\t\t\t// close Control collection, Open the Command collection\r\n\t\t\t$strToReturn .= '</controls><commands>';\r\n\t\t\t\r\n\t\t\t$strToReturn .= $strCommands;\r\n\r\n\t\t\t// close Command collection\r\n\t\t\t$strToReturn .= '</commands>';\r\n\r\n\t\t\t$strContents = trim(ob_get_contents());\r\n\r\n\t\t\tif (strtolower(substr($strContents, 0, 5)) == 'debug') {\r\n\t\t\t} else {\r\n\t\t\t\tob_clean();\r\n\r\n\t\t\t\t// Response is in XML Format\r\n\t\t\t\theader('Content-Type: text/xml');\r\n\r\n\t\t\t\t// Output it and update render state\r\n\t\t\t\tif (QApplication::$EncodingType)\r\n\t\t\t\t\tprintf(\"<?xml version=\\\"1.0\\\" encoding=\\\"%s\\\"?><response>%s</response>\\r\\n\", QApplication::$EncodingType, $strToReturn);\r\n\t\t\t\telse\r\n\t\t\t\t\tprintf(\"<?xml version=\\\"1.0\\\"?><response>%s</response>\\r\\n\", $strToReturn);\r\n\t\t\t}\r\n\r\n\t\t\t// Update Render State\r\n\t\t\t$this->intFormStatus = QFormBase::FormStatusRenderEnded;\r\n\t\t}", "function voyage_mikado_set_ajax_url() {\n echo '<script type=\"application/javascript\">var MikadofAjaxUrl = \"'.admin_url('admin-ajax.php').'\"</script>';\n }", "public function getWidget();", "protected function get_admin_form_uri()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->get_admin_ajax_base_uri();\n }", "public function _ajax()\n\t{\n\t\tswitch($this->action)\n\t\t{\t\t\t\t\n\t\t\tcase 'category':\t\t\t\t\n\t\t\t\tif(empty($_GET['sort']))\n\t\t\t\t\treturn $this->posts_wrapper();\n\t\t\t\treturn $this->get_posts_list();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'view':\n\t\t\t\tif(empty($_GET['sort']))\n\t\t\t\t\treturn $this->comments_wrapper();\n\t\t\t\treturn $this->get_comments_list($this->filter);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'submit':\n\t\t\t\treturn $this->add_post();\n\t\t\t\tbreak;\n\n\t\t\tcase 'vote':\n\t\t\t\treturn $this->vote();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'edit':\n\t\t\t\treturn $this->edit();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'my':\n\t\t\t\t# no sorter default to posts.\n\t\t\t\tif(empty($_GET['sort']))\n\t\t\t\t\treturn $this->my($this->filter);\n\t\t\t\t\n\t\t\t\t# has sorter, so we fetch raw content lists\n\t\t\t\tif('posts' == $this->filter)\n\t\t\t\t\treturn $this->my_posts_list();\n\t\t\t\tif('comments' == $this->filter)\n\t\t\t\t\treturn $this->my_comments_list();\n\t\t\t\tif('starred' == $this->filter)\n\t\t\t\t\treturn $this->my_starred_list();\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn 'invalid url parameters';\n\t}", "public function render(): string\n {\n if (!parent::enqueue()) {\n return '';\n }\n $action = input_get('action');\n if ('search' === $action) {\n $json = $this->executeSearch();\n } elseif ('edit' === $action) {\n $json = $this->executeEdit();\n } else {\n $json = $this->executeStart();\n }\n return twig_render('menu_covers', $json);\n }", "public function render() {\n\t\t//$masthead->loggedIn = $this->loggedIn;\n\t\t//$masthead->username = $this->username;\n\t\t////$masthead->google = $this->google->render();\n\t\t//return $masthead->render('Template_Widget_Masthead.php');\n\t\t\n\t\t$this->isLoggedIn = $this->_session->login_check($this->mysqli);\n\t\t\n\t\tif(!$this->isLoggedIn)\n\t\t{\n\t\t\t//throw new Exception_Permission(\"Not logged in.\");\n\t\t\treturn \"widget requires you be logged in\";\n\t\t}else{\n\t\t\t$this->permissions = $this->_session->getPermissions($this->mysqli);\n\t\t\t$isAdmin = in_array(\"admin\",$this->permissions); // need to be more strict? bool for that\n\t\t\tif(!$isAdmin)\n\t\t\t{\n\t\t\t\t//throw new Exception_Permission(\"Not authorized.\");\n\t\t\t\treturn \"not authorized for this widget\";\n\t\t\t}else{\n\t\t\t\n\t\t\t\tif ($result = $this->mysqli->query(\"SELECT m.id, m.username, m.email FROM members m\")) {\n\t\t\t\t\t$rows = array();\n\t\t\t\t\t\n\t\t\t\t\twhile($row = $result->fetch_row())\n\t\t\t\t\t{\n\t\t\t\t\t\t$rows[]=$row;\n\t\t\t\t\t}\n\t\t\t\t\t$result->close();\n\t\t\t\t\t\n\t\t\t\t\t$template = new Template();\n\t\t\t\t\t$template->userdata = $rows;\n\t\t\t\t\treturn $template->render('Template_Widget_AdminUsersPanel.php');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function get_ajax_handler() {\n\t\treturn $this->ajax;\n\t}", "function wpsl_get_ajax_url() {\n\n $i18n = new WPSL_i18n();\n\n $param = '';\n\n if ( $i18n->wpml_exists() && defined( 'ICL_LANGUAGE_CODE' ) ) {\n $param = '?lang=' . ICL_LANGUAGE_CODE;\n }\n\n $ajax_url = admin_url( 'admin-ajax.php' . $param );\n\n return $ajax_url;\n}", "function wc_ajaxurl() {\n\t\t?>\n\t\t<script type=\"text/javascript\">\n\t\t\tvar ajaxurl =\t\"<?php echo admin_url('admin-ajax.php'); ?>\";\n\t\t\tvar wpurl =\t\t\"<?php bloginfo('template_directory'); ?>\";\n\t\t</script>\n\t\t<?php\n\t}", "public function render( ){\n\t\treturn $this->__childWidget->render();\n\t}", "public function renderWidget()\n {\n if ($this->data !== null) {\n $this->htmlAttributes['value'] = $this->data;\n }\n\n // And to be sure to generate a proper html text input with the proper name...\n $this->htmlAttributes['type'] = $this->type;\n $this->htmlAttributes['name'] = $this->name;\n $this->htmlAttributes['id'] = $this->getId();\n\n $output = '<input ';\n\n $output .= $this->renderHtmlAttributes();\n\n $output .= '/>';\n\n return $output;\n }", "public function ajax_frontend_call()\n {\n\n // Security check\n check_ajax_referer('referer_id', 'nonce');\n\n $response = 'OK';\n // Send response in JSON format\n // wp_send_json( $response );\n // wp_send_json_error();\n wp_send_json_success($response);\n\n die();\n }", "function wck_print_ajax_url(){\r\n\t\techo '<script type=\"text/javascript\">var wppbWckAjaxurl = \"'. apply_filters( 'wck_ajax_url', admin_url('admin-ajax.php') ) .'\";</script>';\r\n\t}", "public function ajax()\n {\n if ($_POST['url'] != '' && $_POST['css'] != '') {\n $url = $_POST['url'];\n $css = $_POST['css'];\n\n $html = file_get_html($url);\n\n // If we get the empty array as a result, we can assume\n // that user inputed css selector does not exist\n // on the page, so we need to bail out!\n if ($html->find($css) == []) {\n return '<script>alert(\"No search results found with param: ' . $css . '\");</script>';\n }\n\n $render = '<div class=\"row\" id=\"innerWrap\">';\n\n foreach ($html->find($css) as $element) {\n\n $render .= $element->innertext . '<hr>';\n }\n\n $render .= '</div>';\n\n return $render;\n }\n\n return null;\n }", "public function render()\n {\n // Get the render location\n $renderLocation = ($this->renderHead) ? CClientScript::POS_HEAD : CClientScript::POS_END;\n \n // Get the namespace\n $n = (($this->namespace != '' && ctype_alnum($this->namespace)) ? $this->namespace : 's');\n \n // Check for s_code rendering\n if($this->s_codeLocation != '')\n Yii::app()->clientScript->registerScriptFile($this->s_codeLocations, $renderLocation);\n \n // Start the rendering...\n $js = '';\n \n // Do we need to create the object?\n if($this->createObject)\n $js.= 'var ' . $n . ' = ' . $n . '_account(' . self::Q . $this->_formatVariable('s_account', $this->s_account) . self::Q . ');' . PHP_EOL;\n \n // Go through the data\n foreach($this->_data as $var => $value)\n {\n $js.= $n . '.' . $var . ' = ' . self::Q . preg_replace('~(?<!\\\\\\)'. self::Q . '~', '\\\\'. self::Q, $this->_formatVariable($var, $value)) . self::Q . ';' . PHP_EOL;\n }\n \n // Should we add s.t()?\n if($this->autoPageview)\n $js.= $n . '.t();' . PHP_EOL;\n \n // TagPla.net copyright... please leave in here!\n $js.= '// Adobe SiteCatalyst Extension provided by TagPla.net' . PHP_EOL;\n $js.= '// https://github.com/TagPlanet/yii-analytics' . PHP_EOL;\n $js.= '// Copyright 2012, TagPla.net & Philip Lawrence' . PHP_EOL;\n \n \n // Should we auto add in the analytics tag?\n if($this->autoRender)\n {\n Yii::app()->clientScript\n ->registerScript('TPSiteCatalyst', $js, CClientScript::POS_HEAD);\n }\n else\n {\n return $js;\n }\n \n return;\n }", "public function frontend_render()\n {\n $user_selected_language = get_user_lang();\n $widget_saved_values = $this->get_settings();\n\n $widget_title = $widget_saved_values['widget_title_' . $user_selected_language] ?? '';\n\n $output = $this->widget_before(); //render widget before content\n\n if (!empty($widget_title)) {\n $output .= '<h4 class=\"widget-title\">' . purify_html($widget_title) . '</h4>';\n }\n $output .='<div class=\"widget widget_search\">\n <form action=\"'.route('frontend.blog.search').'\" method=\"get\" class=\"search-form\">\n <div class=\"form-group\">\n <input type=\"text\" class=\"form-control\" name=\"search\" placeholder=\"'.__('Write your keyword...').'\">\n </div>\n <button class=\"submit-btn\" type=\"submit\"><i class=\"fa fa-search\"></i></button>\n </form>\n </div>';\n\n $output .= $this->widget_after(); // render widget after content\n\n return $output;\n }", "protected abstract function getButtonCallbackURL();", "public function url() {\n if ($this->no_results)\n return false;\n\n $config = Config::current();\n\n return url(\"view/\".$this->url, ExtendController::current());\n }", "protected function getShow(){\r\n\t\t//$strr = file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/embed.php?'.$this->Property->getValue($_SESSION['langue'])->getValueShort());\r\n\t\t$dao = $this->Factory->getPropertyValueDAO();\r\n\t\t$docid = $this->params['currentid'];\r\n\t\t$proId = $this->Property->getId();\r\n\t\t$value= $dao->getByPropertyByDocumentUsingIds($docid,$proId,$_SESSION['langue']);\r\n\t\t$_SESSION['wrapperurl']=$_SERVER['REQUEST_URI'];\r\n\t\t$strr.='<script type=\"text/javascript\">';\r\n\t\t//$strr.='jQuery.ajaxSetup ({cache: false});';\r\n\t\t$strr.='url = \"http://'.$_SERVER['HTTP_HOST'].'/embed.php?'.$value->getValueShort().'\";';\r\n\t\t$this->content.='ajaxLoad(url,\\'listing\\',function() {jQuery(\\'#dynTab\\').dataTable({\"oLanguage\": {\"sUrl\": \"/js/lang/dynTable_'.strtoupper($_SESSION['langue']).'.txt\"}});});';\r\n\t\t//$strr.='jQuery(\"#data\").ready(function(){jQuery(\"#data\").html(ajax_load).load(loadUrl, function() {jQuery(\\'#dynTab\\').dataTable({\"oLanguage\": {\"sUrl\": \"/js/lang/dynTable_'.strtoupper($_SESSION['langue']).'.txt\"}});});});';\r\n\t\t$strr.='</script>'.\"\\n\";\r\n\t\t\r\n\t\treturn $strr;\r\n\t}", "protected function ajax() {\n\t\t// Ignore invalid AJAX requests, AJAX requests should always contain a vote\n\t\tif ( ! $this->is_ajax or empty( $this->new_vote ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Load results and vote feedback\n\t\t$this->load_results();\n\t\t$this->load_vote();\n\n\t\t// Send the item back in JSON format\n\t\techo json_encode( $this->item );\n\t}", "function backend_ajax_button($caption, $ajaxHandler, $attributes = array(), $ajaxParams = null)\n\t{\n\t\treturn Backend_Html::ajaxButton($caption, $ajaxHandler, $attributes, $ajaxParams);\n\t}", "protected function renderCurrentUrl() {}", "protected function renderCurrentUrl() {}", "public function render () {\n\n\t\tcall_user_func_array([$this->_controller, $this->_method], $this->_params);\n\t}", "public function widgetJsAction(Request $request)\n {\n $response = $this->render(\"FreifunkStatisticBundle:Js:widget.js.twig\");\n $response->headers->add(array(\n 'Content-Type' => 'text/javascript; charset=UTF-8'\n ));\n // cache\n $response->setPublic();\n $response->setETag(md5($response->getContent()));\n $response->isNotModified($this->getRequest());\n $response->setMaxAge(60 * 60 * 24 * 30);\n\n return $response;\n }", "public function render() {\n Openbizx::$app->getClientProxy()->includeCalendarScripts();\n\n $format = $this->dateFormat ? $this->dateFormat : \"%Y-%m-%d\";\n\n $sHTML = parent::render();\n\n $showTime = 'false';\n //$image = \"<img src=\\\"\".Openbizx::$app->getImageUrl().\"/calendar.gif\\\" border=0 title=\\\"Select date...\\\" align='top' hspace='2'>\";\n $sHTML .= \"<a class=\\\"date_picker\\\" href=\\\"javascript: void(0);\\\" onclick=\\\"return showCalendar('$this->objectName','$format',$showTime,true);\\\"></a>\";\n return $sHTML;\n }", "public function render()\n {\n return static::renderStatic(\n $this->arguments,\n $this->buildRenderChildrenClosure(),\n $this->renderingContext\n );\n }", "public function ajaxCall() {\n return json_encode('asdf');\n }", "public function forAjaxTemplate()\n {\n $view = SSViewer::create($this->getTemplates());\n\n $return = $view->dontRewriteHashlinks()->process($this);\n\n // Now that we're rendered, clear message\n $this->clearMessage();\n\n return $return;\n }" ]
[ "0.7148367", "0.70140237", "0.70140237", "0.6557887", "0.6557887", "0.6496702", "0.60356027", "0.60070986", "0.59861904", "0.59738755", "0.5886633", "0.57751715", "0.5761966", "0.5743771", "0.57369703", "0.56871164", "0.56313616", "0.56305206", "0.56267154", "0.5621817", "0.56190926", "0.5613684", "0.559904", "0.5538573", "0.5532968", "0.5523587", "0.5515738", "0.5507297", "0.546581", "0.54376376", "0.5402319", "0.5383986", "0.5369848", "0.5365324", "0.53227735", "0.5317849", "0.53143436", "0.5305284", "0.5298321", "0.52934897", "0.52792203", "0.5274256", "0.52726674", "0.5272224", "0.5269489", "0.52665293", "0.5258123", "0.5215182", "0.5204593", "0.5190483", "0.51902926", "0.5189493", "0.5185508", "0.5177854", "0.51707476", "0.51592475", "0.51506644", "0.51365113", "0.5102902", "0.50870556", "0.5086514", "0.5084917", "0.50767785", "0.5065665", "0.506504", "0.5063752", "0.5062218", "0.50577384", "0.5057052", "0.504843", "0.5045488", "0.503679", "0.5022516", "0.50204283", "0.501698", "0.5013212", "0.50117296", "0.5006604", "0.5001601", "0.5001137", "0.49966893", "0.49896154", "0.49689192", "0.496855", "0.49678767", "0.49658793", "0.49625972", "0.49559292", "0.49541196", "0.49493378", "0.4948782", "0.49345806", "0.49323398", "0.49323398", "0.49318582", "0.49313638", "0.492843", "0.49212128", "0.49189812", "0.49189466" ]
0.6116061
6
List of services to preload.
public function toPreload() { return array('web.Broker'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function load_services() {\n\t\tforeach ( $this->get_services() as $service_classname ) {\n\t\t\t$this->load_service( $service_classname );\n\t\t}\n\t}", "private function loadServices()\n {\n # Receive list of available service binary's\n exec(\"php composer.phar exec --list\", $services);\n $services = array_filter($services, function ($row) {\n return (substr($row, 0, 1) === '-' && strpos($row, 'service-')) &&\n (!strpos($row, 'service-manager')) &&\n (!strpos($row, 'service-socket'));\n });\n\n array_unshift($services, \"service-socket\");\n foreach ($services as $service) {\n $service = str_replace(\"- \", \"\", $service);\n $this->loadService($service);\n }\n }", "private function get_services() {\n\t\treturn [\n\t\t\tServices\\Language_Loader::class,\n\t\t\tServices\\Setup_Database::class,\n\t\t\tServices\\Scripts_And_Templates::class,\n\t\t\tServices\\Admin_Pages::class,\n\t\t\tServices\\Setup_Settings_Page::class,\n\t\t\tServices\\Loggers_Loader::class,\n\t\t\tServices\\Dropins_Loader::class,\n\t\t\tServices\\Setup_Log_Filters::class,\n\t\t\tServices\\Setup_Pause_Resume_Actions::class,\n\t\t\tServices\\Setup_Purge_DB_Cron::class,\n\t\t\tServices\\API::class,\n\t\t\tServices\\Dashboard_Widget::class,\n\t\t\tServices\\Network_Menu_Items::class,\n\t\t\tServices\\Plugin_List_Link::class,\n\t\t];\n\t}", "private static function loadServices() {\n\n Application::$services = array();\n\n $config = Application::getConfig();\n\n if ($handle = opendir($config[\"system\"][\"service-folder\"])) {\n\n /* Das ist der korrekte Weg, ein Verzeichnis zu durchlaufen. */\n while (false !== ($entry = readdir($handle))) {\n if ($entry != \".\" && $entry != \"..\") {\n require $config[\"system\"][\"service-folder\"] . \"/\" . $entry;\n $className = $config[\"system\"][\"namespace\"] . \"\\\\services\\\\\" . basename($entry,\".php\");\n $testClass = new \\ReflectionClass($className);\n if (!$testClass->isAbstract()) {\n Application::$services[basename($entry,\".php\")] = new $className();\n }\n\n }\n }\n closedir($handle);\n }\n }", "public function loadServices($providers);", "public static function loadPersistentServices()\n {\n $handlers = ModUtil::getVar(self::HANDLERS, 'definitions', array());\n if (!$handlers) {\n return;\n }\n\n foreach ($handlers as $id => $handler) {\n self::$serviceManager->registerService(new Zikula_ServiceManager_Service($id, $handler['definition'], $handler['shared']));\n }\n }", "public function getServices();", "public static function get_services() {\n return [ \n Pages\\Admin::class,\n Base\\Enqueue::class,\n Base\\SettingsLinks::class,\n Base\\JsObjectsManager::class,\n Base\\ShortCodesManager::class\n ];\n }", "public function getServices()\r\n {\r\n if (is_null($this->_services)) {\r\n if ($this->getConfig('auto')) {\r\n $this->_services = array();\r\n $config = Mage::app()->getConfig();\r\n foreach (array('cache', 'full_page_cache', 'fpc') as $cacheType) {\r\n $node = $config->getXpath('global/' . $cacheType . '[1]');\r\n if (isset($node[0]->backend) && in_array((string)$node[0]->backend, array(\r\n 'Cm_Cache_Backend_Redis',\r\n 'Mage_Cache_Backend_Redis'\r\n ))) {\r\n $this->_services[] = $this->_buildServiceArray(\r\n $this->__(str_replace('_', ' ', uc_words($cacheType))),\r\n $node[0]->backend_options->server,\r\n $node[0]->backend_options->port,\r\n $node[0]->backend_options->password,\r\n $node[0]->backend_options->database\r\n );\r\n }\r\n }\r\n // get session\r\n $node = $config->getXpath('global/redis_session');\r\n if ($node) {\r\n $this->_services[] = $this->_buildServiceArray(\r\n $this->__('Session'),\r\n $node[0]->host,\r\n $node[0]->port,\r\n $node[0]->password,\r\n $node[0]->db\r\n );\r\n }\r\n } else {\r\n $this->_services = unserialize($this->getConfig('manual'));\r\n }\r\n }\r\n return $this->_services;\r\n }", "public static function get_services()\n {\n return [\n Pages\\Admin::class,\n Base\\Enqueue::class,\n Base\\CustomPostType::class,\n Base\\CustomMetaBox::class,\n Base\\Shortcode::class,\n Base\\Cron::class,\n ];\n }", "public static function getServices(): array\n {\n return static::$services;\n }", "public function services()\n {\n return $this->belongstomany(Service::class);\n }", "public function toPreload()\n\t{\n\t\treturn array('web.Broker', 'template.Opt');\n\t}", "public static function get_services()\n {\n return [\n Pages\\Dashboard::class,\n Base\\Enqueue::class,\n Base\\SettingsLink::class,\n Base\\CustomPostTypeController::class,\n ];\n }", "public function getRequiredServices();", "public function getServices(): array;", "public function services($ignore_cache = false) {\n if ($this->services === null || $ignore_cache) {\n $this->services = StatusBoard_Service::allForSite($this);\n }\n \n return $this->services;\n }", "public function getDeferredServices(): array\n {\n return $this->deferredServices;\n }", "public function services(): array\n {\n return \\array_merge(\n \\array_keys($this->_services),\n \\array_keys($this->aliases)\n );\n }", "protected function setPreloads()\n {\n if (!$this->preloadList = \\Xoops_Cache::read('system_modules_preloads')) {\n // get active modules from the xoops instance\n $modules_list = \\Xoops::getInstance()->getActiveModules();\n if (empty($modules_list)) {\n // this should only happen if an exception was thrown in setActiveModules()\n $modules_list = array ('system');\n }\n $this->preloadList =array();\n $i = 0;\n foreach ($modules_list as $module) {\n if (is_dir($dir = XOOPS_ROOT_PATH . \"/modules/{$module}/preloads/\")) {\n $file_list = \\XoopsLists::getFileListAsArray($dir);\n foreach ($file_list as $file) {\n if (preg_match('/(\\.php)$/i', $file)) {\n $file = substr($file, 0, -4);\n $this->preloadList[$i]['module'] = $module;\n $this->preloadList[$i]['file'] = $file;\n $i++;\n }\n }\n }\n }\n \\Xoops_Cache::write('system_modules_preloads', $this->preloadList);\n }\n }", "public static function get_services(): array\n {\n return [\n Base\\SettingsLinks::class,\n Pages\\Admin::class,\n Base\\Enqueue::class,\n CPT\\EmailCpt::class,\n ];\n }", "public static function get_services()\n {\n\n //підключаємо всі необхідні класи для активації через масив\n return [\n Pages\\Admin::class,\n Base\\Enqueue::class,\n Base\\SettingsLinks::class\n ];\n }", "protected function loadServices()\n {\n $di = $this->getDI();\n\n // Register the dispatcher setting a Namespace for controllers\n $di->setShared('dispatcher', function () {\n\n\n $dispatcher = new Dispatcher();\n $dispatcher->setDefaultNamespace('Phalcana\\Controllers');\n\n $listener = new Dispatch;\n $events = new Manager();\n $events->attach('dispatch', $listener);\n $dispatcher->setEventsManager($events);\n\n return $dispatcher;\n });\n\n $di->setShared('router', $this->loadRoutes(new Router(false)));\n }", "public function getClassLoaders();", "function getCacheServices();", "public function getDeclaredServices(): array\n {\n return [\n // Service id, optional class name, tag\n ['best_it_contentful.markdown.twig_extension', MarkdownExtension::class, 'twig.extension'],\n ['best_it_contentful.contentful.twig_extension', ContentfulExtension::class, 'twig.extension'],\n ['best_it_contentful.delivery.cache.reset_service', CacheResetService::class],\n ['best_it_contentful.delivery.client', ClientDecorator::class],\n ['best_it_contentful.markdown.parser', MarkdownParser::class],\n ['best_it_contentful.delivery.response_parser.default', SimpleResponseParser::class]\n ];\n }", "protected function getServices()\n {\n return $this->services;\n }", "public function findServices(): array;", "function get_recommender_services_list() {\n global $CFG;\n\n static $services = array();\n\n // see if we have run it already\n if (!empty($services)) {\n return $services;\n }\n\n $servicesdir = $CFG->dirroot.'/blocks/recommender/services/';\n\n $plugins = get_list_of_plugins('', '', $servicesdir);\n\n foreach ($plugins as $plugin) {\n $servicefile = $servicesdir . $plugin. '/lib.php';\n if (is_readable($servicefile)) {\n include_once($servicefile);\n $serviceclass = 'block_recommender_service_' . $plugin;\n if (class_exists($serviceclass)) {\n $services[] = $plugin;\n } else {\n throw new block_recommender_exception(get_string('errorcallingservice',\n 'block_recommender', $plugin));\n }\n } else {\n throw new block_recommender_exception(get_string('errornosuchservice',\n 'block_recommender', $plugin));\n }\n }\n\n return $services;\n}", "protected function get_service_classes(): array {\n\t\treturn [];\n\t}", "public function &getServices(): array {\n return $this->services;\n }", "public function getDependencies()\n {\n return array(\n MongoServiceProvider::SERVICE_NAME\n );\n }", "public function getServices()\n\t{\n\t\treturn ['card', 'topup_mobile', 'topup_mobile_post', 'topup_game'];\n\t}", "public function getLoadedProviders(): array\n {\n return $this->loadServiceProviders;\n }", "static function getServiceList()\n {\n return session::get('ServerService');\n }", "public function registerServices() {\n\t\t$services = $this->getServices();\n\t\t$services = array_map( [ $this, 'instantiateServices' ], $services );\n\t\t\n\t\tarray_walk( $services, function ( Service $service ) {\n\t\t\t$service->register();\n\t\t} );\n\t}", "public function getLoaders()\n {\n return $this->loaders;\n }", "public function getLoaders()\n {\n return $this->loaders;\n }", "private function load_dependencies() {\n\n\t\t$this->loader = new Service_Tracker_Loader();\n\n\t}", "public function getRequestedServices();", "public static function getListServices () {\n return self::findByStatus(self::STATUS_ACTIVE);\n }", "public function register_services(): void {\n\t\t// Bail early so we don't instantiate services twice.\n\t\tif ( \\count( $this->service_container ) > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Add the injector as the very first service.\n\t\t$this->service_container->put(\n\t\t\tstatic::SERVICE_PREFIX . static::INJECTOR_ID,\n\t\t\t$this->injector\n\t\t);\n\n\t\t$services = $this->get_service_classes();\n\n\t\tif ( $this->enable_filters ) {\n\t\t\t/**\n\t\t\t * Filter the default services that make up this plugin.\n\t\t\t *\n\t\t\t * This can be used to add services to the service container for\n\t\t\t * this plugin.\n\t\t\t *\n\t\t\t * @param array<string, string> $services Associative array of identifier =>\n\t\t\t * class mappings. The provided\n\t\t\t * classes need to implement the\n\t\t\t * Service interface.\n\t\t\t */\n\t\t\t$filtered_services = apply_filters(\n\t\t\t\tstatic::HOOK_PREFIX . static::SERVICES_FILTER,\n\t\t\t\t$services\n\t\t\t);\n\n\t\t\t$services = $this->validate_services( $filtered_services );\n\t\t}\n\n\t\twhile ( null !== key( $services ) ) {\n\t\t\t$id = $this->maybe_resolve( key( $services ) );\n\n\t\t\t$class = $this->maybe_resolve( current( $services ) );\n\n\t\t\t// Delay registering the service until all requirements are met.\n\t\t\tif (\n\t\t\t\tis_a( $class, HasRequirements::class, true )\n\t\t\t) {\n\t\t\t\tif ( ! $this->requirements_are_met( $id, $class, $services ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->schedule_potential_service_registration( $id, $class );\n\n\t\t\tnext( $services );\n\t\t}\n\t}", "public function preload($preload = null);", "public function register_services() {\n\t\t// Bail early so we don't instantiate services twice.\n\t\tif ( ! empty( $this->services ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$classes = $this->get_service_classes();\n\n\t\t$this->services = array_map(\n\t\t\t[ $this, 'instantiate_service' ],\n\t\t\t$classes\n\t\t);\n\n\t\tarray_walk( $this->services, function ( Service $service ) {\n\t\t\t$service->register();\n\t\t} );\n\t}", "public function getServices()\n {\n return $this->services;\n }", "public function getServices()\n {\n return $this->services;\n }", "public function getServices()\n {\n return $this->services;\n }", "public function registerServices() {\n\t\t$services = Config::inst()->get('FakeManager', 'services');\n\t\tif($services) {\n\t\t\tforeach($services as $origName => $fakeName) {\n\t\t\t\t$fakeObj = Injector::inst()->create($fakeName);\n\t\t\t\tif($this->db && $fakeObj instanceof FakeDatabaseConsumerInterface) {\n\t\t\t\t\t$fakeObj->setDb($this->db);\n\t\t\t\t}\n\t\t\t\t$this->services[$origName] = $fakeObj;\n\t\t\t\tInjector::inst()->registerService($fakeObj, $origName);\n\t\t\t}\n\t\t}\n\t}", "public static function loadAll();", "public static function getDeferredServices(){\n return \\Illuminate\\Foundation\\Application::getDeferredServices();\n }", "public function getServices() {\n return $this->services;\n }", "public function getServices() {\n return $this->services;\n }", "public function getServices() {\n $serviceNames = $this->getServiceNames($this->serviceFolderPaths);\n $ret = $ret1 = array();\n// require_once AMFPHP_ROOTPATH.'Plugins/AmfphpDiscovery/CReflection.php';\n foreach ($serviceNames as $serviceName) {\n/* $methods = array();\n $objC = new CReflection(APP_PATH.'/app/controllers/'.$serviceName.'.php');\n $objComment = $objC->getDocComment();\n $arrMethod = $objC->getMethods();\n foreach ($arrMethod as $objMethods)\n {\n $methodComment = $objMethods->getDocComment();\n $parsedMethodComment = $this->parseMethodComment($methodComment);\n $arrParamenter = $objMethods->getParameters();\n foreach ($arrParamenter as $Paramenter)\n {\n $parameterInfo = new AmfphpDiscovery_ParameterDescriptor($Paramenter, '');\n $parameters[] = $parameterInfo;\n }\n $methods[$objMethods->_name] = new AmfphpDiscovery_MethodDescriptor($objMethods->_name, $parameters, $methodComment, $parsedMethodComment['return']);\n }\n\n $ret[$serviceName] = new AmfphpDiscovery_ServiceDescriptor($serviceName, $methods, $objComment); */\n $ret1[] = array('label'=>$serviceName,'date'=>'');\n }\n// var_dump($ret);exit();\n //note : filtering must be done at the end, as for example excluding a Vo class needed by another creates issues\n foreach ($ret as $serviceName => $serviceObj) {\n foreach (self::$excludePaths as $excludePath) {\n if (strpos($serviceName, $excludePath) !== false) {\n unset($ret[$serviceName]);\n break;\n }\n }\n }\n return $ret1;\n }", "public function getDependencies()\n {\n return [\n 'Elcodi\\Bundle\\StoreBundle\\DataFixtures\\ORM\\StoreData',\n 'Elcodi\\Bundle\\ProductBundle\\DataFixtures\\ORM\\PrintSideData',\n 'Elcodi\\Bundle\\ProductBundle\\DataFixtures\\ORM\\ProductColorsData',\n ];\n }", "public static function register_services()\n {\n foreach ( self::get_services() as $class )\n {\n $service = self::instantiate( $class );\n if( method_exists( $service, 'register' ) )\n $service->register();\n }\n }", "private function registerServices() {\n // Modules\n $this->addService('modules', 'MyTravel\\Core\\Service\\Modules::setService');\n // Routing\n $this->addService('routing', 'MyTravel\\Core\\Service\\Routing::setService');\n // Event dispatcher\n $this->serviceContainer\n ->register('events', 'Symfony\\Component\\EventDispatcher\\EventDispatcher');\n // Database\n $this->addService('db', 'MyTravel\\Core\\Service\\Db::setService');\n // Access\n $this->addService('access', 'MyTravel\\Core\\Service\\Access::setService');\n }", "public function servicesArray()\n {\n return [\n self::PAINTING,\n self::TIRE,\n self::BODY_WORK,\n self::TO,\n self::WASHING,\n ];\n }", "public function preloadForList(array $items) {\n\t\t$guids = $this->getGuidsToPreload($items);\n\t\n\t\t$this->preloadCountsFromQuery($guids);\n\t}", "public static function register_services()\n {\n foreach (self::get_services() as $class) {\n $service = self::instantiate($class);\n if (method_exists($service, 'register')) {\n $service->register();\n }\n }\n }", "public static function get_services()\n {\n $ServicesObj = new Services();\n $Services = array();\n try {\n $stmt = $ServicesObj->read();\n $count = $stmt->rowCount();\n if ($count > 0) {\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n extract($row);\n $p = (object) array(\n \"ServiceID\" => (int) $ServiceID,\n \"ServiceName\" => $ServiceName,\n );\n\n array_push($Services, $p);\n }\n }\n return $Services;\n } catch (Exception $e) {\n throw $e;\n }\n }", "public static function register_services()\n {\n foreach ( self::get_services() as $class ) {\n $service = self::instantiate( $class );\n if ( method_exists( $service, 'register' ) ) {\n $service->register();\n }\n }\n }", "function getAllUsedServices()\n {\n $ret = array();\n foreach ($this->plugins as $name => $obj) {\n if ($obj->is_account) {\n if (isset($obj->DisplayName)) {\n $ret[$name] = $obj->DisplayName;\n } else {\n $ret[$name] = $name;\n }\n }\n }\n return $ret;\n }", "public function getServices()\n {\n return $this->pantonoServices;\n }", "public function getServices() {\n\n return $this->services;\n\n }", "public function loadDeferredProviders()\n {\n foreach ($this->deferredServices as $service => $provider) {\n $this->loadDeferredProvider($service);\n }\n\n $this->deferredServices = array();\n }", "private function initializeServices()\n {\n $this->emailManager = $this->getService('mycp.service.email_manager');\n $this->translatorService = $this->getService('translator');\n $this->securityService = $this->getService('Secure');\n $this->router = $this->getService('router');\n }", "public function __construct()\n {\n $this->services = [];\n }", "public static function get_service_providers(): array {\n\t\treturn self::$service_providers;\n\t}", "public function getDependencies()\n {\n return [\n 'Elcodi\\Bundle\\StoreBundle\\DataFixtures\\ORM\\StoreData',\n 'Elcodi\\Bundle\\ProductBundle\\DataFixtures\\ORM\\ProductSizeData',\n 'Elcodi\\Bundle\\ProductBundle\\DataFixtures\\ORM\\ProductData',\n ];\n }", "public static function register_services(): void\n {\n foreach (self::get_services() as $class) {\n $service = self::instantiate($class);\n if (method_exists($class, 'register')) {\n $service->register();\n }\n }\n }", "protected function setEvents()\n {\n foreach ($this->preloadList as $preload) {\n include_once XOOPS_ROOT_PATH . '/modules/' . $preload['module'] . '/preloads/' . $preload['file']. '.php';\n $class_name = ucfirst($preload['module'])\n . ($preload['file'] == 'preload' ? '' : ucfirst($preload['file']) )\n . 'Preload';\n if (!class_exists($class_name)) {\n continue;\n }\n $class_methods = get_class_methods($class_name);\n foreach ($class_methods as $method) {\n if (strpos($method, 'event') === 0) {\n $event_name = strtolower(str_replace('event', '', $method));\n $event= array($class_name, $method);\n $this->eventListeners[$event_name][] = $event;\n }\n }\n }\n }", "public function getPreDependencies()\n\t{\n\t\treturn array( 'OrderRenameTables', 'OrderServiceAttributeAddPrimaryKey' );\n\t}", "protected static function getServiceProviders()\n {\n return [];\n }", "protected function registerServices()\n {\n\n $di = new FactoryDefault();\n\n /**\n * Read services\n */\n include CORE_PATH . \"/config/services.php\";\n\n /**\n * Get config service for use in inline setup below\n */\n $config = $di->getConfig();\n\n\n include CORE_PATH . '/config/loader.php';\n\n \n\n $this->setDI($di);\n }", "public function getPreDependencies()\n\t{\n\t\treturn array( 'MShopAddTypeDataDefault' );\n\t}", "protected function getInstalledServices() {}", "public function getDependencies()\n {\n return [LoadProductData::class, LoadCategoryData::class];\n }", "public function load(): void\n {\n $requested = 0;\n $loaded = 0;\n foreach ($this->storage->loadClassList() as $class) {\n ++$requested;\n if ($this->accept($class) && !class_exists($class, false)) {\n ++$loaded;\n if ($this->verbose) {\n echo \"[Preloader] Loading {$class}\" . PHP_EOL;\n }\n class_exists($class, true);\n }\n }\n\n if ($this->verbose) {\n echo \"[Preloader] Preloaded {$loaded}/{$requested} classes\" . PHP_EOL;\n }\n }", "public function getPreDependencies()\n\t{\n\t\treturn array( 'TablesCreateMShop' );\n\t}", "public function getPreDependencies()\n\t{\n\t\treturn array( 'TablesCreateMShop' );\n\t}", "public function getAvailableServices()\n {\n return array_keys($this->_servicesConfig);\n }", "public function autoload()\n {\n return [\n new Listener\\Start(),\n ];\n }", "public function getLoads() : array\n {\n return $this->loads;\n }", "public function listAllAvailableServices()\n {\n\t\t$data = $this->call(array(), \"GET\", \"sensors/services/available.json\");\n\t\t$data = $data->{'services'};\n\t\t$serviceArray = new ArrayObject();\n\t\tfor($i = 0; $i<count($data);$i++){\n\t\t\t$serviceArray->append(new Service($data[$i], $this));\n\t\t}\n\t\treturn $serviceArray;\n }", "public function loadDeferredProviders(): void\n {\n foreach ($this->deferredServices as $service => $provider) {\n $this->loadDeferredProvider($service);\n }\n\n $this->deferredServices = [];\n }", "protected function getServices() {\n\t\treturn [\n\t\t\tMessagesService::class,\n\t\t];\n\t}", "protected function _preload() {\n }", "private function get_asset_services()\n {\n return [\n Assets\\FrontEnd::class,\n Assets\\AdminSide::class\n ];\n }", "public function getTypeLoaders(): array\n {\n return $this->typeLoaders;\n }", "public function get_registered_services() {\n\t\t$data = [];\n\t\t$res = self::$dbo->query( 'SELECT storage_service FROM snapshot_storage_credentials' );\n\t\twhile ( $row = $res->fetchArray() ) {\n\t\t\t$data[] = $row['storage_service'];\n\t\t}\n\n\t\treturn $data;\n\t}", "public function toPreload()\n\t{\n\t\treturn array('template.Opt');\n\t}", "private function loadAPIKeys() {\n $results = $this->interface->getAPIKeys();\n $this->APIKeys = [ ];\n\n foreach ($results as $row)\n $this->APIKeys[ $row[ 'service' ] ] = $row[ 'key' ];\n }", "public function getServiceDefinitions(): array;", "public function getAvailableServices();", "public function getDependencies()\n {\n return array(\n MachineFixtures::class,\n NetworkFixtures::class,\n UserFixtures::class,\n );\n }", "public function getDependencies()\n {\n return [CategoryFixtures::class, StateFixtures::class, UserFixtures::class, CountyFixtures::class,];\n }", "protected function getServicesList()\n {\n $servicesList = [];\n $services = $this->getInstalledServices();\n foreach ($services as $serviceType => $installedServices) {\n $servicesList[] = $this->getServiceTypeList($serviceType, $installedServices);\n }\n return $servicesList;\n }", "public function getDependencies()\n {\n return [\n 'Chaplean\\Bundle\\CmsBundle\\DataFixtures\\Liip\\DefaultData\\LoadFileExtensionImageData'\n ];\n }", "public function getDependencies()\n {\n return array(\n PortalFixtures::class,\n );\n }", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for contants\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'lib/class-aps-constants.php';\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core plugin.\n\t\t */\n\t\t/* The class responsible to load all libraries */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-aps-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining internationalization functionality\n\t\t * of the plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-aps-i18n.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-aps-admin.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the public-facing\n\t\t * side of the site.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-aps-public.php';\n\n\t\t/**\n\t\t * The class responsible for loading config fields\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-aps-fields-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the aps gateway\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-gateway-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining all ajax actions that occur in the aps gateway\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-aps-ajax.php';\n\n\t\t/**\n\t\t * This class is responsible to all common woocommerce hooks\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-aps-wc-hooks.php';\n\n\t\t$this->loader = new APS_Loader();\n\n\t}" ]
[ "0.71235085", "0.7020378", "0.66509587", "0.66035086", "0.64743674", "0.6286837", "0.6281417", "0.62558067", "0.62538403", "0.6242862", "0.6237549", "0.6166328", "0.61567765", "0.6133615", "0.6069074", "0.6017892", "0.60159457", "0.6012997", "0.59784174", "0.59538513", "0.5889592", "0.5889296", "0.5877081", "0.5836417", "0.5817425", "0.5792554", "0.5774871", "0.57746124", "0.57488173", "0.5745112", "0.5742709", "0.57405424", "0.5720236", "0.57153577", "0.571423", "0.56964105", "0.56724674", "0.56724674", "0.5671172", "0.56621706", "0.5661612", "0.5660774", "0.5657495", "0.56529486", "0.5643576", "0.5643576", "0.5643576", "0.5630784", "0.56138545", "0.5605562", "0.5574607", "0.5574607", "0.5560163", "0.5559032", "0.55545", "0.55439305", "0.553084", "0.5528806", "0.55218923", "0.55206513", "0.55178833", "0.5511535", "0.54989976", "0.5497704", "0.5497044", "0.5490826", "0.5486251", "0.5473836", "0.5466869", "0.54619694", "0.5457594", "0.54486114", "0.54407763", "0.5440029", "0.54384893", "0.54075867", "0.53662026", "0.5360857", "0.5329455", "0.5329455", "0.53239185", "0.532128", "0.53030044", "0.5302874", "0.52996254", "0.52942437", "0.52940834", "0.528666", "0.5286378", "0.5283476", "0.5280067", "0.5262121", "0.5250931", "0.5236765", "0.52233845", "0.52160525", "0.52158296", "0.52128327", "0.51933587", "0.5191233" ]
0.62257004
11
end toPreload(); Builds the JSON object.
public function getObject() { $application = \Trinity\Basement\Application::getApplication(); $broker = $this->_serviceLocator->get('web.Broker'); $json = new Json($application); return $json; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function buildJson();", "protected function CreateJson() {\n\t\t$obj = new \\stdClass;\n\t\t$obj->recordsList = parent::CreateJson();\n\n\t\t// add links from server\n\t\t$obj->link = new \\stdClass;\n\t\t$obj->link->href = $this->link_href;\n\t\t$obj->link->rel = $this->link_rel;\n\t\treturn $obj;\n\t}", "protected function prepareJsonStructure(){\n\t\t\n\t}", "function makeJsonReady()\n {\n $this->json_array = json_encode($this->achievementsToDisplay);\n $this->achievementsToDisplay = [];\n }", "public function func_json_builder () {\n return json_encode ($this -> raw_data);\n }", "public function getJson()\n {\n $newObject = $this->originalData;\n $resourcesClone = $this->resources;\n\n // Remove Main Options that might have been added\n $resourcesClone = array_filter($resourcesClone, function($value) {\n if ($value->gmResource()->getTypeName() == 'MainOptions') {\n return false;\n }\n return true;\n });\n\n // Cast to an array of objects\n $newObject->resources = array_values($resourcesClone);\n //@todo make sure this sorts the way GM does, prevent loads of changes @see\n $newObject->script_order = $this->script_order;\n return JsonService::encode($newObject);\n }", "public function prepare_json() { \n return json_encode($this->get_settings()); \n }", "public function jsonSerialize()\n {\n Loader::model('page_list');\n $nh = Loader::helper('navigation');\n $im = Loader::helper('image');\n $u = new User;\n $pl = new PageList;\n $pl->filterByCollectionTypeHandle('walk');\n $pl->filterByPath($this->page->getCollectionPath());\n $pl->filterByAttribute('exclude_page_list',false);\n $pagecount = 500;\n $cityData = array(\n 'title' => $this->title,\n 'url' => $this->url,\n 'background' => $this->full_bg ? $this->full_bg->getURL() : null,\n /* We'll assume each area's first block is the one with the descriptions */\n 'short_description' => strip_tags($this->page->getBlocks('City Header')[0]->getController()->getContent()),\n 'long_description' => strip_tags($this->page->getBlocks('City Description')[0]->getController()->getContent()),\n 'sponsors' => $this->page->getBlocks('Sponsors')[0]->getController()->getContent()\n );\n if ((int) $this->city_organizer->getUserID() > 1) {\n $cityData['city_organizer'] = array(\n 'photo' => $this->avatar,\n 'first_name' => $this->city_organizer->getAttribute('first_name'),\n 'last_name' => $this->city_organizer->getAttribute('last_name'),\n 'email' => $this->city_organizer->getUserEmail(),\n 'facebook' => $this->facebook,\n 'twitter' => $this->twitter,\n 'website' => $this->website\n );\n }\n foreach ($pl->get($pagecount) as $key => $page) {\n $scheduled = $page->getAttribute('scheduled');\n $slots = (Array) $scheduled['slots'];\n $cityData['walks'][$key] = array(\n 'url' => $nh->getCollectionURL($page),\n 'title' => $page->getCollectionName(),\n 'thumb' => ($thumb = $page->getAttribute('thumbnail')) ? $im->getThumbnail($thumb, 340,720)->src : null,\n 'schedule' => isset($scheduled['open']) ? 'Open Schedule' : (isset($slots[0]['date']) ? $slots[0]['date'] : null),\n 'wards' => $page->getAttribute('walk_wards'),\n 'time' => isset($slots[0]['time']) ? $slots[0]['time'] : 'multiple',\n 'map' => json_decode($page->getAttribute('gmap')),\n 'short_description' => $page->getAttribute('shortdescription')\n );\n foreach ($slots as $slot) {\n $cityData['walks'][$key]['slots'][] = ['date' => $slot['date'], 'time' => $slot['time'] ?: 'multiple'];\n }\n foreach (json_decode($page->getAttribute('team')) as $memkey=>$mem) {\n $cityData['walks'][$key]['team'] .= ($memkey == 0 ? 'Walk led by ' : ($memkey > 0 ? ', ' : '')) . \"{$mem->{'name-first'}} {$mem->{'name-last'}}\";\n }\n }\n\n return $cityData;\n }", "protected function _preload() {\n }", "public function toPreload()\n\t{\n\t\treturn array('web.Broker', 'template.Opt');\n\t}", "function generateJSON(){\n\t\t $metadata = array();\n\t\t $metadata[\"tableID\"] = $this->tableID;\n\t\t $metadata[\"tableGroupID\"] = $this->tableGroupID;\n\t\t $metadata[\"tablePage\"] = $this->tablePage +0 ;\n\t\t $metadata[\"title\"] = $this->tableName;\n\t\t $metadata[\"description\"] = $this->tableDesciption;\n\t\t $metadata[\"tags\"] = $this->tableTags;\n\t\t $metadata[\"doi\"] = $this->tableDOI;\n\t\t $metadata[\"ark\"] = $this->tableARK;\n\t\t $metadata[\"versionControl\"] = $this->versionControl;\n\t\t $metadata[\"license\"] = $this->license;\n\t\t $metadata[\"recordCount\"] = $this->recordCount+0;\n\t\t $metadata[\"rawCreators\"] = $this->rawCreators;\n\t\t $metadata[\"rawContributors\"] = $this->rawContributors;\n\t\t $metadata[\"rawLinkedPersons\"] = $this->rawLinkedPersons;\n\t\t $metadata[\"projects\"] = $this->projects;\n\t\t $metadata[\"files\"] = $this->files;\n\t\t $metadata[\"tableFields\"] = $this->tableFields;\n\t\t $this->metadata = $metadata;\n\t\t return Zend_Json::encode($metadata);\n\t }", "public function buildJSONOutput() {\n\t\t$json= new stdClass();\n\t\t$json->type = $this->getType();\n\t\t$json->registrant = $this->getRegistrant();\n\t\t$json->streetAddress = $this->getStreetAddress();\n\t\tif($this->getState() == \"\") {\n\t\t\t$json->state = $this->getCountry();\n\t\t} else {\n\t\t\t$json->state = $this->getState();\n\t\t}\n\t\t$json->city = $this->getCity();\n\t\t$json->country = $this->getCountry();\n\t\t$json->postCode = $this->getPostCode();\n\t\t$json->markIdentification = $this->getMarkIdentification();\n\t\t$json->serialNumber = $this->getSerialNumber();\n\t\t$json->registrationNumber = $this->getRegistrationNumber();\n\t\t$json->transactionDate = $this->getTransactionDate();\n\t\t$json->filingDate = $this->getFilingDate();\n\t\t$json->description = $this->getDescription();\n\t\t$json->correspondentAddress = $this->getCorrespondentAddress();\n\t\t$json->lastStatusUpdate = $this->getFilingDate();\n\t\treturn $json;\n\t}", "public function json(){ return json_encode( $this->objectify() ); }", "public static function generateJSON();", "public function jsonSerialize() {\n $result = array();\n if (!is_null($this->id)) {\n $result[\"id\"] = intval($this->id);\n }\n if (!is_null($this->addresses)) {\n $result[\"addresses\"] = $this->addresses;\n }\n if (!is_null($this->appnotifications)) {\n $result[\"appnotifications\"] = $this->appnotifications;\n }\n if (!is_null($this->apponboardingstatus)) {\n $result[\"apponboardingstatus\"] = intval($this->apponboardingstatus);\n }\n if (!is_null($this->appoptin)) {\n $result[\"appoptin\"] = $this->appoptin;\n }\n if (!is_null($this->appphone)) {\n $result[\"appphone\"] = strval($this->appphone);\n }\n if (!is_null($this->apptoken)) {\n $result[\"apptoken\"] = strval($this->apptoken);\n }\n if (!is_null($this->birthdate)) {\n $result[\"birthdate\"] = Json::packTimestamp($this->birthdate);\n }\n if (!is_null($this->company)) {\n $result[\"company\"] = strval($this->company);\n }\n if (!is_null($this->customertitleid)) {\n $result[\"customertitleid\"] = intval($this->customertitleid);\n }\n if (!is_null($this->email)) {\n $result[\"email\"] = strval($this->email);\n }\n if (!is_null($this->firstname)) {\n $result[\"firstname\"] = strval($this->firstname);\n }\n if (!is_null($this->image)) {\n $result[\"image\"] = strval($this->image);\n }\n if (!is_null($this->languagecode)) {\n $result[\"languagecode\"] = strval($this->languagecode);\n }\n if (!is_null($this->lastname)) {\n $result[\"lastname\"] = strval($this->lastname);\n }\n if (!is_null($this->lookup)) {\n $result[\"lookup\"] = $this->lookup;\n }\n if (!is_null($this->middlename)) {\n $result[\"middlename\"] = strval($this->middlename);\n }\n if (!is_null($this->optins)) {\n $result[\"optins\"] = $this->optins;\n }\n if (!is_null($this->organizationfunction)) {\n $result[\"organizationfunction\"] = strval($this->organizationfunction);\n }\n if (!is_null($this->phonenumbers)) {\n $result[\"phonenumbers\"] = $this->phonenumbers;\n }\n if (!is_null($this->relationships)) {\n $result[\"relationships\"] = $this->relationships;\n }\n if (!is_null($this->relationtypes)) {\n $result[\"relationtypes\"] = $this->relationtypes;\n }\n if (!is_null($this->sendmail)) {\n $result[\"sendmail\"] = (bool)$this->sendmail;\n }\n if (!is_null($this->sex)) {\n $result[\"sex\"] = strval($this->sex);\n }\n if (!is_null($this->status)) {\n $result[\"status\"] = strval($this->status);\n }\n if (!is_null($this->subscribed)) {\n $result[\"subscribed\"] = (bool)$this->subscribed;\n }\n if (!is_null($this->vatnumber)) {\n $result[\"vatnumber\"] = strval($this->vatnumber);\n }\n if (!is_null($this->isdeleted)) {\n $result[\"isdeleted\"] = (bool)$this->isdeleted;\n }\n if (!is_null($this->createdts)) {\n $result[\"createdts\"] = Json::packTimestamp($this->createdts);\n }\n if (!is_null($this->lastupdatets)) {\n $result[\"lastupdatets\"] = Json::packTimestamp($this->lastupdatets);\n }\n\n\n if (is_array($this->custom_fields)) {\n foreach ($this->custom_fields as $key => $value) {\n $result[\"c_\" . $key] = $value;\n }\n }\n\n return $result;\n }", "public function jsonSerialize()\r\n {\r\n $json = array();\r\n $json['id'] = $this->id;\r\n $json['source'] = $this->source;\r\n $json['location_id'] = $this->locationId;\r\n $json['name'] = $this->name;\r\n $json['total_ratings'] = $this->totalRatings;\r\n $json['average_rating'] = $this->averageRating;\r\n $json['stars'] = $this->stars;\r\n $json['type_id'] = $this->typeId;\r\n $json['meta_no_index'] = $this->metaNoIndex;\r\n $json['owner_id'] = $this->ownerId;\r\n $json['trip_id'] = $this->tripId;\r\n $json['address1'] = $this->address1;\r\n $json['address2'] = $this->address2;\r\n $json['postcode'] = $this->postcode;\r\n $json['telephone'] = $this->telephone;\r\n $json['url'] = $this->url;\r\n $json['description'] = $this->description;\r\n $json['longitude'] = $this->longitude;\r\n $json['latitude'] = $this->latitude;\r\n $json['num_rooms'] = $this->numRooms;\r\n $json['redirect_accommodation_id'] = $this->redirectAccommodationId;\r\n $json['redirect_id'] = $this->redirectId;\r\n $json['page_url'] = $this->pageUrl;\r\n $json['binary_options'] = $this->binaryOptions;\r\n $json['desc_overview'] = $this->descOverview;\r\n $json['desc_room_information'] = $this->descRoomInformation;\r\n $json['desc_facilities'] = $this->descFacilities;\r\n $json['desc_food_drink'] = $this->descFoodDrink;\r\n $json['date_created'] = $this->dateCreated;\r\n $json['date_updated'] = $this->dateUpdated;\r\n $json['date_removed'] = $this->dateRemoved;\r\n\r\n return $json;\r\n }", "public function json()\n {\n\t\t$json = \"\";\n\t\t$json_item = \"\";\n\t\t$json_array = array();\n\t\t$color = Kohana::config('settings.default_map_all');\n\n\t\t$media_type = (isset($_GET['m']) AND intval($_GET['m']) > 0)? intval($_GET['m']) : 0;\n\t\t\n\t\t// Get the incident and category id\n\t\t$category_id = (isset($_GET['c']) AND intval($_GET['c']) > 0)? intval($_GET['c']) : 0;\n\t\t$incident_id = (isset($_GET['i']) AND intval($_GET['i']) > 0)? intval($_GET['i']) : 0;\n\t\t\n\t\t// Get the category colour\n\t\tif (Category_Model::is_valid_category($category_id))\n\t\t{\n\t\t\t$color = ORM::factory('category', $category_id)->category_color;\n\t\t}\n\t\t\n\t\t// Fetch the incidents\n $markers = (isset($_GET['page']) AND intval($_GET['page']) > 0)? reports::fetch_incidents(TRUE) : reports::fetch_incidents();\n\t\t\n\t\t// Variable to store individual item for report detail page\n\t\t$json_item_first = \"\";\t\n\t\tforeach ($markers as $marker)\n\t\t{\n\t\t\t$thumb = \"\";\n\t\t\tif ($media_type == 1)\n\t\t\t{\n\t\t\t\t$media = ORM::factory('incident', $marker->incident_id)->media;\n\t\t\t\tif ($media->count())\n\t\t\t\t{\n\t\t\t\t\tforeach ($media as $photo)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($photo->media_thumb)\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t// Get the first thumb\n\t\t\t\t\t\t\t$prefix = url::base().Kohana::config('upload.relative_directory');\n\t\t\t\t\t\t\t$thumb = $prefix.\"/\".$photo->media_thumb;\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}\n }\n\n\n /* get the icon from the associated categories */\n $cats = ORM::factory('incident', $marker->incident_id)->category;\n $icon = Array();\n if ($cats->count())\n {\n foreach ($cats as $category)\n {\n if ($category->category_image)\n { \n // TODO: this should be an array.\n $prefix = url::base().Kohana::config('upload.relative_directory');\n $icon[] = '\"'. $prefix.\"/\". $category->category_image .'\"';\n }\n }\n }\n\t\t\t\n\t\t\t$json_item = \"{\";\n\t\t\t$json_item .= \"\\\"type\\\":\\\"Feature\\\",\";\n\t\t\t$json_item .= \"\\\"properties\\\": {\";\n\t\t\t$json_item .= \"\\\"id\\\": \\\"\".$marker->incident_id.\"\\\", \\n\";\n\n\t\t\t$encoded_title = utf8tohtml::convert($marker->incident_title, TRUE);\n\t\t\t$encoded_title = str_ireplace('\"','&#34;',$encoded_title);\n\t\t\t$encoded_title = json_encode($encoded_title);\n\t\t\t$encoded_title = str_ireplace('\"', '', $encoded_title);\n\n\t\t\t$json_item .= \"\\\"name\\\":\\\"\" . str_replace(chr(10), ' ', str_replace(chr(13), ' ', \"<a \"\n\t\t\t\t\t. \"href='\".url::base().\"reports/view/\".$marker->incident_id.\"'>\".$encoded_title).\"</a>\") . \"\\\",\"\n\t\t\t\t\t. \"\\\"link\\\": \\\"\".url::base().\"reports/view/\".$marker->incident_id.\"\\\", \";\n\n\t\t\t$json_item .= (isset($category))\n\t\t\t\t? \"\\\"category\\\":[\" . $category_id . \"], \"\n\t\t\t\t: \"\\\"category\\\":[0], \";\n\n\t\t\t$json_item .= \"\\\"color\\\": \\\"\".$color.\"\\\", \\n\";\n\t\t\t//$json_item .= \"\\\"icon\\\": \\\"\".$icon.\"\\\", \\n\";\n\t\t\t$json_item .= \"\\\"icon\\\": [\". implode(',', $icon) .\"], \\n\";\n\t\t\t$json_item .= \"\\\"thumb\\\": \\\"\".$thumb.\"\\\", \\n\";\n\t\t\t$json_item .= \"\\\"timestamp\\\": \\\"\" . strtotime($marker->incident_date) . \"\\\"\";\n\t\t\t$json_item .= \"},\";\n\t\t\t$json_item .= \"\\\"geometry\\\": {\";\n\t\t\t$json_item .= \"\\\"type\\\":\\\"Point\\\", \";\n\t\t\t$json_item .= \"\\\"coordinates\\\":[\" . $marker->longitude . \", \" . $marker->latitude . \"]\";\n\t\t\t$json_item .= \"}\";\n\t\t\t$json_item .= \"}\";\n\n\t\t\tif ($marker->incident_id == $incident_id)\n\t\t\t{\n\t\t\t\t$json_item_first = $json_item;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tarray_push($json_array, $json_item);\n\t\t\t}\n\t\t\t\n\t\t\t// Get Incident Geometries\n\t\t\t$geometry = $this->_get_geometry($marker->incident_id, $marker->incident_title, $marker->incident_date);\n\t\t\tif (count($geometry))\n\t\t\t{\n\t\t\t\t$json_item = implode(\",\", $geometry);\n\t\t\t\tarray_push($json_array, $json_item);\n }\n\t\t}\n\t\t\n\t\tif ($json_item_first)\n\t\t{\n\t\t\t// Push individual marker in last so that it is layered on top when pulled into map\n\t\t\tarray_push($json_array, $json_item_first);\n\t\t}\n\t\t\n\t\t$json = implode(\",\", $json_array);\n\n header('Content-type: application/json; charset=utf-8');\n $this->template->json = $json;\n Kohana::log('info', print_r($this->template, 1));\n }", "public function toPreload()\n\t{\n\t\treturn array('template.Opt');\n\t}", "public function jsonSerialize() {\n\t$fields = get_object_vars($this);\n\t$fields[\"blogId\"] = $this->blogId;\n\t$fields[\"blogProfileId\"] = $this->blogProfileId;\n\t//format the date so that the front end can consume it\n\treturn($fields);\n\t\t}", "public function makeJSON()\n {\n return(json_encode($this));\n }", "public function makeJSON()\n {\n return(json_encode($this));\n }", "function generateJSON_LD(){\n\t\t \n\t\t $metadata = $this->metadata;\n\t\t $JSON_LD = array();\n\t\t \n\t\t $JSON_LD[\"metadata-version\"] = self::JSONldVersion;\n\t\t $JSON_LD[\"@context\"] = array(\n\n\t\t\t\t\"type\" => \"@type\",\n\t\t\t\t\"id\" => \"@id\",\n\t\t\t\t\"tableID\" => \"http://purl.org/dc/elements/1.1/identifier\",\n\t\t\t\t\"title\" => \"http://purl.org/dc/elements/1.1/title\",\n\t\t\t\t\"description\" => \"http://purl.org/dc/terms/abstract\",\n\t\t\t\t\"published\" => \"http://purl.org/dc/terms/issued\",\n\t\t\t\t\"updated\" => \"http://purl.org/dc/terms/modified\",\n\t\t\t\t\"doi\" => \"http://purl.org/ontology/bibo/doi\",\n\t\t\t\t\"ark\" => \"http://en.wikipedia.org/wiki/Archival_Resource_Key\",\n\t\t\t\t\"versionControl\" => \"http://purl.org/dc/terms/hasVersion\",\n\t\t\t\t//\"editorList\" => array(\"@id\" => \"http://purl.org/ontology/bibo/editorList\", \"@container\" => \"@list\"),\n\t\t\t\t\"editorList\" => \"http://purl.org/ontology/bibo/editorList\",\n\t\t\t\t\"editor\" => \"http://purl.org/ontology/bibo/editor\",\n\t\t\t\t//\"contributorList\" => array(\"@id\" => \"http://purl.org/ontology/bibo/contributorList\", \"@container\" => \"@list\"),\n\t\t\t\t\"contributorList\" => \"http://purl.org/ontology/bibo/contributorList\",\n\t\t\t\t\"contributor\" => \"http://purl.org/dc/terms/contributor\",\n\t\t\t\t\"references\" => \"http://purl.org/dc/terms/references\",\n\t\t\t\t\"name\" => \"http://www.w3.org/2000/01/rdf-schema#label\",\n\t\t\t\t\"spatial\" => \"http://purl.org/dc/terms/spatial\",\n\t\t\t\t\"temporal\" => \"http://purl.org/dc/terms/temporal\",\n\t\t\t\t\"recordCount\" => \"http://rdfs.org/ns/void#entities\", //number of entities\n\t\t\t\t\"fieldCount\" => \"http://rdfs.org/ns/void#properties\", //number of properties\n\t\t\t\t\"license\" => \"http://www.w3.org/1999/xhtml/vocab/#license\", //copyright license\n\t\t\t\t\"publisher\" => \"http://purl.org/dc/terms/publisher\",\n\t\t\t\t\"partOf\" => \"http://purl.org/dc/terms/isPartOf\"\n\t\t\t\t);\n\t\t \n\t\t $JSON_LD[\"id\"] = $this->generateTableURI();\n\t\t $JSON_LD[\"tableID\"] = $this->getGenerateTableID();\n\t\t $JSON_LD[\"title\"] = $metadata[\"title\"];\n\t\t $JSON_LD[\"description\"] = $metadata[\"description\"];\n\t\t if($this->pubCreated){\n\t\t\t\t$JSON_LD[\"published\"] = date(\"Y-m-d\\TH:i:s\\-07:00\", strtotime($this->pubCreated));\n\t\t }\n\t\t else{\n\t\t\t\t$JSON_LD[\"published\"] = date(\"Y-m-d\\TH:i:s\\-07:00\", time());\n\t\t }\n\t\t $JSON_LD[\"updated\"] = date(\"Y-m-d\\TH:i:s\\-07:00\", time());\n\t\t $JSON_LD[\"recordCount\"] = $metadata[\"recordCount\"];\n\t\t $JSON_LD[\"fieldCount\"] = count($metadata[\"tableFields\"]);\n\t\t $JSON_LD[\"publisher\"] = array(\"name\" => \"Open Context\",\n\t\t\t\t\t\t\t\t\t\t\t\t \"id\" => \"http://opencontext.org\");\n\t\t $JSON_LD[\"license\"] = $metadata[\"license\"];\n\t\t \n\t\t if($metadata[\"doi\"] != false){\n\t\t\t\t$JSON_LD[\"doi\"] = $metadata[\"doi\"];\n\t\t }\n\t\t if($metadata[\"ark\"] != false){\n\t\t\t\t$JSON_LD[\"ark\"] = $metadata[\"ark\"];\n\t\t }\n\t\t if($this->tablePage > 1){\n\t\t\t\t$JSON_LD[\"partOf\"] = $this->generateParentPartURI();\n\t\t }\n\t\t if(isset($metadata[\"versionControl\"])){\n\t\t\t\tif($metadata[\"versionControl\"] != false){\n\t\t\t\t\t $JSON_LD[\"versionControl\"] = $metadata[\"versionControl\"];\n\t\t\t\t}\n\t\t }\n\t\t \n\t\t if(count($metadata[\"rawCreators\"])>0){\n\t\t\t\t$JSON_LD[\"editorList\"][\"@id\"] = \"#editor-list\";\n\t\t\t\tforeach($metadata[\"rawCreators\"] as $uriKey => $nameArray){\n\t\t\t\t\t $JSON_LD[\"editorList\"][\"editor\"][] = array(\"name\" => $nameArray[\"name\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"count\" => $nameArray[\"count\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"id\" => $uriKey\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t \n\t\t\t\t}\n\t\t }\n\t\t if(count($metadata[\"rawContributors\"])>0){\n\t\t\t\t$JSON_LD[\"contributorList\"][\"@id\"] = \"#contributor-list\";\n\t\t\t\tforeach($metadata[\"rawContributors\"] as $uriKey => $nameArray){\n\t\t\t\t\t $JSON_LD[\"contributorList\"][\"contributor\"][] = array(\"name\" => $nameArray[\"name\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"count\" => $nameArray[\"count\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"id\" => $uriKey\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t \n\t\t\t\t}\n\t\t }\n\t\t if(count($metadata[\"projects\"])>0){\n\t\t\t\tforeach($metadata[\"projects\"] as $uriKey => $nameArray){\n\t\t\t\t\t $JSON_LD[\"references\"][] = array(\"name\" => $nameArray[\"name\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"count\" => $nameArray[\"count\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"type\" => \"http://opencontext/about/concepts#projects\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"id\" => $uriKey\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t \n\t\t\t\t}\n\t\t }\n\t\t \n\t\t $JSON_LD[\"files\"] = $metadata[\"files\"];\n\t\t $JSON_LD[\"tableFields\"] = $metadata[\"tableFields\"];\n\t\t $this->JSON_LD = $JSON_LD;\n\t\t return $JSON_LD;\n\t }", "public function build()\n {\n $this->responseData = [\n 'data' => $this->getData(),\n 'meta' => $this->getMeta(),\n 'links' => $this->getLinks(),\n ];\n }", "public function jsonSerialize() {\n\t\t$fields = get_object_vars($this);\n\t\t$fields[\"profileId\"] = $this->profileId;\n\t\treturn($fields);\n\t}", "public function jsonSerialize()\n {\n $json = array();\n $json['id'] = $this->id;\n $json['name'] = $this->name;\n $json['voa'] = $this->voa;\n $json['voi'] = $this->voi;\n $json['stateAgg'] = $this->stateAgg;\n $json['ach'] = $this->ach;\n $json['transAgg'] = $this->transAgg;\n $json['aha'] = $this->aha;\n $json['accountTypeDescription'] = $this->accountTypeDescription;\n $json['phone'] = $this->phone;\n $json['urlHomeApp'] = $this->urlHomeApp;\n $json['urlLogonApp'] = $this->urlLogonApp;\n $json['oauthEnabled'] = $this->oauth_Enabled;\n $json['urlForgotPassword'] = $this->urlForgotPassword;\n $json['urlOnlineRegistration'] = $this->urlOnlineRegistration;\n $json['class'] = $this->mclass;\n $json['specialText'] = $this->specialText;\n $json['specialInstructions'] = $this->specialInstructions;\n $json['address'] = $this->address;\n $json['currency'] = $this->currency;\n $json['email'] = $this->email;\n $json['status'] = $this->status;\n $json['newInstitutionId'] = $this->newInstitutionId;\n $json['branding'] = $this->branding;\n $json['oauthInstitutionId'] = $this->oauth_InstitutionId;\n\n return array_merge($json, $this->additionalProperties);\n }", "public function toJson();", "public function toJson();", "public function _jsonSerialize();", "public function json()\n\t{\n\t\t$order_data = array();\n\t\t/*\n\t\t\t\"rows\" => array(\n\t\t\t\t\"id\",\n\t\t\t\t\"item\" => array(\n\t\t\t\t\t\"id\", \"name\"\n\t\t\t\t),\n\t\t\t\t\"amount\", \"price\",\n\t\t\t),\n\t\t\t\"items\" => array(\"id\", \"name\", \"amount\", \"price\", \"total\"),\n\t\t\t\t\"purveyances\" => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t\"company\" => array(\"id\", \"name\", \"address\"),\n\t\t\t\t\t\t\"company_section\" => array(\"id\", \"name\", \"address\"),\n\t\t\t\t\t\t\"weekdays\", \"time_from\", \"time_to\", \"days\"\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t\"purchaser\" => array(\n\t\t\t\t\"id\", \"name\",\n\t\t\t\t\"customers\" => array(\n\t\t\t\t\t\"id\", \"name\"\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t*/\n\t\t\n\t\t$purchaser = obj($this->prop(\"purchaser\"));\n\t\tif (true || !$purchaser->is_saved())\n\t\t{\n\t\t\t// FIXME: Only temporarily!\n\t\t\t$__purchaser_id = users::is_logged_in() ? user::get_current_person() : null;\n\t\t\t$purchaser = obj($__purchaser_id, array(), crm_person_obj::CLID);\n\t\t}\n\t\t$order_data[\"purchaser\"] = array(\n\t\t\t\"id\" => $purchaser->id(),\n\t\t\t\"name\" => $purchaser->name(),\n\t\t\t\"customers\" => array(),\n\t\t);\n\t\tif ($purchaser->is_a(crm_person_obj::CLID) and $purchaser->is_saved())\n\t\t{\n\t\t\t$customers = $purchaser->company()->get_customers_by_customer_data_objs(array(crm_person_obj::CLID));\n\t\t\t$order_data[\"purchaser\"][\"company\"] = $purchaser->company()->id();\n\t\t\t\n\t\t}\n\t\telseif ($purchaser->is_a(crm_company_obj::CLID) and $purchaser->is_saved())\n\t\t{\n\t\t\t$customers = $purchaser->get_customers_by_customer_data_objs(array(crm_person_obj::CLID));\n\t\t}\n\t\t$customer_count = isset($customers) ? $customers->count() : 0;\n\t\tif ($customer_count > 0)\n\t\t{\n\t\t\tforeach ($customers->names() as $customer_id => $customer_name)\n\t\t\t{\n\t\t\t\t$order_data[\"purchaser\"][\"customers\"][$customer_id] = array(\n\t\t\t\t\t\"id\" => $customer_id,\n\t\t\t\t\t\"name\" => $customer_name,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$order_data[\"rows\"] = array();\n\t\t$order_data[\"items\"] = array();\n\t\tforeach ($this->get_rows() as $row)\n\t\t{\n\t\t\t$item_data = array(\n\t\t\t\t\"id\" => $row->prop(\"prod\"),\n\t\t\t\t\"name\" => $row->prop(\"prod_name\"),\n\t\t\t);\n\t\t\t$order_data[\"rows\"][$row->id()] = array(\n\t\t\t\t\"id\" => $row->id(),\n\t\t\t\t\"item\" => $item_data,\n\t\t\t\t\"amount\" => $row->prop(\"items\"),\n\t\t\t\t\"price\" => $row->prop(\"price\"),\n\t\t\t\t\"buyer_rep\" => $row->prop(\"buyer_rep\"),\n\t\t\t\t\"purveyance_company_section\" => $row->prop(\"buyer_rep\"),\n\t\t\t\t\"planned_date\" => $row->prop(\"planned_date\"),\n\t\t\t\t\"planned_time\" => $row->prop(\"planned_time\"),\n\t\t\t);\n\n\t\t\tif (!isset($order_data[\"items\"][$item_data[\"id\"]]))\n\t\t\t{\n\t\t\t\t$item = obj($item_data[\"id\"]);\n\t\t\t\t$purveyance_data = array();\n\t\t\t\t$purveyances = $item->get_purveyances();\n\t\t\t\tif ($purveyances->count() > 0)\n\t\t\t\t{\n\t\t\t\t\t$purveyance = $purveyances->begin();\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\t$purveyance_data[$purveyance->id()] = array(\"company\" => array());\n\t\t\t\t\t\tif (is_oid($company_id = $purveyance->prop(\"company\")))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$company = obj($company_id, array(), crm_company_obj::CLID);\n\t\t\t\t\t\t\t$purveyance_data[$purveyance->id()][\"company\"] = array(\n\t\t\t\t\t\t\t\t\"id\" => $company->id(),\n\t\t\t\t\t\t\t\t\"name\" => $company->get_title(),\n\t\t\t\t\t\t\t\t\"address\" => $company->get_address_string(),\n\t\t\t\t\t\t\t\t\"section\" => array(),\n\t\t\t\t\t\t\t\t\"sections\" => array(),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (is_oid($section_id = $purveyance->prop(\"company_section\")))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$section = obj($section_id, array(), crm_section_obj::CLID);\n\t\t\t\t\t\t\t\t$purveyance_data[$purveyance->id()][\"company\"][\"section\"] = array(\n\t\t\t\t\t\t\t\t\t\"id\" => $section->id(),\n\t\t\t\t\t\t\t\t\t\"name\" => $section->name(),\n//\t\t\t\t\t\t\t\t\t\"address\" => $section->get_address_string(),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach ($company->get_sections()->names() as $section_id => $section_name)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$purveyance_data[$purveyance->id()][\"company\"][\"sections\"][] = array(\n\t\t\t\t\t\t\t\t\t\"id\" => $section_id,\n\t\t\t\t\t\t\t\t\t\"name\" => $section_name,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$purveyance_data[$purveyance->id()] += array(\n\t\t\t\t\t\t\t\"weekdays\" => $purveyance->prop(\"weekdays\"),\n\t\t\t\t\t\t\t\"time_from\" => $purveyance->prop(\"time_from\"),\n\t\t\t\t\t\t\t\"time_to\" => $purveyance->prop(\"time_to\"),\n\t\t\t\t\t\t\t\"days\" => $purveyance->prop(\"days\")\n\t\t\t\t\t\t);\n\t\t\t\t\t} while ($purveyance = $purveyances->next());\n\t\t\t\t}\n\t\t\t\t$order_data[\"items\"][$item_data[\"id\"]] = $item_data + array(\n\t\t\t\t\t\"price\" => $row->prop(\"price\"),\n\t\t\t\t\t\"amount\" => $row->prop(\"items\"),\n\t\t\t\t\t\"total\" => $row->prop(\"price\") * $row->prop(\"items\"),\n\t\t\t\t\t\"purveyances\" => $purveyance_data,\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$order_data[\"items\"][$item_data[\"id\"]][\"amount\"] += $row->prop(\"items\");\n\t\t\t\t$order_data[\"items\"][$item_data[\"id\"]][\"total\"] += $row->prop(\"price\") * $row->prop(\"items\");\n\t\t\t}\n\t\t}\n\n\t\t$json = new json();\n\t\treturn $json->encode($order_data, aw_global_get(\"charset\"));\n\t}", "public function toJson(){\n return [\n 'id' => $this->id,\n 'title' => $this->title,\n 'sub_name' => $this->sub_name,\n 'bar_code' => $this->bar_code,\n 'flash_code' => $this->flash_code\n ];\n }", "public function jsonSerialize() {\n $result = array();\n if (!is_null($this->id)) {\n $result[\"id\"] = intval($this->id);\n }\n if (!is_null($this->typeid)) {\n $result[\"typeid\"] = intval($this->typeid);\n }\n if (!is_null($this->name)) {\n $result[\"name\"] = strval($this->name);\n }\n if (!is_null($this->allowetickets)) {\n $result[\"allowetickets\"] = intval($this->allowetickets);\n }\n if (!is_null($this->availability)) {\n $result[\"availability\"] = $this->availability;\n }\n if (!is_null($this->deliverystatusaftertrigger)) {\n $result[\"deliverystatusaftertrigger\"] = intval($this->deliverystatusaftertrigger);\n }\n if (!is_null($this->feedescription)) {\n $result[\"feedescription\"] = strval($this->feedescription);\n }\n if (!is_null($this->internalremark)) {\n $result[\"internalremark\"] = strval($this->internalremark);\n }\n if (!is_null($this->logo)) {\n $result[\"logo\"] = strval($this->logo);\n }\n if (!is_null($this->mailorganization)) {\n $result[\"mailorganization\"] = (bool)$this->mailorganization;\n }\n if (!is_null($this->needsaddress)) {\n $result[\"needsaddress\"] = (bool)$this->needsaddress;\n }\n if (!is_null($this->ordermailtemplateid_delivery)) {\n $result[\"ordermailtemplateid_delivery\"] = intval($this->ordermailtemplateid_delivery);\n }\n if (!is_null($this->ordermailtemplateid_deliverystarted)) {\n $result[\"ordermailtemplateid_deliverystarted\"] = intval($this->ordermailtemplateid_deliverystarted);\n }\n if (!is_null($this->shortdescription)) {\n $result[\"shortdescription\"] = strval($this->shortdescription);\n }\n if (!is_null($this->visibility)) {\n $result[\"visibility\"] = strval($this->visibility);\n }\n if (!is_null($this->isarchived)) {\n $result[\"isarchived\"] = (bool)$this->isarchived;\n }\n if (!is_null($this->createdts)) {\n $result[\"createdts\"] = Json::packTimestamp($this->createdts);\n }\n if (!is_null($this->lastupdatets)) {\n $result[\"lastupdatets\"] = Json::packTimestamp($this->lastupdatets);\n }\n\n\n if (is_array($this->custom_fields)) {\n foreach ($this->custom_fields as $key => $value) {\n $result[\"c_\" . $key] = $value;\n }\n }\n\n return $result;\n }", "public function getJson()\n{\n\n if(isset($_POST['dataType']) && $_POST['dataType'] == \"json\"){\n $pageArray \t=\tarray('title' => $_POST['title'],\n 'firstname' => $_POST['firstname'],\n 'lastname' => $_POST['lastname'],\n 'email' => $_POST['email']);\n $jsonObject = json_encode($pageArray);\n }\n if(isset($_GET['json'])){\n $jsonObject = $_GET['json'];\n\n }\n //Setting the placeholders to values of the object.\n if(isset($jsonObject) && !$jsonObject == null){\n $pageObject =\tjson_decode($jsonObject);\n $this->setTitle($pageObject->title);\n $this->setFirstName($pageObject->firstname);\n $this->setLastName($pageObject->lastname);\n $this->setEmail($pageObject->email);\n }\nreturn $jsonObject;\n}", "public function convert()\n\t{\n\t\t$file = (version_compare(JVERSION,'1.6.0','ge')) ? 'demo25.json' : 'demo.json';\n\t\t$this->data = json_decode(file_get_contents(JPATH_COMPONENT_ADMINISTRATOR . '/data/'.$file), true);\n\n\t\tparent::convert();\n\n if(KRequest::type() == 'AJAX') echo json_encode(array('splittable' => false));\n\t\t\n\t\treturn $this;\n\t}", "public function json() {\n\t\t$data = parent::json();\n\n\t\t$data['id'] = $this->type . '-' . $this->id;\n\t\t$data['label'] = html_entity_decode( $this->label, ENT_QUOTES, get_bloginfo( 'charset' ) );\n\t\t$data['value'] = $this->value();\n\t\t$data['link'] = $this->get_link();\n\t\t$data['defaultValue'] = $this->setting->default;\n\n\t\treturn $data;\n\t}", "function buildJSON($id='',$id2='')\n\t{\n\t\t$this->load->config($this->uri->segments[1].'/'.$this->session->grid);\n\t\t$json = $this->config->item('json');\n\t\tforeach($json['parameter'] as $key=>$val)\n\t\t{\n\t\t\tif($val =='get')\n\t\t\t{\n\t\t\t\t$parameter[$key] = $id;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$parameter[$key] = $this->session->{$key};\n\t\t\t}\n\t\t\t$this->session->set_userdata($key,$parameter[$key]);\n\t\t}\n\t\t$this->load->model('BaseModel');\n\t\t\n\t\tif(isset($json['type']) && in_array($json['type'], ['project','performance']))\n\t\t{\n\t\t\t$output['instrument'] = $this->BaseModel->execute($json['instrument'])->result();\n\t\t\tforeach($output['instrument'] as $k => $v)\n\t\t\t{\n\t\t\t\t$output['instrument'][$k]->source = encrypt($json['type'].'Instruments_'.$v->id,'r'); \t\n\t\t\t}\n\t\t\t$output['score'] = $this->BaseModel->execute($json['score'])->result();\n\t\t\t$this->session->set_userdata('assessmentType',$json['type']);\n\t\t\t$output['type'] = $json['type'];\n\t\t\tif($json['type']=='project')\n\t\t\t{\n\t\t\t\t$output['student_id'] = $id2;\n\t\t\t\t$output['project_id'] = $id;\n\t\t\t\t$this->session->set_userdata('student_id',$output['student_id']);\n\t\t\t\t$this->session->set_userdata('project_id',$output['project_id']);\n\t\t\t\t$output['product_id'] = encrypt('products_'.$output['project_id'].'-'.$output['student_id'],'r');\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$output['student_id'] = $id2;\n\t\t\t\t$output['performance_id'] = $id;\n\t\t\t\t$output['person'] = $this->BaseModel->execute($json['person'])->row();\n\t\t\t\t$this->session->set_userdata('student_id',$output['student_id']);\n\t\t\t\t$this->session->set_userdata('performance_id',$output['performance_id']);\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data = $this->BaseModel->execute($json['quiz'])->row();\n\t\t\t$output['user'] = $this->uri->segments[1];\n\t\t\tif($this->uri->segments[1]=='teacher')\n\t\t\t{\n\t\t\t\t$output['quiz']['close'] = 0;\n\t\t\t\t$output['quiz']['prepare'] = 0;\n\t\t\t\t$output['quiz']['remain'] = strtotime($data->finish)-strtotime($data->start); \n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$output['quiz']['prepare'] = strtotime($data->start)-strtotime(date('Y-m-d H:i:s'));\t\n\t\t\t\t$output['quiz']['close'] = strtotime($data->finish)-strtotime(date('Y-m-d H:i:s'))>0?0:1;\n\t\t\t\t$output['quiz']['remain'] = $data->remain==null ? strtotime($data->finish)-strtotime($data->start) : $data->remain; \n\t\t\t}\n\t\t\t$output['quiz']['start'] = date('Y-m-d H:i:s',strtotime($data->start)); \n\t\t\tif($output['quiz']['close']==1)\n\t\t\t{\n\t\t\t\t$this->session->unset_userdata('token',$data->token);\n\t\t\t\t$this->session->unset_userdata('quiz_id',$data->id);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->session->set_userdata('token',$data->token);\n\t\t\t\t$this->session->set_userdata('quiz_id',$data->id);\n\t\t\t\t$this->session->set_userdata('remain',$output['quiz']['remain']);\n\t\t\t}\n\t\t}\n\t\t$this->json($output);\n\t}", "public function jsonSerialize() {\n $result = array();\n if (!is_null($this->id)) {\n $result[\"id\"] = intval($this->id);\n }\n if (!is_null($this->name)) {\n $result[\"name\"] = strval($this->name);\n }\n if (!is_null($this->content)) {\n $result[\"content\"] = $this->content;\n }\n if (!is_null($this->defaultformat)) {\n $result[\"defaultformat\"] = strval($this->defaultformat);\n }\n if (!is_null($this->description)) {\n $result[\"description\"] = strval($this->description);\n }\n if (!is_null($this->emailbcc)) {\n $result[\"emailbcc\"] = strval($this->emailbcc);\n }\n if (!is_null($this->emailcc)) {\n $result[\"emailcc\"] = strval($this->emailcc);\n }\n if (!is_null($this->emailrecipients)) {\n $result[\"emailrecipients\"] = strval($this->emailrecipients);\n }\n if (!is_null($this->emailschedule)) {\n $result[\"emailschedule\"] = (bool)$this->emailschedule;\n }\n if (!is_null($this->emailscheduledayofmonth)) {\n $result[\"emailscheduledayofmonth\"] = intval($this->emailscheduledayofmonth);\n }\n if (!is_null($this->emailscheduledayofweek)) {\n $result[\"emailscheduledayofweek\"] = intval($this->emailscheduledayofweek);\n }\n if (!is_null($this->emailschedulehourofday)) {\n $result[\"emailschedulehourofday\"] = intval($this->emailschedulehourofday);\n }\n if (!is_null($this->emailschedulequery)) {\n $result[\"emailschedulequery\"] = strval($this->emailschedulequery);\n }\n if (!is_null($this->options)) {\n $result[\"options\"] = $this->options;\n }\n if (!is_null($this->reporttypeid)) {\n $result[\"reporttypeid\"] = intval($this->reporttypeid);\n }\n if (!is_null($this->subtitles)) {\n $result[\"subtitles\"] = $this->subtitles;\n }\n if (!is_null($this->translations)) {\n $result[\"translations\"] = $this->translations;\n }\n if (!is_null($this->usagetypeid)) {\n $result[\"usagetypeid\"] = intval($this->usagetypeid);\n }\n if (!is_null($this->createdts)) {\n $result[\"createdts\"] = Json::packTimestamp($this->createdts);\n }\n if (!is_null($this->lastupdatets)) {\n $result[\"lastupdatets\"] = Json::packTimestamp($this->lastupdatets);\n }\n\n return $result;\n }", "public function toJson() {\n\t\t$data = array();\n\t\tforeach ($this->fields as $name => $field) {\n\t\t\t$data += [$name => $field->toJson()];\n\t\t}\n\t\t$top = array(\"success\"=>$this->getSuccess(),\"data\"=>$data,\"text\"=>$this->text);\n\t\treturn $top;\n\t}", "protected function json(){\n $this->before(function ($request) {\n if ($request->contentType == \"application/json; charset=utf-8\") {\n $request->data = json_decode($request->data);\n }\n });\n $this->after(function ($response) {\n $response->contentType = \"application/json; charset=utf-8\";\n if (isset($_GET['jsonp'])) {\n $response->body = $_GET['jsonp'].'('.json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES).');';\n } else {\n $response->body = json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);\n }\n });\n }", "protected function json(){\n $this->before(function ($request) {\n if ($request->contentType == \"application/json; charset=utf-8\") {\n $request->data = json_decode($request->data);\n }\n });\n $this->after(function ($response) {\n $response->contentType = \"application/json; charset=utf-8\";\n if (isset($_GET['jsonp'])) {\n $response->body = $_GET['jsonp'].'('.json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES).');';\n } else {\n $response->body = json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);\n }\n });\n }", "protected function json(){\n $this->before(function ($request) {\n if ($request->contentType == \"application/json; charset=utf-8\") {\n $request->data = json_decode($request->data);\n }\n });\n $this->after(function ($response) {\n $response->contentType = \"application/json; charset=utf-8\";\n if (isset($_GET['jsonp'])) {\n $response->body = $_GET['jsonp'].'('.json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES).');';\n } else {\n $response->body = json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);\n }\n });\n }", "public function get_json()\n {\n return json_encode($this);\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json() {\n\t\t\tparent::to_json();\n\t\t\t$this->json['mtmfontslist'] = $this->font_list;\n\t\t}", "function jsonSerialize()\n {\n return [\n 'name' => $this->name,\n 'author' => $this->authorModel->fullName,\n 'cover_path' => $this->getCoverWebPath(),\n 'cover_image_name' => $this->preview_path,\n 'release_date' => date('M d, Y', $this->release_date),\n 'created_at' => Yii::$app->getFormatter()->asDatetime($this->created_at),\n 'updated_at' => Yii::$app->getFormatter()->asDatetime($this->updated_at),\n ];\n }", "public function to_json() {\n\t\tparent::to_json();\n\n\t\t// We need to make sure we have the correct image URL.\n\t\tforeach ( $this->choices as $value => $args )\n\t\t\t$this->choices[ $value ]['url'] = esc_url( sprintf( $args['url'], get_template_directory_uri(), get_stylesheet_directory_uri() ) );\n\n\t\t$this->json['choices'] = $this->choices;\n\t\t$this->json['link'] = $this->get_link();\n\t\t$this->json['value'] = $this->value();\n\t\t$this->json['id'] = $this->id;\n\t}", "protected function loadData()\n {\n\n $this->jsonUrl = 'https://api.srgssr.ch/audiometadata/v2/livestreams';\n parent::loadData();\n\n }", "function jsonSerialize()\n {\n return [\n 'meta' => [\n 'offset' => $this->page->getOffset(),\n 'limit' => $this->page->getLimit(),\n 'total' => $this->total,\n ],\n 'data' => $this->results,\n ];\n }", "public function jsonSerialize()\r\n {\r\n $json = array();\r\n $json['id'] = $this->id;\r\n $json['user_photo_album_id'] = $this->userPhotoAlbumId;\r\n $json['filename'] = $this->filename;\r\n $json['original_filename'] = $this->originalFilename;\r\n $json['text'] = $this->text;\r\n $json['display_format'] = $this->displayFormat;\r\n $json['counter'] = $this->counter;\r\n $json['do_not_feature'] = $this->doNotFeature;\r\n $json['approved'] = $this->approved;\r\n $json['category_mask'] = $this->categoryMask;\r\n $json['blessed_id'] = $this->blessedId;\r\n $json['hash'] = $this->hash;\r\n $json['album_id'] = $this->albumId;\r\n\r\n return $json;\r\n }", "public function to_json() {\n\t\tparent::to_json();\n\n\t\t// Loop through each of the settings and set up the data for it.\n\t\tforeach ( $this->settings as $setting_key => $setting_id ) {\n\n\t\t\t$this->json[ $setting_key ] = array(\n\t\t\t\t'link' => $this->get_link( $setting_key ),\n\t\t\t\t'value' => $this->value( $setting_key ),\n\t\t\t\t'label' => isset( $this->l10n[ $setting_key ] ) ? $this->l10n[ $setting_key ] : ''\n\t\t\t);\n\n\t\t\tif ( 'family' === $setting_key )\n\t\t\t\t$this->json[ $setting_key ]['choices'] = googlefont_families();\n\n\t\t\telseif ( 'weight' === $setting_key )\n\t\t\t\t$this->json[ $setting_key ]['choices'] = googlefont_family_all_weights();\n\n\t\t\telseif ( 'style' === $setting_key )\n\t\t\t\t$this->json[ $setting_key ]['choices'] = $this->get_font_style_choices();\n\t\t}\n\t}", "public function json() {\n\t\t$array = wp_array_slice_assoc(\n\t\t\t(array) $this,\n\t\t\tarray(\n\t\t\t\t'id',\n\t\t\t\t'description',\n\t\t\t\t'priority',\n\t\t\t\t'panel',\n\t\t\t\t'type',\n\t\t\t\t'description_hidden',\n\t\t\t\t'section',\n\t\t\t)\n\t\t);\n\n\t\t$array['title'] = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );\n\t\t$array['content'] = $this->get_content();\n\t\t$array['active'] = $this->active();\n\t\t$array['instanceNumber'] = $this->instance_number;\n\n\t\t$array['customizeAction'] = esc_html__( 'Customizing', 'kirki' );\n\t\tif ( $this->panel ) {\n\t\t\t/* translators: The title. */\n\t\t\t$array['customizeAction'] = sprintf( esc_html__( 'Customizing &#9656; %s', 'kirki' ), esc_html( $this->manager->get_panel( $this->panel )->title ) );\n\t\t}\n\t\treturn $array;\n\t}", "abstract protected function getAdditionalJsonData(): array;", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function __toString(){\n $json = parent::__toString();\n\n $json['idm_url'] = $this->idm_url;\n $json['read_url'] = $this->read_url;\n $json['read_headers'] = $this->read_headers;\n $json['search_url'] = $this->search_url;\n $json['search_headers'] = $this->search_headers;\n $json['search_method'] = $this->search_method;\n $json['search_POST'] = $this->search_POST;\n $json['update_url'] = $this->update_url;\n $json['update_headers'] = $this->update_headers;\n $json['update_method'] = $this->update_method;\n $json['create_url'] = $this->create_url;\n $json['create_headers'] = $this->create_headers;\n $json['create_method'] = $this->create_method;\n\n $json['patron'] = $this->patron;\n $json['search'] = $this->search;\n $json['create'] = $this->create;\n $json['update'] = $this->update;\n\n\n return json_encode($json, JSON_PRETTY_PRINT);\n }", "public function jsonSerialize()\n {\n $this->isValid(true);\n // TODO Remove useless context from sub-objects. And other copied data (homepage, etc.).\n return (object) $this->content;\n }", "public function jsonSerialize()\n {\n return array('title' => $this->title,\n 'size' => $this->size,\n 'unit_price' => $this->unitPrice,\n 'description' => $this->description);\n }", "public function saveJson()\n {\n $ExtensionData = new ExtensionData();\n $ExtensionData->SubmittedByID = Member::currentUserID();\n $result = $this->dataFields($ExtensionData);\n return $result ;\n }", "public function json();", "public function json()\n {\n $this->fetchFields();\n Log::json($this);\n }", "public function json()\n {\n }", "public function json()\n {\n }", "public function json()\n {\n }", "public function json()\n {\n }", "public function json()\n {\n }", "public function json()\n {\n }", "public function json()\n {\n }", "public function json()\n {\n }", "public function json()\n {\n }", "public function json()\n {\n }", "public function json()\n {\n }", "public function json()\n {\n }", "function jsonSerialize() {\n\t$fields = get_object_vars($this);\n\t$fields[\"profileId\"] = intval($this->profileId->format(\"U\")) * 1000;\n\treturn ($fields);\n\n}", "public function jsonSerialize()\n {\n $json = array();\n $json['Name'] = $this->name;\n $json['MvaNumber'] = $this->mvaNumber;\n $json['CompanyPhone'] = $this->companyPhone;\n $json['CompanyEmail'] = $this->companyEmail;\n $json['Id'] = $this->id;\n $json['CustomerNumber'] = $this->customerNumber;\n $json['Resources'] = $this->resources;\n $json['CompanyUrl'] = $this->companyUrl;\n $json['Contact'] = $this->contact;\n $json['Address'] = $this->address;\n $json['Dealer'] = $this->dealer;\n $json['Settings'] = $this->settings;\n $json['Country'] = $this->country;\n\n return array_merge($json, $this->additionalProperties);\n }", "public function json()\n {\n // if dirty data exists\n $this->swallow();\n // if redirecting\n if ($this->redirect) {\n /*header(\"Location: {$this->redirect}\");\n // more headers\n foreach ( $this->headers as $header ) {\n header($header);\n }*/\n $this->redirect($this->redirect, array(), false);\n } else {\n // header json data\n header('Content-Type: application/json');\n // more headers\n foreach ($this->headers as $header) {\n header($header);\n }\n //过滤$CFG\n if (!empty($this->vars['CFG'])) {\n unset($this->vars['CFG']);\n }\n // if cli add time\n if ($cli = Utility::isCli()) {\n echo \"[\". date('Y-m-d H:i:s') . \"] \";\n }\n // set varibales data\n if ($cli && version_compare(phpversion(), '5.4.0') > 0) {\n $results = json_encode($this->vars, JSON_PRETTY_PRINT);\n } else {\n $results = json_encode($this->vars);\n }\n // send\n echo $results;\n // if cli add \\n\n if ($cli) {\n echo \"\\n\";\n }\n }\n }", "protected function _buildDataObject()\r\n\t{\r\n\t\t// Initialise variables.\r\n\t\t$data = new stdClass;\r\n\t\t\r\n\t\t$limitString = '&limit=' . $this->limit; // sh404 fix\r\n\t\t\r\n\t\t// Build the additional URL parameters string.\r\n\t\t$params = '';\r\n\t\tif (!empty($this->_additionalUrlParams))\r\n\t\t{\r\n\t\t\tforeach ($this->_additionalUrlParams as $key => $value)\r\n\t\t\t{\r\n\t\t\t\t$params .= '&' . $key . '=' . $value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$data->all = new JPaginationObject(JText::_('JLIB_HTML_VIEW_ALL'), $this->prefix);\r\n\t\tif (!$this->_viewall)\r\n\t\t{\r\n\t\t\t$data->all->base = '0';\r\n\t\t\t$data->all->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=');\r\n\t\t}\r\n\r\n\t\t// Set the start and previous data objects.\r\n\t\t$data->start = new JPaginationObject(JText::_('JLIB_HTML_START'), $this->prefix);\r\n\t\t$data->previous = new JPaginationObject(JText::_('JPREV'), $this->prefix);\r\n\r\n\t\tif ($this->get('pages.current') > 1)\r\n\t\t{\r\n\t\t\t$page = ($this->get('pages.current') - 2) * $this->limit;\r\n\r\n\t\t\t// Set the empty for removal from route\r\n\t\t\t//$page = $page == 0 ? '' : $page;\r\n\r\n\t\t\t$data->start->base = '0';\r\n\t\t\t$data->start->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=0');\r\n\t\t\t$data->previous->base = $page;\r\n\t\t\t$data->previous->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $page . $limitString);\r\n\t\t}\r\n\r\n\t\t// Set the next and end data objects.\r\n\t\t$data->next = new JPaginationObject(JText::_('JNEXT'), $this->prefix);\r\n\t\t$data->end = new JPaginationObject(JText::_('JLIB_HTML_END'), $this->prefix);\r\n\r\n\t\tif ($this->get('pages.current') < $this->get('pages.total'))\r\n\t\t{\r\n\t\t\t$next = $this->get('pages.current') * $this->limit;\r\n\t\t\t$end = ($this->get('pages.total') - 1) * $this->limit;\r\n\r\n\t\t\t$data->next->base = $next;\r\n\t\t\t$data->next->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $next . $limitString);\r\n\t\t\t$data->end->base = $end;\r\n\t\t\t$data->end->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $end . $limitString);\r\n\t\t}\r\n\r\n\t\t$data->pages = array();\r\n\t\t$stop = $this->get('pages.stop');\r\n\t\tfor ($i = $this->get('pages.start'); $i <= $stop; $i++)\r\n\t\t{\r\n\t\t\t$offset = ($i - 1) * $this->limit;\r\n\t\t\t// Set the empty for removal from route\r\n\t\t\t//$offset = $offset == 0 ? '' : $offset;\r\n\r\n\t\t\t$data->pages[$i] = new JPaginationObject($i, $this->prefix);\r\n\t\t\tif ($i != $this->get('pages.current') || $this->_viewall)\r\n\t\t\t{\r\n\t\t\t\t$data->pages[$i]->base = $offset;\r\n\t\t\t\t$data->pages[$i]->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $offset . $limitString);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $data;\r\n\t}", "protected function build()\n {\n if ($this->relations) {\n $this->addRelational();\n }\n $this->loadSubQueries();\n }", "public function generaJson(){\n\tdate_default_timezone_set(\"America/Mexico_City\");\n\t$datosMediaAction\t= \t\"\";\n\t$time\t\t\t\t=\ttime();\n\t$fechaActual \t\t= \tdate('Y-m-d h:i:sa');\n\t$fechaFormatoIso\t=\tdate(\"Y-m-d\", $time) . 'T' . date(\"H:i:s\", $time) .'Z';\t\n\t$nuevafecha \t\t= \tstrtotime ('+1 year' , strtotime($fechaActual)); //Le aumentamos 1 año por ahora solo prueba chance y sirva de algo mas adelante\n\t$fechaFormatoIsoMas\t=\tdate(\"Y-m-d\", $nuevafecha) . 'T' . date(\"H:i:s\", $nuevafecha) .'Z';\n\t\n\t$datosMediaAction =\tarray(\n\t\t\t\t\t\"@context\" \t\t\t=> \"http://schema.org\",\n\t\t\t\t\t\"@type\" \t\t\t=> \"DataFeed\",\n\t\t\t\t\t\"dateModified\" \t=> $fechaFormatoIso,\n\t\t\t\t\t\"dataFeedElement\" \t=> array([\n\t\t\t\t\t\t\t\"@context\" \t\t\t=> array(\"http://schema.org\", array(\"@language\" => \"en\")),\n\t\t\t\t\t\t\t\"@type\" \t\t\t=> \"Movie\",\n\t\t\t\t\t\t\t\"@id\" \t\t\t\t=> \"http://www.example.com/my_favorite_movie\",\n\t\t\t\t\t\t\t\"url\" \t\t\t\t=> \"http://www.example.com/my_favorite_movie\",\n\t\t\t\t\t\t\t\"name\" \t\t\t=> \"My Favorite Movie\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"potentialAction\" \t=>\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"@type\"\t\t\t\t=> \"WatchAction\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"target\"\t\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"@type\"\t\t\t\t=> \"EntryPoint\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"urlTemplate\"\t\t=> \"http://www.example.com/my_favorite_movie?autoplay=true\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"inLanguage\"\t\t=> \"en\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"actionPlatform\"\t=> array(\"http://schema.org/DesktopWebPlatform\",\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\"http://schema.org/MobileWebPlatform\",\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\"http://schema.org/AndroidPlatform\",\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\"http://schema.org/IOSPlatform\",\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\"http://schema.googleapis.com/GoogleVideoCast\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"actionAccessibilityRequirement\" \t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"@type\"\t\t\t\t\t\t\t\t=> \"ActionAccessSpecification\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"category\"\t\t\t\t\t\t\t=> \"subscription\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"availabilityStarts\"\t\t\t\t=> $fechaFormatoIso,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"availabilityEnds\"\t\t\t\t\t=> $fechaFormatoIsoMas,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"eligibleRegion\"\t\t\t\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"@type\"\t=> \"Country\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\"\t=> \"US\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"@type\"\t=> \"Country\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\"\t=> \"CA\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t),//Fin de potentialAction\n\t\t\t\t\t\t\t\"sameAs\"\t\t\t=> \"https://en.wikipedia.org/wiki/my_favorite_movie\",\n\t\t\t\t\t\t\t\"releasedEvent\"\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"@type\"\t\t\t=> \"PublicationEvent\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"startDate\"\t\t=> date('Y-m-d'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\"\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"@type\"\t\t=> \"Country\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\"\t\t=> \"US\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\"description\"\t\t=> \"This is my favorite movie.\",\n\t\t\t\t\t\t\t\"actor\" \t\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"@type\"\t\t=> \"Person\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\"\t\t=> \"John Doe\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"sameAs\"\t=> \"https://en.wikipedia.org/wiki/John_Doe\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"@type\"\t\t=> \"Person\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\"\t\t=> \"Jane Doe\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"sameAs\"\t=> \"https://en.wikipedia.org/wiki/Jane_Doe\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\"identifier\"\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"@type\"=> \"PropertyValue\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"propertyID\"=> \"IMDB_ID\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"value\"=> \"tt0123456\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\n\t\t\t\t\t])//Fin de dataFeedElement\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t);\n\t\n\treturn $datosMediaAction;\n}", "public function jsonSerialize()\n {\n $json = array();\n $json['totalRecords'] = $this->totalRecords;\n $json['totalPages'] = $this->totalPages;\n $json['pageNumber'] = $this->pageNumber;\n $json['numberOfRecordsPerPage'] = $this->numberOfRecordsPerPage;\n $json['applications'] = $this->applications;\n\n return array_merge($json, $this->additionalProperties);\n }", "public function prase_json1(){\n\t\t\t$stry=\"{\";\n\t\t\n\t\t\t$stry=$stry.\"\\\"\".$this->xml->getName().\"\\\"\".\":{\";\n\t\t\t$bg=$this->xml->children();\n\t\t\n\t\t\t\n\t\t\tforeach ($bg[1]->children() as $ff){\n\t\t\t$stry=$stry.\"\\\"\".$ff->getName().\"\\\":\\\"\".$ff.\"\\\",\";\t}\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t$stry=substr($stry,0,strlen($stry)-1);\n\t\t\n\t\t$stry.=\"},\";\n\t\t\n\t\t$stry=substr($stry,0,strlen($stry)-1);\n\t\t$stry.=\"}\";\n\t\t\t\n\t\t\t\n\t\treturn $stry;\n\t\t\t\n\t\t\t\n\t}", "function jsonSerialize()\n {\n return [\n 'id' => $this->id,\n 'title' => $this->title,\n 'quantity' => $this->quantity,\n 'clientName' => $this->clientName,\n 'address' => $this->address,\n 'email' => $this->email,\n 'state' => $this->state,\n 'dispatchingTime'=> $this->dispatchingTime\n ];\n }", "public function getInitialData() \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n { $this->autorender = false;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n \t\t$this->layout = null;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n \t $this->render('ajax');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n $params = json_decode(file_get_contents('php://input'),true); //\n// $fileURL=$params['fileURL'];\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 Controller::loadModel('Bugs');\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n $bugData=$this->Bugs->find('all', array('conditions' => array('status' => '0', 'parentid' => '0'))); //\n echo(json_encode($bugData)); //\n }", "public function jsonSerialize()\n {\n return array_merge(parent::jsonSerialize(),[]);\n }", "public function jsonSerialize()\n {\n }", "public function jsonSerialize()\n {\n }", "function load_data()\n \t{\n \t\t\n \t\t$return=parent::load_data();\t\n \t\t$this->images_array=t3lib_div::trimExplode(',',$this->images);\n \t\t$this->teaserImagesArray=t3lib_div::trimExplode(',',$this->teaserimages);\n \t\treturn $return;\n \t}", "public function jsonSerialize() {\n\t\t$fields = get_object_vars($this);\n\t\t$fields[\"todoDate\"] = round(floatval($this->gettodoDate()->format(\"U.u\") * 1000));\n\t\treturn ($fields);\n\t}", "public function json() {\n\t\t$data = parent::json();\n\n\t\t$data['id'] = $this->type . '-' . $this->id;\n\t\t$data['label'] = html_entity_decode( $this->label, ENT_QUOTES, get_bloginfo( 'charset' ) );\n\t\t$data['value'] = $this->value();\n\t\t$data['link'] = $this->get_link();\n\t\t$data['choices'] = $this->choices;\n\t\t$data['multiple'] = $this->multiple;\n\n\t\t$options = array();\n\n\t\tif ( is_array( $this->choices ) && ! empty( $this->choices ) ) {\n\t\t\tforeach ( $this->choices as $key => $val ) {\n\t\t\t\t$options[] = \"{$key}|||{$val}\";\n\t\t\t}\n\t\t}\n\n\t\t$data['options'] = $options;\n\n\t\treturn $data;\n\t}" ]
[ "0.7012178", "0.6142556", "0.61084175", "0.59710544", "0.5968544", "0.5912146", "0.5898108", "0.58685416", "0.57585377", "0.5703617", "0.56981456", "0.56902194", "0.56786764", "0.5671145", "0.56562674", "0.5609571", "0.5565421", "0.5561511", "0.5489264", "0.54680264", "0.54680264", "0.54650176", "0.54481184", "0.5393826", "0.53498304", "0.53362226", "0.53362226", "0.53358144", "0.532446", "0.5318314", "0.53107834", "0.5304323", "0.5302378", "0.5285074", "0.5283045", "0.52650476", "0.5264376", "0.5255414", "0.5255414", "0.5255414", "0.52526295", "0.52457446", "0.52457446", "0.52457446", "0.52457446", "0.52457446", "0.52457446", "0.52457446", "0.52457446", "0.52457446", "0.5242232", "0.5239992", "0.5239788", "0.52290165", "0.5223932", "0.5221806", "0.52011025", "0.520055", "0.51815546", "0.5178101", "0.5178101", "0.5178101", "0.5178101", "0.5178101", "0.5178101", "0.5178101", "0.5178101", "0.5175405", "0.51749796", "0.51514", "0.5149803", "0.51428294", "0.51382446", "0.51344687", "0.51344687", "0.51344687", "0.51344687", "0.51344687", "0.51344687", "0.51344687", "0.51344687", "0.51344687", "0.51344687", "0.51344687", "0.5134347", "0.5133582", "0.5133432", "0.51316315", "0.512034", "0.51180744", "0.5099044", "0.509652", "0.50874585", "0.5084787", "0.5079386", "0.50750315", "0.5073098", "0.5073098", "0.50720346", "0.5071574", "0.50709254" ]
0.0
-1
For internal only. DO NOT USE IT.
public function deserialize($param) { if ($param === null) { return; } if (array_key_exists("CertificationAuthority",$param) and $param["CertificationAuthority"] !== null) { $this->CertificationAuthority = $param["CertificationAuthority"]; } if (array_key_exists("ClusterExternalEndpoint",$param) and $param["ClusterExternalEndpoint"] !== null) { $this->ClusterExternalEndpoint = $param["ClusterExternalEndpoint"]; } if (array_key_exists("ClusterIntranetEndpoint",$param) and $param["ClusterIntranetEndpoint"] !== null) { $this->ClusterIntranetEndpoint = $param["ClusterIntranetEndpoint"]; } if (array_key_exists("ClusterDomain",$param) and $param["ClusterDomain"] !== null) { $this->ClusterDomain = $param["ClusterDomain"]; } if (array_key_exists("ClusterExternalACL",$param) and $param["ClusterExternalACL"] !== null) { $this->ClusterExternalACL = $param["ClusterExternalACL"]; } if (array_key_exists("ClusterExternalDomain",$param) and $param["ClusterExternalDomain"] !== null) { $this->ClusterExternalDomain = $param["ClusterExternalDomain"]; } if (array_key_exists("ClusterIntranetDomain",$param) and $param["ClusterIntranetDomain"] !== null) { $this->ClusterIntranetDomain = $param["ClusterIntranetDomain"]; } if (array_key_exists("SecurityGroup",$param) and $param["SecurityGroup"] !== null) { $this->SecurityGroup = $param["SecurityGroup"]; } if (array_key_exists("RequestId",$param) and $param["RequestId"] !== null) { $this->RequestId = $param["RequestId"]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function __init__() { }", "private function __() {\n }", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "private function __construct()\t{}", "private function init()\n\t{\n\t\treturn;\n\t}", "final private function __construct() {}", "final private function __construct() {}", "final private function __construct(){\r\r\n\t}", "final private function __construct() {\n\t\t\t}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "private function _i() {\n }", "protected function fixSelf() {}", "protected function fixSelf() {}", "protected final function __construct() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function init()\n\t{\n\t\t\n\t}", "private function __construct() {\r\n\t\r\n\t}", "private function __construct() {\r\n\t\t\r\n\t}", "protected function init() {return;}", "final private function __construct()\n\t{\n\t}", "private function __construct () {}", "final private function __construct()\n {\n }", "private final function __construct() {}", "public function __init(){}", "public function helper()\n\t{\n\t\n\t}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct()\n\t{\n\t\t\n\t}" ]
[ "0.62662613", "0.6151871", "0.5989886", "0.5989886", "0.5989886", "0.5989886", "0.5989418", "0.5989418", "0.5989418", "0.5989418", "0.5989418", "0.5989418", "0.5988404", "0.5988404", "0.5949015", "0.5939596", "0.59168774", "0.59168774", "0.58703923", "0.58665824", "0.5855589", "0.5855589", "0.5855589", "0.5799749", "0.5797107", "0.5797107", "0.57807934", "0.5749856", "0.5749856", "0.5749856", "0.5749856", "0.57458705", "0.5741364", "0.571247", "0.5701768", "0.5694139", "0.5680823", "0.5673589", "0.5668696", "0.5640213", "0.5639332", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5627174", "0.5626381", "0.56240404", "0.56240404", "0.5610547" ]
0.0
-1
Get the unique identifier for the user.
public function getAuthIdentifier() { return $this->getKey(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUserIdentifier()\n {\n // that's why I am sending the id here\n return $this->id;\n }", "public function uniqueId(): string\n {\n return strval($this->user->id);\n }", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "public function getUserId ()\n {\n return $this->storage->get(self::$prefix . 'userId');\n }", "public function get_user_id();", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getAuthIdentifier()\n {\n return (string) $this->user['id'];\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->username;\n }", "public function getUserId()\n {\n $value = $this->get(self::user_id);\n return $value === null ? (integer)$value : $value;\n }", "public function getUserId()\n {\n return UsniAdaptor::app()->user->getId();\n }", "function get_id() : string {\n\t$current_user = wp_get_current_user();\n\treturn sha1( $current_user->user_email );\n}", "public function getUserIdentifier(): string\n {\n return (string) $this->getEmail();\n }", "public function getIdentifier()\n {\n return $this->user->email;\n }", "function user_id () {\r\n\t$info = user_info();\r\n\treturn (isset($info[0]) ? $info[0] : 0);\r\n}", "public function getUserID() {\n\t\tif (is_numeric($this->user_id)) {\n\t\t\treturn $this->user_id;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "public function getUserID () {\n return $this->id;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->login;\n }", "public function getUserId()\n {\n return $this->getUserAttribute(static::ATTRIBUTE_ID);\n }", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getIdentifier()\n {\n return $this->uid;\n }", "public function getUid() {\n return $this->get(self::UID);\n }", "public function getUserId()\n {\n $request = new GetUserRequest();\n $user = $this->serviceClient->GetService()->GetUser($request)->User;\n return $user->Id;\n }", "Public Function UserId() {\n\t\treturn $this->userId;\n\t\n\t}", "public function getUserID() {\n\t\treturn $this->_user_id;\n\t}", "public function getUserId()\n {\n $this->checkIfKeyExistsAndIsInteger('user_id');\n\n return $this->data['user_id'];\n }", "public function getUid();", "public function getUid();", "public function getuserId() : Uuid {\n\t\treturn($this->userId);\n\t}", "public function getUser_ident()\n {\n return $this->user_ident;\n }", "public function getUserID(){\n return($this->userID);\n }", "public function getUser_id()\n {\n return isset($this->user_id) ? $this->user_id : null;\n }", "public function getUid()\n {\n return $this->get(self::_UID);\n }", "public function getUid()\n {\n return $this->get(self::_UID);\n }", "public function getUid()\n {\n return $this->get(self::_UID);\n }", "public function getUid()\n {\n return $this->get(self::_UID);\n }", "public function getUid()\n {\n return $this->get(self::_UID);\n }", "public function getUid()\n {\n return $this->get(self::_UID);\n }", "public function getUserID()\n {\n return $this->userID;\n }", "public function getUserID()\n {\n return $this->userID;\n }", "public function getUserIdentifier(): string\n {\n return ($this->token ?? ($this->appkey ?? ''));\n }", "public function getUserId()\n {\n return $this->authenticator->getUserId();\n }", "public function getAuthIdentifier() {\n return $this->id_user;\n }", "public function getUserIdName()\n {\n return $this->userRepo->getUserIdName();\n }", "protected function getUserId()\n {\n return object_get($this->getUser(), 'profile_id', $this->getDefaultProfileId() );\n }", "public function getUserId(): string;", "public function getUserId() {\n\t\treturn $this->Session->read('UserAuth.User.id');\n\t}", "public function getID() {\n return $this->user_id;\n }", "public function _getID()\n {\n $this->selftest();\n return $this->objectUser->ID;\n }", "public static function get_uniqueid() {\n global $USER;\n\n $uniqueid = new \\stdClass();\n\n // at first, have a look if a specific user for course exports has been defined\n $specific_export_user = self::get_specific_export_user();\n if ($specific_export_user !== false){\n if (!empty($specific_export_user->username)){\n $uniqueid->value = $specific_export_user->username;\n $uniqueid->type = 'username';\n return $uniqueid;\n }\n }\n\n // if no specific export user could be found, we continue...\n $uniqueid->type = get_config('local_remote_backup_provider', 'uniqueid');\n switch ($uniqueid->type) {\n case 'username':\n $uniqueid->value = $USER->username;\n break;\n case 'email':\n $uniqueid->value = $USER->email;\n break;\n case 'idnumber':\n $uniqueid->value = $USER->idnumber;\n break;\n default:\n $uniqueid->value = $USER->username;\n $uniqueid->type = 'username';\n }\n return $uniqueid;\n }", "public function getCustomUserId();", "public function getUserId()\n {\n \treturn $this->getCurrentUserid();\n }", "public function get_user_id()\n {\n return self::getUser();\n }", "function getUserId() {\n\t\treturn $this->getData('userId');\n\t}", "public function getUid() {}", "public function getUserIdentifier(): string\n\t{\n\t\treturn (string)$this->siret;\n\t}", "public function getUid() {}", "public function getUid() {}", "public function getUid() {}", "public function getUid() {}", "public function getUid() {}", "public function getUserID() {\n\t\t\treturn $this->iUser; \t\n\t\t}", "public function get_id_user()\n\t{\n\t\treturn $this->id_user;\n\t}", "public function id() {\n return isset($this->_adaptee->user_info['user_id']) ? $this->_adaptee->user_info['user_id'] : null;\n }", "public function getUserId()\n {\n return parent::getValue('user_id');\n }", "public function get_id_user()\n {\n return (isset($this->_id_user)) ? $this->_id_user : null;\n }", "public function getUserId () {\n\t\treturn ($this->userId);\n\t}", "public function getUid(): string\n {\n return $this->uid;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }", "public function getUserId()\n {\n return $this->user_id;\n }" ]
[ "0.83579457", "0.830269", "0.8108248", "0.8108248", "0.8108248", "0.80963516", "0.80897546", "0.80067533", "0.80067533", "0.80067533", "0.8006005", "0.79547375", "0.79351974", "0.7910551", "0.78961694", "0.7876723", "0.787507", "0.78725845", "0.7869423", "0.7864789", "0.78482157", "0.7840806", "0.7840806", "0.7840806", "0.7840806", "0.7840806", "0.7840806", "0.7840806", "0.7840806", "0.7840806", "0.7840806", "0.7840806", "0.7840806", "0.78378385", "0.78160805", "0.77972543", "0.77972543", "0.77972543", "0.77972543", "0.77972543", "0.77972543", "0.77972543", "0.77972543", "0.77972543", "0.7785441", "0.7777419", "0.7761021", "0.77602535", "0.7757369", "0.77572304", "0.7750807", "0.7750807", "0.774609", "0.77444535", "0.7737298", "0.7722186", "0.7718708", "0.7718708", "0.7718708", "0.7718708", "0.7718708", "0.7718708", "0.77081156", "0.77081156", "0.7707095", "0.769457", "0.76893", "0.7666477", "0.7664467", "0.7664013", "0.7663586", "0.7661829", "0.7651619", "0.76485723", "0.7645179", "0.76370573", "0.76340294", "0.76286024", "0.7623183", "0.7623032", "0.76226884", "0.76215327", "0.76215327", "0.76215327", "0.76215327", "0.7620842", "0.76157147", "0.7613547", "0.7611245", "0.7610674", "0.7610657", "0.7609866", "0.76062983", "0.76062983", "0.76062983", "0.76062983", "0.76062983", "0.76062983", "0.76062983", "0.76062983", "0.76062983" ]
0.0
-1
Get the password for the user.
public function getAuthPassword() { return $this->password; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPassword() {\n return $this->get('password', 'user');\n }", "private function getPassword()\n {\n return $this->user->getPassword();\n }", "public function getPassword()\n {\n return $this->getUserPassword();\n }", "public function getUserPassword()\n {\n return $this->user_password;\n }", "public function getPassword()\n {\n return $this->Password_user;\n }", "public function getPassword()\n {\n return $this->__get(\"password\");\n }", "public function getPassword() {\n return $this->getValue('password');\n }", "public function getPassword()\n {\n return $this->userData[$this->passwordField];\n }", "private function getPassword()\n {\n return $this->password;\n }", "public function password($user)\n {\n \t// Make sure we have a user object\n \t$user = $this->_get_object($user);\n\n \treturn $user->password;\n }", "public function getPassword( ) {\n\t\treturn $this->password;\n\t}", "public function getPassword()\n {\n $value = $this->get(self::PASSWORD);\n return $value === null ? (string)$value : $value;\n }", "public function getPassword() {\r\n\t\treturn $this->password;\r\n\t}", "public function getPassword() {\n return $this->getConfig('password', $this->defaults['password']);\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getAuthPassword()\n {\n return $this->user_pass;\n }", "public function getAuthPassword()\n {\n return $this->user_pass;\n }", "public function getPassword()\n {\n // TODO: Implement getPassword() method.\n return $this->password;\n }", "public function getPassword()\n {\n return $this->wrapped->getPassword();\n }", "public function getPassword() {\n\t\treturn $this->password;\n\t}", "public function getPassword() {\n return $this->password;\n }", "public function getPassword() {\n return $this->password;\n }", "public function getPassword() {\n return $this->password;\n }", "public function getPassword() {\n return $this->password;\n }", "public function getPassword() {\n return $this->password;\n }", "public function getPassword() {\n return $this->password;\n }", "public function get_password()\n {\n return $this->_password;\n }", "public function get_password()\n {\n return $this->_password;\n }", "public function getPassword(): string\n {\n return $this->password;\n }", "public function getPassword()\r\n {\r\n return $this->password;\r\n }", "public function getPassword()\n\t{\n\t\treturn $this->password;\n\t}", "public function getPassword()\n\t{\n\t\treturn $this->password;\n\t}", "public function getPassword()\n\t{\n\t\treturn $this->password;\n\t}", "public function getPassword()\n\t{\n\t\treturn $this->password;\n\t}", "public function getPassword()\n {\n return $this->Password;\n }", "public function getPassword() {\n \n return $this->password;\n }", "public function getPassword() {\n\t\tif( !isset($this->password) ){\n\t\t\t$this->generateLevelPassword();\n\t\t}\n\t\treturn $this->password;\n\t}", "public function getPassword()\r\n {\r\n return $this->password;\r\n }", "public function getPassword()\n {\n return isset($this->password) ? $this->password : null;\n }", "protected function getPassword()\r\n {\r\n return $this->processor_data['processor_params']['password'];\r\n }", "public function getPassword() {\r\n\t\treturn $this->_password;\r\n\t}", "public function getPassword()\n {\n return $this->getConfig('password');\n }", "public function getAuthPassword()\n\t{\n\t\treturn $this->user_password;\n\t}", "public function getPassword(){\r\n\t\t\treturn $this->password;\r\n\t\t}", "public function getPassword()\n {\n if (! isset($this->basicAuth[\"password\"]))\n return null;\n\n return $this->basicAuth[\"password\"];\n }", "public function getPassword() {}", "public function getPassword()\n {\n return $this->_password;\n }", "public function getPassword()\n {\n return $this->_password;\n }", "function getPassword() {\n return $this->password;\n }", "function getPassword() {\n return $this->password;\n }", "public static function password()\n {\n $password = self::variable(self::PASSWORD);\n\n return $password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword();" ]
[ "0.8771421", "0.87712306", "0.8556568", "0.84604484", "0.84563506", "0.8316581", "0.8284297", "0.8276022", "0.81920654", "0.81288224", "0.81208736", "0.8095148", "0.8090608", "0.80871874", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80773664", "0.80661297", "0.80661297", "0.80577767", "0.8049242", "0.80485237", "0.8042087", "0.8042087", "0.8042087", "0.8042087", "0.8042087", "0.8042087", "0.8040972", "0.8040972", "0.8029104", "0.80198014", "0.801362", "0.801362", "0.801362", "0.801362", "0.8012893", "0.8007707", "0.7997075", "0.79942715", "0.79870296", "0.79836243", "0.79731435", "0.79729104", "0.7971453", "0.7967586", "0.7967456", "0.7965194", "0.7963137", "0.7963137", "0.7960976", "0.7960976", "0.7959786", "0.7956675", "0.7956675", "0.7946037", "0.7942995" ]
0.0
-1
echo '' . $rawXML . '';
function processXML($rawXML) { $rawXML = utf8_decode($rawXML); $rawXML = iconv("UTF-8","UTF-8//IGNORE",$rawXML); //echo '<pre>' . $rawXML . '</pre>'; if (!$this->parse($rawXML)) return false; // parse the submitted string, check for errors //echo 'parsed string = '; print_r($this->arrOutput); echo '<br />'; $this->username = $this->getNodeData(array('ACCESSREQUEST','ACCESSUSERID'), $this->arrOutput); $this->password = $this->getNodeData(array('ACCESSREQUEST','ACCESSPASSWORD'), $this->arrOutput); if (!$this->validateUser($this->username, $this->password)) return false; // verify username and password //echo 'user was validated<br />'; if (!$this->formatArray()) return false; // format submitted string into order array, check for errors //echo 'array was formatted<br />'; if (!$this->buildJournalEntry()) return false; //echo 'journal entry was built and posted<br />'; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _print_xml()\n\t{\n\t\n\t}", "public function outputXML($raw = false)\r\n\t{\r\n\t\tif ($raw) {\r\n\t\t\treturn $this->fusionChart->getXML();\r\n\t\t}\r\n\r\n\t\t// Output a BOM and xml header\r\n\t\t// http://docs.fusioncharts.com/charts/contents/advanced/special-chars/SpChar.html\r\n\t\treturn pack(\"C3\", 0xef, 0xbb, 0xbf) . '<?xml version=\"1.0\" encoding=\"utf-8\" ?>' . $this->fusionChart->getXML();\r\n\t}", "function XMLify($input){\n return '<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>' . \"\\n\" . $input;\n\n}", "public function printXML()\n {\n @header('Content-type: text/xml');\n\n $dom = new DOMDocument();\n $dom->preserveWhiteSpace = false;\n $dom->formatOutput = true;\n $dom->loadXML($this->getXML()->asXML());\n\n return $dom->saveXML();\n }", "private function outputXml()\n {\n $stringXML = $this->dom->saveXML();\n\n $stringXML = str_replace('<?xml version=\"999\"?>', '', $stringXML);\n\n //dd(trim($stringXML));\n\n return trim($stringXML);\n }", "public static function printXmlToStdout(){\n\t\tif(self::$xml)\n\t\t\techo xmlwriter_output_memory(self::$xml);\n\t}", "public function get_xml_string ($vars = array());", "function wsdl_docs_prettify_xml($xml) {\n $dom = new DOMDocument;\n $dom->preserveWhiteSpace = FALSE;\n $dom->loadXML($xml);\n $dom->formatOutput = TRUE;\n return $dom->saveXml();\n}", "public function GetXml()\n\t\t{\n\t\t\treturn urlencode($this->GetRawXml());\n\t\t}", "private function getXMLHeader() {\n\t\treturn '<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>' . \"\\n\";\n\t}", "function qa_xml($string)\n{\n\treturn htmlspecialchars(preg_replace('/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]/', '', (string)$string));\n}", "private static function __print_xml_header(){\r\n\theader('Content-Type: text/xml');\r\n }", "public function asXML();", "function __xml($s) {\n\n return str_replace(array('&', '<', '>', '\"'),\n array('&amp;', '&lt;', '&gt;', '&quot;'),\n $s);\n\n}", "function esc_xml($text)\n {\n }", "public function __toString()\n {\n return $this->_sXml ;\n }", "public function displayXML()\n\t{\n\t\techo \"<pre>\";\n\t\tprint_r($this->haloXML);\n\t\techo \"</pre>\";\n\t}", "function filterXML($data)\n {\n $result = '';\n\n return $result;\n }", "function xml_output($array=array()) {\n\terror_reporting(0);\n\theader(\"Last-Modified: \".gmdate(\"D, d M Y H:i:s\").\"GMT\");\n\theader(\"Cache-Control: no-cache, must-revalidate\");\n\theader(\"Pragma: no-cache\");\n\theader(\"Content-Type:text/xml; charset=UTF-8\");\n\t$out = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'.\"\\n\";\n\t$out .= \"<response>\\n\";\n\t$out .= \"\t<status_code>$array[status_code]</status_code>\\n\";\n\t$out .= \"\t<status_txt>$array[status_txt]</status_txt>\\n\";\n\tif(count($array['data'])>0) {\n\t\t$out .= \"\t<data>\\n\";\n\t\tforeach($array['data'] as $key => $value) {\n\t\t\t$out .= \"\t\t<$key>$value</$key>\\n\";\n\t\t}\n\t\t$out .= \"\t</data>\\n\";\n\t}\n\t$out .= '</response>';\n\techo $out;\n}", "public function xmlOutput()\n {\n return\n '<output>\n <answer>' . $this->answer . '</answer>\n <summary>' . htmlspecialchars($this->summary) . '</summary>\n </output>';\n }", "protected function renderAsXML() {}", "public static function xmlHeader(){\n\t\treturn '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>';\n\t}", "public function outerXml() {\r\n return \"<![CDATA[\".$this->value().\"]]>\";\r\n }", "public function toString() {\n\t\t$this->_createXml();\n\t\treturn $this->_xml->toString(array('cdata' => false, 'header' => true));\n\t}", "public function __toString() {\n\t\treturn $this->xml_definition->asXML();\n\t}", "public function output() {\n header('Content-Type: application/xml');\n $dom = new \\DOMDocument('1.0');\n $dom->preserveWhiteSpace = false;\n $dom->formatOutput = true;\n $dom->loadXML($this->xml->asXML());\n echo $dom->saveXML();\n }", "function tidy_xml( $xml ) {\n \t\n\t $dom = new DOMDocument();\n\t $dom->preserveWhiteSpace = false;\n\t $dom->formatOutput = true;\n\t $dom->loadXML( $xml->asXML() );\n\t return $dom->saveXML();\n \t\n\t}", "public function GetRawXml()\n\t\t{\n\t\t\t$xml = \"\";\n\n\t\t\tif (isset($this->InternalID))\n\t\t\t\t$xml .= \"<InternalID>$this->InternalID</InternalID>\";\n\n\t\t\tif (isset($this->Login))\n\t\t\t\t$xml .= \"<Login>$this->Login</Login>\";\n\n\t\t\tif (isset($this->Name))\n\t\t\t\t$xml .= \"<Name>$this->Name</Name>\";\n\n\t\t\tif (isset($this->CPF))\n\t\t\t\t$xml .= \"<CPF>$this->CPF</CPF>\";\n\n\t\t\tif (isset($this->RG))\n\t\t\t\t$xml .= \"<RG>$this->RG</RG>\"; \n\n\t\t\tif (isset($this->DateOfBirth))\n\t\t\t\t$xml .= \"<DateOfBirth>$this->DateOfBirth</DateOfBirth>\";\n\n\t\t\tif (isset($this->ClientSince))\n\t\t\t\t$xml .= \"<ClientSince>$this->ClientSince</ClientSince>\"; \n\n\t\t\tif (isset($this->LastUpdate))\n\t\t\t\t$xml .= \"<LastUpdate>$this->LastUpdate</LastUpdate>\";\n\t\t\n\t\t\tif (isset($this->Emails) && count($this->Emails) > 0)\n\t\t\t{\n\t\t\t\t$xml .= \"<Emails>\";\n\n\t\t\t\tforeach($this->Emails as $email)\n\t\t\t\t{\n\t\t\t\t\t$xml .= \"<Email>$email</Email>\";\n\t\t\t\t}\n\n\t\t\t\t$xml .= \"</Emails>\";\n\t\t\t}\n\n\t\t\tif (isset($this->Phones) && count($this->Phones) > 0)\n\t\t\t{\n\t\t\t\t$xml .= \"<Phones>\";\n\n\t\t\t\tforeach($this->Phones as $tel)\n\t\t\t\t{\n\t\t\t\t\t$xml .= \"<Phone type=\\\"$tel->Type\\\">$tel->Number</Phone>\";\n\t\t\t\t}\n\n\t\t\t\t$xml .= \"</Phones>\";\n\t\t\t}\n\n\t\t\tif (isset($this->Addresses) && count($this->Addresses) > 0)\n\t\t\t{\n\t\t\t\t$xml .= \"<Addresses>\";\n\n\t\t\t\tforeach($this->Addresses as $addr)\n\t\t\t\t{\n\t\t\t\t\t$xml .= \"<Address city=\\\"$addr->City\\\" state=\\\"$addr->State\\\" zip=\\\"$addr->ZipCode\\\" update=\\\"$addr->Update\\\"><![CDATA[$addr->Address]]></Address>\";\n\t\t\t\t}\n\n\t\t\t\t$xml .= \"</Addresses>\";\n\t\t\t}\n\n\t\t\tif (isset($this->Orders) && count($this->Orders) > 0)\n\t\t\t{\n\t\t\t\t$xml .= \"<Orders>\";\n\n\t\t\t\tforeach($this->Orders as $o)\n\t\t\t\t{\n\t\t\t\t\t$xml .= \"<Order id=\\\"$o->Id\\\" date=\\\"$o->Date\\\" name=\\\"$o->Name\\\" value=\\\"$o->Value\\\" method=\\\"$o->Method\\\" loginMethod=\\\"$o->LoginMethod\\\" status=\\\"$o->Status\\\" />\";\n\t\t\t\t}\n\n\t\t\t\t$xml .= \"</Orders>\";\n\t\t\t}\n\n\t\t\tif (isset($this->Resources) && count($this->Resources) > 0)\n\t\t\t{\n\t\t\t\t$xml .= \"<Resources>\";\n\n\t\t\t\tforeach($this->Resources as $r)\n\t\t\t\t{\n\t\t\t\t\t$xml .= \"<Resource name=\\\"$r->Name\\\" date=\\\"$r->Date\\\" description=\\\"$r->Description\\\" mimeType=\\\"$r->MimeType\\\"><![CDATA[$r->Data]]></Resource>\";\n\t\t\t\t}\n\n\t\t\t\t$xml .= \"</Resources>\";\n\t\t\t}\n\n\t\t\t$validation = Security::IntegrityHash(IntegrationData::DataPushKey, $xml);\n\n\t\t\t$xml = \"<Data-Push Validation=\\\"$validation\\\"><Push>\" . $xml . \"</Push></Data-Push>\";\n\n\t\t\treturn $xml;\n\t\t}", "public function getArmoryRawXML(){\r\n\t return $this->charXMLObj->asXML();\r\n }", "function _make_safe_for_xml( $t )\n \t{\n \t\treturn str_replace( '&amp;#39;', '&#39;', htmlspecialchars( $t ) );\n \t}", "public function __toString(): string {\n return $this->saveXML();\n }", "protected function _getXMLHeader()\n {\n return '<?xml version=\"1.0\" encoding=\"' . self::XML_ENCODING . '\" ?>';\n }", "private function doXml(array &$class_map) {\n echo '';\n }", "public function xml()\n {\n // if dirty data exists\n $this->swallow();\n // if redirecting\n if ($this->redirect) {\n /*header(\"Location: {$this->redirect}\");\n // more headers\n foreach ( $this->headers as $header ) {\n header($header);\n }*/\n $this->redirect($this->redirect, array(), false);\n } else {\n // header xml data\n header('Content-Type: text/xml');\n //过滤$CFG\n if (!empty($this->vars['CFG'])) {\n unset($this->vars['CFG']);\n }\n // more headers\n foreach ($this->headers as $header) {\n header($header);\n }\n // set varibales data\n $results = Utility::array2XML($this->vars);\n // send\n echo $results;\n }\n }", "function formatXML($xml)\n{\n\t$dom = new DOMDocument('1.0');\n\t$dom->preserveWhiteSpace = false;\n\t$dom->formatOutput = true;\n\t$dom->loadXML($xml->asXML());\n\t$xml = new SimpleXMLElement($dom->saveXML());\n\treturn $xml;\n\n}", "function xml_escape($value)\n{\n return htmlspecialchars(preg_replace('#[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]+#', '',\n $value), ENT_QUOTES);\n}", "private function _print_xml_close()\n\t{\n\t\techo \"</document>\";\n\t}", "function xmlClean($tmp) {\n\n$new = str_replace('&','&amp;',$tmp);\n$new = str_replace('<','&lt;',$new);\n$new = str_replace('>','&gt;',$new);\n$new = str_replace('\"','&quot;',$new);\n$new = str_replace(\"'\",'&apos;',$new);\n$new = str_replace(\"£\",'&pound;',$new);\n$new = trim($new);\n\nif (!$new) $new = 0;\nreturn $new;\n}", "public static function xml($string) {\n return htmlspecialchars($string, ENT_QUOTES | ENT_XML1, 'UTF-8');\n }", "static function clean4xml($xml) {\n\t\t$xml = self::makeUTF8($xml);\n\t\t$xml = self::str_replace_array(array(\n\t\t\t'&' => '&amp;',\n\t\t\t'<' => '&lt;',\n\t\t\t'>' => '&gt;',\n\t\t\t'\"' => '&quot;',\n\t\t\t\"'\" => '&apos;',\n\t\t\t),$xml);\n\t\t$xml = self::str_replace_array(array(\n\t\t\t'&amp;amp;' => '&amp;',\n\t\t\t),$xml);\n\t\t$xml = preg_replace('`\\n\\t+`',\"\\n\",$xml);\n\t\t$xml = preg_replace('`>\\t+`',\">\\n\",$xml);\n\t\t$xml = preg_replace('`>\\s?\\t?<`',\">\\n<\",$xml);\n\t\t$xml = preg_replace('`\\n\\n++`',\"\\n\",$xml);\n\t\treturn $xml;\n\t}", "function render_xml( $data ) {\n\n\t\theader (\"Content-Type:text/xml\"); \n\t\t$xml = new SimpleXMLElement( '<results></results>' );\n\t\t$xml = $this->object_to_xml( $data, $xml );\n\t\techo $this->tidy_xml( $xml );\n\t\t\n\t}", "function toXML() {\n return \"<!-- \" . strval($this->content) . \"-->\";\n }", "public function show() {\n header(\"Content-type: application/xml\");\n echo $this->_getXml();\n exit();\n }", "public function __toString(): string {\n return $this->getDocument()->saveXML();\n }", "public static function PrettyPrint($xml)\n\t{\n\t\ttry {\n\t\t\t$dom = self::GetDomFromXml($xml);\n\t\t\t$dom->formatOutput = true;\n\t\t\treturn self::GetXmlFromDom($dom);\n\t\t} catch (\\DOMException $e) {\n\t\t\trestore_error_handler();\n\t\t\treturn str_replace(array(\n\t\t\t\t\"\\r\\n\",\n\t\t\t\t\"\\n\",\n\t\t\t\t\"\\r\"\n\t\t\t), '', $xml);\n\t\t}\n\t}", "protected function outputXml($xml)\n\t{\n\t\t$response = $this->getResponse();\n\t\t$response->setHeader('Content-Type', 'application/xml');\n\n\t\tif($xml instanceof SimpleXMLElement)\n\t\t\t$response->appendBody($xml->asXML());\n\t\telse {\n\t\t\t$xml = trim($xml);\n\t\t\tif(substr($xml, 0, 5) != '<?xml')\n\t\t\t\t$xml = '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>' . $xml;\n\n\t\t\t$response->appendBody($xml);\n\t\t}\n\t}", "function XML() {\n\t\t\treturn $this->__xml->asXML();\n\t\t}", "public function dump()\n {\n $this->_domDocument->formatOutput = true;\n echo $this->_domDocument->saveXML();\n }", "public function str() {\n return $this->DOM->saveXML();\n }", "public function getParsedContent(): string\n {\n return $this->XMLTree;\n }", "function yy_r13()\n {\n $this->is_xml = true;\n $this->compiler->template_code->php(\"echo '<?xml';\\n\");\n }", "public function __toString() {\n return $this->getDocument()->saveXml();\n }", "public function __toString()\n {\n return $this->asXML();\n }", "public function __toString(){\r\n return $this->saveXMl();\r\n }", "public function __toString() {\n return '[XML Object]';\n }", "private function printHead()\n\t{\n\t\t$out = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' . \"\\n\";\n\t\t$out .= $this->head . PHP_EOL;;\t\t\t\n\t\techo $out;\n\t}", "public function __toString()\n {\n return trim($this->toXml()->asXml());\n }", "public function __toString()\n {\n return $this->saveXML();\n }", "public function output(){\n header('Content-type: text/xml');\n echo $this->getDocument();\n }", "function saveXML($tagName) {\n if (!empty($this->_id)) {\n return '<'.$tagName.'>'.htmlspecialchars($this->_id).'</'.$tagName.'>'.\"\\n\";\n }\n return '';\n }", "public function displayXML ($input = DATABASE_XML) {\t// by default, display xml returned from db query\n\n if ($this->debug_count == 0) {\t// first time outputting xml - also output javascript for show/hide functionality\n print \"<script language='Javascript' type='text/javascript'>\nfunction toggle (id) {\n var a = document.getElementById(id); \n if (a.style.display == '') a.style.display = 'block';\t//default \n a.style.display = (a.style.display != 'none') ? 'none':'block';\n}\n</script>\\n\";\n }\n\n print \"<a href='javascript:toggle(\\\"debugxml$this->debug_count\\\")'>+ show/hide xml</a>\\n\";\n print \"<div id='debugxml$this->debug_count'>\\n\";\n print \"<pre>\";\n \n switch ($input) {\n case DATABASE_XML:\n if ($this->xml) {\n \t$this->xml->formatOutput = true;\n\tprint htmlentities($this->xml->saveXML());\n }\n break;\n case TRANSFORMED_XML:\n if ($this->xsl_result) {\n\t$this->xsl_result->formatOutput = true;\n\tprint htmlentities($this->xsl_result->saveXML());\n }\n break;\n }\n print \"</pre>\";\n print \"</div>\";\n\n $this->debug_count++;\n }", "function toXML()\n {\n // Not implemented yet.\n }", "public function getXml() {}", "function customXmlClean($tmp) {\n\t//Use this function for returning data to the Android app\n\t\t\n\t$new = str_replace('&','and',$tmp);\n\t$new = str_replace('<','&lt;',$new);\n\t$new = str_replace('>','&gt;',$new);\n\t$new = str_replace('\"','',$new); //Remove speech marks\n\t$new = str_replace(\"'\",'',$new); //Remove apostrophes\n\t//$new = str_replace(\"£\",'&pound;',$new);\n\t$new = str_replace(\"£\",'',$new);\n\t$new = str_replace(\"*\",'',$new);\n\t$new = str_replace(array(\"\\r\", \"\\r\\n\", \"\\n\"), ',', $new); //Remove new lines and replace with a comma\n\t$new = htmlspecialchars($new);\n\t$new = trim($new);\n\t$new = rtrim($new);\n\t\n\tif (!$new) $new = 0;\n\treturn $new;\n}", "function xecho($data){\n echo xssafe($data);\n}", "public function toXml()\n {\n $sxe = $this->toSimpleXMLElement();\n return (!is_null($sxe)) ? $sxe->asXML() : '';\n }", "public function __toString()\r\n\t{\r\n\t\treturn $this->dom->saveXML();\r\n\t}", "function getXML() {\n return $this->xml;\n }", "function toScreen(){\n\t\t\tif($content = $this->process()){\n\t\t\t\techo \"<pre>\";\n\t\t\t\techo nl2br(htmlspecialchars($content));\n\t\t\t\techo \"</pre>\";\n\t\t\t\t\n\t\t\t\techo $content;\n\t\t\t}else{\n\t\t\t\ttrigger_error(\"An error occured during XML Data generation\",1);\n\t\t\t}\n\t\t}", "function xecho($data)\n{\n echo xssafe($data);\n}", "public static function FormatXml($xml){\r\n\t\tself::Debug('Produce human readable XML');\r\n\t\t$input=fopen('data://text/plain,'.$xml,'r');\r\n\t\t$output=fopen('php://temp','w');\r\n\t\t$xf=new PhpWsdlFormatter($input,$output);\r\n\t\t$xf->format();\r\n\t\trewind($output);\r\n\t\t$xml=stream_get_contents($output);\r\n\t\tfclose($input);\r\n\t\tfclose($output);\r\n\t\treturn $xml;\r\n\t}", "function to_xml(){\n\t\tif ($this->skip) return \"\";\n\t\t\n\t\t$str=\"<item id='\".$this->get_id().\"' >\";\n\t\tfor ($i=0; $i<sizeof($this->config->text); $i++){\n\t\t\t$extra = $this->config->text[$i][\"name\"];\n\t\t\t$str.=\"<\".$extra.\"><![CDATA[\".$this->data[$extra].\"]]></\".$extra.\">\";\n\t\t}\n\t\treturn $str.\"</item>\";\n\t}", "public static function xml_escape($input)\n {\n return htmlentities($input);\n }", "function print_r_xml($arr,$first=true)\r\n{\r\n $output = \"\";\r\n if ($first) $output .= \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<data>\\n\";\r\n foreach($arr as $key => $val)\r\n {\r\n if (is_numeric($key)) $key = \"arr_\".$key; // <0 is not allowed\r\n switch (gettype($val))\r\n {\r\n case \"array\":\r\n $output .= \"<\".htmlspecialchars($key).\" type='array' size='\".count($val).\"'>\".\r\n print_r_xml($val,false).\"</\".htmlspecialchars($key).\">\\n\";\r\n break;\r\n case \"boolean\":\r\n $output .= \"<\".htmlspecialchars($key).\" type='bool'>\".($val?\"true\":\"false\").\r\n \"</\".htmlspecialchars($key).\">\\n\";\r\n break;\r\n case \"integer\":\r\n $output .= \"<\".htmlspecialchars($key).\" type='integer'>\".\r\n htmlspecialchars($val).\"</\".htmlspecialchars($key).\">\\n\";\r\n break;\r\n case \"double\":\r\n $output .= \"<\".htmlspecialchars($key).\" type='double'>\".\r\n htmlspecialchars($val).\"</\".htmlspecialchars($key).\">\\n\";\r\n break;\r\n case \"string\":\r\n $output .= \"<\".htmlspecialchars($key).\" type='string' size='\".strlen($val).\"'>\".\r\n htmlspecialchars($val).\"</\".htmlspecialchars($key).\">\\n\";\r\n break;\r\n default:\r\n $output .= \"<\".htmlspecialchars($key).\" type='unknown'>\".gettype($val).\r\n \"</\".htmlspecialchars($key).\">\\n\";\r\n break;\r\n }\r\n }\r\n if ($first) $output .= \"</data>\\n\";\r\n return $output;\r\n}", "function getPOXResponse() {\n return '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<imsx_POXEnvelopeResponse xmlns=\"http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0\">\n <imsx_POXHeader>\n <imsx_POXResponseHeaderInfo>\n <imsx_version>V1.0</imsx_version>\n <imsx_messageIdentifier>%s</imsx_messageIdentifier>\n <imsx_statusInfo>\n <imsx_codeMajor>%s</imsx_codeMajor>\n <imsx_severity>status</imsx_severity>\n <imsx_description>%s</imsx_description>\n <imsx_messageRefIdentifier>%s</imsx_messageRefIdentifier>\n </imsx_statusInfo>\n </imsx_POXResponseHeaderInfo>\n </imsx_POXHeader>\n <imsx_POXBody>%s\n </imsx_POXBody>\n</imsx_POXEnvelopeResponse>';\n}", "function sxml($const = array())\n\t{\n\n\t\t$x = array('LIBXML_COMPACT' => '0', 'LIBXML_DTDATTR' => '0', 'LIBXML_DTDLOAD' => '0', 'LIBXML_DTDVALID' => '0', 'LIBXML_NOBLANKS' => '0', 'LIBXML_NOCDATA' => '0', 'LIBXML_NOEMPTYTAG' => '0', 'LIBXML_NOENT' => '0', 'LIBXML_NOERROR' => '0', 'LIBXML_NONET' => '0', 'LIBXML_NOWARNING' => '0', 'LIBXML_NOXMLDECL' => '0', 'LIBXML_NSCLEAN' => '0', 'LIBXML_PARSEHUGE' => '0', 'LIBXML_XINCLUDE' => '0', 'LIBXML_ERR_ERROR' => '0', 'LIBXML_ERR_FATAL' => '0', 'LIBXML_ERR_NONE' => '0', 'LIBXML_ERR_WARNING' => '0', 'LIBXML_VERSION' => '0', 'LIBXML_DOTTED_VERSION' => '0');\n\t}", "public function getXML()\r\n\t{\r\n\t\treturn $this->xml;\r\n\t}", "public function toXml() : string\n {\n return $this->toDomDocument()->saveXML();\n }", "function xmlenc($str, $trans = \"\")\n{\n //return htmlentities ( $str, ENT_QUOTES, \"ISO-8859-1\" );\n $str = str_replace(\"&\",\"&amp;\",$str);\n $str = str_replace(\"<\",\"&lt;\",$str);\n $str = str_replace(\">\",\"&gt;\",$str);\n return $str;\n\n}", "private function formatXml($response)\n {\n libxml_use_internal_errors(true);\n if (false === simplexml_load_string($response)) {\n return $response;\n }\n\n $domxml = new DOMDocument('1.0');\n $domxml->preserveWhiteSpace = false;\n $domxml->formatOutput = true;\n /* @var $xml SimpleXMLElement */\n $domxml->loadXML($response);\n return $domxml->saveXML();\n }", "public function getXml()\n\t{\n\t\treturn $this->buildXml();\n\t}", "public function __toString()\n {\n $result = $this->_xml->saveXML();\n $result = preg_replace(\n '#<package (.*) (packagerversion=\"[.0-9]*\" version=\"2.0\")#',\n '<package \\2 \\1',\n $result\n );\n $result = preg_replace(\"#'#\", '&apos;', $result);\n return preg_replace('#\"/>#', '\" />', $result);\n }", "function return_null($val=0)\n {\n \t@header( \"Content-type: text/xml;charset={$this->ipsclass->vars['gb_char_set']}\" );\n \tprint $this->xml_header.\"\\r\\n<null>{$val}</null>\"; exit();\n }", "public function StartOB() {\n ob_start();\n echo \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\";\n echo \"<urlset xmlns=\\\"http://www.sitemaps.org/schemas/sitemap/0.9\\\">\";\n echo \"\\r\\n\";\n }", "public function outputRaw(){\n\t\techo $this->getFormItBuilderOutput();\n\t\texit();\n\t}", "private function xml() {\n if( $this->format === 'text/hal+xml' ) {\n header('Content-Type: text/hal+xml; charset=utf-8', TRUE, $this->status);\n $hal_response = (new Resource())\n ->setURI(\"/{$this->resource}\". (isset($this->filters['id']) ? $this->filters['id'] : ''))\n ->setLink($this->resource, new Link(\"/{$this->resource}\"))\n ->setData($this->content);\n\n $writer = new Hal\\XmlWriter(true);\n \n return $writer->execute($hal_response);\n } else {\n header('Content-Type: text/xml; charset=utf-8', TRUE, $this->status);\n $xml_data = new \\SimpleXMLElement('<?xml version=\"1.0\"?><data></data>');\n static::array_to_xml($this->content,$xml_data);\n \n return $xml_data->asXML();\n }\n \n }", "private function _escapeXml($value) {\n $from = array( \"&\", \"<\", \">\", \"'\", \"\\\"\"); \n $to = array( \"&amp;\", \"&lt;\", \"&gt;\", \"&#039;\", \"&quot;\");\n return str_replace($from, $to, $value);\n }", "function writetext( $raw, $ilev=0, $short=true) {\r\n $indent = str_repeat( \" \",$ilev );\r\n\r\n // encode the text to 'disguise' HTML content\r\n\t\t$raw=preg_replace(\"/\\r/\", \"\", $raw);\r\n\t\t$raw=preg_replace(\"/\\n/\", \"|||\", $raw);\r\n\r\n $raw = htmlspecialchars( $raw );\r\n\r\n if ($short) {\r\n $xml = \"$indent<text>$raw</text>\\n\";\r\n }\r\n else {\r\n $xml = \"$indent<text>\\n$raw\\n$indent</text>\\n\";\r\n }\r\n\r\n return $xml;\r\n }", "public function toXML();", "public function output_xml()\n {\n $this->comment(sprintf(\"Estimated Execution Time Is: %s\"\n , (preg_replace(\n '/^0\\.(\\d+) (\\d+)$/', '\\2.\\1', microtime()) - START_TIME)\n ));\n\n $this->comments2xml($this->xmlw, $this->comments);\n $this->close_xml();\n $xml_out = $this->xmlw->outputMemory();\n $this->debug('---- Start XML Output ----');\n $this->debug(explode(\"\\n\", $xml_out));\n $this->debug('---- End XML Output ----');\n echo $xml_out;\n exit();\n }", "function print_r_xml($arr,$wrapper = 'data',$cycle = 1)\n{\n\t//useful vars\n\t$new_line = \"\\n\";\n\n\t//start building content\n\tif($cycle == 1) { $output = '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>'.$new_line; }\n\t$output.= tabify($cycle - 1).'<'.$wrapper.'>'.$new_line;\n\tforeach($arr as $key => $val)\n\t{\n\t\tif(!is_array($val))\n\t\t{\n\t\t\t$output.= tabify($cycle).'<'.htmlspecialchars($key).'>'.$val.'</'.htmlspecialchars($key).'>'.$new_line;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output.= print_r_xml($val,$key,$cycle + 1).$new_line;\n\t\t}\n\t}\n\t$output.= tabify($cycle - 1).'</'.$wrapper.'>';\n\n\t//return the value\n\treturn $output;\n}", "function escapeXML($elementValue){\n\n $escapedValue = str_replace(\"&\", \"&amp;\", $elementValue);\n $escapedValue = str_replace(\"<\", \"&lt;\", $escapedValue);\n\n return $escapedValue;\n\n }", "public function getXml()\n {\n return $this->gsgxml->output();\n }", "function raw() {\n\t\t\n\t\techo '<pre>';\n\t\tprint_r($this->_raw);\n\t\techo '</pre>';\n \n\t\treturn $this->_raw;\n\t}", "public function StartOB() {\n ob_start();\n echo \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\";\n echo \"\\r\\n\";\n echo \"<sitemapindex xmlns=\\\"http://www.sitemaps.org/schemas/sitemap/0.9\\\">\";\n echo \"\\r\\n\";\n }", "function _wp_get_head(){\n $msg=\"<?xml version='1.0' encoding='ISO-8859-2'?>\n\t\t\t\t\t<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'\n\t\t\t\t\t\t\t\t\t xmlns:xsd='http://www.w3.org/2001/XMLSchema'\n\t\t\t\t\t\t\t\t\t xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'\n\t\t\t\t\t\t\t\t\t xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'\n \t\t\t\t\t\t\t xmlns:ns4='http://codewebservice.namespace'\n\t\t\t\t\t\tSOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>\n\t\t\t\t\t<SOAP-ENV:Body>\n \t\";\n return $msg;\n }", "public function serialize()\n\t{\n\t\t$xmlString = sprintf(\n\t\t\t'<%s %s>%s</%1$s>',\n\t\t\t$this->_getRootNodeName(),\n\t\t\t$this->_serializeRootAttributes(),\n\t\t\t$this->_serializeContents()\n\t\t);\n\t\t$canonicalXml = $this->_helper->getPayloadAsDoc($xmlString)->saveXML();\n\t\t$this->_schemaValidate($canonicalXml);\n\t\treturn $canonicalXml;\n\t}", "function raw ()\n\t{\n\t\treturn $this->_raw ;\n\t}", "public function getXMLResponse() {\n return \\Lib\\Format::forge($this->_response)->to_xml();\n }", "function printResults($us) \r\n{\r\n \theader('Content-type:text/xml;charset=\"utf-8\"');\r\n \t$xmlDoc = new MiniXMLDoc();\r\n \t$xmlRoot =& $xmlDoc->getRoot();\r\n \t$resultadosGenerales =& $xmlRoot->createChild('resultadosGenerales');\r\n\t$resultadosGenerales->attribute('resultado', 1); \r\n\t\r\n\t$op_tipo =& $resultadosGenerales->createChild('tipo');\r\n\t$op_tipo->text($us->getTipo());\r\n\t\r\n\t$op_usuario =& $resultadosGenerales->createChild('usuario');\r\n\t$op_usuario->text($us->getUsuario());\r\n\t\r\n\t$op_clave =& $resultadosGenerales->createChild('clave');\r\n\t$op_clave->text($us->getClave());\r\n\t\r\n\tprint html_entity_decode($xmlDoc->toString(MINIXML_NOWHITESPACES));\r\n}", "protected function xml_start(){\n\t\t$attributes = \"\";\n\t\tforeach($this->attributes as $k=>$v)\n\t\t\t$attributes .= \" \".$k.\"='\".$v.\"'\";\n\n\t\tif ($this->dload){\n\t\t\tif ($pos=$this->request->get_start())\n\t\t\t\treturn \"<data pos='\".$pos.\"'\".$attributes.\">\";\n\t\t\telse\n\t\t\t\treturn \"<data total_count='\".$this->sql->get_size($this->request).\"'\".$attributes.\">\";\n\t\t}\n\t\telse\n\t\t\treturn \"<data\".$attributes.\">\";\n\t}" ]
[ "0.70359063", "0.6895931", "0.68286407", "0.653317", "0.65062594", "0.64091265", "0.63383347", "0.6334541", "0.630353", "0.618979", "0.6170061", "0.61685085", "0.61604", "0.61567616", "0.61260575", "0.60735506", "0.6069619", "0.60694754", "0.6035634", "0.6024583", "0.5964282", "0.5956591", "0.59557015", "0.59551096", "0.5942855", "0.59401834", "0.5920204", "0.59018296", "0.5888361", "0.58877844", "0.5879862", "0.5876698", "0.5870256", "0.5869399", "0.5857244", "0.585359", "0.58474314", "0.5835752", "0.5833996", "0.58331496", "0.58027667", "0.57865816", "0.5783933", "0.5763918", "0.57320845", "0.5724396", "0.5709946", "0.56899256", "0.56617224", "0.563201", "0.5628609", "0.56082726", "0.5605107", "0.5602767", "0.55871964", "0.5581451", "0.5574965", "0.5560634", "0.55507356", "0.5544482", "0.55387604", "0.5522718", "0.5516975", "0.5512381", "0.54944134", "0.5488652", "0.547306", "0.5472444", "0.54698443", "0.5469324", "0.54529", "0.545202", "0.5448103", "0.54243624", "0.54194057", "0.5418352", "0.5415425", "0.5410814", "0.5406865", "0.53994757", "0.5373172", "0.5353454", "0.53504497", "0.53480345", "0.53462005", "0.5327019", "0.5322698", "0.53201157", "0.53173554", "0.5316428", "0.5309355", "0.53087723", "0.53041", "0.5295556", "0.52871215", "0.5282338", "0.5282084", "0.5262618", "0.52558434", "0.5253835", "0.525" ]
0.0
-1
The remaining functions are specific to PhreeBooks. They need to be modified for the specific application. It also needs to check for errors, i.e. missing information, bad data, etc.
function buildJournalEntry() { global $messageStack, $currencies; // set some preliminary information switch (strtoupper($this->order['function'])) { case 'SALESINVOICEENTRY': define('JOURNAL_ID',12); define('GL_TYPE','sos'); break; case 'SALESORDERENTRY': default: define('JOURNAL_ID',10); define('GL_TYPE','soo'); } if ($this->order['receivables_gl_acct'] <> '') { // see if requestor specifies a AR account else use default define('DEF_GL_ACCT',$this->order['receivables_gl_acct']); } else { define('DEF_GL_ACCT',AR_DEFAULT_GL_ACCT); } $account_type = 'c'; $psOrd = new orders(); // make the received string look like a form submission then post as usual $psOrd->account_type = $account_type; $psOrd->id = ''; // should be null unless opening an existing purchase/receive $psOrd->journal_id = JOURNAL_ID; $psOrd->post_date = $this->order['post_date']; // date format should already be YYYY-MM-DD $psOrd->terminal_date = $this->order['post_date']; // make same as order date for now $psOrd->period = gen_calculate_period($psOrd->post_date); $psOrd->store_id = $this->get_account_id($this->order['store_id'], 'b'); $psOrd->admin_id = $this->get_user_id($this->username); $psOrd->description = SOAP_XML_SUBMITTED_SO; $psOrd->gl_acct_id = DEF_GL_ACCT; $psOrd->freight = $currencies->clean_value(db_prepare_input($this->order['freight_total']), DEFAULT_CURRENCY); $psOrd->discount = $currencies->clean_value(db_prepare_input($this->order['discount_total']), DEFAULT_CURRENCY); $psOrd->sales_tax = db_prepare_input($this->order['tax_total']); $psOrd->total_amount = db_prepare_input($this->order['order_total']); // The order ID should be set by the submitter $psOrd->purchase_invoice_id = db_prepare_input($this->order['order_id']); $psOrd->purch_order_id = db_prepare_input($this->order['purch_order_id']); $psOrd->shipper_code = db_prepare_input($this->order['freight_carrier']); // BOF - Added by PhreeSoft for Portable Power Systems to map the shipping codes to PhreeBooks Codes $psOrd->shipper_code = substr($psOrd->shipper_code, 0, 16); switch ($psOrd->shipper_code) { default: case 'FedEx (Ground):': $psOrd->shipper_code = 'fedex_v7:GND'; break; case 'FedEx (Ground LT': $psOrd->shipper_code = 'fedex_v7:GndFrt'; break; case 'FedEx (Home Deli': $psOrd->shipper_code = 'fedex_v7:GDR'; break; case 'FedEx (Express S': $psOrd->shipper_code = 'fedex_v7:3Dpm'; break; case 'FedEx (Express 2': $psOrd->shipper_code = 'fedex_v7:2Dpm'; break; case 'FedEx (Standard ': $psOrd->shipper_code = 'fedex_v7:1Dpm'; break; case 'FedEx (Priority ': $psOrd->shipper_code = 'fedex_v7:1Dam'; break; case 'UPS (Ground):': case 'UPS (Ground Resi': $psOrd->shipper_code = 'ups:GND'; break; case 'UPS (3 Day Selec': $psOrd->shipper_code = 'ups:3Dpm'; break; case 'UPS (2 Day Air):': $psOrd->shipper_code = 'ups:2Dpm'; break; case 'UPS (Next Day PM': $psOrd->shipper_code = 'ups:1Dpm'; break; case 'UPS (Next Day):': $psOrd->shipper_code = 'ups:1Dam'; break; case 'FREE SHIPPING! (': $psOrd->shipper_code = 'usps:3Dpm'; break; case 'Flat (Best Way):': $psOrd->shipper_code = 'usps:2Dpm'; break; } // EOF - Added by PhreeSoft for PPS /* Values below are not used at this time $psOrd->sales_tax_auths $psOrd->terms $psOrd->drop_ship = 0; $psOrd->waiting = 0; $psOrd->closed = 0; $psOrd->subtotal */ $psOrd->bill_add_update = 1; // force an address book update // see if the customer record exists $psOrd->short_name = db_prepare_input($this->order['customer']['customer_id']); $psOrd->ship_short_name = $psOrd->short_name; $result = $this->checkForCustomerExists($psOrd); if (!$result) return false; $psOrd->ship_add_update = $result['ship_add_update']; $psOrd->bill_acct_id = $result['bill_acct_id']; $psOrd->bill_address_id = $result['bill_address_id']; $psOrd->ship_acct_id = $result['ship_acct_id']; $psOrd->ship_address_id = $result['ship_address_id']; // Phreebooks requires a primary name or the order is not valid, use company name if exists, else contact name if ($this->order['billing']['primary_name'] == '') { $psOrd->bill_primary_name = $this->order['billing']['contact']; $psOrd->bill_contact = ''; } else { $psOrd->bill_primary_name = $this->order['billing']['primary_name']; $psOrd->bill_contact = $this->order['billing']['contact']; } $psOrd->bill_address1 = $this->order['billing']['address1']; $psOrd->bill_address2 = $this->order['billing']['address2']; $psOrd->bill_city_town = $this->order['billing']['city_town']; $psOrd->bill_state_province = $this->order['billing']['state_province']; $psOrd->bill_postal_code = $this->order['billing']['postal_code']; $psOrd->bill_country_code = gen_get_country_iso_3_from_2($this->order['billing']['country_code']); $psOrd->bill_telephone1 = $this->order['customer']['telephone']; $psOrd->bill_email = $this->order['customer']['email']; if ($this->order['shipping']['primary_name'] == '') { $psOrd->ship_primary_name = $this->order['shipping']['contact']; $psOrd->ship_contact = ''; } else { $psOrd->ship_primary_name = $this->order['shipping']['primary_name']; $psOrd->ship_contact = $this->order['shipping']['contact']; } $psOrd->ship_address1 = $this->order['shipping']['address1']; $psOrd->ship_address2 = $this->order['shipping']['address2']; $psOrd->ship_city_town = $this->order['shipping']['city_town']; $psOrd->ship_state_province = $this->order['shipping']['state_province']; $psOrd->ship_postal_code = $this->order['shipping']['postal_code']; $psOrd->ship_country_code = gen_get_country_iso_3_from_2($this->order['shipping']['country_code']); $psOrd->ship_telephone1 = $this->order['customer']['telephone']; $psOrd->ship_email = $this->order['customer']['email']; // check for truncation of addresses if (strlen($psOrd->bill_primary_name) > 32 || strlen($psOrd->bill_address1) > 32 || strlen($psOrd->ship_primary_name) > 32 || strlen($psOrd->ship_address1) > 32) { $messageStack->add('Either the Primary Name or Address has been truncated to fit in the PhreeBooks database field sizes. Please check source information.', 'caution'); } // load the item rows switch (JOURNAL_ID) { case 12: $index = 'pstd'; break; case 10: default: $index = 'qty'; break; } for ($i = 0; $i < count($this->order['items']); $i++) { $psOrd->item_rows[] = array( 'gl_type' => GL_TYPE, $index => db_prepare_input($this->order['items'][$i]['quantity']), 'sku' => db_prepare_input($this->order['items'][$i]['sku']), 'desc' => db_prepare_input($this->order['items'][$i]['description']), 'price' => db_prepare_input($this->order['items'][$i]['unit_price']), 'acct' => db_prepare_input($this->order['items'][$i]['gl_acct']), 'tax' => db_prepare_input($this->order['items'][$i]['taxable']), 'total' => db_prepare_input($this->order['items'][$i]['total_price']), ); } // error check input if (!$psOrd->short_name) return $this->responseXML('18', SOAP_NO_CUSTOMER_ID, 'error'); if (!$psOrd->post_date) return $this->responseXML('20', SOAP_NO_POST_DATE, 'error'); if (!$psOrd->period) return $this->responseXML('21', SOAP_BAD_POST_DATE, 'error'); if (!$psOrd->bill_primary_name) return $this->responseXML('30', SOAP_NO_BILLING_PRIMARY_NAME, 'error'); if (ADDRESS_BOOK_CONTACT_REQUIRED && !$psOrd->bill_contact) return $this->responseXML('31', SOAP_NO_BILLING_CONTACT, 'error'); if (ADDRESS_BOOK_ADDRESS1_REQUIRED && !$psOrd->bill_address1) return $this->responseXML('32', SOAP_NO_BILLING_ADDRESS1, 'error'); if (ADDRESS_BOOK_ADDRESS2_REQUIRED && !$psOrd->bill_address2) return $this->responseXML('33', SOAP_NO_BILLING_ADDRESS2, 'error'); if (ADDRESS_BOOK_CITY_TOWN_REQUIRED && !$psOrd->bill_city_town) return $this->responseXML('34', SOAP_NO_BILLING_CITY_TOWN, 'error'); if (ADDRESS_BOOK_STATE_PROVINCE_REQUIRED && !$psOrd->bill_state_province) return $this->responseXML('35', SOAP_NO_BILLING_STATE_PROVINCE, 'error'); if (ADDRESS_BOOK_POSTAL_CODE_REQUIRED && !$psOrd->bill_postal_code) return $this->responseXML('36', SOAP_NO_BILLING_POSTAL_CODE, 'error'); if (!$psOrd->bill_country_code) return $this->responseXML('37', SOAP_NO_BILLING_COUNTRY_CODE, 'error'); if (!$psOrd->ship_primary_name) return $this->responseXML('40', SOAP_NO_SHIPPING_PRIMARY_NAME, 'error'); if (ADDRESS_BOOK_CONTACT_REQUIRED && !$psOrd->ship_contact) return $this->responseXML('41', SOAP_NO_SHIPPING_CONTACT, 'error'); if (ADDRESS_BOOK_ADDRESS1_REQUIRED && !$psOrd->ship_address1) return $this->responseXML('42', SOAP_NO_SHIPPING_ADDRESS1, 'error'); if (ADDRESS_BOOK_ADDRESS2_REQUIRED && !$psOrd->ship_address2) return $this->responseXML('43', SOAP_NO_SHIPPING_ADDRESS2, 'error'); if (ADDRESS_BOOK_CITY_TOWN_REQUIRED && !$psOrd->ship_city_town) return $this->responseXML('44', SOAP_NO_SHIPPING_CITY_TOWN, 'error'); if (ADDRESS_BOOK_STATE_PROVINCE_REQUIRED && !$psOrd->ship_state_province) return $this->responseXML('45', SOAP_NO_SHIPPING_STATE_PROVINCE, 'error'); if (ADDRESS_BOOK_POSTAL_CODE_REQUIRED && !$psOrd->ship_postal_code) return $this->responseXML('46', SOAP_NO_SHIPPING_POSTAL_CODE, 'error'); if (!$psOrd->ship_country_code) return $this->responseXML('47', SOAP_NO_SHIPPING_COUNTRY_CODE, 'error'); // post the sales order //echo 'ready to post =><br />'; echo 'psOrd object = '; print_r($psOrd); echo '<br />'; $post_success = $psOrd->post_ordr($action); if (!$post_success) { // extract the error message from the messageStack and return with error $text = strip_tags($messageStack->output()); $text = preg_replace('/&nbsp;/', '', $text); // the &nbsp; messes up the response XML return $this->responseXML('90', SOAP_SO_POST_ERROR . $text, 'error'); } // Begin - additional operations added by PhreeSoft for PPS global $db; if ($this->order['payment']['encval']) { $sql_array = array( 'module' => 'contacts', 'ref_1' => $psOrd->bill_acct_id, 'ref_2' => $psOrd->bill_address_id, 'hint' => $this->order['payment']['hint'], 'enc_value' => $this->order['payment']['encval'], ); $result = $db->Execute("select id from " . TABLE_DATA_SECURITY . " where module = 'contacts' and ref_1 = '" . $psOrd->bill_acct_id . "' and ref_2 = '" . $psOrd->bill_address_id . "' and hint = '" . $this->order['payment']['hint'] . "'"); if ($result->RecordCount() > 0) { db_perform(TABLE_DATA_SECURITY, $sql_array, 'update', 'id = ' . $result->fields['id']); } else { db_perform(TABLE_DATA_SECURITY, $sql_array, 'insert'); } } // End - additional operations added by PhreeSoft for PPS gen_add_audit_log(constant('AUDIT_LOG_SOAP_' . JOURNAL_ID . '_ADDED'), $psOrd->purchase_invoice_id, $psOrd->total_amount); $this->responseXML('0', sprintf(constant('SOAP_' . JOURNAL_ID . '_SUCCESS'), $psOrd->purchase_invoice_id), 'success'); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lookUp() {\n $config = include('config.php');\n $oclcNum = \"\";\n $bookTitle = \"null\";\n $authorLast = \"\";\n $authorFirst = \"\";\n $isbn = \"\";\n $pubDate = \"\";\n \n //define openURL parameters from generic URL from WorldCat Local / Discovery\n if (isset($_GET['rfe_dat'])) {\n $oclcNum = $_GET['rfe_dat'];\n //remove any blank spaces to clean up any OCLC number errors\n $oclcNum = trim($oclcNum); \n }\n if (isset($_GET['rft_btitle'])) {\n $bookTitle = urlencode($_GET['rft_btitle']);\n }\n if (isset($_GET['rft_aulast'])) {\n $authorLast = urlencode($_GET['rft_aulast']);\n }\n if (isset($_GET['rft_aufirst'])) {\n $authorFirst = urlencode($_GET['rft_aufirst']);\n }\n if (isset($_GET['rft_aucorp'])) {\n $authorLast = urlencode($_GET['rft_aucorp']);\n }\n if (isset($_GET['rft_isbn'])) {\n $isbn = urlencode($_GET['rft_isbn']);\n }\n if (isset($_GET['rft_date'])) {\n $pubDate = urlencode($_GET['rft_date']);\n }\n $today = date(\"m-d-Y\");\n //pull all openURL parameters\n $page = $_SERVER['REQUEST_URI'];\n $query = parse_url($page, PHP_URL_QUERY);\n parse_str($query);\n parse_str($query, $arr);\n \n \n //Require dependencies for using OCLC APIs\n require_once('../vendor/autoload.php');\n //configuration file, API keys, etc.\n require('config.php');\n //include file of locations that don't lend for PALShare\n require('nonlending.php');\n \n //build Availability API request authorization\n $wskey = new WSKey($config['key'], $config['secret']);\n $url = 'https://worldcat.org/circ/availability/sru/service?x-registryId=' . $config['institutionId'] . '&x-return-group-availability=true' . '&query=no:ocm' . $oclcNum;\n $user = new User($config['institutionId'], $config['principleId'], $config['principleIdNs']);\n $options = array('user'=> $user);\n\n $authorizationHeader = $wskey->getHMACSignature('GET', $url, $options);\n \n $client = new GuzzleHttp\\Client();\n //$client->get('config/curl/' . CURLOPT_SSLVERSION, 3);\n $headers = array();\n $headers['Authorization'] = $authorizationHeader;\n $request = $client->request('GET', $url, ['headers' => $headers]);\n\n\n //send request, get back XML\n try {\n \t\t//$response = $request->send();\n $xml = $request->getBody();\n $xmlObj = simplexml_load_string($xml);\n //Get the title of the book for use on results display screen\n \t$titlea = \"\";\n \t$titleb = \"\";\n \t$titlec = \"\";\n \t$bookTitle = \"\";\n \t$titlea = $xmlObj->xpath('//datafield[@tag=\"245\"]/subfield[@code=\"a\"]');\n \t$titleb = $xmlObj->xpath('//datafield[@tag=\"245\"]/subfield[@code=\"b\"]');\n \t$titlec = $xmlObj->xpath('//datafield[@tag=\"245\"]/subfield[@code=\"c\"]');\n \t\tif (!empty($titlea)) {\n \t\t\t$bookTitle = $titlea[0];\n \t\t\t$titlea = $titlea[0];\n \t\t}\n \t\tif (!empty($titleb)) {\n \t\t\t$bookTitle = $bookTitle . $titleb[0];\n \t\t}\n \t\tif (!empty($titlec)) {\n \t\t\t$bookTitle = $bookTitle . $titlec[0];\n \t\t}\n \t$title = $bookTitle;\n \n //Get holdings and write to line array\n\t\tif(isset($xmlObj->records->record->recordData->opacRecord->holdings->holding)) {\n\t\t $institutions = array();\n\t\t $localloc = array();\n\t\t $availability = array();\n\t\t $callnums = array();\n\t\t $shelfs = array();\n\t\t $line = array();\n\t\t foreach ($xmlObj->records->record->recordData->opacRecord->holdings->holding as $holding) {\n\t\t $institution = (string) $holding->nucCode;\n\t\t $localloc = $holding->localLocation;\n\t\t $shelf = (string) $holding->shelvingLocation;\n\t\t $callnum = (string) $holding->callNumber;\n\t\t $instavailcount = array();\n\t\t $datapoints = array();\n\t\t foreach ($holding->circulations->circulation as $circulation) {\n\t\t $institutions[] = $institution;\n\t\t $localloc[] = $localloc;\n\t\t $shelfs[] = $shelf;\n\t\t $callnums[] = $callnum;\n\t\t \t $avail = (string) $circulation->availableNow->attributes();\n\t\t\t $availability[] = $avail;\n\t\t $barcode = $circulation->itemId;\n\t\t $line[] = array(\"inst\"=>$institution,\"loc\"=>$shelf,\"callnum\"=>$callnum, \"avail\"=>$avail, \"barcode\"=>$barcode, \"localloc\"=>$localloc);\n\t\t\t } \n }\n \n //if holdings are found, check each holding line array for availability\n if (is_array($line)) {\n $innerLine = array();\n foreach ($line as $innerLine) {\n \t\t// Check type\n \t\tif (is_array($innerLine)){\n \t\t \t// Scan through inner loop\n \t\tforeach ($innerLine as $value) {\n \t\t $instLine = $innerLine[\"inst\"];\n \t\t $locLine = $innerLine[\"loc\"];\n \t\t $callLine = $innerLine[\"callnum\"];\n \t\t $availLine = $innerLine[\"avail\"];\n \t\t $locallocLine = $innerLine[\"localloc\"];\n \t\t //Use MD5 hash because some branch codes have special characters, see nonlending.php\n \t\t $locallocLine = md5($locallocLine);\n \t\t}\n \t\t\t//check the branch code (locallocLine) and loc (locLine) against the nonlending locs in nonlending.php\n \t\t\t$found=false;\n \t\t\n \t\t\tforeach ($palninonlending as $ke=>$va) {\n \t\t \t\tif($ke == $locallocLine) {\n \t\t \t\tforeach($va as $k=>$v) {\n \t\t \t\t\t\tif($v == $locLine) {\n \t\t \t\t\t\t$found=true;\n \t\t \t\t\t\t}\n \t\t \t\t}\t\t\n \t\t }\n \t\t }\n \t\t//if the branch code/loc match values in nonlending.php, skip; otherwise, check availability\n \t\tif ($found == true) {\n \t\t continue;\n \t\t} else {\n \t\t //if there are items available, check to make sure items are actually available; if so, create array of available items\n \t\t \tif (($instLine == $config['institutionCode']) && ($availLine !== '0')) { \n \t\t \t\t$instItems[] = \"<p><strong>Call Number:</strong> \" . $callLine . \" <br /><strong>Shelving Location:</strong> \" . $locLine . '</p>';\n \t\t \t} elseif (($instLine !== $config['institutionCode']) && ($availLine !== '0')) {\n \t\t //create nested array with shelvingLocation and availability of Resource-Sharing held items to be passed to resShare function\n \t\t \t$resItems[] = array('callnumber'=>$callLine, 'shelvinglocation'=>$locLine, 'availability'=>$availLine, 'instl'=>$instLine);\n \t\t } \n \t\t} \t \n }\n }\n }\n }\n //end try\n }\n //catch errors (e.g., API is down) and forward request to ILL form\n catch (\\Exception $e) {\n //Write to log file\n\t\t $current = \"API Failure ILL: \" . $openILL .\"\\n\";\n \t\t$current .= file_get_contents($logfile);\n \t\tfile_put_contents($logfile, $current);\n\t Header( 'Location: '. $openILL ) ;\n }\nreturn array('instItems' => $instItems, 'institutions' => $resItems, 'oclcNum' => $oclcNum, 'query' => $query, 'bookTitle' => $bookTitle, 'titlea' => $titlea);\n}", "public function processBooks()\n\t{\n\t\tif ($this->site->lookupbooks !== '0') {\n\t\t\t$books = new Books($this->echooutput);\n\t\t\t$books->processBookReleases();\n\t\t}\n\t}", "function fill_sample_data()\n{\n /* \n insert_user(db, email, password, display_name) \n insert_textbook(db, title, isbn, author, seller_id, description, price)\n insert_message(db, from_id, to_id, subject, message_body)\n insert_purchase_request(db, buyer_id, seller_id, bookid)\n */\n\n $db = connect_to_db();\n regenerate_database($db);\n\n \n insert_user($db, \"[email protected]\", \"pass1\", \"Bob\");\n insert_user($db, \"[email protected]\", \"pass2\", \"Ralf\");\n insert_user($db, \"[email protected]\", \"pass3\", \"Ron\");\n insert_user($db, \"[email protected]\", \"pass4\", \"Cathy\");\n insert_user($db, \"[email protected]\", \"pass5\", \"Missy\");\n insert_user($db, \"[email protected]\", \"pass6\", \"Arney\");\n insert_user($db, \"[email protected]\", \"pass7\", \"Katie\");\n /* User with long informtion */\n insert_user($db, \"jasfidofjoajfdaio;@dfjiaosdjiaosjdi.sajfdio\", \"jdsa\", \"fjsadiojjfadsio\");\n\n\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS2', '123456788', 'bobby bob2', '3', 'good cond.', '35.55');\n insert_textbook($db, 'Intro to CS3', '123456789', 'bobby bob3', '3', 'good cond.', '36.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '2', 'good cond.', '37.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS2', '123456788', 'bobby bob2', '3', 'good cond.', '38.55');\n insert_textbook($db, 'Intro to CS3', '123456789', 'bobby bob3', '4', 'good cond.', '39.55');\n /* A textbook with long information for testing purposes */\n insert_textbook($db, 'IntrotoCS3 Probability and Statistics thisis a longtitleoneword', '1234567890123', 'bobbybobbobbobhasalongname', '8', 'goodcondalongdescriptioniswhatthistextbookhashopefullyitfits', '139.55');\n\n \n insert_message($db, 1, 5, 'sample subject', 'sample message1');\n insert_message($db, 1, 5, 'sample subject', 'sample message2');\n insert_message($db, 1, 5, 'sample subject', 'sample message3');\n insert_message($db, 1, 3, 'sample subject', 'sample message4');\n insert_message($db, 1, 3, 'sample subject', 'sample message4');\n /* A long message to a long user */\n insert_message($db, 1, 8, 'sample subject this subject is deliberately really long for the purpose of testing the user interface', 'sample message4 this message is deliberately really long in order to test the user interface, hopefully it works with this really long message or it will make the users unhappy. We dont want unhappy user because they will go and use facebook to exchange textbooks. Now for a really long string to see how it breaks words: djasjdfkasjdkjfalkdjfksa;jdklkasdjfkla;sjdklfajkdsjfalskdjf;sadljfa;lskdjl;fjasdjfsadl;fjsadjfklasjlkjfklasjdklfa;lkdjfa;lkdjf;laksdj;flaskdjfl;ajskldjfklasjdkfjas;kldjfla;djkfal');\n\n insert_purchase_request($db, 3, 4, 1);\n insert_purchase_request($db, 3, 4, 2);\n insert_purchase_request($db, 3, 2, 3);\n insert_purchase_request($db, 4, 3, 1);\n insert_purchase_request($db, 5, 4, 1);\n\n /* A purchase request to a long user with a long textbook */\n insert_purchase_request($db, 8, 3, 6); \n\n echo \"data created sucessfully\";\n }", "protected function prepareUpdateData(){\n\t\tthrow new Exception('Unknown Error!', REST_ER_PAGE_NOTFOUND);\n\t}", "public static function book($cltId, $cltName, $phone, $tipId, $srvId, $ctrId, $date, $time, $dura,\n $type, $price, $curr, $disc, $fact, $qty, $total, $masterId, $matresId, $descr, $cmpCltId, $cmpMsgId = null)\n {//insert into com_srv_book\n //(client_id,centre_id,master_id,matres_id,srv_id,tip_id,book_date,book_time,book_dura,book_type_id,total)\n // values (46,1141,,,14623,14367,'2015-07-15',690,,B,10\n $capacity = self::getCapacity($ctrId, $srvId);\n //echo \"Here $capacity<be>\\n\";\n if ($capacity)\n {\n $bookCount = self::bookCount($date, $time, $dura);\n $left = $capacity - ($bookCount + $qty);\n if ($left < 0)\n return $left; // Negative result means overbooking\n }\n if ($cmpMsgId)\n {\n $cmpClt = WDsc::createCmpClt($cltId, null, $cmpMsgId, $price);\n $cmpCltId = $cmpClt['cmp_clnt_id'];\n }\n if ($ctrId == WCentre::id())\n {\n $taxPrc = WCentre::taxPrc();\n $comPrc = WCentre::comPrc();\n }\n else\n {\n $ctrData = DB::getDB()->queryPairs(WCentre::TABLE_CENTRE, 'tax_prc,com_prc', 'id=' . $ctrId);\n $taxPrc = Util::intval($ctrData['tax_prc']);\n $comPrc = Util::intval($ctrData['com_prc']);\n }\n $values = array\n (\n 'creator_id' => DB::int(WClient::id()),\n 'domain_id' => DB::intn(WDomain::id()),\n 'home' => DB::str(Base::home()),\n 'client_id' => DB::intn($cltId),\n 'client_name' => DB::str($cltName),\n 'phone' => DB::str($phone),\n 'number' => DB::strn(Util::pureNumber($phone)),\n 'centre_id' => DB::intn($ctrId),\n 'master_id' => DB::intn($masterId),\n 'matres_id' => DB::intn($matresId),\n 'srv_id' => DB::intn($srvId),\n 'tip_id' => DB::intn($tipId),\n 'currency_id' => DB::str($curr),\n 'book_date' => DB::daten($date),\n 'book_time' => DB::intn($time),\n 'book_dura' => DB::intn($dura),\n 'book_type_id' => DB::strn($type),\n 'price' => DB::money($price),\n 'disc' => DB::intn($disc),\n 'fact' => DB::money($fact),\n 'qty' => DB::intn($qty),\n 'total' => DB::money($total),\n 'ctr_tax_prc' => max(array(0, min(array(99, intval($taxPrc))))),\n 'ctr_com_prc' => max(array(0, min(array(99, intval($comPrc))))),\n 'descr' => DB::str($descr),\n 'cmp_clnt_id' => DB::intn($cmpCltId)\n );\n if ($type == 'B')\n {\n $values['status'] = DB::str('a');\n }\n if (WDomain::local())\n {\n $values['status'] = DB::str('a');\n $values['answered'] = 'current_timestamp';\n }\n //exit(print_r($values, true));\n $db = DB::getAdminDB();\n if (!$db->insertValues(WPurchase::TABLE_BOOK, $values))\n return null;\n return $db->insert_id;\n }", "public function getBookDetails($isbnnumber = NULL){\n\n define(\"API_KEY\",\"AIzaSyBWoCaww-UoB3VbN4QeCV2ESqqD5sD8PTA\");\n define(\"URL\", \"https://www.googleapis.com/books/v1/volumes?q=isbn:\");\n $details=array();\n $imageAvailable = false;\n $image=\"img/125x125.jpg\";\n $error=\"\";\n $description=base64_encode(\"No description available\");\n $publisher=\"No publisher available\";\n $isbn=trim($isbnnumber);\n if(!isset($isbn)||$isbn ==\"\")\n {\n $error=\"Please enter the 10 or 13 digit ISBN number located at the back of the book\";\n $valid = false;\n }\n else\n {\n $isbn= str_replace('-', '', $isbn); \n if(!is_numeric($isbn))\n {\n $error=\"ISBN number should be numeric. You entered \".$isbn.\" is not numeric\";\n $valid = false;\n } \n elseif(strlen($isbn)==13 && $isbn[0]!='9')\n {\n $error=\"ISBN should start with 978..Please review the ISBN entered and try again..\";\n $valid = false;\n } \n elseif (!(strlen($isbn)==10 || strlen($isbn)==13))\n {\n $error=\"ISBN should be atleast 10 or 13 digits...You entered only \".strlen($isbn).\" digits\";\n $valid= false;\n } \n \n }\n if(strlen($error)==\"\")\n {\n $url=URL.$isbn;\n //print_r($url);\n $bookDetails = @file_get_contents($url);\n $bookDetailsArray=json_decode($bookDetails, true);\n $totalItem=$bookDetailsArray['totalItems'];\n // print_r($bookDetailsArray);\n if($totalItem==1)\n {\n if(array_key_exists('imageLinks',$bookDetailsArray['items'][0]['volumeInfo'] ))$imageAvailable=true;\n $title= $bookDetailsArray['items'][0]['volumeInfo']['title'];\n $authors= @implode(\",\", $bookDetailsArray['items'][0]['volumeInfo']['authors']); \n\n if($imageAvailable)\n {\n $image=$bookDetailsArray['items'][0]['volumeInfo']['imageLinks']['smallThumbnail'];\n \n $description=$bookDetailsArray['items'][0]['volumeInfo']['description'];\n $publisher=$bookDetailsArray['items'][0]['volumeInfo']['publisher'];\n }\n $publishedDate=$bookDetailsArray['items'][0]['volumeInfo']['publishedDate']; \n $identifier=$bookDetailsArray['items'][0]['volumeInfo']['industryIdentifiers'][1]['identifier'];\n $identifierTen=$bookDetailsArray['items'][0]['volumeInfo']['industryIdentifiers'][0]['identifier'];\n // $categories=@implode(\",\",$bookDetailsArray['items'][0]['volumeInfo']['categories']);\n // Categories Add in DB and Return IDs\n $cat_arr = array();\n foreach ($bookDetailsArray['items'][0]['volumeInfo']['categories'] as $value) {\n $result = ($this->books_model->batchAddCat($value));\n $cat_array = json_decode(json_encode($result), True);\n $cat_arr[] = $cat_array['id'];\n }\n $cat_arr = implode(',', $cat_arr);\n\n // Authors Add in DB and Return IDs\n $aut_arr = array();\n foreach ($bookDetailsArray['items'][0]['volumeInfo']['authors'] as $value) {\n $result = ($this->books_model->batchAddAuthors($value));\n $aut_array = json_decode(json_encode($result), True);\n $aut_arr[] = $aut_array['id'];\n }\n $aut_arr = implode(',', $aut_arr);\n\n\n $details['category_name'] = $cat_arr;\n $details['author_name'] = $aut_arr;\n $details['book_title'] = $title;\n $details['image'] = $image;\n $details['description'] = $description;\n $details['book_pub'] = $publisher;\n $details['isbn_13'] = $identifier;\n $details['isbn'] = $identifierTen;\n $details['copyright_year'] = $publishedDate;\n \n $valid = true;\n }\n else\n {\n $error=\"No book found for entered ISBN\";\n $valid = false;\n }\n }\n $this->data['categories'] = $this->books_model->getAllCategories();\n $this->data['authors'] = $this->books_model->getAllAuthors();\n $this->data['book_details'] = $details;\n\n $this->mPageTitle = \"Add Book\";\n\n \n $this->render('books/edit');\n }", "protected function validateBooks(){\n if(empty(request()->title)){\n return redirect()->back()->withErrors(\"Please enter the book title\");\n }elseif(empty(request()->author)){\n return redirect()->back()->withErrors(\"Please enter the book author\");\n }elseif(empty(request()->publication_date)){\n return redirect()->back()->withErrors(\"Please enter the date of publication\");\n }else{\n return $this->createBooks();\n }\n }", "function format_item($item) //returns an item result with the proper formatting\n{\n\t$format_arr = array('Necessity', 'Title', 'Edition', 'Authors', 'Publisher');\n\t\n\tforeach ($format_arr as $name)\n\t{\n\t\tif (isset($item[$name]) && $item[$name])\n\t\t{\n\t\t\t$item[$name] = ucwords(strtolower(trim($item[$name], \" \\t\\n\\r\\0\\x0B\\xA0\")));\n\t\t}\n\t}\n\tif (isset($item['Year']) && $item['Year'])\n\t{\n\t\t$item['Year'] = date('Y', strtotime(trim($item['Year'])));\n\t}\n\tif (isset($item['ISBN']) && $item['ISBN'])\n\t{\n\t\t$item['ISBN'] = get_ISBN13(str_replace('&nbsp;', '', trim($item['ISBN'])));\n\t}\n\tif (isset($item['Bookstore_Price']) && $item['Bookstore_Price'])\n\t{\n\t\t$item['Bookstore_Price'] = priceFormat($item['Bookstore_Price']);\n\t}\n\t\n\tif (isset($item['New_Price']) && $item['New_Price'])\n\t{\n\t\t$item['New_Price'] = priceFormat($item['New_Price']);\n\t}\n\tif (isset($item['Used_Price']) && $item['Used_Price'])\n\t{\n\t\t$item['Used_Price'] = priceFormat($item['Used_Price']);\n\t}\n\tif (isset($item['New_Rental_Price']) && $item['New_Rental_Price'])\n\t{\n\t\t$item['New_Rental_Price'] = priceFormat($item['New_Rental_Price']);\n\t}\n\tif (isset($item['Used_Rental_Price']) && $item['Used_Rental_Price'])\n\t{\n\t\t$item['Used_Rental_Price'] = priceFormat($item['Used_Rental_Price']);\n\t}\n\n\treturn $item;\n}", "protected function _afterPrepareDocumentData()\n {\n }", "function reading_list(){\n\t//1. connect to BDD\t\t\n\t$pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;\n\t$bdd = new PDO(DB_PMBA, DB_USER, DB_PWD);\n\t$bdd->exec(\"SET CHARACTER SET utf8\");\n\n\t$count = 0;\n\t\n\t// 2. clean\n\t$bdd->exec('DELETE FROM reading_list');\n\t\n\t\n\t$url = \"http://personalmba.com/best-business-books/\";\n\t$pmba_url = \"http://personalmba.com\";\n\t\n\t$html = connect_to($url,$book);\n\t$html = str_get_html($html);\n\t\n\t// 2. get category\n\t$h2 = $html->find('h2[id]');\n\t\n\tforeach($h2 as $category){\n\t\t\n\t\t$en_category = $category->innertext;\t\t\n\t\t$list_books = $category->next_sibling()->find('li');\n\t\tforeach($list_books as $book){\n\t\t\n\t\t\t//3. info\n\t\t\t$title = $book->find('a',0)->plaintext;\n\t\t\t$amazon_com_url = $pmba_url.$book->find('a',0)->href;\n\t\t\t$author = $book->plaintext;\n\t\t\t$id = get_id($author);\n\t\t\t$author = get_author($author);\t\t\t\n\t\t\t$en_review = $pmba_url.$book->find('a',1)->href;\n\n\t\t\t$fr_category = \"\";\n\t\t\t$fr_review = \"\";\t\t\t\t\t\t\n\t\t\t$amazon_best_url = \"\";\n\t\t\t$amazon_price = \"\";\n\t\t\t$cheapest_price = \"\";\n\t\t\t$ship_price = \"\";\n\t\t\t$ISBN = \"\";\n\n\t\t\t// step 4 : insert in db\t\t\n\t\t\t$request = 'INSERT INTO reading_list VALUES(\\''.$id.'\\', \\''.$title.'\\', \\''.$author.'\\', \\''.$en_category.'\\', \\''.$fr_category.\n\t\t\t\t\t\t'\\', \\''.$en_review.'\\', \\''.$fr_review.'\\', \\''.$amazon_com_url.'\\', \\''.$amazon_best_url.'\\', \\''.$amazon_price.'\\', \\''.$cheapest_price.'\\', \\''.$ship_price.'\\', \\''.$ISBN.'\\')';\n\t\t\t$bdd->exec($request);\t\n\t\t\t\n\t\t\techo $id.\"\\n\";\n\t\t}\n\t}\n\t\t\n\t\n\t$html->clear(); \n\tunset($html);\n\t\n\t\t\n\t// and now we're done; close it\n\t$bdd = null;\n}", "public function callBookMaker($code) {\n // TODO implement here\n }", "public function getBookInfo()\n\t{\n\t\t$isbn = $_POST['ISBN'];\n\t\t$url = \"https://api.douban.com/v2/book/isbn/\" . $isbn;\n\t\t$curl = curl_init();\n\t\tcurl_setopt($curl, CURLOPT_URL, $url);\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);\n\t\t$result = curl_exec($curl);\n\t\tcurl_close($curl);\n\t\t$result = json_decode($result, true);\n\n\n\t\tif ($result[\"code\"] != 6000) {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'success',\n\t\t\t\t'data' => $result\n\t\t\t));\n\t\t\techo $json;\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Can not get its information!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "public function handleMessage(){\n\t\tif (strlen($this->isbn)>0){\n\t\t// We have an ISBN, either use the provided Title/Author or get this from Amazon\n\t\t\tif (strlen($this->title) == 0 || strlen($this->author) == 0){\n\t\t\t\t// If we don't have a title or we don't have an author, we ping Amazon for information\n\t\t\t\t$attempt = $titleAuthorArray = $this->getAmazonTitleAuthor($this->isbn);\t\t// Retrive Title/Author from Amazon\n\t\t\t\tif (!$attempt){\n\t\t\t\t\treturn false; \t\n\t\t\t\t}\n\t\t\t\t$this->title = $titleAuthorArray['title'];\n\t\t\t\t$this->author = $titleAuthorArray['author'];\n\t\t\t}\n\t\t\t// Else, our title and author have already been set with what the message had\n\t\t\t$this->updateDatabase();\n\t\t}\n\t\telse if(strlen($this->author)>0 && strlen($this->title)>0){ \n\t\t\t$matchedISBN = $this->getAmazonISBN($this->title, $this->author);\t// Get the ISBN from Amazon\n\t\t\tif (!$matchedISBN){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->isbn = $matchedISBN;\n\t\t\t\t$this->updateDatabase();\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t//\tIf we reach this case, we don't have the ISBN or we dont have the Author & Title -- we can't do anything but log the problem.\n\t\t\tthrow new Exception(sprintf(\"BookHandler.class.php: %d => Minimum Information Requirements not met -- Needs ISBN (title, author [optional]) or Title & Author\", __LINE__));\n\t\t}\n\t}", "public function getEx1() {\n # Use the QueryBuilder to get all the books\n $books = \\DB::table('books')->get();\n $this->printBooks($books);\n }", "public function format_for_xlwebpro_htl ($doc_nos, $doc_srno, $idate, $ccode, $scode, $hotel_name, $ticketno, $pax, $check_in_date, $check_out_date, $city_code, $basic_c, $basic_s, $nos_pax_a, $nos_pax_c, $room_sgl_nos=0, $room_sgl_pax=0, $room_sgl_rate=0, $room_trp_nos=0, $room_trp_pax=0, $room_trp_rate=0, $room_qad_nos=0, $room_qad_pax=0, $room_qad_rate=0, $room_twn_nos=0, $room_twn_pax=0, $room_twn_rate=0, $room_dbl_nos=0, $room_dbl_pax=0, $room_dbl_rate=0, $roomtype='000', $srv_chrg1c=0, $serv_educ=0, $serv_taxc=0, $hcode='H00000',$gcode='GI03HT', $doc_prf = 'HW', $roomview='000', $mealplan='000', $tarifftype='R') \r\n\t{\r\n\t\t$result['doc_prf'] = $doc_prf;\r\n\t\t$result['doc_nos'] = $doc_nos;\r\n\t\t$result['doc_srno'] = $doc_srno;\r\n\t\t$result['idm_flag'] = 'H';\r\n\t\t$result['il_ref'] = '';\r\n\t\t$result['vd_ref'] = '';\r\n\t\t$result['idate'] = $idate;\r\n\t\t$result['ccode'] = $ccode;\r\n\t\t$result['dcode'] = '';\r\n\t\t$result['ecode'] = '';\r\n\t\t$result['bcode'] = '';\r\n\t\t$result['narration'] = '';\r\n\t\t$result['xo_ref'] = 'H';\r\n\t\t$result['loc_code'] = '000';\r\n\t\t$result['cst_code'] = '000';\r\n\t\t$result['curcode_c'] = 'INR';\r\n\t\t$result['curcode_s'] = 'INR';\r\n\t\t$result['refr_key'] = '';\r\n\t\t$result['gcode'] = $gcode;\r\n\t\t$result['hcode'] = $hcode;\r\n\t\t$result['scode'] = $scode;\r\n\t\t$result['hotel_name'] = $hotel_name;\r\n\t\t$result['xo_nos'] = '';\r\n\t\t$result['ticketno'] = $ticketno; // concatenate first 3 columns\r\n\t\t$result['pax'] = $pax;\r\n\t\t$result['check_in_date'] = $check_in_date;\r\n\t\t$result['check_out_date'] = $check_in_date;\r\n\t\t$result['roomview'] = $roomview;\r\n\t\t$result['mealplan'] = $mealplan;\r\n\t\t$result['roomtype'] = $roomtype;\r\n\t\t$result['tarifftype'] = $tarifftype;\r\n\t\t$result['pkg_code'] = '';\r\n\t\t$result['city'] = $city_code;\r\n\t\t$result['room_sgl_nos'] = $room_sgl_nos;\r\n\t\t$result['room_sgl_pax'] = $room_sgl_pax;\r\n\t\t$result['room_sgl_rate'] = $room_sgl_rate;\r\n\t\t$result['room_sgl_purmth'] = 'RB';\r\n\t\t$result['room_sgl_purval'] = 0;\r\n\t\t$result['room_dbl_nos'] = $room_dbl_nos;\r\n\t\t$result['room_dbl_pax'] = $room_dbl_pax;\r\n\t\t$result['room_dbl_rate'] = $room_dbl_rate;\r\n\t\t$result['room_dbl_purmth'] = 'RB';\r\n\t\t$result['room_dbl_purval'] = 0;\r\n\t\t$result['room_twn_nos'] = $room_twn_nos;\r\n\t\t$result['room_twn_pax'] = $room_twn_pax;\r\n\t\t$result['room_twn_rate'] = $room_twn_rate;\r\n\t\t$result['room_twn_purmth'] = 'RB';\r\n\t\t$result['room_twn_purval'] = 0;\r\n\t\t$result['room_trp_nos'] = $room_trp_nos;\r\n\t\t$result['room_trp_pax'] = $room_trp_pax;\r\n\t\t$result['room_trp_rate'] = $room_trp_rate;\r\n\t\t$result['room_trp_purmth'] = 'RB';\r\n\t\t$result['room_trp_purval'] = 0;\r\n\t\t$result['room_qad_nos'] = $room_qad_nos;\r\n\t\t$result['room_qad_pax'] = $room_qad_pax;\r\n\t\t$result['room_qad_rate'] = $room_qad_rate;\r\n\t\t$result['room_qad_purmth'] = 'RB';\r\n\t\t$result['room_qad_purval'] = 0;\r\n\t\t$result['room_adt_nos'] = 0;\r\n\t\t$result['room_adt_pax'] = 0;\r\n\t\t$result['room_adt_rate'] = 0;\r\n\t\t$result['room_adt_purmth'] = 'RB';\r\n\t\t$result['room_adt_purval'] = 0;\r\n\t\t$result['room_chd_nos'] = 0;\r\n\t\t$result['room_chd_pax'] = 0;\r\n\t\t$result['room_chd_rate'] = 0;\r\n\t\t$result['room_chd_purmth'] = 'RB';\r\n\t\t$result['room_chd_purval'] = 0;\r\n\t\t$result['room_cwb_nos'] = 0;\r\n\t\t$result['room_cwb_pax'] = 0;\r\n\t\t$result['room_cwb_rate'] = 0;\r\n\t\t$result['room_cwb_purmth'] = 'RB';\r\n\t\t$result['room_cwb_purval'] = 0;\r\n\t\t$result['room_foc_nos'] = 0;\r\n\t\t$result['room_foc_pax'] = 0;\r\n\t\t$result['room_foc_rate'] = 0;\r\n\t\t$result['room_foc_purmth'] = 'RB';\r\n\t\t$result['room_foc_purval'] = 0;\r\n\t\t$result['stx_cenvat'] = 'C';\r\n\t\t$result['stx_method'] = 'S';\r\n\t\t$result['nos_pax_a'] = $nos_pax_a;\r\n\t\t$result['nos_pax_c'] = $nos_pax_c;\r\n\t\t$result['nos_pax_i'] = 0;\r\n\t\t$result['narr_1'] = '';\r\n\t\t$result['narr_2'] = '';\r\n\t\t$result['narr_3'] = '';\r\n\t\t$result['narr_4'] = '';\r\n\t\t$result['narr_5'] = '';\r\n\t\t$result['narr_6'] = '';\r\n\t\t$result['r_o_e_c'] = 0;\r\n\t\t$result['r_o_e_s'] = 0;\r\n\t\t$result['basic_c'] = $basic_c;\r\n\t\t$result['basic_s'] = $basic_s;\r\n\t\t$result['tax_c'] = 0;\r\n\t\t$result['tax_s'] = 0;\r\n\t\t$result['disc_paidm1'] = 'RB';\r\n\t\t$result['disc_paidm2'] = 'N';\r\n\t\t$result['disc_recdm1'] = 'RB';\r\n\t\t$result['brok_paidm1'] = 'RB';\r\n\t\t$result['disc_paidv1'] = 0;\r\n\t\t$result['disc_recdv1'] = 0;\r\n\t\t$result['brok_paidv1'] = 0;\r\n\t\t$result['disc_paid1'] = 0;\r\n\t\t$result['disc_recd1'] = 0;\r\n\t\t$result['brok_paid1'] = 0;\r\n\t\t$result['srv_paidm2'] = 'N';\r\n\t\t$result['srv_chrg1c'] = $srv_chrg1c;\r\n\t\t$result['srv_chrg2c'] = 0;\r\n\t\t$result['srv_chrg3c'] = 0;\r\n\t\t$result['raf_c'] = 0;\r\n\t\t$result['srv_chrg1p'] = 0;\r\n\t\t$result['srv_chrg2p'] = 0;\r\n\t\t$result['srv_chrg3p'] = 0;\r\n\t\t$result['raf_p'] = 0;\r\n\t\t$result['serv_taxc'] = $serv_taxc;\r\n\t\t$result['serv_educ'] = $serv_educ;\r\n\t\t$result['tdc_paidv1'] = 0;\r\n\t\t$result['tds_c'] = 0;\r\n\t\t$result['serv_taxp'] = 0;\r\n\t\t$result['serv_edup'] = 0;\r\n\t\t$result['tds_paidv1'] = 0;\r\n\t\t$result['tds_p'] = 0;\r\n\t\t$result['tdb_paidv1'] = 0;\r\n\t\t$result['tds_b'] = 0;\r\n\t\t$result['created_by'] = '';\r\n\t\t$result['created_on'] = '';\r\n\r\n\t\treturn $result;\r\n\t}", "public function bookItem($param) { \n if (!$this->aaa->has_right('openruth', 500))\n $res->bookingError->_value = 'authentication_error';\n else {\n $agencyId = self::strip_agency($param->agencyId->_value);\n $targets = $this->config->get_value('ruth', 'ztargets');\n if ($tgt = $targets[$agencyId]) {\n $book = &$booking->Booking->_value;\n $book->LibraryNo->_value = $agencyId;\n $book->BorrowerTicketNo->_value = $param->userId->_value;\n $book->BookingNote->_value = $param->bookingNote->_value;\n $book->StartDate->_value = self::to_zruth_date($param->bookingStartDate->_value);\n $book->EndDate->_value = self::to_zruth_date($param->bookingEndDate->_value);\n $book->NumberOrdered->_value = $param->bookingTotalCount->_value;\n $book->ServiceCounter->_value = $param->agencyCounter->_value;\n $book->MRID->_value->ID->_value = $param->itemId->_value;\n $book->MRID->_value->TitlePartNo->_value = ($param->itemSerialPartId->_value ? $param->itemSerialPartId->_value : 0);\n $xml = '<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?'.'>' . utf8_decode($this->objconvert->obj2xml($booking));\n $z = new z3950();\n $z->set_target($tgt['host']);\n $z->set_database($tgt['database'].'-ophelia');\n $z->set_authentication($tgt['authentication']);\n if ($tgt['proxy']) {\n $z->set_proxy($tgt['proxy']);\n }\n $xml_ret = $z->z3950_xml_update($xml, $tgt['timeout']);\n//echo 'error: ' . $z->get_errno();\n//print_r($xml);\n//print_r($xml_ret);\n if ($z->get_errno() == 0 && $xml_ret['xmlUpdateDoc']) {\n $dom = new DomDocument();\n $dom->preserveWhiteSpace = false;\n if ($dom->loadXML($xml_ret['xmlUpdateDoc'])) {\n if ($err = $dom->getElementsByTagName('ErrorResponse')->item(0)) {\n verbose::log(ERROR, __FUNCTION__ . ' (' . __LINE__ . ') errno: ' . $err->getAttribute('Err'));\n if (!($res->bookingError->_value = $this->errs[$err->getAttribute('Err')])) \n $res->bookingError->_value = 'unspecified error (' . $err->getAttribute('Err') . '), order not possible';\n } elseif ($err = $dom->getElementsByTagName('Error')->item(0)->nodeValue) {\n verbose::log(ERROR, __FUNCTION__ . ' (' . __LINE__ . ') errno: ' . $err);\n if (!($res->bookingError->_value = $this->errs[$err])) \n $res->bookingError->_value = 'unspecified error (' . $err . '), order not possible';\n } else {\n $res->bookingOk->_value->bookingId->_value = $dom->getElementsByTagName('BookingID')->item(0)->nodeValue;\n if ($sd = self::from_zruth_date($dom->getElementsByTagName('StartDate')->item(0)->nodeValue))\n $res->bookingOk->_value->bookingStartDate->_value = $sd;\n else\n $res->bookingOk->_value->bookingStartDate->_value = $param->bookingStartDate->_value;\n if ($ed = self::from_zruth_date($dom->getElementsByTagName('EndDate')->item(0)->nodeValue))\n $res->bookingOk->_value->bookingEndDate->_value = $ed;\n else\n $res->bookingOk->_value->bookingEndDate->_value = $param->bookingEndDate->_value;\n }\n } else {\n verbose::log(ERROR, __FUNCTION__ . ' (' . __LINE__ . ') loadXML error of: ' . $xml_ret['xmlUpdateDoc']);\n $res->bookingError->_value = 'system error';\n }\n } else {\n self::log_z_error(__FUNCTION__, __LINE__, $agencyId, $z->get_errno(), $z->get_error_string());\n $res->bookingError->_value = 'system error';\n }\n } else\n $res->bookingError->_value = 'unknown agencyId';\n }\n\n $ret->bookItemResponse->_value = $res;\n //var_dump($param); print_r($res); die();\n return $ret;\n }", "protected function prepareInsertData(){\n\t\tthrow new Exception('Unknown Error!', REST_ER_PAGE_NOTFOUND);\n\t}", "public function get_book();", "function prepareAPIdataToSave(){\r\n\tglobal $dataBody;\r\n\t$strDebug = \"prepareAPIdataToSave<br/>\";\r\n\r\n\t\t//arrays storing the form data from each of the arrayed form fields\r\n\t$formOCLC_NUMBERS \t= $_REQUEST[\"OCLC_NUMBER\"];\r\n\t$formOCLCrequested \t= $_REQUEST[\"OCLCrequested\"];\r\n\t$formISSN\t\t\t\t\t\t= $_REQUEST[\"ISSN\"];\r\n\t$formTITLES\t\t\t\t \t= $_REQUEST[\"TITLE\"];\r\n\t$formNumHolders \t \t= $_REQUEST[\"numHolders\"];\r\n\t$formHoldingsData \t= str_replace(\"|\", \"\", $_REQUEST[\"holdingsData\"]); //remove our field separator from the data: ruins formatting\r\n\r\n\t//column titles in first line\r\n\t//$dataBody = \"OCLC_NUMBER|OCLCalternate|ISSN|title|numHolders|CRLholds|\";//see new columns 2012-08-14\r\n\t$dataBody = \"OCLC_NUMBER|OCLCalternate|ISSN|title|numHolders|CRLholds|memberHolds|\";\r\n\t\t//2011: now there will be 4 styles of holdingsData for various uses in XLS, MDB, etc.\r\n\t\t//2012-07-20: nobody needs allNamesList and allCodesList variants with line breaks; skip them\r\n\t$dataBody .= \"allNames|\"; \t\t//all data, no line breaks\r\n\t\t//$dataBody .= \"allNamesList|\"; //all data, add line breaks; see thisAllNamesList in code below\r\n\t$dataBody .= \"allCodes|\"; \t\t//library codes only, no line breaks; see thisAllCodes in code below\r\n\t\t//$dataBody .= \"allCodesList|\"; //library codes only, add line breaks;\r\n\t$dataBody .= \"memberNames|memberCodes|memberData|\";\r\n\t$dataBody .= \"\\n\";\r\n\t//end column titles\r\n\r\n\t$i = 0;\r\n\tforeach($_REQUEST[\"OCLC_NUMBER\"] as $OCLC_NUMBER){\r\n\t\t/*$strDebug .= \"<p>i='\" . $i . \"': \" . $OCLC_NUMBER . \" has title '\" . $formTITLES[$i] . \"', \";\r\n\t\t\t $strDebug .= \"with \" . $formNumHolders[$i] . \" holders, \";\r\n\t\t\t $strDebug .= \"details are <span class='important'>\" . $formHoldingsData[$i] . \"</span>\";\r\n\t\techo $strDebug;\r\n\t\t*/\r\n\r\n\t\t\t/*\r\n\t\t\t\t- $_REQUEST[\"OCLC_NUMBER\"] is array of OCLC numbers returned by API\r\n\t\t\t\t- $_REQUEST[\"OCLCrequested\"] is array of OCLC numbers submitted to API\r\n\t\t\t\t- OCLC_NUMBER and OCLCrequested may be different if API returned data for merged number\r\n\t\t\t*/\r\n\t\t$thisRecord = trim($OCLC_NUMBER) . \"|\";\r\n\t\tif(trim($formOCLCrequested[$i])){\r\n\t\t\t$thisRecord .= trim($formOCLCrequested[$i]) . \"|\";\r\n\t\t} else { // $formOCLCrequested[$i] was blank\r\n\t\t\t$thisRecord .= \"0|\";\r\n\t\t}\r\n\r\n\t\t$thisRecord .= trim($formISSN[$i]) . \"|\"; //Holdings.js function parseISSN fills these so no need to handle blanks here\r\n\r\n\t\t$thisTitle \t= trim($formTITLES[$i]);\r\n\t\t//echo \"<h3>thisTitle='\" . $formTITLES[$i] . \"'<br/> + is in the encoding '\" . mb_detect_encoding($thisTitle) . \"'</h3>\";\r\n\r\n\t\t$thisTitle = str_replace( \",\", \" \", $thisTitle);\r\n\t\t$thisRecord .= $thisTitle . \"|\";\r\n\r\n\t\t$thisRecord .= trim($formNumHolders[$i]) . \"|\"; //original line; just add number from form data\r\n\r\n\t\t\t//bgn CRLholds field: does CRL hold this item?\r\n\t\t$boolCRLholds \t\t\t= 0;\r\n\t\t$CRLstrpos = strpos($formHoldingsData[$i], \"Center for Research Libraries [CRL]\");\r\n\t\tif ($CRLstrpos > -1){\r\n\t\t\t$boolCRLholds = 1;\r\n\t\t}\r\n\t\t$thisRecord .= $boolCRLholds . \"|\";\r\n\t\t//echo \"<br/>after boolCRLholds, thisRecord = \" . $thisRecord;\r\n\t\t//end CRLholds field\r\n\r\n\r\n\t\t/*\r\n\t\t\tfields: memberHolds, memberNames, memberCodes, memberData\r\n\t\t\t\tall need to be filled in from the mySQL interface, not here: leave message to that effect.\r\n\t\t\t\tDefined here, ea. is added to $thisRecord in order they appear in database (see column titles at beginning of function)\r\n\t\t*/\r\n\t\t\t$memberHolds = \"0|\";\r\n\t\t\t$memberNames = \"[member names]|\";\r\n\t\t\t$memberCodes = \"[member codes]|\";\r\n\t\t\t$memberData = \"[member data]|\";\r\n\t\t$thisRecord .= $memberHolds;\r\n\r\n\t\t\t//allNames: all data, no line breaks, straight holdings data as submitted\r\n\t\t$thisHoldingsData = trim($formHoldingsData[$i]);\r\n\t\t$thisHoldingsData = str_replace( \",\", \"\", $thisHoldingsData);\r\n\t\t$thisHoldingsData = replaceDoubleSpaces($thisHoldingsData);\r\n\t\t$thisRecord .= $thisHoldingsData . \"|\";\r\n\t\t//echo '<h3>thisHoldingsData = \"' . $thisHoldingsData . '\"</h3>';\r\n\t\t//echo '<h3>thisHoldingsData is in the encoding \"' . mb_detect_encoding($thisHoldingsData) . '\"</h3>';\r\n\t\t//end allNames field\r\n\r\n\r\n\t\t/* this section of the file has been removed: see allNamesList_unused.php\r\n\t\t\t- no longer providing allNamesList column */\r\n\r\n\r\n\t\t/* allCodes: library codes only, no line breaks\r\n\t\t\tregex: PCRE in PHP manual: Perl-Compatible Regular Expressions\r\n\t\t\t\\w \t <-- means any \"word\" character (letter or digit or underscore)\r\n\r\n\t\t\tregexCodesWrap + preg_replace:\r\n\t\t\t\tstrips holdings library names, leaves brackets + codes\r\n\t\t\t\t'#[0-9]+\\) [A-Za-z0-9\\s\\w\\&\\%\\$\\#\\@\\-\\.\\:\\\"\\'\\(\\)]*#'\r\n\r\n\t\t\tfirst, replace all the accented characters with non-accented equivalents,\r\n\t\t\t\t\tso regexCodesWrap will match the entire repository names: see\r\n\t\t\t\t\thttp://php.net/manual/en/function.strtr.php\r\n\t\t\t\t\t\t$codes = strtr($thisHoldingsData, \"äåö\", \"aao\");\r\n\t\t\t\t\tbut user Anonymous 25-Nov-2009 08:09 posted even simpler solution (with our vars plugged in):\r\n\t\t\t\t\t\t$codes = preg_replace(\"/[^\\x9\\xA\\xD\\x20-\\x7F]/\", \"\", $thisHoldingsData);\r\n\t\t*/\r\n\t\t$regexAccentedChars = '#[^\\x9\\xA\\xD\\x20-\\x7F]#';\r\n\t\t$codes = preg_replace($regexAccentedChars, \"\", $thisHoldingsData); //replace accented characters\r\n\t\t$regexCodesWrap = '#[0-9]+\\) [\\s\\w\\&\\%\\$\\#\\@\\-\\.\\:\\\"\\'\\(\\)]*#';\r\n\t\t$codes = preg_replace($regexCodesWrap, \"\", $codes, -1, $matchCodes);\r\n\t\t$regexBracket = '#\\]\\.#';\r\n\t\t$codes = preg_replace($regexBracket, \"] \", $codes, -1, $matchBracket);\r\n\t\t$thisAllCodes = trim($codes);\r\n\t\t$thisAllCodes = replaceDoubleSpaces($thisAllCodes);\r\n\t\t$thisRecord .= $thisAllCodes . \"|\";\r\n\t\t//end allCodes field\r\n\r\n\t\t/* this section of the file has been removed: see allCodesList_unused.php\r\n\t\t\t- no longer providing allCodesList column */\r\n\r\n\t\t\t//add dummy columns that need to be filled depending on the returned data:\r\n\t\t\t//\tthat's done in the database\r\n\t\t$thisRecord .= $memberNames . $memberCodes . $memberData;\r\n\r\n\t\tif ($thisRecord != \"|||\") $dataBody .= $thisRecord . \"\\n\"; //if not empty record\r\n\r\n\t\t$i++;\r\n\t}//end foreach\r\n\r\n\t//echo $strDebug . \"<p>dataBody:<br/>\" . str_replace(\"\\n\", \"<br/>\", $dataBody) . \"</p><hr/>\";\r\n}", "public function addBook($title, $author,$publisher,$saletype,$published_date,$edition,\n $subjectarea,$condition,$askingprice, $description,$bUserId,$category,$uploadtime,$keyword,$image)\n {\n \n $title = mysql_real_escape_string($title);\n $author = mysql_real_escape_string ($author);\n $publisher = mysql_real_escape_string($publisher);\n $saletype = mysql_real_escape_string($saletype);\n $published_date =mysql_real_escape_string($published_date);\n $edition = mysql_real_escape_string($edition);\n $subjectarea = mysql_real_escape_string($subjectarea);\n $condition = mysql_real_escape_string($condition);\n $askingprice = mysql_real_escape_string($askingprice);\n $description = mysql_real_escape_string ($description); \n $bUserId = mysql_real_escape_string($bUserId);//mysql_real_escape_string($bUserId);\n $category = mysql_real_escape_string($category);\n $uploadtime = date('Y-m-d H:i:s');\n $keyword = mysql_real_escape_string($keyword);\n $image = mysql_real_escape_string($image);\n \n $api= new Api;\n $api->additem($bUserId, $category, $uploadtime, $keyword, $image, $saletype);\n \n $sql3 = \"SELECT itemid \n FROM item\n WHERE uploadtime = '$uploadtime'\";\n $itemid2 = mysql_fetch_row(mysql_query($sql3));\n $itemid2 = $itemid2[0];\n $sql2 = \"INSERT INTO book \n VALUES ('$itemid2','$title','$author','$publisher',\n '$published_date','$edition',\n '$subjectarea','$condition',\n '$saletype','$askingprice',\n '$description')\";\n $result = mysql_query($sql2);\n return $result;\n }", "public function getEx15() {\n $books = Book::all();\n $this->printBooks($books);\n\t}", "public function externalAdd(Request $request) {\n \n if($request->has('bookid')) {\n \n $user = $request->user();\n $bookid = $request->bookid;\n \n if($user) {\n \n // Search the collection\n $search = new Library\\RemoteSearch;\n \n // Create the edition string\n $editionsStr = '';\n $comma = '';\n $titleMatch = false;\n if($request->has('single')) {\n $editionsStr = 'OLID:'.$request->bookid;\n } else {\n $books = $search->openLibSearch($bookid,'olid');\n $titleMatch = $books['docs'][0]['title_suggest'];\n foreach($books['docs'] as $book) {\n foreach($book['edition_key'] as $edition) {\n $editionsStr .= $comma.'OLID:'.$edition;\n $comma = ',';\n }\n }\n }\n \n // Get the individual editions\n $bookData = $search->openLibBooks($editionsStr);\n //dd($bookData);\n \n // Remove any books that don't have isbn\n $returnBooks = array();\n foreach ($bookData as $book) {\n if(isset($book['identifiers']['isbn_10']) || isset($book['identifiers']['isbn_13'])) {\n if(!$titleMatch || (stripos($book['title'],$titleMatch) !== false)) {\n \n // Create our own simplified array\n $bookData = [];\n $bookData['title'] = $book['title'];\n $bookData['year'] = isset($book['publish_date']) ? $book['publish_date'] : NULL;\n $bookData['author'] = isset($book['authors']) ? $book['authors'][0]['name'] : NULL;\n $bookData['authorolid'] = isset($book['authors']) ? Library\\Helpers::getAuthorIdFromUrl($book['authors'][0]['url']) : NULL;\n $bookData['isbn10'] = isset($book['identifiers']['isbn_10']) ? $book['identifiers']['isbn_10'][0] : Library\\Helpers::isbn13_to_10($book['identifiers']['isbn_13'][0]);\n $bookData['isbn13'] = isset($book['identifiers']['isbn_13']) ? $book['identifiers']['isbn_13'][0] : Library\\Helpers::isbn10_to_13($book['identifiers']['isbn_10'][0]);\n $bookData['olid'] = $book['identifiers']['openlibrary'][0];\n $bookData['image'] = isset($book['cover']) ? $book['cover']['medium'] : NULL;\n\n // Get the genres\n $bookData['subjects'] = [];\n if(isset($book['subjects'])) {\n foreach ($book['subjects'] as $subject) {\n $bookData['subjects'][] = $subject['name'];\n }\n }\n\n //$returnBooks[] = $book;\n $returnBooks[] = $bookData;\n \n }\n }\n }\n \n //dd($returnBooks);\n //\n // Now we narrow down more, if only 1 book now, we add, otherwise show editions\n if(count($returnBooks) === 1) {\n \n $addBook = $returnBooks[0];\n \n // first add author to get the id\n $authorID = !is_null($addBook['author']) ? $this->addAuthor($addBook['author'],$addBook['authorolid']) : NULL;\n $addBook['authorid'] = $authorID;\n \n // Add the genres and collect the ids\n $genreIDs = $this->addGenres($addBook['subjects']);\n \n // Add the book\n $bookid = $this->addBook($addBook);\n \n // Connect the cats to the book\n $bookCats = $this->addBookCategories($bookid, $genreIDs);\n \n // Add the users bookshelf\n $bookshelf = new Library\\BookshelfFunctions;\n $shelfID = $bookshelf->newBookshelf($user->id, $bookid);\n \n return redirect('dashboard');\n } else {\n return view('add-book',['results' => $returnBooks]);\n }\n } else {\n return redirect('search');\n }\n \n } else {\n return redirect('search');\n }\n \n }", "function proc_quickbooks_datastore($inc_data,$forcereset)\n{\n \n $fn_debug=array('all'=>false,'service'=>false,'material'=>false,'inventory'=>false,'bids'=>false,'adjusts'=>false);\n $forcereset=false;\n\t$out=array();\n $wrk_data=array(\n 'service'=>array('curr'=>array(),'del'=>array(),'add'=>array(),'prc'=>array()),\n 'material'=>array('curr'=>array(),'del'=>array(),'add'=>array(),'prc'=>array()),\n 'inventory'=>array('curr'=>array(),'del'=>array(),'add'=>array(),'prc'=>array()),\n 'bids'=>array('curr'=>array(),'del'=>array(),'add'=>array(),'prc'=>array()),\n 'adjusts'=>array('curr'=>array(),'del'=>array(),'add'=>array(),'prc'=>array())\n );\n \n // Clear previous entries\n if ($forcereset)\n {\n mssql_query(\"delete from jest..JobCost_Service where oid=\".$inc_data['oid'].\" and jobid='\".trim($inc_data['jobid']).\"' and jadd=\".trim($inc_data['jadd']).\";\");\n mssql_query(\"delete from jest..JobCost_Material where oid=\".$inc_data['oid'].\" and jobid='\".trim($inc_data['jobid']).\"' and jadd=\".trim($inc_data['jadd']).\";\");\n mssql_query(\"delete from jest..JobCost_Inventory where oid=\".$inc_data['oid'].\" and jobid='\".trim($inc_data['jobid']).\"' and jadd=\".trim($inc_data['jadd']).\";\");\n mssql_query(\"delete from jest..JobCost_BidCost where oid=\".$inc_data['oid'].\" and jobid='\".trim($inc_data['jobid']).\"' and jadd=\".trim($inc_data['jadd']).\";\");\n mssql_query(\"delete from jest..JobCost_Adjusts where oid=\".$inc_data['oid'].\" and jobid='\".trim($inc_data['jobid']).\"' and jadd=\".trim($inc_data['jadd']).\";\");\n }\n\t\n\t// Select Previous Data\n $qryS =\"select * from jest..JobCost_Service where oid=\".$inc_data['oid'].\" and jobid='\".trim($inc_data['jobid']).\"' and jadd=\".trim($inc_data['jadd']).\";\";\n $resS =mssql_query($qryS);\n\t$nrowS =mssql_num_rows($resS);\n \n $qryM =\"select * from jest..JobCost_Material where oid=\".$inc_data['oid'].\" and jobid='\".trim($inc_data['jobid']).\"' and jadd=\".trim($inc_data['jadd']).\";\";\n $resM =mssql_query($qryM);\n\t$nrowM =mssql_num_rows($resM);\n \n $qryI =\"select * from jest..JobCost_Inventory where oid=\".$inc_data['oid'].\" and jobid='\".trim($inc_data['jobid']).\"' and jadd=\".trim($inc_data['jadd']).\";\";\n $resI =mssql_query($qryI);\n\t$nrowI =mssql_num_rows($resI);\n \n $qryB =\"select * from jest..JobCost_BidCost where oid=\".$inc_data['oid'].\" and jobid='\".trim($inc_data['jobid']).\"' and jadd=\".trim($inc_data['jadd']).\";\";\n $resB =mssql_query($qryB);\n $nrowB =mssql_num_rows($resB);\n \n $qryA =\"select * from jest..JobCost_Adjusts where oid=\".$inc_data['oid'].\" and jobid='\".trim($inc_data['jobid']).\"' and jadd=\".trim($inc_data['jadd']).\";\";\n $resA =mssql_query($qryA);\n\t$nrowA =mssql_num_rows($resA);\n\t\n // Build Current Stored array\n\tif ($nrowS > 0)\n\t{\n while($rowS = mssql_fetch_array($resS))\n {\n $wrk_data['service']['curr'][]=$rowS;\n }\n \n $wrk_data['service']['add']=array_diff($inc_data['jc_ar']['service'],$wrk_data['service']['curr']);\n\t}\n else\n {\n $wrk_data['service']['add']=$inc_data['jc_ar']['service'];\n }\n \n if ($fn_debug['all'] or $fn_debug['service'])\n {\n echo '<pre>';\n echo 'Existing Service: ('.$nrowS.')<br>';\n echo \"Incoming Service: (\".count($inc_data['jc_ar']['service']).\")<br>\";\n echo \"Service Add: <br>\";\n print_r($wrk_data['service']['add']);\n echo '</pre>';\n }\n \n\tif ($nrowM > 0)\n\t{\n while($rowM = mssql_fetch_array($resM))\n {\n $wrk_data['material']['curr'][]=$rowM;\n }\n \n $wrk_data['material']['add']=array_diff($inc_data['jc_ar']['material'],$wrk_data['material']['curr']);\n\t}\n else\n {\n $wrk_data['material']['add']=$inc_data['jc_ar']['material'];\n }\n \n if ($fn_debug['all'] or $fn_debug['material'])\n {\n echo '<pre>';\n echo 'Existing Material: ('.$nrowM.')<br>';\n echo \"Incoming Material: (\".count($inc_data['jc_ar']['material']).\")<br>\";\n echo 'Material Add: <br>';\n print_r($wrk_data['material']['add']);\n echo '</pre>';\n }\n\t\n\tif ($nrowI > 0)\n\t{\n while($rowI = mssql_fetch_array($resI))\n {\n $wrk_data['inventory']['curr'][]=$rowI;\n }\n \n $wrk_data['inventory']['add']=array_diff($inc_data['jc_ar']['inventory'],$wrk_data['inventory']['curr']);\n\t}\n else\n {\n $wrk_data['inventory']['add']=$inc_data['jc_ar']['inventory'];\n }\n \n if ($fn_debug['all'] or $fn_debug['inventory'])\n {\n echo '<pre>';\n echo 'Existing Inventory: ('.$nrowI.')<br>';\n echo \"Incoming Inventory: (\".count($inc_data['jc_ar']['inventory']).\")<br>\";\n echo 'Inventory Add: <br>';\n print_r($wrk_data['inventory']['add']);\n echo '</pre>';\n }\n \n if ($nrowB > 0)\n\t{\n while($rowB = mssql_fetch_array($resB))\n {\n $wrk_data['bids']['curr'][]=$rowB;\n }\n \n $wrk_data['bids']['add']=array_diff($inc_data['jc_ar']['bids'],$wrk_data['bids']['curr']);\n\t}\n else\n {\n $wrk_data['bids']['add']=$inc_data['jc_ar']['bids'];\n }\n \n if ($fn_debug['all'] or $fn_debug['bids'])\n {\n echo '<pre>';\n echo 'Existing Bids: ('.$nrowB.')<br>';\n echo \"Incoming Bids: (\".count($inc_data['jc_ar']['bids']).\")<br>\";\n echo 'Bid Adds: <br>';\n print_r($wrk_data['bids']['add']);\n echo '</pre>';\n }\n\t\n\tif ($nrowA > 0)\n\t{\n while($rowA = mssql_fetch_array($resA))\n {\n $wrk_data['adjusts']['curr'][]=$rowA;\n }\n \n $wrk_data['adjusts']['add']=array_diff($inc_data['jc_ar']['adjusts'],$wrk_data['adjusts']['curr']);\n\t}\n else\n {\n $wrk_data['adjusts']['add']=$inc_data['jc_ar']['adjusts'];\n }\n\t\n if ($fn_debug['all'] or $fn_debug['adjusts'])\n {\n echo '<pre>';\n echo 'Existing Adjusts: ('.$nrowA.')<br>';\n echo \"Incoming Adjusts: (\".count($inc_data['jc_ar']['adjusts']).\")<br>\";\n echo 'Adjust Adds: <br>';\n print_r($wrk_data['adjusts']['add']);\n echo '</pre>';\n }\n \n exit;\n\t//echo '<pre>';\n\t$preqry='BEGIN TRANSACTION';\n\t$pstqry='COMMIT TRANSACTION';\n \n $srvcnt=0;\n if (count($wrk_data['service']['add']) > 0)\n\t{\n $srvqry='';\n foreach ($wrk_data['service']['add'] as $ns=>$vs)\n {\n $srvqry=$srvqry.\"\n INSERT INTO [jest]..[JobCost_Service] (\n [srvid], [oid], [jobid], [jadd], [phsid],\n [ListID], [EditSequence], [code],\n [itemname], [itemattrib1], [itemattrib2],\n [unitprice], [totalprice], [tquantity]\n ) VALUES (\n \".$vs['srvid'].\", \".$vs['oid'].\", '\".$vs['jobid'].\"', \".$vs['jadd'].\", \".$vs['phsid'].\",\n '\".$vs['ListID'].\"', '\".$vs['EditSequence'].\"', '\".$vs['code'].\"',\n '\".substr(trim($vs['itemname']),0,30).\"', '\".substr(trim($vs['itemattrib1']),0,30).\"','\".substr(trim($vs['itemattrib2']),0,30).\"',\n cast('\".$vs['unitprice'].\"' as money), cast('\".$vs['totalprice'].\"' as money), \".$vs['tquantity'].\");\n \";\n $srvcnt++;\n }\n \n if ($srvcnt > 0)\n {\n mssql_query($preqry.$srvqry.$pstqry);\n //echo $preqry.$srvqry.$pstqry;\n }\n\t}\n\t\n $matcnt=0;\n if (count($wrk_data['material']['add']) > 0)\n\t{\n $matqry='';\n foreach ($wrk_data['material']['add'] as $nm=>$vm)\n {\n $matqry=$matqry.\"\n INSERT INTO [jest]..[JobCost_Material] (\n [invid], [oid], [jobid], [jadd], [phsid],\n [matid], [vpno], [ListID], [EditSequence], [code],\n [itemname], [itemattrib1], [itemattrib2],\n [unitprice], [totalprice], [tquantity]\n ) VALUES (\n \".$vm['invid'].\", \".$vm['oid'].\", '\".$vm['jobid'].\"', \".$vs['jadd'].\", \".$vm['phsid'].\",\n \".$vm['matid'].\", '\".$vm['vpno'].\"','\".$vm['ListID'].\"', '\".$vm['EditSequence'].\"', '\".$vm['code'].\"',\n '\".substr(trim($vm['itemname']),0,30).\"', '\".substr(trim($vm['itemattrib1']),0,30).\"','\".substr(trim($vm['itemattrib2']),0,30).\"',\n cast('\".$vm['unitprice'].\"' as money), cast('\".$vm['totalprice'].\"' as money), \".$vm['tquantity'].\");\n \";\n $matcnt++;\n }\n \n if ($matcnt > 0)\n {\n mssql_query($preqry.$matqry.$pstqry);\n //echo $preqry.$matqry.$pstqry;\n }\n\t}\n\t\n $invcnt=0;\n if (count($wrk_data['inventory']['add']) > 0)\n\t{\n $invqry='';\n foreach ($wrk_data['inventory']['add'] as $ni=>$vi)\n {\n $invqry=$invqry.\"\n INSERT INTO [jest]..[JobCost_Inventory] (\n [invid], [oid], [jobid], [jadd], [phsid],\n [matid], [vpno], [ListID], [EditSequence], [code],\n [itemname], [itemattrib1], [itemattrib2],\n [unitprice], [totalprice], [tquantity]\n ) VALUES (\n \".$vi['invid'].\", \".$vi['oid'].\", '\".$vi['jobid'].\"', \".$vs['jadd'].\", \".$vi['phsid'].\",\n \".$vi['matid'].\", '\".$vi['vpno'].\"','\".$vi['ListID'].\"', '\".$vi['EditSequence'].\"', '\".$vi['code'].\"',\n '\".substr(trim($vi['itemname']),0,30).\"', '\".substr(trim($vi['itemattrib1']),0,30).\"','\".substr(trim($vi['itemattrib2']),0,30).\"',\n cast('\".$vi['unitprice'].\"' as money), cast('\".$vi['totalprice'].\"' as money), \".$vi['tquantity'].\");\n \";\n $invcnt++;\n }\n \n if ($invcnt > 0)\n {\n mssql_query($preqry.$invqry.$pstqry);\n //echo $preqry.$invqry.$pstqry;\n }\n\t}\n \n $bidcnt=0;\n if (count($wrk_data['bids']['add']) > 0)\n\t{\n $bidqry='';\n foreach ($wrk_data['bids']['add'] as $nb=>$vb)\n {\n $bidqry=$bidqry.\"\n INSERT INTO [jest]..[JobCost_BidCost] (\n [bid], [oid], [jobid], [jadd], [phsid],\n [ListID], [EditSequence], [code],\n [itemname], [itemattrib1], [itemattrib2],\n [unitprice], [totalprice], [tquantity]\n ) VALUES (\n \".$vb['bid'].\", \".$vb['oid'].\", '\".$vb['jobid'].\"', \".$vb['jadd'].\", \".$vb['phsid'].\",\n '\".$vb['ListID'].\"', '\".$vb['EditSequence'].\"', '\".$vb['code'].\"',\n '\".substr(trim($vb['itemname']),0,30).\"', '\".substr(trim($vb['itemattrib1']),0,30).\"','\".substr(trim($vb['itemattrib2']),0,30).\"',\n cast('\".$vb['unitprice'].\"' as money), cast('\".$vb['totalprice'].\"' as money), \".$vb['tquantity'].\");\n \";\n $bidcnt++;\n }\n \n if ($bidcnt > 0)\n {\n mssql_query($preqry.$bidqry.$pstqry);\n //echo 'Bid Items: '.$bidcnt.'<br>';\n //echo $preqry.$invqry.$pstqry;\n }\n\t}\n\t\n $adjcnt=0;\n\tif (count($wrk_data['adjusts']['add']) > 0)\n\t{\n $adjcnt=0;\n $adjqry='';\n foreach ($wrk_data['adjusts']['add'] as $na=>$va)\n {\n $adjqry=$adjqry.\"\n INSERT INTO [jest].[dbo].[JobCost_Adjusts] (\n [aid], [oid], [jobid], [jadd], [phsid],\n [ListID], [EditSequence], [code],\n [itemname], [itemattrib1], [itemattrib2],\n [unitprice], [totalprice], [tquantity]\n ) VALUES (\n \".$va['aid'].\", \".$va['oid'].\", '\".$va['jobid'].\"', \".$vs['jadd'].\", \".$va['phsid'].\",\n '\".$va['ListID'].\"', '\".$va['EditSequence'].\"', '\".$va['code'].\"',\n '\".substr(trim($va['itemname']),0,30).\"', '\".substr(trim($va['itemattrib1']),0,30).\"','\".substr(trim($va['itemattrib2']),0,30).\"',\n cast('\".$va['unitprice'].\"' as money), cast('\".$va['totalprice'].\"' as money), \".$va['tquantity'].\");\n \";\n $adjcnt++;\n }\n \n if ($adjcnt > 0)\n {\n mssql_query($preqry.$adjqry.$pstqry);\n //echo 'Adjust Items: '.$adjcnt.'<br>';\n //echo $preqry.$invqry.$pstqry;\n }\n\t}\n \n //$pmtcnt=proc_payment_sched($v_ar,read_payment_sched($v_ar['oid'],$v_ar['jobid'],0));\n $pmtcnt=0;\n\t\n\t//echo '</pre>';\n \n /*\n $out=array(\n 'tprc'=>($srvcnt+$matcnt+$invcnt+$bidcnt+$adjcnt+$pmtcnt),\n 'srv'=>$srvcnt,'mat'=>$matcnt,\n 'inv'=>$invcnt,'bid'=>$bidcnt,\n 'adj'=>$adjcnt,'pmt'=>$pmtcnt,\n 'srverr'=>print_r($inc_data['jc_ar']['service_errors']),'materr'=>print_r($inc_data['jc_ar']['material_errors']),\n 'inverr'=>print_r($inc_data['jc_ar']['inventory_errors']),'biderr'=>print_r($inc_data['jc_ar']['bids_errors']),\n 'adjerr'=>print_r($inc_data['jc_ar']['adjusts_errors'])\n );\n */\n \n //$out=$inc_data['jc_ar']['service_errors'];\n\t//return $out;\n}", "protected function _validate() {\n\t}", "public function check_data()\n {\n parent::check_data();\n\n if(empty($this->build_notifications))\n {\n throw new exception('<strong>Data missing: Notifications</strong>');\n }\n\n if(empty($this->build_batch_reference))\n {\n throw new exception('<strong>Data missing: Batch References</strong>');\n }\n }", "function main()\n{\n\t$research = ResearchService::getAll();\n\tif (!is_null($research)) {\n\t\thttp_response_code(201);\n\t\tJsonDataObject::createResponse($research);\n\t} else {\n\t\thttp_response_code(200);\n\t\tJsonDataObject::createResponse(['error' => 'That user does not exist']);\n\t}\n}", "public function manageCatalog()\r\n {\r\n foreach ($this->data as $line) {\r\n if (count($line) > 2 || ($line[0] == '' && $line[1] == '')) {\r\n $this->invalid_line[] = implode(\";\", $line);\r\n } else {\r\n foreach ($line as $k => $v) {\r\n if ($this->getType($v) == \"name\") {\r\n $name[] = $v;\r\n } elseif ($this->getType($v) == \"number\") {\r\n $v = str_replace(\" \", \"\", trim($v));\r\n $number[] = $v;\r\n $validatednumber[] = $this->validateTelNum($v);\r\n } elseif ($this->getType($v) == \"empty\") {\r\n if ($this->getType($this->temp) == \"name\") {\r\n $v = str_replace(\" \", \"\", trim($v));\r\n $number[] = $v;\r\n $validatednumber[] = $this->validateTelNum($v);\r\n } else{\r\n $name[] = $v;\r\n }\r\n }\r\n $this->temp = $v;\r\n }\r\n }\r\n }\r\n $this->raw_catalog = array_combine($name, $number); // array me ola ta onomata kai ta noumera opws erxetai apo to arxeio\r\n $this->tempcatalog = array_combine($name, $validatednumber); // array me ola ta onomata kai \"invalid number\" opou einai lathos to noumero \r\n $this->create_catalogs($this->tempcatalog);\r\n /*foreach (array_keys($this->tempcatalog, \"invalid number\") as $k => $v) {\r\n $invalidname[] = $v;\r\n $invalidnumber[] = $this->raw_catalog[$v];\r\n $this->invalidcatalog = array_combine($invalidname, $invalidnumber); //aray me onomata kai \"invalid number\" mono\r\n unset($this->tempcatalog[$v]); // kopsimo twn \"invalid number\"\r\n }\r\n foreach ($this->tempcatalog as $k => $v) {\r\n if ($k == '') {\r\n unset($this->tempcatalog[$k]);\r\n $this->invalidcatalog += array($k => $v);\r\n \r\n }\r\n }\r\n $this->invalidcatalog += array('invalid line' => $this->invalid_line);*/\r\n //foreach ($this->tempcatalog as $k => $v) {\r\n /*foreach ($this->valid_catalog->number as $k => $v) {\r\n $finalnumber[] = $this->transformTelNum($v, $this->outputformat);\r\n $final_name[] = $k;\r\n if ($this->order == \"names\") {\r\n $this->finalcatalog = array_combine($final_name, $finalnumber); //array me onomata kai noumera se morfh pou edwse o xrhsths\r\n } else {\r\n $this->finalcatalog = array_combine($finalnumber, $final_name); //array me onomata kai noumera se morfh pou edwse o xrhsths\r\n }\r\n }*/\r\n $this->Catalogs = new ArrayObject();\r\n $this->Catalogs[\"rawcatalog\"] = $this->raw_catalog;\r\n $this->Catalogs[\"validcatalog\"] = $this->valid_catalog;\r\n $this->Catalogs[\"invalidcatalog\"] = $this->invalid_catalog;\r\n $this->Catalogs[\"validatedcatalog\"] = $this->validated_catalog;\r\n return $this->Catalogs;\r\n //return array($this->finalcatalog, $this->invalid_catalog);\r\n }", "function jx_chkvalidprodbc()\r\n\t{\r\n\t\t$this->erpm->auth(PNH_INVOICE_RETURNS|PNH_ADD_INVOICE_RETURN);\r\n\t\t\r\n\t\t//get product and barcode from post \r\n\t\t$prod_id = $this->input->post('pid');\r\n\t\t$prod_bc = $this->input->post('bc');\r\n\t\t\r\n\t\t$output = array();\r\n\t\t\r\n\t\t// check stock entry for barcode against product \r\n\t\t$is_available = $this->db->query('select count(*) as t from t_stock_info where product_id = ? and product_barcode = ? ',array($prod_id,$prod_bc))->row()->t;\r\n\t\tif($is_available)\r\n\t\t{\r\n\t\t\t$output['status'] = 'success';\r\n\t\t}else\r\n\t\t{\r\n\t\t\t$output['status'] = 'error';\r\n\t\t}\r\n\t\t\r\n\t\techo json_encode($output);\r\n\t}", "public function inquire_bill_get(){\r\n// if (!$this->pronet_model->inquire_bill(1, '002', '0000000',0, null, 'E004', 3)) {\r\n if (!$this->pronet_model->inquire_bill(1, '101', '999999999999',0, null, 'E007', 10)) {//test for financial services using genesis\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => FALSE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_BAD_REQUEST);\r\n } else {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => TRUE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_OK);\r\n }\r\n }", "public function _check()\n {\n }", "public function e_book()\n\t{\n\t\tif (preg_match('/^New eBooks.+[ _-]{0,3}(\"|#34;)(.+?.+)\\.(par|vol|rar|nfo).*?(\"|#34;)/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\tif (preg_match('/^\\(Nora Roberts\\)\"(.+?)\\.(epub|mobi|html|pdf|azw)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Doctor Who - Target Books [128/175] - \"DW125_ Terror of the Vervoids - Pip Baker.mobi\" yEnc\n\t\tif (preg_match('/^Doctor Who - Target Books \\[\\d+\\/(\\d+\\]) - \"DW[0-9]{0,3}[-_\\s]{0,3}(.+?)\\.(txt|pdf|mobi|epub|azw)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //(American Curves - Summer 2012) [01/10] - \"AMECURSUM12.par2\" yEnc\n\t\tif (preg_match('/^\\(([a-zA-Z0-9 -]+)\\) \\[\\d+\\/(\\d+\\]) - \".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//(NordicAlbino) [01/10] - \"SWHQ_NA_675qe0033102suSmzSE.sfv\" yEnc\n\t\t//365 Sex Positions A New Way Every Day for a Steamy Erotic Year [eBook] - (1/5) \"365.Sex.Positions.A.New.Way.Every.Day.for.a.Steamy.Erotic.Year.eBook.nfo\" - yenc yEnc\n\t\tif (preg_match('/(.+)[-_\\s]{0,3}[\\(\\[]\\d+\\/\\d+[\\)\\]][-_\\s]{0,3}\"(.+?)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//[1/8] - \"Robin Lane Fox - Travelling heroes.epub\" yEnc\n\t\t//(1/1) \"Unintended Consequences - John Ross.nzb\" - 8.67 kB - yEnc\n\t\tif (preg_match('/^[\\(\\[]\\d+\\/\\d+[\\)\\]][-_\\s]{0,3}\"(.+?)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\")([-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB])?[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[ Mega Dating and Sex Advice Ebooks - Tips and Tricks for Men PDF ] - \"Vatsyayana - The Kama Sutra.pdf.rar\" - (54/58) yEnc\n\t\tif (preg_match('/^[\\(\\[] .+? [\\)\\][-_\\s]{0,3}\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")[-_\\s]{0,3}[\\(\\[]\\d+\\/(\\d+[\\)\\]])[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //WWII in Photos - \"WWII in Photos_05_Conflict Spreads Around the Globe - The Atlantic.epub\" yEnc\n\t\tif (preg_match('/^(WWII in Photos)[-_\\s]{0,3}\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //Various ebooks on History pdf format \"Chelsea House Publishing Discovering U.S. History Vol. 8, World War I and the Roaring Twenties - 1914-1928 (2010).pdf\" [1 of 1] yEnc\n\t\tif (preg_match('/^.+?\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")[-_\\s]{0,3}\\[\\d+ of (\\d+\\])[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //A few things - [4 of 13] \"Man From U.N.C.L.E. 08 - The Monster Wheel Affair - David McDaniel.epub\" yEnc\n\t\tif (preg_match('/.+[\\(\\[]\\d+ of \\d+[\\)\\]] \"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //DDR Kochbuch 1968-wir kochen gut [1/1] - \"DDR Kochbuch 1968-wir kochen gut.pdf\" toby042002\n\t\tif (preg_match('/.+[\\(\\[]\\d+\\/\\d+[\\)\\]] - \"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\") toby\\d+$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Pottermore UK retail - \"Harry Potter and the Goblet of Fire - J.K. Rowling.epub\" (05/14) - 907.57 kB - yEnc\n\t\tif (preg_match('/^.+?[-_\\s]{0,3}\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\") [\\(\\[]\\d+\\/\\d+[\\)\\]] ([-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB])?[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[001/125] (NL Epub Wierook Set 49) - \"Abulhawa, Susan - Litteken van David_Ochtend in Jenin.epub\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\] .+? - \"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\") yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(1/1) \"Radiological Imaging of the Kidney - E. Quaia (Springer, 2011) WW.pdf\" - 162,82 MB - (Radiological Imaging of the Kidney - E. Quaia (Springer, 2011) WW) yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(1/7) \"0865779767.epub\" - 88,93 MB - \"Anatomic Basis of Neurologic Diagnosis - epub\" yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \".+(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")([-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB])?[-_\\s]{0,3}\"(.+?)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[4];\n\t\t}\n\t\t//Re: REQ: Jay Lake's Mainspring series/trilogy (see titles inside) - \"Lake, Jay - Clockwork Earth 03 - Pinion [epub].rar\" 405.6 kBytes yEnc\n\t\t//Attn: Brownian - \"del Rey, Maria - Paradise Bay (FBS).rar\" yEnc\n\t\t//New Scan \"Herbert, James - Sepulchre (html).rar\" yEnc\n\t\tif (preg_match('/^(Attn:|Re: REQ:|New Scan).+?[-_\\s]{0,3}\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")[-_\\s]{0,3}(\\d+[.,]\\d+ [kKmMgG][bB](ytes)?)? yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//\"Gabaldon, Diana - Outlander [5] The Fiery Cross.epub\" yEnc\n\t\t//Kiny Friedman \"Friedman, Kinky - Prisoner of Vandam Street_ A Novel, The.epub\" yEnc\n\t\tif (preg_match('/.*\"(.+?)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Patterson flood - Mobi - 15/45 \"James Patterson - AC 13 - Double Cross.mobi\"\n\t\tif (preg_match('/(.+?)[-_\\s]{0,3}\\d+\\/(\\d+[-_\\s]{0,3}\".+?)\\.(txt|pdf|mobi|epub|azw)\"( \\(\\d+\\/\\d+\\))?( )?$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //04/63 Brave New World Revisited - Aldous Huxley.mobi yEnc\n\t\tif (preg_match('/\\d+\\/\\d+[-_\\s]{0,3}(.+)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //- Campbell, F.E. - Susan - HIT 125.rar BDSM Themed Adult Erotica - M/F F/F - Rtf & Pdf\n\t\tif (preg_match('/^- (.+?)\\.(par|vol|rar|nfo)[-_\\s]{0,3}(.+)/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //\"D. F. Jones - 03 - Colossus and The Crab.epub\" (1/3)\n\t\tif (preg_match('/^\"(.+?)\\.(txt|pdf|mobi|epub|azw)\" \\(\\d+\\/(\\d+\\))/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"D. F. Jones - 01 - Colossus.epub\" (note the space on the end)\n\t\tif (preg_match('/^\"(.+?)\\.(txt|pdf|mobi|epub|azw|lit|rar|nfo|par)\" $/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[01/19] - \"13_X_Panzer_Tracts_EBook.nfo \" yEnc\n\t\tif (preg_match('/^\\[\\d*+\\/(\\d+\\]) - \"(.+?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev\"|\\.vol.+?\"|\\.[A-Za-z0-9]{2,4} \"|\") yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//[09/14] Sven Hassel - Legion of the Damned 09, Reign of Hell.mobi sven hassel as requested (1/7) yEnc\n\t\t//[1/1] Alex Berenson - John Wells 05, The Secret Soldier.mobi (space at end)\n\t\tif (preg_match('/^\\[\\d+\\/(\\d+\\]) (.+?)\\.(txt|pdf|mobi|epub|azw|lit|rar|nfo|par).+?(yEnc)?$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//[1/1] - \"Die Kunst der Fotografie Lehrbuch und Bildband f r ambitionierte Fotografen.rar\"\n\t\t//[1/1] - \"Demonic_ How the Liberal Mob Is Endanger - Coulter, Ann.mobi\" (note space at end)\n\t\t//[1/1] - \"Paris in Love_ A Memoir - Eloisa James.mobi\" 1861K\n\t\tif (preg_match('/^\\[\\d+\\/(\\d+\\]) - \"(.+?)\\.(txt|pdf|mobi|epub|azw|lit|rar|nfo|par)\"( \\d+K)?( )?$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //002/240 Swordships.of.Scorpio.(Dray.Prescot).-.Alan.Burt.Akers.epub\n\t\tif (preg_match('/^\\d+\\/(\\d+)[-_\\s]{0,3}(.+?)\\.(txt|pdf|mobi|epub|azw|lit|rar|nfo|par)$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //Akers Alan Burt - Dray Prescot Saga 14 - Krozair von Kregen.rar yEnc\n\t\tif (preg_match('/^([a-zA-Z0-9. ].+?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev\"|\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\"|) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "function book($param1 = '', $param2 = '', $param3 = '') {\n if ($this->session->userdata('admin_login') != 1)\n redirect('login', 'refresh');\n if ($param1 == 'create') {\n $data['name'] = $this->input->post('name');\n $data['description'] = $this->input->post('description');\n $data['price'] = $this->input->post('price');\n $data['author'] = $this->input->post('author');\n $data['class_id'] = $this->input->post('class_id');\n $data['status'] = $this->input->post('status');\n $data['barcode_no'] = $this->input->post('barcode_no');\n $data['created'] = date(\"Y-m-d\");\n $this->db->insert('book', $data);\n $this->session->set_flashdata('flash_message', get_phrase('data_added_successfully'));\n redirect(base_url() . 'admin/book', 'refresh');\n }\n if ($param1 == 'do_update') {\n $data['name'] = $this->input->post('name');\n $data['description'] = $this->input->post('description');\n $data['price'] = $this->input->post('price');\n $data['author'] = $this->input->post('author');\n $data['class_id'] = $this->input->post('class_id');\n $data['status'] = $this->input->post('status');\n $data['barcode_no'] = $this->input->post('barcode_no');\n $this->db->where('book_id', $param2);\n $this->db->update('book', $data);\n $this->session->set_flashdata('flash_message', get_phrase('data_updated'));\n redirect(base_url() . 'admin/book', 'refresh');\n } else if ($param1 == 'edit') {\n $page_data['edit_data'] = $this->db->get_where('book', array(\n 'book_id' => $param2\n ))->result_array();\n }\n if ($param1 == 'delete') {\n $this->db->where('book_id', $param2);\n $this->db->delete('book');\n $this->session->set_flashdata('flash_message', get_phrase('data_deleted'));\n redirect(base_url() . 'admin/book', 'refresh');\n }\n $page_data['books'] = $this->db->get('book')->result_array();\n $page_data['page_name'] = 'book';\n $page_data['page_title'] = get_phrase('manage_library_books');\n $this->load->view('backend/index', $page_data);\n}", "function booklinkp($author,$isbn,$title=\"\",$pubyear=\"\",$adddate=\"\",$float=\"left\",$type=\"t\",$size=\"s\",$top=\"0\",$bordersize=\"0\",$bordercolor=\"000000\")\n {\n $type=strtolower($type);\n if ($float==\"l\") $float=\"left\";\n if ($float==\"r\") $float=\"right\";\n if (($float==\"left\")) $marg=\"right\"; else $marg=\"left\";\n\t$title=stripcslashes($title);\n\t$title=strtolower($title);\n\t$title=nomorexs($title);\n\t$author=nomorexs($author);\n\t$title=ucwords($title);\t\n\t$temptitle =explode(\":\",$title);\n\t$author=stripcslashes($author);\n $titleplus= str_replace(' ','+',$temptitle[0]);\n\t$titleplus= str_replace('&+','',$titleplus);\n $authorplus= str_replace(' ','+',$author);\n\t$authorplus= str_replace('&+','',$authorplus);\n if ($type==\"t\") { $type=\"TI%5ETITLE\"; $keywordsplus= $titleplus; }\n elseif ($type==\"a\") { $type=\"AU%5EAUTHOR\"; $keywordsplus= $authorplus; }\n elseif ($type==\"i\") { $type=\"ISBN\"; $keywordsplus= $isbn;}\n\t\n\t\t\t\t$adyear= (int) substr($adddate,2,2);\n\t\t\t\t$admonth= (int) substr($adddate,4,2);\n\t\t\t\t$adday= (int) substr($adddate,6,2);\n\t\t\t\t$adddate = $admonth.\"/\".$adday.\"/\".$adyear;\n $datedata =\" &copy; \".$pubyear.\" (Added: \".$adddate.\")\";\n // \"&amp;pubyear=\".$pubyear.\n\techo \"<a href=\\\"http://cat.mfrl.org/uhtbin/cgisirsi.exe/0/CBURG/0/5?searchdata1=%22\".\n\t$keywordsplus.\"%22&amp;srchfield1=\".$type.\"&amp;searchoper1=AND&amp;searchdata2=%22\"\n\t.$authorplus.\"%22&amp;srchfield2=AU%5EAUTHOR\\\">\";\n\t$filename=\"images/isbn/\".$isbn.\"S.GIF\";\n\tif (file_exists($filename)) { echo \"<img src=\\\"/\".$filename.\"\\\"\";}\n\telse echo \"<img src=\\\"http://syndetics.com/index.aspx?isbn=\".$isbn.\"/\".$size.\"C.GIF\\\"\";\n\techo \" style=\\\"border:\".$bordersize.\"px solid #\".$bordercolor.\"; float:\".$float.\"; \".$yodaexception.\" margin-\".$marg.\":3px;\";\n\tif ($top!=\"0\") echo \" margin-top:\".$top.\"px;\";\n\tif ($title==\"\") {echo \"\\\" alt=\\\"\".$author.\"\\\" title=\\\"\".$author.\"\\\"></a>\";}\n\telse {echo \"\\\" alt=\\\"\".$title.\" by \".$author.$datedata.\"\\\" title=\\\"\".$title.\" by \".$author.$datedata.\"\\\"></a>\";}\n}", "function add_book() {\n global $wpdb;\n\n $this->check_dir();\n $this->check_db();\n\n foreach($_POST as $key=>$value) {\n \t$_POST[\"$key\"] = $wpdb->escape($value);\n }\n\n $sql = \"insert into `\".$this->table_name.\"` (`name`, `date`) values ('\".$_POST['name'].\"', '\".date(\"U\").\"')\";\n $wpdb->query($sql);\n $id = $wpdb->get_var(\"select LAST_INSERT_ID();\", 0, 0);\n $xml_file = $this->plugin_path.$this->books_dir.\"/\".$id.\".xml\";\n\n $xml = $this->create_xml($_POST['Width'], $_POST['Height'], $_POST['LoaderColor'], $_POST['InnerSideColor'], $_POST['Autoplay'], $_POST['FieldOfView'], $_POST['SideShadowAlpha'], $_POST['DropShadowAlpha'], $_POST['DropShadowDistance'], $_POST['DropShadowScale'], $_POST['DropShadowBlurX'], $_POST['DropShadowBlurY'], $_POST['MenuDistanceX'], $_POST['MenuDistanceY'], $_POST['MenuColor1'], $_POST['MenuColor2'], $_POST['MenuColor3'], $_POST['ControlSize'], $_POST['ControlDistance'] , $_POST['ControlColor1'], $_POST['ControlColor2'], $_POST['ControlAlpha'], $_POST['ControlAlphaOver'], $_POST['ControlsX'], $_POST['ControlsY'],$_POST['ControlsAlign'], $_POST['TooltipHeight'], $_POST['TooltipColor'], $_POST['TooltipTextY'], $_POST['TooltipTextStyle'], $_POST['TooltipTextColor'], $_POST['TooltipMarginLeft'], $_POST['TooltipMarginRight'], $_POST['TooltipTextSharpness'], $_POST['TooltipTextThickness'], $_POST['InfoWidth'], $_POST['InfoBackground'], $_POST['InfoBackgroundAlpha'], $_POST['InfoMargin'], $_POST['InfoSharpness'], $_POST['InfoThickness'], '', '' );\n $config_file = @fopen($xml_file, \"w+\");\n if(!fwrite($config_file, $xml)) {\n \t$sql = \"delete from `\".$this->table_name.\"` where `id` = '\".$id.\"'\";\n \t$wpdb->query($sql);\n\n \techo \"Adding piecemaker error! Please setup permission to the piecemakers/ , piecemaker-images/ folders and include files to &quot;777&nbsp;\";\n\t\t return 0;\n }\n fclose($config_file);\n\t}", "function addressbook_init($showerr = true, $onlylocal = false) {\n global $data_dir, $username, $ldap_server, $address_book_global_filename;\n global $addrbook_dsn, $addrbook_table;\n global $abook_global_file, $abook_global_file_writeable, $abook_global_file_listing;\n global $addrbook_global_dsn, $addrbook_global_table, $addrbook_global_writeable, $addrbook_global_listing;\n global $abook_file_line_length;\n\n /* Create a new addressbook object */\n $abook = new AddressBook;\n\n /* Create empty error message */\n $abook_init_error='';\n\n /*\n Always add a local backend. We use *either* file-based *or* a\n database addressbook. If $addrbook_dsn is set, the database\n backend is used. If not, addressbooks are stores in files.\n */\n if (isset($addrbook_dsn) && !empty($addrbook_dsn)) {\n /* Database */\n if (!isset($addrbook_table) || empty($addrbook_table)) {\n $addrbook_table = 'address';\n }\n $r = $abook->add_backend('database', Array('dsn' => $addrbook_dsn,\n 'owner' => $username,\n 'table' => $addrbook_table));\n if (!$r && $showerr) {\n $abook_init_error.=_(\"Error initializing address book database.\") . \"\\n\" . $abook->error;\n }\n } else {\n /* File */\n $filename = getHashedFile($username, $data_dir, \"$username.abook\");\n $r = $abook->add_backend('local_file', Array('filename' => $filename,\n 'umask' => 0077,\n 'line_length' => $abook_file_line_length,\n 'create' => true));\n if(!$r && $showerr) {\n // no need to use $abook->error, because message explains error.\n $abook_init_error.=sprintf( _(\"Error opening file %s\"), $filename );\n }\n }\n\n /* Global file based addressbook */\n if (isset($abook_global_file) &&\n isset($abook_global_file_writeable) &&\n isset($abook_global_file_listing) &&\n trim($abook_global_file)!=''){\n\n // Detect place of address book\n if (! preg_match(\"/[\\/\\\\\\]/\",$abook_global_file)) {\n /* no path chars, address book stored in data directory\n * make sure that there is a slash between data directory\n * and address book file name\n */\n $abook_global_filename=$data_dir\n . ((substr($data_dir, -1) != '/') ? '/' : '')\n . $abook_global_file;\n } elseif (preg_match(\"/^\\/|\\w:/\",$abook_global_file)) {\n // full path is set in options (starts with slash or x:)\n $abook_global_filename=$abook_global_file;\n } else {\n $abook_global_filename=SM_PATH . $abook_global_file;\n }\n\n $r = $abook->add_backend('local_file',array('filename'=>$abook_global_filename,\n 'name' => _(\"Global Address Book\"),\n 'detect_writeable' => false,\n 'line_length' => $abook_file_line_length,\n 'writeable'=> $abook_global_file_writeable,\n 'listing' => $abook_global_file_listing));\n\n /* global abook init error is not fatal. add error message and continue */\n if (!$r && $showerr) {\n if ($abook_init_error!='') $abook_init_error.=\"\\n\";\n $abook_init_error.=_(\"Error initializing global address book.\") . \"\\n\" . $abook->error;\n }\n }\n\n /* Load global addressbook from SQL if configured */\n if (isset($addrbook_global_dsn) && !empty($addrbook_global_dsn)) {\n /* Database configured */\n if (!isset($addrbook_global_table) || empty($addrbook_global_table)) {\n $addrbook_global_table = 'global_abook';\n }\n $r = $abook->add_backend('database',\n Array('dsn' => $addrbook_global_dsn,\n 'owner' => 'global',\n 'name' => _(\"Global Address Book\"),\n 'writeable' => $addrbook_global_writeable,\n 'listing' => $addrbook_global_listing,\n 'table' => $addrbook_global_table));\n /* global abook init error is not fatal. add error message and continue */\n if (!$r && $showerr) {\n if ($abook_init_error!='') $abook_init_error.=\"\\n\";\n $abook_init_error.=_(\"Error initializing global address book.\") . \"\\n\" . $abook->error;\n }\n }\n\n /*\n * hook allows to include different address book backends.\n * plugins should extract $abook and $r from arguments\n * and use same add_backend commands as above functions.\n * Since 1.5.2 hook sends third ($onlylocal) argument to address book\n * plugins in order to allow detection of local address book init.\n * @since 1.5.1 and 1.4.5\n * Since 1.5.2, the plugin arguments are passed inside an array\n * and by reference, so plugins hooking in here need to accept arguments\n * in an array and change those values as needed instead of returning\n * the changed values.\n */\n $temp = array(&$abook, &$r, &$onlylocal);\n do_hook('abook_init', $temp);\n if (!$r && $showerr) {\n if ($abook_init_error!='') $abook_init_error.=\"\\n\";\n $abook_init_error.=_(\"Error initializing other address books.\") . \"\\n\" . $abook->error;\n }\n\n /* Load configured LDAP servers (if PHP has LDAP support) */\n if (isset($ldap_server) && is_array($ldap_server)) {\n reset($ldap_server);\n while (list($undef,$param) = each($ldap_server)) {\n if (!is_array($param))\n continue;\n\n /* if onlylocal is true, we only add writeable ldap servers */\n if ($onlylocal && (!isset($param['writeable']) || $param['writeable'] != true))\n continue;\n\n $r = $abook->add_backend('ldap_server', $param);\n if (!$r && $showerr) {\n if ($abook_init_error!='') $abook_init_error.=\"\\n\";\n $abook_init_error.=sprintf(_(\"Error initializing LDAP server %s:\"), $param['host']).\"\\n\";\n $abook_init_error.= $abook->error;\n }\n }\n } // end of ldap server init\n\n /**\n * display address book init errors.\n */\n if ($abook_init_error!='' && $showerr) {\n error_box(nl2br(sm_encode_html_special_chars($abook_init_error)));\n }\n\n /* Return the initialized object */\n return $abook;\n}", "protected function _readRecords() {}", "abstract public function validateData();", "private function process_input()\n\t{\n\t//\t$report_end_datetime = OurTime::js_to_datetime($this->f_report_end, 1);\n\t\t\n\t\t$this->m_product_info_arr = DB::get_all_rows_fq ('\n\t\t\tSELECT products.*\n\t\t\tFROM products\n\t\t');\n\t\t\n\t\t//TESTING: show how many rows we got:\n\t\t//echo count($this->m_obj_info_arr);*/\n\n\t}", "function readInputData() {\n\t\t$this->readUserVars(array('subscriptionName', 'subscriptionEmail', 'subscriptionPhone', 'subscriptionFax', 'subscriptionMailingAddress', 'subscriptionAdditionalInformation', 'enableDelayedOpenAccess', 'delayedOpenAccessDuration', 'delayedOpenAccessPolicy', 'enableOpenAccessNotification', 'enableAuthorSelfArchive', 'authorSelfArchivePolicy', 'subscriptionExpiryPartial', 'enableSubscriptionOnlinePaymentNotificationPurchaseIndividual', 'enableSubscriptionOnlinePaymentNotificationPurchaseInstitutional', 'enableSubscriptionOnlinePaymentNotificationRenewIndividual', 'enableSubscriptionOnlinePaymentNotificationRenewInstitutional', 'enableSubscriptionExpiryReminderBeforeMonths', 'numMonthsBeforeSubscriptionExpiryReminder', 'enableSubscriptionExpiryReminderBeforeWeeks', 'numWeeksBeforeSubscriptionExpiryReminder', 'enableSubscriptionExpiryReminderAfterWeeks', 'numWeeksAfterSubscriptionExpiryReminder', 'enableSubscriptionExpiryReminderAfterMonths', 'numMonthsAfterSubscriptionExpiryReminder'));\n\n\t\t// If delayed open access selected, ensure a valid duration is provided\n\t\tif ($this->_data['enableDelayedOpenAccess'] == 1) {\n\t\t\t$this->addCheck(new FormValidatorInSet($this, 'delayedOpenAccessDuration', 'required', 'manager.subscriptionPolicies.delayedOpenAccessDurationValid', array_keys($this->validDuration)));\n\t\t}\n\n\t\t// If expiry reminder before months is selected, ensure a valid month value is provided\n\t\tif ($this->_data['enableSubscriptionExpiryReminderBeforeMonths'] == 1) {\n\t\t\t$this->addCheck(new FormValidatorInSet($this, 'numMonthsBeforeSubscriptionExpiryReminder', 'required', 'manager.subscriptionPolicies.numMonthsBeforeSubscriptionExpiryReminderValid', array_keys($this->validNumMonthsBeforeExpiry)));\n\t\t}\n\n\t\t// If expiry reminder before weeks is selected, ensure a valid week value is provided\n\t\tif ($this->_data['enableSubscriptionExpiryReminderBeforeWeeks'] == 1) {\n\t\t\t$this->addCheck(new FormValidatorInSet($this, 'numWeeksBeforeSubscriptionExpiryReminder', 'required', 'manager.subscriptionPolicies.numWeeksBeforeSubscriptionExpiryReminderValid', array_keys($this->validNumWeeksBeforeExpiry)));\n\t\t}\n\n\t\t// If expiry reminder after months is selected, ensure a valid month value is provided\n\t\tif ($this->_data['enableSubscriptionExpiryReminderAfterMonths'] == 1) {\n\t\t\t$this->addCheck(new FormValidatorInSet($this, 'numMonthsAfterSubscriptionExpiryReminder', 'required', 'manager.subscriptionPolicies.numMonthsAfterSubscriptionExpiryReminderValid', array_keys($this->validNumMonthsAfterExpiry)));\n\t\t}\n\n\t\t// If expiry reminder after weeks is selected, ensure a valid week value is provided\n\t\tif ($this->_data['enableSubscriptionExpiryReminderAfterWeeks'] == 1) {\n\t\t\t$this->addCheck(new FormValidatorInSet($this, 'numWeeksAfterSubscriptionExpiryReminder', 'required', 'manager.subscriptionPolicies.numWeeksAfterSubscriptionExpiryReminderValid', array_keys($this->validNumWeeksAfterExpiry)));\n\t\t}\n\t}", "function tbc_books_in_progress_all()\n{\n $output = \"\";\n $query = db_select('list_of_category');\n $query->fields('list_of_category');\n $query->orderBy('id', 'ASC');\n $category_list = $query->execute();\n $query = \"\n SELECT po.creation_date, pe.book as book, pe.author as author, pe.publisher as publisher,pe.edition as edition, pe.isbn as isbn, pe.year as year, pe.id as pe_id, loc.category_name as category, loc.category_id as cat_id\nFROM textbook_companion_preference pe \nLEFT JOIN textbook_companion_proposal po ON pe.proposal_id = po.id\nLEFT JOIN list_of_category loc on pe.category = loc.category_id\nWHERE po.proposal_status IN (1,4) AND pe.approval_status = 1 \nORDER BY po.creation_date DESC\n \";\n $result = db_query($query);\n $proposal_rows = array();\n $i = $result->rowCount();\n $category_data = _tbc_list_of_category($preference_data->category);\n $output = \"<hr>\";\n while ($row = $result->fetchObject())\n {\n $proposal_date = date(\"d-m-Y\", $row->creation_date); // remove comment to display year\n if ($row->category != NULL)\n {\n $category = $row->category;\n } //$row->category != NULL\n else\n {\n $category = \"Not assigned\";\n }\n $preference_rows[] = array(\n $i,\n $proposal_date,\n $row->book . \"<br><br>[ Author: \" . $row->author . \", Publisher: \" . $row->publisher . \", Year: \" . $row->year . \", Edition: \" . $row->edition . \", ISBN: \" . $row->isbn . \" ]\",\n $category\n );\n $i--;\n } //$row = $result->fetchObject()\n $preference_header = array(\n 'No',\n 'Proposal Date',\n 'Book',\n 'Category'\n );\n $output .= theme('table', array(\n 'header' => $preference_header,\n 'rows' => $preference_rows\n ));\n return $output;\n}", "function BeforeInsert(&$rawvalues, &$values, &$pageObject, &$message)\n{\n\n\t\t$values['product_name'] = trim($values['product_name']);\n$values['product_types_id'] = trim($values['product_types_id']);\n\n//********** Check if vendor record exists ************\nglobal $conn;\n$strSQLExists = \"select * from vendors where vendor_name = '\" . $rawvalues['vendor_id'] .\"'\";\n$rsExists = db_query($strSQLExists,$conn);\n$data=db_fetch_array($rsExists);\nif($data)\n{\n $values['vendor_id'] = $data['id'];\n}\nelse\n{\n$message = \"No Vendor by that name\";\n return false;\n}\n\n\n//********** Check if type record exists ************\n$strSQLExists = \"select * from product_types where product_type ='\" . $rawvalues['product_types_id'] . \"'\";\n$rsExists = db_query($strSQLExists,$conn);\n$data=db_fetch_array($rsExists);\nif($data)\n{\n $values['product_types_id'] = $data\t['id'];\n}\nelse\n{\n$message = \"No such product type\";\n return false;\n}\n\n\n//********** Check if product record exists ************\n$strSQLExists = \"select * from products where product_name ='\" . $rawvalues['product_name'] . \"'\";\n$rsExists = db_query($strSQLExists,$conn);\n$data=db_fetch_array($rsExists);\nif($data)\n{\n$message = \"Product already exists\";\n return false;\n}\nelse\n{\n return true;\n}\n\n\n;\t\t\n}", "function issue_book($param1 = '', $param2 = '', $param3 = '') {\n if ($this->session->userdata('admin_login') != 1)\n redirect('login', 'refresh');\n if ($param1 == 'create') {\n $data['barcode_no'] = $this->input->post('barcode_no');\n $data['user_id'] = $this->input->post('user_id');\n $data['user_type'] = $this->input->post('user_type');\n $data['start_date'] = $this->input->post('start_date');\n $data['end_date'] = $this->input->post('end_date');\n $data['created'] = date(\"Y-m-d\");\n $this->db->insert('issue_book', $data);\n $this->session->set_flashdata('flash_message', get_phrase('data_added_successfully'));\n redirect(base_url() . 'admin/issue_book', 'refresh');\n }\n\n if ($param1 == 'delete') {\n $this->db->where('issue_book_id', $param2);\n $this->db->delete('issue_book');\n $this->session->set_flashdata('flash_message', get_phrase('data_deleted'));\n redirect(base_url() . 'admin/issue_book', 'refresh');\n }\n $page_data['issue_books'] = $this->db->get('issue_book')->result_array();\n $page_data['page_name'] = 'issue_book';\n $page_data['page_title'] = get_phrase('manage_issue_book');\n $this->load->view('backend/index', $page_data);\n}", "private function populateRDFData()\n\t{\n\t\t// Grabs database object\n\t\t$database = \\App::get('db');\n\t\t$resource = new \\Components\\Publications\\Tables\\Version($database);\n\t\t$resource = $resource->getLastPubRelease($this->id);\n\n\t\tif (!$resource)\n\t\t{\n\t\t\t// Return if ID does not exist\n\t\t\tthrow new Exception(Lang::txt('COM_PUBLICATIONS_FILE_NOT_FOUND'), 404);\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->setPaths();\n\n\t\t// Gets the author name\n\t\t$this->author_id = $resource->created_by;\n\t\t$this->created_by = User::getInstance($this->author_id)->name;\n\n\t\t// Set created date\n\t\t$this->date_created = $this->formatDate($resource->created);\n\n\t\t// Set description\n\t\t$this->intro = $resource->description;\n\n\t\t// Set title\n\t\t$this->title = $resource->title;\n\n\t\t// Set last modified date\n\t\t$this->date_modified = $this->formatDate($resource->modified);\n\n\t\t// Set published date\n\t\t$this->date_published = $this->formatDate($resource->published_up);\n\n\t\t// Set version ID\n\t\t$this->version_id = $resource->id;\n\n\t\t// Load the $types variable. In the form of array([type_id] => [type_name]).\n\t\t$resource = new \\Components\\Publications\\Tables\\Publication($database);\n\t\t$pub = $resource->getPublication($this->id);\n\n\t\t$type_id = $pub->category;\n\t\t$typesData = new \\Components\\Publications\\Tables\\Category($database);\n\t\t$allTypes = $typesData->getCategories(array(\n\t\t\t'state' => 'all'\n\t\t));\n\n\t\t$this->types = array();\n\t\tforeach ($allTypes as $type)\n\t\t{\n\t\t\t$types[$type->id] = $type->name;\n\t\t}\n\n\t\t// Get the type name of this resource\n\t\t$this->type = $types[$type_id];\n\n\t\t// Get attachments\n\t\t$pubAttach = new \\Components\\Publications\\Tables\\Attachment($database);\n\t\t$attachments = $pubAttach->getAttachments($this->version_id);\n\n\t\tforeach ($attachments as $child)\n\t\t{\n\t\t\t$this->aggregates[$child->id]['parent_id'] = $this->id;\n\t\t\t$this->aggregates[$child->id]['title'] = basename($child->path);\n\t\t\t$this->aggregates[$child->id]['created'] = $this->formatDate($child->created);\n\t\t\t$this->aggregates[$child->id]['standalone'] = 0;\n\t\t\t$this->aggregates[$child->id]['path'] = $child->path;\n\t\t\t$this->aggregates[$child->id]['url'] = $this->componentURL . $this->id . '/serve?a=' . $child->id;\n\t\t}\n\n\t\treturn true;\n\t}", "public function addBook()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$ISBN = $_POST['ISBN'];\n\t\t\t$title = $_POST['title'];\n\t\t\t$author = $_POST['author'];\n\t\t\t$press = $_POST['press'];\n\t\t\t$category = $_POST['category'];\n\t\t\t$pub_date = $_POST['pub_date'];\n\t\t\t$price = $_POST['price'];\n\t\t\t$floor = $_POST['floor'];\n\t\t\t$bookshelf = $_POST['bookshelf'];\n\t\t\t$area_code = $_POST['area_code'];\n\t\t\t$number = $_POST['number'];\n\t\t\t$book = D('Book_species');\n\t\t\t$sql1 = \"select count(*) as a from lib_book_unique\";\n\t\t\t$return23 = $book->query($sql1);\n\t\t\t$num = $return23[0]['a'];\n\t\t\t$newbookid = array();\n\t\t\tfor ($k = 1; $k <= $number; $k++) {\n\t\t\t\t$numnew = $k + $num;\n\t\t\t\t$temp_num = 100000;\n\t\t\t\t$new_num = $numnew + $temp_num;\n\t\t\t\tarray_push($newbookid, substr($new_num, 1, 5));\n\t\t\t}\n\t\t\t$sql2333 = \"select * from lib_book_species where isbn = '{$ISBN}';\";\n\t\t\t$return2333 = $book->query($sql2333);\n\t\t\t$sql = \"insert into lib_book_species(isbn,title,author,press,\n\t\t\t\t\tcategory,pub_date,price,floor,bookshelf,area_code) \n\t\t\t\t\tvalues('{$ISBN}','{$title}','{$author}',\n\t\t\t\t\t'{$press}','{$category}','{$pub_date}',\n\t\t\t\t\t'{$price}','{$floor}','{$bookshelf}','{$area_code}');\";\n\t\t\tif(!$return2333){\n\t\t\t\t$return = $book->execute($sql);\n\t\t\t}\n\t\t\t$return = true;\n\t\t\t$sql1 = \"insert into lib_book_unique(isbn) values('{$ISBN}');\";\n\t\t\tfor ($i = 0; $i < $number; $i++) {\n\t\t\t\t$return1 = $book->execute($sql1);\n\t\t\t\t$return = $return && $return1;\n\t\t\t}\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'msg' => 'Add successfully!',\n\t\t\t\t\t'newbookid' => json_encode($newbookid)\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "public function checkRequirements()\n {\n }", "function getPaper($code)\n{\n /* paper information but keyword */\n $result = mysql_fetch_array(mysql_query(\"select paper_title title, course.course_name course, \n des_spanish, des_english, des_portuguese \n from paper, course \n where paper.code = \".$code.\" and\n paper_course = course.code\"));\n\n $paper = new Paper($code, $result['title'], $result['course']);\n $paper->addAbstract('spanish',$result['des_spanish']);\n $paper->addAbstract('english',$result['des_english']);\n $paper->addAbstract('portuguese',$result['des_portuguese']);\n\n /* paper keywords */\n $result = mysql_query(\"select k.keyword_spanish spanish, k.keyword_english english\n from keyword k, terms t\n where t.code_keyword = k.code and\n t.code_paper = \".$code);\n\n for ($i=0; $row = mysql_fetch_array($result); $i++){\n $paper->addkeyword(array('spanish' => $row['spanish'],\n\t\t\t 'english' => $row['english']));\n } \n\n /* author(s) information but membership(s) */\n $result = mysql_query(\"select a.code code, a.author_name name, \n a.author_lastname lastname, a.author_mail mail, \n a.author_webpage webpage \n from author a, authoring at \n where at.code_author = a.code and at.code_paper = \".$code.\"\n order by author_order\");\n for ($i=0; $row = mysql_fetch_array($result); $i++){\n $author[$i] = array('order' => $i+1,\n\t\t\t'code' => $row['code'], \n\t\t\t'name' => $row['name'], \n\t\t\t'lastname' => $row['lastname'], \n\t\t\t'mail' => $row['mail'], \n\t\t\t'webpage' => $row['webpage']);\n }\n \n /* author(s) membership(s) */\n for ($i=0; isset($author[$i]); $i++){\n $result = mysql_query(\"select i.code code, i.institution_name name, \n i.institution_webpage webpage, cit.city_name city, \n cou.country_name country \n from institution i, city cit, country cou, membership mem \n where cit.city_country = cou.code and \n i.institution_city = cit.code and \n mem.code_institution = i.code and \n mem.code_person = \".$author[$i]['code']);\n for ($j=0; $row = mysql_fetch_array($result); $j++) {\n $author[$i]['institution'][$j] = array('code'\t=> $row['code'], \n 'name'\t=> $row['name'], \n\t\t\t\t\t 'webpage' => $row['webpage'], \n\t\t\t\t\t 'city'\t=> $row['city'], \n\t\t\t\t\t 'country' \t=> $row['country']);\n }\n }\n\n foreach ($author as $val) {\n $paper->addAuthor($val['order'], $val['code'], $val['name'], \n\t\t $val['lastname'], $val['mail'], $val['webpage'], $val['institution']);\n }\n \n /* tutor(s) information but membership(s) */\n $result = mysql_query(\"select t.code code, t.tutor_name name, t.tutor_lastname lastname, \n t.tutor_mail mail, t.tutor_webpage webpage \n from tutor t, tutoring tu \n where tu.code_tutor = t.code and tu.code_paper = \".$code);\n\t\t\t\t\t\t\t\t\t\t\t\n for ($i=0; $row = mysql_fetch_array($result); $i++){\n $tutor[$i] = array(\t'code' => $row['code'], \n\t\t\t'name' => $row['name'], \n\t\t\t'lastname'=> $row['lastname'], \n\t\t\t'mail' => $row['mail'], \n\t\t\t'webpage' => $row['webpage']);\n }\n \n /* tutor(s) membership(s) */\n for ($i=0; isset($tutor[$i]); $i++){\n $result = mysql_query(\"select i.code code, i.institution_name name, \n i.institution_webpage webpage, cit.city_name city, \n cou.country_name country \n from institution i, city cit, country cou, membership mem \n where cit.city_country = cou.code and \n i.institution_city = cit.code and \n mem.code_institution = i.code and \n mem.code_person = \".$tutor[$i]['code']);\n for ($j=0; $row = mysql_fetch_array($result); $j++) {\n $tutor[$i]['institution'][$j] = array('code' => $row['code'], \n\t\t\t\t\t 'name' => $row['name'], \n\t\t\t\t\t 'webpage' => $row['webpage'], \n\t\t\t\t\t 'city' => $row['city'], \n\t\t\t\t\t 'country' => $row['country']);\n }\n }\n \n if (isset($tutor)) {\n foreach ($tutor as $val) {\n $paper->addTutor($val['code'], $val['name'], $val['lastname'], \n\t\t $val['mail'], $val['webpage'], $val['institution']);\n }\n }\n return $paper;\n}", "function return_book($param1 = '', $param2 = '', $param3 = '') {\n if ($this->session->userdata('admin_login') != 1)\n redirect('login', 'refresh');\n if ($param1 == 'create') {\n $data['barcode_no'] = $this->input->post('barcode_no');\n $data['user_id'] = $this->input->post('user_id');\n $data['user_type'] = $this->input->post('user_type');\n $data['start_date'] = $this->input->post('start_date');\n $data['end_date'] = $this->input->post('end_date');\n $data['created'] = date(\"Y-m-d\");\n $this->db->insert('return_book', $data);\n $this->session->set_flashdata('flash_message', get_phrase('data_added_successfully'));\n redirect(base_url() . 'admin/return_book', 'refresh');\n }\n\n if ($param1 == 'delete') {\n $this->db->where('return_book_id', $param2);\n $this->db->delete('return_book');\n $this->session->set_flashdata('flash_message', get_phrase('data_deleted'));\n redirect(base_url() . 'admin/issue_book', 'refresh');\n }\n $page_data['return_books'] = $this->db->get('return_book')->result_array();\n $page_data['page_name'] = 'return_book';\n $page_data['page_title'] = get_phrase('manage_return_book');\n $this->load->view('backend/index', $page_data);\n}", "function search_inventory($db, $seller_id, $title, $isbn, $author)\n{\n\t/* Copy and pasted code from \"search_textbooks\" I can't just wrap it in another function because of how the\n\t\t\t\tprepared statement works */\n\t$titlekey = \"\"; //sql colomn name\n\t$isbnkey = \"\"; //sql column name \n\t$authorkey = \"\"; //sql column name\n\t$titlevalue = \"\"; // sql column value\n\t$isbnvalue = \"\"; // sql column value\n\t$authorvalue = \"\"; // sql column value\n\n\t/* All empty strings returns nothing */\n\tif($title == \"\" && $isbn == \"\" && $author == \"\")\n\t{\n\t\t$titlekey = \"1\";\n\t\t$isbnkey = \"1\";\n\t\t$authorkey = \"1\";\n\t\t$titlevalue = \"0\";\n\t\t$isbnvalue = \"0\";\n\t\t$authorvalue = \"0\";\n\t}\n\telse // If not an empty search\n\t{\n\n\t\tif($title == \"\") // No search by title\n\t\t{\n\t\t\t$titlekey = '1';\n\t\t\t$titlevalue = '1';\n\t\t}\n\t\telse // Include search by title\n\t\t{\n\t\t\t$titlekey = 'title';\n\t\t\t$titlevalue = \"%\".$title.\"%\"; \n\t\t}\n\n\t\tif($isbn == \"\") // No search by isbn\n\t\t{\n\t\t\t$isbnkey = '1';\n\t\t\t$isbnvalue = '1';\n\t\t}\n\t\telse // include search by isbn\n\t\t{\n\t\t\t$isbnkey = 'isbn';\n\t\t\t$isbnvalue = \"%\".$isbn.\"%\";\n\t\t}\n\n\t\tif($author == \"\") // no search by author\n\t\t{\n\t\t\t$authorkey = '1';\n\t\t\t$authorvalue = '1';\n\t\t}\n\t\telse // include search by author\n\t\t{\n\t\t\t$authorkey = 'author';\n\t\t\t$authorvalue = \"%\".$author.\"%\";\n\t\t}\n\t}\n\t\t/* Run the query */\n\t\t$sql = \"SELECT * FROM textbooks where \".$titlekey.\" LIKE :title and \n\t\t\".$isbnkey.\" LIKE :isbn and \".$authorkey.\" \n\t\tLIKE :author and seller_id = :seller_id ORDER BY date_time DESC\";\n\n\t\t$st = $db->prepare($sql);\n\t\t$st->execute(array(':title' => $titlevalue, ':isbn'=>$isbnvalue, ':author'=>$authorvalue, ':seller_id'=>$seller_id));\n\t\t$us = $st->fetchAll();\n\t\treturn $us;\n}", "function getOCRData($itemnumber, $sWebserviceURL)\r\n{\r\n\t$aOcrDataInfo = array();\r\n\t$aOcrData = array();\r\n\t$sErrorMessages = '';\r\n\r\n\t//$aOcrData['itemnumber'] = $itemnumber;\r\n\r\n\t$serviceurl = $sWebserviceURL . '/ocr/' . $itemnumber;\r\n\t$incomingdata = file_get_contents($serviceurl);\r\n\t$incomingdatafixed = str_replace( array('&lt;','&gt;') ,array('<','>'),$incomingdata); //nasty fix for the new restler which now encodes the xml tags. We choose to fix it here and transform the response body to xml again\r\n\r\n\ttry {\r\n\t\t$xml = new SimpleXMLElement($incomingdatafixed);\r\n\t\tif (is_object($xml)) {\r\n\r\n\t\t\t//total number of scans\r\n\t\t\t$totalfield = $xml->xpath('//totalscans');\r\n\t\t\t$totalscans = (int) $totalfield[0];\r\n\r\n\t\t\t//whether this is a book with special OCR requirements\r\n\t\t\t$ocrwantedfield = $xml->xpath('//ocrwanted');\r\n\t\t\t$ocrwanted = (string) $ocrwantedfield[0];\r\n\r\n\t\t\t//ocr start page\r\n\t\t\t$ocrstartfield = $xml->xpath('//ocrstartscan');\r\n\t\t\t$ocrstart = (int) $ocrstartfield[0];\r\n\r\n\t\t\t//ocr end page\r\n\t\t\t$ocrendfield = $xml->xpath('//ocrendscan');\r\n\t\t\t$ocrend = (int) $ocrendfield[0];\r\n\r\n\t\t\t//pages to be skipped\r\n\t\t\t$ocrskipfield = $xml->xpath('//donotocr');\r\n\t\t\t$ocrskip = (string) $ocrskipfield[0];\r\n\r\n\t\t\t//from this we should be able to work out for each page if it should be ocred\r\n\t\t\t//what we want to return is an array with 'scannumber'=>'ocr_or_not'\r\n\t\t\t//if only a part of the book should be ocred\r\n\t\t\tif ($ocrwanted == 'noplates') {\r\n\t\t\t\t$skippedpages = array();\r\n\t\t\t\tif ($ocrskip != '') {\r\n\t\t\t\t\t$skippedpages = explode(',', $ocrskip);\r\n\r\n\t\t\t\t\tfor ($count=1; $count <= $totalscans; $count++) {\r\n\t\t\t\t\t\tif (in_array($count, $skippedpages)) {\r\n\t\t\t\t\t\t\t$aOcrData[$count] = '0';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t$aOcrData[$count] = '1';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telseif ($ocrwanted == 'part') {\r\n\t\t\t\tfor ($count=1; $count <= $totalscans; $count++) {\r\n\t\t\t\t\tif ($count < $ocrstart || $count > $ocrend) {\r\n\t\t\t\t\t\t$aOcrData[$count] = '0';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$aOcrData[$count] = '1';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//if nothing should be ocred\r\n\t\t\telseif ($ocrwanted == 'none') {\r\n\t\t\t\tfor ($count=1; $count <= $totalscans; $count++) {\r\n\t\t\t\t\t$aOcrData[$count] = '0';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tfor ($count=1; $count <= $totalscans; $count++) {\r\n\t\t\t\t\t$aOcrData[$count] = '1';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} //end of if_object($xml)\r\n\t\telse {\r\n\t\t\t$sErrorMessages .= 'Kon geen contact maken met de webservice';\r\n\t\t}\r\n\t} //end of try\r\n\tcatch (Exception $e) {\r\n\t\t$sErrorMessages .= 'Er is iets mis in getOCRdata ' . $e->getMessage();\r\n\t}\r\n\t$aOcrDataInfo['errors'] = $sErrorMessages;\r\n\t$aOcrDataInfo['OcrData'] = $aOcrData;\r\n\r\n\treturn $aOcrDataInfo;\r\n}", "public function get_data_for_xlpro_hotel($htl_data)\r\n\t{\r\n\t\t$booking = $htl_data['data'];\r\n\t\t// debug($booking);exit();\r\n\t\t$no_of_pax = count($booking['booking_customer_details']);\r\n\r\n\t\t$doc_srno = 1;\r\n\t\t// loop for each pax\r\n\t\tfor($i = 0; $i < $no_of_pax; $i++) {\r\n\t\t\t$customer = $booking['booking_customer_details'][$i];\r\n\t\t\t// invouce no\r\n\t\t\t$doc_no = '';\r\n\r\n\t\t\t$agent_info = false;\r\n\t\t\t// pax sr no \r\n\t\t\t$doc_srno = $i+1;\r\n\t\t\t$idate = date('d/m/Y', strtotime($booking['booking_details'][0]['created_datetime']));\r\n\t\t\t\r\n\t\t\t$ccode = ''; // C + 5char clint code as per account client master\r\n\t\t\t// if( $booking['booking_details'][0]['created_by_id'] > 0 ) {\r\n\t\t\tif( $customer['employee_id'] > 0 ) {\r\n\t\t\t\t// get the agent client code\r\n\t\t\t\t$agent_info = $this->get_employee_xlcode($customer['employee_id']);\r\n\t\t\t\t// debug($agent_info);exit();\r\n\t\t\t\t$agent_info = $agent_info[0];\r\n\r\n\t\t\t\tif(!empty($agent_info)) {\r\n\t\t\t\t\t// remove this condition later\r\n\t\t\t\t\tif(empty($agent_info['e_xl_code'])) {\r\n\t\t\t\t\t\tif(empty($agent_info['c_xl_code'])) {\r\n\t\t\t\t\t\t\t$ccode = 'C'.'U0003';\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$ccode = 'C'.$agent_info['c_xl_code'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$ccode = 'C'.$agent_info['e_xl_code'];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$ccode = 'C'.'U0003';\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$ccode = 'C'.'U0003';\r\n\t\t\t}\r\n\t\t\t$doc_nos = $booking['booking_details'][0]['xlpro_invoice_no'];\r\n\t\t\t$hcode = 'H00000';\r\n\t\t\t$hcode = $this->get_hotel_code($booking['booking_details'][0]['hotel_name']);\r\n\r\n\t\t\t// if hotel paid for booking\r\n\t\t\t$scode = $hcode;\r\n\r\n\t\t\t$hotel_name = '';\r\n\t\t\tif($hcode == 'H00000') {\r\n\t\t\t\t$hotel_name = $booking['booking_details'][0]['hotel_name'] ;\r\n\t\t\t} elseif (empty($hcode)) {\r\n\t\t\t\t$hotel_name = $booking['booking_details'][0]['hotel_name'] ;\r\n\t\t\t}\r\n\r\n\t\t\t$ticketno = 'HW'.$doc_nos.$doc_srno;\r\n\t\t\t$pax = $customer['first_name'] . ' ' . $customer['last_name'];\r\n\t\t\t$check_in_date = date('d/m/Y', strtotime($booking['booking_details'][0]['hotel_check_in']));\r\n\t\t\t$check_out_date = date('d/m/Y', strtotime($booking['booking_details'][0]['hotel_check_out']));\r\n\r\n\t\t\t// as per city master tabel in xlpro\r\n\t\t\t$city_code = '000';\r\n\t\t\t$city_code = $this->get_hotel_city_code($booking['booking_details'][0]['location']);\r\n\t\t\t$room_name = $booking['booking_itinerary_details'][0]['room_type_name'];\r\n\t\t\t$room_type = $booking['booking_itinerary_details'][0]['room_type'];\r\n\t\t\t$roomtype = '000';\r\n\t\t\t\r\n\r\n\t\t\t$total_supplier = 0;\r\n\t\t\t$total_client = 0;\r\n\r\n\t\t\t// echo $room_cnt;\r\n\t\t\t$room_sgl_nos = 0;\r\n\t\t\t$room_sgl_pax = 0;\r\n\t\t\t$room_sgl_rate = 0;\r\n\t\t\t\r\n\t\t\t$room_dbl_nos = 0;\r\n\t\t\t$room_dbl_pax = 0;\r\n\t\t\t$room_dbl_rate = 0;\r\n\r\n\t\t\t$room_twn_nos = 0;\r\n\t\t\t$room_twn_pax = 0;\r\n\t\t\t$room_twn_rate = 0;\r\n\t\t\t\r\n\t\t\t$room_trp_nos = 0;\r\n\t\t\t$room_trp_pax = 0;\r\n\t\t\t$room_trp_rate = 0;\r\n\t\t\t\r\n\t\t\t$room_qad_nos = 0;\r\n\t\t\t$room_qad_pax = 0;\r\n\t\t\t$room_qad_rate = 0;\r\n\r\n\t\t\t$count = count($booking['booking_customer_details']);\r\n\r\n\t\t\t// if excel room code is not selected while update\r\n\t\t\tif(empty($room_type)) {\r\n\t\t\t\t$roomtype = $this->get_room_type($room_name);\r\n\r\n\t\t\t\tif(strcasecmp($room_name,'triple') == 0) {\r\n\t\t\t\t\t$room_trp_nos = 1;\r\n\t\t\t\t\t$room_trp_pax = 1;\r\n\t\t\t\t\t$room_trp_rate = round($booking['booking_itinerary_details'][0]['total_fare']/$count);\r\n\t\t\t\t\t$total_supplier = $room_trp_rate;\r\n\t\t\t\t\t$total_client = $room_trp_rate;\r\n\t\t\t\t\t$dat = $this->calc_hotel_management_fee($total_client, $agent_info, $booking['booking_details'][0]['hotel_code']);\r\n\t\t\t\t\t$srv_chrg1c = $dat['data']['srv_chrg1c'];\r\n\t\t\t\t\t$serv_educ = $dat['data']['serv_educ'];\r\n\t\t\t\t\t$serv_taxc = $dat['data']['serv_taxc'];\r\n\t\t\t\t} elseif (strcasecmp($room_name,'double') == 0) {\r\n\t\t\t\t\t$room_twn_nos = 1;\r\n\t\t\t\t\t$room_twn_pax = 1;\r\n\t\t\t\t\t$room_twn_rate = round($booking['booking_itinerary_details'][0]['total_fare']/$count);\r\n\t\t\t\t\t$total_supplier = $room_twn_rate;\r\n\t\t\t\t\t$total_client = $room_twn_rate;\r\n\t\t\t\t\t$dat = $this->calc_hotel_management_fee($total_client, $agent_info, $booking['booking_details'][0]['hotel_code']);\r\n\t\t\t\t\t$srv_chrg1c = $dat['data']['srv_chrg1c'];\r\n\t\t\t\t\t$serv_educ = $dat['data']['serv_educ'];\r\n\t\t\t\t\t$serv_taxc = $dat['data']['serv_taxc'];\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$room_sgl_nos = 1;\r\n\t\t\t\t\t$room_sgl_pax = 1;\r\n\t\t\t\t\t$room_sgl_rate = round($booking['booking_itinerary_details'][0]['total_fare']/$count);\r\n\t\t\t\t\t$total_supplier = $room_sgl_rate;\r\n\t\t\t\t\t$total_client = $room_sgl_rate;\r\n\t\t\t\t\t$dat = $this->calc_hotel_management_fee($total_client, $agent_info, $booking['booking_details'][0]['hotel_code']);\r\n\t\t\t\t\t$srv_chrg1c = $dat['data']['srv_chrg1c'];\r\n\t\t\t\t\t$serv_educ = $dat['data']['serv_educ'];\r\n\t\t\t\t\t$serv_taxc = $dat['data']['serv_taxc'];\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$roomtype = $room_type;\r\n\t\t\t\tswitch ($room_type) {\r\n\t\t\t\t\tcase 'D01':\r\n\t\t\t\t\t\t$room_dbl_nos = 1;\r\n\t\t\t\t\t\t$room_dbl_pax = 1;\r\n\t\t\t\t\t\t$room_dbl_rate = round($booking['booking_itinerary_details'][0]['total_fare']/$count);\r\n\t\t\t\t\t\t$total_supplier = $room_dbl_rate;\r\n\t\t\t\t\t\t$total_client = $room_dbl_rate;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'Q01':\r\n\t\t\t\t\t\t$room_qad_nos = 1;\r\n\t\t\t\t\t\t$room_qad_pax = 1;\r\n\t\t\t\t\t\t$room_qad_rate = round($booking['booking_itinerary_details'][0]['total_fare']/$count);\r\n\t\t\t\t\t\t$total_supplier = $room_qad_rate;\r\n\t\t\t\t\t\t$total_client = $room_qad_rate;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'S01':\r\n\t\t\t\t\t\t$room_sgl_nos = 1;\r\n\t\t\t\t\t\t$room_sgl_pax = 1;\r\n\t\t\t\t\t\t$room_sgl_rate = round($booking['booking_itinerary_details'][0]['total_fare']/$count);\r\n\t\t\t\t\t\t$total_supplier = $room_sgl_rate;\r\n\t\t\t\t\t\t$total_client = $room_sgl_rate;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'T00':\r\n\t\t\t\t\t\t$room_trp_nos = 1;\r\n\t\t\t\t\t\t$room_trp_pax = 1;\r\n\t\t\t\t\t\t$room_trp_rate = round($booking['booking_itinerary_details'][0]['total_fare']/$count);\r\n\t\t\t\t\t\t$total_supplier = $room_trp_rate;\r\n\t\t\t\t\t\t$total_client = $room_trp_rate;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'T01':\r\n\t\t\t\t\t\t$room_twn_nos = 1;\r\n\t\t\t\t\t\t$room_twn_pax = 1;\r\n\t\t\t\t\t\t$room_twn_rate = round($booking['booking_itinerary_details'][0]['total_fare']/$count);\r\n\t\t\t\t\t\t$total_supplier = $room_twn_rate;\r\n\t\t\t\t\t\t$total_client = $room_twn_rate;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t// use single room code\r\n\t\t\t\t\t\t$room_sgl_nos = 1;\r\n\t\t\t\t\t\t$room_sgl_pax = 1;\r\n\t\t\t\t\t\t$room_sgl_rate = round($booking['booking_itinerary_details'][0]['total_fare']/$count);\r\n\t\t\t\t\t\t$total_supplier = $room_sgl_rate;\r\n\t\t\t\t\t\t$total_client = $room_sgl_rate;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t// $dat = $this->calc_hotel_management_fee($total_client, $agent_info, $booking['booking_details'][0]['hotel_code']);\r\n\t\t\t\t$info['c_user_id'] = $agent_info['c_user_id'];\r\n\t\t\t\t$query = $this->CI->db->query('SELECT state_name, state_gst from crs_hotel_details where origin = '. $booking['booking_details'][0]['hotel_code']);\r\n\t\t\t\t$htl = $query->result_array();\r\n\t\t\t\t$info['gst_state_name'] = $htl[0]['state_name'];\r\n\t\t\t\t$info['gst_state'] = $htl[0]['state_gst'];\r\n\t\t\t\t$dat = $this->calc_hotel_management_fee_gst ($total_client, $info, $booking['booking_details'][0]['hotel_code']);\r\n\t\t\t\t$srv_chrg1c = $dat['data']['srv_chrg1c'];\r\n\t\t\t\t$serv_educ = $dat['data']['serv_educ'];\r\n\t\t\t\t$serv_taxc = $dat['data']['serv_taxc'];\r\n\r\n\t\t\t}\r\n\r\n\t\t\t$nos_pax_a = 0;\r\n\t\t\t$nos_pax_c = 0;\r\n\t\t\tif($customer['pax_type'] == 'Adult') {\r\n\t\t\t\t$nos_pax_a = 1;\r\n\t\t\t} elseif ($customer['pax_type'] == 'Child') {\r\n\t\t\t\t$nos_pax_c = 1;\r\n\t\t\t}\r\n\r\n\t\t\t$at = array('management_fee' => $srv_chrg1c);\r\n\t\t\t$condition = array('app_reference' => $booking['booking_itinerary_details'][0]['app_reference']);\r\n\t\t\t$dst = $this->CI->custom_db->update_record('hotel_booking_itinerary_details', $at, $condition);\r\n\r\n\t\t\t$result[] = $this->format_for_xlwebpro_htl($doc_nos, $doc_srno, $idate, $ccode, $scode, $hotel_name, $ticketno, $pax, $check_in_date, $check_out_date, $city_code, $total_client, $total_supplier, $nos_pax_a, $nos_pax_c, $room_sgl_nos, $room_sgl_pax, $room_sgl_rate, $room_trp_nos, $room_trp_pax, $room_trp_rate, $room_qad_nos, $room_qad_pax, $room_qad_rate, $room_twn_nos, $room_twn_pax, $room_twn_rate, $room_dbl_nos, $room_dbl_pax, $room_dbl_rate, $roomtype, $srv_chrg1c, $serv_educ, $serv_taxc, $hcode );\r\n\t\t} // END LOOP\r\n\t\t// debug($result);\r\n\t\t// exit();\r\n\t\t$result['cols'] = array(\r\n\t\t\t'doc_prf' => 'DOC_PRF',\r\n\t\t\t'doc_nos' => 'DOC_NOS',\r\n\t\t\t'doc_srno' => 'DOC_SRNO',\r\n\t\t\t'idm_flag' => 'IDM_FLAG',\r\n\t\t\t'il_ref' => 'IL_REF',\r\n\t\t\t'vd_ref' => 'VD_REF',\r\n\t\t\t'idate' => 'IDATE',\r\n\t\t\t'ccode' => 'CCODE',\r\n\t\t\t'dcode' => 'DCODE',\r\n\t\t\t'ecode' => 'ECODE',\r\n\t\t\t'bcode' => 'BCODE',\r\n\t\t\t'narration' => 'NARRATION',\r\n\t\t\t'xo_ref' => 'XO_REF',\r\n\t\t\t'loc_code' => 'LOC_CODE',\r\n\t\t\t'cst_code' => 'CST_CODE',\r\n\t\t\t'curcode_c' => 'CURCODE_C',\r\n\t\t\t'curcode_s' => 'CURCODE_S',\r\n\t\t\t'refr_key' => 'REFR_KEY',\r\n\t\t\t'gcode' => 'GCODE',\r\n\t\t\t'hcode' => 'HCODE',\r\n\t\t\t'scode' => 'SCODE',\r\n\t\t\t'hotel_name' => 'HOTEL_NAME',\r\n\t\t\t'xo_nos' => 'XO_NOS',\r\n\t\t\t'ticketno' => 'TICKETNO',\r\n\t\t\t'pax' => 'PAX',\r\n\t\t\t'check_in_date' => 'CHECK_IN_DATE',\r\n\t\t\t'check_out_date' => 'CHECK_OUT_DATE',\r\n\t\t\t'roomview' => 'ROOMVIEW',\r\n\t\t\t'mealplan ' => 'MEALPLAN ',\r\n\t\t\t'roomtype' => 'ROOMTYPE',\r\n\t\t\t'tarifftype' => 'TARIFFTYPE',\r\n\t\t\t'pkg_code' => 'PKG_CODE',\r\n\t\t\t'city' => 'CITY',\r\n\t\t\t'room_sgl_nos' => 'ROOM_SGL_NOS',\r\n\t\t\t'room_sgl_pax' => 'ROOM_SGL_PAX',\r\n\t\t\t'room_sgl_rate' => 'ROOM_SGL_RATE',\r\n\t\t\t'room_sgl_purmth' => 'ROOM_SGL_PURMTH',\r\n\t\t\t'room_sgl_purval' => 'ROOM_SGL_PURVAL',\r\n\t\t\t'room_dbl_nos' => 'ROOM_DBL_NOS',\r\n\t\t\t'room_dbl_pax' => 'ROOM_DBL_PAX',\r\n\t\t\t'room_dbl_rate' => 'ROOM_DBL_RATE',\r\n\t\t\t'room_dbl_purmth' => 'ROOM_DBL_PURMTH',\r\n\t\t\t'room_dbl_purval' => 'ROOM_DBL_PURVAL',\r\n\t\t\t'room_twn_nos' => 'ROOM_TWN_NOS',\r\n\t\t\t'room_twn_pax' => 'ROOM_TWN_PAX',\r\n\t\t\t'room_twn_rate' => 'ROOM_TWN_RATE',\r\n\t\t\t'room_twn_purmth' => 'ROOM_TWN_PURMTH',\r\n\t\t\t'room_twn_purval' => 'ROOM_TWN_PURVAL',\r\n\t\t\t'room_trp_nos' => 'ROOM_TRP_NOS',\r\n\t\t\t'room_trp_pax' => 'ROOM_TRP_PAX',\r\n\t\t\t'room_trp_rate' => 'ROOM_TRP_RATE',\r\n\t\t\t'room_trp_purmth' => 'ROOM_TRP_PURMTH',\r\n\t\t\t'room_trp_purval' => 'ROOM_TRP_PURVAL',\r\n\t\t\t'room_qad_nos' => 'ROOM_QAD_NOS',\r\n\t\t\t'room_qad_pax' => 'ROOM_QAD_PAX',\r\n\t\t\t'room_qad_rate' => 'ROOM_QAD_RATE',\r\n\t\t\t'room_qad_purmth' => 'ROOM_QAD_PURMTH',\r\n\t\t\t'room_qad_purval' => 'ROOM_QAD_PURVAL',\r\n\t\t\t'room_adt_nos' => 'ROOM_ADT_NOS',\r\n\t\t\t'room_adt_pax' => 'ROOM_ADT_PAX',\r\n\t\t\t'room_adt_rate' => 'ROOM_ADT_RATE',\r\n\t\t\t'room_adt_purmth' => 'ROOM_ADT_PURMTH',\r\n\t\t\t'room_adt_purval' => 'ROOM_ADT_PURVAL',\r\n\t\t\t'room_chd_nos' => 'ROOM_CHD_NOS',\r\n\t\t\t'room_chd_pax' => 'ROOM_CHD_PAX',\r\n\t\t\t'room_chd_rate' => 'ROOM_CHD_RATE',\r\n\t\t\t'room_chd_purmth' => 'ROOM_CHD_PURMTH',\r\n\t\t\t'room_chd_purval' => 'ROOM_CHD_PURVAL',\r\n\t\t\t'room_cwb_nos' => 'ROOM_CWB_NOS',\r\n\t\t\t'room_cwb_pax' => 'ROOM_CWB_PAX',\r\n\t\t\t'room_cwb_rate' => 'ROOM_CWB_RATE',\r\n\t\t\t'room_cwb_purmth' => 'ROOM_CWB_PURMTH',\r\n\t\t\t'room_cwb_purval' => 'ROOM_CWB_PURVAL',\r\n\t\t\t'room_foc_nos' => 'ROOM_FOC_NOS',\r\n\t\t\t'room_foc_pax' => 'ROOM_FOC_PAX',\r\n\t\t\t'room_foc_rate' => 'ROOM_FOC_RATE',\r\n\t\t\t'room_foc_purmth' => 'ROOM_FOC_PURMTH',\r\n\t\t\t'room_foc_purval' => 'ROOM_FOC_PURVAL',\r\n\t\t\t'stx_cenvat' => 'STX_CENVAT',\r\n\t\t\t'stx_method' => 'STX_METHOD',\r\n\t\t\t'nos_pax_a' => 'NOS_PAX_A',\r\n\t\t\t'nos_pax_c' => 'NOS_PAX_C',\r\n\t\t\t'nos_pax_i' => 'NOS_PAX_I',\r\n\t\t\t'narr_1' => 'NARR_1',\r\n\t\t\t'narr_2' => 'NARR_2',\r\n\t\t\t'narr_3' => 'NARR_3',\r\n\t\t\t'narr_4' => 'NARR_4',\r\n\t\t\t'narr_5' => 'NARR_5',\r\n\t\t\t'narr_6' => 'NARR_6',\r\n\t\t\t'r_o_e_c' => 'R_O_E_C',\r\n\t\t\t'r_o_e_s' => 'R_O_E_S',\r\n\t\t\t'basic_c' => 'BASIC_C',\r\n\t\t\t'basic_s' => 'BASIC_S',\r\n\t\t\t'tax_c' => 'TAX_C',\r\n\t\t\t'tax_s' => 'TAX_S',\r\n\t\t\t'disc_paidm1' => 'DISC_PAIDM1',\r\n\t\t\t'disc_paidm2' => 'DISC_PAIDM2',\r\n\t\t\t'disc_recdm1' => 'DISC_RECDM1',\r\n\t\t\t'brok_paidm1' => 'BROK_PAIDM1',\r\n\t\t\t'disc_paidv1' => 'DISC_PAIDV1',\r\n\t\t\t'disc_recdv1' => 'DISC_RECDV1',\r\n\t\t\t'brok_paidv1' => 'BROK_PAIDV1',\r\n\t\t\t'disc_paid1' => 'DISC_PAID1',\r\n\t\t\t'disc_recd1' => 'DISC_RECD1',\r\n\t\t\t'brok_paid1' => 'BROK_PAID1',\r\n\t\t\t'srv_paidm2' => 'SRV_PAIDM2',\r\n\t\t\t'srv_chrg1c' => 'SRV_CHRG1C',\r\n\t\t\t'srv_chrg2c' => 'SRV_CHRG2C',\r\n\t\t\t'srv_chrg3c' => 'SRV_CHRG3C',\r\n\t\t\t'raf_c' => 'RAF_C',\r\n\t\t\t'srv_chrg1p' => 'SRV_CHRG1P',\r\n\t\t\t'srv_chrg2p' => 'SRV_CHRG2P',\r\n\t\t\t'srv_chrg3p' => 'SRV_CHRG3P',\r\n\t\t\t'raf_p' => 'RAF_P',\r\n\t\t\t'serv_taxc' => 'SERV_TAXC',\r\n\t\t\t'serv_educ' => 'SERV_EDUC',\r\n\t\t\t'tdc_paidv1' => 'TDC_PAIDV1',\r\n\t\t\t'tds_c' => 'TDS_C',\r\n\t\t\t'serv_taxp' => 'SERV_TAXP',\r\n\t\t\t'serv_edup' => 'SERV_EDUP',\r\n\t\t\t'tds_paidv1' => 'TDS_PAIDV1',\r\n\t\t\t'tds_p' => 'TDS_P',\r\n\t\t\t'tdb_paidv1' => 'TDB_PAIDV1',\r\n\t\t\t'tds_b' => 'TDS_B',\r\n\t\t\t'created_by' => 'CREATED_BY',\r\n\t\t\t'created_on' => 'CREATED_ON',\r\n\t\t\t);\r\n\t\treturn $result;\r\n\t}", "abstract function process_booking($booking_params, $app_reference, $sequence_number, $search_id);", "public function getEx2() {\n // Use the QueryBuilder to insert a new row into the books table\n // i.e. create a new book\n \\DB::table('books')->insert([\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'title' => 'The Great Gatsby',\n 'author' => 'F. Scott Fitzgerald',\n 'published' => 1925,\n 'cover' => 'http://img2.imagesbn.com/p/9780743273565_p0_v4_s114x166.JPG',\n 'purchase_link' => 'http://www.barnesandnoble.com/w/the-great-gatsby-francis-scott-fitzgerald/1116668135?ean=9780743273565',\n ]);\n return 'Added book.';\n }", "function _processSale() {\n\t\t$this->autoload();\t\t\n\t\tJbPaymentxxsourcexxLib::write_log('xxsourcexx.txt', 'IPN: '.json_encode($_REQUEST));\n\t\t\n\t\t$input = jfactory::getApplication()->input;\t\t\n\t\t$status = $input->getString('xxsourcexx_transactionStatus');\n\t\t\n\t\t$success_status = array('CO','PA');\n\t\t\n\t\tif(in_array($status, $success_status)){\n\t\t\t$order_number = $input->getString('_itemId');\n\t\t\t$order_jb = JbPaymentxxsourcexxLib::getOrder($order_number);\n\t\t\t$order_jb->pay_status = 'SUCCESS';\n\t\t\t$order_jb->order_status = 'CONFIRMED';\n\t\t\t$order_jb->tx_id = $tnxref;\n\t\t\t$order_jb->store ();\n\t\t\treturn $order_jb;\t\n\t\t}else{\n\t\t\texit;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public function __construct($_docNum = null,$_accDate = null,$_docDate = null,$_docCode = null,$_userDeal = null,$_curCode = null,$_dcmRate = null,$_idPartner = null,$_pNum = null,$_idBranch = null,$_bNum = null,$_idGeoRegion = null,$_iTEMS = null)\n {\n parent::__construct(array('DocNum'=>$_docNum,'AccDate'=>$_accDate,'DocDate'=>$_docDate,'DocCode'=>$_docCode,'UserDeal'=>$_userDeal,'curCode'=>$_curCode,'dcmRate'=>$_dcmRate,'idPartner'=>$_idPartner,'PNum'=>$_pNum,'idBranch'=>$_idBranch,'BNum'=>$_bNum,'idGeoRegion'=>$_idGeoRegion,'ITEMS'=>$_iTEMS), false);\n }", "public function ebook()\n\t{\n\t\tif (preg_match('/^New eBooks.+[ _-]{0,3}(\"|#34;)([\\w., &\\'()-]{8,}?\\b)\\.(par|vol|rar|nfo).*?(\"|#34;)/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //Rowwendees post voor u op www.nzbworld.me - [0/6] - \"Animaniacs - Lights, Camera, Action!.nzb\" yEnc (1/1)\n\t\tif (preg_match('/www.nzbworld.me - \\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' yEnc/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Re: Tune In: The Beatles: All These Years (Mark Lewisohn) - Lewisohn, Mark - Tune In- the Beatles- All These Years, Volume 01 - [epub].rar yEnc\n\t\t//Re: REQ: Robert Edsel The Monuments Men - Edsel, Robert M - The Monuments Men- Allied Heroes, Nazi Thieves, and the Greatest Treasure Hunt in History (Retail) [epub].rar yEnc\n\t\tif (preg_match('/^Re:(Req:)? [\\w:()\\?\\' -]+ - ([\\w ,.()\\[\\]-]{8,}?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\tif (preg_match('/^\\(Nora Roberts\\)\"([\\w., &\\'()-]{8,}?\\b)\\.(epub|mobi|html|pdf|azw)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(Zelazny works) [36/39] - \"Roger Zelazny - The Furies.mobi\" yEnc\n\t\tif (preg_match('/\\((.+works)\\) \\[\\d+\\/(\\d+\\]) - ([\\w., &\\'()-]{8,}?\\b)\\.(mobi|pdf|epub|html|azw)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[3];\n\t\t} //(Joan D Vinge sampler) [17/17] - \"Joan D Vinge - World's End.txt\" yEnc\n\t\tif (preg_match('/^\\([a-zA-Z ]+ sampler\\) \\[\\d+(\\/\\d+\\]) - \"([\\w., &\\'()-]{8,}?\\b)\\.(txt|pdf|mobi|epub|azw)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//New - Retail - Juvenile Fiction - \"Magic Tree House #47_ Abe Lincoln at Last! - Mary Pope Osborne & Sal Murdocca.epub\" yEnc\n\t\t//New - Retail - \"Linda Howard - Cover of Night.epub\" yEnc\n\t\t//New - Retail - \"Kylie Logan_Button Box Mystery 01 - Button Holed.epub\" yEnc\n\t\tif (preg_match('/^New - Retail -( Juvenile Fiction -)? \"([\\w., &\\'()-]{8,}?\\b)\\.(txt|pdf|mobi|epub|azw)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //(No. 1 Ladies Detective Agency) [04/13] - \"Alexander McCall Smith - No 1-12 - The Saturday Big Tent Wedding Party.mobi\" yEnc\n\t\tif (preg_match('/^\\(No\\. 1 Ladies Detective Agency\\) \\[\\d+(\\/\\d+\\]) - \"([\\w., &\\'()-]{8,}?\\b)\\.(txt|pdf|mobi|epub|azw)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//[25/33] Philip Jose Farmer - Toward the Beloved City [ss].mobi\n\t\t//[2/4] Graham Masterton - Descendant.mobi\n\t\tif (preg_match('/^\\[\\d+\\/(\\d+\\]) ([\\w., &\\'()-]{8,}?\\b)\\.(txt|pdf|mobi|epub|azw)/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//(NordicAlbino) [01/10] - \"SWHQ_NA_675qe0033102suSmzSE.sfv\" yEnc\n\t\t//365 Sex Positions A New Way Every Day for a Steamy Erotic Year [eBook] - (1/5) \"365.Sex.Positions.A.New.Way.Every.Day.for.a.Steamy.Erotic.Year.eBook.nfo\" - yenc yEnc\n\t\tif (preg_match('/(.+)[-_\\s]{0,3}[\\(\\[]\\d+\\/\\d+[\\)\\]][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . '([-_\\s]{0,3}yEnc){1,2}$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //[001/125] (NL Epub Wierook Set 49) - \"Abulhawa, Susan - Litteken van David_Ochtend in Jenin.epub\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\] .+? - \"([\\w., &\\'()-]{8,}?\\b)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\") yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(1/1) \"Radiological Imaging of the Kidney - E. Quaia (Springer, 2011) WW.pdf\" - 162,82 MB - (Radiological Imaging of the Kidney - E. Quaia (Springer, 2011) WW) yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \"([\\w., &\\'()-]{8,}?\\b)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(1/7) \"0865779767.epub\" - 88,93 MB - \"Anatomic Basis of Neurologic Diagnosis - epub\" yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \".+(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")([-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB])?[-_\\s]{0,3}\"([\\w., &\\'()-]{8,}?\\b)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[4];\n\t\t}\n\t\t//Re: REQ: Jay Lake's Mainspring series/trilogy (see titles inside) - \"Lake, Jay - Clockwork Earth 03 - Pinion [epub].rar\" 405.6 kBytes yEnc\n\t\t//Attn: Brownian - \"del Rey, Maria - Paradise Bay (FBS).rar\" yEnc\n\t\t//New Scan \"Herbert, James - Sepulchre (html).rar\" yEnc\n\t\tif (preg_match('/^(Attn:|Re: REQ:|New Scan).+?[-_\\s]{0,3}\"([\\w., &\\'()-]{8,}?\\b)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")[-_\\s]{0,3}(\\d+[.,]\\d+ [kKmMgG][bB](ytes)?)? yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//\"Gabaldon, Diana - Outlander [5] The Fiery Cross.epub\" yEnc\n\t\t//Kiny Friedman \"Friedman, Kinky - Prisoner of Vandam Street_ A Novel, The.epub\" yEnc\n\t\tif (preg_match('/.*\"([\\w., &\\'()-]{8,}?\\b)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Patterson flood - Mobi - 15/45 \"James Patterson - AC 13 - Double Cross.mobi\"\n\t\tif (preg_match('/(.+?)[-_ ]{0,4}\\d+\\/\\d+[-_\\s]{0,3}([\\w. &\\'()\\[\\]-]{8,}?\\b.?)\\.(txt|pdf|mobi|epub|azw)\"( \\(\\d+\\/\\d+\\))?( )?$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //--- Michael Dobbs - House of Cards.mobi yEnc\n\t\tif (preg_match('/^--- ([\\w., &\\'()-]{8,}?\\b)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //'Steel's Edge - Ilona Andrews.epub' yEnc\n\t\tif (preg_match('/^\\'([\\w. &\\'()\\[\\]-]{8,}?\\b.?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})\\'[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[1 of 1] - Howard Gordon - Gideon's War & Hard Target.epub yEnc\n\t\tif (preg_match('/^\\[\\d+ of \\d+\\][-_\\s]{0,3}([\\w. &\\'()\\[\\]-]{8,}?\\b.?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //1 Playboy-Ausgabe vom Jnner 1953 [RARITT].rar yEnc\n\t\tif (preg_match('/^([\\w. &\\'\\[\\]-]{8,}?\\b.?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Re: Req: Please, does anyone have Scott Berg's Wilson biography? MTIA... - A. Scott Berg - Wilson.epub yEnc\n\t\tif (preg_match('/^.+ - ([^.]{8,})\\.[A-Za-z0-9]{2,4}[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //REQ: \"Keep it Pithy\" by Bill O'Reilly \"Keep It Pithy - Bill O'Reilly.epub\"yEnc\n\t\tif (preg_match('/.*\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)\\.[A-Za-z0-9]{2,4}\"[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //For Your Eyes Only - Ian Fleming.epub - answering my own request yEnc\n\t\tif (preg_match('/^([^.]{8,})\\.[A-Za-z0-9]{2,4}.+[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "public function getEx3() {\n # Use the QueryBuilder to get all the books where author is like \"%Scott%\"\n $books = \\DB::table('books')->where('author', 'LIKE', '%Scott%')->get();\n # Output the results\n $this->printBooks($books);\n }", "function save_publication($thinktank_id, $authors, $title, $url, $tags_object='', $publication_date, $image_url, $isbn, $price, $type) { \n \n $output = array();\n $title = trim($title);\n \n if(!empty($authors)) { \n //test to see if authors exist\n $author_ids = array();\n $author_array_dirty = explode(',', $authors);\n foreach ($author_array_dirty as $author) { \n $author_array_clean[] = trim($author); \n }\n \n foreach ($author_array_clean as $author) { \n $author_data = $this->search_jobs($author, $thinktank_id, '', true, false);\n \n if (empty($author_data[0])){ \n $output[] = array('message' => \"Author '$author' is not currently associated with this thinktank, they will be recorded as a report author for $thinktank_id\", 'type'=>'notice');\n $author_id = $this->save_job($author, $thinktank_id, \"report_author_only\");\n $author_ids[] = $author_id['person_id'];\n $output = array_merge($author_id); \n }\n \n else { \n $output[] = array('message' => \"Author '$author' already exists as a person\", 'type'=> 'log'); \n $author_ids[] = $author_data[0]['person_id']; \n }\n } \n \n }\n else { \n $output[] = array('message' => \"No authors for this publication\", 'type'=>'log');\n }\n \n $extant = $this->search_publications($title, $thinktank_id);\n \n $thinktank_id = mysql_real_escape_string($thinktank_id); \n $title = mysql_real_escape_string($title); \n $url = mysql_real_escape_string($url); \n $tags_object = mysql_real_escape_string($tags_object); \n $publication_date = mysql_real_escape_string($publication_date); \n $image_url = mysql_real_escape_string($image_url);\n $isbn = mysql_real_escape_string($isbn);\n $price = mysql_real_escape_string($price);\n $type = mysql_real_escape_string($type); \n\n //save a new publication\n if (empty($extant[0])) { \n $sql = \"INSERT INTO publications (thinktank_id, title, url, tags_object, publication_date, image_url, isbn, price, type) VALUES ('$thinktank_id', '$title', '$url', '$tags_object', '$publication_date', '$image_url', '$isbn', '$price', '$type')\";\n $resource = $this->query($sql);\n \n $output[] = array('message' => \"$title is a new publication for thinktank id $thinktank_id\", \"type\"=>'notice');\n $pub_id = mysql_insert_id();\n \n //link publications to authors \n if(!empty($author_ids)) {\n foreach($author_ids as $author_id) { \n $sql = \"INSERT INTO people_publications (person_id, publication_id) VALUES ('$author_id', '$pub_id' )\"; \n $this->query($sql);\n } \n }\n }\n \n //update and old one\n else {\n $pub_id = $extant[0]['publication_id']; \n $sql = \"UPDATE publications SET url='$url', tags_object='$tags_object', publication_date='$publication_date', image_url='$image_url', isbn='$isbn', price='$price', type='$type' WHERE publication_id='$pub_id'\";\n $this->query($sql);\n $output[] = array('message' => \"$title is an existing publication for thinktank id $thinktank_id\", 'type'=> 'log');\n }\n\n return $output;\n }", "protected function has_data()\n {\n }", "function search_textbooks($db, $title, $isbn, $author)\n{\n\t$titlekey = \"\"; //sql colomn name\n\t$isbnkey = \"\"; //sql column name \n\t$authorkey = \"\"; //sql column name\n\t$titlevalue = \"\"; // sql column value\n\t$isbnvalue = \"\"; // sql column value\n\t$authorvalue = \"\"; // sql column value\n\n\t/* All empty strings returns nothing */\n\tif($title == \"\" && $isbn == \"\" && $author == \"\")\n\t{\n\t\t$titlekey = \"1\";\n\t\t$isbnkey = \"1\";\n\t\t$authorkey = \"1\";\n\t\t$titlevalue = \"0\";\n\t\t$isbnvalue = \"0\";\n\t\t$authorvalue = \"0\";\n\t}\n\telse // If not an empty search\n\t{\n\n\t\tif($title == \"\") // No search by title\n\t\t{\n\t\t\t$titlekey = '1';\n\t\t\t$titlevalue = '1';\n\t\t}\n\t\telse // Include search by title\n\t\t{\n\t\t\t$titlekey = 'title';\n\t\t\t$titlevalue = \"%\".$title.\"%\"; \n\t\t}\n\n\t\tif($isbn == \"\") // No search by isbn\n\t\t{\n\t\t\t$isbnkey = '1';\n\t\t\t$isbnvalue = '1';\n\t\t}\n\t\telse // include search by isbn\n\t\t{\n\t\t\t$isbnkey = 'isbn';\n\t\t\t$isbnvalue = \"%\".$isbn.\"%\";\n\t\t}\n\n\t\tif($author == \"\") // no search by author\n\t\t{\n\t\t\t$authorkey = '1';\n\t\t\t$authorvalue = '1';\n\t\t}\n\t\telse // include search by author\n\t\t{\n\t\t\t$authorkey = 'author';\n\t\t\t$authorvalue = \"%\".$author.\"%\";\n\t\t}\n\t}\n\n\t\t/* Run the query */\n\t\t$sql = \"SELECT * FROM textbooks where \n\t\t\t\t\t\t\".$titlekey.\" LIKE :title and \".$isbnkey.\" LIKE :isbn and \n\t\t\t\t\t\t\".$authorkey.\" LIKE :author and removed=0\n\t\t\t\t\t\tORDER BY date_time DESC\";\n\n\t\t$st = $db->prepare($sql);\n\t\t$st->execute(array(':title' => $titlevalue, ':isbn'=>$isbnvalue, ':author'=>$authorvalue));\n\t\t$us = $st->fetchAll();\n\t\treturn $us;\n}", "function book($param1 = '', $param2 = '', $param3 = '') {\r\n if ($this->session->userdata('accountant_login') != 1)\r\n redirect('login', 'refresh');\r\n if ($param1 == 'create') {\r\n $data['name'] = $this->input->post('name');\r\n $data['description'] = $this->input->post('description');\r\n $data['price'] = $this->input->post('price');\r\n $data['author'] = $this->input->post('author');\r\n $data['class_id'] = $this->input->post('class_id');\r\n $data['status'] = $this->input->post('status');\r\n $this->db->insert('book', $data);\r\n redirect(base_url() . 'index.php?admin/book', 'refresh');\r\n }\r\n if ($param1 == 'do_update') {\r\n $data['name'] = $this->input->post('name');\r\n $data['description'] = $this->input->post('description');\r\n $data['price'] = $this->input->post('price');\r\n $data['author'] = $this->input->post('author');\r\n $data['class_id'] = $this->input->post('class_id');\r\n $data['status'] = $this->input->post('status');\r\n\r\n $this->db->where('book_id', $param2);\r\n $this->db->update('book', $data);\r\n redirect(base_url() . 'index.php?admin/book', 'refresh');\r\n } else if ($param1 == 'edit') {\r\n $page_data['edit_data'] = $this->db->get_where('book', array(\r\n 'book_id' => $param2\r\n ))->result_array();\r\n }\r\n if ($param1 == 'delete') {\r\n $this->db->where('book_id', $param2);\r\n $this->db->delete('book');\r\n redirect(base_url() . 'index.php?admin/book', 'refresh');\r\n }\r\n $page_data['books'] = $this->db->get('book')->result_array();\r\n $page_data['page_name'] = 'book';\r\n $page_data['page_title'] = get_phrase('manage_library_books');\r\n $this->load->view('index', $page_data);\r\n }", "public function processApi() {\n $request = $this->_request['request'];\n $values = $this->_request;\n\n // WARNING: This method needs to add some ways to authenticate the user\n // and should also filter out any dangerous or magic methods before it\n // would be safe. This code is for demonstration purposes only!\n\n if (method_exists($this->database, $request)) {\n if (!empty($_REQUEST['request'])) {\n unset($values['request']);\n $result = $this->database->processRequest($request, $values);\n if (!empty($result)) {\n $this->response($this->json($result), 200);\n }\n else {\n // If no records \"No Content\" status\n $this->response('',204);\n }\n }\n else {\n // If the method not exist with in this class, response would be \"Page not found\".\n $this->response('',404);\n }\n }\n }", "function AfterAdd(&$values,&$keys,$inline,&$pageObject)\n{\n\n\t\tglobal $conn;\n$proid= $keys['proid'];\n$bill_date=$values['bill_date'];\n$amount_bill=$values['amount'];\n$bill_no=$values['bill_no'];\n$item=$values['item'];\n$ProgramID = $values['ProgramID'];\n$BatchID = $values['BatchID'];\n\n//get related student according to intake , branch, and program\n$sql_student = \"select StudentID from student_info where DipID='$ProgramID' AND BatchID='$BatchID' AND Status='Active'\";\n$q_student = db_query($sql_student,$conn);\n\n//insert all program billing item to related student program bill\nwhile($row_student=db_fetch_array($q_student))\n{ \n$studentID=$row_student['StudentID'];\n$sql_insert=\"INSERT INTO student_billing (proid,date,amount,amount_balance,bill_no,item,studentID,status)\nVALUES ('$proid','$bill_date','$amount_bill','$amount_bill','$bill_no','$item','$studentID','Pending')\";\ndb_exec($sql_insert,$conn);\t\n}\n\n\n;\t\t\n}", "public function getPraposalChecklist( $param1 = null, $param2 = null, $param3 = null, $param4 = null, $param5 = null, $param6 = null, $param7 = null)\n {\n\n $endUseList = $param2;\n $loanProduct = $param2;\n $amount = $param3;\n $loanTenure = $param4;\n $companySharePledged = null;\n $bscNscCode = null;\n if (isset($param5) && isset($param6)) {\n $companySharePledged = $param5;\n $bscNscCode = $param6;\n $loanId = $param7;\n } else {\n $loanId = $param5;\n }\n\n $loan = null;\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n }\n $loanType = null;\n \n $user = null;\n $userProfile = null;\n if (isset($loan)) {\n $loanType = $loan->type;\n $amount = $loan->loan_amount;\n $loanTenure = $loan->loan_tenure;\n $endUseList = $loan->end_use;\n\n\n }\n\n\n $states = MasterData::states();\n $choosenSales = null;\n $userType = MasterData::userType();\n $industryTypes = MasterData::industryTypes(false);\n $businessVintage = MasterData::businessVintage();\n $choosenUserType = null;\n $loanApplicationId = null;\n $chosenproductType = null;\n $existingCompanyDeails = null;\n $existingCompanyDeailsCount = 0;\n $maxCompanyDetails = Config::get('constants.CONST_MAX_COMPANY_DETAIL');\n $newCompanyDeailsNum = $maxCompanyDetails - $existingCompanyDeailsCount;\n\n $loansStatus = null;\n $loan = null;\n $isReadOnly = Config::get('constants.CONST_IS_READ_ONLY');\n $setDisable = null;\n $status = null;\n $user = null;\n $userProfile = null;\n $isRemoveMandatory = MasterData::removeMandatory();\n $entityTypes = MasterData::entityTypes();\n $chosenEntity = null;\n $isRemoveMandatory = array_except($isRemoveMandatory, ['']);\n $removeMandatoryHelper = new validLoanUrlhelper();\n $removeMandatory = $removeMandatoryHelper->getMandatory($user, $isRemoveMandatory);\n // $removeMandatory = $this->getMandatory($user);\n // dd($removeMandatory,$setDisable);\n $validLoanHelper = new validLoanUrlhelper();\n $setDisable = $this->getIsDisabled($user);\n\n //$bl_year = MasterData::BalanceSheet_FY();\n $bl_year = $this->setFinancialYears();\n $groupType = Config::get('constants.CONST_FIN_GROUP_TYPE_RATIO');\n $financialGroups = FinancialGroup::with('financialEntries')->where('type', '=', $groupType)->where('status', '=', 1)->orderBy('sortOrder')->get();\n $helper = new ExpressionHelper($loanId);\n $financialDataExpressionsMap = $helper->calculateRatios();\n //dd($bl_year, $groupType, $financialGroups, $financialDataExpressionsMap);\n $financialDataMap = new Collection();\n $showFormulaText = true;\n $financialProfitLoss = ProfitLoss::where('loan_id', '=', $loanId)->get();\n $ratios = Ratio::where('loan_id', '=', $loanId)->get();\n /* echo \"<pre>\";\n print_r($ratios);\n echo \"</pre>\";\n */ \n $subViewType = 'loans._checklist';\n $formaction = 'Loans\\LoansController@postPraposalChecklist';\n //$formaction = 'loans/newlap/uploaddoc/'.$loanId;\n $validLoanHelper = new validLoanUrlhelper();\n //getting borrowers profile\n //PraposalChecklist\n $loan = Loan::find($loanId);\n $loanUser = User::find($loan->user_id);\n $loanUserProfile = $loanUser->userProfile();\n\n\n $isReadOnly = Config::get('constants.CONST_IS_READ_ONLY');\n\n $setDisable = '';\n $isRemoveMandatory = MasterData::removeMandatory();\n $isRemoveMandatory = array_except($isRemoveMandatory, ['']);\n $removeMandatoryHelper = new validLoanUrlhelper();\n $removeMandatory = $removeMandatoryHelper->getMandatory($user, $isRemoveMandatory);\n if (isset($loanId)) {\n $validLoan = $validLoanHelper->isValidLoan($loanId);\n if (!$validLoan) {\n return view('loans.error');\n }\n $status = $validLoanHelper->getTabStatus($loanId, 'background');\n if ($status == 'Y' && $setDisable != 'disabled') {\n $setDisable = 'disabled';\n }\n }\n //$formaction = 'loans/newlap/uploaddoc/'.$loanId;\n $validLoanHelper = new validLoanUrlhelper();\n //getting borrowers profile\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n $loanUser = User::find($loan->user_id);\n $loanUserProfile = $loanUser->userProfile();\n @$praposalChecklist=PraposalChecklists::where('loan_id', '=', $loanId)->first();\n @$promoterDetails=PromoterDetails::where('loan_id', '=', $loanId)->first();\n }\n $userPr = UserProfile::where('user_id', '=', $loan->user_id)->first();\n $userProfileFirm = UserProfile::with('user')->find($userPr->id);\n\n return view('loans.praposalCreditEdit', compact(\n 'subViewType',\n 'loan',\n 'praposalChecklist',\n 'loanId',\n 'endUseList',\n 'loanType',\n 'amount',\n 'loanTenure',\n 'promoterDetails',\n 'formaction',\n 'removeMandatory ',\n 'bl_year',\n 'businessVintage',\n 'setDisable',\n 'ratioBreachesDescrip',\n 'financialGroups',\n 'groupType',\n 'com_business_type',\n 'financialDataExpressionsMap',\n 'showFormulaText',\n 'financialDataMap',\n 'validLoanHelper',\n 'userProfileFirm',\n 'refreanceCheckDescription',\n 'loanUserProfile',\n 'companySharePledged',\n 'bscNscCode',\n 'financialProfitLoss',\n 'ratios',\n 'typeofEntity'\n ));\n }", "function bookking_get_file_info($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename) {\n global $CFG, $DB, $USER;\n\n // Note: 'intro' area is handled in file_browser automatically.\n\n if (!has_any_capability(array('mod/bookking:appoint', 'mod/bookking:attend'), $context)) {\n return null;\n }\n\n require_once(dirname(__FILE__).'/locallib.php');\n\n $validareas = array_keys(bookking_get_file_areas($course, $cm, $context));\n if (!in_array($filearea, $validareas)) {\n return null;\n }\n\n if (is_null($itemid)) {\n return new bookking_file_info($browser, $course, $cm, $context, $areas, $filearea);\n }\n\n try {\n $bookking = bookking_instance::load_by_coursemodule_id($cm->id);\n\n if ($filearea === 'bookinginstructions') {\n $cansee = true;\n $canwrite = has_capability('moodle/course:manageactivities', $context);\n $name = get_string('bookinginstructions', 'bookking');\n\n } else if ($filearea === 'slotnote') {\n $slot = $bookking->get_slot($itemid);\n\n $cansee = true;\n $canwrite = $USER->id == $slot->teacherid\n || has_capability('mod/bookking:manageallappointments', $context);\n $name = get_string('slot', 'bookking'). ' '.$itemid;\n\n } else if ($filearea === 'appointmentnote') {\n if (!$bookking->uses_appointmentnotes()) {\n return null;\n }\n list($slot, $app) = $bookking->get_slot_appointment($itemid);\n $cansee = $USER->id == $app->studentid || $USER->id == $slot->teacherid\n || has_capability('mod/bookking:manageallappointments', $context);\n $canwrite = $USER->id == $slot->teacherid\n || has_capability('mod/bookking:manageallappointments', $context);\n $name = get_string('appointment', 'bookking'). ' '.$itemid;\n\n } else if ($filearea === 'teachernote') {\n if (!$bookking->uses_teachernotes()) {\n return null;\n }\n\n list($slot, $app) = $bookking->get_slot_appointment($itemid);\n $cansee = $USER->id == $slot->teacherid\n || has_capability('mod/bookking:manageallappointments', $context);\n $canwrite = $cansee;\n $name = get_string('appointment', 'bookking'). ' '.$itemid;\n }\n\n $fs = get_file_storage();\n $filepath = is_null($filepath) ? '/' : $filepath;\n $filename = is_null($filename) ? '.' : $filename;\n if (!$storedfile = $fs->get_file($context->id, 'mod_bookking', $filearea, $itemid, $filepath, $filename)) {\n return null;\n }\n\n $urlbase = $CFG->wwwroot.'/pluginfile.php';\n return new file_info_stored($browser, $context, $storedfile, $urlbase, $name, true, true, $canwrite, false);\n } catch (Exception $e) {\n return null;\n }\n}", "public function getEx11() {\n $books = \\App\\Book::orderBy('title','asc')->get();\n $this->printBooks($books);\n # Underlying SQL: select * from `books` order by `title` asc\n }", "protected function preprocessData() {}", "function checkY3432Poe($exportData, $accountInfo){\r\n\tif(strlen($accountInfo->Employer)>0){ //we have an employer name - update the export array\r\n\t\t$exportData[02][\"debtorPoe\"] = (string) $accountInfo->Employer;\r\n\t\tif(strlen($accountInfo->EmployerAddress)>0){ //now check for address\r\n\t\t\t$exportData[02][\"debtorPoeAddress\"] = (string) $accountInfo->EmployerAddress;\r\n\t\t}\r\n\t\tif(strlen($accountInfo->EmployerCityStateZip)>0 && strstr($accountInfo->EmployerCityStateZip, \", ,\")){ //now check for city state zip\r\n\t\t\t$exportData[02][\"debtorPoeCity\"] = (string) $accountInfo->EmployerCityStateZip;\r\n\t\t}\r\n\t\tif(strlen($accountInfo->EmployerPhone)>0){ //now check for phone\r\n\t\t\t$exportData[02][\"debtorPoePhone\"] = (string) $accountInfo->EmployerPhone;\r\n\t\t}\r\n\t}\r\n\treturn $exportData;\r\n}", "function valida_centrobeneficio($rfc)\n{\n\tif($_REQUEST['codigomodalidadacademica'])\n\t{\n\t\t$codigomodalidadacademica=$_REQUEST['codigomodalidadacademica'];\n\t}\n\telseif(isset($_GET['codigocarrera']) and $_GET['codigocarrera']!=\"\")\n\t{\n\t\tif(!$_REQUEST['codigomodalidadacademica'])\n\t\t{\n\t\t\t$query=\"\";\n\t\t\t$carrera=new ADODB_Active_Record('carrera');\n\t\t\t$carrera->Load(\"codigocarrera='\".$_GET['codigocarrera'].\"'\");\n\t\t\t//echo $carrera->codigomodalidadacademica;\n\t\t\t$codigomodalidadacademica=$carrera->codigomodalidadacademica;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$codigomodalidadacademica=$_REQUEST['codigomodalidadacademica'];\n\t\t}\n\t}\n\t{\n\t\t$rfcfunction = \"ZFICA_CENTROS_BENEF\";\n\t\t$resultstable = \"T_CEBE\";\n\t\t$entrego = \"MODAC\";\n\t\t$modac = $codigomodalidadacademica;\n\t\t$rfchandle = saprfc_function_discover($rfc, $rfcfunction);\n\t\t// traigo la tabla interna de SAP\n\t\tsaprfc_table_init($rfchandle,$resultstable);\n\t\t// importo parametro de entrada\n\t\tsaprfc_import($rfchandle,$entrego,$modac);\n\t\t$rfcresults = saprfc_call_and_receive($rfchandle);\n\t\t$numrows = saprfc_table_rows($rfchandle,$resultstable);\n\t\tfor ($i=1; $i <= $numrows; $i++)\n\t\t{\n\t\t\t$results[$i] = saprfc_table_read($rfchandle,$resultstable,$i);\n\t\t}\n\t\t//var_dump($results);\n\t\tif ($results <> \"\")\n\t\t{ // if 1\n\t\t\tforeach ($results as $valor => $total)\n\t\t\t{ // foreach 1\n\t\t\t\tforeach ($total as $valor1 => $total1)\n\t\t\t\t{ // foreach 2\n\t\t\t\t\tif ($valor1 == \"PRCTR\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$codigocentrobeneficio = $total1;\n\t\t\t\t\t\t//echo $opprincipal,\"<br>\";\n\t\t\t\t\t}\n\t\t\t\t\tif ($valor1 == \"LTEXT\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$nombrecentrobeneficio = $total1;\n\t\t\t\t\t}\n\t\t\t\t} // foreach 2\n\t\t\t\t$totalconceptos[] = array($codigocentrobeneficio,$nombrecentrobeneficio);\n\t\t\t} // foreach 1\n\t\t} // if 1\n\t}\n\n\tif(is_array($totalconceptos))\n\t{\n\t\tforeach ($totalconceptos as $valor => $total)\n\t\t{ // foreach 1\n\t\t\t$contador = 1;\n\t\t\t$codigosap = \"\";\n\t\t\tforeach ($total as $valor1 => $total1)\n\t\t\t{ // foreach 2\n\t\t\t\tif ($contador == 1)\n\t\t\t\t{\n\t\t\t\t\t$codigosap = $codigosap . $total1;\n\t\t\t\t\t$contador++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tif ($contador == 2)\n\t\t\t\t{\n\t\t\t\t\t$codigosap = $codigosap. \"-\" . $total1;\n\t\t\t\t\t$contador++;\n\t\t\t\t}\n\t\t\t} // foreach 2\n\t\t\t$insertacodigo = explode(\"-\", $codigosap);\n\t\t\t$valor=$insertacodigo[0];\n\t\t\t$name = explode(\"-\", $_POST['codigocentrobeneficio']);\n\t\t\t$label=strtoupper($insertacodigo[0]).\"-\".$insertacodigo[1];\n\t\t\t$array_combo_centrobeneficio[$contador_array]['etiqueta']=$label;\n\t\t\t$array_combo_centrobeneficio[$contador_array]['valor']=$valor;\n\t\t\t$contador_array++;\n\t\t}\n\t\treturn $array_combo_centrobeneficio;\n\t}\n}", "abstract public function prepareToStore();", "function book ($Nup, $quantity, &$totalSheets, &$pages) {\n\tif ($_POST[\"book\"] == \"book\"){\n\t$pages = $_POST[\"pages\"];\n\t$spreads = ceil($pages / 4);\n\t$totalSheets = ($spreads / $Nup) * $quantity;\n\t}\n\treturn $spreads;\n}", "public function testErrorHandling()\n\t{\n\t\tR::nuke();\n\t\tR::store( R::dispense( 'book' ) );\n\t\tR::freeze( FALSE );\n\t\tR::find( 'book2', ' id > 0' );\n\t\tpass();\n\t\tR::find( 'book', ' id2 > ?' );\n\t\tpass();\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book', ' id = ?', array( 0, 1 ) );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t\tR::freeze( TRUE );\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book2', ' id > 0' );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book', ' id2 > 0' );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t}", "protected function localValidation()\n\t\t{\n\t\t}", "function editQualificationload($post,$deviceType,$appVersion,$OSVersion,$browserVersion){\n\n $con=connectToDB(); //connect to the DB\n mysql_query('SET NAMES UTF8');\t\t\n\t$sql=\"SELECT * FROM SCP_Qualification where QualificationID='\".$post['QualificationID'].\"'\";\t\t\t\t\n\t$result = mysql_query($sql);\n\t\n //CHECK FOR ERROR\n if (!$result) die('Invalid query: ' . mysql_error());\n $rows = array();\n while($row = mysql_fetch_assoc($result)) {\n\t @$row['serviceRequestID']='62';\n $rows[] = $row;\t\n\t\t$arr=$row;\t\t\n }\n\t\t\n if($rows) {\n $data['responseData'] = $rows;\n\t\t$data['responseData2'] = $arr;\n $data['message'] = \"Qualification get successfully\";\n $data['responseCode'] = \"200\";\n $data['status'] = \"1\";\n } else {\n $data['responseData'] = '';\n\t\t$data['responseData2'] = '';\n $data['message'] = \"No Qualification Found\";\n $data['responseCode'] = \"201\";\n $data['status'] = \"0\";\n }\n print json_encode($data);\n mysql_close($con); //close the connection\n}", "public function item_status($bnum) {\n\n $iii_server_info = self::iii_server_info();\n $avail_token = locum::csv_parser($this->locum_config['iii_custom_config']['iii_available_token']);\n $default_age = $this->locum_config['iii_custom_config']['default_age'];\n $default_branch = $this->locum_config['iii_custom_config']['default_branch'];\n $loc_codes_flipped = array_flip($this->locum_config['iii_location_codes']);\n $bnum = trim($bnum);\n\n // Grab Hold Numbers\n $url = $iii_server_info['nosslurl'] . '/search~24/.b' . $bnum . '/.b' . $bnum . '/1,1,1,B/marc~' . $bnum . '&FF=&1,0,';\n $hold_page_raw = utf8_encode(file_get_contents($url));\n\n // Reserves Regex\n $regex_r = '/(?<hold_num>\\d+) hold/';\n preg_match($regex_r, $hold_page_raw, $match_r);\n $avail_array['holds'] = $match_r['hold_num'] ? $match_r['hold_num'] : 0;\n\n // Order Entry Regex\n $avail_array['on_order'] = 0;\n $regex_o = '%bibOrderEntry(.*?)td(.*?)>(.*?)<%s';\n preg_match_all($regex_o, $hold_page_raw, $match_o);\n foreach($match_o[3] as $order) {\n $order_txt = trim($order);\n preg_match('%^(.*?)cop%s', $order_txt, $order_count);\n $avail_array['on_order'] = $avail_array['on_order'] + (int) trim($order_count[1]);\n $avail_array['orders'][] = $order_txt;\n }\n\n $url = $iii_server_info['nosslurl'] . '/search~24/.b' . $bnum . '/.b' . $bnum . '/1,1,1,B/holdings~' . $bnum . '&FF=&1,0,';\n $avail_page_raw = utf8_encode(file_get_contents($url));\n\n // Holdings Regex\n $regex_h = '%field 1 -->&nbsp;(.*?)</td>(.*?)browse\">(.*?)</a>(.*?)field \\% -->&nbsp;(.*?)</td>%s';\n preg_match_all($regex_h, $avail_page_raw, $matches);\n\n foreach ($matches[1] as $i => $location) {\n // put the item details in the array\n $location = trim($location);\n $loc_code = $loc_codes_flipped[$location];\n $call = str_replace(\"'\", \"&apos;\", trim($matches[3][$i]));\n $status = trim($matches[5][$i]);\n $age = $default_age;\n $branch = $default_branch;\n\n if (in_array($status, $avail_token)) {\n $avail = 1;\n $due_date = 0;\n } else {\n $avail = 0;\n if (preg_match('/DUE/i', $status)) {\n $due_arr = explode(' ', trim($status));\n $due_date_arr = explode('-', $due_arr[1]);\n $due_date = mktime(0, 0, 0, $due_date_arr[0], $due_date_arr[1], (2000 + (int) $due_date_arr[2]));\n } else if(preg_match('/LIB USE ONLY/i', $status)) {\n $due_date = 0;\n $libuse = 1;\n } else {\n $due_date = 0;\n }\n }\n\n // Determine age from location\n if (count($this->locum_config['iii_record_ages'])) {\n foreach ($this->locum_config['iii_record_ages'] as $item_age => $match_crit) {\n if (preg_match('/^\\//', $match_crit)) {\n if (preg_match($match_crit, $loc_code)) { $age = $item_age; }\n } else {\n if (in_array($loc_code, locum::csv_parser($match_crit))) { $age = $item_age; }\n }\n }\n }\n\n // Determine branch from location\n if (count($this->locum_config['branch_assignments'])) {\n foreach ($this->locum_config['branch_assignments'] as $branch_code => $match_crit) {\n if (preg_match('/^\\//', $match_crit)) {\n if (preg_match($match_crit, $loc_code)) { $branch = $branch_code; }\n } else {\n if (in_array($loc_code, locum::csv_parser($match_crit))) { $branch = $branch_code; }\n }\n }\n }\n\n $avail_array['items'][] = array(\n 'location' => $location,\n 'loc_code' => $loc_code,\n 'callnum' => $call,\n 'statusmsg' => $status,\n 'due' => $due_date,\n 'avail' => $avail,\n 'age' => $age,\n 'branch' => $branch,\n 'libuse' => $libuse,\n );\n }\n\n return $avail_array;\n\n }", "abstract protected function _prepare();", "public function aquire( ){\n\t\t\n\n\t\t/*\n\t\t* papers\n\t\t*/\n\t\t$this->papers = array(\n\t\t\t'*' => array(\n\t\t\t\t\t'price_per_kg' => 3.6,\n\t\t\t\t\t'label' => 'Papier do druku cyfrowego 80g',\n\t\t\t\t\t'weight' => .08\n\t\t\t\t),\n\n\t\t\t'gc1-230g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 4.6, 'label' => 'coated 90g', \t'weight' => .23, \t'thickness' => .336 ),\n\t\t\t'gc1-250g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 4.6, 'label' => 'coated 90g', \t'weight' => .25, \t'thickness' => .378 ),\n\t\t\t'gc2-230g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 4.6, 'label' => 'coated 90g', \t'weight' => .23, \t'thickness' => .336 ),\n\t\t\t'gc2-250g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 4.6, 'label' => 'coated 90g', \t'weight' => .25, \t'thickness' => .378 ),\n\n\n\n\n\n\t\t\t'coated-90g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'coated 90g', \t'weight' => .09, \t'thickness' => .074 ),\n\t\t\t'coated-115g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'coated 115g', \t'weight' => .115, \t'thickness' => .09 ),\n\t\t\t'coated-130g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'coated 135g', \t'weight' => .135, \t'thickness' => .1 ),\n\t\t\t'coated-135g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'coated 135g', \t'weight' => .135, \t'thickness' => .1 ),\n\t\t\t'coated-150g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'coated 150g', \t'weight' => .15, \t'thickness' => .105 ),\n\t\t\t'coated-170g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'coated 170g', \t'weight' => .17, \t'thickness' => .13 ),\n\t\t\t'coated-200g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'coated 200g', \t'weight' => .2, \t'thickness' => .15 ),\n\t\t\t'coated-250g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'coated 250g', \t'weight' => .25, \t'thickness' => .19 ),\n\t\t\t'coated-300g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'coated 300g', \t'weight' => .3, \t'thickness' => .235 ),\t\t\t\n\t\t\t'coated-350g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'coated 350g', \t'weight' => .35, \t'thickness' => .274 ),\n\t\t\t\n\t\t\t'uncoated-70g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'Offset 70g', \t'weight' => .07, \t'thickness' => .09 ),\n\t\t\t'uncoated-80g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'Offset 80g', \t'weight' => .08, \t'thickness' => .1 ),\n\t\t\t'uncoated-90g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'Offset 90g', \t'weight' => .09, \t'thickness' => .11 ),\n\t\t\t'uncoated-100g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'Offset 100g', \t'weight' => .1, \t'thickness' => .12 ),\n\t\t\t'uncoated-120g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'Offset 120g', \t'weight' => .12, \t'thickness' => .14 ),\n\t\t\t'uncoated-150g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'Offset 150g', \t'weight' => .15, \t'thickness' => .17 ),\n\t\t\t'uncoated-170g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'Offset 170g', \t'weight' => .15, \t'thickness' => .195 ),\n\t\t\t'uncoated-200g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'Offset 200g', \t'weight' => .15, \t'thickness' => .23 ),\n\t\t\t'uncoated-250g' \t\t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'Offset 250g', \t'weight' => .25, \t'thickness' => .27 ),\n\t\t\t\n\t\t\t'ekobookc-60g-2.0' \t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'Ekobook kremowy 60g pulchny 2.0', \t'weight' => .06, \t'thickness' => .117 ),\n\t\t\t'ekobookw-60g-2.0' \t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'Ekobook bialy 60g pulchny 2.0', \t'weight' => .06, \t'thickness' => .117 ),\n\t\t\t'ekobookc-70g-2.0' \t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'Ekobook kremowy 70g pulchny 2.0', \t'weight' => .07, \t'thickness' => .127 ),\n\t\t\t'ekobookw-70g-2.0' \t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'Ekobook bialy 70g pulchny 2.0', \t'weight' => .07, \t'thickness' => .127 ),\n\t\t\t'ekobookc-80g-2.0' \t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'Ekobook kremowy 80g pulchny 2.0', \t'weight' => .08, \t'thickness' => .137 ),\n\t\t\t'ekobookw-80g-2.0' \t=> array( \n\t\t\t\t'price_per_kg' \t=> 3.6, 'label' => 'Ekobook bialy 80g pulchny 2.0', \t'weight' => .08, \t'thickness' => .137 ),\n\n\n\t\t\t'munken_white_15-80g' \t=> array( \n\t\t\t\t'price_per_kg' \t=> 5.6, 'label' => 'Munken bialy 80g pulchny 1.5', \t'weight' => .08, \t'thickness' => .116 ),\n\t\t\t'munken_cream_15-80g' \t=> array( \n\t\t\t\t'price_per_kg' \t=> 5.6, 'label' => 'Munken kremowy 80g pulchny 1.5', \t'weight' => .08, \t'thickness' => .116 ),\n\n\t\t\t'munken_white_15-90g' \t=> array( \n\t\t\t\t'price_per_kg' \t=> 5.6, 'label' => 'Munken bialy 80g pulchny 1.5', \t'weight' => .08, \t'thickness' => .132 ),\n\t\t\t'munken_cream_15-90g' \t=> array( \n\t\t\t\t'price_per_kg' \t=> 5.6, 'label' => 'Munken kremowy 80g pulchny 1.5', \t'weight' => .08, \t'thickness' => .132 ),\n\n\t\t);\n\n\t\t\n\t}", "public function updateBook()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$ISBN = $_POST['ISBN'];\n\t\t\t$title = $_POST['title'];\n\t\t\t$author = $_POST['author'];\n\t\t\t$press = $_POST['press'];\n\t\t\t$category = $_POST['category'];\n\t\t\t$pub_date = $_POST['pub_date'];\n\t\t\t$price = $_POST['price'];\n\t\t\t$floor = $_POST['floor'];\n\t\t\t$bookshelf = $_POST['bookshelf'];\n\t\t\t$area_code = $_POST['area_code'];\n\n\t\t\t$book = D('Book_species');\n\t\t\t$sql = \"update lib_book_species set title = '{$title}',author='{$author}',press='{$press}',\n\t\t\t\t \tcategory='{$category}',pub_date='{$pub_date}',price='{$price}',\n\t\t\t\t \tfloor='{$floor}',bookshelf='{$bookshelf}',area_code='{$area_code}'\n\t\t\t\t \twhere isbn = '{$ISBN}'\";\n\t\t\t$return = $book->execute($sql);\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'msg' => 'Modify successfully!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "function SchedullerPO(){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Cek --> Update PO List, Update Quantity PO Open\n\t\t// echo \"hahah\";\t\t\n\t\trequire_once APPPATH.'third_party/sapclasses/sap.php';\n\t\t$sap = new SAPConnection();\n\t\t$sap->Connect(APPPATH.\"third_party/sapclasses/logon_dataDev.conf\");\n\t\tif ($sap->GetStatus() == SAPRFC_OK ) $sap->Open ();\n\t\tif ($sap->GetStatus() != SAPRFC_OK ) {\n\t\t\techo $sap->PrintStatus();\n\t\t\texit;\n\t\t}\n\n\t\t$fce = &$sap->NewFunction (\"Z_ZCMM_VMI_PO_DETAILC\");\n\t\t\n\t\tif ($fce == false) {\n\t\t\t$sap->PrintStatus();\n\t\t\texit;\n\t\t}\n\t\t\n\t\t$start \t= date(\"20170101\");\t\t\t\t\t// Date start VMI apps\n\t\t$end \t= date(\"Ymd\");\t\t\t\t\t\t// Date Now\n\t\t$opco\t\t\t\t\t= '7000';\n\t\t$fce->COMPANY \t\t\t= \"$opco\";\t\t// BUKRS\n\t\t// $fce->PO_TYPE \t\t= 'ZK17';\n\t\t// $fce->VENDOR \t\t= ;\n\t\t$fce->DATE['SIGN'] \t= 'I';\n\t\t$fce->DATE['OPTION']\t= 'BT';\n\t\t$fce->DATE['LOW'] \t= $start;\n\t\t$fce->DATE['HIGH'] \t= $end;\n\t\t\n\t\t$fce->PO_TYPE->row['SIGN'] \t= 'I';\n\t\t$fce->PO_TYPE->row['OPTION'] \t= 'EQ';\n\t\t$fce->PO_TYPE->row['LOW'] \t= 'ZK10';\n\t\t$fce->PO_TYPE->row['HIGH'] \t= '';\n\t\t$fce->PO_TYPE->Append($fce->PO_TYPE->row);\n\t\t\n\t\t$fce->PO_TYPE->row['SIGN'] \t= 'I';\n\t\t$fce->PO_TYPE->row['OPTION'] \t= 'EQ';\n\t\t$fce->PO_TYPE->row['LOW'] \t= 'ZK17';\n\t\t$fce->PO_TYPE->row['HIGH'] \t= '';\n\t\t$fce->PO_TYPE->Append($fce->PO_TYPE->row);\n\t\t\t\n $fce->call();\n\n if ($fce->GetStatus() == SAPRFC_OK) {\n $fce->T_ITEM->Reset();\n $data=array();\n $empty=0;\n $tampildata=array();\n while ($fce->T_ITEM->Next()) {\n\t\t\t\t$matnr \t\t= $fce->T_ITEM->row[\"MATNR\"];\t// Kode Material\n\t\t\t\t$lifnr \t\t= $fce->T_ITEM->row[\"LIFNR\"];\t// Kode Vendor\n\t\t\t\t$ebeln \t\t= $fce->T_ITEM->row[\"EBELN\"];\t// No PO\n\t\t\t\t$menge \t\t= intval($fce->T_ITEM->row[\"MENGE\"]);\t// Quantity PO\n\t\t\t\t$sisaqty\t= intval($fce->T_ITEM->row[\"DELIV_QTY\"]);\t// Quantity PO Open\n\t\t\t\t$werks \t\t= $fce->T_ITEM->row[\"WERKS\"];\t// Plant\n\t\t\t\t$vendor\t\t= $fce->T_ITEM->row[\"VENDNAME\"];\t// Nama Vendor\n\t\t\t\t$material \t= $fce->T_ITEM->row[\"MAKTX\"];\t// Nama Material\n\t\t\t\t$potype \t= $fce->T_ITEM->row[\"BSART\"];\t// Type PO\n\t\t\t\t// $mins \t\t= $fce->T_ITEM->row[\"EISBE\"];\t// Safety Stock\n\t\t\t\t$mins \t\t= $fce->T_ITEM->row[\"MINBE\"];\t// Re Order Point\n\t\t\t\t$maxs \t\t= $fce->T_ITEM->row[\"MABST\"];\t// Max\n\t\t\t\t$statuspo\t= $fce->T_ITEM->row[\"ELIKZ\"];\t// Max\n\t\t\t\t$start \t\t= date_format(date_create($fce->T_ITEM->row[\"BEDAT\"]),'d M Y');\n\t\t\t\t$end \t\t= date_format(date_create($fce->T_ITEM->row[\"EINDT\"]),'d M Y');\n\t\t\t\t\n\t\t\t\tif($statuspo == 'X' || $statuspo == 'x')\n\t\t\t\t{\n\t\t\t\t\t$sts = 0;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$sts = 1;\n\t\t\t\t}\n\t\t\t\t$sqlread= \"SELECT count(id_list) ADA\n\t\t\t\t\t\t\tFROM VMI_MASTER \n\t\t\t\t\t\t\twhere NO_PO = '$ebeln' and\n\t\t\t\t\t\t\tKODE_MATERIAL = '$matnr' and \n\t\t\t\t\t\t\tKODE_VENDOR = '$lifnr' and\n\t\t\t\t\t\t\tPLANT = '$werks' \n\t\t\t\t\t\t\t\";\n\t\t\t\t\t\t\t//and QUANTITY = '$menge'\n\t\t\t\t$jum \t= $this->db->query($sqlread)->row();\n\t\t\t\t$nilai \t= $jum->ADA;\n\t\t\t\t// echo $nilai.\"->\".$matnr.\" | \".$lifnr.\" | \".$ebeln.\" | \".$menge.\" | \".$werks.\" | \".$vendor.\" | \".$material.\" | \".$start.\" | \".$end.\" ==> \".$potype.\"<br/>\";\n\t\t\t\t// $ebeln == \"6310000038\" || $ebeln == \"6310000039\" || $ebeln == \"6310000040\" || $ebeln == \"6310000041\" || $ebeln == \"6310000042\" || $ebeln == \"6310000043\")\n\t\t\t\t\n\t\t\t\tif($nilai < 1){\n\t\t\t\t\tif($ebeln == \"6310000038\" || $ebeln == \"6310000039\" || $ebeln == \"6310000040\" || $ebeln == \"6310000041\" || $ebeln == \"6310000042\" || $ebeln == \"6310000043\"\n\t\t\t\t\t\t|| $lifnr == \"0000113004\" || $lifnr == \"0000110091\" || $lifnr == \"0000110253\" || $lifnr == \"0000110015\" || $lifnr == \"0000112369\" || $lifnr == \"0000110016\"){\t\t\t\t\t\t\n\t\t\t\t\t\t$sqlcount \t= \"SELECT max(ID_LIST) MAXX FROM VMI_MASTER\";\n\t\t\t\t\t\t$maxid \t\t= $this->db->query($sqlcount)->row();\t\t\n\t\t\t\t\t\t$max_list \t= $maxid->MAXX+1;\n\t\t\t\t\t\t$insert\t\t= \"insert into VMI_MASTER(ID_LIST,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tPLANT,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tKODE_MATERIAL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tNAMA_MATERIAL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tUNIT,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tKODE_VENDOR,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tNAMA_VENDOR,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tNO_PO,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tPO_ITEM,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tCONTRACT_ACTIVE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tCONTRACT_END,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDOC_DATE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSLOC,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tMIN_STOCK,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tMAX_STOCK,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTOCK_AWAL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTOCK_VMI,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tQUANTITY,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tID_COMPANY,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTATUS)\n\t\t\t\t\t\t\t\t\t\t\t\tvalues('$max_list',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$werks',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$matnr',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$material',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"MEINS\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$lifnr',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$vendor',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$ebeln',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"EBELP\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTO_DATE('\".date_format(date_create($start),'Y-m-d').\"','YYYY-MM-DD'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTO_DATE('\".date_format(date_create($end),'Y-m-d').\"','YYYY-MM-DD'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTO_DATE('\".date_format(date_create($start),'Y-m-d').\"','YYYY-MM-DD'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"LGORT\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"EISBE\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"MABST\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'0',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'0',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$sisaqty',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$opco',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$sts'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\";\n\t\t\t\t\t\t$save \t= $this->db->query($insert);\n\t\t\t\t\t\techo \"Baru ==> $ebeln | $material | $vendor | $opco | $werks | $potype<br/>\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"Skip ==> $ebeln | $material | $vendor | $opco | $werks | $potype<br/>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif($nilai >= 1){\n\t\t\t\t\t$sqlread1 = \"SELECT ID_LIST\n\t\t\t\t\t\t\tFROM VMI_MASTER \n\t\t\t\t\t\t\twhere NO_PO = '$ebeln' and\n\t\t\t\t\t\t\tKODE_MATERIAL = '$matnr' and \n\t\t\t\t\t\t\tKODE_VENDOR = '$lifnr' and\n\t\t\t\t\t\t\tPLANT = '$werks' \n\t\t\t\t\t\t\t\";\n\t\t\t\t\t\t\t//and QUANTITY = '$menge'\n\t\t\t\t\t$getlist= $this->db->query($sqlread1)->row();\n\t\t\t\t\t$idlist = $getlist->ID_LIST;\n\t\t\t\t\t$update\t\t= \"update VMI_MASTER set quantity = '$sisaqty',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmin_stock = '$mins',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmax_stock = '$maxs',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTATUS = '$sts'\n\t\t\t\t\t\t\t\t\t\t\t\t\twhere ID_LIST = '$idlist'\n\t\t\t\t\t\t\t\t\";\n\t\t\t\t\t$update_data\t= $this->db->query($update);\n\t\t\t\t\t\techo \"$update <br/>\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\techo \"Skip ==> $ebeln | $material | $vendor | $opco| $werks | $potype<br/>\";\n\t\t\t\t}\n\t\t\t\t// echo \"<hr/>\"; \n\t\t\t}\n\t\t// echo \"<pre>\";\n\t\t// print_r($fce);\n\t\t// echo \"hahaha\";\n $fce->Close();\n\t\t}\n }", "function refine_existing_data() {\n /* get all the data from the master table */\n $datas = RefineData::getMasterData();\n foreach ($datas as $data) {\n /* refine data from Google API and get the details */\n $add = geo2address($data->lat, $data->lang);\n /* update the address, district , state */\n if (!RefineData::updateDetails($data->id, json_encode($add))) {\n ScreenMessage::setMessage(\"Error Occured\", ScreenMessage::MESSAGE_TYPE_ERROR);\n }\n }\n ScreenMessage::setMessage(\"All is Well\", ScreenMessage::MESSAGE_TYPE_SUCCESS);\n}", "abstract public function prepareData();", "function CheckFreeData($method_name, $data_in) {\n\n $dbTable = \"user\";\n $function = \"checkfreedata\";\n // Write in logs\n $log = \"CheckFreeData method called with: \".var_export($data_in, true);\n writeLogs($function, $log);\n\n try {\n if ($data_in[0]['user'] == user_webserv && $data_in[0]['password'] == passwd_webserv) {\n\n $connectPC = connectDB();\n if (key_exists(\"faultCode\", $connectPC)) {\n\n // Write in logs\n $log = \"Fail to open DB connection: \".var_export($connectPC, true);\n writeLogs($function, $log);\n $log = \"############################################\";\n writeLogs($function, $log);\n\n return $connectPC;\n }\n\n// Initiate variables\n $responseArray = array();\n $userName = $data_in[0]['user_name'];\n $email = $data_in[0]['email_address'];\n\n $freeUserName = checkFreeValue($connectPC, $dbTable, \"user_name\", $userName);\n $freeEmail = checkFreeValue($connectPC, $dbTable, \"email_address\", $email);\n\n if (!$freeUserName && !$freeEmail) {\n\n $responseFault[0] = array(\n 'faultCode' => \"NOK\",\n 'faultString' => \"002\"\n );\n\n // Write in logs\n $log = \"User name and email already used: \".$userName.\"/\".$email;\n writeLogs($function, $log);\n $log = \"############################################\";\n writeLogs($function, $log);\n\n return $responseFault;\n\n } else if (!$freeUserName && $freeEmail) {\n\n $responseFault[0] = array(\n 'faultCode' => \"NOK\",\n 'faultString' => \"003\"\n );\n\n // Write in logs\n $log = \"User name already used: \".$userName;\n writeLogs($function, $log);\n $log = \"############################################\";\n writeLogs($function, $log);\n\n return $responseFault;\n\n } else if ($freeUserName && !$freeEmail) {\n\n $responseFault[0] = array(\n 'faultCode' => \"NOK\",\n 'faultString' => \"004\"\n );\n\n // Write in logs\n $log = \"Email already used: \".$email;\n writeLogs($function, $log);\n $log = \"############################################\";\n writeLogs($function, $log);\n\n return $responseFault;\n\n } else {\n\n $responseArray[0]['faultCode'] = \"OK\";\n\n // Write in logs\n $log = \"User name and email available: \".$userName.\"/\".$email;\n writeLogs($function, $log);\n $log = \"############################################\";\n writeLogs($function, $log);\n\n return $responseArray;\n }\n } else {\n\n $responseFault[0] = array(\n 'faultCode' => \"NOK\",\n 'faultString' => \"001\"\n );\n\n // Write in logs\n $log = \"Unable to access web services, bad credentials.\";;\n writeLogs($function, $log);\n $log = \"############################################\";\n writeLogs($function, $log);\n\n return $responseFault;\n }\n } catch (Exception $e) {\n\n $faultCode = \"000\";\n $faultString = \"Unknown exception\";\n\n $responseFault[0] = array(\n 'faultCode' => $faultCode,\n 'faultString' => $faultString\n );\n\n // Write in logs\n $log = \"CheckFreeData failed : \".$faultString.\": \".$e;\n writeLogs($function, $log);\n $log = \"############################################\";\n writeLogs($function, $log);\n\n return $responseFault;\n }\n}", "protected function _readTable() {}", "protected function _readTable() {}", "function booksList($offset, $total_records_per_page, $order, $ascdesc)\n{\n $booksManager = new ListManager();\n\n\n\n if (isset($_GET['search']) && $_GET['search']!='') {\n $search = input(addcslashes($_GET['search'], '_'));\n $search=\"%\".$search.\"%\";\n $books = $booksManager->get_search($offset, $total_records_per_page, $order, $ascdesc, $search);\n } elseif (isset($_GET['cat']) && $_GET['cat']!='') {\n $cat = input($_GET['cat']);\n $books = $booksManager-> get_cat($offset, $total_records_per_page, $order, $ascdesc, $cat);\n } else {\n $books = $booksManager->selectAll($offset, $total_records_per_page, $order, $ascdesc); // Appel la fonction qui renvoie toutes les données sur les livres en bdd\n }\n // require('view/listView.php');\n return $books;\n echo selectAll();\n}", "function addBook($name, $langt, $author, $langa, $type)\n{\n $conn = mysqli_connect(constant(\"DBSERVER\"),constant(\"DBUSER\"),constant(\"DBPASSWORD\"));\n $db_selected = mysqli_select_db($conn,MYDB);\n if (!$db_selected)\n {\n mysqli_query($conn,\"CREATE DATABASE IF NOT EXISTS \".MYDB.\";\");\n $db_selected = mysqli_select_db($conn,MYDB);\n }\n \n if (!$db_selected)\n {\n exit('Error select '.MYDB.' database: ' .mysqli_error($conn) );\t\t\n }\n $sql = \"CREATE TABLE IF NOT EXISTS \".MYTABLE.\" (\n\t\tid BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,\".$GLOBALS['MYFIELDS'][0].\" TEXT NOT NULL,\"\n\t\t.$GLOBALS['MYLANGFIELDS'][0].\" TINYTEXT,\"\n\t\t.$GLOBALS['MYFIELDS'][1].\" TEXT,\"\n\t\t.$GLOBALS['MYLANGFIELDS'][1].\" TINYTEXT,\"\n\t\t.$GLOBALS['MYNOLANGFIELDS'][0].\" TINYTEXT,date date\n )engine=myisam ;\";\n if (!mysqli_query($conn,$sql))\n {\n exit('Error creating '.MYTABLE.' table: ' .mysqli_error($conn) );\t\t\n }\n $names = array($author,$name);\n $langs = array($langa,$langt);\n $strn = '';\n $strv = '';\n for ($i=0; $i < count($GLOBALS['MYFIELDS']); $i++)\n {\n $strn .= $GLOBALS['MYFIELDS'][$i].\",\";\n $strv .= \"'\".$names[$i].\"',\";\n }\n for ($i=0; $i < count($GLOBALS['MYLANGFIELDS']); $i++)\n {\n $strn .= $GLOBALS['MYLANGFIELDS'][$i].\",\";\n $strv .= \"'\".$langs[$i].\"',\";\n }\n $strn .= $GLOBALS['MYNOLANGFIELDS'][0].',date';\n $strv .= \"'\".$type.\"','\".date('Y-m-d').\"'\";\n $sql = \"INSERT INTO \".MYTABLE.\" (\".$strn.\") VALUES (\".$strv.\");\";\n $err = mysqli_query($conn,$sql);\n if (!$err) \n {\n exit(\"Error Insert MySQL : \".mysqli_error($conn).\" \".$sql.\"<br>\");\n }\n // return as response the mySQL index of the latest inserted record\n echo mysqli_insert_id($conn);\n //echo $sql.\"<br>\";\n}", "function analyzeBusiness()\n{\n $config = include('config.php');\n $dataService = DataService::Configure(array(\n 'auth_mode' => 'oauth2',\n 'ClientID' => $config['client_id'],\n 'ClientSecret' => $config['client_secret'],\n 'RedirectURI' => $config['oauth_redirect_uri'],\n 'scope' => $config['oauth_scope'],\n 'baseUrl' => \"development\"\n ));\n\n /*\n * Retrieve the accessToken value from session variable\n */\n $accessToken = $_SESSION['sessionAccessToken'];\n $dataService->throwExceptionOnError(true);\n\n /*\n * Update the OAuth2Token of the dataService object\n */\n $dataService->updateOAuth2Token($accessToken);\n\n /*\n * Initialize the Report service from the data service context\n */\n $serviceContext = $dataService->getServiceContext();\n $reportService = new ReportService($serviceContext);\n if (!$reportService) {\n exit(\"Problem while initializing ReportService.\\n\");\n }\n\n /*\n * Usecase 1\n * Choose the reports - Balance Sheet, ProfitAndLoss\n */\n $balancesheet = $reportService->executeReport(\"BalanceSheet\");\n $profitAndLossReport = $reportService->executeReport(\"ProfitAndLoss\");\n\n /*\n * Print the reports\n */\n echo(\"ProfitAndLoss Report Execution Start!\" . \"\\n\");\n if (!$profitAndLossReport) {\n exit(\"ProfitAndLossReport Is Null.\\n\");\n } else {\n $result = json_encode($profitAndLossReport, JSON_PRETTY_PRINT);\n print_r($result);\n echo(\"Profit And Loss Report Execution Successful!\" . \"\\n\");\n }\n echo(\"\\nBalanceSheet Execution Start!\" . \"\\n\");\n if (!$balancesheet) {\n exit(\"BalanceShee Is Null.\\n\");\n } else {\n $result = json_encode($balancesheet, JSON_PRETTY_PRINT);\n print_r($result);\n echo(\"BalanceSheet Execution Successful!\" . \"\\n\");\n }\n\n /*\n * Usecase 2\n * Configure report service to be summarized by Customer\n * Report service is default configured for the Current Year end, so no conf needed there\n */\n $reportService->setSummarizeColumnBy(\"Customers\");\n\n /*\n * Once the report service is configured, Choose the reports - Balance Sheet, ProfitAndLoss\n */\n $balancesheet = $reportService->executeReport(\"BalanceSheet\");\n $profitAndLossReport = $reportService->executeReport(\"ProfitAndLoss\");\n\n /*\n * Print the reports\n */\n echo(\"Year End Profit And Loss Report Summarized by Customers Start!\" . \"\\n\");\n if (!$profitAndLossReport) {\n exit(\"ProfitAndLossReport Is Null.\\n\");\n } else {\n $result = json_encode($profitAndLossReport, JSON_PRETTY_PRINT);\n print_r($result);\n echo(\"Year End Profit And Loss Report Summarized by Customers Execution Successful!\" . \"\\n\");\n }\n echo(\"Year End BalanceSheet Summarized by Customers Start!\" . \"\\n\");\n if (!$balancesheet) {\n exit(\"BalanceSheet Is Null.\\n\");\n } else {\n $result = json_encode($balancesheet, JSON_PRETTY_PRINT);\n print_r($result);\n echo(\"BalanceSheet Execution Successful!\" . \"\\n\");\n }\n\n return;\n}", "public function validateTableData($postArray,$editId) \n{\n \n $fldErrors=array();\n $tblErrors=array();\n $errorMesg=array();\n \n $fldErrors=$this->validateFieldData($postArray);\n \n $tblErrors=$this->validateTableDataToFile($postArray,$editId); \n\n $errorMesg=$this->mergeErrorArrays($fldErrors,$tblErrors);\n \n return $errorMesg;\n \n}", "function purchaseTicket($ar){\n\nif (isset($GLOBALS['RRTESTSTA'])){\n XLogs::critical(get_class($this), '::purchaseTicket RRTESTSTA');\n throw new Exception('Coucou');\n $ta = new StdClass();\n $ta->NPOSNO = 0;\n $ta->NJOURNALNO = sprintf('%05d', '1'.date('ms'));\n $ta->NSERIALNO = sprintf('%05d', '2'.date('ms'));\n $ta->NPROJECTNO = 444;\n return $ta;\n}\n\n $wtpsi = $this->getAWTPSI();\n $pt= $ar['tapt'];\n $pool = $ar['pool'];\n $tt = $ar['tatt'];\n $prj = $ar['projectno'];\n $firstname = $ar['firstname'];\n $lastname = $ar['lastname'];\n $dob = $ar['dob'];\n\n $pur = array();\n\n list($chipid, $crc, $accno) = explode('-', $ar['wtpno']);\n $pur[0]['NPERSONTYPENO'] = $pt;\n $pur[0]['NPOOLNO'] = $pool;\n $pur[0]['NTICKETTYPENO'] = $tt;\n $pur[0]['NPROJECTNO'] = $prj;\n $pur[0]['SZVALIDFROM'] = $ar['validfrom'];\n\n // jcp 28/12/11, preco support TA : ne transmettre que le CHIPID\n // $pur[1]['SZACCEPTANCENO'] = $accno;\n // $pur[1]['SZCHIPIDCRC'] = $crc;\n $pur[1]['SZCHIPID'] = $chipid;\n \n // person data\n $pur[2]['SZLASTNAME'] = $lastname;\n $pur[2]['SZFIRSTNAME'] = $firstname;\n $pur[2]['SZDATEOFBIRTH'] = $dob;\n $pur[2]['SZSEX'] = NULL;\n $pur[2]['SZTITLE'] = NULL;\n $pur[2]['SZSALUTATION'] = NULL;\n \n // pas d'adress data\n $pur[3] = NULL; // adress data\n \n // articles -> faire un purchaseProduct\n if (isset($ar['articlesData'])){\n $pur[4] = $ar['articlesData'];\n $soapfunc = 'doPurchaseProduct';\n } else {\n $soapfunc = 'doPurchaseTicket';\n }\n\n $cc = '';\n foreach($pur as $foo=>$block){\n $c = $foo . ' : ';\n if (isset($block)){\n foreach($block as $name=>$value){\n $c .= ' '.$name.'=>'.$value;\n }\n }\n $cc .= $c;\n XLogs::notice(get_class($this), get_class($this).\"::purchaseTicket $c\");\n }\n // purchaseProduct / purchaseTicket\n $r = $wtpsi->$soapfunc(array('purchasedata'=>$pur));\n\n return $r;\n }", "private function checkObjectsErrorsOrConfirmations()\n\t{\n\t\tif (!empty(self::$obj_ts_common->errors))\n\t\t\t$this->errors = array_merge($this->errors, self::$obj_ts_common->errors);\n\n\t\tif (!empty(self::$obj_ts_common->confirmations))\n\t\t\t$this->confirmations = array_merge($this->confirmations, self::$obj_ts_common->confirmations);\n\t}", "public function orderbook()\n {\n return $this->callApi(__FUNCTION__);\n }", "function ilibrary_options_page() {\n\n global $wpdb; # used for interacting with database\n\n // IMPORT LIBRARY\n // Check to see whether the import form has been used\n if (isset($_POST['action']) && $_POST['action'] == 'import') {\n\n try {\n\n // Validate the file\n\n # Check the user has uploaded a file\n if ($_FILES['library_file']['tmp_name'] == '') {throw new Exception(\"Unable to import file. No library file provided. Please try again.\");}\n\n # Check that the file being uploaded has an xml extension\n $ext = substr($_FILES['library_file']['name'], strrpos($_FILES['library_file']['name'], '.') + 1);\n if (strtolower($ext) != 'xml') {throw new Exception(\"Unable to import file. File provided does not have an '.xml' file extension.\");}\n\n // Move the uploaded file to the 'plugins' directory\n\n if(!move_uploaded_file($_FILES['library_file']['tmp_name'], UPLOAD_DIR.basename( $_FILES['library_file']['name']))) {\n throw new Exception(\"There was an error uploading the file. Please try again.\");\n }\n\n // Generate an array of songs based on the library provided\n $songs = iTunesXmlParser(UPLOAD_DIR.basename( $_FILES['library_file']['name']));\n\n // Start the transaction\n @mysql_query(\"BEGIN\", $wpdb->dbh);\n\n // Enable displaying of errors\n $wpdb->hide_errors();\n\n // Prepare some variables to hold stats\n $rows_inserted = array();\n $rows_updated = array();\n $rows_deleted = 0;\n\n // Loop through each song in the library\n foreach ($songs as $song) {\n\n // Handle the true/false fields\n // If they exist in the song's entry, it implies 'true'.\n $compilation = isset($song['Compilation']) ? 1 : 0;\n $podcast = isset($song['Podcast']) ? 1 : 0;\n $unplayed = isset($song['Unplayed']) ? 1 : 0;\n $album_rating_computed = isset($song['Album Rated Computed']) ? 1 : 0;\n\n // take care of:\n // - values that might not exist for the popular song in the library (eg. default to nulls)\n // - timestamp conversion\n $track_id = isset($song['Track ID']) ? $song['Track ID'] : 'null';\n $name = isset($song['Name']) ? $song['Name'] : 'null';\n $artist = isset($song['Artist']) ? $song['Artist'] : 'null';\n $song_artist = isset($song['Song Artist']) ? $song['Song Artist'] : $song['Artist'];\n $album = isset($song['Album']) ? $song['Album'] : 'null';\n $kind = isset($song['Kind']) ? $song['Kind'] : 'null';\n $size = isset($song['Size']) ? $song['Size'] : 'null';\n $total_time = isset($song['Total Time']) ? $song['Total Time'] : 'null';\n $track_number = isset($song['Track Number']) ? $song['Track Number'] : 'null';\n $track_count = isset($song['Track Count']) ? $song['Track Count'] : 'null';\n $year = isset($song['Year']) ? $song['Year'] : 'null';\n $date_modified = isset($song['Date Modified']) ? $song['Date Modified'] : 'null';\n $date_added = isset($song['Date Added']) ? $song['Date Added'] : 'null';\n $bit_rate = isset($song['Bit Rate']) ? $song['Bit Rate'] : 'null';\n $sample_rate = isset($song['Sample Rate']) ? $song['Sample Rate'] : 'null';\n $rating = isset($song['Rating']) ? $song['Rating'] : 'null';\n $album_rating = isset($song['Album Rating']) ? $song['Album Rating'] : 'null';\n $play_count = isset($song['Play Count']) ? $song['Play Count'] : 'null';\n $play_date = isset($song['Play Date']) ? $song['Play Date'] : 'null';\n $play_date_utc = isset($song['Play Date UTC']) ? $song['Play Date UTC'] : 'null';\n $normalization = isset($song['Normalization']) ? $song['Normalization'] : 'null';\n $track_type = isset($song['Track Type']) ? $song['Track Type'] : 'null';\n $location = isset($song['Location']) ? $song['Location'] : 'null';\n $file_folder_count = isset($song['File Folder Count']) ? $song['File Folder Count'] : 'null';\n $library_folder_count = isset($song['Library Folder Count']) ? $song['Library Folder Count'] : 'null';\n\n // Update existing entries, and add new ones\n\n // Create the query\n $sql = \"INSERT INTO\n \".SONGS_TABLE.\"\n (\n persistent_id\n , track_id\n , name\n , artist\n , song_artist\n , album\n , compilation\n , podcast\n , unplayed\n , kind\n , size\n , total_time\n , track_number\n , track_count\n , year\n , date_modified\n , date_added\n , bit_rate\n , sample_rate\n , rating\n , album_rating\n , album_rating_computed\n , play_count\n , play_date\n , play_date_utc\n , normalization\n , track_type\n , location\n , file_folder_count\n , library_folder_count\n ) VALUES (\n '\".addslashes($song['Persistent ID']).\"'\n , \".$track_id.\"\n , '\".addslashes($name).\"'\n , '\".addslashes($artist).\"'\n , '\".addslashes($song_artist).\"'\n , '\".addslashes($album).\"'\n , \".$compilation.\"\n , \".$podcast.\"\n , \".$unplayed.\"\n , '\".addslashes($kind).\"'\n , \".$size.\"\n , \".$total_time.\"\n , \".$track_number.\"\n , \".$track_count.\"\n , \".$year.\"\n , '\".$date_modified.\"'\n , '\".$date_added.\"'\n , \".$bit_rate.\"\n , \".$sample_rate.\"\n , \".$rating.\"\n , \".$album_rating.\"\n , \".$album_rating_computed.\"\n , \".$play_count.\"\n , \".$play_date.\"\n , '\".$play_date_utc.\"'\n , \".$normalization.\"\n , '\".addslashes($track_type).\"'\n , '\".addslashes($location).\"'\n , \".$file_folder_count.\"\n , \".$library_folder_count.\"\n ) ON DUPLICATE KEY UPDATE\n track_id = \".$track_id.\"\n , name = '\".addslashes($name).\"'\n , artist = '\".addslashes($artist).\"'\n , song_artist = '\".addslashes($song_artist).\"'\n , album = '\".addslashes($album).\"'\n , compilation = \".$compilation.\"\n , podcast = \".$podcast.\"\n , unplayed = \".$unplayed.\"\n , kind = '\".addslashes($kind).\"'\n , size = \".$size.\"\n , total_time = \".$total_time.\"\n , track_number = \".$track_number.\"\n , track_count = \".$track_count.\"\n , year = \".$year.\"\n , date_modified = '\".$date_modified.\"'\n , date_added = '\".$date_added.\"'\n , bit_rate = \".$bit_rate.\"\n , sample_rate = \".$sample_rate.\"\n , rating = \".$rating.\"\n , album_rating = \".$album_rating.\"\n , album_rating_computed = \".$album_rating_computed.\"\n , play_count = \".$play_count.\"\n , play_date = \".$play_date.\"\n , play_date_utc = '\".$play_date_utc.\"'\n , normalization = \".$normalization.\"\n , track_type = '\".addslashes($track_type).\"'\n , location = '\".addslashes($location).\"'\n , file_folder_count = \".$file_folder_count.\"\n , library_folder_count = \".$library_folder_count\n ;\n\n // Execute the query\n $result = $wpdb->query($sql);\n\n // Check for a failure\n if ($result === FALSE) {throw new Exception(\"Unable to insert/update entry '\".$song['Persistent ID'].\"': \".$wpdb->last_error);}\n\n // Keep the stats up to date\n switch ($result) {\n case 1:\n array_push($rows_inserted,$song);\n break;\n case 2:\n array_push($rows_updated,$song);\n break;\n }\n\n // Tidy up following the query\n unset($result);\n unset($sql);\n\n // Update the database to state that this file exists in the library\n // This will be used at the end of the import to remove entries\n // that do not exist (ie. have been deleted from iTunes).\n\n // Create the string\n $sql = \"UPDATE \".SONGS_TABLE.\" SET in_library_file_flag = 1 WHERE persistent_id = '\".$song['Persistent ID'].\"'\";\n\n // Execute the query\n $result = $wpdb->query($sql);\n \n // Check for a failure\n if ($result === FALSE) {throw new Exception(\"Unable to mark entry '\".$song['Persistent ID'].\"' as existing in library: \".$wpdb->last_error);}\n\n // Tidy up following the query\n unset($result);\n unset($sql);\n\n }\n\n // Now delete all entries not present in the library file\n\n // Create the sql\n $sql = \"DELETE FROM \".SONGS_TABLE.\" WHERE in_library_file_flag is null\";\n\n // Execute the query\n $result = $wpdb->query($sql);\n\n // Check for a failure\n if ($result === FALSE) {throw new Exception(\"Unable to removed deleted entries: \".$wpdb->last_error);}\n\n // Keep the stats up to date\n $rows_deleted = $result;\n\n // Tidy up following the query\n unset($result);\n unset($sql);\n\n // Reset the 'in_library_file_flag' flag\n\n // Create the SQL\n $sql = \"UPDATE \".SONGS_TABLE.\" SET in_library_file_flag = null\";\n\n // Execute the query\n $result = $wpdb->query($sql);\n \n // Check for a failure\n if ($result === FALSE) {throw new Exception(\"Unable to reset in_library_file_flag: \".$wpdb->last_error);}\n\n // Tidy up following the query\n unset($result);\n unset($sql);\n\n // Commit the transaction\n @mysql_query(\"COMMIT\", $wpdb->dbh);\n\n // Tidy up and remove the library file\n unlink(UPLOAD_DIR.basename( $_FILES['library_file']['name']));\n\n // Output confirmation\n echo \"<div id=\\\"message\\\" class=\\\"updated fade\\\">\n <p>The file \". basename( $_FILES['library_file']['name']).\" has been imported:</p>\n <p>\n - Song(s) Inserted: \".count($rows_inserted).\"<br/>\n - Song(s) Updated: \".count($rows_updated).\"<br/>\n - Song(s) Deleted: \".$rows_deleted.\"<br/>\n </p>\n </div>\";\n\n } catch (Exception $e) {\n\n // Rollback the transaction\n @mysql_query(\"ROLLBACK\", $wpdb->dbh);\n\n // Output the error\n echo \"<div id=\\\"message\\\" class=\\\"error fade\\\"><p>\".$e->getMessage().\"</p></div>\";\n }\n\n // NEW PAGE\n } elseif (isset($_POST['action']) && $_POST['action'] == 'add_page') {\n if (isset($_POST['page_title']) && $_POST['page_title'] != '') {\n\n // Build up the details for the page\n $_p = array();\n $_p['post_title'] = $_POST['page_title'];\n $_p['post_content'] = \"[ilibrary]\";\n $_p['post_status'] = 'publish';\n $_p['post_type'] = 'page';\n $_p['comment_status'] = 'closed';\n $_p['ping_status'] = 'closed';\n $_p['post_category'] = array(1); // the default 'Uncatrgorised'\n\n // Insert the post into the database\n $page_id = wp_insert_post( $_p );\n\n // Grab a link to the post\n $permalink = get_permalink( $page_id );\n\n // Output confirmation\n echo \"<div id=\\\"message\\\" class=\\\"updated fade\\\"><p>New page has been created. <a href=\\\"$permalink\\\" target=\\\"_blank\\\">View your library here</a>.</p></div>\";\n\n } else {\n echo \"<div id=\\\"message\\\" class=\\\"error fade\\\"><p>Unable to create page. No title provided.</p></div>\";\n }\n }\n\n echo '<div class=\"wrap\">';\n\n // Title (wp standard is 'h2')\n echo '<h2>iLibrary Options</h2>';\n\n // Start the form\n echo '<form name=\"ilibrary_options\" method=\"post\" enctype=\"multipart/form-data\">';\n\n // Include two hidden fields which automatically help to check that the user can update options and also redirect the user back\n wp_nonce_field('update-options');\n\n // IMPORT LIBRARY\n\n echo '<h3>Upload Library</h3>';\n echo '<p>This will up trigger an update of your library, adding new entries, updating existing and removing deleted entries.</p>';\n\n // Start the table -- this uses a standard look n feel for WP\n print '<table class=\"form-table\">';\n\n print '<tr valign=\"top\">';\n print '<th scope=\"row\">Library File:</th>';\n print '<td><input size=\"50\" type=\"file\" name=\"library_file\" /></td>';\n print '</tr>';\n\n print '</table>';\n\n print '<input type=\"hidden\" name=\"action\" value=\"import\" />';\n print '<p><input type=\"submit\" class=\"button-primary\" value=\"Update Library\" /></p>';\n\n echo '</form>';\n\n // Start the form\n echo '<form name=\"ilibrary_options\" method=\"post\" enctype=\"multipart/form-data\">';\n\n // ADD PAGE\n\n echo '<h3>Add Library Page</h3>';\n echo '<p>In order to display your library, you need a page that contains the text [ilibrary].</p>';\n echo '<p>You can perform this manually. However, a quick way to achieve this is to use the form below.</p>';\n echo '<p>Once this page has been created, you are free to treat this page as you would any other WordPress page.</p>';\n echo '<p>Please note: This will create a page even if a page already exists with the text [ilibrary].</p>';\n\n // Start the table -- this uses a standard look n feel for WP\n print '<table class=\"form-table\">';\n\n print '<tr valign=\"top\">';\n print '<th scope=\"row\">Page Name:</th>';\n print '<td><input size=\"50\" type=\"text\" name=\"page_title\" /></td>';\n print '</tr>';\n\n print '</table>';\n\n print '<input type=\"hidden\" name=\"action\" value=\"add_page\" />';\n print '<p><input type=\"submit\" class=\"button-primary\" value=\"Add Library Page\" /></p>';\n\n\n echo '</form>';\n\n print '</div>';\n\n}", "function goodrds_get() {\n\t\t\n\t\t$options = $this->goodrds_options;\n\t\t\n\t\t// make sure we've got all we need to connect, if not, dont bother\n\t\tif (!$this->goodrds_haveInfo($options)) return;\n\t\t\n\t\t// get reading\n\t\t$reading_shelf = \"https://www.goodreads.com/review/list/\".$options['user'].\".xml?key=\".\n\t\t $options['apikey'].\"&v=2&shelf=currently-reading&sort=date_started&order=d&page=1&per_page=\".$options['show'];\n\t\t$reading_json = $this->goodrds_phoneHome($reading_shelf);\n\t\tdelete_option('goodrds_reading_json');\n\t\tadd_option('goodrds_reading_json',$reading_json);\n\t\t\n\t\t// get read\n\t\t$read_shelf = \"https://www.goodreads.com/review/list/\".$options['user'].\".xml?key=\". \n\t\t $options['apikey'].\"&v=2&shelf=read&sort=date_started&order=d&page=1&per_page=\".$options['show'];\t\n\t\t$read_json = $this->goodrds_phoneHome($read_shelf);\n\t\tdelete_option('goodrds_read_json');\n\t\tadd_option('goodrds_read_json',$read_json);\n\t}", "abstract protected function setup_info();", "function _validatePurchase() {\n\n // Return results in an array\n $ret = array();\n\n // Retain edit metadata, if found\n if ($this->input->post('edit_id') !== FALSE) {\n $repop['edit_id'] = $this->input->post('edit_id');\n }\n\n // Validate: \"description\"\n $repop['description'] = htmlspecialchars(trim($this->input->post('description')));\n if (!$repop['description']) {\n $error['description'] = 'Description cannot be blank.';\n } elseif (count($repop['description']) > 50) {\n $error['description'] = 'Description cannot exceed 50 characters.';\n } else {\n $purchase_details['description'] = $repop['description'];\n }\n\n // Validate: \"payer\"\n $repop['payer'] = $this->input->post('payer');\n if (!$repop['payer']) {\n $error['payer'] = 'No user was selected as the \"Payer\" of this purchase.';\n } else {\n $valid = false;\n foreach ($this->housemates as $housemate) {\n if ($housemate['user_id'] == $repop['payer']) {\n $valid = true; break;\n }\n }\n if ($valid) {\n $purchase_details['payer'] = $repop['payer'];\n } else {\n $error['payer'] = 'The user selected as purchase \"Payer\" is not your housemate.';\n }\n }\n\n // Validate: \"purchase_date\"\n $repop['purchase_date'] = htmlspecialchars(trim($this->input->post('purchase_date_submit')));\n if (!$repop['purchase_date']) {\n $error['purchase_date'] = 'You must specify a purchase date.';\n } elseif (FALSE) {\n // TODO - verify specified date is a valid format, and exists!\n } else {\n $purchase_details['purchase_date'] = $repop['purchase_date'];\n }\n\n // Validate: \"split_type\"\n $repop['split_type'] = $this->input->post('split_type');\n $repop['total_price'] = trim($this->input->post('total_price'));\n $repop['payees'] = $this->input->post('payees');\n $repop['price_custom'] = $this->input->post('price_custom');\n if ($repop['split_type'] == 'even') {\n $purchase_details['split_type'] = 'even';\n\n // Validate: \"total_price\"\n if (!$repop['total_price']) {\n $error['total_price'] = 'Total Price must be specified if choosing an \"even\" split.';\n } elseif (!is_numeric($repop['total_price'])) {\n $error['total_price'] = 'Total Price must be numeric.';\n } else {\n $purchase_details['total_price'] = $repop['total_price'];\n\n // Validate: \"payees\"\n if (!is_array($repop['payees']) || count($repop['payees']) == 0) {\n $error['payees'] = 'One or more users must be selected to share the total price.';\n } else {\n $tick_count = 0; // count 'ticked' housemates\n $tmp = array_values($repop['payees']);\n foreach ($this->housemates as $housemate) {\n if (in_array($housemate['user_id'], $tmp)) {\n $tick_count++;\n }\n }\n if ($tick_count == 0) {\n $error['payees'] = 'One or more selected users are not housemates.';\n } else {\n // divide the total price between ticked housemates\n foreach ($this->housemates as $housemate) {\n if (in_array($housemate['user_id'], $tmp)) {\n $purchase_details['payees'][] = array(\n 'user_id' => $housemate['user_id'],\n 'price' => ($purchase_details['total_price']/$tick_count)\n );\n }\n }\n }\n }\n }\n } elseif ($repop['split_type'] == 'custom') {\n $purchase_details['split_type'] = 'custom';\n\n // Validate: \"price_custom\"\n if (!$repop['price_custom'] || !is_array($repop['price_custom']) || (count($repop['price_custom']) == 0)) {\n $error['price_custom'] = 'One or more housemates must have prices specified when using a \"custom\" split.';\n } else {\n $user_prices_count = 0; // count number of defined housemate prices\n foreach ($this->housemates as $housemate) {\n if (isset($repop['price_custom'][$housemate['user_id']]) && ($repop['price_custom'][$housemate['user_id']] != '')) {\n if (!is_numeric($repop['price_custom'][$housemate['user_id']])) {\n $error['price_custom'] = 'One or more custom prices were not numeric.';\n $user_prices_count = -1;\n break;\n }\n // Include this user's price in the purchase details\n $purchase_details['payees'][] = array(\n 'user_id' => $housemate['user_id'],\n 'price' => $repop['price_custom'][$housemate['user_id']]\n );\n $user_prices_count++;\n }\n }\n if ($user_prices_count == 0) {\n $error['price_custom'] = 'One or more housemates must have prices specified when using a \"custom\" split.';\n //$error['price_custom'] = 'One or more specified users are not housemates.';\n }\n }\n } else {\n $error['split_type'] = 'Purchase splitting is not defined. Select either \"even\" or \"custom\" splitting.';\n }\n\n // Validate: comment\n $repop['comment'] = htmlspecialchars(trim($this->input->post('comment')));\n if (count($repop['comment']) > 250) {\n $error['comment'] = 'Comment cannot exceed 250 characters';\n } else {\n $purchase_details['comment'] = $repop['comment'];\n }\n\n $ret['repop'] = $repop;\n if (isset($error)) {\n $ret['error'] = $error;\n }\n $ret['purchase_details'] = $purchase_details;\n\n return $ret;\n\n }", "function ppt_resources_get_usd_stocks($data)\n{\n// return $data;\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = [];\n // If there is no uid sent with the api so get the current user id.\n if (isset($data['uid'])) {\n $uid = $data['uid'];\n } else {\n global $user;\n $uid = $user->uid;\n }\n $countries = array();\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n }\n $reps = array();\n if (isset($data['reps'])) {\n $reps = $data['reps'];\n }\n\n $user = user_load($uid);\n\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries);\n }\n\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = get_products_dosages($data['products']);\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid);\n } else {\n $products = get_products_for_accounts($accounts);\n }\n }\n//return entity_metadata_wrapper('field_collection_item', 18045);\n $entries = get_entries($accounts, $products, NULL, $reps);\n $entries_records = get_entries_records_for_year($entries, $year, 'consumption_stock_entry');\n $reports = sum_records_per_field($entries_records, 'field_product', TRUE);\n return $reports;\n}", "function initialize($data)\n\t{\n\t\t$this->book_id = $data['txnid'];\n\t\t$this->pgi_amount = 1.00; //$data['pgi_amount'];\n\t\t$this->firstname = $data['firstname'];\n\t\t$this->email = $data['email'];\n\t\t$this->phone = $data['phone'];\n\t\tif(isset($data['txn_type']) && $data['txn_type'] == 'REFUND')\n\t\t{\n\t\t\t$this->txn_type = $data['txn_type'];\n\t\t\t$this->pg_txn_id = $data['pg_txnid'];\n\t\t\t$this->refund_amt = $data['refund_amt'];\n\t\t\t$this->m_refund_id = \"R-\".time(); //We generate this\n\t\t}\n\t\tif(isset($data['txn_type']) && $data['txn_type'] == 'INSTANT_RECHARGE')\n\t\t{\n\t\t\t$this->txn_type = $data['txn_type'];\n\t\t\t$this->payment_mode_only = $data[\"payment_mode_only\"];\n\t\t\t$this->payment_type_id = $data[\"payment_type_id\"];\n\t\t}\n\n\t\t/*We need to store product info value in session as Paytm does have param to send/receive this as request/response respectively.*/\n\t\t$GLOBALS[\"CI\"]->session->set_userdata(\"paytm_productinfo\", $data['productinfo']);\n\t}", "function parse_data(){\n\n\t $key_file = file_get_contents(\"resp_key.json\");\n\t $built_in_file = file_get_contents(\"built_in_resp.json\");\n\t $this->key_dictonary = json_decode($key_file);\n\t $this->built_in_dictionary = json_decode($built_in_file);\n\n\t if($this->built_in_dictionary == null)\n\t\tvar_dump(\"Built in didn't work\");\n\t if($this->key_dictonary == null)\n\t\tvar_dump(\"key dictionary didn't work\");\n\n }", "public function performChecks(){\n\t\t\n\t}", "public function __construct($_name = NULL,$_number = NULL,$_quantity = NULL,$_tax = NULL,$_amount = NULL,$_ebayItemPaymentDetailsItem = NULL,$_promoCode = NULL,$_productCategory = NULL,$_description = NULL,$_itemWeight = NULL,$_itemLength = NULL,$_itemWidth = NULL,$_itemHeight = NULL,$_itemURL = NULL,$_enhancedItemData = NULL,$_itemCategory = NULL)\r\n\t{\r\n\t\tparent::__construct(array('Name'=>$_name,'Number'=>$_number,'Quantity'=>$_quantity,'Tax'=>$_tax,'Amount'=>$_amount,'EbayItemPaymentDetailsItem'=>$_ebayItemPaymentDetailsItem,'PromoCode'=>$_promoCode,'ProductCategory'=>$_productCategory,'Description'=>$_description,'ItemWeight'=>$_itemWeight,'ItemLength'=>$_itemLength,'ItemWidth'=>$_itemWidth,'ItemHeight'=>$_itemHeight,'ItemURL'=>$_itemURL,'EnhancedItemData'=>$_enhancedItemData,'ItemCategory'=>$_itemCategory));\r\n\t}", "function validate_fields($part){\r\n\tif($part == 1){\r\n\t\t$error_msg = array();\r\n\t\t// check that name is not empty or larger than database can hold\r\n\t\tif (!isset($_POST['fullName'])){\r\n\t\t\t$error_msg[] = \"Name field is blank.\";\r\n\t\t} else if (isset($_POST['fullName'])){\r\n\t\t\t$name = trim($_POST['fullName']);\r\n\t\t\tif (empty($name)){\r\n\t\t\t\t$error_msg[] = \"Name field is blank.\";\r\n\t\t\t} else {\r\n\t\t\t\tif (strlen($name) > 128){\r\n\t\t\t\t\t$error_msg[] = \"First Name field cannot contain more than 128 characters.\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// check that age is set and numeric \r\n\t\tif (!isset($_POST['age'])){\r\n\t\t\t$error_msg[] = \"Age field is blank.\";\r\n\t\t} else if (isset($_POST['age'])){\r\n\t\t\tif (!is_numeric($_POST['age'])) {\r\n\t\t\t\t$error_msg[] = \"Age: Please enter numbers only\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t// check that dropdown option has been chosen \r\n\t\tif (!isset($_POST['student'])){\r\n\t\t\t$error_msg[] = \"Are you a student? Please choose one.\";\r\n\t\t} else if (isset($_POST['student'])){\r\n\t\t\t$age = $_POST['student'];\r\n\t\t\tif(!($age == \"F\" || $age == \"P\" || $age == \"N\")){\r\n\t\t\t\t$error_msg[] = \"Inappropriate answer given. Please select one from dropdown.\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $error_msg;\r\n\t}\r\n\tif($part == 2){\r\n\t\t$error_msg = array();\r\n\t\t// check that purchase method is chosen \r\n\t\tif (!isset($_POST['howPurchased'])){\r\n\t\t\t$error_msg[] = \"Please select method of purchase.\";\r\n\t\t} else if (isset($_POST['howPurchased'])){\r\n\t\t\t$purchased = $_POST['howPurchased']; \r\n\t\t\tif(!($purchased == \"Online\" || $purchased == \"By Phone\" || $purchased == \"Mobile App\" || $purchased == \"In Store\")){\r\n\t\t\t\t$error_msg[] = \"Inappropriate value for method of purchase. Please select one. \".$purchased;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t// check that one or more products has been chosen\r\n\t\tif (!isset($_POST['purchases'])){\r\n\t\t\t$error_msg[] = \"Please select at least one product.\";\r\n\t\t} else if (isset($_POST['purchases'])){\r\n\t\t\t$purchases = $_POST['purchases'];\r\n\t\t\tif(count($purchases) < 1){\r\n\t\t\t\t$error_msg[] = \"Please select at least one product.\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $error_msg;\r\n\t}\r\n\tif($part == 3){\r\n\t\t$error_msg = array();\r\n\t\tfor($x = 0; $x < count($_SESSION['purchases']); $x++){\r\n\t\t\t// check that satisfaction is chosen \r\n\t\t\tif (!isset($_POST['satisfaction'.$x])){\r\n\t\t\t\t$error_msg[] = $_SESSION['purchases'][$x]['name'].\" - Please select level of satisfaction\";\r\n\t\t\t} else if (isset($_POST['satisfaction'.$x])){\r\n\t\t\t\t$sat = $_POST['satisfaction'.$x];\r\n\t\t\t\tif(!is_numeric($sat) || $sat < 1 || $sat > 5){\r\n\t\t\t\t\t$error_msg[] = $_SESSION['purchases'][$x]['name'].\" - Inappropriate value for satisfaction.\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// check that recommendation has been chosen\r\n\t\t\tif (!isset($_POST['recommend'.$x])){\r\n\t\t\t\t$error_msg[] = $_SESSION['purchases'][$x]['name'].\" - Please choose recommendation option.\";\r\n\t\t\t} else if (isset($_POST['recommend'.$x])){\r\n\t\t\t\t$rec = $_POST['recommend'.$x];\r\n\t\t\t\tif(!($rec == \"Yes\" || $rec == \"Maybe\" || $rec == \"No\")){\r\n\t\t\t\t\t$error_msg[] = $_SESSION['purchases'][$x]['name'].\" - Inappropriate answer given. Please select one from dropdown.\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $error_msg;\r\n\t}\r\n}", "public function checkDataSubmission() {\n\t\t$this->main('', array());\n }" ]
[ "0.5925213", "0.58338267", "0.57723445", "0.5735776", "0.5723705", "0.5626711", "0.55927366", "0.5518578", "0.54616266", "0.5460156", "0.54337746", "0.54083675", "0.53778344", "0.53458256", "0.5343712", "0.5326746", "0.5298114", "0.52776724", "0.5276043", "0.52613544", "0.5207838", "0.5184726", "0.51481706", "0.51390296", "0.51222545", "0.5112602", "0.5099981", "0.509992", "0.509517", "0.5083342", "0.50812536", "0.50801283", "0.5059456", "0.5050178", "0.5047416", "0.50400835", "0.50353014", "0.50258034", "0.5024243", "0.50140345", "0.5009828", "0.50025415", "0.49634275", "0.49627733", "0.4959674", "0.49510056", "0.49498406", "0.49480668", "0.49398613", "0.4936838", "0.49245706", "0.49133554", "0.49095103", "0.4904611", "0.49031922", "0.49004716", "0.4886671", "0.48861763", "0.4882254", "0.48788637", "0.48775768", "0.48746258", "0.48713896", "0.48702905", "0.4870072", "0.48694557", "0.4861223", "0.4856987", "0.48569196", "0.48540416", "0.48472485", "0.48431188", "0.4842844", "0.48402005", "0.4839397", "0.48369732", "0.48368508", "0.48315", "0.48305967", "0.4828437", "0.48246908", "0.48242366", "0.48232028", "0.4822529", "0.4819277", "0.48185873", "0.4816982", "0.48153228", "0.48135662", "0.480771", "0.4807318", "0.48071164", "0.48050666", "0.48013338", "0.48004955", "0.4799939", "0.47991624", "0.4796024", "0.47935283", "0.4792837", "0.47925824" ]
0.0
-1