query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Performs the task, can access all $this>crap setup in setUp)
public function perform() { $typeIDs = $this->args["typeIDs"]; // Get all the data from EVE Central $pricingData = $this->app->EveCentral->getPrices($typeIDs); // Loop through all the typeID foreach ($pricingData as $typeID => $data) { $avgSell = 0; $lowSell = 0; $highSell = 0; $avgBuy = 0; $lowBuy = 0; $highBuy = 0; switch ($typeID) { // Customs Office case 2233: // Fetch the price for gantry, nodes, modules, mainframes, cores and sum it up, that's the price for a customs office $gantry = $this->app->EveCentral->getPrice(3962)["sell"]["min"]; $nodes = $this->app->EveCentral->getPrice(2867)["sell"]["min"]; $modules = $this->app->EveCentral->getPrice(2871)["sell"]["min"]; $mainframes = $this->app->EveCentral->getPrice(2876)["sell"]["min"]; $cores = $this->app->EveCentral->getPrice(2872)["sell"]["min"]; $avgSell = $gantry + (($nodes + $modules + $mainframes + $cores) * 8); break; // Motherships case 3628: case 22852: case 23913: case 23917: case 23919: $avgSell = 20000000000; // 20b break; // Revenant case 3514: $avgSell = 100000000000; // 100b break; // Titans case 671: case 3764: case 11567: case 23773: $avgSell = 100000000000; // 100b break; // Turney frigs case 2834: case 3516: case 11375: $avgSell = 80000000000; // 80b break; // Chremoas case 33397: $avgSell = 120000000000; // 120b break; // Cambion case 32788: $avgSell = 100000000000; // 100b break; // Adrestia case 2836: $avgSell = 150000000000; // 150b break; // Vangel case 3518: $avgSell = 90000000000; // 90b break; // Etana case 32790: $avgSell = 100000000000; // 100b break; // Moracha case 33395: $avgSell = 125000000000; // 125b break; // Mimir case 32209: $avgSell = 100000000000; // 100b break; // Chameleon case 33675: $avgSell = 120000000000; // 120b break; // Whiptail case 33673: $avgSell = 100000000000; // 100b break; // Polaris case 9860: $avgSell = 1000000000000; // 1t break; // Cockroach case 11019: $avgSell = 1000000000000; // 1t break; // Gold Magnate case 11940: // Silver Magnate case 11942: // Opux Luxury Yacht case 635: // Guardian-Vexor case 11011: // Opux Dragoon Yacht $avgSell = 500000000000; // 500b break; // Megathron Federate Issue case 13202: // Raven State Issue case 26840: // Apocalypse Imperial Issue case 11936: // Armageddon Imperial Issue case 11938: // Tempest Imperial Issue case 26842: $avgSell = 750000000000; // 750b break; // Fallthrough default: $avgSell = $data["sell"]["avg"]; $lowSell = $data["sell"]["min"]; $highSell = $data["sell"]["max"]; $avgBuy = $data["buy"]["avg"]; $lowBuy = $data["buy"]["min"]; $highBuy = $data["buy"]["max"]; // If the selling price is under 0.05% different from the buying price then we swap them.. if ($highBuy > 0 && $lowSell > 0) { if ((($highBuy / $lowSell) * 100) < 0.05) { // Make sure it has no chance of being duplicated $duplicationChance = $this->app->Db->queryField("SELECT chanceOfDuplicating FROM invTypes WHERE typeID = :typeID", "chanceOfDuplicating", array(":typeID" => $typeID)); if ($duplicationChance == 0) { $avgSell = $data["buy"]["avg"]; $lowSell = $data["buy"]["min"]; $highSell = $data["buy"]["max"]; $avgBuy = $data["buy"]["avg"]; $lowBuy = $data["buy"]["min"]; $highBuy = $data["buy"]["max"]; } } } break; } $date = $data["date"]; // a fallthrough for pre-defined prices if ($lowSell == 0) $lowSell = $avgSell; if ($highSell == 0) $highSell = $avgSell; // Now we just insert it all and call it a day $this->app->Db->execute("INSERT INTO invPrices (typeID, avgSell, lowSell, highSell, avgBuy, lowBuy, highBuy) VALUES (:typeID, :avgSell, :lowSell, :highSell, :avgBuy, :lowBuy, :highBuy) ON DUPLICATE KEY UPDATE avgSell = :avgSell, lowSell = :lowSell, highSell = :highSell, avgBuy = :avgBuy, lowBuy = :lowBuy, highBuy = :highBuy", array( ":typeID" => $typeID, ":avgSell" => $avgSell, ":lowSell" => $lowSell, ":highSell" => $highSell, ":avgBuy" => $avgBuy, ":lowBuy" => $lowBuy, ":highBuy" => $highBuy, )); $this->app->StatsD->increment("ecPriceUpdates"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setUp() {\n $this->task = new Task();\n }", "public function setup(){\n\t\tparent::setup();\n\t\t//Do stuff...\n\t}", "protected function doSetup(): void\n {\n }", "private function setup() {\n sfContext::createInstance($this->configuration);\n\n $this->status = TaskStatus::getTaskStatus($this);\n\n $this->logger = new sfFileLogger(\n sfContext::getInstance()->getEventDispatcher(),\n array('file' => './log/tasks/'.get_class($this).'.log'));\n\n if(false === $this->status) {\n $this->log(\"Status row in Database does not exist\");\n $this->status = new TaskStatus();\n $this->status->task_name = get_class($this);\n $this->status->save();\n }\n\n $this->status->description = substr($this->briefDescription, 0, 120);\n\n $this->log(\"Task was executed via cronjob.\");\n }", "abstract public function setup();", "abstract public function setup();", "abstract public function setup();", "abstract public function setup();", "abstract protected function setup();", "public function setup(){\n parent::setup();\n //Do stuff...\n }", "abstract function setup();", "public function setUp()\n {\n $this->CT = new CommandTester();\n $this->CT->add(new UtilityTask);\n }", "protected function setup(){\n }", "public function setup() {}", "public function run()\n {\n\t $this->call(seeder_category::class);\n\t $this->call(seeder_e::class);\n\t $this->call(seeder_product::class);\n }", "public function setup()\n\t{\n\t\t// we don't do anything here in the base class\n\t}", "public function setUp() : void\n {\n $this->dispatcher = new TaskDispatcher();\n }", "public function runTestTask()\n\t{\n\t\t$this->runTask(1);\n\t}", "protected function setUp()\n {\n parent::setUp();\n $this->command = new GetCommand($this->sites);\n $this->command->setLogger($this->logger);\n $this->command->setSites($this->sites);\n }", "public function run_tests()\n {\n }", "protected function executeTasks() {}", "protected function setup()\n {\n //prepare your stuff\n }", "protected function doExecute()\n\t{\n\t\t// Your application routines go here.\n\t}", "public function run()\n {\n Model::unguard();\n\n //$this->call(TracuuFaker::class);\n //$this->call(SanphamFaker::class);\n //$this->call(DeliveryFaker::class);\n $this->call(updateImages::class);\n\n Model::reguard();\n }", "public function setup();", "public function setup();", "private function setup()\r\n\t{ }", "public function _postSetup()\n {\n }", "public function execute()\n {\n $this->run();\n }", "public function run()\n {\n foreach ($this->getTestMethods() as $method)\n {\n $test = $method->getName();\n\n $this->info(sfInflector::humanize(sfInflector::underscore(substr($test, 4))));\n $this->setUp();\n $this->$test();\n $this->tearDown();\n }\n }", "public function run()\n {\n $this->call(baihat_casi::class);\n $this->call(baihatduyet::class);\n $this->call(users::class);\n $this->call(theloai::class);\n $this->call(casi::class);\n $this->call(baihatmoi::class);\n $this->call(baihathot::class);\n $this->call(baihathot_casi::class);\n }", "public function execute()\n\t{\n\t\t$this->run();\n\t}", "public function testExecuteTaskAction()\n {\n }", "public function run()\n {\n \t// $this->call(Roles::class);\n \t// $this->call(Barangays::class); \n // $this->call(Cities::class); \n \t// $this->call(Users::class);\n \t// $this->call(ClassesforMedicines::class);\n // $this->call(Medicines::class);\n // $this->call(MedicineDosages::class);\n // $this->call(SeniorCitizenNumbers::class) ; \n $this->call(StatusesSeeder::class) ; \n $this->call(DeliveryStatusCodesSeeder::class) ; \n\n\n }", "protected function setUp()\n {\n $this->workload = new Workload('my-workload');\n }", "public function setup() {\n if ($this->pending) {\n return;\n }\n\n $this->fn->__invoke();\n }", "public function setup()\n {\n }", "public function setup()\n {\n }", "public function setup()\n {\n }", "public function setup()\n {\n }", "final public function perform()\n {\n $this->execute($this->args, $this->app);\n }", "public function run()\n {\n $this->call(Database\\Seeds\\Accounts::class);\n $this->call(Database\\Seeds\\BillStatuses::class);\n $this->call(Database\\Seeds\\Categories::class);\n $this->call(Database\\Seeds\\Currencies::class);\n $this->call(Database\\Seeds\\InvoiceStatuses::class);\n $this->call(Database\\Seeds\\Modules::class);\n $this->call(Database\\Seeds\\Settings::class);\n }", "public function setUp()\n {\n\n $this->db = Db::getActive();\n $this->response = Response::getActive();\n\n }", "public function run()\n {\n $this->call(ProductSeed::class);\n $this->call(ProductVariationSeed::class);\n $this->call(DealerSeed::class);\n $this->call(ProductOfferSeed::class);\n }", "public function run()\n {\n $this->seedUsers();\n $this->seedAdmins();\n $this->seedMeals();\n\n $this->seedOrder();\n $this->seedOrderlist();\n\n $this->seedReload();\n }", "public function run()\n {\n $this->output = new ConsoleOutput();\n\n $this->verifyTestDataIsBeingSeeded();\n\n /**\n * Seed models first, as order is important due to foreign key relations;\n * meta tables should already be seeded at this point through the InitialSeeder\n */\n foreach ($this->seed_tables as $table) {\n $this->seed($table);\n }\n }", "public function run()\n\t{\n\t\t//\n\t}", "public function setUp()\n {\n $this->strategy = new ExtractReferenceFromContentStrategy();\n }", "public function setUp(): void\n {\n // do somrthing before the benchmark\n }", "public function setUp(): void\n {\n parent::setUp();\n $this->controller = new TaskController();\n }", "protected function executeSpecificStep() {}", "public function run()\n {\n $tasks = Task::all();\n $categoriesCount = DB::table('categories')->count();\n\n //najskôr každej úlohe priradím aspoň jednu kategóriu\n\n foreach ($tasks as $task)\n $task->categories()->attach(random_int(1, $categoriesCount));\n\n\n //potom náhodným úlohám priradím ďalšiu kategóriu\n\n $max = random_int(5, $tasks->count());\n for ($i = 0; $i < $max; $i++) {\n $task = $tasks->random();\n try {\n $task->categories()->attach(random_int(1, $categoriesCount));\n } catch (Exception $exception) {\n //\n }\n }\n }", "public function run()\n {\n factory(\\App\\Task::class, 50)->create()\n ->each(function ($task) {\n if (mt_rand(0, 3) == 1) {\n $task->parent_task_id = App\\Task::inRandomOrder()\n ->where('id', '!=', $task->id)->first()->id;\n\n $task->save();\n }\n });\n }", "public function run()\n {\n $this->call(TestCompanyForCompletedSeeder::class);\n $this->call(TestRoleForCompletedSeeder::class);\n $this->call(TestDepartmentForCompletedSeeder::class);\n $this->call(TestCategoriesForCompletedSeeder::class);\n $this->call(TestUserForCompletedSeeder::class);\n $this->call(TestUserCategoriesForCompletedSeeder::class);\n $this->call(TestSequenceTypesForCompletedSeeder::class);\n $this->call(TestSequencesForCompletedSeeder::class);\n $this->call(TestWidgetTypesForCompletedSeeder::class);\n $this->call(TestWidgetSettingsForCompletedSeeder::class);\n $this->call(TestWidgetSimpleQuestionForCompletedSeeder::class);\n $this->call(TestWidgetFreeTextQuestionForCompletedSeeder::class);\n $this->call(TestWidgetSliderQuestionForCompletedSeeder::class);\n $this->call(TestWidgetMediaQuestionForCompletedSeeder::class);\n $this->call(TestWidgetMediaAnswerQuestionForCompletedSeeder::class);\n $this->call(TestWidgetArticleForCompletedSeeder::class);\n $this->call(TestWidgetLinkExternalForCompletedSeeder::class);\n $this->call(TestWidgetLinkInternalForCompletedSeeder::class);\n $this->call(TestModulesForCompletedSeeder::class);\n $this->call(TestModuleSequencesForCompletedSeeder::class);\n $this->call(TestWidgetOnboardingForCompletedSeeder::class);\n $this->call(TestCoursesForCompletedSeeder::class);\n $this->call(TestCourseCategoriesForCompletedSeeder::class);\n $this->call(TestCompletedForCompletedSeeder::class);\n }", "public function run ()\n { \n $this->fireCallback (self::TEST_SUITE_BEFORE);\n \n foreach ($this->getTestCases () as $name => $testCase)\n {\n $this->fireCallback (self::TEST_CASE_BEFORE);\n \n $this->_switchTestCase ($name);\n $testCase ($this);\n \n $this->fireCallback (self::TEST_CASE_AFTER);\n }\n \n $this->fireCallback (self::TEST_SUITE_AFTER);\n \n // I want to override $this\n $isolation = function ($structure, $suiteName)\n {\n require_once __DIR__ . '/views/main.php';\n };\n \n $isolation ($this->getAssertions (), $this->getName ());\n }", "public function setup() {\n\t}", "public function after_run(){}", "public function run()\n {\n // $this->call(AdminSeeder::class);\n // $this->call(StudentFaker::class);\n $this->call(TransactionFaker::class);\n // $this->call(BooksFaker::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n\n $this->call(users::class);\n $this->call(affiliates::class);\n $this->call(productInfo::class);\n\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call\n }", "public function run()\n {\n $this->call(Seeder_000001_00_XCountry::class);\n $this->call(Seeder_000002_00_XAPIKey::class);\n $this->call(Seeder_000003_00_XConfigItem::class);\n }", "public function run() {\n $this->base_data();\n $this->minimal_data();\n $project = Project::first();\n\n // Create a bunch more stuff, just for testin'.\n for ($i = 0; $i < 5; $i++) Factory::project($project->id);\n for ($i = 0; $i < 15; $i++) Factory::bid();\n for ($i = 0; $i < 15; $i++) Factory::question();\n for ($i = 0; $i < 10; $i++) Factory::vendor();\n for ($i = 0; $i < 40; $i++) Factory::section();\n\n for ($i = 0; $i < 20; $i++) Factory::project($project->id);\n for ($i = 0; $i < 40; $i++) Factory::bid(array(), $project->id);\n\n }", "public function setup()\n {\t\t\n }", "public function setup()\n {\t\t\n }", "public function run()\n {\n // 调用测试数据生成器容器\n $faker = app(Faker\\Generator::class);\n // 获取文章的 id\n $articles = App\\Models\\Article::released()->lists('id')->toArray();\n // 获取已激活用户的 id\n $commentators = App\\Models\\User::activated()->lists('id')->toArray();\n // 生成 100 个测试评论数据\n $comments = factory(App\\Models\\Comment::class)->times(100)->make()\n ->each(function($ele) use ($faker, $articles, $commentators) {\n $ele->user_id = $faker->randomElement($commentators);\n $ele->commentable_id = $faker->randomElement($articles);\n $ele->commentable_type = App\\Models\\Article::class;\n })->toArray();\n // 保存测试数据\n App\\Models\\Comment::insert($comments);\n }", "public function run() {\n\t\t$this->checkForHelp();\n\n\t\ttry {\n\t\t\t$this->getAndRunTasks();\n\t\t}\n\t\tcatch(Exception $e) {\n\t\t\t$this->printException($e);\n\t\t}\n\t}", "public function run()\n {\n $this->initiateData();\n }", "public function run()\n {\n $this->initiateData();\n }", "public function execute()\n\t{\n\t\t// Make sure we're using a secure connection\n\t\tif (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off')\n\t\t{\n\t\t\tApp::redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], '', 'message', true);\n\t\t\tdie('insecure connection and redirection failed');\n\t\t}\n\n\t\t$this->baseURL = rtrim(Request::base(), '/');\n\n\t\t$this->registerTask('__default', 'create');\n\n\t\tparent::execute();\n\t}", "public function setUp() {\n $this -> CI = &get_instance();\n $this -> flights = $this -> CI -> data['all_flights'];\n $this -> albatros = WackyAPI::getAlbatros();\n }", "public function run()\n {\n factory(Question::class, mt_rand(50, 80))\n ->make()\n ->each(function (Question $question) {\n $question->user_id = $this->getUserId();\n\n $question->save();\n\n $question->categories()->sync($this->getCategories());\n\n $this->makeAnswers($question);\n });\n }", "public function run()\n {\n $this->call('UserSeed');\n $this->call('UsersSeed');\n $this->call('CategoriasSeed');\n $this->call('PromocionesSeed');\n $this->call('ActividadesSeed');\n $this->call('ClientesSeed');\n $this->call('ProductosSeed');\n $this->call('NotificacionesClienteSeed');\n $this->call('ActividadesUsuarioSeed');\n $this->call('VentasProductoSeed');\n $this->call('PromocionesProductoSeed');\n }", "abstract protected function _run();", "abstract protected function _run();", "protected function setUp() {\n $this->object = new CrowdFlower_Judgment_Proxy($this->key);\n $this->data[0] = 'mob';\n $job = CrowdFlower::factory('job', $this->key);\n //set the channel to mob\n $resp = $job->channels($this->jobID, $this->data);\n //print_r($resp);\n }", "function run() {\n\t\t$this->_hook(Hooks::initialize);\n\t\tdo {\n\t\t\ttouch(TMP . 'autopilot_running');\n\t\t\t$this->_getToGreen();\n\t\t\t$this->_rerunAllTests();\n\t\t\t$this->_waitForChanges();\n\t\t} while (!file_exists(TMP . 'autopilot_stop'));\n\t\t$this->_hook(Hooks::quit);\n\t\tunlink(TMP . 'autopilot_running');\n\t}", "public static function setupBeforeClass()\n {\n self::$client = new \\GearmanClient();\n self::$client->addServer();\n self::$client->setCompleteCallback(array(__CLASS__, 'gearman_task_complete'));\n\n }", "function setup()\r\n {\r\n $this->logger = Logger::getLogger( CART_CONVERTER );\r\n //$this->logger->debug(\"main controller setup \" + current_time( \"timestamp\" ) );\r\n $this->cartController = CartController::getInstance();\r\n \r\n // create options panel\r\n $cartOptions = new CartOptionsController();\r\n $cartOptions->init();\r\n\r\n // init cron\r\n $cron = new CronController();\r\n\r\n // init report\r\n $report = new ReportController();\r\n\r\n do_action( 'cart_converter_setup_action' );\r\n }", "public function run()\n {\n $this->call('is_emirleri_seeder');\n $this->call('kullanicilar_seeder');\n $this->call('toplanti_olustur_seeder');\n $this->call('toplantilar_calisanlar_seeder');\n $this->call('tezgahlar_seeder');\n $this->call('tezgahlar_calisanlar_seeder');\n $this->call('akislar_seeder');\n $this->call('akislar_tezgahlar_seeder');\n $this->call('surecler_seeder');\n $this->call('surecler_akislar_seeder');\n $this->call('urunler_seeder');\n $this->call('surecler_urunler_seeder');\n $this->call('biten_urunler_seeder');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n $this->call([\n MockDataUserTableSeeder::class,\n MockDataCategoryTableSeeder::class,\n MockDataCountryTableSeeder::class,\n ]);\n DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n }", "private static function setup()\n {\n $files = ['Routes', 'Setup', 'Response'];\n $folder = static::$root.'Setup'.'/';\n\n self::call($files, $folder);\n\n $files = ['Database', 'Panel', 'Security', 'Maintenance', 'Loggin', 'Translator', 'App', 'Robots'];\n $folder = static::$root.'Setup/Documentations'.'/';\n\n self::call($files, $folder);\n\n $files = ['AppSetupException'];\n $folder = static::$root.'Setup/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "public function 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 after_run() {}", "public function run()\n {\n Model::unguard();\n\n if (\\App::environment('local', 'staging')) {\n // Clear existing data\n $this->clearData();\n }\n\n //$this->call('ThingsSeeder');\n\n Model::reguard();\n }", "public function run()\n {\n $this->call(CountriesSeed::class);\n $this->call(ReplayMapsSeeding::class);\n $this->call(ReplayTypesSeeding::class);\n $this->call(ForumSectionSeeding::class);\n $this->call(UserRoleSeeding::class);\n $this->call(GameVersionSeeding::class);\n }", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}" ]
[ "0.7003524", "0.67356306", "0.6685844", "0.66261953", "0.65701187", "0.65701187", "0.65701187", "0.65701187", "0.64738035", "0.64452875", "0.64273274", "0.6393736", "0.63719064", "0.630093", "0.62658405", "0.6265667", "0.62614405", "0.62581813", "0.62457013", "0.62142986", "0.6212213", "0.6188749", "0.6170198", "0.61662436", "0.6151255", "0.6151255", "0.6145783", "0.61310935", "0.61283916", "0.61182255", "0.6111389", "0.61051613", "0.6091898", "0.6088872", "0.6085154", "0.6078098", "0.6073261", "0.6073261", "0.6073261", "0.6073261", "0.6061216", "0.6050967", "0.6023062", "0.6021488", "0.6020225", "0.60148436", "0.60032976", "0.6002067", "0.59925175", "0.5987339", "0.59867114", "0.5982121", "0.597894", "0.59769547", "0.5974038", "0.5972567", "0.596168", "0.5955005", "0.5950892", "0.59492475", "0.5948951", "0.5939163", "0.5937493", "0.5937493", "0.5925641", "0.59244716", "0.5921545", "0.5921545", "0.5917728", "0.59153306", "0.59114015", "0.59098494", "0.59097856", "0.59097856", "0.5908867", "0.5906837", "0.5903524", "0.59028196", "0.58931637", "0.589242", "0.589154", "0.5887238", "0.58861965", "0.5885495", "0.5883517", "0.58820117", "0.58820117", "0.58820117", "0.58820117", "0.58820117", "0.58820117", "0.58820117", "0.58820117", "0.58820117", "0.58820117", "0.58820117", "0.58820117", "0.58820117", "0.58820117", "0.5880369", "0.5880369" ]
0.0
-1
Sets up the task (Setup $this>crap and such here)
public function setUp() { $this->app = RenaApp::getInstance(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setUp() {\n $this->task = new Task();\n }", "abstract public function setup();", "abstract public function setup();", "abstract public function setup();", "abstract public function setup();", "public function setup(){\n\t\tparent::setup();\n\t\t//Do stuff...\n\t}", "abstract protected function setup();", "public function __construct()\n {\n parent::__construct();\n\n $this->task = new \\App\\Console\\Tasks\\TaskController();\n }", "public function setup() {}", "abstract function setup();", "private function setup() {\n sfContext::createInstance($this->configuration);\n\n $this->status = TaskStatus::getTaskStatus($this);\n\n $this->logger = new sfFileLogger(\n sfContext::getInstance()->getEventDispatcher(),\n array('file' => './log/tasks/'.get_class($this).'.log'));\n\n if(false === $this->status) {\n $this->log(\"Status row in Database does not exist\");\n $this->status = new TaskStatus();\n $this->status->task_name = get_class($this);\n $this->status->save();\n }\n\n $this->status->description = substr($this->briefDescription, 0, 120);\n\n $this->log(\"Task was executed via cronjob.\");\n }", "protected function setup(){\n }", "public function setup();", "public function setup();", "public function setup(){\n parent::setup();\n //Do stuff...\n }", "public function startup()\n {\n parent::startup();\n Configure::write( 'debug', 2 );\n Configure::write( 'Cache.disable', 1 );\n\n $task = Inflector::classify( $this->command );\n }", "public function setup()\n\t{\n\t\t// we don't do anything here in the base class\n\t}", "private function setup()\r\n\t{ }", "public function setUp() : void\n {\n $this->dispatcher = new TaskDispatcher();\n }", "protected function doSetup(): void\n {\n }", "public function setup()\n {\n }", "public function setup()\n {\n }", "public function setup()\n {\n }", "public function setup()\n {\n }", "public function __construct()\n {\n $this->_baseDir = __DIR__;\n\n // Command line parser\n $this->_cmdParser = $parser = Console_CommandLine::fromXmlString($this->_cmdOptionsStructure);\n try {\n $cmdOptions = $parser->parse();\n if ($cmdOptions->command_name) {\n $this->_cmdOptions = $cmdOptions;\n $this->_cmdOptions->command_name = \"_{$this->_cmdOptions->command_name}\";\n } else {\n $parser->displayUsage();\n exit();\n }\n } catch (Exception $e) {\n $parser->displayError($e->getMessage());\n }\n\n // Load Config\n if (!$this->_cfg = $cfg = @json_decode(file_get_contents('config.json'), true)) {\n die($this->_fgColor('bold_red', \"\\nError: Could not read 'config.json'. Aborting.\\n\"));\n }\n\n // Logger\n $this->_log = new Logger('Tasks');\n $handler = new RotatingFileHandler(\"{$this->_baseDir}/log/report.log\", 10, Logger::INFO);\n $handler->setFormatter(new LineFormatter(\"[%datetime%] %level_name%: %message%\\n\"));\n $this->_log->pushHandler($handler);\n\n // Database\n $capsule = new Capsule;\n foreach ($cfg['databases'] as $k => $v) {\n $capsule->addConnection(\n [\n 'driver' => 'mysql',\n 'host' => $v['host'],\n 'database' => $v['database'],\n 'username' => $v['user'],\n 'password' => $v['password'],\n 'charset' => 'utf8',\n 'collation' => 'utf8_general_ci',\n 'prefix' => ''\n ],\n $k\n );\n }\n $capsule->setAsGlobal();\n\n // BitBucket Credentials\n $this->_bbApi = new Bitbucket\\API\\Api();\n $this->_bbApi->getClient()->addListener(\n new \\Bitbucket\\API\\Http\\Listener\\BasicAuthListener(\n $cfg['api']['bitbucket']['users']['admin']['user'],\n $cfg['api']['bitbucket']['users']['admin']['password']\n )\n );\n\n // Phonegap Build\n $this->_pgbApi = new PhonegapBuildApi($cfg['api']['pgb']['token']);\n\n // Stats\n $this->_report = array(\n 'Date & Time' => date('Y-m-d H:i:s'),\n 'Script Time' => 0,\n 'Method' => ''\n );\n }", "protected function setUp()\n {\n parent::setUp();\n $this->command = new GetCommand($this->sites);\n $this->command->setLogger($this->logger);\n $this->command->setSites($this->sites);\n }", "protected function setup() \n {\n if (!isset($this->ini['log'])) {\n $this->fatal_error('The configuration does not define the \\'log\\' setting.');\n }\n\n if (!isset($this->ini['ttl'])) {\n $this->fatal_error('The configuration does not define the \\'ttl\\' setting.');\n }\n\n if (isset($this->ini['redis'])) {\n $this->_redis = new RedisFunctions(\n $this->ini['ttl'], $this->ini['redis']['host'], \n $this->ini['redis']['port'], $this->ini['redis']['timeout']);\n } else {\n $this->fatal_error('The configuration does not define a redis section.');\n }\n\n if ($this->is_parent()) {\n $emails = array();\n if (isset($this->ini['emails'])) {\n foreach ($this->ini['emails'] as $email) {\n $emails[] = $email;\n $this->log(\"Adding $email to notification list.\");\n }\n }\n $this->email_distribution_list = $emails;\n }\n\n $this->_startTime = microtime(true);\n }", "public function setUp()\n {\n $this->CT = new CommandTester();\n $this->CT->add(new UtilityTask);\n }", "public function setup()\n {\n // $this->totalSteps = $this->startNumber;\n $this->times = array();\n $this->totalSteps = 1;\n }", "public function setup() {\n\t}", "public static function run()\n\t{\n\t\tself::initialize(__class__);\n\t\t# Add post-init hooks here\n\t}", "public function __construct() {\n $this->start();\n }", "protected function setup()\n {\n //prepare your stuff\n }", "function __construct() {\n \n self::setQuantumVars();\n \n self::setAutoLoader();\n \n self::initActiveRecord();\n \n self::initSmarty();\n \n self::launcher();\n \n self::output();\n \n }", "public function setup()\n {\n parent::setup();\n }", "protected function setUp() {\n $this->object = new CrowdFlower_Judgment_Proxy($this->key);\n $this->data[0] = 'mob';\n $job = CrowdFlower::factory('job', $this->key);\n //set the channel to mob\n $resp = $job->channels($this->jobID, $this->data);\n //print_r($resp);\n }", "public function setUp()\n {\n $this->urlGenerator = new UrlGenerator(new RouteCollection(), Request::create('/foo', 'GET'));\n $this->htmlBuilder = new HtmlBuilder($this->urlGenerator);\n $this->siteKey = 'my-site-key';\n $this->recaptchaBuilder = new RecaptchaBuilder($this->siteKey, $this->htmlBuilder);\n }", "public function __construct()\n {\n $this->start();\n }", "public function __construct()\n {\n $this->start();\n }", "function setup() {}", "public function __construct()\r\n {\r\n $this->includes();\r\n $this->setup();\r\n $this->hooks();\r\n }", "abstract protected function bootstrap();", "public function setup()\n {\n $this->config = new Config($this->emailOrMobileNumber, $this->merchantKey);\n }", "public function __construct()\n {\n include __DIR__ . '/config/config.php';\n if (isset($config['redis_password']) && !$config['redis_password'] == '') {\n Resque::setBackend('redis://redis:' . $config['redis_password'] . '@' . $config['redis_host']);\n }\n if (isset($config['test_url'])) {\n $this->test_url = $config['test_url'];\n }\n }", "public function setup()\n {\t\t\n }", "public function setup()\n {\t\t\n }", "public function __construct()\n\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->start();\n\t\t\t\t}", "public function __construct() {\n\n\t\t// start.\n\t\t$this->site_id = getenv( 'SITE_ID' );\n\t\t$this->access_token = getenv( 'SHIFTER_ACCESS_TOKEN' );\n\t\t$this->refresh_token = getenv( 'SHIFTER_REFRESH_TOKEN' );\n\n\t\t$shifte_api_v1 = getenv( 'SHIFTER_API_URL_V1' );\n\t\t$shifte_api_v2 = getenv( 'SHIFTER_API_URL_V2' );\n\t\t$this->terminate_url = \"$shifte_api_v2/projects/$this->site_id/wordpress_site/stop\";\n\t\t$this->generate_url = \"$shifte_api_v1/projects/$this->site_id/artifacts\";\n\t\t$this->refresh_url = \"$shifte_api_v1/login\";\n\t\t$this->shifter_dashboard_url = \"https://go.getshifter.io/admin/sites/$this->site_id\";\n\n\t\t$bootup_unixtimestamp = file_get_contents( ABSPATH . '/.bootup' );\n\t\t$bootup_date = new DateTime();\n\t\tself::$token_update_date = $bootup_date->setTimestamp( intval( $bootup_unixtimestamp ) );\n\t\t// stop.\n\t}", "public function setup()\n {\n $config['plugins'] = array($this->_class);\n $this->_markdown = Solar::factory('Solar_Markdown', $config);\n \n // build the plugin\n $config['markdown'] = $this->_markdown;\n $this->_plugin = Solar::factory($this->_class, $config);\n \n }", "protected function setUp()\n {\n $this->workload = new Workload('my-workload');\n }", "public function __construct() {\n\t\tparent::__construct();\n\n\t\t$this->aioseo_options = get_option( 'aioseop_options' );\n\n\t\t$this->import_metas();\n\t\t$this->import_ga();\n\t}", "public function __construct($task)\n {\n $this->task = $task;\n }", "private function __construct() {\n\t\t$this->client_ids = array(\n\t\t\t'stolaf' => get_field( $this->service . '_stolaf_client_id', 'option' ),\n\t\t\t'carleton' => get_field( $this->service . '_carleton_client_id', 'option' ),\n\t\t);\n\t\t$this->client_secrets = array(\n\t\t\t'stolaf' => get_field( $this->service . '_stolaf_client_secret', 'option' ),\n\t\t\t'carleton' => get_field( $this->service . '_carleton_client_secret', 'option' ),\n\t\t);\n\n\t\tif ( empty( $this->client_ids ) || empty( $this->client_secrets ) ) {\n\t\t\tadd_action( 'admin_notices', array( $this, 'missing_api_keys' ) );\n\t\t}\n\n\t\trequire_once BL_PLUGIN_DIR . '/inc/class-libguides-11-async-process.php';\n\t\t$this->async = new LibGuides_11_Async_Process();\n\t}", "public function setup()\n {\n CRUD::setModel(\\App\\Models\\Task::class);\n CRUD::setRoute(config('backpack.base.route_prefix') . '/task');\n CRUD::setEntityNameStrings('task', 'tasks');\n CRUD::set('reorder.label', 'name');\n CRUD::set('reorder.max_level', 1);\n \n $this->crud->orderBy('project_id','ASC')->orderBy('priority','ASC');\n \n }", "function setup()\r\n {\r\n $this->logger = Logger::getLogger( CART_CONVERTER );\r\n //$this->logger->debug(\"main controller setup \" + current_time( \"timestamp\" ) );\r\n $this->cartController = CartController::getInstance();\r\n \r\n // create options panel\r\n $cartOptions = new CartOptionsController();\r\n $cartOptions->init();\r\n\r\n // init cron\r\n $cron = new CronController();\r\n\r\n // init report\r\n $report = new ReportController();\r\n\r\n do_action( 'cart_converter_setup_action' );\r\n }", "protected function parentSetup() {\n }", "public function run()\n {\n $tasks = Task::all();\n $categoriesCount = DB::table('categories')->count();\n\n //najskôr každej úlohe priradím aspoň jednu kategóriu\n\n foreach ($tasks as $task)\n $task->categories()->attach(random_int(1, $categoriesCount));\n\n\n //potom náhodným úlohám priradím ďalšiu kategóriu\n\n $max = random_int(5, $tasks->count());\n for ($i = 0; $i < $max; $i++) {\n $task = $tasks->random();\n try {\n $task->categories()->attach(random_int(1, $categoriesCount));\n } catch (Exception $exception) {\n //\n }\n }\n }", "public function setup()\n {\n }", "public function setup()\n {\n }", "public function setUp() {\n $this -> CI = &get_instance();\n $this -> flights = $this -> CI -> data['all_flights'];\n $this -> albatros = WackyAPI::getAlbatros();\n }", "function __construct()\n\t{\n\t\tparent::__construct();\n\n\t\t// Register Extra tasks\n\t\t$this->registerTask( 'add' , \t'edit' );\n\t}", "public function setUp()\n {\n Time::setToStringFormat('yyyy-MM-dd HH:mm:ss');\n $this->request = new Request();\n $this->response = new Response();\n $this->view = new PugView($this->request, $this->response);\n }", "public function __construct() {\n\t\t$this->QuackBehaviour = new Quack();\n\t\t$this->FlyBehaviour = new FlyWithWings();\n\t}", "public function setup() {\n\t\t$this->setupDetectors();\n\t\t$this->registerExceptionHandler();\n\t}", "public function __construct()\n\t{\n\t\t// process into quick, hopefully low-memory tasks when accessed\n\t\t// through the browser\n\t\t$this->setSteps([\n\t\t\t'preflight',\n\t\t\t'download',\n\t\t\t'unpack'\n\t\t]);\n\n\t\t$this->logger = ee('Updater/Logger');\n\n\t\t// Attempt to set time and memory limits\n\t\t@set_time_limit(0);\n\t\t@ini_set('memory_limit', '256M');\n\t}", "public function setUp() {\n $app = require __DIR__.'/../../bootstrap/app.php';\n $app->make('Illuminate\\Contracts\\Console\\Kernel')->bootstrap();\n\n $this->consumables=new Consumables();\n }", "protected function setUp()\n { \n $settings = require __DIR__ . '/../../../config/settings.php';\n $container = new \\Slim\\Container($settings);\n $container['stockconfig'] = function ($config) {\n $stockconfig =$config['settings']['stockconfig']; \n return $stockconfig;\n };\n $dependencies = new Dependencies($container);\n $dependencies->registerLogger();\n $dependencies->registerDatabase();\n $this->object = new ScoringResource($container);\n \n }", "public function setup()\n {\n // $this->totalSteps = $this->startNumber;\n $this->times = array();\n $this->totalSteps = sizeof(HailApiObject::fetchables());\n }", "protected function setUp() {\n $this->object = new Cron;\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}", "protected function setUp()\n {\n \tob_start ();\n \t\n \t$this->object = new slurm ();\n \t$this->object->setListeOptions ( $this->getListeOption () );\n }", "public function __construct(){\n\t\tini_set('session.use_cookies', '0');\n\t\t$task = lc('uri')->get(TASK_KEY, 'common');\n\t\tif(!method_exists($this, 'web_'.$task) || !is_callable(array($this, 'web_'.$task))){\n\t\t\t$task = 'common';\n\t\t}\n\t\t$this->{'web_'.$task}();\n\t}", "public function run()\n {\n\t $this->call(seeder_category::class);\n\t $this->call(seeder_e::class);\n\t $this->call(seeder_product::class);\n }", "private static function setup()\n {\n $files = ['Routes', 'Setup', 'Response'];\n $folder = static::$root.'Setup'.'/';\n\n self::call($files, $folder);\n\n $files = ['Database', 'Panel', 'Security', 'Maintenance', 'Loggin', 'Translator', 'App', 'Robots'];\n $folder = static::$root.'Setup/Documentations'.'/';\n\n self::call($files, $folder);\n\n $files = ['AppSetupException'];\n $folder = static::$root.'Setup/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "public function __construct() {\n\t\tif ( is_multisite() ) {\n\t\t\t$this->_sitemeta = 'meta' . get_current_blog_id() . '.data';\n\t\t}\n\n\t\t$this->_resetfile = LITESPEED_STATIC_DIR . '/crawler/' . $this->_sitemeta . '.reset';\n\n\t\t$this->_summary = self::get_summary();\n\n\t\tDebug2::debug( '🐞 Init' );\n\t}", "public function setUp()\n {\n $this->strategy = new ExtractReferenceFromContentStrategy();\n }", "public function __construct() {\n // Autoload Dependencies & Helpers\n spl_autoload_register([$this, 'loadBones']);\n // Load in Core Components\n foreach (glob(SKELETON_PATH . 'core/*.php') as $file) {\n list($filePath, $className) = [$file, 'Skeleton_' . basename($file, EXT)];\n if(file_exists($filePath)) {\n include $filePath;\n $this->{strtolower(basename($filePath, EXT))} = new $className($this);\n $this->coreComponents[] = strtolower(basename($filePath, EXT));\n }\n }\n // Core Components Loaded!\n foreach($this->coreComponents as $component) {\n if(method_exists($this->{$component}, '_onLoadFinish')) {\n $this->{$component}->_onLoadFinish();\n }\n }\n // Set environment\n $this->environment = ENVIRONMENT;\n if(!$this->environment) {\n exit(JSON::out('error', 'No environment set!'));\n }\n // Preload stuff is over\n $this->router->setPreloadFlag(false);\n // Run App\n try {\n $skeleton = $this;\n include $this->router->go();\n // the end\n die();\n } catch(NoRouteFoundException $e) {\n JSON::out(array(\n 'status' => 'error', \n 'message' => $e->getMessage()\n ));\n } catch(Exception $e) {\n JSON::out(array(\n 'status' => 'error', \n 'message' => $e->getMessage()\n ));\n }\n }", "public function setup()\n {\n $this->createCategories();\n $this->createProducts();\n }", "protected function setUp()\n { \n $settings = require __DIR__ . '/../../../config/settings.php';\n $container = new \\Slim\\Container($settings);\n $container['stockconfig'] = function ($config) {\n $stockconfig =$config['settings']['stockconfig']; \n return $stockconfig;\n };\n $dependencies = new Dependencies($container);\n $dependencies->registerLogger();\n $dependencies->registerDatabase();\n $this->object = new StockResource($container);\n \n }", "function quickSetUp()\n {\n $this->setUp(null, null, null, null, null);\n }", "protected function setUp(){\n $this->poneys = new Poneys;\n $this->poneys->setCount(8);\n }", "function __construct()\n\t{\n\t\tparent::__construct();\n\n\t\t// Map the save tasks.\n\t\t$this->registerTask('save2new',\t\t'save');\n\t\t$this->registerTask('apply',\t\t'save');\n\n\t\t// Map the publishing state tasks.\n\t\t$this->registerTask('unpublish',\t'publish');\n\t\t$this->registerTask('archive',\t\t'publish');\n\t}", "private function setup() {\n\n\t\tif ( ! function_exists( 'tachyon_url' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Images in post content and galleries.\n\t\tadd_filter( 'the_content', [ __CLASS__, 'filter_the_content' ], 999999 );\n\t\tadd_filter( 'get_post_galleries', [ __CLASS__, 'filter_the_galleries' ], 999999 );\n\n\t\t// Core image retrieval.\n\t\tadd_filter( 'image_downsize', [ $this, 'filter_image_downsize' ], 10, 3 );\n\t\tadd_filter( 'rest_request_before_callbacks', [ $this, 'should_rest_image_downsize' ], 10, 3 );\n\t\tadd_filter( 'rest_request_after_callbacks', [ $this, 'cleanup_rest_image_downsize' ] );\n\n\t\t// Responsive image srcset substitution.\n\t\tadd_filter( 'wp_calculate_image_srcset', [ $this, 'filter_srcset_array' ], 10, 5 );\n\t}", "private function __construct() {\n\t\trequire_once \"Scripts/HTMLCleaner.php\";\n\t\trequire_once \"Scripts/ProcessProperties.php\";\n\t}", "public static function setupBeforeClass()\n {\n self::$client = new \\GearmanClient();\n self::$client->addServer();\n self::$client->setCompleteCallback(array(__CLASS__, 'gearman_task_complete'));\n\n }", "public function __construct()\r\n {\r\n parent::__construct();\r\n\r\n $this->url = Configure::read('cdr_url') . \":\" . Configure::read('cdr_api.async_port');\r\n }", "public function setUp()\n {\n $this->_standardLib = new \\App\\OOProgramming\\StandardLibrary;\n $this->_daughter = new \\App\\OOProgramming\\Daughter;\n }", "public function setupOptions()\n {\n $this->addTaskAction(new Action('test', 't', 'Test action'));\n }", "function __construct()\n {\n parent::__construct();\n\n// if(!authCheck($this->post('auth'))){\n// returnFailedResponse();\n// exit();\n// }\n\n $this->check_auth_client = $this->tasks->check_auth_client();\n\n }", "public function __construct(){\n\n\t\t//iniciando o array de rotas\n\t\t$this->initRotues();\n\n\t\t$this->run($this->getUrl());\n\n\t}", "function __construct(){\n\n\t\t\t$this->enqueues();\n\n\t\t}", "public function __construct() {\n # Get the queue\n $this->queue = Queue::getQueue();\n # Now process\n $this->process();\n }", "protected function setUp()\n {\n // call parent\n parent::setUp();\n\n // create instance\n $this->akismet = new Akismet(APIKEY, URL);\n }", "public function setUp()\n {\n $this->intent = new \\Twitter\\Intents\\Tweet();\n }", "protected function setUp()\n\t{\n\t\t$this->object = new RedisTools;\n\t}", "private function setup() {\n foreach($this->fighters as $i => $fighter) {\n $this->fighters[$i]->instance_id = $i;\n $this->fighter_current = $this->fighters[$i];\n if(!$fighter->abilities) {\n }\n else {\n foreach($fighter->abilities as $ability) {\n if($ability->type == 'passive') {\n $this->useAbility($ability->name);\n }\n }\n }\n }\n $this->fighter_current = $this->fighters[0];\n //TODO: decide start user here\n }", "protected function bootstrap()\n {\n }", "public function __construct( ){\r\n\t\tparent::__construct();\r\n\t\t$this->registerTask('show', 'display' );\r\n\t\t$this->registerTask('check', 'checkstatus' );\r\n\t}", "public function run()\n {\n $this->call(baihat_casi::class);\n $this->call(baihatduyet::class);\n $this->call(users::class);\n $this->call(theloai::class);\n $this->call(casi::class);\n $this->call(baihatmoi::class);\n $this->call(baihathot::class);\n $this->call(baihathot_casi::class);\n }", "protected function setup() : void\n {\n $this->subject = new Product(\n 'ACCESS_KEY',\n 'SECRET_KEY',\n 1\n );\n }", "protected function setup() : void\n {\n $this->subject = new Timezones();\n }" ]
[ "0.6784822", "0.64191943", "0.64191943", "0.64191943", "0.64191943", "0.637564", "0.6342513", "0.63260233", "0.6293389", "0.6290892", "0.62398136", "0.61620927", "0.6152208", "0.6152208", "0.6146425", "0.61242545", "0.6118252", "0.6116656", "0.5998299", "0.5982919", "0.59717494", "0.59717494", "0.59717494", "0.59717494", "0.59557116", "0.59557015", "0.5953664", "0.593517", "0.5837109", "0.5830866", "0.5822872", "0.58116734", "0.5807105", "0.5799218", "0.57913125", "0.5784543", "0.57734007", "0.5767283", "0.5767283", "0.5766817", "0.5753361", "0.5736366", "0.5712658", "0.57092977", "0.5708103", "0.5708103", "0.5705422", "0.5700501", "0.56904125", "0.5686219", "0.5681596", "0.5673537", "0.5672547", "0.56637394", "0.5659907", "0.5638842", "0.5624578", "0.5623539", "0.5623539", "0.5619819", "0.56197447", "0.5617463", "0.5615383", "0.56145376", "0.56082594", "0.5605925", "0.56057304", "0.5602738", "0.5591208", "0.5570938", "0.55677086", "0.55656904", "0.5552677", "0.55501974", "0.55341697", "0.5526209", "0.55224437", "0.55197746", "0.55192554", "0.5511521", "0.55105066", "0.55080557", "0.5504978", "0.5497318", "0.54966176", "0.54965776", "0.5496075", "0.5493595", "0.5489882", "0.5484711", "0.5484039", "0.54824966", "0.54817706", "0.5481585", "0.54786015", "0.54778886", "0.5474026", "0.54625195", "0.5462325", "0.5460312", "0.545685" ]
0.0
-1
Tears the task down, unset $this>crap and such
public function tearDown() { $this->app = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function safeDown()\r\n {\r\n $this->down();\r\n }", "function forget()\n\t{\n\t}", "public function safeDown()\r\n\t{\r\n\t\t$this->down();\r\n\t}", "protected function stopTask() {}", "public function safeDown()\n {\n $this->down();\n }", "public function safeDown()\n {\n $this->down();\n }", "public function __destruct() {\n\t\t$this->stopRinging();\n\t}", "public function safeDown()\n\t{\n\t\t$this->down();\n\t}", "public function abortDuel(){\n $this->plugin->getScheduler()->cancelTask($this->countdownTaskHandler->getTaskId());\n }", "public function reclaim();", "public function forgetMe()\n\t{\n\t\t// TODO\n\t}", "protected function deactivateSelf() {}", "public function __destruct() {\r\n unset( $this );\r\n }", "public function __destruct()\n {\n if (true === $this->parent) {\n foreach ($this->pid as $pid => $task) {\n posix_kill($pid, SIGTERM);\n Redis::init()->rpush('tasks', json_encode([\n 'class' => $task['class'],\n 'link' => $task['link'],\n ]));\n }\n }\n }", "protected function tearDown(): void\r\n {\r\n unset($this->queue);\r\n }", "function __destruct()\n {\n if (!$this->should_schedule()) {\n return;\n }\n $this->schedule();\n }", "public function __destruct() {\r\n if(self::$instance instanceof Booter) {\r\n self::shutdown();\r\n }\r\n }", "public function stop()\n {\n $this->gamerounds[] = $this->roundsum;\n $this->roundsum = 0;\n $this->dice->reset();\n }", "public function __destruct() {\n\t\tunset ( $this );\n\t}", "public function __destruct() {\n\t\tunset($this);\n\t}", "public function __destruct(){unset($this);}", "public function __destruct() {\n $this->this = null;\n }", "function stopDownloadToPool()\n\t{\n\t\tinclude(\"/m23/inc/i18n/\".$GLOBALS[\"m23_language\"].\"/m23base.php\");\n\t\t$this->addInfoMessage($I18N_downloadAborted);\n\n\t\tSERVER_deleteFile($this->getPoolDir().'/lock');\n\n\t\tSERVER_killBackgroundJob('downloadPoolPackages');\n\t}", "public function __destruct()\n\t{\n\t\tunset($this);\n\t}", "protected function tearDown()\n {\n Task::deleteAll();\n }", "protected function __del__() { }", "public function halt();", "public function __destruct() {\n unset($this->_pidManager);\n unset($this->_pidFile);\n unset($this->_ipc);\n unset($this->_tasks);\n }", "public function teardown()\n {\n //\n }", "public function kill();", "private static function cleanup()\n {\n // we don't need the tasks in memory any more.\n self::$_tasks = '';\n }", "public function tearDown()\n\t{\n\t\tunset($this->target);\n\t}", "public function __destruct() {\n if (class_exists('\\Sleepy\\Hook')) {\n Hook::addAction($this->clean_class() . '_postprocess');\n }\n }", "public function tear_down() {\n\t\tunset( $GLOBALS['link'] );\n\t\tparent::tear_down();\n\t}", "public function kill(): void;", "private function _unsetSetup()\n\t{\n\t\tforeach ( $this->_setup as $setup )\n\t\t{\n\t\t\t$setup->disconnect();\n\t\t}\n\n\t\t$this->_setup = null;\n\t\t$this->_setup = array();\n\t}", "public function tearDown() {\n $this->command = null;\n }", "public function __destruct()\n {\n unset($this->queue);\n }", "public function shutdown()\n {\n unset($this->project);\n }", "protected function cleanUp()\n\t{\n\t\t// clean\n\t\t$this->killExceededTasks();\n\t\t$this->cleanHistory();\n\t}", "protected abstract function do_down();", "public function teardown()\n {\n }", "public function teardown()\n {\n parent::teardown();\n }", "public function tearDown() {\n if(self::$__infoKill) {\n echo sprintf(self::$__infoKill, date('r'), $this->__pid) . PHP_EOL;\n }\n exec('kill ' . $this->__pid);\n unset(self::$__pIds[$this->__pid]);\n\n parent::tearDown();\n }", "public function tearDown() : void {\n\t\tunset($this->ls); /* Kill circular references */\n\t\tunset($this->lsconn); /* Kill circular references */\n\t}", "public function tearDown()\n {\n unset($this->_foo);\n }", "public function purge() {}", "public function down() { return $this->run('down'); }", "public function tracker_abort(){\n\t\t$this->env_set('tracker:event', false);\n\t\t}", "public function self_destruct(){\n foreach($this->donations() as $index => $obj)$obj->self_destruct();\n parent::self_destruct();\n }", "function _deactivate() {}", "public function __destruct(){\n\t\t$this->purgeQueue();\n\t}", "protected function doTearDown(): void\n {\n }", "public function stop()\n {\n $this->mark('__stop');\n }", "public function tear_down()\n {\n }", "public function tear_down()\n {\n }", "public function tear_down()\n {\n }", "public function tearDown()\n {\n unset($this->_standardLib);\n unset($this->_daughter);\n }", "abstract public static function cleanShutDown();", "protected function tearDown(): void {\n unset($this->integration);\n unset($this->ccm);\n unset($this->session);\n }", "protected function tear_down()\n {\n unset($this->_object, $this->_view);\n }", "protected function parentCleanup() {\n }", "public function tearDown()\n {\n unset($this->VenusFuelDepot);\n }", "public function uncork()\n {\n $this->_corked = false;\n\n while ($call = array_shift($this->_queue)) {\n call_user_func_array(array($this,'trigger'), $call);\n }\n\n return $this;\n }", "public function stop() {}", "public function unguard()\n {\n $this->guard = false;\n }", "public function __destruct()\n {\n unset($this->stepCount);\n parent::__destruct();\n }", "function off() {\n return $this;\n }", "public function nuke () {\n\t\tglobal $wpdb;\n\n\t\t// Make a list of the items syndicated from this feed...\n\t\t$post_ids = $wpdb->get_col($wpdb->prepare(\"\n\t\tSELECT post_id FROM $wpdb->postmeta\n\t\tWHERE meta_key = 'syndication_feed_id'\n\t\tAND meta_value = '%s'\n\t\t\", $this->id));\n\n\t\t// ... and kill them all\n\t\tif (count($post_ids) > 0) :\n\t\t\tforeach ($post_ids as $post_id) :\n\t\t\t\t// Force scrubbing of deleted post\n\t\t\t\t// rather than sending to Trashcan\n\t\t\t\twp_delete_post(\n\t\t\t\t\t/*postid=*/ $post_id,\n\t\t\t\t\t/*force_delete=*/ true\n\t\t\t\t);\n\t\t\tendforeach;\n\t\tendif;\n\n\t\t$this->delete();\n\t}", "public function tear_down() {\n\t\t$this->registry = null;\n\n\t\tparent::tear_down();\n\t}", "public function abort() {\n\t\t$this->timer->abortEvent( $this );\n\t}", "public function haltJobLoop()\n\t{\n\t\t$this->halt_job_loop = true;\n\t}", "private function stop_ATD()\n\t{\n\t\texecuteCommand('killall run-lowmem.sh', '', $result, $return_status);\n\t}", "public function gracefulStop(){\n $this->handleWorkerOutput('warn', \"Work done, exiting now.\");\n $this->stop();\n }", "protected function tearDown() {\n $this->stack = null;\n }", "protected function tearDown()\n\t{\n\t\tunset($this->_instance);\n\t\tparent::tearDown();\n\t}", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function killExceededTasks()\n\t{\n\t\t$exceededTasks = $this->taskRepository->findExceededTasks();\n\t\tforeach ($exceededTasks as $task) {\n\t\t\t$task->lastSuccess = false;\n\t\t\t$this->setTaskIdleAndSave($task);\n\t\t\t// task history ..\n\t\t\t$taskHistory = new TaskHistory();\n\t\t\t$taskHistory->taskId = $task->id;\n\t\t\t$taskHistory->started = new DateTime();\n\t\t\t$taskHistory->finished = new DateTime();\n\t\t\t$taskHistory->output = new Output;\n\t\t\t$taskHistory->output->error(\"Exceeded time to run\");\n\t\t\t$taskHistory->resultCode = -1;\n\t\t\t$this->taskHistoryRepository->save($taskHistory);\n\t\t}\n\t}", "protected function tearDown()\n\t {\n\t\tunset($this->object);\n\t }", "protected function tearDown()\n\t{\n\t\t$this->instance = null;\n\t}", "public function __destruct()\n {\n curl_close($this->curl);\n $this->curl = null;\n }", "public function __destruct() {\n\t\t\tparent::__destruct();\n\t\t\tunset($this->after);\n\t\t\tunset($this->before);\n\t\t\tunset($this->builder);\n\t\t\tunset($this->data_source);\n\t\t}", "abstract public function down();", "abstract public function down();", "abstract public function down();", "protected abstract function killFree();", "public function __destruct()\n {\n if ($this == self::$instance) {\n self::$instance = null;\n }\n }", "public function tear_down(): void {\n\t\t$this->dispatcher->execute();\n\t}", "protected function shutdown()\n {\n }", "Function __destruct(){\n\t\t$this->unload();\n\t}", "function unextend() {\n if ($this->observation) {\n $this->observation->cancel();\n $this->observation = NULL;\n }\n }", "public function stop()\n {\n die;\n }", "protected function tearDownAsync()\n {\n \\gc_collect_cycles();\n }", "public function __destruct()\n {\n $this->configuration->eventDispatcher()->dispatch(new Destruct($this));\n }", "public function purge(): void\n {\n $this->boot();\n $this->configuration->eventDispatcher()->dispatch(new Clear($this));\n }", "public function __destruct()\n {\n DirectoryRemover::remove($this->path);\n }", "protected function childCleanup() {\n }" ]
[ "0.646167", "0.6424525", "0.63918734", "0.63856876", "0.6378202", "0.6378202", "0.63284516", "0.6246043", "0.6235112", "0.6153335", "0.61478984", "0.6135059", "0.6132968", "0.60674405", "0.60510135", "0.60112387", "0.6001847", "0.59929365", "0.5974281", "0.5966369", "0.5944577", "0.5924761", "0.5910325", "0.58873606", "0.5862889", "0.5861981", "0.5858471", "0.5850516", "0.58504", "0.5846932", "0.584515", "0.5841563", "0.583054", "0.5826719", "0.58243275", "0.58242035", "0.5812394", "0.58064055", "0.5795319", "0.579182", "0.5788488", "0.57690084", "0.57668006", "0.57585824", "0.57530653", "0.5743075", "0.57269794", "0.5724452", "0.5719569", "0.5709448", "0.56991756", "0.569873", "0.5688224", "0.568083", "0.5674189", "0.5674189", "0.5674189", "0.5673546", "0.567008", "0.56674117", "0.5666096", "0.56560606", "0.56544435", "0.5635248", "0.5629726", "0.5628012", "0.562269", "0.5617391", "0.56129605", "0.5611937", "0.5609235", "0.5609137", "0.55957055", "0.55955905", "0.5589766", "0.55897444", "0.557816", "0.557816", "0.557816", "0.557816", "0.557816", "0.55597323", "0.55592126", "0.5554693", "0.55525017", "0.5552385", "0.55430156", "0.55430156", "0.55430156", "0.55334127", "0.55294573", "0.5528447", "0.5527687", "0.5527554", "0.55273396", "0.5526492", "0.55245167", "0.5522508", "0.5519109", "0.55186033", "0.55182326" ]
0.0
-1
Gets query for [[Request]].
public function getSession() { return $this->hasOne(HospitalSession::className(), ['Session_ID' => 'Session_ID']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getQuery(Request $request)\n {\n $queries = $request->all();\n \n if (count($queries) > 0) {\n $bag = [];\n\n foreach ($queries as $key => $value) {\n $bag[] = \"$key=$value\";\n }\n\n return \"?\" . join('&', $bag);\n }\n\n return null;\n }", "public static function getQuery()\n {\n return ServiceLocatorService::getServiceLocator()->get('Request')->getQuery()->toArray();\n }", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "protected function obtainGetRequest() {\n $request = Request::createFromGlobals();\n return $request->query;\n }", "public function getQuery()\n {\n return $this->get(self::_QUERY);\n }", "public function getQuery()\n {\n return $this->getQ();\n }", "public function getQuery() {}", "public function getQuery() {}", "public function getQuery(){\n \n return $this->query;\n \n }", "public function getQUERY()\n {\n return $this->QUERY;\n }", "public function getQuery()\r\n\t{\r\n\t\treturn $this->query;\r\n\t}", "public function getQuery() {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery() {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->_data['query'];\n }", "public function getQuery()\n\t{\n\t\treturn $this->query;\n\t}", "public function getQuery() {\n return $this->query;\n }", "function getQuery() {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->wrapped->getQuery();\n }", "public static function getQuery()\n {\n return self::$__query;\n }", "public final function getQuery() {\n return $this->queryString;\n }", "public function getQuery()\r\n {\r\n return $this->m_query;\r\n }", "public function getQuery()\n {\n return $this->_query;\n }", "public function getQuery() {\n $query = $this->getArgument(self::QUERY_NAME, '');\n if ($query) {\n// $query = str_replace(Url::getBaseUrl(), '', $query);\n $query = str_replace('?' . self::QUERY_NAME . '=', '', $query);\n $query = ltrim($query, Request::QUERY_SEPARATOR);\n $query = rtrim($query, Request::QUERY_SEPARATOR);\n }\n\n return $query;\n }", "protected function getQuery()\n {\n return self::$_query;\n }", "public function get() {\n\t\treturn $this->query;\n\t}", "public function getQuery()\n {\n return $this->getOption('query');\n }", "public function get_query(){\n return $this->build_query()->query;\n }", "public function getQuery()\n {\n /* Return self->query */\n return $this->query;\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function getQuery(): string\r\n {\r\n return $this->query;\r\n }", "public function getQuery($name = null);", "public function getQuery(): string\n {\n return $this->query;\n }", "public function getQuery(): string\n {\n return $this->query;\n }", "public function getQuery(): string\n {\n return $this->query;\n }", "public function getquery(){\n\t\treturn $this->query;\n\t}", "public function getQuery()\n {\n return isset($this->query) ? $this->query : null;\n }", "public abstract function getQuery();", "public function getQueryString()\n {\n return $this->getRequest()->getQueryString();\n }", "public function getRequest()\n {\n return $this->get(self::_REQUEST);\n }", "public function getFulltextQuery()\n {\n return $this->getRequest()->getParam('query');\n }", "public function getQuery()\n {\n // if it's a simple query/filter there is no need to create a bool query\n if ((count($this->must) + count($this->should)) === 1) {\n $a = array_merge($this->must, $this->should);\n return array_shift($a);\n }\n\n // required conditions (AND)\n if (!empty($this->must)) {\n $this->query['bool']['must'] = $this->must;\n }\n\n // optional conditions (OR)\n if (!empty($this->should)) {\n $this->query['bool']['should'] = $this->should;\n $this->query['bool']['minimum_should_match'] = $this->minimumShouldMatch;\n }\n\n return $this->query;\n }", "function getQuery() ;", "public function query(): array\n {\n return $this->request->query();\n }", "protected function _getQuery()\n {\n return $this->_queryFactory->get();\n }", "protected function buildQuery(Request $request)\n {\n $query = $this->model->selectRaw('id, name, url, created_at');\n \n if ($name = $request->input('name')) {\n $query->where('name', 'like', \"%{$name}%\");\n }\n\n return $query;\n }", "public function getHttpQuery () {\n\t\t\tif($this->httpQuery) {\n\t\t\t\treturn $this->httpQuery;\n\t\t\t}\n\t\t\t\n\t\t\treturn 'No query initiated yet';\n\t\t}", "public function getQueryString()\n {\n return $this->query_string;\n }", "protected function getQueryString(HttpRequest $request)\n\t{\n\t\treturn urldecode($request->getQueryString());\n\t}", "protected function getWhereQuery(Request $request){\n $where = [];\n foreach((array) $request->get('q', []) as $query){\n\n $q = array_filter(explode(':', $query));\n\n if(count($q) == 1){\n //worthless\n continue;\n }elseif(count($q) == 2){\n //for consistency\n $q = [$q[0], '=', $q[1]];\n }\n\n //are we allowed to filter by this field?\n if(!in_array($q[0], $this->allowedWheres)){\n continue;\n }\n\n //add like wildcards if not present\n if($q[1] == 'like' && !starts_with($q[2], '%') && !ends_with($q[2], '%')){\n $q[2] = '%' . $q[2] . '%';\n }\n $where[] = $q;\n }\n return $where;\n }", "public function getQueryParameters()\n {\n return $this->queryParameters;\n }", "public abstract function get_query();", "public function buildRequestQuery()\n\t{\n\t\t$query_string = '';\n\t\tforeach ($this->returnItems() as $index => $item) {\n\t\t\t$query_string .= '&' . $item->toQueryString($index++);\n\t\t}\n\t\treturn $query_string;\n\t}", "public function\n\tGetRequestQuery(String $Which='get'):\n\t?Array {\n\n\t\tswitch($Which) {\n\t\t\tcase 'get': {\n\t\t\t\tif(isset($_GET)) return $_GET;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'post': {\n\t\t\t\tif(isset($_POST)) return $_POST;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'request': {\n\t\t\t\tif(isset($_REQUEST)) return $_REQUEST;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn NULL;\n\t}", "public function getRequest(): Request\n {\n return Model::getRequest();\n }", "public function getSubscriptionQueryRequest()\n {\n return $this->readOneof(3);\n }", "public function getRequest()\n {\n return $this->get('request');\n }", "public function getRequest()\n {\n return $this->get('request');\n }", "public function getRequest()\n {\n return $this->get('request');\n }", "public function getRequest()\n {\n return $this->get('request');\n }", "public function get_query() {\n\t return $this->decodedWebhook['queryResult']['queryText'];\n }", "abstract protected function getQuery();", "public function getQueryString() {\n\t\t\n\t}", "public function Query(){\r\n\t\treturn self::get_query();\r\n\t}", "function request()\n {\n return Request::get();\n }", "public function queryService($request)\n {\n $runtime = new RuntimeOptions([]);\n $headers = [];\n\n return $this->queryServiceEx($request, $headers, $runtime);\n }", "protected function _getQuery()\n {\n return Mage::helper('catalogsearch')->getQuery();\n }", "public function getClientQuery(): string;", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();" ]
[ "0.7384882", "0.724216", "0.71251154", "0.71251154", "0.71251154", "0.71251154", "0.71251154", "0.71251154", "0.71251154", "0.71251154", "0.71251154", "0.7121994", "0.7076551", "0.70546365", "0.7031184", "0.7031184", "0.7029122", "0.7015735", "0.69842166", "0.69694716", "0.69671714", "0.69671714", "0.69671714", "0.69671714", "0.69671714", "0.69671714", "0.69671714", "0.69671714", "0.69671714", "0.69671714", "0.69590646", "0.6935737", "0.69282484", "0.6889861", "0.68463725", "0.6844579", "0.6829939", "0.67812675", "0.6744947", "0.67440504", "0.6739729", "0.67009187", "0.6677688", "0.666798", "0.66625595", "0.66602004", "0.6651843", "0.6651843", "0.6651843", "0.6651843", "0.6651843", "0.6651843", "0.6651843", "0.6651843", "0.6651843", "0.6628285", "0.6626629", "0.6618774", "0.6618774", "0.6618774", "0.6597818", "0.6590667", "0.6577072", "0.6567524", "0.65510947", "0.65362614", "0.6528399", "0.65129554", "0.64963603", "0.6493269", "0.6435794", "0.6381706", "0.63722277", "0.6359384", "0.6345178", "0.63441396", "0.63329095", "0.6328798", "0.6326509", "0.6319926", "0.63198465", "0.63144255", "0.63144255", "0.63144255", "0.63144255", "0.6285037", "0.6282208", "0.62757456", "0.62636715", "0.625907", "0.6246315", "0.62430996", "0.62354213", "0.62344766", "0.62344766", "0.62344766", "0.62344766", "0.62344766", "0.62344766", "0.62344766", "0.62344766" ]
0.0
-1
Gets query for [[Sensor]].
public function getSensor() { return $this->hasOne(Sensor::className(), ['SensorID' => 'SensorID']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function get_sensor_where() \n {\n $where = '';\n \n if(isset($_SESSION['_user_vision']['sensor'])) \n {\n foreach ($_SESSION['_user_vision']['sensor'] as $key => $perm) \n {\n if (preg_match(\"/^[A-F0-9]{32}$/\", $key)) \n {\n if ($where != '') \n { \n $where .= ', '; \n }\n \n $where .= \"UNHEX('$key')\";\n }\n }\n }\n \n return $where;\n }", "public function get_sensors() \n {\n return $this->sensors;\n }", "public function hasSensor()\n {\n return $this->sensor;\n }", "public function readSensor($id)\n {\n\t\t$data = $this->call(array(), \"GET\", \"sensors/\".$id.\".json\");\n\t\t$data = $data->{'sensor'};\n\t\treturn new Sensor($data, $this);\n }", "public function getQuery()\n {\n return $this->get(self::_QUERY);\n }", "public function getQUERY()\n {\n return $this->QUERY;\n }", "public function getQuery()\n {\n return $this->_data['query'];\n }", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function get_sensors() {\n\t\t//Returns true or false. Values are set in their object ($switches, $thermometers, etc)\n\t\treturn $this->_get_sensors();\t\t\n\t}", "public function getQuery()\n {\n return $this->readOneof(5);\n }", "public static function getQuery()\n {\n return self::$__query;\n }", "public function getQuery(){\n \n return $this->query;\n \n }", "public function getQuery()\n {\n return $this->readOneof(2);\n }", "public function sensorsData()\n {\n return $this->hasMany('App\\SensorsData', 'el_sensor_id'); \n }", "protected function getAccuracyQuery()\n {\n return $this->accuracyQuery;\n }", "public function getQuery()\n {\n return $this->getQ();\n }", "public abstract function getQuery();", "public function getQuery() {}", "public function getQuery() {}", "public function getQuery() {\n return $this->query;\n }", "public function getQuery() {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\r\n\t{\r\n\t\treturn $this->query;\r\n\t}", "public function getQuery() {\n return $this->query;\n }", "public function Query(){\r\n\t\treturn self::get_query();\r\n\t}", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function getQuery()\n\t{\n\t\treturn $this->query;\n\t}", "public function getAllDevice(){\n $query = \"select distinct device_id from $this->basicSensorLog_tableName\";\n $result = $this->dbh->query($query);\n if($result->rowCount() > 0){\n return $result->fetchAll();\n }\n return null;\n }", "public function getMeasurement()\n {\n return $this->db->get($this->product_measurement);\n }", "public function getQuery()\n {\n return $this->_query;\n }", "function getQuery() {\n return $this->query;\n }", "public function getQuery()\r\n {\r\n return $this->m_query;\r\n }", "public function query() {\n\t\treturn Documents::instance()->query();\n\t}", "protected function getQuery()\n {\n return self::$_query;\n }", "protected function _getQuery()\n {\n return $this->_queryFactory->get();\n }", "public function getquery(){\n\t\treturn $this->query;\n\t}", "public abstract function get_query();", "public function showSensor($roomID, $sensor = 'all')\n {\n $room = Room::where('internal_id', '=', strtoupper($roomID))->first();\n\n if (empty($room)) { return response()->json('Invalid parameter data', 400); }\n\n $data = $room->averageSensorData;\n\n if(empty($data))\n {\n return response()->json('Unable to find room.', 400);\n }\n \n switch($sensor)\n {\n case 'all':\n return response()->json(array_merge($data, ['id' => $roomID]), 200);\n\n case 'co2':\n case 'humidity':\n case 'light':\n case 'noise':\n case 'pressure':\n case 'temperature':\n case 'uv':\n case 'voc':\n return response()->json([\n 'id' => $roomID,\n 'type' => $sensor,\n 'value' => $data[$sensor],\n ], 200);\n\n default:\n return response()->json(\"No sensor found\", 400);\n }\n }", "public static function get_query()\n\t{\n\t\treturn self::new_instance_records()->get_query();\n\t}", "public function getQuery(): string\r\n {\r\n return $this->query;\r\n }", "function getQuery() ;", "public function query(Smartphone $smartphone)\n {\n return $smartphone->newQuery();\n }", "public function get() {\n\t\treturn $this->query;\n\t}", "public function query()\n {\n return Topic::query();\n }", "public function getQuery(): string\n {\n return $this->query;\n }", "public function getQuery(): string\n {\n return $this->query;\n }", "public function getQuery(): string\n {\n return $this->query;\n }", "public function getInstanceQuery()\n {\n return $this->get(self::_INSTANCE_QUERY);\n }", "function getSearchEngineQuery() {\n\t\treturn $this->_searchEngineQuery;\n\t}", "public function getQuery()\n {\n /* Return self->query */\n return $this->query;\n }", "public function voicePlatformQuery()\n\t{\n\t\t$data = array('communique' => Zend_Json::encode(array('voice' => 1)));\n\t\t\n\t\t// initiate curl session\n\t\t$ch = curl_init();\n\t\t\n\t\t$queryArrUrl = Zend_Registry::get('config')->voice->platform->base->url . '/rest/query.php';\n\t\t\n\t\t// url for curl\n\t\tcurl_setopt($ch, CURLOPT_URL, $queryArrUrl);\n\t\t// return with result on success\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t// using POST and not GET\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\t// POST data\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\t\t\n\t\t// get wave file a.k.a communique\n\t\t$result = curl_exec($ch);\n\t\t\n\t\t$resultInArr = Zend_Json::decode($result);\n\t\t$httpRspCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\t\t\n\t\tcurl_close($ch);\n\t\t\n\t\tif ($resultInArr['status'] == 'FAIL'){\n\t\t\t$message = $status['message'];\n\t\t\t\n\t\t\tthrow new Exception('Voice Platform Query Error: ' . $message, $httpRspCode);\n\t\t}\n\t\telse{\n\t\t\t$urlString = $resultInArr['voice'][0]; // retrieve only one url string\n\t\t\t\n\t\t\treturn array($urlString, $resultInArr['voice']);\n\t\t}\n\t}", "public function listConnectedSensors( $sensorID)\n {\n\t\t$data = $this->call(array(), \"GET\", \"sensors/\".$sensorID.\"/sensors.json\");\n\t\t$data = $data->{'sensors'};\n\t\t$sensorArray = new ArrayObject();\n\t\tfor($i = 0; $i<count($data);$i++){\n\t\t\t$sensorArray->append(new Sensor($data[$i], $this));\n\t\t}\n\t\treturn $sensorArray;\n }", "public function getType(): string\n {\n return Client::QUERY_ANALYSIS_FIELD;\n }", "public function getQuery()\n {\n return isset($this->query) ? $this->query : null;\n }", "public function query()\n {\n return $this->_query;\n }", "public function query() {\n // Leave empty to avoid a query on this field.\n }", "function getAllSensors() {\n $sens = shell_exec(\"tdtool --list-sensors\");\n\n //turn raw result into array\n $sensorlist = array();\n preg_match_all('/type=(?<type>\\w+)\\tprotocol=(?<protocol>\\w+)\\tmodel=(?<model>\\w+)\\tid=(?<id>\\d+)\\ttemperature=(?<temperature>[\\d\\.]+)(|\\thumidity=(?<humidity>[\\d\\.]+))\\ttime=(?<time>[\\d-\\s:]+)\\tage=(?<age>\\d+)/', $sens, $matches);\n for ($x = 0; $x < count($matches[0]); $x++) {\n $sensorlist[] = array(\"type\" => $matches[\"type\"][$x], \"protocol\" => $matches[\"protocol\"][$x], \"id\" => $matches[\"id\"][$x], \"temperature\" => $matches[\"temperature\"][$x], \"humidity\" => $matches[\"humidity\"][$x], \"time\" => $matches[\"time\"][$x], \"age\" => $matches[\"age\"][$x]);\n }\n return $sensorlist;\n}", "public function get_query() {\n\t return $this->decodedWebhook['queryResult']['queryText'];\n }", "public function getQuery ($entity);", "public function getEndpoint() {\n\t\treturn \"http://vamps.tw.rpi.edu/virtuoso/sparql\";\n\t}", "public final function getQuery() {\n return $this->queryString;\n }", "public function getQueryAnalysis()\n {\n foreach ($this->items as $item) {\n if ('query' == $item->getName()) {\n return $item;\n }\n }\n }", "public function getQuery(): string\n {\n return (string) $this->query;\n }", "public static function latestMeasurement($where) {\n if (is_numeric($where)) $where = [ 'station_id' => $where ];\n if (is_object($where)) $where = [ 'station_id' => $where->{static::primaryKey()} ];\n foreach ($where as $key => $value) $wheres[] = '`' . $key . '` = ?';\n return Database::query('SELECT * FROM `measurements` WHERE ' . implode(' AND ', $wheres) . ' ORDER BY `created_at` DESC LIMIT 1', ...array_values($where));\n }", "public function getQueryLog() {\n return $this->_log_query;\n }", "public function data() {\n\t\treturn $this->query;\n\t}", "public function sensorReading($sensorId)\n {\n //date_default_timezone_set(\"Europe/London\");\n $date = new DateTime(date(\"Y-m-d\"));\n\n $today = str_replace(\"+\",\".000+\", $date->format(DateTime::ATOM));\n $this_record = MongoSensorData::where('sensor_id', '=', floatval($sensorId))\n ->where('recordDay', '=', new DateTime($today))->first();\n\n $device = Device::where('sensor_id', '=', floatval($sensorId))->first();\n\n $datapoints = $device->data_points;\n $reading = array();\n foreach ($datapoints as $datapoint){\n\n if($this_record){\n if(isset($this_record->dataSamples[$this_record->nSample - 1][$datapoint['point']])){\n $sensor_reading = round($this_record->dataSamples[$this_record->nSample - 1][$datapoint['point']], 2);\n }\n else{\n $sensor_reading = 0;\n }\n\n }\n else{\n $sensor_reading = -1.00;\n }\n $reading[] = ['datapoint' => $datapoint, 'reading' => $sensor_reading];\n }\n return $reading;\n }", "public function getQuery()\n {\n return $this->getOption('query');\n }", "public function getQuery(): array;", "public function where()\n {\n return $this->query; \n }", "private function getQuery()\n {\n return $this->connection->table($this->table);\n }", "public function getConfigSOQL() {\n return $this->config['SOQL'];\n }", "public static function query();", "public function query() {\n\t\treturn SalesHistoryQuery::create();\n\t}", "public function getElasticaQuery()\n {\n return $this->elasticaQuery;\n }" ]
[ "0.6281533", "0.6261696", "0.5963424", "0.5901681", "0.5731769", "0.56952703", "0.5659533", "0.56515735", "0.56515735", "0.56515735", "0.56515735", "0.56515735", "0.56515735", "0.56515735", "0.56515735", "0.56515735", "0.5634848", "0.5566336", "0.55352694", "0.5530298", "0.550118", "0.548378", "0.54463387", "0.5437799", "0.5422377", "0.54185903", "0.54185903", "0.5413722", "0.5394193", "0.53845006", "0.53845006", "0.53845006", "0.53845006", "0.53845006", "0.53845006", "0.53845006", "0.53845006", "0.53845006", "0.53845006", "0.5366563", "0.53612036", "0.53581923", "0.5352066", "0.5352066", "0.5352066", "0.5352066", "0.5352066", "0.5352066", "0.5352066", "0.5352066", "0.5352066", "0.5347387", "0.53448546", "0.53434306", "0.53411216", "0.5338016", "0.5309343", "0.5302698", "0.5299959", "0.5262497", "0.52589154", "0.5256647", "0.5252199", "0.5209513", "0.520812", "0.51972324", "0.51771986", "0.51747906", "0.5174202", "0.51720864", "0.51720864", "0.51720864", "0.5171197", "0.51561946", "0.51508033", "0.51321185", "0.51257473", "0.51117426", "0.510831", "0.51007116", "0.50916314", "0.50567687", "0.5053257", "0.50490487", "0.501886", "0.5017776", "0.501364", "0.5012591", "0.5012321", "0.50100523", "0.5008993", "0.5001136", "0.49973577", "0.49925068", "0.49905974", "0.4986128", "0.49739406", "0.4968586", "0.49660257", "0.4952097" ]
0.6524615
0
Declare the js and css files.
public static function loadStrapper() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addAssets()\n {\n $this->addJs('../../graphreport/assets/d3.js');\n $this->addJs('../../graphreport/assets/c3.js');\n $this->addCss('../../graphreport/assets/c3.css'); \n }", "private function __register_scripts() {\n\t\t// Load all the registered scripts\n\t\t$assets_loader = new SwpmvcAssetsLoader();\n\t\t$assets = $assets_loader->fn_load_scripts();\n\n\t\t//Extract CSS Assets and put them into Registered CSS Container\n\t\t$this->registered_css = $assets[ 'css' ];\n\n\t\t//Extract JS Assets and put them into Registered JS Container\n\t\t$this->registered_js = $assets[ 'js' ];\n\n\t\t//Some cleanup\n\t\tunset($assets_loader);\n\t\tunset($assets);\n\n\t\t//Load all the common CSS and JS which will be required for all the pages.\n\t\t$this->fn_load_scripts();\n\t}", "static function include_scripts(){\n\t\t//self::include_css();\n\t\tself::include_js();\n\t}", "protected function addAssets(): void\n {\n $this->enqueue('assets/dashifen-2022.js');\n $font1 = $this->enqueue('//fonts.googleapis.com/css2?family=El+Messiri&display=swap');\n $font2 = $this->enqueue('//fonts.googleapis.com/css2?family=Roboto&display=swap');\n $css = $this->enqueue('assets/dashifen-2022.css', [$font1, $font2]);\n \n $dir = trailingslashit($this->getStylesheetDir());\n if (file_exists($dir . 'assets/dashifen-2022-components.css')) {\n $this->enqueue('assets/dashifen-2022-components.css', [$css]);\n }\n }", "public function DefineJsResources()\n {\n $this->carabiner->js('https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js');\n $this->carabiner->js('https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js');\n $this->carabiner->js('https://cdn.jsdelivr.net/npm/chart.js@2.9.3/dist/Chart.min.js');\n // an array of arrays\n $this->carabiner->js(array(\n array('assets/js/Chart.min.js'),\n array('assets/js/Chart.bundle.min.js'),\n array('assets/js/jquery.js')\n ));\n }", "public function addDependencies()\n {\n $this->Html->script('/attachments/js/vendor/jquery.ui.widget.js', ['block' => true]);\n $this->Html->script('/attachments/js/vendor/jquery.iframe-transport.js', ['block' => true]);\n $this->Html->script('/attachments/js/vendor/jquery.fileupload.js', ['block' => true]);\n $this->Html->script('/attachments/js/app/lib/AttachmentsWidget.js', ['block' => true]);\n $this->Html->css('/attachments/css/attachments.css', ['block' => true]);\n }", "public function loadConfigAssets()\r\n {\r\n $this->app->document->addScript('elements:imagebox/assets/js/myimage.js');\r\n $this->app->document->addStylesheet('elements:imagebox/assets/css/editoption.css');\r\n $this->app->document->addScript('elements:imagebox/assets/js/myoption.js');\r\n $this->app->document->addStylesheet('elements:option/option.css');\r\n }", "static function enqueue_scripts(){\n\t\tself::include_css();\n\t\tself::include_js();\n\t}", "public function initialize_scripts_and_styles() {\n\t\tTypes_Asset_Manager::get_instance();\n\t}", "public function includeAssets()\n {\n $this->Html->script('CkTools.vendor/tinymce/jquery.tinymce.min.js', ['block' => true]);\n $this->Html->script('CkTools.vendor/moxiemanager/js/moxman.loader.min.js', ['block' => true]);\n }", "function add_css_js()\n\t{\n\t\tif (!defined('CSS_JS_PARSED'))\n\t\t{\n\t\t\tdefine('CSS_JS_PARSED', true);\n\t\t}\n\n\t\t// Include custom CSS from templates/CURRENT_TPL folder\n\t\tif(is_array($this->css_style_include) && !empty($this->css_style_include))\n\t\t{\n\t\t\tfor ($i = 0; $i < sizeof($this->css_style_include); $i++)\n\t\t\t{\n\t\t\t\t$this->assign_block_vars('css_style_include', array(\n\t\t\t\t\t'CSS_FILE' => $this->css_style_include[$i],\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Include custom CSS from templates/common folder\n\t\tif(is_array($this->css_include) && !empty($this->css_include))\n\t\t{\n\t\t\tfor ($i = 0; $i < sizeof($this->css_include); $i++)\n\t\t\t{\n\t\t\t\t$this->assign_block_vars('css_include', array(\n\t\t\t\t\t'CSS_FILE' => $this->css_include[$i],\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Include custom JS from templates/common folder\n\t\tif(is_array($this->js_include) && !empty($this->js_include))\n\t\t{\n\t\t\tfor ($i = 0; $i < sizeof($this->js_include); $i++)\n\t\t\t{\n\t\t\t\t$this->assign_block_vars('js_include', array(\n\t\t\t\t\t'JS_FILE' => $this->js_include[$i],\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "public function setup_scripts_and_styles() {\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'enqueue_discogs_css' ), 50 );\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'enqueue_discogs_js' ), 10 );\n\t}", "public function frontEndStyleScripts(): void\n {\n wp_enqueue_style('users-data-bootstrap', plugin_dir_url(dirname(__FILE__)) . 'assets/css/bootstrap.min.css', [], UsersListing::getVersion());\n wp_enqueue_style('users-data-fontawsome', plugin_dir_url(dirname(__FILE__)) . 'assets/css/font-awesome.min.css', [], UsersListing::getVersion());\n wp_enqueue_style('users-data-styles', plugin_dir_url(dirname(__FILE__)) . 'assets/css/users-data.css', [], UsersListing::getVersion());\n //\n wp_enqueue_script('jquery-min', plugin_dir_url(dirname(__FILE__)) . 'assets/js/jquery.min.js', ['jquery'], UsersListing::getVersion(), false);\n wp_enqueue_script('jquery-popper', plugin_dir_url(dirname(__FILE__)) . 'assets/js/popper.min.js', ['jquery'], UsersListing::getVersion(), false);\n wp_enqueue_script('bootstrap-min', plugin_dir_url(dirname(__FILE__)) . 'assets/js/bootstrap.min.js', ['jquery'], UsersListing::getVersion(), false);\n }", "function assets(){\n\t\t\twp_enqueue_style( 'sp-2020-styles', get_template_directory_uri() .'/assets/css/main.css', array(), SPUTZNIK_2020_THEME_VERSION );\n\t\t\twp_enqueue_script( 'sp-2020-js', get_template_directory_uri() . '/assets/js/main.js', array('jquery'), SPUTZNIK_2020_THEME_VERSION, true );\n\n\t\t}", "public function loadScripts() {\n $graphcss = $this->getProperty('graphcss');\n $customcss = $this->getProperty('customcss');\n $loadjquery = $this->getProperty('loadjquery');\n\n $cssUrl = $this->sekug->config['cssUrl'].'web/';\n $jsUrl = $this->sekug->config['jsUrl'].'web/';\n\n if($loadjquery == 1){\n $this->modx->regClientStartupScript($jsUrl.'libs/'.$this->sekug->config['jqueryFile']);\n }\n if($customcss>''){\n $this->modx->regClientCSS($this->modx->getOption('assets_url').$customcss);\n } else {\n $this->modx->regClientCSS($cssUrl.'gallery.structure.css');\n }\n if($graphcss>''){\n $this->modx->regClientCSS($this->modx->getOption('assets_url').$graphcss);\n } else {\n $this->modx->regClientCSS($cssUrl.'directory.graph.css');\n }\n }", "private function _initJsCss(){\n\t\t$cs = Yii::app()->clientScript;\n\t\t$cs->registerCssFile(Yii::app()->baseUrl . '/css/admin/admin.css');\n\n\t}", "private function register_scripts_and_styles()\n\t\t\t{\n\n\t\t\t\tif( is_admin() )\n\t\t\t\t{\n\n\t\t \t\t//$this->load_file('friendly_widgets_admin_js', '/themes/'.THEMENAME.'/admin/js/widgets.js', true);\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{ \n\n\t\t \t\t//$this->load_file('friendly_widgets', '/themes/'.THEMENAME.'/theme_assets/js/widgets.js', true);\n\n\t\t\t\t}\n\n\t\t\t}", "private function register_scripts_and_styles()\n\t\t\t{\n\n\t\t\t\tif( is_admin() )\n\t\t\t\t{\n\n\t\t \t\t//$this->load_file('friendly_widgets_admin_js', '/themes/'.THEMENAME.'/admin/js/widgets.js', true);\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{ \n\n\t\t \t\t//$this->load_file('friendly_widgets', '/themes/'.THEMENAME.'/theme_assets/js/widgets.js', true);\n\n\t\t\t\t}\n\n\t\t\t}", "protected function addJS() {\n foreach ($this->js_files as $js_file) {\n $this->header.=\"<script type='text/javascript' src='\" . __ASSETS_PATH . \"/\" . $js_file . \"'></script> \\n\";\n }\n }", "protected function renderJavaScriptAndCss() {}", "public function loadAssets() {\r\n\t\tparent::loadAssets();\r\n\t\t$this->app->document->addScript('elements:download/assets/js/download.js');\r\n\t}", "function addScriptResources()\t{\n\t\tif (t3lib_extMgm::isLoaded('t3jquery')) {\n\t\t\trequire_once(t3lib_extMgm::extPath('t3jquery').'class.tx_t3jquery.php');\n\t\t}\n\n\t\t// checks if t3jquery is loaded\n\t\tif (T3JQUERY === TRUE) {\n\t\t\ttx_t3jquery::addJqJS();\n\t\t} else {\n\t\t\tif($this->conf['jQueryRes']) $this->jsFile[] = $this->conf['jQueryRes'];\n\t\t\tif($this->conf['tooltipJSRes']) $this->jsFile[] = $this->conf['tooltipJSRes'];\n\t\t}\n\n\t\t// Fix moveJsFromHeaderToFooter (add all scripts to the footer)\n\t\tif ($GLOBALS['TSFE']->config['config']['moveJsFromHeaderToFooter']) {\n\t\t\t$allJsInFooter = TRUE;\n\t\t} else {\n\t\t\t$allJsInFooter = FALSE;\n\t\t}\n\n\t\t$pagerender = $GLOBALS['TSFE']->getPageRenderer();\n\t\t\n\t\t// add all defined JS files\n\t\tif (count($this->jsFile) > 0) {\n\t\t\tforeach ($this->jsFile as $jsToLoad) {\n\t\t\t\tif (T3JQUERY === TRUE) {\n\t\t\t\t\t$conf = array(\n\t\t\t\t\t\t'jsfile' => $jsToLoad,\n\t\t\t\t\t\t'tofooter' => ($this->conf['jsInFooter'] || $allJsInFooter),\n\t\t\t\t\t\t'jsminify' => $this->conf['jsMinify'],\n\t\t\t\t\t);\n\t\t\t\t\ttx_t3jquery::addJS('', $conf);\n\t\t\t\t} else {\n\t\t\t\t\t$file = $GLOBALS['TSFE']->tmpl->getFileName($jsToLoad);\n\t\t\t\t\tif ($file) {\n\t\t\t\t\t\tif ($allJsInFooter) {\n\t\t\t\t\t\t\t$pagerender->addJsFooterFile($file, 'text/javascript', $this->conf['jsMinify']);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$pagerender->addJsFile($file, 'text/javascript', $this->conf['jsMinify']);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tt3lib_div::devLog(\"'{\".$jsToLoad.\"}' does not exists!\", $this->extKey, 2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// add defined CSS file\n\t\tif($this->conf['cssFile']) {\n\t\t\t// Add script only once\n\t\t\t$css = $GLOBALS['TSFE']->tmpl->getFileName($this->conf['cssFile']);\n\t\t\tif ($css) {\n\t\t\t\t$pagerender->addCssFile($css, 'stylesheet', 'all', '', $this->conf['cssMinify']);\n\t\t\t} else {\n\t\t\t\tt3lib_div::devLog(\"'{\".$this->conf['cssFile'].\"}' does not exists!\", $this->extKey, 2);\n\t\t\t}\n\t\t}\n\t}", "protected function setupAssetsInfo() {\n JQuery::registerJQuery();\n $this->addAssetInfo(\n array(\"js/jquery.cookie.js\" ),\n $this->getCommonAssetDir()\n );\n $this->addAssetInfo(\n \"smartScrollPane.css\",\n dirname(__FILE__) . \"/assets\"\n );\n }", "public function register_assets() {\n $js_folder = SD_PLUGIN_PATH . '/src/assets/js/';\n $css_folder = SD_PLUGIN_PATH . '/src/assets/css/';\n $scripts = scandir($js_folder);\n //var_dump($scripts);\n $styles = scandir($css_folder);\n foreach ($styles as $style) {\n if( !is_dir($style) ) {\n wp_enqueue_style( URL_SCOPE . mt_rand(0, 9000), '/wp-content/plugins/'.sanitize_key(PLUGIN_NAME).'/src/assets/css/' . $style);\n }\n }\n foreach ($scripts as $script) {\n if( !is_dir($script) ) {\n wp_enqueue_script( URL_SCOPE . mt_rand(0, 9000), '/wp-content/plugins/'.sanitize_key(PLUGIN_NAME).'/src/assets/js/' . $script);\n }\n }\n }", "public function loadAssets(): void\n {\n $this->printStyle('//resource.css', 'print_resource_page_assets');\n }", "function addJSFiles()\n\t{\n\t\t\t\t$this->getContainer()->AddJSFile(\"include/zoombox/zoombox.js\");\n\t\t$this->getJSControl();\t\n\t}", "protected function setupAssetsInfo() {\n JQuery::registerJQuery();\n $this->addYiiGemsCommonCss();\n $this->addFontAwesomeCss();\n $this->addAssetInfo( \"buttonBar.css\", dirname(__FILE__) . \"/assets\" );\n $this->addGradientAssets(array(\n $this->gradient, $this->hoverGradient,\n $this->activeGradient, $this->selectedGradient,\n $this->separatorGradient, $this->selectedColor\n ));\n }", "public function includeAssets(): void\n {\n $this->Html->script('CkTools.vendor/tinymce/jquery.tinymce.min.js', ['block' => true]);\n }", "public function addJavascriptFiles($js /* array */);", "public function loadAssets() {\r\n\t\t$this->app->document->addScript('elements:relateditems/relateditems.js');\r\n\t}", "function Define_Resources() : void\n {\n for($i = 0;$i < count($this->Scripts);$i++)\n {\n if($this->Scripts[$i] instanceof stdClass)\n {\n wp_enqueue_script($this->Scripts[$i]->Handle,$this->Scripts[$i]->Src,$this->Scripts[$i]->Deps,$this->Scripts[$i]->Ver,$this->Scripts[$i]->InFooter);\n }\n }\n for($i = 0;$i < count($this->Styles);$i++)\n {\n if($this->Styles[$i] instanceof stdClass)\n {\n wp_enqueue_style($this->Styles[$i]->Handle,$this->Styles[$i]->Src,$this->Styles[$i]->Deps,$this->Styles[$i]->Ver,$this->Styles[$i]->Media);\n }\n }\n }", "public function enqueue_scripts() {\n\t\t$this->styles();\n\t\t$this->scripts();\n\t}", "private function fn_load_scripts() {\n\n\t\t/**\n\t\t * Load Common CSS and JS for a blank Page\n\t\t */\n\n\t\t$fixed_version = $this->fixed_version;\n\t\t$common_css_version = '0.3';\n\t\t$common_js_version = '0.1';\n\t\t$custom_css_version = '0.4';\n\t\t$custom_js_version = '0.4';\n\n\t\t$registered_styles = $this->registered_css;\n\t\t$registered_scripts = $this->registered_js;\n\n\t\t/**\n\t\t * Load CSS--------------------------------------------------------------\n\t\t */\n\n /** Load Google Fonts */\n\t\t$this->google_fonts['google_opensans'] = $registered_styles['google_opensans'];\n\n\t\t/** Load CSS Assets @todo Move the components in their containers */\n\t\t\n\t\t$this->css_assets['bootstrap'] = $registered_styles['bootstrap'].\"?ver=\".$fixed_version;\n\t\t$this->css_assets['fontawesome'] = $registered_styles['fontawesome'].\"?ver=\".$fixed_version;\n\t\t\n\t\t/**\n\t\t * Load JS--------------------------------------------------------------\n\t\t */\n\t\t\n\t\t/** Load footer js **/\n\t\t$this->footer_js['jquery'] = $registered_scripts['jquery'].\"?ver=\".$fixed_version;\t\t\n\t\t$this->footer_js['jquery-ui'] = $registered_scripts['jquery-ui'].\"?ver=\".$fixed_version;\n\n\t\t$this->footer_js['bootstrap'] = $registered_scripts['bootstrap'].\"?ver=\".$fixed_version;\n\t\t/**let other controllers load their own css/js files **/\n\t}", "protected function assets()\n {\n $output = [];\n if (!file_exists($this->config['build'] . 'node_modules')) {\n putenv('PATH=' . trim(shell_exec('echo $PATH')) . ':' . dirname(MODX_BASE_PATH) . '/');\n if (file_exists($this->config['build'] . 'package.json')) {\n $this->modx->log(modX::LOG_LEVEL_INFO, 'Trying to install or update nodejs dependencies');\n $output = [\n shell_exec('cd ' . $this->config['build'] . ' && npm config set scripts-prepend-node-path true && npm install'),\n ];\n }\n if (file_exists($this->config['build'] . 'gulpfile.js')) {\n $output = array_merge($output, [\n shell_exec('cd ' . $this->config['build'] . ' && npm link gulp'),\n shell_exec('cd ' . $this->config['build'] . ' && gulp copy'),\n ]);\n }\n if ($output) {\n $this->modx->log(xPDO::LOG_LEVEL_INFO, implode(\"\\n\", array_map('trim', $output)));\n }\n }\n if (file_exists($this->config['build'] . 'gulpfile.js')) {\n $output = shell_exec('cd ' . $this->config['build'] . ' && gulp default 2>&1');\n $this->modx->log(xPDO::LOG_LEVEL_INFO, 'Compile scripts and styles ' . trim($output));\n }\n }", "public function init()\n\t{\n//\t\t$this->js[] = YII_DEBUG ? 'js/jquery.Jcrop.js' : 'js/jquery.Jcrop.min.js';\n $this->css[]=\"css/imgareaselect-animated.css\";\n $this->css[]=\"css/imagestyle.css\";\n\n $this->js[]=\"js/script.js\";\n $this->js[]=\"js/jquery.imgareaselect.pack.js\";\n $this->js[]=\"//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js\";\n \n \n // $this->js[]=\"js/myjs.js\";\n \n\t\n\t}", "function addCSSFiles()\n\t{\n\t\t$this->getContainer()->AddCSSFile(\"include/zoombox/zoombox.css\");\n\t}", "function load_js_css() {\n\n\t\t\twp_register_script( 'fontawesome-all', get_stylesheet_directory_uri() . '/js/fontawesome-all.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'owl', get_stylesheet_directory_uri() . '/js/owl.carousel.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'selectric', get_stylesheet_directory_uri() . '/js/jquery.selectric.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'select', get_stylesheet_directory_uri() . '/js/select.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'jquery-ui', get_stylesheet_directory_uri() . '/js/jquery-ui.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'tab_menu', get_stylesheet_directory_uri() . '/js/tab_menu.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'aos', get_stylesheet_directory_uri() . '/js/aos.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'rangeslider', get_stylesheet_directory_uri() . '/js/rangeslider.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'bootstrap', get_stylesheet_directory_uri() . '/js/bootstrap.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'easymap', get_stylesheet_directory_uri() . '/js/easymap.plugin.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'markerclusterer', get_stylesheet_directory_uri() . '/js/markerclusterer.min.js', array(), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'customscrollbar', get_stylesheet_directory_uri() . '/js/jquery.mCustomScrollbar.concat.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'ddslick', get_stylesheet_directory_uri() . '/js/jquery.ddslick.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'project045-main', get_stylesheet_directory_uri() . '/js/main.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\n\t\t\twp_enqueue_script( 'fontawesome-all' );\n\t\t\twp_enqueue_script( 'owl' );\n\t\t\twp_enqueue_script( 'selectric' );\n\t\t\twp_enqueue_script( 'select' );\n\t\t\twp_enqueue_script( 'jquery-ui' );\n\t\t\twp_enqueue_script( 'tab_menu' );\n\t\t\twp_enqueue_script( 'aos' );\n\t\t\twp_enqueue_script( 'rangeslider' );\n\t\t\twp_enqueue_script( 'bootstrap' );\n\t\t\twp_enqueue_script( 'easymap' );\n\t\t\twp_enqueue_script( 'markerclusterer' );\n\t\t\twp_enqueue_script( 'customscrollbar' );\n\t\t\twp_enqueue_script( 'ddslick' );\n\t\t\twp_enqueue_script( 'project045-main' );\n\n\t\t}", "protected function setupAssetsInfo() {\n JQuery::registerJQuery();\n $this->addYiiGemsCommonCss();\n $this->addFontAwesomeCss();\n $this->addAssetInfo(\n array( \"$this->style.css\", \"faq.js\"),\n dirname(__FILE__) . \"/assets\"\n );\n $this->addGradientAssets($this->gradient);\n }", "public function DefineCssResources()\n {\n $this->carabiner->css(array(\n array('assets/css/libs/bootstrap.css'),\n array('assets/css/views/normalize.css'),\n array('assets/css/libs/Chart.min.css')\n ));\n }", "function theme_files() {\n \n wp_register_style('style', get_template_directory_uri() . '/dist/app.css', [], 1, 'all');\n wp_enqueue_style('style');\n\n wp_enqueue_script('jquery');\n\n wp_register_script('app', get_template_directory_uri() . '/dist/app.js', ['jquery'], 1, true);\n wp_enqueue_script('app');\n}", "private function register_files() {\n\t\tif( $this->type === self::STYLE ) {\n\t\t\twp_register_style( $this->handle, $this->src, $this->settings['deps'], $this->settings['vers'], $this->settings['media'] );\n\t\t} else if ( $this->type === self::SCRIPT ) {\n\t\t\twp_register_script( $this->handle, $this->src, $this->settings['deps'], $this->settings['vers'], $this->settings['in_footer'] );\n\t\t}\n\t}", "function dw_schemas_add_assets() {\n\twp_enqueue_script('schemas-admin-js', '/wp-content/plugins/dw_schemas/assets/scripts.js');\n\twp_enqueue_style('schemas-admin-css', '/wp-content/plugins/dw_schemas/assets/styles.css');\n}", "protected function addSystemCssJs()\n\t{\n\t\tglobal $cWebPath;\n\t\t\t\t\n\t\t$this->mStyles[] = $cWebPath . '/style/mainstyle.css';\n\t\t$this->mStyles[] = $cWebPath . '/style/svwp_style.css';\n\t\t\n\t\t$this->mScripts[] = $cWebPath . '/scripts/jquery.slideViewerPro.1.5.js';\n\t\t$this->mScripts[] = $cWebPath . '/scripts/jquery.timers-1.2.js';\n\t\t$this->mScripts[] = $cWebPath . '/scripts/imageslider.js';\n\t}", "public function addRessources()\n {\n // $this->context->controller->addCss(($this->_path . '/views/css/tab.css'), 'all');\n // $this->context->controller->addJquery();\n // $this->context->controller->addJS(($this->_path . '/views/js/script.js'));\n // $this->context->controller->addJS(($this->_path . '/views/js/configuration.js'));\n }", "public function add_scripts_and_styles()\n {\n // Estilos css \n wp_register_style( 'wiAjustesStyles', WI_PLUGIN_URL . '/style.css', null, WI_VERSION );\n wp_enqueue_style( 'wiAjustesStyles' );\n\n // Scripts de javascript\n wp_enqueue_script('wiAjustesStylesJs', WI_PLUGIN_URL . '/script.js' , array('jquery'));\n }", "protected function setupAssetsInfo() {\n JQuery::registerJQuery();\n if ($this->iconClass) {\n $this->addAssetInfo(\n \"font-awesome.css\", \n $this->getCommonAssetDir()\n );\n }\n \n $this->addAssetInfo(\n \"titleHeader.css\",\n dirname(__FILE__) . \"/assets\"\n );\n }", "function include_css_js_files()\n{\n\twp_register_style('css_file1','https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css');\n\twp_enqueue_style('css_file1');\n\n\n\twp_register_script('js_file1','https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js');\n\twp_enqueue_script('js_file1');\n\twp_register_script('js_file2','https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js');\n\twp_enqueue_script('js_file2');\n\twp_register_script('js_file3','https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js');\n\twp_enqueue_script('js_file3');\n\n}", "public function js_css_public(){\n\n wp_enqueue_style('asRange', plugin_dir_url(__FILE__). 'libs/assets/css/asRange.min.css', false, $this->version());\n wp_enqueue_style('select2', plugin_dir_url(__FILE__). 'libs/assets/css/select2.min.css', false, $this->version());\n wp_enqueue_style('flatpickr', plugin_dir_url(__FILE__). 'libs/assets/css/flatpickr.min.css', false, $this->version());\n wp_enqueue_style('metform-ui', plugin_dir_url(__FILE__). 'libs/assets/css/metform-ui.css', false, $this->version());\n wp_enqueue_style('font-awesome', plugin_dir_url(__FILE__). 'libs/assets/css/font-awesome.min.css', false, $this->version());\n wp_enqueue_style('metform-style', plugin_dir_url(__FILE__). 'libs/assets/css/style.css', false, $this->version());\n \n wp_enqueue_script('asRange', plugin_dir_url(__FILE__) . 'libs/assets/js/jquery-asRange.min.js', array(), $this->version(), true);\n wp_enqueue_script('select2', plugin_dir_url(__FILE__) . 'libs/assets/js/select2.min.js', array(), $this->version(), true);\n wp_enqueue_script('flatpickr', plugin_dir_url(__FILE__) . 'libs/assets/js/flatpickr.js', array(), $this->version(), true);\n \n wp_register_script('recaptcha', 'https://www.google.com/recaptcha/api.js?onload=onloadMetFormCallback&render=explicit', array(), $this->version(), true);\n wp_enqueue_script('metform-submission', plugin_dir_url(__FILE__) . 'libs/assets/js/submission.js', array(), $this->version(), true);\n \n\n }", "public function registerScripts() {\r\n\t\t$baseUrl = Yii::app()->assetManager->publish(dirname(__FILE__).\"/assets/\".__CLASS__);\r\n\t\tYii::app()->clientScript->registerScriptFile($baseUrl.\"/AFileBrowser.js\");\r\n\t\t\r\n\t}", "public function register_assets() {\n\n $scripts = $this->get_scripts();\n $styles = $this->get_styles();\n\n foreach ( $scripts as $handle => $script ) {\n $deps = isset( $script['deps'] ) ? $script['deps'] : false;\n\n wp_register_script( $handle, $script['src'], $deps, $script['version'], true );\n }\n\n foreach ( $styles as $handle => $style ) {\n $deps = isset( $style['deps'] ) ? $style['deps'] : false;\n\n wp_register_style( $handle, $style['src'], $deps, $style['version'] );\n }\n\n wp_localize_script( 'cbxcf-scripts', 'cbxcfObj', [\n 'ajaxurl' => admin_url( 'admin-ajax.php' ),\n 'error' => __( 'Something went wrong', 'cbxcustomform' ),\n ] );\n\n }", "public function prepareHead() {\r\n // add jQuery\r\n if($this->cdn_jquery) {\r\n $this->addJS('//code.jquery.com/jquery-2.1.0.min.js', true);\r\n $this->addJS('//code.jquery.com/jquery-migrate-1.2.1.min.js', true);\r\n } else {\r\n $this->addJS(array('jquery-2.1.0.min', 'jquery-migrate-1.2.1.min'));\r\n }\r\n // add bootstrap\r\n if($this->cdn_bootstrap) {\r\n $this->addCSS('//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css', true);\r\n $this->addJS('//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js', true);\r\n } else {\r\n $this->addCSS('bootstrap.min');\r\n $this->addJS('bootstrap.min');\r\n }\r\n \r\n $this->addCSS(array('bootstrap-switch.min', 'spectrum'));\r\n $this->addJS(array('plugins'));\r\n \r\n // ace code editor\r\n $this->addJS('libs/ace/ace.js', true);\r\n \r\n $this->addCSS('style');\r\n $this->addJS('script');\r\n \r\n $this->smarty->assign(array(\r\n 'title' => $this->title,\r\n 'css_files' => $this->css_files,\r\n 'js_files' => $this->js_files,\r\n ));\r\n }", "public function setMedia()\n {\n $loadLibrary = false;\n\n if ($loadLibrary)\n {\n $activeTheme = $this->theme->active();\n $casset = \\Config::get('lb.theme.use_casset');\n $casset and \\Casset::add_path('theme', $activeTheme['asset_base']);\n \n \\Lb\\Backend::addAsset(array(\n 'jquery.min.js',\n 'jquery-ui.min.js',\n ), 'js', 'js_core', $this->theme, $casset);\n \n \\Lb\\Backend::addAsset(array(\n 'bootstrap/css/bootstrap.css',\n 'bootstrap/css/bootstrap-glyphicons.css',\n ), 'css', 'css_plugin', $this->theme, $casset);\n\n \\Lb\\Backend::addAsset(array(\n 'bootstrap.js',\n ), 'js', 'js_core', $this->theme, $casset);\n \n \\Lb\\Backend::addAsset(array(\n 'font-awesome/css/font-awesome.css',\n ), 'css', 'css_plugin', $this->theme, $casset);\n }\n }", "public function initialize () {\n PageLayout::addStylesheet($this->assets . 'styles.css');\n $this->addScript('script.js');\n }", "private function setup_assets() {\n\t\t$this->prefix = sanitize_title($this->theme_name) . '-';\n\t\t$public_lib = '/lib/pub/';\n\t\t$source_lib = '/lib/src/';\n\n\t\t//IF WP DEBUG Is ON, load source maps and assets\n\t\tif (constant(\"WP_DEBUG\") === true) {\n\t\t\t//Style Resources\n\t\t\t$this->styles[] = array(\n\t\t\t\t'slug' => $this->prefix . 'styles',\n\t\t\t\t'path' => $source_lib . 'css/master.css',\n\t\t\t\t'deps' => array()\n\t\t\t);\n\t\t\t\n\t\t\t$this->styles[] = array(\n\t\t\t\t'slug' => $this->prefix . 'scss',\n\t\t\t\t'path' => $source_lib . 'scss/master.scss',\n\t\t\t\t'deps' => array( $this->prefix . 'styles')\n\t\t\t);\n\n\t\t\t$this->styles[] = array(\n\t\t\t\t'slug' => $this->prefix . 'css-map',\n\t\t\t\t'path' => $source_lib . 'maps/master.css.map',\n\t\t\t\t'deps' => array( $this->prefix . 'styles', $this->prefix . 'scss')\n\t\t\t);\n\t\t\n\t\n\t\t\t$this->scripts[] = array(\n\t\t\t\t'slug' => $this->prefix . 'plugins',\n\t\t\t\t'path' => $source_lib . 'js/plugins.js',\n\t\t\t\t'deps' => array(\n\t\t\t\t\t'jquery'\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->scripts[] = array(\n\t\t\t\t'slug' => $this->prefix . 'the-script',\n\t\t\t\t'path' => $source_lib . 'js/script.js',\n\t\t\t\t'deps' => array(\n\t\t\t\t\t'jquery'\n\t\t\t\t)\n\t\t\t);\n\n\n\n\t\t\t// $this->scripts[] = array(\n\t\t\t// \t'slug' => $this->prefix . 'script-map',\n\t\t\t// \t'path' => $source_lib . 'maps/scripts.js.map',\n\t\t\t// \t'deps' => array(\n\t\t\t// \t\t'jquery',\n\t\t\t// \t\t$this->prefix . 'script'\n\t\t\t// \t)\n\t\t\t// );\n\t\n\t\t// Otherwise load only minified assets\n\t\t} else {\n\n\t\t\t$this->styles[] = array(\n\t\t\t\t'slug' => $this->prefix . 'styles-min',\n\t\t\t\t'path' => $public_lib . 'css/master.min.css',\n\t\t\t\t'deps' => array()\n\t\t\t);\n\n\t\t\t$this->scripts[] = array(\n\t\t\t\t\t'slug' => $this->prefix . 'scripts-min',\n\t\t\t\t\t'path' => $public_lib . 'js/master.min.js',\n\t\t\t\t\t'deps' => array(\n\t\t\t\t\t\t'jquery'\n\t\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t}\n\t\t\n\t\t$this->add_wp_script('jquery');\n\t\t\n\t\tadd_action('wp_enqueue_scripts', array( $this, 'theme_assets_handler' ));\n\t}", "public function __construct()\n {\n $this->style = file_get_contents(__DIR__ . '/style.css');\n //load scripts.js into $scripts\n $this->scripts = file_get_contents(__DIR__ . '/scripts.js');\n }", "protected function setupAssetsInfo() {\n JQuery::registerJQuery();\n $this->addYiiGemsCommonCss();\n $this->addFontAwesomeCss();\n $this->addAssetInfo(\n \"ribbon.css\",\n dirname(__FILE__) . \"/assets\"\n );\n $this->addGradientAssets($this->barGradient);\n }", "public function init()\n {\n $this->_helper->layout->setLayout('layout_admin_geral');\n $this->view->headScript()->appendFile($this->view->baseUrl('dist/js/promocao.js'));\n }", "protected function loadJavaScripts()\n {\n $this->pageRenderer->loadJquery();\n $this->pageRenderer->loadRequireJsModule('bootstrap');\n $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/ContextHelp');\n $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/DocumentHeader');\n $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/SplitButtons');\n }", "private function processAssets()\n {\n $js = $this->assetmanager->getAssetHandler('js');\n\n $afh = new \\Core\\Asset\\AssetFileHandler();\n $afh->setFilename($this->config->get('Core', 'dir.cache') . '/script.js');\n $afh->setTTL($this->config->get('Core', 'cache.ttl.js'));\n\n $js->setFileHandler($afh);\n\n $css = $this->assetmanager->getAssetHandler('css');\n\n $theme = $this->config->get('Core', 'style.theme.name');\n\n $css->addProcessor(new \\Core\\Asset\\Processor\\ReplaceProcessor('../fonts/', '../Themes/' . $theme . '/fonts/'));\n $css->addProcessor(new \\Core\\Asset\\Processor\\ReplaceProcessor('../img/', '../Themes/' . $theme . '/img/'));\n\n $afh = new \\Core\\Asset\\AssetFileHandler();\n $afh->setFilename($this->config->get('Core', 'dir.cache') . '/style.css');\n $afh->setTTL($this->config->get('Core', 'cache.ttl.css'));\n\n $css->setFileHandler($afh);\n\n foreach ($this->apps as $app) {\n foreach ($app->javascript as $aio) {\n $js->addObject($aio);\n }\n\n foreach ($app->css as $aio) {\n $css->addObject($aio);\n }\n }\n\n // Process assets\n $this->assetmanager->process();\n }", "public function initAssets()\n {\n add_action(\n \"admin_enqueue_scripts\",\n array($this, 'PluginScripts')\n );\n\n add_action(\n \"admin_enqueue_scripts\",\n array($this, 'PluginStyles')\n );\n }", "public function loadIncludes() {\n // TODO: better way to skip load includes.\n $this->addCSS($this->env->dir['tmp_files'] . '/css.min.css');\n $this->addJS('/tmp/js.min.js');\n }", "public function init() {\n\t\t\n\t\t$class = $this->className();\n\t\t$config = $this->wire('config');\n\t\n\t\t$file = $config->paths->$class . \"$class.css\";\n\t\tif($this->loadStyles && is_file($file)) {\n\t\t\t$mtime = filemtime($file);\n\t\t\t$this->config->styles->add($config->urls->$class . \"$class.css?v=$mtime\");\n\t\t}\n\t\t\n\t\t$file = $config->paths->$class . \"$class.js\"; \n\t\t$mtime = 0;\n\t\tif($this->loadScripts && is_file($file)) {\n\t\t\t$minFile = $config->paths->$class . \"$class.min.js\";\n\t\t\tif(!$config->debug && is_file($minFile)) {\n\t\t\t\t$mtime = filemtime($minFile);\n\t\t\t\t$config->scripts->add($config->urls->$class . \"$class.min.js?v=$mtime\");\n\t\t\t} else {\n\t\t\t\t$mtime = filemtime($file);\n\t\t\t\t$config->scripts->add($config->urls->$class . \"$class.js?v=$mtime\");\n\t\t\t}\n\t\t}\n\n\t\tif(count($this->requested)) {\n\t\t\tforeach($this->requested as $name) {\n\t\t\t\t$url = $this->components[$name]; \n\t\t\t\tif(strpos($url, '/') === false) {\n\t\t\t\t\t$mtime = filemtime($config->paths->$class . $url);\n\t\t\t\t\t$url = $config->urls->$class . $url;\n\t\t\t\t}\n\t\t\t\t$url .= \"?v=$mtime\";\n\t\t\t\t$this->wire('config')->scripts->add($url);\n\t\t\t}\n\t\t\t$this->requested = array();\n\t\t}\n\n\t\t$this->initialized = true;\n\t}", "public function init()\n {\n $this->sourcePath = '@barrelstrength/sproutforms/web/assets/entries/dist';\n\n // define the dependencies\n $this->depends = [\n CpAsset::class,\n ChartsAsset::class\n ];\n\n // define the relative path to CSS/JS files that should be registered with the page\n // when this asset bundle is registered\n $this->js = [\n 'js/SproutFormsEntriesIndex.js',\n 'js/SproutFormsEntriesTableView.js',\n ];\n\n parent::init();\n }", "protected function loadJavaScripts() {}", "public function theme_assets_handler() {\n\t\t\n\t\t$version = wp_get_theme()->get('Version');\n\n\t\t//Enqueue stylesheets\n\t\tforeach ($this->styles as $style) {\n\t\t\twp_register_style($this->prefix . $style['slug'], get_template_directory_uri() . $style['path'], $style['deps'], $version);\n\t\t\twp_enqueue_style($this->prefix . $style['slug']);\n\n\n\n\t\t}\n\t\t\n\t\t//Enqueue Scripts\n\t\tforeach ($this->scripts as $script) {\n\t\t\twp_register_script($this->prefix . $script['slug'], get_template_directory_uri() . $script['path'], $script['deps'], $version);\n\t\t\twp_enqueue_script($this->prefix . $script['slug']);\n\t\t}\n\t\t\n\t\t//Enqueue WP Scripts\n\t\tif(is_array($this->wp_scripts)){\n\t\t\t\n\t\t\tforeach ($this->wp_scripts as $script) {\n\t\t\t\twp_enqueue_script($script);\n\t\t\t}\n\t\t}\n\t}", "public function register_assets() {\n\n\t\tforeach ( $this->assets as $asset ) {\n\t\t\t$js_path = $this->plugin->dir() . '/js/dist/' . $asset . '.asset.php';\n\t\t\t$css_path = $this->plugin->dir() . '/css/' . $asset . '.css';\n\t\t\tif ( file_exists( $js_path ) ) {\n\t\t\t\t$assets_dep = require_once $js_path;\n\t\t\t\twp_register_script(\n\t\t\t\t\t'formation-' . $asset . '-js',\n\t\t\t\t\t$this->plugin->asset_url( 'js/dist/' . $asset . '.js' ),\n\t\t\t\t\t$assets_dep['dependencies'],\n\t\t\t\t\t$assets_dep['version'],\n\t\t\t\t\ttrue\n\t\t\t\t);\n\n\t\t\t\tif ( file_exists( $css_path ) ) {\n\t\t\t\t\twp_register_style(\n\t\t\t\t\t\t'formation-' . $asset . '-css',\n\t\t\t\t\t\t$this->plugin->asset_url( 'css/' . $asset . '.css' ),\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t$assets_dep['version']\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function wcufd_load_styles_scripts() {\n //main script file of the plugin\n wp_register_script( 'wcufd-front-end-js', plugins_url( 'js/wcufd-script.js',__FILE__ ), array('jquery'), '', true );\n wp_localize_script( 'wcufd-front-end-js', 'wcufd_vars', array(\n 'ajaxurl' => admin_url('admin-ajax.php'),\n 'current_user_can' => current_user_can('administrator')\n )\n );\n wp_register_style( 'wcufd-front-end-style', plugins_url( 'css/wcufd-style.css',__FILE__ ) );\n }", "protected function loadCss() {}", "protected function registerAssets(){\n\n\t\t$cs = Yii::app()->clientScript;\n\t\t$cs->registerCoreScript('jquery');\n\n\t\t$assets_path = dirname(__FILE__) . DIRECTORY_SEPARATOR.'assets';\n\t\t$url = Yii::app()->assetManager->publish($assets_path, false, -1, YII_DEBUG);\n\t\t$webroot = Yii::getPathOfAlias('webroot').DIRECTORY_SEPARATOR;\n\t\t$plugins = array();\n\t\t\n\t\t// register redactor files\n\t\t$cs->registerScriptFile($url.'/chosen.jquery.min.js');\n\t\t$cs->registerCssFile($url.'/chosen.min.css');\n\t\t\n\t\t$cs->registerScript('chosen_'.$this->id, '\n\t\t\t$(\"#'.$this->id.'\").chosen({no_results_text: \"'.Yii::t('chosen', 'Ничего не найдено').'\"});\n\t\t');\n\t\t\n\t}", "public function dt_testimonial_simple_loadCssAndJs() {\n wp_register_style( 'dt_extend_style', plugins_url('assets/droit-wbpakery-addons.css', __FILE__) );\n }", "public function register_frontend_assets() {\n\t\twp_enqueue_style( 'ghc-functionality', $this->plugin_dir_url( 'dist/css/style.min.css' ), array(), $this->version );\n\n\t\twp_register_script( 'ghc-content-types-filter', $this->plugin_dir_url( 'dist/js/content-types.min.js' ), array( 'jquery' ), $this->version, true );\n\n\t\twp_register_script( 'ghc-maps', $this->plugin_dir_url( 'dist/js/maps.min.js' ), array( 'jquery', 'google-maps-api' ), $this->version, true );\n\t\twp_register_script( 'google-maps-api', 'https://maps.googleapis.com/maps/api/js?key=' . get_option( 'options_api_key' ), array(), null, true ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters -- let Google Maps handle cache invalidation.\n\n\t\twp_enqueue_script( 'ghc-popups', $this->plugin_dir_url( 'dist/js/popups.min.js' ), array( 'jquery', 'popup-maker-site' ), $this->version, true );\n\n\t\twp_register_script( 'ghc-robly-lists', $this->plugin_dir_url( 'dist/js/robly-lists.min.js' ), array( 'jquery' ), $this->version, true );\n\n\t\twp_register_script( 'slick', $this->plugin_dir_url( 'dist/js/slick.min.js' ), array( 'jquery' ), $this->version, true );\n\t\twp_register_style( 'slick', $this->plugin_dir_url( 'dist/css/slick.min.css' ), array(), $this->version, false );\n\t}", "function init() {\n $this->enqueue_script();\n $this->localize_script();\n $this->stylize();\n }", "public function dt_icon_list_loadCssAndJs() {\n wp_register_style( 'dt_extend_style', plugins_url('assets/droit-wbpakery-addons.css', __FILE__) );\n // If you need any javascript files on front end, here is how you can load them.\n //wp_enqueue_script( 'droit-wbpakery-addons_js', plugins_url('assets/droit-wbpakery-addons.js', __FILE__), array('jquery') );\n }", "public function load_assets() {\n\t\t\t//only load styles and js when needed\n\t\t\tif ( $this->is_edit_page() ) {\n\t\t\t\t//styles\n\t\t\t\twp_enqueue_style( 'thickbox' );\n\t\t\t\twp_enqueue_style( 'fancybox' );\n\t\t\t\twp_enqueue_style( 'wm-options-panel-white-label' );\n\t\t\t\tif ( ! wm_option( 'branding-panel-logo' ) && ! wm_option( 'branding-panel-no-logo' ) )\n\t\t\t\t\twp_enqueue_style( 'wm-options-panel-branded' );\n\t\t\t\twp_enqueue_style( 'color-picker' );\n\n\t\t\t\t//scripts\n\t\t\t\twp_enqueue_script( 'jquery-ui-core' );\n\t\t\t\twp_enqueue_script( 'jquery-ui-tabs' );\n\t\t\t\twp_enqueue_script( 'jquery-ui-datepicker' );\n\t\t\t\twp_enqueue_script( 'jquery-ui-slider' );\n\t\t\t\twp_enqueue_script( 'thickbox' );\n\t\t\t\twp_enqueue_script( 'fancybox' );\n\t\t\t\twp_enqueue_script( 'wm-options-panel' );\n\t\t\t\twp_enqueue_script( 'color-picker' );\n\t\t\t}\n\t\t}", "protected function registerCoreScripts()\n\t{\n\t\t$cs=Yii::app()->getClientScript();\n\t\tif(is_string($this->cssFile))\n\t\t\t$cs->registerCssFile($this->themeUrl.'/'.$this->theme.'/'.$this->cssFile);\n\t\telseif(is_array($this->cssFile))\n\t\t{\n\t\t\tforeach($this->cssFile as $cssFile)\n\t\t\t\t$cs->registerCssFile($this->themeUrl.'/'.$this->theme.'/'.$cssFile);\n\t\t}\n\n\t\t$cs->registerCoreScript('jquery');\n\t\tif(is_string($this->scriptFile))\n\t\t\t$this->registerScriptFile($this->scriptFile);\n\t\telseif(is_array($this->scriptFile))\n\t\t{\n\t\t\tforeach($this->scriptFile as $scriptFile)\n\t\t\t\t$this->registerScriptFile($scriptFile);\n\t\t}\n\t}", "public function enqueue_css_js() {\n\t\twp_enqueue_style('wp-pointer');\n\t\twp_enqueue_script('wp-pointer');\n\t}", "function mk_resources() {\t\t\n\twp_enqueue_style('style', get_stylesheet_uri());\n\twp_enqueue_script( 'jquery', get_template_directory_uri() . '/js/jquery-3.1.1.min.js', array(), '20120206', true );\n\twp_enqueue_script( 'custom-script', get_template_directory_uri() . '/js/script.js', array( 'jquery'), '1.1', true );\n}", "function register_scripts() {\n\t\t\t$id = get_the_ID();\n\t\t\t// Only continue if current page is home\n\t\t\tif ( !is_home() ) return;\n\n\t\t\twp_enqueue_script( 'jquery' );\n\t\t\twp_enqueue_script( 'kevinw-sf-react', plugins_url( 'assets/react.min.js', KEVINW_SF_FILE ), array(), false, true );\n\t\t\twp_enqueue_script( 'kevinw-sf-react-app', plugins_url( 'assets/scripts.min.js', KEVINW_SF_FILE ), array(), false, true );\n\t\t\n\t\t\t$this->register_scripts_css();\n\t\t}", "public function enqueueAssets()\n {\n wp_enqueue_style( WPADW_DOMAIN . '-admin-style', WPADW_URL . '/assets/style.css' );\n }", "public function init() {\n\t\tparent::init();\n\t\t\t\t\n\t\t// Register site CSS file\n\t\t$cs = Yii::app()->clientscript;\n\t\t$cs->registerCssFile(Yii::app()->baseUrl.'/css/site.css');\n\t}", "function aitEnqueueScriptsAndStyles(){\r\n\tif(!is_admin()){\r\n\t\t// just shortcuts\r\n\t\t$s = THEME_CSS_URL;\r\n\t\t$j = THEME_JS_URL;\r\n\r\n\t\taitAddStyles(array(\r\n\t\t\t'ait-colorbox' => array('file' => \"$s/libs/colorbox.css\"),\r\n\t\t\t'ait-fancybox' => array('file' => \"$s/libs/fancybox.css\"),\r\n\t\t\t'jquery-ui' \t => array('file' => \"$s/libs/jquery-ui.css\"),\r\n\t\t\t'prettysociable' => array('file' => \"$s/libs/prettySociable.css\"),\r\n\t\t\t'hoverzoom' \t => array('file' => \"$s/libs/hoverZoom.css\"),\r\n\t\t));\r\n\r\n\t\taitAddScripts(array(\r\n\t\t\t'jquery-ui-tabs' \t\t\t=> true,\r\n\t\t\t'jquery-ui-accordion' \t\t\t=> true,\r\n\t\t\t'jquery-infieldlabel' \t\t\t=> array('file' => \"$j/libs/jquery-infieldlabel.js\", 'deps' => array('jquery'), 'inFooter' => true),\r\n\t\t\t'jquery-iconmenu' \t\t\t\t=> array('file' => \"$j/libs/jquery-iconmenu.js\", 'deps' => array('jquery'), 'inFooter' => true),\r\n\t\t\t'jquery-plugins'\t \t\t\t=> array('file' => \"$j/libs/jquery-plugins.js\", 'deps' => array('jquery')),\r\n\t\t\t'modernizr'\t\t\t\t\t\t=> array('file' => \"$j/libs/modernizr-2.6.1-custom.js\", 'deps' => array('jquery'), 'inFooter' => true),\r\n\r\n\t\t\t'ait-gridgallery' \t\t\t=> array('file' => \"$j/gridgallery.js\", 'deps' => array('jquery', 'jquery-plugins'), 'inFooter' => true),\r\n\t\t\t'ait-testimonials' \t\t\t=> array('file' => \"$j/testimonials.js\", 'deps' => array('jquery'), 'inFooter' => true),\r\n\t\t\t'ait-script' \t\t\t=> array('file' => \"$j/script.js\", 'deps' => array('jquery', 'jquery-infieldlabel', 'jquery-iconmenu', 'jquery-plugins', 'modernizr'), 'inFooter' => true),\r\n\t\t));\r\n\t}\r\n}", "protected function loadStylesheets()\n {\n if (!empty($GLOBALS['TBE_STYLES']['stylesheet'])) {\n $this->pageRenderer->addCssFile($GLOBALS['TBE_STYLES']['stylesheet']);\n }\n if (!empty($GLOBALS['TBE_STYLES']['stylesheet2'])) {\n $this->pageRenderer->addCssFile($GLOBALS['TBE_STYLES']['stylesheet2']);\n }\n }", "public function enqueueScripts(){}", "public function initialize()\n {\n // $this->view->setTemplateBefore('public');\n // $this->view->setTemplateBefore('coba');\n if ($this->session->has('auth-identity')) {\n // $this->view->setTemplateBefore('private');\n $this->view->setTemplateBefore('cobaprivate');\n }else {\n // $this->view->setTemplateBefore('public');\n $this->view->setTemplateBefore('coba');\n }\n\n // Add some local CSS resources\n $this->assets->addCss(\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\");\n $this->assets->addCss(\"css/font-awesome.min.css\");\n $this->assets->addCss(\"css/animate.min.css\");\n $this->assets->addCss(\"css/prettyPhoto.css\");\n $this->assets->addCss(\"css/main.css\");\n $this->assets->addCss(\"css/responsive.css\");\n\n // And some local JavaScript resources\n $this->assets->addJs(\"//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js\");\n $this->assets->addJs(\"js/jquery.js\");\n $this->assets->addJs(\"js/bootstrap.min.js\");\n $this->assets->addJs(\"js/main.js\");\n $this->assets->addJs(\"js/jquery.prettyPhoto.js\");\n $this->assets->addJs(\"js/jquery.isotope.min.js\");\n $this->assets->addJs(\"js/wow.min.js\");\n }", "public function css() {\r\n\t\tif ($this->cssLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.BASE_REQUEST.'/default/skin/'.pzk_app()->name.'/css/'.$this->cssLink.'.css\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page())\r\n\t\t\t\t\t$page->addObjCss($this->cssLink);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tif ($this->cssExternalLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.$this->cssExternalLink.'\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page()) {\r\n\t\t\t\t\t$page->addExternalCss($this->cssExternalLink);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "public function enqueueScripts() {\n\t\t\twp_enqueue_script('jquery');\n//\t\t\twp_enqueue_script('owl', self::asset(\"node_modules/owl.carousel/dist/owl.carousel.min.js\"), ['jquery'], '1.0.0', ' all');\n// wp_enqueue_script('headroom', self::asset(\"node_modules/headroom.js/dist/headroom.min.js\"), ['jquery'], '1.0.0', ' all');\n// wp_enqueue_script('prettyPhoto', self::asset(\"js/vendor/jquery.prettyPhoto.js\"), ['jquery'], '1.0.0', ' all');\n//\t\t\twp_enqueue_script('navigo', self::asset(\"node_modules/navigo/lib/navigo.min.js\"), ['jquery'], '1.0.0', ' all')\\;\n\t\t\twp_enqueue_script('app', self::asset(\"js/app.min.js\"), ['jquery'], '1.0.0', ' all');\n\t\t}", "public static function spawn_assets() {\n $screen = get_current_screen();\n if ( $screen->id === 'settings_page_drift-adm-settings' ) {\n\n # https://github.com/vdw/Tabslet\n wp_enqueue_script( 'jquery-tabslet', DRIFTADM_ROOT_PATH . 'vendor/jquery.tabslet.min.js' );\n\n # https://github.com/tovic/color-picker\n wp_enqueue_script( 'color-picker-js', DRIFTADM_ROOT_PATH . 'vendor/color-picker/color-picker.min.js' );\n wp_enqueue_style( 'color-picker-css', DRIFTADM_ROOT_PATH . 'vendor/color-picker/color-picker.min.css' );\n \n wp_enqueue_script( 'driftadm-settings-js', DRIFTADM_ROOT_PATH . 'assets/js/settings-page.js' );\n wp_enqueue_style( 'driftadm-settings-css', DRIFTADM_ROOT_PATH . 'assets/css/driftadm-settings.css' );\n }\n\n wp_enqueue_style( 'driftadm-main-css', DRIFTADM_ROOT_PATH . 'assets/css/driftadm-main.css' );\n wp_enqueue_script( 'driftadm-main-js', DRIFTADM_ROOT_PATH . 'assets/js/driftadm-main.js' );\n }", "public function includeLibs()\n {\n $string = '';\n\n if($this->css_files)\n {\n foreach( $this->css_files as &$css_file )\n {\n $string .= '<link rel=\"stylesheet\" href=\"' . $css_file . '\" type=\"text/css\" />';\n }\n }\n \n if($this->js_files)\n {\n foreach( $this->js_files as &$js_file )\n {\n $string .= PHP_EOL . '<script src=\"' . $js_file . '\" type=\"text/javascript\"></script>';\n }\n }\n $this->tpl->assign(\"libs\", $string . PHP_EOL);\n }", "private function set_styles()\n {\n\n if (count($this->assets_css['global']) > 0)\n {\n $this->template->append_metadata('<!-- BEGIN GLOBAL MANDATORY STYLES -->');\n foreach($this->assets_css['global'] as $asset)\n {\n $this->template->append_metadata('<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . '../../themes/public/css/' . $asset . '\" media=\"screen\" />');\n }\n }\n if (isset($this->assets_css['page_style']) && count($this->assets_css['page_style']) > 0)\n {\n $this->template->append_metadata('<!-- BEGIN PAGE STYLES -->');\n foreach($this->assets_css['page_style'] as $asset)\n {\n $this->template->append_metadata('<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . '../../themes/public/css/' . $asset . '\" media=\"screen\" />');\n }\n }\n\n // Webkit based browsers\n //$this->template->append_metadata('<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/webkit.css\" media=\"screen\" />');\n\n // Internet Explorer styles\n $this->template->append_metadata('<!--[if IE 6]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie6.css\" media=\"screen\" /><![endif]-->');\n $this->template->append_metadata('<!--[if IE 7]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie7.css\" media=\"screen\" /><![endif]-->');\n $this->template->append_metadata('<!--[if IE 8]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie8.css\" media=\"screen\" /><![endif]-->');\n $this->template->append_metadata('<!--[if IE 9]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie9.css\" media=\"screen\" /><![endif]-->');\n }", "function validation_files()\n\t{\n\t\t//Script file\n\t\techo '<script src=\"'.SITEPATH.'/administrator/validation/validationtextfield.js\" type=\"text/javascript\"></script>\n\t\t<script src=\"'.SITEPATH.'/administrator/validation/validationtextarea.js\" type=\"text/javascript\"></script>\n\t\t<script src=\"'.SITEPATH.'/administrator/validation/validationselect.js\" type=\"text/javascript\"></script>';\n\t\t//css file\n\t\techo '<link href=\"'.SITEPATH.'/administrator/validation/validationtextfield.css\" rel=\"stylesheet\" type=\"text/css\" />\n\t\t<link href=\"'.SITEPATH.'/administrator/validation/validationtextarea.css\" rel=\"stylesheet\" type=\"text/css\" />\n\t\t<link href=\"'.SITEPATH.'/administrator/validation/validationselect.css\" rel=\"stylesheet\" type=\"text/css\" />';\n\t}", "public function registerClientScripts()\r\n {\r\n if ($this->baseUrl === '')\r\n throw new CException('Can not find the base folder');\r\n\r\n $this->clientScript = Yii::app()->getClientScript();\r\n\r\n// $this->clientScript->registerCoreScript('jquery');\r\n \r\n foreach ($this->Jscripts as $script)\r\n {\r\n $this->clientScript->registerScriptFile($this->baseUrl.'/js/'.$script,CClientScript::POS_HEAD); \t\r\n }\r\n\r\n\r\n \r\n $this->clientScript->registerCssFile($this->baseUrl.'/css/'.$this->Cssscript);\r\n }", "function _s_scripts() {\n\twp_enqueue_style( 'main.css', get_stylesheet_directory_uri() . '/dist/src/style.css', false, '6.9' );\n\twp_enqueue_script( 'main.js', get_stylesheet_directory_uri() . '/dist/main.js', false, false, true );\n}", "function excalibur_css_js() {\n\tglobal $wp_styles;\n\t\t// register main stylesheet\n\t\twp_register_style('excalibur-stylesheet', get_stylesheet_directory_uri() . '/assets/css/styles.css', array(), '', 'all');\n\t\t\n\t\twp_enqueue_style( 'excalibur-stylesheet' );\n}", "function mightyResources() {\n $css_file = get_stylesheet_directory() . '/dist/assets/css/style.min.css';\n wp_enqueue_style('theme', get_stylesheet_directory_uri() . '/dist/assets/css/style.min.css', '', date('m.d.Y.H.i.s', filemtime($css_file)));\n\t\twp_dequeue_style('wp-block-library');\n\n wp_deregister_script('jquery');\n wp_register_script('jquery', ('//ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js'), '', '2.2.4', false);\n wp_enqueue_script('jquery');\n\n // wp_enqueue_script('fontawesome-kit', '//kit.fontawesome.com/72e34829c8.js', '', '1.0', false);\n\t\twp_enqueue_script('google-maps', '//maps.googleapis.com/maps/api/js?key=AIzaSyClqC80DXd3luWXcJZ-a0odx1q6ddTDVr0', '', '1.0', false);\n\n\t\twp_enqueue_script('aos', '//unpkg.com/aos@2.3.1/dist/aos.js', '', '2.3.1', true);\n wp_enqueue_script('theme', get_stylesheet_directory_uri() . '/dist/assets/js/scripts.min.js', ['jquery'], '1.0.6', true);\n\n\t\twp_localize_script('theme', 'globalVar', array(\n\t\t 'themePath' => get_template_directory_uri(),\n\t\t));\n }", "public function enqueue_files ()\n\t{\n\t\t// Flowdrive\n\t\twp_register_style( 'flowdrive_admin_css', plugin_dir_url( __DIR__ ) . 'assets/css/flowdrive-admin.css', false, $this->version );\n\t\twp_enqueue_style( 'flowdrive_admin_css' );\n\t\t\n\t\t// wp_enqueue_script( $this, plugin_dir_url( __FILE__ ) . 'js/cloudoki-smmp-admin.js', array( 'jquery' ), $this->version, false );\n\t\t\n\t\t// Chosen\n\t\twp_register_style( 'chosen_admin_css', plugin_dir_url( __DIR__ ) . '../vendor/drmonty/chosen/css/chosen.min.css', false, $this->version );\n\t\twp_enqueue_style( 'chosen_admin_css' );\n\t\t\n\t\twp_register_script( 'chosen_admin_js', plugin_dir_url( __DIR__ ) . '../vendor/drmonty/chosen/js/chosen.jquery.min.js', ['jquery'], $this->version );\n\t\twp_enqueue_script( 'chosen_admin_js' );\n\t\t\n\t\t// wp_enqueue_script( $this, plugin_dir_url( __DIR__ ) . '../vendor/drmonty/chosen/js/chosen.jquery.min.js', array( 'jquery' ), $this->version, false );\n\t}", "public function setup() {\n\t\t$this->setup_menu();\n\t\t$this->enqueue_scripts();\n\t}", "public function loadAssets()\r\n {\r\n $this->app->document->addStylesheet('elements:imagebox/assets/css/edit.css');\r\n return parent::loadAssets();\r\n }", "function theme_assets() {\n\t// load css\n\twp_enqueue_style( 'font-awesome-css', get_template_directory_uri() . '/css/fontawesome.css' );\n\twp_enqueue_style( 'bootstrap-css', get_template_directory_uri() . '/css/bootstrap.css' );\n\twp_enqueue_style( 'style-css', get_template_directory_uri() . '/style.css', false, time() );\n\n\t// load javascript\n\twp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . '/js/bootstrap.min.js', array(), '', true );\n wp_enqueue_script( 'waterfall-js', get_template_directory_uri() . '/js/waterfall.js', array(), '', true );\n\twp_enqueue_script( 'main', get_template_directory_uri() . '/js/main.js', array(), '', true);\n}", "public function loadAssets()\n {\n add_action('admin_enqueue_scripts', [$this, 'enqueueAdminAssets']);\n add_filter('script_loader_tag', [$this, 'addAssetAttribute'], 10, 3);\n }", "function massively_theme_assets() {\n\n\t\t$var = '1.0.0';\n\n\t\t/* CSS */\n\t\twp_enqueue_style( 'main-css', get_theme_file_uri('/assets/css/main.css'), '', $var );\n\t\twp_enqueue_style( 'noscript-css', get_theme_file_uri('/assets/css/noscript.css'), '', $var );\n\t\twp_enqueue_style( 'theme-css', get_stylesheet_uri(), '', $var );\n\n\t\t/* JavaScripts */\n\t\twp_enqueue_script( 'jquery' );\n\t\twp_enqueue_script( 'scrollex-js', get_theme_file_uri('/assets/js/jquery.scrollex.min.js'), '', $var );\n\t\twp_enqueue_script( 'scrolly-js', get_theme_file_uri('/assets/js/jquery.scrolly.min.js'), '', $var );\n\t\twp_enqueue_script( 'browser-js', get_theme_file_uri('/assets/js/browser.min.js'), '', $var );\n\t\twp_enqueue_script( 'breakpoints-js', get_theme_file_uri('/assets/js/breakpoints.min.js'), '', $var );\n\t\twp_enqueue_script( 'util-js', get_theme_file_uri('/assets/js/util.js'), '', $var );\n\t\twp_enqueue_script( 'main-js', get_theme_file_uri('/assets/js/main.js'), array('jquery'), $var, true );\n\t}", "function mandiberg_scripts() {\n\n\t\t//include bootstrap:\n\t\twp_register_style( 'bootstrap-style', get_template_directory_uri() . '/css/bootstrap.min.css' );\n\t\twp_enqueue_style( 'bootstrap-style');\n\n\n\n\t\t// Register the style like this for a theme:\n\t wp_register_style( 'mandiberg-style', get_template_directory_uri() . '/style.css', array(), '20120208', 'all' );\n\t\twp_enqueue_style( 'mandiberg-style');\n\n\t\t//barba js for transitions\n\n\t\t wp_register_script('barba', get_template_directory_uri() . '/build/barba.min.js', array ( 'jquery' ),'1.1', true);\n\t\t wp_enqueue_script('barba');\n\n\t\t//js\n\t\twp_register_script('js-file', get_template_directory_uri() . '/build/script.js', array ( 'jquery' ),'1.1', true);\n\t\t wp_enqueue_script('js-file');\n\n\t}" ]
[ "0.71677697", "0.7090198", "0.7065064", "0.69919294", "0.6974555", "0.6921828", "0.68946314", "0.68469965", "0.6808663", "0.68049407", "0.67964363", "0.6752706", "0.67477477", "0.6689844", "0.6684175", "0.6673297", "0.66398185", "0.66398185", "0.66376436", "0.6604276", "0.6603235", "0.65520805", "0.65485716", "0.6530145", "0.65278894", "0.65258366", "0.6516222", "0.65031755", "0.649972", "0.649957", "0.64935523", "0.64883274", "0.6478031", "0.64693", "0.6469199", "0.6455439", "0.64458954", "0.64399135", "0.6432034", "0.64231324", "0.6411795", "0.64115876", "0.641023", "0.63993424", "0.63867575", "0.6377885", "0.63556254", "0.63539493", "0.635384", "0.6336117", "0.63310236", "0.633043", "0.6326993", "0.6326842", "0.6324096", "0.63078904", "0.63003856", "0.62978387", "0.62909603", "0.62669927", "0.62634665", "0.626061", "0.6257577", "0.6257025", "0.6250854", "0.6243669", "0.6242483", "0.6239379", "0.62032294", "0.62021863", "0.6200655", "0.6180676", "0.61734647", "0.6161875", "0.6155663", "0.61533713", "0.615217", "0.61484903", "0.6147904", "0.6144865", "0.6140132", "0.61398566", "0.61385727", "0.6137632", "0.61311454", "0.61310154", "0.61303216", "0.6128366", "0.6122485", "0.61205536", "0.6114735", "0.6109153", "0.61078155", "0.60984635", "0.60979956", "0.6097955", "0.6095648", "0.6088661", "0.6085953", "0.60857004", "0.60853964" ]
0.0
-1
loadNGFiles($file) loads to display view default layout.
public static function loadNGFiles($file) { /** * Get the document. */ $document = JFactory::getDocument(); /** * Get file type. */ $filename = $file.'.js'; /** * Returns the root URI for the request. * * @param boolean $pathonly If false, prepend the scheme, host and port information. Default is false. * string $path The path. * * @return string The root URI string. */ $url = JUri::root(true).'/media/ngtodo/js/'; $path = JPATH_SITE.'/media/ngtodo/js/'; /** * check filename exits or not. */ if(JFile::exists($path.$filename)) { $document->addScript($url.$filename); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadView($file, $params = array()) {\n \n if(!empty($params)) {\n extract($params);\n } \n \n include realpath(dirname(__FILE__)).'/../view/'.$file.'.php';\n}", "public static function view($view_file, $items = []){\n\t\t\textract($items);\n\n\t\t\t$base_dir = $_SERVER['DOCUMENT_ROOT'].'/php/tarot/app/views/';\n\n\t\t\t// Header partial\n\t\t\tinclude($base_dir.'partials/header.view.php');\n\n\t\t\t// Selected view file to load\n\t\t\tinclude($base_dir.$view_file.'.view.php');\n\n\t\t\t// Footer partial\n\t\t\tinclude($base_dir.'partials/footer.view.php');\n\t\t}", "public function Display(){\n\t\trequire($this->viewFileName);\n\t}", "protected function loadViews()\n {\n $this->loadViewsFrom(__DIR__.'/../resources/views', 'firefly');\n }", "private function renderView(){\n\t\trequire($this->ViewFile);\n\t}", "protected function loadView()\n {\n }", "protected function loadView()\n {\n }", "public static function load($view)\n {\n $file = strtolower($view);\n require_once(getcwd() . \"/views/\" . $view . '/' . $file . \".php\");\n }", "public function View($file,$data)\n {\n $path = '../view/'. $file . '.php';\n //dd($path);\n if (file_exists($path)){\n ob_start();\n require_once $path;\n $content = ob_get_clean();\n require_once '../view/layout/main.php';\n } else{\n echo \"404 NOT FOUND\";\n }\n }", "function _loadFromFile($view, $file, $moduleName) {\n $variables = array();\n\t if (!file_exists($file)) {\n $this->_fatalError(\"ModuleBuilderParser: required viewdef file {$file} does not exist\");\n }\n\n $GLOBALS['log']->info('ModuleBuilderParser->_loadFromFile(): file='.$file); \n require FileLoader::validateFilePath($file); // loads in a $viewdefs\n\n // Check to see if we have the module name set as a variable rather than embedded in the $viewdef array\n // If we do, then we have to preserve the module variable when we write the file back out\n // This is a format used by ModuleBuilder templated modules to speed the renaming of modules\n // Traditional Sugar modules don't use this format\n // We must do this in ParserModifyLayout (rather than just in ParserBuildLayout) because we might be\n // editing the layout of a MB created module in Studio after it has been deployed\n $moduleVariables = array('module_name','_module_name', 'OBJECT_NAME', '_object_name');\n foreach ($moduleVariables as $name) {\n if (isset($$name)) {\n \t$variables[$name] = $$name;\n }\n }\n $viewVariable = $this->_defMap[strtolower($view)];\n\n // Now tidy up the module name in the viewdef array\n // MB created definitions store the defs under packagename_modulename and later methods that expect to find them under modulename will fail\n $defs = $$viewVariable;\n\n if (isset($variables['module_name'])) {\n \t$mbName = $variables['module_name'];\n \tif ($mbName != $moduleName) {\n\t \t$GLOBALS['log']->debug('ModuleBuilderParser->_loadFromFile(): tidying module names from '.$mbName.' to '.$moduleName);\n\t \t$defs[$moduleName] = $defs[$mbName];\n\t \tunset($defs[$mbName]);\n \t}\n }\n//\t $GLOBALS['log']->debug('ModuleBuilderParser->_loadFromFile(): '.print_r($defs,true));\n return (array('viewdefs' => $defs, 'variables' => $variables));\n\t}", "private function loadPage()\n\t{\n\t $data = $this->getData();\n \t \n\t $this->load->view('index', $data);\n\t}", "public function view_loader(){\n\n\t\tparent::view_loader();\n\t}", "public function load($file);", "public function load($file);", "public function load($file);", "function view($fileName, $data=null) {\n if(is_array($data)) {\n extract($data);\n }\n require_once('html/' . $fileName);\n }", "public static function section($view_file, $items = []){\n\t\t\textract($items);\n\n\t\t\t$base_dir = $_SERVER['DOCUMENT_ROOT'].'/php/tarot/app/views/';\n\n\t\t\t// Selected view file to load\n\t\t\tinclude($base_dir.$view_file.'.view.php');\n\t\t}", "public function display($fileName)\n { \t\n \tif (file_exists($fileName)) {\n \t\t\n \t\t$view = file_get_contents($fileName);\n \t\t$this->view = '?>' . $view;\n \t\t\n \t\t$this->processTags();\n \t\t\n \t\teval ($this->view);\n \t\t\n \t} else {\n \t\t\n \t\t$this->displayError(\"Can't load view : \" . $fileName);\n \t}\n }", "public function loadFromFile($file)\n {\n \n }", "public function load ($module = null, $filename = null) {\n \n if ($module === null) {\n $module = $this->uri->segment(1);\n if ($module === false) {\n $module = explode('/', $this->router->routes['default_controller']);\n $module = $module[0];\n }\n }\n \n $layout = array(\n // TODO: use $this->config->item('modules_locations') for modules path\n simplexml_load_file(APPPATH.'modules/layout/views/'.$this->get_skin().'/layout/default.xml'),\n simplexml_load_file(APPPATH.'modules/'.$module.'/views/'.$this->get_skin().'/layout/default.xml')\n );\n \n if ($filename === null) {\n $filename = $this->router->fetch_class();\n }\n $layout[] = simplexml_load_file(APPPATH.'modules/'.$module.'/views/'.$this->get_skin().'/layout/'.$filename.'.xml');\n\n foreach ($layout as $xml) {\n \n foreach ($xml->children() as $k=>$xml) {\n \n if ( (string)$k === 'default' || (string)$k === $this->router->fetch_method() ) {\n if ($xml['template'] != '') {\n $this->layout($xml['template']);\n }\n\n if (isset($xml->head->css)) {\n foreach ($xml->head->css as $node) {\n if ((string)$node['action'] === 'unset') {\n $this->css((string)$node, true);\n } else {\n $this->css((string)$node);\n }\n }\n }\n if (isset($xml->head->js)) {\n foreach ($xml->head->js as $node) {\n if ((string)$node['action'] === 'unset') {\n $this->js((string)$node, true);\n } else {\n $this->js((string)$node);\n }\n }\n }\n if (isset($xml->head->title)) {\n foreach ($xml->head->title as $node) {\n $this->title((string)$node);\n }\n }\n\n if (isset($xml->body)) {\n $body_class = (string)$xml->body['class'];\n if ($body_class !== '') {\n $this->body_class($body_class);\n }\n foreach ($xml->body->children() as $key=>$value) {\n foreach ($value as $blockKey=>$blockValue) {\n if ((string)$blockKey === 'remove') {\n $this->remove((string)$key, (string) $blockValue['template']); \n } else {\n $this->set((string)$key, (string) $blockValue['template']); \n }\n }\n }\n }\n }\n }\n } \n return $this;\n }", "protected function view($var_and_file = array(\"content\"=>\"index.php\"),$var = array()){\n foreach($var_and_file as $variabel => $file){\n if(is_object($file)||is_array($file)||strpos($file,\".php\")==0)\n $$variabel = $file;\n else\n $$variabel = $this->viewPartial($file,$var);\n }\n include_once(\"system/view/component/$this->layout\");\n }", "public function load($view) {\n\n\n\t}", "function loadTemplate($mainFile, $params = array()) {\n \n loadView(\"template/header\", $params);\n loadView('template/navigation', $params);\n \n loadView($mainFile, $params);\n \n loadView(\"template/footer\", $params);\n}", "public function render(){\n require_once($_SERVER['DOCUMENT_ROOT'].\"//views/\".self::$page_name.\"/\".self::$page_name.\".php\");\n }", "public function setLayout($file);", "function fake_views_default_views() {\n $views = array();\n $view_files = file_scan_directory(drupal_get_path('module', \n'my_module') . '/views', '.*\\.views\\.inc\\.php');\n foreach ($view_files as $file => $data) {\n include $file;\n $views[$view->name] = $view;\n\n }\n return $views;\n\n}", "public static function load($view){\n\n\t\tif(!isset($_GET['view'])){\n\n\t\t\tif(Core::$root==\"\"){\n\t\t\t\t// echo '<pre>'; print_r(\"no hay var get\"); echo '</pre>';\n\n\t\t\t\t\tinclude \"core/app/view/\".$view.\"-view.php\";\n\t\t\t}\n\n\t\t}else{\n\n\t\t\tif(View::isValid()){\n\t\t\t\t$url =\"\";\n\t\t\t\tif($_GET[\"view\"] != \"inicio\"){\n\n\t\t\t\t\t// echo '<pre>'; print_r(\"vista completa\"); echo '</pre>';\n\t\t\t\t\t\n\t\t\t\t\t$url = \"core/app/view/\".$_GET['view'].\"-view.php\";\n\n\t\t\t\t}else{\n\n\t\t\t\t\techo '<pre>'; print_r(\"modelo completa\"); echo '</pre>';\n\n\t\t\t\t\tModule::loadLayout();\n\t\t\t\t}\n\n\t\t\t\tinclude $url;\t\t\t\t\n\t\t\t}else{\n\n\t\t\t\tView::Error(\"<b>404 NOT FOUND</b> View <b>\".$_GET['view'].\"</b> folder !! - <a href='http://evilnapsis.com/legobox/help/' target='_blank'>Help</a>\");\n\t\t\t}\n\t\t}\n\t}", "public function render($file, $variables = []){\n extract($variables);\n ob_start();\n require_once $file;\n $views = ob_get_clean();\n return $views;\n }", "public function loadTemplate($file) {\n $file = FilesystemUtils::getFullPath($file, CONTENT_DIR);\n $type = FilesystemUtils::getFileExtension($file);\n\n switch ($type) {\n case 'tpl':\n // Smarty template\n $this->output = $this->filterSmarty($file);\n break;\n\n case 'md':\n // Static Markdown file\n $this->output = $this->filterMarkdown($file);\n break;\n\n case 'tplmd':\n // Smarty template, with the output run through the Markdown parser\n $this->output = $this->filterMarkdown($this->filterSmarty($file), TRUE);\n break;\n\n case 'php':\n // PHP script\n $this->output = $this->filterPHP($file);\n break;\n\n case 'html':\n default:\n // HTML or other unsupported file; passed through unchanged\n $this->output = file_get_contents($file);\n break;\n }\n }", "function initializeFilesLayout() {\n $this->loadFilesMenubar();\n // navigation stuff\n $this->layout->add($this->getSearchPanel());\n $this->layout->add($this->getTagsPanel());\n $this->layout->add($this->getFolderPanel());\n // file list\n $this->layout->add($this->getClipboardPanel());\n $this->layout->add($this->getFilesPanel());\n // dialog\n $this->layout->setParam('COLUMNWIDTH_CENTER', '50%');\n $this->layout->setParam('COLUMNWIDTH_RIGHT', '50%');\n }", "protected function _loadTemplates()\n {\n $this->_tpl = array();\n $dir = Solar_Class::dir($this, 'Data');\n $list = glob($dir . '*.php');\n foreach ($list as $file) {\n \n // strip .php off the end of the file name to get the key\n $key = substr(basename($file), 0, -4);\n \n // load the file template\n $this->_tpl[$key] = file_get_contents($file);\n \n // we need to add the php-open tag ourselves, instead of\n // having it in the template file, becuase the PEAR packager\n // complains about parsing the skeleton code.\n // \n // however, only do this on non-view files.\n if (substr($key, 0, 4) != 'view') {\n $this->_tpl[$key] = \"<?php\\n\" . $this->_tpl[$key];\n }\n }\n }", "function load_view($template){$this->hold_template = APPPATH . '/views/' . $template . EXT;}", "public function core($file)\n {\n\t\t//echo self::$base_path.'/luser/src/'.$file .'.php';\n if (file_exists( self::$framework . DIRECTORY_SEPARATOR . $file . '.php')) {\n require self::$framework . DIRECTORY_SEPARATOR . $file . '.php';\n\t\t\t\t //echo \"success load ->\".self::$framework . DIRECTORY_SEPARATOR . $file . '.php'.\"<br>\";\n } \n }", "private static function view()\n {\n $files = ['View'];\n $folder = static::$root.'MVC/View'.'/';\n\n self::call($files, $folder);\n\n $files = ['Template', 'Views'];\n $folder = static::$root.'MVC/View/Libs'.'/';\n\n self::call($files, $folder);\n\n $files = ['ViewNotFoundException'];\n $folder = static::$root.'MVC/View/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "protected function fetch($file) {\n ob_start();\n $controller = $this->getViewPath();\n $controller .= $file . '.php';\n if (file_exists($controller)) {\n foreach ($this->arrVar as $arrVars) {\n if (is_array($arrVars)) {\n foreach ($arrVars as $var => $val) {\n $$var = $val;\n }\n }\n }\n include $controller;\n }\n $content = ob_get_contents();\n ob_end_clean();\n return $content;\n }", "public function fileBrowser() {\r\n\t\t$document = JFactory::getDocument();\r\n\r\n\t\t$viewType\t= $document->getType();\r\n\t\t$viewName\t= JRequest::getCmd( 'view', $this->getName() );\r\n\t\t$viewLayout\t= JRequest::getCmd( 'layout', 'fileBrowser' );\r\n\r\n\t\t$this->view = $this->getView(\"languages\");\r\n\r\n\t\t// Set the layout\r\n\t\t$this->view->setLayout($viewLayout);\r\n\r\n\t\t$this->view->filebrowser();\r\n\t}", "public function display($file) {\n $tpl_file = $this->option ['templateDir'] . '/' . $file;\n if (! file_exists ( $tpl_file ))\n $this->core->err ( '102', $tpl_file );\n \n $parse_file = $this->option ['compileDir'] . '/' . sha1 ( $file ) . $file . '.php';\n \n if (! file_exists ( $parse_file ) || filemtime ( $parse_file ) < filemtime ( $tpl_file )) {\n $compile = new templatesModuleCompiler ( $this->core, $this->option, $tpl_file );\n $compile->parse ( $parse_file );\n }\n \n if ($this->option ['cache']) {\n $cache_file = $this->option ['cacheDir'] . '/' . sha1 ( $file ) . $file . '.html';\n \n // Create cache file if needed\n if (! file_exists ( $cache_file ) || filemtime ( $cache_file ) < filemtime ( $parse_file )) {\n include $parse_file;\n $content = ob_get_clean ();\n if (! file_put_contents ( $cache_file, $content ))\n $this->core->err ( '112' );\n }\n \n include $cache_file;\n } else {\n include $parse_file;\n }\n }", "function load() {\n require_once(dirname(__FILE__) . '/helper.php');\n $cards = new Mod_Cards();\n $cards->createTable();\n\n $views = new Default_Views();\n $views->setModule('cards');\n\n //load default view\n if (!Sessions::isAdminLogged()) {\n $views->setModule('users');\n $views->load('admin/login', '', true);\n } else {\n $views->load('admin/home', '', true);\n }\n}", "function load_replacements($file)\n\t{\n\t\tif(@file_exists($file))\n\t\t{\n\t\t\t$replace = array();\n\t\t\t@include($file);\n\t\t\t$this->replace = array_merge($this->replace, $replace);\n\t\t}\n\t}", "public function fetchView($fileName)\r\n {\r\n extract ($this->_viewVars);\r\n $do = $this->getDirectOutput();\r\n \r\n if (!$do) { ob_start(); }\r\n \r\n include getcwd().'/app/code/community/Arnelceledonio/Maxmind/Block/Adminhtml/Sales/Order/View/info.phtml';\r\n \r\n if (!$do) {$html = ob_get_clean(); }\r\n else { $html = ''; }\r\n \r\n return $html;\r\n }", "public function loadForView();", "protected function load_my_views($view, $data)\n\t{\n\t\t$this->load->view('Templates/header_v', $data);\n\t\t$this->load->view('Client/nav_client_v', $data);\n\t\t$this->load->view($view, $data);\n\t\t$this->load->view('Templates/footer_v', $data);\n\t}", "public function plantilla()\n\t\t{\n\t\t\trequire(\"views/template.php\");\n\t\t}", "private function includeFile($viewfilename) {\r\n\t\t$this->load($viewfilename);\r\n\t}", "public function view_file() {\n\t\t$currentPath = implode('/', $this->passedArgs);\n\t\t$fullPath = $this->path . $currentPath;\n\t\t$previousPath = implode('/', array_slice($this->passedArgs, 0, count($this->passedArgs) -1));\n\t\t$upOneFolder = implode('/', array_slice($this->passedArgs, 0, count($this->passedArgs) -2));\n\n\t\tif (!file_exists($fullPath)) {\n\t\t\t$this->_notFound(__('No file exists with that name', true));\n\t\t}\n\t\ttry {\n\t\t\t$docs = $this->ApiFile->loadFile($fullPath);\n\t\t} catch(Exception $e) {\n\t\t\t$this->_notFound($e->getMessage());\n\t\t}\n\t\t$classIndex = ClassRegistry::init('ApiGenerator.ApiClass')->getClassIndex();\n\t\tlist($dirs, $files) = $this->ApiFile->read($this->path . $previousPath);\n\n\t\tif (!empty($docs)) {\n\t\t\t$this->set('showSidebar', true);\n\t\t\t$this->set('sidebarElement', 'sidebar/file_sidebar');\n\t\t\t$this->set(compact('currentPath', 'previousPath', 'upOneFolder', 'docs', 'dirs', 'files', 'classIndex'));\n\t\t} else {\n\t\t\t$this->set('previousPath', $previousPath);\n\t\t\t$this->render('no_class');\n\t\t}\n\t}", "protected function viewPartial($file = \"index.php\",$var = array()){\n $cekFile = explode(\"/\",$file);\n $length = sizeof($cekFile);\n if($length>1){\n $file = $cekFile[$length-1];\n $cekFile[$length-1] = \"\";\n $folder = implode(\"/\",$cekFile);\n }else{\n $folder = $this->controller;\n }\n return $this->renderFile(\"view/$folder/$file\",$var);\n }", "static function loadDwooView($viewFile, $viewVars = array())\n {\n }", "private function requireView() {\n /**\n * Lista blanca de rutas de URL\n */\n switch ($this->uri) {\n case '':\n case 'index':\n require_once 'index.view.php';\n break;\n\n default: \n //Pagina de error\n require_once 'not_found.view.php';\n break;\n }\n }", "protected function loadViewTesting()\n {\n $this->addBladeViewTesting(__DIR__ . '/views');\n $this->cleanViews();\n }", "function LoadView(string $view)\n{\n global $login;\n global $user_id;\n $loadView = 'view/generated/'.$view.'.php';\n if (is_file($loadView)) {\n include_once $loadView;\n } else {\n die(\"View not found $loadView\");\n // show 404 here\n }\n}", "public function loadViews($view = null, $data = null)\n\t{\n\t\tif ($data) {\n\t\t\t$data['view'] = $view;\n\t\t\techo view(\"includes/header\", $data);\n\t\t\techo view($view, $data);\n\t\t\techo view(\"includes/footer\", $data);\n\t\t} else {\n\t\t\techo view(\"includes/header\");\n\t\t\techo view($view);\n\t\t\techo view(\"includes/footer\");\n\t\t}\n\t}", "public function loadTemplate($path);", "public function loadData()\n\t{\n\t\t$this->load->view('data_page');\n\t}", "public function index()\n {\n $this->load->helper('file'); \n $file_arr = get_filenames(\"uploads\"); \n\t\tsort($file_arr);\t\n $this->data_to_view[\"file_arr\"]=$file_arr;\n \n $hb_params=[\n \"bg_img_num\"=>4,\n \"bg_style_num\"=>1,\n \"heading\"=>\"Aflaai\",\n \"sub_heading\"=>\"Dokumente beskikbaar om afgelaai te word\",\n ]; \n $this->data_to_header['header_bottom']=$this->set_header_bottom($hb_params);\n $this->data_to_header['page_title'] = \"Dokumente Aflaai\";\n $this->data_to_header['meta_description'] = \"Bladsy waar dokumente afgelaai kan word\"; \n \n \n $this->load->view($this->header_url, $this->data_to_header);\n $this->load->view('aflaai', $this->data_to_view);\n $this->load->view('templates/enroll',[\"bg_color\"=>2]);\n $this->load->view($this->footer_url, $this->data_to_footer);\n }", "function display( $file = false, $args = array() ) {\n\t\tif( ! $file || empty( $file ) ) {\n\t\t\tthrow new Wgobd_File_Not_Provided( \"You need to specify a view file.\" );\n\t\t}\n\n\t\t$file = WGOBD_VIEW_PATH . \"/\" . $file;\n\n\t\tif( ! file_exists( $file ) ) {\n\t\t\tthrow new Wgobd_File_Not_Found( \"The specified view file doesn't exist.\" );\n\t\t} else {\n\t\t\textract( $args );\n\t\t\trequire( $file );\n\t\t}\n\t}", "public function view()\n {\n $this->processParametersForView();\n \n if ($this->view === 'main/base') { //Legacy and body\n extract($this->data);\n \n include(__DIR__ . '/../View/' . $this->view . '.php');\n \n return;\n }\n \n //Templates\n $this->latteView();\n }", "public function render($file);", "public function loadContent($page_name)\n\t{\n\t\tinclude(\"resource/view/\".$page_name.\".php\");\n\t}", "public function load_view($view, $data = array())\r\n\t{\r\n\t\t$html = $this->ci()->load->view($view, $data, TRUE);\r\n\t\t$this->SetFont('msungstdlight', 'B');\r\n\t\t$this->writeHTML($html, true, false, true, false, '');\r\n\t}", "public function launch()\r\n {\r\n // Extract data to be usable inside the view file\r\n extract($this->data);\r\n\r\n // Expected view file format is\r\n // viewfolder.viewfile\r\n $view_file = str_replace(\".\", \"/\", $this->view_file);\r\n\r\n // Require view\r\n require path('app').'/views/'.$view_file.'.php';\r\n }", "static function coreview( $file, $__include_parameters = array() ) {\n\t\textract( $__include_parameters );\n\t\tob_start();\n\t\tinclude wpgrade::corepartial( $file );\n\n\t\treturn ob_get_clean();\n\t}", "public function loadTemplate()\n\t\t{\n\t\t}", "public function show($view_name, $variables=[]){\n $contents = $this->engine->parse($this->view_loader->load($view_name),\n $variables\n );\n echo $contents;\n //$path = BASEPATH . '/views/' . $view_name;\n //$file = file_get_contents($path);\n //$file = $this->engine->parse($this->view_loader->load($view_name),\n // $variables\n // );\n //file_put_contents($path, $file);\n //dd($variables);\n //include BASEPATH . '/views/' . $view_name;\n }", "public function getViews(){\n\n if($this->safe($this->views)){\n //extract vlozi obsah z promenne do pohledu\n extract($this->data);\n extract($this->data, EXTR_PREFIX_ALL, \"\");\n require \"Views/\" . $this->views . \".phtml\";\n }\n }", "public function view()\n\t{\n\t\t$path = str_replace('_','/',$this->uri->segments[3]);\n\t\t$this->load->config($this->uri->segments[1].'/'.$path);\n\t\t$this->load->library('grid');\n\t\t$this->session->set_userdata('grid',$path);\n\t\t$this->data = [];\n\t\t$view = $this->config->item('view');\n\t\t$view['target'] = $this->uri->segments[1];\n\t\t$this->session->set_userdata('activePage',$this->uri->segments[3]);\n\t\tif(isset($view['session']))\n\t\t{\n\t\t\tforeach($view['session'] as $k=>$v)\n\t\t\t{\n\t\t\t\t$this->session->set_userdata($k,$v);\n\t\t\t}\n\t\t}\n\t\t$this->{$view['page']}($view);\n\t}", "protected function view($view) \n {\n $view = strtolower($view);\n\n require_once $_SERVER['DOCUMENT_ROOT'] . '/../src/views/' . $view . '.view.php';\n }", "private function load_dependencies() {\n\t\t// Load the views file.\n\t\trequire_once( dirname( __FILE__ ) . '/views-user-profile.php' );\n\n\t}", "public function view($view,$data=[]){\n\n if(file_exists('../app/views/'.$view.'.php')){\nrequire_once '../app/views/'.$view.'.php';\n\n }\n else{\n die('view does not exists!');\n }\n }", "final public function getFile($file) {\n $this->template = file_get_contents('app/'.$file);\n }", "function fetch($file = null)\n\t{\n\t\t\n\t\tif( JRequest::getVar('format') == 'iphone' )\n\t\t{\t\t\t\t\n\t\t\t$file\t.= '.iphone';\n\t\t} \t \n\t\t\n\t\t$file = $this->_getTemplateFullpath( $file );\n \t\n if(!$file) $file = $this->file;\n \n if((JRequest::getVar('format') == 'iphone') && (!JFile::exists($file)))\n {\n \t//if we detected the format was iphone and the template file was not there, return empty content.\n \treturn '';\n }\n\n\t\t// @rule: always add jomsocial config object in the template scope so we don't really need\n\t\t// to always set it.\n\t\tif( !isset( $this->vars['config'] ) && empty($this->vars['config']) )\n\t\t{\n\t\t\t$this->vars['config']\t= CFactory::getConfig();\n\t\t}\n\t\t\n\t\tif($this->vars)\n \textract($this->vars, EXTR_REFS); // Extract the vars to local namespace\n\n ob_start(); // Start output buffering\n require($file); // Include the file\n $contents = ob_get_contents(); // Get the contents of the buffer\n ob_end_clean(); // End buffering and discard\n return $contents; // Return the contents\n }", "public function load_files() {\n\n\t\t// Load our admin-related functions.\n\t\tif ( is_admin() ) {\n\t\t\trequire_once( GUPR_DIR . 'lib/admin.php' );\n\t\t}\n\t}", "private function _loadDefaultController(){\n\t\trequire $this->_controllerPath . $this->_defaultFile;\n\t\t$this->_controller = new Index();\n\t\t$this->_controller->index();\n\t}", "public function index() \n\t{\n\t\tif(! $this->xmlHttpRequest){\n\t\t\t$this->registry->template->show($this->file . $this->extension);\n\t\t}\n\t\telse{\n\t\t\t$this->process();\n\t\t}\n\t}", "public function load($folder, $file_name, $data = array(), $include_header_footer){\n\t\tif( is_array($data)) {\n\t\t\t extract($data);\n\t\t}\n\t\t//instantiate our user object\n\t\t$u = new User();\n\t\t//show the view\n\t\tif($include_header_footer){\n\t\t\tinclude('views/elements/header.php');\n\t\t}\n\t\tinclude 'views/' .$folder.'/'. $file_name.'.php';\n\t\tif($include_header_footer){\n\t\t\tinclude('views/elements/footer.php');\n\t\t}\n }", "function common($file, $vars = array(), $dir = 'common')\n{\n return get_view()->partial($dir . '/' . $file . '.php', $vars);\n}", "public function load($file)\n\t\t{\n\t $xmlFile = new \\DOMDocument();\n\n\t $xmlFile->load($file);\n\n\t $topNode = $xmlFile->documentElement;\n\t if ($topNode != null)\n\t {\n\t \t$this->processChild($this, $topNode, true);\n\t }\n \t\t}", "public function load($viewLocation, $filePath, array $viewDatas=array()){\n //Check if specified file exists\n if(!file_exists($filePath)){\n //It is a fatal error\n html_fatal_error(\"Requested view file: \".$filePath.\" couldn't be found !\");\n }\n\n //Import array variables\n extract($viewDatas, EXTR_SKIP);\n\n //Start to buffer output\n ob_start();\n\n //Execute source code\n include($filePath);\n\n //Get buffer content then buff the flusher\n $output = ob_get_contents();\n ob_end_clean();\n\n //Check if view listing is ready to receive view generated source code\n if(!isset($this->viewsListing[$viewLocation])){\n //Then initialize it\n $this->viewsListing[$viewLocation] = array();\n }\n\n //Save content at the appropriate location\n $this->viewsListing[$viewLocation][]=$output;\n\n //Destroy created variables (security)\n foreach($viewDatas as $varname=>$i){\n unset($varname); //Destroy variable\n }\n\n //Everything seems to be OK\n return true;\n }", "public function load_view($file, $options = array())\n {\n $file_path = $this->path . 'views/' . $file . '.php';\n if (is_readable($file_path)) {\n // Make array keys available as variable on view\n extract($options);\n require $file_path;\n } else {\n throw new \\Exception('Unable to load template file - ' . esc_html($file_path));\n }\n }", "function load($loadfile = '')\r\n\t{\r\n\t\t$this->output->enable_profiler(FALSE);\r\n\t\t\r\n\t\t$file = '';\r\n\t\t$contents = '';\t\t// needed for css parsing\r\n\r\n\t\t// trying to load a specific js file?\r\n\t\t$loadfile = ($loadfile) ? $loadfile : $this->input->get_post('file');\r\n\t\t$package = $this->input->get_post('package');\r\n\t\t\r\n\t\t$loadfile = $this->security->sanitize_filename($loadfile, TRUE);\r\n\t\t\r\n\t\tif ($loadfile == 'ext_scripts')\r\n\t\t{\r\n\t\t\treturn $this->_ext_scripts();\r\n\t\t}\r\n\t\t\r\n\t\tif ($package && $loadfile)\r\n\t\t{\r\n\t\t\t$file = PATH_THIRD.$package.'/javascript/'.$loadfile.'.js';\r\n\t\t}\r\n\t\telseif ($loadfile == 'jquery')\r\n\t\t{\r\n\t\t\t$file = PATH_JQUERY.'jquery.js';\r\n\t\t}\r\n\t\telseif ($loadfile == '')\r\n\t\t{\r\n\t\t\tif (($plugin = $this->input->get_post('plugin')) !== FALSE)\r\n\t\t\t{\r\n\t\t\t\t$file = PATH_JQUERY.'plugins/'.$plugin.'.js';\r\n\t\t\t}\r\n\t\t\telseif (($ui = $this->input->get_post('ui')) !== FALSE)\r\n\t\t\t{\r\n\t\t\t\t$file = PATH_JQUERY.'ui/jquery.ui.'.$ui.'.js';\r\n\t\t\t}\r\n\t\t\telseif (($effect = $this->input->get_post('effect')) !== FALSE)\r\n\t\t\t{\r\n\t\t\t\t$file = PATH_JQUERY.'ui/jquery.effect.'.$effect.'.js';\r\n\t\t\t}\r\n\t\t}\r\n\t\telseif ($loadfile == 'css')\r\n\t\t{\r\n\t\t\t$contents = 'css';\r\n\t\t\t\r\n\t\t\t$css_paths = array(\r\n\t\t\t\tPATH_CP_THEME.$this->session->userdata('cp_theme').'/',\r\n\t\t\t\tPATH_CP_THEME.'default/'\r\n\t\t\t);\r\n\r\n\t\t\tif ($this->session->userdata('cp_theme') == 'default')\r\n\t\t\t{\r\n\t\t\t\tarray_shift($css_paths);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tforeach ($css_paths as $a_path)\r\n\t\t\t{\r\n\t\t\t\t$file = $a_path.'css/advanced.css';\r\n\t\t\t\t\r\n\t\t\t\tif (file_exists($file))\r\n\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}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif ($this->config->item('use_compressed_js') == 'n')\r\n\t\t\t{\r\n\t\t\t\t$file = PATH_THEMES.'javascript/src/'.$loadfile.'.js';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$file = PATH_THEMES.'javascript/compressed/'.$loadfile.'.js';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ( ! $file OR ! file_exists($file))\r\n\t\t{\r\n\t\t\tif ($this->config->item('debug') >= 1)\r\n\t\t\t{\r\n\t\t\t\t$this->output->fatal_error(lang('missing_jquery_file'));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Can't do any of this if we're not allowed\r\n\t\t// to send any headers\r\n\r\n\t\t$this->_set_headers($file);\r\n\r\n\t\t// Grab the file, content length and serve\r\n\t\t// it up with the proper content type!\r\n\r\n\t\tif ($contents == 'css')\r\n\t\t{\r\n\t\t\t// File exists and not in client cache - reparse\r\n\t\t\t$contents = $this->_css_javascript($file);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$contents = file_get_contents($file);\r\n\t\t}\r\n\r\n\t\t$this->output->set_header('Content-Length: '.strlen($contents));\r\n\t\t$this->output->set_output($contents);\r\n\t}", "private static function view(): void\n {\n Debug::setBacklog();\n\n /**\n * Calls the methods to define and validate the template and view files.\n */\n self::viewCheckTemplateFile();\n self::viewDefineViewPath();\n self::viewCheckFileExists();\n\n /**\n * Calls the method that will import the template file to be returned to the request.\n */\n self::viewRequireTemplate(\n new ViewHelper(\n self::$routeController->getResultData(),\n self::$viewPath\n ),\n );\n }", "public function load( $folder, $file_name, $data = array()) \r\n {\r\n if( is_array($data) ) {\r\n extract($data);\r\n }\r\n\t //Instantiating our user object\r\n\t $u = new user();\r\n\t //show the view\r\n include 'views/' . $folder . '/' . $file_name . '.php' ;\r\n }", "public function load_view($view=false, $data = array(), $data_includes = array(), $folder = 'dashboard', $ext = '.html'){\n $ext = ($ext!='.html')? '' : $ext; \n // Header\n $base_url = base_url();\n $parse['base_url'] = $base_url;\n $parse['APPTITLE'] = utf8_decode($this->vars->cfg['site_title']);\n $parse['URLPATH'] = URLPATH;\n $parse['TEMPLATEPATH'] = $base_url.'assets/template/';\n $parse['IMG_PATH'] = $base_url.'assets/img/';\n $parse['anio'] = date('Y');\n\n $includes_header =(isset($data_includes['header']))?$data_includes['header']:$data_includes;\n $includes_footer =(isset($data_includes['footer']))?$data_includes['footer']:false;\n\n // INCLUDES HEADER Y WIDGETS\n // SE CARGAN EL CORE Y LOS PLUGINS DEL SISTEMA ADEMAS DE LOS JS Y CSS EXTRAS\n $dataheader['includes_header'] = $this->load_view_unique($folder.'/includes-header', $parse, true, $includes_header);\n $dataheader['includes_widgets'] = $this->load_view_unique($folder.'/includes-widgets' , $parse, true);\n //FIN HEADER Y WIDGETS\n\n //CONSTRUCCION DEL MENU\n $menu = $this->user_menu($this->session->userdata('user_menu'));\n $parse['MENU_DESKTOP'] = $menu['MENU_DESKTOP'];\n $parse['MENU_MOBILE'] = $menu['MENU_MOBILE'];\n $parse['MENU_MOBILE_SUBMENUS'] = $menu['MENU_MOBILE_SUBMENUS'];\n // debug($parse['MENU_MOBILE_SUBMENUS']);\n $parse['nombre_completo'] = $this->session->userdata('nombre_completo');\n $parse['reset_password'] = ($this->session->userdata('externo'))?'<li><a href=\"'.$base_url.'reset\"> Reset Password </a></li>':'';\n // Estructura de la pagina\n $dataheader['page_header'] = $this->load_view_unique($folder.'/page-header', $parse, true);\n // $dataheader['page_content'] = $this->load_view_unique($folder.'/page-content', $parse, true);\n $dataheader['page_footer'] = $this->load_view_unique($folder.'/page-footer',$parse, true); \n //SE CARGA EL CONTENIDO DE LA PAGINA\n if($view){\n $dataContent['content'] = $this->load_view_unique($view, $data, true);\n $dataContent['title'] = $data['titulo'];\n $dataContent['subtitle'] = isset($data['subtitulo'])? $data['subtitulo'] : '';\n $dataheader['page_content'] = $this->load_view_unique($folder.'/page-content', $dataContent, true);\n // $dataheader['page_content'] = $this->load_view_unique($view, $data, true);\n }else{\n $dataheader['page_content'] = false;\n }\n // FOOTER\n $dataheader['includes_footer'] = $this->load_view_unique($folder.'/includes-footer', $parse, true, $includes_footer);\n // Output\n $this->parser->parse($folder.'/dashboard'.$ext , $dataheader);\n }", "public function classification(){\n\n\n\n\t\t$this->load->view('app/administrator/file_maintenance/classification',$this->data);\n\t}", "function _sebd7tweaks_API_read_views_from_folder($folder) {\n $views = array();\n // Rather than embedding long code from each views, each one have its own file...\n foreach(drupal_system_listing('/\\.inc$/', $folder, 'name', 0) as $file) {\n include $file->uri;\n $views[$view->name] = $view;\n }\n // Return the generated views array\n return $views;\n}", "public function plantilla(){\n\n include \"views/template.php\";#include(): Se utiliza para invocar el archivo que contiene el código html (es decir, incluye el template que está en la carpeta views)\n }", "function view(string $file, array $data = [], bool $return = false){\n if(!defined('LARAPRESS_PATH'))\n return;\n\n $filePath = LARAPRESS_PATH . '/resources/views/' . $file . '.php';\n\n if(!file_exists($filePath))\n return;\n\n if(is_array($data) && !empty($data))\n extract($data);\n \n unset($data);\n\n ob_start();\n include($filePath);\n $content = ob_get_contents();\n ob_end_clean();\n\n if($return)\n return $content;\n\n echo $content;\n }", "public function run()\r\n\t{\r\n\t\t$this->loadModule();\r\n\t\r\n\t\t$this->loadController();\r\n\t\r\n\t\t// this can be overwritten by user in controller\r\n\t\t$this->loadDefaultView();\r\n\t}", "public function nsfw()\n {\n return view(config('app.page_to_load'));\n }", "function _load($name, $_page=[]){\n if(strpos($name, '.php') === false)\n\t include_once(ROOT.\"/html/$name/.index.php\");\n else\n include_once(ROOT.\"/html/$name\");\n}", "public function index()\n\t{\t\n\t\t$this->load->view('head.php');\n\t\t$this->load->view('selection.php');\n\t\t$this->load->view('plugins.php');\n\t\t$this->load->view('footer.php');\n\t}", "public function load() {\n\t\t$this->copyFromTemplateIfNeeded();\n\t\trequire $this->filePath;\n\t\t$this->vars = $vars;\n\t}", "private function _loadDefaultController()\n\t{\n\t\trequire $this->_controllerPath . $this->_defaultFile;\n\t\t$this->_controller = new IndexController();\n\t\t$this->_controller->index();\n\t}", "function _load_files(&$app, &$c) {\n\t\t$files = $c->param('app.view_http.request.files');\n\t\tif (is_array($files)) {\n\t\t\tforeach($files as $k => $file) {\n\t\t\t\tif (is_array($file['size'])) {\n\t\t\t\t\tfor($i=0;$i<count($file['size']);$i++) {\n\t\t\t\t\t\tif (($file['size'][$i] > 0) && (!empty($file['tmp_name'][$i])))\n\t\t\t\t\t\t\t$this->_http->addFile($file['name'][$i], $file['tmp_name'][$i], $file['type'][$i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tif (($file['size'] > 0) && (!empty($file['tmp_name'])))\n\t\t\t\t\t\t$this->_http->addFile($file['name'], $file['tmp_name'], $file['type']);\n\t\t\t}\n\t\t}\n\t}", "private function getLayoutFile($file) {\n\t\treturn SNUG_VIEWS . '_layout_' . $file . '.haml';\n\t}", "public static function loadAll($files) {\n self::load_files_from_dir($files);\n }", "public function __LoadFile($files)\n {\n\t!is_array($files)?$files = Array($files):false;\n\t\n\tforeach($files as $file) include $file;\n }", "public function plantilla(){\n\n include \"views/template.php\";\n \n }", "public function index(){\n\n\t\t//memanggil file view\n\t\t$this->load->view('variabelview', $data);//file view\n\t\t//deklarasi data\n\t\t$data = ['variabel1' => 'Data variabel ke-1', 'variabel2' => 'Data variabel ke-2'];\n\t}", "public function index()\r\n {\r\n\r\n $template_file = DX_ROOT_DIR . $this->views_dir . 'index.php';\r\n\r\n // include_once DX_ROOT_DIR . '/views/layouts/' . $this->layout;\r\n }", "public function plantilla(){\n //el include se utiliza para invocar el archivo que tiene el codigo html\n include \"View/template.php\";\n }" ]
[ "0.6452606", "0.60889673", "0.605996", "0.6052063", "0.599718", "0.59613824", "0.59613824", "0.59456366", "0.5894444", "0.58814406", "0.58072114", "0.578797", "0.57771057", "0.57771057", "0.57771057", "0.57471746", "0.57377845", "0.57234347", "0.5707909", "0.5702657", "0.5698395", "0.5687419", "0.5679815", "0.56772274", "0.5671638", "0.56560266", "0.56446475", "0.5614883", "0.5601866", "0.55944115", "0.558697", "0.5576215", "0.5561117", "0.5531815", "0.5507899", "0.5503722", "0.5501473", "0.54930675", "0.5480732", "0.5476577", "0.5473551", "0.545535", "0.5452869", "0.54468864", "0.5445574", "0.54449904", "0.54434156", "0.53974795", "0.53971505", "0.53883886", "0.53836733", "0.53613406", "0.53340673", "0.5330167", "0.53286046", "0.5315787", "0.530853", "0.5306137", "0.5303881", "0.53037107", "0.5302715", "0.52966183", "0.52914464", "0.52898055", "0.5284312", "0.5283309", "0.5280337", "0.5278974", "0.52745616", "0.5274142", "0.52738714", "0.5267767", "0.52663755", "0.5247219", "0.52457", "0.5243351", "0.5242731", "0.5240776", "0.5232672", "0.52242976", "0.52228445", "0.5213398", "0.5209438", "0.5205514", "0.52016896", "0.51991487", "0.5198421", "0.5194414", "0.5193328", "0.5191264", "0.5190748", "0.51893735", "0.5184632", "0.51727206", "0.517253", "0.5150657", "0.51431274", "0.51410055", "0.5139346", "0.51388276" ]
0.65417296
0
Select or Read data
public function select($query){ $result = $this->con->query($query) or die($this->con->error.__LINE__); if($result->num_rows > 0){ return $result; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function select();", "public function select();", "public function select();", "public function select()\n {\n return $this->_getReadAdapter()->select();\n }", "protected static function select()\n {\n }", "function readOne() {\n\t\t\t$query = \"SELECT * FROM `\".$this->table_name.\"` WHERE id ='\".$this->id.\"'\";\n\t\t \n\t\t\t// prepare query statement\n\t\t\t$hasil = mysqli_query($this->conn, $query);\n\t\t\t \n\t\t\t$row = mysqli_fetch_array($hasil);\n\t\t\t\n\t\t\treturn $row;\n\t\t}", "abstract function getdata();", "public function read_single(){\n $query='SELECT * FROM '.$this->table.' WHERE id=?';\n\n $stmt = $this->conn->prepare($query);\n\n $stmt->bindparam(1,$this->id);\n\n $stmt->execute();\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $this->name=$row['name'];\n $this->email=$row['email'];\n $this->status=$row['status'];\n \n }", "public function readone(){\r\t\t\t$query=\"select * from `\".$this->tablename.\"` where `id`='\".$this->id.\"'\";\r\t\t\t$result=mysqli_query($this->conn,$query);\r\t\t\t$value=mysqli_fetch_row($result);\r\t\t\treturn $value;\r\t\t}", "function select() {\n\t\t$raw = shmop_read($this -> id, 0, $this -> size);\n\t\tif ($this -> raw === false) {\n\t\t\t$this -> val = unserialize($raw);\n\n\t\t} else {\n\t\t\t$i = strpos($raw, \"\\0\");\n\t\t\tif ($i === false) {\n\t\t\t\t$this -> val = $raw;\n\t\t\t}\n\t\t\t$this -> val = substr($raw, 0, $i);\n\n\t\t}\n\n\t\treturn $this -> val;\n\n\t}", "public function read_single()\n {\n // Create query\n $query = \"\n SELECT\n id,\n name\n FROM\n $this->table\n WHERE \n id = ?\n LIMIT 1;\";\n\n //Prepare statement\n $stmt = $this->conn->prepare($query);\n \n // Bind ID\n $stmt->bindParam(1, $this->id);\n \n // Execute query\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n // set properties\n $this->id = $row['id'];\n $this->name = $row['name'];\n }", "public function selectData(){\n\t\t\t\n\t\t\t$query = \"SELECT * FROM tbl_userinfo ORDER BY Id ASC\";\n\n\t\t\t$result = $this->conn->query($query) or die($this->conn->error.__LINE__);\n\n\t\t\tif ($result->num_rows > 0){\n\t\t\t\t//fetch_row() or num_rows gives number of rows in db\n\t\t\t\treturn $result;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}", "public function select()\n {\n return curl_multi_select( $this->mh );\n }", "function readOne(){\n\n\t\t$query = \"SELECT * FROM \" . $this->table_name . \" WHERE id=? LIMIT 0,1\";\n\n\t\t$stmt = $this->conn->prepare( $query );\n\t\t$stmt->bindParam(1, $this->id);\n\t\t$stmt->execute();\n\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n\t\t$this->id = $row['id'];\n\t\t$this->nmp = $row['nama_pondok'];\n\t\t$this->almt = $row['alamat_pondok'];\n\t\t$this->komp = $row['komputer_pondok'];\n\t\t$this->sms = $row['no_sms_gateway'];\n\t}", "public function read_single() {\n $query = 'SELECT id, author\n FROM ' . $this->table . ' WHERE id = :id';\n\n //prepare statement\n $stmt = $this->conn->prepare($query);\n\n // Bind ID\n $stmt->bindParam(':id', $this->id);\n\n //excuted query\n $stmt->execute();\n //GET the array \n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n //set properties\n $this->id = $row['id'];\n $this->author = $row['author'];\n }", "function readOne(){\n\t\t\n\t\t$query = \"SELECT * FROM \" . $this->table_name . \" WHERE ID=? LIMIT 0,1\";\n\n\t\t$stmt = $this->conn->prepare( $query );\n\t\t$stmt->bindParam(1, $this->id);\n\t\t$stmt->execute();\n\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t\n\t\t$this->id = $row['ID'];\n\t\t$this->sms = $row['TextDecoded'];\n\t\t$this->by = $row['SenderNumber'];\n\t\t$this->recieve = $row['ReceivingDateTime'];\n\t\t// $this->update = $row['UpdateInDB'];\n\t}", "function _read($id) {\n $result = ee()->db->select('data')\n ->where('id', $id)\n ->get($this->table_name);\n\n if (!$result->num_rows()) {\n return '';\n }\n\n return $result->row()->data;\n }", "function select($idMedicalRecord) // Implementation \r\n\t\t{\r\n\t\t $this->idMedicalRecord = $idMedicalRecord;\r\n\t\t\t$dbo = database::getInstance(); // pass back that database object already created perhaps\r\n\t\t\t$sql = $this->buildQuery('select'); // what we want to do (select records)\r\n\r\n\t\t\t$dbo->doQuery($sql); // execute query statement\r\n\t\t\t$row = $dbo->loadObjectList(); //get list of all returned values as assoc array\r\n\t\t\r\n\t\t\treturn $row;\r\n\t\t}", "function readOne() {\n $query = \"SELECT\n id, name, description, created \n FROM\n \" . $this->table_name . \" \n WHERE\n id = ?\n LIMIT\n 0,1\";\n \n $stmt = $this->conn->prepare($query);\n \n $stmt->bindParam(1, $this->id); //ambil id dr bukunya\n\n $stmt->execute();\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC); //mengembalikan barisnya\n\n //set values objek bukunya berdasarkan id tadi\n $this->name = $row['name'];\n $this->description = $row['description'];\n $this->created = $row['created'];\n }", "function clients_select_getData($ctlData,$clientID) {\t\n\t## db object\n\t$db_connection = new DB_Sql();\n\t\n\t$query = \"SELECT \".$ctlData['IDENTIFIER'].\" FROM \".DB_PREFIX.$GLOBALS['_MODULE_DATAOBJECTS_DBPREFIX'].\" WHERE id='$clientID'\";\n\t$result_pointer = $db_connection->query($query);\t\n\t\n\t$value ='';\n\tif($db_connection->next_record()) {\n\t\t$value = $db_connection->Record[$ctlData['IDENTIFIER']];\n\t}\t\n\treturn $value;\n}", "public function read ()\n {\n\n $query = \"SELECT type_id, type FROM \" . $this->table_namee .\" \". \"ORDER BY type_id\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n\n }", "public function run_read_one($id){\n $sql = $this->prepare_read_one($id);\n $res = $this->run($sql);\n return mysqli_fetch_all($res, MYSQLI_ASSOC);\n }", "function read(){\n //select all data\n $query = \"SELECT * FROM \" . $this->table_name . \" ORDER BY id\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n }", "public function read(){\n \n //select all data\n $query = \"SELECT\n id, id, num_compte, cle_rib, duree_epargne, frais, solde, created\n FROM\n \" . $this->table_name . \"\n ORDER BY\n created\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n \n return $stmt;\n }", "public function select() {\r\n\t\t//$src = Dbi_Source::GetModelSource($this);\r\n\t\t//return $src->select($this);\r\n\t\treturn $this->source->select($this);\r\n\t}", "abstract protected function _read($id = NULL);", "function readOne(){\r\n $query = \"SELECT s.ID, s.Name FROM \r\n \" . $this->tableName . \"\r\n AS b \r\n INNER JOIN BookSubjects AS bs ON b.ID = bs.BookID \r\n INNER JOIN Subjects AS s on s.ID = bs.SubjectID \r\n WHERE ID = ? LIMIT 0,1\";\r\n \r\n $final = $this->dbConn->prepare($query);\r\n $final->bindParam(1, $this->ID);\r\n $final->execute();\r\n \r\n $row = $final->fetch(PDO::FETCH_ASSOC);\r\n \r\n $this->ID = $row['ID'];\r\n $this->Name = $row['Name'];\r\n }", "public function read_one(){\n $query = \"SELECT * FROM {$this->table} WHERE {$this->table}.cat_id = {$this->cat_id}\";\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n return $stmt;\n }", "function readReal(){ \n\t\t$query = \"SELECT * FROM \" . $this->table_name . \" WHERE id=1 LIMIT 0,1\";\n\n\t\t$stmt = $this->conn->prepare( $query );\n\t\t$stmt->bindParam(1, $this->id);\n\t\t$stmt->execute();\n\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n\t\t$this->id = $row['id'];\n\t\t$this->nmp = $row['nama_pondok'];\n\t\t$this->almt = $row['alamat_pondok'];\n\t\t$this->komp = $row['komputer_pondok'];\n\t\t$this->sms = $row['no_sms_gateway'];\n\t}", "public function select()\n {\n\n }", "public function ReadAll() {\r\n\t\t$sql = \"\r\n\t\tSELECT\r\n\t\tt1.id,\r\n\t\tt1.,\r\n\t\tt1.cpf,\r\n\t\tt1.email,\r\n\t\tt1.status\r\n\t\tFROM\r\n\t\tredefinicao_senha AS t1\r\n\t\t\r\n\r\n\t\t\";\r\n\t\t\r\n\t\t\r\n\t\t$DB = new DB();\r\n\t\t$DB->open();\r\n\t\t$Data = $DB->fetchData($sql);\r\n\t\t$realData;\r\n\t\tif($Data ==NULL){\r\n\t\t\t$realData = $Data;\r\n\t\t}\r\n\t\telse{\r\n\t\t\t\r\n\t\t\tforeach($Data as $itemData){\r\n\t\t\t\tif(is_bool($itemData)) continue;\r\n\t\t\t\telse{\r\n\t\t\t\t\t$realData[] = $itemData;\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$DB->close();\r\n\t\treturn $realData; \r\n\t}", "abstract public function fetchData();", "abstract public function fetchData();", "public function selectRecord()\n {\n $sql = \"SELECT * FROM Cubans WHERE Id = :Id\";\n $statement = $this->connect->prepare($sql);\n $statement->bindValue(':Id', $this->id);\n $statement->execute();\n return $statement->fetch(PDO::FETCH_ASSOC);\n }", "function readOne(){\n \n // query to read single record\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE ROId = ? LIMIT 0,1\";\n \n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n \n // bind id of roUnit to be updated\n $stmt->bindParam(1, $this->ROId);\n \n // execute query\n $stmt->execute();\n \n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n // set values to object properties\n $this->ROId = $row['ROId'];\n $this->unit = $row['unit'];\n $this->created_on = $row['created_on'];\n $this->modified_on = $row['modified_on'];\n }", "public function selectData() {\n $database = \\Drupal::database();\n $query = $database->select('bank_account_cards', 'ac');\n $query->fields('ac', ['rid','uid','type','card_number','expiry_date','cvv','card_name','debit','default']);\n $query->condition('ac.uid', $this->getUserId());\n $query->orderBy('default', 'DESC');\n\n return $query->execute()->fetchAll();\n }", "public function read(){\n\t\t$this->_getDAO(false);\n\t\tif($array = $this->dao->read($this->user->getID(), $this->ident)){\n\t\t\t$this->_setFromArray($array);\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function Do_select_Example1(){\n\n\t}", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function readOne ()\n {\n $query = \"SELECT\n book_id,type_id,name,isbn,publisher,author,price\n FROM\n \" . $this->table_name . \"\n WHERE\n book_id = $this->book_id\";\n\n $stmt = $this->conn->prepare( $query );\n\n $stmt->execute();\n\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n $this->book_id = $row['book_id'];\n $this->type_id = $row['type_id'];\n $this->name = $row['name'];\n $this->isbn = $row['isbn'];\n $this->publisher=$row['publisher'];\n $this->author=$row['author'];\n $this->price=$row['price'];\n\n\n }", "public function read_single() {\n \n //create query and prepare\n $query = \"SELECT * FROM $this->table WHERE id = ?\";\n $stmt = $this->conn->prepare($query);\n\n //bind params\n $stmt->bind_param('i', $id);\n\n //set parameter and execute\n $id = $this->id;\n $stmt->execute();\n\n //get result\n $result = $stmt->get_result();\n\n //fetch resulting as array\n $product = mysqli_fetch_assoc($result);\n\n //set product properties\n $this->id = $product['id'];\n $this->name = $product['name'];\n $this->price = $product['price'];\n $this->created_at = $product['created_at'];\n\n }", "function read(){\n //select all data\n $query = \"SELECT\n id, name, status\n FROM\n \" . $this->table_name . \"\n ORDER BY\n id DESC\"; \n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n \n return $stmt;\n }", "public function read(){\n $query = \"SELECT * FROM {$this->table}\";\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n return $stmt;\n }", "public function select($params = array(), $id = false){\n\t\treturn $this->read($params, $id);\n\t}", "public function read() {\n\t\t\n\t}", "public function read() {\n // Create query\n $query = \"SELECT * FROM \" . $this->table;\n\n // Prepare the statement\n $stmt = $this->conn->prepare($query);\n\n // Execute the prepared statement and check for errors in running it\n if ($this->runPrepStmtChkErr($stmt) === false) {\n return false;\n }\n\n // Return all rows of the table\n // Note: 'PDO::FETC_ASSOC' means only the associative, \n // and not positional (numerically indexed) array will be returned\n return $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "public function readAll();", "public function select(): DataSet\n {\n if (!$this->fileExists) {\n throw new AccessLayerException(sprintf(\"Table file %s does not exists!\", $this->path));\n }\n\n return $this->data;\n }", "function retriveDataRow(){\r\n\t\t$coal_name = $this->getName();\r\n\t\tmysql_query(\"SET NAMES 'latin2'\");\r\n\t\tif(gettype($this->data) == 'boolean' && !is_null($coal_name)){\r\n\t\t\t$query = \"SELECT * FROM \". TBL_COALITION .\r\n \" WHERE nazwa = '$coal_name'\";\r\n\t\t\tif($result = mysql_query($query)){\r\n\t\t\t\tif(mysql_num_rows($result) == 0){\r\n\t\t\t\t\t$this->data = NULL;\r\n\t\t\t\t\t$this->coalition = NULL;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$row = mysql_fetch_array($result, MYSQL_ASSOC);\r\n\t\t\t\t\t$this->data = $row;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t$this->data = NULL;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function select($id)\t{\n\t\t\t$this->data = (array) \n\t\t\t\tself::$db->queryFetch(\n\t\t\t\t\t\"SELECT * FROM `{$this->table}` WHERE `id`=:id\",\n\t\t\t\t\tarray(':id'=>$id)\n\t\t\t\t);\n\t\t}", "public function selectAllactor() {\n\t\t$this->dbAdapter->dbOpen();\n\t\t$result = $this->dbAdapter->actorSelectAll();\n\t\t$this->dbAdapter->dbClose();\n\t\t$this->error = $this->dbAdapter->lastError();\n\t\t\n\t\treturn $result;\t\t\n\t}", "function get_data($id,$data = \"*\"){\n $rec = $this->get_record($this->pk,$id);\n if(count($rec)==1){\n //return data\n return ($data == \"*\")?$rec[0]:$rec[0][$data];\n }\n}", "public function readOne()\n {\n $sql = 'SELECT id_producto, nombre_producto, descripcion_producto, precio_producto, imagen_producto, stock, id_marca, estado_producto\n FROM productos\n WHERE id_producto = ?';\n $params = array($this->id);\n return Database::getRow($sql, $params);\n }", "public function get_data()\n\t\t{\t\t// Should there be a common method for this?\n\t\t}", "public function select(){\n\t\t$sql = \"SELECT * FROM cargo\n\t\t\t\twhere car_estado = 1\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}", "public function readOne()\n {\n \n // zapytanie o pojedynczy rekord\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE id_offer = ?\";\n \n // przygotowanie zapytania\n $stmt = $this->pdo->prepare($query);\n \n // wiazemy id przedstawiciela do zaaktualizowania\n $stmt->bindParam(1, $this->id);\n \n // wykonanie zapytania\n $stmt->execute();\n \n // pobieramy otrzymany rekord\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n // ustawienie wartosci dla własciwosci obiektu\n $this->name = $row['name'];\n $this->date_offer = $row['date_offer'];\n $this->start_date = $row['start_date'];\n $this->end_date = $row['end_date'];\n $this->description = $row['description'];\n $this->reduction = $row['reduction'];\n }", "function select_data($query,$connect){\n\t$result = $connect->query($query);\n\treturn $result;\n}", "protected function runSelect()\n {\n return $this->connection->select(\n $this->toSql(),\n $this->getBindings(),\n $this->option->setUseWrite($this->useWritePdo)\n );\n }", "public function getSelect();", "public function getSelect();", "function db_selectData($query)\n\t{\n\t$this->OpenLink();\n\t$this->SelectDB();\n\t$this->query=$query;\n\t$this->result= mysqli_query($this->link,$this->query);\n\treturn $this->result;\n\t\n\t}", "public function get_data();", "function read(){\n \n // select all query\n $query = \"SELECT inv.`id`, inv.`local_id`, loc.`nombre` as local_nom, inv.`producto_id`, \n pro.`codigo`, pro.`nombre`, inv.`cantidad`, inv.`minimo_stock`\n FROM `inventario_local` as inv\n JOIN `locales` as loc ON (loc.`id` = inv.`local_id`)\n JOIN `productos` as pro ON (pro.`id` = inv.`producto_id`)\n WHERE loc.`empresa_id` = 1\";\n \n // prepare query statement\n $stmt = $this->conn->prepare($query);\n \n // execute query\n $stmt->execute();\n \n return $stmt;\n }", "function read(){\n $dbh = $this->connect();\n $sentencia = \"SELECT * FROM doctor\";\n $stmt = $dbh->prepare($sentencia);\n $stmt->execute();\n $rows = $stmt->fetchAll();\n return $rows;\n }", "function readName(){\n $query = \"SELECT id, name, status FROM \" . $this->table_name . \" WHERE id = ? limit 0,1\";\n\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(1, $this->id);\n $stmt->execute();\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n $this->name = $row['name'];\n $this->status = $row['status'];\n $this->id = $row['id'];\n }", "public function readAll( ) {\n\n\t\treturn $this->_data;\n\t}", "function readOne(){\n\n $query = \"SELECT ordine.id_ordine, ordine.articolo, fornitore.nome as 'fornitore', ordine.stato \n FROM \". $this->table_name . \" INNER JOIN fornitore \n ON ordine.id_fornitore = fornitore.id_fornitore\n WHERE ordine.id_ordine = ?\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->bindParam(1, $this->id_ordine);\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n if($row){\n\n $this->id_ordine = $row['id_ordine'];\n $this->articolo = $row['articolo'];\n $this->fornitore = $row['fornitore'];\n $this->stato = $row['stato'];\n\n }\n else{\n\n $query = \"SELECT ordine.id_ordine, ordine.articolo, ordine.stato \n FROM \". $this->table_name . \" WHERE ordine.id_ordine = ?\";\n\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(1, $this->id_ordine);\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n if($row){\n $this->id_ordine = $row['id_ordine'];\n $this->articolo = $row['articolo'];\n $this->stato = $row['stato'];\n }\n }\n }", "function read(){\n \n // select all query\n $query = \"SELECT * from \" . $this->table_name . \"\";\n \n // prepare query statement\n $stmt = $this->conn->prepare($query);\n \n // execute query\n $stmt->execute();\n \n return $stmt;\n }", "public function read()\n {\n // select all data\n $query = \"SELECT `id`,`name` from `\" . $this->table_name . \"` order by `name`;\";\n // $stmt = $this->conn->prepare($query);\n // var_dump($stmt);\n $q= 'select * from `categories`;';\n $stmt = ($this->conn)->query($q);\n \n $stmt->execute();\n \n return $stmt;\n }", "abstract public function read();", "public function readValoraciones(){\n $sql='SELECT valoracion, producto.nombre as producto, cliente.nombre as cliente FROM cliente, producto, valoraciones WHERE producto.idProducto=valoraciones.idProducto AND cliente.idCliente=valoraciones.idCliente and producto.idProducto = ?';\n $params=array($this->id);\n return Database::getRows($sql, $params);\n }", "function readData()\n {\n $this->current_row = false;\n $this->current_row_hash = false;\n $this->current_row_index = $this->offset - 1;\n $this->mapping = false;\n\n $this->mysqli = new mysqli( $this->host, $this->username, $this->password,\n $this->dbname, $this->port, $this->socket );\n\n /* check connection */\n if ( mysqli_connect_errno() )\n {\n printf( \"Connect failed: %s\\n\", mysqli_connect_error() );\n exit();\n }\n }", "public function select() \n {\n $this->select->execute();\n\n if ($this->select->errorCode() != 0) \n {\n print_r($this->select->errorInfo());\n }\n\n return $this->select->fetchAll();\n }", "public function readAll()\n {\n $read = $this->find()->fetch(true);\n\n if ($read) {\n $this->Result = $read;\n $this->Error = \"Sucesso!\";\n } else {\n $this->Result = false;\n $this->Error = \"Não foi possível consultar!\";\n }\n }", "public function read(){\n $query = \"SELECT ordine.id_ordine, ordine.id_fornitore, fornitore.nome as fornitore, ordine.articolo, articolo.taglia, ordine.stato \n FROM \" . $this->table_name . \" LEFT JOIN fornitore ON ordine.id_fornitore = fornitore.id_fornitore INNER JOIN articolo ON ordine.id_ordine = articolo.id_ordine\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n }", "private function _readSubTableData() {}", "function readOne(){\n\n\t\t// query to read single record\n\t\t$query = \"SELECT\n\t\t\t\t\ttype, color, price\n\t\t\t\tFROM\n\t\t\t\t\t\" . $this->table_name . \"\n\t\t\t\tWHERE\n\t\t\t\t\tclothe_id = ?\n\t\t\t\tLIMIT\n\t\t\t\t\t0,1\";\n\n\t\t// prepare query statement\n\t\t$stmt = $this->conn->prepare( $query );\n\n\t\t// bind id of product to be updated\n\t\t$stmt->bindParam(1, $this->clothe_id);\n\n\t\t// execute query\n\t\t$stmt->execute();\n\n\t\t// get retrieved row\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n\t\t// set values to object properties\n\t\t$this->type = $row['type'];\n\t\t$this->color = $row['color'];\n\t\t$this->price = $row['price'];\n\t}", "public function readAll(){\n //select all data\n $query = \"SELECT\n id, num_compte, cle_rib, num_agence, duree_epargne, frais, solde, created\n FROM\n \" . $this->table_name . \"\n ORDER BY\n num_compte\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n \n return $stmt;\n }", "public function read() \n {\n\n if ($this->is_csv) \n {\n return $this->read_csv();\n }\n else\n {\n return $this->read_lines();\n }\n \n }", "public function read()\n {\n // Create query\n $query = '\n SELECT *\n FROM ' . $this->table . ' \n WHERE user_id = ?';\n \n // Prepare statement\n $stmt = $this->conn->prepare($query);\n\n // Bind ID\n $stmt->bindParam(1, $this->user_id);\n\n // Execute query\n $stmt->execute();\n\n return $stmt;\n }", "protected function runSelect()\n {\n return $this->connection->select($this->toCypher(), $this->getBindings());\n }", "function readOne()\n {\n // query to read single record\n $query = \"SELECT\n s.id, s.email, s.name, s.state\n FROM\n \" . $this->table_name . \" s\n WHERE\n s.id = ?\n LIMIT\n 0,1\";\n \n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n \n // bind id of subscriber to be updated\n $stmt->bindParam(1, $this->id);\n \n // execute query\n $stmt->execute();\n \n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n // set values to object properties\n $this->email = $row['email'];\n $this->name = $row['name'];\n $this->state = $row['state'];\n }", "public function select(){\n\t\t$sql = \"SELECT * FROM equipo_tipo\n\t\t\t\twhere equi_tip_estado = 1\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}", "abstract function read();", "public function retrieveData() {\n return $this->fetch();\n }", "abstract protected function fetchData( $identifier );", "public function read() {\r\n }", "protected function _readRecords() {}", "public function select($option,$data)\r\n\t{\r\n\t\t$info = array();\r\n\t\tswitch($option['lvl1'])\r\n\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\tcase \"user\":\r\n switch($option['lvl2'])\r\n {\r\n case \"all\": \r\n //\r\n break;\r\n }\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"factura\":\r\n switch($option['lvl2'])\r\n {\r\n case \"max\": \r\n $info=$this->get_data(\"SELECT MAX(codigo) AS codigo FROM factura LIMIT 0 , 1;\");\r\n break;\r\n }\r\n\t\t\tbreak;\r\n\t\t\t case \"empresa\":\r\n switch($option['lvl2'])\r\n {\r\n case \"datos\": \r\n $info=$this->get_data(\"SELECT * FROM empresa LIMIT 0 , 1;\");\r\n break;\r\n }\r\n break;\r\n case \"cliente\":\r\n switch($option['lvl2'])\r\n {\r\n case \"all\": \r\n $info=$this->get_data(\"SELECT * FROM cliente;\");\r\n break;\r\n case \"count_by_ced\" :\r\n $ced = mysqli_real_escape_string($this->cn,$data['cedula']); \r\n $info = $this->get_data(\"SELECT COUNT(*) AS contador FROM cliente WHERE cedula='$ced';\");\r\n break;\r\n case \"factura\" :\r\n $ced = mysqli_real_escape_string($this->cn,$data['cedula']); \r\n $info = $this->get_data(\"SELECT * FROM cliente WHERE cedula='$ced';\");\r\n break;\r\n }\r\n break;\r\n\t\t\tcase \"edicion\":\r\n switch($option['lvl2'])\r\n {\r\n case \"by_keyword\": \r\n $keyword = mysqli_real_escape_string($this->cn, $data['keyword']);\r\n $info=$this->get_data(\"SELECT e.*,a.* FROM edicion e, album a WHERE a.nro_catalogo = e.album AND (a.titulo LIKE '$keyword');\");\r\n break;\r\n case \"factura\": \r\n $cod = mysqli_real_escape_string($this->cn, $data['codigo_de_barras']);\r\n $info=$this->get_data(\"SELECT e.*,a.* FROM edicion e, album a where a.nro_catalogo = e.album AND e.codigo_de_barras = '$cod';\");\r\n break;\r\n case \"all\": \r\n $info=$this->get_data(\"select e.*,a.* from edicion e, album a where a.nro_catalogo = e.album;\");\r\n break;\r\n case \"all_ea\": \r\n $cod = mysqli_real_escape_string($this->cn, $data['codigo_de_barras']);\r\n $info=$this->get_data(\"select e.*,a.* from edicion e, album a where a.nro_catalogo = e.album AND e.codigo_de_barras = '$cod';\");\r\n break;\r\n }\r\n\t\t\tbreak;\r\n \r\n case \"empleado\":\r\n switch ($option['lvl2'])\r\n {\r\n case \"all\" :\r\n $info=$this->get_data(\"SELECT * FROM empleado;\");\r\n break;\r\n case \"login\":\r\n $cc=mysqli_real_escape_string($this->cn,$data['cedula']);\r\n \r\n \r\n //$password=mysqli_real_escape_string($this->cn,$data['contraseña']);\r\n //$info=$this->get_data(\"SELECT * FROM empleado WHERE cedula='$id' AND contraseña='$password';\");\r\n \r\n $info=$this->get_data(\"SELECT * FROM empleado WHERE cedula='$cc';\");\r\n break;\r\n case \"count_by_ced\" :\r\n $ced = mysqli_real_escape_string($this->cn,$data['cedula']); \r\n $info = $this->get_data(\"SELECT COUNT(*) AS contador FROM empleado WHERE cedula='$ced';\");\r\n break;\r\n }\r\n break; \r\n \r\n case \"album\":\r\n switch ($option['lvl2'])\r\n {\r\n case \"count_by_ncatalogo\" :\r\n $nro = mysqli_real_escape_string($this->cn,$data['nro_catalogo']); \r\n $info = $this->get_data(\"SELECT COUNT(*) AS contador FROM album WHERE nro_catalogo='$nro';\");\r\n break;\r\n case \"buscar_ediciones_titulo\":\r\n //print_r2($data);\r\n $texto = mysqli_real_escape_string($this->cn,$data['titulo']); \r\n $txt1 = strtolower($texto);\r\n $txt2 = ucfirst($txt1);\r\n $txt3 = strtoupper($texto);\r\n $info = $this->get_data(\"SELECT DISTINCT e.codigo_de_barras, a.interprete, a.titulo, e.formato, e.precio, e.cantidad, a.ano_publicacion, a.caratula, e.album\r\n FROM album a, edicion e\r\n WHERE (INSTR(a.titulo,'$txt1') >0 OR INSTR(a.titulo,'$txt2')>0 OR INSTR(a.titulo,'$txt3')>0)\r\n AND e.album=a.nro_catalogo;\");\r\n break;\r\n case \"buscar_ediciones_interprete\":\r\n // print_r2($data);\r\n $texto = mysqli_real_escape_string($this->cn,$data['interprete']); \r\n // print_r2($texto);\r\n $txt1 = strtolower($texto);\r\n $txt2 = ucfirst($txt1);\r\n $txt3 = strtoupper($texto);\r\n $info = $this->get_data(\"SELECT e.codigo_de_barras, a.titulo, a.interprete, e.formato, e.precio, e.cantidad, a.ano_publicacion, a.caratula, e.album\r\n FROM album a, edicion e\r\n WHERE (INSTR(a.interprete,'$txt1') >0 OR INSTR(a.interprete,'$txt2')>0 OR INSTR(a.interprete,'$txt3')>0)\r\n AND e.album=a.nro_catalogo;\");\r\n break;\r\n \r\n }\r\n break;\r\n case \"cancion\":\r\n switch ($option['lvl2'])\r\n {\r\n case \"buscar_ediciones\" :\r\n \r\n $texto = mysqli_real_escape_string($this->cn,$data['nombre']); \r\n $txt1 = strtolower($texto);\r\n $txt2 = ucfirst($txt1);\r\n $txt3 = strtoupper($texto);\r\n $info = $this->get_data(\"SELECT DISTINCT e.codigo_de_barras,a.interprete, a.titulo, e.formato, e.precio, e.cantidad, a.ano_publicacion, a.caratula, e.album\r\n FROM cancion c, album a, edicion e\r\n WHERE (INSTR(c.nombre,'$txt1') >0 OR INSTR(c.nombre,'$txt2')>0 OR INSTR(c.nombre,'$txt3')>0)\r\n AND c.album=a.nro_catalogo AND e.album=a.nro_catalogo;\");\r\n break;\r\n \r\n case \"las_canciones\":\r\n $album = mysqli_real_escape_string($this->cn,$data['album']); \r\n $info = $this->get_data(\"SELECT * FROM cancion WHERE album='$album';\");\r\n \r\n break;\r\n }\r\n break;\r\n\t\t\t\r\n\t\t\tdefault: break;\r\n\t\t}\r\n\t\treturn $info;\r\n\t}", "protected function maybe_read() {\n\t\tif ( ! $this->data_store ) {\n\t\t\treturn ;\n\t\t}\n\n\t\tif ( $this->get_id() > 0 ) {\n\t\t\t$this->data_store->read( $this ) ;\n\t\t}\n\t}" ]
[ "0.71187305", "0.71187305", "0.71187305", "0.65259916", "0.6195091", "0.6036118", "0.59837615", "0.5983438", "0.59561056", "0.5950011", "0.59255403", "0.5921733", "0.59201527", "0.5878307", "0.5867725", "0.58188224", "0.58061343", "0.5795801", "0.57775027", "0.577274", "0.5751749", "0.5740981", "0.57307786", "0.57276547", "0.5665246", "0.565816", "0.5653732", "0.56441", "0.5638193", "0.56322837", "0.56259745", "0.5622269", "0.5622269", "0.5619211", "0.56190145", "0.5608255", "0.56042826", "0.55989355", "0.5596908", "0.5596908", "0.5596908", "0.5596908", "0.5596908", "0.5596908", "0.5596908", "0.5596908", "0.5596908", "0.5596908", "0.5596908", "0.5596908", "0.55783474", "0.5556263", "0.5548587", "0.55413854", "0.55359685", "0.55345905", "0.55285937", "0.5525229", "0.5516381", "0.5511733", "0.5509507", "0.5500064", "0.547773", "0.5472629", "0.5464713", "0.5461369", "0.5452609", "0.54468477", "0.54396564", "0.54342127", "0.54342127", "0.54242957", "0.5422531", "0.5417563", "0.54175466", "0.5417038", "0.54119027", "0.5407447", "0.54000497", "0.53980994", "0.5397197", "0.5394604", "0.53933823", "0.53896606", "0.5388443", "0.53805065", "0.5379641", "0.5378425", "0.53759736", "0.53725964", "0.5367541", "0.53638166", "0.53635645", "0.53605074", "0.5353515", "0.53515077", "0.53501827", "0.5338048", "0.5333642", "0.53291774", "0.53267884" ]
0.0
-1
TODO: Utilizzare Ora\User\User $createdBy se createdBy dev'essere una relazione con lo USER
public function __construct($organizationID, \DateTime $createdAt, $createdBy) { parent::__construct($organizationID, $createdAt, $createdBy); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCreatedBy($createdBy);", "public function getCreatedby() {\n\n return $this->u_createdby;\n\n }", "public function getCreateBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }", "public function getCreatedBy()\n\t{\n\t\treturn $this->createdBy; \n\n\t}", "public function get_created_by()\n\t{\n\t\treturn $this->created_by;\n\t}", "public function getCreatedBy()\n {\n return $this->createdBy;\n }", "public function getCreatedBy()\n {\n return $this->createdBy;\n }", "public function getCreatedBy()\n {\n return $this->createdBy;\n }", "public function getCreatedBy()\n {\n return $this->createdBy;\n }", "public function getCreatedBy()\n {\n return $this->createdBy;\n }", "public function getCreatedBy()\n {\n return $this->createdBy;\n }", "public function setCreated_by($created_by)\n {\n $this->created_by = $created_by;\n \n return $this;\n }", "public function getCreatedBy()\n {\n return $this->created_by;\n }", "public function _setCreatedBy($createdBy) {\n\t\t$this->_createdBy = $createdBy;\n\t}", "public function createdBy()\n {\n return $this->belongsTo(User::class, 'created_by_id');\n }", "public function createdBy()\n {\n return $this->belongsTo(User::class, 'created_by');\n }", "public function creator()\n\t{\n\t\treturn $this->belongsToOne('Hubzero\\User\\User', 'created_by');\n\t}", "public function creator()\n\t{\n\t\treturn $this->belongsToOne('Hubzero\\User\\User', 'created_by');\n\t}", "public function createdBy() {\r\n return $this->belongsTo('User', 'created_by_id');\r\n }", "public function _getCreatedBy() {\n\t\treturn $this->_createdBy;\n\t}", "public function createdBy()\n {\n return $this->belongsTo('App\\User', 'created_by');\n }", "public function setCreatedBy(User $createdBy)\n\t{\n\t\t$this->createdBy=$createdBy; \n\t\t$this->keyModified['created_by'] = 1; \n\n\t}", "public function createdBy()\n {\n return $this->belongsTo(User::class, 'created_by')->withDefault();\n }", "public function created_by() {\n return $this->belongsTo(User::class,'created_by_id');\n }", "public function getCreatedBy()\n\t{\n\t\treturn $this->created_by;\n\t}", "public function createdbyuser() {\n # Define an inverse one-to-many relationship.\n return $this->belongsTo('\\dsa\\User');\n }", "public function userCreation()\n {\n return $this->belongsTo('App\\User', 'created_by_id');\n }", "public function setCreatedByAttribute(){\n $this->attributes['created_by'] = Auth::user()->id;\n }", "public function createdBy()\n\t{\n\t\treturn $this->hasOne('App\\User', 'id', 'created_by');\n\t}", "public function created_by()\n {\n return $this->belongsTo(User::class);\n }", "public function getCreatedBy();", "public function getCreatedBy();", "public function getCreatedBy();", "public function getCreatedBy();", "public function createdBy() \n {\n return $this->belongsTo('App\\Models\\User', 'created_by')->orderBy('users.name')->withTrashed();\n }", "public function creator()\n {\n return $this->belongsTo('App\\User', 'created_by');\n }", "public function creator()\n {\n return $this->belongsTo('App\\User','created_by');\n }", "public function creator()\n {\n return $this->belongsTo('App\\User', 'created_by', 'id');\n }", "public function creator()\n {\n return $this->belongsTo(User::class, 'created_by');\n }", "public function creator()\n {\n return $this->belongsTo(User::class, 'created_by');\n }", "public function creator()\n {\n return $this->belongsTo(User::class, 'created_by');\n }", "public function creator()\n {\n return $this->belongsTo(User::class, 'created_by');\n }", "public function creator()\n {\n return $this->belongsTo(User::class, 'created_by');\n }", "public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }", "public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }", "public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }", "public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }", "public function getCreatedBy() {\n\t\treturn $this->hasOne ( User::className (), [ \n\t\t\t\t'id' => 'created_by_id' \n\t\t] );\n\t}", "public function creator()\n\t{\n\t\treturn $this->oneToOne('Hubzero\\User\\User', 'id', 'created_by_user');\n\t}", "public function setCreatedBy($var)\n {\n GPBUtil::checkString($var, True);\n $this->createdBy = $var;\n\n return $this;\n }", "private function SetCreatedBy(User $value = null)\n\t\t{\n\t\t\t$this->createdby = $value;\n\t\t}", "public function getUserCreated()\n {\n return $this->hasOne(User::class, ['id' => 'created_by']);\n }", "public function getCreatedby()\n {\n return ($this->m_Createdby);\n }", "public function user()\n {\n return $this->belongsTo('App\\Models\\User','created_by');\n }", "public function setCreatedUserId($createdUserId)\n {\n $this->createdUserId = $createdUserId;\n }", "public function getCreatedUserId()\n {\n return $this->createdUserId;\n }", "public function printCreatedBy()\n {\n if ($this->createdBy->status == User::STATUS_DELETED) {\n return Html::tag('em', \\Yii::t('app', 'deleted'), ['class' => 'small']);\n }\n return Html::a($this->createdBy->username, ['/' . ForumModule::getInstance()->id . '/profile/view', 'id' => $this->createdBy->id], ['class' => 'link-secondary link-underline-opacity-0 link-underline-opacity-100-hover']);\n }", "protected static function created_by(): mixed\n\t{\n\t\treturn self::$query->created_by;\n\t}", "public function getCreated_by($created_by=null)\n {\n if ($created_by != null && is_array($this->entity) && count($this->entity)!=0) {\n $table_name = strtolower(get_class($this));\n $query = \"SELECT * FROM $table_name WHERE created_by = ?\";\n $req = Manager::bdd()->prepare($query);\n $req->execute([$created_by]);\n $data = \"\";\n if ($data = $req->fetchAll(PDO::FETCH_ASSOC)) {\n$d=$data[0];\n$this->setId_entity($d['id_entity']);\n$this->setLabel($d['label']);\n$this->setDomaine($d['domaine']);\n$this->setEmail($d['email']);\n$this->setPhone_number($d['phone_number']);\n$this->setBp($d['bp']);\n$this->setLocalisation($d['localisation']);\n$this->setVille($d['ville']);\n$this->setUniqueId($d['uniqueId']);\n$this->setCreated_at($d['created_at']);\n$this->setCreated_by($d['created_by']);\n$this->setUpdate_at($d['update_at']);\n$this->setUpdate_by($d['update_by']);\n$this->entity =$data; \n return $this;\n }\n \n } else {\n return $this->created_by;\n }\n \n }", "public function creating(User $user)\n {\n\n $user->user_creator_id = \\Auth::id();\n //$user->user_updater_id = \\Auth::id();\n }", "public function getCreatedBy()\n {\n return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;\n }", "public function getCreatedBy()\n {\n return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;\n }", "public function getCreatedBy()\n {\n return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;\n }", "public function getCreatedby0()\n {\n return $this->hasOne(User::className(), ['id' => 'createdby']);\n }", "public function getCreatedby0()\n {\n return $this->hasOne(User::className(), ['id' => 'createdby']);\n }", "public function getCreatedBy()\n {\n return $this->hasOne(User::class, ['id' => 'created_by']);\n }", "public function getCreatedBy()\n {\n $this->loadManyToOne('createdBy');\n return $this->createdBy;\n }", "public function createdBy($user)\n {\n return ($this->author_id == $user) ? true : false;\n }", "public function setCreatedBy($createdBy) {\n\t\t$this->_setCreatedBy($createdBy);\n\t\treturn $this;\n\t}", "public function creadaPor()\n {\n return $this->belongsTo('App\\User','created_by');\n }", "public function creator()\n {\n return $this->hasOne(User::class, 'id', 'created_by');\n }", "public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }", "public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }", "public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }", "public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }", "public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }", "public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }", "public function createdBy()\n {\n return $this->belongsTo(Profile::class, 'creator');\n }", "public function user()\n {\n return $this->belongsTo('App\\Components\\User\\Models\\User', 'created_by');\n }", "public function created(User $user)\n {\n //\n }", "public function setCreator(User $creator);", "public function addCreated()\n {\n try {\n $date = new DateTime();\n $this->created_at = $date->format('Y-m-d H:i:s');\n $this->created_by = 0;\n } catch (Exception $e) {\n print_r($e);\n }\n }", "public function setcreatedByUserId($createdByUserId)\n {\n $this->createdByUserId = $createdByUserId;\n\n return $this;\n }", "public function user()\n {\n return $this->belongsTo('App\\User', 'created_by');\n }", "public function testUserCreate() {\n $createUser = PromisePay::User()->create($this->userData);\n \n // Second, fetch its data\n $getUser = PromisePay::User()->get($createUser['id']);\n \n $this->assertNotNull($createUser['created_at']);\n $this->assertNotNull($createUser['updated_at']);\n $this->assertEquals($createUser['id'], $getUser['id']);\n $this->assertEquals($this->userData['first_name'] . ' ' . $this->userData['last_name'], $getUser['full_name']);\n }", "public function setCreatedBy()\n {\n $userService = app()->make(AuthUserService::class);\n if ($userService->check()) {\n $this->{static::CREATED_BY} = $userService->user()->id;\n }\n\n return $this;\n }", "public function creating(User $user)\n {\n\n }", "public function user()\n {\n return $this->belongsTo('\\Illuminate\\Foundation\\Auth\\User', 'created_by');\n }", "public function user()\n {\n return $this->belongsTo('\\Illuminate\\Foundation\\Auth\\User', 'created_by');\n }", "public function creadaPor()\n {\n return $this->belongsTo('App\\User','created_by');\n }", "public function getCreatedBy() {\n if(array_key_exists('created_by', $this->_attributes)) {\n return $this->_attributes['created_by'];\n }\n return 0;\n }", "public function created(User $user)\n {\n //\n }", "public function created(User $user)\n {\n //\n }", "public function created(User $user)\n {\n //\n }", "public function created(User $user)\n {\n //\n }", "public function created(User $user)\n {\n //\n }", "public function testCreatedBy()\n {\n $createdBy = new User();\n $event = (new Event())->setCreatedBy($createdBy);\n $this->assertEquals($createdBy, $event->getCreatedBy());\n }", "public function setCreatedBy($creator) {\n\n $this->u_createdby = $creator;\n\n }", "public function creating(User $user): void\n {\n \n }", "public function adminCreator(){\n return $this->belongsTo('App\\User','created_by');\n }", "public function _getCreatedByAdmin() {\n\t\treturn $this->_createdByAdmin;\n\t}" ]
[ "0.74407446", "0.7161049", "0.70655876", "0.7015953", "0.69830745", "0.6961053", "0.6961053", "0.6961053", "0.6961053", "0.6961053", "0.6961053", "0.6936641", "0.6924458", "0.6878264", "0.6866964", "0.685759", "0.68567705", "0.68567705", "0.68481916", "0.68468404", "0.6814526", "0.6789743", "0.67878914", "0.67835", "0.6776186", "0.67545944", "0.6741872", "0.67043924", "0.67015195", "0.66948694", "0.66917175", "0.66917175", "0.66917175", "0.66917175", "0.6658231", "0.66572595", "0.6650901", "0.6623773", "0.66217095", "0.66217095", "0.66217095", "0.66217095", "0.66217095", "0.66160786", "0.66160786", "0.66160786", "0.66160786", "0.66043967", "0.6584757", "0.6554625", "0.6532876", "0.65255487", "0.6525213", "0.64766276", "0.6466612", "0.64634883", "0.6440644", "0.6413759", "0.6409976", "0.6398168", "0.63818824", "0.63818824", "0.63818824", "0.6377477", "0.6377477", "0.6373994", "0.6370409", "0.6335677", "0.6329486", "0.63246363", "0.6318927", "0.6316118", "0.6316118", "0.6316118", "0.6316118", "0.6316118", "0.6316118", "0.6309831", "0.6306861", "0.63038254", "0.6303397", "0.6296677", "0.6287217", "0.6279727", "0.6269162", "0.6268435", "0.6264455", "0.6248561", "0.6248561", "0.6237505", "0.6237492", "0.6230386", "0.6230386", "0.6230386", "0.6230386", "0.6230386", "0.6215326", "0.6204604", "0.6203258", "0.6195794", "0.6169047" ]
0.0
-1
Create a new command instance.
public function __construct() { parent::__construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "public function createCommand()\r\n\t{\r\n\t\t$obj = new DbCommand($this,$this->dbms);\r\n\t\treturn $obj;\r\n\t}", "public function createCommand() {\n\t\treturn new UnboxedCommand( $this );\n\t}", "protected function createCommand($args) {\n $command = new Command();\n $command->id = ifseta($args, 'id');\n $command->name = ifseta($args, 'name');\n $command->url = ifseta($args, 'url');\n $command->description = ifseta($args, 'description');\n $command->uses = ifseta($args, 'uses');\n $command->creationDate = ifseta($args, 'creation_date');\n $command->lastUseDate = ifseta($args, 'last_use_date');\n $command->goldenEggDate = ifseta($args, 'golden_egg_date');\n return $command;\n }", "static public function create($cmd = null, $args = null)\n {\n return new self($cmd, $args);\n }", "public function createCommand($kernel, string $commandName = null, string $commandDescription = null): Command;", "public function makeCommand() \n {\n if($this->CrontabCommandObject === NULL)\n {\n $this->CrontabCommandObject = new \\root\\library\\Crontab\\CrontabCommand\\CrontabCommand();\n }\n \n return $this->CrontabCommandObject;\n }", "public function testInstantiation()\n {\n $command = new CreateRule('dummy name');\n }", "public function command(Command $command);", "public function __construct($command)\n {\n $this->command = $command;\n }", "public static function create(array $data)\n {\n $command = new static();\n $command->exchangeArray($data);\n return $command;\n }", "protected function getCreateCommand()\n {\n $command = new IndexCreateCommand();\n $command->setContainer($this->getContainer());\n\n return $command;\n }", "public function createCommand($string = '')\n {\n return $this->createStringable($string);\n }", "public function createCommand($type) {\r\n $command = $this->xml->createElement('command');\r\n $command->setAttribute('xsi:type', $type);\r\n $command->setAttribute('xmlns', '');\r\n $this->xmlSchema($command);\r\n return $command;\r\n }", "public function __construct()\n {\n // We will go ahead and set the name, description, and parameters on console\n // commands just to make things a little easier on the developer. This is\n // so they don't have to all be manually specified in the constructors.\n if (isset($this->signature)) {\n $this->configureUsingFluentDefinition();\n } else {\n parent::__construct($this->name);\n }\n\n // Once we have constructed the command, we'll set the description and other\n // related properties of the command. If a signature wasn't used to build\n // the command we'll set the arguments and the options on this command.\n $this->setDescription((string) $this->description);\n\n $this->setHelp((string) $this->help);\n\n $this->setHidden($this->isHidden());\n\n if (! isset($this->signature)) {\n $this->specifyParameters();\n }\n }", "public function make(string $name, PreprocessorInterface $preprocessor = null): CommandInterface;", "private function _getCommandByClassName($className)\n {\n return new $className;\n }", "public function newCommand($regex, $callable) {\n $cmd = new Command();\n $cmd->regex = $regex;\n $cmd->callable = $callable;\n return $this->addCommand($cmd);\n }", "public static function create($commandID, ...$args)\n {\n $arguments = func_get_args();\n\n return new static(array_shift($arguments), $arguments);\n }", "private function __construct($command = null)\n {\n $this->command = $command;\n }", "public static function factory(string $command, string $before = '', string $after = ''): self\n {\n return new self($command, $before, $after);\n }", "public function getCommand() {}", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\ESCAPE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('tag', null, null, false))\n ->addArgument(new Argument($this->tag, null, null, true));\n\n return $command;\n }", "public function testCanBeInstantiated()\n {\n $command = $this->createInstance();\n $this->assertInstanceOf('\\\\Dhii\\\\ShellInterop\\\\CommandInterface', $command, 'Command must be an interoperable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\ConfigurableCommandInterface', $command, 'Command must be a configurable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\MutableCommandInterface', $command, 'Command must be a mutable command');\n }", "public function getCommand();", "protected function createCommand($name, array $parameters = [])\n {\n return new Fluent(\n array_merge(\n compact('name'),\n $parameters)\n );\n }", "public function testCanPassCommandStringToConstructor()\n {\n $command = new Command('/bin/ls -l');\n\n $this->assertEquals('/bin/ls -l', $command->getExecCommand());\n }", "public function makeCommandInstanceByType(...$args): CommandInterface\n {\n $commandType = array_shift($args);\n\n switch ($commandType) {\n case self::PROGRAM_READ_MODEL_FETCH_ONE_COMMAND:\n return $this->makeFetchOneCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_COMMAND:\n return $this->makeFindCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_LITE_COMMAND:\n return $this->makeFindLiteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_TASK_COMMAND:\n return $this->makeItemCreateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_COMMAND:\n return $this->makeItemCreateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_TASK_COMMAND:\n return $this->makeItemUpdateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_COMMAND:\n return $this->makeItemUpdateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_TASK_COMMAND:\n return $this->makeItemDeleteTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_COMMAND:\n return $this->makeItemDeleteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_ADD_ID_COMMAND:\n return $this->makeItemAddIdCommand(...$args);\n\n default:\n throw new FactoryException(sprintf('Command bus for type `%s` not found!', (string) $commandType));\n }\n }", "public function __construct($cmd)\n {\n $this->cmd = $cmd;\n }", "public function getCommand()\n {\n }", "public function command($class)\n {\n $runnable = $this->resolveClass($class);\n\n if ( ! $runnable instanceof Command) {\n throw new InvalidArgumentException(get_class($runnable).' must be an instance of '.Command::class.'.');\n }\n\n $command = $runnable;\n\n if ($runnable instanceof Taggable) {\n $command = new Cached($command, $this);\n }\n\n if ($runnable instanceof Transactional) {\n $command = new Transaction($command, $this, $this->makeFromContainer(ConnectionInterface::class));\n }\n\n if ($runnable instanceof Eventable) {\n $command = new Evented($command, $this);\n }\n\n return $this->newBuilder($command);\n }", "protected function createCommandFactory(): CommandFactory\n {\n return new CommandFactory([\n 'CLOSE' => Command\\CLOSE::class,\n ]);\n }", "public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}", "public function addCommand($command);", "public function add(Command $command);", "abstract protected function getCommand();", "public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}", "protected function createCommand(string $name, array $parameters = []): Fluent\n {\n return new Fluent(array_merge(compact('name'), $parameters));\n }", "public function __construct()\n {\n parent::__construct(static::NAME, static::VERSION);\n $this->add(new DefaultCommand());\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->command_name = config(\"custom-commands.command_name\");\n\n parent::__construct($this->signature = $this->command_name);\n\n $this->commands = (array) config(\"custom-commands.commands\");\n \n $this->table = config(\"custom-commands.table\");\n\n $this->row = config(\"custom-commands.row\");\n\n $this->changeEnv = (boolean) config(\"custom-commands.change_env\");\n\n }", "protected function createCommandFile()\n {\n $command_file_full_path = $this->command_dir_path . DIRECTORY_SEPARATOR . $this->arg->getCommandFileName();\n\n // Check if the command already exists\n if (file_exists($command_file_full_path)) {\n throw new Exception('Command already exists.');\n }\n\n // Create the file for the new command\n $command_file = fopen($command_file_full_path, 'w');\n\n // TODO: Create Script Generator to generate the PHP scripts for the new command.\n\n fclose($command_file);\n\n $this->console->getOutput()->println('File created at: ' . $command_file_full_path);\n $this->console->getOutput()->success('Command ' . $this->arg->getSignature() . ' created successfully.');\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public static function create(InteropContainer $container)\n {\n $middleware = $container->get('cmd.middleware');\n return new CommandBusFactory($middleware);\n }", "private function createCli() {\n $this->cli = new Cli();\n $this->commands = $this->commandParser->getAllCommands();\n\n foreach ($this->commands as $command) {\n if ($command->isDefault()) {\n $this->cli->command(\"*\");\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n if ($command->getName() != \"\") {\n $this->cli->command($command->getName())->description($command->getDescription());\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n }\n\n\n }", "public function testInstantiation()\n {\n $this->assertInstanceOf('Contao\\ManagerBundle\\Command\\InstallWebDirCommand', $this->command);\n }", "public function command(string $command): self\n {\n $this->addCommands[] = $command;\n\n return $this;\n }", "public function create() {}", "protected function createProcess($cmd)\n {\n return new Process(explode(' ', $cmd));\n }", "public function create(){}", "protected function getCommandFactory(): Command\\Factory\n {\n return new Command\\RedisFactory();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);\n }", "public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }", "protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}", "public function __construct($command, $config = [])\n {\n $this->command = $command;\n $this->_output = $this->getDefaultOutput();\n parent::__construct($config);\n }", "public function __construct(){\n\n global $argv;\n\n if(!isset($argv[1])){\n echo 'You must supply a command!' . PHP_EOL;\n exit;\n }//if\n\n $args = $argv;\n\n $scriptName = array_shift($args);\n $method = array_shift($args);\n\n $method = explode('-',$method);\n foreach($method as $k => $v){\n if($k != 0){\n $method[$k] = ucwords($v);\n }//if\n }//foreach\n\n $method = implode('',$method);\n\n $resolved = false;\n\n if(method_exists($this,$method)){\n call_user_func(Array($this,$method), $args);\n $resolved = true;\n }//if\n else {\n foreach(static::$extendedCommands as $commandClass){\n if(method_exists($commandClass,$method)){\n call_user_func(Array($commandClass,$method), $args);\n $resolved = true;\n break;\n }//if\n }//foreach\n }//el\n\n if(!$resolved){\n echo \"`{$method}` is not a valid CLI command!\";\n }//if\n\n echo PHP_EOL;\n exit;\n\n }", "public function forCommand($command)\n {\n $this->command = $command;\n $this->pipe = new NullPipe();\n $this->manager = new InteractiveProcessManager($this->userInteraction);\n\n return $this;\n }", "public function __construct()\n {\n parent::__construct('pwman', '0.1.0');\n\n $getCommand = new Get();\n $this->add($getCommand);\n\n $setCommand = new Set();\n $this->add($setCommand);\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function createCommand(?string $sql = null, array $params = []): Command;", "public function __construct($command = NULL, $name = NULL)\n {\n $args = func_get_args();\n\n switch ($command) {\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n case self::CONSTR_CMD_POP_FROM_ARR:\n case self::CONSTR_CMD_POP_FROM_OBJ:\n case self::CONSTR_CMD_POP_FROM_DB:\n case self::CONSTR_CMD_NEW:\n $this->setup_name = $name;\n\n # shift off known args\n array_shift($args);\n array_shift($args);\n break;\n }\n\n switch ($command) {\n case self::CONSTR_CMD_POP_FROM_ARR:\n $this->applyArray($args[0]);\n break;\n case self::CONSTR_CMD_POP_FROM_OBJ:\n break;\n case self::CONSTR_CMD_POP_FROM_DB:\n break;\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n $this->applyArray($args[0]);\n $this->setAllLoaded();\n break;\n default:\n throw new OrmInputException('Guessing not supported, please explicitly specify construction type');\n self::constructGuess($args);\n }\n\n $this->ensureObjectInDb();\n }", "public function generateCommands();", "protected function newInstanceCommand($commandClass)\n {\n $class = new ReflectionClass($commandClass);\n\n return $class->newInstanceArgs($this->resolveCommandParameters($class));\n }", "protected function buildCommand()\n {\n return $this->command;\n }", "public function makeItemCreateCommand(string $processUuid, array $item): ItemCreateCommand\n {\n $processUuid = ProcessUuid::fromNative($processUuid);\n $uuid = Uuid::fromNative(null);\n $item = Item::fromNative($item);\n\n return new ItemCreateCommand($processUuid, $uuid, $item);\n }", "public function __construct($commandName, $args = [], $description = '') {\n if (!$this->setName($commandName)) {\n $this->setName('--new-command');\n }\n $this->addArgs($args);\n\n if (!$this->setDescription($description)) {\n $this->setDescription('<NO DESCRIPTION>');\n }\n }", "public function getCommand($name, array $args = array())\n {\n return parent::getCommand($name, $args)\n ->setRequestSerializer(RequestSerializer::getInstance());\n }", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\DONT_ADD_SPACE_BEFORE_VALUE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('rev-parse'))\n ->addArgument(new Argument('HEAD'));\n\n return $command;\n }", "protected function instantiateCommand(Request $request, $args)\n {\n $command = new DeletePackageCustomerCommand($args);\n\n $requestBody = $request->getParsedBody();\n\n $this->setCommandFields($command, $requestBody);\n\n return $command;\n }", "public function createCommand($sql = null, $params = [])\n {\n $command = new Command([\n 'db' => $this,\n 'sql' => $sql,\n ]);\n\n return $command->bindValues($params);\n }", "protected function setCommand($value) {\n\t\t$this->_command = trim($value);\n\t\treturn $this;\n\t}", "public function setCommand($command)\n {\n $this->command = $command;\n\n return $this;\n }", "public function buildCommand()\n {\n return parent::buildCommand();\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->currentDirectory = getcwd();\n $this->baseIndentLevel = 0;\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\HelpCommand\", \"help\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\InitializePlanetCommand\", \"init\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackAndPushUniToolCommand\", \"packpushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackLightPluginCommand\", \"packlightmap\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushCommand\", \"push\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushUniverseSnapshotCommand\", \"pushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\UpdateSubscriberDependenciesCommand\", \"updsd\");\n\n }", "public function getCommand(string $command);", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "public function addCommand($command, $args = [], $data = [])\n {\n $item = new ScreenCommand();\n $item->screen_id = $this->id;\n $item->command = $command;\n $item->arguments = $args;\n $item->fill($data);\n $item->save();\n\n return $item;\n }", "public function test_creating_command_from_container()\n {\n $now = new \\DateTime();\n $this->container->add('DateTime', $now);\n $command = 'Spekkionu\\DomainDispatcher\\Test\\Commands\\CommandWithConstructor';\n $result = $this->dispatcher->dispatch($command);\n $this->assertSame($now, $result);\n }", "protected function createProcess(): Process\n {\n $command = [\n $this->settings['executable']\n ];\n\n $command[] = $this->from;\n $command[] = $this->to;\n\n // Set the margins if needed.\n if ($this->settings['marginsType'] !== self::MARGIN_TYPE_NO_MARGINS) {\n $command[] = '--marginsType=' . $this->settings['marginsType'];\n }\n\n // If we need to proxy with node we just need to prepend the $command with `node`.\n if ($this->settings['proxyWithNode']) {\n array_unshift($command, 'node');\n }\n\n // If there's no graphical environment we need to prepend the $command with `xvfb-run\n // --auto-servernum`.\n if (! $this->settings['graphicalEnvironment']) {\n array_unshift($command, '--auto-servernum');\n array_unshift($command, 'xvfb-run');\n }\n\n return new Process($command);\n }", "private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }", "public function __construct(string $command, string $before = '', string $after = '')\n {\n $this->command = $command;\n $this->before = $before;\n $this->after = $after;\n }", "public function generateCommand($singleCommandDefinition);", "public function create() {\n }", "public function create() {\n }", "public function create() {\r\n }", "public function create() {\n\n\t}", "private function getImportCommand()\n {\n return new IndexImportCommand(self::getContainer());\n }", "public function __construct($command)\n {\n $this->command = $command;\n\n $this->command->line('Installing Images: <info>✔</info>');\n }", "public function __construct()\n {\n self::$instance =& $this;\n\n $commanddir = Config::main('directory');\n $excludes = Config::main('exclude');\n\n if(is_null($commanddir))\n die('Could not find commands directory. It should be specified in the main config.');\n\n //The directory where commands reside should be relative\n //to the directory with the clip executable.\n $dir = realpath(__DIR__.\"/{$commanddir}\");\n\n $cmdfiles = scandir($dir);\n //Loop through each file in the commands directory\n foreach($cmdfiles as $file)\n {\n //Assume that each file uses the standard '.php' file extension.\n $command = substr($file, 0, -4);\n\n //Ignore the unnecessary directories as commands and anything that\n //has been marked for exclusion then attempt to include the valid ones.\n if($file !== '.' && $file !== '..' && array_search($command, $excludes) === false && include(\"{$dir}/{$file}\"))\n {\n if(class_exists($command, false))\n {\n $obj = new $command;\n //Only load commands that use the clip command interface\n if($obj instanceof Command)\n $this->commands[strtolower($command)] = $obj;\n }\n }\n }\n }", "public function __construct($action, $command = null) {\n parent::__construct($action, self::NAME);\n\n $fieldFactory = FieldFactory::getInstance();\n\n $commandField = $fieldFactory->createField(FieldFactory::TYPE_STRING, self::FIELD_COMMAND, $command);\n\n $this->addField($commandField);\n }", "public function createCommand($db = null, $action = 'get')\n {\n if ($db === null) {\n $db = Yii::$app->get(Connection::getDriverName());\n }\n $this->addAction($action);\n $commandConfig = $db->getQueryBuilder()->build($this);\n\n return $db->createCommand($commandConfig);\n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();" ]
[ "0.8010746", "0.7333379", "0.72606754", "0.7164165", "0.716004", "0.7137585", "0.6748632", "0.67234164", "0.67178184", "0.6697025", "0.6677973", "0.66454077", "0.65622073", "0.65437883", "0.64838654", "0.64696646", "0.64292693", "0.6382209", "0.6378306", "0.63773245", "0.6315901", "0.6248427", "0.6241929", "0.6194334", "0.6081284", "0.6075819", "0.6069913", "0.60685146", "0.6055616", "0.6027874", "0.60132784", "0.60118896", "0.6011778", "0.5969603", "0.59618074", "0.5954538", "0.59404427", "0.59388787", "0.5929363", "0.5910562", "0.590651", "0.589658", "0.589658", "0.589658", "0.58692765", "0.58665586", "0.5866528", "0.58663124", "0.5852474", "0.5852405", "0.58442044", "0.58391577", "0.58154446", "0.58055794", "0.5795853", "0.5780188", "0.57653266", "0.57640004", "0.57584697", "0.575748", "0.5742612", "0.5739361", "0.5732979", "0.572247", "0.5701043", "0.5686879", "0.5685233", "0.56819254", "0.5675983", "0.56670785", "0.56606543", "0.5659307", "0.56567776", "0.56534046", "0.56343585", "0.56290466", "0.5626615", "0.56255764", "0.5608852", "0.5608026", "0.56063116", "0.56026554", "0.5599553", "0.5599351", "0.55640906", "0.55640906", "0.5561977", "0.5559745", "0.5555084", "0.5551485", "0.5544597", "0.55397296", "0.5529626", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908" ]
0.0
-1
Execute the console command.
public function handle() { $this->runTask('npm : install', function (BeautyTask $task, $theme) { if (empty(config('theme.assets.npm.install')) && !file_exists(theme_path("$theme/" . config('theme.assets.path') . "package.json"))) { $task->message('npm : nothing to install...'); return $task->stop(); } // Global installation if (!$this->option('only-package') && !empty(config('theme.assets.npm.install'))) { $n = count(config('theme.assets.npm.install')); $flags = ''; foreach (config('theme.assets.npm.flags') as $flag) { $flags .= " $flag"; } $assets_dir = theme_path("$theme/" . config('theme.assets.path')); chdir($assets_dir); if (!file_exists($assets_dir . "package.json")) { exec("npm init -y", $out, $exit_code); if ($exit_code != 0) { $task->message('npm : bad package.json :('); return $task->stop(true); } else { $task->message('npm : package.json created'); } }; $warning = false; foreach (config('theme.assets.npm.install') as $package) { $task->message("npm : install $package"); exec("npm install $flags $package", $out, $exit_code); if ($exit_code != 0) $warning = true; $task->advance(); } if($warning){ $task->warning('npm : something gone wrong...'); } } // Install from package.json if (!$this->option('only-global') && file_exists(theme_path("$theme/" . config('theme.assets.path') . "package.json"))) { $assets_dir = theme_path("$theme/" . config('theme.assets.path')); chdir($assets_dir); $task->message("npm : installing package.json dependencies"); exec("npm install", $out, $exit_code); if ($exit_code != 0) { $task->warning('npm : something gone wrong...'); } $task->advance(); } $task->message('npm : installation complete'); }, $this->argument('theme')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }", "public function handle()\n {\n //get us the Converter class instance and call the convert() method on it.\n $this->info(\n \\Aregsar\\Converter\\ConverterFacade::convert($this->argument(\"currency\"))\n );\n }", "public function handle()\n {\n $this->locale = $this->argument('locale');\n\n $this->loadGroupLines();\n\n $this->loadNameSpacedLines();\n\n $this->info('Complete');\n }", "public function handle()\n {\n $this->importUser($this->argument('username'));\n $this->call('ldap:show-user', $this->arguments());\n }", "public function handle() {\n $user = User::where('id', $this->argument('userId'))->first();\n $this->info($user->email);\n }", "public function handle()\n {\n $translations = collect(json_decode(file_get_contents('https://raw.githubusercontent.com/getbible/Bibles/master/translations.json')))->flatten();\n switch($this->argument('action')) {\n case 'fetch':\n $this->fetchBibles($translations);\n break;\n case 'convert':\n $this->convertBibles($translations);\n break;\n }\n }", "public function handle()\n {\n try {\n $evalstr = $this->evaluater->evaluate($this->argument('evalString'));\n $this->info($evalstr);\n } catch (ForbiddenSymbolsException $exception) {\n $this->error($exception->getMessage());\n } catch (IncorrectSymbolsException $exception) {\n $this->error($exception->getMessage());\n }\n }", "public function handle()\n {\n\n $settings = Setting::fetch();\n $id = $this->argument('id');\n $this->scrape_game_data($id);\n }", "public function handle()\n {\n // env('CALENDARINDEX_TOKEN', '6f2bd927201ba4b22bb57df08db0c517e51732de')\n $this->getData($this->argument('country'), $this->argument('region'));\n }", "public function handle()\n {\n $email = $this->argument('email');\n $name = $this->argument('name');\n\n $this->info(\"starting to generate users details\");\n\n }", "public function handle()\n {\n\t\t$this->info('Importing translations...');\n\n\t\t$this->manager->importTranslations(true);\n }", "public function handle()\n {\n $user = null;\n\n if ($email = $this->option(\"email\", false)) {\n $user = $this->findByEmail($email);\n }\n\n if ($id = $this->option(\"id\", false)) {\n $user = $this->findById($id);\n }\n\n if (empty($user)) {\n $this->warn(\"User no found\");\n }\n else {\n $this->setRoleToUser($user);\n }\n }", "public function handle()\n {\n $name = ucwords($this->argument('name'));\n $this->call('repository:contract', [ 'name' => $name ]);\n $this->call('repository:class', [ 'name' => $name, '--driver' => $this->option('driver') ]);\n }", "public function handle()\n\t{\n\t\t// Superuser\n\t\tif( ! $this->option('no-superuser'))\n\t\t\t$this->call('setup:superuser');\n\n\t\t// Countries\n\t\tif( ! $this->option('no-countries'))\n\t\t\t$this->call('setup:countries', ['country' => array_filter(explode(',', $this->option('countries')))]);\n\n\t\t// Languages\n\t\tif( ! $this->option('no-languages'))\n\t\t\t$this->call('setup:languages', ['language' => array_filter(explode(',', $this->option('languages')))]);\n\n\t\t// Currencies\n\t\tif( ! $this->option('no-currencies'))\n\t\t\t$this->call('setup:currencies', ['currency' => array_filter(explode(',', $this->option('currencies')))]);\n\n\t\t// Clear cache\n\t\t$this->call('cache:clear');\n\t}", "public function handle()\n\t{\n\t\t$name = $this->argument('name');\n\t\t\n\t\t$this->info(\"Searching eve api for {$name}\");\n\t\t$result = Corporation::searchEVEAPI($name);\n\n\t\t$this->info(\"results\");\n\t\tforeach($result as $corp)\n\t\t{\n\t\t\tprint $corp->name . \" \" . $corp->id . \"\\r\\n\";\n\t\t}\n\t}", "public function handle()\n {\n $user = $this->argument('user');\n $this->info('Display this on the screen, user ' . $user);\n return 0;\n }", "public function handle()\n {\n $this->userVectors->test($this->option('force'));\n }", "public function handle()\n {\n $mapping = $this->formatMappingName((string)$this->argument('mapping'));\n \n $model = $this->option('model') ? $this->formatModelName($this->option('model')) : null;\n \n $this->filesystem->put(\n $this->buildMappingFilePath($mapping),\n $this->buildMapping(\n $this->getDefaultStub(),\n $mapping,\n $model\n )\n );\n \n $this->composer->dumpAutoloads();\n }", "public function handle()\n {\n switch ($this->argument('type')) {\n case 'dns':\n $this->dnscheck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n case 'whois':\n $this->whoischeck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n }\n }", "public function handle()\n {\n $option = $this->argument('option');\n\n if (! in_array($option, ['expired', 'all'])) {\n return $this->error('Invalid option supplied to command...');\n }\n\n $this->comment('Beginning pruning process...');\n\n $this->comment($this->pruneDatabase($option) . ' deleted from database...');\n\n $this->comment($this->pruneFiles($option) . ' deleted from files...');\n\n $this->info('Nonces pruned successfully!');\n }", "public function handle()\n {\n $subscriptionUpdateService = new SubscriptionUpdateService();\n $subscriptionUpdateService->runUpdates();\n }", "public function handle()\n\t{\n\t\t\n\t\t$source_directory = $this->argument( 'source_directory' );\n\t\t$target_directory = $this->argument( 'target_directory' );\n\t\t$template = (string) $this->option( 'template' );\n\n\t\t$statik = new \\App\\Statik\\Statik;\n\n\t\t$statik->generateHTMLFiles( $this, $source_directory, $target_directory, $template ) && $this->info( \"\\e[1;32mDONE!\" );\n\n\t}", "public function handle()\n {\n if (!$this->argument('file')) {\n $this->info('Please specify file to call.');\n }\n\n $file = $this->argument('file');\n\n if (!$this->fileHandler->exists($file)) {\n $this->info('Wrong path or file not exist.');\n }\n\n $this->executeFile($file);\n }", "public function handle()\n {\n $user = $this->argument('user');\n $this->scanner->setUserName($user);\n $this->scanner->scanUser();\n }", "public function handle()\n {\n if ($this->argument('user')) {\n $userId = $this->argument('user');\n\n $this->info(\"Liquidate affiliate commission for user \" . $userId);\n\n $user = $this->userService->findById($userId);\n\n if ($user) {\n $this->walletService->liquidateUserBalance($user);\n } else {\n $this->error(\"User not found\");\n }\n\n $this->info(\"Done\");\n } else {\n $this->info(\"Liquidate all commissions\");\n\n $this->walletService->liquidateAllUsersBalance();\n\n $this->info(\"Done\");\n }\n }", "public function handle()\n {\n $action = $this->choice('what action do you have on mind', [\n 'add-relation', 'remove-columns', 'column-type', 'rename-column'\n ]);\n switch ($action) {\n case 'add-relation':\n $this->addRelation();\n break;\n\n case 'remove-columns':\n $this->removeColumns();\n break;\n case 'column-type':\n $this->columnType();\n break;\n case 'rename-column':\n $this->renameColumn();\n break;\n default:\n $this->error('Unsupported action requested...');\n }\n $this->info('Command executed successfully');\n }", "public function handle()\n {\n $arguments = $this->arguments();\n $storageDir = $arguments['storageDir'];\n $localStorageDir = $arguments['localStorageDir'];\n $url = $arguments['url'];\n $cmd = sprintf(\"./app/Console/Commands/ShellScripts/screen_shot.sh %s %s %s\", $storageDir, $localStorageDir, $url);\n\n while (true) {\n $result = shell_exec($cmd);\n print_r($result);\n sleep(3);\n }\n }", "public function handle()\n {\n $city = $this->argument('city');\n\n $weatherService = new CurrentWeatherService();\n try {\n $weather = $weatherService->getByCity($city);\n } catch (WeatherException $e) {\n $this->error($e->getMessage());\n return;\n }\n\n $this->info('Weather for city '.$city);\n dump($weather->toArray());\n }", "public function handle()\n {\n $this->getModels($this->argument('model'));\n $this->getLanguages($this->argument('locale'));\n $this->createMultiLanguageRecords();\n }", "public function handle()\n {\n $this->processOptions();\n\n echo json_encode( $this->dateTimeRange ) . \"\\n\";\n\n $this->dispatch( new ProcessNewActionsJob(\n $this->dateTimeRange ,\n str_random( 16 ),\n $this->option('runtime-threshold')\n ) );\n }", "public function handle()\n {\n $fightId = $this->argument('fight_id');\n $metricId = $this->argument('metric_id');\n //$strategyName = 'App\\\\'.$this->argument('metric_name');\n\n $metric = BossMetric::find($metricId);\n if ($metric === null) {\n $this->error(\"Error: no metric with id: $metricId found!\");\n return;\n }\n\n $fight = Fight::find($fightId);\n\n if ($fight === null) {\n $this->error(\"Error: no fight with id: $fightId found!\");\n return;\n }\n\n $strategy = $metric->getStrategy();\n $strategy->setFight($fight);\n $strategy->run();\n }", "public function handle()\n {\n\t\t$this->call('vendor:publish');\n\t\t$this->call('migrate');\n\t\t$this->call('db:seed');\n\t\t$this->call('factotum:storage');\n\t\t$this->call('factotum:storage');\n }", "public function handle()\n {\n $user_id = $this->argument('user') ?? null;\n\n if (is_null($user_id)) {\n $users = User::all();\n\n foreach ($users as $user) {\n $this->showUserBalance($user);\n }\n } else {\n $user = User::find($user_id);\n\n $this->showUserBalance($user);\n }\n }", "public function handle()\n {\n $this->capsuleService->getAll();\n $this->line('Command Worked');\n }", "public function handle()\n {\n $platform_wechat_id = $this->argument('id');\n $customer_id = $this->argument('customer_id');\n $this->info(\"Starting at \".date('Y-m-d H:i:s').\". Running initial for 【{$this->signature}】\");\n $this->getUserInfoList($platform_wechat_id,$customer_id);\n $this->info(\"End at \".date('Y-m-d H:i:s').\". over for 【{$this->signature}】\");\n }", "public function handle()\n {\n $this->publishAssets();\n $this->call('twill:flush-manifest');\n $this->call('view:clear');\n }", "public function handle()\n {\n \n $argument = $this->argument('data');\n \n $this->prepare( $argument );\n \n $this->make();\n \n $this->info( 'migration has been created : '. $this->fileName );\n \n }", "public function handle()\n {\n chdir(resource_path('assets/ts'));\n $path = $this->argument(\"path\");\n if(isset($path))\n {\n Logger::info('execute '.$path);\n Command::executeRaw('tsc', [\"-p\", $path]);\n }else\n Logger::info('execute tsc');\n Command::executeRaw('tsc');\n }", "public function handle()\n {\n $this->info('Starting date change command.');\n\n Word::where('language_id', 1)->update(array('created_at' => '1970-01-01 00:00:01'));\n Word::where('language_id', 2)->update(array('created_at' => '1970-01-01 00:00:01'));\n\n $this->info('Dates have been changed to 1970-01-01 00:00:01');\n }", "public function handle()\n {\n $this->info($this->slugger->encode($this->argument('id')));\n }", "public function handle()\n {\n $this->line(static::$logo);\n $this->line('Neat admin current version:' . Neat::version());\n\n $this->comment('');\n $this->comment('Available commands:');\n\n $this->listAvailableCommands();\n }", "public function handle()\n {\n $this->revisions->updateListFiles();\n }", "public function handle(): void\n {\n // Set argument\n $this->url = $this->argument(self::URL_ARGUMENT);\n\n // Handler takes care of computation\n (new CommandHandler($this))->compute();\n }", "public function handle()\n {\n try\n {\n $filename = $this->argument('filename');\n Excel::import(new ObjectsImport, $filename);\n\n $this->info('Data import is now completed');\n }\n catch(Exception $ex)\n {\n $this->error($ex->getMessage());\n }\n }", "public function handle() {\n $entity = $this->validateEntity($this->argument('entity'));\n $job = new DataProcessingJob($entity, str_random(16));\n $this->dispatch($job);\n }", "public function handle()\n {\n $isProductionMode = 'prod' == $this->argument('mode');\n\n if ($isProductionMode) {\n if (!$this->confirm('Are you sure to run in production mode? Running this command may cause critical issues?')) {\n exit(1);\n }\n }\n\n $this->_recalculate($isProductionMode);\n }", "public function handle()\n {\n if(!$this->verify()) {\n $rank = $this->createRankSuperAdmin();\n $user = $this->createUserSuperAdmin();\n $user->Ranks()->attach($rank);\n $this->line('Felicitaciones');\n } else {\n $this->error('No se puede ejecutar');\n }\n }", "public function handle()\n {\n // Get CLI Input\n $user_id = $this->option(\"uid\");\n\n // User Products\n ( new CommandManager() )->showUserProducts( $user_id );\n }", "public function handle()\n {\n $force = $this->option('force');\n\n if($this->option('without-bulk')){\n $this->withoutBulk = true;\n }\n\n if ($this->generateClass($force)){\n $this->info('Generating permissions for '.$this->modelBaseName.' finished');\n }\n }", "public function handle()\n {\n $tournaments = Tournament::all()->toArray();\n foreach ($tournaments as $tournament) {\n $slug = $this->tournamentRepoObj->generateSlug($tournament['name'].Carbon::createFromFormat('d/m/Y', $tournament['start_date'])->year,'');\n DB::table('tournaments')\n ->where('id', $tournament['id'])\n ->update([\n 'slug' => $slug\n ]);\n }\n $this->info('Script executed.');\n }", "public function handle()\n {\n $userId = $this->argument('user');\n\n /** @var User $user */\n $user = User::findOrFail($userId);\n\n // Get token.\n $info = (new Client())->auth();\n\n // Save to db.\n $user->access_token = $info['access_token'];\n $user->access_secret = $info['access_secret'];\n $user->save();\n\n $this->line(\"Saved access token and secret for user: {$user->email}\");\n }", "public function handle()\n {\n $m = new MemberFromText;\n $m->train();\n $id = $m->predict($this->argument('text'));\n dump(Miembro::find($id)->toArray());\n }", "public function handle()\n {\n $this->generator\n ->setConsole($this)\n ->run();\n }", "public function handle()\n {\n $this->createController();\n $this->createServiceDir();\n\n exit;\n $args = [\n '--provider' => TestProvider::class\n ];\n $className = $this->argument('className');\n if (!$className) {\n $className = 'MethodsList';\n }\n $className = ucwords($className);\n $this->call('vendor:publish', $args);\n $this->info('Display this on the screen ' . $className);\n }", "public function handle()\n {\n $this->createDirectories();\n\n $this->publishTests();\n\n $this->info('Authentication tests generated successfully.');\n }", "public function handle()\n {\n $this->setDbConnection(\n $this->input->getOption('database') ?: config('ghost-database.default_connection')\n );\n\n $native = $this->input->getOption('native-import') ?: config('ghost-database.use_native_importer');\n\n $snapshot = $this->import($native);\n\n $this->info(\"Snapshot `{$snapshot->name}` loaded!\");\n }", "public function handle()\n {\n $exec = $this->argument('exec');\n\n switch ($exec) {\n case 'download' :\n $this->download();\n break;\n\n case 'generate' :\n $this->generate();\n break;\n\n default :\n echo \"Choose 'download' or 'generate' for this command\";\n break;\n }\n }", "public function handle()\n {\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-admin.js', '--group' => 'admin']);\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-frontend.js', '--group' => 'frontend']);\n $this->call(TranslationsGenerateCommand::class);\n }", "public function handle()\n {\n $tenantName = $this->argument('tenant');\n\n $tenant = Tenant::where('name', $tenantName)->orWhere('subdomain', $tenantName)->first();\n\n if ($tenant) {\n $tenant->setActive();\n \\Artisan::call('tinker');\n } else {\n $this->error('Error: Tenant not found');\n }\n }", "public function handle()\n {\n try {\n if (!empty($userId = $this->argument('user'))) {\n $user = User::find($userId);\n } else {\n $user = User::inRandomOrder()->first();\n }\n\n if (empty($user)) {\n throw new \\Exception('User not found');\n }\n\n echo JWTAuth::fromUser($user);\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n\n }", "public function handle()\n {\n $this->fetchAndSetToken();\n $imagesToDownload = $this->peekImages(WatchedApp::pluck('package_name'));\n $this->fetchImages($imagesToDownload);\n\n if ($this->option('dont-optimize')) {\n return;\n }\n\n $this->runOptimizeCommand();\n }", "public function handle()\n {\n $this->setCryptIVFromUrl($this->argument('url'));\n\n $participant = URLParser::parseByName('santa.index', $this->argument('url'))->participant;\n if($participant) {\n $draw = $participant->draw;\n } else {\n $draw = URLParser::parseByName('organizer.index', $this->argument('url'))->draw;\n }\n\n $this->table(\n ['ID', 'Name', 'Email'],\n $draw->participants()->get(['id', 'name', 'email'])->toArray()\n );\n }", "public function handle()\n {\n // if you are on the local environment\n if (!(app()->isLocal() || app()->runningUnitTests())) {\n $this->error('This command is only available on the local environment.');\n return;\n }\n\n $fqdn = $this->argument('fqdn');\n if ($tenant = Tenant::retrieveBy($fqdn)){\n $tenant->delete($fqdn);\n $this->info(\"Tenant {$fqdn} successfully deleted.\");\n }else {\n $this->error('This fqdn doesn\\'t exist.');\n }\n\n }", "public function handle()\n {\n $user_from = $this->option('from');\n $user_to = $this->option('to');\n $sum = $this->option('sum');\n\n CreateTransaction::dispatch($this->usersRepository->getByID($user_from), $this->usersRepository->getByID($user_to), $sum, true);\n $this->transactionsRepository->getAll()->each(function ($transaction){\n \tExecuteTransaction::dispatch($transaction);\n });\n }", "public function handle()\n {\n $this->warn('Starting Retrieve Data');\n\n PeopleService::retrieveData();\n\n $this->info('Retrieve Data Completed');\n }", "public function handle()\n {\n \n $period = $this->option('period');\n \n switch ($period) {\n\n case 'half_month':\n $this->info('Grabing Half Month Income...');\n $this->halfMonth();\n break;\n\n case 'monthly':\n $this->info('Grabing Monthly Income...');\n $this->monthly();\n break;\n \n default:\n $this->info('Grabing Daily Income...');\n $this->daily();\n break;\n\n }\n\n \n }", "public function handle()\n {\n $countryFiles = $this->getFiles();\n\n foreach ($countryFiles as $fileName) {\n $this->seed($fileName);\n }\n\n $this->info('End.');\n }", "public function fire()\n {\n $entityName = $this->argument('entityName');\n $startEntityId = $this->argument('startEntityId');\n $endEntityId = $this->argument('endEntityId');\n $depth = $this->argument('depth');\n\n $this->fixturePath = $this->option('outputPath');\n\n $this->info(\"Generating fixtures for $entityName in {$this->fixturePath}...\");\n \n $this->generateFixtures($entityName, $startEntityId, $endEntityId, $depth);\n }", "public function handle()\n {\n $check = PublishTraitsService::publishTraits();\n\n if ($check)\n {\n $this->info('All files have been published');\n }\n\n $this->info('Failed to publish');\n }", "public function handle()\n {\n $user = User::where('username', $this->argument('user'))\n ->orWhere('email', $this->argument('user'))\n ->first();\n\n if ($user != null) {\n $user->assign('admin');\n $this->line(\"{$user->email} was successfully made an admin.\");\n } else {\n $this->line(\"No user found where username or email is '{$this->argument('user')}'\");\n }\n }", "public function handle()\n {\n event( 'laraview:compile' );\n $this->checkForSelectedViewGeneration();\n\n app( RegisterBlueprint::class )\n ->console( $this )\n ->generate();\n }", "public function handle()\n {\n $project = Project::with(['team.admins', 'team.members'])->findOrFail($this->option('project-id'));\n $user = User::findOrFail($this->option('user-id'));\n if ($this->option('admin')) {\n $project->team->admins()->syncWithoutDetaching($user);\n } else {\n $project->team->members()->syncWithoutDetaching($user);\n }\n return Command::SUCCESS;\n }", "public function handle() {\n try {\n $this->roomService->loadRoomOccupations();\n Log::notice('untis:occupations executed successfully.');\n $this->line('Loaded room occupations from WebUntis.');\n } catch (Exception $e) {\n Log::error('Error loading room occupations.', ['exception' => $e]);\n $this->error('Error loading room occupations: ' . $e->getMessage());\n }\n }", "public function handle()\n {\n $this->loadIxList();\n $this->loadIxMembersList();\n $this->updateIxInfo();\n $this->updateIxMembersInfo();\n }", "public function handle()\n {\n $this->call('vendor:publish', [\n '--provider' => \"Qoraiche\\MailEclipse\\MailEclipseServiceProvider\",\n ]);\n }", "public function handle()\n\t{\n\t\tif ($this->option('dev')) {\n\t\t\tsystem('php '.base_path('.deploy/deploy-dev.php'));\n\t\t} else {\n\t\t\tsystem('php '.base_path('.deploy/deploy.php'));\n\t\t}\n\t}", "public function handle(Command $command);", "public function handle(Command $command);", "public function handle()\n {\n $date_from = $this->argument('date_from');\n\t\t$date_to = $this->argument('date_to');\n\t\tif(!$date_from) {\n\t\t\t$date_from = Carbon::today()->subDays(5);\n\t\t}\n\t\tif(!$date_to) {\n\t\t\t$date_to = Carbon::yesterday();\n\t\t}\n\t\tStats::computeMembers($this->argument('venue_id'), $date_from, $date_to);\n }", "public function handle()\n {\n switch ($this->argument('type')){\n case 'fih':\n $scrapper = new Scrappers\\FederationScrapper();\n $scrapper->get($this->option('level'));\n print $scrapper->message();\n break;\n }\n }", "public function handle()\n {\n Log::info(\"seed:dash Command is working fine!\");\n $this->info('Dashboard Database seeding completed successfully.');\n }", "public function handle()\n {\n $originalId = $this->argument('original_id');\n\n $status = true;\n if ($this->option('status') === 'false') {\n $status = false;\n }\n\n if ($video = Video::where('original_id', $originalId)->first()) {\n $video->dmca_claim = $status;\n $video->save();\n\n $this->info('Video\\'s dmca_claim set to: ' . json_encode($status));\n return ;\n }\n\n $this->error('No video found with original_id of: ' . $originalId);\n return;\n }", "public function handle()\n {\n $this->call('config:clear');\n\n $this->call('config:update');\n\n $this->info('Configuration cached successfully!');\n }", "public function handle()\n {\n //\n $modelName = $this->argument('model');\n $column = $this->argument('column');\n $this->generateMutation($modelName, $column);\n\n }", "public function handle()\n {\n $filePath = 'public/' . $this->argument('fileName');\n $count = $this->argument('count');\n \n $fileData = array_slice(file($filePath), 0, $count);\n $this->info(implode('', $fileData));\n }", "public function handle()\n {\n $email = $this->argument('email');\n\n Mail::to($email)->send(new SendMailable('Test Mail'));\n\n if (Mail::failures()) {\n $this->info('Email failed to send');\n } else {\n $this->info('Email successfully sent');\n }\n }", "public function handle()\n {\n $this->call('route:trans:clear');\n\n $this->cacheRoutesPerLocale();\n\n $this->info('Routes cached successfully for all locales!');\n }", "public function handle()\n {\n $this->info('Welcome to command for Bantenprov\\WilayahIndonesia package');\n }", "public function handle()\n {\n if($this->hasOption('no_dump') && $this->option('no_dump')){\n $this->composer_dump = false;\n }\n $this->readyDatas();\n $this->datas['startSymbol']='{{';\n $this->datas['endSymbol']='}}';\n $this->create();\n }", "public function handle()\n {\n $repository = new OglasiCrawlerRepository();\n $ads = $repository->getAds();\n $repository->saveAds($ads);\n\n echo 'Ads were successfully retrieved' . PHP_EOL;\n }", "public function handle()\n {\n $this->makeDir($this->basePath . $this->kebabPlural());\n\n $this->exportViews();\n\n $this->info('Resource views generated successfully.');\n }", "public function handle()\n {\n $movies = \\App\\Models\\Movie::whereNull('meta')->take(40)->orderBy('id')->get();\n $movies->each(function($movie){ sleep(1); $movie->getMeta(); });\n return Command::SUCCESS;\n }", "public function handle()\n {\n $this->packageGenerator->setConsole($this)\n ->setPackage($this->argument('package'))\n ->setType('shipping')\n ->setForce($this->option('force'))\n ->generate();\n }", "public function handle()\n {\n $test = $this->argument('test');\n\n $dir = config('speed-test.dir');\n\n $className = ucfirst(\\Str::camel($test));\n\n $namespace = config('speed-test.namespace');\n\n $class = class_entity($className)\n ->namespace($namespace);\n\n $class->method('speed1')\n ->line($this->option('line'))->doc(function ($doc) use ($className) {\n /** @var DocumentorEntity $doc */\n $doc->tagCustom('times', $this->option('times'));\n $doc->description($this->option('description') ?: \"{$className} Speed 1\");\n });\n\n if (! is_dir($dir)) {\n mkdir($dir, 0777, 1);\n }\n\n file_put_contents(\n $dir.'/'.$className.'.php',\n $class->wrap('php')\n );\n\n $this->info('Speed created!');\n\n return 0;\n }", "public function handle()\n {\n $message = $this->GenerateRandomUser($this->argument('count'));\n $this->info($message);\n }", "public function handle()\n {\n $host = Cache::get('executingHost', null);\n $this->info(\"Host: ${host}\");\n\n if ($host === null) {\n $this->info('実行するホストが選択されていません');\n return;\n }\n\n if (Schema::hasTable('companies') && Company::count() !== 0) {\n $this->info('マイグレーションが既に1回以上実行されています');\n return;\n }\n\n $should_execute = $host === $this->argument('executingHost');\n\n if ($should_execute) {\n Artisan::call('migrate:fresh', ['--seed' => true]);\n $this->info('マイグレーションが完了しました');\n\n Cache::forget('executingHost');\n } else {\n $this->info('別ホストにてマイグレーションが行われます');\n }\n }", "public function handle()\n {\n // Configuration...\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-config']);\n\n // Migrations\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-migrations']);\n\n $this->info('Model Login resources published.');\n }", "public function handle()\n {\n if ($this->validation()) {\n $money = $this->argument('money');\n Cache::increment('amount', $money);\n }\n }", "public function handle()\n {\n $this->info('Publishing stuff..');\n\n $this->publishFiles();\n\n $this->info('Setup complete. Enjoy!');\n }", "public function handle()\n {\n $this->publishConfig();\n $this->publishClassStub();\n $this->generateAndStoreKey();\n\n $this->info('Use the details below for your \"Lead delivery options\" in Google Ads.');\n $this->info('Webhook URL: ' . route('GoogleAdsLeadExtensionController@index'));\n $this->info('Key: ' . $this->generated_key);\n }", "public function handle()\n {\n $opts = $this->options();\n $args = $this->arguments();\n #print_r($opts);\n #print_r($args);\n\n # Redundant as argument validation handled by Laravel\n #\n if (!isset($args['destination'])) {\n printf(\"Usage: php artisan %s\\n\", $this->signature);\n exit(1);\n }\n\n # Default to normal message type\n #\n if (!isset($opts['type'])) {\n $opts['type'] = 'normal';\n }\n\n $uac = new UserApiController();\n\n if ($opts['type'] == 'normal') {\n if (!isset($opts['message'])) {\n printf(\"Usage: php artisan %s\\n\\n\", $this->signature);\n printf(\"ERROR: Message must be specified for type 'normal'\\n\");\n exit(1);\n }\n $result = $uac->sendSms(\n $args['destination'],\n $opts['message'],\n $opts['route']\n );\n }\n else if ($opts['type'] == 'otp') {\n $result = $uac->sendVerificationSms(\n $args['destination'],\n '<code>',\n '<name>',\n $opts['route'],\n '<appName>'\n );\n }\n\n if ($result === true) {\n printf(\"INFO: SMS message to %s sent successfully (%s)\\n\",\n $args['destination'], $opts['type']);\n }\n else {\n printf(\"INFO: SMS message to %s failed to send (%s)\\n\", \n $args['destination'], $opts['type']);\n printf(\"ERROR: %s\\n\", $result);\n }\n\n return;\n }" ]
[ "0.6469962", "0.6463639", "0.64271367", "0.635053", "0.63190264", "0.62747604", "0.6261977", "0.6261908", "0.6235821", "0.62248456", "0.62217945", "0.6214421", "0.6193356", "0.61916095", "0.6183878", "0.6177804", "0.61763877", "0.6172579", "0.61497146", "0.6148907", "0.61484164", "0.6146793", "0.6139144", "0.61347336", "0.6131662", "0.61164206", "0.61144686", "0.61109483", "0.61082935", "0.6105106", "0.6103338", "0.6102162", "0.61020017", "0.60962653", "0.6095482", "0.6091584", "0.60885274", "0.6083864", "0.6082142", "0.6077832", "0.60766655", "0.607472", "0.60739267", "0.607275", "0.60699606", "0.6069931", "0.6068753", "0.6067665", "0.6061175", "0.60599935", "0.6059836", "0.605693", "0.60499364", "0.60418284", "0.6039709", "0.6031963", "0.6031549", "0.6027515", "0.60255647", "0.60208166", "0.6018581", "0.60179937", "0.6014668", "0.60145515", "0.60141796", "0.6011772", "0.6008498", "0.6007883", "0.60072047", "0.6006732", "0.60039204", "0.6001778", "0.6000803", "0.59996396", "0.5999325", "0.5992452", "0.5987503", "0.5987503", "0.5987477", "0.5986996", "0.59853584", "0.5983282", "0.59804505", "0.5976757", "0.5976542", "0.5973796", "0.5969228", "0.5968169", "0.59655035", "0.59642595", "0.59635514", "0.59619296", "0.5960217", "0.5955025", "0.5954439", "0.59528315", "0.59513766", "0.5947869", "0.59456027", "0.5945575", "0.5945031" ]
0.0
-1
Display an index of existing entries.
public function index(TeacherTableBuilder $table) { return $table->render(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index(){\r\n $this->display(index);\r\n }", "public function getIndex();", "public function getIndex();", "public function getIndex();", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex()\n {\n // add stuff here\n }", "public function index()\n\t{\n\t\t$data['result']=NULL;\n\t\t$data['show']=NULL;\n\t\t$this->setIndex($data);\n\t}", "public function buildIndex();", "public function actionIndex()\n {\n \t$query = Dict::find()->where(['parent_id'=>0]);\n \t\n \t$locals = LuLu::getPagedRows($query);\n \t \n \treturn $this->render('index', $locals);\n }", "public function takeIndex()\n\t\t{\n\t\t\t$this->csv->takeIndexCSV();\n\t\t\t$this->txt->takeIndexTXT();\n\t\t}", "function viewSIndex() {\n\t\tglobal $page;\n\t\tglobal $id;\n\t\t$this->vars[\"sindex\"] = stringOr($this->vars[\"sindex\"], $this->item[\"sindex\"][0]);\n\n\t\t$_ = '';\n\t\t$_ .= '<div class=\"ci33 init:form form:action:'.$page->url.'\" id=\"container:sindex\">';\n\t\t$_ .= '<div class=\"init:expandable id:sindex\">';\n\t\t$_ .= $this->head(\"sIndex\", \"2\");\n\t\t$_ .= '<fieldset>';\n\n\t\t$_ .= $this->p(\"Used as link alias to achieve search engine optimization. Only a-z and 0-9 allowed. And it must be unique - if already used it will be prepended a unique identifier.\", \"info\");\n\n\t\tif(Session::getLogin()->validatePage(\"sindex_update\")) {\n\t\t\t$_ .= $this->inputHidden(\"id\", $id);\n\t\t\t$_ .= $this->inputHidden(\"page_status\", \"sindex_update\");\n\t\t\t$_ .= $this->input(\"sindex\");\n\t\t\t$_ .= $this->smartButton($this->translate(\"Update\"), false, \"sindex_update\", \"fright\");\n\t\t}\n\t\telse {\n\t\t\t$_ .= $this->block($this->varnames[\"sindex\"], $this->vars[\"sindex\"]);\n\t\t}\n\n\t\t$_ .= '</fieldset>';\n\t\t$_ .= '</div>';\n\t\t$_ .= '</div>';\n\t\treturn $_;\n\t}", "public function _index(){\n\t $this->_list();\n\t}", "public function actionIndex() : string\n {\n return $this->render('index', [\n 'items' => Item::find()->asArray()->all(),\n ]);\n }", "function indexInfo( $table, $index, $fname = __METHOD__ );", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function getIndex() {return $this->index;}", "function getIndex() ;", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "function get_index()\r\n\t{\r\n\r\n\t}", "function putIndex(){\n\n }", "function putIndex(){\n\n }", "public function makeIndex()\n {\n //Admin panel\n if (!TTO_IS_ADMIN) {\n return;\n }\n\n //Index contents\n $count = $this->search->getEngine()->indexContents();\n\n //Update counter\n $index = Search::getIndex();\n TeaThemeOptions::setConfigs($index.'-count', $count);\n }", "abstract protected function getIndex();", "public function actionIndex() {\n\n return $this->render('index', [\n ]);\n }", "public function index()\n\t{\n\t\t$data = $this->crud->select()->orderBy('crud_id', 'desc')->get();\n\t\t$this->template('crud/index', $data);\n\t}", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Gl2010idid::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getIndex()\n\t{\n\t\tLog::info('asfasfds');\n\t\treturn View::make('home')->with('entries', Entry::all());\n\t}", "public function index()\r\n {\r\n \treturn $this->class->index(1);\r\n }", "public function actionIndex()\n\t{\n\t\techo 1 . \"\\n\\r\";\n\t}", "public function show($index)\n {\n // Todo\n }", "public function getIndex( )\n\t{\n\n\t\tself::addArgument('students', User::getStudents());\n\n\t\tself::addArgument('section', 'index');\n\n\t\treturn self::make('index');\n\n\t}", "public function index()\n {\n return $this->index;\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n\t return $this->render('index');\n }", "public function __viewIndex() {\n $this->createRandomEntries();\n $title = __(extension_random_entries_generator::EXT_NAME);\n $this->setTitle(__('%1$s &ndash; %2$s', array(__('Symphony'), $title)));\n $this->appendSubheading(__($title));\n $wrapper = new XMLELement('fieldset', null, array('class' => 'settings'));\n $wrapper->appendChild(new XMLElement('legend', __('Result')));\n $content = new XMLElement('p', __($this->result));\n if ($this->hasErrors) {\n $content = Widget::Error($content, 'Please try again!');\n }\n $wrapper->appendChild($content);\n $this->Form->appendChild($wrapper);\n }", "public function index()\n {\n //\n return view('entry.index');\n }", "public static function _index()\n\t{\n\t\treturn self::$_index;\n\t}", "public function _INDEX()\n\t{\n\t\t\n\t}", "public function actionIndex()\n {\n $this->render('index');\n }", "public function index()\n {\n $entry = $this->getEntry();\n\n if ($entry) {\n\t\t\treturn View::make('entry.details')\n\t\t\t\t\t\t->with('entry', $entry);\n \t}\n\n return View::make('entry.index');\n\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function index() {\n\t\t$this->display('index');\n\t}", "public function actionIndex(){\r\r\n\t\t$this->render('index', array());\r\r\n\t}", "public function actionIndex()\n\t{\n\n\t\treturn $this->render(\"index\");\n\n\n\t}", "public function actionIndex()\n {\n return $this->renderIndex();\n }", "public function index() {\n $this->view->render('index/index', null, null);\n }", "abstract function index();", "abstract function index();", "abstract function index();", "public function index(){\n return Vista::crear(\"index\");\n }", "public function actionIndex()\n {\n return $this->render('index.twig');\n }", "public function actionIndex() {\n\t\treturn $this->render('index');\n\t}", "public function actionIndex()\r\n {\r\n\t\treturn $this->render('index');\r\n }", "public function createIndex(): void;", "public function action_index()\n\t{\n\t\treturn View::make('nike.index');\n\t}", "public function actionIndex()\n {\n\n return $this->render('index');\n }", "public function actionIndex()\n {\n\n return $this->render('index');\n }", "private function rebuildIndex()\n {\n foreach ($this->rows as $id => $row) {\n $label = $row->getColumn('label');\n if ($label !== false) {\n $this->rowsIndexByLabel[$label] = $id;\n }\n }\n $this->indexNotUpToDate = false;\n }", "public function actionIndex()\r\n {\r\n \treturn $this->render('index');\r\n }", "public function index(IndexableEntity $entity);", "public function getSearchIndex();", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $records = $em->getRepository('dswEvalBundle:Record')->findAll();\n\n return $this->render('record/index.html.twig', array(\n 'records' => $records,\n ));\n }", "public function isIndex();", "public function index()\n {\n return $this->render('index', [\n 'model' => $this->model,\n ]);\n }", "public function actionIndex()\n {\n $searchModel = new IndicationSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n $counter = Counter::findOne(['id' => Yii::$app->request->get('id')]);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'counter' => $counter,\n ]);\n }", "public function actionIndex() {\n return $this->render('index', $this->getDataProviders());\n }", "public function getModelIndex();" ]
[ "0.6759489", "0.6757223", "0.6757223", "0.6757223", "0.670628", "0.670628", "0.670628", "0.6705199", "0.6705036", "0.6705036", "0.6705036", "0.6704164", "0.6704164", "0.6521348", "0.6506881", "0.6496497", "0.64718497", "0.6223823", "0.61917883", "0.61799", "0.6176991", "0.6140715", "0.6117571", "0.608709", "0.6073656", "0.6066414", "0.6063723", "0.60545605", "0.60545605", "0.6028012", "0.6007054", "0.6002092", "0.59965646", "0.59893185", "0.59771895", "0.59767634", "0.5961065", "0.59582925", "0.5955264", "0.5947157", "0.5944932", "0.59415376", "0.59413487", "0.59369045", "0.5934255", "0.59203535", "0.59195477", "0.590297", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5893095", "0.5890582", "0.5890085", "0.5882592", "0.5879303", "0.5879084", "0.58581424", "0.58581424", "0.58581424", "0.5854464", "0.5851", "0.5849107", "0.58453023", "0.58416384", "0.58289903", "0.58270574", "0.58270574", "0.5819122", "0.58133304", "0.5802647", "0.58026433", "0.5791955", "0.5791792", "0.57885706", "0.5780614", "0.57785255", "0.5775032" ]
0.0
-1
Create a new entry.
public function create(TeacherFormBuilder $form) { return $form->render(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createAtomEntry() {\n\t\t$this->create();\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new Entry;\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['Entry']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Entry'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function add_entry($entry);", "public function newEntryModel();", "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 function newEntry()\n {\n return new Entry;\n }", "public function testAddNewEntry()\n {\n $actual = $this->diaryService->addNewEntry($this->entryData);\n $entry = Entry::latest('created_at')->first();\n $expected = [\n 'message' => 'Entry added successfully!',\n 'statusCode' => 201,\n 'data' => null\n ];\n $this->assertEquals($expected, $actual);\n $this->assertDatabaseHas('entries', $entry->toArray());\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function creating(EntryInterface $entry)\n {\n $this->dispatchNow(new SetStrId($entry));\n\n parent::creating($entry);\n }", "public function creating(EntryInterface $entry)\n {\n $this->dispatchNow(new SetStrId($entry));\n\n parent::creating($entry);\n }", "public function creating(EntryInterface $entry)\n {\n $this->dispatchNow(new SetStrId($entry));\n\n parent::creating($entry);\n }", "public static function createEntry(array $entry)\n {\n return DB::table(static::$schema)->insert($entry);\n }", "function newEntry( $args = null, $entry = null)\n { \n\t\t// default duration of a new activity\n\t\t$duration = (int)($_SESSION[$this->appName]['preferences']['duration']?$_SESSION[$this->appName]['preferences']['duration']:'3600');\n\n \t// no predefined activity time\n if( is_numeric($args['activity_start']) == true )\n {\n\t\t\t// when a user clicks on the visual calendar\n\t\t\t// the format is number of seconds not string date/time\n\t\t \t$entry['activity_start'] = gmdate( 'Y-m-d H:i:s', $args['activity_start']);\n\t $entry['activity_end'] = gmdate( 'Y-m-d H:i:s', (int)$args['activity_start']+$duration);\n\t unset($args['activity_start']);\n\t }\n\t else if( isset($args['activity_start']) == false )\n\t {\n\t \t// when a new activity is created as a related record\n\t\t\t$start = round((int)(strtotime('+0 hour')/60),-1)*60;\n\t $entry['activity_start'] = gmdate( 'Y-m-d H:i', $start);\n\t $entry['activity_end'] = gmdate( 'Y-m-d H:i', $start+$duration);\n\t\t} \n\t\t\n\t\t$entry['type_id'] = $_SESSION[$this->appName]['preferences']['type_id']?$_SESSION[$this->appName]['preferences']['type_id']:'CA';\n\t\t$entry['status_id'] = $_SESSION[$this->appName]['preferences']['status_id']?$_SESSION[$this->appName]['preferences']['status_id']:'SC';\n $entry['priority_id'] = $_SESSION[$this->appName]['preferences']['priority_id']?$_SESSION[$this->appName]['preferences']['priority_id']:'NO'; \n $entry['reminder_email'] = $_SESSION[$this->appName]['preferences']['reminder_email']?$_SESSION[$this->appName]['preferences']['reminder_email']:''; \n $entry['reminder_popup'] = $_SESSION[$this->appName]['preferences']['reminder_popup']?$_SESSION[$this->appName]['preferences']['reminder_popup']:''; \n\t\t$entry['is_allday'] = 'N';\n\n\t\treturn parent::newEntry( $args, $entry);\n }", "public function add_entry($entry)\n {\n }", "public function creating(EntryInterface $entry)\n {\n $entry->setAttribute('str_id', str_random(24));\n\n parent::creating($entry);\n }", "public function createNewEntry(ApiUser $apiUser);", "public function addEntry($entry) {\n\t\t$this->_initDbConnection();\n\t\t\n\t\t// TODO: convert author into authorid\n\t\t$authorId = 0;\n\t\t\n\t\tif ($entry->author) {\n\t\t\t$authorId = $this->_getAuthorId($entry->author);\n\t\t}\n\t\t\n\t\t$stm = $this->_prepareStatement('entry', 'add');\n\t\t$stm->execute(array(\n\t\t\t':url' => $entry->url,\n\t\t\t':title' => $entry->title,\n\t\t\t':id' => $entry->id,\n\t\t\t\n\t\t\t':author_id' => $authorId,\n\t\t\t':summary' => (!empty($entry->summary))?$entry->summary:'',\n\t\t\t':content' => (!empty($entry->content))?$entry->content:'',\n\t\t\t\n\t\t\t':published' => strtotime($entry->published),\n\t\t\t':updated' => (!empty($entry->updated))?strtotime($entry->updated):0\n\n\t\t));\n\n\t\tif ($this->_isPdoError($stm)) {\n\t\t\treturn false;\n\t\t}\t\t\n\t\t\n\t\treturn true;\n\t}", "private function createSingleInstance(array $data)\n {\n $entry = new Entry();\n $entry->setId($data[\"ID\"]);\n $entry->setDate($data[\"date\"]);\n $entry->setStart($data[\"start\"]);\n $entry->setEnd($data[\"end\"]);\n $entry->setBreak($data[\"break\"]);\n $entry->setExp($data[\"exp\"]);\n $entry->setNote($data[\"note\"]);\n $entry->setUserId($data[\"userid\"]);\n\n return $entry;\n }", "public function p_newentry($trip_id) {\n if (empty($_POST['title'])) {\n Router::redirect(\"/trips/newentry/blank\");\n }\n \n $here = Geolocate::locate();\n $_POST['state'] = $here['state'];\n $_POST['city'] = $here['city'];\n $_POST['ip'] = $here['ip'];\n\n # Associate this trip with this user\n $_POST['user_id'] = $this->user->user_id;\n\n # Unix timestamp of when this trip was created / modified\n $_POST['created'] = Time::now();\n $_POST['modified'] = Time::now();\n\n $_POST['pic_id'] = \"\";\n $_POST['trip_id'] = $trip_id;\n $_POST['vid'] = \"\";\n $_POST['comment_id'] = \"\";\n\n DB::instance(DB_NAME)->insert(\"entries\", $_POST);\n\n Router::redirect(\"/trips/dashboard/\".$trip_id);\n }", "public static function createEntry\n\t(\n\t\t$uniID\t\t\t\t// <int> The UniID that is creating the entry.\n\t,\t$title\t\t\t\t// <str> The title of the entry.\n\t,\t$status = 0\t\t\t// <int> The current status to assign to the entry (e.g. Content::STATUS_DRAFT)\n\t,\t$clearanceView = 0\t// <int> The clearance required to view this entry.\n\t,\t$primeHashtag = \"\"\t// <str> Assigns a primary hashtag, if applicable (\"\" to ignore).\n\t,\t$comments = 4\t\t// <int> The type of comments for this entry (0 is disallow).\n\t,\t$voting = 4\t\t\t// <int> The type of voting to allow for this entry (0 is disallow).\n\t,\t$urlSlug = \"\"\t\t// <str> The URL that you want to enforce in this entry.\n\t)\t\t\t\t\t\t// RETURNS <int> The ID of the entry on success, or 0 on failure.\n\t\n\t// $contentID = ContentForm::createEntry($uniID, $title, $status, [$clearanceView], [$primeHashtag], [$comments], [$voting], [$urlSlug]);\n\t{\n\t\t// Prepare Values\n\t\t$urlSlug = strtolower(Sanitize::variable($urlSlug, \"-/\"));\n\t\t\n\t\tDatabase::startTransaction();\n\t\t\n\t\t// Create the Entry\n\t\tif($pass = Database::query(\"INSERT INTO content_entries (uni_id, url_slug, title, primary_hashtag, status, clearance_view, comments, voting) VALUES (?, ?, ?, ?, ?, ?, ?, ?)\", array($uniID, $urlSlug, $title, $primeHashtag, $status, $clearanceView, $comments, $voting)))\n\t\t{\n\t\t\t// Make sure that the entry ID was retrieved successfully.\n\t\t\tif($contentID = Database::$lastID)\n\t\t\t{\n\t\t\t\t$pass = Database::query(\"INSERT INTO content_by_user (uni_id, content_id) VALUES (?, ?)\", array($uniID, $contentID));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$pass = false;\n\t\t\t}\n\t\t\t\n\t\t\t// Set the URL Slug if necessary\n\t\t\tif($pass and $urlSlug)\n\t\t\t{\n\t\t\t\t$pass = Database::query(\"INSERT INTO content_by_url (url_slug, content_id) VALUES (?, ?)\", array($urlSlug, $contentID));\n\t\t\t}\n\t\t}\n\t\t\n\t\tDatabase::endTransaction($pass);\n\t\t\n\t\treturn ($pass ? $contentID : 0);\n\t}", "private function prepForNewEntry()\n {\n $this->id = Helper::makeUuid();\n $locale = $this->request->input('locale');\n\n $this->content = Entry::create($this->slug)\n ->collection($this->collection)\n ->get();\n\n if ($locale !== default_locale()) {\n $this->content->set('title', $this->slug);\n $this->content->published(false);\n $this->content = $this->content->in($locale)->get();\n }\n\n $this->content->published($this->getSubmittedStatus());\n\n $this->content->order(\n $this->getSubmittedOrderKey() ?: $this->getNewEntryOrderKey()\n );\n }", "function addEntry($newentry) {\n\t\t$this->data[] = $newentry;\n\t}", "public static function create() {\n\t\t$entry = new GuestbookEntry();\n\t\t$entry->Date = SS_DateTime::now()->getValue();\n\t\t$entry->IpAddress = $_SERVER['REMOTE_ADDR'];\n\t\t$entry->Host = gethostbyaddr($entry->IpAddress);\n\t\treturn $entry;\n\t}", "public function create()\n {\n return view(config('const.template.user.entry'));\n }", "public function create($kv_pairs) {\r\n\r\n # Create Resource\r\n\r\n $params = array_merge(array('ws.op' => 'create'), $kv_pairs);\r\n\r\n $data = $this->adapter->request('POST', $this->url, $params, array('return' => 'headers'));\r\n\r\n $this->_entries = array();\r\n\r\n\r\n\r\n # Return new Resource\r\n\r\n @$url = $data['Location'];\r\n\r\n $resource_data = $this->adapter->request('GET', $url);\r\n\r\n return new AWeberEntry($resource_data, $url, $this->adapter);\r\n\r\n }", "public function create()\n {\n // Not needed cause this is coming from the item listing\n }", "public function create()\n\t\t{\n\t\t\t//\n\t\t}", "public function create()\n\t\t{\n\t\t\t//\n\t\t}", "public function create()\n\t{\n\t\t\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}" ]
[ "0.7970289", "0.71068466", "0.7085793", "0.7041335", "0.69788903", "0.6874101", "0.6836444", "0.67678255", "0.6651166", "0.6651166", "0.6651166", "0.6639194", "0.66294265", "0.66143817", "0.64349353", "0.6360815", "0.6287685", "0.62781274", "0.6271418", "0.62622535", "0.62535125", "0.61951894", "0.61806583", "0.61798674", "0.61671835", "0.6143333", "0.6138545", "0.6138545", "0.60890156", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794", "0.60719794" ]
0.0
-1
Edit an existing entry.
public function edit(TeacherFormBuilder $form, $id) { return $form->render($id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(JournalEntry $entry)\n {\n //\n }", "public function editTask($entry = null)\n {\n if (User::isGuest())\n {\n $rtrn = Request::getVar('REQUEST_URI', Route::url('index.php?option=' . $this->_option . '&task=' . $this->_task, false, true), 'server');\n App::redirect(\n Route::url('index.php?option=com_users&view=login&return=' . base64_encode($rtrn)),\n Lang::txt('COM_RADIAM_LOGIN_NOTICE'),\n 'warning'\n );\n return;\n }\n\n if (!$this->config->get('access-create-entry')\n && !$this->config->get('access-edit-entry')\n && !$this->config->get('access-manage-entry'))\n {\n App::abort(403, Lang::txt('COM_RADIAM_NOT_AUTH'));\n }\n\n if (!is_object($entry))\n {\n $entry = Entry::oneOrNew(Request::getInt('entry', 0));\n }\n\n if ($entry->isNew())\n {\n $entry->set('allow_comments', 1);\n $entry->set('state', Entry::STATE_PUBLISHED);\n $entry->set('scope', 'site');\n $entry->set('created_by', User::get('id'));\n }\n\n foreach ($this->getErrors() as $error)\n {\n $this->view->setError($error);\n }\n\n $this->view\n ->set('config', $this->config)\n ->set('entry', $entry)\n ->setLayout('edit')\n ->display();\n }", "public function edit( )\r\n {\r\n //\r\n }", "public function edit()\n {\n if (Entry::canCreateOrEdit() === false) {\n return Redirect::route('entry.index')\n ->withMessage(\"Sorry, the competition has now started and entries cannot be changed.\");\n }\n\n $entry = $this->getEntry();\n\n if ($entry) {\n return View::make('entry.edit')\n ->with('entry', $entry);\n }\n\n return Redirect::route('entry.index');\n }", "public function edit() {\n\t\t\t\n\t\t}", "public function update(Entry $entry)\n {\n\n $queryBuilder = $this->getQueryBuilder()\n ->update(\"entry\")\n ->set(\"date\", \"?\")\n ->set(\"start\", \"?\")\n ->set(\"end\", \"?\")\n ->set(\"break\", \"?\")\n ->set(\"exp\", \"?\")\n ->set(\"note\", \"?\")\n ->where(\"ID = ?\")\n ->setParameter(0, $entry->getDate())\n ->setParameter(1, $entry->getStart())\n ->setParameter(2, $entry->getEnd())\n ->setParameter(3, $entry->getBreak())\n ->setParameter(4, $entry->getExp())\n ->setParameter(5, $entry->getNote())\n ->setParameter(6, $entry->getId());\n\n $queryBuilder->execute();\n }", "public function edit()\n\t{\n\t\t//\n\t}", "public function edit($entryId){\n\n $entry = $this->CalendarEntry->find('first', array(\n 'contain' => array(),\n 'conditions' => array(\n 'CalendarEntry.id' => $entryId\n )\n ));\n\n if(empty($entry))\n $this->redirect('/calendar');\n\n $this->set('add', false);\n $this->set('entryId', $entryId);\n\n if($this->request->is('put')){\n $this->CalendarEntry->id = $entryId;\n if($this->CalendarEntry->save($this->request->data)){\n $this->_setFlash('Calendar entry updated');\n return $this->redirect('/calendar');\n }\n else {\n debug(\"Something failed\");\n $this->_setFlash($this->CalendarEntry->validationErrorsAsString());\n $this->_setFlash('Test');\n }\n }\n else {\n $this->request->data = $entry;\n }\n\n $this->render('add-edit');\n }", "public function edit() {\n }", "public function edit(Feed $feed)\n {\n //\n }", "public function edit(){\r\n\t\t//$this->auth->set_access('edit');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}", "public function edit(cr $cr)\n {\n //\n }", "public function edit(cr $cr)\n {\n //\n }", "public function edit(cr $cr)\n {\n //\n }", "public function edit(cr $cr)\n {\n //\n }", "public function edit(cr $cr)\n {\n //\n }", "public function edit(Address $address)\n\t{\n\t\t//\n\t}", "public function editAction(BlogEntry $blogEntry) {\n\t\t$this->view->assign('blog', $blogEntry);\n\t}", "public function edit($id) {\n\t\t//\n\t}", "public function edit($id) {\n\t\t//\n\t}", "public function edit($id) {\n\t\t//\n\t}", "public function edit($id) {\n\t\t//\n\t}", "public function edit($id) {\n\t\t//\n\t}", "public function edit($id) {\n\t\t//\n\t}", "public function edit($id) {\n\t\t//\n\t}", "public function edit($id) {\n\t\t//\n\t}", "public function edit($id) {\n\t\t//\n\t}", "public function edit($id) {\n\t\t//\n\t}", "public function edit(Thread $thread)\n {\n //\n }", "public function edit(Thread $thread)\n {\n //\n }", "public function edit(Thread $thread)\n {\n //\n }", "public function edit()\n\t{\n\t\t\n\t}", "public function edit()\n {\n \n }", "public function edit ( $id )\n {\n // NO-OP\n }", "public function edit($id = null)\n\t{\n\t\t//\n\t}", "public function edit($id = null)\n\t{\n\t\t//\n\t}", "public function edit()\n {\n \n \n }", "public function edit(Thread $thread)\n {\n }", "public function edit($id)\r\n\t{\r\n\t\t//\r\n\t}", "public function edit($id)\r\n\t{\r\n\t\t//\r\n\t}", "public function edit(Tile $tile)\n {\n //\n }", "public function edit(Tile $tile)\n {\n //\n }", "public function edit($id)\t{\n\t\t//\n\t}", "public function edit($id) {\n\t\t\n\t}", "public function edit($id)\n\t {\n\t //\n\t }", "public function edit( $id ) {\n\t\t//\n\t}", "public function edit( $id ) {\n\t\t//\n\t}", "public function edit(Request $request, $entry)\n {\n $sensor = ParkSensor::findOrFail($entry);\n \n return view('sensor-mgmt/edit', ['sensor' => $sensor]);\n }", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t}" ]
[ "0.80311304", "0.70270544", "0.6973768", "0.69557136", "0.68582094", "0.6844655", "0.68352765", "0.6795296", "0.67658484", "0.67550385", "0.6739286", "0.67294663", "0.67294663", "0.67294663", "0.67294663", "0.67294663", "0.6723026", "0.672131", "0.6705785", "0.6705785", "0.6705785", "0.6705785", "0.6705785", "0.6705785", "0.6705785", "0.6705785", "0.6705785", "0.6705785", "0.67012054", "0.67012054", "0.67012054", "0.66933066", "0.668789", "0.6672339", "0.6655764", "0.6655764", "0.66518563", "0.6648789", "0.6647837", "0.6647837", "0.66467196", "0.66467196", "0.6639057", "0.66389704", "0.66373956", "0.663646", "0.663646", "0.66322833", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603", "0.6628603" ]
0.0
-1
Handle an incoming request.
public function handle($request, Closure $next) { if (! $this->isServiceAvailable($request->service)) { return redirect()->route('login'); } return $next($request); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function handle_request();", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "protected abstract function handleRequest();", "abstract public function handleRequest($request);", "abstract public function handleRequest(Request $request);", "public function handle($request);", "public function handleRequest() {}", "function handleRequest() ;", "public function handle(Request $request);", "protected function handle(Request $request) {}", "public function handle(array $request);", "public function process_request() {\n if(!empty($this->POST)) {\n return $this->handlePOST();\n } else {\n return $this->handleGET();\n }\n }", "public function handleRequest() {\n // Make sure the action parameter exists\n $this->requireParam('action');\n\n // Call the correct handler based on the action\n switch($this->requestBody['action']) {\n\n case 'checkoutLocker':\n $this->handleCheckoutLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'remindLocker':\n $this->handleRemindLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'returnLocker':\n $this->handleReturnLocker();\n\t\t\t\tbreak;\n\n default:\n $this->respond(new Response(Response::BAD_REQUEST, 'Invalid action on Locker resource'));\n }\n }", "abstract protected function process(Request $request);", "public function handleRequest($request)\n {\n list ($route, $params) = $request->resolve();\n $this->requestedRoute = $route;\n $result = $this->runAction($route, $params);\n\n if ($result instanceof Response) {\n return $result;\n } elseif ($result instanceof Looper){\n $result->loop();\n\n $response = $this->getResponse();\n $response->exitStatus = 0;\n\n return $response;\n } else {\n $response = $this->getResponse();\n $response->exitStatus = $result;\n\n return $response;\n }\n }", "abstract function handle(Request $request, $parameters);", "protected function handle_request() {\r\n global $wp;\r\n $film_query = $wp->query_vars['films'];\r\n \r\n if (!$film_query) { // send all films\r\n $raw_data = $this->get_all_films();\r\n }\r\n else if ($film_query == \"featured\") { // send featured films\r\n $raw_data = $this->get_featured_films();\r\n }\r\n else if (is_numeric($film_query)) { // send film of id\r\n $raw_data = $this->get_film_by_id($film_query);\r\n }\r\n else { // input error\r\n $this->send_response('Bad Input');\r\n }\r\n\r\n $all_data = $this->get_acf_data($raw_data);\r\n $this->send_response('200 OK', $all_data);\r\n }", "public function handle(ServerRequestInterface $request);", "public function handleRequest()\n {\n $route = $this->router->match();\n\n if ($route) {\n $controllerName = $route['target']['controllerName'];\n $methodName = $route['target']['methodName'];\n\n $controller = new $controllerName();\n\n $controller->$methodName($route['params']);\n } else {\n header(\"HTTP:1.0 404 not Found\");\n echo json_encode([\n \"error_code\" => 404,\n \"reason\" => \"page not found\"\n ]);\n }\n }", "function handle(Request $request = null, Response $response = null);", "public function processRequest();", "public abstract function processRequest();", "public function handleRequest(Request $request, Response $response);", "abstract public function processRequest();", "public function handle(array $request = []);", "public function handleRequest()\n {\n $router = new Router();\n $controllerClass = $router->resolve()->getController();\n $controllerAction = $router->getAction();\n\n \n\n if(!class_exists($controllerClass)\n || !method_exists($controllerClass,$controllerAction)\n ){\n header('Not found', true, 404);\n exit;\n }\n\n $controller = new $controllerClass();\n call_user_func([$controller, $controllerAction]);\n\n }", "public function handle(Request $request)\n {\n if ($request->header('X-GitHub-Event') === 'push') {\n return $this->handlePush($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'pull_request') {\n return $this->handlePullRequest($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'ping') {\n return $this->handlePing();\n }\n\n return $this->handleOther();\n }", "protected function _handle()\n {\n return $this\n ->_addData('post', $_POST)\n ->_addData('get', $_GET)\n ->_addData('server', $_SERVER)\n ->_handleRequestRoute();\n }", "public function processRequest() {\n $action = \"\";\n //retrieve action from client.\n if (filter_has_var(INPUT_GET, 'action')) {\n $action = filter_input(INPUT_GET, 'action');\n }\n\n switch ($action) {\n case 'login':\n $this->login(); \n break;\n case 'register':\n $this->register(); //list all articles\n break;\n case 'search':\n $this->search(); //show a form for an article\n break;\n case 'searchList':\n $this->searchList();\n break;\n case 'remove':\n $this->removeArticle();\n break;\n case 'modify':\n $this->modifyArticle();\n break;\n case 'listCategoryForm':\n $this->listCategoryForm();\n break;\n case 'listCategory':\n $this->listCategory();\n break;\n default :\n break;\n }\n }", "public static function handleRequest($request)\r\n {\r\n // Load controller for requested resource\r\n $controllerName = ucfirst($request->getRessourcePath()) . 'Controller';\r\n\r\n if (class_exists($controllerName))\r\n {\r\n $controller = new $controllerName();\r\n\r\n // Get requested action within controller\r\n $actionName = strtolower($request->getHTTPVerb()) . 'Action';\r\n\r\n if (method_exists($controller, $actionName))\r\n {\r\n // Do the action!\r\n $result = $controller->$actionName($request);\r\n\r\n // Send REST response to client\r\n $outputHandlerName = ucfirst($request->getFormat()) . 'OutputHandler';\r\n\r\n if (class_exists($outputHandlerName))\r\n {\r\n $outputHandler = new $outputHandlerName();\r\n $outputHandler->render($result);\r\n }\r\n }\r\n }\r\n }", "public function process(Request $request, Response $response, RequestHandlerInterface $handler);", "public function handle(Request $request)\n {\n $handler = $this->router->match($request);\n if (!$handler) {\n echo \"Could not find your resource!\\n\";\n return;\n }\n\n return $handler();\n }", "public function handleRequest() {\n\t\t\n\t\tif (is_null($this->itemObj)) {\n\t\t\t$this->itemObj = MovieServices::getVcdByID($this->getParam('vcd_id'));\n\t\t}\n\t\t\n\t\t$action = $this->getParam('action');\n\t\t\n\t\tswitch ($action) {\n\t\t\tcase 'upload':\n\t\t\t\t$this->uploadImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'fetch':\n\t\t\t\t$this->fetchImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\n\t\t\tdefault:\n\t\t\t\tredirect();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function handle(Request $request): Response;", "public static function process_http_request()\n {\n }", "public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n break;\r\n case 'POST':\r\n $response = $this->create();\r\n break;\r\n case 'PUT':\r\n $response = $this->update($this->id);\r\n break;\r\n case 'DELETE':\r\n $response = $this->delete($this->id);\r\n break;\r\n case 'OPTIONS':\r\n break;\r\n default:\r\n $response = $this->notFoundResponse();\r\n break;\r\n }\r\n\r\n header($response['status_code_header']);\r\n\r\n // If there is a body then echo it\r\n if($response['body']) {\r\n echo $response['body'];\r\n }\r\n }", "abstract public function handle(ServerRequestInterface $request): ResponseInterface;", "public function processRequest()\n\t\t{\n\t\t\t$request_method = strtolower($_SERVER['REQUEST_METHOD']);\n\t\t\tswitch ($request_method)\n\t\t\t{\n\t\t\t\tcase 'get':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$request_parts = explode('/', $data);\n\t\t\t$controller = $request_parts[0];\n\t\t\tswitch ($controller)\n\t\t\t{\n\t\t\t\tcase 'ad':\n\t\t\t\t\tprocessAdRequest(substr($data, strlen('ad')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'category':\n\t\t\t\t\tprocessCategoryRequest(substr($data, strlen('category')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user':\n\t\t\t\t\tprocessUserRequest(substr($data, strlen('user')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo \"Invalid Request!\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "function handleRequest (&$request, &$context) {\n\n\t\t/* cycle through our process callback queue. using each() vs.\n\t\t * foreach, etc. so we may add elements to the callback array\n\t\t * later. probably primarily used for conditional callbacks. */\n\t\treset ($this->_processCallbacks);\n\t\twhile ($c = each ($this->_processCallbacks)) {\n\n\t\t\t// test for a successful view dispatch\n\t\t\tif ($this->_processProcess ($this->_processCallbacks[$c['key']],\n\t\t\t $request,\n\t\t\t $context))\n\t\t\t\treturn;\n\t\t}\n\n\t\t// if no view has been found yet attempt our default\n\t\tif ($this->defaultViewExists ())\n\t\t\t$this->renderDefaultView ($request, $context);\n\t}", "public function handle($request, $next);", "public function handle(): void\n {\n $globals = $_SERVER;\n //$SlimPsrRequest = ServerRequestFactory::createFromGlobals();\n //it doesnt matters if the Request is of different class - no need to create Guzaba\\Http\\Request\n $PsrRequest = ServerRequestFactory::createFromGlobals();\n //the only thing that needs to be fixed is the update the parsedBody if it is NOT POST & form-fata or url-encoded\n\n\n //$GuzabaPsrRequest =\n\n //TODO - this may be reworked to reroute to a new route (provided in the constructor) instead of providing the actual response in the constructor\n $DefaultResponse = $this->DefaultResponse;\n //TODO - fix the below\n// if ($PsrRequest->getContentType() === ContentType::TYPE_JSON) {\n// $DefaultResponse->getBody()->rewind();\n// $structure = ['message' => $DefaultResponse->getBody()->getContents()];\n// $json_string = json_encode($structure, JSON_UNESCAPED_SLASHES);\n// $StreamBody = new Stream(null, $json_string);\n// $DefaultResponse = $DefaultResponse->\n// withBody($StreamBody)->\n// withHeader('Content-Type', ContentType::TYPES_MAP[ContentType::TYPE_JSON]['mime'])->\n// withHeader('Content-Length', (string) strlen($json_string));\n// }\n\n $FallbackHandler = new RequestHandler($DefaultResponse);//this will produce 404\n $QueueRequestHandler = new QueueRequestHandler($FallbackHandler);//the default response prototype is a 404 message\n foreach ($this->middlewares as $Middleware) {\n $QueueRequestHandler->add_middleware($Middleware);\n }\n $PsrResponse = $QueueRequestHandler->handle($PsrRequest);\n $this->emit($PsrResponse);\n\n }", "public function HandleRequest(Request $request)\r\n {\r\n $command = $this->_commandResolver->GetCommand($request);\t// Create command object for Request\r\n $response = $command->Execute($request);\t\t\t\t\t// Execute the command to get response\r\n $view = ApplicationController::GetView($response);\t\t\t\t\t// Send response to the appropriate view for display\r\n $view->Render();\t\t\t\t\t\t\t\t\t\t\t// Display the view\r\n }", "public function process($path, Request $request);", "public function handle(string $query, ServerRequestInterface $request);", "public function handleRequest()\n\t{\n\t\t$fp = $this->fromRequest();\n\t\treturn $fp->render();\n\t}", "private function _processRequest()\n\t{\n\t\t// prevent unauthenticated access to API\n\t\t$this->_secureBackend();\n\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t//check if an action is sent through\n\t\tif(!isset($this->request->action)){\n\t\t\t//if no action is provided then reply with a 400 error with message\n\t\t\t$this->reply(\"No Action Provided\", 400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t//check if method for the action exists\n\t\tif(!method_exists($this, $this->request->action)){\n\t\t\t//if method doesn't exist, send 400 code and message with reply'\n\t\t\t$this->reply(\"Action method not found\",400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n \n\t\tswitch($this->request->action){\n\t\t\tcase \"hello\":\n\t\t\t\t$this->hello($this->request->data);\n\t\t\t\tbreak;\n\t\t\tcase \"submit_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->submit_video($this->request, $_FILES);\n\t\t\t\tbreak;\n\t\t\tcase \"remove_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->remove_video($this->request);\n\t\t\t\tbreak;\n\t\t\tcase \"isSubmitted\":\n\t\t\t\t$this->isSubmitted($this->request);\n\t\t\tdefault:\n\t\t\t\t$this->reply(\"action switch failed\",400);\n\t\t\tbreak;\n\t\t}\n\n\n\n\t}", "public function handleRequest ()\n\t{\n\t\t$this->version = '1.0';\n\t\t$this->id = NULL;\n\n\t\tif ($this->getProperty(self::PROPERTY_ENABLE_EXTRA_METHODS))\n\t\t\t$this->publishExtraMethods();\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t{\n\n\t\t\t$json = file_get_contents('php://input');\n\t\t\t$request = \\json_decode($json);\n\n\t\t\tif (is_array($request))\n\t\t\t{\n\t\t\t\t// Multicall\n\t\t\t\t$this->version = '2.0';\n\n\t\t\t\t$response = array();\n\t\t\t\tforeach ($request as $singleRequest)\n\t\t\t\t{\n\t\t\t\t\t$singleResponse = $this->handleSingleRequest($singleRequest, TRUE);\n\t\t\t\t\tif ($singleResponse !== FALSE)\n\t\t\t\t\t\t$response[] = $singleResponse;\n\t\t\t\t}\n\n\t\t\t\t// If all methods in a multicall are notifications, we must not return an empty array\n\t\t\t\tif (count($response) == 0)\n\t\t\t\t\t$response = FALSE;\n\t\t\t}\n\t\t\telse if (is_object($request))\n\t\t\t{\n\t\t\t\t$this->version = $this->getRpcVersion($request);\n\t\t\t\t$response = $this->handleSingleRequest($request);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$response = $this->formatError(self::ERROR_INVALID_REQUEST);\n\t\t}\n\t\telse if ($_SERVER['PATH_INFO'] != '')\n\t\t{\n\t\t\t$this->version = '1.1';\n\t\t\t$this->id = NULL;\n\n\t\t\t$method = substr($_SERVER['PATH_INFO'], 1);\n\t\t\t$params = $this->convertFromRpcEncoding($_GET);\n\n\t\t\tif (!$this->hasMethod($method))\n\t\t\t\t$response = $this->formatError(self::ERROR_METHOD_NOT_FOUND);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tRpcResponse::setWriter(new JsonRpcResponseWriter($this->version, $this->id));\n\t\t\t\t\t$res = $this->invoke($method, $params);\n\t\t\t\t\tif ($res instanceof JsonRpcResponseWriter)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res->finalize();\n\t\t\t\t\t\t$resposne = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $this->formatResult($res);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exception)\n\t\t\t\t{\n\t\t\t\t\t$response = $this->formatException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = $this->formatError(self::ERROR_PARSE_ERROR);\n\t\t}\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-Type: application/json', TRUE);\n\t\t\theader('Cache-Control: nocache', TRUE);\n\t\t\theader('Pragma: no-cache', TRUE);\n\t\t}\n\n\t\tif ($response !== FALSE)\n\t\t{\n\t\t\t$result = \\json_encode($this->convertToRpcEncoding($response));\n\n\t\t\tif ($result === FALSE)\n\t\t\t\terror_log(var_export($response, TRUE));\n\t\t\telse\n\t\t\t\techo($result);\n\t\t}\n\t}", "public function handle($request)\n {\n $this->setRouter($this->app->compose('Cygnite\\Base\\Router\\Router', $request), $request);\n\n try {\n $response = $this->sendRequestThroughRouter($request);\n /*\n * Check whether return value is a instance of Response,\n * otherwise we will try to fetch the response form container,\n * create a response and return to the browser.\n *\n */\n if (!$response instanceof ResponseInterface && !is_array($response)) {\n $r = $this->app->has('response') ? $this->app->get('response') : '';\n $response = Response::make($r);\n }\n } catch (\\Exception $e) {\n $this->handleException($e);\n } catch (Throwable $e) {\n $this->handleException($e);\n }\n\n return $response;\n }", "public function handleRequest()\n\t{\n $response = array();\n switch ($this->get_server_var('REQUEST_METHOD')) \n {\n case 'OPTIONS':\n case 'HEAD':\n $response = $this->head();\n break;\n case 'GET':\n $response = $this->get();\n break;\n case 'PATCH':\n case 'PUT':\n case 'POST':\n $response = $this->post();\n break;\n case 'DELETE':\n $response = $this->delete();\n break;\n default:\n $this->header('HTTP/1.1 405 Method Not Allowed');\n }\n\t\treturn $response;\n }", "public function handleRequest(Zend_Controller_Request_Http $request)\n {\n \n }", "final public function handle(Request $request)\n {\n $response = $this->process($request);\n if (($response === null) && ($this->successor !== null)) {\n $response = $this->successor->handle($request);\n }\n\n return $response;\n }", "public function process(Aloi_Serphlet_Application_HttpRequest $request, Aloi_Serphlet_Application_HttpResponse $response) {\r\n\r\n\t\ttry {\r\n\t\t\t// Identify the path component we will use to select a mapping\r\n\t\t\t$path = $this->processPath($request, $response);\r\n\t\t\tif (is_null($path)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (self::$log->isDebugEnabled()) {\r\n\t\t\t\tself::$log->debug('Processing a \"' . $request->getMethod() . '\" for path \"' . $path . '\"');\r\n\t\t\t}\r\n\r\n\t\t\t// Select a Locale for the current user if requested\r\n\t\t\t$this->processLocale($request, $response);\r\n\r\n\t\t\t// Set the content type and no-caching headers if requested\r\n\t\t\t$this->processContent($request, $response);\r\n\t\t\t$this->processNoCache($request, $response);\r\n\r\n\t\t\t// General purpose preprocessing hook\r\n\t\t\tif (!$this->processPreprocess($request, $response)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//Identify the mapping for this request\r\n\t\t\t$mapping = $this->processMapping($request, $response, $path);\r\n\t\t\tif (is_null($mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Check for any role required to perform this action\r\n\t\t\tif (!$this->processRoles($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process any ActionForm bean related to this request\r\n\t\t\t$form = $this->processActionForm($request, $response, $mapping);\r\n\t\t\t$this->processPopulate($request, $response, $form, $mapping);\r\n\t\t\tif (!$this->processValidate($request, $response, $form, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process a forward or include specified by this mapping\r\n\t\t\tif (!$this->processForward($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!$this->processInclude($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Create or acquire the Action instance to process this request\r\n\t\t\t$action = $this->processActionCreate($request, $response, $mapping);\r\n\t\t\tif (is_null($action)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Call the Action instance itself\r\n\t\t\t$forward = $this->processActionPerform($request, $response, $action, $form, $mapping);\r\n\r\n\t\t\t// Process the returned ActionForward instance\r\n\t\t\t$this->processForwardConfig($request, $response, $forward);\r\n\t\t} catch (ServletException $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}", "function handleRequest() {\n // I. On récupère l'action demandée par l'utilisateur, avec retrocompatibilité\n // Controller et Entité\n $entityName = (isset($_GET['controller']) ? $_GET['controller'] : \"article\");\n // on retravaille le nom pour obtenir un nom de la forme \"Article\"\n $entityName = ucfirst(strtolower($entityName));\n\n // Action\n $actionName = (isset($_GET['action']) ? $_GET['action'] : \"index\");\n $actionName = strtolower($actionName);\n\n // II à IV sont maintenant dans loadDep\n $controller = $this->loadDependencies($entityName);\n\n // V. On regarde si l'action de controller existe, puis on la charge\n // on retravaille la var obtenue pour obtenir un nom de la forme \"indexAction\"\n $action = $actionName . \"Action\";\n\n // si la méthode demandée n'existe pas, remettre \"index\"\n if (!method_exists($controller, $action)) {\n $actionName = \"index\";\n $action = \"indexAction\";\n }\n\n // on stock le titre sous la forme \"Article - Index\"\n $this->title = $entityName . \" - \" . $actionName;\n\n // on appelle dynamiquement la méthode de controller\n $this->content = $controller->$action();\n }", "public function handle(RequestInterface $request): ResponseInterface;", "public function handleRequest() {\n $this->loadErrorHandler();\n\n $this->sanitizeRequest();\n $this->modx->invokeEvent('OnHandleRequest');\n if (!$this->modx->checkSiteStatus()) {\n header('HTTP/1.1 503 Service Unavailable');\n if (!$this->modx->getOption('site_unavailable_page',null,1)) {\n $this->modx->resource = $this->modx->newObject('modDocument');\n $this->modx->resource->template = 0;\n $this->modx->resource->content = $this->modx->getOption('site_unavailable_message');\n } else {\n $this->modx->resourceMethod = \"id\";\n $this->modx->resourceIdentifier = $this->modx->getOption('site_unavailable_page',null,1);\n }\n } else {\n $this->checkPublishStatus();\n $this->modx->resourceMethod = $this->getResourceMethod();\n $this->modx->resourceIdentifier = $this->getResourceIdentifier($this->modx->resourceMethod);\n if ($this->modx->resourceMethod == 'id' && $this->modx->getOption('friendly_urls', null, false) && !$this->modx->getOption('request_method_strict', null, false)) {\n $uri = $this->modx->context->getResourceURI($this->modx->resourceIdentifier);\n if (!empty($uri)) {\n if ((integer) $this->modx->resourceIdentifier === (integer) $this->modx->getOption('site_start', null, 1)) {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL);\n } else {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL) . $uri;\n }\n $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));\n }\n }\n }\n if (empty ($this->modx->resourceMethod)) {\n $this->modx->resourceMethod = \"id\";\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $this->modx->resourceIdentifier = $this->_cleanResourceIdentifier($this->modx->resourceIdentifier);\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $found = $this->findResource($this->modx->resourceIdentifier);\n if ($found) {\n $this->modx->resourceIdentifier = $found;\n $this->modx->resourceMethod = 'id';\n } else {\n $this->modx->sendErrorPage();\n }\n }\n $this->modx->beforeRequest();\n $this->modx->invokeEvent(\"OnWebPageInit\");\n\n if (!is_object($this->modx->resource)) {\n if (!$this->modx->resource = $this->getResource($this->modx->resourceMethod, $this->modx->resourceIdentifier)) {\n $this->modx->sendErrorPage();\n return true;\n }\n }\n\n return $this->prepareResponse();\n }", "public function process(\n ServerRequestInterface $request,\n RequestHandlerInterface $handler\n );", "protected function handleRequest() {\n\t\t// TODO: remove conditional when we have a dedicated error render\n\t\t// page and move addModule to Mustache#getResources\n\t\tif ( $this->adapter->getFormClass() === 'Gateway_Form_Mustache' ) {\n\t\t\t$modules = $this->adapter->getConfig( 'ui_modules' );\n\t\t\tif ( !empty( $modules['scripts'] ) ) {\n\t\t\t\t$this->getOutput()->addModules( $modules['scripts'] );\n\t\t\t}\n\t\t\tif ( $this->adapter->getGlobal( 'LogClientErrors' ) ) {\n\t\t\t\t$this->getOutput()->addModules( 'ext.donationInterface.errorLog' );\n\t\t\t}\n\t\t\tif ( !empty( $modules['styles'] ) ) {\n\t\t\t\t$this->getOutput()->addModuleStyles( $modules['styles'] );\n\t\t\t}\n\t\t}\n\t\t$this->handleDonationRequest();\n\t}", "public function handleHttpRequest($requestParams)\n\t{\n\t\t$action = strtolower(@$requestParams[self::REQ_PARAM_ACTION]);\t\t\n\t\t$methodName = $this->actionToMethod($action);\n\t\t\n\t\ttry\n\t\t{\n\t\t\t$this->$methodName($requestParams);\n\t\t} catch(Exception $e)\n\t\t{\n\t\t\techo \"Error: \".$e->getMessage();\n\t\t}\n\t}", "public static function handleRequest()\n\t{\n\t\t// Load language strings\n\t\tself::loadLanguage();\n\n\t\t// Load the controller and let it run the show\n\t\trequire_once dirname(__FILE__).'/classes/controller.php';\n\t\t$controller = new LiveUpdateController();\n\t\t$controller->execute(JRequest::getCmd('task','overview'));\n\t\t$controller->redirect();\n\t}", "public function handle() {\n $this->initDb(((!isset(self::$_config['db']['type'])) ? 'mysql' : self::$_config['db']['type']));\n $request = new corelib_request(self::$_config['routing'], self::$_config['reg_routing']);\n $path = parse_url($_SERVER['REQUEST_URI']);\n\n if (self::$_config['home'] == \"/\" || self::$_config['home'] == \"\") {\n $uri = ltrim($path['path'], '/');\n } else {\n $uri = str_replace(self::$_config['home'], '', $path['path']);\n }\n\n if (\"\" == $uri || \"/\" == $uri) {\n $uri = self::$_config['routing']['default']['controller'] . '/' . self::$_config['routing']['default']['action'];\n }\n self::$isAjax = $request->isAjax();\n self::$request = $request->route($uri);\n self::$request['uri'] = $uri;\n\n if (self::$request['action'] == \"\")\n self::$request['action'] = self::$_config['routing']['default']['action'];\n\n $this->_run( self::$request['params'] );\n }", "public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }", "public function request_handler(){\r\n\t\t$route = new Router;\r\n\t\t$session = new Session;\r\n\t\t$segments = $route->urlRoute();\r\n\t\t#check if controller/action exist\r\n\t\t#if not use default_controller / default_action\r\n\t\tif( count($segments) == 0 || count($segments) == 1 ){\r\n\t\t\tinclude_class_method( default_controller , default_action );\r\n\t\t}else{\r\n\t\t#if controller/action exist in the url\r\n\t\t#then check the controller if it's existed in the file\r\n\t\t\tif( file_exists( CONTROLLER_DIR . $segments[0] . CONT_EXT ) )\r\n\t\t\t{\r\n\t\t\t\t#check for segments[1] = actions\r\n\t\t\t\t#if segments[1] exist, logically segments[0] which is the controller is also exist!!\r\n\t\t\t\t//if( isset($segments[1]) ){\r\n\t\t\t\t\tinclude_class_method( $segments[0], $segments[1] . 'Action' );\r\n\t\t\t\t//}\r\n\t\t\t}else{\r\n\t\t\t\terrorHandler(CONTROLLER_DIR . $segments[0] . CONT_EXT);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function handle() {\n if(method_exists($this->class, $this->function)) {\n echo $this->class->{$this->function}($this->request);\n }else {\n echo Response::response(['error' => 'function does not exist on ' . get_class($this->class)], 500);\n }\n }", "public function handle(ClientInterface $client, RequestInterface $request, HttpRequest $httpRequest);", "public function handleRequest() {\n $questions=$this->contactsService->getAllQuestions(\"date\");\n //load all the users\n $userList = User::loadUsers();\n //load all the topics\n \t\t$topics = $this->contactsService2->getAllTopics(\"name\");\n \t\t\n\t\t\t\trequire_once '../view/home.tpl';\n\t}", "public function serve_request()\n {\n }", "public static function process($request){\r\n\t\tcall_user_func($request -> action, $request -> params);\r\n\t}", "function process($request) {\n\t//$logFusion =& LoggerManager::getLogger('fusion');\n//PBXFusion begin\n\t$request=$this->mapRequestVars($request);\n $mode = $request->get('callstatus');\n\t//$logFusion->debug(\"PBX CONTROLLER PROCESS mode=\".$mode);\n//PBXFusion end\n switch ($mode) {\n\t//PBXFusion begin\n \t case \"CallStart\" :\n $this->processCallStart($request);\n break;\n\t//PBXFusion end\n case \"StartApp\" :\n $this->processStartupCallFusion($request);\n break;\n case \"DialAnswer\" :\n $this->processDialCallFusion($request);\n break;\n case \"Record\" :\n $this->processRecording($request);\n break;\n case \"EndCall\" :\n $this->processEndCallFusion($request);\n break;\n case \"Hangup\" :\n $callCause = $request->get('causetxt');\n if ($callCause == \"null\") {\n break;\n }\n $this->processHangupCall($request);\n break;\n }\n }", "public function handle() {\n\t\n\t\t$task = $this->request->getTask();\n\t\t$handler = $this->resolveHandler($task);\n\t\t$action = $this->request->getAction();\n\t\t$method = empty($action) ? $this->defaultActionMethod : $action.$this->actionMethodSuffix;\n\t\t\n\t\tif (! method_exists($handler, $method)) {\n\t\t\tthrow new Task\\NotHandledException(\"'{$method}' method not found on handler.\");\n\t\t}\n\t\t\n\t\t$handler->setRequest($this->request);\n\t\t$handler->setIo($this->io);\n\t\t\n\t\treturn $this->invokeHandler($handler, $method);\n\t}", "private function handleCall() { //$this->request\n $err = FALSE;\n // route call to method\n $this->logToFile($this->request['action']);\n switch($this->request['action']) {\n // Edit form submitted\n case \"edit\":\n // TODO: improve error handling\n try {\n $this->logToFile(\"case: edit\");\n $this->edit($this->request['filename']);\n //$this->save();\n } catch (Exception $e) {\n $err = \"Something went wrong: \";\n $err .= $e.getMessage();\n }\n break;\n }\n // TODO: set error var in response in case of exception / error\n // send JSON response\n if($err !== FALSE) {\n $this->request['error_msg'] = $err;\n }\n $this->giveJSONResponse($this->request);\n }", "function handle()\n {\n $this->verifyPost();\n\n $postTarget = $this->determinePostTarget();\n\n $this->filterPostData();\n\n switch ($postTarget) {\n case 'upload_media':\n $this->handleMediaFileUpload();\n break;\n case 'feed':\n $this->handleFeed();\n break;\n case 'feed_media':\n $this->handleFeedMedia();\n break;\n case 'feed_users':\n $this->handleFeedUsers();\n break;\n case 'delete_media':\n $this->handleDeleteMedia();\n break;\n }\n }", "public function run() {\n\t\t// If this particular request is not a hook, something is wrong.\n\t\tif (!isset($this->server[self::MERGADO_HOOK_AUTH_HEADER])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s is to be used only for handling hooks sent from Mergado.\n\t\t\t\tMergado-Apps-Hook-Auth is missing.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t}\n\n\t\tif (!$decoded = json_decode($this->rawRequest, true)) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle request, because the data to be handled is empty.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t} elseif (!isset($decoded['action'])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle the hook, because the hook action is undefined.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t};\n\n\t\t$this->handle($decoded['action'], $decoded);\n\n\t}", "public function handleRequest()\n {\n $version = $this->versionEngine->getVersion();\n $queryConfiguration = $version->parseRequest($this->columnConfigurations);\n $this->provider->prepareForProcessing($queryConfiguration, $this->columnConfigurations);\n $data = $this->provider->process();\n return $version->createResponse($data, $queryConfiguration, $this->columnConfigurations);\n }", "public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}", "public function run(){\n // server response object \n $requestMethod = $this->requestBuilder->getRequestMethod();\n $this->response = new Response($requestMethod);\n\n try{\n $route = $this->router->validateRequestedRoute($this->requestBuilder);\n\n // serve request object\n $this->requestBuilder->setQuery();\n $this->requestBuilder->setBody();\n $requestParams = $this->requestBuilder->getParam();\n $requestQuery = $this->requestBuilder->getQuery();\n $requestBody = $this->requestBuilder->getBody(); \n $this->request = new Request($requestParams, $requestQuery, $requestBody);\n\n $callback = $route->getCallback();\n $callback($this->request, $this->response);\n }catch(RouteNotImplementedException $e){\n $this->response->statusCode(404)->json($e->getMessage()); \n }\n \n }", "final public function handle()\n {\n \n $this->_preHandle();\n \n if ($this->_request->getActionName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the action name.');\n }\n\n if ($this->_request->getProviderName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the provider name.');\n }\n \n ob_start();\n \n try {\n $dispatcher = new ZendL_Tool_Rpc_Endpoint_Dispatcher();\n $dispatcher->setRequest($this->_request)\n ->setResponse($this->_response)\n ->dispatch();\n \n } catch (Exception $e) {\n //@todo implement some sanity here\n die($e->getMessage());\n //$this->_response->setContent($e->getMessage());\n return;\n }\n \n if (($content = ob_get_clean()) != '') {\n $this->_response->setContent($content);\n }\n \n $this->_postHandle();\n }", "public function RouteRequest ();", "public function handle(ServerRequestInterface $request, $handler, array $vars): ?ResponseInterface;", "public function DispatchRequest ();", "protected function handleRequest() {\n\t\t// FIXME: is this necessary?\n\t\t$this->getOutput()->allowClickjacking();\n\t\tparent::handleRequest();\n\t}", "public function listen() {\n\t\t// Checks the user agents match\n\t\tif ( $this->user_agent == $this->request_user_agent ) {\n\t\t\t// Determine if a key request has been made\n\t\t\tif ( isset( $_GET['key'] ) ) {\n\t\t\t\t$this->download_update();\n\t\t\t} else {\n\t\t\t\t// Determine the action requested\n\t\t\t\t$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING );\n\n\t\t\t\t// If that method exists, call it\n\t\t\t\tif ( method_exists( $this, $action ) )\n\t\t\t\t\t$this->{$action}();\n\t\t\t}\n\t\t}\n\t}", "abstract public function request();", "public function run() {\r\n $this->routeRequest(new Request());\r\n }", "public function processAction(Request $request)\n {\n // Get the request Vars\n $this->requestQuery = $request->query;\n\n // init the hybridAuth instance\n $provider = trim(strip_tags($this->requestQuery->get('hauth_start')));\n $cookieName = $this->get('azine_hybrid_auth_service')->getCookieName($provider);\n $this->hybridAuth = $this->get('azine_hybrid_auth_service')->getInstance($request->cookies->get($cookieName), $provider);\n\n // If openid_policy requested, we return our policy document\n if ($this->requestQuery->has('get') && 'openid_policy' == $this->requestQuery->get('get')) {\n return $this->processOpenidPolicy();\n }\n\n // If openid_xrds requested, we return our XRDS document\n if ($this->requestQuery->has('get') && 'openid_xrds' == $this->requestQuery->get('get')) {\n return $this->processOpenidXRDS();\n }\n\n // If we get a hauth.start\n if ($this->requestQuery->has('hauth_start') && $this->requestQuery->get('hauth_start')) {\n return $this->processAuthStart();\n }\n // Else if hauth.done\n elseif ($this->requestQuery->has('hauth_done') && $this->requestQuery->get('hauth_done')) {\n return $this->processAuthDone($request);\n }\n // Else we advertise our XRDS document, something supposed to be done from the Realm URL page\n\n return $this->processOpenidRealm();\n }", "public function run() {\n $base = $this->request->getNextRoute();\n if ($base !== BASE) {\n $this->response->notFound();\n }\n $start = $this->request->getNextRoute();\n if ($rs = $this->getRs($start)) {\n if ($this->request->isOptions()) {\n $this->response->okEmpty();\n return;\n }\n try {\n $this->response->ok($rs->handleRequest());\n\n } catch (UnauthorizedException $e) {\n $this->response->unauthorized();\n\n } catch (MethodNotAllowedException $e) {\n $this->response->methodNotAllowed();\n\n } catch (BadRequestExceptionInterface $e) {\n $this->response->badRequest($e->getMessage());\n\n } catch (UnavailableExceptionInterface $e) {\n $this->response->unavailable($e->getMessage());\n\n } catch (Exception $e) {\n $this->response->unavailable($e->getMessage());\n }\n } else {\n $this->response->badRequest();\n }\n }", "public function handle(Request $request, Response|JsonResponse|BinaryFileResponse|StreamedResponse $response, int $length);", "public function handle(Request $request, Closure $next);", "public function handleGetRequest($id);", "abstract function doExecute($request);", "public function parseCurrentRequest()\n {\n // If 'action' is post, data will only be read from 'post'\n if ($action = $this->request->post('action')) {\n die('\"post\" method action handling not implemented');\n }\n \n $action = $this->request->get('action') ?: 'home';\n \n if ($response = $this->actionHandler->trigger($action, $this)) {\n $this->getResponder()->send($response);\n } else {\n die('404 not implemented');\n }\n }", "abstract public function mapRequest($request);", "public function handle(ServerRequestInterface $request)\n {\n $router = $this->app->get(RouterInterface::class);\n $response = $router->route($request);\n\n if (! headers_sent()) {\n\n // Status\n header(sprintf(\n 'HTTP/%s %s %s',\n $response->getProtocolVersion(),\n $response->getStatusCode(),\n $response->getReasonPhrase()\n ));\n\n // Headers\n foreach ($response->getHeaders() as $name => $values) {\n foreach ($values as $value) {\n header(sprintf('%s: %s', $name, $value), false);\n }\n }\n }\n\n echo $response->getBody()->getContents();\n }", "abstract public function processRequest(PriceWaiter_NYPWidget_Controller_Endpoint_Request $request);", "private function handleRequest()\n {\n // we check the inputs validity\n $validator = Validator::make($this->request->only('rowsNumber', 'search', 'sortBy', 'sortDir'), [\n 'rowsNumber' => 'required|numeric',\n 'search' => 'nullable|string',\n 'sortBy' => 'nullable|string|in:' . $this->columns->implode('attribute', ','),\n 'sortDir' => 'nullable|string|in:asc,desc',\n ]);\n // if errors are found\n if ($validator->fails()) {\n // we log the errors\n Log::error($validator->errors());\n // we set back the default values\n $this->request->merge([\n 'rowsNumber' => $this->rowsNumber ? $this->rowsNumber : config('tablelist.default.rows_number'),\n 'search' => null,\n 'sortBy' => $this->sortBy,\n 'sortDir' => $this->sortDir,\n ]);\n } else {\n // we save the request values\n $this->setAttribute('rowsNumber', $this->request->rowsNumber);\n $this->setAttribute('search', $this->request->search);\n }\n }", "public function handle() {\n\t\t\n\t\t\n\t\t\n\t\theader('ApiVersion: 1.0');\n\t\tif (!isset($_COOKIE['lg_app_guid'])) {\n\t\t\t//error_log(\"NO COOKIE\");\n\t\t\t//setcookie(\"lg_app_guid\", uniqid(rand(),true),time()+(10*365*24*60*60));\n\t\t} else {\n\t\t\t//error_log(\"cookie: \".$_COOKIE['lg_app_guid']);\n\t\t\t\n\t\t}\n\t\t// checks if a JSON-RCP request has been received\n\t\t\n\t\tif (($_SERVER['REQUEST_METHOD'] != 'POST' && (empty($_SERVER['CONTENT_TYPE']) || strpos($_SERVER['CONTENT_TYPE'],'application/json')===false)) && !isset($_GET['d'])) {\n\t\t\t\techo \"INVALID REQUEST\";\n\t\t\t// This is not a JSON-RPC request\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\n\t\t// reads the input data\n\t\tif (isset($_GET['d'])) {\n\t\t\tdefine(\"WEB_REQUEST\",true);\n\t\t\t$request=urldecode($_GET['d']);\n\t\t\t$request = stripslashes($request);\n\t\t\t$request = json_decode($request, true);\n\t\t\t\n\t\t} else {\n\t\t\tdefine(\"WEB_REQUEST\",false);\n\t\t\t//error_log(file_get_contents('php://input'));\n\t\t\t$request = json_decode(file_get_contents('php://input'),true);\n\t\t\t//error_log(print_r(apache_request_headers(),true));\n\t\t}\n\t\t\n\t\terror_log(\"Method: \".$request['method']);\n\t\tif (!isset($this->exemptedMethods[$request['method']])) {\n\t\t\ttry {\n\t\t\t\t$this->authenticate();\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->authenticated = false;\n\t\t\t\t$this->handleError($e);\n\t\t\t}\n\t\t} else {\n\t\t\t//error_log('exempted');\n\t\t}\n\t\ttrack_call($request);\n\t\t//error_log(\"RPC Method Called: \".$request['method']);\n\t\t\n\t\t//include the document containing the function being called\n\t\tif (!function_exists($request['method'])) {\n\t\t\t$path_to_file = \"./../include/methods/\".$request['method'].\".php\";\n\t\t\tif (file_exists($path_to_file)) {\n\t\t\t\tinclude $path_to_file;\n\t\t\t} else {\n\t\t\t\t$e = new Exception('Unknown method. ('.$request['method'].')', 404, null);\n \t$this->handleError($e);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t// executes the task on local object\n\t\ttry {\n\t\t\t\n\t\t\t$result = @call_user_func($request['method'],$request['params']);\n\t\t\t\n\t\t\tif (!is_array($result) || !isset($result['result']) || $result['result']) {\n\t\t\t\t\n\t\t\t\tif (is_array($result) && isset($result['result'])) unset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'result' => $result,\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\t} else {\n\t\t\t\tunset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'error' => $result\n\t\t\t\t\t\t\t\t );\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t\n\t\t\t$response = array (\n\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t'result' => NULL,\n\t\t\t\t\t\t\t\t'error' => $e->getMessage()\n\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t}\n\t\t// output the response\n\t\tif (!empty($request['id'])) { // notifications don't want response\n\t\t\theader('content-type: text/javascript');\n\t\t\t//error_log(@print_r($response));\n\t\t\tif (isset($_GET['d'])) $str_response = $_GET['jsoncallback'].\"(\".str_replace('\\/','/',json_encode($response)).\")\";\n\t\t\telse $str_response = str_replace('\\/','/',json_encode($response));\n\t\t\t\n\t\t\tif ($_SERVER['SERVER_ADDR']=='192.168.1.6') {\n\t\t\t\t//error_log($str_response);\n\t\t\t}\n\t\t\techo $str_response;\n\t\t}\n\t\t\n\t\t\n\t\t// finish\n\t\treturn true;\n\t}", "protected function handle(Request $request)\n {\n return 1;\n }", "public function __invoke(Request $request, RequestHandler $handler) {\n R::setup('mysql:host=127.0.0.1;dbname=cellar','root','');\n \n $response = $handler->handle($request);\n R::close();\n return $response;\n }", "public function handle($req)\n {\n $params = $req->post ?: [];\n\n $files = $this->transformFiles($req->files);\n\n $cookies = $req->cookie ?: [];\n\n $server = $this->transformHeadersToServerVars(array_merge($req->header, [\n 'PATH_INFO' => array_get($req->server, 'path_info'),\n ]));\n $server['X_REQUEST_ID'] = Str::uuid()->toString();\n\n $requestUri = $req->server['request_uri'];\n if (isset($req->server['query_string']) && $req->server['query_string']) {\n $requestUri .= \"?\" . $req->server['query_string'];\n }\n\n $resp = $this->call(\n strtolower($req->server['request_method']),\n $requestUri, $params, $cookies, $files,\n $server, $req->rawContent()\n );\n\n return [\n 'status' => $resp->getStatusCode(),\n 'headers' => $resp->headers,\n 'body' => $resp->getContent(),\n ];\n }", "public function handle(Request $request)\n {\n $route_params = $this->_router->match($request->getUri());\n $route = $route_params['route'];\n $params = $route_params['params'];\n\n $func = reset($route) . self::CONTROLLER_METHOD_SUFIX;\n $class_name = key($route);\n $controller = new $class_name($request);\n\n $response = call_user_func_array(\n [\n $controller,\n $func,\n ],\n [$params]\n );\n\n if ($response instanceof Response) {\n return $response;\n } else {\n throw new InvalidHttpResponseException();\n }\n }" ]
[ "0.8299201", "0.8147294", "0.8147294", "0.8147294", "0.8127764", "0.7993589", "0.7927201", "0.7912899", "0.7899075", "0.76317674", "0.75089735", "0.7485808", "0.74074036", "0.7377414", "0.736802", "0.7294553", "0.72389543", "0.7230166", "0.72108", "0.71808434", "0.7170364", "0.71463037", "0.7126907", "0.7122795", "0.71225274", "0.7116879", "0.70607233", "0.6981947", "0.6966695", "0.69393975", "0.6912079", "0.68985975", "0.6887614", "0.68774897", "0.6806274", "0.67969805", "0.67778915", "0.6762979", "0.67565143", "0.67533374", "0.67192745", "0.6683243", "0.66487724", "0.66395754", "0.6634629", "0.66283566", "0.6617558", "0.6610097", "0.6610011", "0.6544976", "0.653806", "0.6512757", "0.64682734", "0.64381886", "0.6416964", "0.63373476", "0.63359964", "0.6334543", "0.63308066", "0.6321675", "0.63176167", "0.631661", "0.6310991", "0.63108873", "0.6295945", "0.6279438", "0.62778515", "0.62508965", "0.62422955", "0.62321424", "0.62237644", "0.6203428", "0.61954546", "0.6191255", "0.61774665", "0.61682004", "0.6151806", "0.61271876", "0.61257905", "0.6116093", "0.61126447", "0.6112368", "0.6101652", "0.60893977", "0.60871464", "0.60862815", "0.60734737", "0.60535145", "0.6028341", "0.60250086", "0.60224646", "0.6011745", "0.6011483", "0.60106593", "0.5998867", "0.5997086", "0.5991233", "0.59844923", "0.59668386", "0.5961315", "0.5954762" ]
0.0
-1
Check if socialite service is enabled in config
protected function isServiceAvailable($service) { return in_array( strtolower($service), array_keys(config('awesio-auth.socialite.services')) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function facebook_enabled()\r\n{\r\n\tglobal $settings;\r\n\t\r\n\treturn !empty($settings['facebook_app_id']) && !empty($settings['facebook_app_secret']);\r\n}", "function the_champ_social_login_provider_enabled($provider){\r\n\tglobal $theChampLoginOptions;\r\n\tif(the_champ_social_login_enabled() && isset($theChampLoginOptions['providers']) && in_array($provider, $theChampLoginOptions['providers'])){\r\n\t\treturn true;\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n}", "public function usingSocialAccount()\n {\n return ( ! is_null($this->provider) && ! is_null($this->provider_id) ) ? true : false;\n }", "protected function isServiceAvailable()\n {\n return (boolean) $this->extConfig['providers'][strtolower($this->provider)]['enabled'];\n }", "public function plugin_is_configured() {\n\t\treturn isset( $this->settings->client_id, $this->settings->base_uri ) && $this->settings->client_id && $this->settings->base_uri;\n\t}", "function the_champ_social_login_enabled(){\r\n\tglobal $theChampLoginOptions;\r\n\tif(isset($theChampLoginOptions['enable']) && $theChampLoginOptions['enable'] == 1){\r\n\t\treturn true;\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n}", "public function facebook()\r\n\t{\r\n\t\treturn (bool) Mage::getStoreConfig('ec/facebook/enable');\r\n\t}", "function b2c_has_social_login() {\n\treturn ! empty( b2c_get_current_user_auth_provider() );\n}", "public static function hasLinkedInSupport()\n {\n return static::enabled(static::linkedin());\n }", "function isEnabled()\n{\n global $avahips_config;\n\n // Load Avahi-PS configuration file\n $aps_cfg = load_conffile($avahips_config);\n\n // Check for IPFS as a backend database for publication\n if (isset($aps_cfg['DATABASE']) && strpos($aps_cfg['DATABASE'], 'ipfs') !== false) {\n return true;\n }\n return false;\n}", "public function hasConfig();", "public static function isConfigured()\n {\n return !(bool) (empty(self::applicationId()) || empty(self::apiKey()));\n }", "function the_champ_social_sharing_enabled(){\r\n\tglobal $theChampSharingOptions;\r\n\tif(isset($theChampSharingOptions['enable']) && $theChampSharingOptions['enable'] == 1){\r\n\t\treturn true;\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n}", "function have_services(){\n\t$services = get_services();\n\treturn !empty($services) && is_array($services);\n}", "public static function hasFacebookSupport()\n {\n return static::enabled(static::facebook());\n }", "function the_champ_social_counter_enabled(){\r\n\tglobal $theChampCounterOptions;\r\n\tif(isset($theChampCounterOptions['enable'])){\r\n\t\treturn true;\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n}", "function has_config() {\n return true;\n }", "public static function isEnabled()\n {\n $app_model = new waAppSettingsModel();\n $is_enabled = $app_model->get(array('shop', self::PLUGIN_ID), self::PLUGIN_ID . '-profile');\n $profile_cookie = $app_model->get(array('shop', self::PLUGIN_ID), self::PLUGIN_ID_SHORT . '-profile-cookie');\n $cookie_enabled = $profile_cookie && waRequest::cookie($profile_cookie, '');\n return $is_enabled && $cookie_enabled;\n }", "function have_profile(){\n\treturn ( get_profile('enabled') === true && get_profile() !== -1 );\n}", "private function isEnableOpenPlatform()\n {\n return $this->config()->has('wechat.open_platform');\n }", "function hasDiigo(){\n if (!empty(\\Idno\\Core\\site()->config()->diigo)) {\n return true;\n }\n\t\t\t return false;\n }", "function is_user_connected_with($service){\n\tglobal $user_ID;\n\tswitch($service){\n\t\tcase 'facebook':\n\t\t\treturn (boolean) get_facebook_id($user_ID);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn false;\n\t\t\tbreak;\n\t}\n}", "function ppom_is_api_enable() {\n \n $api_enable = get_option( 'ppom_api_enable' );\n $api_key = get_option( 'ppom_rest_secret_key' );\n \n $return = false;\n \n if( $api_enable == 'yes' && $api_key != '' ) {\n $return = true;\n }\n \n return $return;\n}", "public static function getEnabled()\n {\n return array_filter(\n $providers = array_keys(self::getProviders(), true, true),\n function ($provider) {\n // if ('google' === $provider && ends_with(config('app.url'), '.local')) {\n // return false;\n // }\n\n return self::isConfigured($provider);\n }\n );\n }", "public function isEnabledInSystem()\r\n\t{\r\n\t\t// Get global vars\r\n\t\tglobal $realtime_webservice_global_enabled;\r\n\t\t// If both vars have a value, then it IS enabled\r\n\t\treturn $realtime_webservice_global_enabled;\r\n\t}", "function is_nextend_facebook_login() {\n\t\tif ( class_exists( 'NextendSocialLogin', false ) && ! class_exists( 'NextendSocialLoginPRO', false ) ) {\n\t\t\treturn NextendSocialLogin::isProviderEnabled( 'facebook' );\n\t\t}\n\t\treturn false;\n\t}", "public function environmentIsConfigured();", "public function isTagalysActive()\n\t{\n\t\t//$status = $this->scopeConfig->getValue('tgs_search/default/status', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\t\t$status = $this->scopeConfig->getValue('tagalys_tglssearch/general/enable', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\n\t\tif ($status)\n\t\t{\n\n\t\t\t//$service = $this->tglssearchClientConnector;\n\t\t\t$service = $this->tglssearchClientConnector;\n\t\t $tagalys = $service->isRequestSuccess();\n\t\t if($tagalys)\n\t\t\t{\n\t\t\t\t//print_r('if');die;\n\t\t \treturn $service;\n\t\t }\n\t\t\telse\n\t\t\t{\n\t\t\t\t//print_r('else');die;\n\t\t \treturn false;\n\t\t }\n\n\t\t} else\n\t\t{\n\t\t\t//print_r('false');die;\n\t\t\treturn false;\n\t\t}\n\t\t//print_r('nthg');die;\n\t}", "function the_champ_facebook_plugin_enabled(){\r\n\tglobal $theChampFacebookOptions, $theChampCounterOptions;\r\n\tif((the_champ_social_commenting_enabled() && the_champ_facebook_commenting_enabled()) || the_champ_facebook_like_rec_enabled()){\r\n\t\treturn true;\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n}", "public static function hasProvider() {\n\t\treturn !is_null(self::$provider);\n\t}", "function is_system_configured() {\n global $CFG;\n return (!empty($CFG->ombielalertsserverendpoint) && \n !empty($CFG->ombielalertsserversserverusername) && \n !empty($CFG->ombielalertsserverpassword) && \n !empty($CFG->ombielalertsorgcode) && \n !empty($CFG->ombielalertsorgpassword)\n );\n }", "public function getStatus(){\r\n if($this->scopeConfigInterface->getValue(self::XML_PATH_ENABLED,ScopeInterface::SCOPE_WEBSITE) ==1){\r\n return true;\r\n }\r\n return false;\r\n }", "function is_pppoe_server_enabled() {\n\t$pppoeenable = false;\n\n\tforeach (config_get_path('pppoes/pppoe', []) as $pppoes) {\n\t\tif ($pppoes['mode'] == 'server') {\n\t\t\t$pppoeenable = true;\n\t\t}\n\t}\n\n\treturn $pppoeenable;\n}", "public static function enabled(string $provider)\n {\n return in_array($provider, config('socialstream.providers', []));\n }", "public function has_config() {\n return true;\n }", "public function has_config() {\n return true;\n }", "function is_nextend_google_login() {\n\t\tif ( class_exists( 'NextendSocialLogin', false ) && ! class_exists( 'NextendSocialLoginPRO', false ) ) {\n\t\t\treturn NextendSocialLogin::isProviderEnabled( 'google' );\n\t\t}\n\t\treturn false;\n\t}", "public function isConfiguredForThisStore()\n {\n return $this->getUsername() && $this->isEnabled();\n }", "public function isApiEnabled()\n {\n return (Mage::getStoreConfig('smsnotifier/main_conf/active')==0) ? 0 : 1;\n\n }", "public function has_config() {\n return false;\n }", "public function has_config() {\n return false;\n }", "public function isServiceEnabled(): bool\n {\n return $this->getModuleRegistry()->isModuleEnabled(SchemaConfigurationFunctionalityModuleResolver::SCHEMA_CONFIGURATION);\n }", "function plugin_satisfactionsmiley_check_config() {\n return true;\n}", "public function checkAcquiaHosted() {\n return isset($_SERVER['AH_SITE_ENVIRONMENT'], $_SERVER['AH_SITE_NAME']);\n }", "function configEnabled() { global $db;\n global $lang;\n\n $dbtst = $db->query(\"SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '\".$lang[\"config_db_name\"].\"'\");\n if($dbtst->num_rows == 0) {\n $prepReturn = prepConfig();\n if ($prepReturn == \"Ready\"){\n return true;\n } else {\n return $prepReturn;\n }\n } else {\n return true;\n }\n }", "private function _check_socials_access() {\n\n return Access_token::inst()->check_socials_access($this->c_user->id);\n\n }", "public function isApiEnabled()\n {\n return (Mage::getStoreConfig('easywebshopsms/api_connection/active')==0) ? false : true;\n }", "public function hasProviders(): bool;", "function sloodle_autoreg_enabled_site()\n {\n return (bool)sloodle_get_config('sloodle_allow_autoreg');\n }", "function acadp_registration_enabled() {\n\n\t$registration_settings = get_option( 'acadp_registration_settings', array() );\n\n\tif( ! empty( $registration_settings['engine'] ) && 'acadp' == $registration_settings['engine'] ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n\n}", "protected function isHostConfigured() {}", "public function isEnabled(): bool\n {\n return config('theme-system.enable', true) ?? true;\n }", "public static function isMultiSiteEnabled()\n {\n return sfConfig::get('app_rt_enable_multi_site', false);\n }", "public function getIsServiceProvider()\n {\n if (array_key_exists(\"isServiceProvider\", $this->_propDict)) {\n return $this->_propDict[\"isServiceProvider\"];\n } else {\n return null;\n }\n }", "function sloodle_autoenrol_enabled_site()\n {\n return (bool)sloodle_get_config('sloodle_allow_autoenrol');\n }", "function is_user_registered_with($service){\n\tglobal $gianism, $wpdb;\n\tswitch($service){\n\t\tcase 'facebook':\n\t\t\t$user_id = get_user_id_on_fangate();\n\t\t\t$sql = <<<EOS\n\t\t\t\tSELECT user_id FROM {$wpdb->usermeta}\n\t\t\t\tWHERE meta_key = 'wpg_facebook_id' AND meta_value = %s\nEOS;\n\t\t\treturn $wpdb->get_var($wpdb->prepare($sql, $signed['user_id']));\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn false;\n\t\t\tbreak;\n\t}\n}", "public static function hasTwitterSupport()\n {\n return static::enabled(static::twitter());\n }", "function jetpack_is_atomic_site() {\n\t$at_options = get_option( 'at_options', array() );\n\treturn ! empty( $at_options ) || defined( 'WPCOMSH__PLUGIN_FILE' );\n}", "protected function isEnabled()\n {\n $store = Mage::app()->getStore();\n return $store->getConfig('cueconnect/enabled/enabled');\n }", "public function isProviderOnline($provider = null): bool;", "function at_follow_is_pro_user() {\n $isPro = false;\n $options = get_option('addthis_settings');\n $profile = $options['profile'];\n if ($profile) {\n $request = wp_remote_get( \"http://q.addthis.com/feeds/1.0/config.json?pubid=\" . $profile );\n $server_output = wp_remote_retrieve_body( $request );\n $array = json_decode($server_output);\n // check for pro user\n if (array_key_exists('_default',$array)) {\n $isPro = true;\n } else {\n $isPro = false;\n }\n }\n return $isPro;\n}", "function wlabarron_saml_is_user_in_config() {\n global $yourls_user_passwords;\n $users = array_keys($yourls_user_passwords);\n \n return in_array(YOURLS_USER, $users);\n}", "public function isEnabled()\n\t{\n\t\treturn Mage::helper('wordpress')->isPluginEnabled('wordpress-seo/wp-seo.php') \n\t\t\t|| Mage::helper('wordpress')->isPluginEnabled('wordpress-seo-premium/wp-seo-premium.php');\n\t}", "public function supports(Request $request) {\n if($request->get('service') === 'google') return false;\n return true;\n }", "function has_altis_config() : bool {\n\tif ( ! function_exists( 'Altis\\\\get_config' ) ) {\n\t\treturn false;\n\t}\n\n\tif ( ! isset( Altis\\get_config()['hm-juicer'] ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "public function is_configured($name)\n\t{\n\t\treturn isset($this->extensions[$name]['ext_active']);\n\t}", "public function is_enabled() {\n $enabled = file_exists(ABSPATH . '!sak4wp.php');\n return $enabled;\n }", "public static function is_available () {\n\t\t$auth = op5Auth::instance();\n\t\tforeach (AuthModulePool_Model::all() as $module) {\n\t\t\t$driver = $auth->get_auth_driver($module->get_modulename());\n\t\t\tif (\n\t\t\t\t$driver->get_metadata('require_user_configuration') &&\n\t\t\t\t$driver->get_user_count() > 0\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function _checkConfig(){\n return true;\n if(count($this->moduleConfig) > 0) return true;\n return false;\n }", "public function hasConfigLoader(): bool;", "public function hasThirdPartyServiceProviders() {\n\t\treturn $this->thirdPartyServiceProviders;\n\t}", "public function is_site_enabled( $app_id ) {\n\n\t\tif ( 'off' === $this->site_status( $app_id ) ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\n\t}", "function the_champ_social_commenting_enabled(){\r\n\tglobal $theChampFacebookOptions;\r\n\tif(isset($theChampFacebookOptions['enable_commenting'])){\r\n\t\treturn true;\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n}", "public function is_available() {\n if ($this->enabled == \"yes\") {\n if (!is_ssl() && !$this->testmode) {\n return false;\n }\n // Required fields check\n if (!$this->secret_key || !$this->publishable_key) {\n return false;\n }\n return true;\n }\n return false;\n }", "public function isRublonConfigured() {\t \t \n\t\treturn ($this->getSystemToken() AND $this->getSecretKey());\n\t}", "public function hasFacebook(): bool;", "public static function isConfigured($provider = null)\n {\n return !array_diff(\n self::$requiredConfig,\n array_keys(config()->get(\"services.${provider}\", []), true, false)\n );\n }", "public static function isGgoogleAnalyticConfigured()\n {\n return (bool) config('analytics.view_id');\n }", "public function is_enabled()\n {\n }", "public function isEnabled()\n {\n return (bool)Mage::helper('Core')->isModuleEnabled('Faonni_AccountNavigation') && \n\t\t\tMage::getStoreConfig('faonni_accountnavigation/general/active');\n }", "public function isVconnetEnabled() {\n\t\n\t\t$installed = Mage::helper('core')->isModuleEnabled('Vconnect_Postnord');\n\t\t\n\t\tif($installed == true) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\n\t}", "public function isServiceEnabled(): bool\n {\n $enablingModule = $this->getEnablingModule();\n if ($enablingModule !== null && !$this->getModuleRegistry()->isModuleEnabled($enablingModule)) {\n return false;\n }\n\n return true;\n }", "function idealEnabled() {\r\n\t\t$db = & JFactory::getDBO();\r\n\t\t$sql = 'SELECT COUNT(id) FROM #__osmembership_plugins WHERE name=\"os_ideal\" AND published=1';\r\n\t\t$db->setQuery($sql) ;\r\n\t\t$total = $db->loadResult() ;\r\n\t\tif ($total) {\r\n\t\t\trequire_once JPATH_ROOT.'/components/com_osmembership/plugins/ideal/ideal.class.php';\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 static function isAvailible() {\n $domain = self::SERVICE_URL;\n \n if(!filter_var($domain, FILTER_VALIDATE_URL)) {\n return false;\n }\n\n //initialize curl\n $curlInit = curl_init($domain);\n curl_setopt($curlInit,CURLOPT_CONNECTTIMEOUT,10);\n curl_setopt($curlInit,CURLOPT_HEADER,true);\n curl_setopt($curlInit,CURLOPT_NOBODY,true);\n curl_setopt($curlInit,CURLOPT_RETURNTRANSFER,true);\n\n //get answer\n $response = curl_exec($curlInit);\n\n curl_close($curlInit);\n\n if ($response) return true;\n\n return false;\n }", "public function hasConfig() {\n\t\treturn (bool)@file_exists($this->fullModulePath.'/config.ini');\n\t}", "private function isOnboardedWithAccountAndGoogle()\n {\n if (false === (new PsAccountsService())->getShopUuidV4() &&\n false === $this->configurationRepository->getGoogleLinkedValue()\n ) {\n return false;\n }\n\n return true;\n }", "public function isEnabled()\n {\n return $this->config->isEnabledSDK($this->_storeManager->getStore()->getId());\n }", "private function _isEnvisSet(){\n\t\t/* Variable initialization */\n\t\t$blnIsSet\t= true;\n\t\t\n\t\t/* if setup configuration is not done then then do needful */\n\t\tif($this->getEnvSetupConfigured() == 0){\n\t\t\t/* value overriding */\n\t\t\t$blnIsSet\t= false;\n\t\t}\n\t\t\n\t\t/* Redirect to set-up module */\n\t\tif((!$blnIsSet) && ($this->uri->segment(1) != 'settings' && $this->uri->segment(1) != 'mod' && $this->uri->segment(1) != 'manage_widgets' && $this->uri->segment(1) != 'manage-widgets' && $this->uri->segment(1) != 'social_wall' && $this->uri->segment(1) != 'social-wall')){\n\t\t\t/* redirecting to login */\n\t\t\tredirect(SITE_URL.'settings/setup');\n\t\t}\n\t}", "static public function is_enabled($contextname) {\n return get_config('metadatacontext_'.$contextname, 'metadataenabled') == 1;\n }", "public function hasConfig($package);", "public function is_elex_dpd_enabled() {\n\t\treturn class_exists( 'Elex_dp_dynamic_pricing_plugin' );\n\t}", "public function loadSettings() {\n $this->serverURL = Yii::$app->getModule('rocketchat')->settings->get('serverURL');\n return true;\n }", "public function checkIfEssentialConfigurationExists() {}", "private static function linkToNet()\n\t{\n\t\tif(!Loader::includeModule('socialservices'))\n\t\t\treturn false;\n\n\t\tif(self::isLinkedToNet())\n\t\t\treturn true;\n\n\t\t$result = false;\n\t\t$request = \\Bitrix\\Main\\Context::getCurrent()->getRequest();\n\t\t$host = ($request->isHttps() ? 'https://' : 'http://').$request->getHttpHost();\n\t\t$registerResult = \\CSocServBitrix24Net::registerSite($host);\n\n\t\tif(is_array($registerResult) && isset($registerResult[\"client_id\"]) && isset($registerResult[\"client_secret\"]))\n\t\t{\n\t\t\tOption::set('socialservices', 'bitrix24net_domain', $host);\n\t\t\tOption::set('socialservices', 'bitrix24net_id', $registerResult[\"client_id\"]);\n\t\t\tOption::set('socialservices', 'bitrix24net_secret', $registerResult[\"client_secret\"]);\n\t\t\t$result = true;\n\t\t}\n\n\t\treturn $result;\n\t}", "private static function verifyEnabled() {\n try {\n\n $customerId = session()->get('id');\n\n $final = self::executeSweetApi(\n 'GET',\n '/api/social-class/v1/frontend/final?where[customers_id]='.$customerId,\n []\n );\n\n // Log::debug(get_object_vars($final));\n\n /**\n * Se já tiver atualizado as informações pessoais.\n */\n if (strlen(session()->get('updated_personal_info_at')) < 1) {\n return false;\n } \n\n /**\n * Se não possuir registro em final_social_class.\n */\n if(false === isset($final->data[0]->id)){\n return true;\n }\n\n /**\n * Se a classe social ainda for nula.\n */\n if(isset($final->data[0]->id) && (null == $final->data[0]->final_class_by_questions)){\n return true;\n }\n\n /**\n * Se já ganhou a pontuação.\n */\n if(isset($final->data[0]->id) && (60 == $final->data[0]->earned_points)){\n return false;\n }\n\n return false;\n\n } catch (RequestException $exception) {\n Log::debug($exception->getMessage());\n } catch (ConnectException $exception) {\n Log::debug($exception->getMessage());\n } catch (ClientException $exception) {\n Log::debug($exception->getMessage());\n } catch (BadResponseException $exception) {\n Log::debug($exception->getMessage());\n } \n }", "protected function isConfigured()\n {\n $skip = Tools::getValue('skip');\n if ($skip) {\n Configuration::updateValue('DF_ENABLE_HASH', 0);\n Configuration::updateValue('DF_ENABLED_V9', true);\n }\n $sql = 'SELECT id_configuration FROM ' . _DB_PREFIX_ . 'configuration WHERE name = \\'DF_ENABLE_HASH\\'';\n\n return Db::getInstance()->getValue($sql);\n }", "function IsGoogleAnalytics() {\n\t\t// SiteConfig::current_site_config()->googleAnalytics;\n\t\treturn Member::currentUserID() ? 0 : 1;\n\t}", "public function is_search_api_key_in_config() {\n\t\treturn defined( 'ALGOLIA_SEARCH_API_KEY' );\n\t}", "function tinc_enabled()\n{\n $mdl = new \\OPNsense\\Tinc\\Tinc();\n\n foreach ($mdl->networks->network->iterateItems() as $network) {\n if ($network->enabled == '1') {\n return true;\n }\n }\n\n return false;\n}", "public function is_enabled() {\n return $this->proxy_host && $this->proxy_port;\n }" ]
[ "0.69382507", "0.67498225", "0.66967314", "0.6545528", "0.6540319", "0.6507632", "0.6442985", "0.642975", "0.6419139", "0.6418256", "0.64060265", "0.6385257", "0.6361121", "0.63418335", "0.627566", "0.62475497", "0.6231476", "0.62199867", "0.62136215", "0.61888117", "0.6160851", "0.61444175", "0.61337554", "0.6132914", "0.6105085", "0.6096188", "0.6089709", "0.60822475", "0.6061943", "0.6046793", "0.60457635", "0.6039336", "0.6027695", "0.60268664", "0.6024574", "0.6024574", "0.6020446", "0.60133815", "0.6013322", "0.5989554", "0.5989554", "0.59711117", "0.5965634", "0.5961292", "0.5957277", "0.59559613", "0.59367055", "0.5913563", "0.5905078", "0.5900199", "0.5896756", "0.5892217", "0.5888381", "0.5877238", "0.5876538", "0.587617", "0.58745956", "0.5872776", "0.5856515", "0.58553386", "0.5843931", "0.58353513", "0.58298564", "0.58252215", "0.5820718", "0.5816138", "0.58151567", "0.5812679", "0.57922816", "0.57794183", "0.5779188", "0.57772696", "0.57751167", "0.5762585", "0.5756663", "0.5745238", "0.573744", "0.573471", "0.57294977", "0.57259345", "0.5721294", "0.5717622", "0.5713006", "0.5709139", "0.5704969", "0.5701228", "0.569399", "0.5684673", "0.5679352", "0.5675118", "0.5671494", "0.56670535", "0.5660148", "0.5656181", "0.5645206", "0.5641378", "0.56333715", "0.563122", "0.562953", "0.56228906" ]
0.6338699
14
Returns (the parent) path ( a Path object).
public function getPath() { return $this->path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getParentPath() {\n\t\treturn $this->parentPath;\n\t}", "public function GetParent()\n {\n $pathcount = count($this->paths);\n \n if ($pathcount <= 1)\n return FALSE; // there is no parent\n\n $pathcount--; // the parent has one path less\n\n $result = array();\n for ($i = 0; $i < $pathcount; $i++)\n $result[$i] = $this->paths[$i];\n\n return new TPhysicalPath($result);\n }", "public function getParent()\n {\n if (! $this->parentrecord) {\n list($this->parentrecord, $unused) = self::getParentAndChild($this->flatpath);\n }\n return $this->parentrecord;\n }", "public function getParent() {\n\t\tif ($this->path === '/') {\n\t\t\treturn NULL;\n\t\t}\n\t\treturn $this->nodeDataRepository->findOneByPath($this->parentPath, $this->workspace);\n\t}", "public function getParentFolder() {}", "public function getParentFolder() {}", "public function getParentFolder() {}", "public function getPath()\n {\n \treturn implode(' / ', array_map(create_function('$a', 'return trim($a->getName());'), $this->getParents()));\n }", "function get_parent() {\n return $this->get_mapped_property('parent');\n }", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "public function getParent() {}", "public function getPath() : Path\n {\n return $this->path;\n }", "public function getPath() {\n\t\treturn $this->current_path;\n\t}", "public function get_parent() {\n\t\treturn $this->parent();\n\t}", "protected function get_parent()\r\n {\r\n return $this->parent;\r\n }", "public static function getParent(string $path) : File\n {\n return (new File($path))->getParent();\n }", "public function getParent()\n {\n return $this->Root->parentOfSection($this->URLSegment);\n }", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function get_parent();", "public function parent(){\n return $this->where('id', $this->parent_id)->first();\n }", "function getParentDir()\n {\n $parent = $this->getParent();\n if (trim($parent) != '')\n return ucwords($parent) . '\\\\';\n return $parent;\n }", "public function getParentDirectory($path);", "private function basePath()\n {\n return $this->allDescendants()\n ? $this->parentName\n : $this->childPath($this->parentName, $this->query['from'][0]['collectionId']);\n }", "public function getParentDirectory() {\n\t\treturn new Directory(dirname($this->getPath()));\n\t}", "public function getPath() {\n $path = '';\n try {\n $path = $this->getParent()->getPath();\n } catch (PageException $e) {}\n return $path . '/' . $this->getSlug();\n }", "public function getPath()\n {\n return $this->wrapped->getPath();\n }", "public function getPath()\n\t{\n\t\t\n\t\t$this->setPath();\n\t\treturn $this->path;\n\t\t\n\t}", "function getParent();", "function get_parent_dir() {\n $path = $_SERVER['PHP_SELF'];\n $splitPath = explode('/', $path);\n return $splitPath[1];\n }", "public function parent()\n {\n if ( !$this->loaded )\n $this->reload();\n\n if ($this->is_root())\n return NULL;\n\n if ( ! in_array('parent', $this->_objects) )\n {\n $sql = \"SELECT * FROM $this->_table_name\n WHERE \n $this->primary_column = $this->parent_key\n ORDER BY \". $this->_sorting[0] .\" \". $this->_sorting[1] .\"\n \";\n\n $result = $this->_db->query($sql);\n\n $this->_objects['parent'] = $this->factory_set($result)[0];\n }\n\n return $this->_objects['parent'];\n }", "public function parent() {\n return $this->parent;\n }", "final public function getParent()\n\t{\n\t\treturn $this->parent;\n\t}", "public function getPath() {\n\t\treturn $this->path;\n\t}", "public function getPath() {\n\t\treturn $this->path;\n\t}", "function get_parent()\r\n {\r\n return $this->parent;\r\n }", "function get_parent()\r\n {\r\n return $this->parent;\r\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent () {\n\t\treturn ProjectFactory::getProject($this->idParent);\n\t}", "public function getPath()\n {\n return $this->dirs[0];\n }", "public function getPath()\n {\n return $this->dirs[0];\n }", "public function getParent()\n {\n }", "public function parent()\r\n\t{\r\n\t\treturn $this->parent;\r\n\t}", "public function getParent()\n {\n return $this->parent;\n\n }", "public function __invoke()\n {\n return $this->getParent();\n }", "function getPath() {\n\t\treturn $this->path;\n\t}", "public function getPath()\n {\n return $this->__get(\"path\");\n }", "public function getPath()\r\n\t{\r\n\t\treturn $this->path;\r\n\t}", "public function getParent() {\n return $this->parent;\n }", "public function getParent()\n\t{\n\t\treturn $this->parent;\n\t}", "public function getParent()\n\t{\n\t\treturn $this->parent;\n\t}", "public function getPath()\n\t{\n\t\treturn $this->path;\n\t}", "public function getPath()\n\t{\n\t\treturn $this->path;\n\t}", "public function getPath()\n\t{\n\t\treturn $this->path;\n\t}", "public function getPath()\n\t{\n\t\treturn $this->path;\n\t}", "public function getPath()\n {\n\n return $this->path;\n }", "public function getParent() {\n\t\treturn $this->parent;\n\t}", "public function getParent() {\n\t\treturn $this->parent;\n\t}" ]
[ "0.8550171", "0.8029668", "0.73963535", "0.73733944", "0.72390866", "0.7238708", "0.7238708", "0.7073291", "0.702299", "0.70032907", "0.70032907", "0.70032907", "0.70032907", "0.70032907", "0.70032907", "0.70032907", "0.69366294", "0.6932953", "0.6891948", "0.68343174", "0.68252033", "0.6799641", "0.6793994", "0.6793994", "0.6793994", "0.6793994", "0.6793994", "0.6793994", "0.6793994", "0.6793994", "0.6793994", "0.6793994", "0.679144", "0.6776825", "0.67729354", "0.6766617", "0.67520165", "0.67515475", "0.6736162", "0.67108965", "0.6701851", "0.666105", "0.66564304", "0.6638705", "0.6633651", "0.6630738", "0.6621547", "0.6621547", "0.66131115", "0.66131115", "0.6613007", "0.6613007", "0.6613007", "0.6613007", "0.6613007", "0.6613007", "0.6613007", "0.6613007", "0.6613007", "0.6613007", "0.6613007", "0.6613007", "0.6613007", "0.6613007", "0.6613007", "0.6613007", "0.6613007", "0.6613007", "0.6613007", "0.6613007", "0.6613007", "0.6613007", "0.6613007", "0.65991545", "0.65989965", "0.65989965", "0.65927106", "0.6587325", "0.6573162", "0.6565183", "0.6563273", "0.6551994", "0.6551479", "0.65501505", "0.6545957", "0.6545957", "0.65414006", "0.65414006", "0.65414006", "0.65414006", "0.6533065", "0.65297586", "0.65297586" ]
0.0
-1
Converts the object back to an \stdClass object. stdClass
public function toStdClass() : \stdClass { $obj = new \stdClass(); $obj->id = $this->id; $obj->path = $this->path->toStdClass(); $obj->path->siteName = NULL; $obj->type = $this->type; $obj->recycled = $this->recycled; return $obj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function asObject(): stdClass\n {\n return json_decode($this->result);\n }", "public function asClass(): \\stdClass {\n\t\treturn (object) $this->asArray();\n\t}", "public function toStdClass(): \\stdClass\n\t{\n\t\t$arr = $this->toArray(false);\n\t\tif (count($arr) === 0) {\n\t\t\treturn new \\stdClass();\n\t\t} else {\n\t\t\treturn json_decode(json_encode($arr, JSON_UNESCAPED_SLASHES));\n\t\t}\n\t}", "public function toStdClass() : \\stdClass\n {\n $obj = new \\stdClass();\n $obj->level = $this->level;\n $obj->type = $this->type;\n $obj->name = $this->name;\n return $obj;\n }", "public function toStdClass() {\n $stdClass = new stdClass();\n $stdClass->number = $this->_number;\n $stdClass->internal = $this->_internal;\n return $stdClass;\n }", "static private function convertToOriginalObject($object) {\n $objectType = $object->_className;\n if (get_class($object) == $objectType) {\n return $object;\n }\n $newObject = new $objectType();\n $vars = get_object_vars($object);\n foreach ($vars as $property => $value) {\n $newObject->$property = $value;\n }\n return $newObject;\n }", "public function toObject(){\r\n return json_decode($this->toJson());\r\n }", "public function document_to_object(stdClass $document): stdClass\n\t{\n\t\t$result = [];\n\n\t\tif (isset($document))\n\t\t{\n\t\t\t$result = $this->convert_document_id($document);\n\t\t}\n\n\t\treturn $result;\n\t}", "public function toObject()\r\n\t{\r\n\t\treturn (object)$this->m_data;\r\n\t}", "public function toObject(): object\n {\n $body = (string) $this->response->getBody();\n\n return json_decode($body) ?? (object) [];\n }", "public function toStdClass() {\n $stdClass = new stdClass();\n $stdClass->billOfLading = $this->_billOfLading;\n $stdClass->secondaryPickingType = $this->_secondaryPickingType;\n return $stdClass;\n }", "protected function asObject()\n\t{\n\t\treturn \\json_decode($this->response);\n\t}", "public function toStdClass() {\n $stdClass = new stdClass();\n $stdClass->amountInsuranceBase = $this->_amountInsuranceBase;\n $stdClass->fragile = $this->_fragile;\n $stdClass->parcelsCount = $this->_parcelsCount;\n $stdClass->serviceTypeId = $this->_serviceTypeId;\n return $stdClass;\n }", "private function fromObject(\\stdClass $object)\n {\n $profile = new Profile();\n $this->setModelProperties($profile, $object);\n return $profile;\n }", "public function toStdClass() {\n $stdClass = new stdClass();\n $stdClass->postCode = $this->_postCode;\n $stdClass->name = $this->_name;\n $stdClass->type = $this->_type;\n $stdClass->municipality = $this->_municipality;\n $stdClass->region = $this->_region;\n return $stdClass;\n }", "public function checkStdClass(): stdClass\n {\n if (!$this->value instanceof stdClass) {\n throw new TypeInvalidException('stdClass', gettype($this->value));\n }\n\n return $this->value;\n }", "public function toObject();", "public function cast(stdClass $result) {\n\t\t\t$this->load($result);\n\t\t\t$this->user_ = new user_($result);\n\t\t\t$this->bike_ = new bike_($result);\n\t\t\t$this->brand_ = new brand_($result);\n\t\t}", "private function obj()\n {\n $object = $this->associative ? [] : new \\stdClass;\n\n if (++$this->depth > $this->maxDepth) {\n $this->throwSyntaxError('Maximum stack depth exceeded');\n }\n\n $this->nextOrFail('{');\n $this->white();\n while ($this->currentByte !== null) {\n if ($this->currentByte === '}') {\n $this->nextOrFail('}');\n $this->depth--;\n return $object; // Potentially empty object\n }\n\n // Keys can be unquoted. If they are, they need to be\n // valid JS identifiers.\n if ($this->currentByte === '\"' || $this->currentByte === \"'\") {\n $key = $this->string();\n } else {\n $key = $this->identifier();\n }\n\n $this->white();\n $this->nextOrFail(':');\n if ($this->associative) {\n $object[$key] = $this->value();\n } else {\n $object->{$key} = $this->value();\n }\n $this->white();\n // If there's no comma after this pair, this needs to be\n // the end of the object.\n if ($this->currentByte !== ',') {\n $this->nextOrFail('}');\n $this->depth--;\n return $object;\n }\n $this->nextOrFail(',');\n $this->white();\n }\n\n $this->throwSyntaxError('Invalid object');\n }", "private function convertObjToType($obj){\n\t\t$output = new Type();\n\t\t\n\t\tif(!empty($obj->id)){\n\t\t\t$output->id = $obj->id;\n\t\t}\n\t\t\n\t\tif(!empty($obj->img_presents)){\n\t\t\t$output->img_present = $obj->img_presents;\n\t\t}\n\t\t\n\t\tif(!empty($obj->color_overlay)){\n\t\t\t$output->color_overlay = $obj->color_overlay;\n\t\t}\n\t\t\n\t\tif(!empty($obj->label)){\n\t\t\t$output->label = $obj->label;\n\t\t}\n\t\t\n\t\treturn($output);\n\t\t\n\t}", "static public function object_to_array(stdClass $Class){\n \t# Typecast to (array) automatically converts stdClass -> array.\n \t$newClass = array();\n \t\n \t# Iterate through the former properties looking for any stdClass properties.\n \t# Recursively apply (array).\n \tforeach($Class as $key => $value){\n \t if(is_object($value)&&get_class($value)==='stdClass'){\n \t \t$newClass[$key] = self::object_to_array($value);\n \t }else{\n \t \t$newClass[$key] = $value;\n \t }\n \t}\n \treturn $newClass;\n }", "public function scrubObject(object $data) : object;", "function TransformIntoStdClass($obj){\r\n $attrs = get_object_vars($obj);\r\n if($obj instanceof EntityModel){\r\n /*\r\n * remove attribute from EntityModel\r\n */\r\n unset($attrs['_attrib']);\r\n }\r\n \r\n $cls = new stdClass();\r\n \r\n foreach ($attrs as $key=>$value){\r\n $cls->$key = $value;\r\n }\r\n return $cls;\r\n}", "private function sanitize_attributes_object( $object ) {\n $return = new stdClass();\n\n if ( isset( $object->attributes ) ) {\n foreach ( $object->attributes as $att ) {\n\n $name = $att->name;\n if ( strpos( $name, '.' ) ) {\n $var = explode( '.', $name );\n $name = $var[1];\n }\n\n $return->{$name} = $att->value;\n }\n }\n\n return $return;\n }", "protected static function _rawurldecode_object($data){\n\n\t\t$result = new stdClass;\n\n\t\tforeach ($data as $key => &$value) {\n\n\t\t\tif(is_array($value) || is_object($value)){\n\n\t\t\t\t$result->{$key} = static::_rawurldecode($value);\n\n\t\t\t}else{\n\n\t\t\t\tif(!empty($value)){\n\n\t\t\t\t\t$result->{$key} = rawurldecode($value);\n\n\t\t\t\t}else{\n\n\t\t\t\t\t$result->{$key} = '';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tunset($key, $value);\n\t\t}\n\n\t\treturn (object) $result;\n\t}", "public static function createFromObject(\\stdClass $object) {\n\t\tstatic::createFromArray($object);\n\t}", "function _ctools_export_unpack_object($schema, $data, $object = 'stdClass') {\r\n if (is_string($object)) {\r\n if (class_exists($object)) {\r\n $object = new $object;\r\n }\r\n else {\r\n $object = new stdClass;\r\n }\r\n }\r\n\r\n // Go through our schema and build correlations.\r\n foreach ($schema['fields'] as $field => $info) {\r\n if (isset($data->$field)) {\r\n $object->$field = empty($info['serialize']) ? $data->$field : unserialize($data->$field);\r\n\t\t\t//$object->$field = $data->$field;\r\n }\r\n else {\r\n $object->$field = NULL;\r\n }\r\n }\r\n\r\n if (isset($schema['join'])) {\r\n foreach ($schema['join'] as $join_key => $join) {\r\n $join_schema = ctools_export_get_schema($join['table']);\r\n if (!empty($join['load'])) {\r\n foreach ($join['load'] as $field) {\r\n $info = $join_schema['fields'][$field];\r\n $object->$field = empty($info['serialize']) ? $data->$field : unserialize($data->$field);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return $object;\r\n}", "public function getResult(): \\stdClass\n {\n return $this->result;\n }", "function fix_object($object)\n {\n // preg_replace_callback handler. Needed to calculate new key-length.\n $fix_key = create_function('$matches', 'return \":\" . strlen( $matches[1] ) . \":\\\"\" . $matches[1] . \"\\\"\";');\n\n // 1. Serialize the object to a string.\n $dump = serialize($object);\n\n // 2. Change class-type to 'stdClass'.\n $dump = preg_replace('/^O:\\d+:\"[^\"]++\"/', 'O:8:\"stdClass\"', $dump);\n\n // 3. Make private and protected properties public.\n $dump = preg_replace_callback('/:\\d+:\"\\0.*?\\0([^\"]+)\"/', $fix_key, $dump);\n\n // 4. Unserialize the modified object again.\n return unserialize($dump);\n }", "public function fetch_object()\n\t{\n\t\t$object = null;\n\t\tif (current($this->result)) {\n\t\t\tforeach (current($this->result) AS $key => $value) {\n\t\t\t\t$object->$key = $value;\n\t\t\t}\n\t\t}else {\n\t\t\t$object = FALSE;\n\t\t}\n\t\tnext($this->result);\n\t\treturn $object;\n\t}", "function obj_clone($obj) {\n $new_obj = new stdClass();\n foreach($obj as $key=>$value) {\n $new_obj->$key = $value;\n }\n return $new_obj;\n}", "public function as_object() {\r\n $this->fetch_mode = 'object';\r\n return $this;\r\n }", "public static function array2object($array) {\r\r\n \r\r\n\t\tif (is_array($array)) {\r\r\n\t\t\t$obj = new StdClass();\r\r\n\t \r\r\n\t\t\tforeach ($array as $key => $val){\r\r\n\t\t\t\t$obj->$key = $val;\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n \telse { $obj = $array; }\r\r\n\t\t\r\r\n \t\treturn $obj;\r\r\n\t}", "public static function toStdClass($o)\n {\n if ($o instanceof DateTime) {\n return $o->getTimestamp();\n }\n\n if (is_array($o)) {\n $o_new = array();\n foreach ($o as $oitem) {\n $o_new[] = self::toStdClass($oitem);\n }\n\n return $o_new;\n }\n\n if (!is_object($o)) {\n if (is_numeric($o)) {\n $vint = intval($o);\n $vfloat = floatval($o);\n $v = ($vfloat != $vint) ? $vfloat : $vint;\n\n return $v;\n }\n\n return $o;\n }\n\n $xary = (array)$o;\n $o_new = new stdClass ();\n foreach ($xary as $k => $v) {\n if ($k[0] == \"\\0\") {\n // private/protected members have null-delimited prefixes\n // that need to be removed\n $prefix_length = stripos($k, \"\\0\", 1) + 1;\n $k = substr($k, $prefix_length, strlen($k) - $prefix_length);\n }\n\n $o_new->$k = self::toStdClass($v);\n }\n\n return $o_new;\n }", "public final function getReference(): \\stdClass\n {\n return clone $this->reference;\n }", "private static function transform_db_row_to_data(stdClass $dbrow) : stdClass {\n return (object) [\n 'name' => $dbrow->reengagementname,\n 'userid' => $dbrow->userid,\n 'completiontime' => transform::datetime($dbrow->completiontime),\n 'emailtime' => transform::datetime($dbrow->emailtime),\n 'emailsent' => $dbrow->emailsent,\n 'completed' => $dbrow->completed\n ];\n }", "protected function make_object( \\stdClass $data ) {\n\t\treturn new Purchase( $data );\n\t}", "public static function getObj($object){\n\t\t\treturn self::get($object, static::factory(), static::factory());\n\t\t}", "public function as_object()\n {\n $this->return_as = 'object';\n return $this;\n }", "public function toStdClass() {\n $stdClass = new stdClass();\n $stdClass->billOfLading = $this->_billOfLading;\n $stdClass->takingDate = $this->_takingDate;\n $stdClass->serviceTypeId = $this->_serviceTypeId;\n $stdClass->officeToBeCalledId = $this->_officeToBeCalledId;\n if (isset($this->_optionsBeforePayment)) {\n \t$stdClass->optionsBeforePayment = $this->_optionsBeforePayment->toStdClass();\n }\n \n $stdClass->fixedTimeDelivery = $this->_fixedTimeDelivery;\n $stdClass->deferredDeliveryWorkDays = $this->_deferredDeliveryWorkDays;\n $stdClass->backDocumentsRequest = $this->_backDocumentsRequest;\n $stdClass->backReceiptRequest = $this->_backReceiptRequest;\n $stdClass->willBringToOffice = $this->_willBringToOffice;\n $stdClass->willBringToOfficeId = $this->_willBringToOfficeId;\n $stdClass->specialDeliveryId = $this->_specialDeliveryId;\n $stdClass->amountInsuranceBase = $this->_amountInsuranceBase;\n $stdClass->amountCodBase = $this->_amountCodBase;\n $stdClass->payCodToThirdParty = $this->_payCodToThirdParty;\n $stdClass->retMoneyTransferReqAmount = $this->_retMoneyTransferReqAmount;\n $stdClass->retThirdPartyPayer = $this->_retThirdPartyPayer;\n $stdClass->parcelsCount = $this->_parcelsCount;\n if (isset($this->_size)) {\n $stdClass->size = $this->_size->toStdClass();\n }\n $stdClass->weightDeclared = $this->_weightDeclared;\n $stdClass->contents = $this->_contents;\n $stdClass->packing = $this->_packing;\n \n $arrStdClassParamPackings = array();\n if (isset($this->_packings)) {\n \tif (is_array($this->_packings)) {\n \t\tfor($i = 0; $i < count($this->_packings); $i++) {\n \t\t\t$arrStdClassParamPackings[$i] = $this->_packings[$i]->toStdClass();\n \t\t}\n \t} else {\n \t\t$arrStdClassParamPackings[0] = $this->_packings->toStdClass();\n \t}\n }\n $stdClass->packings = $arrStdClassParamPackings;\n \n $stdClass->packId = $this->_packId;\n $stdClass->documents = $this->_documents;\n $stdClass->fragile = $this->_fragile;\n $stdClass->palletized = $this->_palletized;\n if (isset($this->_sender)) {\n $stdClass->sender = $this->_sender->toStdClass();\n }\n if (isset($this->_receiver)) {\n $stdClass->receiver = $this->_receiver->toStdClass();\n }\n $stdClass->payerType = $this->_payerType;\n $stdClass->payerRefId = $this->_payerRefId;\n $stdClass->payerTypeInsurance = $this->_payerTypeInsurance;\n $stdClass->payerTypePackings = $this->_payerTypePackings;\n $stdClass->payerRefInsuranceId = $this->_payerRefInsuranceId;\n $stdClass->payerRefPackingsId = $this->_payerRefPackingsId;\n $stdClass->noteClient = $this->_noteClient;\n if (isset($this->_discCalc)) {\n $stdClass->discCalc = $this->_discCalc->toStdClass();\n }\n $stdClass->retToClientId = $this->_retToClientId;\n $stdClass->ref1 = $this->_ref1;\n $stdClass->ref2 = $this->_ref2;\n $stdClass->clientSystemId = $this->_clientSystemId;\n $arrStdClassParamParcelInfo = array();\n if (isset($this->_parcels)) {\n if (is_array($this->_parcels)) {\n for($i = 0; $i < count($this->_parcels); $i++) {\n $arrStdClassParamParcelInfo[$i] = $this->_parcels[$i]->toStdClass();\n }\n } else {\n $arrStdClassParamParcelInfo[0] = $this->_parcels->toStdClass();\n }\n }\n $stdClass->parcels = $arrStdClassParamParcelInfo;\n $stdClass->skipAutomaticParcelsCreation = $this->_skipAutomaticParcelsCreation;\n $stdClass->pendingParcelsDescription = $this->_pendingParcelsDescription;\n $stdClass->pendingShipmentDescription = $this->_pendingShipmentDescription;\n $arrStdClassParamReturnServiceRequest = array();\n if (isset($this->_retServicesRequest)) {\n if (is_array($this->_retServicesRequest)) {\n for($i = 0; $i < count($this->_retServicesRequest); $i++) {\n $arrStdClassParamReturnServiceRequest[$i] = $this->_retServicesRequest[$i]->toStdClass();\n }\n } else {\n $arrStdClassParamReturnServiceRequest[0] = $this->_retServicesRequest->toStdClass();\n }\n }\n $stdClass->retServicesRequest = $arrStdClassParamReturnServiceRequest;\n if (isset($this->_retShipmentRequest)) {\n $stdClass->retShipmentRequest = $this->_retShipmentRequest->toStdClass();\n }\n\n if (isset($this->_returnVoucher)) {\n $stdClass->returnVoucher = $this->_returnVoucher->toStdClass();\n }\n\n if (isset($this->_deliveryToFloorNo)) {\n $stdClass->deliveryToFloorNo = $this->_deliveryToFloorNo;\n }\n\n if (isset($this->_includeShippingPriceInCod)) {\n $stdClass->includeShippingPriceInCod = $this->_includeShippingPriceInCod;\n }\n\n if (isset($this->_halfWorkDayDelivery)) {\n $stdClass->halfWorkDayDelivery = $this->_halfWorkDayDelivery;\n }\n\n return $stdClass;\n }", "public function jsonToObject(): ?ViaCepApi {\n if ($this->responseType == \"json\" && $this->response != \"[]\") {\n $this->responseType = \"object\";\n $this->response = (object) json_decode($this->response);\n }\n \n return $this; \n }", "public function jsonSerialize()\n {\n return (object) get_object_vars($this);\n }", "public function normalize($object)\n\t{\n\t\treturn json_decode($this->getSerializer()->serialize($object, 'json', $this->applyOptionsToContext(SerializationContext::create())), true);\n\t}", "public static function convertObject($d) {\r\n\t\tif (is_object($d)) {\r\n\t\t\t$d = get_object_vars($d);\r\n\t\t}\r\n\r\n\t\tif (is_array($d)) {\r\n\t\t\treturn array_map(__METHOD__, $d);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn $d;\r\n\t\t}\r\n\t}", "public function fetch_object() {\n $row = $this->fetch_array();\n return $row ? (object) $row : false;\n }", "public static function ensureObject($value)\n\t{\n\t\treturn (object)$value;\n\t}", "public function getValues(): stdClass\n {\n $res = [];\n foreach (get_object_vars($this) as $attrib => $value)\n {\n if (!is_null($value))\n {\n if ($value instanceof self)\n {\n $value = $value->getValues();\n }\n $res[$attrib] = $value;\n }\n }\n return (object) $res;\n }", "function jsonSerialize()\n {\n return (object) get_object_vars($this);\n }", "function toJson($object);", "function object_to_array($data) // Converts a Nested stdObject to a full associative Array\n{\n if(is_array($data) || is_object($data)) //\n {\n $result = array();\n foreach($data as $key => $value)\n {\n $result[$key] = object_to_array($value);\n }\n return $result;\n }\n return $data;\n}", "public function checkObject(): object\n {\n if (!is_object($this->getValue())) {\n throw new TypeInvalidException('object', gettype($this->getValue()));\n }\n\n return $this->getValue();\n }", "protected function fetchObject($cursor = null, $class = 'stdClass')\n {\n if (!empty($cursor) && $cursor instanceof Statement) {\n $object = $cursor->fetch(\\PDO::FETCH_OBJ);\n } else {\n if ($this->prepared instanceof Statement) {\n $object = $this->prepared->fetch(\\PDO::FETCH_OBJ);\n }\n }\n\n if (!isset($object)) {\n return false;\n }\n\n $newObject = $object;\n if ($class !== 'stdClass') {\n $newObject = new $class;\n foreach (get_object_vars($object) as $key => $value) {\n $newObject->{$key} = $value;\n }\n }\n\n return $newObject;\n }", "public function toObject() \n {\n return $this->toJson();\n }", "protected static function array_to_object($array){\n\t\t\n\t\t$object = new stdClass;\n\n\t\tforeach($array as $key => &$value) {\n\n\t\t\tif(is_array($value)){\n\n\t\t\t\t$object->{$key} = static::array_to_object($value);\n\n\t\t\t}else{\n\n\t\t\t\t$object->{$key} = $value;\n\t\t\t}\n\n\t\t\tunset($key, $value);\n\t\t}\n\n\t\treturn $object;\n\t}", "public function get_as_object() {\n $lines = $this->lines;\n foreach ($lines as $i => $linha) {\n $lines[$i] = (object) $linha;\n }\n\n return $lines;\n }", "public function getUserResponse(\\stdClass $user): \\stdClass\n {\n $responseUser = json_decode('{}');\n $responseUser->{'name'} = $user->{'name'};\n $responseUser->{'email'} = $user->{'email'};\n $responseUser->{'role'} = $user->{'role'};\n\n return $responseUser;\n }", "public function get_object()\n {\n return $this->object;\n }", "private function convert_document_id(stdClass $document): stdClass\n\t{\n\t\tif (isset($document) && property_exists($document, '_id') && $document->{'_id'} instanceof ObjectID)\n\t\t{\n\t\t\t$document->{'_id'} = $document->{'_id'}->__toString();\n\t\t}\n\n\t\treturn $document;\n\t}", "private function getObject() {\n return $this->object;\n }", "public function parse(stdClass $object)\n {\n $responseMessage = oxNew(CaptureShippingResponseEntity::class);\n if (isset($object->shippingNumber)) {\n $responseMessage->setShippingNumber($object->shippingNumber);\n }\n if (isset($object->message)) {\n $responseMessage->setErrors([$object->message]);\n }\n return $responseMessage;\n }", "public function getObject() {\n return $this->object;\n }", "public function getObj() {\n return $this->obj;\n }", "public function getObject()\n {\n return $this->_object;\n }", "public function toArray()\n\t{\n\t\t$result = new \\stdClass();\n\t\t\n\t\t// Objetos adicionadas a esta classe\n\t\tforeach ($this as $key => $entity) {\n\t\t\t$result->$key = clone $entity;\n\t\t}\n\t\treturn $result;\n\t}", "public function asObject() {\n\t\treturn $this->_sth->fetchAll(PDO::FETCH_OBJ);\n\t}", "public function getObject()\n {\n return $this->object;\n }", "public function getObject()\n {\n return $this->object;\n }", "public function getObject(): object;", "public function for(stdClass $record);", "public function fetchObj(){\n try{\n $this->obj = $this->resultado->fetch(PDO::FETCH_OBJ);\n } catch (PDOException $e){\n $this->errors[] = 'error: function fetchObj<br/>'.$e->getMessage();\n $this->obj = NULL;\n }\n return $this->obj;\n }", "public function get_object()\n {\n return $this->_object;\n }", "public function fetch_object($class_name = 'stdClass')\r\n {\r\n return $this->resultID->fetch_object($class_name);\r\n }", "public static function convert($obj) {\n\t\t$result=get_object_vars($obj);\n\t\t$rc=new \\ReflectionClass($obj);\n\t\t$meths=$rc->getMethods(\\ReflectionMethod::IS_PUBLIC);\n\t\tforeach($meths as $m) {\n\t\t\t$n=$m->getShortName();\n\t\t\t$n2=lcfirst(substr($n,3));\n\t\t\tif(strpos($n,'get')===0 && $m->getNumberOfRequiredParameters()==0) {\n\t\t\t\t$result[$n2]=$m->invoke($obj);\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "function &stdClass(stdClass $value, string $namespace = 'default'): stdClass\n{\n $var = new Variable\\StdClassVariable($value);\n Repository::add($var, $namespace);\n return $var->getValue();\n}", "function objectToObject($instance, $className) {\n\t\t return unserialize(sprintf(\n\t\t 'O:%d:\"%s\"%s',\n\t\t strlen($className),\n\t\t $className,\n\t\t strstr(strstr(serialize($instance), '\"'), ':')\n\t\t ));\n\t\t}", "static function returnStdObject(&$var){\n\t\t// check if $var is already a standard object\n\t\tif(self::isInstanceOf($var, 'Webiny\\Component\\StdLib\\StdObject\\StdObjectAbstract')){\n\t\t\treturn $var;\n\t\t}\n\n\t\t// try to map $var to a standard object\n\t\tif(self::isString($var)){\n\t\t\treturn new StringObject($var);\n\t\t}else if(self::isArray($var)){\n\t\t\treturn new ArrayObject($var);\n\t\t}\n\n\t\t// return value as StdObjectWrapper\n\t\treturn new self($var);\n\t}", "public function checkStdClass(): stdClass\n {\n return (new CheckerClass($this->getValue()))->checkStdClass();\n }", "public function getValuesObject()\n {\n $obj = new \\stdClass;\n\n foreach ( $this->keyValues as $key => $value )\n {\n $obj->$key = $value;\n }\n\n return $obj;\n }", "public function parseResponse($response_object){\n $retval = null;\n if (is_object($response_object)) {\n if (!empty($response_object->data)){\n $temp_array = drupal_json_decode($response_object->data);\n $retval = (object)$temp_array;\n }\n }\n return $retval;\n }", "function affiliatepressx_array_to_object($array) {\n $obj = new stdClass;\n foreach($array as $k => $v) {\n if(is_array($v)) {\n $obj->{$k} = array_to_object($v); //RECURSION\n } else {\n $obj->{$k} = $v;\n }\n }\n return $obj;\n}", "public static function toObject(){\r\n $args = func_get_args();\r\n \r\n if(count($args) >=2){\r\n $className = '\\\\'.str_replace('.', '\\\\', $args[0]);\r\n $refClass = new \\ReflectionClass($className);\r\n $toObjInstance = $refClass->newInstance();\r\n\r\n unset($args[0]);\r\n \r\n foreach($args as $arg){\r\n \r\n if(is_object($arg)){\r\n $arg = Obj::getProperties($arg);\r\n }\r\n \r\n if(is_array($arg)){\r\n foreach($arg as $propertyName=>$propertyValue){\r\n if($refClass->hasProperty($propertyName)){\r\n $property = $refClass->getProperty($propertyName);\r\n $property->setAccessible(true);\r\n $property->setValue($toObjInstance, $propertyValue);\r\n }\r\n }\r\n }\r\n }\r\n return $toObjInstance;\r\n }\r\n }", "public function getBody():\\stdClass{\n\t return $this->body??$this->setBody(new \\stdClass);\n\t}", "static public function array_to_object(array $array){\n \t# Iterate through our array looking for array values.\n \t# If found recurvisely call itself.\n \t$obj = new stdClass();\n \tforeach($array as $key => $value){\n \t if(is_array($value)){\n \t \t$obj->$key = self::array_to_object($value);\n \t }else{\n \t \t$obj->$key = $value;\n \t }\n \t}\n \t\n \t# Typecast to (object) will automatically convert array -> stdClass\n \treturn $obj;\n }", "public function getAllAsObject(array $options = [])\n {\n $result = $this->getAll($options);\n if (count($result) === 0) {\n return new \\stdClass();\n }\n\n return $result;\n }", "public static function ArrayAsObject($Array) {\n if (!is_array($Array))\n return $Array;\n\n $Return = new stdClass();\n foreach($Array as $Property => $Value) {\n $Return->$Property = $Value;\n }\n return $Return;\n }", "function toObject($arr = false){\n \tif( !$arr )\n \t\treturn false;\n \treturn (object) $arr;\n }", "function arrayIntoObject (&$object,$array) {\nwhile(list($key,$val)=@each($array)) {\n if (!is_numeric($key)) {\n if ($v2 = @unserialize($val)) { $val = $v2; }\n $object->$key = $val;\n }\n}\n}", "private function JsonDecode($obj)\n {\n $json = \\json_decode($obj);\n if ($json !== null) {\n $obj = $json;\n }\n return $obj;\n }", "static public function fromNode(INode $root): \\stdClass {\n\t\t\t$object = new \\stdClass();\n\t\t\t$attributeList = $root->getAttributeList();\n\t\t\tif (($value = $root->getValue()) !== null) {\n\t\t\t\t$object->{'::value'} = $value;\n\t\t\t}\n\t\t\tif ($attributeList->isEmpty() === false) {\n\t\t\t\t$object = (object)array_merge((array)$object, $attributeList->array());\n\t\t\t}\n\t\t\t$metaList = $root->getMetaList();\n\t\t\tif ($metaList->isEmpty() === false) {\n\t\t\t\t$object->{'::meta'} = $metaList->array();\n\t\t\t}\n\t\t\tif ($value = $root->getValue()) {\n\t\t\t\t$object->value = $value;\n\t\t\t}\n\t\t\t$nodeList = [];\n\t\t\tforeach ($root->getNodeList() as $node) {\n\t\t\t\t$nodeList[$node->getName()][] = self::fromNode($node);\n\t\t\t}\n\t\t\tforeach ($nodeList as $name => $list) {\n\t\t\t\t$object->{$name} = count($list) === 1 ? reset($list) : $list;\n\t\t\t}\n\t\t\treturn $root->isRoot() ? (object)[$root->getName() => $object] : $object;\n\t\t}", "function object_to_array($data)\r\n{\r\n if (is_array($data) || is_object($data))\r\n {\r\n $result = array();\r\n foreach ($data as $key => $value)\r\n {\r\n $result[$key] = object_to_array($value);\r\n }\r\n return $result;\r\n }\r\n return $data;\r\n}", "public static function obj($json)\n {\n return self::decode($json);\n }", "function _fetch_object()\r\n\t{\r\n\t\tif ( is_array($this->pdo_results) ) {\r\n\t\t\t$i = $this->pdo_index;\r\n\t\t\t$this->pdo_index++;\r\n\t\t\tif ( isset($this->pdo_results[$i])) {\r\n\t\t\t\t$back = '';\r\n\t\t\t\tforeach ( $this->pdo_results[$i] as $key => $val ) {\r\n\t\t\t\t\t$back->$key = $val;\r\n\t\t\t\t}\r\n\t\t\t\treturn $back;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn $this->result_id->fetch(PDO::FETCH_OBJ);\r\n\t}", "public function castToArray($stdClassObject)\n {\n return (array)$stdClassObject;\n }", "public static function getObject(){\n\t\treturn self::$object_class;\n\t}", "protected function _fetch_object()\n\t{\n\t\t$id = ($this->curs_id) ? $this->curs_id : $this->stmt_id;\n\t\treturn oci_fetch_object($id);\n\t}", "function pdo_fetch_object($stmt, $classname=\"stdClass\", $params=array()) {\r\n return pdo_stmt($stmt)->fetchObject($classname, $params);\r\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 getObject();", "public function getObject();", "public function getData($object = FALSE) {\n\t\tif (empty($this->originalData))\n\t\t\treturn false;\n\t\tif ($object) {\n\t\t\t$properties = array_merge($this->originalData,$this->modifiedData);\n\t\t\t$obj = new stdClass();\n\t\t\tforeach ($properties as $name=>$property) {\n\t\t\t\t$obj->$name = $property;\n\t\t\t}\n\t\t\treturn $obj;\n\t\t}\n\t\treturn array_merge($this->originalData,$this->modifiedData);\n\t}" ]
[ "0.7512461", "0.7090765", "0.688265", "0.6666987", "0.66083837", "0.6567666", "0.65463847", "0.6530217", "0.6494159", "0.6482689", "0.6301694", "0.627478", "0.62255335", "0.6213821", "0.62018955", "0.6200889", "0.6190094", "0.6171341", "0.6119637", "0.6085946", "0.6033941", "0.6004725", "0.593723", "0.5851777", "0.58482814", "0.5842185", "0.579499", "0.57863593", "0.5774156", "0.5761383", "0.5744414", "0.57200855", "0.57076937", "0.5690957", "0.56533223", "0.5648654", "0.5627014", "0.5623177", "0.5602207", "0.55948836", "0.5542883", "0.55286187", "0.552791", "0.55162346", "0.55143905", "0.55125934", "0.55095303", "0.5502489", "0.5491925", "0.54885095", "0.54618794", "0.5451313", "0.54469603", "0.54462", "0.5438497", "0.5433381", "0.5424253", "0.54112273", "0.5410207", "0.54069453", "0.54050124", "0.53989905", "0.5398989", "0.5386277", "0.53830343", "0.5382722", "0.5382722", "0.53743106", "0.5328145", "0.53243524", "0.5319128", "0.5310521", "0.5308264", "0.5307055", "0.52801496", "0.5276901", "0.5272139", "0.52679247", "0.5255161", "0.5238987", "0.52389646", "0.52346385", "0.5234145", "0.5232745", "0.522811", "0.52210397", "0.52134615", "0.5212678", "0.5201254", "0.5192939", "0.5192076", "0.5191669", "0.51760614", "0.51751095", "0.51694053", "0.5167358", "0.51661247", "0.51514447", "0.51514447", "0.51452154" ]
0.6465957
10
Constructor Creates a form to add a user.
public function __construct() { parent::__construct([], [ 'acronym' => [ 'type' => 'text', 'label' => 'Akronym', 'required' => true, 'validation' => ['not_empty'], ], 'firstName' => [ 'type' => 'text', 'label' => 'Förnamn', 'required' => true, 'validation' => ['not_empty'], ], 'lastName' => [ 'type' => 'text', 'label' => 'Efternamn', 'required' => true, 'validation' => ['not_empty'], ], 'town' => [ 'type' => 'text', 'label' => 'Ort', 'required' => true, 'validation' => ['not_empty'], ], 'email' => [ 'type' => 'text', 'label' => 'E-post', 'required' => true, 'validation' => ['not_empty', 'email_adress'], ], 'password' => [ 'type' => 'password', 'label' => 'Lösenord', 'required' => true, 'validation' => ['not_empty'], ], 'submit' => [ 'type' => 'submit', 'callback' => [$this, 'callbackSubmit'], 'value' => 'Spara', ], ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addUser(UserAddForm $form);", "public function actionCreate()\n\t{\n\t\t$model=new UserAddForm();\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['UserAddForm']))\n\t\t{\n\t\t\t$model->attributes=$_POST['UserAddForm'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->data->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function __construct(){\n\t\tparent::__construct();\n\t\tif (isset($_REQUEST['user'])){\n\t\t\tif ($_REQUEST['user'] != $GLOBALS['cUser']->getId() and !ACL::canAdmin('admin', 0)){\n\t\t\t\tnew Alert('error', 'Vous n\\'avez pas l\\'autorisation de faire ceci !');\n\t\t\t\t$this->user = $GLOBALS['cUser'];\n\t\t\t}else{\n\t\t\t\t$users = UsersManagement::getDBUsers();\n\t\t\t\t$found = \\Get::getObjectsInList($users, 'id', $_REQUEST['user']);\n\t\t\t\tif (empty($found)){\n\t\t\t\t\tnew Alert('error', 'Cet utilisateur n\\'existe pas !');\n\t\t\t\t\t$this->user = $GLOBALS['cUser'];\n\t\t\t\t}else{\n\t\t\t\t\t$this->user = new User($_REQUEST['user']);\n\t\t\t\t\t$this->title = 'Profil de '.$this->user->getName();\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t$this->user = $GLOBALS['cUser'];\n\t\t}\n\t\t$this->form = new Form('userProfile');\n\t}", "public function __construct($UserTable)\n\t {\n\t // Set all attributes of the form.\n\t parent::__construct('SignupForm');\n $this->setAttribute('action', '/user/signup');\n $this->setAttribute('id', 'signupForm');\n\t\t\t$this->setAttribute('header', 'Sign up');\n\t\t\t\n\t\t\t// Set the UserTable property.\n\t\t\t$this->UserTable = $UserTable;\n\t\t\t\n // Add the necessary elements.\n // Account info.\n $this->add(\n\t [\n\t 'name' => 'email',\n\t 'attributes' =>\n\t [\n\t 'type' => 'email',\n\t 'id' => 'email',\n\t 'placeholder' => 'Email',\n\t 'required' => 'required'\n ],\n\t 'options' => ['label' => 'Email']\n\t ]);\n\t\t\t$this->add(\n\t [\n\t 'name' => 'password',\n\t 'attributes' =>\n\t [\n\t 'type' => 'password',\n\t 'id' => 'password',\n 'placeholder' => 'Password',\n 'required' => 'required'\n ],\n\t 'options' => ['label' => 'Password'],\n\t ]);\n $this->add(\n\t [\n\t 'name' => 'rePassword',\n\t 'attributes' =>\n\t [\n\t 'type' => 'password',\n\t 'id' => 'rePassword',\n 'placeholder' => 'Confirm password',\n 'required' => 'required'\n ],\n\t 'options' => ['label' => 'Confirm password'],\n\t ]);\n\t\t\t\n\t\t\t// Address data.\n\t\t\t$this->add(\n\t\t\t[\n\t 'name' => 'fullName',\n\t 'attributes' =>\n\t [\n\t 'type' => 'text',\n\t 'id' => 'fullName',\n \t'placeholder' => 'e.g. Mr A Smith',\n 'required' => 'required',\n\t \t],\n\t 'options' => ['label' => 'Full name']\n\t ]);\n\t\t\t$this->add(\n\t\t\t[\n\t 'name' => 'street',\n\t 'attributes' =>\n\t [\n\t 'type' => 'text',\n\t 'id' => 'street',\n \t'placeholder' => 'e.g. 3 High Street',\n 'required' => 'required',\n\t \t],\n\t 'options' => ['label' => 'Number and street']\n\t ]);\n\t\t\t$this->add(\n\t\t\t[\n\t 'name' => 'locality',\n\t 'attributes' =>\n\t [\n\t 'type' => 'text',\n\t 'id' => 'locality',\n \t'placeholder' => 'e.g. Hedge End',\n\t \t],\n\t 'options' => ['label' => 'Locality (optional)']\n\t ]);\n\t\t\t$this->add(\n\t\t\t[\n\t 'name' => 'postTown',\n\t 'attributes' =>\n\t [\n\t 'type' => 'text',\n\t 'id' => 'postTown',\n \t'placeholder' => 'e.g. Southampton',\n 'required' => 'required',\n\t \t],\n\t 'options' => ['label' => 'Post town']\n\t ]);\n\t\t\t$this->add(\n\t\t\t[\n\t 'name' => 'postcode',\n\t 'attributes' =>\n\t [\n\t 'type' => 'text',\n\t 'id' => 'postcode',\n \t'placeholder' => 'e.g. SO31 4NG',\n 'required' => 'required',\n\t \t],\n\t 'options' => ['label' => 'Postcode']\n\t ]);\n\t\t\t\n\t\t\t// Terms of service checkbox and the submit button.\n $this->add(\n [\n 'name' => 'acceptTos',\n 'attributes' =>\n [\n 'type' => 'checkbox',\n 'id' => 'acceptTos',\n 'required' => 'required'\n ],\n 'options' => ['label' => 'I agree to the <a href=\"/tos\">Terms of Service</a>']\n ]);\n\t\t\t$this->add(\n\t\t\t[\n\t 'name' => 'submitSignupForm',\n\t 'attributes' =>\n\t [\n\t 'type' => 'submit',\n\t 'id' => 'submitSignupForm',\n 'required' => 'required',\n 'value' => 'Sign up!',\n\t \t]\n\t ]);\n\t }", "public function __construct($name = null)\n {\n parent::__construct('user_sign_up');\n $this->setAttribute('method', 'post');\n\t\t$this->setAttribute('id', 'formid'); \n $this->add(array(\n 'name' => 'email',\n 'attributes' => array(\n\t\t\t\t'type' => 'text',\n\t\t\t\t'id'\t=> 'email',\t\t\t\t\t\t\t\n ),\n 'options' => array(\n 'label' => 'Email',\n\t\t\t\t\n ),\n ));\n $this->add(array(\n 'name' => 'password',\n 'attributes' => array(\n 'type' => 'password',\n\t\t\t\t'id'\t=> 'password',\n ),\n 'options' => array(\n 'label' => 'Password',\n ),\n ));\n $this->add(array(\n 'name' => 'confirm_password',\n 'attributes' => array(\n 'type' => 'password',\n\t\t\t\t'id'\t=> 'confirm_password',\n ),\n 'options' => array(\n 'label' => 'Confirm Password',\n ),\n ));\n \n $this->add(array(\n 'name' => 'submit',\n 'attributes' => array(\n 'type' => 'submit',\n 'value' => 'Go',\n 'id' => 'submitbutton',\n ),\n ));\n }", "public function __construct($name = null)\n {\n // we want to ignore the name passed\n parent::__construct('user');\n\n $this->add(array(\n 'name' => 'username',\n 'type' => 'Text',\n 'options' => array(\n 'label' => 'Username',\n ),\n 'attributes' => array(\n 'class' => 'form-control',\n ),\n ));\n $this->add(array(\n 'name' => 'password',\n 'type' => 'Password',\n 'options' => array(\n 'label' => 'Password',\n ),\n 'attributes' => array(\n 'class' => 'form-control',\n ),\n ));\n $this->add(array(\n 'name' => 'password_confirmation',\n 'type' => 'Password',\n 'options' => array(\n 'label' => 'Password Confirmation',\n ),\n 'attributes' => array(\n 'class' => 'form-control',\n ),\n ));\n $this->add(array(\n 'name' => 'email',\n 'type' => 'Text',\n 'options' => array(\n 'label' => 'Email',\n ),\n 'attributes' => array(\n 'class' => 'form-control',\n ),\n ));\n $this->add(array(\n 'name' => 'file_upload',\n 'type' => 'File',\n 'options' => array(\n 'label' => 'Avatar (only .jpg, .jpeg and .png file)',\n ),\n ));\n $this->add(array(\n 'name' => 'submit',\n 'type' => 'Submit',\n 'attributes' => array(\n 'value' => 'Save',\n 'id' => 'submitbutton',\n 'class' => 'btn btn-success',\n ),\n ));\n }", "public function formAddUser()\n {\n ($user);\n return view('addUser');\n }", "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 }", "protected function form()\n {\n $form = new Form(new WechatUser);\n\n $form->text('nick_name', __('昵称'));\n $form->text('name', __('用户名'));\n $form->password('password', __('密码'));\n $form->mobile('mobile', __('手机号'));\n $form->text('mini_program_open_id', __('OpenId'));\n\n return $form;\n }", "public function __construct($name = null) {\n parent::__construct('user');\n \n $this->setAttribute('method', 'post');\n\n $id_user = new Hidden('id_user');\n $this->add($id_user);\n\n $nom_user = new Text('nom_user');\n $nom_user->setAttribute('class', 'form-control');\n $nom_user->setAttribute('placeholder', 'Entre ton nom');\n $this->add($nom_user);\n\n $prenom_user = new Text('prenom_user');\n $prenom_user->setAttribute('class', 'form-control');\n $prenom_user->setAttribute('placeholder', 'Entre ton prenom');\n $this->add($prenom_user);\n\n $mail_user = new Text('mail_user');\n $mail_user->setAttribute('class', 'form-control');\n $mail_user->setAttribute('placeholder', 'Entre ton mail');\n $this->add($mail_user);\n\n $password_user = new Password('password_user');\n $password_user->setAttribute('class', 'form-control');\n $password_user->setAttribute('placeholder', 'Entre ton password');\n $this->add($password_user);\n\n $repassword_user = new Password('repassword_user');\n $repassword_user->setAttribute('class', 'form-control');\n $repassword_user->setAttribute('placeholder', 'Entre encore ton password ');\n $this->add($repassword_user);\n\n $date_de_naissance_user = new \\Zend\\Form\\Element\\Date('date_de_naissance_user');\n $date_de_naissance_user->setAttribute('class', 'form-control');\n $date_de_naissance_user->setAttribute('placeholder', 'Format AAAA-MM-JJ');\n $this->add($date_de_naissance_user);\n\n $adresse_user = new Text('adresse_user');\n $adresse_user->setAttribute('class', 'form-control');\n $adresse_user->setAttribute('placeholder', 'Entre ton adresse');\n $this->add($adresse_user);\n\n $code_postal_user = new Text('code_postal_user');\n $code_postal_user->setAttribute('class', 'form-control');\n $code_postal_user->setAttribute('placeholder', 'Entre ton Code Postal');\n $this->add($code_postal_user);\n\n $pays_user = new Text('pays_user');\n $pays_user->setAttribute('class', 'form-control');\n $pays_user->setAttribute('placeholder', 'Entre ton Pays');\n $this->add($pays_user);\n\n $ville_user = new Text('ville_user');\n $ville_user->setAttribute('class', 'form-control');\n $ville_user->setAttribute('placeholder', 'Entre ta ville');\n $this->add($ville_user);\n\n $sexe_user = new \\Zend\\Form\\Element\\Select('sexe_user');\n $sexe_user->setAttribute('class', 'selectpicker col-xs-12');\n $sexe_user->setValueOptions(array(\n 'Homme' => 'Homme',\n 'Femme' => 'Femme',\n ));\n $sexe_user->setEmptyOption('- - -');\n $this->add($sexe_user);\n \n $submit = new \\Zend\\Form\\Element\\Submit('submit');\n $submit->setValue('Inscription');\n $submit->setAttribute('class', 'btn btn-primary col-xs-2');\n $this->add($submit);\n }", "public function action_add()\r\n\t{\r\n\t\tif ( Request::current()->method() == Request::POST )\r\n\t\t{\r\n\t\t\treturn $this->_add();\r\n\t\t}\r\n\t\t\r\n\t\t$this->template->title = __('Add user');\r\n\t\t$this->breadcrumbs\r\n\t\t\t->add($this->template->title);\r\n\r\n\t\t// check if user have already enter something\r\n\t\t$data = Flash::get( 'post_data', array() );\r\n\r\n\t\t$user = new User( $data );\r\n\r\n\t\t$this->template->content = View::factory( 'user/edit', array(\r\n\t\t\t'action' => 'add',\r\n\t\t\t'user' => $user,\r\n\t\t\t'permissions' => Model_Permission::get_all()\r\n\t\t) );\r\n\t}", "public function __construct()\n {\n parent::__construct('user');\n $this->setAttribute('method', 'post');\n\t\t\n\t\t$this->add(array(\n\t\t 'type' => 'Zend\\Form\\Element\\Csrf',\n\t\t 'name' => 'csrf',\n\t\t 'options' => array(\n\t\t\t\t 'csrf_options' => array(\n\t\t\t\t\t\t 'timeout' => 600,\n\t\t\t\t\t\t 'salt' => 'unique'\n\t\t\t\t )\n\t\t\t)\n\t\t));\n\n\t\t$this->add(array( \n\t\t\t'type' => 'Zend\\Form\\Element\\MultiCheckbox', \n\t\t\t'name' => 'user_tag_id',\n\t\t\t'attributes' => array(\n\t\t\t\t'options' => array(),\n\t\t\t),\n\t\t\t\t\n\t\t)); \n\n\t\t \n\t\t$this->add(array(\n\t\t\t'name' => 'submit',\n\t\t\t'type' => 'Submit',\n\t\t\t'attributes' => array(\n\t\t\t\t'value' => 'Next',\n\t\t\t\t'id' => 'submitbutton',\n\t\t\t),\n\t\t));\n\t\t$this->add(array(\n\t\t\t'name' => 'reset',\n\t\t\t'type' => 'Submit',\n\t\t\t'attributes' => array(\n\t\t\t\t'value' => 'Skip',\n\t\t\t\t'id' => 'resetbutton',\n\t\t\t),\n\t\t));\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 }", "public function init(){\n $this->setAttrib('id', 'create-new-user-form');\n\n $clients = Repo_Client::getInstance()->getSelectArray();\n $roles = Repo_Role::getInstance()->getSelectArray();\n unset($roles['']);\n\n // Email\n $this->addElement('text','email',array(\n 'decorators' => $this->_standardElementDecorator,\n 'class' => 'form-control',\n 'label' => 'Email',\n 'required' => true,\n 'validators' => array('EmailAddress')\n ));\n\n // Password\n $this->addElement('text','password',array(\n 'decorators' => $this->_standardElementDecorator,\n 'class' => 'form-control',\n 'label' => 'Password',\n 'required' => true,\n 'validators' => array(array('StringLength', false, array(8, 50)))\n ));\n\n // UDID\n $this->addElement('text','UDID',array(\n 'decorators' => $this->_standardElementDecorator,\n 'class' => 'form-control',\n 'label' => 'UDID',\n 'required' => false\n ));\n\n // Surname\n $this->addElement('text','surname',array(\n 'decorators' => $this->_standardElementDecorator,\n 'class' => 'form-control',\n 'label' => 'Surname',\n 'required' => true\n ));\n\n // First name\n $this->addElement('text','firstname',array(\n 'decorators' => $this->_standardElementDecorator,\n 'class' => 'form-control',\n 'label' => 'First Name',\n 'required' => true\n ));\n\n // User type\n /*$this->addElement('text','user_type',array(\n 'decorators' => $this->_standardElementDecorator,\n 'class' => 'form-control',\n 'label' => 'User Type',\n 'required' => true\n ));*/\n\n // Role\n $this->addElement('multiCheckbox','role', array(\n 'decorators' => $this->_multiCheckboxDecorator,\n 'label' => 'Role',\n 'required' => true,\n 'registerInArrayValidator' => false\n ));\n\n $this->getElement('role')->addMultiOptions(\n $roles\n );\n\n // Client\n $this->addElement('select','client', array(\n 'decorators' => $this->_standardElementDecorator,\n 'class' => 'form-control',\n 'label' => 'Client',\n 'required' => true\n ));\n\n $this->getElement('client')->addMultiOptions(\n $clients\n );\n\n // ID\n $this->addElement('hidden','id',array(\n 'decorators' => $this->_buttonElementDecorator,\n 'required' => false\n ));\n\n // Set user values if a user is passed in.\n if (isset($this->extraParams['user']) && $user = $this->extraParams['user']) {\n $this->setUser($user);\n }\n }", "protected function form()\n {\n $form = new Form(new User());\n\n $form->text('name', __('Name'));\n $form->email('email', __('Email'));\n $form->datetime('email_verified_at', __('Email verified at'))->default(date('Y-m-d H:i:s'));\n $form->password('password', __('Password'));\n $form->text('remember_token', __('Remember token'));\n $form->decimal('point', __('Point'))->default(0.000);\n $form->switch('status', __('field.status'));\n\n return $form;\n }", "public function init()\n {\n // form should use p4cms-ui styles.\n $this->setAttrib('class', 'p4cms-ui login-form p4cms-user-login');\n \n // form should submit on enter\n $this->setAttrib('submitOnEnter', true);\n\n // set the method for the form to POST\n $this->setMethod('post');\n\n // add a field to collect the user name.\n $this->addElement(\n 'text',\n 'user',\n array(\n 'label' => 'User',\n 'required' => true,\n 'description' => \"Enter your email address or username.\",\n 'filters' => array('StringTrim'),\n 'size' => 20\n )\n );\n\n // add a field to collect the user's password\n $this->addElement(\n 'password',\n 'password',\n array(\n 'label' => 'Password',\n 'required' => false,\n 'size' => 20\n )\n );\n\n // add the submit button\n $this->addElement(\n 'SubmitButton',\n 'login',\n array(\n 'label' => 'Login',\n 'required' => false,\n 'ignore' => true,\n 'class' => 'preferred'\n )\n );\n $buttons = array('login');\n\n // add an 'add user' button, if we have appropriate permissions\n $user = P4Cms_User::fetchActive();\n if ($user->isAllowed('users', 'add', $this->getAcl()) && P4_User::isAutoUserCreationEnabled()) {\n $this->addElement(\n 'Button',\n 'addNewUser',\n array(\n 'label' => 'New User',\n 'class' => 'add-button',\n 'ignore' => true,\n 'onclick' => 'window.location = p4cms.url({module: \"user\", controller: \"index\", action: \"add\"});',\n )\n );\n $buttons[] = 'addNewUser';\n }\n\n // put the button in a fieldset.\n $this->addDisplayGroup(\n $buttons,\n 'buttons',\n array('class' => 'buttons')\n );\n }", "public function newAction() {\n $this->buildAssets();\n\n $this->persistent->conditions = null;\n\n\n if ($this->request->isPost()) {\n $this->createNew();\n } else {\n $view = $this->view;\n $this->ctx->pickView($view, 'users/new');\n \n $userForm = new UsersForm();\n $this->view->form = $userForm;\n }\n }", "protected function form()\n {\n $form = new Form(new User);\n\n// $form->number('role_id', 'Role id');\n $form->text('name', 'Name');\n// $form->email('email', 'Email');\n// $form->image('avatar', 'Avatar')->default('users/default.png');\n// $form->password('password', 'Password');\n// $form->text('remember_token', 'Remember token');\n// $form->textarea('settings', 'Settings');\n $form->text('username', 'Username');\n// $form->text('access_token', 'Access token');\n// $form->text('no_hp', 'No hp');\n// $form->number('location_id', 'Location id');\n// $form->switch('gender', 'Gender')->default(1);\n\n\n return $form;\n }", "public function create()\n {\n return view('users.form', ['user' => new User]);\n }", "private function createCreateForm(User $user)\n {\n $form = $this->createForm(new UserType(), $user, array(\n 'action' => $this->generateUrl('user_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array(\n \t\t'label' => 'Create',\n \t\t'attr' => array('class' => 'ui-btn ui-corner-all ui-shadow ui-btn-b ui-btn-icon-left ui-icon-check')\n ));\n\n return $form;\n }", "public function Create()\n\t{\n\t\t$form = new CForm(array('name'=>'createUserForm', 'action'=>$this->request->CreateUrl('user/create')), array(\n\t\t\t'acronym' \t\t=> new CFormElementText('acronym', array(\n\t\t\t\t'label'\t\t=> 'Acronym:',\n\t\t\t\t'type'\t\t=> 'text',\n\t\t\t\t)\n\t\t\t),\n\t\t\t'password'\t\t=> new CFormElementPassword('password', array(\n\t\t\t\t'label'\t\t=> 'Password:',\n\t\t\t\t'type'\t\t=> 'password',\n\t\t\t\t)\n\t\t\t),\n\t\t\t'password2'\t\t=> new CFormElementPassword('password', array(\n\t\t\t\t'label'\t\t=> 'Password again:',\n\t\t\t\t'type'\t\t=> 'password',\n\t\t\t\t)\n\t\t\t),\n\t\t\t'name' \t\t=> new CFormElementText('name', array(\n\t\t\t\t'label'\t\t=> 'Name:',\n\t\t\t\t'type'\t\t=> 'text',\n\t\t\t\t)\n\t\t\t),\n\t\t\t'email' \t\t=> new CFormElementText('email', array(\n\t\t\t\t'label'\t\t=> 'Email:',\n\t\t\t\t'type'\t\t=> 'text',\n\t\t\t\t)\n\t\t\t),\n\t\t\tnew CFormElementSubmit('doCreate', array(\n\t\t\t\t'value'\t\t=> 'Create',\n\t\t\t\t'type'\t\t=> 'submit',\n\t\t\t\t'callback'\t=> array($this, 'DoCreate')\n\t\t\t\t)\n\t\t\t),\n\t\t));\n\t\t\n\t\t$form->SetValidation('acronym',array('not_empty'));\n\t\t$form->SetValidation('password',array('not_empty'));\n\t\t$form->SetValidation('password2',array('not_empty'));\n\t\t$form->SetValidation('name',array('not_empty'));\n\t\t$form->SetValidation('email',array('not_empty'));\n\t\t\n\t\t$form->Check();\n\n\t\t$this->views->SetTitle('Create user');\n\t\t$this->views->AddView('user/create.tpl.php', array(\n\t\t\t'register_form'\t\t=> $form->GetHTML(),\n\t\t\t'allow_create_user'\t=> $this->config['create_new_users'],\n\t\t\t),\n\t\t'primary'\n\t\t);\n\t}", "protected function form()\n {\n $form = new Form(new User);\n\n $form->mobile('mobile', trans('user.mobile'))->readOnly();\n $form->text('name',trans('user.name'))->readOnly();\n $form->select('first_leader',trans('user.first_leader'))->options('/admin/api/user');\n// $form->email('email', trans('user.email'))->readOnly();\n $form->text('real_name',trans('user.real_name'))->readOnly();\n// $form->text('contact_mobile', trans('user.contact_mobile'))->readOnly();\n $form->text('idcard_front',trans('user.idcard_front'))->readOnly();\n $form->text('idcard_back', trans('user.idcard_back'))->readOnly();\n $form->text('idcard_num', trans('user.idcard_num'))->readOnly();\n $form->image('avatar', trans('user.avatar'))->readOnly();\n $form->radio('gender',trans('user.gender'))->options(User::getGenderArr())->readOnly();\n// $form->text('sign', trans('user.sign'))->readOnly();\n// $form->text('home', trans('user.home'))->readOnly();\n// $form->date('birthday',trans('user.birthday'))->default(date('Y-m-d'))->readOnly();\n $form->number('account', trans('user.account'));\n $form->number('money', trans('user.money'));\n $form->switch('is_lock', trans('user.is_lock'));\n $form->ignore(['mobile','name','email','real_name','contact_mobile','idcard_front','idcard_back','idcard_num','avatar','gender','sign','home','birthday']);\n $form->footer(function ($footer) {\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n });\n $form->tools(function (Form\\Tools $tools) {\n $tools->disableDelete();\n $tools->disableView();\n });\n\n $form->saving(function (Form $form) {\n\n $user = User::find(request()->route()->parameter('user'));\n\n if($user['first_leader']){\n //已经有上级\n if($form->first_leader){\n $error = new MessageBag([\n 'title' => '错误提示',\n 'message' => '已经有上级的用户, 不可再更改其上级',\n ]);\n\n return back()->with(compact('error'));\n }\n }\n });\n\n\n return $form;\n }", "public function formUserCreate(){\n // Access-controlled resource\n if (!$this->_app->user->checkAccess('create_account')){\n $this->_app->notFound();\n }\n \n $get = $this->_app->request->get();\n \n if (isset($get['render']))\n $render = $get['render'];\n else\n $render = \"modal\";\n \n // Get a list of all groups\n $groups = GroupLoader::fetchAll();\n \n // Get a list of all locales\n $locale_list = $this->_app->site->getLocales();\n \n // Get default primary group (is_default = GROUP_DEFAULT_PRIMARY)\n $primary_group = GroupLoader::fetch(GROUP_DEFAULT_PRIMARY, \"is_default\");\n \n // Get the default groups\n $default_groups = GroupLoader::fetchAll(GROUP_DEFAULT, \"is_default\");\n \n // Set default groups, including default primary group\n foreach ($groups as $group_id => $group){\n $group_list[$group_id] = $group->export();\n if (isset($default_groups[$group_id]) || $group_id == $primary_group->id)\n $group_list[$group_id]['member'] = true;\n else\n $group_list[$group_id]['member'] = false;\n }\n \n $data['primary_group_id'] = $primary_group->id;\n // Set default title for new users\n $data['title'] = $primary_group->new_user_title;\n // Set default locale\n $data['locale'] = $this->_app->site->default_locale;\n \n // Create a dummy user to prepopulate fields\n $target_user = new User($data); \n \n if ($render == \"modal\")\n $template = \"components/user-info-modal.html\";\n else\n $template = \"components/user-info-panel.html\";\n \n // Determine authorized fields for those that have default values. Don't hide any fields\n $fields = ['title', 'locale', 'groups', 'primary_group_id'];\n $show_fields = [];\n $disabled_fields = [];\n $hidden_fields = [];\n foreach ($fields as $field){\n if ($this->_app->user->checkAccess(\"update_account_setting\", [\"user\" => $target_user, \"property\" => $field]))\n $show_fields[] = $field;\n else\n $disabled_fields[] = $field;\n } \n \n // Load validator rules\n $schema = new \\Fortress\\RequestSchema($this->_app->config('schema.path') . \"/forms/user-create.json\");\n $validators = new \\Fortress\\ClientSideValidator($schema, $this->_app->translator); \n \n $this->_app->render($template, [\n \"box_id\" => $get['box_id'],\n \"box_title\" => \"Create User\",\n \"submit_button\" => \"Create user\",\n \"form_action\" => $this->_app->site->uri['public'] . \"/users\",\n \"target_user\" => $target_user,\n \"groups\" => $group_list,\n \"locales\" => $locale_list,\n \"fields\" => [\n \"disabled\" => $disabled_fields,\n \"hidden\" => $hidden_fields\n ],\n \"buttons\" => [\n \"hidden\" => [\n \"edit\", \"enable\", \"delete\", \"activate\"\n ]\n ],\n \"validators\" => $validators->formValidationRulesJson()\n ]); \n }", "protected function form()\n {\n $form = new Form(new ElectronUser);\n\n $form->text('username', __('账号'))->required();\n $form->password('password', __('密码'))->required();\n $form->textarea('remark', __('备注'));\n $form->hidden('user_id');\n $form->saving(function(Form $form){\n $user = MemberUser::user();\n if(!$form->model()->id){\n $form->user_id = $user->id;\n }elseif($form->model()->user_id != $user->id){\n return back();\n }\n });\n return $form;\n }", "public function create()\n {\n return view('webcontrol.user.add');\n }", "public function create()\n {\n return view('admin.adminuser.userForm', [\n\t\t\t'bdb'\t=> [['name'=>'后台用户管理'], ['name'=>'添加用户'],], \n\t\t\t'roles'\t=> Role::all(),\n\t\t\t]);\n }", "public function add(){\n Auth::checkUserLogin();\n\t\t// Set the Page Title ('pageName', 'pageSection', 'areaName')\n\t\t$this->_view->pageTitle = array('Add', 'Users');\n\t\t// Set Page Description\n\t\t$this->_view->pageDescription = '';\n\t\t// Set Page Section\n\t\t$this->_view->pageSection = 'Users';\n\t\t// Set Page Sub Section\n\t\t$this->_view->pageSubSection = 'Add';\n\n $this->_view->error = array();\n\n // If Form has been submitted process it\n\t\tif(!empty($_POST)){\n //if user selected cancel\n if(!empty($_POST['cancel'])){\n\t\t\t Url::redirect('users/index');\n\t\t }\n\n // Create new user\n $createData = $this->_model->createData($_POST);\n if(isset($createData['error']) && $createData['error'] != null){\n foreach($createData['error'] as $key => $error){\n $this->_view->error[$key] = $error;\n }\n }else{\n $this->_view->flash[] = \"User added successfully.\";\n Session::set('backofficeFlash', array($this->_view->flash, 'success'));\n Url::redirect('users/index');\n }\n\t\t}\n\t\t// Render the view ($renderBody, $layout, $area)\n\t\t$this->_view->render('users/add', 'layout');\n\t}", "public function addAction()\n {\n $viewModel = new ViewModel(['title' => 'add a user']);\n // if they are trying to add a user account for an existing person...\n $person_id = $this->params()->fromRoute('id');\n // or if there's no person_id route parameter...\n if (! $person_id && isset($this->params()->fromPost()['user'])) {\n // try post parameters\n $user = $this->params()->fromPost()['user'];\n if (isset($user['person']) && ! empty($user['person']['id'])) {\n $person_id = $user['person']['id'];\n }\n }\n $options = [\n 'action' => 'create',\n 'auth_user_role' => $this->auth_user_role,\n 'constrain_email' => true,\n ];\n\n if ($person_id) {\n /** @todo better db efficiency... */\n $person = $this->entityManager\n ->find('InterpretersOffice\\Entity\\Person', $person_id);\n if (! $person) {\n return $viewModel->setVariables(\n ['errorMessage' => \"person with id $person_id not found\"]\n );\n }\n $options['existing_person'] = $person;\n } else {\n $person = null;\n }\n $form = new UserForm($this->entityManager, $options);\n $user = new Entity\\User();\n if ($person) {\n $this->events->trigger(\n 'load-person',\n $this,\n compact('person', 'form')\n );\n $user->setPerson($person);\n $form->get('user')->get('person')->setObject($person);\n }\n\n $form->bind($user);\n $viewModel->form = $form;\n $request = $this->getRequest();\n\n if ($request->isPost()) {\n $form->setData($request->getPost());\n if (! $form->isValid()) {\n return new JsonModel(['status' => 'error',\n 'validation_errors' => $form->getMessages()]);\n }\n $user->setCreated(new \\DateTime());\n $this->entityManager->persist($user);\n if (! $person_id) {\n $this->entityManager->persist($user->getPerson());\n }\n // we could do this in the model instead, with lifecycle callback (?)\n $user->setPassword(bin2hex(openssl_random_pseudo_bytes(8)));\n $this->entityManager->flush();\n $person = $user->getPerson();\n $this->flashMessenger()->addSuccessMessage(\n sprintf(\n 'A user account has been created for %s <strong>%s %s</strong>.',\n $user->getRole(),\n $person->getFirstName(),\n $person->getLastname()\n )\n );\n return new JsonModel(['status' => 'success','validation_errors' => null]);\n }\n\n return $viewModel;\n }", "public function addUserAction()\n {\n $form = new Application_Form_UserEdit();\n $this->view->form = $form;\n\n if ($this->getRequest()->isPost())\n {\n $formData = $this->getRequest()->getPost();\n if ($form->isValid($formData))\n {\n $username = $form->getValue('username');\n $password = $form->getValue('password');\n $role = $form->getValue('role');\n $first_name = $form->getValue('first_name');\n $last_name = $form->getValue('last_name');\n $email = $form->getValue('email'); \n $user = new Application_Model_DbTable_Users();\n $user->addUser($username, $password, $first_name,\n $last_name, $email, $role);\n $this->_helper->redirector('index', 'index');\n }\n else\n {\n $form->populate($formData);\n }\n }\n }", "public function newUserAction()\n {\n $user = new User();\n\n $form = $this->createForm(UserType::class, $user);\n\n return $this->render('GrtResBundle:User:form.html.twig', array(\n 'form' => $form->createView()\n ));\n }", "public function create()\n\t{\n\t\t$eloquent = App::make('orchestra.user');\n\t\t$form = $this->presenter->form($eloquent, 'create');\n\n\t\t$this->fireEvent('form', array($eloquent, $form));\n\t\tSite::set('title', trans('orchestra/foundation::title.users.create'));\n\n\t\treturn View::make('orchestra/foundation::users.edit', compact('eloquent', 'form'));\n\t}", "public function addUser(){}", "public function create() {\n $this->title = \"Add New User\";\n $arr = array('controller' => $this->controller, 'action' => $this->action, 'title' => $this->title);\n return view('user.add', $arr);\n }", "protected function form()\n {\n return Admin::form(User::class, function (Form $form) {\n\n $form->display('id', '序号');\n $form->select('role', '用户类型')->options(User::getRoleDisplayMap());\n $form->display('created_at', '创建时间');\n $form->display('updated_at', '更新时间');\n });\n }", "public function initialize()\n {\n $username = new Text('username',\n array(\n 'id' => 'username',\n 'class' => 'form-control'\n )\n );\n\n $username->setLabel('Nombre de Usuario');\n\n $username->addValidators(\n array(\n new PresenceOf(\n array(\n 'message' => 'El campo Nombre de Usuario es requerido'\n )\n ),\n new StringLength(\n array(\n 'max' => '50',\n 'min' => '2',\n 'messageMinimum' => 'El campo Nombre de Usuario no puede tener menos de 2 caracteres',\n 'messageMaximum' => 'El campo Nombre de Usuario no puede tener mas de 50 caracteres'\n )\n )\n )\n );\n\n $this->add($username);\n\n // Campo Email y validaciones (Se llama aqui la libreria porque ya existe una libreria llamada Email, que es un validaor)\n $email = new Phalcon\\Forms\\Element\\Email('email',\n array(\n 'id' => 'email',\n 'class' => 'form-control'\n )\n );\n\n $email->setLabel('Correo');\n\n $email->addValidators(\n array(\n new PresenceOf(\n array(\n 'message' => 'El campo Correo es requerido'\n )\n ),\n new Email(\n array(\n 'message' => 'El campo Correo no tiene un formato valido'\n )\n )\n )\n );\n\n $this->add($email);\n\n // Agregar el campo role\n $role = new Select('role',\n array(\n 'registered' => 'Registrado',\n 'admin' => 'Administrador'\n ),\n array(\n 'id' => 'role',\n 'class' => 'form-control'\n )\n );\n\n $role->setLabel('Role');\n\n $this->add($role);\n\n // campo status y su validacion\n $status = new Check ('status',\n array(\n 'id' => 'status',\n 'value' => 1\n )\n );\n $status->setLabel('Activo');\n $this->add($status);\n\n // Agregar submit\n $this->add(new Submit('submit', array(\n 'class' => 'btn btn-primary btn-sm btn-block',\n 'value' => 'Enviar'\n )));\n\n\n // Para evitar ataque csrf\n $csrf = new Hidden('csrf');\n\n $csrf->addValidator( new Identical(array(\n 'value' => $this->security->getSessionToken(),\n 'message' => 'Problemas con el formulario'\n )\n )\n );\n\n $this->add($csrf);\n\n $this->add(new Hidden('typeForm', array('value'=>'user')));\n }", "public function create()//mostra formulário de criação de usuários\n {\n $form = \\FormBuilder::create(UserForm::class,[\n 'url' => route('admin.users.store'),\n 'method' => 'POST'\n ]); //classe de formulario, url de ação do formulario e método http\n\n return view('admin.users.create', compact('form'));\n }", "public function init()\n\t{\n\t\tparent::init();\n\n\t\t// Set the form's attributes\n\t\t$this->setName('userForm');\n\t\t$this->setMethod(self::METHOD_POST);\n\t\t\n\t\t// Id\n\t\t$id = new Zend_Form_Element_Hidden('user_id');\n\t\t$id->setOptions(array(\n\t\t\t\t'required' => false,\n\t\t\t\t'filters' => array(\n\t\t\t\t\t\t'StringTrim',\n\t\t\t\t\t\t'StripTags'\n\t\t\t\t),\n\t\t\t\t'decorators' => array('ViewHelper')\n\t\t));\n\t\t$this->addElement($id);\n\n\t\t// Name\n\t\t$name = new Zend_Form_Element_Text('user_name');\n\t\t$name->setOptions(array(\n\t\t\t\t'label' => 'UserForm:@Name',\n\t\t\t\t'required' => true,\n\t\t\t\t'filters' => array(\n\t\t\t\t\t\t'StringTrim',\n\t\t\t\t\t\t'StripTags'\n\t\t\t\t),\n\t\t\t\t'validators' => array('NotEmpty'),\n\t\t\t\t'decorators' => array('ViewHelper'),\n\t\t\t\t'autocomplete' => 'off'\n\t\t));\n\t\t$this->addElement($name);\n\n\t\t// Email\n\t\t$email = new Zend_Form_Element_Text('user_email');\n\t\t$email->setOptions(array(\n\t\t\t\t'label' => 'UserForm:@Email',\n\t\t\t\t'required' => true,\n\t\t\t\t'filters' => array(\n\t\t\t\t\t\t'StringTrim',\n\t\t\t\t\t\t'StripTags'\n\t\t\t\t),\n\t\t\t\t'validators' => array('NotEmpty'),\n\t\t\t\t'decorators' => array('ViewHelper'),\n\t\t\t\t'autocomplete' => 'off'\n\t\t));\n\t\t$this->addElement($email);\n\n\t\t// Status\n\t\t$status = new Zend_Form_Element_Radio('user_status');\n\t\t$status->setOptions(array(\n\t\t\t\t'label' => 'UserForm:@Status',\n\t\t\t\t'required' => true,\n\t\t\t\t'filters' => array(\n\t\t\t\t\t\t'StringTrim',\n\t\t\t\t\t\t'StripTags'\n\t\t\t\t),\n\t\t\t\t'multiOptions' => array(\n\t\t\t\t\t\t1 => 'UserForm:@Status active',\n\t\t\t\t\t\t0 => 'UserForm:@Status inactive'\n\t\t\t\t),\n\t\t\t\t'validators' => array('NotEmpty'),\n\t\t\t\t'decorators' => array('ViewHelper'),\n\t\t\t\t'autocomplete' => 'off'\n\t\t));\n\t\t$this->addElement($status);\n\t\t\n\t\t// Role\n\t\t$userRole = new Zend_Form_Element_Select('user_role');\n\t\t$userRole->setOptions(array(\n\t\t\t\t'label' => 'UserForm:@Role',\n\t\t\t\t'required' => true,\n\t\t\t\t'filters' => array(\n\t\t\t\t\t\t'StringTrim',\n\t\t\t\t\t\t'StripTags'\n\t\t\t\t),\n\t\t\t\t'onChange' => 'LumiaJS.admin.user.form.getPrivilegesAccordingRole(this)',\n\t\t\t\t'multiOptions' => array(null => 'Form:@Unselected'),\n\t\t\t\t'validators' => array('NotEmpty'),\n\t\t\t\t'decorators' => array('ViewHelper')\n\t\t));\n\t\t\n\t\t$userRoleModel = new Admin_Model_Role();\n\t\t$userRoleRows = $userRoleModel->allActivate();\n\t\tif ($userRoleRows->count())\n\t\t{\n\t\t\tif (Admin_Auth::getInstance()->isAdmin())\n\t\t\t{\n\t\t\t\t$userRole->addMultiOption(Lumia_Const::ROLE_CODE_ADMIN, $this->getTranslator()->translate('RoleLabel:@Admin'));\n\t\t\t}\n\t\t\t\n\t\t\tforeach ($userRoleRows as $userRoleRow)\n\t\t\t{\n\t\t\t\t$userRole->addMultiOption($userRoleRow->role_code, $userRoleRow->role_name);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->addElement($userRole);\n\t\t\n\t\t// Password\n\t\t$password = new Zend_Form_Element_Password('user_password');\n\t\t$password->setOptions(array(\n\t\t\t\t'label' => 'UserForm:@Password',\n\t\t\t\t'required' => false,\n\t\t\t\t'filters' => array('StripTags'),\n\t\t\t\t'validators' => array(\n\t\t\t\t\t\tarray('StringLength', false, array('min' => 6, 'max' => 64))\n\t\t\t\t),\n\t\t\t\t'decorators' => array('ViewHelper'),\n\t\t\t\t'autocomplete' => 'off'\n\t\t));\n\t\t$password->setRenderPassword(true);\n\t\t$this->addElement($password);\n\t\t\n\t\t// Confirm password\n\t\t$verifyPassword = new Zend_Form_Element_Password('user_verify_password');\n\t\t$verifyPassword->setOptions(array(\n\t\t\t\t'label' => 'UserForm:@Verify password',\n\t\t\t\t'required' => true,\n\t\t\t\t'filters' => array('StripTags'),\n\t\t\t\t'validators' => array(\n\t\t\t\t\t\tarray('VerifyPassword', false, array('token' => 'user_password'))\n\t\t\t\t),\n\t\t\t\t'decorators' => array('ViewHelper'),\n\t\t\t\t'autocomplete' => 'off'\n\t\t));\n\t\t$verifyPassword->setAutoInsertNotEmptyValidator(false);\n\t\t$verifyPassword->setRenderPassword(true);\n\t\t$this->addElement($verifyPassword);\n\t\t\n\t\t// Privileges\n\t\t$this->_privilegesForm = new Zend_Form_SubForm();\n\t\t$this->addSubForm($this->_privilegesForm, 'dependencyPrivileges');\n\t\t$this->_privilegesForm();\n\t\t\n\t\t// Privileges according to role\n\t\t$this->_rolePrivilegesForm();\n\t\t\n\t\t// Save button\n\t\t$submit = new Zend_Form_Element_Submit('btnSave');\n\t\t$submit->setOptions(array(\n\t\t\t\t'label' => 'Form:@Button save',\n\t\t\t\t'decorators' => array('ViewHelper')\n\t\t));\n\t\t$this->addElement($submit);\n\n\t\t// Reset button\n\t\t$submit = new Zend_Form_Element_Button('btnReset');\n\t\t$submit->setOptions(array(\n\t\t\t\t'label' => 'Form:@Button reset',\n\t\t\t\t'type' => 'reset',\n\t\t\t\t'decorators' => array('ViewHelper')\n\t\t));\n\n\t\t$this->addElement($submit);\n\t}", "public function addUserAction()\n\t{\n\t\t$user = new User();\n\n\t\t$form = $this->createForm(new UserType, $user);\n\t\t\n\t\t$request = $this->get('request');\n\n\t\tif ($request->getMethod() == 'POST') {\n\t\t\t$form->bind($request);\n\n // Checking the validity of the submission\n\t\t\tif ($form->isValid()) {\n\t\t\t\t$em = $this->getDoctrine()->getManager();\n\t\t\t\t$em->persist($user);\n\t\t\t\t$em->flush();\n\n // Redirection to the homepage of Bundle\n\t\t\t\treturn $this->redirect($this->generateUrl('valentin_films_manager_index'));\n\t\t\t}\n\t\t}\n\t\treturn $this->render('ValentinFilmsManagerBundle:Manager:addUser.html.twig', array(\n\t\t\t'form' => $form->createView(),\n\t\t\t));\n\t\t\n\t}", "public function __construct($name = null)\n {\n parent::__construct('user_form');\n }", "public function form()\n {\n $userModel = config('admin.database.users_model');\n\n $form = new Form(new $userModel());\n\n $userTable = config('admin.database.users_table');\n $connection = config('admin.database.connection');\n\n $form->display('id', 'ID');\n $form->text('username', trans('admin.username'))\n ->creationRules(['required', \"unique:{$connection}.{$userTable}\"])\n ->updateRules(['required', \"unique:{$connection}.{$userTable},username,{{id}}\"]);\n\n $form->text('name', trans('admin.name'))->rules('required');\n $form->image('avatar', trans('admin.avatar'));\n $form->password('password', trans('admin.password'))->rules('required|confirmed');\n $form->password('password_confirmation', trans('admin.password_confirmation'))->rules('required')\n ->default(function ($form) {\n return $form->model()->password;\n });\n\n $form->ignore(['password_confirmation']);\n\n $form->display('created_at', trans('admin.created_at'));\n $form->display('updated_at', trans('admin.updated_at'));\n\n $form->saving(function (Form $form) {\n if ($form->password && $form->model()->password != $form->password) {\n $form->password = bcrypt($form->password);\n }\n });\n\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n });\n\n return $form;\n }", "public function create()\n {\n // dd( $user->roles );\n $form[ 'formUrl' ] = url('users');\n $form[ 'formMethod' ] = 'post';\n $form[ 'blank' ] = 'blank';\n $formFields = User::getFormData( );\n unset( $formFields['_password'] );\n unset( $formFields['_password_confirmation'] );\n $form[ 'content' ] = view('layouts.templates.forms.form_fields', [ 'formFields' => $formFields ] );\n $form = view('layouts.templates.forms.form', $form );\n \n $this->data[ 'contents' ] = $form ;\n\n $this->data[ 'message_alert' ] = Session::get('message');\n $this->data[ 'page_title' ] = 'User management';\n $this->data[ 'header' ] = 'Tambah User';\n $this->data[ 'sub_header' ] = '';\n return $this->render( );\n }", "public function create()\n {\n return view(\"users.usersform\");\n }", "public function create() {\n // TODO: Admin Policy\n return view('auth.user_add');\n }", "public function addAction() {\n $form = new Admin_Form_CreateAdminUser();\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($this->_request->getPost())) {\n $values = $form->getValues();\n $adminMapper = new Application_Model_Table_AdminUsers();\n $userFound = $adminMapper->fetchByUsername($values['username']);\n if(!$userFound){\n $values['is_active'] = 1;\n $values['is_admin'] = 1;\n $adminUser = $adminMapper->createRow($values);\n $adminUser->hashPassword($values['new_password']);\n $adminUser->save();\n $this->_helper->FlashMessenger->addMessage('The user has been created' , 'successful');\n $this->_helper->redirector->goToRouteAndExit(array(), 'admin-users', true);\n } else {\n $this->view->messages['error'] = \"This username already exists\";\n }\n }\n }\n $this->view->form = $form;\n }", "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 create()\n {\n return view('Admin.user.useradd');\n }", "public function init()\n {\n // form should use p4cms-ui styles.\n $this->setAttrib('class', 'p4cms-ui role-form role-add-form');\n\n // set the method for the form to POST\n $this->setMethod('post');\n\n // add a field to collect the role name.\n $this->addElement(\n 'text',\n 'id',\n array(\n 'label' => 'Name',\n 'required' => true,\n 'filters' => array('StringTrim'),\n 'validators' => array('GroupName'),\n 'size' => 30,\n 'order' => 10\n )\n );\n\n // add a field to collect users to assign this role to (doesn't include system user).\n $users = P4Cms_User::fetchAll()->invoke('getId');\n\n $options = count($users) ? array_combine($users, $users) : array();\n $this->addElement(\n 'MultiCheckbox',\n 'users',\n array(\n 'multiOptions' => $options,\n 'label' => 'Users',\n 'order' => 20\n )\n );\n\n // add the submit button\n $this->addElement(\n 'SubmitButton',\n 'save',\n array(\n 'label' => 'Save',\n 'class' => 'preferred',\n 'required' => false,\n 'ignore' => true\n )\n );\n\n // put the button in a fieldset.\n $this->addDisplayGroup(\n array('save'),\n 'buttons',\n array(\n 'class' => 'buttons',\n 'order' => 100\n )\n );\n\n }", "public function add(){\n\t\t// Set the Page Title ('pageName', 'pageSection', 'areaName')\n\t\t$this->_view->pageTitle = array('Add', 'Users');\n\t\t// Set Page Description\n\t\t$this->_view->pageDescription = '';\n\t\t// Set Page Section\n\t\t$this->_view->pageSection = 'Users';\n\t\t// Set Page Sub Section\n\t\t$this->_view->pageSubSection = 'Users';\n\n\t\t// Set default variables\n\t\t$this->_view->error = array();\n\n\t\t$userTypes = explode(',', USERS);\n $userTypesStore = array_pop($userTypes);\n\t\t$this->_view->userTypes = $userTypes;\n\n // If Form has been submitted process it\n\t\tif(!empty($_POST)){\n //if user selected cancel\n if(!empty($_POST['cancel'])){\n Url::redirect('backoffice/users/index');\n }\n $_POST['salt'] = null;\n\n if(!isset($_FILES) || empty($_FILES['image']['name'])){\n $_POST['image'] = null;\n }else{\n $this->uploadFile($_FILES);\n }\n\n // Create new user\n $createData = $this->_model->createData($_POST);\n if(isset($createData['error']) && $createData['error'] != null){\n foreach($createData['error'] as $key => $error){\n $this->_view->error[$key] = $error;\n }\n }else {\n $this->_view->flash[] = \"User added successfully.\";\n Session::set('backofficeFlash', array($this->_view->flash, 'success'));\n Url::redirect('backoffice/users/');\n }\n\t\t}\n\t\t// Render the view ($renderBody, $layout, $area)\n\t\t$this->_view->render('users/add', 'layout', 'backoffice');\n\t}", "protected function createForm() \n {\n if ($this->form) {\n return $this->form;\n }\n $tm = $this->getContext()->getTranslationManager();\n $id = 0;\n $this->form = new Form_Form(\n array (\n 'method' => 'post',\n 'action' => $this->getContext()->getRouting()->gen('users.register'), //We should add action for ajax calls\n 'submit' => $tm->_('Register'),\n 'id' => $id++,\n 'renderer' => $this->getContainer()->getOutputType()->getRenderer()\n )\n );\n $username = new Form_Elements_TextField(\n array(\n 'name' => 'username',\n 'title' => $tm->_('User name'),\n 'required' => true,\n 'id' => $id++\n ), \n $this->form\n\t );\n $this->form->addChild($username);\n $email = new Form_Elements_TextField(\n array(\n 'name' => 'email',\n 'title' => $tm->_('Email address'),\n 'required' => true,\n 'email' => true,\n 'id' => $id++\n ), \n $this->form\n\t );\n $this->form->addChild($email);\n\n $password = new Form_Elements_PasswordField(\n array(\n 'name' => 'password',\n 'title' => $tm->_('Password'),\n 'required' => true,\n 'min' => 6,\n 'id' => $id++\n ), \n $this->form\n );\n $this->form->addChild($password);\n $confirm = new Form_Elements_PasswordField(\n array(\n 'name' => 'confirm',\n 'title' => $tm->_('Confirm'),\n 'required' => true,\n 'equal' => 'password', //Name of other field \n 'id' => $id++\n ), \n $this->form\n );\n\n $this->form->addChild($confirm);\n return $this->form;\n }", "public function profile_admin()\n {\n parent::__construct();\n\t\t$this->setAttribute('method', 'post');\n\t\t$this->setAttribute('class', 'profile_form');\n \n\t\t$this->add(array(\n 'name' => 'user_name',\n 'type' => 'text',\n\t\t\t\"required\"=>true,\n 'options' =>array(\n 'label' => \"Full Name\",\n ),\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'form-control required', \n\t\t\t\t\"placeholder\" => \"Full Name\", \n\t\t\t ),\n ));\n\t\t\n\t\t\n\t\t$this->add(array(\n 'name' => 'user_email',\n 'type' => 'text',\n\t\t\t\"required\"=>true,\n 'options' =>array(\n 'label' => \"Email\",\n ),\n\t\t\t\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'form-control required email checkemail_exclude', \n\t\t\t\t\"placeholder\" => \"Email Address\", \n\t\t\t ),\n ));\n\t\t\n\t\t$this->add(array(\n 'name' => 'user_address',\n 'type' => 'text',\n\t\t\t\"required\"=>true,\n 'options' =>array(\n 'label' => \"Address\",\n ),\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'form-control required', \n\t\t\t\t\"placeholder\" => \"Address\", \n\t\t\t ),\n ));\n\t\t\n\t\t$this->add(array(\n 'name' => 'user_phone',\n 'type' => 'text',\n\t\t\t\"required\"=>true,\n 'options' =>array(\n 'label' => \"Phone Number\",\n ),\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'form-control required', \n\t\t\t\t\"placeholder\" => \"Phone Number\", \n\t\t\t\t'id'=>'user_phone', \n\t\t\t ),\n ));\n\t\t\n\t\t$this->add(array(\n 'name' => 'user_city',\n 'type' => 'text',\n\t\t\t\"required\"=>true,\n 'options' =>array(\n 'label' => \"City\",\n ),\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'form-control required', \n\t\t\t\t\"placeholder\" => \"City\", \n\t\t\t ),\n ));\n\t\t\n\t\t$this->add(array(\n 'name' => 'user_state',\n 'type' => 'text',\n\t\t\t\"required\"=>true,\n 'options' =>array(\n 'label' => \"State\",\n ),\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'form-control required', \n\t\t\t\t\"placeholder\" => \"State\", \n\t\t\t ),\n ));\n\t\t$this->add(array(\n 'name' => 'user_country',\n 'type' => 'text',\n\t\t\t\"required\"=>true,\n 'options' =>array(\n 'label' => \"Country\",\n ),\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'form-control required', \n\t\t\t\t\"placeholder\" => \"Country\", \n\t\t\t ),\n ));\n\t\t\n\t\t$this->add(array(\n\t\t\t'name' => 'user_image',\n\t\t\t'type' => 'file',\t\t\t\n\t\t\t'options' =>array(\n\t\t\t\t'label' => \"Profile Image\",\n\t\t\t),\n\t\t\t\"accept\"=>\"image/*\",\n\t\t\t'attributes' =>array( // Array of attributes\n\t\t\t\t'class' => 'default', \n\t\t\t\t\"id\" => \"user_image\", \n\t\t\t\t\"accept\"=>\"image/*\"\t\t\t\t\n\t\t\t ),\n\t\t));\t\n }", "public function create()\n {\n return view('add_user');\n //\n }", "private function createCreateForm(User $entity)\n {\n $form = $this->createForm(new UserType(), $entity, array(\n 'action' => $this->generateUrl('user_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "function create() \n {\n $api = new Module_UserManagement_API();\n\n $user_types = $api->getExerciseTypes();\n\n $form = new AddUserForm();\n if ($form->validate()) {\n $userid = $form->getSubmitValue('login');\n $password = $form->getSubmitValue('password');\n $coach = $form->getSubmitValue('coach');\n $athlete = $form->getSubmitValue('athlete');\n $usertype = $form->getSubmitValue('usertype');\n\n $success = $api->createUser($userid, $password, \n $coach, $athlete, $usertype);\n if ($success) {\n /* We have sucessfully logged in, now lets \n * display the next page */\n /*\n if (!isset($redirect_module) || !isset($redirect_action)) {\n $redirect_module = 'Sessions';\n }\n\n Core_Url::redirectToUrl($urlToRedirect);\n */\n }\n }\n\n $view = Core_View::factory('adduser');\n //$view->users = $users;\n $view->addForm($form);\n $view->subTemplate = 'genericForm.tpl';\n\n /* Coach radio buttons */\n $view->assign('coach_types', array('y' => 'Yes',\n 'n' => 'No'));\n $view->assign('coach_selected', 'n');\n\n /* Athlete radio buttons */\n $view->assign('athlete_types', array('y' => 'Yes',\n 'n' => 'No'));\n $view->assign('athlete_selected', 'n');\n\n /* Athlete radio buttons */\n $view->assign('usertype_types', array('user' => 'User',\n 'superuser' => 'SuperUser'));\n $view->assign('usertype_selected', 'user');\n\n echo $view->render();\n }", "protected function addUserId()\n {\n $this->add(array(\n 'name' => 'user_id',\n 'required' => true,\n ));\n \n return $this;\n }", "private function createCreateForm(User $entity)\n {\n $form = $this->createForm(new UserType(), $entity, array(\n 'action' => $this->generateUrl('api_user_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function addAction() {\r\n\t\tif ($this->request->isPost ()) {\r\n\t\t\t$user = new Users ();\r\n\t\t\t$user->firstname = $this->request->get ( \"first_name\" );\r\n\t\t\t$user->lastname = $this->request->get ( \"last_name\" );\r\n\t\t\t$user->bithday = $this->request->get ( \"date\" );\r\n\t\t\t$user->save ();\r\n\t\t}\r\n\t}", "public function __construct($name = null)\n {\n parent::__construct('user');\n\n $this->add(array(\n 'name' => 'id',\n 'type' => 'Hidden',\n ));\n\t\t $this->add(array(\n 'name' => 'name',\n 'type' => 'Text',\n 'options' => array(\n 'label' => 'Name',\n ),\n ));\n\t\t $this->add(array(\n 'name' => 'isActive',\n 'type' => 'Zend\\Form\\Element\\Select',\n 'options' => array(\n 'label' => 'isActive',\n\t\t\t\t 'value_options' => array(\n 'Y' => 'Yes',\n 'N' => 'No',\n\t\t\t\t ),\n ),\n ));\n\t\t $this->add(array(\n 'name' => 'submit',\n 'type' => 'Submit',\n 'attributes' => array(\n 'value' => 'Go',\n 'id' => 'submitbutton',\n ),\n ));\n }", "public function create() // abre un formulario de creacion\n {\n \n return view('user.create');\n }", "public function add() {\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->create();\n\t\t\t$this->request->data['User']['password'] = AuthComponent::password($this->request->data['User']['password']);\n\t\t\tif ($this->User->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('The user has been saved'));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n\t\t\t}\n\t\t} else {\n\t\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t\t$lookupSupported = isset($queryURL) && \"\" <> $queryURL;\r\n\t\t\t$this->set('lookupSupported', $lookupSupported);\n\t\t\t$this->set('userType', $user['User']['type']);\n\t\t}\n\t}", "private function createCreateForm(User $entity)\n {\n $form = $this->createForm(\n new UserType(),\n $entity,\n array(\n 'action' => $this->generateUrl('vipa_admin_user_create'),\n 'method' => 'POST'\n )\n );\n\n return $form;\n }", "public function create()\n {\n return view(\"Admin/user_add\");\n }", "public function create()\n {\n $this->authorize('create', User::class);\n return view('user.form')->with('user', new User())->with('roles', UserRole::getRoleList());\n }", "public function getAddUser()\n\t{\n\t\t$roles = (new RolesForCheckboxesRetriever())->execute();\n\t\t$pagination_size_options = (new PaginationSizeLookupRetriever())->execute();\n\t\treturn view('user.add-user', [ \n\t\t\t\t'roles' => $roles, \n\t\t\t\t'pagination_size_options' => $pagination_size_options\n\t\t]);\n\t}", "private function createCreateForm(User $entity)\n {\n $form = $this->createForm(new UserType(), $entity, array(\n 'action' => $this->generateUrl('usuarios_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function showUserCreationForm()\n {\n return view('admin.user_create');\n }", "public function create()\n {\n return view('users.form');\n }", "public function create()\n {\n return view('users.form');\n }", "public function actionCreate()\n {\n $model = new UserForm();\n $model->setScenario('create');\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n }\n if (Yii::$app->request->isGet) {\n $model->status = User::STATUS_ACTIVE;\n $model->roles = User::ROLE_USER;\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'roles' => ArrayHelper::map(Yii::$app->authManager->getRoles(), 'name', 'name')\n ]);\n }", "public function create()\n {\n return view(\"admin.addUser\");\n }", "public function create()\n {\n return view('admin.user.user-add');\n }", "public function create()\n {\n $User = User::get();\n view()->share('elements', $User);\n\n $UserRoles = UserRoles::get();\n view()->share('UserRoles', $UserRoles);\n\n return view('users.form');\n }", "public function createAction(){\n\t \t$form=new UserFrom();\n\t\t$form->get('submit')->setValue('Validate');\n\t\t$request = $this->getRequest();\n\t\t\n\t\tif ($request->isPost()) {\n\t\t\t$user=new User();\n\t\t\t$form->setInputFilter($user->getInputFilter());\n\t\t\t$form->setData($request->getPost());\n\t\t\t\n\t\t\tif ($form->isValid()) {\n $user->exchangeArray($form->getData());\n $this->getUserTable()->saveUSer($user);\n // Redirect to list of u\n return $this->redirect()->toRoute('user');\n }\n\t\t}\n\t\treturn array('form' => $form);\n\t }", "public function create()\n {\n return view('admin.user.add');\n }", "public function create()\n {\n return view('admin.user.add');\n }", "public function create()\n {\n return view('admin.user.add');\n }", "public function createForm();", "public function createForm();", "private function createCreateForm(User $user)\n {\n $form = $this->get('form.factory')->create('dte_btsbundle_user', $user, array(\n 'action' => $this->generateUrl('dte_bts_user_create'),\n 'method' => 'POST',\n 'form_context' => UserType::CREATE_CONTEXT,\n ));\n\n $form->add('submit', 'submit', array('label' => 'bts.default.action.create'));\n\n return $form;\n }", "public function create()\n {\n \t $this->pass_data['page_heading'] = \"Add User\";\n return view('backend.user.create', $this->pass_data);\n }", "public function actionCreate()\n {\n $model = new UserRegisterForm;\n \n //var_dump(Yii::app()->user);\n \n if(isset($_POST['UserRegisterForm']))\n {\n $model->attributes=$_POST['UserRegisterForm'];\n // validate user input and redirect to the previous page if valid\n if($model->validate())\n {\n $model->createUser();\n $this->redirect(Yii::app()->user->returnUrl);\n }\n }\n \n $this->render('create', array('model'=>$model));\n\n }", "protected function form()\n {\n $form = new Form(new User);\n\n $form->tab('Personal Information', function ($form) {\n\n $form->text('name')->required();\n $form->text('email')->required();\n $form->password('password')->required()->default(function ($form) {\n return $form->model()->password;\n });;\n\n $form->saving(function (Form $form) {\n if ($form->password && $form->model()->password != $form->password) {\n $form->password = bcrypt($form->password);\n }\n });\n $form->hidden('role_id',1);\n// $form->select('role_id')->options([\n// User::HOST_USER_ROLE_ID => 'host',\n// // User::NORMAL_USER_ROLE_ID => 'normal'\n// ])->required();\n $form->select('type')->options([\n User::PROFESSIONAL_USER_TYPE_ID => 'Professional',\n User::GROUP_USER_TYPE_ID => 'Group',\n User::COMPANY_USER_TYPE_ID => 'Company'\n ])->required();\n $form->select('status')->options([\n User::SUSPEND_USER => 'Suspend User',\n User::APPROVED_USER => 'Approved User',\n User::REJECTED_USER => 'Rejcted User'\n ])->required(); \n $form->image('avatar');\n $form->number('number_of_events' , 'Number Of Events');\n $form->number('number_of_activity' , 'Number Of Activity');\n $form->number('number_of_services' , 'Number Of Services');\n $form->multipleSelect('profession')->options(\\App\\Models\\Professions::all()->pluck('en_name', 'id'))->required();\n $form->multipleSelect('packeges')->options(\\App\\Models\\Packages::all()->pluck('name_en', 'id'));\n })\n ->tab('Socail Media', function ($form) {\n\n $form->hasMany('socailmedia', function (Form\\NestedForm $form) {\n $form->select('type')->options([\n 1 => 'instgram',\n 2 => 'facebook',\n 3 => 'twitter'\n ]);\n $form->text('link');\n\n });\n\n })\n ->tab('Profession Certification', function ($form) {\n\n $form->hasMany('usercertificate', function (Form\\NestedForm $form) {\n $form->text('name');\n $form->date('from');\n $form->date('to');\n $form->file('certificate_file');\n });\n\n\n })\n ->tab('Host Data', function ($form) {\n\n\n $form->text('host.company_name')->required();\n $form->email('host.email')->required();\n $form->text('host.location')->required();\n $form->text('host.website')->required();\n $form->date('host.starting_year')->required();\n $form->file('host.company_certificate');\n $form->mobile('host.landline')->required();\n $form->mobile('host.mobile')->required();\n $form->mobile('host.whatsapp')->required();\n $form->time('host.work_from')->required();\n $form->time('host.work_to')->required();\n $form->time('host.break_from')->required();\n $form->time('host.break_to')->required();\n\n\n })\n\n ;\n $form->display('created_at');\n $form->display('updated_at');\n\n\n return $form;\n }", "public function create()\n { //加载表单\n return view('Admin.Adminuser.add');\n }", "public function create()\n {\n return view('admin.user.add',[\n 'title'=>'添加管理员页面',\n ]);\n }", "public function add(){\n\t\t// if we got a post information, do add else do nothing\n\t\tif($this->request->is('post')){\n\t\t\t$this->User->create();\n\t\t\tif($this->User->save($this->request->data)){\n\t\t\t\t// if the information is successfully saved\n\t\t\t\t$this->Session->setFlash(__('Congratulation, the user has been created.'));\n\t\t\t\t$this->redirect(array('controller'=>'jobs', 'action'=>'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Sorry, the user can not be created.'));\n\t\t\t}\n\t\t}\n\t}", "public function create()\n {\n //return view ('admin.user-table.new-user-form');\n }", "public function createForm()\n {\n }", "public function newAction()\n {\n $user = new User();\n $form = $this->createForm(UserType::class, $user, array(\n 'adminRequired' => true,\n ));\n\n return $this->render('AdminBundle:admin:new.html.twig', array(\n 'user' => $user,\n 'form' => $form->createView(),\n ));\n }", "private function createCreateForm(User $entity)\n {\n $form = $this->createForm(new UserType(), $entity, array(\n 'action' => $this->generateUrl('register'),\n 'method' => 'POST',\n ));\n\n return $form;\n }", "public function newAction()\n {\n $entity = new User();\n $form = $this->createCreateForm($entity)\n ->add('create', 'submit', array('label' => 'c'));\n\n return $this->render(\n 'VipaAdminBundle:AdminUser:new.html.twig',\n array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n )\n );\n }", "public function create()\n {\n return view(\"admin/useradd\");\n }", "protected function form()\n {\n $form = new Form(new userWhitelist());\n\n $form->text('accountId', ___('AccountId'));\n $form->text('accountName', ___('AccountName'));\n $form->text('nickName', ___('NickName'));\n\n return $form;\n }", "public function newAction()\r\n {\r\n $entity = new User();\r\n $form = $this->createForm(new UserType(), $entity);\r\n\r\n return array(\r\n 'entity' => $entity,\r\n 'form' => $form->createView(),\r\n );\r\n }", "public function create()\n {\n MetaTag::setTags(['title' => 'Добавление пользователя']);\n\n return view('blog.admin.user.add');\n }", "public function actionCreate()\n\t{\n\t\t$model=new User;\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['User']))\n\t\t{\n\t\t\t$model->attributes=$_POST['User'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new User;\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['User']))\n\t\t{\n\t\t\t$model->attributes=$_POST['User'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function create()\n {\n $this->generateParams();\n return view('backend.pages.user._form', compact('gender', 'type', 'city'));\n }", "private function insertUser(){\n\t\t$data['tipoUsuario'] = Seguridad::getTipo();\n\t\tView::show(\"user/insertForm\", $data);\n\t}", "public function create()\n {\n \treturn View::make(\"admin.UserAdd\");\n }", "public function create()\n {\n return view('admin.pages.allusers.user_add');\n }", "public function create()\n {\n return view('customer.adduser');\n }", "protected function add()\n {\n $userModel = config('admin.database.users_model');\n $roleModel = config('admin.database.roles_model');\n\n $username = null;\n\n while ($username === null) {\n $answer_username = $this->ask('Please enter a username to login');\n\n if ($userModel::where('username', '=', $answer_username)->exists()) {\n\n $this->line(\"<error>Username is exists: </error> $answer_username\");\n } else {\n $username = $answer_username;\n }\n }\n\n $password = null;\n\n while ($password === null) {\n $answer_password = $this->secret('Please enter a password to login');\n\n $answer_password_again = $this->secret('Please enter the password again');\n\n if ($answer_password != $answer_password_again) {\n $this->line(\"<error>Password do not match</error>\");\n } else {\n $password = bcrypt($answer_password);\n }\n }\n\n $name = $this->ask('Please enter a name to display');\n\n if ($this->confirm('Add role for user?', true)) {\n $roles = $roleModel::all();\n\n if (!$this->confirm('All role?', true)) {\n /** @var array $selected */\n $selectedOption = $roles->pluck('name')->toArray();\n\n $selected = $this->choice('Please choose a role for the user, or you can use \",\" to make multiple', $selectedOption, null, null, true);\n\n $selected = Arr::wrap($selected);\n\n $roles = $roles->filter(function ($role) use ($selected) {\n return in_array($role->name, $selected);\n });\n }\n }\n\n $user = new $userModel(compact('username', 'password', 'name'));\n\n $user->save();\n\n if (isset($roles)) {\n $user->roles()->attach($roles);\n }\n\n $this->line('<info>User created successfully: </info> ' . $name);\n }" ]
[ "0.7803736", "0.71814924", "0.7057859", "0.6940717", "0.68145585", "0.6786464", "0.6782658", "0.67746854", "0.67739356", "0.67563283", "0.6722403", "0.67013294", "0.66925365", "0.6679759", "0.6675265", "0.66590834", "0.6654256", "0.664875", "0.6644554", "0.66249985", "0.65909165", "0.6586758", "0.65855294", "0.65677565", "0.6560226", "0.65460503", "0.65457815", "0.65446204", "0.65162593", "0.6515645", "0.6508923", "0.65068656", "0.6504114", "0.6494143", "0.64842296", "0.64690125", "0.6461314", "0.64451295", "0.6431744", "0.6411528", "0.6403054", "0.63942486", "0.6370441", "0.63678634", "0.6359755", "0.63479245", "0.6344646", "0.6336819", "0.632641", "0.6320734", "0.6309755", "0.63072103", "0.6303834", "0.63020843", "0.62977684", "0.627077", "0.626964", "0.6263792", "0.62624", "0.6253076", "0.62488735", "0.6248396", "0.6247483", "0.62469643", "0.6245272", "0.6243005", "0.6243005", "0.6238447", "0.62383765", "0.6228787", "0.6224938", "0.62202656", "0.62192726", "0.62192726", "0.62192726", "0.62103796", "0.62103796", "0.621029", "0.6201081", "0.6196763", "0.61836255", "0.61675835", "0.616746", "0.6164233", "0.6157198", "0.6154771", "0.61525124", "0.61510974", "0.61481494", "0.61477244", "0.6132679", "0.6127576", "0.6124594", "0.6100737", "0.6100737", "0.6097562", "0.60956246", "0.6092349", "0.6091229", "0.6080505", "0.6080309" ]
0.0
-1
Customise the check() method.
public function check($callIfSuccess = null, $callIfFail = null) { return parent::check([$this, 'callbackSuccess'], [$this, 'callbackFail']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function check();", "abstract function check();", "public function check() {}", "public function check();", "public function check();", "public function check();", "public function check();", "public function check();", "public static function check();", "public function _check()\n {\n }", "public static function check()\n {\n parent::check();\n }", "public function check()\n {\n }", "public function check()\n {\n }", "public function check(): void;", "public function check(): void;", "public function goCheck(){\n $request = Request::instance();\n\n $params = $request->param();\n\n //check the input params\n $result = $this->batch()->check($params);\n\n //adjust the checked result\n if($result){\n return true;\n }else{\n $ex = new InputParamsErr();\n $ex->errMsg = $this->getError();\n throw $ex;\n }\n }", "public function check()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function performChecks(){\n\t\t\n\t}", "public function check()\n {\n return true;\n }", "public function isChecked() {}", "public function check()\n {\n $method = $this->camelize('check-for-' . $this->event_type);\n return $this->$method();\n }", "abstract protected function safetyCheck() : self;", "public function check($condition)\n\t{\n\t}", "protected function check($file)\n {\n }", "public function check($value): bool;", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}", "public function check()\n {\n foreach ($this->options as $id => $option) {\n $option->check();\n }\n }", "public function check()\n {\n foreach ($this->_tests as $test) {\n $res = $test->check();\n if ($res !== true) {\n return $res;\n }\n }\n\n return true;\n }", "public function check(Node $node);", "public function checkCondition()\n {\n $conditionClass = $this->getConditionClass();\n $conditionMethod = $this->getConditionMethod();\n\n if (empty($conditionClass) || empty($conditionMethod))\n {\n return true;\n }\n else\n {\n return call_user_func(array($conditionClass, $conditionMethod), $this);\n }\n }", "public function makeCheck_In()\n {}", "abstract public function isValid();", "abstract public function isValid();", "public function check () {\n $modelName = $this->field->model->name;\n $fieldName = $this->field->name;\n $bean = $this->field->model->bean;\n $ctx = @$this->field->constraints['context'];\n $update = $ctx ? strpos(\",,{$ctx->value},\", ',update,') : true;\n return $this->dispatch(\n (!$this->value) || ($this->field && $this->field->value) || ($bean->id && !$update),\n \"{$this->field->title} is required\"\n );\n }", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function check() {\n\t\treturn $this->result;\n\t}", "public function check() {\n $field = null;\n $this->_errors = [];\n $fields = $this->_getField();\n\n foreach ($this->_constraints as $constraints) {\n foreach ($fields as $value) {\n switch ($constraints['type']) {\n case self::EQUAL:\n if ($value != $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::DIFFERENT:\n if ($value == $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::MORETHAN:\n if ($value <= $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LESSTHAN:\n if ($value >= $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::BETWEEN:\n if ($value < $constraints['value'][0] || $value > $constraints['value'][1]) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::IN:\n if (!in_array($value, $constraints['value'])) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::NOTIN:\n if (in_array($value, $constraints['value'])) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTH:\n if (strlen($value) != $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTHMIN:\n if (strlen($value) < $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTHMAX:\n if (strlen($value) > $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTHIN:\n if (!in_array(strlen($value), $constraints['value'])) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTHBETWEEN:\n if (strlen($value) < $constraints['value'][0] || strlen($value) > $constraints['value'][1]) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::REGEX:\n if (!preg_match($constraints['value'], $value)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::URL:\n if (!filter_var($value, FILTER_VALIDATE_URL)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::MAIL:\n if (!filter_var($value, FILTER_VALIDATE_EMAIL)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::INT:\n if (!filter_var($value, FILTER_VALIDATE_INT)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::FLOAT:\n if (!filter_var($value, FILTER_VALIDATE_FLOAT)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::ALPHA:\n if (!preg_match('#^([a-zA-Z]+)$#', $value)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::ALPHANUM:\n if (!preg_match('#^([a-zA-Z0-9]+)$#', $value)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::ALPHADASH:\n if (!preg_match('#^([a-zA-Z0-9_-]+)$#', $value)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::IP:\n if (!filter_var($value, FILTER_VALIDATE_IP)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::SQL:\n /** @var $value \\Gcs\\Framework\\Core\\Orm\\Entity\\Entity */\n\n $sql = new Sql();\n $sql->query('query-form-validation', $constraints['value']['query']);\n $sql->vars('value', $value);\n\n if (count($constraints['value']['vars']) > 0) {\n $sql->vars($constraints['value']['vars']);\n }\n\n $data = $sql->fetch('query-form-validation', Sql::PARAM_FETCHCOLUMN);\n\n $querySuccess = true;\n\n switch ($constraints['value']['constraint']) {\n case '==':\n if ($data != $constraints['value']['value']) {\n $querySuccess = false;\n }\n break;\n\n case '!=':\n if ($data == $constraints['value']['value']) {\n $querySuccess = false;\n }\n break;\n\n case '>':\n if ($data <= $constraints['value']['value']) {\n $querySuccess = false;\n }\n break;\n\n case '<':\n if ($data >= $constraints['value']['value']) {\n $querySuccess = false;\n }\n break;\n }\n\n if (!$querySuccess) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::CUSTOM:\n /** @var object[] $constraints */\n if ($constraints['value']->filter() == false) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['value']->error()]);\n }\n break;\n }\n }\n\n switch ($constraints['type']) {\n case self::COUNT:\n if (count($fields) != $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::COUNTMIN:\n if (count($fields) < $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::COUNTMAX:\n if (count($fields) > $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::COUNTIN:\n /** @var array $constraints */\n if (!in_array(count($fields), $constraints['value'])) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::EXIST:\n if (count($fields) == 1 && $fields[0] == null) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::NOTEXIST:\n if (count($fields) == 1 && $fields[0] != null) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n }\n }\n }", "protected function check($item){\r\n\tif((string)$item->row->attributes()->system_type=='bool'){\r\n\t\t$postdata = !isset($this->sourceData['meta_value_'.(string)$item->row->name]) ? 0: 1;\r\n\t}else{\r\n\t\t$postdata = (string)$item->row->attributes()->system_type=='password' ? array($this->sourceData['meta_value_'.(string)$item->row->name], $this->sourceData['meta_value_'.(string)$item->row->name.'_check']):$this->sourceData['meta_value_'.(string)$item->row->name];\r\n\t}\r\n\tif((int)$item->row->attributes()->validate == 1){\r\n\t\t$ret = DataValidator::validateData($postdata, (string)$item->row->attributes()->system_type, (int)$item->row->attributes()->size) === true ? 'ok': 'v';\r\n\t\t\r\n\t\t$tpref = Lng::get('system/mwms_meta_datatype_operators');\r\n\t\t\r\n\t\t$operator = $tpref[(string)$item->row->attributes()->system_type];\r\n\t\t\r\n\t\tif((int)$item->row->attributes()->unique == 1 && $ret == 'ok'){\r\n\t\t\t$ret = $ret=='ok' && $this->unique($item, $this->sourceData['meta_value_'.(string)$item->row->name], $operator) ? 'ok': 'u';\r\n\t\t}\r\n\t\t\r\n\t\tif(!$ret){\r\n\t\t\t$show = is_array($postdata) ? implode(\"/\", $postdata): $postdata;\r\n\t\t\t//echo $item->row->title.'(@'.$item->row->name.') -> '.$item->row->attributes()->system_type.' -> '.$postdata.'<br />';\r\n\t\t}\r\n\t\t\r\n\t\treturn $ret;\r\n\t}else{\r\n\t\treturn 'ok';\r\n\t}\r\n}", "abstract protected function validate(): bool;", "public function checkValidity()\n { \t\n \treturn true;\n }", "public function check($id);", "public function check(Resource $resource);", "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 }", "abstract public function validate(): bool;", "public function check() {\n\t\t$values = array($this->value);\n\t\tif ($this->value == 'On') {\n\t\t\t$values[] = '1';\n\t\t}\n\t\telseif ($this->value == 'Off') {\n\t\t\t// TODO check it, empty is default value\n\t\t\t$values[] = '';\n\t\t\t$values[] = '0';\n\t\t}\n\t\tif (!in_array(ini_get($this->name), $values)) {\n\t\t\t$this->log('Setting '.$this->name.'='.ini_get($this->name).'. \"'.$this->value.'\" is required', Project::MSG_ERR);\n\t\t\treturn 1;\n\t\t}\n\t\t\n\t\t$this->log('Setting '.$this->name.' is passed', Project::MSG_VERBOSE);\n\t\treturn 0;\n\t}", "public function check()\t{\n\t\treturn ! is_null($this->user());\n\t}", "public function check() {\n return $this->structure->check();\n }", "abstract public function isValid($data);", "public function check() : bool\n\t{\n\t\tif (!$this->enabled) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn $this->handle->check();\n\t}", "public function testCheck()\n {\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->check('128.232.234.256');\n $this->assertIsArray($t);\n $this->assertEquals(3, count($t));\n $this->assertEquals('deny', $t['status']);\n unset($ipComponent, $t);\n\n // Test 2. Check denied list.\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $ipComponent->setDeniedItem('127.0.55.44');\n $t = $ipComponent->check('127.0.55.44');\n\n $this->assertIsArray($t);\n $this->assertEquals(3, count($t));\n $this->assertEquals('deny', $t['status']);\n unset($ipComponent, $t);\n\n // Test 3. Check allowed list.\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $ipComponent->setAllowedItem('39.9.197.241');\n $t = $ipComponent->check('39.9.197.241');\n\n $this->assertIsArray($t);\n $this->assertEquals(3, count($t));\n $this->assertEquals('allow', $t['status']);\n unset($ipComponent, $t);\n\n // Test 4. Check IP is if in denied IP range.\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $ipComponent->setDeniedItem('127.0.55.0/16');\n $t = $ipComponent->check('127.0.33.1');\n $this->assertIsArray($t);\n $this->assertEquals(3, count($t));\n $this->assertEquals('deny', $t['status']);\n unset($ipComponent, $t);\n\n // Test 5. Check IP is if in allowed IP range.\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $ipComponent->setDeniedItem('127.0.55.0/16');\n $ipComponent->setAllowedItem('127.0.55.0/16');\n $t = $ipComponent->check('127.0.33.1');\n $this->assertIsArray($t);\n $this->assertEquals(3, count($t));\n $this->assertEquals('allow', $t['status']);\n unset($ipComponent, $t);\n\n // Test 6. Test denyAll\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $ipComponent->denyAll();\n $t = $ipComponent->check('127.0.33.1');\n $this->assertIsArray($t);\n $this->assertEquals(3, count($t));\n $this->assertEquals('deny', $t['status']);\n unset($ipComponent, $t);\n }", "protected function _isValid()\n {\n $class = get_called_class();\n $methods = get_class_methods($class);\n \n foreach($methods as $method) {\n if(strcasecmp(substr($method, 0, 9), 'validates') === 0)\n {\n $value = $this->_getter(strtolower(substr($method, 9)));\n if($error = $this->{$method}($value) !== true)\n {\n return $error;\n }\n }\n }\n\n return true; \n }", "public function check(IUser $user);", "public abstract function validation();", "public function check(): bool\n {\n return $this->adapter->check();\n }", "public function isValidationPassed();", "function _inputCheck(){\n if (isset($_POST['verder']) && $this->_verify() == \"\") {\n return true;\n }\n else {\n return false;\n }\n }", "public function checks() {\n\t\tif ( 'no' === $this->enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// PHP Version\n\t\tif ( version_compare( phpversion(), '5.3', '<' ) ) {\n\t\t\techo '<div class=\"error\"><p>' . sprintf( __( 'Simplify Commerce Error: Simplify commerce requires PHP 5.3 and above. You are using version %s.', 'woocommerce' ), phpversion() ) . '</p></div>';\n\t\t}\n\n\t\t// Check required fields\n\t\telseif ( ! $this->public_key || ! $this->private_key ) {\n\t\t\techo '<div class=\"error\"><p>' . __( 'Simplify Commerce Error: Please enter your public and private keys', 'woocommerce' ) . '</p></div>';\n\t\t}\n\t}", "public function check()\n {\n return ! $this->guest();\n }", "function check() {\n\n // TODO check for valid strings\n return true;\n }", "protected function validate()\n {\n }", "function CheckCondition()\n\t{\n\t\treturn true;\n\t}", "public function getCheck()\n {\n return $this->check;\n }", "public function check() : int\n {\n\n /**\n * @return invalid request(1) if a code is empty ,null or undefined,\n * if not continue the next execution\n */\n\n if(!$this->code) return INVALID_REQUEST;\n\n\n /** @var $is_valid check the specified code is equal and valid */\n\n $is_valid = database::getInstance()->has('user',[\n\n \"id\" => (new Users())->get_id(),\n\n \"verification_code\" => $this->code\n\n ]);\n\n /** validation */\n\n if($is_valid) {\n\n /** @var $success if a specified code is valid\n * update the current status of \"isVerify\" attribute of a database\n * to PHONE_NUMBER_VERIFIED(1) and\n * @return the number of affected rows\n */\n\n $success = database::getInstance()->update('user',['isVerify'=>user_type::PHONE_NUMBER_VERIFIED],[\n\n \"id\"=> (new Users())->get_id()\n\n ])->rowCount();\n\n /** if has a affeted rows return valid request(2), invalid request if not */\n\n return $success ? VALID_REQUEST : INVALID_REQUEST;\n\n }\n\n\n /** return invalid request(1) if a code is not equal */\n\n return INVALID_REQUEST;\n\n\n\n }", "function callback_multicheck(array $args)\n {\n }", "protected function _validate() {\n\t}", "function isValid() ;", "abstract protected function checkValue( &$value );", "public function check()\n\t{\n\t\treturn ! is_null($this->user());\n\t}", "abstract protected function validate($data);", "abstract public function valid();", "abstract public function runValidation();", "abstract public function validate();", "abstract public function validate();", "public static function check()\n {\n return !is_null(static::user());\n }", "public function isValid() {\n $paramsList = func_get_args();\n $numParams = func_num_args();\n\n switch($numParams) {\n case 0: \n $result = $this->doRevalidation();\n break;\n case 1:\n if( $paramsList[0] ) { // $isRevalidation = true\n $result = $this->doRevalidation();\n } else {\n $result = $this->doValidation();\n }\n break;\n }\n\n return $result;\n }", "public function check($callIfSuccess = null, $callIfFail = null)\r\n {\r\n return parent::check([$this, 'callbackSuccess'], [$this, 'callbackFail']);\r\n }", "abstract function validator();", "protected function validate_request_permission($check)\n {\n }", "public function check()\n {\n $calculator = new Calculator($this->subject, array(\n 'omocodiaLevel' => $this->omocodiaLevel,\n ));\n if ($this->omocodiaLevel == self::ALL_OMOCODIA_LEVELS) {\n $values = $calculator->calculateAllPossibilities();\n } else {\n $values = array($calculator->calculate());\n }\n\n return in_array($this->codiceFiscaleToCheck, $values);\n }" ]
[ "0.83209395", "0.82648146", "0.79760754", "0.7949678", "0.7949678", "0.7949678", "0.7949678", "0.7949678", "0.76319236", "0.7579245", "0.7518036", "0.75065804", "0.75065804", "0.7316374", "0.7316374", "0.68434405", "0.6819443", "0.68134", "0.66300726", "0.64645606", "0.6405093", "0.6353734", "0.63247967", "0.62679964", "0.6252715", "0.6226377", "0.62262917", "0.62262917", "0.62262917", "0.62262917", "0.62262917", "0.6226106", "0.6226106", "0.61973536", "0.617743", "0.6174532", "0.6111578", "0.61106837", "0.6096344", "0.6096344", "0.60350406", "0.6013081", "0.6013081", "0.6013081", "0.6013081", "0.6013081", "0.6013081", "0.6013081", "0.6013081", "0.6013081", "0.6013081", "0.6013081", "0.6013081", "0.6013081", "0.6013081", "0.6013081", "0.6013081", "0.60022527", "0.59998834", "0.5992413", "0.59482557", "0.59406424", "0.5927561", "0.59228945", "0.59193003", "0.5913436", "0.59005266", "0.5888537", "0.5870126", "0.58412504", "0.5818664", "0.5816243", "0.58045727", "0.58018214", "0.58008987", "0.578366", "0.57673717", "0.5743436", "0.57376665", "0.57321537", "0.5715612", "0.5706317", "0.5701388", "0.57012993", "0.56981856", "0.56847095", "0.56780636", "0.56710094", "0.5670356", "0.56557316", "0.5653771", "0.56520814", "0.56504333", "0.564447", "0.564447", "0.56433207", "0.56418407", "0.5638881", "0.56381094", "0.5634554", "0.5632215" ]
0.0
-1
Callback for submitbutton. Saves a user in DB.
public function callbackSubmit() { $this->exception = null; $this->acronym = $this->Value('acronym'); $now = gmdate('Y-m-d H:i:s'); $this->newUser = new \Anax\Users\User(); $this->newUser->setDI($this->di); if ($this->isAcronymAvailable($this->newUser, $this->acronym)) { try { $isSaved = $this->newUser->save(array( 'acronym' => $this->Value('acronym'), 'firstName' => $this->Value('firstName'), 'lastName' => $this->Value('lastName'), 'town' => $this->Value('town'), 'email' => $this->Value('email'), 'gravatar' => 'http://www.gravatar.com/avatar/' . md5(strtolower(trim($this->Value('email')))) . '.jpg', 'password' => password_hash($this->Value('password'), PASSWORD_DEFAULT), 'activityScore' => 0, 'numVotes' => 0, 'created' => $now )); } catch (\Exception $e) { $this->exception = $e; $isSaved = false; } } else { $this->errorMessage = "<p><i>Akronym är redan upptaget, välj ny akronym!</i></p>"; $isSaved = false; } return $isSaved; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function doUserSubmit() {\n\t\tif (@isset( $_REQUEST ['id'] )) {\n\t\t\t$user = new User($_REQUEST['id']);\n\t\t\tif ($_REQUEST['a_password'] != '') {\n\t\t\t\t$user->setPassword($_REQUEST['a_password']);\n\t\t\t}\n\t\t} else {\n\t\t\t$user = new User();\n\t\t\t$user->setPassword($_REQUEST['a_password']);\n\t\t\t\t\n\t\t}\n\t\t$user->setUsername($_REQUEST['a_username']);\n\t\t$user->setName($_REQUEST['a_name']);\n\t\t$user->setEmail($_REQUEST['a_username']);\n\t\t$user->setJoinNewsletter(@$_REQUEST['a_join_newsletter']);\n\t\tif (isset($_REQUEST['a_group'])) {\n\t\t\t$user->setAuthGroup($_REQUEST['a_group']);\n\t\t} else {\n\t\t\t$user->setAuthGroup(2);\n\t\t}\n\t\tif (isset($_REQUEST['a_status'])) {\n\t\t\t$user->setActiveStatus($_REQUEST['a_status']);\n\t\t} else {\n\t\t\t$user->setActiveStatus(1);\n\t\t}\n\t\t$user->save();\n\n\t\t$this->setupMainList();\n\t\t$this->template = 'admin/user_table.tpl';\n\t}", "public function saveButtonClicked($sender,$param)\r\n {\r\n if($this->IsValid) // when all validations succeed\r\n {\r\n // Retrieves the existing user data. This is equivalent to:\r\n $userRecord=$this->UserRecord;\r\n \r\n // Fetches the input data\r\n $userRecord->user_username=$this->Username->Text;\r\n // update password when the input is not empty\r\n if(!empty($this->Password->Text))\r\n $userRecord->user_password=$this->Password->Text;\r\n $userRecord->user_mail=$this->Email->Text;\r\n // update the role if the current user is an administrator\r\n if($this->User->IsAdmin)\r\n $userRecord->idtm_user_role=(int)$this->Role->SelectedValue;\r\n $userRecord->user_vorname=$this->FirstName->Text;\r\n $userRecord->user_name=$this->LastName->Text;\r\n \r\n // saves to the database via Active Record mechanism\r\n $userRecord->save();\r\n \r\n // redirects the browser to the homepage\r\n $this->Response->redirect($this->Service->DefaultPageUrl);\r\n }\r\n }", "public function saveUser()\n {\n $connection = \\Yii::$app->db;\n $command = $connection->createCommand()\n ->update('users', [\n 'name' => $this->name,\n 'email' => $this->email,\n ], 'id='.$this->id);\n $command->execute();\n }", "function saveuser(){\n \t\t\tif (isset($_POST['UserID'])){\n \t\t\t\t$UserID = base64_decode($_POST['UserID']);\n \t\t\t\t$this->Users->UpdateUser($UserID);\n \t\t\t}else{\n \t\t\t\t$UserID = $this->Users->AddNewUser();\n \t\t\t\t$this->Users->AddUserToCompany($UserID);\n \t\t\t}\n \t\t\t$this->Flash->error(__('UserSaved', true));\n \t\t\t$this->Redirect('/users/edituser/'.base64_encode($UserID));\n \t\t}", "public function save()\n {\n $this->validate();\n $this->user->save();\n\n $this->toast('Your information has been updated!', 'success');\n }", "public function save_user()\n\t{\n $user= new Users();\n $user->setNom($_POST['nom']);\n $user->setPrenom($_POST['prenom']);\n $user->setDate_naissance($_POST['date_naiss']);\n $user->setEmail($_POST['mail']);\n $user->setPassword($_POST['pwd']); \n\n $user->Create_user();\n\t}", "public function saving(User $user)\n {\n //\n }", "public function saved(User $user)\n {\n //\n }", "public function save()\n {\n if ($this->uid)\n {\n $query = sprintf('UPDATE %sUSER SET USERNAME = \"%s\", ' .\n 'PASSWORD = \"%s\", EMAIL_ADDR = \"%s\", IS_ACTIVE = %d ' .\n 'WHERE USER_ID = %d',\n DB_TBL_PREFIX,\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n $this->isActive,\n $this->userId);\n mysql_query($query, $GLOBALS['DB']);\n }\n else\n {\n $query = sprintf('INSERT INTO %sUSER (USERNAME, PASSWORD, ' .\n 'EMAIL_ADDR, IS_ACTIVE) VALUES (\"%s\", \"%s\", \"%s\", %d)',\n DB_TBL_PREFIX,\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n $this->isActive);\n mysql_query($query, $GLOBALS['DB']);\n\n $this->uid = mysql_insert_id($GLOBALS['DB']);\n }\n }", "public function addUser()\n {\n $categoryList = $this->itemModel->getCategories();\n\n //Check that register button exists and was clicked\n if (isset($_POST[\"user_submit\"])) { \n\n //Insert new row in Account and setting the User's name in database using values inputted in the HTML form\n $username = $_POST['username']; \n\n $newly_registered_account_id = $this->accountModel->registerAccount($username,$_POST[\"password\"],$_POST[\"sfsu_id\"]);\n\n $this->userModel->setUser($newly_registered_account_id,$_POST[\"firstname\"], \n $_POST[\"lastname\"],$_POST[\"country\"],$_POST[\"state\"],\n $_POST[\"address\"],$_POST[\"city\"],$_POST[\"zipcode\"],$_POST[\"phoneNumber\"]);\n\n } else {\n echo '<script language=\"javascript\">';\n echo 'alert(\"accounts.php registerUser bad.\")';\n echo '</script>';\n }\n\n header('location: ' . URL . 'home/index');\n }", "public function save()\n {\n if ($this->id)\n {\n $query = sprintf('UPDATE USERS SET USERNAME = \"%s\", ' .\n 'PASSWORD = \"%s\", EMAIL_ADDR = \"%s\", FIRST_NAME = \"%s\", LAST_NAME = \"%s\", IS_ACTIVE = %d ' .\n 'WHERE USER_ID = %d',\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n mysql_real_escape_string($this->firstName, $GLOBALS['DB']),\n mysql_real_escape_string($this->lastName, $GLOBALS['DB']),\n $this->isActive,\n $this->id);\n mysql_query($query, $GLOBALS['DB']);\n }\n else\n {\n $query = sprintf('INSERT INTO USERS (USERNAME, PASSWORD, ' .\n 'EMAIL_ADDR, FIRST_NAME, LAST_NAME, IS_ACTIVE) VALUES (\"%s\", \"%s\", \"%s\", \"%s\", \"%s\", %d)',\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n mysql_real_escape_string($this->firstName, $GLOBALS['DB']),\n mysql_real_escape_string($this->lastName, $GLOBALS['DB']),\n $this->isActive);\n mysql_query($query, $GLOBALS['DB']);\n\n $this->id = mysql_insert_id($GLOBALS['DB']);\n }\n }", "public function saveNewUser() {\n\t\t$db = $this->getDatabaseConnection();\n\n\t\t// Prepare the SQL\n\t\t$sql =\"INSERT INTO users (email, password, first_name, last_name, username)\n\t\t\t\tVALUES (:email, :password, :first_name, :last_name, :username)\";\n\n\t\t$statement = $db->prepare($sql);\n\n\t\t// Bind the form data to the SQL query\n\t\t$statement->bindValue(':email', $_POST['email']);\n\t\t$statement->bindValue(':password', $_POST['password']);\n\t\t$statement->bindValue(':first_name', $_POST['first_name']);\n\t\t$statement->bindValue(':last_name', $_POST['last_name']);\n\t\t$statement->bindValue(':username', $_POST['username']);\n\n\t\t// Run the query\n\t\t$result = $statement->execute();\n\n\t\t//Confirm tht it worked\n\t\tif( $result == true) {\n\t\t\t// Yay!\n\n\t\t\t$_SESSION['user_id'] = $db->lastInsertID();\n\t\t\t$_SESSION['privilege'] = 'user';\n\t\t\t$_SESSION['first_name'] = $_POST['first_name'];\n\t\t\t$_SESSION['last_name'] = $_POST['last_name'];\n\t\t\t$_SESSION['username'] = $_POST['username'];\n\t\t\t$_SESSION['email'] = $_POST['email'];\n\n\t\t\theader('Location: index.php?page=account');\n\t\t} else {\n\t\t\t// Uh oh...\n\t\t}\n\n\t\t//If it did, log the user in and redirect to their \n\t\t// new account page\n\t}", "public function saveAction(){\n\t\t$request = $this->_request->getParams();\n\t\t$oValidationHelper = new Helpers_Usermanagement_Validate();\n\t\t\n\t\t$error = false;\n\t\tif(!$oValidationHelper->ifEmailAvailable($request['user_email'],$this->_auth->user_id)){\n\t\t\t$error = true;\n\t\t\t$this->_messages->setMessage('User with such email already exists','error','user_email');\n\t\t}\n\n\t\tif(!$oValidationHelper->ifUsernameAvailable($request['user_login'],$this->_auth->user_id)){\n\t\t\t$this->_messages->setMessage('User with such username already exists','error','user_login');\n\t\t\t$error = true;\n\t\t}\n\t\t\t\t\n\t\tif($this->_validator->validate('registration_form',$request) && !$error){\n\t\t\t\n\t\t\tif($request['user_email']!=$this->_auth->user_email){\n\t\t\t\t$request['user_confirmation_code'] = md5(time()+rand(10000,99999));\n\t\t\t\t$request['user_active'] = 0;\n\t\t\t\t$this->_sendConfirmationEmail($request['user_email'],$request['user_login'],$request['user_confirmation_code']);\n\t\t\t\t$this->_messages->setMessage('WARNING!!! Your email has been changed and your account has been disabled. Instructions on how to activate account were sent to you','error');\n\t\t\t}\n\t\t\t\n\t\t\t$request['user_id'] = $this->_auth->user_id;\n\t\t\t$oUsers = new Models_Usermanagement_Users();\n\t\t\t$oUsers->updateEntry($request);\t\t\t\n\t\t\t\n\t\t\t$this->_messages->setMessage('Account has been updated');\n\t\t\t$this->_redirect('/usermanagement/profile/generaldataform/');\n\t\t}else{\n\t\t\tforeach ( $this->_validator->getErrors () as $field=>$error ) {\n\t\t\t\t$this->_messages->setMessage ( $error, 'error' , $field);\n\t\t\t}\n\t\t\t$this->_redirect('/usermanagement/profile/generaldataform/?error=1');\n\t\t}\n\t}", "public function callbackSubmit()\n {\n $this->user = new \\Anax\\Users\\User();\n $this->user->setDI($this->di);\n\n if (isset($_SESSION[\"user\"])) {\n unset($_SESSION[\"user\"]);\n return $this->isLogoutSuccessful();\n } else {\n $this->logoutMessage = \"Du är inte inloggad!\";\n return false;\n }\n }", "function save() {\n $conn = \\DB\\getConnection();\n\n $query = sprintf(\"INSERT INTO Payments (uid, typeid, token, amount)\n VALUES (%u, %u, '%s', %f)\",\n $this->uid, $this->typeid, $conn->escape_string($this->token), $this->amount);\n\n \n\n $result = $conn->query($query);\n\n // If this is a newly created user, then update the id with the\n // newly created one\n if (!isset($this->id)) {\n $this->id = $result->insert_id;\n }\n }", "protected function save() {\n $factory = I2CE_FormFactory::instance();\n if ($this->creatingNewUser()) {\n if ( !$this->hasPermission('task(users_can_edit)')) {\n return false;\n }\n if (!$this->userObj instanceof I2CE_User_Form || !($username = $this->userObj->username) ) {\n return false;\n }\n $accessMech = I2CE::getUserAccess();\n if ($accessMech->userExists($username,false)) {\n I2CE::raiseError(\"Trying to recreate existing user : \" .$username);\n return false;\n }\n if (I2CE_User::hasDetail('creator')) {\n $this->userObj->creator = $this->user->username;\n }\n }\n\n $username = $this->userObj->username;\n $password = $this->userObj->password;\n $parent = $this->userMapObj->getField(\"parent\")->getValue();\n $personObj = $factory->createContainer($parent);\n $personObj->populate();\n $emails = LBBoards_Module_Qualify::getPersonEmail($parent);\n $emails = implode(\",\", $emails);\n $fname = $personObj->getField(\"firstname\")->getValue();\n $body = \"Hi $fname<br> We have created your account on the License Board online system, your username is $username and your password is $password. Please change your password after first login\";\n $subject = \"Account For License Board Online System\";\n LBBoards_Module_Qualify::sendEmail($emails, $subject, $body);\n return parent::save();\n }", "function save_user_object($user){\r\n\r\n}", "function save_user() {\n $this -> load -> library(array('form_validation', 'session'));\n $this -> form_validation -> set_rules('user_firstname', 'nombre', \"required|trim\");\n $this -> form_validation -> set_rules('user_lastname', 'apellido', \"required|trim\");\n $this -> form_validation -> set_rules('user_email', 'email', \"required|trim|valid_email\");\n $this -> form_validation -> set_rules('user_email2', 'confirmar email', \"required|trim|valid_email|matches[user_email]\");\n $this -> form_validation -> set_rules('user_password', 'contraseña', (!$this -> input -> post('user_id') ? 'required|' : '') . \"trim|min_length[4]\");\n $this -> form_validation -> set_rules('user_password2', 'confirmar contraseña', (!$this -> input -> post('user_id') || trim($this -> input -> post('user_password')) != '' ? 'required|' : '') . \"trim|matches[user_password]\");\n\n if ($this -> form_validation -> run() == TRUE) {\n if (trim($this -> input -> post('user_password')) == '')\n unset($_POST['user_password']);\n unset($_POST['user_password2']);\n unset($_POST['user_email2']);\n if (!$this -> input -> post('user_id'))\n $_POST['user_created'] = date('Y-m-d G:i:s');\n $data = $this -> basic -> save('users', 'user_id', $this -> input -> post());\n $response['js'] = 'window.top.location.href=\"' . site_url('front_login/perfil') . '\"';\n } else {\n $response['html'] = validation_errors();\n $response['error'] = '1';\n }\n\n echo json_encode($response);\n }", "public function Save()\r\n\t\t{\r\n\t\t\t$db = new Db();\r\n\t\t\t$sql = \"INSERT INTO tbl_users (naam, voornaam, email, wachtwoord)\r\n\t\t\tVALUES ('\".$db->conn->real_escape_string($this->m_sName).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sFirstname).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sEmail).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sPassword).\"'\r\n\t\t\t)\";\r\n\t\t\t$db->conn->query($sql);\r\n\r\n\t\t\t//user_id van de geregistreerde gebruiker in de session variabele opslaan\r\n\t\t\t$user_id = $db->conn->insert_id;\r\n\t\t\t$_SESSION['user_id'] = $user_id;\r\n\t\t}", "protected function _index_submit()\n\t{\n\t\t$user = user_get_account_info();\n\n\t\t$security_method = $this->input->post('method');\n\n\t\tmodel('user')->update($user->id, compact('security_method'));\n\t}", "public function save() {\n\t\t$data = array(\n\t\t\t\t\"user\" => array(\n\t\t\t\t\t\t\"email\" => $this->_data[\"email\"],\n\t\t\t\t)\n\t\t);\n\t\t\n\t\t// kontrola zmeny hesla\n\t\tif (in_array(\"password\", $this->_changed)) $data[\"user\"][\"password\"] = $this->_data[\"password\"];\n\t\t\n\t\t// odeslani dat\n\t\t$response = $this->_connection->sendRequest(self::OBJECT, \"put\", $this->_data[$this->_identifier], $data, \"post\");\n\t}", "public function saveAction() {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"users\",\n \"action\" => \"index\"\n ));\n }\n\n $id = $this->request->getPost(\"id\");\n\n $user = Users::findFirstByid($id);\n if (!$user) {\n $this->flash->error(\"user does not exist \" . $id);\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"users\",\n \"action\" => \"index\"\n ));\n }\n\n $user->id = $this->request->getPost(\"id\");\n $user->name = $this->request->getPost(\"name\");\n $user->email = $this->request->getPost(\"email\", \"email\");\n $user->password = $this->request->getPost(\"password\");\n $user->mustChangePassword = $this->request->getPost(\"mustChangePassword\");\n $user->status = $this->request->getPost(\"status\");\n\n\n if (!$user->save()) {\n\n foreach ($user->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"users\",\n \"action\" => \"edit\",\n \"params\" => array($user->id)\n ));\n }\n\n $this->flash->success(\"user was updated successfully\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"users\",\n \"action\" => \"index\"\n ));\n }", "public function callbackSubmit()\n {\n // Get values from the submitted form\n $text = $this->form->value(\"text\");\n\n if (!$this->di->get('session')->has(\"user\")) {\n $this->form->addOutput(\"Du behöver logga in\");\n return false;\n }\n\n $user = new User($this->di->get(\"db\"));\n if ($user->controlAuthority($this->di->get('session')->get(\"user\"), $this->post->user) != true) {\n $this->form->addOutput(\"Du får inte redigera denna.\");\n return false;\n }\n\n if ($text == \"\") {\n $this->form->addOutput(\"Du skrev aldrig något. Skriv gärna något.\");\n return false;\n }\n\n $this->post->text = $text;\n $this->post->save();\n $this->form->addOutput(\"Du har uppdaterat inlägget\");\n return true;\n }", "function addsubmit() \n\t{\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n\n \n // Use the add action's post form variables and the current precise time to insert an article.\n // validate all post variables before inserting them to avoid a\n // SQL Injection attack and ensure that we've working with clean data. \n\t\t$email=$_POST['email'];\n\t\t$password=$_POST['password'];\n\t\ttry\n\t\t{\n\t\t if (!empty($_POST['username'])&& !empty($_POST['firstname'])&& !empty( $_POST['role']) && !empty($_POST['email']) && !empty($_POST['password']))\n\t\t { \n\t\t\t$result= UserModel::Create()->InsertUser($_POST['username'],$_POST['email'], $password, $_POST['firstname'],$_POST['middlename'],$_POST['lastname'],$_POST['role'], $_POST['phoneres'], $_POST['phonecell'], $_POST['status'], $_POST['comments']);\n\t\t\t\n\t\t\tif(empty($result))\n\t\t\t{\n\t\t\t\t$this->viewData['module']=\"Add User\";\n\t\t\t\t$this->viewData['error']= \"Failed to Add the user\";\n\t\t\t\t$this->renderWithTemplate('common/error', 'AdminPageBaseTemplate');\n\t\t\t}\n\t\t\telse // invite the user by sending email \n\t\t\t{\n\t\t\t\tMailModel::SendInvitation($_POST['email'], $_POST['firstname'],$result);\n\t\t\t\t$this->renderWithTemplate('users/addsubmit', 'AdminPageBaseTemplate');\n\t\t\t}\n\t\t }\n\t\t}\n\t\tcatch (Exception $ex)\n\t\t{\n\t\t\t$this->viewData['module']=\"Add User\";\n\t\t\t$this->viewData['error']= $ex->getMessage();\n\t\t\t$this->renderWithTemplate('common/error', 'AdminPageBaseTemplate');\n\t\t}\n\t\t\n\t}", "public function SaveAsUser()\r\n\t\t{\r\n\t\t\t$db = new Db();\r\n\t\t\t$id = $_SESSION['a_restaurant_id'];\r\n\t\t\t$sql = \"INSERT INTO tbl_reservaties (klantnaam, aantalpersonen, datum, uur, tafel_id)\r\n\t\t\tVALUES ('\".$db->conn->real_escape_string($this->m_sName).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_iPersonen).\"',\r\n\t\t\t\t\tSTR_TO_DATE('\".$db->conn->real_escape_string($this->m_dDate).\"', '%e-%m-%Y'),\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_iUur).\"',\r\n\t\t\t\t\t(SELECT tafel_id FROM tbl_tafels WHERE tafelnr = \".$db->conn->real_escape_string($this->m_iTable).\" AND restaurant_id = $id\r\n\t\t\t))\";\r\n\t\t\t$db->conn->query($sql);\r\n\t\t\t\r\n\t\t}", "function save() {\n\n $record = new stdClass;\n $record->username = $this->username;\n $record->firstname = addslashes($this->firstname);\n $record->lastname = addslashes($this->lastname);\n $record->idnumber = $this->idnumber;\n $record->update_flag = $this->update_flag;\n $record->reg_status = $this->reg_status;\n $record->college = $this->college;\n $record->year = $this->year;\n $record->classification = $this->classification;\n $record->keypadid = $this->keypadid;\n $record->ferpa= $this->ferpa;\n $record->anonymous = $this->anonymous;\n $record->degree_candidacy = $this->degree_candidacy;\n\n if ($this->hidden != null) {\n $record->hidden = $this->hidden;\n }\n if ($this->numsections != null) {\n $record->numsections = $this->numsections;\n }\n if ($this->format != null) {\n $record->format= $this->format;\n }\n if ($this->cr_delete != null) {\n $record->cr_delete = $this->cr_delete;\n }\n if ($this->moodleid != null) {\n $record->moodleid = $this->moodleid;\n }\n\n if (!$this->id) {\n\n $this->id = insert_record('block_courseprefs_users', $record, true);\n\n if (!$this->id) {\n throw new Exception('Unable to create new courseprefs user within database');\n }\n\n } else {\n\n $record->id = $this->id;\n\n if (!update_record('block_courseprefs_users', $record)) {\n throw new Exception('Unable to update existing courseprefs user within database');\n }\n }\n }", "public static function save(User $user)// statiska funkcija, lai nevajadzetu taisit klases objektu\n {\n }", "public function save() {\n\n if( isset( $_POST ) ) {\n // Set user id for add\n $id = null;\n // Set null if empty value\n $_POST['email'] = replace_empty_with_null( $_POST['email'] );\n // Update mode\n if( $_POST['userId'] != '' ) {\n // Set user id for update\n $id = $_POST['userId'];\n // Check if update password form is trigger\n if( isset( $_POST['password'] ) ) {\n $_POST['password'] = $this->user_model->hash( $_POST['password'] ); \n unset( $_POST['confirm_password'] ); \n } else {\n $_POST['firstName'] = ucfirst( $_POST['firstName'] );\n $_POST['surname'] = ucfirst( $_POST['surname'] );\n $_POST['initials'] = ucfirst( $_POST['initials'] );\n }\n } else {\n\n $_POST['password'] = $this->user_model->hash( $_POST['password'] );\n $_POST['firstName'] = ucfirst( $_POST['firstName'] );\n $_POST['surname'] = ucfirst( $_POST['surname'] );\n $_POST['initials'] = ucfirst( $_POST['initials'] );\n\n }\n \n $this->user_model->save( $_POST, $id );\n echo \"true\";\n } else {\n echo \"error\";\n }\n\n }", "public function save()\n\t{\n\t\t// Verifier le login\n\t\t$login = $this->getValue('login');\n\t\t$id = $this->getValue('id');\n\t\tif ( $this->checkLogin($login, $id) )\n\t\t{\n\t\t\t$this->_error(LOC_MSG_LOGIN_EXIST . '(' . $login . ')');\n\t\t\treturn false;\n\t\t}\n\n\t\t// Enregistrer les donnees\n\t\t$where = 'user_id=' . $id;\n\t\t$id = $this->update('users', 'user_', $this->getValues(), $where);\n\t\treturn $id;\n\t}", "public function Save() {\n $this->db->ExecuteQuery(self::SQL('update profile'), array($this['name'], $this['email'], $this['id']));\n $this->session->SetAuthenticatedUser($this->profile);\n return $this->db->RowCount() === 1;\n }", "public function saveUser()\n {\n $this->_initUser();\n\n $this->generateSecurePassword();\n\n return $this->save(\n [\n 'username' => $this->username,\n 'password' => $this->password,\n 'salt' => $this->_salt,\n 'email' => $this->email,\n 'name' => $this->name,\n 'lastname' => $this->lastname,\n 'sw_active' => 1\n ], true\n );\n }", "public function Save() {\n// \t$this->db->ExecuteQuery(self::SQL('update profile'), array($this['name'], $this['email'], $this['id']));\n \t\t$this->db->ExecuteQuery(self::SQL('update profile'), array($this['name'], $this['email'], $this['id']));\n\t $this->session->SetAuthenticatedUser($this->profile);\n \treturn $this->db->RowCount() === 1;\n \t}", "public function save()\n {\n $user_id = Yii::$app->session->getFlash('validatedUserId');\n if ($this->validate() && ( $user = User::findOne($user_id)) !== null ) {\n // Hashing user password before saving it to the DB\n // http://www.yiiframework.com/doc-2.0/guide-security-passwords.html\n $user->password = Yii::$app->getSecurity()->generatePasswordHash($this->password);\n $user->active = '1';\n // Generates a new auth key to avoid the previous one from being used\n $user->auth_key = Yii::$app->security->generateRandomString();\n // Save DB record\n return $user->save();\n }\n return false;\n }", "function doSavePlayer() {\n\t\tif(!LibTools::isAdmin()) {\n\t\t\treturn;\n\t\t}\n\t\t$savePlayer = $_POST['savePlayer'];\n\t\t$pseudo = $savePlayer[\"pseudo\"];\n\t\t$prenom = $savePlayer[\"prenom\"];\n\t\t$nom \t= $savePlayer[\"nom\"];\n\t\t$mail\t= $savePlayer[\"mail\"];\n\t\t$tel\t= $savePlayer[\"tel\"];\n\t\t\n\t\tSs::get()->dao->playerDao->save($this->id, $pseudo, $prenom, $nom, $mail, $tel);\n\t}", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'username' => $this->username,\n 'password_hash' => $this->password_hash,\n 'email' => $this->email,\n 'first_name' => $this->first_name,\n 'last_name' => $this->last_name,\n 'user_type' => $this->user_type,\n 'bio' => $this->bio,\n 'creation_date' => $this->creation_date,\n 'gender' => $this->gender,\n 'color' => $this->color\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function saveUser($user) {\n if(empty($user->user_id)){\n $this->dao->insertUser($user);\n } else {\n $this->dao->updateUser($user, $user->user_id); \n }\n }", "public function saveProfile()\n\t{\n\t\tif (isset($_REQUEST['username'])) {\n\t\t\t$username = trim($_REQUEST['username']);\n\t\t\t$fbuid = $this->getFBUID();\n\t\t\tif (isset($_POST['sub_clear'])) { $username = ''; }\n\t\t\tif ($username) {\n\t\t\t\t$result = $this->db->exec(\"INSERT IGNORE INTO selective_status_users (fbuid, twitterid) VALUES (\" . $this->db->quote($fbuid) . \", \" . $this->db->quote($username) . \");\");\n\t\t\t}\n\t\t\t$result = $this->db->exec(\"UPDATE selective_status_users SET twitterid = \" . $this->db->quote($username) . \", is_page = 0 WHERE fbuid = \" . $this->db->quote($fbuid) . \" LIMIT 1\");\n\t\t\treturn true;\n\t\t}\n\t}", "public function save($user) {\n\n\t\t$stmt = $this->db->prepare(\"INSERT INTO users values (?,?,?)\");\n\t\t$stmt->execute(array($user->getEmail(), $user->getCompleteName(), $user->getPasswd()));\n\t}", "public function users_save() {\n if ($this->id) {\n return $this->users_update();\n } else {\n return $this->users_insert();\n }\n }", "public function save(User $user){\n return $user->save();\n }", "public function save ( $isNewUser = false ) {\n $db = new DB();\n \n // If the user is already registered, just update their info\n if ( !$isNewUser ) {\n $data = array (\n 'password' => \"'$this->hashedPassword'\",\n 'email' => \"'$this->email'\"\n );\n $db->update($_SESSION[userTable], $data, \"id = '\".$this->id.\"'\");\n }\n // else register the user\n else {\n $data = array (\n 'username' => \"'$this->username'\",\n 'password' => \"'$this->hashedPassword'\",\n 'email' => \"'$this->email'\",\n 'joindate' => \"'\".date(\"Y-m-d H:i:s\").\"'\"\n );\n $this->id = $db->insert($_SESSION['userTable'], $data);\n $this->joindate = time();\n }\n }", "public function store()\n {\n // Save post data in $user var\n $user = $_POST;\n \n // Create a password, set created_by ID and set the date of creation\n $user['password'] = password_hash('Gorilla1!', PASSWORD_DEFAULT);\n $user['created_by'] = Helper::getUserIdFromSession();\n $user['created'] = date('Y-m-d H:i:s');\n\n // Save the record to the database\n UserModel::load()->store($user);\n }", "public function store()\n\t{\n\t\t// Validate the form input\n\t\t$this->userUpdateForm->validate(Input::all());\n\n\t\textract(Input::only('username', 'email', 'password', 'first_name', 'last_name'));\n\n\t\t$user = $this->execute(\n\t\t\tnew RegisterUserCommand($username, $email, $password, $first_name, $last_name)\n\t\t);\n\n\t\tFlash::success($user->username . ' was successfully created');\n\t\treturn Redirect::back();\n\t}", "public function superadmin_save($user_id) {\n }", "public function saved(User $user)\n {\n // $his->name = \"mr.\".$user->name;\n // $his->save();\n }", "public function save(User $model);", "function saveUser($user)\n {\n //1. Define the query\n $sql = \"INSERT INTO users (username, nickname, userlocation, archive, usertype, password, email) \n VALUES (:username, :nickname, :userlocation, :archive, :usertype, :password, :email)\";\n\n //2. Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //3. Bind the parameters\n $statement->bindParam(':username', $user->getUserName(), PDO::PARAM_STR);\n $statement->bindParam(':nickname', $user->getNickname(), PDO::PARAM_STR);\n $statement->bindParam(':userlocation', $user->getLocation(), PDO::PARAM_STR);\n $statement->bindParam(':password', $user->getPassword(), PDO::PARAM_STR);\n $statement->bindParam(':email', $user->getEmail(), PDO::PARAM_STR);\n\n // set account type and archive if admin\n if ($user instanceof Admin) {\n $userType = \"admin\";\n $archive = 1;\n } else {\n $userType = \"standard\";\n $archive = 0;\n }\n\n $statement->bindParam(':archive', $archive, PDO::PARAM_STR);\n $statement->bindParam(':usertype', $userType, PDO::PARAM_STR);\n\n $lastId = $this->_dbh->lastInsertId();\n\n //4. Execute the query\n $result = $statement->execute();\n\n //5. Process the results\n return $result;\n }", "public function save(){\n\t\t\tif($this->uid){\n\t\t\t\t$query = sprintf('UPDATE %sUSER SET USERNAME = \"%s\",PASSWORD =\"%s\", EMAIL_ADDR =\"%s\", IS_ACTIVE = %d WHERE USER_ID = %d',DB_TBL_PREFIX,\n\t\t\t\t\t\tmysql_real_escape_string($this->username, $GLOBALS['DB']),\n\t\t\t\t\t\tmysql_real_escape_string($this->password, $GLOBALS['DB']),\n\t\t\t\t\t\tmysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n\t\t\t\t\t\t$this->isActive, $this->userId);\n\t\t\t\t\t return mysql_query($query, $GLOBALS['DB']);\n\t\t\t}else{\n\t\t\t\t// if the user has not registered yet\n\t\t\t\t$query = sprintf('INSERT INTO %USER (USERNAME, PASSWORD, EMAIL_ADDR, IS_ACTIVE) VALUES ( \"%s\",\"%s\", \"%s\", %d)',DB_TBL_PREFIX,\n\t\t\t\t\t\tmysql_real_escape_string($this->username, $GLOBALS['DB']),\n\t\t\t\t\t\tmysql_real_escape_string($this->password, $GLOBALS['DB']),\n\t\t\t\t\t\tmysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n\t\t\t\t\t\t$this->isActive);\n\t\t\t\t\t\tif(mysql_query($query, $GLOBALS['DB'])){\n\t\t\t\t\t\t\t$this->uid = mysql_insert_id($GLOBALS['DB']);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t }", "public function save_user($u)\n\t{\n\t\n\t\tif($u['id'])\n\t\t{\n\t\t\t$sql=\"UPDATE waf_users SET email='\".$this->db->Q($u['email'],1).\"', \"\n\t\t\t.((!empty($u['pass']))?\"pass='\".md5($u['pass']).\"', \":\"\")\n\t\t\t.\"editor=\".(isset($u['editor'])?1:0).\", \"\n\t\t\t. \"status=\".(isset($u['status'])?1:0).\" \"\n\t\t\t. \"WHERE id=\".$this->db->Q($u['id']);\n\t\t}else{\n\t\t\t$sql=\"INSERT INTO waf_users (email,pass,editor,status) VALUES ('\".$this->db->Q($u['email'],1).\"','\".md5($u['pass']).\"',\".(isset($u['editor'])?1:0).\",\".(isset($u['status'])?1:0).\")\";\n\t\t}\n\t\t$this->db->QUERY($sql);\n\t}", "private function insertUser(){\n\t\t$data['tipoUsuario'] = Seguridad::getTipo();\n\t\tView::show(\"user/insertForm\", $data);\n\t}", "function saveUser(){\n global $conn, $errors, $username, $role_id, $class_id, $email, $isEditing;\n $errors = validateUser($_POST, ['save_user']);\n // receive all input values from the form\n $username = $_POST['username'];\n $email = $_POST['email'];\n $password = password_hash($_POST['password'], PASSWORD_DEFAULT); //encrypt the password before saving in the database\n $profile_picture = uploadProfilePicture(); // upload profile picture and return the picture name\n if (count($errors) === 0) {\n if (isset($_POST['role_id'])) {\n $role_id = $_POST['role_id'];\n }\n if (isset($_POST['class_id'])) {\n $class_id = $_POST['class_id'];\n }\n $sql = \"INSERT INTO users SET username=?, role_id=?, class_id=?, email=?, password=?, profile_picture=?\";\n $result = modifyRecord($sql, 'siisss', [$username, $role_id, $class_id, $email, $password, $profile_picture]);\n\n if($result){\n $_SESSION['success_msg'] = \"User account created successfully\";\n header(\"location: \" . BASE_URL . \"admin/users/userList.php\");\n exit(0);\n } else {\n $_SESSION['error_msg'] = \"Something went wrong. Could not save user in Database\";\n }\n }\n}", "public function saveAction()\n {\n $user = Mage::getSingleton('admin/session')->getUser(); \n $post_data = $this->getRequest()->getPost();\n\n try {\n $survey = Mage::getModel('client/survey')->loadSurveyByEmail($user->getEmail());\n if ($survey->getId()) $post_data['id'] = $survey->getId();\n\n $survey->setData($post_data);\n $survey->setName($user->getName());\n $survey->setEmail($user->getEmail());\n\n $survey->save();\n\n Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('client')->__('Survey was successfully saved. Thank you!'));\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n }\n\n $this->_redirect('*/*/');\n }", "public function store()\n\t{\n\t\t$user = $this->user->store( Input::all() );\n\t}", "public function save(){\n\t\tif($this->validateForms(Input::all()) === true){\n\t\t\t$user = new User();\n\t\t\t$user->username = Input::get('username');\n\t\t\t$user->password = Hash::make(Input::get('password'));\t\n\t\t\t$user->email = Input::get('email');\n\t\t\t$user->role_id = Input::get('rol');\n\t\t\t$user->enable = 1;\n\n\t\t\t$useradmin = new UsuarioAdmin();\n\t\t\t$useradmin->nombres = Input::get('nombres');\n\t\t\t$useradmin->apellidos = Input::get('apellidos');\n\t\t\t$useradmin->cargo = Input::get('cargo');\n\n\t\t\t$user->save();\n\t\t\t$user->usuarioadmin()->save($useradmin);\n\n\t\t\tSession::flash('message', 'Usuario Agregado');\n\t\t\treturn Redirect::back();\n\n\t\t}else{\n\t\t\treturn Redirect::back()->withErrors($this->validateForms(Input::all()))->withInput();\n\t\t}\n\t}", "public function insert() {\n\t\t$this->insert_user();\n\t}", "public function Save() {\n\n\t\ttry{\n\n\t\t\t$statement = \"INSERT INTO `users` (`username`, `email`, `password`, `createDate`, `ACL`, `lastLoginDate`)\n\t\t\t\t\tVALUES (:username, :email, :userPassword, :createDate, :ACL, :lastLoginDate)\";\n\n\t\t\t$statement = $this->database->prepare($statement);\n\n\t\t\t$statement->execute(array( ':username' => $this->getUsername()\n\t\t\t\t\t, ':email' => $this->getEmail()\n\t\t\t\t\t, ':userPassword' => $this->getPassword()\n\t\t\t\t\t, ':createDate' => $this->getFirstLogin()\n\t\t\t\t\t, ':ACL' => $this->getAccessLevel()\n\t\t\t\t\t, ':lastLoginDate' => $this->getFirstLogin()\n\t\t\t));\n\n\t\t}catch(Exception $e){\n\t\t\tthrow new Exception( 'Database error:', 0, $e);\n\t\t\treturn;\n\t\t};\n\n\t\treturn(\"saved\");\n\t}", "public function store()\n {\n $objUser = new User;\n \n $objUser->doSave($_POST);\n \n return Redirect::to('/admin/manage_user');\n }", "private function saveUser(){\n\n if( ! $this->checkEmail() ){\n $password = password_hash($this->_userPassword, PASSWORD_DEFAULT);\n $request = $this->_connexion->prepare(\"INSERT INTO Users (user_name, user_email, user_password) VALUES (?, ?, ?)\");\n $request->execute(array($this->_userName, $this->_userEmail, $password));\n\n return $response = json_encode([\n 'status' => 'ok',\n 'message' => 'successfuly add'\n ]);\n }\n else{\n return $response = json_encode([\n 'status' => 'failed',\n 'message' => 'this email allready exist'\n ]);\n }\n\n }", "public function saveUser() {\n\n try {\n\n $this->save();\n\n }catch (Exception $e) {\n\n throw new Exception($e->getMessage());\n\n }\n }", "public function save()\n {\n $this->user->setCulture($this->getValue('language'));\n }", "public function save($userid)\n {\n }", "function editsubmit() \n\t{\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n\t\ttry\n\t\t{\n\t\t\n\t\t\tif (!empty($_POST['username'])&& !empty($_POST['firstname']) && !empty( $_POST['role']) && !empty($_POST['email']))\n\t\t\t{\n\t\t\t\t$userId=$_POST['userid'];\n\t\t\t\t$userName=$_POST['username'];\n\t\t\t\t$email=$_POST['email'];\n\t\t\t\n\t\t\t\t$firstname=$_POST['firstname'];\n\t\t\t\t$middlename=$_POST['middlename'];\n\t\t\t\t$lastname=$_POST['lastname'];\n\t\t\t\t$role=$_POST['role'];\n\t\t\t\t$phoneres=$_POST['phoneres'];\n\t\t\t\t$phonecell=$_POST['phonecell'];\n\t\t\t\t$isActive=$_POST['status'];\n\t\t\t\t$isLocked=$_POST['locked'];\n\t\t\t\t$comments=$_POST['comments'];\n\t\t\t\t\n\t\t\t \n\t\t\t\tUserModel::Create()->UpdateUser( $userId, $userName,$email, $firstname, $middlename, $lastname, $role, $phoneres, $phonecell, $isActive, $isLocked, $comments);\n\t\t\t\t\n\t\t\t\t$this->renderWithTemplate('users/editsubmit', 'AdminPageBaseTemplate');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->viewData['module']=\"Edit User\";\n\t\t\t\t$this->viewData['error']= \"Please Enter all the Required Fields and submit\"; \n\t\t\t\t$this->renderWithTemplate('common/error', 'AdminPageBaseTemplate');\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $ex)\n\t\t{\n\t\t\t$this->viewData['module']=\"Edit User\";\n\t\t\t$this->viewData['error']= $ex->getMessage(); \n\t\t\t$this->renderWithTemplate('users/error', 'AdminPageBaseTemplate');\n\t\t}\n\t\t\t\n\t\t\t\n\t}", "public function p_signup(){\n\t\tforeach($_POST as $field => $value){\n\t\t\tif(empty($value)){\n\t\t\t\tRouter::redirect('/users/signup/empty-fields');\n\t\t\t}\n\t\t}\n\n\t\t#check for duplicate email\n\t\tif ($this->userObj->confirm_unique_email($_POST['email']) == false){\n\t\t\t#send back to signup page\n\t\t\tRouter::redirect(\"/users/signup/duplicate\");\n\t\t}\n\n\t\t#adding data to the user\n\t\t$_POST['created'] = Time::now();\n\t\t$_POST['modified'] = Time::now();\n\n\t\t#encrypt password\n\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t\t#create encrypted token via email and a random string\n\t\t$_POST['token'] = sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string());\n\n\t\t#Insert into the db\n\t\t$user_id = DB::instance(DB_NAME)->insert('users', $_POST);\n\n\t\t# log in the new user\n\n\t\tsetcookie(\"token\", $_POST['token'], strtotime('+2 weeks'), '/');\n\n\t\t# redirect to home\n\t\tRouter::redirect('/users/home');\n\t\t\n\t}", "public function save()\n {\n $this->validate();\n $user = User::findOrFail($this->userId);\n if(strtolower($this->origName) == strtolower($this->newName)){\n $this->updateName($user);\n return;\n }else{\n $user->info->update(['company_name' => $this->newName]);\n $user->save();\n $this->updateName($user);\n }\n\n\n }", "public function post_add_users() {\n\t}", "function save_user($data){ \n global $database;\n if (!$data) {\n return false;\n }else{\n $query = '';\n if ( isset ( $_GET['id'] ) ){\n // UPDATE\n $query .= \"UPDATE \" . TABLE_PREFIX . \"users SET \";\n\n foreach ( $data as $key => $field ) {\n if ( 'save_user' != $key ){\n $fields[] = $key . \"='\" . $field . \"'\";\n }\n }\n $query .= implode(',', $fields);\n $query .= \" WHERE ID='\". $_GET['id'] .\"'\";\n \n }else{\n // INSERT\n $fields = $values = array();\n $query .= \"INSERT INTO \" . TABLE_PREFIX . \"users (\";\n foreach ( $data as $key => $field ) {\n if ( 'save_user' != $key ){\n $fields[] = $key;\n }\n }\n $query .= implode(',', $fields);\n $query .= \") VALUES (\";\n foreach ( $data as $key => $field ) {\n if ( 'save_user' != $key ){\n $values[] = \"'\" . $field . \"'\";\n }\n }\n $query .= implode(',', $values);\n $query .= \")\";\n \n }\n \n $database->query($query);\n if( !$database->error ){\n $_SESSION['message'] .= 'Los cambios se han guardado con éxito.';\n return true;\n }\n return $database->error;\n \n }\n}", "public function save() {\n\t\tif (!$this->validate()) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach($this->attributeNames() as $name) {\n\t\t\tif ($name != 'password2') {\n\t\t\t\t$this->user->$name = $this->$name;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($this->getScenarioIsCreation()) {\n\t\t\t$this->user->isNewRecord = true;\n\t\t}\n\t\tif (!$this->user->save(false, $this->getSafeAttributeNames())) {\n\t\t\t$this->addError('', 'Save account failed');\n\t\t\treturn false;\n\t\t}\n\t\t$msg = $this->getScenarioIsCreation()\n\t\t\t? 'Add Account successfull' : 'Save Account successfull'; \n\t\tYii::app()->console->addSuccess($msg);\n\t\treturn true;\n\t}", "public function actionSave()\n { \n \t$model=new RegisterForm();\n \t\n \t//Load form parameters into model and validate form data\n\t\tif($model->load(Yii::$app->request->post()) && $model->validate())\n\t\t{\n \t\tYii::trace('Validation failed. Redirecting to registration page.');\n \t\t//$this->displayErrorView($model);\n \t\t//exit;\n \t}\n\n \t//Data is good proceed to save user in DB\n \t$this->createUser($model);\n \t\n \t//Create MainForm\n \t$mainModel = new MainForm();\n \t\n \t$mainModel->firstNm = $model->name;\n \t$mainModel->welcomeMsg = $model->welcomeMsg;\n \t\n \treturn $this->renderPartial('/site/main',array('model'=>$mainModel));\n }", "public function doRegister()\n {\n\n //check if all the fields are 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 based on filled data\n $userEntity = new User(Request::postData());\n\n //check if the user exists and get it as entity if exists\n if ($this->repository->findUser($userEntity)) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The username/email already exists!\", \"type\" => \"error\")));\n exit;\n }\n\n //add the user into DB\n $this->repository->addUser($userEntity);\n\n echo json_encode(\n array(\n \"swal\" => array(\"title\" => \"Success!\", \"text\" => \"Your account has been created!\", \"type\" => \"success\", \"hideConfirmButton\" => true),\n \"redirect\" => array(\"url\" => BASE_URL . '/index.php?page=home', 'time' => 1)\n )\n );\n }", "public function saveAction() {\n $logger = $this->get('logger');\n if (!$this->get('request')->isXmlHttpRequest()) { // Is the request an ajax one?\n return new Response(\"<b>Not an ajax call!!!\" . \"</b>\");\n }\n\n try {\n //Get parameters\n $request = $this->get('request');\n $id = $request->get('id');\n $name = $request->get('name');\n $lastname = $request->get('lastname');\n $username = $request->get('username');\n $email = $request->get('email');\n $cellPhone = $request->get('cellPhone');\n $isActive = $request->get('isActive');\n $isCreating = false;\n\n $translator = $this->get(\"translator\");\n\n if( isset($id) && isset($name) && trim($name) != \"\"\n && isset($lastname) && trim($lastname) != \"\"\n && isset($username) && trim($username) != \"\") {\n $em = $this->getDoctrine()->getManager();\n $entity = new User();\n if($id != 0) { //It's updating, find the user\n $entity = $em->getRepository('TecnotekAsiloBundle:User')->find($id);\n }\n if( isset($entity) ) {\n $entity->setName($name);\n $entity->setLastname($lastname);\n $entity->setUsername($username);\n $entity->setCellPhone($cellPhone);\n $entity->setEmail($email);\n $entity->setIsActive( ($isActive==\"true\")? 1:0);\n $rawPassword = $this->generateStrongPassword();\n if($id == 0) { // If it's new must generates a new password\n $encoder = $this->container->get('security.encoder_factory')->getEncoder($entity);\n $entity->setPassword($encoder->encodePassword($rawPassword, $entity->getSalt()));\n $isCreating = true;\n }\n\n if($em->getRepository(\"TecnotekAsiloBundle:User\")\n ->checkUniqueUsernameAndEmail($username, $email, $id) ) {\n\n $em->persist($entity);\n $em->flush();\n if($isCreating) { // If it's new must email the new account email including the password\n $roleEmployee = $em->getRepository('TecnotekAsiloBundle:Role')->findOneByRole(\"ROLE_EMPLOYEE\");\n $entity->getUserRoles()->add($roleEmployee);\n $em->persist($entity);\n $em->flush();\n $logger->info(\"Send Email for new Account with password: \" . $rawPassword);\n $this->sendEmailForNewAccount($entity, $rawPassword);\n }\n return new Response(json_encode(array(\n 'error' => false,\n 'msg' => $translator->trans('catalog.save.success'))));\n } else {\n return new Response(json_encode(array(\n 'error' => true,\n 'msg' => $translator->trans('user.username.and.email.must.be.uniques'))));\n }\n } else {\n return new Response(json_encode(array('error' => true, 'msg' => \"Missing Parameters 2\")));\n }\n } else {\n return new Response(json_encode(array('error' => true, 'msg' => \"Missing Parameters 1\")));\n }\n } catch (Exception $e) {\n $info = toString($e);\n $logger->err('User::saveAction [' . $info . \"]\");\n return new Response(json_encode(array('error' => true, 'msg' => $info)));\n }\n }", "public function postSave() {}", "public function save() {\r\n\t return isset($this->userid) ? $this->update() : $this->create();\r\n\t}", "public function save()\n {\n $this->validate();\n if(empty($this->errors)) {\n $qb = new QB;\n $qb->conn = static::getDB();\n $columns = ['name', 'email', 'password_hash'];\n $password_hash = password_hash($this->password, PASSWORD_BCRYPT);\n $values = [\n $this->name,\n $this->email,\n $password_hash\n ];\n $qb->insert('users', $columns, $values);\n return true;\n }else{\n return false;\n }\n }", "public function update()\n {\n $userId = Helper::getIdFromUrl('user');\n\n // Save post data in $user\n $user = $_POST;\n \n // Save record to database\n UserModel::load()->update($user, $userId);\n\n View::redirect('user/' . $userId);\n }", "function admin_insert_new_user(){\r\n\t\tif(isset($_POST['doctor_create_user'])){\r\n\t\t\t$result['insert_new_user_data'] = $this->model->insert_new_user();\r\n\t\t\tredirect('Doctor_control/admin_create_new_user'); \r\n\t\t}\r\n\t\tif(isset($_POST['doctor_update_user'])){\r\n\t\t\tif($this->model->update_new_user_record()){\r\n\t\t\t\tredirect('Doctor_control/admin_create_new_user'); \r\n\t\t\t} \r\n\t\t} \r\n\t}", "public function save()\n\t{\n\t\t$data['password'] = $this->input->post('new_password');\n\t\t$this->db->where('id', $this->input->post('id'));\n\t\t$this->db->update('users', $data);\n\n\t\theader(\"Content-type:application/json\");\n\t\techo json_encode('success');\n\t}", "public function insertUser($data) {\n\t\t\n\t\t\n\t}", "function save()\n\t{\n\t\tJSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n\n\t\t$user = JFactory::getUser();\n\t\t$post\t= JRequest::get('post');\n\t\tif (!($user->authorise('core.create', 'com_gmapfp') and empty($post['id'])) and !($user->authorise('core.edit', 'com_gmapfp') and !empty($post['id'])))\n\t\t{\n\t\t\t$this->setMessage(JText::_('JLIB_APPLICATION_ERROR_CREATE_RECORD_NOT_PERMITTED'), 'error');\n\t\t} else {\n\t\t\t$model = $this->getModel('gmapfp');\n\t\t\t$returnid=$model->store($post);\n\t\t\tif ($returnid>0) {\n\t\t\t\t$msg = JText::_( 'GMAPFP_SAVED' );\n\t\t\t} else {\n\t\t\t\t$msg = JText::_( 'GMAPFP_SAVED_ERROR' );\n\t\t\t}\n\t\t}\n\n\t\t$link = 'index.php?option=com_gmapfp&controller=gmapfp&task=view';\n\t\t// Check the table in so it can be edited.... we are done with it anyway\n\t\t$this->setRedirect($link, $msg);\n\t}", "function createUser()\n{\n $userCheck = UsersQuery::create()->findOneByUsername($_POST['username']);\n if ($userCheck == \"\") {\n // next add user to db\n $user = new Users();\n $user->setUsername($_POST['username']);\n $user->setPassword($_POST['password']);\n $user->setName($_POST['name']);\n $user->setEmail($_POST['email']);\n $user->setStatus(\"active\");\n $user->setPicture(\"none\");\n $user->setCreated(time());\n $user->setModified(time());\n\n $user->save();\n\n if ($user != null) {\n echo \"user added successfully\";\n }\n } else {\n echo \"user already registered\";\n }\n}", "function add() {\n $this->layout = \"no_header\";\n if (!empty($this->data)) {\n if ($this->User->save($this->data)) {\n $this->Session->setFlash(\"Your account has been created successfully\");\n $this->go_back(\"login\");\n }\n }\n }", "public function store()\n\t{\n $user = new User();\n $user->name = Input::get('name');\n $user->email = Input::get('email');\n $user->mobile = Input::get('mobile');\n $user->save();\n echo json_encode(array('msg' => 'success', 'id' => $user->id));\n\t}", "public function save(){\n\n // Authenticate as admin\n $user = User::fetch_by_session();\n if($user === false) return $this->zajlib->json(['status'=>'error', 'message'=>'Your user session has expired!']);\n if($user->data->admin != 'admin') return $this->zajlib->json(['status'=>'error', 'message'=>'Your user account does not have rights to perform this action!']);\n\n // Fetch the photo\n $photo = Photo::fetch($_POST['id']);\n $photo->set_with_data($_POST, ['name', 'alttext', 'caption']);\n $photo->save();\n\n return $this->zajlib->json(['status'=>'ok']);\n }", "public static function addUser()\n {\n // ADD NEW DATA TO A TABLE\n // MAKE SURE TO SEND USERS TO THE /users page when a user is added\n }", "function SignupAction($data, $form) {\n \n\t\t\n\t\t// Create a new object and load the form data into it\n\t\t$entry = new SearchContestEntry();\n\t\t$form->saveInto($entry);\n \n\t\t// Write it to the database.\n\t\t$entry->write();\n\t\t\n\t\tSession::set('ActionStatus', 'success'); \n\t\tSession::set('ActionMessage', 'Thanks for your entry!');\n\t\t\n\t\t//print_r($form);\n\t\tDirector::redirectBack();\n \n\t}", "function save_user($user) {\n\ttry {\n\t\t# Get connected\n\t\t$dbh = get_dbh();\n\n\t\t# Create the user if necessary\n\t\t$stmt = $dbh->prepare('SELECT username FROM users WHERE username = ?');\n\t\t$stmt->execute(array($user['username']));\n\t\tif (! is_array($stmt->fetch())) {\n\t\t\t$stmt = $dbh->prepare('INSERT INTO users (username) VALUES (?)');\n\t\t\t$stmt->execute(array($user['username']));\n\t\t}\n\n\t\t# Update the DB from our local array\n\t\t$stmt = $dbh->prepare('UPDATE users SET auth = ? WHERE username = ?');\n\t\t$stmt->execute(array($user['auth'], $user['username']));\n\t} catch (PDOException $e) {\n\t\terror(0, 'DB error in save_user: ' . $e->getMessage());\n\t}\n\n\treturn TRUE;\n}", "public function save($isNewUser = false) {\n // Create a new database object.\n $db = new DB();\n $username = $db->mysqli->real_escape_string($this->username );\n $email = $db->mysqli->real_escape_string($this->email );\n $firstName = $db->mysqli->real_escape_string($this->firstName );\n $lastName = $db->mysqli->real_escape_string($this->lastName );\n\n // If just modifying a current user.\n if(!$isNewUser) {\n // set the data array\n $data = array(\"user_username\" => \"$username\",\n \"user_password\" => \"$this->hashpass\",\n \"user_email\" => \"$email\",\n \"user_firstName\" => \"$firstName\",\n \"user_lastName\" => \"$lastName\"\n );\n // Modify the user in the database\n $db->modify('User', $data, \"'id = $this->id'\");\n\n } else {\n // If this is a new user being registered.\n $data = array(\"user_id\" => \"NULL\",\n \"user_username\" => \"$username\",\n \"user_password\" => \"$this->hashpass\",\n \"user_email\" => \"$email\",\n \"user_firstName\" => \"$firstName\",\n \"user_lastName\" => \"$lastName\",\n \"user_joinDate\" => \"\".date(\"Y-m-d H:i:s\")\n );\n\n $this->id = $db->insert('User', $data);\n $this->joinDate = time();\n }\n return true;\n }", "public function save( $params ) {\n $query = \"INSERT INTO stat SET user = ?, answer_id=?\";\n $this->db->execute( $query, array($params['user'], $params['answer_id']) );\n\n $this->id = $this->db->getLastId();\n $this->init();\n\n }", "public function createAction()\r\n {\r\n $user = new User($_POST);\r\n\r\n if ($user->save()) {\r\n\t\t\t\r\n\t\t\tsession_regenerate_id(true);\r\n\r\n\t\t\t$_SESSION['user_id'] = User::getIdSavedUser($_POST['email']);\r\n\t\t\t\r\n\t\t\tIncome::saveDefaultIncomes($_SESSION['user_id']);\r\n\t\t\tExpense::saveDefaultExpenses($_SESSION['user_id']);\r\n\t\t\tPaymentMethod::saveDefaultPaymentMethods($_SESSION['user_id']);\r\n\t\t\t\r\n\t\t\t$user->sendActivationEmail();\r\n\r\n $this->redirect('/signup/success');\r\n\r\n } else {\r\n\r\n View::renderTemplate('Signup/new.html', [\r\n 'user' => $user\r\n ]);\r\n\r\n }\r\n }", "public function save(): bool\r\n {\r\n if (!$this->user_id)\r\n throw new Exception(\"Couldn't save User: The user id hasn't been set.\");\r\n\r\n $sql = \"UPDATE `users` SET `email`=:email,`password`=:password,`rank`=:rank,`last_login`=:last_login,`last_login_2`=:last_login_2 WHERE `user_id`=:user_id\";\r\n $statement = $this->pdo->prepare($sql);\r\n $statement->bindValue(':email', $this->data['email']);\r\n $statement->bindValue(':password', $this->data['password']);\r\n $statement->bindValue(':rank', $this->data['rank']);\r\n $statement->bindValue(':last_login', $this->data['last_login']);\r\n $statement->bindValue(':last_login_2', $this->data['last_login_2']);\r\n $statement->bindValue(':user_id', $this->user_id);\r\n if (!$statement->execute()) {\r\n throw new Exception(\"Error saving User data\");\r\n if ($this->logger) $this->logger->error(\"Error saving User data at User::save()\", $this->data);\r\n }\r\n\r\n if ($this->logger) $this->logger->info(\"Save User data \", $this->data);\r\n\r\n return true;\r\n }", "public function saveToDatabase() {\n if($this->id != 0) {\n $dbResult = System::database()->query('update :table_users \n set `role_id` = :role_id, \n `login` = :login, \n `password` = :password, \n `auth_key` = :auth_key, \n `auth_expire` = :auth_expire, \n `last_login` = :last_login\n where `id` = :id');\n \n $dbResult->bindInt(':id', $this->id);\n $dbResult->bindValue(':auth_key', $this->authKey);\n $dbResult->bindInt(':auth_expire', $this->authExpired);\n $dbResult->bindInt(':last_login', $this->lastLoginTime);\n } else {\n $dbResult = System::database()->query('insert into :table_users (`role_id`, `login`, `password`)\n values (:role_id, :login, :password);');\n }\n $dbResult->bindTable(':table_users', TABLE_USERS);\n $dbResult->bindInt(':role_id', $this->role['id']);\n $dbResult->bindValue(':login', $this->login);\n $dbResult->bindValue(':password', $this->password);\n\n $dbResult->execute();\n }", "public function store() {\n\t\tApp::get( 'database' )->insert( 'users', [\n\t\t\t'name' => $_POST['name']\n\n\t\t] );\n\t\t//And then redirect back to all users\n\t\treturn redirect( 'users' );\n\t}", "public function testUpdateUser()\n {\n }", "public function formSubmit() {\n\n check_admin_referer('ncstate-wrap-authentication');\n\n $newOptions = array(\n 'autoCreateUser' => (bool)$_POST['nwa_autoCreateUser'],\n );\n\n update_option('ncstate-wrap-authentication', $newOptions);\n\n wp_safe_redirect(add_query_arg('updated', 'true', wp_get_referer()));\n }", "public function registerUserAction() {\n\t\n\t\t\t$request = $this->getRequest();\n\t\t\t\n\t\t\t\n\t\t\tif ($request->isPost()) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// get the json raw data\n\t\t\t\t$handle = fopen(\"php://input\", \"rb\");\n\t\t\t\t$http_raw_post_data = '';\n\t\t\t\t\n\t\t\t\twhile (!feof($handle)) {\n\t\t\t\t $http_raw_post_data .= fread($handle, 8192);\n\t\t\t\t}\n\t\t\t\tfclose($handle); \n\t\t\t\t\n\t\t\t\t// convert it to a php array\n\t\t\t\t$json_data = json_decode($http_raw_post_data, true);\n\t\t\t\t\n\t\t\t\t//echo json_encode($json_data);\n\t\t\t\t\n\t\t\t\tif (is_array($json_data)) {\n\t\t\t\t\t// convert it back to json\n\t\t\t\t\t\n\t\t\t\t\t// write the user back to database\n\t\t\t\t\t$registered = Application_Model_User::registerUser($json_data);\n\t\t\t\t\t\n\t\t\t\t\tif($registered) {\n\t\t\t\t\t\techo json_encode($registered);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\techo 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t}", "public function p_signup() {\n $duplicate = DB::instance(DB_NAME)->select_field(\"SELECT email FROM users WHERE email = '\" . $_POST['email'] . \"'\");\n \n //If email already exists \n if($duplicate){ \n //Redirect to error page \n Router::redirect('/users/login/?duplicate=true');\n }\n\n // Encrypt the password \n $_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']); \n\n // Create an encrypted token via their email address and a random string\n $_POST['token'] = sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string()); \n\n // Insert this user into the database\n $user_id = DB::instance(DB_NAME)->insert('users', $_POST);\n\n\n\n //Image Upload\n Upload::upload($_FILES, \"/uploads/avatars/\", array(\"JPG\", \"JPEG\", \"jpg\", \"jpeg\", \"gif\", \"GIF\", \"png\", \"PNG\"), $user_id);\n \n $filename = $_FILES['avatar']['name']; // original filename (i.e. picture.jpg)\n $extension = substr($filename, strrpos($filename, '.')); // filename format extension (i.e. .jpg)\n $avatar = $user_id.$extension; // user id + .jpg or .png or .gif (i.e. 26.png)\n\n // Add Image to DB in \"avatar\" column\n $data = Array(\"avatar\" => $avatar);\n DB::instance(DB_NAME)->update(\"users\", $data, \"WHERE id = '\".$user_id.\"'\"); \n\n // Send them back to the login page with a success message\n Router::redirect(\"/users/login/?success=true\"); \n\n \n }", "public function save($user){\n $this->validate();\n if(sizeof($this->errors)==0){\n\n $password_hash=password_hash($user->getPassword(),PASSWORD_DEFAULT);\n $sql=\"INSERT INTO user(name,email,password) VALUES(?,?,?)\";\n $stmt=static::getDB()->prepare($sql);\n $stmt->execute(array($user->getUsername(),$user->getEmail(),$password_hash));\n \n }else{\n print_r($this->errors) ;\n }\n\n // return false;\n }", "public function save()\n {\n $this->checkModel();\n if (!is_null($this->profile)) $this->saved = $this->profile->save();\n }", "function onAfterStoreUser($user, $isnew, $success, $msg)\n\t{\n\t\tglobal $mainframe;\n\n\t\t// convert the user parameters passed to the event\n\t\t// to a format the external application\n\n\t\t$args = array();\n\t\t$args['username']\t= $user['username'];\n\t\t$args['email'] \t\t= $user['email'];\n\t\t$args['fullname']\t= $user['name'];\n\t\t$args['password']\t= $user['password'];\n\n\t\tif ($isnew)\n\t\t{\n\t\t\t// Call a function in the external app to create the user\n\t\t\t// ThirdPartyApp::createUser($user['id'], $args);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Call a function in the external app to update the user\n\t\t\t// ThirdPartyApp::updateUser($user['id'], $args);\n\t\t}\n\t}", "public function post_edit() {\n //try to edit the user\n if (AuxUser::editUser()) {\n //if the edit process worked, redirect to the profile page\n echo '<script>alert(\"User data edited\");</script>';\n Response::redirect('/profile');\n } else {\n //if not, print the error message\n echo '<script>alert(\"No data was updated, Please confirm that you change at least one field\");</script>';\n Response::redirect('/user/edit', 'refresh');\n }\n }", "function newuser(){\n\t\t\tif(!empty($_POST['newemail']) && !empty($_POST['newpassword']) && !empty($_POST['newnombre']) && !empty($_POST['newpoblacion']) && !empty($_POST['newrol'])){\n\t\t\t\t$poblacion = filter_input(INPUT_POST,'newpoblacion',FILTER_SANITIZE_STRING);\n\t\t\t\t$nombre = filter_input(INPUT_POST,'newnombre',FILTER_SANITIZE_STRING);\n\t\t\t\t$password = filter_input(INPUT_POST,'newpassword',FILTER_SANITIZE_STRING);\n\t\t\t\t$email = filter_input(INPUT_POST,'newemail',FILTER_SANITIZE_STRING);\n\t\t\t\t$rol = filter_input(INPUT_POST,'newrol',FILTER_SANITIZE_STRING);\n\t\t\t\t$list = $this -> model -> adduser($nombre,$password,$email,$poblacion,$rol);\n \t\t$this -> ajax_set(array('redirect'=>APP_W.'admin'));\n\t\t\t}\n\t\t}" ]
[ "0.7470914", "0.73257756", "0.7243964", "0.71939886", "0.7107475", "0.70958984", "0.7033376", "0.6964341", "0.6940713", "0.6860676", "0.6845488", "0.68201524", "0.68153304", "0.6807278", "0.67851573", "0.6766013", "0.67114806", "0.670515", "0.66894925", "0.66801506", "0.6645006", "0.66447425", "0.6611482", "0.65995836", "0.657337", "0.65636003", "0.6548531", "0.65234673", "0.65103155", "0.6504099", "0.64897966", "0.64854443", "0.64767414", "0.6462615", "0.64501196", "0.64473224", "0.643992", "0.6427549", "0.6416118", "0.63862664", "0.6385971", "0.6381665", "0.6381333", "0.6381072", "0.6357635", "0.6353265", "0.6345818", "0.6336776", "0.63338596", "0.6328785", "0.6318644", "0.63034725", "0.6271137", "0.62545466", "0.6242848", "0.6241699", "0.62394446", "0.62328213", "0.6232098", "0.62126297", "0.62030965", "0.6189165", "0.6184685", "0.6177678", "0.6172966", "0.61359537", "0.6119157", "0.61176497", "0.6107266", "0.6091678", "0.60879433", "0.6087804", "0.60843503", "0.60792804", "0.60680294", "0.605715", "0.6054923", "0.60515183", "0.6048253", "0.6040661", "0.6033088", "0.6026624", "0.60261166", "0.60209244", "0.60208696", "0.6019986", "0.6010977", "0.600882", "0.60039794", "0.5998653", "0.5997054", "0.59933794", "0.59932077", "0.5992819", "0.5987017", "0.5986007", "0.5984901", "0.5980083", "0.59787714", "0.5977373" ]
0.69287956
9
Helper method to check if an acronym is available or not. Checks in DB if an acronym is available or not.
private function isAcronymAvailable($userDb, $acronym) { $isAcronymAvailable = true; $user = $this->getUserFromDb($userDb, $acronym); if (isset($user[0]) && (strcmp($user[0]->acronym, $acronym) === 0)) { $isAcronymAvailable = false; } return $isAcronymAvailable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasAcronym() {\n return $this->_has(3);\n }", "public function hasAcronym() {\n return $this->_has(4);\n }", "public function hasAcronym() {\n return $this->_has(4);\n }", "public function hasAcronym() {\n return $this->_has(4);\n }", "public function hasDatasetAcronym() {\n return $this->_has(7);\n }", "public function hasStudyAcronym() {\n return $this->_has(10);\n }", "public function getAcronym();", "function DOM_find_acronyms () {\r\n\t\t$query = '//' . ReTidy::get_html_namespace() . 'acronym';\r\n\t\t$acronymTags = $this->xpath->query($query);\r\n\r\n\t\tforeach($acronymTags as $acronymTag) {\r\n\t\t\tif($acronymTag->hasAttributes()) {\r\n\t\t\t\tforeach ($acronymTag->attributes as $attribute) {\r\n\t\t\t\t\tif ($attribute->nodeName === \"title\") {\r\n\t\t\t\t\t\t$definition = htmlentities($attribute->nodeValue);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif($acronymTag->hasChildNodes()) {\r\n\t\t\t\tforeach ($acronymTag->childNodes as $child) {\r\n\t\t\t\t\tif ($child->nodeName === \"#text\") {\r\n\t\t\t\t\t\t$acronym = htmlentities($acronymTag->firstChild->nodeValue);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\r\n\t\t\t// this is a potential acronym so add it to the acronymsarray\r\n\t\t\t$IsADuplicate = false;\r\n\t\t\tforeach($this->acronymsArray as $index => $acronym_tab_definition) {\r\n\t\t\t\t$acronym18 = substr($acronym_tab_definition, 0, strpos($acronym_tab_definition, \"\t\"));\r\n\t\t\t\tif ($acronym18 === $acronym) {\r\n\t\t\t\t\t$IsADuplicate = true;\r\n\t\t\t\t\t// check if this one is better than the existing one?\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif($IsADuplicate != true) {\r\n\t\t\t\t$ToAdd = \"$acronym\t$definition\";\r\n\t\t\t\t$this->acronymsArray[] = $ToAdd;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// now we could look for acronym tables and capitalized words and other things (using DOM \r\n\t\t// to get only nodes that we are interested in).\r\n\t}", "abstract public function modules__ddl__is_eligible_for_title ( &$ddl_information );", "public function GetAcronym() \n {\n return $this->acronym;\n }", "public function testOneWordIsNotAbbreviated(): void\n {\n $this->assertEmpty(acronym('Word'));\n }", "public function GetAcronym() {\n\t\t$user = self::GetUserProfile();\n\t\treturn $user['akronym'];\n\t}", "function isCharityNamePresent($name = NULL){\t\t\t\n\t\t$query = \" SELECT id\";\n\t\t$query .= \" FROM \" . $this->config->item('ems_organisers_details','dbtables');\n\t\t$query .= \" WHERE charity_name = ? \";\t\t\n\t\t$dataBindArr = array($name);\n\t\t$res = $this->db->query($query, $dataBindArr);\n\t\t$resArr = $res->result();\t\t\n\t\treturn count($resArr);\n\t}", "function name_exists($str){\n\n\t\tif(strlen($str)<3 || strlen($str)>30){\n\t\t\t$this->form_validation->set_message('name_exists','The field {field} must be between 3 and 30 characters in length');\n\t\t\treturn false;\n\t\t}\n\t\t$nameExists = $this->DAO->entitySelection('station',array('nameStation'=>$str),TRUE);\n\t\tif($nameExists['data']){\n\t\t\t$this->form_validation->set_message('name_exists','The field {field} already exists');\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}", "function isAuthorExists($author_name, $connection) {\n $q = mysqli_query($connection, 'SELECT * \n FROM authors\n WHERE author_name = \"' . $author_name . '\"'\n );\n\n if (!$q) {\n echo 'Възникна грешка!';\n if ($debug) {\n echo mysqli_error($connection);\n }\n exit;\n } else {\n if ($q->num_rows == 0) {\n return false;\n } else {\n return true;\n }\n }\n}", "function findAcronymsAndDefinitions($acronym_pattern2, $code) {\t\t$strlen = strlen($code);\r\n\t\t$big_offset = 0;\r\n\t\t// restrict the length of acronyms\r\n\t\tif(isset($this->config['maximum_acronym_length'])) {\r\n\t\t\t$maximum_acronym_length = $this->config['maximum_acronym_length'];\r\n\t\t} else {\r\n\t\t\t$maximum_acronym_length = 12;\r\n\t\t}\r\n\t\t//$do_the_abbr_count = false;\r\n\t\t//if(!isset($this->abbr_found)) {\r\n\t\t//\t$do_the_abbr_count = true;\r\n\t\t//}\r\n\t\twhile($big_offset < $strlen) {\r\n\t\t\tpreg_match_all($acronym_pattern2, substr($code, $big_offset, 64000), $matches, PREG_OFFSET_CAPTURE);\r\n\t\t\t//if($do_the_abbr_count) {\r\n\t\t\t//\t$this->abbr_found += sizeof($matches[0]);\r\n\t\t\t//}\r\n\t\t\tforeach($matches[0] as $index => $value) {\r\n\t\t\t\t$match = $matches[2][$index][0];\r\n\t\t\t\t$offset = $matches[2][$index][1] + $big_offset;\r\n\t\t\t\tif(strlen($match) > 1 && strlen($match) < $maximum_acronym_length) {\r\n\t\t\t\t\t$IsAnAcronym = true;\t\t\t\t\r\n\t\t\t\t\tforeach($this->stopWords as $index => $NonAcronymPart) {\r\n\t\t\t\t\t\t// if this is completely a stop word\r\n\t\t\t\t\t\tif(strpos(strtolower($NonAcronymPart), strtolower($match)) === 0) {\r\n\t\t\t\t\t\t\t$IsAnAcronym = false;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif($IsAnAcronym) {\r\n\t\t\t\t\t\tforeach($this->arrayofNonAcronyms as $index => $NonAcronym) {\r\n\t\t\t\t\t\t\tif($NonAcronym === $match) {\r\n\t\t\t\t\t\t\t\t// we call this not an acronym\r\n\t\t\t\t\t\t\t\t$IsAnAcronym = false;\r\n\t\t\t\t\t\t\t\t// exit loop\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif($IsAnAcronym === true) {\r\n\t\t\t\t\t\t// clean acronym of extra space...\r\n\t\t\t\t\t\t$match = preg_replace('/\\s+/s', ' ', $match);\r\n\t\t\t\t\t\t$defArray = ReTidy::findDefinitions($match, $offset, $code);\r\n\t\t\t\t\t\tforeach($defArray as $definition) {\r\n\t\t\t\t\t\t\tReTidy::addAcronymIfNew($match, $definition);\r\n\t\t\t\t\t\t\t//ReTidy::addAcronym($match, $definition);\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\t$big_offset += 60000;\r\n\t\t}\r\n\t}", "function addAcronymIfNew($acronym, $definition) {\r\n\t\t// (so that our acronyms array does not become polluted with many entries representing the same acronym)\r\n\t\t$IsADuplicate = false;\r\n\t\tforeach($this->acronymsArray as $index => $value) {\r\n\t\t\t$acronym16 = $this->acronymsArray[$index][0];\r\n\t\t\t$Existingdefinition16 = $this->acronymsArray[$index][1];\t\t\t\r\n\t\t\tif(html_entity_decode($acronym16) === html_entity_decode($acronym)) {\r\n\t\t\t\tif($this->config[\"simple_acronym_detection\"]) {\r\n\t\t\t\t\t// This is a useful and inaccurate approximation; we are saying that if we have an accepted definition, then do not look for others.\r\n\t\t\t\t\t$IsADuplicate = true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$pattern = ReTidy::getDefinitionPattern($acronym);\r\n\t\t\t\t\tpreg_match('/' . $pattern . '/is', $definition, $matches17);\r\n\t\t\t\t\tif(sizeof($matches17) > 0 && strlen($definition) > 0) {\r\n\t\t\t\t\t\tif(is_array($Existingdefinition16)) {\r\n\t\t\t\t\t\t\tforeach($Existingdefinition16 as $definition18) {\r\n\t\t\t\t\t\t\t\tif ($definition18 === $definition || ReTidy::areSimilarDefinitions($definition18, $definition)) {\r\n\t\t\t\t\t\t\t\t\t$IsADuplicate = true;\r\n\t\t\t\t\t\t\t\t\tbreak 2;\r\n\t\t\t\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tif ($Existingdefinition16 === $definition || ReTidy::areSimilarDefinitions($Existingdefinition16, $definition)) {\r\n\t\t\t\t\t\t\t\t$IsADuplicate = true;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$IsADuplicate = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(!$IsADuplicate) {\r\n\t\t\tforeach($this->newAcronymsArray as $index => $value) {\r\n\t\t\t\t$acronym16 = $this->newAcronymsArray[$index][0];\r\n\t\t\t\t$Existingdefinition16 = $this->newAcronymsArray[$index][1];\r\n\t\t\t\tif(html_entity_decode($acronym16) === html_entity_decode($acronym)) {\r\n\t\t\t\t\tif(is_array($Existingdefinition16)) {\r\n\t\t\t\t\t\tforeach($Existingdefinition16 as $definition18) {\r\n\t\t\t\t\t\t\tif ($definition18 === $definition) {\r\n\t\t\t\t\t\t\t\t$IsADuplicate = true;\r\n\t\t\t\t\t\t\t\tbreak 2;\r\n\t\t\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif ($Existingdefinition16 === $definition) {\r\n\t\t\t\t\t\t\t$IsADuplicate = true;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\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}\r\n\t\tif(!$IsADuplicate) {\r\n\t\t\t$acronymExists = false;\r\n\t\t\tforeach($this->newAcronymsArray as $index => $value) {\r\n\t\t\t\t$acronym17 = $this->newAcronymsArray[$index][0];\r\n\t\t\t\t$definition17 = $this->newAcronymsArray[$index][1];\t\t\t\t\r\n\t\t\t\tif($acronym17 === $acronym) {\r\n\t\t\t\t\t$acronymExists = true;\r\n\t\t\t\t\tif(is_array($definition17)) {\r\n\t\t\t\t\t\t$this->newAcronymsArray[$index][1][] = $definition;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->newAcronymsArray[$index][1] = array($this->newAcronymsArray[$index][1], $definition);\r\n\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\tif(!$acronymExists) {\r\n\t\t\t\t$this->newAcronymsArray[] = array($acronym, $definition);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function validateSingleFitment($name) { \n\tglobal $pdo;\n\n\t$stmt = 'SELECT * FROM amasty_finder_value WHERE UPPER(name)=UPPER(:name)';\n\t$stmt = $pdo->prepare($stmt);\n\t$stmt->execute(['name' => $name]);\n\n\tif (sizeOf( $stmt->fetchAll(PDO::FETCH_COLUMN) ) > 0) return true;\n\telse return false;\n}", "public function findByAcronym($acronym)\n\t{\n\t $this->db->select()\n\t ->from($this->getSource())\n\t ->where(\"acronym = ?\");\n\n\t $this->db->execute([$acronym]);\n\t return $this->db->fetchInto($this);\n\t}", "function acronym($acronym) {\n\n if(array_key_exists($acronym, $this->acronyms)) {\n\n $title = $this->_xmlEntities($this->acronyms[$acronym]);\n\n $this->doc .= '<abbr title=\"'.$title\n .'\">'.$this->_xmlEntities($acronym).'</abbr>';\n\n } else {\n $this->doc .= $this->_xmlEntities($acronym);\n }\n }", "function is_reserved_name($str) {\n\t\t$reserved = array('name','value','content','parent','rank','password','timestamp');\n\t\tif(empty($str) || in_array($str, $reserved)) return true;\n\t\treturn false;\n\t}", "public function validate_abbreviation() {\n $errors = array();\n \n if ($this->abbreviation == '' || $this->abbreviation == null) {\n $errors[] = 'Lyhenne ei saa olla tyhjä.';\n }\n \n if (strlen($this->abbreviation) < 2 || strlen($this->abbreviation) > 9) {\n $errors[] = 'Lyhenteen pituuden tulee olla vähintään 2 ja enintaan 9 merkkiä.';\n }\n \n $previous_units = self::all();\n\n foreach ($previous_units as $u) {\n if (strcasecmp($u->abbreviation, $this->abbreviation) == 0) {\n $errors[] = 'Sama lyhenne löytyy jo tietokannasta.';\n }\n }\n \n return $errors;\n }", "function check_existing_standards($slug, $isCompetency) {\n\t$tax;\n\tif ($isCompetency)\n\t\t$tax = \"asn_index\";\n\telse $tax = \"asn_topic_index\";\n\t$term = get_term_by( \"slug\", $slug, $tax);\n\tif ($term !== false) {\n\t return true;\n\t}\n\telse return false;\t\n}", "function hasSynonyms($author)\r\n {\r\n $CI = &get_instance();\r\n $CI->db->select(\"*\");\r\n $CI->db->distinct();\r\n $CI->db->where(array('synonym_of'=>$author->author_id));\r\n $CI->db->from(\"author\");\r\n\t return ($CI->db->count_all_results() > 0);\r\n }", "function check_exists()\r\n\t{\r\n\t\t$name = url_title($this->input->post('name'));\r\n\r\n\t\t$exists = $this->item_definition_model->check_exists(\r\n\t\t\t'name',\r\n\t\t\t$name,\r\n\t\t\t$this->input->post('id_item_definition')\r\n\t\t);\r\n\r\n\t\t$this->xhr_output($exists);\r\n\t}", "public function validateSchoolNameExistence($schoolName){\n $handle = $this->con->prepare(\"SELECT * FROM school WHERE schoolName = ?\");\n $handle->execute([$schoolName]); \n \n if($handle->rowCount()>0){\n return SCHOOL_NAME_AREADY_EXIST;\n }else{\n return SCHOOL_NAME_DOES_NOT_EXIT;\n }\n }", "public function hasReservedName()\n {\n return count($this->get(self::RESERVED_NAME)) !== 0;\n }", "public function getAcronymList() {\n return $this->_get(3);\n }", "public function validate_abbreviation() {\n $errors = array();\n \n if (!is_null($this->abbreviation) && $this->abbreviation != '') {\n if (strlen($this->abbreviation) > 12) {\n $errors[] = 'Lyhenteen pituuden tulee olla enintään 12 merkkiä.';\n }\n \n $other_departments = $this->other_departments();\n\n foreach ($other_departments as $d) {\n if (strcasecmp($d->abbreviation, $this->abbreviation) == 0) {\n $errors[] = 'Olet jo lisännyt samannimisen lyhenteen.';\n }\n }\n }\n \n return $errors;\n }", "function check_exists()\n\t{\n\t\t$name = url_title($this->input->post('name'));\n\n\t\t$exists = $this->content_type_model->check_exists(\n\t\t\t'name',\n\t\t\t$name,\n\t\t\t$this->input->post('id_content_type')\n\t\t);\n\n\t\t$this->xhr_output($exists);\n\t}", "function is_alias($name) {\n\n\tglobal $aliastable;\n\n\treturn isset($aliastable[$name]);\n}", "function check_for_attribute_term( $term_name ) {\n\tglobal $wpdb;\n\n\t$terms_table = $wpdb->prefix . \"terms\";\n\t$terms_sql = \"SELECT * FROM \" . $terms_table . \" WHERE name = '$term_name'\";\n\n\tif ( $wpdb->get_results($terms_sql, ARRAY_A) ) {\n\t\t$response = true;\n\t} else {\n\t\t$response = false;\n\t}\n\n\treturn $response;\n}", "function is_validaliasname($name) {\n\tif (!preg_match(\"/(:word:)/\", $name))\n\treturn true;\n\telse\n\treturn false;\n}", "public function getAcronymList() {\n return $this->_get(4);\n }", "public function getAcronymList() {\n return $this->_get(4);\n }", "public function getAcronymList() {\n return $this->_get(4);\n }", "function isValidShortName($name) {\n return preg_match('#^[a-z0-9]+$#i', $name);\n}", "public function check_availability_manager_name_exist_edit() {\n $availability_id = $this->input->post('availability_id');\n $name = $this->input->post('name', true);\n $result = $this->availabilityMaster_model->get_availability_manager_name_edit($name);\n if (count($result) === 0) {\n $response = true;\n } else {\n if ($result[0]['id'] === $availability_id) {\n $response = true;\n } else {\n $response = false;\n }\n }\n return $response;\n }", "function validate_artist_name($artist_name, $db) {\n try {\n $sql = \"SELECT * FROM artists WHERE name=:name;\";\n $stmt = $db->prepare($sql);\n $params = array(\"name\" => $artist_name);\n $stmt->execute($params);\n if (count($stmt->fetchAll()) <= 0) {\n // Artist name didn't exist, so add it in.\n $sql2 = \"INSERT INTO artists (name) VALUES (:name);\";\n $stmt2 = $db->prepare($sql);\n $params2 = array(\"name\" => $artist_name);\n $stmt->execute($params);\n success(\"added \" . $artist_name . \" to artists table.\");\n }\n success(\"artist name validated\");\n }\n catch (PDOException $ex) {\n catch_error(\"The artist failed to validate.\", $ex);\n }\n }", "function name_exist($conn, $username) {\n\t$sql = \"SELECT * FROM Officer WHERE Officer_Username = '$username';\";\n\t$result = mysqli_query($conn, $sql);\n\tif (mysqli_num_rows($result) > 0) {\n\t\treturn True;\n\t} else {\n\t\treturn False;\n\t}\n}", "function check_software_name()\n {\n $q = $this->db\n ->where('action_type', \"install\")\n ->where('computer_ser', $this->input->post('computer'))\n ->where('name', $this->input->post('sw_name'))\n ->where('company_id', $this->session->userdata('company_id'))\n ->limit(1)->get('software');\n\n if ($q->num_rows == 1)\n {\n return true;\n\n } else {\n\n return false;\n }\n }", "public static function cmpFqdnValidDataProvider() {}", "public function titleExists($title){ // returns true if title title in titles\n $stmt = $this->conn->prepare ( 'SELECT * FROM titles WHERE title = :title' );\n $stmt->bindParam ( ':title', $title );\n $stmt->execute ();\n $stmt->fetch ();\n if ($stmt->rowCount () === 0)\n return FALSE;\n else\n return TRUE;\n }", "public static function nameAvailable( $name )\n {\n Database::all();\n\n if( !(preg_replace(\"/[^0-9]+/\", \"\", $name) == $name) )\n {\n if( (count($name) <= 16) && (count($name) > 0) )\n {\n if( preg_replace(\"/[^a-z0-9]+/\", \"\", $name) == $name )\n {\n if( !Database::DB( $name ) )\n {\n return true;\n }\n else{ commandResult( 403, \"Database \" . $name . \" already exists.\" ); }\n }\n else{ commandResult( 400, \"Database name (\" . $name . \") must be lower case alphanumeric.\" ); }\n }\n else{ commandResult( 400, \"Database name (\" . $name . \") cannot be longer than 16 characters.\" ); }\n }\n else{ commandResult( 400, \"Database name (\" . $name . \") cannot be a number alone.\" ); }\n\n return false;\n }", "public function hasName()\n {\n return $this->get(self::NAME) !== null;\n }", "public function hasResourceName(){\n return $this->_has(1);\n }", "public function hasResourceName(){\n return $this->_has(1);\n }", "public function hasResourceName(){\n return $this->_has(1);\n }", "function license_exists($lic) {\n\tglobal $DB;\n\n\tif(!isset($lic) || empty($lic) || is_null($lic)) {\n\t\treturn true;\n\t}\n\t$lic = $DB->EscapeQueryStmt($lic);\n\t$DB->Query(\"SELECT COUNT(*) AS TOT FROM Account WHERE License = '{$lic}'\");\n\t$tot = $DB->GetRow();\n\treturn (isset($tot[\"TOT\"]) && intval($tot[\"TOT\"]) > 0);\n}", "function main_acronym($openKeys)\t{\n\t\tglobal $LANG, $BE_USER;\n\n\t\t$content.=$this->doc->startPage(\"RTE acronym\");\n\t\t$RTEtsConfigParts = explode(\":\",t3lib_div::_GP(\"RTEtsConfigParams\"));\n\t\t$RTEsetup = $BE_USER->getTSConfig(\"RTE\",t3lib_BEfunc::getPagesTSconfig($RTEtsConfigParts[5]));\n\t\t$thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup[\"properties\"],$RTEtsConfigParts[0],$RTEtsConfigParts[2],$RTEtsConfigParts[4]);\n\n\t\t$content.='\n\t<div class=\"title\" id=\"abbrType\">' . $LANG->getLL(\"Acronym\") . '</div>\n\t<fieldset id=\"type\">\n\t\t<legend>' . $LANG->getLL(\"Type_of_abridged_form\") . '</legend>\n\t\t<label for=\"abbreviation\" class=\"checkbox\">' . $LANG->getLL(\"Abbreviation\") . '</label><input type=\"radio\" name=\"type\" id=\"abbreviation\" value=\"abbreviation\" checked=\"checked\" onclick=\"setType();\" />\n\t\t<label for=\"acronym\" class=\"checkbox\">' . $LANG->getLL(\"Acronym\") . '</label><input type=\"radio\" name=\"type\" id=\"acronym\" value=\"acronym\" onclick=\"setType();\" />\n\t</fieldset>\n\t<fieldset id=\"selector\">\n\t\t<legend>' . $LANG->getLL(\"Defined_term\") . '</legend>\n\t\t<label for=\"termSelector\" class=\"fl\" id=\"termSelectorLabel\" title=\"' . $LANG->getLL(\"Select_a_term\") . '\">' . $LANG->getLL(\"Unabridged_term\") . '</label>\n\t\t<select id=\"termSelector\" name=\"termSelector\" title=\"' . $LANG->getLL(\"Select_a_term\") . '\"\n\t\t\tonChange=\"document.acronymForm.acronymSelector.selectedIndex=document.acronymForm.termSelector.selectedIndex; document.acronymForm.title.value=document.acronymForm.termSelector.options[document.acronymForm.termSelector.selectedIndex].value;\">\n\t\t\t<option value=\"\"></option>\n\t\t</select>\n\t\t<label for=\"acronymSelector\" id=\"acronymSelectorLabel\" title=\"' . $LANG->getLL(\"Select_an_acronym\") . '\">' . $LANG->getLL(\"Abridged_term\") . '</label>\n\t\t<select id=\"acronymSelector\" name=\"acronymSelector\" title=\"' . $LANG->getLL(\"Select_an_acronym\") . '\"\n\t\t\tonChange=\"document.acronymForm.termSelector.selectedIndex=document.acronymForm.acronymSelector.selectedIndex; document.acronymForm.title.value=document.acronymForm.termSelector.options[document.acronymForm.termSelector.selectedIndex].value;\">\n\t\t\t<option value=\"\"></option>\n\t\t</select>\n\t</fieldset>\n\t<fieldset>\n\t\t<legend>' . $LANG->getLL(\"Term_to_abridge\") . '</legend>\n\t\t<label for=\"title\" class=\"fl\" title=\"' . $LANG->getLL('Use_this_term_explain') . '\">' . $LANG->getLL('Use_this_term') . '</label>\n\t\t<input type=\"text\" id=\"title\" name=\"title\" size=\"60\" title=\"' . $LANG->getLL('Use_this_term_explain') . '\" />\n\t</fieldset>\n\t<div class=\"buttons\">\n\t\t<button type=\"button\" title=\"' . $LANG->getLL(\"OK\") . '\"onclick=\"return onOK();\">' . $LANG->getLL(\"OK\") . '</button>\n\t\t<button type=\"button\" title=\"' . $LANG->getLL(\"Delete\") . '\" onclick=\"return onDelete();\">' . $LANG->getLL(\"Delete\") . '</button>\n\t\t<button type=\"button\" title=\"' . $LANG->getLL(\"Cancel\") . '\" onclick=\"return onCancel();\">' . $LANG->getLL(\"Cancel\") . '</button>\n\t</div>';\n\t\n\t\t$content.= $this->doc->endPage();\n\t\treturn $content;\n\t}", "public static function IsATable($search){\n\t\t$DB = static::instance();\n\t\t$rtn = false;\n\t\tif(isset($DB->DB_AUTO_INSTALL)&&$DB->DB_AUTO_INSTALL){\n\t\t\t$tables = static::ShowTables();\n\t\t\t$rtn = in_array($search, $tables);\n\t\t\tif($DB->DB_DEBUG&&!$rtn)TRACE(\"IsATable() Did not find ( $search ) in table list.\");\n\t\t}\n\t\treturn $rtn;\n\t}", "private function isValid(){\n\n\t\tif (!$this->inputValidation->validateRequiredFields('Du måste i fylla både namn och kommentar.')){ return false; }\t\n\t\tif (!$this->inputValidation->regexValidation('/^[A-Za-zåäöÅÄÖ\\s]{2,64}$/', 'author', 'Namnet innehåller otillåtna tecken. (A-Ö, a-ö, 2-64 tecken)')){ return false; }\n\n\t\treturn true;\t\t\n\t}", "static function validation(string $qth): bool\n {\n $qth = strtoupper($qth);\n return preg_match(\"{\" . self::PATTERN . \"+$}AD\", $qth) === 1;\n }", "public function checkAuthor()\n {\n if ($this->author()) {\n return $this->author->name;\n }\n return 'N/A';\n }", "function exist($name, $db) {\n $resultSet = $db -> query(\"SELECT * from Pokedex WHERE name = '$name'\");\n $count = $resultSet->rowCount();\n return (!$count == 0);\n }", "function checkAuthors () {\n\t\tif ( count ( $this->authors) == 0 ) return ;\n\t\n\t\tif ( isset($this->existing_q) ) {\n\t\t\t$this->wd->loadItem ( $this->existing_q ) ;\n\t\t\t$i = $this->wd->getItem ( $this->existing_q ) ;\n\t\t\t$c1 = $i->getClaims ( $this->props['author'] ) ;\n\t\t\t$c2 = $i->getClaims ( $this->props['short author'] ) ;\n\t\t\t$this->invalidateExistingAuthors ( $c1 ) ;\n\t\t\t$this->invalidateExistingAuthors ( $c2 ) ;\n\t\t\t\n\t\t\t// Special case: Single author, one author already in item...\n\t\t\tif ( count($this->authors) == 1 && count($c1)+count($c2) == 1 ) {\n\t\t\t\t$this->authors[1]->hadthat = true ;\n\t\t\t}\n\t\t}\n\t}", "function identify_aminoacid_complete_name ($aa){\r\n $aa=strtoupper($aa);\r\n if (strlen($aa)==1){\r\n if ($aa==\"A\"){return \"Alanine\";}\r\n if ($aa==\"R\"){return \"Arginine\";}\r\n if ($aa==\"N\"){return \"Asparagine\";}\r\n if ($aa==\"D\"){return \"Aspartic Acid\";}\r\n if ($aa==\"C\"){return \"Cysteine\";}\r\n if ($aa==\"E\"){return \"Glutamic Acid\";}\r\n if ($aa==\"Q\"){return \"Glutamine\";}\r\n if ($aa==\"G\"){return \"Glycine\";}\r\n if ($aa==\"H\"){return \"Histidine\";}\r\n if ($aa==\"I\"){return \"Isoleucine\";}\r\n if ($aa==\"L\"){return \"Leucine\";}\r\n if ($aa==\"K\"){return \"Lysine\";}\r\n if ($aa==\"M\"){return \"Methionine\";}\r\n if ($aa==\"F\"){return \"Phenylalanine\";}\r\n if ($aa==\"P\"){return \"Proline\";}\r\n if ($aa==\"S\"){return \"Serine\";}\r\n if ($aa==\"T\"){return \"Threonine\";}\r\n if ($aa==\"W\"){return \"Tryptophan\";}\r\n if ($aa==\"Y\"){return \"Tyrosine\";}\r\n if ($aa==\"V\"){return \"Valine\";}\r\n }elseif (strlen($aa)==3){\r\n if ($aa==\"ALA\"){return \"Alanine\";}\r\n if ($aa==\"ARG\"){return \"Arginine\";}\r\n if ($aa==\"ASN\"){return \"Asparagine\";}\r\n if ($aa==\"ASP\"){return \"Aspartic Acid\";}\r\n if ($aa==\"CYS\"){return \"Cysteine\";}\r\n if ($aa==\"GLU\"){return \"Glutamic Acid\";}\r\n if ($aa==\"GLN\"){return \"Glutamine\";}\r\n if ($aa==\"GLY\"){return \"Glycine\";}\r\n if ($aa==\"HIS\"){return \"Histidine\";}\r\n if ($aa==\"ILE\"){return \"Isoleucine\";}\r\n if ($aa==\"LEU\"){return \"Leucine\";}\r\n if ($aa==\"LYS\"){return \"Lysine\";}\r\n if ($aa==\"MET\"){return \"Methionine\";}\r\n if ($aa==\"PHE\"){return \"Phenylalanine\";}\r\n if ($aa==\"PRO\"){return \"Proline\";}\r\n if ($aa==\"SER\"){return \"Serine\";}\r\n if ($aa==\"THR\"){return \"Threonine\";}\r\n if ($aa==\"TRP\"){return \"Tryptophan\";}\r\n if ($aa==\"TYR\"){return \"Tyrosine\";}\r\n if ($aa==\"VAL\"){return \"Valine\";}\r\n }\r\n}", "function addAcronym($acronym, $definition) {\r\n\t\t$acronymExists = false;\r\n\t\tforeach($this->newAcronymsArray as $index => $value) {\r\n\t\t\t$acronym17 = $this->newAcronymsArray[$index][0];\r\n\t\t\t$definition17 = $this->newAcronymsArray[$index][1];\t\t\t\t\r\n\t\t\tif($acronym17 === $acronym) {\r\n\t\t\t\t$acronymExists = true;\r\n\t\t\t\tif(is_array($definition17)) {\r\n\t\t\t\t\t$this->newAcronymsArray[$index][1][] = $definition;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->newAcronymsArray[$index][1] = array($this->newAcronymsArray[$index][1], $definition);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(!$acronymExists) {\r\n\t\t\t$this->newAcronymsArray[] = array($acronym, $definition);\r\n\t\t}\r\n\t}", "function is_username_available($username) {\n\t\t$this->db->select('1', FALSE);\n\t\t$this->db->where('LOWER(username)=', strtolower($username));\n\n\t\t$query = $this->db->get($this->table_name);\n\t\treturn $query->num_rows() == 0;\n\t}", "function hasAnonymizedResults()\n\t{\n\t\treturn ($this->getAnonymize() == self::ANONYMIZE_ON || \n\t\t\t$this->getAnonymize() == self::ANONYMIZE_FREEACCESS);\n\t}", "public function has($name)\n {\n return isset($this->suggesters[$name]);\n }", "function isNameViable(){\n\t$postName = filter_var($_POST['name'], FILTER_SANITIZE_SPECIAL_CHARS);\n\tif(strlen($postName) < 3){\n\t\treturn false;\n\t}\n\n\t$f = $postName[0]; #first letter is predicted class\n\t$s = $postName[1]; #second letter is actual class\n\t#third letter is '_'\n\tif(($f=='B' || $f=='D' || $f=='F' || $f=='L' || $f=='R') && \n\t\t($s=='B' || $s=='D' || $s=='F' || $s=='L' || $s=='R') &&\n\t\t$postName[2]=='_'){\n\t\t\treturn true;\n\t} else{\n\t\treturn false;\n\t}\n}", "public function hasName() {\n return $this->_has(3);\n }", "public function hasName() {\n return $this->_has(3);\n }", "public function hasName() {\n return $this->_has(3);\n }", "public function hasName() {\n return $this->_has(3);\n }", "public function unit_has_award()\n\t{\n\t\treturn true;\n\t}", "function is_nombre_empresa_available($nombre, $tabla)\n\t\t{\n\t\t\t$this->db->select('1', FALSE);\n\t\t\t$this->db->where('LOWER(nombre)=', strtolower($nombre));\n\t\t\tif( !is_null($tabla) ) {\n\t\t\t\t$query = $this->db->get( $tabla );\n\t\t\t} else {\n\t\t\t\t$query = $this->db->get('empresas');\n\t\t\t}\n\t\t\t\n\t\t\treturn $query->num_rows() == 0;\n\n\t\treturn NULL;\n\t}", "function getName($org){\n $query = \"SELECT org.name AS name FROM Organization AS org WHERE org.id= ?\";\n $q = $this->db->query($query, array($org));\n\n if($q->num_rows()==1){\n $row = $q->result()[0];\n return ucwords($row->name);\n }\n else\n return false;\n\n }", "public function checkTitle($title)\r\n {\r\n $model = new Ynidea_Model_DbTable_Ideas;\r\n $select = $model -> select()->where('title = ?',$title); \r\n $row = $model->fetchRow($select); \r\n if($row)\r\n return true;\r\n else\r\n return false; \r\n }", "public function getAwardByNameDB($name){\n \n global $DB;\n \n $record = $DB->get_record(\"bcgt_criteria_awards\", array(\"gradingstructureid\" => $this->id, \"name\" => $name), \"id\");\n return ($record) ? new \\GT\\CriteriaAward($record->id) : false;\n \n }", "private function isTitleValid($title) {\n\t\t// Ensure that the languageCode has a valid value\n\t\t$sql = \t<<<EOD\n\t\t\t\tSELECT *\n\t\t\t\tFROM T_ProductLanguage\n\t\t\t\tWHERE F_ProductCode=? \n\t\t\t\tAND F_LanguageCode=?\nEOD;\n\t\t$rs = $this->db->Execute($sql, array($title->productCode, $title->languageCode));\n\t\t\n\t\tswitch ($rs->RecordCount()) {\n\t\t\tcase 0:\n\t\t\t\t// There is no matching pair, raise an error\n\t\t\t\treturn false;\n\t\t\tdefault:\n\t\t}\n\t\t// Also make sure that Author Plus has a content location\n\t\t// But how to differentiate this from the above error? \n\t\t// Need to return an error code I suppose.\n\t\t// This is left for now. You get a double error message, but that is kind of OK\n\t\t// v3.5 Now dbContentLocation is tied to the field in DMS and is the direct database link\n\t\t//if ($title-> productCode == 1 && ($title->contentLocation == \"\" || $title->contentLocation == null))\n\t\tif ($title-> productCode == 1 && ($title->dbContentLocation == \"\" || $title->dbContentLocation == null))\n\t\t\treturn false;\n\t\t\t\n\t\treturn true;\n\t}", "function nameValidator() {\n\t\tglobal $firstname;\n\t\treturn ctype_alpha($firstname);\n\t}", "function requiresLookup($Card_Number) {\n $cardType = $this->determineCardType($Card_Number);\n if (strcasecmp(\"VISA\", $cardType) == 0 ||\n strcasecmp(\"MASTERCARD\", $cardType) == 0 ||\n strcasecmp(\"JCB\", $cardType) == 0) {\n return true;\n } else {\n return false;\n }\n }", "public function getAwardByShortName($name){\n \n if ($this->awards){\n \n foreach($this->awards as $award){\n \n if (strcasecmp($award->getShortName(), $name) == 0){\n return $award;\n }\n \n }\n \n }\n \n return null;\n \n }", "public static function LanguageExists($lang_abbrev)\n\t{\n\t\tglobal $objLogin;\n\t\t\n\t\tif($objLogin->IsLoggedInAs('owner','mainadmin','admin')){\n\t\t\t$used_on = ' AND (used_on = \\'global\\' || used_on = \\'back-end\\')';\t\t\t\t\n\t\t}else{\n\t\t\t$used_on = ' AND (used_on = \\'global\\' || used_on = \\'front-end\\')';\n\t\t}\n\t\t\n\t\t$sql = 'SELECT abbreviation\n\t\t\t\tFROM '.TABLE_LANGUAGES.'\n\t\t\t\tWHERE abbreviation = \\''.$lang_abbrev.'\\' '.$used_on.' AND is_active = 1';\n\t\tif(database_query($sql, ROWS_ONLY) > 0){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function hasName(){\n return $this->_has(1);\n }", "public function hasName(){\n return $this->_has(1);\n }", "public function hasName(){\n return $this->_has(1);\n }", "public function hasName(){\n return $this->_has(1);\n }", "public function hasName() {\n return $this->_has(2);\n }", "public function hasName() {\n return $this->_has(2);\n }", "public function hasName() {\n return $this->_has(2);\n }", "public function hasName() {\n return $this->_has(2);\n }", "public function hasName() {\n return $this->_has(2);\n }", "public function hasName() {\n return $this->_has(2);\n }", "public function hasName() {\n return $this->_has(2);\n }", "public function hasName() {\n return $this->_has(2);\n }", "public function hasName() {\n return $this->_has(2);\n }", "function exists(){\n\t\t$sql = 'SELECT barcode FROM barcodes\n\t\t\t\tWHERE barcode = \"'.$this->code.'\"';\n\t\t$this->DB->query($sql);\n\t\tif(!$this->DB->isEmpty())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->error = 'The barcode <strong>'.$this->code.'</strong> was not properly pre-registered. Please put this wristband aside, and distribute a new one.';\n\t\t\treturn false;\n\t\t}\n\t}", "public function hasTitle(){\n return $this->_has(37);\n }", "public function hasName() {\n return $this->_has(1);\n }", "public function hasName() {\n return $this->_has(1);\n }", "public function hasName() {\n return $this->_has(1);\n }", "public function hasName() {\n return $this->_has(1);\n }", "public function canStoreDisplayname();", "function _name_check($str){\n }", "function valid_item_name ($item_name) {\n if ( empty($item_name) )\n return false;\n else \n return true;\t\n}", "public function hasName(){\r\n return $this->_has(1);\r\n }", "function displayNameExists($displayname) {\n global $mysqli, $db_table_prefix;\n $stmt = $mysqli->prepare(\"SELECT active\n\t\tFROM \" . $db_table_prefix . \"users\n\t\tWHERE\n\t\tdisplay_name = ?\n\t\tLIMIT 1\");\n $stmt->bind_param(\"s\", $displayname);\n $stmt->execute();\n $stmt->store_result();\n $num_returns = $stmt->num_rows;\n $stmt->close();\n\n if ($num_returns > 0) {\n return true;\n } else {\n return false;\n }\n}" ]
[ "0.7799044", "0.7735638", "0.7735638", "0.7735638", "0.6733427", "0.6639552", "0.6571099", "0.60167205", "0.60090566", "0.59095514", "0.58940625", "0.5881327", "0.5745805", "0.553895", "0.54477906", "0.5426029", "0.54233855", "0.53922796", "0.5370007", "0.53496605", "0.5341746", "0.53348935", "0.5322173", "0.52944916", "0.52885246", "0.52646685", "0.5261518", "0.52521265", "0.5243307", "0.5231177", "0.5225499", "0.5224568", "0.52129877", "0.52008724", "0.52008724", "0.52008724", "0.5180636", "0.518063", "0.5180577", "0.51666", "0.51653385", "0.51642966", "0.5159697", "0.5157752", "0.515289", "0.5148881", "0.5148881", "0.5148881", "0.5142772", "0.5134466", "0.5124088", "0.5121022", "0.5116214", "0.51115406", "0.5103586", "0.5089398", "0.5088017", "0.50799197", "0.50748014", "0.50744754", "0.5070674", "0.5069452", "0.5067656", "0.5067656", "0.5067656", "0.5067656", "0.5067248", "0.5059332", "0.5055133", "0.5033807", "0.5027881", "0.5017991", "0.5011037", "0.5005257", "0.5002529", "0.49998486", "0.49978095", "0.49978095", "0.49978095", "0.49978095", "0.49966753", "0.49966753", "0.49966753", "0.49966753", "0.49966753", "0.49966753", "0.49966753", "0.49966753", "0.49966753", "0.49942362", "0.4993912", "0.49871016", "0.49871016", "0.49871016", "0.49871016", "0.49772733", "0.49745488", "0.4970572", "0.4964618", "0.49641266" ]
0.685432
4
Helper method to get a user in DB via an acronym. Uses the acronym to get the users acronym from DB.
private function getUserFromDb($userDb, $acronym) { $user = $userDb->query('acronym') ->where('acronym = ?') ->execute([$acronym]); return $user; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findByAcronym($acronym)\n\t{\n\t $this->db->select()\n\t ->from($this->getSource())\n\t ->where(\"acronym = ?\");\n\n\t $this->db->execute([$acronym]);\n\t return $this->db->fetchInto($this);\n\t}", "public function fetchByAcronym($acronym)\n {\n $this->db->select()\n ->from($this->getSource())\n ->where(\"acronym = ?\");\n \n $this->db->execute([$acronym]);\n return $this->db->fetchInto($this);\n }", "public function GetAcronym() {\n\t\t$user = self::GetUserProfile();\n\t\treturn $user['akronym'];\n\t}", "function cicleinscription_get_user_by_username($username){\n\tglobal $DB;\n\treturn $DB->get_record('user', array('username'=>$username));\n}", "function get_user($user_id){\n\tglobal $connection;\n\t$get_user= mysqli_query($connection,\"SELECT * FROM kp_users WHERE user_id='$user_id'\");\n\t$row = mysqli_fetch_assoc($get_user);\n\t$name = strtoupper($row['username']);\n\treturn $name;\n}", "function get_user_by_user_name($user_name)\n{\n global $conn;\n $q['query'] = \"SELECT * FROM `user_master` WHERE `user_name`='$user_name'\";\n $q['run'] = $conn->query($q['query']);\n $q['result'] = $q['run']->fetch_assoc();\n\n return $q['result'];\n}", "function getname($username,$db,$name) {\n\n\t$selection = \"SELECT $name FROM users WHERE email='$username'\";\n\t$result = select($selection,$db);\n\n\tif (mysqli_num_rows($result) > 0) {\n\t\t$row = mysqli_fetch_assoc($result);\n\t}\n\treturn ucfirst($row[$name]); /* uppercase first letter */\n\n}", "public static function GetByUserName ($userName);", "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 getAuthorByID($id, $db) {\n $sql = \"SELECT * FROM User WHERE UserID = {$id};\";\n $result = mysqli_query($db, $sql);\n if($result) {\n return mysqli_fetch_assoc($result);\n } else {\n return NULL;\n }\n}", "public static function get_by_user_name($user_name) {\n\t\t$db = db::get_instance();\n\t\t\n\t\t$query = sprintf(\"SELECT * FROM users\n\t\t WHERE `user_name` = '%s'\",\n\t\t $db->db_escape($user_name));\n\t\t \n\t\t return $db->db_fetch($query);\n\t}", "public function get_user_by_id($user_id, $organization_id);", "function getUsername($user_id){\n $this->load( array( \"id=?\", $user_id ));\n return $this->query[0];\n }", "public function fetchUserByUserName($username);", "public function getUserWithUsername($username);", "function retrieveUser($username) {\r\n // Database connection\r\n $db = dbConnect();\r\n\r\n $sql = 'SELECT * FROM User WHERE username=:username';\r\n $sth = $db->prepare($sql);\r\n $sth->execute(array(':username' => $username));\r\n\r\n return $sth->fetch();\r\n}", "public static function get_by_name($conn, $name) {\n\t\t$query = $conn->prepare('SELECT * FROM users WHERE name = ?;');\n\t\t$query->bind_param(\"s\", $user->name);\n\t\tif ($query->execute() == false) return null;\n\n\t\t//Create the object from the retrieved data\n\t\t$res = $query->get_result();\n\t\t$row = $res->fetch_assoc();\n\t\t$user = new User($row['id'], $row['name'], $row['email'], $row['pw']);\n\t\treturn $user;\n\t}", "public function getAcronym();", "public function getByName(string $name): User;", "public static function get_user($user_id);", "public function retrieveByUsername($username, $isActive = true)\n {\n // Define query.\n $query = Doctrine_Core::getTable('klUser')->createQuery('u')\n ->where('u.username = ?', $username)\n ->addWhere('u.is_active = ?', (int) $isActive);\n \n return $query->fetchOne();\n }", "public function get_user_by_email_address($email_address, $organization_id);", "function get_user_by_userid($db, $userid)\n{\n\n\t$sql = 'SELECT * FROM users where id='.$userid;\n\t$st = $db->prepare($sql);\n\t$st->execute();\n\t$us = $st->fetchAll();\n\treturn $us[0];\n}", "private function isAcronymAvailable($userDb, $acronym)\n {\n $isAcronymAvailable = true;\n\n $user = $this->getUserFromDb($userDb, $acronym);\n if (isset($user[0]) && (strcmp($user[0]->acronym, $acronym) === 0)) {\n $isAcronymAvailable = false;\n }\n\n return $isAcronymAvailable;\n\n }", "function Obtenernameuser($identificador){\n\n\tglobal $database_softPark, $softPark, $mysqli;\n\t#mysql_select_db($database_softPark, $softPark);\n\t$query_consultafuncion = sprintf(\"SELECT users.FirstName FROM users WHERE Id= %s\",$identificador);\n\t$consultafuncion = $mysqli->query($query_consultafuncion) or die(mysqli_error());\n\t$row_consultafuncion = $consultafuncion->fetch_assoc();\n\t#$totalRows_consultafuncion = $row_consultafuncion->num_rows;\n\treturn $row_consultafuncion['FirstName']; \n\tmysqli_free_result($consultafuncion);\n}", "function get_user($userName){\n return get_user_object($userName);\n}", "function get_user_by_ID($id){\n global $database;\n $query = \"SELECT * FROM \".TABLE_PREFIX.\"users WHERE ID = \" . $id;\n return $database->query( $query );\n}", "function getUserName($db, $code)\n{\n $strReslt = \"\";\n if ($code != \"\") {\n $code = trim($code);\n $strSQL = \"SELECT name FROM adm_user WHERE id_adm_user = '$code'\";\n $resDb = $db->execute($strSQL);\n if ($rowDb = $db->fetchrow($resDb)) {\n $strResult = $rowDb['name'];\n }\n } else {\n $strResult = \"\";\n }\n return $strResult;\n}", "function getUserId($user_name){\n return sqlSelectOne(\"SELECT * FROM users WHERE user_username='$user_name'\", 'user_id');\n}", "function get_caf_user($uname) {\r\n $this->load->database();\r\n $this->db->select('*');\r\n $this->db->from('users');\r\n $this->db->where(\"email\", $uname);\r\n $this->db->limit(1);\r\n $query = $this->db->get();\r\n $this->db->close();\r\n if ($query->num_rows() > 0) {\r\n return $query->row();\r\n } else {\r\n return FALSE;\r\n }\r\n }", "function get_user_acc_info($username){\r\n\tglobal $dbc;\r\n\t\r\n\t$query = 'SELECT u_id, firstname, lastname, email, street1, street2, city, zip, state, phone '.\r\n\t\t\t 'FROM user '.\r\n\t\t\t 'WHERE username = \\''. $username .'\\'';\r\n\t\r\n\t$result = mysqli_query($dbc, $query);\r\n\tif(!$result){\r\n\t\treturn 0;\r\n\t}\r\n\telse {\r\n\t\t$row = mysqli_fetch_object($result);\r\n\t\treturn $row;\r\n\t}\r\n}", "function getUserFullName($user_id)\n{\n $user = \\Illuminate\\Support\\Facades\\DB::table('saas_users')->where('id', $user_id)->get(array('name'));\n $name = $user[0]->name;\n return $name;\n}", "public function GetAcronym() \n {\n return $this->acronym;\n }", "function selectAccountByUserId($id) {\n $connection = openDb();\n $id = escape($id,$connection);\n $id = (int) $id;\n\n //Using prepared statements and parameterized queries:\n $sql = \"SELECT * FROM accounts WHERE USER = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"i\",$id);\n\n return executeQueryPrepared($stmt, $connection, true);\n}", "function ObtenerApellidoUsuario($apellido)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT surname FROM users WHERE id_user = %s \",\n\t\t GetSQLValueString($apellido, \"int\"));\n\t//echo $query_ConsultaFuncion;\n\t$ConsultaFuncion = mysqli_query($con, $query_ConsultaFuncion) or die(mysqli_error($con));\n\t$row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion);\n\t$totalRows_ConsultaFuncion = mysqli_num_rows($ConsultaFuncion);\n\t\n\treturn $row_ConsultaFuncion[\"surname\"];\t\n\t\n\tmysqli_free_result($ConsultaFuncion);\n}", "function getUsername($id){\n return sqlSelectOne(\"SELECT * FROM users WHERE user_id={$id}\", 'user_username');\n}", "function FindUser($User) {\n $User = str_replace('ZZ ', '', $User);\n\n //separa o primeiro nome do sobrenome\n $name_complete = explode(' ', $User);\n $user_name = array_shift($name_complete);\n $user_lastname = implode(' ', $name_complete);\n\n $Read = new WsUsers();\n\n $Read->setUser_name($user_name);\n $Read->setUser_lastname($user_lastname);\n $Result = $Read->Execute()->Query(\"user_name like '%{$user_name}%' AND user_lastname like '%{$user_lastname}%'\");\n\n if (!empty($Result)):\n return $Result[0]->user_id;\n endif;\n}", "public function retrieveByUsernameOrEmailAddress($username, $isActive = true)\n {\n // Define query.\n $query = Doctrine_Core::getTable('klUser')->createQuery('u')\n ->where('u.username = ? OR u.email_address = ?', array($username, $username))\n ->addWhere('u.is_active = ?', $isActive);\n\n return $query->fetchOne();\n }", "function getUsername($id) { // Returns name of user with given id\n\t$id = intval($id);\n\treturn(dbFirstResult(\"SELECT username FROM users WHERE id=$id\"));\n}", "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}", "function get_one_user($username, $password){\n global $db;\n $query = \"SELECT * FROM users \n WHERE userName = :username AND \n password = :password\";\n $statement = $db->prepare($query);\n $statement->bindValue(':username', $username);\n $statement->bindValue(':password', $password);\n $statement->execute();\n $user = $statement->fetch();\n $statement->closeCursor();\n return $user; \n }", "function retrieveUserByAccessToken($accessToken);", "function find_user($user_id)\n{\n global $db;\n $sql = \"SELECT * FROM users WHERE id = :user_id;\";\n $params = array(':user_id' => $user_id);\n $users = exec_sql_query($db, $sql, $params)->fetchAll();\n if ($users) {\n return $users[0];\n }\n return NULL;\n}", "function getByUser(User $user);", "public function findByOwnerOrderByAcronym(User $user) {\r\n $qb = $this->createQueryBuilder('i');\r\n $qb = $this->qbByOwners($qb, $user);\r\n $qb = $this->qbReachByUser($qb, $user);\r\n $qb = $this->qbOrderByAcronym($qb);\r\n\r\n return $qb->getQuery()->getResult();\r\n }", "public function GetByUsername($username);", "function get_user($user_name){\n include('../../common/database/config.php');\n\n $sql = 'SELECT id,name from users where name =\"'.$user_name.'\"';\n $res = mysqli_query($conn,$sql);\n $res_array = mysqli_fetch_assoc($res, MYSQLI_ASSOC);\n\n return $res_array;\n}", "function cicleinscription_get_user_by_id($userid){\n\tglobal $DB;\n\treturn $DB->get_record('user', array('id'=>$userid));\n}", "function getUserByUsername($username)\n {\n if($this->table_name == \"users\"){\n $query = \"SELECT * FROM users WHERE username = '{$username}'\";\n $result = $this->db_connect->query($query);\n if (!$result) {\n die(\"Unable to retrieve username: \" . $this->db_connect->error);\n } else {\n return $result->fetch_assoc();\n }\n }else{\n return null;\n }\n }", "function findUser($acc,$pass){\n\t\tUtilidades::_log(\"findUser($acc,***)\");\n\t\t$db=DB::conectar();\n\t\t$select=$db->prepare('SELECT * FROM user WHERE account=:account');\n\t\t$select->bindValue('account',$acc);\n\t\t$select->execute();\n\t\t$row=$select->fetch();\n\t\t$user = null;\n\t\t//Verifica si la clave es correcta\n\t\tif (password_verify($pass, $row['pass'])){\n\t\t\t//Si es correcta\n\t\t\t$user=new UserDAO($row);\n\t\t\tUtilidades::_log('pass Correcta');\n\t\t}\n\t\tUtilidades::_log('id: '.$row['id']);\n\t\treturn $user;\n\t}", "public function retrieve_user($user)\n{\t\t\n $uid=$user->__get('uid');\n\t$con = connect();\n\t$q1 = mysqli_query($con, \"SELECT * FROM user WHERE UId = '$uid'\");\n\treturn $q1;\n}", "public function retrieveByUsername($username, $isActive = true)\n {\n $query = Doctrine_Core::getTable('sfGuardUser')->createQuery('u')\n ->where('u.username = ?', $username)\n ->addWhere('u.is_active = ?', $isActive)\n ;\n\n return $query->fetchOne();\n }", "function find_user($db, $user_id)\n{\n $records = exec_sql_query(\n $db,\n \"SELECT * FROM users WHERE id = :user_id;\",\n array(':user_id' => $user_id)\n )->fetchAll();\n if ($records) {\n // users are unique, there should only be 1 record\n return $records[0];\n }\n return NULL;\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 }", "public function getUser($surname, $firstname)\n {\n return self::getModel(\"users WHERE firstname = '$firstname' AND surname = '$surname'\", \"*\");\n }", "function getUsername($userId){\n return getSingleValue(\"SELECT `username` FROM `private_users` WHERE `id` =\" . escape(intval($userId)) . \" LIMIT 0, 1\");\n }", "function find_user($user_id) {\n global $db;\n $sql = \"SELECT * FROM users WHERE id = :user_id;\";\n $params = array(\n ':user_id' => $user_id\n );\n $records = exec_sql_query($db, $sql, $params)->fetchAll();\n if ($records) {\n // user_id is a unique field, so only 1 record should be selected.\n return $records[0];\n }\n // if nothing is returned earlier, then return NULL\n return NULL;\n}", "function getPostAuthorById($user_id)\n{\n\tglobal $conn;\n\t$sql = \"SELECT username FROM users WHERE id=$user_id\";\n\t$result = mysqli_query($conn, $sql);\n\tif ($result) {\n\t\t// return username\n\t\treturn mysqli_fetch_assoc($result)['username'];\n\t} else {\n\t\treturn null;\n\t}\n}", "public function findUserByName($name)\r\n {\r\n $user = $this->DB->fetchAssoc('select * from user where LOWER(name) = LOWER(?)',array($name));\r\n $user = $this->reformatUserData($user);\r\n return $user;\r\n }", "function get_user($name) {\n $conn = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_DATABASE);\n $query = mysqli_query($conn, \"SELECT * FROM users WHERE name='$name'\");\n return $query;\n}", "public function loadUser(ArenaAuthUser $user): ArenaAuthUser;", "function getFirstName() {\n\t$COMMON = new Common($debug);\n\t$uID = $_SESSION[\"userID\"];\n\n\t$sql = \"select * from Proj2Advisors where `id` = '$uID'\";\n\t$rs = $COMMON->executeQuery($sql, $_SERVER[\"SCRIPT_NAME\"]);\n\t$row = mysql_fetch_row($rs);\n\n\t$name = $row[1];\n\treturn $name;\n}", "public function findUserByUsername($username);", "public function findUserByUsername($username);", "public function findUserByUsername($username);", "function ldap_get_user($username_or_email, $db) {\n if( is_mail($username_or_email) && $db->mailExists($username_or_email) ) {\n return $db->getUserWithMail($username_or_email);\n }\n if($db->userExists($username_or_email)) {\n return $db->getUser($username_or_email);\n }\n return false;\n}", "function findById($id){\n\t\tUtilidades::_log(\"findById($id)\");\n\t\t$query = \"SELECT id,name,account,surnames,email,pass,address,access\n\t\t\t\t\tFROM user WHERE id = $id\";\n\t\t$row = DB::ejecutarConsulta($query);\n\t\t\n\t\treturn new UserDAO($row[0]);\n\t}", "function searchUser()\t{\n\t\t$position = mt_rand(1, $this->rnd_users_number);\n $query = \"select user from \".self::RNDUSERSC_NAME.\" where id=\".$position;\n if ($result = $this->db_conn->query($query)) {\n $row = $result->fetch_assoc();\n return $row[\"user\"];\n }\n else {\n die (\"Error sending the query '\".$query.\"' to MySQL\");\n }\n\t}", "function get_name_by_uid($uid)\r\n\t{\r\n\t\t$this->load->database();\r\n\t\t$str = \"SELECT firstname\r\n\t\t\t\tFROM users\r\n\t\t\t\tWHERE uid=?;\";\r\n\t\t\t\t\r\n\t\t$data = array($uid);\r\n\t\t\r\n\t\t$query = $this->db->query($str, $data);\r\n\t\t\r\n\t\t// return the single record with this user's name, \r\n\t\t// or return NULL if a user with given uid was not found\r\n\t\tif ($query->num_rows() > 0)\r\n\t\t\treturn $query->row();\r\n\t\telse\r\n\t\t\treturn NULL;\r\n\t}", "function get_user_by_id($user_id) {\n\t\t$this->db->where('id', $user_id);\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}", "function getUserName($us_id)\n\t{\n\t\t$func = create_function('$id',$this->UserNameFunc);\n\t\treturn $func($us_id);\n\t}", "public function findUserById()\n {\n $this->db->query('SELECT * FROM user WHERE id = :id');\n $this->db->bind(':id', $_SESSION['id']);\n \n $row = $this->db->single();\n \n return $row; \n }", "function getFrontUserNameById($id){\r\n\r\n\t$res = 0;\r\n\r\n\t$ci = & get_instance();\r\n\r\n\t$ci->db->select('first_name, user_email_phone');\r\n\r\n\t$ci->db->from('buzz_user');\r\n\r\n\t$ci->db->where(array('status'=>'1', 'user_id'=>$id));\r\n\r\n \t$query = $ci->db->get();\r\n\r\n\t\r\n\r\n\tif ($query->num_rows() > 0) {\r\n\r\n\t\t$res = $query->result_array();\r\n\r\n\t\tif($res[0]['first_name'])\r\n\r\n\t\t\t$res = ucfirst($res[0]['first_name']);\r\n\r\n\t\telse\r\n\r\n\t\t\t$res = ucfirst($res[0]['user_email_phone']);\r\n\r\n \t}\r\n\r\n\treturn $res;\r\n\r\n}", "private function _getUser($principalUri) {\n\n\t\t$username = basename($principalUri);\n\n\t\treturn \\GO\\Base\\Model\\User::model()->findSingleByAttribute('username', $username);\n\t}", "public function retrieveByUsername($username);", "function alias($alias) {\r\n $db = new MySQL();\r\n $sql = \"SELECT * FROM `usuarios_usuarios` WHERE(`alias` = '\" . $alias . \"');\";\r\n $consulta = $db->sql_query($sql);\r\n $fila = $db->sql_fetchrow($consulta);\r\n $db->sql_close();\r\n return($fila['usuario']);\r\n }", "public static function getUserName($user_id);", "function getUserAccountInfo($userName) {\n\t\n\t\tglobal $dbh;\n\t\t$userAccount = new UserAccount();\n\n\t\t\n\t\t$sql = \"SELECT userName, password, roleId FROM agents WHERE userName = '\" . $userName . \"'\";\n\t\ttry {\n\t\t\tgetDBConnection();\n\t\t\t\n\t\t\t/*$stmt = mysqli_prepare($dbh, $sql);\n\n\t\t\tmysqli_stmt_bind_param($stmt, \"s\", $userName);*/\n\t\t\t\n\t\t\t$result = mysqli_query($dbh, $sql);\n\t\t\t\n\t\t\tif(!$result) {\n\t\t\t\tprint(\"Query failed: \" . mysqli_errno($dbh) . \"--\" . mysqli_error($dbh) . \"<br/>\");\n\t\t\t\texit();\n\t\t\t}\n\t\t\t\n\t\t\t/*$_SESSION[\"message\"] .= print_r($stmt);\n\t\t\t$result = mysqli_stmt_execute($stmt);*/\n\t\t\t\n\t\t\twhile ($values = mysqli_fetch_object($result)) {\n\t\t\t\t$userAccount -> setUserAccount($values);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tprint_r($userAccount);\n\n\t\t\tif($userAccount -> userName == \"\") {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn $userAccount;\n\t\t} catch (Exception $e){\n\t\t\tprint \"<br/> $e\";\n\t\t} finally {\n\t\t\tcloseDBConnection();\n\t\t}\n\t}", "function get_user($username){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn \t-> prepare('SELECT *\n\t\t\t\t\t\t\t\t\t\tFROM `clients`\n\t\t\t\t\t\t\t\t\t\tWHERE `username` = ?');\n\t\t$sth \t-> execute(array($username));\n\t\treturn \t$sth ;\n\t}", "public function getByUserName(string $userName) : ?User;", "protected function getDbUserByAlias($userKey)\n {\n if (! filter_var($userKey, FILTER_VALIDATE_EMAIL)) {\n // This function only makes sense for actual email addresses.\n return null;\n }\n \n $allUsers = $this->getAllDbUsers();\n \n foreach ($allUsers as $aUser) {\n if (! isset($aUser['data'])) {\n continue;\n }\n \n $userData = json_decode($aUser['data'], true);\n if ($userData === null) {\n continue;\n }\n \n $primaryEmail = isset($userData['primaryEmail']) ? $userData['primaryEmail'] : null;\n \n $aliasesResource = $this->getAliasesForUser($primaryEmail);\n if ($aliasesResource) {\n foreach ($aliasesResource['aliases'] as $aliasResource) {\n $alias = $aliasResource['alias'];\n if (strcasecmp($alias, $userKey) === 0) {\n return $aUser;\n }\n }\n }\n }\n \n return null;\n }", "function getaem($usern){\r\n\r\n\tglobal $conn;\r\n\r\n\t$q = \"SELECT * FROM users WHERE username='\".$usern.\"' \";\r\n\r\n\t$result = mysql_query($q,$conn);\r\n\r\n\t$row=mysql_fetch_array($result);\r\n\r\n\treturn $row['aem'];\r\n\r\n}", "public function getUser($owner = null)\n {\n if($owner === null)\n $owner = $this->owner;\n\n $res = $this->db->select(\"SELECT * FROM `{$this->domainUser}` WHERE itemName()='{$owner}'\", array('ConsistentRead' => 'true'));\n $this->logErrors($res);\n if(isset($res->body->SelectResult->Item))\n return self::normalizeUser($res->body->SelectResult->Item);\n elseif(isset($res->body->SelectResult))\n return null;\n else\n return false;\n }", "public function getUser($db, $username, $id)\n {\n\n $query = \"SELECT username FROM users WHERE id = :userid\";\n $pdostmt2 = $db->prepare($query);\n $pdostmt2->bindValue(\":userid\", $id);\n $pdostmt2->bindValue(\":username\", $username);\n /*$result = */$pdostmt2->execute();\n $userFetch = $pdostmt2->fetch(PDO::FETCH_ASSOC);\n $pdostmt2->closeCursor();\n return $userFetch;\n }", "function getusername($uid) {\n\t$sql = \"SELECT username FROM users WHERE id='\".$uid.\"' LIMIT 1\";\n\t$res = mysql_query($sql) or die(mysql_error());\n\t$row = mysql_fetch_assoc($res);\n\treturn $row['username'];\n}", "public function findUserByName($name){\r\n $this->db->query('SELECT * FROM users WHERE name = :name');\r\n // Bind value\r\n $this->db->bind(':name', $name);\r\n $row = $this->db->single();\r\n // Check row\r\n if($this->db->rowCount() > 0){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "function get_user_by_username($username) {\n $read_json = file_get_contents(__DIR__ . '/data_users.json');\n $data = json_decode($read_json, JSON_OBJECT_AS_ARRAY);\n\n // iterate over db, if username is found, return user\n foreach ($data as $user){\n if ($user[\"username\"] == $username){\n return $user;\n }\n }\n return false;\n}", "function get_user_name($user_id){\n //not current user\n //return userid or false for failure\n //\n $sql = \"SELECT * from Users WHERE Id='$user_id'\";\n $result = mysqli_query(Db::$conn, $sql);\n if (mysqli_num_rows($result) > 0) {\n $row = mysqli_fetch_assoc($result);\n return $row['Username'];\n } else\n return false;\n}", "function get_user_by($field, $value)\n {\n }", "function get_user() {\n // $query = $this->db->where('id', 1)->get('user', 1);\n $query = $this->db->get_where('user', array('id'=>1),1);\n \n return $query->row();\n }", "function getUsername($userId){\n\n global $conn;\n\n # get username with SQL Query\n $sql = \"SELECT `username` FROM `user` WHERE `userId` = $userId \";\n $result = mysqli_query($conn, $sql);\n $row = mysqli_fetch_assoc($result);\n $username = $row['username'];\n\n if ($userId == $_SESSION['userId']) {\n\n\n return \"<a class='username' href='../View/OwnProfile.php'>$username</a>\";\n } else {\n\n return \"<a class='username' href='../View/UserProfile.php?id=$userId'>$username</a>\";\n }\n\n}", "public function get ( $username ){\n $result = $this->_db->prepare('SELECT * FROM mas_accounts WHERE username = :username');\n $result->execute(array(':username' => $username));\n if (($result->rowCount() == 0)){\n return false;\n } else {\n $account = $result->fetch( PDO::FETCH_ASSOC );\n return $account;\n }\n }", "function get_user_by_user_id($user_id)\n{\n global $conn;\n $q['query'] = \"SELECT * FROM `user_master` WHERE `user_id`='$user_id'\";\n $q['run'] = $conn->query($q['query']);\n $q['result'] = $q['run']->fetch_assoc();\n\n return $q['result'];\n}", "public function getTheUser($userId)\r\n {\r\n\r\n $stmt = $this->connection()->prepare(\"SELECT * FROM users WHERE id=?\");\r\n \r\n $stmt->execute([$userId]);\r\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\r\n return $results;\r\n }", "public function loadUserByUsername($username);", "public function get_username($id) {\n $conn = db();\n $sql = \"SELECT username FROM user WHERE id = $id\";\n $result = $conn->query($sql);\n $user_data = $result->fetch_assoc();\n echo $user_data['username'];\n }", "function getUserFromId($userId) {\n $statement = 'SELECT id, username, email, role_id, banned FROM USER WHERE id = (?)';\n $query = $this->prepare($statement);\n $query->execute([$userId]);\n return $query->fetch();\n }", "function getUserNameById($id) {\n global $pdo;\n $statement = $pdo->prepare('SELECT `firstname`, `lastname` FROM `user` WHERE `id` = :id');\n $statement->bindParam(\":id\", $id);\n $statement->execute();\n return $statement->fetch(PDO::FETCH_ASSOC);\n}", "function selectByUsername($username, $isMayacaptive = TRUE){\n $column = \"\";\n if($isMayacaptive){\n $column = \"vis_correo\";\n } else{\n $column = \"username\";\n }\n $this->db->where($column, $username);\n $result = $this->db->get($this->table);\n return $result->row();\n }", "function findUser($conn, $id){\r\n $q = \"SELECT * FROM Users WHERE userID=\".$id;\r\n $result = mysqli_query($conn,$q);\r\n $username=\"\";\r\n if(!$result){\r\n $username=\"Unknown\";\r\n } else {\r\n $row = mysqli_fetch_assoc($result);\r\n $username = $row['username'];\r\n }\r\n return $username;\r\n }" ]
[ "0.67773736", "0.6362282", "0.61787075", "0.606601", "0.6042187", "0.59948313", "0.5966892", "0.5964983", "0.59612423", "0.58602524", "0.58297545", "0.582484", "0.5721593", "0.5719937", "0.5708765", "0.56977713", "0.56977016", "0.5697124", "0.5677187", "0.5668654", "0.56535333", "0.56513256", "0.5650506", "0.56475675", "0.56383306", "0.56333953", "0.5628876", "0.5615527", "0.5603938", "0.55593085", "0.5545234", "0.5527857", "0.55233574", "0.5509558", "0.5505463", "0.54939723", "0.5490596", "0.5485785", "0.54846036", "0.54805917", "0.5475737", "0.54641217", "0.54530644", "0.54519796", "0.54494184", "0.54451543", "0.543896", "0.54368097", "0.5434348", "0.5431701", "0.54305315", "0.54303306", "0.5425306", "0.5423897", "0.5419928", "0.5414141", "0.540271", "0.5397073", "0.53944594", "0.53930926", "0.538801", "0.5383155", "0.5373505", "0.5373505", "0.5373505", "0.5372632", "0.53590065", "0.53483087", "0.5345642", "0.5340189", "0.53353053", "0.533318", "0.5323509", "0.5320261", "0.5318019", "0.531271", "0.5308642", "0.5304761", "0.5303126", "0.5302075", "0.5297872", "0.52965426", "0.5286796", "0.52863145", "0.528434", "0.52767867", "0.52726173", "0.5268066", "0.5266038", "0.52618366", "0.52582514", "0.5257138", "0.52532727", "0.5252445", "0.52519816", "0.52482116", "0.52481014", "0.52449995", "0.52445626", "0.524432" ]
0.7313081
0
Callback at success. Prints out a welcome message for the user who creates a new account. Redirects back to the form.
public function callbackSuccess() { $this->AddOutput("<p><i>Välkommen till Allt Om Landskapsfotografering! Ditt användare id är: " . $this->acronym . " </i></p>"); $this->redirectTo(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createAccountSuccess()\n {\n return Redirect()->route('bank-accounts')->with('message', 'You have successfully added a bank account.');\n }", "public function postCreationSuccessful() {\n $this->setDisplayMessage(\"Posted new message.\");\n $this->redirect();\n die();\n }", "function formSuccess() {\n\n // Template\n $this->r->text['back_url'] = suxFunct::getPreviousURL();\n $this->r->title .= \" | {$this->r->gtext['success']}\";\n\n $this->tpl->display('success.tpl');\n\n }", "function register() {\n\n/* ... this form is not to be shown when logged in; if logged in just show the home page instead (unless we just completed registering an account) */\n if ($this->Model_Account->amILoggedIn()) {\n if (!array_key_exists( 'registerMsg', $_SESSION )) {\n redirect( \"mainpage/index\", \"refresh\" );\n }\n }\n\n/* ... define values for template variables to display on page */\n $data['title'] = \"Account Registration - \".$this->config->item( 'siteName' );\n\n/* ... set the name of the page to be displayed */\n $data['main'] = \"register\";\n\n/* ... complete our flow as we would for a normal page */\n $this->index( $data );\n\n/* ... time to go */\n return;\n }", "public function callbackSuccess()\n {\n $this->AddOutput(\"<p><i>Form was submitted and the callback method returned true.</i></p>\"); \n $this->redirectTo();\n }", "public function newRegistration() {\n $this->registerModel->getUserRegistrationInput();\n $this->registerView->setUsernameValue($this->registerView->getUsername());\n $this->registerModel->validateRegisterInputIfSubmitted();\n if ($this->registerModel->isValidationOk()) {\n $this->registerModel->hashPassword();\n $this->registerModel->saveUserToDatabase();\n $this->loginView->setUsernameValue($this->registerView->getUsername());\n $this->loginView->setLoginMessage(\"Registered new user.\");\n $this->layoutView->render(false, $this->loginView);\n } else {\n $this->layoutView->render(false, $this->registerView);\n }\n \n }", "public function accountAction()\n {\n \tif(!in_array($this->_user->{User::COLUMN_STATUS}, array(User::STATUS_BANNED, User::STATUS_PENDING, User::STATUS_GUEST))){\n \t\t$this->_forward('homepage');\n \t\treturn;\n \t}\n \t$this->view->registerForm = new User_Form_Register();\n \t$this->view->loginForm = new User_Form_Login();\n }", "function add() {\n $this->layout = \"no_header\";\n if (!empty($this->data)) {\n if ($this->User->save($this->data)) {\n $this->Session->setFlash(\"Your account has been created successfully\");\n $this->go_back(\"login\");\n }\n }\n }", "function success()\n {\n $cur = common_current_user();\n $url = common_local_url('subscriptions', array('nickname' => $cur->nickname));\n common_redirect($url, 303);\n }", "public function processNewAccount() {\n\n\t\t// List of accounts\n\t\t$accounts = ['admin','bennabbott','oriongregg'];\n\n\t\t// Validate the form\n\t\t// Check that the user has privided a username\n\t\tif( $this->username == '' ) {\n\t\t\t$this->usernameErrorMsg = 'Invalid Username';\n\t\t} elseif(in_array($this->username, $accounts)) {\n\t\t\t$this->usernameErrorMsg = 'Username already exists';\t\t\t\n\t\t} else {\n\t\t\t$this->usernameErrorMsg = '';\n\t\t}\n\t\t\n\t\t// Check and make sure the paswords match\n\t\tif ($_POST['password'] == '' || $_POST ['password2'] == '') {\n\t\t\t$this->passwordErrorMsg = '* required';\t\t\t\n\t\t} elseif( $_POST['password'] != $_POST['password2']) {\n\t\t\t$this->passwordErrorMsg = 'Passwords do not match';\n\t\t} else {\n\t\t\t$this->passwordErrorMsg = '';\n\t\t}\n\t}", "public function formSubmit() {\n\n check_admin_referer('ncstate-wrap-authentication');\n\n $newOptions = array(\n 'autoCreateUser' => (bool)$_POST['nwa_autoCreateUser'],\n );\n\n update_option('ncstate-wrap-authentication', $newOptions);\n\n wp_safe_redirect(add_query_arg('updated', 'true', wp_get_referer()));\n }", "public function successAction()\r\n {\r\n View::renderTemplate('Signup/success.html');\r\n }", "public function successAction()\n {\n View::renderTemplate('Signup/success.html');\n }", "public function page_register() {\n\n\t\tif(isset($_POST['submit'])) {\n\n\t\t\t$validate = new validate();\n\n\t\t\t/**\n\t\t\t * setup custom allback text\n\t\t\t */\n\t\t\t$validate->errors_text['account_action::_pwdntmatch'] = 'Password fields do not match!';\n\t\t\t$validate->errors_text['account_action::_userexists'] = 'User already exists!';\n\n\t\t\t/**\n\t\t\t* setup form validation rules\n\t\t\t*/\n\t\t\t$validate->set_rules('username', array(\n\t\t\t\t'empty', \n\t\t\t\tarray(\n\t\t\t\t\t'callback' => array(&$this, '_userexists')\n\t\t\t\t)\n\t\t\t));\n\n\t\t\t$validate->set_rules('password', array(\n\t\t\t\t'empty',\n\t\t\t\tarray(\n\t\t\t\t\t'callback' => array($this, '_pwdntmatch'),\n\t\t\t\t\t'params' => array('password_again')\n\t\t\t\t)\n\t\t\t), true);\n\n\t\t\t/**\n\t\t\t * lets attempt to save user into the database\n\t\t\t */\n\t\t\tif(!$validate->check()) {\n\n\t\t\t\t/**\n\t\t\t\t * register user\n\t\t\t\t */\n\t\t\t\tif(account_model::register()) {\n\t\t\t\t\t$this->data->message = \"Account created successful\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->data->message = \"Something went wrong when attempting to create this account!\";\n\t\t\t\t}\n\n\n\t\t\t} else {\n\t\t\t\t$this->data->message = validate::errors();\n\t\t\t}\n\t\t}\n\t}", "protected function success() {\r\n $this->redirect();\r\n }", "public function create()\n {\n // TODO: Algún parámetro para no permitir el registro.\n \n // Es ya un usuario?\n if (Core::isUser())\n {\n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('') . '\\';');\n return;\n }\n \n // Tenemos datos?\n if ($this->request->is('email'))\n {\n // Validamos los datos\n $form = Core::getLib('form.validator');\n $form->setRules(Core::getService('account.signup')->getValidation());\n \n // Si no hay errores procedemos a capturar los datos.\n if ($form->validate())\n {\n // Agregamos usuario\n if (Core::getService('account.process')->add($this->request->getRequest()))\n {\n if (Core::getParam('user.verify_email_at_signup'))\n {\n // Vamos a que verifique su email\n Core::getLib('session')->set('email', $this->request->get('email'));\n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('account.verify') . '\\';');\n }\n else\n {\n // Iniciamos sesión\n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('account.login') . '\\';');\n }\n \n return;\n }\n }\n }\n \n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('account.signup') . '\\';');\n }", "public function redirect_after_quick_create($succes, $message);", "public function DoCreate($form)\n\t{\n\t\tif ($form['password']['value']!=$form['password2']['value'])\n\t\t{\n\t\t\t$this->session->AddMessage('error', 'Password did not match.');\n\t\t\t$this->RedirectToController('create');\n\t\t}\n\t\telse if($this->user->Create($form['acronym']['value'],\n $form['password']['value'],\n $form['name']['value'],\n $form['email']['value']\n ))\n\t\t{\n\t\t\t$this->user->Login($form['acronym']['value'], $form['password']['value']);\n\t\t\t$this->session->AddMessage('success', \"Welcome {$this->user->GetAcronym()}. Your have successfully created a new account.\");\n\t\t\t$this->RedirectToController('profile');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->session->AddMessage('notice', \"Failed to create an account.\");\n\t\t\t$this->RedirectToController('create');\n\t\t}\n\t}", "public function callbackSuccess()\n {\n $this->di->get(\"response\")->redirect(\"user\")->send();\n }", "public function postRegister()\n\t{\n\t\t$user = $this->userService->create(Input::all());\n\n\t\tif (!$user)\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($this->userService->errors())->withInput();\n\t\t}\n\n\t\tAlert::success('You have successfully registered yourself!')->flash();\n\n\t\t// set flag for login page\n\t\tSession::flash('just_registered', '1');\n\n\t\treturn Redirect::route('auth-login');\n\t}", "public function create()\n\t{\n\t\tif (Auth::check()) {\n\t\t\tSession::flash('info_message', 'You are already logged into an account!');\n\t\t\treturn Redirect::route('users.index');\n\t\t} else {\n\t\t\treturn view('users.create');\n\t\t}\n\t}", "public function formUserCreate(){\n // Access-controlled resource\n if (!$this->_app->user->checkAccess('create_account')){\n $this->_app->notFound();\n }\n \n $get = $this->_app->request->get();\n \n if (isset($get['render']))\n $render = $get['render'];\n else\n $render = \"modal\";\n \n // Get a list of all groups\n $groups = GroupLoader::fetchAll();\n \n // Get a list of all locales\n $locale_list = $this->_app->site->getLocales();\n \n // Get default primary group (is_default = GROUP_DEFAULT_PRIMARY)\n $primary_group = GroupLoader::fetch(GROUP_DEFAULT_PRIMARY, \"is_default\");\n \n // Get the default groups\n $default_groups = GroupLoader::fetchAll(GROUP_DEFAULT, \"is_default\");\n \n // Set default groups, including default primary group\n foreach ($groups as $group_id => $group){\n $group_list[$group_id] = $group->export();\n if (isset($default_groups[$group_id]) || $group_id == $primary_group->id)\n $group_list[$group_id]['member'] = true;\n else\n $group_list[$group_id]['member'] = false;\n }\n \n $data['primary_group_id'] = $primary_group->id;\n // Set default title for new users\n $data['title'] = $primary_group->new_user_title;\n // Set default locale\n $data['locale'] = $this->_app->site->default_locale;\n \n // Create a dummy user to prepopulate fields\n $target_user = new User($data); \n \n if ($render == \"modal\")\n $template = \"components/user-info-modal.html\";\n else\n $template = \"components/user-info-panel.html\";\n \n // Determine authorized fields for those that have default values. Don't hide any fields\n $fields = ['title', 'locale', 'groups', 'primary_group_id'];\n $show_fields = [];\n $disabled_fields = [];\n $hidden_fields = [];\n foreach ($fields as $field){\n if ($this->_app->user->checkAccess(\"update_account_setting\", [\"user\" => $target_user, \"property\" => $field]))\n $show_fields[] = $field;\n else\n $disabled_fields[] = $field;\n } \n \n // Load validator rules\n $schema = new \\Fortress\\RequestSchema($this->_app->config('schema.path') . \"/forms/user-create.json\");\n $validators = new \\Fortress\\ClientSideValidator($schema, $this->_app->translator); \n \n $this->_app->render($template, [\n \"box_id\" => $get['box_id'],\n \"box_title\" => \"Create User\",\n \"submit_button\" => \"Create user\",\n \"form_action\" => $this->_app->site->uri['public'] . \"/users\",\n \"target_user\" => $target_user,\n \"groups\" => $group_list,\n \"locales\" => $locale_list,\n \"fields\" => [\n \"disabled\" => $disabled_fields,\n \"hidden\" => $hidden_fields\n ],\n \"buttons\" => [\n \"hidden\" => [\n \"edit\", \"enable\", \"delete\", \"activate\"\n ]\n ],\n \"validators\" => $validators->formValidationRulesJson()\n ]); \n }", "public function p_signup(){\n\t\tforeach($_POST as $field => $value){\n\t\t\tif(empty($value)){\n\t\t\t\tRouter::redirect('/users/signup/empty-fields');\n\t\t\t}\n\t\t}\n\n\t\t#check for duplicate email\n\t\tif ($this->userObj->confirm_unique_email($_POST['email']) == false){\n\t\t\t#send back to signup page\n\t\t\tRouter::redirect(\"/users/signup/duplicate\");\n\t\t}\n\n\t\t#adding data to the user\n\t\t$_POST['created'] = Time::now();\n\t\t$_POST['modified'] = Time::now();\n\n\t\t#encrypt password\n\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t\t#create encrypted token via email and a random string\n\t\t$_POST['token'] = sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string());\n\n\t\t#Insert into the db\n\t\t$user_id = DB::instance(DB_NAME)->insert('users', $_POST);\n\n\t\t# log in the new user\n\n\t\tsetcookie(\"token\", $_POST['token'], strtotime('+2 weeks'), '/');\n\n\t\t# redirect to home\n\t\tRouter::redirect('/users/home');\n\t\t\n\t}", "public function postSignup()\n {\n \tif ($this->userForm->create(Input::all())) {\n \t\treturn Redirect::route('auth.getSignup')\n \t\t->with('message', 'Successfully registered. Please check your email and activate your account.')\n \t\t->with('messageType', \"success\");\n \t}\n \n \treturn Redirect::route('auth.getSignup')\n \t->withInput()\n \t->withErrors($this->userForm->errors());\n }", "public function action_signup()\r\n\t{\r\n\t\t$this->title = 'Sign Up';\r\n\t\t$user = ORM::factory('user');\r\n\t\t$errors = array();\r\n\t\tif ($_POST)\r\n\t\t{\r\n\t\t\t$user->values($_POST);\r\n\t\t\t$user->level_id = Model_User::DEFAULT_LEVEL;\r\n\t\t\tif ($user->check())\r\n\t\t\t{\r\n\t\t\t\t$user->save(); // must save before adding relations\r\n\t\t\t\t$user->add('roles', ORM::factory('role', array('name'=>'login')));\r\n\t\t\t\t$this->session->set($this->success_session_key, \"Your account is set up.\");\r\n\t\t\t\t$user->login($_POST);\r\n\t\t\t\t$user->create_sample_form();\r\n\t\t\t\t$this->request->redirect('account');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$errors = $user->validate()->errors('validate');\r\n\t\t\t}\r\n\t\t}\r\n\t\t$view = 'account/signup';\r\n\t\t$vars = array(\r\n\t\t\t'user' => $user,\r\n\t\t\t'errors' => $errors,\r\n\t\t);\r\n\t\t$this->template->content = View::factory($view)->set($vars);\r\n\t}", "public function admin_add() {\n if ($this->isAuthorized()) {\n if ($this->request->is('post')) {\n $this->User->create();\n if ($this->User->save($this->request->data)) {\n $this->Session->setFlash(__('The user has been created'));\n return $this->redirect(array(\n 'action' => 'index',\n ));\n } else {\n $this->Session->setFlash(__('The user could not be created. Please, try again.'));\n }\n }\n } else {\n $this->Session->setFlash(__('You do not have permission to do this'));\n return $this->redirect(array(\n 'action' => 'admin_dashboard',\n ));\n }\n }", "public function post_join()\n\t{\n\t\tif(Service\\Validation\\Register::passes(Input::all()))\n\t\t{\n\t\t\tif($user = Repository\\User::register(Input::all()))\n\t\t\t{\n\t\t\t\t// Users must confirm their e-mail address once they have registered. We\n\t\t\t\t// will now send them an e-mail with their activation code.\n\t\t\t\tif(Config::get('feather.registration.confirm_email'))\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t// Log the user in and redirect back to the home page.\n\t\t\t\tService\\Security::authorize($user);\n\n\t\t\t\treturn Redirect::home();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn Redirect::to_route('register')->with_input()->with_errors(new Messages(array(\n\t\t\t\t\t__('register.failed')->get()\n\t\t\t\t)));\n\t\t\t}\n\t\t}\n\n\t\treturn Redirect::to_route('register')->with_input()->with_errors(Service\\Validation::errors());\n\t}", "private function _signUpPageRequested()\n {\n $this->utility->redirect('signup');\n }", "public function post()\n\t{\n// \t\t$this->viewParams->signupErrors = ['New accounts are not accepted at this time.'];\n// \t\treturn $this->renderView('home');\n\t\t\n\t\t$orgTitle = $this->trimPostVar('title');\n\t\t$orgName = $this->trimPostVar('name');\n\t\t$username = $this->trimPostVar('username');\n\t\t$password = $this->postVar('password');\n\t\t$confirmPass = $this->postVar(\"confirm-password\");\n\t\t\n\t\t$errors = [];\n\t\t\n\t\tif(strlen($password) < 8){\n\t\t\t$errors[] = \"Password must be at least 8 characters long.\";\n\t\t}\n\t\tif($password !== $confirmPass){\n\t\t\t$errors[] = \"Passwords did not match.\";\n\t\t}\n\t\t\n\t\tif(Org::findByName($orgName)){\n\t\t\t$errors[] = \"Identifier is already taken. Please choose another.\";\n\t\t}\n\t\t\n\t\tif(!filter_var($username, FILTER_VALIDATE_EMAIL)){\n\t\t\t$errors[] = \"Invalid email address provided.\";\n\t\t}\n\t\t\n\t\tif(!count($errors)){\n\t\t\tif($admin = Admin::signup($username, $password)){\n\t\t\t\tif($org = Org::create($admin, $orgName, $orgTitle)){\n\t\t\t\t\tLogin::adminLogin($admin);\n\t\t\t\t\t$this->localRedirect(\"orgs/\".$org->getName());\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$errors[] = \"Organization could not be created.\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$errors[] = \"Admin email is already taken.\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->viewParams->signupOrgTitle = $orgTitle;\n\t\t$this->viewParams->signupOrgName = $orgName;\n\t\t$this->viewParams->signupUsername = $username;\n\t\t$this->viewParams->signupErrors = $errors;\n\t\t\n\t\treturn $this->renderView('Home');\n\t\t\n\t\t\n\t\t\n\t}", "public function registerNewUser()\n\t{\n\t\t# make the call to the API\n\t\t$response = App::make('ApiClient')->post('register', Input::all());\n\n\t\t# if we successfully register a new user\n\t\tif(isset($response['success']))\n\t\t{\n\t\t\tUser::startSession($response['success']['data']['user']);\n\n\t\t\t# grab the data array from the response\n\t\t\tSession::flash('success', $response['success']['data']);\n\n\t\t\t# show the user profile screen\n\t\t\treturn Redirect::route('profile');\n\t\t}\n\t\t# there was a problem registering the user\n\t\telse \n\t\t{\n\t\t\t# save the API response to some flash data\n\t\t\tSession::flash('registration-errors', getErrors($response));\n\n\t\t\t# also flash the input so we can replay it out onto the reg form again\n\t\t\tInput::flash();\n\n\t\t\t# ... and show the sign up form again\n\t\t\treturn Redirect::back();\n\t\t}\n\t}", "public function callbackSuccess()\n {\n $this->AddOutput(\"<p><i>\" . $this->logoutMessage . \"</i></p>\");\n $this->redirectTo();\n }", "public function successAction()\n\t{\n\t\t$this->_redirect('checkout/onepage/success', array('_secure'=>true));\n\t}", "private function success() : void\n {\n session_destroy();\n session_unset();\n (new Repository())->disconnect();\n (new Session())->set('user','success', 'Votre compte a bien été supprimé');\n header('Location:' . self::REDIRECT_SIGNUP);\n die();\n\n }", "public function createAction()\n\t{\n\t\t$auth = new AuthenticationService();\n\t\tif($auth->hasIdentity()) {\n\t\t\t# if user has session take them some else\n\t\t\treturn $this->redirect()->toRoute('home');\n\t\t}\n\n\t $createForm = new CreateForm($this->adapter);\n\t $request = $this->getRequest();\n\n\t if($request->isPost()) {\n\t \t$formData = $request->getPost()->toArray();\n\t \t$createForm->setInputFilter($this->usersTable->getCreateFormFilter());\n\t \t$createForm->setData($formData);\n\n\t \tif($createForm->isValid()) {\n\t \t\ttry {\n\t \t\t\t$data = $createForm->getData();\n\t \t\t\t$this->usersTable->saveAccount($data); \n\n\t \t\t\t$this->flashMessenger()->addSuccessMessage('Compte créé avec succès. Vous pouvez maintenant vous connecter');\n\n\t \t\t\treturn $this->redirect()->toRoute('login');\n\t \t\t} catch(RuntimeException $exception) {\n\t \t\t\t$this->flashMessenger()->addErrorMessage($exception->getMessage());\n\t \t\t\treturn $this->redirect()->refresh(); # refresh this page to view errors\n\t \t\t}\n\t \t}\n\t }\n\t\t$this->layout()->setTemplate('login/index-layout');\n\t\treturn (new ViewModel(['form' => $createForm]))->setTemplate('auth/create');\n\t}", "public function onSignUp()\n {\n $data = post();\n $data['requires_confirmation'] = $this->requiresConfirmation;\n\n if (app(SignUpHandler::class)->handle($data, (bool)post('as_guest'))) {\n if ($this->requiresConfirmation) {\n return ['.mall-signup-form' => $this->renderPartial($this->alias . '::confirm.htm')];\n }\n\n return $this->redirect();\n }\n }", "public function signUp() {\n if ($this->request->is('post')) {\n\n $this->User->create();\n\n if ($this->User->save($this->request->data['signUp'])) {\n $this->Flash->set(__(\"Your user has been created\"),array(\n 'element' => 'success'\n ));\n return $this->redirect(array('action' => 'index'));\n }\n $this->Flash->set(\n __('The user could not be saved. Please, try again.',\n array(\n 'element' => 'error.ctp'\n ))\n );\n }\n\n $this->autoRender = false;\n }", "public function create(){\r\n\t\t\t$data['title'] = \"Accounts | Create Account\";\r\n\t\t\t$data['userData'] = $this->session->userdata();\r\n\r\n\t\t\tif (!empty($this->input->post())){\r\n\t\t\t\t$accountCreateValidation = $this->form_validation->run();\r\n\r\n\t\t\t\tif($accountCreateValidation){\r\n\t\t\t\t\t$_POST['userID'] = $data['userData']['userID'];\r\n\t\t\t\t\t$createCheck = $this->account_model->createAccount($_POST);\r\n\t\t\t\t\tif ($createCheck){\r\n\t\t\t\t\t\t$this->session->set_flashdata('success', 'You have successfully created an account.');\r\n\t\t\t\t\t\tredirect('accounts');\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$this->session->set_flashdata('danger', 'Something internally happened. Please try again.');\r\n\t\t\t\t\t\t$this->load->template('accounts/create', $data);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$this->load->template('accounts/create', $data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$this->load->template('accounts/create', $data);\r\n\t\t\t}\r\n\t\t}", "public function callbackSuccess()\n {\n $this->redirectTo();\n }", "function twitter_non_auth_account_form_submit($form, &$form_state) {\n $name = $form_state['values']['screen_name'];\n $twitter = twitter_connect(NULL, TRUE, TRUE);\n if (!$twitter) {\n return FALSE;\n }\n\n $twitter_account = $twitter->users_show($name, FALSE);\n if (!isset($twitter_account->id)) {\n form_set_error('screen_name', t('Could not add the Twitter account <em>@name</em>. ' .\n 'Check the recent messages log.', array('@name' => $name)));\n }\n else {\n $twitter_account->uid = $form_state['values']['uid'];\n twitter_account_save($twitter_account, FALSE);\n drupal_set_message(t('Twitter account added successfully'));\n }\n}", "public function manageAccountAction()\n {\n $errors = [];\n $preserved = [];\n if(!empty($_POST)){\n $userValidation = new UserValidation($_POST, ['fullname', 'address', 'contact']);\n $errors = $userValidation->getNamedErrors();\n\n $preserved = $_POST;\n\n if(empty($errors)){\n $user = Auth::getUser();\n $user->update($_POST);\n Extra::setMessageCookie(\"Profile updated successfully.\");\n $this->redirect(\"/manage-account/\");\n }\n }\n View::renderTemplate(\"LoggedUser/manage-account.html\", [\n 'errors' => $errors,\n 'preserved' => $preserved\n ]);\n }", "public function newUserAction()\n {\n $user = (new UserModel())->createUser();\n echo (new View('userCreated'))\n ->addData('user', $user)\n ->render();\n }", "public function redirect_to_welcome() {\n\t\tif ( ! $this->can_redirect() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$url = '';\n\t\tif ( $this->invalid ) {\n\t\t\t$url = 'registration';\n\t\t} elseif ( ! get_option( 'rank_math_wizard_completed' ) ) {\n\t\t\t$url = 'wizard';\n\t\t}\n\n\t\twp_redirect( Helper::get_admin_url( $url ) );\n\t\texit;\n\t}", "public function addUser()\n {\n $categoryList = $this->itemModel->getCategories();\n\n //Check that register button exists and was clicked\n if (isset($_POST[\"user_submit\"])) { \n\n //Insert new row in Account and setting the User's name in database using values inputted in the HTML form\n $username = $_POST['username']; \n\n $newly_registered_account_id = $this->accountModel->registerAccount($username,$_POST[\"password\"],$_POST[\"sfsu_id\"]);\n\n $this->userModel->setUser($newly_registered_account_id,$_POST[\"firstname\"], \n $_POST[\"lastname\"],$_POST[\"country\"],$_POST[\"state\"],\n $_POST[\"address\"],$_POST[\"city\"],$_POST[\"zipcode\"],$_POST[\"phoneNumber\"]);\n\n } else {\n echo '<script language=\"javascript\">';\n echo 'alert(\"accounts.php registerUser bad.\")';\n echo '</script>';\n }\n\n header('location: ' . URL . 'home/index');\n }", "public function create(){\n \n $data = array();\n $data['login'] = $_POST['login'];\n $data['password'] = Hash::create('sha256', $_POST['password'], HASH_KEY);\n $data['role'] = $_POST['role'];\n \n //Do the Error checking\n \n $this->model->RunCreate($data);\n /*\n * After we Post the user info to create, the header is refereshed so that the data appears dynamically \n * below in the users list\n */\n header('location: ' . URL . 'users');\n }", "public function postSignup()\n\t{\n\t\t$v = Validator::make($input = Input::all(), $this->rules->signupRules);\n\t\tif($v->fails())\n\t\t\treturn Redirect::back()->withInput()->withErrors($v);\n\n\t\tif($this->user->createNewUser($input)) {\n\t\t\treturn Redirect::action('UsersController@index');\n\t\t}\t\t\n\t\telse {\n\t\t\treturn Redirect::back()-withInput();\n\t\t}\n\t}", "public function register_action()\n {\n $registration_successful = RegistrationModel::registerNewUser();\n\n if ($registration_successful) {\n Redirect::to('index');\n } else {\n Redirect::to('user/register');\n }\n }", "static function displayCreateUser()\n {\n echo \"<div class='col-xs-6'><h1>Create Account</h1>\";\n echo \"<form role='form' method='post' action='login.php'>\";\n\n echo \"<label for='createUser'>Username: </label>\";\n echo \"<input type='text' class='form-control' id='createUser' name='usr' required>\";\n echo \"<label for='createPass'>Password: </label>\";\n echo \"<input type='password' class='form-control' id='createPass' name='pwd' required>\";\n echo \"<label for='createPass'>Email Address: </label>\";\n echo \"<input type='email' class='form-control' id='createEmail' name='email' required>\";\n\n echo \"<input type='hidden' name='action' value='create'><input type='submit' class='btn btn-default'>\";\n echo \"</form></div>\";\n }", "public function index(){\n\t\t\tif ($this->user->isUserLogged())\n\t\t\t\treturn $this->redirect('/account');\n\t\t\t\n\t\t\tif ($this->isPost) {\n\t\t\t\t$data = $this->getRequestData();\n\t\t\t\t\n\t\t\t\t$user_data = $this->user->getByField('username', $data['user']['username']);\n\t\t\t\t\n\t\t\t\tif (empty($user_data)) {\n\t\t\t\t\tNotifications::set('empty_user_data', 'User not found', Notifications::MESSAGE_ERROR);\n\t\t\t\t\treturn $this->reload();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->user->pushData($user_data);\n\t\t\t\t\n\t\t\t\tif (!$this->user->checkPassword($data['user']['password'])) {\n\t\t\t\t\tNotifications::set('wrong_user_password', 'Wrong user password', Notifications::MESSAGE_ERROR);\n\t\t\t\t\treturn $this->reload();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->user->storeSessionLoginData();\n\t\t\t\t\n\t\t\t\treturn $this->redirect('/account');\n\t\t\t}\n\t\t\t\n\t\t\t$formFields = FormUser::build(['username', 'password']);\n\t\t\t$this->assign('form_fields', $formFields);\n\t\t}", "public function doneSucceed()\r\n {\r\n $progress = app()->make(Progress::class);\r\n $progress->reset();\r\n\r\n app('antares.messages')->add('success', trans('Installation is completed. Now you can login to administration area.'));\r\n return $this->redirect(handles('antares::install/completed'));\r\n }", "public function doRegister()\n {\n\n //check if all the fields are 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 based on filled data\n $userEntity = new User(Request::postData());\n\n //check if the user exists and get it as entity if exists\n if ($this->repository->findUser($userEntity)) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The username/email already exists!\", \"type\" => \"error\")));\n exit;\n }\n\n //add the user into DB\n $this->repository->addUser($userEntity);\n\n echo json_encode(\n array(\n \"swal\" => array(\"title\" => \"Success!\", \"text\" => \"Your account has been created!\", \"type\" => \"success\", \"hideConfirmButton\" => true),\n \"redirect\" => array(\"url\" => BASE_URL . '/index.php?page=home', 'time' => 1)\n )\n );\n }", "public function create() {\n $page = 'createAccount';\n\n require('./View/default.php');\n }", "public function post_account()\n {\n $rules = array();\n $rules['username'] = 'required|min:4|max:32';\n $rules['email'] = Input::has('email') ? 'required|email' : '';\n $rules['password'] = Input::has('email') ? 'required|confirmed|min:4|max:32' : '';\n\n $v = Validator::make( Input::all(), $rules );\n if ($v->fails()) {\n return Redirect::to( Config::get('user.account_route', Config::get('user::config.account_route')) )\n ->with_errors($v)\n ->with_input();\n }\n\n Auth::user()->username = Input::get('username');\n Auth::user()->email = Input::get('email');\n\n // Leave password alone if the user doesn't want to change it\n if(Input::has('password')) {\n Auth::user()->password = Input::get('password');\n }\n\n Auth::user()->save();\n\n Event::fire('user: account updated');\n\n return Redirect::to( Config::get('user.account_route', Config::get('user::config.account_route')) )\n ->with('success', 'Account changes saved');\n }", "public function callbackSuccess()\r\n {\r\n $this->redirectTo('question/user/'.$this->Value('uid') . \"/infouppdaterat\");\r\n }", "public function handleSignUp()\n {\n $data = \\Request::all();\n $result = \\DB::transaction(function() use($data) {\n $data['type'] = Member::USER_TYPE_ID;\n // honeypot checking for valid submission\n $this->companyService->honeypotCheck($data);\n // get the plan\n $plan = Plan::findOrFail($data['plan_id']);\n // create the company\n list($company, $role) = $this->companyService->create($data);\n // create the user\n $data['company_id'] = $company->id;\n $data['roles'] = [$role->id];\n $data['is_owner'] = true;\n $user = $this->userService->create($data);\n // send confirmation email\n $mail_data = [\n 'plan' => $plan->name,\n 'price_month' => \\Format::currency($plan->price_month),\n 'price_year' => \\Format::currency($plan->price_year),\n 'trial_end_date' => \\Carbon::now()->addDays(14)->toFormattedDateString()\n ];\n \\Mail::to($company->email)->send(new SignUpConfirmation($mail_data));\n // find the user and log them in\n $auth_user = \\Auth::findById($user->id);\n \\Auth::login($auth_user, true);\n // set message and redirect\n \\Msg::success('Thank you for signing up with Tellerr!');\n return [\n 'route' => 'account'\n ];\n });\n return redir($result['route']);\n }", "public function registerPost(){\n\t\t\t$this->modelRegister();\n\t\t\t//quay lai trang dang ky\n\t\t\t//header(\"location:index.php?controller=account&action=register&notify=success\");\n\t\t\techo \"<script>location.href='login/register-success';</script>\";\n\t\t}", "public function createUserAction() {\n $this->authService->createUser();\n die();\n }", "function newuser(){\n\t\t\tif(!empty($_POST['newemail']) && !empty($_POST['newpassword']) && !empty($_POST['newnombre']) && !empty($_POST['newpoblacion']) && !empty($_POST['newrol'])){\n\t\t\t\t$poblacion = filter_input(INPUT_POST,'newpoblacion',FILTER_SANITIZE_STRING);\n\t\t\t\t$nombre = filter_input(INPUT_POST,'newnombre',FILTER_SANITIZE_STRING);\n\t\t\t\t$password = filter_input(INPUT_POST,'newpassword',FILTER_SANITIZE_STRING);\n\t\t\t\t$email = filter_input(INPUT_POST,'newemail',FILTER_SANITIZE_STRING);\n\t\t\t\t$rol = filter_input(INPUT_POST,'newrol',FILTER_SANITIZE_STRING);\n\t\t\t\t$list = $this -> model -> adduser($nombre,$password,$email,$poblacion,$rol);\n \t\t$this -> ajax_set(array('redirect'=>APP_W.'admin'));\n\t\t\t}\n\t\t}", "function admin_insert_new_user(){\r\n\t\tif(isset($_POST['doctor_create_user'])){\r\n\t\t\t$result['insert_new_user_data'] = $this->model->insert_new_user();\r\n\t\t\tredirect('Doctor_control/admin_create_new_user'); \r\n\t\t}\r\n\t\tif(isset($_POST['doctor_update_user'])){\r\n\t\t\tif($this->model->update_new_user_record()){\r\n\t\t\t\tredirect('Doctor_control/admin_create_new_user'); \r\n\t\t\t} \r\n\t\t} \r\n\t}", "public function registerAction(){\n if(!empty($_POST[\"fname\"]) && !empty($_POST[\"lname\"]) && !empty($_POST[\"email2\"]) && !empty($_POST[\"password2\"]) && !empty($_POST[\"password3\"])){\n\n //We validate that the passwords match and that the password is at least 4 characters\n if(($_POST[\"password2\"] == $_POST[\"password3\"]) && (strlen($_POST[\"password2\"]) >= 4)){\n\n //We validate the email string\n if(filter_var($_POST[\"email2\"], FILTER_VALIDATE_EMAIL)){\n //We has the password\n $hashPass = password_hash($_POST[\"password2\"], PASSWORD_BCRYPT, array(\"cost\" => 11));\n\n //Add to database\n $db = new PDO(\"mysql:host=localhost;dbname=chatup\", \"root\", \"root\");\n $stm = $db->prepare(\"INSERT INTO users (user_fname, user_lname, user_email, user_pass) VALUES (:fname, :lname, :email2, :password2)\");\n $result = $stm->execute(array(\n \":fname\" => $_POST[\"fname\"],\n \":lname\" => $_POST[\"lname\"],\n \":email2\" => $_POST[\"email2\"],\n \":password2\" => $hashPass\n ));\n\n //If we added without problems we redirect the user\n if($result){\n echo \"You are now registered - try to log in!\";\n //header(\"location:../user?msg=ok\");\n }\n else{\n echo \"user already exists!\";\n //$msg = \"user already exists!\";\n }\n }\n else{\n echo \"email is invalid!\";\n //$msg = \"email is invalid!\";\n }\n }\n else{\n echo \"Passwords don't match or less than 4 characters!\";\n //$msg = \"Passwords don't match or less than 4 characters!\";\n }\n }\n else{\n echo \"the entire form must be filled!\";\n //$msg = \"the entire form must be filled!\";\n }\n\n //The $msg from above is displayed in the template\n }", "public function doAction() {\n if ($this->request->isPost() === false) {\n\n $this->flashSession->error('Invalid request');\n return $this->response->redirect('signup', false, 302);\n }\n\n // Validate the form\n $form = new \\Aiden\\Forms\\RegisterForm();\n if (!$form->isValid($this->request->getPost())) {\n foreach ($form->getMessages() as $message) {\n $this->flashSession->error($message);\n return $this->response->redirect('/#form-response', 302);\n }\n }\n\n $name = $this->request->getPost(\"name\", \"string\");\n $email = $this->request->getPost(\"email\", \"string\");\n $password = $this->request->getPost(\"password\");\n $websiteUrl = $this->request->getPost(\"websiteUrl\", \"string\");\n $companyName = $this->request->getPost(\"companyName\", \"string\");\n $companyCountry = $this->request->getPost(\"companyCountry\", \"string\");\n $companyCity = $this->request->getPost(\"companyCity\", \"string\");\n $checkfirst = \\Aiden\\Models\\Users::findFirst(array(\n \"email = ?1\",\n \"bind\" => array(\n 1 => $email,\n )));\n\n if ($checkfirst) {\n $errorMessage = 'Email is already existed, please try another.';\n $this->flashSession->error($errorMessage);\n return $this->response->redirect('signup', false, 302);\n }\n $user = new \\Aiden\\Models\\Users();\n $user->setName($name);\n $user->setEmail($email);\n $user->setWebsiteUrl($websiteUrl);\n $user->setCompanyName($companyName);\n $user->setCompanyCountry($companyCountry);\n $user->setCompanyCity($companyCity);\n $user->setPasswordHash($this->security->hash($password));\n $user->setLevel(\\Aiden\\Models\\Users::LEVEL_USER);\n $user->setCreated(new \\DateTime());\n $user->setLastLogin(new \\DateTime());\n $user->setImageUrl(BASE_URI.\"dashboard_assets/images/avatars/avatar.jpg\");\n $user->setSeenModal(0);\n $user->setPhraseDetectEmail(0);\n $user->setSubscriptionStatus('trial');\n\n if ($user->save()) {\n\n $this->session->set('auth', [\n 'user' => $user\n ]);\n\n // Log message\n $message = sprintf('User with email [%s] has successfully registered.', $email);\n $this->logger->info($message);\n\n return $this->response->redirect('leads', false, 302);\n }\n else {\n\n // Client message\n $errorMessage = 'Something went wrong, please try again.';\n $this->flashSession->error($errorMessage);\n\n // Log message\n $message = sprintf('Could not signup user [%s]. (Model error: %s)', $email, print_r($user->getMessages(), true));\n $this->logger->error($message);\n\n return $this->response->redirect('signup', false, 302);\n }\n\n }", "public function registerAction() {\n\t\t$this->setLayout('login');\n\t\t// If registrations are disabled, redirect to home\n\t\tif (!isset($this->config->registration_enabled) || $this->config->registration_enabled == false) {\n\t\t\t$this->redirect('/');\n\t\t}\n\n\t\t$form = new Website_Form_Register();\n\n\t\tif($this->getRequest()->isPost()) {\n\t\t\tif($form->isValid($this->getRequest()->getParams())) {\n\t\t\t\t$allOk = true;\n\t\t\t\t$testUser = User::getByName($this->getParam('username'));\n\t\t\t\tif ($testUser) {\n\t\t\t\t\t$allOk = false;\n\t\t\t\t\t$el = $form->getElement('username');\n\t\t\t\t\t$el->addError('Username already taken');\n\t\t\t\t}\n\n\t\t\t\tif ($this->getParam('pw') != $this->getParam('pw2')) {\n\t\t\t\t\t$allOk = false;\n\t\t\t\t\t$el = $form->getElement('pw2');\n\t\t\t\t\t$el->addError('Passwords do not match');\n\t\t\t\t}\n\n\t\t\t\tif ($allOk) {\n\t\t\t\t\t$user = User::create(array(\n\t\t\t\t\t\t\"parentId\" => 3,\n\t\t\t\t\t\t\"name\" => $this->getParam(\"username\"),\n\t\t\t\t\t\t\"password\" => Pimcore_Tool_Authentication::getPasswordHash($this->getParam(\"username\"), $this->getParam(\"pw\")),\n\t\t\t\t\t\t\"active\" => true,\n\t\t\t\t\t\t\"email\"=>$this->getParam('email'),\n\t\t\t\t\t\t'firstname'=>$this->getParam('firstname'),\n\t\t\t\t\t\t'lastname'=>$this->getParam('lastname')\n\t\t\t\t\t));\n\n // Create member\n $memberObject = new Website_Model_Members();\n $memberObject->setUserId($user->getId());\n $memberObject->save();\n\n // Login\n\t\t\t\t\t$securityService = Security_Service_Common::getInstance();\n $securityService->authenticate($form->getValues());\n\n\t\t\t\t\t$params = array(\n\t\t\t\t\t\t'name'=>$this->view->username($user),\n\t\t\t\t\t\t'url'=>$this->getAbsoluteUrl() . '/user/login',\n\t\t\t\t\t\t'username'=>$user->getName()\n\t\t\t\t\t);\n\t\t\t\t\t//sending the email\n\t\t\t\t\t$mail = new Pimcore_Mail();\n\t\t\t\t\t$mail->addTo($user->getEmail());\n\t\t\t\t\t$mail->setDocument('/_onderdelen/user_register');\n\t\t\t\t\t$mail->setParams($params);\n\t\t\t\t\t$mail->send();\n\n $this->addFlashMessage($this->view->translate('Your account was successfully created. Have fun!'));\n\t\t\t\t\t$this->redirect(\"/user\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t}", "function ft_hook_loginsuccess() {}", "public function postSignup()\n {\n $FormName = 'SignupForm';\n $returnToRoute = array\n (\n\t\t\t\t\t 'name' => FALSE,\n\t\t\t\t\t 'data' => FALSE,\n\t\t\t\t\t );\n $FormMessages = array();\n\n if(Request::isMethod('post'))\n {\n $Attempts = $this->getAccessAttemptByUserIDs\n (\n $FormName,\n array($this->getSiteUser()->id),\n self::POLICY_AllowedAttemptsLookBackDuration\n );\n\n if($Attempts['total'] < self::POLICY_AllowedSignupAttempts)\n {\n if($this->isFormClean($FormName, Input::all()))\n {\n $formFields = array\n (\n 'new_member' => Input::get('new_member'),\n 'password' => Input::get('password'),\n 'password_confirmation ' => Input::get('password_confirmation'),\n 'acceptTerms' => Input::get('acceptTerms'),\n );\n $formRules = array\n (\n 'new_member' => array\n (\n 'required',\n 'email',\n 'unique:employee_emails,email_address',\n 'between:5,120',\n ),\n 'password' => array\n (\n 'required',\n 'between:10,256',\n ),\n 'password_confirmation ' => array\n (\n 'same:password',\n ),\n 'acceptTerms' => array\n (\n 'required',\n 'boolean',\n 'accepted',\n ),\n );\n $formMessages = array\n (\n 'new_member.required' => \"An email address is required and can not be empty.\",\n 'new_member.email' => \"Your email address format is invalid.\",\n 'new_member.unique' => \"Please, check your inbox for previous sign up instructions.\",\n 'new_member.between' => \"Please, re-check your email address' size.\",\n\n 'password.required' => \"Please enter your password.\",\n 'password.confirmed' => \"A password confirmation is required.\",\n 'password.between' => \"Passwords must be more than 10 digits.\",\n\n 'password_confirmation.same' => \"A password confirmation is required.\",\n\n 'acceptTerms.required' => \"Please indicate that you read our Terms & Privacy Policy.\",\n 'acceptTerms.boolean' => \"Please, indicate that you read our Terms & Privacy Policy.\",\n 'acceptTerms.accepted' => \"Please indicate that you read our Terms & Privacy Policy\",\n );\n\n $validator = Validator::make($formFields, $formRules, $formMessages);\n $passwordCheck = $this->checkPasswordStrength($formFields['password']);\n\n if ($validator->passes() && $passwordCheck['status'])\n {\n // Add the emailAddress\n $this->addEmployeeEmailStatus($formFields['new_member'], 'AddedUnverified');\n\n // Get the Site User so you can associate this user behaviour with this new member\n $this->SiteUser = $this->getSiteUser();\n\n // Create a Member Object\n $NewMemberID = $this->addEmployee($formFields['new_member'], $formFields['password']);\n\n if($NewMemberID > 0)\n {\n // Update User with Member ID\n $this->setSiteUserMemberID($this->getSiteUser()->getID(), $NewMemberID);\n\n // Create & Save a Employee Status Object for the new Member\n $this->addEmployeeStatus('Successful-Signup', $NewMemberID);\n\n // Create & Save a Employee Emails Object\n $NewEmployeeEmailID = $this->addEmployeeEmail($formFields['new_member'], $NewMemberID);\n\n if($NewEmployeeEmailID > 0)\n {\n // Prepare an Email for Validation\n $verifyEmailLink = $this->generateVerifyEmailLink($formFields['new_member'], $NewMemberID, 'verify-new-member');\n $sendEmailStatus = $this->sendEmail\n (\n 'verify-new-member',\n array\n (\n 'verifyEmailLink' => $verifyEmailLink\n ),\n array\n (\n 'fromTag' => 'General',\n 'sendToEmail' => $formFields['new_member'],\n 'sendToName' => 'Welcome to Ekinect',\n 'subject' => 'Welcome to Ekinect',\n 'ccArray' => FALSE,\n 'attachArray' => FALSE,\n )\n );\n\n if($sendEmailStatus)\n {\n // Update employee emails that verification was sent and at what time for this member\n $this->updateEmployeeEmail($NewEmployeeEmailID, array\n (\n 'verification_sent' => 1,\n 'verification_sent_on' => strtotime('now'),\n ));\n\n // Add the emailAddress status\n $this->addEmployeeEmailStatus($formFields['new_member'], 'VerificationSent');\n\n // Redirect to Successful Signup Page that informs them of the need to validate the email before they can login\n $this->registerAccessAttempt($this->getSiteUser()->getID(), $FormName, 1);\n $viewData = array\n (\n 'emailAddress' => $formFields['new_member'],\n );\n return $this->makeResponseView('application/auth/employee-signup-success', $viewData);\n }\n else\n {\n $this->addAdminAlert();\n $this->registerAccessAttempt($this->getSiteUser()->getID(), $FormName, 0);\n Log::info($FormName . \" - Could not send the new employee email to [\" . $formFields['new_member'] . \"] for member id [\" . $NewMemberID . \"].\");\n $employeeService = str_replace(\"[errorNumber]\", \"Could not send the new employee email.\", self::POLICY_LinkEmployeeService );\n $SignupFormMessages[] = \"Sorry, we cannot complete the signup process at this time.\n Please refresh, and if the issue continues, contact \" . $employeeService . \".\";\n }\n }\n else\n {\n $this->addAdminAlert();\n $this->registerAccessAttempt($this->getSiteUser()->getID(), $FormName, 0);\n Log::info($FormName . \" - Could not create a new employee email.\");\n $employeeService = str_replace(\"[errorNumber]\", \"Could not create a new employee email.\", self::POLICY_LinkEmployeeService );\n $SignupFormMessages[] = \"Sorry, we cannot complete the signup process at this time.\n Please refresh, and if the issue continues, contact \" . $employeeService . \".\";\n }\n }\n else\n {\n $this->addAdminAlert();\n $this->registerAccessAttempt($this->getSiteUser()->getID(), $FormName, 0);\n Log::info($FormName . \" - Could not create a new member.\");\n $employeeService = str_replace(\"[errorNumber]\", \"Could not create a new employee.\", self::POLICY_LinkEmployeeService );\n $SignupFormMessages[] = \"Sorry, we cannot complete the signup process at this time.\n Please refresh, and if the issue continues, contact \" . $employeeService . \".\";\n }\n }\n else\n {\n $FormErrors = $validator->messages()->toArray();\n $FormMessages = array();\n foreach($FormErrors as $errors)\n {\n $FormMessages[] = $errors[0];\n }\n\n if(array_key_exists('errors', $passwordCheck))\n {\n foreach($passwordCheck['errors'] as $errors)\n {\n $FormMessages[] = $errors;\n }\n }\n\n $this->registerAccessAttempt($this->getSiteUser()->getID(),$FormName, 0);\n Log::info($FormName . \" - form values did not pass.\");\n }\n }\n else\n {\n $this->registerAccessAttempt($this->getSiteUser()->getID(), $FormName, 0);\n $this->addAdminAlert();\n Log::warning($FormName . \" has invalid dummy variables passed.\");\n $returnToRoute = array\n (\n 'name' => 'custom-error',\n 'data' => array('errorNumber' => 23),\n );\n }\n }\n else\n {\n $this->applyLock('Locked:Excessive-Signup-Attempts', '','excessive-signups', []);\n $returnToRoute = array\n (\n 'name' => 'custom-error',\n 'data' => array('errorNumber' => 18),\n );\n }\n }\n else\n {\n Log::warning($FormName . \" is not being correctly posted to.\");\n $returnToRoute = array\n (\n 'name' => 'custom-error',\n 'data' => array('errorNumber' => 23),\n );\n }\n\n if(FALSE != $returnToRoute['name'])\n {\n return Redirect::route($returnToRoute['name'],$returnToRoute['data']);\n }\n else\n {\n $viewData = array(\n 'activity' => \"signup\",\n\n 'LoginAttemptMessages' => '',\n\n 'LoginFormMessages' => '',\n 'SignupFormMessages' => (count($FormMessages) >= 1 ? $FormMessages : ''),\n 'ForgotFormMessages' => '',\n\n 'LoginHeaderMessage' => ''\n );\n return $this->makeResponseView('application/auth/login', $viewData);\n }\n }", "public function saveNewUser() {\n\t\t$db = $this->getDatabaseConnection();\n\n\t\t// Prepare the SQL\n\t\t$sql =\"INSERT INTO users (email, password, first_name, last_name, username)\n\t\t\t\tVALUES (:email, :password, :first_name, :last_name, :username)\";\n\n\t\t$statement = $db->prepare($sql);\n\n\t\t// Bind the form data to the SQL query\n\t\t$statement->bindValue(':email', $_POST['email']);\n\t\t$statement->bindValue(':password', $_POST['password']);\n\t\t$statement->bindValue(':first_name', $_POST['first_name']);\n\t\t$statement->bindValue(':last_name', $_POST['last_name']);\n\t\t$statement->bindValue(':username', $_POST['username']);\n\n\t\t// Run the query\n\t\t$result = $statement->execute();\n\n\t\t//Confirm tht it worked\n\t\tif( $result == true) {\n\t\t\t// Yay!\n\n\t\t\t$_SESSION['user_id'] = $db->lastInsertID();\n\t\t\t$_SESSION['privilege'] = 'user';\n\t\t\t$_SESSION['first_name'] = $_POST['first_name'];\n\t\t\t$_SESSION['last_name'] = $_POST['last_name'];\n\t\t\t$_SESSION['username'] = $_POST['username'];\n\t\t\t$_SESSION['email'] = $_POST['email'];\n\n\t\t\theader('Location: index.php?page=account');\n\t\t} else {\n\t\t\t// Uh oh...\n\t\t}\n\n\t\t//If it did, log the user in and redirect to their \n\t\t// new account page\n\t}", "public function postCreate() {\n \t$validator = Validator::make(Input::all(), User::$rules);\n\n \t// i made a user with something@place.com, goodbye\n \tif ($validator->passes()) {\n \t\t// validation has passed, save user in DB\n \t\t$user = new User;\n \t\t$user->first_name = Input::get('first_name');\n \t\t$user->last_name = Input::get('last_name');\n \t\t$user->email = Input::get('email');\n \t\t$user->password = Hash::make(Input::get('password'));\n \t\t$user->save();\n\n \t\treturn Redirect::to('users/login')->with('message', '<div class=\"alert alert-success\" role=\"alert\">Thanks for registering!</div>');\n \t}\n \telse {\n \t\t// validation has failed, display error messages\n \t\treturn Redirect::to('users/register')->with('message', '<div class=\"alert alert-warning\" role=\"alert\">The following errors occurred</div>')->withErrors($validator)->withInput();\n \t}\n }", "public function actionRegister()\n\t{\n\t\tUtilities::updateCallbackURL();\n\t\t$this->render('registration');\n\t}", "public function add()\n {\n $storedPassword = password_hash($_POST['password'], PASSWORD_DEFAULT);\n\n $data = [];\n $data['username'] = $_POST[\"username\"];\n $data['password'] = $storedPassword;\n $data['email'] = $_POST['email'];\n $data['profile_picture'] = $_FILES['profile']['tmp_name'];\n $data['mime'] = $_FILES['profile']['type'];\n $data['phone_num'] = $_POST['phone-number'];\n\n if ($this->model('User')->addNewUser($data) > 0) {\n $this->redirect(BASE_URL . \"/home/index/{$data['username']}\");\n }\n }", "public function registerForm(): Response\n {\n $this->init('You\\'r already loggedIn', '/chatroom');\n return $this->render('register.html.twig');\n }", "public function main() {\n // No need to be able to register again if user is logged in already\n if (isset($_SESSION[\"logged_in\"])) {\n header('Location: ?page=user_main');\n return;\n }\n\n $data[\"title\"] = \"Register for Account\";\n $data[\"errors\"] = false;\n $data[\"added\"] = false;\n\n // Process registration submission\n if (isset($_POST['submit'])) {\n $username = $this->_user_model->clean($_POST[\"user_name\"]);\n $password = $this->_user_model->clean($_POST[\"password\"]);\n\n $errors = $this->checkEntry($username, $password);\n\n if (count($errors) != 0) {\n $data[\"errors\"] = $errors;\n } else {\n $data[\"added\"] = $this->_user_model->addUser($username, $password);\n }\n }\n\n $this->_header->main($data[\"title\"]);\n $this->_register_view->main($data);\n $this->_footer->main();\n }", "function add(){\n\t\tredirect('auth/register');\t\t\n\t}", "function register_action()\n {\n $login_model = $this->loadModel('Login');\n $registration_successful = $login_model->registerNewUser();\n\n if ($registration_successful == true) {\n $this->view->render('login/index');\n } else {\n $this->view->render('login/register');\n }\n }", "public function signupAction()\n {\n $form = new \\RTB\\Core\\ShopFrontOffice\\Forms\\RegisterForm;\n if ($this->request->isPost()) {\n $email = $this->request->getPost('email', 'email');\n $password = $this->request->getPost('password', 'string');\n $repeatPassword = $this->request->getPost('repeatPassword', 'string');\n $response = $this->userService->createContact($email, $password, $repeatPassword);\n if($response == UserServices::SIGNUPSUCCESS){\n if ($this->request->isAjax()) {\n return $response;\n }\n $this->flash->success((string) $response);\n return $this->response->redirect('login');\n }else{\n if ($this->request->isAjax()) {\n return $response;\n }\n $this->flash->error($response);\n }\n }\n $this->view->form = $form;\n }", "protected function redirectAfterSuccessfulLogin()\n {\n $member = Security::getCurrentUser();\n\n // Absolute redirection URLs may cause spoofing\n $backURL = $this->getBackURL();\n if ($backURL) {\n return $this->redirect($backURL);\n }\n\n // If a default login dest has been set, redirect to that.\n $defaultLoginDest = Security::config()->get('default_login_dest');\n if ($defaultLoginDest) {\n return $this->redirect($defaultLoginDest);\n }\n\n // Redirect the user to the page where they came from\n if ($member) {\n // Welcome message\n $message = _t(\n 'SilverStripe\\\\Security\\\\Member.WELCOMEBACK',\n 'Welcome Back, {firstname}',\n ['firstname' => $member->FirstName]\n );\n Security::singleton()->setSessionMessage($message, ValidationResult::TYPE_GOOD);\n }\n\n // Redirect back\n return $this->redirectBack();\n }", "public function submit_form()\n\t{\n\t\tDisplay::message('user_profil_submit', ROOT . 'index.' . PHPEXT . '?p=profile&amp;module=contact', 'forum_profil');\n\t}", "public function post_index()\n\t{\n\t\t$input = Input::all();\n\t\t$rules = array(\n\t\t\t'email' => array('required', 'email'),\n\t\t\t'fullname' => array('required'),\n\t\t);\n\n\t\tif (Auth::user()->id !== $input['id']) return Response::error('500');\n\n\t\tEvent::fire('orchestra.validate: user.account', array(& $rules));\n\n\t\t$msg = Messages::make();\n\t\t$val = Validator::make($input, $rules);\n\n\t\tif ($val->fails())\n\t\t{\n\t\t\treturn Redirect::to(handles('orchestra::account'))\n\t\t\t\t\t->with_input()\n\t\t\t\t\t->with_errors($val);\n\t\t}\n\n\t\t$user = Auth::user();\n\t\t$user->email = $input['email'];\n\t\t$user->fullname = $input['fullname'];\n\n\t\ttry\n\t\t{\n\t\t\t$this->fire_event('updating', array($user));\n\t\t\t$this->fire_event('saving', array($user));\n\n\t\t\tDB::transaction(function () use ($user)\n\t\t\t{\n\t\t\t\t$user->save();\n\t\t\t});\n\n\t\t\t$this->fire_event('updated', array($user));\n\t\t\t$this->fire_event('saved', array($user));\n\n\t\t\t$msg->add('success', __('orchestra::response.account.profile.update'));\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$msg->add('error', __('orchestra::response.db-failed', array(\n\t\t\t\t'error' => $e->getMessage(),\n\t\t\t)));\n\t\t}\n\n\t\treturn Redirect::to(handles('orchestra::account'));\n\t}", "public function createUser(){\n $post = $this->_app->request->post();\n \n // Load the request schema\n $requestSchema = new \\Fortress\\RequestSchema($this->_app->config('schema.path') . \"/forms/user-create.json\");\n \n // Get the alert message stream\n $ms = $this->_app->alerts; \n \n // Access-controlled resource\n if (!$this->_app->user->checkAccess('create_account')){\n $ms->addMessageTranslated(\"danger\", \"ACCESS_DENIED\");\n $this->_app->halt(403);\n }\n\n // Set up Fortress to process the request\n $rf = new \\Fortress\\HTTPRequestFortress($ms, $requestSchema, $post); \n \n // Sanitize data\n $rf->sanitize();\n \n // Validate, and halt on validation errors.\n $error = !$rf->validate(true);\n \n // Get the filtered data\n $data = $rf->data(); \n \n // Remove csrf_token, password confirmation from object data\n $rf->removeFields(['csrf_token, passwordc']);\n \n // Perform desired data transformations on required fields. Is this a feature we could add to Fortress?\n $data['user_name'] = strtolower(trim($data['user_name']));\n $data['display_name'] = trim($data['display_name']);\n $data['email'] = strtolower(trim($data['email']));\n $data['active'] = 1;\n \n // Check if username or email already exists\n if (UserLoader::exists($data['user_name'], 'user_name')){\n $ms->addMessageTranslated(\"danger\", \"ACCOUNT_USERNAME_IN_USE\", $data);\n $error = true;\n }\n\n if (UserLoader::exists($data['email'], 'email')){\n $ms->addMessageTranslated(\"danger\", \"ACCOUNT_EMAIL_IN_USE\", $data);\n $error = true;\n }\n \n // Halt on any validation errors\n if ($error) {\n $this->_app->halt(400);\n }\n \n // Get default primary group (is_default = GROUP_DEFAULT_PRIMARY)\n $primaryGroup = GroupLoader::fetch(GROUP_DEFAULT_PRIMARY, \"is_default\");\n \n // Set default values if not specified or not authorized\n if (!isset($data['locale']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"locale\"]))\n $data['locale'] = $this->_app->site->default_locale;\n \n if (!isset($data['title']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"title\"])) {\n // Set default title for new users\n $data['title'] = $primaryGroup->new_user_title;\n }\n \n if (!isset($data['primary_group_id']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"primary_group_id\"])) {\n $data['primary_group_id'] = $primaryGroup->id;\n }\n \n // Set groups to default groups if not specified or not authorized to set groups\n if (!isset($data['groups']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"groups\"])) {\n $default_groups = GroupLoader::fetchAll(GROUP_DEFAULT, \"is_default\");\n $data['groups'] = [];\n foreach ($default_groups as $group_id => $group){\n $data['groups'][$group_id] = \"1\";\n }\n }\n \n // Hash password\n $data['password'] = Authentication::hashPassword($data['password']);\n \n // Create the user\n $user = new User($data);\n\n // Add user to groups, including selected primary group\n $user->addGroup($data['primary_group_id']);\n foreach ($data['groups'] as $group_id => $is_member) {\n if ($is_member == \"1\"){ \n $user->addGroup($group_id); \n }\n }\n \n // Store new user to database\n $user->store(); \n \n // Success message\n $ms->addMessageTranslated(\"success\", \"ACCOUNT_CREATION_COMPLETE\", $data);\n }", "public function onFormSuccess(FormEvent $event)\n {\n $values = $event->getValues();\n $control = $event->getControl();\n $presenter = $event->getPresenter();\n $form = $event->getForm();\n if($values->id == null){\n $this->addUser($values, $control, $presenter, $form);\n } else {\n $this->saveUser($values, $control, $presenter, $form);\n }\n return;\n }", "function SignupAction($data, $form) {\n \n\t\t\n\t\t// Create a new object and load the form data into it\n\t\t$entry = new SearchContestEntry();\n\t\t$form->saveInto($entry);\n \n\t\t// Write it to the database.\n\t\t$entry->write();\n\t\t\n\t\tSession::set('ActionStatus', 'success'); \n\t\tSession::set('ActionMessage', 'Thanks for your entry!');\n\t\t\n\t\t//print_r($form);\n\t\tDirector::redirectBack();\n \n\t}", "public function signup() {\n\t\t//$this->set('title_for_layout','Sign Up');\n\t\t//$this->layout = 'clean';\n\t\t\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->request->data['User']['username'] = strip_tags($this->request->data['User']['username']);\n\t\t\t$this->request->data['User']['fullname'] = strip_tags($this->request->data['User']['fullname']);\n\t\t\t$this->request->data['User']['location'] = strip_tags($this->request->data['User']['location']);\n\t\t\t//$this->request->data['User']['slug'] = $this->toSlug($this->request->data['User']['username']); //Should happen automagically with the Sluggable plugin\n\t\t\t\n\t\t\t//Register the user\n\t\t\t$user = $this->User->register($this->request->data,true,false);\n\t\t\tif (!empty($user)) {\n\t\t\t\t//Generate a public key that the user can use to login later (without username and password)\n\t\t\t\t//$this->User->generateAndSavePublicKey($user);\n\t\t\t\t\n\t\t\t\t//Send the user their activation email\n\t\t\t\t$options = array(\n\t\t\t\t\t\t\t\t\t'layout'=>'signup_activate',\n\t\t\t\t\t\t\t\t\t'subject'=>__('Activate your account at Prept!', true),\n\t\t\t\t\t\t\t\t\t'view'=>'default'\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t$viewVars = array('user'=>$user,'token'=>$user['User']['email_token']);\n\t\t\t\t$this->_sendEmail($user['User']['email'],$options,$viewVars);\n\t\t\t\t$this->User->id = $user['User']['id'];\n\t\t\t\t$this->request->data['User']['id'] = $this->User->id; \n\t\t\t\t$this->Auth->autoRedirect = false;\n\t\t\t\tif($this->Auth->login($this->request->data['User'])){\n\t\t\t\t\t//The login was a success\n\t\t\t\t\tunset($this->request->data['User']);\n\t\t\t\t\t$this->Session->setFlash(__('You have successfully created an account &mdash; now get to studying.', true));\n\t\t\t\t\t$this->Auth->loginRedirect = array('admin'=>false,'controller'=>'users','action'=>'backpack');\n\t\t\t\t\treturn $this->redirect($this->Auth->loginRedirect);\n\t\t\t\t}else{\n\t\t\t\t\t$this->Session->setFlash(__(\"There was an error logging you in.\", true));\n\t\t\t\t\t$this->redirect(array('admin'=>false,'action' => 'login'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "function indexAction()\n {\n if(!$this->getDi()->auth->getUserId() && $this->_request->isGet())\n $this->getDi()->auth->checkExternalLogin($this->_request);\n /*==TRIAL_SPLASH==*/\n\n if (!$this->getDi()->auth->getUserId() && $this->getDi()->config->get('signup_disable')) {\n $e = new Am_Exception_InputError(___('New Signups are Disabled'));\n $e->setLogError(false);\n throw $e;\n }\n\n $this->loadForm();\n $this->view->title = ___($this->record->title);\n $this->form = new Am_Form_Signup();\n $this->form->setParentController($this);\n\n if (($h = $this->getDi()->request->getFiltered('order-data')) &&\n ($hdata = $this->getDi()->store->get('am-order-data-'.$h)))\n {\n $dhdata = json_decode($hdata, true);\n if ($this->getDi()->auth->getUser() && isset($dhdata['redirect'])) {\n $this->getDi()->store->delete('am-order-data-'.$h);\n Am_Mvc_Response::redirectLocation($dhdata['redirect']);\n }\n $this->form->getSessionContainer()->storeOpaque('am-order-data', $dhdata);\n }\n $this->form->initFromSavedForm($this->record);\n try {\n $this->form->run();\n } catch (Am_Exception_QuietError $e){\n $e->setPublicTitle($this->record->title);\n throw $e;\n }\n }", "function new_member_profile_form()\n {\n if ( ! Session::access('can_admin_members')) {\n return Cp::unauthorizedAccess();\n }\n\n Cp::$body_props = \" onload=\\\"document.forms[0].email.focus();\\\"\";\n\n $title = __('members.register_member');\n\n // Build the output\n $r = Cp::formOpen(['action' => 'C=Administration'.AMP.'M=members'.AMP.'P=register_member']);\n\n $r .= Cp::quickDiv('tableHeading', $title);\n $r .= Cp::div('box');\n $r .= Cp::itemgroup(\n Cp::required().NBS.__('account.email'),\n Cp::input_text('email', '', '35', '32', 'input', '300px')\n );\n\n $r .= Cp::itemgroup(\n Cp::required().NBS.__('account.password'),\n Cp::input_pass('password', '', '35', '32', 'input', '300px')\n );\n\n $r .= Cp::itemgroup(\n Cp::required().NBS.__('account.password_confirm'),\n Cp::input_pass('password_confirm', '', '35', '32', 'input', '300px')\n );\n\n $r .= Cp::itemgroup(\n Cp::required().NBS.__('account.screen_name'),\n Cp::input_text('screen_name', '', '40', '50', 'input', '300px')\n );\n\n $r .= '</td>'.PHP_EOL.\n Cp::td('', '45%', '', '', 'top');\n\n $r .= Cp::itemgroup(\n Cp::required().NBS.__('account.email'),\n Cp::input_text('email', '', '35', '100', 'input', '300px')\n );\n\n // Member groups assignment\n if (Session::access('can_admin_mbr_groups')) {\n $query = DB::table('member_groups')\n ->select('group_id', 'group_name')\n ->orderBy('group_name');\n\n if (Session::userdata('group_id') != 1)\n {\n $query->where('is_locked', 'n');\n }\n\n $query = $query->get();\n\n if ($query->count() > 0)\n {\n $r .= Cp::quickDiv(\n 'paddingTop',\n Cp::quickDiv('defaultBold', __('account.member_group_assignment'))\n );\n\n $r .= Cp::input_select_header('group_id');\n\n foreach ($query as $row)\n {\n $selected = ($row->group_id == 5) ? 1 : '';\n\n // Only SuperAdmins can assigned SuperAdmins\n if ($row->group_id == 1 AND Session::userdata('group_id') != 1) {\n continue;\n }\n\n $r .= Cp::input_select_option($row->group_id, $row->group_name, $selected);\n }\n\n $r .= Cp::input_select_footer();\n }\n }\n\n $r .= '</div>'.PHP_EOL;\n\n // Submit button\n\n $r .= Cp::itemgroup( '',\n Cp::required(1).'<br><br>'.Cp::input_submit(__('cp.submit'))\n );\n $r .= '</form>'.PHP_EOL;\n\n\n Cp::$title = $title;\n Cp::$crumb = Cp::anchor(BASE.'?C=Administration'.AMP.'area=members_and_groups', __('admin.members_and_groups')).\n Cp::breadcrumbItem($title);\n Cp::$body = $r;\n }", "public function postAdd() {\n try {\n $this->_adminUserRepository->addOrUpdateUsers ();\n } catch ( Exception $e ) {\n $this->logger->error ( $e->getMessage () );\n }\n \n return redirect ( StringLiterals::ADMIN_USERS )->withSuccess ( trans ( 'user::adminuser.success' ) );\n }", "public function signup()\n {\n if (isset($_POST['signUp'])) {\n $userExist = $this->checkIfUserExist($_POST['login']);\n $userPassword = $_POST['password'];\n \n if ($userExist === false) {\n if ($userPassword === $_POST['passwordConfirm']) {\n $hashPassword = password_hash($userPassword, PASSWORD_DEFAULT);\n \n $affectedUser = $this->usersManager->setNewUser($_POST['firstName'], $_POST['lastName'], $_POST['login'], $hashPassword, $_POST['email'], 'reader');\n \n if ($affectedUser === false) {\n header('Location: auth&alert=signup');\n exit();\n } else {\n header('Location: auth&alert=success');\n exit();\n }\n } else {\n header('Location: auth&alert=passwords');\n exit();\n }\n } else {\n header('Location: auth&alert=userSignup');\n exit();\n }\n } else {\n throw new Exception($this->datasError);\n }\n\n }", "public function createAccount(){\n\n\t\t$title = 'Create Account.';\n\n\t\treturn View('accounts.createAccount')\n ->with('title', $title);\n\t}", "public function new_user()\n\t{\n\t\t$this->load->view('signup_view');\n\t}", "public function signupAction()\n {\n // check request method\n if (Router::getMethod() == 'POST') {\n $username = Router::getParam('username');\n $password = Router::getParam('password');\n\n // fill user object with data and try to save\n $user = new User($username, $password, Router::getIp());\n if (!$user->save()) {\n // add errors to display\n $this->setMessage($user->getErrors(), 'error');\n $this->setVar('username', $user->getUsername());\n } else {\n Router::redirect('index', 'signin');\n }\n } elseif (isset($_SESSION['userId'])) {\n Router::redirect('index', 'index');\n }\n\n $this->setVar('title', 'Sign up page');\n $this->render('signup');\n }", "public function create()\n\t{\n\t\tif (!isset($_POST) || empty($_POST))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// TODO need to validate data\n\t\t$data = array('username' => $_POST['username'], 'password' => $_POST['password'], 'cpassword' => $_POST['cpassword'], 'email' => $_POST['email']);\n\t\t// validate the input data\n\t\t$errorArray = User::validates($data);\n\t\tif (count($errorArray))\n\t\t{\n\t\t\t// store errors in session and redirect\n\t\t\t$_SESSION['user'] = $data;\n\t\t\t$_SESSION['user']['errors'] = $errorArray;\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// create a new user, assume all new users are not staff\n\t\t$values = array('username'=>$_POST['username'],'password'=>$_POST['password'],'email'=>$_POST['email'],'user_type'=>'1');\n\t\t$id = User::createUser($values);\n\t\t// log the user in\n\t\t$_SESSION['user']['id'] = $id;\n\t\t$_SESSION['user']['name'] = $_POST['username'];\n\t\t$_SESSION['user']['type'] = '1';\n\t\techo \"id = \" . $id;\n\t\theader(\"Location: /myrecipe/users/\" . $id);\n\t\texit;\n\t}", "function addsubmit() \n\t{\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n\n \n // Use the add action's post form variables and the current precise time to insert an article.\n // validate all post variables before inserting them to avoid a\n // SQL Injection attack and ensure that we've working with clean data. \n\t\t$email=$_POST['email'];\n\t\t$password=$_POST['password'];\n\t\ttry\n\t\t{\n\t\t if (!empty($_POST['username'])&& !empty($_POST['firstname'])&& !empty( $_POST['role']) && !empty($_POST['email']) && !empty($_POST['password']))\n\t\t { \n\t\t\t$result= UserModel::Create()->InsertUser($_POST['username'],$_POST['email'], $password, $_POST['firstname'],$_POST['middlename'],$_POST['lastname'],$_POST['role'], $_POST['phoneres'], $_POST['phonecell'], $_POST['status'], $_POST['comments']);\n\t\t\t\n\t\t\tif(empty($result))\n\t\t\t{\n\t\t\t\t$this->viewData['module']=\"Add User\";\n\t\t\t\t$this->viewData['error']= \"Failed to Add the user\";\n\t\t\t\t$this->renderWithTemplate('common/error', 'AdminPageBaseTemplate');\n\t\t\t}\n\t\t\telse // invite the user by sending email \n\t\t\t{\n\t\t\t\tMailModel::SendInvitation($_POST['email'], $_POST['firstname'],$result);\n\t\t\t\t$this->renderWithTemplate('users/addsubmit', 'AdminPageBaseTemplate');\n\t\t\t}\n\t\t }\n\t\t}\n\t\tcatch (Exception $ex)\n\t\t{\n\t\t\t$this->viewData['module']=\"Add User\";\n\t\t\t$this->viewData['error']= $ex->getMessage();\n\t\t\t$this->renderWithTemplate('common/error', 'AdminPageBaseTemplate');\n\t\t}\n\t\t\n\t}", "public function createAction()\r\n {\r\n $user = new User($_POST);\r\n\r\n if ($user->save()) {\r\n\t\t\t\r\n\t\t\tsession_regenerate_id(true);\r\n\r\n\t\t\t$_SESSION['user_id'] = User::getIdSavedUser($_POST['email']);\r\n\t\t\t\r\n\t\t\tIncome::saveDefaultIncomes($_SESSION['user_id']);\r\n\t\t\tExpense::saveDefaultExpenses($_SESSION['user_id']);\r\n\t\t\tPaymentMethod::saveDefaultPaymentMethods($_SESSION['user_id']);\r\n\t\t\t\r\n\t\t\t$user->sendActivationEmail();\r\n\r\n $this->redirect('/signup/success');\r\n\r\n } else {\r\n\r\n View::renderTemplate('Signup/new.html', [\r\n 'user' => $user\r\n ]);\r\n\r\n }\r\n }", "public function createFollower(array $context) {\n if (isset($context[$this->successMsg])) {\n $this->cookie->set($this->successMsg, $context[$this->successMsg]);\n } else if (isset($context[$this->errorMsg])) {\n $this->cookie->set($this->errorMsg, $context[$this->errorMsg]);\n }\n \n header('Location: ' . \"/users/\", true, 303);\n die;\n }", "public function add() {\n\t\tRouter::redirect('/users/profile');\t\n\t}", "function RedirectUser(){\r\n\t\t\r\n\t\t\tif (empty($email) || empty($userName) || empty($pwd)){\r\n\t\t\t\techo \"<script type='text/Javascript'> alert('Please fill out all required fields')</script>\";\r\n\t\t\t\techo \"<script type='text/Javascript'> window.location.href='landing.php'</script>\";\r\n\t\t\t}\r\n\t\t\r\n\t}", "function message(){\n\t\t\treturn \"New Admin has been successfully created!\";\n\t\t}", "public function doCreate() {\n if(\n isset($_POST['email']) &&\n isset($_POST['password']) &&\n isset($_POST['lastName']) &&\n isset($_POST['firstName']) &&\n isset($_POST['address']) &&\n isset($_POST['postalCode']) &&\n isset($_POST['city'])\n ) {\n $alreadyExist = $this->userManager->findByEmail($_POST['email']);\n\n if(!$alreadyExist) {\n $newUser = new User($_POST);\n $this->userManager->create($newUser);\n $page = 'login';\n }\n else {\n $error = \"ERROR : This email (\".$_POST['email'].\") is used by another user\";\n $page = 'create';\n }\n }\n\n require('./View/default.php');\n }", "function form_success() {\n\t\t$this->sci->da('template');\n\t}", "public function regNewCommercialUser()\n {\n $this->view('Registration/commercial_user_registration');\n }", "public function signupAction()\n {\n $form = new SignUpForm();\n\n if ($this->request->isPost()) {\n\n if ($form->isValid($this->request->getPost()) != false) {\n\n $user = new Users();\n\n $user->assign(array(\n 'name' => $this->request->getPost('name', 'striptags'),\n 'email' => $this->request->getPost('email'),\n 'password' => $this->security->hash($this->request->getPost('password')),\n 'profilesId' => 2\n ));\n\n if ($user->save()) {\n return $this->dispatcher->forward(array(\n 'controller' => 'index',\n 'action' => 'index'\n ));\n }\n\n $this->flash->error($user->getMessages());\n }\n }\n\n $this->view->form = $form;\n }", "public function signupAction()\n {\n $form = new SignUpForm();\n\n if ($this->request->isPost()) {\n\n if ($form->isValid($this->request->getPost()) != false) {\n\n $user = new Users();\n\n $user->assign(array(\n 'name' => $this->request->getPost('name', 'striptags'),\n 'email' => $this->request->getPost('email'),\n 'password' => $this->security->hash($this->request->getPost('password')),\n 'profilesId' => 2\n ));\n\n if ($user->save()) {\n return $this->dispatcher->forward(array(\n 'controller' => 'index',\n 'action' => 'index'\n ));\n }\n\n $this->flash->error($user->getMessages());\n }\n }\n\n $this->view->form = $form;\n }", "public function actionSuccess()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\t\t\n\t\t$email = Yii::app()->request->getParam('email');\n\t\t$this->render('success', array('email'=>$email,'is_found'=>true));\n\t}", "public function registration() {\r\n \r\n if (isset($_GET[\"submitted\"])) {\r\n $this->registrationSubmit();\r\n } else {\r\n \r\n }\r\n }" ]
[ "0.72797287", "0.70179784", "0.6999927", "0.6997101", "0.6907326", "0.6898361", "0.68787175", "0.6846908", "0.6828289", "0.68261844", "0.6779459", "0.6724031", "0.6693618", "0.66095746", "0.65954256", "0.6585402", "0.65750766", "0.6554776", "0.65543133", "0.65522784", "0.6524096", "0.6523936", "0.6501957", "0.647937", "0.6460329", "0.6447207", "0.64032096", "0.6402891", "0.6382385", "0.6373523", "0.6361194", "0.6354641", "0.63334715", "0.6332718", "0.6331142", "0.6318302", "0.62968683", "0.62948066", "0.62897724", "0.62894285", "0.62876517", "0.6273948", "0.6262782", "0.62396556", "0.62313837", "0.62241346", "0.6201751", "0.61982465", "0.6194296", "0.6181225", "0.61807287", "0.6179182", "0.61749077", "0.61707675", "0.61525494", "0.61427337", "0.61401755", "0.61321086", "0.6130911", "0.61224204", "0.6121795", "0.611757", "0.6117198", "0.61059034", "0.6104758", "0.61046034", "0.6095122", "0.60854405", "0.607843", "0.6073055", "0.6071164", "0.607034", "0.606086", "0.605302", "0.60503966", "0.6047667", "0.6043006", "0.6033246", "0.6024633", "0.6024344", "0.6022372", "0.6018814", "0.60165167", "0.6008914", "0.600485", "0.6001035", "0.59941906", "0.59922665", "0.5989732", "0.5988369", "0.59882885", "0.59881675", "0.59723705", "0.596796", "0.59639263", "0.59592384", "0.59569055", "0.59569055", "0.59520876", "0.5951482" ]
0.6163908
54
Callback at failure. Prints out an error message and redirects back to the form.
public function callbackFail() { if (isset($this->exception)) { if (strpos($this->exception, CFormAddUser::SQLSTATE) !== false && strpos($this->exception, CFormAddUser::ERROR_DUPLICATE_KEY) !== false) { $errorMessage = "<p><i>Fel har uppstått i databasen. Akronym är redan upptaget, försök att välja ny akronym eller kontakta administratör!</i></p>"; } else { $errorMessage = "<p><i>Fel har uppstått i databasen, försök igen eller kontakta administratör!</i></p>"; } } else { if (isset($this->errorMessage)) { $errorMessage = $this->errorMessage; } else { $errorMessage = "<p><i>Fel har uppstått i databasen, kunde ej spara information i databasen. Försök igen eller kontakta administratör!</i></p>"; } } $this->AddOutput($errorMessage); $this->redirectTo(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function callbackFail()\r\n {\r\n //$this->AddOutput(\"<p><i>Form was submitted and the Check() method returned false.</i></p>\");\r\n $this->redirectTo();\r\n }", "public function callbackFail()\n {\n $this->AddOutput(\"<p><i>Form was submitted and the Check() method returned false.</i></p>\");\n $this->redirectTo();\n }", "public function callbackFail()\n {\n $this->AddOutput(\"<p><i>Form was submitted and the Check() method returned false.</i></p>\");\n }", "public function callbackFail()\n {\n $this->redirectTo();\n }", "protected function failure($error_msg) {\r\n $this->dest_page = 'login';\r\n \r\n /*\r\n * If the $_POST['dest'] was set, pass it back to the form as a $_GET\r\n * parameter\r\n */\r\n $dest_param = $this->request->request->get(\"dest\", null);\r\n if (!is_null($dest_param)) {\r\n $this->dest_params = \"?dest\" . \\urlencode($dest_param);\r\n }\r\n \r\n /*\r\n * Set the error message for the form\r\n */\r\n $this->session->set('login_err', $error_msg);\r\n\r\n /*\r\n * Redirect to $this->dest_code\r\n */\r\n $this->redirect();\r\n \r\n \r\n }", "public function errorAction()\n {\n // get the view vars\n $site = $this->view->site;\n $errors = $this->view->errors;\n $loginUser = $this->view->loginUser;\n\n // set the input params\n $optionalParams = array(\n 'errorCode',\n );\n\n $input = $this->processInput( null, $optionalParams, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n if ( !$this->view->ajax ) {\n $homeUrl = $site->getUrl( 'home' );\n return $this->_redirect( $homeUrl );\n }\n\n return $this->renderPage( 'authError' );\n }", "public function callbackFail()\n {\n $this->di->get(\"response\")->redirect(\"user\")->send();\n }", "private function failure() : void\n {\n (new Repository())->disconnect();\n (new Session())->set('user','success', 'Une erreur est survenue nous vous prions de réessayer ultèrieurement');\n header('Location:' . self::REDIRECT_HOME);\n die();\n }", "public function runError() {\n\t\t\t$this->setSession('sError', $this->getError());\n\n\t\t\t// Set the router\n\t\t\tredirect(\n\t\t\t\t$this->getUrl(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'sRouter' => 'error', \n\t\t\t\t\t\t'sController' => 'index'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}", "public function postErrorResponse()\n {\n $this->getResponse()->code(400)->redirect();\n return $this->form;\n }", "public function errorAction()\n {\n $this->_logger->debug(__('Calling errorAction'));\n try {\n $this->loadLayout()\n ->_initLayoutMessages('checkout/session')\n ->_initLayoutMessages('catalog/session')\n ->_initLayoutMessages('customer/session');\n $this->renderLayout();\n $this->_logger->info(__('Successful to redirect to error page.'));\n } catch (\\Exception $e) {\n $this->_logger->error(json_encode($this->getRequest()->getParams()));\n $this->_getCheckoutSession()->addError(__('An error occurred during redirecting to error page.'));\n }\n }", "protected function _redirectToError()\n {\n $this->_redirect(self::ZIPMONEY_ERROR_ROUTE);\n }", "public function callbackFail()\n {\n $this->AddOutput(\"<p><i>\" . $this->logoutMessage . \"</i></p>\");\n $this->redirectTo();\n }", "function died($error) {\r\n \r\n echo \"<h1>Whoops!</h1><h2>There appears to be something wrong with your submission.</h2>\";\r\n \r\n echo \"<strong><p>The following items are not specified correctly.</p></strong><br />\";\r\n \r\n echo $error.\"<br /><br />\";\r\n \r\n echo \"<p>Return to the form and try again.</p><br />\";\r\n\t\techo \"<p><a href='index.php'>return to the homepage</a></p>\";\r\n die();\r\n\t\t\r\n \r\n }", "function render_submission_error( $form, $args ) {\n if ( af_submission_failed( $form['key'] ) ) {\n $errors = AF()->submission['errors'];\n\n foreach ( $errors as $error ) {\n echo '<div class=\"acf-notice -error -acf-error-message-dismiss\">';\n echo sprintf( '<p>%s</p>', $error );\n echo '</div>';\n }\n }\n }", "public function errorAction() {\n\t\tZend_Layout::getMvcInstance ()->setLayout ( \"light\" );\n\t\t$errors = $this->_getParam ( 'error_handler' );\n\t\tif ($errors->exception->getCode () == 404 || in_array ( $errors->type, array (\n\t\t\t\tZend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE,\n\t\t\t\tZend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER,\n\t\t\t\tZend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION \n\t\t) )) {\n\t\t\t$this->getResponse ()->setHttpResponseCode ( 404 );\n\t\t\t$this->_helper->viewRenderer ( '404' );\n\t\t}\n\t\t\n\t\t\n\t\t$this->view->content = $errors->exception->getMessage ();\n\t}", "public function errorAction()\n {\n $errors = $this->_getParam('error_handler');\n\n switch ($errors->type) {\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:\n\n // 404 error -- controller or action not found\n $this->getResponse()->setHttpResponseCode(404);\n $this->view->message = 'Page not found';\n break;\n default:\n // Generic application error\n $this->getResponse()->setHttpResponseCode(500);\n $this->view->message = 'Application error';\n break;\n }\n\n $this->view->exception = $errors->exception;\n $this->view->request = $errors->request;\n $this->_response->clearBody();\n }", "public function errorAction()\r\n {\r\n $this->_helper->layout->setLayout('bzerror');\r\n $this->_helper->redirector('index','bzerror');\r\n //$this->_helper->layout->setLayout('bzerror');\r\n }", "function died($error) {\n header('location: index.html?status=error');\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n \n echo \"These errors appear below.<br /><br />\";\n \n echo $error.\"<br /><br />\";\n \n echo \"Please go back and fix these errors.<br /><br />\";\n \n \n \n die();\n \n }", "public function storeFailed()\r\n {\r\n return $this->redirect(handles('antares::install/create'));\r\n }", "public function actionError() {\n\t\tif($error=Yii::app()->errorHandler->error)\n\t\t{\n\t\t\tif(Yii::app()->request->isAjaxRequest)\n\t\t\t\techo $error['message'];\n\t\t\telse {\n\t\t\t\tif ($error['code']==999) {\n\t\t\t\t\t$model=new LoginForm;\n\t\t\t\t\tDialog::message('Warning Message', $error['message']);\n\t\t\t\t\t$this->layout = \"main_nm\";\n\t\t\t\t\t$this->render('login',array('model'=>$model));\n\t\t\t\t} else {\n\t\t\t\t\t$this->render('error', $error);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function errorAction() {\n $this->setSession();\n $this->setOrder($this->getOrderIdFromResponse());\n $this->setPayment();\n $this->checkHash($this->getPaymentHashFromResponse());\n $params = $this->getRequest()->getParams();\n if (array_key_exists('code', $params)) {\n Mage::log('Error: Order id - '.$this->_order->getIncrementId().', Code - '.$params['code'], null, 'payuplpro.log');\n }\n /** @var Orba_Payuplpro_Model_Payment $paymentModel */\n $paymentModel = Mage::getModel('payuplpro/payment');\n if (!$paymentModel->isPaymentCompleted($this->_order) && !$paymentModel->isOrderCompleted($this->_order)) {\n $state = Mage_Sales_Model_Order::STATE_HOLDED;\n $store_id = $this->_order->getStoreId();\n $this->_order\n ->setHoldBeforeState($this->_order->getState())\n ->setHoldBeforeStatus($this->_order->getStatus())\n ->setState($state, $this->getConfig()->getDefaultStatus($state, $store_id))\n ->save();\n $this->_session->setErrorMessage($this->__('Your transaction was rejected by Payu.pl.').' '.$this->__('Click <a href=\"%s\">here</a> to pay again.', Mage::helper('payuplpro')->getRepeatPaymentUrl($this->_order)));\n $this->_session->getQuote()->setIsActive(false)->save();\n }\n if ($this->isNewOrder()) {\n $this->_redirect('checkout/onepage/failure', array('_secure'=>true));\n } else {\n $this->loadLayout();\n $this->renderLayout();\n }\n }", "protected function errorAction() {}", "function died($error) {\n\t\techo $template_1;\n\t\techo \"We're sorry, but there's errors found with the form you submitted.<br /><br />\";\n\t\techo $error.\"<br /><br />\";\n\t\techo \"<a href='contact.html'>Please go back</a> and fix these errors.<br /><br />\";\n\t\techo $template_2;\n\t\tdie();\n\t}", "function quitWithError($id, $err, $qty, $price, $email)\n{\n // Create dummy form\n echo \"\n <form id='redirect' action='..' method='post'>\n <input type='hidden' id='failure_id' name='failure_id' value='$id'></input>\n <input type='hidden' id='error' name='error' value='$err'></input>\n <input type='hidden' id='quantity' name='quantity' value='\".$qty.\"'></input>\n <input type='hidden' id='price' name='price' value='\".$price.\"'></input>\n <input type='hidden' id='email' name='email' value='\".$email.\"'></input>\n </form>\";\n\n // Submit form on load\n echo \"<script type='text/javascript'>\n function submit () {\n document.getElementById('redirect').submit();\n }\n window.onload = submit;\n </script>\";\n}", "public function actionError() {\n\t if($error=app()->errorHandler->error) {\t\t\n\t \tif(app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse {\n\t\t\t\t$row = Pagecontent::model()->getPageContent('pagenotfound'); // get the page content for the page\n\t\t\t\tif ($row) { // row is found (page has contents) so we are rending the default view\n\t\t\t\t\t$row['html_title'] .= (!empty($row['html_title']) ? ' ' : '') . ' (' . $error['code'] . ')';\n\t\t\t\t\t$this->setPageAttributes($row);\t\t\n\t\t\t\t\t$this->render('default',array ('row'=>$row));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$this->render('error', $error); // execute the error view file \t \t\n\t\t\t}\n\t }\n\t}", "protected function addErrorFlashMessage() {}", "public function failedToSubmitApplicationAction()\n {\n $application = $this\n ->getIrisAgentContext()\n ->getReferencingApplicationClient()\n ->getReferencingApplication(array(\n 'referencingApplicationUuId' => $this->getSymfonyRequest()->query->get('uuid'),\n ))\n ;\n\n $this->renderTwigView('/iris-referencing/failed-to-submit-application.html.twig', array(\n 'application' => $application,\n ));\n }", "public function error() \n\t{\n\t\trequire $this->view('error', 'error');\n\t\texit;\n\t}", "public function actionError()\r\n\t{\r\n\t\tif(Yii::app()->user->isGuest)\r\n\t\t\t$this->layout='//layouts/loginForm';\r\n\t\tif($error=Yii::app()->errorHandler->error)\r\n\t\t{\r\n\t\t\tif(Yii::app()->request->isAjaxRequest)\r\n\t\t\t\techo $error['message'];\r\n\t\t\telse\r\n\t\t\t\t$this->render('error', $error);\r\n\t\t}\r\n\t}", "function reiskoffer_frontend_login_fail( $username ) {\n\tif(isset($_SERVER['HTTP_REFERER'])) {\n \t $referrer = $_SERVER['HTTP_REFERER']; // where did the post submission come from?\n }\n // if there's a valid referrer, and it's not the default log-in screen\n if ( !empty($referrer) && !strstr($referrer, 'wp-login') && !strstr($referrer, 'wp-admin') ) {\n wp_redirect( $referrer . '?login=failed' ); // let's append some information (login=failed) to the URL for the theme to use\n exit;\n } else {\n\t wp_redirect(home_url());\n\t exit();\n }\n}", "public function actionError()\n {\n if(Core::getLoggedDeliveryBoyID() > 0)\n {\n\t \t $exception = Yii::$app->errorHandler->exception;\n\t \t $error = array('statusCode' => $exception->statusCode, 'message' => $exception->getMessage(), 'name' => $exception->getName());\n \t\t return $this->render('/error', ['error' => $error]);\n }\n else\n {\n\t \t\treturn Yii::$app->getResponse()->redirect(Yii::$app->getHomeUrl().'delivery')->send();\n }\n }", "public function err_page()\n {\n $site = new SiteContainer($this->db);\n\n $site->printHeader();\n $site->printNav();\n echo \"An Error has occured and your request could not be completed. Return <a href=\\\"index.php\\\">Home</a>\";\n $site->printFooter();\n }", "protected function errorAction() {\n\t\t$errorFlashMessage = $this->getErrorFlashMessage();\n\t\tif ($errorFlashMessage !== FALSE) {\n\t\t\t$this->flashMessageContainer->addMessage($errorFlashMessage);\n\t\t}\n\t\t$postNode = $this->arguments['postNode']->getValue();\n\t\tif ($postNode !== NULL) {\n\t\t\t$this->redirect('show', 'Frontend\\Node', 'TYPO3.Neos', array('node' => $postNode));\n\t\t}\n\n\t\t$message = 'An error occurred while trying to call ' . get_class($this) . '->' . $this->actionMethodName . '().' . PHP_EOL;\n\t\tforeach ($this->arguments->getValidationResults()->getFlattenedErrors() as $propertyPath => $errors) {\n\t\t\tforeach ($errors as $error) {\n\t\t\t\t$message .= 'Error for ' . $propertyPath . ': ' . $error->render() . PHP_EOL;\n\t\t\t}\n\t\t}\n\n\t\treturn $message;\n\t}", "public function errorAction() {\n $errors = $this->_getParam(\"error_handler\");\n \n // assegno i valori alla view\n $this->viewInit();\n switch ($errors->type) {\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:\n // 404 error -- controller or action not found \n $this->getResponse()->setRawHeader(\"HTTP/1.1 404 Not Found\");\n $this->view->title = \"HTTP/1.1 404 Not Found\";\n break;\n default:\n // application error; display error page, but don't change \n // status code\n $this->view->title = \"Application Error\";\n break;\n }\n $this->view->message = $errors->exception;\n }", "public function showFailed();", "function showerror($err) {\n\t\techo \"<script language='javascript'> alert('Sorry! \" . $err . \"'); history.go(-1);</script>\";\n\t\texit();\n\t}", "public function getFormErrorPage();", "private function redirect_to_error_page($message = array())\n\t{\n\t\t// redirect to error page\n\t\t\\Session::set_flash('error', $message);\n\t\t\\Response::redirect('admin/error');\n\t}", "protected function error($action = __MISSING_ACTION__) {\n\t\theader(\"Location: /error.php?Action=\".$action);\t\n\t}", "function died($error) {\n\t\techo \"We're sorry, but there is an error found with the form you submitted.<br /><br />\";\n\t\techo $error.\"<br /><br />\";\n\t\techo \"Please go back and fix this error.<br /><br />\";\n\t\tdie();\n\t}", "public function actionError()\n\t{\n\t\treturn $this->render('error');\n\t}", "function died($error) {\r\n echo \"Sentimos muito mas o formulário enviado contém erros<br/>\";\r\n echo \"Os erros seguintes apareceram:<br /><br />\";\r\n echo $error.\"<br /><br />\";\r\n echo \"Por favor, volte e corrija-os.<br /><br />\";\r\n die();\r\n }", "public static function error()\n {\n if ($error = static::$errorHandler) {\n admin_exit($error());\n }\n\n if (Helper::isAjaxRequest()) {\n abort(403, trans('admin.deny'));\n }\n\n admin_exit(\n Content::make()->withError(trans('admin.deny'))\n );\n }", "public function doneFailed()\r\n {\r\n /* @var $progress Progress */\r\n $progress = app()->make(Progress::class);\r\n $progress->reset();\r\n\r\n app('antares.messages')->add('error', trans('Installation failed. Please try again or contact with software provider.'));\r\n return $this->redirect(handles('antares::install/failed'));\r\n }", "function died($error) {\n\necho \"We are very sorry, but there were error(s) found with the form you submitted. \";\n\necho \"These errors appear below.<br /><br />\";\n\necho $error.\"<br /><br />\";\n\necho \"Please go back and fix these errors.<br /><br />\";\n\ndie();\n\n}", "function died($error) {\n echo \"<h3>We are very sorry, but there were error(s) found with the form you submitted.</h3>\";\n echo \"<h3>These errors appear below.</h3>\";\n echo \"<h3>\".$error.\"</h3>\";\n echo \"<h3>Please go back and fix these errors.</h3>\";\n die();\n }", "public function errorAction() {\n\t\t\n\t\t$errors = $this->_getParam('error_handler');\n\t\t\n\t\tswitch ($errors->type) {\n\t\t\t \n\t\t\tcase Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:\n\t\t\tcase Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:\n\t\t\t\t\n\t\t\t\t// stranka nebyla nalezena - HTTP chybova hlaska 404\n\t\t\t\t$this->getResponse()->setHttpResponseCode(404);\n\t\t\t\t$this->view->message = 'Stránka nenalezena';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\t\n\t\t\t\t// chyba v aplikaci - HTTP chybova hlaska 500\n\t\t\t\t$this->getResponse()->setHttpResponseCode(500);\n\t\t\t\t$this->view->message = 'Chyba v aplikaci';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t}\n\t\t\n $this->view->env = APPLICATION_ENV;\n\t\t$this->view->exception = $errors->exception;\n\t\t$this->view->request = $errors->request;\n\t\t$this->view->title = 'Objevila se chyba';\r\n\t\t$this->view->showDetails = ini_get('display_errors');\r\n\t\t\n\t\t$this->_helper->layout->setLayout('error');\n\t\t\n\t}", "public function errorAction()\n {\n $code = $this->_request->getParam('errorCode');\n $this->view->errorCode = $code;\n $this->getResponse()->setRawHeader('HTTP/1.1 500 Internal Server Error');\n }", "function redirect_error($code, $url = null) {\n\n global $CFG;\n\n // Set the redirect URL if it wasn't specified as a parameter\n if (!$url) {\n $url = $CFG->wwwroot;\n }\n\n // URL encode parameters to error page\n $code = urlencode($code);\n $url = urlencode($url);\n\n // Redirect user to error page with encoded parameters\n redirect($CFG->wwwroot . \"/blocks/courseprefs/error.php?error=$code\" .\n ($url ? \"&url=$url\" : ''));\n}", "public function errorAction()\r\n {\r\n $errors = $this->_getParam('error_handler');\r\n $messages = array();\r\n\r\n switch ((string)$errors->type) {\r\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:\r\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:\r\n // 404 error -- controller or action not found\r\n $this->getResponse()->setRawHeader('HTTP/1.1 404 Not Found');\r\n\r\n $messages[] = Zoo::_(\"The page you requested was not found.\");\r\n if (ZfApplication::getEnvironment() == \"development\" || ZfApplication::getEnvironment() == \"staging\") {\r\n $messages[] = $errors->exception->getMessage();\r\n }\r\n break;\r\n\r\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_OTHER:\r\n case 0:\r\n // application error\r\n //$messages[] = Zoo::_(\"An unexpected error occurred with your request. Please try again later.\");\r\n $messages[] = $errors->exception->getMessage();\r\n if (ZfApplication::getEnvironment() == \"development\" || ZfApplication::getEnvironment() == \"staging\") {\r\n $trace = $errors->exception->getTrace();\r\n foreach (array_keys($trace) as $i) {\r\n if ($trace[$i]['args']) {\r\n foreach ($trace[$i]['args'] as $index => $arg) {\r\n if (is_object($arg)) {\r\n $trace[$i]['args'][$index] = get_class($arg);\r\n }\r\n elseif (is_array($arg)) {\r\n $trace[$i]['args'][$index] = \"array\";\r\n }\r\n }\r\n }\r\n $trace[$i]['file_short'] = \"..\".substr($trace[$i]['file'], strrpos(str_replace(\"\\\\\", DIRECTORY_SEPARATOR, $trace[$i]['file']), DIRECTORY_SEPARATOR));\r\n }\r\n $this->view->assign('trace', $trace);\r\n }\r\n break;\r\n\r\n default:\r\n // application error\r\n $this->getResponse()->setRawHeader('HTTP/1.1 '.$errors->type);\r\n $messages[] = $errors->exception->getMessage();\r\n break;\r\n }\r\n\r\n // Clear previous content\r\n $this->getResponse()->clearBody();\r\n\r\n $this->view->assign('errormessages', $messages);\r\n }", "function customError($errno, $errstr)\n {\n $_SESSION['err_msg'] = \"<b>Error:</b> [$errno] $errstr<br />\"; \n header(\"location: ../_php_fail.php\");\n die();\n }", "protected function errorAction()\n\t{\n\t\t$this->handleTargetNotFoundError();\n\n\t\treturn $this->getFlattenedValidationErrorMessage();\n\t}", "public function actionError()\n {\n if(Core::getLoggedUserID() > 0)\n {\n\t \t $exception = Yii::$app->errorHandler->exception;\n\t \t $error = array('statusCode' => $exception->statusCode, 'message' => $exception->getMessage(), 'name' => $exception->getName());\n \t\t return $this->render('/error', ['error' => $error]);\n }\n else\n {\n\t \t\treturn Yii::$app->getResponse()->redirect(Yii::$app->getHomeUrl().'admin')->send();\n }\n }", "function form_fail($filtered_input, &$form) {\r\n}", "function died($error) {\n echo \"<br />\";\n \n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n \n echo \"These errors appear below.<br /><br />\";\n \n echo $error.\"<br /><br />\";\n \n echo \"Please go back and fix these errors.<br /><br />\";\n \n die();\n \n }", "public function actionError()\n\t{\n\t\t$this->layout = '//layouts/error';\n\t\tif($error=Yii::app()->errorHandler->error)\n\t\t{\n\t\t\tif ( empty($error['message']) && isset(Config::$errors[ $error['code'] ]) ) {\n\t\t\t\t$error['message'] = Config::$errors[$error['code']];\n\t\t\t}\n\n\t\t\tif(Yii::app()->getRequest()->getIsAjaxRequest()) {\n\t\t\t\tYii::app()->end( json_encode( array('error'=>$error['code'], 'message'=>$error['message']), JSON_NUMERIC_CHECK ) );\n\t\t\t} else\n\t\t\t\t$this->render('error',array('error' => $error));\n\t\t}\n\t}", "public function index() {\n header('Location: ' . URLROOT . '/errors/page_not_found');\n }", "function print_error($reason,$type = 0) {\n global $version, $header_file, $footer_file, $testing, $post_info, $key;\n global $val, $_POST, $recipient;\n// for missing required data\n // if ($type == \"missing\") {\nhtml_header(\"error\");\n?>\n<p>&nbsp;</p>\n<div align=\"center\">\n<table width=\"500\" border=\"0\" cellpadding=\"10\" cellspacing=\"0\" bgcolor=\"#CCCCCC\">\n <tr>\n <td><strong>The form was not submitted because it contained the following reasons:</strong><br>\n\t<ul>\n\t<?=$reason?>\n\t</ul>\n <p>Please use your browser's back button to return to the form and try again.</p>\n\t</td>\n </tr>\n</table></div>\n<?php\n if($testing == 1) {\n $post_info = $_POST;\n print(\"<p><strong>This script is in testing mode:</strong> <br> Here are the post variables:</p><br>\");\n foreach($post_info as $key=>$val) { print(\"$key: $val<br>\");}\n print(\"<br>And the email would have been sent to: $recipient\"); \n }\n html_footer();\n exit; \n}", "function died($error) {\n \n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n \n echo \"These errors appear below.<br /><br />\";\n \n echo $error.\"<br /><br />\";\n \n echo \"Please go back and fix these errors.<br /><br />\";\n \n die();\n \n }", "function error_redirect($message)\n{\n global $_PAGE;\n\n header(\"Location: /post.php?error_message=\". urlencode($message));\n\n $_PAGE['content'] = \"<p>Post failed. You are being redirected.</p>\";\n\n require('template.php');\n die();\n}", "function error($params = array()) {\n header('location: /');\n }", "public function actionError()\n {\n if ($error = Yii::app()->errorHandler->error) {\n if (Yii::app()->request->isAjaxRequest) {\n $this->layout = 'ajax';\n echo $error['message'];\n } else {\n $this->layout = 'login';\n $this->render('error', $error);\n }\n }\n }", "public function callback_custom_error(){\r\n global $woocommerce;\r\n $checkout_page_id = wc_get_page_id('checkout');\r\n //In case the url for the checkout is not found, we redirect to the home page.\r\n $url_return = ($checkout_page_id) !== -1 ? get_permalink($checkout_page_id) : get_home_url();\r\n\r\n wp_die(wc_get_template( 'error.php', array('url_return' => $url_return), 'flowpaymentfl/', plugin_dir_path( __FILE__ ) .'templates/')); \r\n }", "function died($error) {\r\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\r\n echo \"These errors appear below.<br /><br />\";\r\n echo $error.\"<br /><br />\";\r\n echo \"Please go back and fix these errors.<br /><br />\";\r\n die();\r\n }", "function died($error) {\r\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\r\n echo \"These errors appear below.<br /><br />\";\r\n echo $error.\"<br /><br />\";\r\n echo \"Please go back and fix these errors.<br /><br />\";\r\n die();\r\n }", "function sendto_editor_fail() {\n\tswitch($_GET['error']){\n\t\tcase 'postid_empty':\n\t\t\t$msg = 'Could not get the post_id of this post (notify tech)';\n\t\t\tbreak;\n\t\tcase 'title_empty':\n\t\t\t$msg = 'Please enter a title for this post';\n\t\t\tbreak;\n\t\tcase 'fbwall_empty':\n\t\t\t$msg = 'Please select a FB wall from the dropdown list';\n\t\t\tbreak;\n\t\tcase 'slug_empty':\n\t\t\t$msg = 'Could not get the post_name of this post (notify tech)';\n\t\t\tbreak;\n\t\tcase 'image_empty':\n\t\t\t$msg = 'Please add a featured image to this post';\n\t\t\tbreak;\n\t\tcase 'permalink_empty':\n\t\t\t$msg = 'Could not create permalink to this post (notify tech)';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$msg = 'Unkown error, try clicking \"Publish\" or \"Update\" then submitting again, if problem persists notify tech';\n\t}\n\techo <<<HTML\n<div class=\"error notice\">\n\t<p>Sending email to Editor failed.</p>\n\t<p>$msg</p>\n</div>\nHTML;\n}", "public static function renderErrorPage(): void\n {\n\t\tob_start();\n\t\theader('Location: /page/error');\n\t\tob_end_flush();\n }", "public function errorAction()\n\t{\n\t}", "public function postDispatch() {\r\n $this->render('error');\r\n }", "protected function markAsFailed()\n {\n $this->view->success = false;\n }", "public function actionError()\n\t{\n\t\tif($error = Yii::app()->errorHandler->error)\n\t\t{\n if($error['code']==404)\n\t\t\t$this->render('pages/404');\n else\n $this->redirect('/');\n\t\t}\n\t}", "protected function renderAsError() {}", "public function error($url='index'){\n\t\t$data \t\t\t\t\t\t= $this->data;\n\t\t$data['menu'] \t\t\t\t= 'error';\n\t\techo $this->blade->nggambar('website.error.index',$data);\n\t\treturn;\n\t}", "public function index()\n {\n $this->mPageTitle = lang('reparation_errors');\n $this->render('reparation/errors');\n }", "function died($error) {\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n echo \"These errors appear below.<br /><br />\";\n echo $error.\"<br /><br />\";\n echo \"Please go back and fix these errors.<br /><br />\";\n die();\n }", "function died($error) {\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n echo \"These errors appear below.<br /><br />\";\n echo $error.\"<br /><br />\";\n echo \"Please go back and fix these errors.<br /><br />\";\n die();\n }", "public function error() {\n\t\tnonce_generate();\n\t\t$this->title = !empty($_SESSION['title']) ? $_SESSION['title'] : 'Error';\n\t\tif (!empty($_SESSION['data'])) {\n\t\t\t$data = $_SESSION['data'];\n\t\t} else {\n\t\t\t$data = array(\n\t\t\t\t'error' => 'An unknown error ocurred.',\n\t\t\t\t'link' => ''\n\t\t\t);\n\t\t}\n\t\t$this->content = $this->View->getHtml('content-error', $data, $this->title);\n\t}", "public function actionError(){\n\t\tif($error=Yii::app()->errorHandler->error){\n\t\t\tif(YII_DEBUG){\n\t\t\t\t//开始框架的调试模式则显示错误信息\n\t\t\t\tif(Yii::app()->request->isAjaxRequest)\n\t\t\t\t\techo $error['message'];\n\t\t\t\telse\n\t\t\t\t\t$this->render('error', $error);\n\t\t\t}else{\n\t\t\t\t//否则所有的错误都会导致页面重定向到首页\n\t\t\t\t$this->redirect(array('site/index'));\n\t\t\t}\n\t\t}\n\t}", "private function fail() {\n\t\theader('HTTP/1.1 400 BAD REQUEST');\n\t\tdie('400 BAD REQUEST');\n\t}", "public function actionError()\n\t{\n\t\t$error=Yii::app()->errorHandler->error;\n\t\tif($error)\n\t\t{\n\t\t\t$this->setAutoRender(false);\n\t\t\tif(Yii::app()->request->isAjaxRequest)\n\t\t\t\techo $error['message'];\n\t\t\telse\n\t\t\t\t$this->render('error', $error);\n\t\t}\n\t}", "public function actionError() {\r\n\t\tif ($error = Yii::app()->errorHandler->error) {\r\n\t\t\tif (Yii::app()->request->isAjaxRequest)\r\n\t\t\t\techo $error['message'];\r\n\t\t\telse\r\n\t\t\t\t$this->render('error', $error);\r\n\t\t}\r\n\t}", "public function actionError() {\n if (!empty(Yii::app()->session['_lang'])) {\n\n Yii::app()->language = Yii::app()->session['_lang'];\n } else {\n Yii::app()->session['_lang'] = 'en';\n Yii::app()->language = Yii::app()->session['_lang'];\n }\n if ($error = Yii::app()->errorHandler->error) {\n if (Yii::app()->request->isAjaxRequest)\n echo $error['message'];\n else\n $this->render('error', $error);\n }\n }", "public static function back()\n {\n resolve('session')->set('errors', resolve('bag')->errors);\n\n self::redirect('/' . self::uri());\n }", "public function actionError()\n\t{\n\t\tif ($error = Yii::app()->errorHandler->error)\n\t\t{\n\t\t\tif (Yii::app()->request->isAjaxRequest)\n\t\t\t\techo $error['message'];\n\t\t\telse\n\t\t\t\t$this->render('error', $error);\n\t\t}\n\t}", "public function error(array $options = []){\n\n\t\theader('Location: /home/show');\n\t\tdie();\n\n\t}", "public function redirectBackWithErrors($validator);", "protected function redirectWithError($message = '') {\n\t\tif($message !== '') {\n\t\t\t$this->unknownErrorMessage = $message;\n\t\t}\n\n\t\tflash($this->unknownErrorMessage, 'danger');\n\n\t\treturn redirect()->back()->withInput();\n\t}", "function died($error) {\n\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n\n echo \"These errors appear below.<br /><br />\";\n\n echo $error.\"<br /><br />\";\n\n echo \"Please go back and fix these errors.<br /><br />\";\n\n die();\n\n}", "function died($error) {\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n echo \"These errors appear below.<br /><br />\";\n echo $error.\"<br /><br />\";\n echo \"Please go back and fix these errors.<br /><br />\";\n die();\n }", "function died($error) {\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n echo \"These errors appear below.<br /><br />\";\n echo $error.\"<br /><br />\";\n echo \"Please go back and fix these errors.<br /><br />\";\n die();\n }", "function died($error) {\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n echo \"These errors appear below.<br /><br />\";\n echo $error.\"<br /><br />\";\n echo \"Please go back and fix these errors.<br /><br />\";\n die();\n }", "function died($error) {\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n echo \"These errors appear below.<br /><br />\";\n echo $error.\"<br /><br />\";\n echo \"Please go back and fix these errors.<br /><br />\";\n die();\n }", "function died($error) {\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n echo \"These errors appear below.<br /><br />\";\n echo $error.\"<br /><br />\";\n echo \"Please go back and fix these errors.<br /><br />\";\n die();\n }", "function died($error) {\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n echo \"These errors appear below.<br /><br />\";\n echo $error.\"<br /><br />\";\n echo \"Please go back and fix these errors.<br /><br />\";\n die();\n }", "function died($error) {\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n echo \"These errors appear below.<br /><br />\";\n echo $error.\"<br /><br />\";\n echo \"Please go back and fix these errors.<br /><br />\";\n die();\n }", "public function actionError()\n\t{\n\t\tif($error=Yii::app()->errorHandler->error)\n\t\t{\n\t\t\tif(Yii::app()->request->isAjaxRequest)\n\t\t\techo $error['message'];\n\t\t\telse\n\t\t\t$this->render('error', $error);\n\t\t}\n\t}", "public function actionError()\n\t{\n\t\tif($error=Yii::app()->errorHandler->error)\n\t\t{\n\t\t\tif(Yii::app()->request->isAjaxRequest)\n\t\t\techo $error['message'];\n\t\t\telse\n\t\t\t$this->render('error', $error);\n\t\t}\n\t}", "public function actionError()\r\n\t{\r\n\t\tif($error=Yii::app()->errorHandler->error)\r\n\t\t{\r\n\t\t\tif(Yii::app()->request->isAjaxRequest)\r\n\t\t\t\techo $error['message'];\r\n\t\t\telse\r\n\t\t\t\t$this->render('error', $error);\r\n\t\t}\r\n\t}", "public function actionError()\n\t{\t\t\n\t\tif($error=Yii::app()->errorHandler->error)\n\t\t{\n\t\t\tif(Yii::app()->request->isAjaxRequest)\n\t\t\t\techo $error['message'];\n\t\t\telse\n\t\t\t\t$this->render('error', $error);\n\t\t}\n\t}" ]
[ "0.8235299", "0.81865585", "0.75769424", "0.74670404", "0.7355782", "0.7114263", "0.70683616", "0.6975315", "0.6946625", "0.68424976", "0.6834654", "0.6761724", "0.6759118", "0.67354506", "0.66134584", "0.6582912", "0.6581322", "0.6576393", "0.6566021", "0.6564477", "0.6508693", "0.649484", "0.6493057", "0.6461246", "0.6461049", "0.6422302", "0.6410144", "0.638829", "0.6360088", "0.63519835", "0.6329817", "0.6326456", "0.63183415", "0.630631", "0.63031006", "0.6287736", "0.6264182", "0.6262138", "0.6260885", "0.62604886", "0.6254576", "0.62502664", "0.62338394", "0.62206805", "0.6218981", "0.62173975", "0.6214072", "0.62136537", "0.6186771", "0.61866504", "0.6167877", "0.6163449", "0.61489326", "0.61469233", "0.61436486", "0.61406446", "0.6134177", "0.6130548", "0.6128906", "0.61285055", "0.61273426", "0.61156666", "0.6113367", "0.6110334", "0.60925615", "0.60925615", "0.6080814", "0.60731936", "0.6072895", "0.60663474", "0.60542876", "0.6046948", "0.6044573", "0.6039274", "0.6038407", "0.60372007", "0.60372007", "0.60369", "0.6036521", "0.60242814", "0.60212773", "0.6015146", "0.60150015", "0.60084325", "0.60030174", "0.59953356", "0.59942204", "0.59837884", "0.59831536", "0.5979274", "0.5979274", "0.5979274", "0.5979274", "0.5979274", "0.5979274", "0.5979274", "0.5979085", "0.5979085", "0.59781367", "0.59767294" ]
0.7196847
5
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 history tab.
public function index($playerId){ $data = array(); $player = User::find($playerId); $data['player'] = $player; $matches = Matches::userMatches($playerId); $data['matches'] = $matches; $characters = Characters::all(); $charactersIdToName = array(); foreach($characters as $character){ $charactersIdToName[$character['id']] = $character['name']; } $data['characters'] = $charactersIdToName; return view('history', $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(history $history)\n {\n //\n }", "public function show()\n {\n return view('history');\n }", "public function actionHistory()\n {\n $this->pageTitle = 'Your Viewing History';\n\n $data['pageHistory'] = History::model()->all('page');\n $data['pdfHistory'] = History::model()->all('pdf');\n\n $this->render('//content/history', $data);\n }", "public function canShowHistory() {}", "public function actionHistory()\n {\n $model= User::findOne(['id' => Yii::$app->user->identity->getId()]);\n $orders = Order::find()->where(['id_user' => $model->id])->with('orderProds')->orderBy('date DESC')->all();\n return $this->render('history', [\n 'model' => $model,\n 'orders' => $orders,\n 'page' => SmapPages::find()->where(['id_class'=>4,'alias' => 'history'])->one()\n ]);\n }", "public function history()\n {\n $data['title'] = 'Cuci Sepatu | Kang Cuci';\n $data['user'] = $this->workerModel->datauser();\n\n $this->load->view('worker/worker_header', $data);\n $this->load->view('worker/panel/sepatu', $data);\n $this->load->view('worker/worker_footer');\n }", "public function index()\n {\n $history = App\\Models\\history::latest()->first();\n return view('admin.history.view',compact('history'));\n }", "public function getHistory()\n {\n return view('PagePersonal.history');\n }", "function simple_history_management_page() {\n\n\tglobal $simple_history;\n\n\tsimple_history_purge_db();\n\n\t?>\n\n\t<div class=\"wrap simple-history-wrap\">\n\t\t<h2><?php echo __(\"History\", 'simple-history') ?></h2>\n\t\t<?php\t\n\t\tsimple_history_print_nav(array(\"from_page=1\"));\n\t\techo simple_history_print_history(array(\"items\" => $simple_history->get_pager_size(), \"from_page\" => \"1\"));\n\t\techo simple_history_get_pagination();\n\t\t?>\n\t</div>\n\n\t<?php\n\n}", "public function actionCron_jobs_history()\n {\n $request = Yii::app()->request;\n $model = new ConsoleCommandListHistory('search');\n $model->unsetAttributes();\n\n $model->attributes = (array)$request->getQuery($model->modelName, array());\n \n $this->setData(array(\n 'pageMetaTitle' => $this->data->pageMetaTitle . ' | '. Yii::t('cronjobs', 'View cron jobs history'),\n 'pageHeading' => Yii::t('cronjobs', 'View cron jobs history'),\n 'pageBreadcrumbs' => array(\n Yii::t('cronjobs', 'Cron jobs history'),\n )\n ));\n\n $this->render('cron-jobs-history', compact('model'));\n }", "public function get_history()\n {\n return view('content.history')\n ->with('pages', History::page_all())\n ->with('pdfs', History::pdf_all());\n }", "public static function showMenuItem() {\n $title = __('Login History', 'simple-login-history');\n add_menu_page($title, $title, 'manage_options', 'simple_login_history_show_list', 'SimpleLoginHistory::showList', 'dashicons-welcome-learn-more', 81);\n }", "function learn_press_single_quiz_history() {\n\t\tlearn_press_get_template( 'content-quiz/history.php' );\n\t}", "function action_history()\n{\n\tglobal $pagestore, $page, $full, $HistMax;\n\n\t$history = $pagestore->history($page);\n\n\tgen_headers($history[0][0]);\n\n\n\t$text = '';\n\t$latest_auth = '';\n\t$previous_ver = 0;\n\t$is_latest = 1;\n\n\tfor($i = 0; $i < count($history); $i++)\n\t{\n\t\tif($latest_auth == '')\n\t\t{\n\t\t\t$latest_auth = ($history[$i][3] == '' ? $history[$i][1]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: $history[$i][3]);\n\t\t\t$latest_ver = $history[$i][2];\n\t\t}\n\n\t\tif($previous_ver == 0\n\t\t\t && $latest_auth != ($history[$i][3] == '' ? $history[$i][1]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t : $history[$i][3]))\n\t\t\t{ $previous_ver = $history[$i][2]; }\n\n\t\tif($i < $HistMax || $full)\n\t\t{\n\t\t\t$text = $text . html_history_entry($page, $history[$i][2],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $history[$i][0], $history[$i][1],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $history[$i][3],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $previous_ver == $history[$i][2] || !$full && $i == count($history)-1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $is_latest, $history[$i][4]);\n\t\t}\n\n\t\t$is_latest = 0;\n\t}\n\n\tif($i >= $HistMax && !$full)\n\t\t{ $text = $text . html_fullhistory($page, count($history)); }\n\n\t$p1 = $pagestore->page($page);\n\t$p1->version = $previous_ver;\n\t$p2 = $pagestore->page($page);\n\t$p2->version = $latest_ver;\n\n\t$diff = diff_compute($p1->read(), $p2->read());\n\ttemplate_history(array('page' => $p2->as_array(),\n\t\t\t\t\t\t\t\t\t\t\t\t 'history' => $text,\n\t\t\t\t\t\t\t\t\t\t\t\t 'diff' => diff_parse($diff)));\n}", "public function actionHistory()\n {\n $id = Yii::app()->request->getQuery('id');\n $model = Order::model()->findByPk($id);\n\n if (!$model)\n $this->error404(Yii::t('CartModule.admin', 'ORDER_NOT_FOUND'));\n if ($model->is_deleted)\n throw new CHttpException(404, Yii::t('CartModule.admin', 'ORDER_ISDELETED'));\n $this->render('_history', array(\n 'model' => $model\n ));\n }", "public function showHistory()\n {\n return view('customer.purchase-history', ['cart_items' => Cart::where('user_id', auth()->user()->id)->where('checkout_id', '!=', null)->simplePaginate(10)]);\n }", "public function history($id)\n {\n $history = $this->history->find($id);\n\n return $this->view('account.history', compact('history', 'id'));\n }", "public function history()\n {\n $tittle['tittle'] = 'History Penjualan';\n\n $data = array(\n 'data_penjualan' => $this->penjualan->ambil_data_penjualan()->result_array(),\n 'data_detail_penjualan' => $this->penjualan->ambil_detail_penjualan(),\n 'user' => $this->db->get_where('user', ['username' =>\n $this->session->userdata('username')])->row_array()\n );\n\n //View dari Controller akuntansi/index\n $this->load->view('template/header', $tittle);\n $this->load->view('template/topbar', $data);\n $this->load->view('template/sidebar', $data);\n $this->load->view('transaksi/history', $data);\n $this->load->view('template/footer');\n }", "public function index()\n\t{\n\t\t$orders = Order::select()->whereNull('original_order')->orderBy('updated_at', 'desc')->paginate(6);\n\n\t\treturn view('admin.history.index', compact('orders'));\n\t}", "public function history()\n {\n $data['courses'] = $this->exchange_rates_model->get_courses();\n $data['title'] = 'History course';\n\n $this->load->view('templates/header', $data);\n $this->load->view('exchange_rates/history', $data);\n $this->load->view('templates/footer');\n }", "public function render()\n {\n return view('components.history');\n }", "public function getHistory(){\n \t$History = HPP::where([['hpp_kind','=','history'],['hpp_city_id','=',1]])->get();\n \treturn view('Admin.HistoryPlanPurpose.History' , compact('History'));\n }", "public function history()\n {\n $history = Peminjaman::where('email', Auth::user()->email)->orderBy('created_at', 'desc')->paginate(2);\n $i = ($history->perPage() * $history->currentPage()) - ($history->perPage() - 1);\n return view('peminjaman.history', compact('i', 'history'));\n }", "public function show(HistoryCategory $historyCategory)\n {\n //\n }", "public function history()\n\t{\n\t\t$migration = new \\Hubzero\\Content\\Migration();\n\t\t$history = $migration->history();\n\t\t$items = [];\n\t\t$maxFile = 0;\n\t\t$maxUser = 0;\n\t\t$maxScope = 0;\n\n\n\t\tif ($history && count($history) > 0)\n\t\t{\n\t\t\t$items[] = [\n\t\t\t\t'File',\n\t\t\t\t'By',\n\t\t\t\t'Direction',\n\t\t\t\t'Date'\n\t\t\t];\n\n\t\t\tforeach ($history as $entry)\n\t\t\t{\n\t\t\t\t$items[] = [\n\t\t\t\t\t$entry->scope . DS . $entry->file,\n\t\t\t\t\t$entry->action_by,\n\t\t\t\t\t$entry->direction,\n\t\t\t\t\t$entry->date\n\t\t\t\t];\n\t\t\t}\n\n\t\t\t$this->output->addTable($items, true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->addLine('No history to display.');\n\t\t}\n\t}", "function parse_history_zone()\n\t\t{\n\t\t\tif ( (empty($this->display_history)) || (!($this->display_history)))\n\t\t\t{\n\t\t\t\t//hide the history zone\n\t\t\t\t$this->t->set_var(array( 'history' => ''));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$inst_parser =& CreateObject('workflow.bo_uiinstance', $this->t);\n\t\t\t\t$inst_parser->t =& $this->t;\n\t\t\t\t$inst_parser->parse_instance_history($this->instance->workitems);\n\t\t\t\t$this->t->set_var('history', $this->t->parse('output', 'history_tpl'));\n\t\t\t}\n\t\t}", "public function render()\n {\n return view('sp::components.history');\n }", "public function show(Histories $histories)\n {\n //\n }", "public static function showList() {\n $template = file_get_contents(plugin_dir_path(__FILE__) . 'templates/login_history.html');\n\n $results = self::queryLoginHistories('desc', 25);\n $histories = '';\n foreach ($results as $history) {\n $histories .= '<tr><td>' . $history->logged_in_at. '</td><td>' . $history->user_login . '</td><td>' . $history->remote_ip . '</td><td>' . $history->user_agent . '</td></tr>';\n }\n\n $output = str_replace('%%page_title%%', get_admin_page_title(), $template);\n $output = str_replace('%%login_histories%%', $histories, $output);\n $output = str_replace('%%Recent%%', __('Recent', 'simple-login-history'), $output);\n $output = str_replace('%%record%%', __('record', 'simple-login-history'), $output);\n $output = str_replace('%%csv_download_link%%', plugin_dir_url(__FILE__) . 'download.php', $output);\n echo $output;\n }", "public function index()\n {\n $history = UserDeviceHistory::latest()->paginate(5);\n\n return view('history.index', compact('history'))\n ->with('i', (request()->input('page', 1) - 1) * 5);\n }", "public function index()\n {\n $items = HistoryAlumni::all();\n\n return view('pages.history.index')->with([\n 'items' => $items \n ]);\n }", "public function actionHistory($id)\n\t\t{\n\t\t\t\t$model = $this->findModel($id);\n\n\t\t\t\t$query = new Query();\n\t\t\t\t$orderHistory = new ActiveDataProvider([\n\t\t\t\t\t\t'query' => OrderHistory::find()->where([\n\t\t\t\t\t\t\t\t'order_id' => $model->order_id,\n\t\t\t\t\t\t\t\t// 'attribute' => 'order_status_id'\n\t\t\t\t\t\t]),\n\t\t\t\t\t\t'sort' => [\n\t\t\t\t\t\t\t\t'defaultOrder' => [\n\t\t\t\t\t\t\t\t\t\t// 'attribute' => SORT_ASC,\n\t\t\t\t\t\t\t\t\t\t'create_time' => SORT_ASC\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'pagination' => [\n\t\t\t\t\t\t\t\t'pageSize' => 20,\n\t\t\t\t\t\t],\n\t\t\t\t]);\n\n\t\t\t\treturn $this->render('history', [\n\t\t\t\t\t\t'model' => $model,\n\t\t\t\t\t\t'orderHistory' => $orderHistory,\n\t\t\t\t\t\t'subData' => $this->subData\n\t\t\t\t]);\n\t\t}", "public function show($historyUser)\n {\n //\n }", "protected function showmyhistory() {\n global $USER, $PAGE;\n\n // Create a navigation cache so that we can store the history\n $cache = new navigation_cache('navigationhistory', 60*60);\n\n // If the user isn't logged in or is a guest we don't want to display anything\n if (!isloggedin() || isguestuser()) {\n return false;\n }\n\n // Check the cache to see if we have loaded my courses already\n // there is a very good chance that we have\n if (!$cache->cached('history')) {\n $cache->history = array();\n }\n $history = $cache->history;\n $historycount = count($history);\n\n // Find the initial active node\n $child = false;\n if ($PAGE->navigation->contains_active_node()) {\n $child = $PAGE->navigation->find_active_node();\n } else if ($PAGE->settingsnav->contains_active_node()) {\n $child = $PAGE->settingsnav->find_active_node();\n }\n // Check that we found an active child node\n if ($child!==false) {\n $properties = array();\n // Check whether this child contains another active child node\n // this can happen if we are looking at a module\n if ($child->contains_active_node()) {\n $titlebits = array();\n // Loop while the child contains active nodes and in each iteration\n // find the next node in the correct direction\n while ($child!==null && $child->contains_active_node()) {\n if (!empty($child->shorttext)) {\n $titlebits[] = $child->shorttext;\n } else {\n $titlebits[] = $child->text;\n }\n foreach ($child->children as $child) {\n if ($child->contains_active_node() || $child->isactive) {\n // We have found the active child or one of its parents\n // so break the foreach so we can proceed in the while\n break;\n }\n }\n }\n if (!empty($child->shorttext)) {\n $titlebits[] = $child->shorttext;\n } else {\n $titlebits[] = $child->text;\n }\n $properties['text'] = join(' - ', $titlebits);\n $properties['shorttext'] = join(' - ', $titlebits);\n } else {\n $properties['text'] = $child->text;\n $properties['shorttext'] = $child->shorttext;\n }\n $properties['action'] = $child->action;\n $properties['key'] = $child->key;\n $properties['type'] = $child->type;\n $properties['icon'] = $child->icon;\n\n // Create a new navigation node object free of the main structure\n // so that it is easily storeable and customised\n $child = new navigation_node($properties);\n\n // Check that this page isn't already in the history array. If it is\n // we will remove it so that it gets added at the top and we dont get\n // duplicate entries\n foreach ($history as $key=>$node) {\n if ($node->key == $child->key && $node->type == $child->type) {\n if ($node->action instanceof moodle_url && $child->action instanceof moodle_url && $node->action->compare($child->action)) {\n unset($history[$key]);\n } else if ($child->action instanceof moodle_url && $child->action->out_omit_querystring() == $node->action) {\n unset($history[$key]);\n } else if ($child->action == $node->action) {\n unset($history[$key]);\n }\n }\n }\n // If there is more than 5 elements in the array remove the first one\n // We want a fifo array\n if (count($history) > 5) {\n array_shift($history);\n }\n $child->nodetype = navigation_node::NODETYPE_LEAF;\n $child->children = array();\n // Add the child to the history array\n array_push($history,$child);\n }\n\n // If we have `more than nothing` in the history display it :D\n if ($historycount > 0) {\n // Add a branch to hold the users history\n $mymoodle = $PAGE->navigation->get('mymoodle', navigation_node::TYPE_CUSTOM);\n $myhistorybranch = $mymoodle->add(get_string('showmyhistorytitle', $this->blockname), null, navigation_node::TYPE_CUSTOM, null, 'myhistory');\n $mymoodle->get($myhistorybranch)->children = array_reverse($history);\n }\n\n // Cache the history (or update the cached history as it is)\n $cache->history = $history;\n\n return true;\n }", "function get_history() {\n\t\treturn $this->history;\n\t}", "function show_normal_tabs() {\n //$this->log(\"show_normal_tabs() top\", LOG_DEBUG);\n $this->show_tabs(Configure::read('tabs_order_default'));\n }", "function setTabs(){\n global $ilTabs, $ilCtrl, $ilAccess, $ilLocator;\n\n // show current quiz round inlcuding link and QR code (deadline)\n if ($ilAccess->checkAccess(\"read\", \"\", $this->object->getRefId())){\n $ilTabs->addTab(\"showCurrentRound\", $this->txt(\"tabmenu_showCurrentRound\"), $ilCtrl->getLinkTarget($this, \"showCurrentRound\"));\n }\n\n // tab for the \"edit quiz\" command\n if ($ilAccess->checkAccess(\"write\", \"\", $this->object->getRefId())){\n $ilTabs->addTab(\"editQuiz\", $this->txt(\"tabmenu_edit_quiz\"), $ilCtrl->getLinkTarget($this, \"editQuiz\"));\n }\n\n // show round results\n if ($ilAccess->checkAccess(\"write\", \"\", $this->object->getRefId())){\n $ilTabs->addTab(\"showResults\", $this->txt(\"tabmenu_show_result\"), $ilCtrl->getLinkTarget($this, \"showResults\"));\n }\n\n // a \"properties\" tab\n if ($ilAccess->checkAccess(\"write\", \"\", $this->object->getRefId())){\n $ilTabs->addTab(\"properties\", $this->txt(\"tabmenu_properties\"), $ilCtrl->getLinkTarget($this, \"editProperties\"));\n $this->addPermissionTab();\n }\n\n // information Tab\n if ($ilAccess->checkAccess(\"write\", \"\", $this->object->getRefId())){\n $ilTabs->addTab(\"info\", $this->txt(\"tabmenu_info\"), $ilCtrl->getLinkTarget($this, \"info\"));\n }\n\n }", "public function create()\n {\n \n return view('admin.history.create');\n }", "public function getHistory()\r\r\n {\r\r\n return $this->history;\r\r\n }", "function simple_history_print_history($args = null) {\n\t\n\tglobal $simple_history;\n\t\n\t$arr_events = simple_history_get_items_array($args);\n\t#sf_d($arr_events);\n\t#sf_d($args);sf_d($arr_events);\n\t$defaults = array(\n\t\t\"page\" => 0,\n\t\t\"items\" => $simple_history->get_pager_size(),\n\t\t\"filter_type\" => \"\",\n\t\t\"filter_user\" => \"\",\n\t\t\"is_ajax\" => false\n\t);\n\n\t$args = wp_parse_args( $args, $defaults );\n\t$output = \"\";\n\tif ($arr_events) {\n\t\tif (!$args[\"is_ajax\"]) {\n\t\t\t// if not ajax, print the div\n\t\t\t$output .= \"<div class='simple-history-ol-wrapper'><ol class='simple-history'>\";\n\t\t}\n\t\n\t\t$loopNum = 0;\n\t\t$real_loop_num = -1;\n\t\tforeach ($arr_events as $one_row) {\n\t\t\t\n\t\t\t$real_loop_num++;\n\n\t\t\t$object_type = $one_row->object_type;\n\t\t\t$object_type_lcase = strtolower($object_type);\n\t\t\t$object_subtype = $one_row->object_subtype;\n\t\t\t$object_id = $one_row->object_id;\n\t\t\t$object_name = $one_row->object_name;\n\t\t\t$user_id = $one_row->user_id;\n\t\t\t$action = $one_row->action;\n\t\t\t$action_description = $one_row->action_description;\n\t\t\t$occasions = $one_row->occasions;\n\t\t\t$num_occasions = sizeof($occasions);\n\t\t\t$object_image_out = \"\";\n\n\t\t\t$css = \"\";\n\t\t\tif (\"attachment\" == $object_type_lcase) {\n\t\t\t\tif (wp_get_attachment_image_src($object_id, array(50,50), true)) {\n\t\t\t\t\t// yep, it's an attachment and it has an icon/thumbnail\n\t\t\t\t\t$css .= ' simple-history-has-attachment-thumnbail ';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (\"user\" == $object_type_lcase) {\n\t\t\t\t$css .= ' simple-history-has-attachment-thumnbail ';\n\t\t\t}\n\n\t\t\tif ($num_occasions > 0) {\n\t\t\t\t$css .= ' simple-history-has-occasions ';\n\t\t\t}\n\t\t\t\n\t\t\t$output .= \"<li class='$css'>\";\n\n\t\t\t$output .= \"<div class='first'>\";\n\t\t\t\n\t\t\t// who performed the action\n\t\t\t$who = \"\";\n\t\t\t$user = get_user_by(\"id\", $user_id); // false if user does not exist\n\n\t\t\tif ($user) {\n\t\t\t\t$user_avatar = get_avatar($user->user_email, \"32\"); \n\t\t\t\t$user_link = \"user-edit.php?user_id={$user->ID}\";\n\t\t\t\t$who_avatar = sprintf('<a class=\"simple-history-who-avatar\" href=\"%2$s\">%1$s</a>', $user_avatar, $user_link);\n\t\t\t} else {\n\t\t\t\t$user_avatar = get_avatar(\"\", \"32\"); \n\t\t\t\t$who_avatar = sprintf('<span class=\"simple-history-who-avatar\">%1$s</span>', $user_avatar);\n\t\t\t}\n\t\t\t$output .= $who_avatar;\n\t\t\t\n\t\t\t// section with info about the user who did something\n\t\t\t$who .= \"<span class='who'>\";\n\t\t\tif ($user) {\n\t\t\t\t$who .= sprintf('<a href=\"%2$s\">%1$s</a>', $user->user_nicename, $user_link);\n\t\t\t\tif (isset($user->first_name) || isset($user->last_name)) {\n\t\t\t\t\tif ($user->first_name || $user->last_name) {\n\t\t\t\t\t\t$who .= \" (\";\n\t\t\t\t\t\tif ($user->first_name && $user->last_name) {\n\t\t\t\t\t\t\t$who .= esc_html($user->first_name) . \" \" . esc_html($user->last_name);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$who .= esc_html($user->first_name) . esc_html($user->last_name); // just one of them, no space necessary\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$who .= \")\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$who .= \"&lt;\" . __(\"Unknown or deleted user\", 'simple-history') .\"&gt;\";\n\t\t\t}\n\t\t\t$who .= \"</span>\";\n\n\t\t\t// what and object\n\t\t\tif (\"post\" == $object_type_lcase) {\n\t\t\t\t\n\t\t\t\t$post_out = \"\";\n\t\t\t\t\n\t\t\t\t// Get real name for post type (not just the slug for custom post types)\n\t\t\t\t$post_type_object = get_post_type_object( $object_subtype );\n\t\t\t\tif ( is_null($post_type_object) ) {\n\t\t\t\t\t$post_out .= esc_html__( ucfirst( $object_subtype ) );\n\t\t\t\t} else {\n\t\t\t\t\t$post_out .= esc_html__( ucfirst( $post_type_object->labels->singular_name ) );\n\t\t\t\t}\n\n\t\t\t\t$post = get_post($object_id);\n\n\t\t\t\tif (null == $post) {\n\t\t\t\t\t// post does not exist, probably deleted\n\t\t\t\t\t// check if object_name exists\n\t\t\t\t\tif ($object_name) {\n\t\t\t\t\t\t$post_out .= \" <span class='simple-history-title'>\\\"\" . esc_html($object_name) . \"\\\"</span>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post_out .= \" <span class='simple-history-title'>&lt;unknown name&gt;</span>\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t#$title = esc_html($post->post_title);\n\t\t\t\t\t$title = get_the_title($post->ID);\n\t\t\t\t\t$title = esc_html($title);\n\t\t\t\t\t$edit_link = get_edit_post_link($object_id, 'display');\n\t\t\t\t\t$post_out .= \" <a href='$edit_link'>\";\n\t\t\t\t\t$post_out .= \"<span class='simple-history-title'>{$title}</span>\";\n\t\t\t\t\t$post_out .= \"</a>\";\n\t\t\t\t}\n\n\t\t\t\t$post_out .= \" \" . esc_html__($action, \"simple-history\");\n\t\t\t\t\n\t\t\t\t$post_out = ucfirst($post_out);\n\t\t\t\t$output .= $post_out;\n\n\t\t\t\t\n\t\t\t} elseif (\"attachment\" == $object_type_lcase) {\n\t\t\t\n\t\t\t\t$attachment_out = \"\";\n\t\t\t\t$attachment_out .= __(\"attachment\", 'simple-history') . \" \";\n\n\t\t\t\t$post = get_post($object_id);\n\t\t\t\t\n\t\t\t\tif ($post) {\n\n\t\t\t\t\t// Post for attachment was found\n\n\t\t\t\t\t$title = esc_html(get_the_title($post->ID));\n\t\t\t\t\t$edit_link = get_edit_post_link($object_id, 'display');\n\t\t\t\t\t$attachment_metadata = wp_get_attachment_metadata( $object_id );\n\t\t\t\t\t$attachment_file = get_attached_file( $object_id );\n\t\t\t\t\t$attachment_mime = get_post_mime_type( $object_id );\n\t\t\t\t\t$attachment_url = wp_get_attachment_url( $object_id );\n\n // Check that file exists. It may not due to local dev vs remove dev etc.\n $file_exists = file_exists($attachment_file);\n\n\t\t\t\t\t// Get attachment thumbnail. 60 x 60 is the same size as the media overview uses\n\t\t\t\t\t// Is thumbnail of object if image, is wp icon if not\n\t\t\t\t\t$attachment_image_src = wp_get_attachment_image_src($object_id, array(60, 60), true);\t\t\t\t\t\n if ($attachment_image_src && $file_exists) {\n\t\t\t\t\t\t$object_image_out .= \"<a class='simple-history-attachment-thumbnail' href='$edit_link'><img src='{$attachment_image_src[0]}' alt='Attachment icon' width='{$attachment_image_src[1]}' height='{$attachment_image_src[2]}' /></a>\";\n } else {\n $object_image_out .= \"<a class='simple-history-attachment-thumbnail' href='$edit_link'></a>\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Begin adding nice to have meta info about to attachment (name, size, mime, etc.)\t\t\t\t\t\n\t\t\t\t\t$object_image_out .= \"<div class='simple-history-attachment-meta'>\";\n\n\t\t\t\t\t// File name\n\n\t\t\t\t\t// Get size in human readable format. Code snippet from media.php\n\t\t\t\t\t$sizes = array( 'KB', 'MB', 'GB' );\n\n $attachment_filesize = \"\";\n if ( $file_exists ) {\n $attachment_filesize = filesize( $attachment_file );\n for ( $u = -1; $attachment_filesize > 1024 && $u < count( $sizes ) - 1; $u++ ) {\n $attachment_filesize /= 1024;\n }\n }\n\n if (empty($attachment_filesize)) {\n $str_attachment_size = \"<p>\" . __(\"File size: Unknown \", \"simple-history\") . \"</p>\";\n } else {\n $size_unit = ($u == -1) ? __(\"bytes\", \"simple-history\") : $sizes[$u];\n $str_attachment_size = sprintf('<p>%1$s %2$s %3$s</p>', __(\"File size:\", \"simple-history\"), round( $attachment_filesize, 0 ), $size_unit );\n\t\t\t\t\t}\n\n\t\t\t\t\t// File type\n\t\t\t\t\t$file_type_out = \"\";\n\t\t\t\t\tif ( preg_match( '/^.*?\\.(\\w+)$/', $attachment_file, $matches ) )\n\t\t\t\t\t\t$file_type_out .= esc_html( strtoupper( $matches[1] ) );\n\t\t\t\t\telse\n\t\t\t\t\t\t$file_type_out .= strtoupper( str_replace( 'image/', '', $post->post_mime_type ) );\n\t\t\t\n\t\t\t\t\t// Media size, width x height\n\t\t\t\t\t$media_dims = \"\";\n\t\t\t\t\tif ( ! empty( $attachment_metadata['width'] ) && ! empty( $attachment_metadata['height'] ) ) {\n\t\t\t\t\t\t$media_dims .= \"<span>{$attachment_metadata['width']}&nbsp;&times;&nbsp;{$attachment_metadata['height']}</span>\";\n\t\t\t\t\t}\n\n\t\t\t\t\t// Generate string with metainfo\n $object_image_out .= $str_attachment_size;\n $object_image_out .= sprintf('<p>%1$s %2$s</p>', __(\"File type:\"), $file_type_out );\n\t\t\t\t\tif ( ! empty( $media_dims ) ) $object_image_out .= sprintf('<p>%1$s %2$s</p>', __(\"Dimensions:\"), $media_dims );\t\t\t\t\t\n\t\t\t\t\tif ( ! empty( $attachment_metadata[\"length_formatted\"] ) ) $object_image_out .= sprintf('<p>%1$s %2$s</p>', __(\"Length:\"), $attachment_metadata[\"length_formatted\"] );\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// end attachment meta info box output\n\t\t\t\t\t$object_image_out .= \"</div>\"; // close simple-history-attachment-meta\n\n\t\t\t\t\t$attachment_out .= \" <a href='$edit_link'>\";\n\t\t\t\t\t$attachment_out .= \"<span class='simple-history-title'>{$title}</span>\";\n\t\t\t\t\t$attachment_out .= \"</a>\";\n\t\t\t\t\t\n\t\t\t\t} else {\n\n\t\t\t\t\t// Post for attachment was not found\n\t\t\t\t\tif ($object_name) {\n\t\t\t\t\t\t$attachment_out .= \"<span class='simple-history-title'>\\\"\" . esc_html($object_name) . \"\\\"</span>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$attachment_out .= \" <span class='simple-history-title'>&lt;deleted&gt;</span>\";\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t$attachment_out .= \" \" . esc_html__($action, \"simple-history\") . \" \";\n\t\t\t\t\n\t\t\t\t$attachment_out = ucfirst($attachment_out);\n\t\t\t\t$output .= $attachment_out;\n\n\t\t\t} elseif (\"user\" == $object_type_lcase) {\n\n\t\t\t\t$user_out = \"\";\n\t\t\t\t$user_out .= __(\"user\", 'simple-history');\n\t\t\t\t$user = get_user_by(\"id\", $object_id);\n\t\t\t\tif ($user) {\n\t\t\t\t\t$user_link = \"user-edit.php?user_id={$user->ID}\";\n\t\t\t\t\t$user_out .= \"<span class='simple-history-title'>\";\n\t\t\t\t\t$user_out .= \" <a href='$user_link'>\";\n\t\t\t\t\t$user_out .= $user->user_nicename;\n\t\t\t\t\t$user_out .= \"</a>\";\n\t\t\t\t\tif (isset($user->first_name) && isset($user->last_name)) {\n\t\t\t\t\t\tif ($user->first_name || $user->last_name) {\n\t\t\t\t\t\t\t$user_out .= \" (\";\n\t\t\t\t\t\t\tif ($user->first_name && $user->last_name) {\n\t\t\t\t\t\t\t\t$user_out .= esc_html($user->first_name) . \" \" . esc_html($user->last_name);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$user_out .= esc_html($user->first_name) . esc_html($user->last_name); // just one of them, no space necessary\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$user_out .= \")\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$user_out .= \"</span>\";\n\t\t\t\t} else {\n\t\t\t\t\t// most likely deleted user\n\t\t\t\t\t$user_link = \"\";\n\t\t\t\t\t$user_out .= \" \\\"\" . esc_html($object_name) . \"\\\"\";\n\t\t\t\t}\n\n\t\t\t\t$user_out .= \" \" . esc_html__($action, \"simple-history\");\n\t\t\t\t\n\t\t\t\t$user_out = ucfirst($user_out);\n\t\t\t\t$output .= $user_out;\n\n\t\t\t} elseif (\"comment\" == $object_type_lcase) {\n\t\t\t\t\n\t\t\t\t$comment_link = get_edit_comment_link($object_id);\n\t\t\t\t$output .= ucwords(esc_html__(ucfirst($object_type))) . \" \" . esc_html($object_subtype) . \" <a href='$comment_link'><span class='simple-history-title'>\" . esc_html($object_name) . \"\\\"</span></a> \" . esc_html__($action, \"simple-history\");\n\n\t\t\t} else {\n\n\t\t\t\t// unknown/general type\n\t\t\t\t// translate the common types\n\t\t\t\t$unknown_action = $action;\n\t\t\t\tswitch ($unknown_action) {\n\t\t\t\t\tcase \"activated\":\n\t\t\t\t\t\t$unknown_action = __(\"activated\", 'simple-history');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"deactivated\":\n\t\t\t\t\t\t$unknown_action = __(\"deactivated\", 'simple-history');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"enabled\":\n\t\t\t\t\t\t$unknown_action = __(\"enabled\", 'simple-history');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"disabled\":\n\t\t\t\t\t\t$unknown_action = __(\"disabled\", 'simple-history');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$unknown_action = $unknown_action; // dah!\n\t\t\t\t}\n\t\t\t\t$output .= ucwords(esc_html__($object_type, \"simple-history\")) . \" \" . ucwords(esc_html__($object_subtype, \"simple-history\")) . \" <span class='simple-history-title'>\\\"\" . esc_html($object_name) . \"\\\"</span> \" . esc_html($unknown_action);\n\n\t\t\t}\n\t\t\t$output .= \"</div>\";\n\t\t\t\n\t\t\t// second div = when and who\n\t\t\t$output .= \"<div class='second'>\";\n\t\t\t\n\t\t\t$date_i18n_date = date_i18n(get_option('date_format'), strtotime($one_row->date), $gmt=false);\n\t\t\t$date_i18n_time = date_i18n(get_option('time_format'), strtotime($one_row->date), $gmt=false);\t\t\n\t\t\t$now = strtotime(current_time(\"mysql\"));\n\t\t\t$diff_str = sprintf( __('<span class=\"when\">%1$s ago</span> by %2$s', \"simple-history\"), human_time_diff(strtotime($one_row->date), $now), $who );\n\t\t\t$output .= $diff_str;\n\t\t\t$output .= \"<span class='when_detail'>\".sprintf(__('%s at %s', 'simple-history'), $date_i18n_date, $date_i18n_time).\"</span>\";\n\n\t\t\t// action description\n\t\t\tif ( trim( $action_description ) ) {\n\t\t\t\t$output .= sprintf(\n\t\t\t\t\t'\n\t\t\t\t\t<a href=\"#\" class=\"simple-history-item-description-toggler\">%2$s</a>\n\t\t\t\t\t<div class=\"simple-history-item-description-wrap\">\n\t\t\t\t\t\t<div class=\"simple-history-action-description\">%1$s</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t',\n\t\t\t\t\tnl2br( esc_attr( $action_description ) ), // 2\n\t\t\t\t\t__(\"Details\", \"simple-history\") // 2\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\t$output .= \"</div>\";\n\n\t\t\t// Object image\n\t\t\tif ( $object_image_out ) {\n\n\t\t\t\t$output .= sprintf(\n\t\t\t\t\t'\n\t\t\t\t\t<div class=\"simple-history-object-image\">\n\t\t\t\t\t\t%1$s\n\t\t\t\t\t</div>\n\t\t\t\t\t',\n\t\t\t\t\t$object_image_out\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t\t// occasions\n\t\t\tif ($num_occasions > 0) {\n\t\t\t\t$output .= \"<div class='third'>\";\n\t\t\t\tif ($num_occasions == 1) {\n\t\t\t\t\t$one_occasion = __(\"+ 1 occasion\", 'simple-history');\n\t\t\t\t\t$output .= \"<a class='simple-history-occasion-show' href='#'>$one_occasion</a>\";\n\t\t\t\t} else {\n\t\t\t\t\t$many_occasion = sprintf(__(\"+ %d occasions\", 'simple-history'), $num_occasions);\n\t\t\t\t\t$output .= \"<a class='simple-history-occasion-show' href='#'>$many_occasion</a>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$output .= \"<ul class='simple-history-occasions hidden'>\";\n\t\t\t\tforeach ($occasions as $one_occasion) {\n\t\t\t\t\n\t\t\t\t\t$output .= \"<li>\";\n\t\t\t\t\n\t\t\t\t\t$date_i18n_date = date_i18n(get_option('date_format'), strtotime($one_occasion->date), $gmt=false);\n\t\t\t\t\t$date_i18n_time = date_i18n(get_option('time_format'), strtotime($one_occasion->date), $gmt=false);\t\t\n\t\t\t\t\n\t\t\t\t\t$output .= \"<div class='simple-history-occasions-one-when'>\";\n\t\t\t\t\t$output .= sprintf(\n\t\t\t\t\t\t\t__('%s ago (%s at %s)', \"simple-history\"), \n\t\t\t\t\t\t\thuman_time_diff(strtotime($one_occasion->date), $now), \n\t\t\t\t\t\t\t$date_i18n_date, \n\t\t\t\t\t\t\t$date_i18n_time\n\t\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\tif ( trim( $one_occasion->action_description ) ) {\n\t\t\t\t\t\t$output .= \"<a href='#' class='simple-history-occasions-details-toggle'>\" . __(\"Details\", \"simple-history\") . \"</a>\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$output .= \"</div>\";\n\n\t\t\t\t\tif ( trim( $one_occasion->action_description ) ) {\n\t\t\t\t\t\t$output .= sprintf(\n\t\t\t\t\t\t\t'<div class=\"simple-history-occasions-one-action-description\">%1$s</div>',\n\t\t\t\t\t\t\tnl2br( esc_attr( $one_occasion->action_description ) )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$output .= \"</li>\";\n\t\t\t\t}\n\n\t\t\t\t$output .= \"</ul>\";\n\n\t\t\t\t$output .= \"</div>\";\n\t\t\t}\n\n\t\t\t$output .= \"</li>\";\n\n\t\t\t$loopNum++;\n\n\t\t}\n\t\t\n\t\t// if $loopNum == 0 no items where found for this page\n\t\tif ($loopNum == 0) {\n\t\t\t$output .= \"noMoreItems\";\n\t\t}\n\t\t\n\t\tif ( ! $args[\"is_ajax\"] ) {\n\n\t\t\t// if not ajax, print the divs and stuff we need\n\t\t\t$show_more = \"<select>\";\n\t\t\t$show_more .= sprintf('<option value=5 %2$s>%1$s</option>', __(\"Show 5 more\", 'simple-history'), ($args[\"items\"] == 5 ? \" selected \" : \"\") );\n\t\t\t$show_more .= sprintf('<option value=15 %2$s>%1$s</option>', __(\"Show 15 more\", 'simple-history'), ($args[\"items\"] == 15 ? \" selected \" : \"\") );\n\t\t\t$show_more .= sprintf('<option value=50 %2$s>%1$s</option>', __(\"Show 50 more\", 'simple-history'), ($args[\"items\"] == 50 ? \" selected \" : \"\") );\n\t\t\t$show_more .= sprintf('<option value=100 %2$s>%1$s</option>', __(\"Show 100 more\", 'simple-history'), ($args[\"items\"] == 100 ? \" selected \" : \"\") );\n\t\t\t$show_more .= \"</select>\";\n\n\t\t\t$no_found = __(\"No matching items found.\", 'simple-history');\n\t\t\t$view_rss = __(\"RSS feed\", 'simple-history');\n\t\t\t$view_rss_link = simple_history_get_rss_address();\n\t\t\t$str_show = __(\"Show\", 'simple-history');\n\t\t\t$output .= \"</ol>\";\n\n\t\t\t$output .= sprintf( '\n\t\t\t\t\t<div class=\"simple-history-loading\">%2$s %1$s</div>\n\t\t\t\t\t', \n\t\t\t\t\t__(\"Loading...\", 'simple-history'), // 1\n\t\t\t\t\t\"<img src='\".site_url(\"wp-admin/images/loading.gif\").\"' width=16 height=16>\"\n\t\t\t\t);\n\n\t\t\t$output .= \"</div>\";\n\n\t\t\t$output .= \"\n\t\t\t\t<p class='simple-history-no-more-items'>$no_found</p>\t\t\t\n\t\t\t\t<p class='simple-history-rss-feed-dashboard'><a title='$view_rss' href='$view_rss_link'>$view_rss</a></p>\n\t\t\t\t<p class='simple-history-rss-feed-page'><a title='$view_rss' href='$view_rss_link'><span></span>$view_rss</a></p>\n\t\t\t\";\n\n\t\t}\n\n\t} else {\n\n\t\tif ($args[\"is_ajax\"]) {\n\t\t\t$output .= \"noMoreItems\";\n\t\t} else {\n\t\t\t$no_found = __(\"No history items found.\", 'simple-history');\n\t\t\t$please_note = __(\"Please note that Simple History only records things that happen after this plugin have been installed.\", 'simple-history');\n\t\t\t$output .= \"<p>$no_found</p>\";\n\t\t\t$output .= \"<p>$please_note</p>\";\n\t\t}\n\n\t}\n\treturn $output;\n}", "public function showBackEnd();", "public function actionHistory($id)\n {\n $searchModel = new ModelHistorySearch;\n\n $queryParams= Yii::$app->request->getQueryParams();\n $queryParams['ModelHistorySearch']['user_id'] = $id;\n $dataProvider = $searchModel->search($queryParams);\n\n return $this->render('model-history', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "private function showPage($records)\n {\n $this->data['histories'] = '';\n $this->data['histories'] = $records;\n\n $this->data['pagebody'] = 'History';\n $this->render();\n }", "public function clearHistory() {}", "protected function updateHistory()\n {\n self::$history[] = time();\n if(30 === count(self::$history))\n {\n if(reset(self::$history) >= (time() - 30))\n {\n sleep(2);\n }\n array_shift(self::$history);\n }\n }", "public function getHistory()\n {\n return $this->history;\n }", "public function history()\n {\n $streams = Auth::user()->streams()\n // Select 1st chunk created_at\n // Select last chunk created_at\n ->with(['firstChunk', 'lastChunk'])\n ->orderBy('id', 'desc')\n ->paginate();\n\n return view('streams_history', ['streams' => $streams]);\n }", "public static function history($request, $response)\n {\n $personal = false;\n if ($request->getUri() == \"/dashboard/history\") {\n $history = Requests::getPersonalHistory($_SESSION[\"username\"]);\n $personal = true;\n } else {\n $history = Requests::getAll();\n }\n return $response->render(\n __DIR__ . '/../Views/Dashboard/history.php',\n array(\n 'history' => $history,\n 'personal' => $personal\n )\n );\n }", "public function getHistory()\n {\n return $this->_history;\n }", "protected function updateHistory() {\n self::$history[] = time();\n\n if ( 30 === count( self::$history ) ) {\n if ( reset( self::$history ) >= (time() - 30) ) {\n sleep( 2 );\n }\n\n array_shift( self::$history );\n }\n }", "public function bookingHistory() {\n return view('history', [\n \"history\" => app('App\\Http\\Controllers\\BookingController')->byUser(Auth::user())\n ]);\n }", "protected function show_contents()\n\t\t{\n\t\t\t//echo(\"<a href='javascript:setTimeout(window.location.href=\\\"\". $_SERVER['PHP_SELF']. \"?\". $this->paramname. \"=\". $this->menuvalue. \"\\\",5000);'>\". $this->menutext. \"</a>\");\n\t\t\techo(\"<a href='javascript:openhelp(\\\"helppage.php?context=\". (isset($_GET['Page']) ? $_GET['Page'] : \"\"). \"\\\")'>\". $this->menutext. \"</a>\");\t\n\t\t\techo(\"<SCRIPT> function openhelp(aurl) { window.open(aurl,'_blank'); } </SCRIPT>\");\n\t\t}", "public function testHistoryPageDisplayed()\n {\n $user = factory(User::class)->make();\n\n $response = $this->actingAs($user)->get('/history');\n $response->assertStatus(200);\n\n $this->assertAuthenticatedAs($user);\n }", "public function index()\n {\n\t\t/*\n\t\tif(!Auth::check()) { \t\n\t\t\treturn redirect()->to('/login');\n\t\t}\n\t\t*/\n return view('history');\n }", "public function action_chat_history() {\n\t\t$this->_template->set('page_title', 'All Messages');\n\t\t$this->_template->set('page_info', 'view and manage chat messages');\n\t\t$messages = ORM::factory('Message')->get_grouped_messages($this->_current_user->id);\n\t\t$this->_template->set('messages', $messages);\n\t\t$this->_set_content('messages');\n\t}", "public function show($id)\n {\n $orders = $this->orderRepository->showHistory($id);\n $totalprice = $this->orderRepository->showHistoryTotal($id);\n return view('pages.history', compact('orders', 'totalprice'));\n }", "public function viewHistory() {\n $historyRows = $this->db->query(\"SELECT * FROM history\");\n if (!$historyRows) die(\"Fatal Error.\");\n\n // Looping through all rows in the histoy table.\n $history = [];\n foreach($historyRows as $historyRow) {\n $regNr = htmlspecialchars($historyRow[\"regNr\"]);\n $ssNr = htmlspecialchars($historyRow[\"ssNr\"]);\n $checkOut = htmlspecialchars($historyRow[\"checkOutTime\"]);\n $checkIn = htmlspecialchars($historyRow[\"checkInTime\"]);\n $days = htmlspecialchars($historyRow[\"days\"]);\n $cost = htmlspecialchars($historyRow[\"cost\"]);\n\n // Setting 0 as default value on days and cost if car not checked in yet.\n if (!$checkIn) {\n $checkIn = \"Checked Out\";\n $days = 0;\n $cost = 0;\n }\n \n $histor = [\"regNr\" => $regNr,\n \"ssNr\" => $ssNr, \n \"checkOut\" => $checkOut,\n \"checkIn\" => $checkIn, \n \"days\" => $days,\n \"cost\" => $cost,\n \"days\" => $days];\n \n $history[] = $histor;\n }\n return $history;\n }", "static private function historyback()\n {\n echo '<script>window.history.back();</script>';\n }", "public function createTabsHistorique()\n {\n $tab = new Tab();\n $tab->active = 1;\n $names = array(1 => 'Historique CA', 'Historique CA');\n foreach (Language::getLanguages() as $language) {\n $tab->name[$language['id_lang']] = isset($names[$language['id_lang']])\n ? $names[$language['id_lang']] : $names[1];\n }\n $tab->class_name = 'AdminHistorique';\n $tab->module = $this->name;\n $tab->id_parent = Tab::getIdFromClassName('AdminParentStats');\n\n return (bool)$tab->add();\n }", "function history()\n {\n $data['tbl_history'] = $this->Tbl_history_model->get_tbl_history();\n \n if(isset($data['tbl_history']['id_history']))\n {\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n 'history_desc_id' => $this->input->post('history_desc_id'),\n 'history_desc_en' => $this->input->post('history_desc_en'),\n );\n\n $this->Tbl_history_model->update_tbl_history($params); \n redirect('admin/history');\n }\n else\n {\n $data = array(\n \"site\" => $_SERVER['SERVER_NAME'],\n \"page\" => \"History\",\n \"tbl_history\" => $this->Tbl_history_model->get_tbl_history()\n );\n $this->load->view('layout/admin/header', $data);\n $this->load->view('edit_history',$data);\n $this->load->view('layout/admin/footer');\n }\n }\n else\n show_error('The tbl_home you are trying to edit does not exist.');\n }", "public function setHistory($var)\n {\n GPBUtil::checkMessage($var, \\Temporal\\Api\\History\\V1\\History::class);\n $this->history = $var;\n\n return $this;\n }", "function simple_history_settings_page() {\n\t// echo \"Please choose options for simple history ...\";\n}", "public function taskHistory(){\n //Changes the current page to TaskHistory\n $_SESSION['current_page'] = 'TaskHistory';\n //No data needs to be loaded but the variable is still requored\n $data = [];\n //Load the view\n $this->view('taskHistory/TaskHistory', $data);\n }", "public function getHistoryTpl(){\n return $this->templates['history'];\n }", "public function action_index()\n{\n $history = Jelly::select( 'user_history' )\n ->where(':primary_key', '=', $this->user->id)\n ->limit( 25 )\n ->execute();\n\n $this->template->content = View::factory('history/index')\n ->set('history', $history);\n\n}", "public function clienthistoryAction()\n {\n // If no client ID was provided, bail out.\n if (!$this->_hasParam('id')) {\n throw new UnexpectedValueException('No client ID parameter provided');\n }\n\n $clientId = $this->_getParam('id');\n\n // Pass current and past client and household history.\n $service = new App_Service_Member();\n\n $this->view->pageTitle = 'View Household History';\n $this->view->client = $service->getClientById($clientId);\n $this->view->householders = $service->getHouseholdersByClientId($clientId);\n $this->view->history = $service->getClientHouseholdHistory($clientId);\n }", "public function rewindHistory();", "function simple_history_print_nav() {\n\n\tglobal $wpdb;\n\t$tableprefix = $wpdb->prefix;\n\t\n\t// fetch all types that are in the log\n\tif (isset($_GET[\"simple_history_type_to_show\"])) {\n\t\t$simple_history_type_to_show = $_GET[\"simple_history_type_to_show\"];\n\t} else {\n\t\t$simple_history_type_to_show = \"\";\n\t}\n\n\t// Get all object types and object subtypes\n\t// order by the number of times they occur\n\t$sql = \"SELECT \n\t\t\t\tcount(object_type) AS object_type_count,\n\t\t\t\tobject_type, object_subtype \n\t\t\tFROM {$tableprefix}simple_history \n\t\t\tGROUP BY object_type, object_subtype\n\t\t\tORDER BY object_type_count DESC, object_type, object_subtype\n\t\t\";\n\t$arr_types = $wpdb->get_results($sql);\n\n\t$css = \"\";\n\tif (empty($simple_history_type_to_show)) {\n\t\t$css = \"class='selected'\";\n\t}\n\n\t// Reload-button\n\t$str_reload_button = sprintf('<a class=\"simple-fields-reload\" title=\"%1$s\" href=\"#\"><span>Reload</span></a>', esc_attr__(\"Reload history\", \"simple-history\"));\n\techo $str_reload_button;\n\n\t// Begin select\n\t$str_types_select = \"\";\n\t$str_types_select .= \"<select name='' class='simple-history-filter simple-history-filter-type'>\";\n\n\t$total_object_num_count = 0;\n\tforeach ( $arr_types as $one_type ) {\n\t\t$total_object_num_count += $one_type->object_type_count;\n\t}\n\n\t// First filter is \"all types\"\n\t$link = esc_html(add_query_arg(\"simple_history_type_to_show\", \"\"));\n\t$str_types_desc = __(\"All types\", 'simple-history');\n\n\t$str_types_select .= sprintf('<option data-simple-history-filter-type=\"\" data-simple-history-filter-subtype=\"\" value=\"%1$s\">%2$s (%3$d)</option>', $link, esc_html($str_types_desc), $total_object_num_count );\n\n\t// Loop through all types\n\t// $one_type->object_type = user | post | attachment | comment | plugin | attachment | post | Reply | Topic | Widget | Wordpress_core\n\t// $one_type->object_subtype = page | nav_menu_item | ...\n\t#sf_d($arr_types);\n\tforeach ($arr_types as $one_type) {\n\n\t\t$css = \"\";\n\t\t$option_selected = \"\";\n\t\tif ($one_type->object_subtype && $simple_history_type_to_show == ($one_type->object_type.\"/\".$one_type->object_subtype)) {\n\t\t\t$css = \"class='selected'\";\n\t\t\t$option_selected = \" selected \";\n\t\t} elseif (!$one_type->object_subtype && $simple_history_type_to_show == $one_type->object_type) {\n\t\t\t$css = \"class='selected'\";\n\t\t\t$option_selected = \" selected \";\n\t\t}\n\n\t\t// Create link to filter this type + subtype\n\t\t$arg = \"\";\n\t\tif ($one_type->object_subtype) {\n\t\t\t$arg = $one_type->object_type.\"/\".$one_type->object_subtype;\n\t\t} else {\n\t\t\t$arg = $one_type->object_type;\n\t\t}\n\t\t$link = esc_html(add_query_arg(\"simple_history_type_to_show\", $arg));\n\n\t\t// Begin option\n\t\t$str_types_select .= sprintf(\n\t\t\t'<option %1$s data-simple-history-filter-type=\"%2$s\" data-simple-history-filter-subtype=\"%3$s\" value=\"%4$s\">',\n\t\t\t$option_selected, // 1\n\t\t\t$one_type->object_type, // 2\n\t\t\t$one_type->object_subtype, // 3\n\t\t\t$link // 4\n\t\t);\n\t\t\n\t\t// Some built in types we translate with built in translation, the others we use simple history for\n\t\t// TODO: use WP-function to get all built in types?\n\t\t$object_type_translated = \"\";\n\t\t$object_subtype_translated = \"\";\n\n\t\t// Get built in post types\n\t\t$arr_built_in_post_types = get_post_types( array(\"_builtin\" => true) );\n\n\t\t$object_type_translated = \"\";\n\t\t$object_subtype_translated = \"\";\n\n\t\t// For built in types\n\t\tif ( in_array( $one_type->object_type, $arr_built_in_post_types ) ) {\n\t\t\t\n\t\t\t// Get name of main type\n\t\t\t$object_post_type_object = get_post_type_object( $one_type->object_type );\n\t\t\t$object_type_translated = $object_post_type_object->labels->name;\n\t\t\t\n\t\t\t// Get name of subtype\n\t\t\t$object_subtype_post_type_object = get_post_type_object( $one_type->object_subtype );\n\t\t\tif ( ! is_null( $object_subtype_post_type_object ) ) {\n\t\t\t\t$object_subtype_translated = $object_subtype_post_type_object->labels->name;;\n\t\t\t}\n\n\t\t}\n\t\t\n\t\tif ( empty( $object_type_translated ) ) {\n\t\t\t$object_type_translated = ucfirst( esc_html__( $one_type->object_type, \"simple-history\") );\n\t\t}\n\n\t\tif ( empty( $object_subtype_translated ) ) {\n\t\t\t$object_subtype_translated = ucfirst( esc_html__( $one_type->object_subtype, \"simple-history\") );\n\t\t}\n\t\t\n\t\t// Add name of type (post / attachment / user / etc.)\n\t\t\n\t\t// built in types use only subtype\n\t\tif ( in_array( $one_type->object_type, $arr_built_in_post_types ) && ! empty($object_subtype_translated) ) {\n\n\t\t\t$str_types_select .= $object_subtype_translated;\n\n\t\t} else {\n\t\t\t\n\t\t\t$str_types_select .= $object_type_translated;\n\n\t\t\t// And subtype, if different from main type\n\t\t\tif ($object_subtype_translated && $object_subtype_translated != $object_type_translated) {\n\t\t\t\t$str_types_select .= \"/\" . $object_subtype_translated;\n\t\t\t}\n\n\t\t}\n\t\t// Add object count\n\t\t$str_types_select .= sprintf(' (%d)', $one_type->object_type_count);\n\t\t\n\t\t// Close option\n\t\t$str_types_select .= \"\\n</option>\";\n\t\t\n\t\t// debug\n\t\t#$str_types .= \" type: \" . $one_type->object_type;\n\t\t#$str_types .= \" type: \" . ucfirst($one_type->object_type);\n\t\t#$str_types .= \" subtype: \" . $one_type->object_subtype. \" \";\n\t\t\n\t} // foreach arr types\n\n\t$str_types_select .= \"\\n</select>\";\n\n\t// Output filters\n\tif ( ! empty( $arr_types ) ) {\n\t\t// echo $str_types;\n\t\techo $str_types_select;\n\t}\n\n\t// fetch all users that are in the log\n\t$sql = \"SELECT DISTINCT user_id FROM {$tableprefix}simple_history WHERE user_id <> 0\";\n\t$arr_users_regular = $wpdb->get_results($sql);\n\tforeach ($arr_users_regular as $one_user) {\n\t\t$arr_users[$one_user->user_id] = array(\"user_id\" => $one_user->user_id);\n\t}\n\t\n\tif ( ! empty( $arr_users ) ) {\n\t\n\t\tforeach ($arr_users as $user_id => $one_user) {\n\t\t\t$user = get_user_by(\"id\", $user_id);\n\t\t\tif ($user) {\n\t\t\t\t$arr_users[$user_id][\"user_login\"] = $user->user_login;\n\t\t\t\t$arr_users[$user_id][\"user_nicename\"] = $user->user_nicename;\n\t\t\t\tif (isset($user->first_name)) {\n\t\t\t\t\t$arr_users[$user_id][\"first_name\"] = $user->first_name;\n\t\t\t\t}\n\t\t\t\tif (isset($user->last_name)) {\n\t\t\t\t\t$arr_users[$user_id][\"last_name\"] = $user->last_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif (isset($arr_users) && $arr_users) {\n\n\t\tif (isset($_GET[\"simple_history_user_to_show\"])) {\n\t\t\t$simple_history_user_to_show = $_GET[\"simple_history_user_to_show\"];\n\t\t} else {\n\t\t\t$simple_history_user_to_show = \"\";\n\t\t}\n\n\t\t$str_users_select = \"\";\n\t\t$str_users_select .= \"<select name='' class='simple-history-filter simple-history-filter-user'>\";\n\n\t\t$css = \"\";\n\t\t$option_selected = \"\";\n\t\tif (empty($simple_history_user_to_show)) {\n\t\t\t$css = \" class='selected' \";\n\t\t\t$option_selected = \" selected \";\n\t\t}\n\n\t\t// All users\n\t\t$link = esc_html(add_query_arg(\"simple_history_user_to_show\", \"\"));\n\n\t\t$str_users_select .= sprintf(\n\t\t\t\t'<option data-simple-history-filter-user-id=\"%4$s\" value=\"%3$s\" %2$s>%1s</option>', \n\t\t\t\t__(\"By all users\", 'simple-history'), // 1\n\t\t\t\t$option_selected, // 2\n\t\t\t\t$link, // 3\n\t\t\t\t\"\" // 4\n\t\t\t);\n\n\t\tforeach ($arr_users as $user_id => $user_info) {\n\n\t\t\t$user = new WP_User($user_id);\n\t\t\tif ( ! $user->exists() ) continue;\n\n\t\t\t$link = esc_html(add_query_arg(\"simple_history_user_to_show\", $user_id));\n\t\t\t\n\t\t\t$css = \"\";\n\t\t\t$option_selected = \"\";\n\n\t\t\tif ($user_id == $simple_history_user_to_show) {\n\t\t\t\t$css = \" class='selected' \";\n\t\t\t\t$option_selected = \" selected \";\n\t\t\t}\n\n\t\t\t// all users must have username and email\n\t\t\t$str_user_name = sprintf('%1$s (%2$s)', esc_attr($user->user_login), esc_attr($user->user_email));\n\t\t\t// if ( ! empty( $user_info[\"first_name\"] ) $user_info[\"last_name\"] );\n\t\t\t\n\t\t\t$str_users_select .= sprintf(\n\t\t\t\t'<option data-simple-history-filter-user-id=\"%4$s\" %2$s value=\"%1$s\">%1$s</option>',\n\t\t\t\t$str_user_name, // 1\n\t\t\t\t$option_selected, // 2\n\t\t\t\t$link, // 3\n\t\t\t\t$user_id\n\t\t\t);\n\n\t\t}\n\n\t\t$str_users_select .= \"</select>\";\n\n\t\tif ( ! empty($str_users_select) ) {\n\t\t\techo $str_users_select;\n\t\t}\n\n\t}\n\t\n\t// search\n\t$str_search = __(\"Search\", 'simple-history');\n\t$search = \"<p class='simple-history-filter simple-history-filter-search'>\n\t\t<input type='text' />\n\t\t<input type='button' value='$str_search' class='button' />\n\t</p>\";\n\techo $search;\n\t\n}", "public function actionIndex()\n {\n return $this->redirect('history');\n //return $this->render('index');\n }", "function display_tablenav( $which ) {\n $mode = isset($_REQUEST['mode']) ? wpla_clean($_REQUEST['mode']) : 'list';\n ?>\n <div class=\"tablenav <?php echo esc_attr( $which ); ?>\">\n <div class=\"alignleft actions\">\n <?php $this->bulk_actions(); ?>\n </div>\n <?php\n $this->extra_tablenav( $which );\n $this->pagination( $which );\n $this->view_switcher( $mode );\n ?>\n <br class=\"clear\" />\n </div>\n <?php\n }", "public function show();", "public function show();", "public function show();", "public function show();", "function wfCometDemoSkinTemplateNavigation( SkinTemplate &$skt, array &$links ) {\n\t$links['actions']['view-debug-log'] = array(\n\t\t'class' => 'cometdemo-tab',\n\t\t'text' => wfMessage( 'cometdemo-tab-name' )->escaped(),\n\t\t'href' => '#'\n\t);\n\treturn true;\n}", "public function officerHistoryView(){\n $this->view('auditor/officerHistoryView');\n \n $this->view->render(); // This is how load the view\n }", "public function show_navigation() {\n\n echo '<h1>' . esc_html( get_admin_page_title() ) . '</h1>';\n echo '<h2 class=\"nav-tab-wrapper\">';\n foreach ( $this->settings_tabs as $tab ) {\n printf( '<a href=\"#%1$s\" class=\"nav-tab\" id=\"%1$s-tab\">%2$s</a>', $tab['id'], $tab['title'] );\n }\n echo '</h2>';\n\n //settings_errors();\n\n }", "public function homeTimeline($options = []);", "public function hasIsHistory()\n {\n return $this->is_history !== null;\n }", "private function screenNavigationTabs($tab)\n {\n $url = 'options-general.php?page=plugin_wordpress.php';\n echo '<p>';\n if (empty($tab)) $tab = 'general';\n echo '<a href=\"' . admin_url($url . '&tab=general') . '\"' . ($tab == 'general' ? ' style=\"font-weight: bold; text-decoration:none;\"' : '') . '>' . 'General Settings' . '</a> | ';\n echo '<a href=\"' . admin_url($url . '&tab=set_schedule') . '\"' . ($tab == 'set_schedule' ? ' style=\"font-weight: bold; text-decoration:none;\"' : '') . '>' . 'Set Schedule' . '</a> | ';\n echo '<a href=\"' . admin_url($url . '&tab=save_database') . '\"' . ($tab == 'save_database' ? ' style=\"font-weight: bold; text-decoration:none;\"' : '') . '>' . 'Save Database' . '</a> | ';\n echo '</p><hr/>';\n }", "public function actionIndex()\n {\n $this->can('viewTabs');\n $searchModel = new TabsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function show(UserDeviceHistory $history)\n {\n return view('history.show', compact('history'));\n }", "public function getHistoryAdmin() {\r\n if (Session::has('adminSession')) {\r\n $objadmin = Session::get('adminSession');\r\n //var_dump($objadmin);\r\n $id = $objadmin[0]->id;\r\n //echo $id;\r\n $tblAdminModel = new tblAdminModel();\r\n $data = $tblAdminModel->selectHistoryAdmin($id, 5);\r\n //echo $data[0]->historyContent;\r\n //var_dump($data);\r\n $link = $data->links();\r\n return View::make('backend.admin.adminHistory')->with('arrHistory', $data)->with('link', $link);\r\n } else {\r\n return View::make('fontend.404')->with('thongbao', 'Ko co lich su');\r\n }\r\n }", "public function userHistory() {\n\t\t[ $response, $error ] = $this->api('user/history');\n\n\t\tif($error) return $this->response($response, $error);\n\n\t\treturn $this->response($response['links']);\n\t}", "public function get_help_tabs()\n {\n }", "public function personHistoryView(){\n $this->view('auditor/personHistoryView');\n \n $this->view->render(); // This is how load the view\n }", "public function smsHistory()\n {\n return view('client.sms-history');\n }", "public function getHistory() {\n $rentalModel = new RentalModel($this->db);\n\n try {\n $rentals = $rentalModel->getAll();\n } catch (\\Exception $e) {\n $properties = ['errorMessage' => 'Error getting rental history.'];\n return $this->render('error.twig', $properties);\n }\n\n $properties = [\"rentals\" => $rentals];\n return $this->render('history.twig', $properties);\n }", "protected function display_tablenav($which)\n {\n }", "protected function display_tablenav($which)\n {\n }", "public function populateHistory()\n {\n $resultHistory = DB::select('select * from calculations order by created_at desc limit 10');\n return view('calculator', ['resultHistory' => $resultHistory]);\n }", "public function actionHistory()\n {\n /*$auditdata = AuditTrailSearch::find()\n ->select(['entry_id', 'model_id', 'user_id', 'created', 'old_value'])\n ->where([\n 'action' => 'DELETE',\n 'model' => 'backend\\models\\Event',\n ])\n ->andFilterWhere(['>', 'old_value', \"''\"])\n ->orderBy(['model_id' => SORT_DESC])\n ->all();*/\n// $historyData = \\yii\\helpers\\ArrayHelper::map($auditdata, 'model_id', 'old_value');\n// \\yii\\helpers\\VarDumper::dump($historyData);\n\n $searchModel = new AuditTrailSearch;\n $searchFilter = [\n 'AuditTrailSearch' => [\n 'action' => 'DELETE',\n 'model' => 'backend\\models\\Event'\n ]\n ];\n $dataProvider = $searchModel->search(\\yii\\helpers\\ArrayHelper::merge(Yii::$app->request->get(), $searchFilter));\n //var_dump(Yii::$app->request->get());\n //\\yii\\helpers\\VarDumper::dump($searchModel);\n $message = \"<ol>恢复操作指引<li><删除内容>中输入内容筛选</li><li>点击复选框选中需要恢复的记录</li><li>点击<恢复记录>按钮</li></ol>\";\n Yii::$app->session->setFlash('info', $message);\n return $this->render('history', [\n 'dataProvider' => $dataProvider,\n 'searchModel' => $searchModel,\n ]);\n }", "public function index()\n {\n //\n $trackers = ProductTracker::where('user_id', auth()->user()->id)->get();\n\n return view('history', compact('trackers'));\n }", "public function add_help_tab() {\n\t\t$screen = get_current_screen();\n\t\t$screen->add_help_tab( array(\n\t\t\t\t'id' => 'support',\n\t\t\t\t'title' => 'Support',\n\t\t\t\t'content' => '',\n\t\t\t\t'callback' => array( $this, 'display' ),\n\t\t\t)\n\t\t);\n\t}", "function showTabs($tabgroup, $currenttabid, $recordid = 0){\r\n\r\n\t\t$querystatement = \"\r\n SELECT\r\n `uuid`,\r\n `name`,\r\n `location`,\r\n `enableonnew`,\r\n `notificationsql`,\r\n `tooltip`,\r\n `roleid`\r\n FROM\r\n `tabs`\r\n WHERE\r\n `tabgroup` ='\".$tabgroup.\"'\r\n ORDER BY\r\n `displayorder`\";\r\n\r\n\t\t$queryresult = $this->db->query($querystatement);\r\n\r\n\t\t?><ul class=\"tabs\"><?php\r\n\r\n while($therecord=$this->db->fetchArray($queryresult)){\r\n\r\n\t\t\t\tif(hasRights($therecord[\"roleid\"])){\r\n\r\n\t\t\t\t\t?><li <?php if($therecord[\"uuid\"]==$currenttabid) echo \"class=\\\"tabsSel\\\"\" ?>><?php\r\n\r\n \t\tif($therecord[\"uuid\"]==$currenttabid || ($recordid==0 && $therecord[\"enableonnew\"]==0)){\r\n\r\n\t\t\t\t\t\t\t$opener=\"<div>\";\r\n\t\t\t\t\t\t\t$closer=\"</div>\";\r\n\r\n } else {\r\n\r\n\t\t\t\t\t\t\t$opener=\"<a href=\\\"\".APP_PATH.$therecord[\"location\"].\"?id=\".urlencode($recordid).\"\\\">\";\r\n\t\t\t\t\t\t\t$closer=\"</a>\";\r\n\r\n }//endif\r\n\r\n\t\t\t\t\t\tif($therecord[\"notificationsql\"]!=\"\"){\r\n\r\n\t\t\t\t\t\t\t$therecord[\"notificationsql\"]=str_replace(\"{{id}}\",((int) $recordid),$therecord[\"notificationsql\"]);\r\n\r\n $notificationresult=$this->db->query($therecord[\"notificationsql\"]);\r\n\r\n\t\t\t\t\t\t\tif($this->db->numRows($notificationresult)!=0){\r\n\r\n\t\t\t\t\t\t\t\t$notificationrecord=$this->db->fetchArray($notificationresult);\r\n\r\n if(isset($notificationrecord[\"theresult\"]))\r\n\t\t\t\t\t\t\t\t\tif($notificationrecord[\"theresult\"]>0){\r\n\r\n $opener.=\"<span>\";\r\n\t\t\t\t\t\t\t\t\t\t$closer=\"</span>\".$closer;\r\n\r\n\t\t\t\t\t\t\t\t\t}//endif\r\n\r\n\t\t\t\t\t\t\t}//endif\r\n\r\n\t\t\t\t\t\t}//endif\r\n\r\n\t\t\t\t\t\techo $opener.$therecord[\"name\"].$closer;\r\n\r\n\t\t\t\t\t?></li><?php\r\n\t\t\t\t}//endif hasRights\r\n\t\t\t}//end whilt\r\n\t\t?>\r\n\t\t</ul><?php\r\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()\n\t{\n\t\t//\n\t}", "public function help_tab(){\r\n $screen = get_current_screen();\r\n\r\n foreach($this->what_helps as $help_id => $tab) {\r\n $callback_name = $this->generate_callback_name($help_id);\r\n if(method_exists($this, 'help_'.$callback_name.'_callback')) {\r\n $callback = array($this, 'help_'.$callback_name.'_callback');\r\n }\r\n else {\r\n $callback = array($this, 'help_callback');\r\n }\r\n // documentation tab\r\n $screen->add_help_tab( array(\r\n 'id' => 'hw-help-'.$help_id,\r\n 'title' => __( $tab['title'] ),\r\n //'content' => \"<p>sdfsgdgdfghfhfgh</p>\",\r\n 'callback' => $callback\r\n )\r\n );\r\n }\r\n }", "public function clearHistory()\r\r\n {\r\r\n $this->history = array();\r\r\n }", "private function tab_navigation() {\n\t\t\techo '<div class=\"wpseo-local-metabox-menu\">';\n\t\t\techo '<ul role=\"tablist\" class=\"yoast-seo-local-aria-tabs\" aria-label=\"Yoast SEO: Local\">';\n\t\t\tforeach ( $this->tabs as $key => $tab ) {\n\t\t\t\t$active = ( $key === 0 );\n\n\t\t\t\t$link_class = [ 'wpseo-local-meta-section-link' ];\n\t\t\t\tif ( $active ) {\n\t\t\t\t\t$link_class[] = 'yoast-active-tab';\n\t\t\t\t}\n\n\t\t\t\techo '<li role=\"presentation\" ' . ( ( $active ) ? 'class=\"active\"' : '' ) . '>';\n\t\t\t\techo '<a role=\"tab\" href=\"#wpseo-local-tab-' . $tab['id'] . '\" class=\"' . implode( ' ', $link_class ) . '\" id=\"wpseo-local-tab-' . $tab['id'] . '-content\">';\n\t\t\t\techo '<span class=\"dashicons dashicons-' . $tab['icon'] . '\"></span>';\n\t\t\t\techo $tab['title'];\n\t\t\t\techo '</a>';\n\t\t\t\techo '</li>';\n\t\t\t}\n\t\t\techo '</ul>';\n\t\t\techo '</div> <!-- .wpseo-metabox-menu -->';\n\t\t}" ]
[ "0.75377375", "0.73215026", "0.71723706", "0.7093475", "0.6761947", "0.6722023", "0.6690759", "0.66293854", "0.6624004", "0.6573293", "0.6566487", "0.65208536", "0.6509544", "0.6389931", "0.6382902", "0.6304307", "0.62247413", "0.62198704", "0.61889344", "0.6149144", "0.6134242", "0.6115997", "0.6109363", "0.6087889", "0.60837513", "0.60580885", "0.6052648", "0.6031021", "0.601805", "0.59792787", "0.5974133", "0.5953695", "0.5929919", "0.5910323", "0.590086", "0.58974415", "0.5895956", "0.58700365", "0.5867481", "0.5854758", "0.58545375", "0.5834453", "0.58293784", "0.5823301", "0.5816495", "0.5810609", "0.5797123", "0.5794351", "0.5767385", "0.57635486", "0.5763222", "0.5741413", "0.5719668", "0.57196283", "0.5714158", "0.5713881", "0.57090384", "0.57077396", "0.5680265", "0.56751317", "0.56697226", "0.5661891", "0.5653481", "0.5650286", "0.5645187", "0.56394815", "0.5602325", "0.5601894", "0.5600732", "0.56001526", "0.5577287", "0.5577287", "0.5577287", "0.5577287", "0.55722487", "0.5565503", "0.5547593", "0.5543118", "0.5539592", "0.55351985", "0.5530574", "0.55268407", "0.55103767", "0.54950815", "0.5492778", "0.5490049", "0.54837465", "0.5478975", "0.54592574", "0.5455127", "0.5452767", "0.5445543", "0.5430037", "0.54247624", "0.5422671", "0.5415684", "0.5415684", "0.5415684", "0.5396204", "0.5383917", "0.536435" ]
0.0
-1
Show the history tab for a player with no data
public function userIndex(){ $playerId = Auth::user()->id; return $this->index($playerId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function canShowHistory() {}", "function learn_press_single_quiz_history() {\n\t\tlearn_press_get_template( 'content-quiz/history.php' );\n\t}", "public function history()\n {\n $data['title'] = 'Cuci Sepatu | Kang Cuci';\n $data['user'] = $this->workerModel->datauser();\n\n $this->load->view('worker/worker_header', $data);\n $this->load->view('worker/panel/sepatu', $data);\n $this->load->view('worker/worker_footer');\n }", "public function actionHistory()\n {\n $model= User::findOne(['id' => Yii::$app->user->identity->getId()]);\n $orders = Order::find()->where(['id_user' => $model->id])->with('orderProds')->orderBy('date DESC')->all();\n return $this->render('history', [\n 'model' => $model,\n 'orders' => $orders,\n 'page' => SmapPages::find()->where(['id_class'=>4,'alias' => 'history'])->one()\n ]);\n }", "private static function showHistoryPage(SR_Player $player, $page)\n\t{\n// \t\t$bot = Shadowrap::instance($player);\n\t\t\n\t\tif (false === ($clan = SR_Clan::getByPlayer($player)))\n\t\t{\n\t\t\treturn self::rply($player, '1019');\n// \t\t\t$bot->reply('You don\\'t belong to a clan yet.');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$ipp = 5;\n\t\t$table = GDO::table('SR_ClanHistory');\n\t\t$where = 'sr4ch_cid='.$clan->getID();\n\t\t$nItems = $table->countRows($where);\n\t\t$nPages = GWF_PageMenu::getPagecount($ipp, $nItems);\n\t\tif ($page > $nPages)\n\t\t{\n\t\t\treturn self::rply($player, '1009');\n// \t\t\t$bot->reply('This page is empty.');\n\t\t\treturn false;\n\t\t}\n\t\t$from = GWF_PageMenu::getFrom($page, $ipp);\n\t\tif (false === ($result = $table->selectAll('sr4ch_time,sr4ch_pname,sr4ch_action,sr4ch_iname,sr4ch_amt', $where, 'sr4ch_time DESC', NULL, $ipp, $from, GDO::ARRAY_N)))\n\t\t{\n\t\t\t$player->message('DB ERROR');\n// \t\t\t$bot->reply('DB ERROR');\n\t\t\treturn false;\n\t\t}\n\n\t\t$b = 0;\n\t\t$out = array();\n\t\tforeach ($result as $row)\n\t\t{\n\t\t\t$b = 1 - $b;\n\t\t\t$b2 = $b === 0 ? '' : \"\\X02\";\n\t\t\t$out[] = $b2.SR_ClanHistory::getHistMessage($player, $row[0], $row[1], $row[2], $row[3], $row[4]).$b2;\n\t\t}\n\t\t\n\t\treturn self::rply($player, '5041', array($page, $nPages, implode(' ', $out)));\n// \t\t$message = sprintf('ClanHistory page %d/%d: %s', $page, $nPages, implode(' ', $out));\n// \t\treturn $bot->reply($message);\n\t}", "function parse_history_zone()\n\t\t{\n\t\t\tif ( (empty($this->display_history)) || (!($this->display_history)))\n\t\t\t{\n\t\t\t\t//hide the history zone\n\t\t\t\t$this->t->set_var(array( 'history' => ''));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$inst_parser =& CreateObject('workflow.bo_uiinstance', $this->t);\n\t\t\t\t$inst_parser->t =& $this->t;\n\t\t\t\t$inst_parser->parse_instance_history($this->instance->workitems);\n\t\t\t\t$this->t->set_var('history', $this->t->parse('output', 'history_tpl'));\n\t\t\t}\n\t\t}", "public function show(history $history)\n {\n //\n }", "public function actionHistory()\n {\n $this->pageTitle = 'Your Viewing History';\n\n $data['pageHistory'] = History::model()->all('page');\n $data['pdfHistory'] = History::model()->all('pdf');\n\n $this->render('//content/history', $data);\n }", "public function getHistory()\n {\n return Wrapper\\Player\\Senior::history($this->getId());\n }", "public function testEmptyHistory()\n {\n $response = $this->get('/api/user/history/999');\n $response->assertStatus(200);\n }", "public function index($playerId){\n $data = array();\n $player = User::find($playerId);\n $data['player'] = $player;\n\n $matches = Matches::userMatches($playerId);\n $data['matches'] = $matches;\n\n $characters = Characters::all();\n\n $charactersIdToName = array();\n foreach($characters as $character){\n $charactersIdToName[$character['id']] = $character['name'];\n }\n $data['characters'] = $charactersIdToName;\n\n return view('history', $data);\n }", "public function history()\n {\n $tittle['tittle'] = 'History Penjualan';\n\n $data = array(\n 'data_penjualan' => $this->penjualan->ambil_data_penjualan()->result_array(),\n 'data_detail_penjualan' => $this->penjualan->ambil_detail_penjualan(),\n 'user' => $this->db->get_where('user', ['username' =>\n $this->session->userdata('username')])->row_array()\n );\n\n //View dari Controller akuntansi/index\n $this->load->view('template/header', $tittle);\n $this->load->view('template/topbar', $data);\n $this->load->view('template/sidebar', $data);\n $this->load->view('transaksi/history', $data);\n $this->load->view('template/footer');\n }", "public function history()\n\t{\n\t\t$migration = new \\Hubzero\\Content\\Migration();\n\t\t$history = $migration->history();\n\t\t$items = [];\n\t\t$maxFile = 0;\n\t\t$maxUser = 0;\n\t\t$maxScope = 0;\n\n\n\t\tif ($history && count($history) > 0)\n\t\t{\n\t\t\t$items[] = [\n\t\t\t\t'File',\n\t\t\t\t'By',\n\t\t\t\t'Direction',\n\t\t\t\t'Date'\n\t\t\t];\n\n\t\t\tforeach ($history as $entry)\n\t\t\t{\n\t\t\t\t$items[] = [\n\t\t\t\t\t$entry->scope . DS . $entry->file,\n\t\t\t\t\t$entry->action_by,\n\t\t\t\t\t$entry->direction,\n\t\t\t\t\t$entry->date\n\t\t\t\t];\n\t\t\t}\n\n\t\t\t$this->output->addTable($items, true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->addLine('No history to display.');\n\t\t}\n\t}", "public function action_chat_history() {\n\t\t$this->_template->set('page_title', 'All Messages');\n\t\t$this->_template->set('page_info', 'view and manage chat messages');\n\t\t$messages = ORM::factory('Message')->get_grouped_messages($this->_current_user->id);\n\t\t$this->_template->set('messages', $messages);\n\t\t$this->_set_content('messages');\n\t}", "function action_history()\n{\n\tglobal $pagestore, $page, $full, $HistMax;\n\n\t$history = $pagestore->history($page);\n\n\tgen_headers($history[0][0]);\n\n\n\t$text = '';\n\t$latest_auth = '';\n\t$previous_ver = 0;\n\t$is_latest = 1;\n\n\tfor($i = 0; $i < count($history); $i++)\n\t{\n\t\tif($latest_auth == '')\n\t\t{\n\t\t\t$latest_auth = ($history[$i][3] == '' ? $history[$i][1]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: $history[$i][3]);\n\t\t\t$latest_ver = $history[$i][2];\n\t\t}\n\n\t\tif($previous_ver == 0\n\t\t\t && $latest_auth != ($history[$i][3] == '' ? $history[$i][1]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t : $history[$i][3]))\n\t\t\t{ $previous_ver = $history[$i][2]; }\n\n\t\tif($i < $HistMax || $full)\n\t\t{\n\t\t\t$text = $text . html_history_entry($page, $history[$i][2],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $history[$i][0], $history[$i][1],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $history[$i][3],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $previous_ver == $history[$i][2] || !$full && $i == count($history)-1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $is_latest, $history[$i][4]);\n\t\t}\n\n\t\t$is_latest = 0;\n\t}\n\n\tif($i >= $HistMax && !$full)\n\t\t{ $text = $text . html_fullhistory($page, count($history)); }\n\n\t$p1 = $pagestore->page($page);\n\t$p1->version = $previous_ver;\n\t$p2 = $pagestore->page($page);\n\t$p2->version = $latest_ver;\n\n\t$diff = diff_compute($p1->read(), $p2->read());\n\ttemplate_history(array('page' => $p2->as_array(),\n\t\t\t\t\t\t\t\t\t\t\t\t 'history' => $text,\n\t\t\t\t\t\t\t\t\t\t\t\t 'diff' => diff_parse($diff)));\n}", "function history() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['user_id'];\n $auth = $this->getAuthorization();\n if (!$this->validateAuthorization($id, $auth)) {\n $this->response('', 400);\n }\n\n if ($id > 0) {\n $query = \"select * from videos where id in (select video_id from history where user_id=$id group by video_id order by view_date desc);\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = array();\n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n $this->response(json_encode($result), 200); \n } else {\n $this->response('',204);\n }\n } else {\n $this->response('', 400);\n }\n }", "public function history()\n {\n $data['courses'] = $this->exchange_rates_model->get_courses();\n $data['title'] = 'History course';\n\n $this->load->view('templates/header', $data);\n $this->load->view('exchange_rates/history', $data);\n $this->load->view('templates/footer');\n }", "public static function getAllHistory()\n\t{\n\t\tglobal $mysql;\n\t\t$output = array();\n\t\t\n\t\t$result = $mysql->query(\"SELECT * FROM `history`\");\n\t\twhile ( $d = mysqli_fetch_array($result) )\n\t\t{\n\t\t\tif ( !empty($d) )\n\t\t\t\t$output[] = $d;\n\t\t}\n\t\treturn $output;\n\t}", "public function clearHistory() {}", "public function showHistory()\n {\n return view('customer.purchase-history', ['cart_items' => Cart::where('user_id', auth()->user()->id)->where('checkout_id', '!=', null)->simplePaginate(10)]);\n }", "public function history()\n {\n $streams = Auth::user()->streams()\n // Select 1st chunk created_at\n // Select last chunk created_at\n ->with(['firstChunk', 'lastChunk'])\n ->orderBy('id', 'desc')\n ->paginate();\n\n return view('streams_history', ['streams' => $streams]);\n }", "public function getHistory(){\n \t$History = HPP::where([['hpp_kind','=','history'],['hpp_city_id','=',1]])->get();\n \treturn view('Admin.HistoryPlanPurpose.History' , compact('History'));\n }", "protected function updateHistory()\n {\n self::$history[] = time();\n if(30 === count(self::$history))\n {\n if(reset(self::$history) >= (time() - 30))\n {\n sleep(2);\n }\n array_shift(self::$history);\n }\n }", "function simple_history_settings_page() {\n\t// echo \"Please choose options for simple history ...\";\n}", "public static function showList() {\n $template = file_get_contents(plugin_dir_path(__FILE__) . 'templates/login_history.html');\n\n $results = self::queryLoginHistories('desc', 25);\n $histories = '';\n foreach ($results as $history) {\n $histories .= '<tr><td>' . $history->logged_in_at. '</td><td>' . $history->user_login . '</td><td>' . $history->remote_ip . '</td><td>' . $history->user_agent . '</td></tr>';\n }\n\n $output = str_replace('%%page_title%%', get_admin_page_title(), $template);\n $output = str_replace('%%login_histories%%', $histories, $output);\n $output = str_replace('%%Recent%%', __('Recent', 'simple-login-history'), $output);\n $output = str_replace('%%record%%', __('record', 'simple-login-history'), $output);\n $output = str_replace('%%csv_download_link%%', plugin_dir_url(__FILE__) . 'download.php', $output);\n echo $output;\n }", "function simple_history_print_history($args = null) {\n\t\n\tglobal $simple_history;\n\t\n\t$arr_events = simple_history_get_items_array($args);\n\t#sf_d($arr_events);\n\t#sf_d($args);sf_d($arr_events);\n\t$defaults = array(\n\t\t\"page\" => 0,\n\t\t\"items\" => $simple_history->get_pager_size(),\n\t\t\"filter_type\" => \"\",\n\t\t\"filter_user\" => \"\",\n\t\t\"is_ajax\" => false\n\t);\n\n\t$args = wp_parse_args( $args, $defaults );\n\t$output = \"\";\n\tif ($arr_events) {\n\t\tif (!$args[\"is_ajax\"]) {\n\t\t\t// if not ajax, print the div\n\t\t\t$output .= \"<div class='simple-history-ol-wrapper'><ol class='simple-history'>\";\n\t\t}\n\t\n\t\t$loopNum = 0;\n\t\t$real_loop_num = -1;\n\t\tforeach ($arr_events as $one_row) {\n\t\t\t\n\t\t\t$real_loop_num++;\n\n\t\t\t$object_type = $one_row->object_type;\n\t\t\t$object_type_lcase = strtolower($object_type);\n\t\t\t$object_subtype = $one_row->object_subtype;\n\t\t\t$object_id = $one_row->object_id;\n\t\t\t$object_name = $one_row->object_name;\n\t\t\t$user_id = $one_row->user_id;\n\t\t\t$action = $one_row->action;\n\t\t\t$action_description = $one_row->action_description;\n\t\t\t$occasions = $one_row->occasions;\n\t\t\t$num_occasions = sizeof($occasions);\n\t\t\t$object_image_out = \"\";\n\n\t\t\t$css = \"\";\n\t\t\tif (\"attachment\" == $object_type_lcase) {\n\t\t\t\tif (wp_get_attachment_image_src($object_id, array(50,50), true)) {\n\t\t\t\t\t// yep, it's an attachment and it has an icon/thumbnail\n\t\t\t\t\t$css .= ' simple-history-has-attachment-thumnbail ';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (\"user\" == $object_type_lcase) {\n\t\t\t\t$css .= ' simple-history-has-attachment-thumnbail ';\n\t\t\t}\n\n\t\t\tif ($num_occasions > 0) {\n\t\t\t\t$css .= ' simple-history-has-occasions ';\n\t\t\t}\n\t\t\t\n\t\t\t$output .= \"<li class='$css'>\";\n\n\t\t\t$output .= \"<div class='first'>\";\n\t\t\t\n\t\t\t// who performed the action\n\t\t\t$who = \"\";\n\t\t\t$user = get_user_by(\"id\", $user_id); // false if user does not exist\n\n\t\t\tif ($user) {\n\t\t\t\t$user_avatar = get_avatar($user->user_email, \"32\"); \n\t\t\t\t$user_link = \"user-edit.php?user_id={$user->ID}\";\n\t\t\t\t$who_avatar = sprintf('<a class=\"simple-history-who-avatar\" href=\"%2$s\">%1$s</a>', $user_avatar, $user_link);\n\t\t\t} else {\n\t\t\t\t$user_avatar = get_avatar(\"\", \"32\"); \n\t\t\t\t$who_avatar = sprintf('<span class=\"simple-history-who-avatar\">%1$s</span>', $user_avatar);\n\t\t\t}\n\t\t\t$output .= $who_avatar;\n\t\t\t\n\t\t\t// section with info about the user who did something\n\t\t\t$who .= \"<span class='who'>\";\n\t\t\tif ($user) {\n\t\t\t\t$who .= sprintf('<a href=\"%2$s\">%1$s</a>', $user->user_nicename, $user_link);\n\t\t\t\tif (isset($user->first_name) || isset($user->last_name)) {\n\t\t\t\t\tif ($user->first_name || $user->last_name) {\n\t\t\t\t\t\t$who .= \" (\";\n\t\t\t\t\t\tif ($user->first_name && $user->last_name) {\n\t\t\t\t\t\t\t$who .= esc_html($user->first_name) . \" \" . esc_html($user->last_name);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$who .= esc_html($user->first_name) . esc_html($user->last_name); // just one of them, no space necessary\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$who .= \")\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$who .= \"&lt;\" . __(\"Unknown or deleted user\", 'simple-history') .\"&gt;\";\n\t\t\t}\n\t\t\t$who .= \"</span>\";\n\n\t\t\t// what and object\n\t\t\tif (\"post\" == $object_type_lcase) {\n\t\t\t\t\n\t\t\t\t$post_out = \"\";\n\t\t\t\t\n\t\t\t\t// Get real name for post type (not just the slug for custom post types)\n\t\t\t\t$post_type_object = get_post_type_object( $object_subtype );\n\t\t\t\tif ( is_null($post_type_object) ) {\n\t\t\t\t\t$post_out .= esc_html__( ucfirst( $object_subtype ) );\n\t\t\t\t} else {\n\t\t\t\t\t$post_out .= esc_html__( ucfirst( $post_type_object->labels->singular_name ) );\n\t\t\t\t}\n\n\t\t\t\t$post = get_post($object_id);\n\n\t\t\t\tif (null == $post) {\n\t\t\t\t\t// post does not exist, probably deleted\n\t\t\t\t\t// check if object_name exists\n\t\t\t\t\tif ($object_name) {\n\t\t\t\t\t\t$post_out .= \" <span class='simple-history-title'>\\\"\" . esc_html($object_name) . \"\\\"</span>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post_out .= \" <span class='simple-history-title'>&lt;unknown name&gt;</span>\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t#$title = esc_html($post->post_title);\n\t\t\t\t\t$title = get_the_title($post->ID);\n\t\t\t\t\t$title = esc_html($title);\n\t\t\t\t\t$edit_link = get_edit_post_link($object_id, 'display');\n\t\t\t\t\t$post_out .= \" <a href='$edit_link'>\";\n\t\t\t\t\t$post_out .= \"<span class='simple-history-title'>{$title}</span>\";\n\t\t\t\t\t$post_out .= \"</a>\";\n\t\t\t\t}\n\n\t\t\t\t$post_out .= \" \" . esc_html__($action, \"simple-history\");\n\t\t\t\t\n\t\t\t\t$post_out = ucfirst($post_out);\n\t\t\t\t$output .= $post_out;\n\n\t\t\t\t\n\t\t\t} elseif (\"attachment\" == $object_type_lcase) {\n\t\t\t\n\t\t\t\t$attachment_out = \"\";\n\t\t\t\t$attachment_out .= __(\"attachment\", 'simple-history') . \" \";\n\n\t\t\t\t$post = get_post($object_id);\n\t\t\t\t\n\t\t\t\tif ($post) {\n\n\t\t\t\t\t// Post for attachment was found\n\n\t\t\t\t\t$title = esc_html(get_the_title($post->ID));\n\t\t\t\t\t$edit_link = get_edit_post_link($object_id, 'display');\n\t\t\t\t\t$attachment_metadata = wp_get_attachment_metadata( $object_id );\n\t\t\t\t\t$attachment_file = get_attached_file( $object_id );\n\t\t\t\t\t$attachment_mime = get_post_mime_type( $object_id );\n\t\t\t\t\t$attachment_url = wp_get_attachment_url( $object_id );\n\n // Check that file exists. It may not due to local dev vs remove dev etc.\n $file_exists = file_exists($attachment_file);\n\n\t\t\t\t\t// Get attachment thumbnail. 60 x 60 is the same size as the media overview uses\n\t\t\t\t\t// Is thumbnail of object if image, is wp icon if not\n\t\t\t\t\t$attachment_image_src = wp_get_attachment_image_src($object_id, array(60, 60), true);\t\t\t\t\t\n if ($attachment_image_src && $file_exists) {\n\t\t\t\t\t\t$object_image_out .= \"<a class='simple-history-attachment-thumbnail' href='$edit_link'><img src='{$attachment_image_src[0]}' alt='Attachment icon' width='{$attachment_image_src[1]}' height='{$attachment_image_src[2]}' /></a>\";\n } else {\n $object_image_out .= \"<a class='simple-history-attachment-thumbnail' href='$edit_link'></a>\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Begin adding nice to have meta info about to attachment (name, size, mime, etc.)\t\t\t\t\t\n\t\t\t\t\t$object_image_out .= \"<div class='simple-history-attachment-meta'>\";\n\n\t\t\t\t\t// File name\n\n\t\t\t\t\t// Get size in human readable format. Code snippet from media.php\n\t\t\t\t\t$sizes = array( 'KB', 'MB', 'GB' );\n\n $attachment_filesize = \"\";\n if ( $file_exists ) {\n $attachment_filesize = filesize( $attachment_file );\n for ( $u = -1; $attachment_filesize > 1024 && $u < count( $sizes ) - 1; $u++ ) {\n $attachment_filesize /= 1024;\n }\n }\n\n if (empty($attachment_filesize)) {\n $str_attachment_size = \"<p>\" . __(\"File size: Unknown \", \"simple-history\") . \"</p>\";\n } else {\n $size_unit = ($u == -1) ? __(\"bytes\", \"simple-history\") : $sizes[$u];\n $str_attachment_size = sprintf('<p>%1$s %2$s %3$s</p>', __(\"File size:\", \"simple-history\"), round( $attachment_filesize, 0 ), $size_unit );\n\t\t\t\t\t}\n\n\t\t\t\t\t// File type\n\t\t\t\t\t$file_type_out = \"\";\n\t\t\t\t\tif ( preg_match( '/^.*?\\.(\\w+)$/', $attachment_file, $matches ) )\n\t\t\t\t\t\t$file_type_out .= esc_html( strtoupper( $matches[1] ) );\n\t\t\t\t\telse\n\t\t\t\t\t\t$file_type_out .= strtoupper( str_replace( 'image/', '', $post->post_mime_type ) );\n\t\t\t\n\t\t\t\t\t// Media size, width x height\n\t\t\t\t\t$media_dims = \"\";\n\t\t\t\t\tif ( ! empty( $attachment_metadata['width'] ) && ! empty( $attachment_metadata['height'] ) ) {\n\t\t\t\t\t\t$media_dims .= \"<span>{$attachment_metadata['width']}&nbsp;&times;&nbsp;{$attachment_metadata['height']}</span>\";\n\t\t\t\t\t}\n\n\t\t\t\t\t// Generate string with metainfo\n $object_image_out .= $str_attachment_size;\n $object_image_out .= sprintf('<p>%1$s %2$s</p>', __(\"File type:\"), $file_type_out );\n\t\t\t\t\tif ( ! empty( $media_dims ) ) $object_image_out .= sprintf('<p>%1$s %2$s</p>', __(\"Dimensions:\"), $media_dims );\t\t\t\t\t\n\t\t\t\t\tif ( ! empty( $attachment_metadata[\"length_formatted\"] ) ) $object_image_out .= sprintf('<p>%1$s %2$s</p>', __(\"Length:\"), $attachment_metadata[\"length_formatted\"] );\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// end attachment meta info box output\n\t\t\t\t\t$object_image_out .= \"</div>\"; // close simple-history-attachment-meta\n\n\t\t\t\t\t$attachment_out .= \" <a href='$edit_link'>\";\n\t\t\t\t\t$attachment_out .= \"<span class='simple-history-title'>{$title}</span>\";\n\t\t\t\t\t$attachment_out .= \"</a>\";\n\t\t\t\t\t\n\t\t\t\t} else {\n\n\t\t\t\t\t// Post for attachment was not found\n\t\t\t\t\tif ($object_name) {\n\t\t\t\t\t\t$attachment_out .= \"<span class='simple-history-title'>\\\"\" . esc_html($object_name) . \"\\\"</span>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$attachment_out .= \" <span class='simple-history-title'>&lt;deleted&gt;</span>\";\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t$attachment_out .= \" \" . esc_html__($action, \"simple-history\") . \" \";\n\t\t\t\t\n\t\t\t\t$attachment_out = ucfirst($attachment_out);\n\t\t\t\t$output .= $attachment_out;\n\n\t\t\t} elseif (\"user\" == $object_type_lcase) {\n\n\t\t\t\t$user_out = \"\";\n\t\t\t\t$user_out .= __(\"user\", 'simple-history');\n\t\t\t\t$user = get_user_by(\"id\", $object_id);\n\t\t\t\tif ($user) {\n\t\t\t\t\t$user_link = \"user-edit.php?user_id={$user->ID}\";\n\t\t\t\t\t$user_out .= \"<span class='simple-history-title'>\";\n\t\t\t\t\t$user_out .= \" <a href='$user_link'>\";\n\t\t\t\t\t$user_out .= $user->user_nicename;\n\t\t\t\t\t$user_out .= \"</a>\";\n\t\t\t\t\tif (isset($user->first_name) && isset($user->last_name)) {\n\t\t\t\t\t\tif ($user->first_name || $user->last_name) {\n\t\t\t\t\t\t\t$user_out .= \" (\";\n\t\t\t\t\t\t\tif ($user->first_name && $user->last_name) {\n\t\t\t\t\t\t\t\t$user_out .= esc_html($user->first_name) . \" \" . esc_html($user->last_name);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$user_out .= esc_html($user->first_name) . esc_html($user->last_name); // just one of them, no space necessary\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$user_out .= \")\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$user_out .= \"</span>\";\n\t\t\t\t} else {\n\t\t\t\t\t// most likely deleted user\n\t\t\t\t\t$user_link = \"\";\n\t\t\t\t\t$user_out .= \" \\\"\" . esc_html($object_name) . \"\\\"\";\n\t\t\t\t}\n\n\t\t\t\t$user_out .= \" \" . esc_html__($action, \"simple-history\");\n\t\t\t\t\n\t\t\t\t$user_out = ucfirst($user_out);\n\t\t\t\t$output .= $user_out;\n\n\t\t\t} elseif (\"comment\" == $object_type_lcase) {\n\t\t\t\t\n\t\t\t\t$comment_link = get_edit_comment_link($object_id);\n\t\t\t\t$output .= ucwords(esc_html__(ucfirst($object_type))) . \" \" . esc_html($object_subtype) . \" <a href='$comment_link'><span class='simple-history-title'>\" . esc_html($object_name) . \"\\\"</span></a> \" . esc_html__($action, \"simple-history\");\n\n\t\t\t} else {\n\n\t\t\t\t// unknown/general type\n\t\t\t\t// translate the common types\n\t\t\t\t$unknown_action = $action;\n\t\t\t\tswitch ($unknown_action) {\n\t\t\t\t\tcase \"activated\":\n\t\t\t\t\t\t$unknown_action = __(\"activated\", 'simple-history');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"deactivated\":\n\t\t\t\t\t\t$unknown_action = __(\"deactivated\", 'simple-history');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"enabled\":\n\t\t\t\t\t\t$unknown_action = __(\"enabled\", 'simple-history');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"disabled\":\n\t\t\t\t\t\t$unknown_action = __(\"disabled\", 'simple-history');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$unknown_action = $unknown_action; // dah!\n\t\t\t\t}\n\t\t\t\t$output .= ucwords(esc_html__($object_type, \"simple-history\")) . \" \" . ucwords(esc_html__($object_subtype, \"simple-history\")) . \" <span class='simple-history-title'>\\\"\" . esc_html($object_name) . \"\\\"</span> \" . esc_html($unknown_action);\n\n\t\t\t}\n\t\t\t$output .= \"</div>\";\n\t\t\t\n\t\t\t// second div = when and who\n\t\t\t$output .= \"<div class='second'>\";\n\t\t\t\n\t\t\t$date_i18n_date = date_i18n(get_option('date_format'), strtotime($one_row->date), $gmt=false);\n\t\t\t$date_i18n_time = date_i18n(get_option('time_format'), strtotime($one_row->date), $gmt=false);\t\t\n\t\t\t$now = strtotime(current_time(\"mysql\"));\n\t\t\t$diff_str = sprintf( __('<span class=\"when\">%1$s ago</span> by %2$s', \"simple-history\"), human_time_diff(strtotime($one_row->date), $now), $who );\n\t\t\t$output .= $diff_str;\n\t\t\t$output .= \"<span class='when_detail'>\".sprintf(__('%s at %s', 'simple-history'), $date_i18n_date, $date_i18n_time).\"</span>\";\n\n\t\t\t// action description\n\t\t\tif ( trim( $action_description ) ) {\n\t\t\t\t$output .= sprintf(\n\t\t\t\t\t'\n\t\t\t\t\t<a href=\"#\" class=\"simple-history-item-description-toggler\">%2$s</a>\n\t\t\t\t\t<div class=\"simple-history-item-description-wrap\">\n\t\t\t\t\t\t<div class=\"simple-history-action-description\">%1$s</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t',\n\t\t\t\t\tnl2br( esc_attr( $action_description ) ), // 2\n\t\t\t\t\t__(\"Details\", \"simple-history\") // 2\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\t$output .= \"</div>\";\n\n\t\t\t// Object image\n\t\t\tif ( $object_image_out ) {\n\n\t\t\t\t$output .= sprintf(\n\t\t\t\t\t'\n\t\t\t\t\t<div class=\"simple-history-object-image\">\n\t\t\t\t\t\t%1$s\n\t\t\t\t\t</div>\n\t\t\t\t\t',\n\t\t\t\t\t$object_image_out\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t\t// occasions\n\t\t\tif ($num_occasions > 0) {\n\t\t\t\t$output .= \"<div class='third'>\";\n\t\t\t\tif ($num_occasions == 1) {\n\t\t\t\t\t$one_occasion = __(\"+ 1 occasion\", 'simple-history');\n\t\t\t\t\t$output .= \"<a class='simple-history-occasion-show' href='#'>$one_occasion</a>\";\n\t\t\t\t} else {\n\t\t\t\t\t$many_occasion = sprintf(__(\"+ %d occasions\", 'simple-history'), $num_occasions);\n\t\t\t\t\t$output .= \"<a class='simple-history-occasion-show' href='#'>$many_occasion</a>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$output .= \"<ul class='simple-history-occasions hidden'>\";\n\t\t\t\tforeach ($occasions as $one_occasion) {\n\t\t\t\t\n\t\t\t\t\t$output .= \"<li>\";\n\t\t\t\t\n\t\t\t\t\t$date_i18n_date = date_i18n(get_option('date_format'), strtotime($one_occasion->date), $gmt=false);\n\t\t\t\t\t$date_i18n_time = date_i18n(get_option('time_format'), strtotime($one_occasion->date), $gmt=false);\t\t\n\t\t\t\t\n\t\t\t\t\t$output .= \"<div class='simple-history-occasions-one-when'>\";\n\t\t\t\t\t$output .= sprintf(\n\t\t\t\t\t\t\t__('%s ago (%s at %s)', \"simple-history\"), \n\t\t\t\t\t\t\thuman_time_diff(strtotime($one_occasion->date), $now), \n\t\t\t\t\t\t\t$date_i18n_date, \n\t\t\t\t\t\t\t$date_i18n_time\n\t\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\tif ( trim( $one_occasion->action_description ) ) {\n\t\t\t\t\t\t$output .= \"<a href='#' class='simple-history-occasions-details-toggle'>\" . __(\"Details\", \"simple-history\") . \"</a>\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$output .= \"</div>\";\n\n\t\t\t\t\tif ( trim( $one_occasion->action_description ) ) {\n\t\t\t\t\t\t$output .= sprintf(\n\t\t\t\t\t\t\t'<div class=\"simple-history-occasions-one-action-description\">%1$s</div>',\n\t\t\t\t\t\t\tnl2br( esc_attr( $one_occasion->action_description ) )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$output .= \"</li>\";\n\t\t\t\t}\n\n\t\t\t\t$output .= \"</ul>\";\n\n\t\t\t\t$output .= \"</div>\";\n\t\t\t}\n\n\t\t\t$output .= \"</li>\";\n\n\t\t\t$loopNum++;\n\n\t\t}\n\t\t\n\t\t// if $loopNum == 0 no items where found for this page\n\t\tif ($loopNum == 0) {\n\t\t\t$output .= \"noMoreItems\";\n\t\t}\n\t\t\n\t\tif ( ! $args[\"is_ajax\"] ) {\n\n\t\t\t// if not ajax, print the divs and stuff we need\n\t\t\t$show_more = \"<select>\";\n\t\t\t$show_more .= sprintf('<option value=5 %2$s>%1$s</option>', __(\"Show 5 more\", 'simple-history'), ($args[\"items\"] == 5 ? \" selected \" : \"\") );\n\t\t\t$show_more .= sprintf('<option value=15 %2$s>%1$s</option>', __(\"Show 15 more\", 'simple-history'), ($args[\"items\"] == 15 ? \" selected \" : \"\") );\n\t\t\t$show_more .= sprintf('<option value=50 %2$s>%1$s</option>', __(\"Show 50 more\", 'simple-history'), ($args[\"items\"] == 50 ? \" selected \" : \"\") );\n\t\t\t$show_more .= sprintf('<option value=100 %2$s>%1$s</option>', __(\"Show 100 more\", 'simple-history'), ($args[\"items\"] == 100 ? \" selected \" : \"\") );\n\t\t\t$show_more .= \"</select>\";\n\n\t\t\t$no_found = __(\"No matching items found.\", 'simple-history');\n\t\t\t$view_rss = __(\"RSS feed\", 'simple-history');\n\t\t\t$view_rss_link = simple_history_get_rss_address();\n\t\t\t$str_show = __(\"Show\", 'simple-history');\n\t\t\t$output .= \"</ol>\";\n\n\t\t\t$output .= sprintf( '\n\t\t\t\t\t<div class=\"simple-history-loading\">%2$s %1$s</div>\n\t\t\t\t\t', \n\t\t\t\t\t__(\"Loading...\", 'simple-history'), // 1\n\t\t\t\t\t\"<img src='\".site_url(\"wp-admin/images/loading.gif\").\"' width=16 height=16>\"\n\t\t\t\t);\n\n\t\t\t$output .= \"</div>\";\n\n\t\t\t$output .= \"\n\t\t\t\t<p class='simple-history-no-more-items'>$no_found</p>\t\t\t\n\t\t\t\t<p class='simple-history-rss-feed-dashboard'><a title='$view_rss' href='$view_rss_link'>$view_rss</a></p>\n\t\t\t\t<p class='simple-history-rss-feed-page'><a title='$view_rss' href='$view_rss_link'><span></span>$view_rss</a></p>\n\t\t\t\";\n\n\t\t}\n\n\t} else {\n\n\t\tif ($args[\"is_ajax\"]) {\n\t\t\t$output .= \"noMoreItems\";\n\t\t} else {\n\t\t\t$no_found = __(\"No history items found.\", 'simple-history');\n\t\t\t$please_note = __(\"Please note that Simple History only records things that happen after this plugin have been installed.\", 'simple-history');\n\t\t\t$output .= \"<p>$no_found</p>\";\n\t\t\t$output .= \"<p>$please_note</p>\";\n\t\t}\n\n\t}\n\treturn $output;\n}", "public function actionHistory()\n {\n $id = Yii::app()->request->getQuery('id');\n $model = Order::model()->findByPk($id);\n\n if (!$model)\n $this->error404(Yii::t('CartModule.admin', 'ORDER_NOT_FOUND'));\n if ($model->is_deleted)\n throw new CHttpException(404, Yii::t('CartModule.admin', 'ORDER_ISDELETED'));\n $this->render('_history', array(\n 'model' => $model\n ));\n }", "public function index()\n {\n if($this->previousUrlIsFlashMsg()) {\n $redirectAction = redirect()->route('home');\n } else {\n $redirectAction = redirect()->back();\n }\n \n $players = Player::all();\n \n return response()->view('players.index', [\n 'players' => $players\n ])->header('cache-control', 'no-store,no-cache,must-revalidate')\n ->header('pragma', 'no-cache')\n ->header('expires', '0');\n }", "public function getHistory()\n {\n return view('PagePersonal.history');\n }", "public function clearHistory()\r\r\n {\r\r\n $this->history = array();\r\r\n }", "public function show()\n {\n return view('history');\n }", "function bit_admin_show_playlines( $playid ) {\n}", "public function index()\n {\n $history = App\\Models\\history::latest()->first();\n return view('admin.history.view',compact('history'));\n }", "public function anyHistory() {\n return $this->getHistoryCount() !== 0;\n }", "protected function updateHistory() {\n self::$history[] = time();\n\n if ( 30 === count( self::$history ) ) {\n if ( reset( self::$history ) >= (time() - 30) ) {\n sleep( 2 );\n }\n\n array_shift( self::$history );\n }\n }", "public function get_history()\n {\n return view('content.history')\n ->with('pages', History::page_all())\n ->with('pdfs', History::pdf_all());\n }", "function show_user_history() {\n if (!$this->session->userdata('logged_in')) {\n redirect('logout');\n }\n\n $id = $this->session->userdata('userid');\n $query = $this->db->get_where('tb_app_prev_info', array('app_id' => $id));\n if ($query->num_rows() == 1) {\n foreach ($query->result() as $ro) {\n $value1 = array(\n 'specializ' => $ro->specialization,\n 'high_edu' => $ro->high_edu_attained,\n 'institut' => $ro->institution,\n 'gradu_year' => $ro->year_of_gradu,\n 'gpa' => $ro->gpa,\n 'other_qualification' => $ro->other_qualification,\n 'dof' => $ro->dof,\n 'dot' => $ro->dot,\n 'responsibility' => $ro->nature_of_work,\n 'employer' => $ro->comp_employed,\n 'release' => $ro->comp_release_agre,\n 'position' => $ro->position\n );\n }\n unset($ro);\n return $value1;\n } else {\n $value1 = array(\n 'specializ' => '',\n 'high_edu' => '',\n 'institut' => '',\n 'gradu_year' => '',\n 'gpa' => '',\n 'other_qualification' => '',\n 'dof' => '',\n 'dot' => '',\n 'responsibility' => '',\n 'employer' => '',\n 'release' => '',\n 'position' => ''\n );\n return $value1;\n }\n }", "public function actionCron_jobs_history()\n {\n $request = Yii::app()->request;\n $model = new ConsoleCommandListHistory('search');\n $model->unsetAttributes();\n\n $model->attributes = (array)$request->getQuery($model->modelName, array());\n \n $this->setData(array(\n 'pageMetaTitle' => $this->data->pageMetaTitle . ' | '. Yii::t('cronjobs', 'View cron jobs history'),\n 'pageHeading' => Yii::t('cronjobs', 'View cron jobs history'),\n 'pageBreadcrumbs' => array(\n Yii::t('cronjobs', 'Cron jobs history'),\n )\n ));\n\n $this->render('cron-jobs-history', compact('model'));\n }", "public function actionHistory()\n {\n /*$auditdata = AuditTrailSearch::find()\n ->select(['entry_id', 'model_id', 'user_id', 'created', 'old_value'])\n ->where([\n 'action' => 'DELETE',\n 'model' => 'backend\\models\\Event',\n ])\n ->andFilterWhere(['>', 'old_value', \"''\"])\n ->orderBy(['model_id' => SORT_DESC])\n ->all();*/\n// $historyData = \\yii\\helpers\\ArrayHelper::map($auditdata, 'model_id', 'old_value');\n// \\yii\\helpers\\VarDumper::dump($historyData);\n\n $searchModel = new AuditTrailSearch;\n $searchFilter = [\n 'AuditTrailSearch' => [\n 'action' => 'DELETE',\n 'model' => 'backend\\models\\Event'\n ]\n ];\n $dataProvider = $searchModel->search(\\yii\\helpers\\ArrayHelper::merge(Yii::$app->request->get(), $searchFilter));\n //var_dump(Yii::$app->request->get());\n //\\yii\\helpers\\VarDumper::dump($searchModel);\n $message = \"<ol>恢复操作指引<li><删除内容>中输入内容筛选</li><li>点击复选框选中需要恢复的记录</li><li>点击<恢复记录>按钮</li></ol>\";\n Yii::$app->session->setFlash('info', $message);\n return $this->render('history', [\n 'dataProvider' => $dataProvider,\n 'searchModel' => $searchModel,\n ]);\n }", "function simple_history_management_page() {\n\n\tglobal $simple_history;\n\n\tsimple_history_purge_db();\n\n\t?>\n\n\t<div class=\"wrap simple-history-wrap\">\n\t\t<h2><?php echo __(\"History\", 'simple-history') ?></h2>\n\t\t<?php\t\n\t\tsimple_history_print_nav(array(\"from_page=1\"));\n\t\techo simple_history_print_history(array(\"items\" => $simple_history->get_pager_size(), \"from_page\" => \"1\"));\n\t\techo simple_history_get_pagination();\n\t\t?>\n\t</div>\n\n\t<?php\n\n}", "public function getHistory()\n {\n \treturn QuizResult::where('user_id', '=', Auth::user()->id)->orderBy('id', 'DESC')->limit(5)->get();\n }", "public function show($historyUser)\n {\n //\n }", "public function clienthistoryAction()\n {\n // If no client ID was provided, bail out.\n if (!$this->_hasParam('id')) {\n throw new UnexpectedValueException('No client ID parameter provided');\n }\n\n $clientId = $this->_getParam('id');\n\n // Pass current and past client and household history.\n $service = new App_Service_Member();\n\n $this->view->pageTitle = 'View Household History';\n $this->view->client = $service->getClientById($clientId);\n $this->view->householders = $service->getHouseholdersByClientId($clientId);\n $this->view->history = $service->getClientHouseholdHistory($clientId);\n }", "function retrive_history_details_for_single_pfac_in_preview($pfac_id, $params){\n\t\n\t\tglobal $connection;\n\t\t$sql = \"SELECT * FROM pfac__players_history WHERE PFAC_id = {$pfac_id}\";\n\t\treturn DBFunctions::result_to_array_for_few_fields(DBFunctions::execute_query($sql), $params);\t\t\t\t\n\t}", "function bp_videossubnav_tab_action() {\n\t\techo $this->get_instance( \\MyVideoRoomExtrasParking\\Library\\SectionTemplates::class )->control_panel_store_video();\n\t}", "public function player()\n {\n if($this->previousUrlIsFlashMsg()) {\n $redirectAction = redirect()->route('home');\n } else {\n $redirectAction = redirect()->back();\n }\n //echo request()->team_id;exit;\n \n $players = Player::where('team_id', request()->team_id)->get();\n return response()->view('players.index', [\n 'players' => $players,\n 'teamId' =>request()->team_id\n ])->header('cache-control', 'no-store,no-cache,must-revalidate')\n ->header('pragma', 'no-cache')\n ->header('expires', '0');\n }", "public function get_user_history(){\n \t$s = \"SELECT * FROM user_history WHERE username = ? group by ETF order by Date ASC\";\n \tif($stmt = $this->connection->prepare($s)){\n \t\t$stmt->bind_param(\"s\", $_SESSION['username']);\n \t\t$stmt->execute();\n \t\t$res = $stmt->get_result();\n \t\twhile($row = $res->fetch_object()){\n \t\t\t$history[] = $row;\n \t\t}\n \t\treturn $history;\n \t}\n \t \t\n }", "function get_history() {\n\t\treturn $this->history;\n\t}", "protected function loadUniqueStatHistory()\n\t{\n\t\tif (!$this->stat_history && $this->getApplicationID())\n\t\t{\n\t\t\t$this->stat_history = $this->findUniqueStatHistoryByTrackApp(\n\t\t\t\t$this->getTrackKey(),\n\t\t\t\t$this->getApplicationID()\n\t\t\t);\n\t\t}\n\t}", "public function rewindHistory();", "public function action_index()\n{\n $history = Jelly::select( 'user_history' )\n ->where(':primary_key', '=', $this->user->id)\n ->limit( 25 )\n ->execute();\n\n $this->template->content = View::factory('history/index')\n ->set('history', $history);\n\n}", "public function viewHistory() {\n $historyRows = $this->db->query(\"SELECT * FROM history\");\n if (!$historyRows) die(\"Fatal Error.\");\n\n // Looping through all rows in the histoy table.\n $history = [];\n foreach($historyRows as $historyRow) {\n $regNr = htmlspecialchars($historyRow[\"regNr\"]);\n $ssNr = htmlspecialchars($historyRow[\"ssNr\"]);\n $checkOut = htmlspecialchars($historyRow[\"checkOutTime\"]);\n $checkIn = htmlspecialchars($historyRow[\"checkInTime\"]);\n $days = htmlspecialchars($historyRow[\"days\"]);\n $cost = htmlspecialchars($historyRow[\"cost\"]);\n\n // Setting 0 as default value on days and cost if car not checked in yet.\n if (!$checkIn) {\n $checkIn = \"Checked Out\";\n $days = 0;\n $cost = 0;\n }\n \n $histor = [\"regNr\" => $regNr,\n \"ssNr\" => $ssNr, \n \"checkOut\" => $checkOut,\n \"checkIn\" => $checkIn, \n \"days\" => $days,\n \"cost\" => $cost,\n \"days\" => $days];\n \n $history[] = $histor;\n }\n return $history;\n }", "public function homeTimeline($options = []);", "public function getHistory()\r\r\n {\r\r\n return $this->history;\r\r\n }", "public function index()\n\t{\n\t\t$orders = Order::select()->whereNull('original_order')->orderBy('updated_at', 'desc')->paginate(6);\n\n\t\treturn view('admin.history.index', compact('orders'));\n\t}", "public function index()\n {\n $players = new \\App\\Models\\hockey\\Players();\n $records = $players->findAll();\n \n \n $table = new \\CodeIgniter\\View\\Table();\n \n $headings = $players->fields;\n \n //Add an extra row to header for column show\n $headings[count($headings)+1] = \"Show\";\n \n $table->setHeading($headings);\n\n foreach ($records as $val) {\n\n //create a new array without the 'show' heading\n $headingsminusshow = array_slice($headings, 0, count($headings)-1);\n //Loop through headers and assign their value to an array for each table row\n foreach ($headingsminusshow as $key => $header) {\n $newRow[$key] = $val->$header;\n }\n\n //Link to show each player\n $showLink = anchor(\"hockey/home/show/$val->id\",\"Show\");\n $newRow[count($headings)+1] = $showLink;\n \n $table->addRow($newRow);\n }\n \n return $table->generate();\n }", "public function getHistoryTpl(){\n return $this->templates['history'];\n }", "public function getRawHistory()\n {\n return $this->raw_history;\n }", "public function get_history()\n\t{\n return array(\n 'result' => array(\n 'error' => array(\n 'code' => '404',\n 'message' => 'Not Found'\n )\n )\n );\n\t}", "function show_champ($db)\n{\n global $PHP_SELF,$bluebdr,$greenbdr,$yellowbdr;\n\n if (!$db->Exists(\"SELECT * FROM champions\")) {\n echo \"<p>The Champions database is being edited. Please check back shortly.</p>\\n\";\n return;\n } else {\n\n\n echo \"<table width=\\\"100%\\\" cellpadding=\\\"10\\\" cellspacing=\\\"0\\\" border=\\\"0\\\">\\n\";\n echo \"<tr>\\n\";\n echo \" <td align=\\\"left\\\" valign=\\\"top\\\">\\n\";\n\n echo \"<table width=\\\"100%\\\" cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" border=\\\"0\\\">\\n\";\n echo \"<tr>\\n\";\n echo \" <td align=\\\"left\\\" valign=\\\"top\\\">\\n\";\n echo \" <font class=\\\"10px\\\">You are here:</font> <a href=\\\"/index.php\\\">Home</a> &raquo; <font class=\\\"10px\\\">Champions</font></p>\\n\";\n echo \" </td>\\n\";\n //echo \" <td align=\\\"right\\\" valign=\\\"top\\\">\\n\";\n //require (\"includes/navtop.php\");\n //echo \" </td>\\n\";\n echo \"</tr>\\n\";\n echo \"</table>\\n\";\n\n echo \"<b class=\\\"16px\\\">Historical Champions</b><br><br>\\n\";\n\n //////////////////////////////////////////////////////////////////////////////////////////\n // League Champions List\n //////////////////////////////////////////////////////////////////////////////////////////\n// 8-Oct-2015 10:30pm - Modified SQL to get the ChampTeam2 and ChampTeam3, and used LEFT JOINs\n $db->Query(\"\n SELECT\n ch.*,\n te.TeamName, te.TeamAbbrev, te.TeamID, \n\t\t\t\tte2.TeamName as TeamName2, te2.TeamAbbrev as TeamAbbrev2, te2.TeamID as TeamID2, \n\t\t\t\tte3.TeamName as TeamName3, te3.TeamAbbrev as TeamAbbrev3, te3.TeamID as TeamID3,\n se.*\n FROM\n champions ch\n INNER JOIN\n teams te ON ch.ChampTeam = te.TeamID\n\t\t\tLEFT JOIN\n teams te2 ON ch.ChampTeam2 = te2.TeamID\n\t\t\tLEFT JOIN\n teams te3 ON ch.ChampTeam3 = te3.TeamID\n\t\t\tINNER JOIN \n seasons se ON ch.ChampSeason = se.SeasonID\n WHERE\n se.SeasonName NOT LIKE '%KO%'\n ORDER BY\n se.SeasonName DESC\n \");\n \n\n echo \"<table width=\\\"100%\\\" border=\\\"1\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" bordercolor=\\\"$bluebdr\\\" align=\\\"center\\\">\\n\";\n echo \" <tr>\\n\";\n echo \" <td bgcolor=\\\"$bluebdr\\\" class=\\\"whitemain\\\" height=\\\"23\\\">&nbsp;LEAGUE CHAMPIONS LIST</td>\\n\";\n echo \" </tr>\\n\";\n echo \" <tr>\\n\";\n echo \" <td bgcolor=\\\"#FFFFFF\\\" valign=\\\"top\\\" bordercolor=\\\"#FFFFFF\\\" class=\\\"main\\\" colspan=\\\"2\\\">\\n\";\n\n echo \" <table width=\\\"100%\\\" cellspacing=\\\"1\\\" cellpadding=\\\"3\\\" class=\\\"tablehead\\\">\\n\"; \n\n echo \"<tr class=\\\"colhead\\\">\\n\"; \n echo \" <td align=\\\"left\\\" width=\\\"40%\\\"><b>SEASON</b></td>\\n\";\n echo \" <td align=\\\"left\\\" width=\\\"20%\\\"><b>Champion</b></td>\\n\"; // 8-Oct-2015 10:30pm\n\t\techo \" <td align=\\\"left\\\" width=\\\"20%\\\"><b>Runners</b></td>\\n\";\n\t\techo \" <td align=\\\"left\\\" width=\\\"20%\\\"><b>3rd</b></td>\\n\";\n echo \"</tr>\\n\";\n \n for ($x=0; $x<$db->rows; $x++) {\n $db->GetRow($x);\n \n // setup variables\n\n $tna = $db->data['TeamName'];\n $tab = $db->data['TeamAbbrev'];\n $sn = $db->data['SeasonName'];\n $tid = $db->data['TeamID'];\n \n\t\t$tna2 = $db->data['TeamName2']; // 8-Oct-2015 10:30pm\n $tab2 = $db->data['TeamAbbrev2'];\n $tid2 = $db->data['TeamID2'];\n\t\t\n\t\t$tna3 = $db->data['TeamName3']; // 8-Oct-2015 10:30pm\n $tab3 = $db->data['TeamAbbrev3'];\n $tid3 = $db->data['TeamID3'];\n\t\t\n echo '<tr class=\"trrow', ($x % 2 ? '1' : '2'), '\">';\n// 1-Mar-2010 - removed the words League Champions. \n echo \" <td align=\\\"left\\\" width=\\\"40%\\\">$sn</td>\\n\";\n// echo \" <td align=\\\"left\\\" width=\\\"40%\\\">$sn League Champions</td>\\n\";\n echo \" <td align=\\\"left\\\" width=\\\"20%\\\"><a href=\\\"/teamdetails.php?teams=$tid&ccl_mode=1\\\">$tab</a></td>\\n\";\n\t\techo \" <td align=\\\"left\\\" width=\\\"20%\\\"><a href=\\\"/teamdetails.php?teams=$tid2&ccl_mode=1\\\">$tab2</a></td>\\n\";\n\t\techo \" <td align=\\\"left\\\" width=\\\"20%\\\"><a href=\\\"/teamdetails.php?teams=$tid3&ccl_mode=1\\\">$tab3</a></td>\\n\";\n echo \"</tr>\\n\";\n \n }\n\n echo \"</table>\\n\";\n\n echo \" </td>\\n\";\n echo \"</tr>\\n\";\n echo \"</table><br>\\n\";\n \n //////////////////////////////////////////////////////////////////////////////////////////\n // KO Champions List\n //////////////////////////////////////////////////////////////////////////////////////////\n// 8-Oct-2015 10:30pm - Modified SQL to get the ChampTeam2 and ChampTeam3, and used LEFT JOINs\n\n $db->Query(\"\n SELECT\n ch.*,\n te.TeamName, te.TeamAbbrev, te.TeamID,\n\t\t\t\tte2.TeamName as TeamName2, te2.TeamAbbrev as TeamAbbrev2, te2.TeamID as TeamID2, \n\t\t\t\tte3.TeamName as TeamName3, te3.TeamAbbrev as TeamAbbrev3, te3.TeamID as TeamID3,\t\t\t\t\n se.*\n FROM\n champions ch\n INNER JOIN\n teams te ON ch.ChampTeam = te.TeamID\n\t\t\tLEFT JOIN\n teams te2 ON ch.ChampTeam2 = te2.TeamID\n\t\t\tLEFT JOIN\n teams te3 ON ch.ChampTeam3 = te3.TeamID\n INNER JOIN \n seasons se ON ch.ChampSeason = se.SeasonID\n WHERE\n se.SeasonName LIKE '%KO%'\n ORDER BY\n se.SeasonName DESC\n \");\n \n\n echo \"<table width=\\\"100%\\\" border=\\\"1\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" bordercolor=\\\"$greenbdr\\\" align=\\\"center\\\">\\n\";\n echo \" <tr>\\n\";\n echo \" <td bgcolor=\\\"$greenbdr\\\" class=\\\"whitemain\\\" height=\\\"23\\\">&nbsp;KNOCKOUT CHAMPIONS LIST</td>\\n\";\n echo \" </tr>\\n\";\n echo \" <tr>\\n\";\n echo \" <td bgcolor=\\\"#FFFFFF\\\" valign=\\\"top\\\" bordercolor=\\\"#FFFFFF\\\" class=\\\"main\\\" colspan=\\\"2\\\">\\n\";\n\n echo \" <table width=\\\"100%\\\" cellspacing=\\\"1\\\" cellpadding=\\\"3\\\" class=\\\"tablehead\\\">\\n\"; \n\n echo \"<tr class=\\\"colhead\\\">\\n\"; \n echo \" <td align=\\\"left\\\" width=\\\"40%\\\"><b>SEASON</b></td>\\n\";\n\t\techo \" <td align=\\\"left\\\" width=\\\"20%\\\"><b>Champion</b></td>\\n\"; // 8-Oct-2015 10:30pm\n\t\techo \" <td align=\\\"left\\\" width=\\\"20%\\\"><b>Runners</b></td>\\n\";\n\t\techo \" <td align=\\\"left\\\" width=\\\"20%\\\"><b>3rd</b></td>\\n\";\n echo \"</tr>\\n\";\n\n for ($x=0; $x<$db->rows; $x++) {\n $db->GetRow($x);\n \n // setup variables\n\n $tna = $db->data['TeamName'];\n $tab = $db->data['TeamAbbrev'];\n $sn = $db->data['SeasonName'];\n $tid = $db->data['TeamID'];\n \n\t\t$tna2 = $db->data['TeamName2']; // 8-Oct-2015 10:30pm\n $tab2 = $db->data['TeamAbbrev2'];\n $tid2 = $db->data['TeamID2'];\n\t\t\n\t\t$tna3 = $db->data['TeamName3']; // 8-Oct-2015 10:30pm\n $tab3 = $db->data['TeamAbbrev3'];\n $tid3 = $db->data['TeamID3'];\n\t\t\n echo '<tr class=\"trrow', ($x % 2 ? '1' : '2'), '\">';\n// 1-Mar-2010 - removed the words League Champions. \necho \" <td align=\\\"left\\\" width=\\\"40%\\\">$sn</td>\\n\";\n// echo \" <td align=\\\"left\\\" width=\\\"40%\\\">$sn League Champions</td>\\n\";\n echo \" <td align=\\\"left\\\" width=\\\"20%\\\"><a href=\\\"/teamdetails.php?teams=$tid&ccl_mode=1\\\">$tab</a></td>\\n\";\n\t\techo \" <td align=\\\"left\\\" width=\\\"20%\\\"><a href=\\\"/teamdetails.php?teams=$tid2&ccl_mode=1\\\">$tab2</a></td>\\n\";\n\t\techo \" <td align=\\\"left\\\" width=\\\"20%\\\"><a href=\\\"/teamdetails.php?teams=$tid3&ccl_mode=1\\\">$tab3</a></td>\\n\";\n\t\t\n echo \"</tr>\\n\";\n \n }\n\n echo \"</table>\\n\";\n\n echo \" </td>\\n\";\n echo \"</tr>\\n\";\n echo \"</table>\\n\";\n \n\n echo \" </td>\\n\";\n echo \"</tr>\\n\";\n echo \"</table>\\n\";\n }\n}", "static function getHistoryEntry($data) {\n\n switch ($data['linked_action'] - Log::HISTORY_PLUGIN) {\n case 0:\n return __('History from plugin example', 'example');\n }\n\n return '';\n }", "protected function showmyhistory() {\n global $USER, $PAGE;\n\n // Create a navigation cache so that we can store the history\n $cache = new navigation_cache('navigationhistory', 60*60);\n\n // If the user isn't logged in or is a guest we don't want to display anything\n if (!isloggedin() || isguestuser()) {\n return false;\n }\n\n // Check the cache to see if we have loaded my courses already\n // there is a very good chance that we have\n if (!$cache->cached('history')) {\n $cache->history = array();\n }\n $history = $cache->history;\n $historycount = count($history);\n\n // Find the initial active node\n $child = false;\n if ($PAGE->navigation->contains_active_node()) {\n $child = $PAGE->navigation->find_active_node();\n } else if ($PAGE->settingsnav->contains_active_node()) {\n $child = $PAGE->settingsnav->find_active_node();\n }\n // Check that we found an active child node\n if ($child!==false) {\n $properties = array();\n // Check whether this child contains another active child node\n // this can happen if we are looking at a module\n if ($child->contains_active_node()) {\n $titlebits = array();\n // Loop while the child contains active nodes and in each iteration\n // find the next node in the correct direction\n while ($child!==null && $child->contains_active_node()) {\n if (!empty($child->shorttext)) {\n $titlebits[] = $child->shorttext;\n } else {\n $titlebits[] = $child->text;\n }\n foreach ($child->children as $child) {\n if ($child->contains_active_node() || $child->isactive) {\n // We have found the active child or one of its parents\n // so break the foreach so we can proceed in the while\n break;\n }\n }\n }\n if (!empty($child->shorttext)) {\n $titlebits[] = $child->shorttext;\n } else {\n $titlebits[] = $child->text;\n }\n $properties['text'] = join(' - ', $titlebits);\n $properties['shorttext'] = join(' - ', $titlebits);\n } else {\n $properties['text'] = $child->text;\n $properties['shorttext'] = $child->shorttext;\n }\n $properties['action'] = $child->action;\n $properties['key'] = $child->key;\n $properties['type'] = $child->type;\n $properties['icon'] = $child->icon;\n\n // Create a new navigation node object free of the main structure\n // so that it is easily storeable and customised\n $child = new navigation_node($properties);\n\n // Check that this page isn't already in the history array. If it is\n // we will remove it so that it gets added at the top and we dont get\n // duplicate entries\n foreach ($history as $key=>$node) {\n if ($node->key == $child->key && $node->type == $child->type) {\n if ($node->action instanceof moodle_url && $child->action instanceof moodle_url && $node->action->compare($child->action)) {\n unset($history[$key]);\n } else if ($child->action instanceof moodle_url && $child->action->out_omit_querystring() == $node->action) {\n unset($history[$key]);\n } else if ($child->action == $node->action) {\n unset($history[$key]);\n }\n }\n }\n // If there is more than 5 elements in the array remove the first one\n // We want a fifo array\n if (count($history) > 5) {\n array_shift($history);\n }\n $child->nodetype = navigation_node::NODETYPE_LEAF;\n $child->children = array();\n // Add the child to the history array\n array_push($history,$child);\n }\n\n // If we have `more than nothing` in the history display it :D\n if ($historycount > 0) {\n // Add a branch to hold the users history\n $mymoodle = $PAGE->navigation->get('mymoodle', navigation_node::TYPE_CUSTOM);\n $myhistorybranch = $mymoodle->add(get_string('showmyhistorytitle', $this->blockname), null, navigation_node::TYPE_CUSTOM, null, 'myhistory');\n $mymoodle->get($myhistorybranch)->children = array_reverse($history);\n }\n\n // Cache the history (or update the cached history as it is)\n $cache->history = $history;\n\n return true;\n }", "public function actionHistory($id)\n {\n $searchModel = new ModelHistorySearch;\n\n $queryParams= Yii::$app->request->getQueryParams();\n $queryParams['ModelHistorySearch']['user_id'] = $id;\n $dataProvider = $searchModel->search($queryParams);\n\n return $this->render('model-history', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getTabUrl()\n {\n return '';\n }", "function getHistory(){\r\n\t\t// pobranie informacji o poprzedniej erze\r\n\t\t$zapytanie=\"select * from historia_koalicje where nr_ery = (select max(nr_ery) from historia_koalicje) and nazwa='\".$this->getName().\"';\";\r\n\t\t$historia=mysql_query($zapytanie)or Die(\"ups :)\");\r\n\t\tif(mysql_num_rows($historia)>0){\r\n\t\t\t$wiersz_h->dane=mysql_fetch_array($historia);\r\n\t\t\t$wiersz_h->czyJest='ok';\r\n\t\t}else{\r\n\t\t\t$wiersz_h->czyJest=false;\r\n\t\t}\r\n\t\treturn $wiersz_h;\r\n\t}", "public function show($id)\n {\n //\n $game_history = Game_History::find($id);\n if(is_null($game_history)) {\n Session::flash('message','game_history not found');\n return redirect('/game_histories');\n }\n return view('game_history.show')->with([\n 'game_history' => $game_history,\n ]);\n }", "function tab_user_complete($course, $user, $mod, $tab) {\n global $CFG, $DB;\n\n if ($logs = $DB->get_records('log', array('userid' => $user->id, 'module' => 'tab',\n 'action' => 'view', 'info' => $tab->id . ' - ' . $tab->name), 'time ASC')) {\n $numviews = count($logs);\n $lastlog = array_pop($logs);\n\n $strmostrecently = get_string('mostrecently');\n $strnumviews = get_string('numviews', '', $numviews);\n\n echo \"$strnumviews - $strmostrecently \" . userdate($lastlog->time);\n } else {\n print_string('neverseen', 'tab');\n }\n}", "public function getHistory()\n {\n return $this->history;\n }", "public function actionHistory($id)\n\t\t{\n\t\t\t\t$model = $this->findModel($id);\n\n\t\t\t\t$query = new Query();\n\t\t\t\t$orderHistory = new ActiveDataProvider([\n\t\t\t\t\t\t'query' => OrderHistory::find()->where([\n\t\t\t\t\t\t\t\t'order_id' => $model->order_id,\n\t\t\t\t\t\t\t\t// 'attribute' => 'order_status_id'\n\t\t\t\t\t\t]),\n\t\t\t\t\t\t'sort' => [\n\t\t\t\t\t\t\t\t'defaultOrder' => [\n\t\t\t\t\t\t\t\t\t\t// 'attribute' => SORT_ASC,\n\t\t\t\t\t\t\t\t\t\t'create_time' => SORT_ASC\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'pagination' => [\n\t\t\t\t\t\t\t\t'pageSize' => 20,\n\t\t\t\t\t\t],\n\t\t\t\t]);\n\n\t\t\t\treturn $this->render('history', [\n\t\t\t\t\t\t'model' => $model,\n\t\t\t\t\t\t'orderHistory' => $orderHistory,\n\t\t\t\t\t\t'subData' => $this->subData\n\t\t\t\t]);\n\t\t}", "public function getHistory() {\n $rentalModel = new RentalModel($this->db);\n\n try {\n $rentals = $rentalModel->getAll();\n } catch (\\Exception $e) {\n $properties = ['errorMessage' => 'Error getting rental history.'];\n return $this->render('error.twig', $properties);\n }\n\n $properties = [\"rentals\" => $rentals];\n return $this->render('history.twig', $properties);\n }", "public static function history($request, $response)\n {\n $personal = false;\n if ($request->getUri() == \"/dashboard/history\") {\n $history = Requests::getPersonalHistory($_SESSION[\"username\"]);\n $personal = true;\n } else {\n $history = Requests::getAll();\n }\n return $response->render(\n __DIR__ . '/../Views/Dashboard/history.php',\n array(\n 'history' => $history,\n 'personal' => $personal\n )\n );\n }", "private function showPage($records)\n {\n $this->data['histories'] = '';\n $this->data['histories'] = $records;\n\n $this->data['pagebody'] = 'History';\n $this->render();\n }", "public function displayHistory()\n\t\t\t{\n\t\t\t\t$data_arr = array();\n\t\t\t\t$inc = 0;\n\n\t\t\t\twhile($row = $this->fetchResultRecord())\n\t\t\t\t\t{\n\t\t\t\t\t\t$uDetails = $this->isMemberJoined($row['email']);\n\t\t\t\t\t\t$statusClass = '';\n\t\t\t\t\t\t$status = $this->LANG['invitation_history_email_status_not_joined'];\n\t\t\t\t\t\tif ($uDetails)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t$status = $this->LANG['invitation_history_email_status_joined'];\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t$data_arr[$inc]['date_added'] = $row['date_added'];\n\t\t\t\t\t\t$data_arr[$inc]['attempts'] = $row['attempts'];\n\t\t\t\t\t\t$data_arr[$inc]['email'] = $row['email'];\n\t\t\t\t\t\t$data_arr[$inc]['class'] = ($uDetails)?'clsJoined':'clsNotJoined';;\n\t\t\t\t\t\t$data_arr[$inc]['status'] = $status;\n\t\t\t\t\t\t$data_arr[$inc]['remind_url'] = getUrl('invitationhistory', '?action=remind&id='.$row['invitation_id'].'&start='.$this->fields_arr['start'], '?action=remind&id='.$row['invitation_id'].'&start='.$this->fields_arr['start']);\n\t\t\t\t\t\t$data_arr[$inc]['delete_url'] = getUrl('invitationhistory', '?action=delete&id='.$row['invitation_id'].'&start'.$this->fields_arr['start'], '?action=delete&id='.$row['invitation_id'].'&start'.$this->fields_arr['start']);\n\t\t\t\t\t\t$data_arr[$inc]['check_box_value'] = $row['invitation_id'];\n\t\t\t\t\t\t$inc++;\n\t\t\t\t\t}\n\t\t\t\treturn $data_arr;\n\t\t\t}", "public function run()\n {\n // PlayHistory::factory()->count(50)->create();\n }", "public function fetchHistory(): array;", "public static function list_all() {\n // $player = self::get_user_logged_in();\n // $scores = Score::find_by_player($player->id);\n // View::make('player/show.html', array('player' => $player, 'scores' => $scores));\n Redirect::to('/player/' . self::get_user_logged_in()->id);\n }", "public function CleanHistoryInfo()\n\t{\n\t $this->m_RecordId = null;\n $this->m_CurrentPage = 1;\n $this->m_SearchRule = null;\n $this->m_SortRule = null;\n $this->m_NoHistoryInfo = true;\n\t}", "public function testGetViewingHistoryWithNoVideo()\n\t{\n\t\t$this->be(User::first());\n\t\t$response = $this->action('GET', 'ApiViewingHistoryController@getIndex');\n\t\t\n\t\t$this->assertInstanceOf('Illuminate\\Http\\JsonResponse', $response);\n\t\t$this->assertResponseStatus(404);\n\t}", "public function clearHistorys()\n\t{\n\t\t$this->collHistorys = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function loadOnlinePlayers() {\n\t\t$this -> template = TemplateManager::load(\"StyledTable\");\n\t\t$this -> template -> insert(\"title\", \"All Online Players\");\n\t\t$players = $this -> database -> query(\"SELECT * FROM \" . GLOBAL_DB . \".members WHERE online=1 AND lastWorld !=-1\");\n\t\t$table = \"\";\n\t\twhile ($playerData = $players -> fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$user = User::getUser($playerData['UID']);\n\t\t\t$table .= \"<tr class=\\\"online\\\">\n\t\t\t<td class=\\\"name\\\"><span class='username' style=''>\" . $user -> getModule(\"UserTools\") -> getFormatUsername(true) . \"</span></td>\n\t\t\t<td class=\\\"world\\\">World \" . $user -> getLastWorld() . \"</td>\n\t\t\t</tr>\";\n\t\t}\n\t\tif ($table == \"\") {\n\t\t\t$table = \"There are currently no online players.\";\n\t\t}\n\t\t$this -> template ->insert(\"icon\", \"globe\");\n\t\t$this -> template -> insert(\"table\", $table);\n\t\t$this -> display();\n\t}", "public function index()\n {\n //\n $trackers = ProductTracker::where('user_id', auth()->user()->id)->get();\n\n return view('history', compact('trackers'));\n }", "public function history()\n {\n $history = Peminjaman::where('email', Auth::user()->email)->orderBy('created_at', 'desc')->paginate(2);\n $i = ($history->perPage() * $history->currentPage()) - ($history->perPage() - 1);\n return view('peminjaman.history', compact('i', 'history'));\n }", "function simple_history_print_nav() {\n\n\tglobal $wpdb;\n\t$tableprefix = $wpdb->prefix;\n\t\n\t// fetch all types that are in the log\n\tif (isset($_GET[\"simple_history_type_to_show\"])) {\n\t\t$simple_history_type_to_show = $_GET[\"simple_history_type_to_show\"];\n\t} else {\n\t\t$simple_history_type_to_show = \"\";\n\t}\n\n\t// Get all object types and object subtypes\n\t// order by the number of times they occur\n\t$sql = \"SELECT \n\t\t\t\tcount(object_type) AS object_type_count,\n\t\t\t\tobject_type, object_subtype \n\t\t\tFROM {$tableprefix}simple_history \n\t\t\tGROUP BY object_type, object_subtype\n\t\t\tORDER BY object_type_count DESC, object_type, object_subtype\n\t\t\";\n\t$arr_types = $wpdb->get_results($sql);\n\n\t$css = \"\";\n\tif (empty($simple_history_type_to_show)) {\n\t\t$css = \"class='selected'\";\n\t}\n\n\t// Reload-button\n\t$str_reload_button = sprintf('<a class=\"simple-fields-reload\" title=\"%1$s\" href=\"#\"><span>Reload</span></a>', esc_attr__(\"Reload history\", \"simple-history\"));\n\techo $str_reload_button;\n\n\t// Begin select\n\t$str_types_select = \"\";\n\t$str_types_select .= \"<select name='' class='simple-history-filter simple-history-filter-type'>\";\n\n\t$total_object_num_count = 0;\n\tforeach ( $arr_types as $one_type ) {\n\t\t$total_object_num_count += $one_type->object_type_count;\n\t}\n\n\t// First filter is \"all types\"\n\t$link = esc_html(add_query_arg(\"simple_history_type_to_show\", \"\"));\n\t$str_types_desc = __(\"All types\", 'simple-history');\n\n\t$str_types_select .= sprintf('<option data-simple-history-filter-type=\"\" data-simple-history-filter-subtype=\"\" value=\"%1$s\">%2$s (%3$d)</option>', $link, esc_html($str_types_desc), $total_object_num_count );\n\n\t// Loop through all types\n\t// $one_type->object_type = user | post | attachment | comment | plugin | attachment | post | Reply | Topic | Widget | Wordpress_core\n\t// $one_type->object_subtype = page | nav_menu_item | ...\n\t#sf_d($arr_types);\n\tforeach ($arr_types as $one_type) {\n\n\t\t$css = \"\";\n\t\t$option_selected = \"\";\n\t\tif ($one_type->object_subtype && $simple_history_type_to_show == ($one_type->object_type.\"/\".$one_type->object_subtype)) {\n\t\t\t$css = \"class='selected'\";\n\t\t\t$option_selected = \" selected \";\n\t\t} elseif (!$one_type->object_subtype && $simple_history_type_to_show == $one_type->object_type) {\n\t\t\t$css = \"class='selected'\";\n\t\t\t$option_selected = \" selected \";\n\t\t}\n\n\t\t// Create link to filter this type + subtype\n\t\t$arg = \"\";\n\t\tif ($one_type->object_subtype) {\n\t\t\t$arg = $one_type->object_type.\"/\".$one_type->object_subtype;\n\t\t} else {\n\t\t\t$arg = $one_type->object_type;\n\t\t}\n\t\t$link = esc_html(add_query_arg(\"simple_history_type_to_show\", $arg));\n\n\t\t// Begin option\n\t\t$str_types_select .= sprintf(\n\t\t\t'<option %1$s data-simple-history-filter-type=\"%2$s\" data-simple-history-filter-subtype=\"%3$s\" value=\"%4$s\">',\n\t\t\t$option_selected, // 1\n\t\t\t$one_type->object_type, // 2\n\t\t\t$one_type->object_subtype, // 3\n\t\t\t$link // 4\n\t\t);\n\t\t\n\t\t// Some built in types we translate with built in translation, the others we use simple history for\n\t\t// TODO: use WP-function to get all built in types?\n\t\t$object_type_translated = \"\";\n\t\t$object_subtype_translated = \"\";\n\n\t\t// Get built in post types\n\t\t$arr_built_in_post_types = get_post_types( array(\"_builtin\" => true) );\n\n\t\t$object_type_translated = \"\";\n\t\t$object_subtype_translated = \"\";\n\n\t\t// For built in types\n\t\tif ( in_array( $one_type->object_type, $arr_built_in_post_types ) ) {\n\t\t\t\n\t\t\t// Get name of main type\n\t\t\t$object_post_type_object = get_post_type_object( $one_type->object_type );\n\t\t\t$object_type_translated = $object_post_type_object->labels->name;\n\t\t\t\n\t\t\t// Get name of subtype\n\t\t\t$object_subtype_post_type_object = get_post_type_object( $one_type->object_subtype );\n\t\t\tif ( ! is_null( $object_subtype_post_type_object ) ) {\n\t\t\t\t$object_subtype_translated = $object_subtype_post_type_object->labels->name;;\n\t\t\t}\n\n\t\t}\n\t\t\n\t\tif ( empty( $object_type_translated ) ) {\n\t\t\t$object_type_translated = ucfirst( esc_html__( $one_type->object_type, \"simple-history\") );\n\t\t}\n\n\t\tif ( empty( $object_subtype_translated ) ) {\n\t\t\t$object_subtype_translated = ucfirst( esc_html__( $one_type->object_subtype, \"simple-history\") );\n\t\t}\n\t\t\n\t\t// Add name of type (post / attachment / user / etc.)\n\t\t\n\t\t// built in types use only subtype\n\t\tif ( in_array( $one_type->object_type, $arr_built_in_post_types ) && ! empty($object_subtype_translated) ) {\n\n\t\t\t$str_types_select .= $object_subtype_translated;\n\n\t\t} else {\n\t\t\t\n\t\t\t$str_types_select .= $object_type_translated;\n\n\t\t\t// And subtype, if different from main type\n\t\t\tif ($object_subtype_translated && $object_subtype_translated != $object_type_translated) {\n\t\t\t\t$str_types_select .= \"/\" . $object_subtype_translated;\n\t\t\t}\n\n\t\t}\n\t\t// Add object count\n\t\t$str_types_select .= sprintf(' (%d)', $one_type->object_type_count);\n\t\t\n\t\t// Close option\n\t\t$str_types_select .= \"\\n</option>\";\n\t\t\n\t\t// debug\n\t\t#$str_types .= \" type: \" . $one_type->object_type;\n\t\t#$str_types .= \" type: \" . ucfirst($one_type->object_type);\n\t\t#$str_types .= \" subtype: \" . $one_type->object_subtype. \" \";\n\t\t\n\t} // foreach arr types\n\n\t$str_types_select .= \"\\n</select>\";\n\n\t// Output filters\n\tif ( ! empty( $arr_types ) ) {\n\t\t// echo $str_types;\n\t\techo $str_types_select;\n\t}\n\n\t// fetch all users that are in the log\n\t$sql = \"SELECT DISTINCT user_id FROM {$tableprefix}simple_history WHERE user_id <> 0\";\n\t$arr_users_regular = $wpdb->get_results($sql);\n\tforeach ($arr_users_regular as $one_user) {\n\t\t$arr_users[$one_user->user_id] = array(\"user_id\" => $one_user->user_id);\n\t}\n\t\n\tif ( ! empty( $arr_users ) ) {\n\t\n\t\tforeach ($arr_users as $user_id => $one_user) {\n\t\t\t$user = get_user_by(\"id\", $user_id);\n\t\t\tif ($user) {\n\t\t\t\t$arr_users[$user_id][\"user_login\"] = $user->user_login;\n\t\t\t\t$arr_users[$user_id][\"user_nicename\"] = $user->user_nicename;\n\t\t\t\tif (isset($user->first_name)) {\n\t\t\t\t\t$arr_users[$user_id][\"first_name\"] = $user->first_name;\n\t\t\t\t}\n\t\t\t\tif (isset($user->last_name)) {\n\t\t\t\t\t$arr_users[$user_id][\"last_name\"] = $user->last_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif (isset($arr_users) && $arr_users) {\n\n\t\tif (isset($_GET[\"simple_history_user_to_show\"])) {\n\t\t\t$simple_history_user_to_show = $_GET[\"simple_history_user_to_show\"];\n\t\t} else {\n\t\t\t$simple_history_user_to_show = \"\";\n\t\t}\n\n\t\t$str_users_select = \"\";\n\t\t$str_users_select .= \"<select name='' class='simple-history-filter simple-history-filter-user'>\";\n\n\t\t$css = \"\";\n\t\t$option_selected = \"\";\n\t\tif (empty($simple_history_user_to_show)) {\n\t\t\t$css = \" class='selected' \";\n\t\t\t$option_selected = \" selected \";\n\t\t}\n\n\t\t// All users\n\t\t$link = esc_html(add_query_arg(\"simple_history_user_to_show\", \"\"));\n\n\t\t$str_users_select .= sprintf(\n\t\t\t\t'<option data-simple-history-filter-user-id=\"%4$s\" value=\"%3$s\" %2$s>%1s</option>', \n\t\t\t\t__(\"By all users\", 'simple-history'), // 1\n\t\t\t\t$option_selected, // 2\n\t\t\t\t$link, // 3\n\t\t\t\t\"\" // 4\n\t\t\t);\n\n\t\tforeach ($arr_users as $user_id => $user_info) {\n\n\t\t\t$user = new WP_User($user_id);\n\t\t\tif ( ! $user->exists() ) continue;\n\n\t\t\t$link = esc_html(add_query_arg(\"simple_history_user_to_show\", $user_id));\n\t\t\t\n\t\t\t$css = \"\";\n\t\t\t$option_selected = \"\";\n\n\t\t\tif ($user_id == $simple_history_user_to_show) {\n\t\t\t\t$css = \" class='selected' \";\n\t\t\t\t$option_selected = \" selected \";\n\t\t\t}\n\n\t\t\t// all users must have username and email\n\t\t\t$str_user_name = sprintf('%1$s (%2$s)', esc_attr($user->user_login), esc_attr($user->user_email));\n\t\t\t// if ( ! empty( $user_info[\"first_name\"] ) $user_info[\"last_name\"] );\n\t\t\t\n\t\t\t$str_users_select .= sprintf(\n\t\t\t\t'<option data-simple-history-filter-user-id=\"%4$s\" %2$s value=\"%1$s\">%1$s</option>',\n\t\t\t\t$str_user_name, // 1\n\t\t\t\t$option_selected, // 2\n\t\t\t\t$link, // 3\n\t\t\t\t$user_id\n\t\t\t);\n\n\t\t}\n\n\t\t$str_users_select .= \"</select>\";\n\n\t\tif ( ! empty($str_users_select) ) {\n\t\t\techo $str_users_select;\n\t\t}\n\n\t}\n\t\n\t// search\n\t$str_search = __(\"Search\", 'simple-history');\n\t$search = \"<p class='simple-history-filter simple-history-filter-search'>\n\t\t<input type='text' />\n\t\t<input type='button' value='$str_search' class='button' />\n\t</p>\";\n\techo $search;\n\t\n}", "public function getHistory()\n {\n return $this->_history;\n }", "public function hasIsHistory()\n {\n return $this->is_history !== null;\n }", "public function actionIndex()\n {\n $depositId = \\Yii::$app->request->get('depositId');\n\n $searchModel = new DepositsHistorySearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $depositId);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'depositId' => $depositId\n ]);\n }", "public function userHistory() {\n\t\t[ $response, $error ] = $this->api('user/history');\n\n\t\tif($error) return $this->response($response, $error);\n\n\t\treturn $this->response($response['links']);\n\t}", "function freshTrackback ()\n{\n global $_CONF, $LANG_TRB;\n\n $retval = '';\n\n $freshurl = $_CONF['site_admin_url'] . '/trackback.php?mode=fresh';\n\n $retval .= COM_startBlock($LANG_TRB['trackback'], getHelpUrl(),\n COM_getBlockTemplate('_admin_block', 'header'));\n $retval .= sprintf ($LANG_TRB['trackback_note'], $freshurl);\n $retval .= COM_endBlock();\n\n return $retval;\n}", "function history()\n {\n $data['tbl_history'] = $this->Tbl_history_model->get_tbl_history();\n \n if(isset($data['tbl_history']['id_history']))\n {\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n 'history_desc_id' => $this->input->post('history_desc_id'),\n 'history_desc_en' => $this->input->post('history_desc_en'),\n );\n\n $this->Tbl_history_model->update_tbl_history($params); \n redirect('admin/history');\n }\n else\n {\n $data = array(\n \"site\" => $_SERVER['SERVER_NAME'],\n \"page\" => \"History\",\n \"tbl_history\" => $this->Tbl_history_model->get_tbl_history()\n );\n $this->load->view('layout/admin/header', $data);\n $this->load->view('edit_history',$data);\n $this->load->view('layout/admin/footer');\n }\n }\n else\n show_error('The tbl_home you are trying to edit does not exist.');\n }", "public function getHistory(): array\n {\n return $this->history;\n }", "public function getHistory(): array\n {\n return $this->history;\n }", "function index() {\n\n $this->data['pagebody'] = 'playersView'; \n // this is the view we want shown\n // build the list of players, to pass on to our view\n $source = $this->players->all();\n\n //get value of session->userdata('editMode')\n $session_editMode = $this->session->editMode;\n //if emtpy, hide edit button in playersView\n if(empty($session_editMode)) {\n $this->data['editEnabled'] = \"none\";\n $this->data['hide'] = \"true\";\n } else {\n $this->data['editEnabled'] = \"true\";\n $this->data['hide'] = \"none\";\n }\n\n $players = array();\n foreach ($source as $record) {\n $players[] = array(\n 'who' => $record->lastname . \", \" . $record->firstname, \n 'mug' => $record->mug, \n 'id' => $record->id, \n 'position' => $record->position, \n 'number' => $record->number\n );\n }\n $this->data['players'] = $players;\n\n $this->render();\n }", "public function index()\n {\n GameMove::truncate();\n request()->session()->forget(['gameStatus', 'card']);\n request()->session()->put(['gameStatus' => false]);\n return view('game.home', $this->homeData()); \n }", "public function initHistorys()\n\t{\n\t\t$this->collHistorys = array();\n\t}", "public function index()\n\t{\n $this->leaderBoard->calculate();\n $this->shareToView('entries', $this->leaderBoard->getEntries());\n\n $this->setTitle('Ranking');\n\n return $this->makeView('pages.game.player.index');\n\t}", "public function isSaveToHistoryEnabled(): bool\n\t{\n\t\treturn false;\n\t}", "public function index(Request $request)\n {\n $user = $request->user();\n\t\t\n\t\tif ($user){\n\t\t\t#$game_histories=$user->game_histories()->get();\n\t\t\t$game_histories = Game_History::where('user_id', '=', $user->id)->orderBy('id','DESC')->get();\n\t\t}\n\t\telse{\n\t\t\t$game_histories=[];\n\t\t}\n\t\t\n\t\treturn view('game_history.index')->with([\n\t\t\t'game_histories'=> $game_histories\n\n\t\t]);\n }", "public function getHistoryAdmin() {\r\n if (Session::has('adminSession')) {\r\n $objadmin = Session::get('adminSession');\r\n //var_dump($objadmin);\r\n $id = $objadmin[0]->id;\r\n //echo $id;\r\n $tblAdminModel = new tblAdminModel();\r\n $data = $tblAdminModel->selectHistoryAdmin($id, 5);\r\n //echo $data[0]->historyContent;\r\n //var_dump($data);\r\n $link = $data->links();\r\n return View::make('backend.admin.adminHistory')->with('arrHistory', $data)->with('link', $link);\r\n } else {\r\n return View::make('fontend.404')->with('thongbao', 'Ko co lich su');\r\n }\r\n }", "static function showHistory($ID_port) {\n global $DB,$LANG,$INFOFORM_PAGES,$CFG_GLPI;\n\n include (GLPI_ROOT . \"/plugins/fusioninventory/inc_constants/snmp.mapping.constant.php\");\n\n $CommonItem = new CommonItem;\n $np = new Netport;\n\n $query = \"\n SELECT * FROM(\n SELECT * FROM (\n SELECT ID, date as date, process_number as process_number,\n FK_port_source, FK_port_destination,\n creation as Field, NULL as old_value, NULL as new_value\n\n FROM glpi_plugin_fusioninventory_snmphistoryconnections\n WHERE `FK_port_source`='\".$ID_port.\"'\n OR `FK_port_destination`='\".$ID_port.\"'\n ORDER BY date DESC\n LIMIT 0,30\n )\n AS DerivedTable1\n UNION ALL\n SELECT * FROM (\n SELECT ID, date_mod as date, FK_process as process_number,\n FK_ports AS FK_port_source, NULL as FK_port_destination,\n Field, old_value, new_value\n\n FROM glpi_plugin_fusioninventory_snmphistories\n WHERE `FK_ports`='\".$ID_port.\"'\n ORDER BY date DESC\n LIMIT 0,30\n )\n AS DerivedTable2)\n AS MainTable\n ORDER BY date DESC, ID DESC\n LIMIT 0,30\";\n //echo $query.\"<br/>\";\n $text = \"<table class='tab_cadre' cellpadding='5' width='950'>\";\n\n $text .= \"<tr class='tab_bg_1'>\";\n $text .= \"<th colspan='8'>\";\n $text .= \"Historique\";\n $text .= \"</th>\";\n $text .= \"</tr>\";\n\n $text .= \"<tr class='tab_bg_1'>\";\n $text .= \"<th>\".$LANG['plugin_fusioninventory'][\"snmp\"][50].\"</th>\";\n $text .= \"<th>\".$LANG[\"common\"][1].\"</th>\";\n $text .= \"<th>\".$LANG[\"event\"][18].\"</th>\";\n $text .= \"<th></th>\";\n $text .= \"<th></th>\";\n $text .= \"<th></th>\";\n $text .= \"<th>\".$LANG[\"common\"][27].\"</th>\";\n $text .= \"</tr>\";\n\n if ($result=$DB->query($query)) {\n while ($data=$DB->fetch_array($result)) {\n $text .= \"<tr class='tab_bg_1'>\";\n if (!empty($data[\"FK_port_destination\"])) {\n // Connections and disconnections\n if ($data['Field'] == '1') {\n $text .= \"<td align='center'><img src='\".GLPI_ROOT.\"/plugins/fusioninventory/pics/connection_ok.png'/></td>\";\n } else {\n $text .= \"<td align='center'><img src='\".GLPI_ROOT.\"/plugins/fusioninventory/pics/connection_notok.png'/></td>\";\n }\n if ($ID_port == $data[\"FK_port_source\"]) {\n $np->getFromDB($data[\"FK_port_destination\"]);\n if (isset($np->fields[\"on_device\"])) {\n $CommonItem->getFromDB($np->fields[\"device_type\"],\n $np->fields[\"on_device\"]);\n $link1 = $CommonItem->getLink(1);\n $link = \"<a href=\\\"\" . $CFG_GLPI[\"root_doc\"] . \"/front/networking.port.php?ID=\" . $np->fields[\"ID\"] . \"\\\">\";\n if (rtrim($np->fields[\"name\"]) != \"\")\n $link .= $np->fields[\"name\"];\n else\n $link .= $LANG['common'][0];\n $link .= \"</a>\";\n $text .= \"<td align='center'>\".$link.\" \".$LANG['networking'][25].\" \".$link1.\"</td>\";\n } else {\n $text .= \"<td align='center'><font color='#ff0000'>\".$LANG['common'][28].\"</font></td>\";\n }\n\n } else if ($ID_port == $data[\"FK_port_destination\"]) {\n $np->getFromDB($data[\"FK_port_source\"]);\n if (isset($np->fields[\"on_device\"])) {\n $CommonItem->getFromDB($np->fields[\"device_type\"],\n $np->fields[\"on_device\"]);\n $link1 = $CommonItem->getLink(1);\n $link = \"<a href=\\\"\" . $CFG_GLPI[\"root_doc\"] . \"/front/networking.port.php?ID=\" . $np->fields[\"ID\"] . \"\\\">\";\n if (rtrim($np->fields[\"name\"]) != \"\")\n $link .= $np->fields[\"name\"];\n else\n $link .= $LANG['common'][0];\n $link .= \"</a>\";\n $text .= \"<td align='center'>\".$link.\" \".$LANG['networking'][25].\" \".$link1.\"</td>\";\n } else {\n $text .= \"<td align='center'><font color='#ff0000'>\".$LANG['common'][28].\"</font></td>\";\n }\n }\n $text .= \"<td align='center' colspan='4'></td>\";\n $text .= \"<td align='center'>\".convDateTime($data[\"date\"]).\"</td>\";\n\n } else {\n // Changes values\n $text .= \"<td align='center' colspan='2'></td>\";\n $text .= \"<td align='center'>\".$FUSIONINVENTORY_MAPPING[NETWORKING_TYPE][$data[\"Field\"]]['name'].\"</td>\";\n $text .= \"<td align='center'>\".$data[\"old_value\"].\"</td>\";\n $text .= \"<td align='center'>-></td>\";\n $text .= \"<td align='center'>\".$data[\"new_value\"].\"</td>\";\n $text .= \"<td align='center'>\".convDateTime($data[\"date\"]).\"</td>\";\n }\n $text .= \"</tr>\";\n }\n }\n\n /*\n $pthc = new PluginFusioninventorySnmphistoryconnection;\n\n $data_connections = $pthc->find('`FK_port_source`=\"'.$ID_port.'\"\n OR `FK_port_destination `=\"'.$ID_port.'\"',\n '`date` DESC',\n '0,30');\n $query = \"SELECT *\n FROM `glpi_plugin_fusioninventory_snmphistories`\n WHERE `FK_ports`='\".$ID_port.\"'\n ORDER BY `date_mod` DESC\n LIMIT 0,30;\";\n\n\n $text = \"<table class='tab_cadre' cellpadding='5' width='950'>\";\n\n $text .= \"<tr class='tab_bg_1'>\";\n $text .= \"<th colspan='8'>\";\n $text .= \"Historique\";\n $text .= \"</th>\";\n $text .= \"</tr>\";\n\n $text .= \"<tr class='tab_bg_1'>\";\n $text .= \"<th>\".$LANG['plugin_fusioninventory'][\"snmp\"][50].\"</th>\";\n $text .= \"<th>\".$LANG[\"common\"][1].\"</th>\";\n $text .= \"<th>\".$LANG[\"networking\"][15].\"</th>\";\n $text .= \"<th>\".$LANG[\"event\"][18].\"</th>\";\n $text .= \"<th></th>\";\n $text .= \"<th></th>\";\n $text .= \"<th></th>\";\n $text .= \"<th>\".$LANG[\"common\"][27].\"</th>\";\n $text .= \"</tr>\";\n\n if ($result=$DB->query($query)) {\n while ($data=$DB->fetch_array($result)) {\n $text .= \"<tr class='tab_bg_1'>\";\n\n if (($data[\"old_device_ID\"] != \"0\") OR ($data[\"new_device_ID\"] != \"0\")) {\n // Connections and disconnections\n if ($data[\"old_device_ID\"] != \"0\") {\n $text .= \"<td align='center'>\".$LANG['plugin_fusioninventory'][\"history\"][2].\"</td>\";\n $CommonItem->getFromDB($data[\"old_device_type\"],$data[\"old_device_ID\"]);\n $text .= \"<td align='center'>\".$CommonItem->getLink(1).\"</td>\";\n $text .= \"<td align='center'>\".$data[\"old_value\"].\"</td>\";\n } else if ($data[\"new_device_ID\"] != \"0\") {\n $text .= \"<td align='center'>\".$LANG['plugin_fusioninventory'][\"history\"][3].\"</td>\";\n $CommonItem->getFromDB($data[\"new_device_type\"],$data[\"new_device_ID\"]);\n $text .= \"<td align='center'>\".$CommonItem->getLink(1).\"</td>\";\n $text .= \"<td align='center'>\".$data[\"new_value\"].\"</td>\";\n }\n $text .= \"<td align='center' colspan='4'></td>\";\n $text .= \"<td align='center'>\".convDateTime($data[\"date_mod\"]).\"</td>\";\n\n } else if (($data[\"old_device_ID\"] == \"0\") AND ($data[\"new_device_ID\"] == \"0\") AND ($data[\"Field\"] == \"0\")) {\n // Unknown Mac address\n if (!empty($data[\"old_value\"])) {\n $text .= \"<td align='center' background='#cf9b9b' class='tab_bg_1_2'>\".$LANG['plugin_fusioninventory'][\"history\"][2].\"</td>\";\n $CommonItem->getFromDB($data[\"old_device_type\"],$data[\"old_device_ID\"]);\n $text .= \"<td align='center' background='#cf9b9b' class='tab_bg_1_2'>\".$CommonItem->getLink(1).\"</td>\";\n $text .= \"<td align='center' background='#cf9b9b' class='tab_bg_1_2'>\".$data[\"old_value\"].\"</td>\";\n } else if (!empty($data[\"new_value\"])) {\n $text .= \"<td align='center' background='#cf9b9b' class='tab_bg_1_2'>\".$LANG['plugin_fusioninventory'][\"history\"][3].\"</td>\";\n $CommonItem->getFromDB($data[\"new_device_type\"],$data[\"new_device_ID\"]);\n $text .= \"<td align='center' background='#cf9b9b' class='tab_bg_1_2'>\".$CommonItem->getLink(1).\"</td>\";\n $text .= \"<td align='center' background='#cf9b9b' class='tab_bg_1_2'>\".$data[\"new_value\"].\"</td>\";\n }\n $text .= \"<td align='center' colspan='4' background='#cf9b9b' class='tab_bg_1_2'></td>\";\n $text .= \"<td align='center' background='#cf9b9b' class='tab_bg_1_2'>\".convDateTime($data[\"date_mod\"]).\"</td>\";\n } else {\n // Changes values\n $text .= \"<td align='center' colspan='3'></td>\";\n $text .= \"<td align='center'>\".$data[\"Field\"].\"</td>\";\n $text .= \"<td align='center'>\".$data[\"old_value\"].\"</td>\";\n $text .= \"<td align='center'>-></td>\";\n $text .= \"<td align='center'>\".$data[\"new_value\"].\"</td>\";\n $text .= \"<td align='center'>\".convDateTime($data[\"date_mod\"]).\"</td>\";\n }\n $text .= \"</tr>\";\n }\n }\n */\n $text .= \"<tr class='tab_bg_1'>\";\n $text .= \"<th colspan='8'>\";\n $text .= \"<a href='\".GLPI_ROOT.\"/plugins/fusioninventory/report/switch_ports.history.php?FK_networking_ports=\".$ID_port.\"'>Voir l'historique complet</a>\";\n $text .= \"</th>\";\n $text .= \"</tr>\";\n $text .= \"</table>\";\n return $text;\n }", "public function index()\n {\n $playing = Auth::user()->playing()->get();\n\n return view('home', ['games'=>$playing]);\n }", "public function reset()\n {\n $this->values[self::_ITEM_HISTORYS] = array();\n }" ]
[ "0.6408036", "0.6069419", "0.60689676", "0.5875461", "0.5874139", "0.58455443", "0.5839395", "0.57793045", "0.57733744", "0.56542176", "0.55410653", "0.5536791", "0.5501055", "0.5496866", "0.54904383", "0.54837185", "0.547689", "0.5470668", "0.54363006", "0.54257387", "0.54103965", "0.5397389", "0.5358689", "0.5357685", "0.5350309", "0.53491884", "0.5348489", "0.5329962", "0.5313895", "0.53044933", "0.530061", "0.5271207", "0.5265908", "0.52511317", "0.52454174", "0.5237582", "0.5237053", "0.5236225", "0.5232067", "0.5227353", "0.5226344", "0.52196795", "0.5219645", "0.5205865", "0.5202515", "0.5184235", "0.5182833", "0.5182596", "0.5177282", "0.51736635", "0.51684666", "0.5160305", "0.5142024", "0.51376104", "0.5136403", "0.5131589", "0.50924087", "0.50691766", "0.5066897", "0.5060518", "0.5058054", "0.5054747", "0.5053516", "0.50509924", "0.5042375", "0.50354576", "0.50195795", "0.49983394", "0.49972147", "0.49969527", "0.4986989", "0.49850142", "0.49818882", "0.49807593", "0.49691", "0.496127", "0.49591443", "0.49580958", "0.49530128", "0.49457967", "0.49247918", "0.4924272", "0.49192822", "0.49072564", "0.49064717", "0.48950705", "0.4893774", "0.48890492", "0.48697782", "0.48692566", "0.48692566", "0.48685312", "0.4866211", "0.48585233", "0.4849137", "0.48433894", "0.48368895", "0.483619", "0.48330998", "0.48273456", "0.48270145" ]
0.0
-1
dumps messages to the screen if debugging on
public function debug($message) { if($this->isDebug()) { echo microtime(true) . ": "; var_dump($message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function debug($message) {\n if ($this->debug) echo $message . \"\\n\";\n if ($this->htmldebug) {\n echo \"<br />\\n\";\n ob_flush();\n }\n }", "private function debug($msg = '')\n\t{\n\t\t$this->debugger .= $msg.\"<br/>\\n\";\t\n\t}", "private function debug($msg) {\r\n if ($this->debug) {\r\n echo '[debug] ' . $msg . '<br>';\r\n }\r\n }", "function _debug() {\n $nl = \"\\n\";\n $header = implode($nl, $this->__header);\n $message = implode($nl, $this->__message);\n $fm = $nl;\n\n if ($this->delivery == 'smtp') {\n $fm .= sprintf('%s %s%s', 'Host:', $this->smtpOptions['host'], $nl);\n $fm .= sprintf('%s %s%s', 'Port:', $this->smtpOptions['port'], $nl);\n $fm .= sprintf('%s %s%s', 'Timeout:', $this->smtpOptions['timeout'], $nl);\n }\n $fm .= sprintf('%s %s%s', 'To:', $this->to, $nl);\n $fm .= sprintf('%s %s%s', 'From:', $this->from, $nl);\n $fm .= sprintf('%s %s%s', 'Subject:', $this->_encode($this->subject), $nl);\n $fm .= sprintf('%s%3$s%3$s%s', 'Header:', $header, $nl);\n $fm .= sprintf('%s%3$s%3$s%s', 'Parameters:', $this->additionalParams, $nl);\n $fm .= sprintf('%s%3$s%3$s%s', 'Message:', $message, $nl);\n $fm .= $nl;\n\n $this->log($fm);\n return true;\n }", "protected function debug() { \n if ($this->SHOW_ERRORS) { \n echo $this->ERROR_MSG; \n } \n if ($this->LOGGING) { \n if ($this->FILE_HANDLER) { \n fwrite($this->FILE_HANDLER,$this->ERROR_MSG); \n } else { \n return false; \n } \n } \n }", "public function debug();", "public function debug();", "function print_debugger()\n\t{\n\t\t$output = str_replace(\"\\n\", \"<br/>\\n\", $this->debugger);\n\t\techo $output;\t\n\t}", "function out($msg) {\n if(BULLET_ENV === 'development') {\n echo $msg . \"\\n\";\n }\n}", "private static function debugging($message) {\r\n $debugdisplay = ini_get('display_errors');\r\n\r\n if (($debugdisplay == '1' || strtolower($debugdisplay) == 'on') && (error_reporting() >= E_ALL | E_STRICT)) {\r\n if (defined('CLI_SCRIPT') && CLI_SCRIPT) {\r\n echo \"++ $message ++\\n\";\r\n } else {\r\n echo '<div class=\"notifytiny debuggingmessage\" data-rel=\"debugging\">' , $message , '</div>';\r\n }\r\n }\r\n }", "function debug($message);", "protected function send_debug_email()\n {\n }", "function emDebug() {\n if ($this->getSystemSetting('enable-system-debug-logging') || ( !empty($_GET['pid']) && $this->getProjectSetting('enable-project-debug-logging'))) {\n $emLogger = \\ExternalModules\\ExternalModules::getModuleInstance('em_logger');\n $emLogger->emLog($this->PREFIX, func_get_args(), \"DEBUG\");\n }\n }", "static private function debug($message) {\n if (self::getConfig('debug')) {\n print_r($message);\n print_r(PHP_EOL);\n }\n }", "function debug($message = \"\")\r\n {\r\n \tif ($this->_debug) {\r\n \t\techo $message;\r\n \t}\r\n \t\r\n \treturn TRUE;\r\n }", "function debug($msg) {\n echo '<p><b>' . $msg . \"</b></p>\\n\";\n}", "public function debug($message) {\n\t\tif ($this->debug)\n\t\t\techo \"cobweb: DEBUG {$message}\\n\";\n\t}", "function debug($message) {\n $_SESSION[\"debug\"][] = $message;\n }", "function debugOn()\n\t{\n\t\t$this->bDebug = true;\n\t}", "public function debug()\n {\n \t// Observer responses\n \t$responses = array();\n \t \n \t// Interate the observers and fire their handle() method\n \tforeach($this->observers as $observer){\n \t\t$responses[get_class($observer)] = $observer->handle($this->breakpoints);\n \t}\n \t\n \t// Generate the notification email content\n \t$viewData = array('responses' => $responses);\n \t$message = $this->CI->load->view('Notification', $viewData, true);\n \t \n \t// Prepare the to addresses\n \t$to = implode(',', $this->config['emailTo']);\n \t\n \t// Set the message subject\n \t$subject = '[' . $this->CI->config->item('base_url') . '] Debug Notification';\n \t\n \t// Prepare mail headers\n \t$headers = array(\n \t\t'From: ' . $this->config['emailFrom'],\n \t\t'Content-Type:text/html; charset=utf-8'\n \t);\n \t\n \t// Send the message\n \tmail($to, $subject, $message, implode(PHP_EOL, $headers));\n }", "public function enableDebug() {}", "function debugMsg($msg)\n {\n echo \"DEBUG MESSAGE: {$msg}<br>\\n\";\n }", "function debugMP($type,$hdr,$msg='') {\n\t\t\tif (($type === 'msg') && ($msg!=='')) {\n\t\t\t\t$msg = esc_html($msg);\n\t\t\t}\n\t\t\tif (($hdr!=='')) {\n\t\t\t\t$hdr = 'UI: ' . $hdr;\n\t\t\t}\n\t\t\t$this->addon->debugMP($type,$hdr,$msg,NULL,NULL,true);\n\t\t}", "function debug() {\n if (!APP_IN_DEVELOPER_MODE)\n return;\n $args = func_get_args();\n ob_start();\n if (count($args) > 1) {\n echo var_dump($args);\n } else if (count($args) == 1) {\n echo var_dump(reset($args));\n }\n $message = ob_get_contents();\n ob_end_clean();\n trigger_error(\"debug() triggered with the following data:\\n\\n$message\", \\E_USER_WARNING);\n}", "function Debug($debug, $msg = \"Debugging\"){\n\tif(ENV == PRODUCTION && (!isset($_GET['debug'])) ){\n\t\treturn;\n\t}\n\n\techo '<pre class=\"debug\">';\n\techo '<h2>'.$msg.'</h2>';\n\tprint_r($debug);\n\techo '</pre>';\n}", "function Trace($msg)\r\n{\r\n\tglobal $debug;\r\n\tif ($debug) echo $msg;\r\n}", "public function enableDebug();", "function _debug($message) {\n if ($debug = TRUE) {\n _log($message);\n } \n}", "protected function debugPrint($msg)\n {\n if ($this->debug) {\n echo \"<pre>{$msg}</pre>\\n\";\n }\n }", "public function debug($message) {}", "function print_persistent_capture()\n\t{\n\t\t/*if ( !is_user_logged_in() || !current_user_can('administrator') )\n\t\t\treturn;*/\n\n\t\t$set = self::is_debug_set();\n\t\t$sep = '<span class=\"sep\">|</span>';\n\n\t\t?>\n\t\t<div id=\"dev_debug_persistent\" class=\"dev_debug <?php echo $set ? 'set' : ''; ?>\">\n\t\t\t<?php\n\n\t\t\techo '<span class=\"title\">DEBUG</span> ';\n\n\t\t\tif ( $set )\n\t\t\t{\n\t\t\t\textract( get_transient('dev_debug') );\n\n\t\t\t\t$output = $this->analyze( $data, array( 'echo' => 0, 'backtrace' => $backtrace ) ); // return\n\n\t\t\t\t$meta = date( '@ g:i:s a', $time );\n\n\t\t\t\t$title = $title ? \"$meta $sep $title\" : $meta;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$title = sprintf('<em class=\"disabled\"> %s </em>',\n\t\t\t\t\t!empty( $_GET['cdt'] ) ? 'cleared' : 'not set'\n\t\t\t\t);\n\t\t\t\t$output = '';\n\t\t\t}\n\n\t\t\techo \"<span class='meta'>$title</span> <span class='output'>$output</span>\";\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}", "protected function debug($sql){\n\t\tif($this->debug){\n\t\t\tFlash::notice($sql);\n\t\t}\t\n\t}", "private function setDebugger()\n {\n $this->client\n ->getEmitter()\n ->attach(new LogSubscriber($this->debugLogger, Formatter::DEBUG));\n }", "public function dprint()\n\t{\n\t\tprint_r( $this->debug );\n\t}", "public function debug( $msg )\n {\n if ( DEBUG )\n {\n echo $msg;\n }\n }", "public static function debug($message){\n\t\tif(Functions::$runmode == Functions::$RUNMODE_DEBUG){\n\t\t\techo 'DEBUG: '.$message.\"\\n\";\n\t\t}\n\t}", "function testDebugDoNotShow() {\n Debug::$enable_show = false;\n ob_start();\n Debug::out('Testing, testing, 123');\n $output = ob_get_clean();\n $this->assertEqual('', $output);\n }", "public static function debug()\n {\n foreach (func_get_args() as $message) {\n if (is_null($message))\n $message = 'NULL';\n if (!is_string($message))\n $message = print_r($message, true);\n static::_log(self::DEBUG, $message);\n }\n }", "function debug_msg($mesg)\r\r\n{\r\r\n\tdebug_open_window();\r\r\n\tprint \"<script language='JavaScript'>\\n\";\r\r\n\tprint \"debugWindow.document.writeln('<span style=\\'font-family: Arial, Helvetica, sans-serif; font-size: 10px; line-height: 11px;\\'>\" . trim(nl2br($mesg)) . \"</span><br>');\\n\";\r\r\n\tprint \"debugWindow.scrollBy(0,10000);\";\r\r\n\tprint \"self.focus();\\n\";\r\r\n\tprint \"</script>\\n\";\r\r\n}", "public static function debug($message)\n {\n if (!self::$output) {\n return;\n }\n self::$output->debug($message);\n }", "public function debug()\n {\n add_settings_field(\n 'debug',\n apply_filters($this->plugin_name . 'label-debug', esc_html__('Debug', $this->plugin_name)),\n [$this->builder, 'checkbox'],\n $this->plugin_name,\n $this->plugin_name . '-library',\n [\n 'description' => 'Enable debug at the bottom of your security.txt file & this page.',\n 'id' => 'debug',\n 'class' => 'hide-when-disabled',\n 'value' => isset($this->options['debug']) ? $this->options['debug'] : false,\n ]\n );\n }", "protected function dumpPage() {\n\t\tif ($this->_debugCatcher !== null) {\n\t\t\t$this->_debugCatcher->flush();\n\t\t}\n\n\t\t$this->_dumped = true;\n\t\tparent::dumpPage();\n\t}", "protected function debug($string){\n \t$this->_msg($string, Messages::DEBUG);\n }", "public function enableDebugMode() {}", "private function _writeToScreen($message) {\n echo $message . PHP_EOL;\n }", "function testDebugEmail() {\n Debug::$enable_show = false;\n Debug::$enable_send = true;\n Debug::out('Testing, testing, 123');\n $this->assertTrue(Debug::sendEmail());\n Debug::$enable_send = false;\n }", "function dbgmsg( $dbgtxt=\"Debug\" )\n{\n echo \"$dbgtxt\\n\";\n flush();\n}", "function debugMP($type,$hdr,$msg='') {\n\t\tglobal $slplus_plugin;\n\t\tif (!is_object($slplus_plugin)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (($type === 'msg') && ($msg!=='')) {\n\t\t\t$msg = esc_html($msg);\n\t\t}\n\t\tif (($hdr!=='')) {\n\t\t\t$hdr = 'GFM: ' . $hdr;\n\t\t}\n\t\t$slplus_plugin->AddOns->instances[SLP_GFL_FREE_SLUG]->debugMP($type,$hdr,$msg,NULL,NULL,true);\n\t}", "protected function debugPrint($message) {\n if ($this->debug) {\n echo \"<p style=\\\"font-family: monospace;\\\">[ lib-php-digest DEBUG ]: {$message}</p>\";\n }\n }", "function pkg_debug($msg) {\n\t\tglobal $g, $debug, $fd_log;\n\n\t\tif (!$debug) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!$fd_log) {\n\t\t\t$fd_log = fopen(\"{$g['tmp_path']}/pkg_mgr_debug.log\",\n\t\t\t \"w\");\n\t\t}\n\n\t\tif (!$fd_log) {\n\t\t\tupdate_status(gettext(\"Warning, could not open log \" .\n\t\t\t \"for writing.\") . \"\\n\");\n\t\t\treturn;\n\t\t}\n\t\t@fwrite($fd_log, $msg);\n\t}", "public function debug($message)\n {\n }", "function dev_debug_display( $thing ) {\n\techo '<pre>';\n\tprint_r( $thing );\n\techo '</pre>';\n}", "function debug() {\r\n//\tif (!$debug_mode) {\r\n//\t\treturn;\r\n//\t}\r\n\techo '<pre>';\r\n\tforeach (func_get_args() as $var) {\r\n\t\t$psfix = str_repeat('-', 40);\r\n\t echo \"<span style='font-size: 18px; color:blue;'>\".\r\n\t \"debug: $psfix I were newbility line separator $psfix\".\r\n\t \"</span>\\n\";\r\n\t echo(var_dump($var));\r\n\t}\r\n echo '</pre>';\r\n}", "function debug($content=\"\",$loglevel = \"\") {\n\t// Si no esta habilitado, nada\n\tif (!$this->Debug) return;\n\t$this->log($content, $loglevel);\n//\techo \"DEBUG> $content <br>\\n\";\t \n }", "public function debug()\n {\n // Get the request paramaters\n $request = Zend_Controller_Front::getInstance()->getRequest()->getParams();\n\n // Create the string variable\n $string = <<<HTML\n <div id=\"debugArea\">\n <b>Debug Area</b>\n <hr />\nHTML;\n\n // Run the isfacebook method\n $string .= self::_isFacebook();\n\n // Run the isTodo method\n $string .= '<b>Todo</b>';\n $string .= self::_isTodo();\n\n // Output the Request Paramaters\n $string .= '<b>Paramaters</b><br />';\n $string .= Zend_Debug::dump($request, '<b>All Params</b>', false);\n $string .= Zend_Debug::dump($_REQUEST, '<b>Request Paramaters</b>', false);\n\n // Get the Auth Instance\n $auth = Zend_Auth::getInstance();\n\n // Check if this user is logged in\n if ($auth->hasIdentity()) {\n $string .= Zend_Debug::dump($auth->getIdentity(), '<b>Zend Auth</b>', false);\n }\n\n // If Files is not empty then output these\n if (!empty($_FILES)) {\n $string .= Zend_Debug::dump($_FILES, '<b>Files</b>', false);\n }\n\n // End the DIV\n $string .= '</div>';\n\n return $string;\n }", "public static function debugTrail() {}", "public function isDebug();", "public function isDebug();", "public function debug($msg)\n {\n if (self::$debugMode) {\n $this->debug [] = $msg;\n }\n }", "protected function debug($msg)\n {\n echo \"(DEBUG:Url) $msg\\n\";\n }", "function debug($message, $fatal = false) {\r\n if (DEBUG) {\r\n global $DEBUG;\r\n console_message($message, $fatal);\r\n }\r\n}", "public static function write_debug_warning(){\n\t\t\tif(str_replace('none','',CFG::get('DEBUG_MODE'))!='' && !Ajax::is_on()){\n\t\t\t\t$ie6h=(stripos(str_replace(' ','',$_SERVER['HTTP_USER_AGENT']),'MSIE6')!==false); // ie6 hotfix\n\t\t\t\t?><div style=\"-moz-border-radius:8px; -webkit-border-radius:8px; border-radius:8px;\n\t\t\t\t\t-moz-box-shadow:0 0 8px #000; -webkit-box-shadow:0 0 8px #000; box-shadow:0 0 8px #000;\n\t\t\t\t\tbackground:#FEE; border:2px solid #F00; font-family:arial; font-size:12px; font-weight:bold;\n\t\t\t\t\tmargin:2px; padding:0 4px; position:fixed; right:4px; text-shadow:0 0 10px #A00; z-index:10;\n\t\t\t\t\ttop:4px; position:<?php echo $ie6h?'absolute':'fixed'; ?>;\">DEBUG MODE</div><?php\n\t\t\t}\n\t\t}", "function harvest_debug( $log ) {\n\tadd_action( 'admin_notices', function( $log ){\n\t\techo '<div class=\"error\"><p><code>'. $log .'</code></p></div>';\n\t} );\n}", "protected function _debug()\n {\n $file = self::DEFAULT_LOG_FILE;\n Mage::getModel('core/log_adapter', $file)->log($this->_debugData);\n }", "static function debug() {\n\t\tif ( $autoload ) {\n\t\t\techo 'Warning the scripts are auto loaded';\n\t\t}\n\t}", "public function disableDebug() {}", "public function debug()\n {\n echo '<h3>Request Object</h3>';\n echo '<pre>';\n var_dump($this->request);\n echo '</pre>';\n\n echo '<hr/>';\n\n echo '<h3>Request XML</h3>';\n echo '<textarea class=\"widefat\" rows=\"10\">';\n echo htmlentities( $this->service->__getLastRequest() );\n echo '</textarea>';\n\n echo '<hr/>'; \n\n echo '<h3>Response Object</h3>';\n echo '<pre>';\n var_dump($this->response);\n echo '</pre>';\n\n echo '<hr/>';\n\n echo '<h3>Response XML</h3>';\n echo '<textarea class=\"widefat\" rows=\"10\">';\n echo htmlentities( $this->service->__getLastResponse() );\n echo '</textarea>';\n }", "public function debug ($mes) {\n echo $mes;\n }", "function debug($value)\n {\n $debugbar = debugbar();\n foreach (func_get_args() as $value) {\n $debugbar->addMessage($value, 'debug');\n }\n }", "function debug_output() {\n\t\tglobal $ac_tos_response, $ac_status_response;\n\t\t$response = 'tos' == $_GET['ac_debug'] ? $ac_tos_response : $ac_status_response;\n\t\tif ( empty( $response ) ) {\n\t\t\t$response = 'No response from API :(';\n\t\t} else {\n\t\t\t$response = print_r( $response, 1 );\n\t\t}\n\n\t\t$tos = $this->get_option( 'tos' ) ?\n\t\t\t'<span style=\"color:green;\">Yes</span>' :\n\t\t\t'<span style=\"color:red;\">No</span>';\n\t\t$status = $this->get_option( 'wordads_approved' ) ?\n\t\t\t'<span style=\"color:green;\">Yes</span>' :\n\t\t\t'<span style=\"color:red;\">No</span>';\n\t\t$house = $this->get_option( 'wordads_house' ) ? 'Yes' : 'No';\n\n\t\t$type = $this->get_option( 'tos' ) && $this->get_option( 'wordads_approved' ) ?\n\t\t\t'updated' :\n\t\t\t'error';\n\n\t\techo <<<HTML\n\t\t<div class=\"notice $type is-dismissible\">\n\t\t\t<p>TOS: $tos | Status: $status | House: $house</p>\n\t\t\t<pre>$response</pre>\n\t\t</div>\nHTML;\n\t}", "public function testDebugLog()\n {\n define('DEBUG_MODE', 1);\n\n // Start capturing the output to the screen.\n ob_start();\n\n // Message that is expected to be outputted.\n $msg = 'This is a message';\n\n // Execute.\n $this->testObject->debugLog($msg);\n\n // Output debug information.\n $log = ob_get_clean();\n\n // Assert Result\n $this->assertContains($msg, $log);\n }", "private function displayDebug($res){\n\t\tif( $this->waitForHeaders &&\n\t\t\t((ob_get_level() && ob_get_length() === 0) || (!ob_get_level() && !headers_sent())) ){\n\t\t\tarray_push($this->queue, $res);\n\t\t} else {\n\t\t\t$this->purgeQueue();\n\t\t\techo $res;\n\t\t}\n\t}", "private function print_banner() {\n if ($this->debug_state('banner')) {\n echo PHP_EOL, 'PHP Daemon - Worker Debug Console';\n echo PHP_EOL, 'Use `help` for list of commands', PHP_EOL, PHP_EOL;\n $this->debug_state('banner', false);\n }\n }", "public function hookDebug()\n\t{\n\t\treturn print_r($this, 1);\n\t}", "function debug($data) {\n global $debug_switch;\n global $output;\n \n if (!$debug_switch)\n return;\n \n if (is_array($data) || is_object($data)) {\n $output[\"debug\"][] = $data;\n } else {\n $output[\"debug\"][] = htmlspecialchars($data);\n }\n }", "public function enableDebug() : void\n {\n $this->debug = TRUE;\n }", "protected function debugVar($var){\n \tob_start(); \n \t$this->debug(nl2br(ob_get_clean()));\n }", "function debug( $data , $fim = false ){\n\techo '<pre style=\"display: block; text-align:left;\">';\n\tvar_dump($data);\n\techo '</pre>';\n\n\tif ($fim){\n\t\tdie();\n\t}\n}", "public function pre($_msg){\r\n $db = debug_backtrace(null,1);\r\n echo \"<pre>y<b>\".Data::get($db,'0.file').\":\".Data::get($db,'0.line').\"</b>\".PHP_EOL.var_export($_msg,true).\"</pre>\";\r\n }", "private function print_debug($_msg, $_terminate = TRUE)\n {\n print(\"DEBUG:\" . PHP_EOL);\n if (is_array($_msg)) {\n // If _msg is array then run through each key => value pair and print each entry to the screen\n foreach ($_msg as $key => $value) {\n print($key . \" => \");\n var_dump($value);\n print(PHP_EOL);\n }\n } else \n if (is_string($_msg)) {\n print_r($_msg);\n print(PHP_EOL);\n }\n \n if ($_terminate) {\n exit();\n }\n }", "public static function debug($msg)\n {\n if (!defined(\"SERVER_LIVE\") || (defined(\"SERVER_LIVE\") && !SERVER_LIVE)) {\n $return = \"Requested URL: \" . Server::getAbsoluteURL() . \"<br>\";\n $return .= $msg . \"<br>\";\n $return .= \"<pre>\";\n $return .= print_r(debug_backtrace(), true);\n $return .= \"</pre>\";\n self::getInstance()->outputContent($return);\n } else {\n trigger_error($msg, E_USER_ERROR);\n }\n }", "static function show()\n {\n $trace = self::log();\n ?>\n <style type=\"text/css\">\n #-pt-debug { position:relative; z-index:2147483584; background-color:rgba(255,255,255,0.9); margin:20px; padding:20px 20px 40px 20px; font:14px/20px Tahoma; border:#666 dashed 1px; opacity:0.2; text-align:left; }\n #-pt-debug:hover { opacity:1; }\n #-pt-debug legend { text-shadow:1px -2px 0px #FFF; font:bold 16px Tahoma; margin:0px; border:0px; width:auto; }\n #-pt-debug p { margin-top:5px; }\n #-pt-debug p code { display:block; background:#FAFAFA; border:#DDD solid 1px; font-size:12px; padding:10px; margin:5px 0px 0px 30px; }\n #-pt-debug .pt-error { color:#CB1818; }\n #-pt-debug .pt-warning { color:#E88500; }\n #-pt-debug ._cls { position:absolute; top:20px; right:15px; color:#E00; font-weight:bold; font-size:16px; }\n </style>\n <fieldset id=\"-pt-debug\">\n <legend>DEBUG MESSAGE</legend>\n <?php foreach ($trace as $value) { ?>\n <p class=\"pt-<?php echo $value['type']; ?>\"><?php echo is_string($value['message']) ? $value['message'] : var_export($value['message'], true); ?></p>\n <?php } ?>\n <a class=\"_cls\" href=\"javascript:;\" onclick=\"this.parentNode.style.display='none'\">CLOSE</a>\n </fieldset>\n <?php\n }", "public function debug(){\n $debug = [\n 'ID' => $this->ID,\n 'slug' => $this->slug,\n 'options' => $this->options,\n 'items' => $this->items,\n ];\n \"<pre>\".var_dump($debug).\"</pre>\";\n }", "public function debugMessage ($message)\n {\n if (sfConfig::get('sf_web_debug'))\n {\n sfWebDebug::getInstance()->logShortMessage($message);\n }\n }", "public static function debug()\r\n {\r\n if (func_num_args() === 0)\r\n return;\r\n\r\n // Get all passed variables\r\n $variables = func_get_args();\r\n\r\n $output = array();\r\n foreach ($variables as $var)\r\n {\r\n $output[] = Core::_dump($var, 1024);\r\n }\r\n\r\n echo '<pre class=\"debug\">'.implode(\"\\n\", $output).'</pre>';\r\n }", "public function wpDebug($message, $code=Zend_Log::INFO)\n\t{\n\t\tMage::log($message, $code, \"WhitePageswpDebug.log\");\n\t}", "function debugger(){\n $debug = 1;\n if($debug === 1) {\n header(\"Content-Type: text/html; charset=utf-8\");\n error_reporting(E_ALL);\n ini_set('display_errors', 1);\n }else{\n error_reporting( 0 );\n }\n}", "function viewdump($data)\n {\n if (PLATFORM === 'development') {\n echo '<pre>';\n echo var_dump($data);\n echo '</pre>';\n exit();\n } else {\n return false;\n }\n }", "function testDebugShow() {\n ob_start();\n Debug::out('Testing, testing, 123.');\n $output = ob_get_clean();\n $this->assertPattern('/<pre>Testing, testing, 123.<\\/pre>/is', $output);\n }", "public function debug(string $message);", "function elgg_dump($value, $to_screen = TRUE, $level = 'NOTICE') {\n\tglobal $CONFIG;\n\n\t// plugin can return false to stop the default logging method\n\t$params = array('level' => $level,\n\t\t\t\t\t'msg' => $value,\n\t\t\t\t\t'to_screen' => $to_screen);\n\tif (!trigger_plugin_hook('debug', 'log', $params, true)) {\n\t\treturn;\n\t}\n\n\t// Do not want to write to screen before page creation has started.\n\t// This is not fool-proof but probably fixes 95% of the cases when logging\n\t// results in data sent to the browser before the page is begun.\n\tif (!isset($CONFIG->pagesetupdone)) {\n\t\t$to_screen = FALSE;\n\t}\n\n\tif ($to_screen == TRUE) {\n\t\techo '<pre>';\n\t\tprint_r($value);\n\t\techo '</pre>';\n\t} else {\n\t\terror_log(print_r($value, TRUE));\n\t}\n}", "protected static function echoDebug($message)\r\n {\r\n if (self::$DEBUG)\r\n echo $message;\r\n }", "function debug($status = array())\n {\n $this->debug = $status;\n }", "public function debug(){\n echo\"<pre><code>\";\n var_dump($this);\n echo \"</code></pre>\";\n }", "protected function debug($msg)\n {\n if(self::DEBUG)\n {\n error_log('epfl-quota: '.$msg);\n }\n }", "protected function LiveDebugString()\n {\n return $this->debugMessage;\n }", "function debug($message, $linefeed = 1) {\n\tglobal $debug;\n\n\tif ($debug) {\n\t\tif ($linefeed == 0) {\n\t\t\tprint \"DEBUG: \" . $message . \"\\r\";\n\t\t}else{\n\t\t\tprint \"DEBUG: \" . $message . \"\\n\";\n\t\t}\n\t}\n}", "function printDebug($message)\n{\n global $tPrintDebug, $t;\n if ($tPrintDebug) print \"$t[1]$message\\n\";\n}", "public function debug(): void\n {\n echo \"CLIENT : \" . PHP_EOL;\n echo \"=========\" . PHP_EOL;\n echo \"URL : \" . $this->getUrl(). PHP_EOL;\n echo \"METHOD : \" . $this->method. PHP_EOL;\n echo \"SPA ID : \" . $this->spaceId. PHP_EOL;\n echo \"ACCEPT : \" . $this->acceptContentType. PHP_EOL;\n echo \"C TYPE : \" . $this->contentType . PHP_EOL;\n echo \"API : \" . $this->apiType. PHP_EOL;\n echo \"TOKEN : \" . $this->c->getCredentials()->getAccessToken(). PHP_EOL;\n echo \"GEOJSON: \" . $this->geojsonFile. PHP_EOL;\n var_dump($this->requestBody);\n echo \"=========\" . PHP_EOL;\n }", "public function EnableDebug()\n {\n $this->_debug = true;\n return;\n }" ]
[ "0.71412593", "0.6930466", "0.6864411", "0.666301", "0.6645595", "0.6633696", "0.6633696", "0.66324776", "0.6558029", "0.6556115", "0.6539531", "0.6535702", "0.65201163", "0.6494868", "0.6492529", "0.6473553", "0.6460648", "0.6454192", "0.6436529", "0.6419376", "0.6418583", "0.6406398", "0.6376404", "0.63722885", "0.63715637", "0.63584065", "0.63260806", "0.6320116", "0.6298734", "0.6286021", "0.62399983", "0.6234873", "0.6228919", "0.62277776", "0.6221505", "0.6217933", "0.6179821", "0.6165792", "0.6161878", "0.6156468", "0.61521536", "0.6136794", "0.61260146", "0.60921943", "0.6072785", "0.6067328", "0.6058666", "0.6053266", "0.60364264", "0.603614", "0.6019666", "0.60032356", "0.59992194", "0.59908", "0.59867257", "0.5972897", "0.5972372", "0.5972372", "0.5964986", "0.5945942", "0.59368736", "0.5933013", "0.59321094", "0.5906459", "0.5905385", "0.5903508", "0.58955276", "0.58939385", "0.5890438", "0.58677334", "0.58581084", "0.58579695", "0.5857579", "0.5852687", "0.584921", "0.58333725", "0.58317125", "0.582751", "0.58258057", "0.58197844", "0.58195364", "0.5817784", "0.5817121", "0.58152753", "0.581442", "0.58126545", "0.5812451", "0.57959443", "0.57929915", "0.5789188", "0.5783859", "0.578361", "0.57787794", "0.5773632", "0.57644963", "0.57628626", "0.57558304", "0.5754978", "0.5750312", "0.5748138" ]
0.6121835
43
Output only. The resource name of the ModelEvaluationSlice. Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
public function getName() { return $this->name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSliceName() {\n return $this->sliceName;\n }", "public function setSlice($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\AIPlatform\\V1\\ModelEvaluationSlice\\Slice::class);\n $this->slice = $var;\n\n return $this;\n }", "public function setSliceName($sliceName) {\n $this->sliceName = $sliceName;\n return $this;\n }", "public function getCollectionName()\r\n {\r\n return 'result_'.$this->getReportName();\r\n }", "public function ListModelEvaluationSlices(\\Google\\Cloud\\AIPlatform\\V1\\ListModelEvaluationSlicesRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/ListModelEvaluationSlices',\n $argument,\n ['\\Google\\Cloud\\AIPlatform\\V1\\ListModelEvaluationSlicesResponse', 'decode'],\n $metadata, $options);\n }", "public function getName()\n {\n if ( $this->multiple ) {\n return $this->name . '[]';\n }\n return $this->name;\n }", "public function name()\n\t{\n\t\treturn $this->array['name'] ?? '';\n\t}", "public function getName()\n\t{\n\t\tif ($this->frozen) {\n\t\t\treturn $this->__call(__FUNCTION__, func_get_args());\n\t\t}\n\t\treturn $this->name;\n\t}", "public function name(): string\n {\n return 'PopulationValidation';\n }", "final public function name(): string\n {\n return $this->name;\n }", "public function name() {\n\t\treturn $this->name;\n\t}", "final public function name():string\n {\n return $this->name;\n }", "public function name()\n {\n return $this->getFromCache(\n ['type' => 'name']\n );\n }", "public function name() {\n return $this->name;\n }", "public function getOutputName(): string\n {\n return $this->outputName;\n }", "public function name() { return $this->name; }", "public function getEvaluationMessage()\n {\n return $this->evaluationMessage;\n }", "public function name()\n\t{\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}", "public function getName() { return $this->data['name']; }", "public function toString() {\n\t\treturn $this->name;\n\t}", "public function toString(): string\n {\n return $this->name;\n }", "public function getResourceName()\n {\n return $this->resource_name;\n }", "public function getName()\n {\n return $this['name'];\n }", "public function toString()\n {\n return $this->name;\n }", "private function getDataByPath($name): string\n {\n $namePath = explode('.', $name);\n $out = $this->model;\n\n for ($i=0; $i < count($namePath); $i++) {\n\n $out = $i+1 < count($namePath) ?\n $out->{$namePath[$i]} : $out->{$namePath[$i].'_'.$this->language->getShortName()};\n\n if (is_array($out)) {\n for ($j=0; $j < count($out); $j++) {\n $out[$j] = $out[$j]->{$namePath[$i+1].'_'.$this->language->getShortName()};\n }\n $out = implode(', ', $out);\n break;\n }\n }\n\n return trim($out, ', ');\n }", "public function name() {\n return $this->name;\n }", "public function getName(): string\n {\n return $this->requireString('name');\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function setCollectionName($name);", "public function getName() {\n\t\treturn $this->selectedEndpoint['name'];\n\t}", "public function getCollectionName()\n {\n return $this->collectionName;\n }", "public function name()\n\t{\n\t\treturn $this->_name;\n\t}", "public function getName() { return $this->name; }", "public function getEvaluation()\n {\n return $this->evaluation;\n }", "public function toString()\n {\n return $this->name;\n }", "public function name()\n {\n if (isset($this->attributes[self::NAME])) {\n return $this->attributes[self::NAME];\n }\n\n return $this->path();\n }", "public function getName()\n {\n return $this->getValue('name');\n }", "public function getSlice()\n {\n return $this->slice;\n }", "public function getSectionName(): string\n {\n return $this->sectionName;\n }", "function getName() {\n\t\treturn $this->name;\n\t}", "public function __toString()\n {\n return $this->name;\n }", "public function __toString()\n {\n return $this->name;\n }", "public function __toString()\n {\n return $this->name;\n }", "public function __toString()\n {\n return $this->name;\n }", "public function __toString()\n {\n return $this->name;\n }", "public function __toString()\n {\n return $this->name;\n }", "public function __toString()\n {\n return $this->name;\n }", "public function __toString()\n {\n return $this->name;\n }", "public function __toString()\n {\n return $this->name;\n }", "public function __toString()\n {\n return $this->name;\n }", "public function __toString()\n {\n return $this->name;\n }", "public function __toString()\n {\n return $this->name;\n }", "final public function getName()\n\t{\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 __toString(): string\n {\n return $this->name;\n }", "public function __toString(): string\n {\n return $this->name;\n }", "public static function raw($name)\n {\n $container = static::getInstance();\n\n if (!array_key_exists($name, $container->values)) {\n throw new \\InvalidArgumentException(sprintf('\"%s\" is not defined.', $name));\n }\n\n return isset($container->raw[$name]) ? $container->raw[$name] : $container->values[$name];\n }", "public function __get($name)\n {\n return (isset($this->response[$name]) ? $this->response[$name] : '');\n }", "function getName () {return $this->getFieldValue ('name');}", "public function __toString() {\n\t\treturn $this->name;\n\t}", "function getName () {\n\t\treturn $this->name;\n\t}", "private function getData($name)\n {\n $output = $this->ask->query(\"\n [[{$name}]]\n |?skos:altLabel\n |?skos:related\n |?skosem:narrower\n |?skosem:broader\n |?skosem:partOf\n |?skos:definition\n |?Context\n |?\" . Entry::TITLE_PROPERTY . \"\n |?\" . Entry::HEADING_PROPERTY . \"\n \")->getResults();\n\n if (count($output) == 0) {\n throw new \\Exception(sprintf(\"The page '%s' could not be found\", $name));\n }\n\n return $output[0];\n }", "public function name()\n {\n return $this->getName();\n }", "public function name()\n {\n return $this->getName();\n }", "public function __toString()\n {\n return (string) $this[\"name\"];\n }", "public function get_name() {\n return $this->name;\n }", "public function get_name() {\r\n return $this->name;\r\n }", "function getName() {\n return $this->name;\n }", "public function get_name()\r\n {\r\n \t$data = $this->get_exercise_data();\r\n \treturn $data['title'];\r\n }", "public function get_response_name()\n\t{\n\t\treturn $this->name;\n\t}", "public function getFullyQualifiedName()\n {\n $name = $this->getName();\n\n if ($this->getIsMultiple()) {\n $name .= '[]';\n }\n\n return $name;\n }", "public function getName() {\n return $this->name;\n }", "public function get_name() {\n\n\t\treturn $this->name;\n\t}", "public function getOutputName()\n {\n\n $ext_pos = strrpos($this->getName(), '.');\n if ($ext_pos === false) {\n throw new SiteBuilderException('Unexpected filename; must have file extension');\n }\n $filename = substr($this->getName(), 0, $ext_pos) . '.html';\n\n return $filename;\n }", "public function getName () {\n return $this->name;\n }", "public function getSolutionName()\n {\n return $this->solution_name;\n }", "public function name(): string\n {\n return $this->rsn;\n }", "public function getNameUnwrapped()\n {\n return $this->readWrapperValue(\"name\");\n }", "public function getNameUnwrapped()\n {\n return $this->readWrapperValue(\"name\");\n }", "public function getNameUnwrapped()\n {\n return $this->readWrapperValue(\"name\");\n }", "protected function getModelName()\n {\n $fullyQualifiedClassName = substr(static::class, 0, -10); // \\App\\Repositories\\{name}Repository => \\App\\Repositories\\{name}\n $nameArray = explode('\\\\', $fullyQualifiedClassName); // [App, Repositories, {name}]\n return array_pop($nameArray); // {name}\n }", "public function getName()\n {\n return $this->str_name;\n }", "public function getName() {\n return $this->name;\n }", "public function getName() {\n return $this->name;\n }", "public function getName() {\n return $this->name;\n }", "public function getname()\n {\n return $this->name;\n }" ]
[ "0.6367233", "0.5898603", "0.5304272", "0.48008192", "0.47498298", "0.46732178", "0.46232888", "0.4570289", "0.45610547", "0.45176467", "0.45132732", "0.4453284", "0.44522446", "0.44475806", "0.4440818", "0.44325814", "0.4430664", "0.44243687", "0.44243687", "0.44243687", "0.4422678", "0.44161218", "0.4415309", "0.4399431", "0.43991882", "0.43987766", "0.43956757", "0.43904498", "0.4388665", "0.43878832", "0.43878832", "0.43878832", "0.43878832", "0.43878832", "0.43878832", "0.43878832", "0.43878832", "0.43878832", "0.43878832", "0.43878832", "0.43840876", "0.43750632", "0.4366046", "0.43492514", "0.4348407", "0.4346957", "0.43432897", "0.43382758", "0.4333955", "0.4330691", "0.43190658", "0.43178967", "0.43175858", "0.43175858", "0.43175858", "0.43175858", "0.43175858", "0.43175858", "0.43175858", "0.43175858", "0.43175858", "0.43175858", "0.43175858", "0.43175858", "0.43171695", "0.43108615", "0.43108615", "0.43108615", "0.43108615", "0.4310776", "0.4310776", "0.430843", "0.43054754", "0.43036795", "0.42991456", "0.42970872", "0.42950946", "0.42941064", "0.42941064", "0.42940044", "0.4284427", "0.42841595", "0.42775032", "0.4274481", "0.42741427", "0.42697573", "0.42675126", "0.42667145", "0.42658535", "0.42656362", "0.42653283", "0.42646813", "0.4263973", "0.4263973", "0.4263973", "0.4258601", "0.4257407", "0.4254456", "0.4254456", "0.4254456", "0.42529893" ]
0.0
-1
Output only. The resource name of the ModelEvaluationSlice. Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
public function setName($var) { GPBUtil::checkString($var, True); $this->name = $var; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSliceName() {\n return $this->sliceName;\n }", "public function setSlice($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\AIPlatform\\V1\\ModelEvaluationSlice\\Slice::class);\n $this->slice = $var;\n\n return $this;\n }", "public function setSliceName($sliceName) {\n $this->sliceName = $sliceName;\n return $this;\n }", "public function getCollectionName()\r\n {\r\n return 'result_'.$this->getReportName();\r\n }", "public function ListModelEvaluationSlices(\\Google\\Cloud\\AIPlatform\\V1\\ListModelEvaluationSlicesRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/ListModelEvaluationSlices',\n $argument,\n ['\\Google\\Cloud\\AIPlatform\\V1\\ListModelEvaluationSlicesResponse', 'decode'],\n $metadata, $options);\n }", "public function getName()\n {\n if ( $this->multiple ) {\n return $this->name . '[]';\n }\n return $this->name;\n }", "public function name()\n\t{\n\t\treturn $this->array['name'] ?? '';\n\t}", "public function getName()\n\t{\n\t\tif ($this->frozen) {\n\t\t\treturn $this->__call(__FUNCTION__, func_get_args());\n\t\t}\n\t\treturn $this->name;\n\t}", "public function name(): string\n {\n return 'PopulationValidation';\n }", "final public function name(): string\n {\n return $this->name;\n }", "public function name() {\n\t\treturn $this->name;\n\t}", "final public function name():string\n {\n return $this->name;\n }", "public function name()\n {\n return $this->getFromCache(\n ['type' => 'name']\n );\n }", "public function name() {\n return $this->name;\n }", "public function getOutputName(): string\n {\n return $this->outputName;\n }", "public function name() { return $this->name; }", "public function getEvaluationMessage()\n {\n return $this->evaluationMessage;\n }", "public function name()\n\t{\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}", "public function getName() { return $this->data['name']; }", "public function toString() {\n\t\treturn $this->name;\n\t}", "public function toString(): string\n {\n return $this->name;\n }", "public function toString()\n {\n return $this->name;\n }", "public function getResourceName()\n {\n return $this->resource_name;\n }", "public function getName()\n {\n return $this['name'];\n }", "private function getDataByPath($name): string\n {\n $namePath = explode('.', $name);\n $out = $this->model;\n\n for ($i=0; $i < count($namePath); $i++) {\n\n $out = $i+1 < count($namePath) ?\n $out->{$namePath[$i]} : $out->{$namePath[$i].'_'.$this->language->getShortName()};\n\n if (is_array($out)) {\n for ($j=0; $j < count($out); $j++) {\n $out[$j] = $out[$j]->{$namePath[$i+1].'_'.$this->language->getShortName()};\n }\n $out = implode(', ', $out);\n break;\n }\n }\n\n return trim($out, ', ');\n }", "public function name() {\n return $this->name;\n }", "public function getName(): string\n {\n return $this->requireString('name');\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function setCollectionName($name);", "public function getName() {\n\t\treturn $this->selectedEndpoint['name'];\n\t}", "public function getCollectionName()\n {\n return $this->collectionName;\n }", "public function getEvaluation()\n {\n return $this->evaluation;\n }", "public function name()\n\t{\n\t\treturn $this->_name;\n\t}", "public function getName() { return $this->name; }", "public function toString()\n {\n return $this->name;\n }", "public function name()\n {\n if (isset($this->attributes[self::NAME])) {\n return $this->attributes[self::NAME];\n }\n\n return $this->path();\n }", "public function getSlice()\n {\n return $this->slice;\n }", "public function getName()\n {\n return $this->getValue('name');\n }", "public function getSectionName(): string\n {\n return $this->sectionName;\n }", "public function __toString()\n {\n return $this->name;\n }", "public function __toString()\n {\n return $this->name;\n }", "public function __toString()\n {\n return $this->name;\n }", "public function __toString()\n {\n return $this->name;\n }", "public function __toString()\n {\n return $this->name;\n }", "public function __toString()\n {\n return $this->name;\n }", "public function __toString()\n {\n return $this->name;\n }", "public function __toString()\n {\n return $this->name;\n }", "public function __toString()\n {\n return $this->name;\n }", "public function __toString()\n {\n return $this->name;\n }", "public function __toString()\n {\n return $this->name;\n }", "public function __toString()\n {\n return $this->name;\n }", "function getName() {\n\t\treturn $this->name;\n\t}", "final public function getName()\n\t{\n\t\treturn $this->name;\n\t}", "public function __toString(): string\n {\n return $this->name;\n }", "public function __toString(): string\n {\n return $this->name;\n }", "public static function raw($name)\n {\n $container = static::getInstance();\n\n if (!array_key_exists($name, $container->values)) {\n throw new \\InvalidArgumentException(sprintf('\"%s\" is not defined.', $name));\n }\n\n return isset($container->raw[$name]) ? $container->raw[$name] : $container->values[$name];\n }", "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 __get($name)\n {\n return (isset($this->response[$name]) ? $this->response[$name] : '');\n }", "function getName () {return $this->getFieldValue ('name');}", "public function __toString() {\n\t\treturn $this->name;\n\t}", "private function getData($name)\n {\n $output = $this->ask->query(\"\n [[{$name}]]\n |?skos:altLabel\n |?skos:related\n |?skosem:narrower\n |?skosem:broader\n |?skosem:partOf\n |?skos:definition\n |?Context\n |?\" . Entry::TITLE_PROPERTY . \"\n |?\" . Entry::HEADING_PROPERTY . \"\n \")->getResults();\n\n if (count($output) == 0) {\n throw new \\Exception(sprintf(\"The page '%s' could not be found\", $name));\n }\n\n return $output[0];\n }", "function getName () {\n\t\treturn $this->name;\n\t}", "public function __toString()\n {\n return (string) $this[\"name\"];\n }", "public function name()\n {\n return $this->getName();\n }", "public function name()\n {\n return $this->getName();\n }", "public function get_name() {\n return $this->name;\n }", "public function get_name() {\r\n return $this->name;\r\n }", "function getName() {\n return $this->name;\n }", "public function get_name()\r\n {\r\n \t$data = $this->get_exercise_data();\r\n \treturn $data['title'];\r\n }", "public function get_response_name()\n\t{\n\t\treturn $this->name;\n\t}", "public function getFullyQualifiedName()\n {\n $name = $this->getName();\n\n if ($this->getIsMultiple()) {\n $name .= '[]';\n }\n\n return $name;\n }", "public function getName() {\n return $this->name;\n }", "public function getOutputName()\n {\n\n $ext_pos = strrpos($this->getName(), '.');\n if ($ext_pos === false) {\n throw new SiteBuilderException('Unexpected filename; must have file extension');\n }\n $filename = substr($this->getName(), 0, $ext_pos) . '.html';\n\n return $filename;\n }", "public function get_name() {\n\n\t\treturn $this->name;\n\t}", "public function getName () {\n return $this->name;\n }", "public function getNameUnwrapped()\n {\n return $this->readWrapperValue(\"name\");\n }", "public function getNameUnwrapped()\n {\n return $this->readWrapperValue(\"name\");\n }", "public function getNameUnwrapped()\n {\n return $this->readWrapperValue(\"name\");\n }", "public function getSolutionName()\n {\n return $this->solution_name;\n }", "public function name(): string\n {\n return $this->rsn;\n }", "protected function getModelName()\n {\n $fullyQualifiedClassName = substr(static::class, 0, -10); // \\App\\Repositories\\{name}Repository => \\App\\Repositories\\{name}\n $nameArray = explode('\\\\', $fullyQualifiedClassName); // [App, Repositories, {name}]\n return array_pop($nameArray); // {name}\n }", "public function getName()\n {\n return $this->str_name;\n }", "public function getName() {\n return $this->name;\n }", "public function getName() {\n return $this->name;\n }", "public function getName() {\n return $this->name;\n }", "public function getname()\n {\n return $this->name;\n }" ]
[ "0.6366815", "0.5901809", "0.5305577", "0.47976786", "0.47508553", "0.46702623", "0.46202216", "0.45673344", "0.455897", "0.45155674", "0.4510376", "0.44512233", "0.44488224", "0.44448906", "0.44389093", "0.44306865", "0.44287363", "0.44214487", "0.44214487", "0.44214487", "0.4420525", "0.4414118", "0.44135302", "0.4396753", "0.4396723", "0.4396004", "0.4394019", "0.43883133", "0.43859032", "0.43852293", "0.43852293", "0.43852293", "0.43852293", "0.43852293", "0.43852293", "0.43852293", "0.43852293", "0.43852293", "0.43852293", "0.43852293", "0.4382311", "0.43728414", "0.4363484", "0.4346404", "0.43462813", "0.43459454", "0.4341571", "0.43345127", "0.43325648", "0.43303877", "0.4317192", "0.43162826", "0.43162826", "0.43162826", "0.43162826", "0.43162826", "0.43162826", "0.43162826", "0.43162826", "0.43162826", "0.43162826", "0.43162826", "0.43162826", "0.43151164", "0.43138582", "0.43093947", "0.43093947", "0.430861", "0.43078262", "0.43078262", "0.43078262", "0.43078262", "0.43048003", "0.43014848", "0.42978168", "0.42949483", "0.42943206", "0.42927274", "0.42913043", "0.42913043", "0.42815083", "0.42813832", "0.42750406", "0.42724836", "0.42713794", "0.42676792", "0.4264494", "0.4263913", "0.4263364", "0.42631188", "0.42625576", "0.42625576", "0.42625576", "0.42623597", "0.42618883", "0.4255759", "0.42542496", "0.4251765", "0.4251765", "0.4251765", "0.42502946" ]
0.0
-1
Output only. The slice of the test data that is used to evaluate the Model. Generated from protobuf field .google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice slice = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
public function getSlice() { return $this->slice; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setSlice($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\AIPlatform\\V1\\ModelEvaluationSlice\\Slice::class);\n $this->slice = $var;\n\n return $this;\n }", "public function testSlice()\n {\n $slice = $this->collection->slice(1, 1);\n\n $this->assertInstanceOf(Collection::class, $slice);\n $this->assertAttributeEquals([1 => 2], 'elements', $slice);\n $this->assertAttributeEquals([1, 2, 3], 'elements', $this->collection);\n }", "public function getSliceName() {\n return $this->sliceName;\n }", "public function testSliceWithoutArgs()\n {\n $slice = $this->collection->slice();\n\n $this->assertInstanceOf(Collection::class, $slice);\n $this->assertAttributeEquals([], 'elements', $slice);\n $this->assertAttributeEquals([1, 2, 3], 'elements', $this->collection);\n }", "public function ListModelEvaluationSlices(\\Google\\Cloud\\AIPlatform\\V1\\ListModelEvaluationSlicesRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/ListModelEvaluationSlices',\n $argument,\n ['\\Google\\Cloud\\AIPlatform\\V1\\ListModelEvaluationSlicesResponse', 'decode'],\n $metadata, $options);\n }", "public function BatchImportModelEvaluationSlices(\\Google\\Cloud\\AIPlatform\\V1\\BatchImportModelEvaluationSlicesRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/BatchImportModelEvaluationSlices',\n $argument,\n ['\\Google\\Cloud\\AIPlatform\\V1\\BatchImportModelEvaluationSlicesResponse', 'decode'],\n $metadata, $options);\n }", "public function setSliceName($sliceName) {\n $this->sliceName = $sliceName;\n return $this;\n }", "public function getArticleSliceService() {\n\t\treturn $this->get('sly-service-articleslice');\n\t}", "public function getSlicing() {\n return $this->slicing;\n }", "public function slice($offset, $length = null)\n {\n if (!$this->initialized && !$this->isDirty && $this->association['fetch'] === ApiMetadata::FETCH_EXTRA_LAZY) {\n $persister = $this->manager->getUnitOfWork()->getCollectionPersister($this->association);\n\n return $persister->slice($this, $offset, $length);\n }\n\n return parent::slice($offset, $length);\n }", "public function testSplice()\n {\n $slice = $this->collection->splice(1, 1);\n\n $this->assertInstanceOf(Collection::class, $slice);\n $this->assertAttributeEquals([2], 'elements', $slice);\n $this->assertAttributeEquals([1, 3], 'elements', $this->collection);\n }", "public function testSpliceWithoutArgs()\n {\n $slice = $this->collection->splice();\n\n $this->assertInstanceOf(Collection::class, $slice);\n $this->assertAttributeEquals([], 'elements', $slice);\n $this->assertAttributeEquals([1, 2, 3], 'elements', $this->collection);\n }", "public function generateExtraDataForSlice (Slice $slice) : array\n\t{\n\t\t$result = [];\n\n\t\t/** @var SliceExtraDataGeneratorInterface $dataGenerator */\n\t\tforeach ($this->sliceExtraDataGenerators as $dataGenerator)\n\t\t{\n\t\t\t$result = $dataGenerator->appendExtraData($slice, $result);\n\t\t}\n\n\t\treturn $result;\n\t}", "public function slice(int $start = 0, int $end = 3): array {\n\n return array_slice($this->data, $start, $end);\n }", "public function slice($start, $length)\n {\n return new self(array_slice($this->inputs, $start, $length));\n }", "public function dataset()\n {\n return $this->data;\n }", "public function getSliceSettingsDefaultData()\n {\n $settings = array(\n 'slice_1' => array(\n 'label' => '10% OFF',\n 'discount_type' => 'percent',\n 'value' => 10,\n 'gravity' => '20',\n ),\n 'slice_2' => array(\n 'label' => 'Not Lucky Today',\n 'discount_type' => 'fixed',\n 'value' => 0,\n 'gravity' => '5',\n ),\n 'slice_3' => array(\n 'label' => '35% OFF',\n 'discount_type' => 'percent',\n 'value' => 35,\n 'gravity' => '0',\n ),\n 'slice_4' => array(\n 'label' => 'Opps! Sorry',\n 'discount_type' => 'fixed',\n 'value' => 0,\n 'gravity' => '5',\n ),\n 'slice_5' => array(\n 'label' => '15% OFF',\n 'discount_type' => 'percent',\n 'value' => 15,\n 'gravity' => '10',\n ),\n 'slice_6' => array(\n 'label' => 'Better Luck Next Time',\n 'discount_type' => 'fixed',\n 'value' => 0,\n 'gravity' => '10',\n ),\n 'slice_7' => array(\n 'label' => '50% OFF',\n 'discount_type' => 'percent',\n 'value' => 50,\n 'gravity' => '0',\n ),\n 'slice_8' => array(\n 'label' => 'Try Next Time',\n 'discount_type' => 'fixed',\n 'value' => 0,\n 'gravity' => '10',\n ),\n 'slice_9' => array(\n 'label' => 'Free Shipping',\n 'discount_type' => 'freeship',\n 'value' => 0,\n 'gravity' => '10',\n ),\n 'slice_10' => array(\n 'label' => 'Come Again',\n 'discount_type' => 'fixed',\n 'value' => 0,\n 'gravity' => '10',\n ),\n 'slice_11' => array(\n 'label' => '5% OFF',\n 'discount_type' => 'percent',\n 'value' => 5,\n 'gravity' => '10',\n ),\n 'slice_12' => array(\n 'label' => 'Try Again',\n 'discount_type' => 'fixed',\n 'value' => 0,\n 'gravity' => '10',\n )\n );\n return $settings;\n }", "public function setSlicing($slicing) {\n $this->slicing = $slicing;\n return $this;\n }", "public function getEvaluations();", "public function run()\n {\n $part_b_evals = [\n // self-evaluations col 1 part b\n ['group_id' => '2','choice_id' => '81','meta' => '1'],\n ['group_id' => '2','choice_id' => '85','meta' => '1'],\n ['group_id' => '2','choice_id' => '89','meta' => '1'],\n ['group_id' => '2','choice_id' => '93','meta' => '1'],\n ['group_id' => '2','choice_id' => '97','meta' => '1'],\n ['group_id' => '2','choice_id' => '101','meta' => '1'],\n ['group_id' => '2','choice_id' => '105','meta' => '1'],\n ['group_id' => '2','choice_id' => '109','meta' => '1'],\n ['group_id' => '2','choice_id' => '113','meta' => '1'],\n ['group_id' => '2','choice_id' => '117','meta' => '1'],\n ['group_id' => '2','choice_id' => '121','meta' => '1'],\n ['group_id' => '2','choice_id' => '125','meta' => '1'],\n ['group_id' => '2','choice_id' => '129','meta' => '1'],\n ['group_id' => '2','choice_id' => '133','meta' => '1'],\n ['group_id' => '2','choice_id' => '137','meta' => '1'],\n ['group_id' => '2','choice_id' => '141','meta' => '1'],\n ['group_id' => '2','choice_id' => '145','meta' => '1'],\n ['group_id' => '2','choice_id' => '149','meta' => '1'],\n ['group_id' => '2','choice_id' => '153','meta' => '1'],\n ['group_id' => '2','choice_id' => '157','meta' => '1'],\n\n // self-evaluations col 2 part b\n ['group_id' => '2','choice_id' => '82','meta' => '2'],\n ['group_id' => '2','choice_id' => '86','meta' => '2'],\n ['group_id' => '2','choice_id' => '90','meta' => '2'],\n ['group_id' => '2','choice_id' => '94','meta' => '2'],\n ['group_id' => '2','choice_id' => '98','meta' => '2'],\n ['group_id' => '2','choice_id' => '102','meta' => '2'],\n ['group_id' => '2','choice_id' => '106','meta' => '2'],\n ['group_id' => '2','choice_id' => '110','meta' => '2'],\n ['group_id' => '2','choice_id' => '114','meta' => '2'],\n ['group_id' => '2','choice_id' => '118','meta' => '2'],\n ['group_id' => '2','choice_id' => '122','meta' => '2'],\n ['group_id' => '2','choice_id' => '126','meta' => '2'],\n ['group_id' => '2','choice_id' => '130','meta' => '2'],\n ['group_id' => '2','choice_id' => '134','meta' => '2'],\n ['group_id' => '2','choice_id' => '138','meta' => '2'],\n ['group_id' => '2','choice_id' => '142','meta' => '2'],\n ['group_id' => '2','choice_id' => '146','meta' => '2'],\n ['group_id' => '2','choice_id' => '150','meta' => '2'],\n ['group_id' => '2','choice_id' => '154','meta' => '2'],\n ['group_id' => '2','choice_id' => '158','meta' => '2'],\n\n // self-evaluations col 3 part b\n ['group_id' => '2','choice_id' => '83','meta' => '3'],\n ['group_id' => '2','choice_id' => '87','meta' => '3'],\n ['group_id' => '2','choice_id' => '91','meta' => '3'],\n ['group_id' => '2','choice_id' => '95','meta' => '3'],\n ['group_id' => '2','choice_id' => '99','meta' => '3'],\n ['group_id' => '2','choice_id' => '103','meta' => '3'],\n ['group_id' => '2','choice_id' => '107','meta' => '3'],\n ['group_id' => '2','choice_id' => '111','meta' => '3'],\n ['group_id' => '2','choice_id' => '115','meta' => '3'],\n ['group_id' => '2','choice_id' => '119','meta' => '3'],\n ['group_id' => '2','choice_id' => '123','meta' => '3'],\n ['group_id' => '2','choice_id' => '127','meta' => '3'],\n ['group_id' => '2','choice_id' => '131','meta' => '3'],\n ['group_id' => '2','choice_id' => '135','meta' => '3'],\n ['group_id' => '2','choice_id' => '139','meta' => '3'],\n ['group_id' => '2','choice_id' => '143','meta' => '3'],\n ['group_id' => '2','choice_id' => '147','meta' => '3'],\n ['group_id' => '2','choice_id' => '151','meta' => '3'],\n ['group_id' => '2','choice_id' => '155','meta' => '3'],\n ['group_id' => '2','choice_id' => '159','meta' => '3'],\n\n // self-evaluations col 4 part b\n ['group_id' => '2','choice_id' => '84','meta' => '4'],\n ['group_id' => '2','choice_id' => '88','meta' => '4'],\n ['group_id' => '2','choice_id' => '92','meta' => '4'],\n ['group_id' => '2','choice_id' => '96','meta' => '4'],\n ['group_id' => '2','choice_id' => '100','meta' => '4'],\n ['group_id' => '2','choice_id' => '104','meta' => '4'],\n ['group_id' => '2','choice_id' => '108','meta' => '4'],\n ['group_id' => '2','choice_id' => '112','meta' => '4'],\n ['group_id' => '2','choice_id' => '116','meta' => '4'],\n ['group_id' => '2','choice_id' => '120','meta' => '4'],\n ['group_id' => '2','choice_id' => '124','meta' => '4'],\n ['group_id' => '2','choice_id' => '128','meta' => '4'],\n ['group_id' => '2','choice_id' => '132','meta' => '4'],\n ['group_id' => '2','choice_id' => '136','meta' => '4'],\n ['group_id' => '2','choice_id' => '140','meta' => '4'],\n ['group_id' => '2','choice_id' => '144','meta' => '4'],\n ['group_id' => '2','choice_id' => '148','meta' => '4'],\n ['group_id' => '2','choice_id' => '152','meta' => '4'],\n ['group_id' => '2','choice_id' => '156','meta' => '4'],\n ['group_id' => '2','choice_id' => '160','meta' => '4'],\n ];\n\n foreach ($part_b_evals as $key => $value) {\n Evaluation::create($value);\n }\n }", "public function slice(int $offset, ?int $length = null): CollectionInterface;", "public function validate()\n\t{\n\t\t$result = true;\n\t\tforeach ($this->slices as &$slice) {\n\t\t\t//debug($slice['name'] . ' ('.$slice['from'].'-'.$slice['till'].': '.sizeof($slice['desc']).')');\n\t\t\t$f2 = new HTMLFormTable($slice['desc']);\n\t\t\t$v = new HTMLFormValidate($f2);\n\t\t\t$result = $v->validate() && $result; // recursive inside // this order to force execution\n\t\t\t$slice['desc'] = $v->getDesc();\n\t\t}\n\t\t//debug($this->slices);\n\t\treturn $result;\n\t}", "public function retrieve(){\n\t\t$this->queried = false;\n\t\t\n\t\t$this->Subset = array();\n\t\t$subset = $this->Data;\n\t\t\n\t\t/* Order */\n\t\t$order = $this->Storage->retrieve('order');\n\t\tif($order && $sequence = $this->getArguments($order)){\n\t\t\t$DataComparison = new DataComparison;\n\t\t\tforeach($sequence as $seq){\n\t\t\t\t$seq = array_map('trim', explode(' ', $seq));\n\t\t\t\tif(empty($seq[0])) continue;\n\t\t\t\t\n\t\t\t\t$DataComparison->setField($seq[0])->setOrder(!(!empty($seq[1]) && String::toLower($seq[1])=='desc'));\n\t\t\t\tuasort($subset, array($DataComparison, 'sort'));\n\t\t\t}\n\t\t}\n\t\t/* Limit */\n\t\t$limit = $this->Storage->retrieve('limit');\n\t\tif(is_array($limit) && ($limit[0] || $limit[1])){\n\t\t\t$i = -1;\n\t\t\tforeach($subset as $k => $v){\n\t\t\t\t$i++;\n\t\t\t\tif($limit[0] && $i<$limit[0]) continue;\n\t\t\t\t\n\t\t\t\t$this->Subset[$k] = $v;\n\t\t\t\tif($i>$limit[1]) break;\n\t\t\t}\n\t\t}else\n\t\t\t$this->Subset = $subset;\n\t\t\n\t\tunset($subset);\n\t\t\n\t\t/* Fields */\n\t\t$fields = $this->Storage->retrieve('fields');\n\t\tif($fields && $checks = $this->getArguments($fields))\n\t\t\tforeach($this->Subset as $k => $data){\n\t\t\t\t$filtered = array();\n\t\t\t\tforeach($data as $key => $value)\n\t\t\t\t\tif(in_array($key, $checks))\n\t\t\t\t\t\t$filtered[$key] = $value;\n\t\t\t\t\n\t\t\t\t$this->Subset[$k] = $filtered;\n\t\t\t}\n\t\t\n\t\t\n\t\treturn $this->Subset;\n\t}", "public function getSlice($offset, $length)\n\t{\n\t\treturn $this->collection->slice($offset, $length);\n\t}", "public function take($limit)\n {\n $this->dataToArray();\n\n return new self(array_slice($this->data, 0, $limit));\n }", "public function slice(int $start, int $length): self\n {\n $items = array_slice($this->items, $start, $length);\n $collection = new self();\n $collection->items = $items;\n $collection->length = $length;\n\n return $collection;\n }", "public function index()\n\t{\n\t\t$this->slice->with('full_name', 'John Doe')\n\t\t\t\t\t->with('users', [['id' => 1, 'name' => 'John'], ['id' => 2, 'name' => 'Jane'], ['id' => 3, 'name' => 'Dave'], ['id' => 4, 'name' => 'Arthur'], ['id' => 5, 'name' => 'Michael'], ['id' => 6, 'name' => 'Ben']])\n\t\t\t\t\t->with('members', [])\n\t\t\t\t\t->with('rows', '0')\n\t\t\t\t\t->directive('Test::custom_slice_directive');\n\n\t\t//\tSlice-Library 1.3 comes with helpers to make things easier!\n\t\tview('page');\n\t}", "public function getEvaluation()\n {\n return $this->evaluation;\n }", "public function edit(Evaluation $evaluation)\n {\n return $evaluation;\n }", "public static function connectionFromArraySlice(array $arraySlice, $args, $meta)\n {\n }", "public static function connectionFromArraySlice(array $arraySlice, $args, $meta)\n {\n }", "public function slice(int $offset, int $length = null): self;", "abstract public function slice($offset, $length = null, $preserveKeys = false);", "public function testSpliceWithScalarReplacement()\n {\n $slice = $this->collection->splice(1, 1, 7);\n\n $this->assertInstanceOf(Collection::class, $slice);\n $this->assertAttributeEquals([2], 'elements', $slice);\n $this->assertAttributeEquals([1, 7, 3], 'elements', $this->collection);\n }", "public function getObservations()\n {\n return $this->observations;\n }", "public function getSlice($offset, $length)\n {\n $result = $this->sphinxQL->limit($length)->offset($offset)->execute()->fetchAllAssoc();\n\n return $this->persister->transformToEntity($result);\n }", "public function evaluation()\n {\n return $this->hasMany('App\\Models\\Evaluation', 'user_id');\n }", "public static function showSlice(rex_extension_point $ep)\n {\n if ($ep->hasParam('sql')) {\n /** @var rex_sql $sql */\n $sql = $ep->getParam('sql');\n $status = (bool) $sql->getValue('status');\n } else {\n $status = (bool) static::getValueOfSlice($ep->getParam('slice_id'), 'status', 1);\n }\n if (false === $status) {\n // slice is not active - don't show anything!\n return '';\n }\n }", "public function slice(int $start, ?int $length = null): VectorInterface;", "public function slice($offset, $length = null)\n {\n $this->data = array_slice($this->data, $offset, $length, true);\n\n return $this;\n }", "public function slice($offset, $length = null, $preserveKeys = true);", "public function evaluations()\n {\n return $this->belongsToMany('App\\Evaluation');\n }", "public function testSpliceWithArrayOfReplacements()\n {\n $slice = $this->collection->splice(1, 1, [7,8,9]);\n\n $this->assertInstanceOf(Collection::class, $slice);\n $this->assertAttributeEquals([2], 'elements', $slice);\n $this->assertAttributeEquals([1, 7, 8, 9, 3], 'elements', $this->collection);\n }", "public function assertArraySubset($subset, $array, $strict = null, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertArraySubset', func_get_args()));\n }", "public function assertArraySubset($subset, $array, $strict = null, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertArraySubset', func_get_args()));\n }", "public function rest() {\n return new LazySeq(\n function( $x ) { return $x; },\n array_slice( $this->items, 1 )\n );\n }", "function slice(array|string $input, int $start, int $end = null, bool $keep_keys = false): array|string\n{\n return is_array($input) ? array_slice($input, $start, $end, $keep_keys)\n : mb_substr($input, $start, $end);\n}", "public function slice(int $offset, int $length = null): \\IvoPetkov\\DataList\n {\n $this->update();\n $slice = array_slice($this->data, $offset, $length);\n $className = get_class($this);\n return new $className($slice);\n }", "protected function groupWhereSliceForScope(QueryBuilder $query, $whereSlice)\n {\n $whereBooleans = collect($whereSlice)->pluck('boolean');\n\n // Here we'll check if the given subset of where clauses contains any \"or\"\n // booleans and in this case create a nested where expression. That way\n // we don't add any unnecessary nesting thus keeping the query clean.\n if ($whereBooleans->contains('or')) {\n $query->wheres[] = $this->createNestedWhere(\n $whereSlice, $whereBooleans->first()\n );\n } else {\n $query->wheres = array_merge($query->wheres, $whereSlice);\n }\n }", "private function query($cursor, $limit) {\n // here. Since this is an example, we just use a premade dataset.\n\n return array_slice($this->data, $cursor, $limit);\n }", "public function slice($start, $amount);", "public function seriesDetailsSlice($lang, $id, $index = 0, $length = 100, $filter = null);", "public function slice_and_dice(){\n\n // Are we inside a section?\n $in_section = false;\n\n // The current Section name\n $section_name = '';\n\n // Output, as Layout file modified\n $output = '';\n\n // The canonical name of the Layout\n $layout_canonical_name = (string) new \\file_basename_for($this->layout_name);\n\n // The full path filename for the layout\n $filename = (string)new Theme_Root(getcwd(), $this->theme_name) . \"/$this->layout_name\";\n\n // Get model for saving sections in DB\n $page_model = (new Model('website_page'))\n\n ->find(\"name='$layout_canonical_name'\");\n\n // Have we substituted the sections for the directive yet?\n $is_replaced = false;\n\n // if we can open the file for reading...\n if ( ( $handle = fopen($filename,'r'))){\n\n while ( ($line = fgets($handle))!== false ){\n\n // Report for first file\n if ( self::$is_first_file && $this->verbose ) echo \"\\tLine: $line\";\n\n if ( preg_match('/<section/',$line,$hits)){\n\n if ( $this->verbose ) echo \"\\tFound an HTML <section> on line $line in Layout $layout_canonical_name\\r\\n\";\n\n\n $section_name = (string) new Section_Name($line,$layout_canonical_name);\n\n // Initialize content\n $this->sections[$section_name] = '';\n\n $in_section = true;\n\n if ( ! $is_replaced){\n\n $output .= file_get_contents(new Code_Alchemy_Root_Path().\"/templates/fragments/foreach-model-template.php\").\"\\r\\n\";\n\n $is_replaced = true;\n }\n }\n\n if ( $in_section )\n\n $this->sections[$section_name] .= $line;\n\n else\n\n $output .= $line;\n\n if ( preg_match('<\\/section>',$line) )\n\n $in_section = false;\n\n }\n\n // No longer the first file\n self::$is_first_file = false;\n\n\n if ( $output )\n\n file_put_contents($filename,$output);\n\n\n fclose($handle);\n\n // Write sections to database\n foreach ( $this->sections as $name => $section_data ) {\n\n // If DB Model for Page was found...\n if ( $page_model->exists){\n\n $section_model = (new Model('page_section'));\n\n if ( ! $section_model\n\n ->create_from(array(\n\n 'website_page_id' => $page_model->id,\n\n 'name' => $name,\n\n 'handlebars_template' => (string)\n\n new String_Values_Replacer($section_data,array(\n\n '/<\\?\\=\\$theme_root\\?\\>/' => '{{theme_root}}'\n ))\n\n )))\n\n echo \"\\t\".$section_model->error();\n\n else\n\n {\n\n if ( $this->verbose ) echo \"\\t$name: Section successfully extracted and added to database\\r\\n\";\n }\n\n\n\n }\n\n\n }\n\n\n }\n\n if ( $this->verbose ) echo \"\\t\". get_called_class().\" Sliced out \".count( $this->sections).\" from Layout $layout_canonical_name\\r\\n\";\n\n }", "public function actionEvaluate($id)\n {\n $model = $this->findModel($id);\n $instrument = Instrument::find()->where(['id' => $model->instrument_id])->one();\n $sections = Section::find()->where(['instrument_id' => $instrument->id ])->all();\n // echo $model->id;\n // die();\n $evalSections = $model->evaluationSections;\n $evalItems = [];\n $oldItems = [];\n if (!empty($evalSections)) {\n foreach ($evalSections as $indexSection => $modelSection) {\n \n $items = $modelSection->evaluationItems;\n $evalItems[$indexSection] = $items;\n $oldItems = ArrayHelper::merge(ArrayHelper::index($items, 'id'), $oldItems);\n \n }\n \n }\n if($model->evalBy->id !== Yii::$app->user->id){\n throw new \\yii\\web\\HttpException(401, 'You are Forbidden to Evaluate this Teacher for it is not yours to evaluate!');\n }elseif($model->status == 1){\n throw new \\yii\\web\\HttpException(401, \"You're done evaluating this teacher you cant change anything after you submit!\");\n }\n \n if (Yii::$app->request->post()) {\n // reset\n $evalItems = [];\n\n $oldSectionIDs = ArrayHelper::map($evalSections, 'id', 'id');\n $evalSections = Model::createMultiple(EvaluationSection::classname(), $evalSections);\n Model::loadMultiple($evalSections, Yii::$app->request->post());\n $deletedSectionIDs = array_diff($oldSectionIDs, array_filter(ArrayHelper::map($evalSections, 'id', 'id')));\n\n if (Yii::$app->request->isAjax) {\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ActiveForm::validateMultiple($evalSections);\n }\n\n // validate Evaluation and EvaluationSection models\n $valid = $model->validate();\n $valid = Model::validateMultiple($evalSections) && $valid;\n\n $itemsIDs = [];\n if (isset($_POST['EvaluationItem'][0][0])) {\n foreach ($_POST['EvaluationItem'] as $indexSection => $items) {\n $itemsIDs = ArrayHelper::merge($itemsIDs, array_filter(ArrayHelper::getColumn($items, 'id')));\n // die($itemsIDs);\n foreach ($items as $indexItem => $item) {\n $data['EvaluationItem'] = $item;\n $modelItem = (isset($item['id']) && isset($oldItems[$item['id']])) ? $oldItems[$item['id']] : new EvaluationItem;\n // $modelItem->scenario = 'update';\n $modelItem->load($data);\n $evalItems[$indexSection][$indexItem] = $modelItem;\n $valid = $modelItem->validate();\n }\n }\n }\n\n $oldItemsIDs = ArrayHelper::getColumn($oldItems, 'id');\n $deletedItemsIDs = array_diff($oldItemsIDs, $itemsIDs);\n\n if ($valid) {\n $transaction = Yii::$app->db->beginTransaction();\n try {\n if ($flag = $model->save(false)) {\n\n // if (! empty($deletedItemsIDs)) {\n // // EvaluationItem::deleteAll(['id' => $deletedItemsIDs]);\n // echo \"YEAH 1\";\n // die();\n // }\n\n // if (! empty($deletedSectionIDs)) {\n // // EvaluationsSection::deleteAll(['id' => $deletedSectionIDs]);\n // echo \"YEAH 2\";\n // die();\n // }\n \n foreach ($evalSections as $indexSection => $modelSection) {\n \n if ($flag === false) {\n break;\n }\n\n if (!($flag = $modelSection->save())) {\n break;\n }\n\n if (isset($evalItems[$indexSection]) && is_array($evalItems[$indexSection])) {\n foreach ($evalItems[$indexSection] as $indexItem => $modelItem) {\n \n if (!($flag = $modelItem->save(false))) {\n break;\n }\n }\n }\n }\n }\n $model->status = 1;\n $model->save();\n $transaction->commit();\n return $this->redirect(['/']);\n \n } catch (Exception $e) {\n $transaction->rollBack();\n }\n }\n }\n\n return $this->render('evaluate', [\n 'model' => $model,\n 'evalSections' => $evalSections,\n 'evalItems' => $evalItems\n ]);\n\n }", "public function evaluate();", "public function evaluate();", "public function slice(int $index, int $length = null): Sequence;", "public function evaluations()\n {\n return $this->hasMany(Evaluation::class);\n }", "public function seriesSlice($index = 0, $length = 100, $search = null, $translit = false);", "public function index()\n {\n \\Gate::authorize('view', 'competences_evaluations');\n $Evaluation = EvaluationCompetency::get();\n return $Evaluation;\n }", "function getSlice(int $start, int $end): string\n {\n if ($start === $end || $start < 0 || $end < 0) {\n return '';\n }\n\n if ($start < $end) {\n return (string) substr($this->html, $start, $end - $start);\n } else {\n return (string) substr($this->html, $end, $start - $end);\n }\n }", "public function createSlice($alias, array $values = array(), array $options = array());", "public function getSlice($page = 0, $perpage = 0)\n {\n return $this->_search($page, $perpage);\n }", "function custom_sdppi($scrap_raw, $slice_array = 44, $field_count = 10)\n\t{\n\t\t$data = [];\n\n\t\tif (!is_null($scrap_raw))\n\t\t{\n\t\t\t$result = array_slice($scrap_raw, $slice_array); // Menghilangkan data header/array header\n\t\t\t$total_array = count($result);\n\t\t\t$j = 0;\n\n\t\t\tfor ($i=0; $i < $total_array; $i++)\n\t\t\t{\n\t\t\t\t$temp = array_slice($result, $j, $field_count);\n\t\t\t\t// Memisahkan data per field_count elemen dengan syarat array tidak kosong, \n\t\t\t\t// data pertama setiap array adalah integer dan tidak lebih dari jumlah field_count - 1\n\t\t\t\tif (!empty($temp) AND is_numeric($temp[0]) AND count($temp) > ($field_count - 1))\n\t\t\t\t{\n\t\t\t\t\t$data[$i] = $temp;\n\t\t\t\t\t$j += $field_count;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}", "public function slice($offset, $length = null, $preserve = true) {\n\t\tif (!$length && $length !== 0) {\n\t\t\t$length = abs($offset);\n\t\t}\n\n\t\treturn array_slice($this->_value, (int) $offset, (int) $length, $preserve);\n\t}", "public function pop()\n {\n if (empty($this->_data)) {\n require_once 'MC/Array/Exception.php';\n throw new MC_Array_Exception(\"Not enough elements for this \" .\n \"operation\");\n }\n \n return array_pop($this->_data);\n }", "public function take($length)\n {\n if(!is_int($length))\n {\n throw new \\InvalidArgumentException();\n }\n\n if($length>=0 && $length>$this->length())\n {\n $length = $this->length();\n }\n elseif($length<0 && $length<(0-$this->length()))\n {\n $length = 0-$this->length();\n }\n\n $temp = $this->newInstance();\n\n if($length>=0)\n {\n $temp->setData(array_slice($this->getData(), 0, $length));\n }\n else\n {\n $temp->setData(array_slice($this->getData(), $length));\n }\n\n return $temp;\n }", "function dataset0 ( ) // 允許外界直接[接觸]到內部的_dataset (可能反向排序)\n{\n return $this->_dataset;\n}", "public function slice($offset, $length=null, $preserveKeys=false)\n {\n $class = $this->instance();\n \n $length = is_numeric($length) ? $length : $this->count() - $offset;\n \n return new $class(array_slice($this->_data, $offset, $length,\n $preserveKeys));\n }", "function expression_function_take($collection, $number)\n{\n if (is_array($collection)) {\n return array_slice($collection, 0, $number, true);\n } else if ($collection instanceof \\Iterator) {\n return new \\LimitIterator($collection, 0, $number);\n } else {\n throw new \\InvalidArgumentException('Collection must be an array or an Iterator');\n }\n}", "public static function slice(array $array, int $offset, int $limit): array\n {\n return array_slice($array, $offset, $limit);\n }", "static function getRubricEvalDemoData()\n {\n return array(\n 'event' => array(\n 'Event' => array(\n 'id' => 0,\n 'title' => 'Preview Event',\n 'due_date' => Toolkit::formatDate(time()+(5*24*60*60)),\n 'description' => 'Preview for rubric evaluation event.',\n 'com_req' => true,\n ),\n 'Group' => array(\n 'id' => 0,\n 'group_name' => 'Demo Group',\n ),\n ),\n 'groupMembers' => array(\n array(\n 'User' => array(\n 'id' => 1,\n 'first_name' => 'Demo',\n 'last_name' => 'Student1',\n ),\n ),\n array(\n 'User' => array(\n 'id' => 2,\n 'first_name' => 'Demo',\n 'last_name' => 'Student2',\n ),\n ),\n array(\n 'User' => array(\n 'id' => 3,\n 'first_name' => 'Demo',\n 'last_name' => 'Student3',\n ),\n ),\n ),\n 'courseId' => 0,\n 'userId' => 1,\n 'evaluateeCount' => 2,\n 'fullName' => User::get('full_name'),\n 'preview' => true,\n );\n }", "public function showSlices(HTMLFormTable $f)\n\t{\n\t\tforeach ($this->slices as $slice) {\n\t\t\t//$part = $this->sliceFromTill($this->desc, $slice['from'], $slice['till']);\n\t\t\t$part = $slice['desc'];\n\t\t\t$f->fieldset($slice['name'], $slice['fieldsetParams']);\n\t\t\t$f2 = new HTMLFormTable($part);\n\t\t\t$f2->showForm();\n\t\t\tthrow new Exception('TODO: test this');\n\t\t}\n\t\t//debug($slice);\n\t}", "function slice ($start, $len, $preserveKeys = false)\n {\n $this->A = array_slice ($this->A, $start, $len, $preserveKeys);\n return $this;\n }", "public function setEvaluation($evaluation)\n {\n $this->evaluation = $evaluation;\n\n return $this;\n }", "public function index()\n {\n return evaluationSummary::all();\n }", "public function getPartOfSeries() {\n\t\treturn $this->partOfSeries;\n\t}", "protected function _createSubset() {}", "public function slice(int $offset, int|null $length = null): array;", "public function __toString()\n {\n return (string)$this->slice(',')->toString();\n }", "public function getSlice($offset, $length): iterable\n {\n return $this->adapter->getResults($offset, $length)->toArray();\n }", "public function evaluation()\n {\n return $this->hasOne(\"App\\Services\\Evaluation\\Evaluation\", 'id_employee', 'id_assessor'); // one to many\n /*ถ้าตอน Query เอา table ไหนเป็นหลัก ตรง model ก็เอา pk ของ table นั้นขึ้นทีหลัง*/\n //return $this->hasMany(\"App\\Services\\Evaluation\\Evaluation\", 'id_assessor', 'id_employee'); // one to many\n }", "private function _getSlice($startPosition, $endPosition = 0)\n {\n if (!$endPosition) {\n $endPosition = strlen($this->_documentXML);\n }\n return substr($this->_documentXML, $startPosition, ($endPosition - $startPosition));\n }", "public function slice( $from, $count )\n {\n throw new UnmodifiableException(\"This collection cannot be changed\");\n }", "public function assertSubset($subset, $array)\n {\n $values = collect($array)->only(array_keys($subset))->all();\n\n $this->assertEquals($subset, $values, 'The expected subset does not match the given array.');\n }", "public function getSlice($offset, $length)\n {\n return $this->select\n ->limit($length)\n ->offset($offset)\n ->fetchAll();\n }", "public function testCanGetFilteredDatasetSnapshotProfiles() {\n AuthenticationHelper::login(\"admin@kinicart.com\", \"password\");\n\n\n $this->metaDataService->returnValue(\"getObjectTagsFromSummaries\", [\n new ObjectTag(new Tag(new TagSummary(\"Project\", \"My Project\", \"project\"), 2, \"soapSuds\")),\n new ObjectTag(new Tag(new TagSummary(\"Account2\", \"My Account\", \"account2\"), 2, \"soapSuds\"))\n ], [\n [\n new TagSummary(\"Project\", \"My Project\", \"project\"),\n new TagSummary(\"Account2\", \"My Account\", \"account2\")\n ], 2, \"soapSuds\"\n ]);\n\n\n $dataSetInstanceSummary = new DatasetInstanceSummary(\"Test dataset\", \"test-json\", null, [], [], []);\n $instanceId = $this->datasetService->saveDataSetInstance($dataSetInstanceSummary, null, 2);\n\n $dataSetInstanceSummary = new DatasetInstanceSummary(\"Another dataset\", \"test-json\", null, [], [], []);\n $instance2Id = $this->datasetService->saveDataSetInstance($dataSetInstanceSummary, \"soapSuds\", 2);\n\n $dataSetInstanceSummary = new DatasetInstanceSummary(\"Yet Another dataset\", \"test-json\", null, [], [], []);\n $dataSetInstanceSummary->setTags(\n [new TagSummary(\"Project\", \"My Project\", \"project\"),\n new TagSummary(\"Account2\", \"My Account\", \"account2\")]\n );\n $instance3Id = $this->datasetService->saveDataSetInstance($dataSetInstanceSummary, \"soapSuds\", 2);\n\n\n $snapshotProfile1 = new DatasetInstanceSnapshotProfileSummary(\"Daily Snapshot\", \"tabulardatasetsnapshot\", [\n ], DatasetInstanceSnapshotProfileSummary::TRIGGER_SCHEDULE, [\n new ScheduledTaskTimePeriod(null, null, 0, 0)\n ]);\n\n $snapshotProfile1Id = $this->datasetService->saveSnapshotProfile($snapshotProfile1, $instanceId);\n\n\n $snapshotProfile2 = new DatasetInstanceSnapshotProfileSummary(\"Weekly Snapshot\", \"tabulardatasetsnapshot\", [\n ], DatasetInstanceSnapshotProfileSummary::TRIGGER_SCHEDULE, [\n new ScheduledTaskTimePeriod(null, 1, 0, 0)\n ]);\n\n\n $snapshotProfile2Id = $this->datasetService->saveSnapshotProfile($snapshotProfile2, $instanceId);\n\n\n $snapshotProfile3 = new DatasetInstanceSnapshotProfileSummary(\"Daily Snapshot\", \"tabulardatasetsnapshot\", [\n ], DatasetInstanceSnapshotProfileSummary::TRIGGER_SCHEDULE, [\n new ScheduledTaskTimePeriod(null, null, 0, 0)\n ]);\n\n $snapshotProfile3Id = $this->datasetService->saveSnapshotProfile($snapshotProfile3, $instance2Id);\n\n\n $snapshotProfile4 = new DatasetInstanceSnapshotProfileSummary(\"Weekly Snapshot\", \"tabulardatasetsnapshot\", [\n ], DatasetInstanceSnapshotProfileSummary::TRIGGER_SCHEDULE, [\n new ScheduledTaskTimePeriod(null, 1, 0, 0)\n ]);\n\n\n $snapshotProfile4Id = $this->datasetService->saveSnapshotProfile($snapshotProfile4, $instance2Id);\n\n\n $snapshotProfile5 = new DatasetInstanceSnapshotProfileSummary(\"Tagged Snapshot\", \"tabulardatasetsnapshot\", [\n ], DatasetInstanceSnapshotProfileSummary::TRIGGER_SCHEDULE, [\n new ScheduledTaskTimePeriod(null, 1, 0, 0)\n ]);\n\n\n $snapshotProfile5Id = $this->datasetService->saveSnapshotProfile($snapshotProfile5, $instance3Id);\n\n\n $snapshotProfile1 = DatasetInstanceSnapshotProfile::fetch($snapshotProfile1Id);\n $snapshotProfile2 = DatasetInstanceSnapshotProfile::fetch($snapshotProfile2Id);\n $snapshotProfile3 = DatasetInstanceSnapshotProfile::fetch($snapshotProfile3Id);\n $snapshotProfile4 = DatasetInstanceSnapshotProfile::fetch($snapshotProfile4Id);\n $snapshotProfile5 = DatasetInstanceSnapshotProfile::fetch($snapshotProfile5Id);\n\n\n // Now check we get back what we are expecting in alphabetical order for an account only query\n $matches = $this->datasetService->filterSnapshotProfiles(\"\", [], null, 0, 10, 2);\n $this->assertEquals(5, sizeof($matches));\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile3), $matches[0]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile4), $matches[1]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile1), $matches[2]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile2), $matches[3]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile5), $matches[4]);\n\n\n // Limit to project\n $matches = $this->datasetService->filterSnapshotProfiles(\"\", [], \"soapSuds\", 0, 10, 2);\n $this->assertEquals(3, sizeof($matches));\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile3), $matches[0]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile4), $matches[1]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile5), $matches[2]);\n\n\n // Limit to project and tags\n $matches = $this->datasetService->filterSnapshotProfiles(\"\", [\"project\"], \"soapSuds\", 0, 10, 2);\n $this->assertEquals(1, sizeof($matches));\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile5), $matches[0]);\n\n // Check special NONE tag\n $matches = $this->datasetService->filterSnapshotProfiles(\"\", [\"NONE\"], null, 0, 10, 2);\n $this->assertEquals(4, sizeof($matches));\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile3), $matches[0]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile4), $matches[1]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile1), $matches[2]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile2), $matches[3]);\n\n\n // Limit to filter string\n $matches = $this->datasetService->filterSnapshotProfiles(\"another\", [], null, 0, 10, 2);\n $this->assertEquals(3, sizeof($matches));\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile3), $matches[0]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile4), $matches[1]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile5), $matches[2]);\n\n $matches = $this->datasetService->filterSnapshotProfiles(\"daily\", [], null, 0, 10, 2);\n $this->assertEquals(2, sizeof($matches));\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile3), $matches[0]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile1), $matches[1]);\n\n\n // Offset and limit\n $matches = $this->datasetService->filterSnapshotProfiles(\"\", [], null, 0, 3, 2);\n $this->assertEquals(3, sizeof($matches));\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile3), $matches[0]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile4), $matches[1]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile1), $matches[2]);\n\n\n $matches = $this->datasetService->filterSnapshotProfiles(\"\", [], null, 1, 3, 2);\n $this->assertEquals(3, sizeof($matches));\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile4), $matches[0]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile1), $matches[1]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile2), $matches[2]);\n }", "function Get() {\n\t\t\treturn array_pop($this->_Data);\n\t\t}", "static function custom_slice_directive($content)\n\t{\n\t\t$pattern = '/(\\s*)@slice\\s*\\((\\'.*\\')\\)/';\n\t\treturn preg_replace($pattern, '$1<?php echo \"$2\"; ?>', $content);\n\t}", "public function slice($offset, $length = null, $preserveKeys = true)\n {\n $data = array_slice($this->_data, $offset, $length, $preserveKeys);\n return new static($data);\n }", "public static function slice($string, $start, $end = null)\n {\n if ($end !== null) {\n $end -= $start;\n }\n\n if (function_exists('mb_substr')) {\n return mb_substr($string, $start, $end, static::getEncoding());\n }\n\n if (function_exists('iconv_substr')) {\n return iconv_substr($string, $start, $end ?: iconv_strlen($string), static::getEncoding());\n }\n\n throw new RuntimeException('Unreachable');\n }", "public function evaluations()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Evaluation', 'application_id');\n\t}", "public function isSubsettable() {}", "public function getData()\n {\n $data = $this->only(['name', 'nr_days', 'nr_weeks', 'slots_per_day', 'begin_hour', 'week_days', 'minutes_per_slot', 'time_optimization', 'room_optimization', 'distribution_optimization', 'student_optimisation', 'is_random', 'problem_class']);\n\n return $data;\n }", "protected function getSlice($startPosition, $endPosition = 0)\n {\n if (!$endPosition) {\n $endPosition = strlen($this->tempDocumentMainPart);\n }\n\n return substr($this->tempDocumentMainPart, $startPosition, ($endPosition - $startPosition));\n }", "public function sliceTraduct($slice)\n {\n if ($slice == 'DAY') {\n return 'Journée';\n } elseif ($slice == 'AM') {\n return 'Matin';\n } elseif ($slice == 'PM') {\n return 'Aprés Midi';\n }\n }", "public function Out($i){\n\treturn $this->output[$this->num_of_layers-1][$i];\n}", "function Query($start=0,$slice=0,$res_type=\"LIST\",$p_query=\"\") {\n \n $query=$this->initQuery($start,$slice,$p_query);\n $this->res_type=$res_type;\t\n $err = $this->basic_elem->exec_query($query);\n //\tprint \"$query $res_type $p_query<BR>\\n\";\n if ($err != \"\") return($err); \n\n $this->nb = $this->basic_elem->numrows(); \n \n if ($this->nb ==0) {\n\treturn FALSE;\n }\n if ($res_type == \"ITEM\") {\n\t$this->cindex=0; // current index row\n\treturn $this->basic_elem->res;\n }\n if ($start >= $this->nb) {$start=0;}\n if ($slice == 0) {$slice = $this->nb;}\n\n if (($start+$slice) >= $this->nb) {\n $end = $this->nb;\n } else {\n $end = $start + $slice;\n }\n for ($c=0; $c<$this->nb;$c++) {\n \n $result = $this->basic_elem->fetch_array($c);\n if (($res_type == \"LIST\") || ($res_type == \"LISTC\")) {\n $this->list[$c] = new $this->class($this->dbaccess,\"\",$result,$this->basic_elem->dbid);\n } else {\n while (list($k,$v)=each( $result)) {\n $this->list[$c][$k]=$v;\n }\n }\n \n }\n\n return($this->list);\n }", "public function getArrayCopy()\n {\n return $this->data;\n }", "function getEvaluationAccess() \n\t{\n\t\treturn ($this->evaluation_access) ? $this->evaluation_access : self::EVALUATION_ACCESS_OFF;\n\t}" ]
[ "0.7474064", "0.56739676", "0.5302312", "0.52739674", "0.50691116", "0.48030996", "0.46248507", "0.44365036", "0.44120222", "0.4294863", "0.42571092", "0.4237816", "0.4236467", "0.42203498", "0.41853246", "0.41655838", "0.41303355", "0.40906665", "0.408756", "0.40767157", "0.40657678", "0.4061608", "0.40559813", "0.40462038", "0.40126657", "0.40079984", "0.4003981", "0.39750606", "0.39660123", "0.39640042", "0.39640042", "0.38865283", "0.38810945", "0.38744748", "0.3853654", "0.38342142", "0.38245538", "0.3823629", "0.38183168", "0.38139975", "0.38084552", "0.37856585", "0.37749738", "0.376545", "0.376545", "0.37554088", "0.37493408", "0.37391144", "0.37376836", "0.372869", "0.37197682", "0.37157792", "0.37059897", "0.3694371", "0.36911097", "0.36911097", "0.3682424", "0.36763707", "0.36721036", "0.36688527", "0.3654914", "0.3654576", "0.3653367", "0.3637934", "0.36299464", "0.3621829", "0.36206067", "0.36101952", "0.36010993", "0.359148", "0.35855842", "0.35821092", "0.35820603", "0.35748532", "0.3572509", "0.35695902", "0.35441145", "0.35355282", "0.35310882", "0.35121906", "0.35072243", "0.34999615", "0.34995714", "0.3492806", "0.34886482", "0.34641728", "0.3459418", "0.34418955", "0.3439602", "0.34388998", "0.34251997", "0.3418237", "0.34131888", "0.340976", "0.3406388", "0.33908895", "0.33817407", "0.33804953", "0.3372782", "0.3371842" ]
0.60680544
1
Output only. The slice of the test data that is used to evaluate the Model. Generated from protobuf field .google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice slice = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
public function setSlice($var) { GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\ModelEvaluationSlice\Slice::class); $this->slice = $var; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSlice()\n {\n return $this->slice;\n }", "public function testSlice()\n {\n $slice = $this->collection->slice(1, 1);\n\n $this->assertInstanceOf(Collection::class, $slice);\n $this->assertAttributeEquals([1 => 2], 'elements', $slice);\n $this->assertAttributeEquals([1, 2, 3], 'elements', $this->collection);\n }", "public function getSliceName() {\n return $this->sliceName;\n }", "public function testSliceWithoutArgs()\n {\n $slice = $this->collection->slice();\n\n $this->assertInstanceOf(Collection::class, $slice);\n $this->assertAttributeEquals([], 'elements', $slice);\n $this->assertAttributeEquals([1, 2, 3], 'elements', $this->collection);\n }", "public function ListModelEvaluationSlices(\\Google\\Cloud\\AIPlatform\\V1\\ListModelEvaluationSlicesRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/ListModelEvaluationSlices',\n $argument,\n ['\\Google\\Cloud\\AIPlatform\\V1\\ListModelEvaluationSlicesResponse', 'decode'],\n $metadata, $options);\n }", "public function BatchImportModelEvaluationSlices(\\Google\\Cloud\\AIPlatform\\V1\\BatchImportModelEvaluationSlicesRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/BatchImportModelEvaluationSlices',\n $argument,\n ['\\Google\\Cloud\\AIPlatform\\V1\\BatchImportModelEvaluationSlicesResponse', 'decode'],\n $metadata, $options);\n }", "public function setSliceName($sliceName) {\n $this->sliceName = $sliceName;\n return $this;\n }", "public function getArticleSliceService() {\n\t\treturn $this->get('sly-service-articleslice');\n\t}", "public function getSlicing() {\n return $this->slicing;\n }", "public function slice($offset, $length = null)\n {\n if (!$this->initialized && !$this->isDirty && $this->association['fetch'] === ApiMetadata::FETCH_EXTRA_LAZY) {\n $persister = $this->manager->getUnitOfWork()->getCollectionPersister($this->association);\n\n return $persister->slice($this, $offset, $length);\n }\n\n return parent::slice($offset, $length);\n }", "public function testSplice()\n {\n $slice = $this->collection->splice(1, 1);\n\n $this->assertInstanceOf(Collection::class, $slice);\n $this->assertAttributeEquals([2], 'elements', $slice);\n $this->assertAttributeEquals([1, 3], 'elements', $this->collection);\n }", "public function testSpliceWithoutArgs()\n {\n $slice = $this->collection->splice();\n\n $this->assertInstanceOf(Collection::class, $slice);\n $this->assertAttributeEquals([], 'elements', $slice);\n $this->assertAttributeEquals([1, 2, 3], 'elements', $this->collection);\n }", "public function generateExtraDataForSlice (Slice $slice) : array\n\t{\n\t\t$result = [];\n\n\t\t/** @var SliceExtraDataGeneratorInterface $dataGenerator */\n\t\tforeach ($this->sliceExtraDataGenerators as $dataGenerator)\n\t\t{\n\t\t\t$result = $dataGenerator->appendExtraData($slice, $result);\n\t\t}\n\n\t\treturn $result;\n\t}", "public function slice(int $start = 0, int $end = 3): array {\n\n return array_slice($this->data, $start, $end);\n }", "public function slice($start, $length)\n {\n return new self(array_slice($this->inputs, $start, $length));\n }", "public function dataset()\n {\n return $this->data;\n }", "public function getSliceSettingsDefaultData()\n {\n $settings = array(\n 'slice_1' => array(\n 'label' => '10% OFF',\n 'discount_type' => 'percent',\n 'value' => 10,\n 'gravity' => '20',\n ),\n 'slice_2' => array(\n 'label' => 'Not Lucky Today',\n 'discount_type' => 'fixed',\n 'value' => 0,\n 'gravity' => '5',\n ),\n 'slice_3' => array(\n 'label' => '35% OFF',\n 'discount_type' => 'percent',\n 'value' => 35,\n 'gravity' => '0',\n ),\n 'slice_4' => array(\n 'label' => 'Opps! Sorry',\n 'discount_type' => 'fixed',\n 'value' => 0,\n 'gravity' => '5',\n ),\n 'slice_5' => array(\n 'label' => '15% OFF',\n 'discount_type' => 'percent',\n 'value' => 15,\n 'gravity' => '10',\n ),\n 'slice_6' => array(\n 'label' => 'Better Luck Next Time',\n 'discount_type' => 'fixed',\n 'value' => 0,\n 'gravity' => '10',\n ),\n 'slice_7' => array(\n 'label' => '50% OFF',\n 'discount_type' => 'percent',\n 'value' => 50,\n 'gravity' => '0',\n ),\n 'slice_8' => array(\n 'label' => 'Try Next Time',\n 'discount_type' => 'fixed',\n 'value' => 0,\n 'gravity' => '10',\n ),\n 'slice_9' => array(\n 'label' => 'Free Shipping',\n 'discount_type' => 'freeship',\n 'value' => 0,\n 'gravity' => '10',\n ),\n 'slice_10' => array(\n 'label' => 'Come Again',\n 'discount_type' => 'fixed',\n 'value' => 0,\n 'gravity' => '10',\n ),\n 'slice_11' => array(\n 'label' => '5% OFF',\n 'discount_type' => 'percent',\n 'value' => 5,\n 'gravity' => '10',\n ),\n 'slice_12' => array(\n 'label' => 'Try Again',\n 'discount_type' => 'fixed',\n 'value' => 0,\n 'gravity' => '10',\n )\n );\n return $settings;\n }", "public function getEvaluations();", "public function setSlicing($slicing) {\n $this->slicing = $slicing;\n return $this;\n }", "public function run()\n {\n $part_b_evals = [\n // self-evaluations col 1 part b\n ['group_id' => '2','choice_id' => '81','meta' => '1'],\n ['group_id' => '2','choice_id' => '85','meta' => '1'],\n ['group_id' => '2','choice_id' => '89','meta' => '1'],\n ['group_id' => '2','choice_id' => '93','meta' => '1'],\n ['group_id' => '2','choice_id' => '97','meta' => '1'],\n ['group_id' => '2','choice_id' => '101','meta' => '1'],\n ['group_id' => '2','choice_id' => '105','meta' => '1'],\n ['group_id' => '2','choice_id' => '109','meta' => '1'],\n ['group_id' => '2','choice_id' => '113','meta' => '1'],\n ['group_id' => '2','choice_id' => '117','meta' => '1'],\n ['group_id' => '2','choice_id' => '121','meta' => '1'],\n ['group_id' => '2','choice_id' => '125','meta' => '1'],\n ['group_id' => '2','choice_id' => '129','meta' => '1'],\n ['group_id' => '2','choice_id' => '133','meta' => '1'],\n ['group_id' => '2','choice_id' => '137','meta' => '1'],\n ['group_id' => '2','choice_id' => '141','meta' => '1'],\n ['group_id' => '2','choice_id' => '145','meta' => '1'],\n ['group_id' => '2','choice_id' => '149','meta' => '1'],\n ['group_id' => '2','choice_id' => '153','meta' => '1'],\n ['group_id' => '2','choice_id' => '157','meta' => '1'],\n\n // self-evaluations col 2 part b\n ['group_id' => '2','choice_id' => '82','meta' => '2'],\n ['group_id' => '2','choice_id' => '86','meta' => '2'],\n ['group_id' => '2','choice_id' => '90','meta' => '2'],\n ['group_id' => '2','choice_id' => '94','meta' => '2'],\n ['group_id' => '2','choice_id' => '98','meta' => '2'],\n ['group_id' => '2','choice_id' => '102','meta' => '2'],\n ['group_id' => '2','choice_id' => '106','meta' => '2'],\n ['group_id' => '2','choice_id' => '110','meta' => '2'],\n ['group_id' => '2','choice_id' => '114','meta' => '2'],\n ['group_id' => '2','choice_id' => '118','meta' => '2'],\n ['group_id' => '2','choice_id' => '122','meta' => '2'],\n ['group_id' => '2','choice_id' => '126','meta' => '2'],\n ['group_id' => '2','choice_id' => '130','meta' => '2'],\n ['group_id' => '2','choice_id' => '134','meta' => '2'],\n ['group_id' => '2','choice_id' => '138','meta' => '2'],\n ['group_id' => '2','choice_id' => '142','meta' => '2'],\n ['group_id' => '2','choice_id' => '146','meta' => '2'],\n ['group_id' => '2','choice_id' => '150','meta' => '2'],\n ['group_id' => '2','choice_id' => '154','meta' => '2'],\n ['group_id' => '2','choice_id' => '158','meta' => '2'],\n\n // self-evaluations col 3 part b\n ['group_id' => '2','choice_id' => '83','meta' => '3'],\n ['group_id' => '2','choice_id' => '87','meta' => '3'],\n ['group_id' => '2','choice_id' => '91','meta' => '3'],\n ['group_id' => '2','choice_id' => '95','meta' => '3'],\n ['group_id' => '2','choice_id' => '99','meta' => '3'],\n ['group_id' => '2','choice_id' => '103','meta' => '3'],\n ['group_id' => '2','choice_id' => '107','meta' => '3'],\n ['group_id' => '2','choice_id' => '111','meta' => '3'],\n ['group_id' => '2','choice_id' => '115','meta' => '3'],\n ['group_id' => '2','choice_id' => '119','meta' => '3'],\n ['group_id' => '2','choice_id' => '123','meta' => '3'],\n ['group_id' => '2','choice_id' => '127','meta' => '3'],\n ['group_id' => '2','choice_id' => '131','meta' => '3'],\n ['group_id' => '2','choice_id' => '135','meta' => '3'],\n ['group_id' => '2','choice_id' => '139','meta' => '3'],\n ['group_id' => '2','choice_id' => '143','meta' => '3'],\n ['group_id' => '2','choice_id' => '147','meta' => '3'],\n ['group_id' => '2','choice_id' => '151','meta' => '3'],\n ['group_id' => '2','choice_id' => '155','meta' => '3'],\n ['group_id' => '2','choice_id' => '159','meta' => '3'],\n\n // self-evaluations col 4 part b\n ['group_id' => '2','choice_id' => '84','meta' => '4'],\n ['group_id' => '2','choice_id' => '88','meta' => '4'],\n ['group_id' => '2','choice_id' => '92','meta' => '4'],\n ['group_id' => '2','choice_id' => '96','meta' => '4'],\n ['group_id' => '2','choice_id' => '100','meta' => '4'],\n ['group_id' => '2','choice_id' => '104','meta' => '4'],\n ['group_id' => '2','choice_id' => '108','meta' => '4'],\n ['group_id' => '2','choice_id' => '112','meta' => '4'],\n ['group_id' => '2','choice_id' => '116','meta' => '4'],\n ['group_id' => '2','choice_id' => '120','meta' => '4'],\n ['group_id' => '2','choice_id' => '124','meta' => '4'],\n ['group_id' => '2','choice_id' => '128','meta' => '4'],\n ['group_id' => '2','choice_id' => '132','meta' => '4'],\n ['group_id' => '2','choice_id' => '136','meta' => '4'],\n ['group_id' => '2','choice_id' => '140','meta' => '4'],\n ['group_id' => '2','choice_id' => '144','meta' => '4'],\n ['group_id' => '2','choice_id' => '148','meta' => '4'],\n ['group_id' => '2','choice_id' => '152','meta' => '4'],\n ['group_id' => '2','choice_id' => '156','meta' => '4'],\n ['group_id' => '2','choice_id' => '160','meta' => '4'],\n ];\n\n foreach ($part_b_evals as $key => $value) {\n Evaluation::create($value);\n }\n }", "public function slice(int $offset, ?int $length = null): CollectionInterface;", "public function validate()\n\t{\n\t\t$result = true;\n\t\tforeach ($this->slices as &$slice) {\n\t\t\t//debug($slice['name'] . ' ('.$slice['from'].'-'.$slice['till'].': '.sizeof($slice['desc']).')');\n\t\t\t$f2 = new HTMLFormTable($slice['desc']);\n\t\t\t$v = new HTMLFormValidate($f2);\n\t\t\t$result = $v->validate() && $result; // recursive inside // this order to force execution\n\t\t\t$slice['desc'] = $v->getDesc();\n\t\t}\n\t\t//debug($this->slices);\n\t\treturn $result;\n\t}", "public function retrieve(){\n\t\t$this->queried = false;\n\t\t\n\t\t$this->Subset = array();\n\t\t$subset = $this->Data;\n\t\t\n\t\t/* Order */\n\t\t$order = $this->Storage->retrieve('order');\n\t\tif($order && $sequence = $this->getArguments($order)){\n\t\t\t$DataComparison = new DataComparison;\n\t\t\tforeach($sequence as $seq){\n\t\t\t\t$seq = array_map('trim', explode(' ', $seq));\n\t\t\t\tif(empty($seq[0])) continue;\n\t\t\t\t\n\t\t\t\t$DataComparison->setField($seq[0])->setOrder(!(!empty($seq[1]) && String::toLower($seq[1])=='desc'));\n\t\t\t\tuasort($subset, array($DataComparison, 'sort'));\n\t\t\t}\n\t\t}\n\t\t/* Limit */\n\t\t$limit = $this->Storage->retrieve('limit');\n\t\tif(is_array($limit) && ($limit[0] || $limit[1])){\n\t\t\t$i = -1;\n\t\t\tforeach($subset as $k => $v){\n\t\t\t\t$i++;\n\t\t\t\tif($limit[0] && $i<$limit[0]) continue;\n\t\t\t\t\n\t\t\t\t$this->Subset[$k] = $v;\n\t\t\t\tif($i>$limit[1]) break;\n\t\t\t}\n\t\t}else\n\t\t\t$this->Subset = $subset;\n\t\t\n\t\tunset($subset);\n\t\t\n\t\t/* Fields */\n\t\t$fields = $this->Storage->retrieve('fields');\n\t\tif($fields && $checks = $this->getArguments($fields))\n\t\t\tforeach($this->Subset as $k => $data){\n\t\t\t\t$filtered = array();\n\t\t\t\tforeach($data as $key => $value)\n\t\t\t\t\tif(in_array($key, $checks))\n\t\t\t\t\t\t$filtered[$key] = $value;\n\t\t\t\t\n\t\t\t\t$this->Subset[$k] = $filtered;\n\t\t\t}\n\t\t\n\t\t\n\t\treturn $this->Subset;\n\t}", "public function getSlice($offset, $length)\n\t{\n\t\treturn $this->collection->slice($offset, $length);\n\t}", "public function take($limit)\n {\n $this->dataToArray();\n\n return new self(array_slice($this->data, 0, $limit));\n }", "public function slice(int $start, int $length): self\n {\n $items = array_slice($this->items, $start, $length);\n $collection = new self();\n $collection->items = $items;\n $collection->length = $length;\n\n return $collection;\n }", "public function index()\n\t{\n\t\t$this->slice->with('full_name', 'John Doe')\n\t\t\t\t\t->with('users', [['id' => 1, 'name' => 'John'], ['id' => 2, 'name' => 'Jane'], ['id' => 3, 'name' => 'Dave'], ['id' => 4, 'name' => 'Arthur'], ['id' => 5, 'name' => 'Michael'], ['id' => 6, 'name' => 'Ben']])\n\t\t\t\t\t->with('members', [])\n\t\t\t\t\t->with('rows', '0')\n\t\t\t\t\t->directive('Test::custom_slice_directive');\n\n\t\t//\tSlice-Library 1.3 comes with helpers to make things easier!\n\t\tview('page');\n\t}", "public function getEvaluation()\n {\n return $this->evaluation;\n }", "public function edit(Evaluation $evaluation)\n {\n return $evaluation;\n }", "public static function connectionFromArraySlice(array $arraySlice, $args, $meta)\n {\n }", "public static function connectionFromArraySlice(array $arraySlice, $args, $meta)\n {\n }", "public function slice(int $offset, int $length = null): self;", "abstract public function slice($offset, $length = null, $preserveKeys = false);", "public function testSpliceWithScalarReplacement()\n {\n $slice = $this->collection->splice(1, 1, 7);\n\n $this->assertInstanceOf(Collection::class, $slice);\n $this->assertAttributeEquals([2], 'elements', $slice);\n $this->assertAttributeEquals([1, 7, 3], 'elements', $this->collection);\n }", "public function getObservations()\n {\n return $this->observations;\n }", "public function getSlice($offset, $length)\n {\n $result = $this->sphinxQL->limit($length)->offset($offset)->execute()->fetchAllAssoc();\n\n return $this->persister->transformToEntity($result);\n }", "public function evaluation()\n {\n return $this->hasMany('App\\Models\\Evaluation', 'user_id');\n }", "public static function showSlice(rex_extension_point $ep)\n {\n if ($ep->hasParam('sql')) {\n /** @var rex_sql $sql */\n $sql = $ep->getParam('sql');\n $status = (bool) $sql->getValue('status');\n } else {\n $status = (bool) static::getValueOfSlice($ep->getParam('slice_id'), 'status', 1);\n }\n if (false === $status) {\n // slice is not active - don't show anything!\n return '';\n }\n }", "public function slice(int $start, ?int $length = null): VectorInterface;", "public function slice($offset, $length = null)\n {\n $this->data = array_slice($this->data, $offset, $length, true);\n\n return $this;\n }", "public function slice($offset, $length = null, $preserveKeys = true);", "public function evaluations()\n {\n return $this->belongsToMany('App\\Evaluation');\n }", "public function testSpliceWithArrayOfReplacements()\n {\n $slice = $this->collection->splice(1, 1, [7,8,9]);\n\n $this->assertInstanceOf(Collection::class, $slice);\n $this->assertAttributeEquals([2], 'elements', $slice);\n $this->assertAttributeEquals([1, 7, 8, 9, 3], 'elements', $this->collection);\n }", "public function assertArraySubset($subset, $array, $strict = null, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertArraySubset', func_get_args()));\n }", "public function assertArraySubset($subset, $array, $strict = null, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertArraySubset', func_get_args()));\n }", "public function rest() {\n return new LazySeq(\n function( $x ) { return $x; },\n array_slice( $this->items, 1 )\n );\n }", "function slice(array|string $input, int $start, int $end = null, bool $keep_keys = false): array|string\n{\n return is_array($input) ? array_slice($input, $start, $end, $keep_keys)\n : mb_substr($input, $start, $end);\n}", "public function slice(int $offset, int $length = null): \\IvoPetkov\\DataList\n {\n $this->update();\n $slice = array_slice($this->data, $offset, $length);\n $className = get_class($this);\n return new $className($slice);\n }", "protected function groupWhereSliceForScope(QueryBuilder $query, $whereSlice)\n {\n $whereBooleans = collect($whereSlice)->pluck('boolean');\n\n // Here we'll check if the given subset of where clauses contains any \"or\"\n // booleans and in this case create a nested where expression. That way\n // we don't add any unnecessary nesting thus keeping the query clean.\n if ($whereBooleans->contains('or')) {\n $query->wheres[] = $this->createNestedWhere(\n $whereSlice, $whereBooleans->first()\n );\n } else {\n $query->wheres = array_merge($query->wheres, $whereSlice);\n }\n }", "private function query($cursor, $limit) {\n // here. Since this is an example, we just use a premade dataset.\n\n return array_slice($this->data, $cursor, $limit);\n }", "public function slice($start, $amount);", "public function seriesDetailsSlice($lang, $id, $index = 0, $length = 100, $filter = null);", "public function slice_and_dice(){\n\n // Are we inside a section?\n $in_section = false;\n\n // The current Section name\n $section_name = '';\n\n // Output, as Layout file modified\n $output = '';\n\n // The canonical name of the Layout\n $layout_canonical_name = (string) new \\file_basename_for($this->layout_name);\n\n // The full path filename for the layout\n $filename = (string)new Theme_Root(getcwd(), $this->theme_name) . \"/$this->layout_name\";\n\n // Get model for saving sections in DB\n $page_model = (new Model('website_page'))\n\n ->find(\"name='$layout_canonical_name'\");\n\n // Have we substituted the sections for the directive yet?\n $is_replaced = false;\n\n // if we can open the file for reading...\n if ( ( $handle = fopen($filename,'r'))){\n\n while ( ($line = fgets($handle))!== false ){\n\n // Report for first file\n if ( self::$is_first_file && $this->verbose ) echo \"\\tLine: $line\";\n\n if ( preg_match('/<section/',$line,$hits)){\n\n if ( $this->verbose ) echo \"\\tFound an HTML <section> on line $line in Layout $layout_canonical_name\\r\\n\";\n\n\n $section_name = (string) new Section_Name($line,$layout_canonical_name);\n\n // Initialize content\n $this->sections[$section_name] = '';\n\n $in_section = true;\n\n if ( ! $is_replaced){\n\n $output .= file_get_contents(new Code_Alchemy_Root_Path().\"/templates/fragments/foreach-model-template.php\").\"\\r\\n\";\n\n $is_replaced = true;\n }\n }\n\n if ( $in_section )\n\n $this->sections[$section_name] .= $line;\n\n else\n\n $output .= $line;\n\n if ( preg_match('<\\/section>',$line) )\n\n $in_section = false;\n\n }\n\n // No longer the first file\n self::$is_first_file = false;\n\n\n if ( $output )\n\n file_put_contents($filename,$output);\n\n\n fclose($handle);\n\n // Write sections to database\n foreach ( $this->sections as $name => $section_data ) {\n\n // If DB Model for Page was found...\n if ( $page_model->exists){\n\n $section_model = (new Model('page_section'));\n\n if ( ! $section_model\n\n ->create_from(array(\n\n 'website_page_id' => $page_model->id,\n\n 'name' => $name,\n\n 'handlebars_template' => (string)\n\n new String_Values_Replacer($section_data,array(\n\n '/<\\?\\=\\$theme_root\\?\\>/' => '{{theme_root}}'\n ))\n\n )))\n\n echo \"\\t\".$section_model->error();\n\n else\n\n {\n\n if ( $this->verbose ) echo \"\\t$name: Section successfully extracted and added to database\\r\\n\";\n }\n\n\n\n }\n\n\n }\n\n\n }\n\n if ( $this->verbose ) echo \"\\t\". get_called_class().\" Sliced out \".count( $this->sections).\" from Layout $layout_canonical_name\\r\\n\";\n\n }", "public function actionEvaluate($id)\n {\n $model = $this->findModel($id);\n $instrument = Instrument::find()->where(['id' => $model->instrument_id])->one();\n $sections = Section::find()->where(['instrument_id' => $instrument->id ])->all();\n // echo $model->id;\n // die();\n $evalSections = $model->evaluationSections;\n $evalItems = [];\n $oldItems = [];\n if (!empty($evalSections)) {\n foreach ($evalSections as $indexSection => $modelSection) {\n \n $items = $modelSection->evaluationItems;\n $evalItems[$indexSection] = $items;\n $oldItems = ArrayHelper::merge(ArrayHelper::index($items, 'id'), $oldItems);\n \n }\n \n }\n if($model->evalBy->id !== Yii::$app->user->id){\n throw new \\yii\\web\\HttpException(401, 'You are Forbidden to Evaluate this Teacher for it is not yours to evaluate!');\n }elseif($model->status == 1){\n throw new \\yii\\web\\HttpException(401, \"You're done evaluating this teacher you cant change anything after you submit!\");\n }\n \n if (Yii::$app->request->post()) {\n // reset\n $evalItems = [];\n\n $oldSectionIDs = ArrayHelper::map($evalSections, 'id', 'id');\n $evalSections = Model::createMultiple(EvaluationSection::classname(), $evalSections);\n Model::loadMultiple($evalSections, Yii::$app->request->post());\n $deletedSectionIDs = array_diff($oldSectionIDs, array_filter(ArrayHelper::map($evalSections, 'id', 'id')));\n\n if (Yii::$app->request->isAjax) {\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ActiveForm::validateMultiple($evalSections);\n }\n\n // validate Evaluation and EvaluationSection models\n $valid = $model->validate();\n $valid = Model::validateMultiple($evalSections) && $valid;\n\n $itemsIDs = [];\n if (isset($_POST['EvaluationItem'][0][0])) {\n foreach ($_POST['EvaluationItem'] as $indexSection => $items) {\n $itemsIDs = ArrayHelper::merge($itemsIDs, array_filter(ArrayHelper::getColumn($items, 'id')));\n // die($itemsIDs);\n foreach ($items as $indexItem => $item) {\n $data['EvaluationItem'] = $item;\n $modelItem = (isset($item['id']) && isset($oldItems[$item['id']])) ? $oldItems[$item['id']] : new EvaluationItem;\n // $modelItem->scenario = 'update';\n $modelItem->load($data);\n $evalItems[$indexSection][$indexItem] = $modelItem;\n $valid = $modelItem->validate();\n }\n }\n }\n\n $oldItemsIDs = ArrayHelper::getColumn($oldItems, 'id');\n $deletedItemsIDs = array_diff($oldItemsIDs, $itemsIDs);\n\n if ($valid) {\n $transaction = Yii::$app->db->beginTransaction();\n try {\n if ($flag = $model->save(false)) {\n\n // if (! empty($deletedItemsIDs)) {\n // // EvaluationItem::deleteAll(['id' => $deletedItemsIDs]);\n // echo \"YEAH 1\";\n // die();\n // }\n\n // if (! empty($deletedSectionIDs)) {\n // // EvaluationsSection::deleteAll(['id' => $deletedSectionIDs]);\n // echo \"YEAH 2\";\n // die();\n // }\n \n foreach ($evalSections as $indexSection => $modelSection) {\n \n if ($flag === false) {\n break;\n }\n\n if (!($flag = $modelSection->save())) {\n break;\n }\n\n if (isset($evalItems[$indexSection]) && is_array($evalItems[$indexSection])) {\n foreach ($evalItems[$indexSection] as $indexItem => $modelItem) {\n \n if (!($flag = $modelItem->save(false))) {\n break;\n }\n }\n }\n }\n }\n $model->status = 1;\n $model->save();\n $transaction->commit();\n return $this->redirect(['/']);\n \n } catch (Exception $e) {\n $transaction->rollBack();\n }\n }\n }\n\n return $this->render('evaluate', [\n 'model' => $model,\n 'evalSections' => $evalSections,\n 'evalItems' => $evalItems\n ]);\n\n }", "public function evaluate();", "public function evaluate();", "public function slice(int $index, int $length = null): Sequence;", "public function evaluations()\n {\n return $this->hasMany(Evaluation::class);\n }", "public function seriesSlice($index = 0, $length = 100, $search = null, $translit = false);", "public function index()\n {\n \\Gate::authorize('view', 'competences_evaluations');\n $Evaluation = EvaluationCompetency::get();\n return $Evaluation;\n }", "public function createSlice($alias, array $values = array(), array $options = array());", "function getSlice(int $start, int $end): string\n {\n if ($start === $end || $start < 0 || $end < 0) {\n return '';\n }\n\n if ($start < $end) {\n return (string) substr($this->html, $start, $end - $start);\n } else {\n return (string) substr($this->html, $end, $start - $end);\n }\n }", "public function getSlice($page = 0, $perpage = 0)\n {\n return $this->_search($page, $perpage);\n }", "function custom_sdppi($scrap_raw, $slice_array = 44, $field_count = 10)\n\t{\n\t\t$data = [];\n\n\t\tif (!is_null($scrap_raw))\n\t\t{\n\t\t\t$result = array_slice($scrap_raw, $slice_array); // Menghilangkan data header/array header\n\t\t\t$total_array = count($result);\n\t\t\t$j = 0;\n\n\t\t\tfor ($i=0; $i < $total_array; $i++)\n\t\t\t{\n\t\t\t\t$temp = array_slice($result, $j, $field_count);\n\t\t\t\t// Memisahkan data per field_count elemen dengan syarat array tidak kosong, \n\t\t\t\t// data pertama setiap array adalah integer dan tidak lebih dari jumlah field_count - 1\n\t\t\t\tif (!empty($temp) AND is_numeric($temp[0]) AND count($temp) > ($field_count - 1))\n\t\t\t\t{\n\t\t\t\t\t$data[$i] = $temp;\n\t\t\t\t\t$j += $field_count;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}", "public function slice($offset, $length = null, $preserve = true) {\n\t\tif (!$length && $length !== 0) {\n\t\t\t$length = abs($offset);\n\t\t}\n\n\t\treturn array_slice($this->_value, (int) $offset, (int) $length, $preserve);\n\t}", "public function pop()\n {\n if (empty($this->_data)) {\n require_once 'MC/Array/Exception.php';\n throw new MC_Array_Exception(\"Not enough elements for this \" .\n \"operation\");\n }\n \n return array_pop($this->_data);\n }", "public function take($length)\n {\n if(!is_int($length))\n {\n throw new \\InvalidArgumentException();\n }\n\n if($length>=0 && $length>$this->length())\n {\n $length = $this->length();\n }\n elseif($length<0 && $length<(0-$this->length()))\n {\n $length = 0-$this->length();\n }\n\n $temp = $this->newInstance();\n\n if($length>=0)\n {\n $temp->setData(array_slice($this->getData(), 0, $length));\n }\n else\n {\n $temp->setData(array_slice($this->getData(), $length));\n }\n\n return $temp;\n }", "function dataset0 ( ) // 允許外界直接[接觸]到內部的_dataset (可能反向排序)\n{\n return $this->_dataset;\n}", "public function slice($offset, $length=null, $preserveKeys=false)\n {\n $class = $this->instance();\n \n $length = is_numeric($length) ? $length : $this->count() - $offset;\n \n return new $class(array_slice($this->_data, $offset, $length,\n $preserveKeys));\n }", "function expression_function_take($collection, $number)\n{\n if (is_array($collection)) {\n return array_slice($collection, 0, $number, true);\n } else if ($collection instanceof \\Iterator) {\n return new \\LimitIterator($collection, 0, $number);\n } else {\n throw new \\InvalidArgumentException('Collection must be an array or an Iterator');\n }\n}", "static function getRubricEvalDemoData()\n {\n return array(\n 'event' => array(\n 'Event' => array(\n 'id' => 0,\n 'title' => 'Preview Event',\n 'due_date' => Toolkit::formatDate(time()+(5*24*60*60)),\n 'description' => 'Preview for rubric evaluation event.',\n 'com_req' => true,\n ),\n 'Group' => array(\n 'id' => 0,\n 'group_name' => 'Demo Group',\n ),\n ),\n 'groupMembers' => array(\n array(\n 'User' => array(\n 'id' => 1,\n 'first_name' => 'Demo',\n 'last_name' => 'Student1',\n ),\n ),\n array(\n 'User' => array(\n 'id' => 2,\n 'first_name' => 'Demo',\n 'last_name' => 'Student2',\n ),\n ),\n array(\n 'User' => array(\n 'id' => 3,\n 'first_name' => 'Demo',\n 'last_name' => 'Student3',\n ),\n ),\n ),\n 'courseId' => 0,\n 'userId' => 1,\n 'evaluateeCount' => 2,\n 'fullName' => User::get('full_name'),\n 'preview' => true,\n );\n }", "public static function slice(array $array, int $offset, int $limit): array\n {\n return array_slice($array, $offset, $limit);\n }", "public function showSlices(HTMLFormTable $f)\n\t{\n\t\tforeach ($this->slices as $slice) {\n\t\t\t//$part = $this->sliceFromTill($this->desc, $slice['from'], $slice['till']);\n\t\t\t$part = $slice['desc'];\n\t\t\t$f->fieldset($slice['name'], $slice['fieldsetParams']);\n\t\t\t$f2 = new HTMLFormTable($part);\n\t\t\t$f2->showForm();\n\t\t\tthrow new Exception('TODO: test this');\n\t\t}\n\t\t//debug($slice);\n\t}", "function slice ($start, $len, $preserveKeys = false)\n {\n $this->A = array_slice ($this->A, $start, $len, $preserveKeys);\n return $this;\n }", "public function setEvaluation($evaluation)\n {\n $this->evaluation = $evaluation;\n\n return $this;\n }", "public function index()\n {\n return evaluationSummary::all();\n }", "public function getPartOfSeries() {\n\t\treturn $this->partOfSeries;\n\t}", "protected function _createSubset() {}", "public function slice(int $offset, int|null $length = null): array;", "public function __toString()\n {\n return (string)$this->slice(',')->toString();\n }", "public function getSlice($offset, $length): iterable\n {\n return $this->adapter->getResults($offset, $length)->toArray();\n }", "public function evaluation()\n {\n return $this->hasOne(\"App\\Services\\Evaluation\\Evaluation\", 'id_employee', 'id_assessor'); // one to many\n /*ถ้าตอน Query เอา table ไหนเป็นหลัก ตรง model ก็เอา pk ของ table นั้นขึ้นทีหลัง*/\n //return $this->hasMany(\"App\\Services\\Evaluation\\Evaluation\", 'id_assessor', 'id_employee'); // one to many\n }", "private function _getSlice($startPosition, $endPosition = 0)\n {\n if (!$endPosition) {\n $endPosition = strlen($this->_documentXML);\n }\n return substr($this->_documentXML, $startPosition, ($endPosition - $startPosition));\n }", "public function slice( $from, $count )\n {\n throw new UnmodifiableException(\"This collection cannot be changed\");\n }", "public function assertSubset($subset, $array)\n {\n $values = collect($array)->only(array_keys($subset))->all();\n\n $this->assertEquals($subset, $values, 'The expected subset does not match the given array.');\n }", "public function getSlice($offset, $length)\n {\n return $this->select\n ->limit($length)\n ->offset($offset)\n ->fetchAll();\n }", "public function testCanGetFilteredDatasetSnapshotProfiles() {\n AuthenticationHelper::login(\"admin@kinicart.com\", \"password\");\n\n\n $this->metaDataService->returnValue(\"getObjectTagsFromSummaries\", [\n new ObjectTag(new Tag(new TagSummary(\"Project\", \"My Project\", \"project\"), 2, \"soapSuds\")),\n new ObjectTag(new Tag(new TagSummary(\"Account2\", \"My Account\", \"account2\"), 2, \"soapSuds\"))\n ], [\n [\n new TagSummary(\"Project\", \"My Project\", \"project\"),\n new TagSummary(\"Account2\", \"My Account\", \"account2\")\n ], 2, \"soapSuds\"\n ]);\n\n\n $dataSetInstanceSummary = new DatasetInstanceSummary(\"Test dataset\", \"test-json\", null, [], [], []);\n $instanceId = $this->datasetService->saveDataSetInstance($dataSetInstanceSummary, null, 2);\n\n $dataSetInstanceSummary = new DatasetInstanceSummary(\"Another dataset\", \"test-json\", null, [], [], []);\n $instance2Id = $this->datasetService->saveDataSetInstance($dataSetInstanceSummary, \"soapSuds\", 2);\n\n $dataSetInstanceSummary = new DatasetInstanceSummary(\"Yet Another dataset\", \"test-json\", null, [], [], []);\n $dataSetInstanceSummary->setTags(\n [new TagSummary(\"Project\", \"My Project\", \"project\"),\n new TagSummary(\"Account2\", \"My Account\", \"account2\")]\n );\n $instance3Id = $this->datasetService->saveDataSetInstance($dataSetInstanceSummary, \"soapSuds\", 2);\n\n\n $snapshotProfile1 = new DatasetInstanceSnapshotProfileSummary(\"Daily Snapshot\", \"tabulardatasetsnapshot\", [\n ], DatasetInstanceSnapshotProfileSummary::TRIGGER_SCHEDULE, [\n new ScheduledTaskTimePeriod(null, null, 0, 0)\n ]);\n\n $snapshotProfile1Id = $this->datasetService->saveSnapshotProfile($snapshotProfile1, $instanceId);\n\n\n $snapshotProfile2 = new DatasetInstanceSnapshotProfileSummary(\"Weekly Snapshot\", \"tabulardatasetsnapshot\", [\n ], DatasetInstanceSnapshotProfileSummary::TRIGGER_SCHEDULE, [\n new ScheduledTaskTimePeriod(null, 1, 0, 0)\n ]);\n\n\n $snapshotProfile2Id = $this->datasetService->saveSnapshotProfile($snapshotProfile2, $instanceId);\n\n\n $snapshotProfile3 = new DatasetInstanceSnapshotProfileSummary(\"Daily Snapshot\", \"tabulardatasetsnapshot\", [\n ], DatasetInstanceSnapshotProfileSummary::TRIGGER_SCHEDULE, [\n new ScheduledTaskTimePeriod(null, null, 0, 0)\n ]);\n\n $snapshotProfile3Id = $this->datasetService->saveSnapshotProfile($snapshotProfile3, $instance2Id);\n\n\n $snapshotProfile4 = new DatasetInstanceSnapshotProfileSummary(\"Weekly Snapshot\", \"tabulardatasetsnapshot\", [\n ], DatasetInstanceSnapshotProfileSummary::TRIGGER_SCHEDULE, [\n new ScheduledTaskTimePeriod(null, 1, 0, 0)\n ]);\n\n\n $snapshotProfile4Id = $this->datasetService->saveSnapshotProfile($snapshotProfile4, $instance2Id);\n\n\n $snapshotProfile5 = new DatasetInstanceSnapshotProfileSummary(\"Tagged Snapshot\", \"tabulardatasetsnapshot\", [\n ], DatasetInstanceSnapshotProfileSummary::TRIGGER_SCHEDULE, [\n new ScheduledTaskTimePeriod(null, 1, 0, 0)\n ]);\n\n\n $snapshotProfile5Id = $this->datasetService->saveSnapshotProfile($snapshotProfile5, $instance3Id);\n\n\n $snapshotProfile1 = DatasetInstanceSnapshotProfile::fetch($snapshotProfile1Id);\n $snapshotProfile2 = DatasetInstanceSnapshotProfile::fetch($snapshotProfile2Id);\n $snapshotProfile3 = DatasetInstanceSnapshotProfile::fetch($snapshotProfile3Id);\n $snapshotProfile4 = DatasetInstanceSnapshotProfile::fetch($snapshotProfile4Id);\n $snapshotProfile5 = DatasetInstanceSnapshotProfile::fetch($snapshotProfile5Id);\n\n\n // Now check we get back what we are expecting in alphabetical order for an account only query\n $matches = $this->datasetService->filterSnapshotProfiles(\"\", [], null, 0, 10, 2);\n $this->assertEquals(5, sizeof($matches));\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile3), $matches[0]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile4), $matches[1]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile1), $matches[2]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile2), $matches[3]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile5), $matches[4]);\n\n\n // Limit to project\n $matches = $this->datasetService->filterSnapshotProfiles(\"\", [], \"soapSuds\", 0, 10, 2);\n $this->assertEquals(3, sizeof($matches));\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile3), $matches[0]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile4), $matches[1]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile5), $matches[2]);\n\n\n // Limit to project and tags\n $matches = $this->datasetService->filterSnapshotProfiles(\"\", [\"project\"], \"soapSuds\", 0, 10, 2);\n $this->assertEquals(1, sizeof($matches));\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile5), $matches[0]);\n\n // Check special NONE tag\n $matches = $this->datasetService->filterSnapshotProfiles(\"\", [\"NONE\"], null, 0, 10, 2);\n $this->assertEquals(4, sizeof($matches));\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile3), $matches[0]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile4), $matches[1]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile1), $matches[2]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile2), $matches[3]);\n\n\n // Limit to filter string\n $matches = $this->datasetService->filterSnapshotProfiles(\"another\", [], null, 0, 10, 2);\n $this->assertEquals(3, sizeof($matches));\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile3), $matches[0]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile4), $matches[1]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile5), $matches[2]);\n\n $matches = $this->datasetService->filterSnapshotProfiles(\"daily\", [], null, 0, 10, 2);\n $this->assertEquals(2, sizeof($matches));\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile3), $matches[0]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile1), $matches[1]);\n\n\n // Offset and limit\n $matches = $this->datasetService->filterSnapshotProfiles(\"\", [], null, 0, 3, 2);\n $this->assertEquals(3, sizeof($matches));\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile3), $matches[0]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile4), $matches[1]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile1), $matches[2]);\n\n\n $matches = $this->datasetService->filterSnapshotProfiles(\"\", [], null, 1, 3, 2);\n $this->assertEquals(3, sizeof($matches));\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile4), $matches[0]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile1), $matches[1]);\n $this->assertEquals(new DatasetInstanceSnapshotProfileSearchResult($snapshotProfile2), $matches[2]);\n }", "function Get() {\n\t\t\treturn array_pop($this->_Data);\n\t\t}", "public function slice($offset, $length = null, $preserveKeys = true)\n {\n $data = array_slice($this->_data, $offset, $length, $preserveKeys);\n return new static($data);\n }", "static function custom_slice_directive($content)\n\t{\n\t\t$pattern = '/(\\s*)@slice\\s*\\((\\'.*\\')\\)/';\n\t\treturn preg_replace($pattern, '$1<?php echo \"$2\"; ?>', $content);\n\t}", "public static function slice($string, $start, $end = null)\n {\n if ($end !== null) {\n $end -= $start;\n }\n\n if (function_exists('mb_substr')) {\n return mb_substr($string, $start, $end, static::getEncoding());\n }\n\n if (function_exists('iconv_substr')) {\n return iconv_substr($string, $start, $end ?: iconv_strlen($string), static::getEncoding());\n }\n\n throw new RuntimeException('Unreachable');\n }", "public function evaluations()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Evaluation', 'application_id');\n\t}", "public function isSubsettable() {}", "public function getData()\n {\n $data = $this->only(['name', 'nr_days', 'nr_weeks', 'slots_per_day', 'begin_hour', 'week_days', 'minutes_per_slot', 'time_optimization', 'room_optimization', 'distribution_optimization', 'student_optimisation', 'is_random', 'problem_class']);\n\n return $data;\n }", "protected function getSlice($startPosition, $endPosition = 0)\n {\n if (!$endPosition) {\n $endPosition = strlen($this->tempDocumentMainPart);\n }\n\n return substr($this->tempDocumentMainPart, $startPosition, ($endPosition - $startPosition));\n }", "public function sliceTraduct($slice)\n {\n if ($slice == 'DAY') {\n return 'Journée';\n } elseif ($slice == 'AM') {\n return 'Matin';\n } elseif ($slice == 'PM') {\n return 'Aprés Midi';\n }\n }", "function Query($start=0,$slice=0,$res_type=\"LIST\",$p_query=\"\") {\n \n $query=$this->initQuery($start,$slice,$p_query);\n $this->res_type=$res_type;\t\n $err = $this->basic_elem->exec_query($query);\n //\tprint \"$query $res_type $p_query<BR>\\n\";\n if ($err != \"\") return($err); \n\n $this->nb = $this->basic_elem->numrows(); \n \n if ($this->nb ==0) {\n\treturn FALSE;\n }\n if ($res_type == \"ITEM\") {\n\t$this->cindex=0; // current index row\n\treturn $this->basic_elem->res;\n }\n if ($start >= $this->nb) {$start=0;}\n if ($slice == 0) {$slice = $this->nb;}\n\n if (($start+$slice) >= $this->nb) {\n $end = $this->nb;\n } else {\n $end = $start + $slice;\n }\n for ($c=0; $c<$this->nb;$c++) {\n \n $result = $this->basic_elem->fetch_array($c);\n if (($res_type == \"LIST\") || ($res_type == \"LISTC\")) {\n $this->list[$c] = new $this->class($this->dbaccess,\"\",$result,$this->basic_elem->dbid);\n } else {\n while (list($k,$v)=each( $result)) {\n $this->list[$c][$k]=$v;\n }\n }\n \n }\n\n return($this->list);\n }", "public function Out($i){\n\treturn $this->output[$this->num_of_layers-1][$i];\n}", "public function getArrayCopy()\n {\n return $this->data;\n }", "function getEvaluationAccess() \n\t{\n\t\treturn ($this->evaluation_access) ? $this->evaluation_access : self::EVALUATION_ACCESS_OFF;\n\t}" ]
[ "0.60676765", "0.5675386", "0.5301768", "0.5275299", "0.5068951", "0.48027158", "0.4623527", "0.44373196", "0.44106454", "0.4294619", "0.42584422", "0.42392617", "0.42379516", "0.42210415", "0.41844556", "0.41676193", "0.41310605", "0.40910754", "0.4089171", "0.4079001", "0.40665546", "0.40625614", "0.40586892", "0.4046578", "0.40121982", "0.40081176", "0.40046814", "0.3975929", "0.39651033", "0.3963768", "0.3963768", "0.38864326", "0.38820285", "0.38751906", "0.3856104", "0.3834754", "0.38256583", "0.38241544", "0.38182685", "0.3813856", "0.38095015", "0.37860987", "0.37766185", "0.37676245", "0.37676245", "0.37561026", "0.37500837", "0.37394303", "0.373649", "0.37294117", "0.3719704", "0.37171206", "0.37052193", "0.36956123", "0.36927718", "0.36927718", "0.36824653", "0.36779085", "0.36730334", "0.36694518", "0.36556965", "0.3654505", "0.36537603", "0.36390266", "0.363062", "0.3621376", "0.3620644", "0.3611591", "0.3601595", "0.35912818", "0.3586028", "0.35849884", "0.35818225", "0.35756454", "0.35732037", "0.35721856", "0.35450974", "0.35374492", "0.35321623", "0.351275", "0.35092938", "0.35009962", "0.34998143", "0.34911174", "0.34903044", "0.34649652", "0.34627327", "0.34425646", "0.3439337", "0.34390935", "0.34238133", "0.34199923", "0.34152815", "0.34124318", "0.3406926", "0.3389482", "0.33815753", "0.3380822", "0.33741117", "0.33713055" ]
0.7472934
0
Output only. Points to a YAML file stored on Google Cloud Storage describing the [metrics][google.cloud.aiplatform.v1.ModelEvaluationSlice.metrics] of this ModelEvaluationSlice. The schema is defined as an OpenAPI 3.0.2 [Schema Object]( Generated from protobuf field string metrics_schema_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
public function getMetricsSchemaUri() { return $this->metrics_schema_uri; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setMetricsSchemaUri($var)\n {\n GPBUtil::checkString($var, True);\n $this->metrics_schema_uri = $var;\n\n return $this;\n }", "public function setMetrics($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Value::class);\n $this->metrics = $var;\n\n return $this;\n }", "public function getMetadataSchemaUri()\n {\n return $this->metadata_schema_uri;\n }", "protected function get_image_schema( $url ) {\n\t\t$image = new WPSEO_Schema_Image( $this->context->canonical . '#schema-image-' . md5( $url ) );\n\n\t\treturn $image->generate_from_url( $url );\n\t}", "public function getMetrics(): array;", "public function getMetrics()\n {\n return $this->metrics;\n }", "public function getMetrics()\n {\n return $this->metrics;\n }", "public function getMetrics()\n {\n return $this->metrics;\n }", "public function getMetrics()\n {\n return $this->metrics;\n }", "private function saveSourceReferencePoiMetric(){\n $sourceReference = $this->sourceReferenceFactory->getSourceReferenceById($sourceReferencePoi->source_reference_id);\n $sourceMetrics = $this->sourceMetricFactory->createSourceMetricsBySourceId($sourceReference->source_id);\n foreach($sourceMetrics as $sourceMetric){\n $sourceReferencePoiMetric = new \\source\\model\\SourceReferencePoiMetric();\n $sourceReferencePoiMetric->source_reference_poi_id = $sourceReferencePoi->source_reference_poi_id;\n $sourceReferencePoiMetric->metric_id = $sourceMetric->metric_id;\n $this->sourceReferencePoiMetricFactory->saveSourceReferencePoiMetric($sourceReferencePoiMetric);\n }\n }", "public function run()\n {\n // DB::table('widgets')->truncate();\n\n $metrics = array(\n\narray(\n 'name' => 'Top Customers',\n 'type' => 'table',\n 'updates_default' => '600',\n 'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n 'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n 'related' => '',\n),\narray('name' => 'Number of Inactive Customers',\n 'type' => 'snapshot',\n 'updates_default' => '600',\n 'user_parameters' => '{\"env\":\"\",\"options\":{\"IC_TIME_FRAME\":{ \"value\":\"7\", \"description\":\"The time frame in days where activity is monitored.\"}}}', \n 'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}', \n 'related' => ''),\narray(\n\t'name' => 'Active Calls',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , \narray(\n\t'name' => 'New Active Customers',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"NAC_TIME_FRAME\":{\"value\":\"1\", \"description\":\"The time frame in days for a customer to be considered \\'new\\'.\")}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) ,\narray(\n\t'name' => 'Number Of Customers With Overdue Invoices',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"overdue\"}',\n\t'related' => '35'\n) , array(\n\t'name' => 'Generated Revenue',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"Revenue\"}',\n\t'related' => '36'\n) , array(\n\t'name' => 'Revenue This Month',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Number Of Calls Per Day',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'ASR',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"asr\"}',\n\t'related' => '37'\n) , array(\n\t'name' => 'Call Volume (ONNET)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_sip\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'SIP-UA\\' connection.\"}, \"ps_internal_um\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'INTERNAL\\' connection.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"ONNET\"}',\n\t'related' => '38,39'\n) , array(\n\t'name' => 'Total Registered Locations',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Connection Utilization (OB)',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"originate\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'ACD (OB)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_sip\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'SIP-UA\\' connection.\"}, \"ps_internal_um\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'INTERNAL\\' connection.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"originate\"}',\n\t'related' => '41'\n) , array(\n\t'name' => 'Failed Calls',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"FAILEDCALLS_TIME_FRAME\":{\"value\":\"600\", \"description\":\"The time frame in seconds that is considered for analysis.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'ACD & PDD By Vendor',\n\t'type' => 'table',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_vendor\": {\"value\":\"\"}, \"PDD_RED_THESHOLD\": {\"value\":\"10000\"}, \"PDD_YELLOW_THESHOLD\": {\"value\":\"4000\"}, \"SHOW_INTERNAL_CNX\":{\"value\":\"true\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Call Loss Ratio',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Nr Of Short Calls',\n\t'type' => 'table',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"UC_TOO_SHORT\":{\"value\":\"10\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":{\"1\":\"short\"}}',\n\t'related' => ''\n) , array(\n\t'name' => 'Nr Of Long Calls',\n\t'type' => 'table',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"UC_TOO_LONG\":{\"value\":\"7200\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":{\"1\":\"long\"}}',\n\t'related' => ''\n) , array(\n\t'name' => 'Top 10 Destinations',\n\t'type' => 'table',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"TOP_DESTINATIONS_TIME_FRAME\": {\"value\":\"3600\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Top Vendors (Outbound)',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"TOP_VENDORS_TIME_FRAME\":{\"value\":\"86400\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":{\"1\":\"originate\"}}',\n\t'related' => ''\n) , array(\n\t'name' => 'Top Vendors (Inbound)',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"TOP_VENDORS_TIME_FRAME\":{\"value\":\"86400\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":{\"1\"1:\"answer\"}}',\n\t'related' => ''\n) , array(\n\t'name' => 'PDD',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_vendor\":{\"value\":\"\",\"description\":\"The ID of the PortaSwitch internal vendor.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Active Calls by Customer',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Call volume by Customer',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Number Of Customers With Unpaid Invoices',\n\t'type' => 'snapshot',\n\t'updates_default' => '86400',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"unpaid\"}',\n\t'related' => '14'\n) , array(\n\t'name' => 'Incurred Cost',\n\t'type' => 'duration',\n\t'updates_default' => '86400',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"Cost\"}',\n\t'related' => '15'\n) , array(\n\t'name' => 'NER',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"ner\"}',\n\t'related' => '18'\n) , array(\n\t'name' => 'Call Volume (OB)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_vendor\": {\"value\":\"\", \"description\":\"The ID of the PortaSwitch internal vendor.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"OUT\"}',\n\t'related' => '19,39'\n) , array(\n\t'name' => 'Call Volume (IB)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_vendor\": {\"value\":\"\", \"description\":\"The ID of the PortaSwitch internal vendor.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"IN\"}',\n\t'related' => '19,38'\n) , array(\n\t'name' => 'Connection Utilization (IB)',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"answer\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'ACD (IB)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_sip\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'SIP-UA\\' connection.\"}, \"ps_internal_um\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'INTERNAL\\' connection.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"answer\"}',\n\t'related' => '23'\n)\n\n );\n\n // Uncomment the below to run the seeder\n DB::table('metrics')->insert($metrics);\n \n \n }", "public function get_stats_schema() {\n\t\t\t$schema = array(\n\t\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t\t'title' => 'quiz-statistics',\n\t\t\t\t'parent' => 'quiz',\n\t\t\t\t'type' => 'object',\n\t\t\t\t'properties' => array(\n\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t'description' => __( 'Statistics Ref ID.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'quiz' => array(\n\t\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Quiz.\n\t\t\t\t\t\t\tesc_html_x(\n\t\t\t\t\t\t\t\t'%s ID.',\n\t\t\t\t\t\t\t\t'placeholder: Quiz',\n\t\t\t\t\t\t\t\t'learndash'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'quiz' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'user' => array(\n\t\t\t\t\t\t'description' => __( 'User ID.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'date' => array(\n\t\t\t\t\t\t'description' => __( 'Date.', 'learndash' ),\n\t\t\t\t\t\t'type' => array( 'string', null ),\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'answers_correct' => array(\n\t\t\t\t\t\t'description' => __( 'Answer correct.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'answers_incorrect' => array(\n\t\t\t\t\t\t'description' => __( 'Answer incorrect.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\treturn $schema;\n\t\t}", "public function getMetrics()\n\t{\n\t\treturn $this->metrics;\n\t}", "public function generate()\n {\n $this->schema->put('@graph', $this->expandGraphs());\n\n return $this->schema->toJson();\n }", "function getName(): string\n {\n return 'Metrics';\n }", "public function toYaml(): string\n {\n return Yaml::dump($this->toArray(), 20);\n }", "public function getMetadataSchema()\n {\n return isset($this->metadata_schema) ? $this->metadata_schema : null;\n }", "private function _getNumberOfMetrics() {}", "public function setMetrics($value)\n {\n return $this->set('Metrics', $value);\n }", "public function testDimensionsValidation(): void\n {\n $builder = new ValidationBuilder();\n $builder->validate(\"avatar\", function (Field $field): void {\n $field->dimensions(function(Dimensions $dimensions): void {\n $dimensions->ratio(3/2)->width(100);\n });\n });\n\n $rules = $builder->getRules();\n\n $this->assertCount(1, $rules);\n $this->assertEquals([\"dimensions:ratio=1.5,width=100\"], $rules[\"avatar\"]);\n }", "public function setMetrics($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Notebooks\\V1\\RuntimeMetrics::class);\n $this->metrics = $var;\n\n return $this;\n }", "protected function getMetricsTable()\n {\n $prefix = app(System::class)->getTablePrefix();\n\n return $prefix.'metrics';\n }", "public function getMetricDataFormat() {}", "public function getMetrics(): Response\n {\n\n $registry = \\Prometheus\\CollectorRegistry::getDefault();\n\n $renderer = new RenderTextFormat();\n $result = $renderer->render($registry->getMetricFamilySamples());\n\n return $this->responseFactory->make($result, 200, ['Content-Type' => RenderTextFormat::MIME_TYPE]);\n }", "public function getSamlMetadataUrl()\n {\n if (array_key_exists(\"samlMetadataUrl\", $this->_propDict)) {\n return $this->_propDict[\"samlMetadataUrl\"];\n } else {\n return null;\n }\n }", "public function get_stats_questions_schema() {\n\t\t\t$schema = array(\n\t\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t\t'title' => 'quiz-statistics-questions',\n\t\t\t\t'parent' => 'quiz-statistics',\n\t\t\t\t'type' => 'object',\n\t\t\t\t'properties' => array(\n\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t'description' => __( 'Unique ID for Statistics Question.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'statistic' => array(\n\t\t\t\t\t\t'description' => __( 'Statistics Ref ID.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'quiz' => array(\n\t\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Quiz.\n\t\t\t\t\t\t\tesc_html_x(\n\t\t\t\t\t\t\t\t'%s ID',\n\t\t\t\t\t\t\t\t'placeholder: Quiz',\n\t\t\t\t\t\t\t\t'learndash'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'quiz' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'question' => array(\n\t\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Question.\n\t\t\t\t\t\t\tesc_html_x(\n\t\t\t\t\t\t\t\t'%s ID',\n\t\t\t\t\t\t\t\t'placeholder: Question',\n\t\t\t\t\t\t\t\t'learndash'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'question' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'question_type' => array(\n\t\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Question.\n\t\t\t\t\t\t\tesc_html_x(\n\t\t\t\t\t\t\t\t'%s Type',\n\t\t\t\t\t\t\t\t'placeholder: Question',\n\t\t\t\t\t\t\t\t'learndash'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'question' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'points_scored' => array(\n\t\t\t\t\t\t'description' => esc_html__( 'Points scored.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'points_total' => array(\n\t\t\t\t\t\t'description' => esc_html__( 'Points total.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'answers' => array(\n\t\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Question.\n\t\t\t\t\t\t\tesc_html_x(\n\t\t\t\t\t\t\t\t'The collection of %s answers.',\n\t\t\t\t\t\t\t\t'placeholder: Question',\n\t\t\t\t\t\t\t\t'learndash'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'question' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'student' => array(\n\t\t\t\t\t\t'description' => __( 'The collection of student submitted answers.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\treturn $schema;\n\t\t}", "public function getReadNamespacedScaleScale(\n $name,\n $mnamespace,\n $pretty = null\n ) {\n\n //the base uri for api requests\n $_queryBuilder = Configuration::$BASEURI;\n \n //prepare query string for API call\n $_queryBuilder = $_queryBuilder.\n '/oapi/v1/namespaces/{namespace}/deploymentconfigs/{name}/scale';\n\n //process optional query parameters\n $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array (\n 'name' => $name,\n 'namespace' => $mnamespace,\n ));\n\n //process optional query parameters\n APIHelper::appendUrlWithQueryParameters($_queryBuilder, array (\n 'pretty' => $pretty,\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl($_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => 'APIMATIC 2.0',\n 'Accept' => 'application/json'\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::get($_queryUrl, $_headers);\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n $mapper = $this->getJsonMapper();\n\n return $mapper->mapClass($response->body, 'OpenShiftAPIWithKubernetesLib\\\\Models\\\\V1beta1Scale');\n }", "function gttn_tpps_xlsx_get_dimension($location) {\n $reader = new XMLReader();\n $reader->open($location);\n while ($reader->read()) {\n if ($reader->nodeType == XMLReader::ELEMENT and $reader->name == 'dimension') {\n $dim = $reader->getAttribute('ref');\n $reader->close();\n return $dim;\n }\n }\n return NULL;\n}", "function Monitor_Shortcuts_convertPageOfMetricsToResponse($request, $match, $page)\n{\n // User defined format\n if (Monitor_Shortcuts_isPrometheusRequest($request)) {\n $items = $page->fetchItems();\n $result = '';\n foreach ($items as $metric) {\n $value = $metric->invoke($request, $match);\n $result = $result . //\n Monitor_Shortcuts_convertMetricToPrometheusLabel($metric) . \" \" . //\n ($value ? $value : '0') . PHP_EOL;\n }\n return new Pluf_HTTP_Response($result, 'text/plain');\n }\n return $page;\n}", "public function getSchema(): string;", "public function getSchema(): string;", "public function updateReplaceNamespacedScaleScale(\n $body,\n $name,\n $mnamespace,\n $pretty = null\n ) {\n\n //the base uri for api requests\n $_queryBuilder = Configuration::$BASEURI;\n \n //prepare query string for API call\n $_queryBuilder = $_queryBuilder.\n '/oapi/v1/namespaces/{namespace}/deploymentconfigs/{name}/scale';\n\n //process optional query parameters\n $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array (\n 'name' => $name,\n 'namespace' => $mnamespace,\n ));\n\n //process optional query parameters\n APIHelper::appendUrlWithQueryParameters($_queryBuilder, array (\n 'pretty' => $pretty,\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl($_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => 'APIMATIC 2.0',\n 'Accept' => 'application/json',\n 'content-type' => 'application/json; charset=utf-8'\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::put($_queryUrl, $_headers, Request\\Body::Json($body));\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n $mapper = $this->getJsonMapper();\n\n return $mapper->mapClass($response->body, 'OpenShiftAPIWithKubernetesLib\\\\Models\\\\V1beta1Scale');\n }", "function YAMLLoad($input) {\n\t\t$spyc = new Spyc;\n\t\treturn $spyc->load($input);\n\t}", "protected function getSchema()\n {\n return '{\n \"$schema\":\"http://json-schema.org/draft-04/schema#\",\n \"title\":\"' . $this->name . ' Schema\",\n \"description\":\"' . $this->description . '\",\n \"type\":\"object\",\n \"additionalProperties\":false,\n \"properties\":{\n \"string\":{\n \"type\":\"string\",\n \"description\": \"The input string to process\"\n }\n },\n \"required\":[\n \"string\"\n ]\n }';\n }", "public function retrieveReactorMetrics()\n {\n return $this->start()->uri(\"/api/reactor/metrics\")\n ->get()\n ->go();\n }", "public function __construct($metrics, $dimensions)\n {\n $this->metrics = $metrics;\n $this->dimensions = $dimensions;\n }", "public static function getSampleYamlFile()\n {\n return self::fixtureDir().'/fixture_sample.yml';\n }", "public function getAnalysisStorage(): StorageInterface;", "public static function getSampleYamlString()\n {\n return trim(\n '---'.\"\\n\".\n 'greeting: \"hello\"'.\"\\n\".\n 'to: \"you\"'.\"\\n\"\n );\n }", "public function getFiguredLarge()\n\t{\n\t\tif(!Storage::has('json/wristband/colors/figuredLarge.json')) {\n\t\t\t// generate and save .json file.\n\t\t\tStorage::put('json/wristband/colors/figuredLarge.json', json_encode($this->figuredLarge()));\n\t\t}\n\t\t// return data from .json file.\n\t\treturn json_decode(Storage::get('json/wristband/colors/figuredLarge.json'), true);\n\t}", "public function getOutputUri()\n {\n return $this->output_uri;\n }", "public function emit($data) {\r\n $output = sfYaml::dump($data);\r\n return $output; \r\n }", "public function schema()\r\n {\r\n return $this->getKey('schema', true);\r\n }", "public function get_item_schema() {\n\t\tif ( $this->schema ) {\n\t\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t\t}\n\n\t\t$this->schema = array(\n\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title' => 'url-details',\n\t\t\t'type' => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'title' => array(\n\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t/* translators: %s: HTML title tag. */\n\t\t\t\t\t\t__( 'The contents of the %s element from the URL.' ),\n\t\t\t\t\t\t'<title>'\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'icon' => array(\n\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t/* translators: %s: HTML link tag. */\n\t\t\t\t\t\t__( 'The favicon image link of the %s element from the URL.' ),\n\t\t\t\t\t\t'<link rel=\"icon\">'\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'description' => array(\n\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t/* translators: %s: HTML meta tag. */\n\t\t\t\t\t\t__( 'The content of the %s element from the URL.' ),\n\t\t\t\t\t\t'<meta name=\"description\">'\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'image' => array(\n\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t/* translators: 1: HTML meta tag, 2: HTML meta tag. */\n\t\t\t\t\t\t__( 'The Open Graph image link of the %1$s or %2$s element from the URL.' ),\n\t\t\t\t\t\t'<meta property=\"og:image\">',\n\t\t\t\t\t\t'<meta property=\"og:image:url\">'\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t}", "public function getSchemaPath() : string\n {\n return $this->schema;\n }", "public function getOutSchema() {\n return static::$outSchema;\n }", "public function getDimensionsString()\n {\n $size = $this->getImageSize();\n\n return $size[3];\n }", "public function getMetric()\n {\n return isset($this->metric) ? $this->metric : '';\n }", "public function dataset($file, $format = null)\n {\n $file = $this->getDatasetFile($file);\n if (!file_exists($file)) {\n throw new \\InvalidArgumentException(\"Could not find dataset file '$file'\");\n }\n if (!$format) {\n $format = pathinfo($file, \\PATHINFO_EXTENSION);\n }\n if ($format == 'json') {\n return json_decode(file_get_contents($file), true);\n } elseif (in_array($format, array('yml', 'yaml'))) {\n return yaml_parse_file($file);\n } elseif ($format == 'php') {\n return require($file);\n } else {\n return file_get_contents($file);\n }\n }", "public function getMetric()\n {\n return $this->metric;\n }", "public function getMetric()\n {\n return $this->metric;\n }", "public function getDimensions() {}", "public function setQueryMetrics($var)\n {\n GPBUtil::checkMessage($var, QueryMetrics::class);\n $this->query_metrics = $var;\n\n return $this;\n }", "public function loadYamlConfig($filepath);", "public function getSchema()\n {\n return $this->source;\n }", "public function getSchema() {}", "public function setMetadataSchemaUri($var)\n {\n GPBUtil::checkString($var, True);\n $this->metadata_schema_uri = $var;\n\n return $this;\n }", "public function chartApiOutput() {\n\n $user = Auth::user();\n $chart = new DataChart();\n $mounthOutput = $this->getQueryChart($user);\n $chart->dataset('Last Mounth output', 'line', $mounthOutput->values())\n ->color('rgb(0,123,255)');;\n return json_decode($chart->api());\n }", "public function getMetricType()\n {\n if (array_key_exists(\"metricType\", $this->_propDict)) {\n return $this->_propDict[\"metricType\"];\n } else {\n return null;\n }\n }", "function print_dataset_definitions_category($form) {\n global $CFG, $DB;\n $datasetdefs = array();\n $lnamemax = 22;\n $namestr =get_string('name', 'quiz');\n $minstr=get_string('min', 'quiz');\n $maxstr=get_string('max', 'quiz');\n $rangeofvaluestr=get_string('minmax','qtype_datasetdependent');\n $questionusingstr = get_string('usedinquestion','qtype_calculated');\n $itemscountstr = get_string('itemscount','qtype_datasetdependent');\n $text ='';\n if (!empty($form->category)) {\n list($category) = explode(',', $form->category);\n $sql = \"SELECT i.*,d.*\n FROM {question_datasets} d,\n {question_dataset_definitions} i\n WHERE i.id = d.datasetdefinition\n AND i.category = ?;\n \" ;\n if ($records = $DB->get_records_sql($sql, array($category))) {\n foreach ($records as $r) {\n $sql1 = \"SELECT q.*\n FROM {question} q\n WHERE q.id = ?\n \";\n if ( !isset ($datasetdefs[\"$r->type-$r->category-$r->name\"])){\n $datasetdefs[\"$r->type-$r->category-$r->name\"]= $r;\n }\n if ($questionb = $DB->get_records_sql($sql1, array($r->question))) {\n $datasetdefs[\"$r->type-$r->category-$r->name\"]->questions[$r->question]->name =$questionb[$r->question]->name ;\n }\n }\n }\n }\n if (!empty ($datasetdefs)){\n\n $text =\"<table width=\\\"100%\\\" border=\\\"1\\\"><tr><th style=\\\"white-space:nowrap;\\\" class=\\\"header\\\" scope=\\\"col\\\" >$namestr</th><th style=\\\"white-space:nowrap;\\\" class=\\\"header\\\" scope=\\\"col\\\">$rangeofvaluestr</th><th style=\\\"white-space:nowrap;\\\" class=\\\"header\\\" scope=\\\"col\\\">$itemscountstr</th><th style=\\\"white-space:nowrap;\\\" class=\\\"header\\\" scope=\\\"col\\\">$questionusingstr</th></tr>\";\n foreach ($datasetdefs as $datasetdef){\n list($distribution, $min, $max,$dec) = explode(':', $datasetdef->options, 4);\n $text .=\"<tr><td valign=\\\"top\\\" align=\\\"center\\\"> $datasetdef->name </td><td align=\\\"center\\\" valign=\\\"top\\\"> $min <strong>-</strong> $max </td><td align=\\\"right\\\" valign=\\\"top\\\">$datasetdef->itemcount&nbsp;&nbsp;</td><td align=\\\"left\\\">\";\n foreach ($datasetdef->questions as $qu) {\n //limit the name length displayed\n if (!empty($qu->name)) {\n $qu->name = (strlen($qu->name) > $lnamemax) ?\n substr($qu->name, 0, $lnamemax).'...' : $qu->name;\n } else {\n $qu->name = '';\n }\n $text .=\" &nbsp;&nbsp; $qu->name <br/>\";\n }\n $text .=\"</td></tr>\";\n }\n $text .=\"</table>\";\n }else{\n $text .=get_string('nosharedwildcard', 'qtype_calculated');\n }\n return $text ;\n }", "public function metrics($user_id = 'me') {\n \t$result = $this->get(\"/v2/users/{$user_id}/metrics\");\n \treturn $result;\n }", "public static function generateYaml(array $data, $outputFile)\n {\n $outputFileDir = dirname($outputFile);\n if (!is_dir($outputFileDir)) {\n throw new \\InvalidArgumentException(\"$outputFileDir is not a valid directory (\" . __FUNCTION__ . ')');\n }\n\n $dumper = new YamlDumper();\n $dumper->setIndentation(4);\n $yaml = $dumper->dump($data, 3);\n file_put_contents($outputFile, $yaml);\n\n return true;\n }", "public function getResourcePathForExport()\n {\n $sFileExtension = pathinfo($this->_getIssueHelpPage()->name, PATHINFO_EXTENSION);\n $sFileExtension = Zend_Filter::filterStatic($sFileExtension, 'StringToLower', array('encoding' => 'UTF-8'));\n $sFileExtension = ('pdf' == $sFileExtension) ? 'png' : $sFileExtension;\n\n if (empty($sFileExtension)) {\n return null;\n }\n\n $sValue = '/' . $this->_getIssueHelpPage()->getThumbnailPresetType()\n . '/' . AM_Tools_String::generatePathFromId($this->_getIssueHelpPage()->id_issue)\n . '/' . $this->_getIssueHelpPage()->type . '.' . $sFileExtension;\n\n return $sValue;\n }", "public function describe($model) { //IMPORTANTISIMO es el que devuelve el schema al Modelo\n\t\treturn $this->_schema;\n\t}", "public function schemaDefinition() {\n return [\n 'description' => 'Stores details about batches (processes that run in multiple HTTP requests).',\n 'fields' => [\n 'bid' => [\n 'description' => 'Primary Key: Unique batch ID.',\n // This is not a serial column, to allow both progressive and\n // non-progressive batches. See batch_process().\n 'type' => 'int',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n ],\n 'token' => [\n 'description' => \"A string token generated against the current user's session id and the batch id, used to ensure that only the user who submitted the batch can effectively access it.\",\n 'type' => 'varchar_ascii',\n 'length' => 64,\n 'not null' => TRUE,\n ],\n 'timestamp' => [\n 'description' => 'A Unix timestamp indicating when this batch was submitted for processing. Stale batches are purged at cron time.',\n 'type' => 'int',\n 'not null' => TRUE,\n ],\n 'batch' => [\n 'description' => 'A serialized array containing the processing data for the batch.',\n 'type' => 'blob',\n 'not null' => FALSE,\n 'size' => 'big',\n ],\n ],\n 'primary key' => ['bid'],\n 'indexes' => [\n 'token' => ['token'],\n ],\n ];\n }", "function dump_rewrite_rules_to_file()\n{\n $images_url = \\DB::connection('mysql')->table('url_rewrites')\n ->select(['from_url', 'to_url', 'type'])\n ->get()\n ->map(function ($row) {\n return \"rewrite \\\"^{$row->from_url}$\\\" {$row->to_url} redirect;\";\n });\n\n $videos_url = \\DB::connection('mysqlVideo')->table('url_rewrites')\n ->select(['from_url', 'to_url', 'type'])\n ->get()\n ->map(function ($row) {\n return \"rewrite \\\"^{$row->from_url}$\\\" {$row->to_url} redirect;\";\n });\n\n $content = $images_url\n ->merge($videos_url)\n ->pipe(function ($collection) {\n return implode(\"\\n\", $collection->toArray());\n });\n\n file_put_contents(public_path('nginx.conf'), $content);\n devops_reload_nginx();\n return true;\n}", "public function generate() {\n\t\t$graph = array();\n\n\t\tforeach ( $this->get_graph_pieces() as $piece ) {\n\t\t\tif ( ! $piece->is_needed() ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$graph_piece = $piece->generate();\n\n\t\t\t/**\n\t\t\t * Filter: 'wpseo_schema_<class name>' - Allows changing graph piece output.\n\t\t\t *\n\t\t\t * @api array $graph_piece The graph piece to filter.\n\t\t\t */\n\t\t\t$class = str_replace( 'wpseo_schema_', '', strtolower( get_class( $piece ) ) );\n\t\t\t$graph_piece = apply_filters( 'wpseo_schema_' . $class, $graph_piece );\n\t\t\tif ( is_array( $graph_piece ) ) {\n\t\t\t\t$graph[] = $graph_piece;\n\t\t\t}\n\t\t}\n\n\t\tWPSEO_Utils::schema_output( $graph, 'yoast-schema-graph yoast-schema-graph--main' );\n\t}", "public function metric()\n {\n return $this->availableMetrics()->first(function ($metric) {\n return $this->metric === $metric->uriKey();\n }) ?: abort(404);\n }", "public static function getStorageDescriptorPath()\n {\n return preg_replace('/.php$/', '.json', __FILE__);\n }", "public static function getStorageDescriptorPath()\n {\n return preg_replace('/.php$/', '.json', __FILE__);\n }", "public static function getStorageDescriptorPath()\n {\n return preg_replace('/.php$/', '.json', __FILE__);\n }", "public static function getStorageDescriptorPath()\n {\n return preg_replace('/.php$/', '.json', __FILE__);\n }", "protected function jobMetrics() {\n $metrics = array();\n if ($jobs = $this->getSteadyStateJobs()) {\n $iops = array();\n foreach(array_keys($jobs) as $job) {\n if (isset($jobs[$job]['write']['iops'])) $iops[] = $jobs[$job]['write']['iops'];\n }\n if ($iops) $metrics['iops'] = round(array_sum($iops)/count($iops));\n }\n return $metrics;\n }", "public function get_url() {\n\t\treturn 'http://code.google.com/p/wordpress-custom-content-type-manager/wiki/Textarea';\n\t}", "public function validationSummary();", "public function getSchema()\n {\n return $this->get(self::SCHEMA);\n }", "protected function schemaDefinition() {\n $schema = parent::schemaDefinition();\n\n $schema['views_test_data']['fields']['uid'] = [\n 'description' => \"The {users}.uid of the author of the beatle entry.\",\n 'type' => 'int',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n 'default' => 0,\n ];\n\n return $schema;\n }", "function write_endpoint_details($fh){\n\tGLOBAL $options;\n\tfwrite($fh, Quad(\"http://bio2rdf.org/dataset_resource:\".md5($options['url']), \"http://www.w3.org/1999/02/22-rdf-syntax-ns#type\", \"http://bio2rdf.org/dataset_vocabulary:Endpoint\"));\n\tfwrite($fh, QuadLiteral(\"http://bio2rdf.org/dataset_resource:\".md5($options['url']), \"http://www.w3.org/2000/01/rdf-schema#label\", $options['url'].\" SPARQL endpoint\"));\n\tfwrite($fh, Quad(\"http://bio2rdf.org/dataset_resource:\".md5($options['url']), \"http://bio2rdf.org/dataset_vocabulary:has_url\", $options['url']));\n}", "public function generateSchemaCommand($type = NULL, $path = NULL, $yaml = NULL) {\n\t\t$data = NULL;\n\t\tif ($yaml !== NULL && is_file($yaml) && is_readable($yaml)) {\n\t\t\t$data = \\Symfony\\Component\\Yaml\\Yaml::parse($yaml);\n\t\t} elseif ($type !== NULL) {\n\t\t\t$data = $this->configurationManager->getConfiguration($type);\n\t\t\tif ($path !== NULL){\n\t\t\t\t$data = \\TYPO3\\Flow\\Utility\\Arrays::getValueByPath($data, $path);\n\t\t\t}\n\t\t}\n\n\t\tif (empty($data)){\n\t\t\t$this->outputLine('Data was not found or is empty');\n\t\t\treturn;\n\t\t}\n\n\t\t$yaml = \\Symfony\\Component\\Yaml\\Yaml::dump($this->schemaGenerator->generate($data), 99);\n\t\t$this->output($yaml . chr(10));\n\t}", "public function getUserExperienceAnalyticsMetricId()\n {\n if (array_key_exists(\"userExperienceAnalyticsMetricId\", $this->_propDict)) {\n return $this->_propDict[\"userExperienceAnalyticsMetricId\"];\n } else {\n return null;\n }\n }", "public function save()\n\t{\n\t\t// -> means the file was never loaded because no setting was changed\n\t\t// -> means no need to save\n\t\tif ($this->settings === null) return;\n\t\t\n\t\t$yaml = Spyc::YAMLDump($this->settings);\n\t}", "public function setMetrics(string $metrics): self\n {\n $this->options['metrics'] = $metrics;\n return $this;\n }", "public static function getYamlConfig()\n {\n return file_get_contents(self::fixtureDir().'/fixture_config.yml');\n }", "public function getScaling() {}", "public function registerMetrics(PrometheusExporter $exporter);", "public function metricList(){\n\t\t\n\t\t$req = $this -> curl_req(\"GET\", \"api/v1/metrics\"); \n\t\t\n\t\t/* Check if the transaction was successfull and pass the data else return false */\n\t\t\n\t\treturn ($req[1]['http_code'] === 200) ? $req[0] : false;\n\t}", "public function getReferencedSchema(): string;", "function nice_metrics($domain,$cols,$axis_values)\n\t\t{\n\t\t\tglobal $METRICS;\n\t\t\t$raw_data\t\t=\tself::send_api_request($domain,$cols,true);\n\t\t\t$nice_metrics\t=\tself::nicify_metrics($raw_data,$METRICS,$axis_values);\n\t\t\treturn $nice_metrics;\n\t\t}", "public function export()\n {\n return $this->rules;\n }", "public function getOutput()\n {\n return $this->file->dumpString();\n }", "public function getSchema()\n {\n if ($this->schema) {\n return $this->schema;\n }\n\n return $this->schema = resolve(Bakery::getModelSchema($this));\n }", "public function setDimensions($value)\n {\n return $this->set('Dimensions', $value);\n }", "public function loadFromFile()\n {\n $this->getLogger()->debug('Reading metadata from ' . $this->defFile);\n $fields = Yaml::parse($this->defFile);\n if (!is_array($fields)) {\n $fields = array();\n $this->getLogger()->warning('No definition found in metadata file.');\n }\n $res = array();\n foreach ($fields as $field_data) {\n $res[$field_data['id']] = $field_data;\n }\n ksort($res);\n return $res;\n }", "public function getOutputConfig()\n {\n return $this->output_config;\n }", "public static function resolveSchemaUri(InputInterface $input)\n {\n if (!is_readable($input->getArgument('file'))) {\n throw new Exception('Schema file doesn\\'t exist or is not readable.');\n }\n\n // schema argument must be an URL\n $schema = $input->getArgument('schema');\n\n $file = sys_get_temp_dir().'/tmp.json';\n\n (new Client())->get($schema, [\n 'save_to' => $file,\n ]);\n\n $input->setArgument('schema', $file);\n }", "protected function restSystemCloudMetricsGetRequest()\n {\n\n $resourcePath = '/rest/system/cloud/metrics';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function store(Request $request)\n {\n // Simple code for now. Still needs determining game_id by api_key and saving identical metrics as a repetition\n $metric = new Metric;\n $metric->name = $request->input('name');\n $metric->category = $request->input('category');\n $metric->level = $request->input('level');\n $metric->value = $request->input('value');\n $metric->repetitions = $request->input('repetitions');\n $metric->game_id = $request->input('game_id');\n $metric->save();\n }", "public function getMetricId($metric_name, $metrics, $suffix, $desc){\n\t\t\n\t\t$id = \"\";\n\t\t\n\t\t/* Loop through all the metrics passed into this function */\n\t\t\n\t\tforeach ($metrics as $metric) {\n\t\t\t\n\t\t\t/* If metric Name match the expected, get the Id of the metric and break the loop */\n\t\t\t\n\t\t\tif ($metric['name'] === $metric_name){\n\t\t\t\n\t\t\t\t$id = $metric['id'];\n\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* Check if Id value is set from the previous block. If not enter here to create the metric */\n\t\t\n\t\tif ($id == \"\"){\n\t\t\t\n\t\t\t/* Set default value for Uptime as 100 while for Response as 0 */\n\t\t\t\n\t\t\t$default_value = ($suffix === \"%\") ? 100 : 0;\n\t\t\t\n\t\t\t/* Create a new metric with all the information passed into this function */\n\t\t\t\n\t\t\t$new_metric = $this -> curl_req(\"POST\", \"api/v1/metrics\", array('name' => $metric_name, 'suffix' => $suffix, 'description' => $desc, 'default_value' => $default_value, 'display_chart' => 1 ));\n\t\t\t\n\t\t\t/*If Metric was created successfully enter here to obtain the new metric id */\n\t\t\t\n\t\t\tif ($new_metric[0]['data']['name'] == $metric_name & $new_metric[1]['http_code'] === 200){\n\t\t\t\t\n\t\t\t\t/* Load updated Metrics */\n\t\t\t\t\n\t\t\t\t$updated_metrics = $this -> metricList();\n\t\t\t\t\n\t\t\t\t/* If metrics was loaded successfully get the new metric id here */\n\t\t\t\t\n\t\t\t\tif ($updated_metrics != false){\n\t\t\t\t\t\n\t\t\t\t\t$arr_id = count($updated_metrics['data']) - 1;\n\t\t\t\t\t\n\t\t\t\t\t$id = $updated_metrics['data'][$arr_id]['id'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $id;\n\t}", "public function test_scenario5() {\n\n $data = array(array('filename' => 'data/iris.csv', 'expected_file' => 'data/model/predictions_distribution_iris.txt'),\n array('filename' => 'data/iris_sp_chars.csv', 'expected_file' => 'data/model/predictions_distribution_iris_sp_chars.txt'),\n array('filename' => 'data/spam.csv', 'expected_file' => 'data/model/predictions_distribution_spam.txt'),\n array('filename' => 'data/grades.csv', 'expected_file' => 'data/model/predictions_distribution_grades.txt'),\n array('filename' => 'data/diabetes.csv', 'expected_file' => 'data/model/predictions_distribution_diabetes.txt'),\n array('filename' => 'data/iris_missing2.csv', 'expected_file' => 'data/model/predictions_distribution_iris_missing2.txt'),\n array('filename' => 'data/tiny_kdd.csv', 'expected_file' => 'data/model/predictions_distribution_tiny_kdd.txt')\n );\n\n foreach($data as $item) {\n print \"\\n Successfully creating a model and check its predictions distribution\\n\";\n\n print \"Given I create a data source uploading a \". $item[\"filename\"]. \" file\\n\";\n $source = self::$api->create_source($item[\"filename\"], $options=array('name'=>'local_test_source', 'project'=> self::$project->resource));\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $source->code);\n $this->assertEquals(1, $source->object->status->code);\n\n print \"And I wait until the source is ready\\n\";\n $resource = self::$api->_check_resource($source->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create dataset with local source\\n\";\n $dataset = self::$api->create_dataset($source->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $dataset->code);\n $this->assertEquals(BigMLRequest::QUEUED, $dataset->object->status->code);\n\n print \"And I wait until the dataset is ready\\n\";\n $resource = self::$api->_check_resource($dataset->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create model\\n\";\n $model = self::$api->create_model($dataset->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $model->code);\n\n print \"And I wait until the model is ready \". $model->resource . \"\\n\";\n $resource = self::$api->_check_resource($model->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create a local model\\n\";\n $local_model = new Model($model->resource, self::$api);\n print \"Then I check the predictions distribution with \". $item[\"expected_file\"] . \" file\\n\";\n\n $file_distribution = file_get_contents($item[\"expected_file\"]);\n $distribution = $local_model->get_prediction_distribution();\n $distribution_str='';\n\n foreach($distribution as $key => $value) {\n $distribution_str= $distribution_str . \"[\" . $key . \",\" . $value . \"]\\n\";\n }\n\n $this->assertEquals(trim($distribution_str), trim($file_distribution));\n\n }\n }", "public function getPropertySchema(): array;" ]
[ "0.51127285", "0.46667495", "0.4410763", "0.42922962", "0.42014173", "0.4187895", "0.4187895", "0.4187895", "0.4187895", "0.4148167", "0.41246045", "0.41243985", "0.41088638", "0.4058172", "0.40503067", "0.4027301", "0.40065604", "0.39757505", "0.39652964", "0.39454105", "0.39419806", "0.39270312", "0.39068207", "0.3895513", "0.38930812", "0.38885844", "0.38783294", "0.38537535", "0.38122886", "0.37726262", "0.37726262", "0.37276825", "0.37255248", "0.37215802", "0.37156975", "0.37022007", "0.36928874", "0.36915743", "0.36859486", "0.36807606", "0.36572862", "0.36572245", "0.36556622", "0.3644352", "0.36373615", "0.36272034", "0.36229187", "0.36220476", "0.3621376", "0.36146703", "0.36146703", "0.35984", "0.358754", "0.35772792", "0.35764092", "0.35729155", "0.35722044", "0.3558905", "0.35549185", "0.35467297", "0.35412955", "0.3536899", "0.35193348", "0.35189548", "0.3517159", "0.35158673", "0.35101002", "0.35056144", "0.35043567", "0.35043567", "0.35043567", "0.35043567", "0.35018256", "0.3501444", "0.3500326", "0.34936172", "0.3490826", "0.34885055", "0.34805596", "0.34797987", "0.3476143", "0.34727168", "0.3466748", "0.34611976", "0.3457228", "0.34516615", "0.3437496", "0.3434324", "0.34289268", "0.34242076", "0.34231263", "0.3423121", "0.3421384", "0.34213144", "0.34212154", "0.34210512", "0.34199885", "0.3418869", "0.3418707", "0.3418426" ]
0.56491095
0
Output only. Points to a YAML file stored on Google Cloud Storage describing the [metrics][google.cloud.aiplatform.v1.ModelEvaluationSlice.metrics] of this ModelEvaluationSlice. The schema is defined as an OpenAPI 3.0.2 [Schema Object]( Generated from protobuf field string metrics_schema_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
public function setMetricsSchemaUri($var) { GPBUtil::checkString($var, True); $this->metrics_schema_uri = $var; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMetricsSchemaUri()\n {\n return $this->metrics_schema_uri;\n }", "public function setMetrics($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Value::class);\n $this->metrics = $var;\n\n return $this;\n }", "public function getMetadataSchemaUri()\n {\n return $this->metadata_schema_uri;\n }", "protected function get_image_schema( $url ) {\n\t\t$image = new WPSEO_Schema_Image( $this->context->canonical . '#schema-image-' . md5( $url ) );\n\n\t\treturn $image->generate_from_url( $url );\n\t}", "public function getMetrics(): array;", "public function getMetrics()\n {\n return $this->metrics;\n }", "public function getMetrics()\n {\n return $this->metrics;\n }", "public function getMetrics()\n {\n return $this->metrics;\n }", "public function getMetrics()\n {\n return $this->metrics;\n }", "private function saveSourceReferencePoiMetric(){\n $sourceReference = $this->sourceReferenceFactory->getSourceReferenceById($sourceReferencePoi->source_reference_id);\n $sourceMetrics = $this->sourceMetricFactory->createSourceMetricsBySourceId($sourceReference->source_id);\n foreach($sourceMetrics as $sourceMetric){\n $sourceReferencePoiMetric = new \\source\\model\\SourceReferencePoiMetric();\n $sourceReferencePoiMetric->source_reference_poi_id = $sourceReferencePoi->source_reference_poi_id;\n $sourceReferencePoiMetric->metric_id = $sourceMetric->metric_id;\n $this->sourceReferencePoiMetricFactory->saveSourceReferencePoiMetric($sourceReferencePoiMetric);\n }\n }", "public function run()\n {\n // DB::table('widgets')->truncate();\n\n $metrics = array(\n\narray(\n 'name' => 'Top Customers',\n 'type' => 'table',\n 'updates_default' => '600',\n 'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n 'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n 'related' => '',\n),\narray('name' => 'Number of Inactive Customers',\n 'type' => 'snapshot',\n 'updates_default' => '600',\n 'user_parameters' => '{\"env\":\"\",\"options\":{\"IC_TIME_FRAME\":{ \"value\":\"7\", \"description\":\"The time frame in days where activity is monitored.\"}}}', \n 'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}', \n 'related' => ''),\narray(\n\t'name' => 'Active Calls',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , \narray(\n\t'name' => 'New Active Customers',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"NAC_TIME_FRAME\":{\"value\":\"1\", \"description\":\"The time frame in days for a customer to be considered \\'new\\'.\")}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) ,\narray(\n\t'name' => 'Number Of Customers With Overdue Invoices',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"overdue\"}',\n\t'related' => '35'\n) , array(\n\t'name' => 'Generated Revenue',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"Revenue\"}',\n\t'related' => '36'\n) , array(\n\t'name' => 'Revenue This Month',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Number Of Calls Per Day',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'ASR',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"asr\"}',\n\t'related' => '37'\n) , array(\n\t'name' => 'Call Volume (ONNET)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_sip\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'SIP-UA\\' connection.\"}, \"ps_internal_um\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'INTERNAL\\' connection.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"ONNET\"}',\n\t'related' => '38,39'\n) , array(\n\t'name' => 'Total Registered Locations',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Connection Utilization (OB)',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"originate\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'ACD (OB)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_sip\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'SIP-UA\\' connection.\"}, \"ps_internal_um\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'INTERNAL\\' connection.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"originate\"}',\n\t'related' => '41'\n) , array(\n\t'name' => 'Failed Calls',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"FAILEDCALLS_TIME_FRAME\":{\"value\":\"600\", \"description\":\"The time frame in seconds that is considered for analysis.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'ACD & PDD By Vendor',\n\t'type' => 'table',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_vendor\": {\"value\":\"\"}, \"PDD_RED_THESHOLD\": {\"value\":\"10000\"}, \"PDD_YELLOW_THESHOLD\": {\"value\":\"4000\"}, \"SHOW_INTERNAL_CNX\":{\"value\":\"true\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Call Loss Ratio',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Nr Of Short Calls',\n\t'type' => 'table',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"UC_TOO_SHORT\":{\"value\":\"10\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":{\"1\":\"short\"}}',\n\t'related' => ''\n) , array(\n\t'name' => 'Nr Of Long Calls',\n\t'type' => 'table',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"UC_TOO_LONG\":{\"value\":\"7200\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":{\"1\":\"long\"}}',\n\t'related' => ''\n) , array(\n\t'name' => 'Top 10 Destinations',\n\t'type' => 'table',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"TOP_DESTINATIONS_TIME_FRAME\": {\"value\":\"3600\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Top Vendors (Outbound)',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"TOP_VENDORS_TIME_FRAME\":{\"value\":\"86400\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":{\"1\":\"originate\"}}',\n\t'related' => ''\n) , array(\n\t'name' => 'Top Vendors (Inbound)',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"TOP_VENDORS_TIME_FRAME\":{\"value\":\"86400\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":{\"1\"1:\"answer\"}}',\n\t'related' => ''\n) , array(\n\t'name' => 'PDD',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_vendor\":{\"value\":\"\",\"description\":\"The ID of the PortaSwitch internal vendor.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Active Calls by Customer',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Call volume by Customer',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Number Of Customers With Unpaid Invoices',\n\t'type' => 'snapshot',\n\t'updates_default' => '86400',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"unpaid\"}',\n\t'related' => '14'\n) , array(\n\t'name' => 'Incurred Cost',\n\t'type' => 'duration',\n\t'updates_default' => '86400',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"Cost\"}',\n\t'related' => '15'\n) , array(\n\t'name' => 'NER',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"ner\"}',\n\t'related' => '18'\n) , array(\n\t'name' => 'Call Volume (OB)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_vendor\": {\"value\":\"\", \"description\":\"The ID of the PortaSwitch internal vendor.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"OUT\"}',\n\t'related' => '19,39'\n) , array(\n\t'name' => 'Call Volume (IB)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_vendor\": {\"value\":\"\", \"description\":\"The ID of the PortaSwitch internal vendor.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"IN\"}',\n\t'related' => '19,38'\n) , array(\n\t'name' => 'Connection Utilization (IB)',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"answer\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'ACD (IB)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_sip\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'SIP-UA\\' connection.\"}, \"ps_internal_um\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'INTERNAL\\' connection.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"answer\"}',\n\t'related' => '23'\n)\n\n );\n\n // Uncomment the below to run the seeder\n DB::table('metrics')->insert($metrics);\n \n \n }", "public function get_stats_schema() {\n\t\t\t$schema = array(\n\t\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t\t'title' => 'quiz-statistics',\n\t\t\t\t'parent' => 'quiz',\n\t\t\t\t'type' => 'object',\n\t\t\t\t'properties' => array(\n\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t'description' => __( 'Statistics Ref ID.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'quiz' => array(\n\t\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Quiz.\n\t\t\t\t\t\t\tesc_html_x(\n\t\t\t\t\t\t\t\t'%s ID.',\n\t\t\t\t\t\t\t\t'placeholder: Quiz',\n\t\t\t\t\t\t\t\t'learndash'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'quiz' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'user' => array(\n\t\t\t\t\t\t'description' => __( 'User ID.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'date' => array(\n\t\t\t\t\t\t'description' => __( 'Date.', 'learndash' ),\n\t\t\t\t\t\t'type' => array( 'string', null ),\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'answers_correct' => array(\n\t\t\t\t\t\t'description' => __( 'Answer correct.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'answers_incorrect' => array(\n\t\t\t\t\t\t'description' => __( 'Answer incorrect.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\treturn $schema;\n\t\t}", "public function getMetrics()\n\t{\n\t\treturn $this->metrics;\n\t}", "public function generate()\n {\n $this->schema->put('@graph', $this->expandGraphs());\n\n return $this->schema->toJson();\n }", "function getName(): string\n {\n return 'Metrics';\n }", "public function toYaml(): string\n {\n return Yaml::dump($this->toArray(), 20);\n }", "public function getMetadataSchema()\n {\n return isset($this->metadata_schema) ? $this->metadata_schema : null;\n }", "private function _getNumberOfMetrics() {}", "public function setMetrics($value)\n {\n return $this->set('Metrics', $value);\n }", "public function testDimensionsValidation(): void\n {\n $builder = new ValidationBuilder();\n $builder->validate(\"avatar\", function (Field $field): void {\n $field->dimensions(function(Dimensions $dimensions): void {\n $dimensions->ratio(3/2)->width(100);\n });\n });\n\n $rules = $builder->getRules();\n\n $this->assertCount(1, $rules);\n $this->assertEquals([\"dimensions:ratio=1.5,width=100\"], $rules[\"avatar\"]);\n }", "public function setMetrics($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Notebooks\\V1\\RuntimeMetrics::class);\n $this->metrics = $var;\n\n return $this;\n }", "protected function getMetricsTable()\n {\n $prefix = app(System::class)->getTablePrefix();\n\n return $prefix.'metrics';\n }", "public function getMetricDataFormat() {}", "public function getSamlMetadataUrl()\n {\n if (array_key_exists(\"samlMetadataUrl\", $this->_propDict)) {\n return $this->_propDict[\"samlMetadataUrl\"];\n } else {\n return null;\n }\n }", "public function getMetrics(): Response\n {\n\n $registry = \\Prometheus\\CollectorRegistry::getDefault();\n\n $renderer = new RenderTextFormat();\n $result = $renderer->render($registry->getMetricFamilySamples());\n\n return $this->responseFactory->make($result, 200, ['Content-Type' => RenderTextFormat::MIME_TYPE]);\n }", "public function get_stats_questions_schema() {\n\t\t\t$schema = array(\n\t\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t\t'title' => 'quiz-statistics-questions',\n\t\t\t\t'parent' => 'quiz-statistics',\n\t\t\t\t'type' => 'object',\n\t\t\t\t'properties' => array(\n\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t'description' => __( 'Unique ID for Statistics Question.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'statistic' => array(\n\t\t\t\t\t\t'description' => __( 'Statistics Ref ID.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'quiz' => array(\n\t\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Quiz.\n\t\t\t\t\t\t\tesc_html_x(\n\t\t\t\t\t\t\t\t'%s ID',\n\t\t\t\t\t\t\t\t'placeholder: Quiz',\n\t\t\t\t\t\t\t\t'learndash'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'quiz' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'question' => array(\n\t\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Question.\n\t\t\t\t\t\t\tesc_html_x(\n\t\t\t\t\t\t\t\t'%s ID',\n\t\t\t\t\t\t\t\t'placeholder: Question',\n\t\t\t\t\t\t\t\t'learndash'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'question' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'question_type' => array(\n\t\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Question.\n\t\t\t\t\t\t\tesc_html_x(\n\t\t\t\t\t\t\t\t'%s Type',\n\t\t\t\t\t\t\t\t'placeholder: Question',\n\t\t\t\t\t\t\t\t'learndash'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'question' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'points_scored' => array(\n\t\t\t\t\t\t'description' => esc_html__( 'Points scored.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'points_total' => array(\n\t\t\t\t\t\t'description' => esc_html__( 'Points total.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'answers' => array(\n\t\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Question.\n\t\t\t\t\t\t\tesc_html_x(\n\t\t\t\t\t\t\t\t'The collection of %s answers.',\n\t\t\t\t\t\t\t\t'placeholder: Question',\n\t\t\t\t\t\t\t\t'learndash'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'question' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'student' => array(\n\t\t\t\t\t\t'description' => __( 'The collection of student submitted answers.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\treturn $schema;\n\t\t}", "public function getReadNamespacedScaleScale(\n $name,\n $mnamespace,\n $pretty = null\n ) {\n\n //the base uri for api requests\n $_queryBuilder = Configuration::$BASEURI;\n \n //prepare query string for API call\n $_queryBuilder = $_queryBuilder.\n '/oapi/v1/namespaces/{namespace}/deploymentconfigs/{name}/scale';\n\n //process optional query parameters\n $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array (\n 'name' => $name,\n 'namespace' => $mnamespace,\n ));\n\n //process optional query parameters\n APIHelper::appendUrlWithQueryParameters($_queryBuilder, array (\n 'pretty' => $pretty,\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl($_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => 'APIMATIC 2.0',\n 'Accept' => 'application/json'\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::get($_queryUrl, $_headers);\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n $mapper = $this->getJsonMapper();\n\n return $mapper->mapClass($response->body, 'OpenShiftAPIWithKubernetesLib\\\\Models\\\\V1beta1Scale');\n }", "function gttn_tpps_xlsx_get_dimension($location) {\n $reader = new XMLReader();\n $reader->open($location);\n while ($reader->read()) {\n if ($reader->nodeType == XMLReader::ELEMENT and $reader->name == 'dimension') {\n $dim = $reader->getAttribute('ref');\n $reader->close();\n return $dim;\n }\n }\n return NULL;\n}", "function Monitor_Shortcuts_convertPageOfMetricsToResponse($request, $match, $page)\n{\n // User defined format\n if (Monitor_Shortcuts_isPrometheusRequest($request)) {\n $items = $page->fetchItems();\n $result = '';\n foreach ($items as $metric) {\n $value = $metric->invoke($request, $match);\n $result = $result . //\n Monitor_Shortcuts_convertMetricToPrometheusLabel($metric) . \" \" . //\n ($value ? $value : '0') . PHP_EOL;\n }\n return new Pluf_HTTP_Response($result, 'text/plain');\n }\n return $page;\n}", "public function getSchema(): string;", "public function getSchema(): string;", "function YAMLLoad($input) {\n\t\t$spyc = new Spyc;\n\t\treturn $spyc->load($input);\n\t}", "public function updateReplaceNamespacedScaleScale(\n $body,\n $name,\n $mnamespace,\n $pretty = null\n ) {\n\n //the base uri for api requests\n $_queryBuilder = Configuration::$BASEURI;\n \n //prepare query string for API call\n $_queryBuilder = $_queryBuilder.\n '/oapi/v1/namespaces/{namespace}/deploymentconfigs/{name}/scale';\n\n //process optional query parameters\n $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array (\n 'name' => $name,\n 'namespace' => $mnamespace,\n ));\n\n //process optional query parameters\n APIHelper::appendUrlWithQueryParameters($_queryBuilder, array (\n 'pretty' => $pretty,\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl($_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => 'APIMATIC 2.0',\n 'Accept' => 'application/json',\n 'content-type' => 'application/json; charset=utf-8'\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::put($_queryUrl, $_headers, Request\\Body::Json($body));\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n $mapper = $this->getJsonMapper();\n\n return $mapper->mapClass($response->body, 'OpenShiftAPIWithKubernetesLib\\\\Models\\\\V1beta1Scale');\n }", "protected function getSchema()\n {\n return '{\n \"$schema\":\"http://json-schema.org/draft-04/schema#\",\n \"title\":\"' . $this->name . ' Schema\",\n \"description\":\"' . $this->description . '\",\n \"type\":\"object\",\n \"additionalProperties\":false,\n \"properties\":{\n \"string\":{\n \"type\":\"string\",\n \"description\": \"The input string to process\"\n }\n },\n \"required\":[\n \"string\"\n ]\n }';\n }", "public function retrieveReactorMetrics()\n {\n return $this->start()->uri(\"/api/reactor/metrics\")\n ->get()\n ->go();\n }", "public function __construct($metrics, $dimensions)\n {\n $this->metrics = $metrics;\n $this->dimensions = $dimensions;\n }", "public static function getSampleYamlFile()\n {\n return self::fixtureDir().'/fixture_sample.yml';\n }", "public function getAnalysisStorage(): StorageInterface;", "public static function getSampleYamlString()\n {\n return trim(\n '---'.\"\\n\".\n 'greeting: \"hello\"'.\"\\n\".\n 'to: \"you\"'.\"\\n\"\n );\n }", "public function getFiguredLarge()\n\t{\n\t\tif(!Storage::has('json/wristband/colors/figuredLarge.json')) {\n\t\t\t// generate and save .json file.\n\t\t\tStorage::put('json/wristband/colors/figuredLarge.json', json_encode($this->figuredLarge()));\n\t\t}\n\t\t// return data from .json file.\n\t\treturn json_decode(Storage::get('json/wristband/colors/figuredLarge.json'), true);\n\t}", "public function emit($data) {\r\n $output = sfYaml::dump($data);\r\n return $output; \r\n }", "public function schema()\r\n {\r\n return $this->getKey('schema', true);\r\n }", "public function getOutputUri()\n {\n return $this->output_uri;\n }", "public function get_item_schema() {\n\t\tif ( $this->schema ) {\n\t\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t\t}\n\n\t\t$this->schema = array(\n\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title' => 'url-details',\n\t\t\t'type' => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'title' => array(\n\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t/* translators: %s: HTML title tag. */\n\t\t\t\t\t\t__( 'The contents of the %s element from the URL.' ),\n\t\t\t\t\t\t'<title>'\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'icon' => array(\n\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t/* translators: %s: HTML link tag. */\n\t\t\t\t\t\t__( 'The favicon image link of the %s element from the URL.' ),\n\t\t\t\t\t\t'<link rel=\"icon\">'\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'description' => array(\n\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t/* translators: %s: HTML meta tag. */\n\t\t\t\t\t\t__( 'The content of the %s element from the URL.' ),\n\t\t\t\t\t\t'<meta name=\"description\">'\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'image' => array(\n\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t/* translators: 1: HTML meta tag, 2: HTML meta tag. */\n\t\t\t\t\t\t__( 'The Open Graph image link of the %1$s or %2$s element from the URL.' ),\n\t\t\t\t\t\t'<meta property=\"og:image\">',\n\t\t\t\t\t\t'<meta property=\"og:image:url\">'\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t}", "public function getSchemaPath() : string\n {\n return $this->schema;\n }", "public function getOutSchema() {\n return static::$outSchema;\n }", "public function dataset($file, $format = null)\n {\n $file = $this->getDatasetFile($file);\n if (!file_exists($file)) {\n throw new \\InvalidArgumentException(\"Could not find dataset file '$file'\");\n }\n if (!$format) {\n $format = pathinfo($file, \\PATHINFO_EXTENSION);\n }\n if ($format == 'json') {\n return json_decode(file_get_contents($file), true);\n } elseif (in_array($format, array('yml', 'yaml'))) {\n return yaml_parse_file($file);\n } elseif ($format == 'php') {\n return require($file);\n } else {\n return file_get_contents($file);\n }\n }", "public function getDimensionsString()\n {\n $size = $this->getImageSize();\n\n return $size[3];\n }", "public function getMetric()\n {\n return isset($this->metric) ? $this->metric : '';\n }", "public function getMetric()\n {\n return $this->metric;\n }", "public function getMetric()\n {\n return $this->metric;\n }", "public function getDimensions() {}", "public function setQueryMetrics($var)\n {\n GPBUtil::checkMessage($var, QueryMetrics::class);\n $this->query_metrics = $var;\n\n return $this;\n }", "public function loadYamlConfig($filepath);", "public function getSchema()\n {\n return $this->source;\n }", "public function getSchema() {}", "public function setMetadataSchemaUri($var)\n {\n GPBUtil::checkString($var, True);\n $this->metadata_schema_uri = $var;\n\n return $this;\n }", "public function chartApiOutput() {\n\n $user = Auth::user();\n $chart = new DataChart();\n $mounthOutput = $this->getQueryChart($user);\n $chart->dataset('Last Mounth output', 'line', $mounthOutput->values())\n ->color('rgb(0,123,255)');;\n return json_decode($chart->api());\n }", "public function getMetricType()\n {\n if (array_key_exists(\"metricType\", $this->_propDict)) {\n return $this->_propDict[\"metricType\"];\n } else {\n return null;\n }\n }", "function print_dataset_definitions_category($form) {\n global $CFG, $DB;\n $datasetdefs = array();\n $lnamemax = 22;\n $namestr =get_string('name', 'quiz');\n $minstr=get_string('min', 'quiz');\n $maxstr=get_string('max', 'quiz');\n $rangeofvaluestr=get_string('minmax','qtype_datasetdependent');\n $questionusingstr = get_string('usedinquestion','qtype_calculated');\n $itemscountstr = get_string('itemscount','qtype_datasetdependent');\n $text ='';\n if (!empty($form->category)) {\n list($category) = explode(',', $form->category);\n $sql = \"SELECT i.*,d.*\n FROM {question_datasets} d,\n {question_dataset_definitions} i\n WHERE i.id = d.datasetdefinition\n AND i.category = ?;\n \" ;\n if ($records = $DB->get_records_sql($sql, array($category))) {\n foreach ($records as $r) {\n $sql1 = \"SELECT q.*\n FROM {question} q\n WHERE q.id = ?\n \";\n if ( !isset ($datasetdefs[\"$r->type-$r->category-$r->name\"])){\n $datasetdefs[\"$r->type-$r->category-$r->name\"]= $r;\n }\n if ($questionb = $DB->get_records_sql($sql1, array($r->question))) {\n $datasetdefs[\"$r->type-$r->category-$r->name\"]->questions[$r->question]->name =$questionb[$r->question]->name ;\n }\n }\n }\n }\n if (!empty ($datasetdefs)){\n\n $text =\"<table width=\\\"100%\\\" border=\\\"1\\\"><tr><th style=\\\"white-space:nowrap;\\\" class=\\\"header\\\" scope=\\\"col\\\" >$namestr</th><th style=\\\"white-space:nowrap;\\\" class=\\\"header\\\" scope=\\\"col\\\">$rangeofvaluestr</th><th style=\\\"white-space:nowrap;\\\" class=\\\"header\\\" scope=\\\"col\\\">$itemscountstr</th><th style=\\\"white-space:nowrap;\\\" class=\\\"header\\\" scope=\\\"col\\\">$questionusingstr</th></tr>\";\n foreach ($datasetdefs as $datasetdef){\n list($distribution, $min, $max,$dec) = explode(':', $datasetdef->options, 4);\n $text .=\"<tr><td valign=\\\"top\\\" align=\\\"center\\\"> $datasetdef->name </td><td align=\\\"center\\\" valign=\\\"top\\\"> $min <strong>-</strong> $max </td><td align=\\\"right\\\" valign=\\\"top\\\">$datasetdef->itemcount&nbsp;&nbsp;</td><td align=\\\"left\\\">\";\n foreach ($datasetdef->questions as $qu) {\n //limit the name length displayed\n if (!empty($qu->name)) {\n $qu->name = (strlen($qu->name) > $lnamemax) ?\n substr($qu->name, 0, $lnamemax).'...' : $qu->name;\n } else {\n $qu->name = '';\n }\n $text .=\" &nbsp;&nbsp; $qu->name <br/>\";\n }\n $text .=\"</td></tr>\";\n }\n $text .=\"</table>\";\n }else{\n $text .=get_string('nosharedwildcard', 'qtype_calculated');\n }\n return $text ;\n }", "public function metrics($user_id = 'me') {\n \t$result = $this->get(\"/v2/users/{$user_id}/metrics\");\n \treturn $result;\n }", "public static function generateYaml(array $data, $outputFile)\n {\n $outputFileDir = dirname($outputFile);\n if (!is_dir($outputFileDir)) {\n throw new \\InvalidArgumentException(\"$outputFileDir is not a valid directory (\" . __FUNCTION__ . ')');\n }\n\n $dumper = new YamlDumper();\n $dumper->setIndentation(4);\n $yaml = $dumper->dump($data, 3);\n file_put_contents($outputFile, $yaml);\n\n return true;\n }", "public function describe($model) { //IMPORTANTISIMO es el que devuelve el schema al Modelo\n\t\treturn $this->_schema;\n\t}", "public function getResourcePathForExport()\n {\n $sFileExtension = pathinfo($this->_getIssueHelpPage()->name, PATHINFO_EXTENSION);\n $sFileExtension = Zend_Filter::filterStatic($sFileExtension, 'StringToLower', array('encoding' => 'UTF-8'));\n $sFileExtension = ('pdf' == $sFileExtension) ? 'png' : $sFileExtension;\n\n if (empty($sFileExtension)) {\n return null;\n }\n\n $sValue = '/' . $this->_getIssueHelpPage()->getThumbnailPresetType()\n . '/' . AM_Tools_String::generatePathFromId($this->_getIssueHelpPage()->id_issue)\n . '/' . $this->_getIssueHelpPage()->type . '.' . $sFileExtension;\n\n return $sValue;\n }", "public function schemaDefinition() {\n return [\n 'description' => 'Stores details about batches (processes that run in multiple HTTP requests).',\n 'fields' => [\n 'bid' => [\n 'description' => 'Primary Key: Unique batch ID.',\n // This is not a serial column, to allow both progressive and\n // non-progressive batches. See batch_process().\n 'type' => 'int',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n ],\n 'token' => [\n 'description' => \"A string token generated against the current user's session id and the batch id, used to ensure that only the user who submitted the batch can effectively access it.\",\n 'type' => 'varchar_ascii',\n 'length' => 64,\n 'not null' => TRUE,\n ],\n 'timestamp' => [\n 'description' => 'A Unix timestamp indicating when this batch was submitted for processing. Stale batches are purged at cron time.',\n 'type' => 'int',\n 'not null' => TRUE,\n ],\n 'batch' => [\n 'description' => 'A serialized array containing the processing data for the batch.',\n 'type' => 'blob',\n 'not null' => FALSE,\n 'size' => 'big',\n ],\n ],\n 'primary key' => ['bid'],\n 'indexes' => [\n 'token' => ['token'],\n ],\n ];\n }", "function dump_rewrite_rules_to_file()\n{\n $images_url = \\DB::connection('mysql')->table('url_rewrites')\n ->select(['from_url', 'to_url', 'type'])\n ->get()\n ->map(function ($row) {\n return \"rewrite \\\"^{$row->from_url}$\\\" {$row->to_url} redirect;\";\n });\n\n $videos_url = \\DB::connection('mysqlVideo')->table('url_rewrites')\n ->select(['from_url', 'to_url', 'type'])\n ->get()\n ->map(function ($row) {\n return \"rewrite \\\"^{$row->from_url}$\\\" {$row->to_url} redirect;\";\n });\n\n $content = $images_url\n ->merge($videos_url)\n ->pipe(function ($collection) {\n return implode(\"\\n\", $collection->toArray());\n });\n\n file_put_contents(public_path('nginx.conf'), $content);\n devops_reload_nginx();\n return true;\n}", "public function generate() {\n\t\t$graph = array();\n\n\t\tforeach ( $this->get_graph_pieces() as $piece ) {\n\t\t\tif ( ! $piece->is_needed() ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$graph_piece = $piece->generate();\n\n\t\t\t/**\n\t\t\t * Filter: 'wpseo_schema_<class name>' - Allows changing graph piece output.\n\t\t\t *\n\t\t\t * @api array $graph_piece The graph piece to filter.\n\t\t\t */\n\t\t\t$class = str_replace( 'wpseo_schema_', '', strtolower( get_class( $piece ) ) );\n\t\t\t$graph_piece = apply_filters( 'wpseo_schema_' . $class, $graph_piece );\n\t\t\tif ( is_array( $graph_piece ) ) {\n\t\t\t\t$graph[] = $graph_piece;\n\t\t\t}\n\t\t}\n\n\t\tWPSEO_Utils::schema_output( $graph, 'yoast-schema-graph yoast-schema-graph--main' );\n\t}", "public static function getStorageDescriptorPath()\n {\n return preg_replace('/.php$/', '.json', __FILE__);\n }", "public static function getStorageDescriptorPath()\n {\n return preg_replace('/.php$/', '.json', __FILE__);\n }", "public static function getStorageDescriptorPath()\n {\n return preg_replace('/.php$/', '.json', __FILE__);\n }", "public static function getStorageDescriptorPath()\n {\n return preg_replace('/.php$/', '.json', __FILE__);\n }", "public function metric()\n {\n return $this->availableMetrics()->first(function ($metric) {\n return $this->metric === $metric->uriKey();\n }) ?: abort(404);\n }", "public function get_url() {\n\t\treturn 'http://code.google.com/p/wordpress-custom-content-type-manager/wiki/Textarea';\n\t}", "public function validationSummary();", "protected function jobMetrics() {\n $metrics = array();\n if ($jobs = $this->getSteadyStateJobs()) {\n $iops = array();\n foreach(array_keys($jobs) as $job) {\n if (isset($jobs[$job]['write']['iops'])) $iops[] = $jobs[$job]['write']['iops'];\n }\n if ($iops) $metrics['iops'] = round(array_sum($iops)/count($iops));\n }\n return $metrics;\n }", "public function getSchema()\n {\n return $this->get(self::SCHEMA);\n }", "protected function schemaDefinition() {\n $schema = parent::schemaDefinition();\n\n $schema['views_test_data']['fields']['uid'] = [\n 'description' => \"The {users}.uid of the author of the beatle entry.\",\n 'type' => 'int',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n 'default' => 0,\n ];\n\n return $schema;\n }", "function write_endpoint_details($fh){\n\tGLOBAL $options;\n\tfwrite($fh, Quad(\"http://bio2rdf.org/dataset_resource:\".md5($options['url']), \"http://www.w3.org/1999/02/22-rdf-syntax-ns#type\", \"http://bio2rdf.org/dataset_vocabulary:Endpoint\"));\n\tfwrite($fh, QuadLiteral(\"http://bio2rdf.org/dataset_resource:\".md5($options['url']), \"http://www.w3.org/2000/01/rdf-schema#label\", $options['url'].\" SPARQL endpoint\"));\n\tfwrite($fh, Quad(\"http://bio2rdf.org/dataset_resource:\".md5($options['url']), \"http://bio2rdf.org/dataset_vocabulary:has_url\", $options['url']));\n}", "public function generateSchemaCommand($type = NULL, $path = NULL, $yaml = NULL) {\n\t\t$data = NULL;\n\t\tif ($yaml !== NULL && is_file($yaml) && is_readable($yaml)) {\n\t\t\t$data = \\Symfony\\Component\\Yaml\\Yaml::parse($yaml);\n\t\t} elseif ($type !== NULL) {\n\t\t\t$data = $this->configurationManager->getConfiguration($type);\n\t\t\tif ($path !== NULL){\n\t\t\t\t$data = \\TYPO3\\Flow\\Utility\\Arrays::getValueByPath($data, $path);\n\t\t\t}\n\t\t}\n\n\t\tif (empty($data)){\n\t\t\t$this->outputLine('Data was not found or is empty');\n\t\t\treturn;\n\t\t}\n\n\t\t$yaml = \\Symfony\\Component\\Yaml\\Yaml::dump($this->schemaGenerator->generate($data), 99);\n\t\t$this->output($yaml . chr(10));\n\t}", "public function getUserExperienceAnalyticsMetricId()\n {\n if (array_key_exists(\"userExperienceAnalyticsMetricId\", $this->_propDict)) {\n return $this->_propDict[\"userExperienceAnalyticsMetricId\"];\n } else {\n return null;\n }\n }", "public function save()\n\t{\n\t\t// -> means the file was never loaded because no setting was changed\n\t\t// -> means no need to save\n\t\tif ($this->settings === null) return;\n\t\t\n\t\t$yaml = Spyc::YAMLDump($this->settings);\n\t}", "public function setMetrics(string $metrics): self\n {\n $this->options['metrics'] = $metrics;\n return $this;\n }", "public static function getYamlConfig()\n {\n return file_get_contents(self::fixtureDir().'/fixture_config.yml');\n }", "public function getScaling() {}", "public function registerMetrics(PrometheusExporter $exporter);", "public function metricList(){\n\t\t\n\t\t$req = $this -> curl_req(\"GET\", \"api/v1/metrics\"); \n\t\t\n\t\t/* Check if the transaction was successfull and pass the data else return false */\n\t\t\n\t\treturn ($req[1]['http_code'] === 200) ? $req[0] : false;\n\t}", "public function getReferencedSchema(): string;", "function nice_metrics($domain,$cols,$axis_values)\n\t\t{\n\t\t\tglobal $METRICS;\n\t\t\t$raw_data\t\t=\tself::send_api_request($domain,$cols,true);\n\t\t\t$nice_metrics\t=\tself::nicify_metrics($raw_data,$METRICS,$axis_values);\n\t\t\treturn $nice_metrics;\n\t\t}", "public function export()\n {\n return $this->rules;\n }", "public function loadFromFile()\n {\n $this->getLogger()->debug('Reading metadata from ' . $this->defFile);\n $fields = Yaml::parse($this->defFile);\n if (!is_array($fields)) {\n $fields = array();\n $this->getLogger()->warning('No definition found in metadata file.');\n }\n $res = array();\n foreach ($fields as $field_data) {\n $res[$field_data['id']] = $field_data;\n }\n ksort($res);\n return $res;\n }", "public static function resolveSchemaUri(InputInterface $input)\n {\n if (!is_readable($input->getArgument('file'))) {\n throw new Exception('Schema file doesn\\'t exist or is not readable.');\n }\n\n // schema argument must be an URL\n $schema = $input->getArgument('schema');\n\n $file = sys_get_temp_dir().'/tmp.json';\n\n (new Client())->get($schema, [\n 'save_to' => $file,\n ]);\n\n $input->setArgument('schema', $file);\n }", "public function getSchema()\n {\n if ($this->schema) {\n return $this->schema;\n }\n\n return $this->schema = resolve(Bakery::getModelSchema($this));\n }", "public function getOutput()\n {\n return $this->file->dumpString();\n }", "public function setDimensions($value)\n {\n return $this->set('Dimensions', $value);\n }", "public function test_scenario5() {\n\n $data = array(array('filename' => 'data/iris.csv', 'expected_file' => 'data/model/predictions_distribution_iris.txt'),\n array('filename' => 'data/iris_sp_chars.csv', 'expected_file' => 'data/model/predictions_distribution_iris_sp_chars.txt'),\n array('filename' => 'data/spam.csv', 'expected_file' => 'data/model/predictions_distribution_spam.txt'),\n array('filename' => 'data/grades.csv', 'expected_file' => 'data/model/predictions_distribution_grades.txt'),\n array('filename' => 'data/diabetes.csv', 'expected_file' => 'data/model/predictions_distribution_diabetes.txt'),\n array('filename' => 'data/iris_missing2.csv', 'expected_file' => 'data/model/predictions_distribution_iris_missing2.txt'),\n array('filename' => 'data/tiny_kdd.csv', 'expected_file' => 'data/model/predictions_distribution_tiny_kdd.txt')\n );\n\n foreach($data as $item) {\n print \"\\n Successfully creating a model and check its predictions distribution\\n\";\n\n print \"Given I create a data source uploading a \". $item[\"filename\"]. \" file\\n\";\n $source = self::$api->create_source($item[\"filename\"], $options=array('name'=>'local_test_source', 'project'=> self::$project->resource));\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $source->code);\n $this->assertEquals(1, $source->object->status->code);\n\n print \"And I wait until the source is ready\\n\";\n $resource = self::$api->_check_resource($source->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create dataset with local source\\n\";\n $dataset = self::$api->create_dataset($source->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $dataset->code);\n $this->assertEquals(BigMLRequest::QUEUED, $dataset->object->status->code);\n\n print \"And I wait until the dataset is ready\\n\";\n $resource = self::$api->_check_resource($dataset->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create model\\n\";\n $model = self::$api->create_model($dataset->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $model->code);\n\n print \"And I wait until the model is ready \". $model->resource . \"\\n\";\n $resource = self::$api->_check_resource($model->resource, null, 3000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create a local model\\n\";\n $local_model = new Model($model->resource, self::$api);\n print \"Then I check the predictions distribution with \". $item[\"expected_file\"] . \" file\\n\";\n\n $file_distribution = file_get_contents($item[\"expected_file\"]);\n $distribution = $local_model->get_prediction_distribution();\n $distribution_str='';\n\n foreach($distribution as $key => $value) {\n $distribution_str= $distribution_str . \"[\" . $key . \",\" . $value . \"]\\n\";\n }\n\n $this->assertEquals(trim($distribution_str), trim($file_distribution));\n\n }\n }", "public function store(Request $request)\n {\n // Simple code for now. Still needs determining game_id by api_key and saving identical metrics as a repetition\n $metric = new Metric;\n $metric->name = $request->input('name');\n $metric->category = $request->input('category');\n $metric->level = $request->input('level');\n $metric->value = $request->input('value');\n $metric->repetitions = $request->input('repetitions');\n $metric->game_id = $request->input('game_id');\n $metric->save();\n }", "public function getOutputConfig()\n {\n return $this->output_config;\n }", "protected function restSystemCloudMetricsGetRequest()\n {\n\n $resourcePath = '/rest/system/cloud/metrics';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getPropertySchema(): array;", "public function getMetricId($metric_name, $metrics, $suffix, $desc){\n\t\t\n\t\t$id = \"\";\n\t\t\n\t\t/* Loop through all the metrics passed into this function */\n\t\t\n\t\tforeach ($metrics as $metric) {\n\t\t\t\n\t\t\t/* If metric Name match the expected, get the Id of the metric and break the loop */\n\t\t\t\n\t\t\tif ($metric['name'] === $metric_name){\n\t\t\t\n\t\t\t\t$id = $metric['id'];\n\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* Check if Id value is set from the previous block. If not enter here to create the metric */\n\t\t\n\t\tif ($id == \"\"){\n\t\t\t\n\t\t\t/* Set default value for Uptime as 100 while for Response as 0 */\n\t\t\t\n\t\t\t$default_value = ($suffix === \"%\") ? 100 : 0;\n\t\t\t\n\t\t\t/* Create a new metric with all the information passed into this function */\n\t\t\t\n\t\t\t$new_metric = $this -> curl_req(\"POST\", \"api/v1/metrics\", array('name' => $metric_name, 'suffix' => $suffix, 'description' => $desc, 'default_value' => $default_value, 'display_chart' => 1 ));\n\t\t\t\n\t\t\t/*If Metric was created successfully enter here to obtain the new metric id */\n\t\t\t\n\t\t\tif ($new_metric[0]['data']['name'] == $metric_name & $new_metric[1]['http_code'] === 200){\n\t\t\t\t\n\t\t\t\t/* Load updated Metrics */\n\t\t\t\t\n\t\t\t\t$updated_metrics = $this -> metricList();\n\t\t\t\t\n\t\t\t\t/* If metrics was loaded successfully get the new metric id here */\n\t\t\t\t\n\t\t\t\tif ($updated_metrics != false){\n\t\t\t\t\t\n\t\t\t\t\t$arr_id = count($updated_metrics['data']) - 1;\n\t\t\t\t\t\n\t\t\t\t\t$id = $updated_metrics['data'][$arr_id]['id'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $id;\n\t}" ]
[ "0.56483215", "0.46644998", "0.44116184", "0.4294168", "0.41995797", "0.41843003", "0.41843003", "0.41843003", "0.41843003", "0.41493493", "0.41240975", "0.41240925", "0.41054243", "0.40587628", "0.4048435", "0.40290835", "0.40068465", "0.39738998", "0.39631787", "0.39458957", "0.39407477", "0.39252692", "0.39065248", "0.3894574", "0.3892915", "0.38885707", "0.38775447", "0.38541532", "0.38118136", "0.37739027", "0.37739027", "0.37282825", "0.37276188", "0.37224782", "0.37125945", "0.37020236", "0.36951447", "0.36906058", "0.36883384", "0.3680042", "0.36590955", "0.36568087", "0.36562395", "0.36463133", "0.36378708", "0.36263484", "0.3622423", "0.3620933", "0.36190063", "0.36117107", "0.36117107", "0.35966182", "0.35854238", "0.35808945", "0.35766482", "0.3574417", "0.3573826", "0.3558254", "0.3552764", "0.35473725", "0.35394573", "0.35391083", "0.3520069", "0.3519425", "0.35178056", "0.3517513", "0.35111076", "0.35053298", "0.35053298", "0.35053298", "0.35053298", "0.35036555", "0.3502831", "0.3500438", "0.34988236", "0.34937802", "0.34931993", "0.34897947", "0.34834355", "0.34784675", "0.3477707", "0.34712288", "0.3468778", "0.34591892", "0.34559843", "0.3449429", "0.34386912", "0.3433255", "0.34281725", "0.34241396", "0.3423906", "0.34229693", "0.34228128", "0.34217045", "0.34204945", "0.34204382", "0.34198266", "0.3419233", "0.341913", "0.34184542" ]
0.5113107
1
Output only. Sliced evaluation metrics of the Model. The schema of the metrics is stored in [metrics_schema_uri][google.cloud.aiplatform.v1.ModelEvaluationSlice.metrics_schema_uri] Generated from protobuf field .google.protobuf.Value metrics = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
public function getMetrics() { return $this->metrics; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setMetrics($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Value::class);\n $this->metrics = $var;\n\n return $this;\n }", "public function getMetrics()\n\t{\n\t\treturn $this->metrics;\n\t}", "public function getMetrics(): array;", "public function index()\n {\n return evaluationSummary::all();\n }", "public function setMetrics($value)\n {\n return $this->set('Metrics', $value);\n }", "public function getMeasures() {\n return $this->measures;\n }", "public function retrieveReactorMetrics()\n {\n return $this->start()->uri(\"/api/reactor/metrics\")\n ->get()\n ->go();\n }", "public function getEvaluations();", "public function scores() {\n\n\t\treturn $this->hasMany('App\\EvaluationScore', 'evaluation_id', 'evaluation_id');\n\t}", "public function getQueryMetrics()\n {\n return $this->query_metrics;\n }", "public function setMetrics($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Notebooks\\V1\\RuntimeMetrics::class);\n $this->metrics = $var;\n\n return $this;\n }", "public function evaluations()\n {\n return $this->hasMany(Evaluation::class);\n }", "public function setQueryMetrics($var)\n {\n GPBUtil::checkMessage($var, QueryMetrics::class);\n $this->query_metrics = $var;\n\n return $this;\n }", "public function evaluations()\n {\n return $this->belongsToMany('App\\Evaluation');\n }", "public function getEvaluation()\n {\n return $this->evaluation;\n }", "public function availableMetrics()\n {\n return DashboardNova::allAvailableDashboardCards($this)->whereInstanceOf(Metric::class);\n }", "public function evaluations()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Evaluation', 'application_id');\n\t}", "public function evaluation()\n {\n return $this->hasMany('App\\Models\\Evaluation', 'user_id');\n }", "public function getMetrics(): Response\n {\n\n $registry = \\Prometheus\\CollectorRegistry::getDefault();\n\n $renderer = new RenderTextFormat();\n $result = $renderer->render($registry->getMetricFamilySamples());\n\n return $this->responseFactory->make($result, 200, ['Content-Type' => RenderTextFormat::MIME_TYPE]);\n }", "public function setMetrics(string $metrics): self\n {\n $this->options['metrics'] = $metrics;\n return $this;\n }", "public function ListModelEvaluationSlices(\\Google\\Cloud\\AIPlatform\\V1\\ListModelEvaluationSlicesRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/ListModelEvaluationSlices',\n $argument,\n ['\\Google\\Cloud\\AIPlatform\\V1\\ListModelEvaluationSlicesResponse', 'decode'],\n $metadata, $options);\n }", "public function index()\n\t{\n\t\t$metrics = Metric::all();\n\t\treturn $metrics;\n\t}", "protected function jobMetrics() {\n $metrics = array();\n if ($jobs = $this->getSteadyStateJobs()) {\n $iops = array();\n foreach(array_keys($jobs) as $job) {\n if (isset($jobs[$job]['write']['iops'])) $iops[] = $jobs[$job]['write']['iops'];\n }\n if ($iops) $metrics['iops'] = round(array_sum($iops)/count($iops));\n }\n return $metrics;\n }", "public function setSlice($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\AIPlatform\\V1\\ModelEvaluationSlice\\Slice::class);\n $this->slice = $var;\n\n return $this;\n }", "public function getObservations()\n {\n return $this->observations;\n }", "public function run()\n {\n $part_b_evals = [\n // self-evaluations col 1 part b\n ['group_id' => '2','choice_id' => '81','meta' => '1'],\n ['group_id' => '2','choice_id' => '85','meta' => '1'],\n ['group_id' => '2','choice_id' => '89','meta' => '1'],\n ['group_id' => '2','choice_id' => '93','meta' => '1'],\n ['group_id' => '2','choice_id' => '97','meta' => '1'],\n ['group_id' => '2','choice_id' => '101','meta' => '1'],\n ['group_id' => '2','choice_id' => '105','meta' => '1'],\n ['group_id' => '2','choice_id' => '109','meta' => '1'],\n ['group_id' => '2','choice_id' => '113','meta' => '1'],\n ['group_id' => '2','choice_id' => '117','meta' => '1'],\n ['group_id' => '2','choice_id' => '121','meta' => '1'],\n ['group_id' => '2','choice_id' => '125','meta' => '1'],\n ['group_id' => '2','choice_id' => '129','meta' => '1'],\n ['group_id' => '2','choice_id' => '133','meta' => '1'],\n ['group_id' => '2','choice_id' => '137','meta' => '1'],\n ['group_id' => '2','choice_id' => '141','meta' => '1'],\n ['group_id' => '2','choice_id' => '145','meta' => '1'],\n ['group_id' => '2','choice_id' => '149','meta' => '1'],\n ['group_id' => '2','choice_id' => '153','meta' => '1'],\n ['group_id' => '2','choice_id' => '157','meta' => '1'],\n\n // self-evaluations col 2 part b\n ['group_id' => '2','choice_id' => '82','meta' => '2'],\n ['group_id' => '2','choice_id' => '86','meta' => '2'],\n ['group_id' => '2','choice_id' => '90','meta' => '2'],\n ['group_id' => '2','choice_id' => '94','meta' => '2'],\n ['group_id' => '2','choice_id' => '98','meta' => '2'],\n ['group_id' => '2','choice_id' => '102','meta' => '2'],\n ['group_id' => '2','choice_id' => '106','meta' => '2'],\n ['group_id' => '2','choice_id' => '110','meta' => '2'],\n ['group_id' => '2','choice_id' => '114','meta' => '2'],\n ['group_id' => '2','choice_id' => '118','meta' => '2'],\n ['group_id' => '2','choice_id' => '122','meta' => '2'],\n ['group_id' => '2','choice_id' => '126','meta' => '2'],\n ['group_id' => '2','choice_id' => '130','meta' => '2'],\n ['group_id' => '2','choice_id' => '134','meta' => '2'],\n ['group_id' => '2','choice_id' => '138','meta' => '2'],\n ['group_id' => '2','choice_id' => '142','meta' => '2'],\n ['group_id' => '2','choice_id' => '146','meta' => '2'],\n ['group_id' => '2','choice_id' => '150','meta' => '2'],\n ['group_id' => '2','choice_id' => '154','meta' => '2'],\n ['group_id' => '2','choice_id' => '158','meta' => '2'],\n\n // self-evaluations col 3 part b\n ['group_id' => '2','choice_id' => '83','meta' => '3'],\n ['group_id' => '2','choice_id' => '87','meta' => '3'],\n ['group_id' => '2','choice_id' => '91','meta' => '3'],\n ['group_id' => '2','choice_id' => '95','meta' => '3'],\n ['group_id' => '2','choice_id' => '99','meta' => '3'],\n ['group_id' => '2','choice_id' => '103','meta' => '3'],\n ['group_id' => '2','choice_id' => '107','meta' => '3'],\n ['group_id' => '2','choice_id' => '111','meta' => '3'],\n ['group_id' => '2','choice_id' => '115','meta' => '3'],\n ['group_id' => '2','choice_id' => '119','meta' => '3'],\n ['group_id' => '2','choice_id' => '123','meta' => '3'],\n ['group_id' => '2','choice_id' => '127','meta' => '3'],\n ['group_id' => '2','choice_id' => '131','meta' => '3'],\n ['group_id' => '2','choice_id' => '135','meta' => '3'],\n ['group_id' => '2','choice_id' => '139','meta' => '3'],\n ['group_id' => '2','choice_id' => '143','meta' => '3'],\n ['group_id' => '2','choice_id' => '147','meta' => '3'],\n ['group_id' => '2','choice_id' => '151','meta' => '3'],\n ['group_id' => '2','choice_id' => '155','meta' => '3'],\n ['group_id' => '2','choice_id' => '159','meta' => '3'],\n\n // self-evaluations col 4 part b\n ['group_id' => '2','choice_id' => '84','meta' => '4'],\n ['group_id' => '2','choice_id' => '88','meta' => '4'],\n ['group_id' => '2','choice_id' => '92','meta' => '4'],\n ['group_id' => '2','choice_id' => '96','meta' => '4'],\n ['group_id' => '2','choice_id' => '100','meta' => '4'],\n ['group_id' => '2','choice_id' => '104','meta' => '4'],\n ['group_id' => '2','choice_id' => '108','meta' => '4'],\n ['group_id' => '2','choice_id' => '112','meta' => '4'],\n ['group_id' => '2','choice_id' => '116','meta' => '4'],\n ['group_id' => '2','choice_id' => '120','meta' => '4'],\n ['group_id' => '2','choice_id' => '124','meta' => '4'],\n ['group_id' => '2','choice_id' => '128','meta' => '4'],\n ['group_id' => '2','choice_id' => '132','meta' => '4'],\n ['group_id' => '2','choice_id' => '136','meta' => '4'],\n ['group_id' => '2','choice_id' => '140','meta' => '4'],\n ['group_id' => '2','choice_id' => '144','meta' => '4'],\n ['group_id' => '2','choice_id' => '148','meta' => '4'],\n ['group_id' => '2','choice_id' => '152','meta' => '4'],\n ['group_id' => '2','choice_id' => '156','meta' => '4'],\n ['group_id' => '2','choice_id' => '160','meta' => '4'],\n ];\n\n foreach ($part_b_evals as $key => $value) {\n Evaluation::create($value);\n }\n }", "public function evaluate();", "public function evaluate();", "public function index()\n {\n return Metric::all();\n }", "private function _getNumberOfMetrics() {}", "public function metricList(){\n\t\t\n\t\t$req = $this -> curl_req(\"GET\", \"api/v1/metrics\"); \n\t\t\n\t\t/* Check if the transaction was successfull and pass the data else return false */\n\t\t\n\t\treturn ($req[1]['http_code'] === 200) ? $req[0] : false;\n\t}", "public function index()\n {\n $evaluation = Evaluation::all();\n\n return response()->json($evaluation);\n }", "public function MCscore()\n {\n $MCscore = $this->getMCscores();\n\n return View::make('admin/reports/showMCscore')->with('results',$MCscore);\n }", "public function BatchImportModelEvaluationSlices(\\Google\\Cloud\\AIPlatform\\V1\\BatchImportModelEvaluationSlicesRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/BatchImportModelEvaluationSlices',\n $argument,\n ['\\Google\\Cloud\\AIPlatform\\V1\\BatchImportModelEvaluationSlicesResponse', 'decode'],\n $metadata, $options);\n }", "public function evaluate()\n {\n $result = [];\n\n foreach (array_keys($this->properties) as $key) {\n $validatorDefinition = $this->renderValidatorDefinition($key);\n\n $result[$validatorDefinition->getName()] = $validatorDefinition;\n }\n\n return $result;\n }", "public function run()\n {\n // DB::table('widgets')->truncate();\n\n $metrics = array(\n\narray(\n 'name' => 'Top Customers',\n 'type' => 'table',\n 'updates_default' => '600',\n 'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n 'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n 'related' => '',\n),\narray('name' => 'Number of Inactive Customers',\n 'type' => 'snapshot',\n 'updates_default' => '600',\n 'user_parameters' => '{\"env\":\"\",\"options\":{\"IC_TIME_FRAME\":{ \"value\":\"7\", \"description\":\"The time frame in days where activity is monitored.\"}}}', \n 'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}', \n 'related' => ''),\narray(\n\t'name' => 'Active Calls',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , \narray(\n\t'name' => 'New Active Customers',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"NAC_TIME_FRAME\":{\"value\":\"1\", \"description\":\"The time frame in days for a customer to be considered \\'new\\'.\")}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) ,\narray(\n\t'name' => 'Number Of Customers With Overdue Invoices',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"overdue\"}',\n\t'related' => '35'\n) , array(\n\t'name' => 'Generated Revenue',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"Revenue\"}',\n\t'related' => '36'\n) , array(\n\t'name' => 'Revenue This Month',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Number Of Calls Per Day',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'ASR',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"asr\"}',\n\t'related' => '37'\n) , array(\n\t'name' => 'Call Volume (ONNET)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_sip\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'SIP-UA\\' connection.\"}, \"ps_internal_um\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'INTERNAL\\' connection.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"ONNET\"}',\n\t'related' => '38,39'\n) , array(\n\t'name' => 'Total Registered Locations',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Connection Utilization (OB)',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"originate\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'ACD (OB)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_sip\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'SIP-UA\\' connection.\"}, \"ps_internal_um\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'INTERNAL\\' connection.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"originate\"}',\n\t'related' => '41'\n) , array(\n\t'name' => 'Failed Calls',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"FAILEDCALLS_TIME_FRAME\":{\"value\":\"600\", \"description\":\"The time frame in seconds that is considered for analysis.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'ACD & PDD By Vendor',\n\t'type' => 'table',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_vendor\": {\"value\":\"\"}, \"PDD_RED_THESHOLD\": {\"value\":\"10000\"}, \"PDD_YELLOW_THESHOLD\": {\"value\":\"4000\"}, \"SHOW_INTERNAL_CNX\":{\"value\":\"true\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Call Loss Ratio',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Nr Of Short Calls',\n\t'type' => 'table',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"UC_TOO_SHORT\":{\"value\":\"10\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":{\"1\":\"short\"}}',\n\t'related' => ''\n) , array(\n\t'name' => 'Nr Of Long Calls',\n\t'type' => 'table',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"UC_TOO_LONG\":{\"value\":\"7200\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":{\"1\":\"long\"}}',\n\t'related' => ''\n) , array(\n\t'name' => 'Top 10 Destinations',\n\t'type' => 'table',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"TOP_DESTINATIONS_TIME_FRAME\": {\"value\":\"3600\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Top Vendors (Outbound)',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"TOP_VENDORS_TIME_FRAME\":{\"value\":\"86400\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":{\"1\":\"originate\"}}',\n\t'related' => ''\n) , array(\n\t'name' => 'Top Vendors (Inbound)',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"TOP_VENDORS_TIME_FRAME\":{\"value\":\"86400\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":{\"1\"1:\"answer\"}}',\n\t'related' => ''\n) , array(\n\t'name' => 'PDD',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_vendor\":{\"value\":\"\",\"description\":\"The ID of the PortaSwitch internal vendor.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Active Calls by Customer',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Call volume by Customer',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Number Of Customers With Unpaid Invoices',\n\t'type' => 'snapshot',\n\t'updates_default' => '86400',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"unpaid\"}',\n\t'related' => '14'\n) , array(\n\t'name' => 'Incurred Cost',\n\t'type' => 'duration',\n\t'updates_default' => '86400',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"Cost\"}',\n\t'related' => '15'\n) , array(\n\t'name' => 'NER',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"ner\"}',\n\t'related' => '18'\n) , array(\n\t'name' => 'Call Volume (OB)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_vendor\": {\"value\":\"\", \"description\":\"The ID of the PortaSwitch internal vendor.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"OUT\"}',\n\t'related' => '19,39'\n) , array(\n\t'name' => 'Call Volume (IB)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_vendor\": {\"value\":\"\", \"description\":\"The ID of the PortaSwitch internal vendor.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"IN\"}',\n\t'related' => '19,38'\n) , array(\n\t'name' => 'Connection Utilization (IB)',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"answer\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'ACD (IB)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_sip\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'SIP-UA\\' connection.\"}, \"ps_internal_um\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'INTERNAL\\' connection.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"answer\"}',\n\t'related' => '23'\n)\n\n );\n\n // Uncomment the below to run the seeder\n DB::table('metrics')->insert($metrics);\n \n \n }", "public function getAggregateMetricResults()\n {\n return $this->aggregate_metric_results;\n }", "protected function resetMetrics()\n {\n $this->metrics = ['gauges' => [], 'counters' => []];\n }", "public function schools()\n {\n $noHidden = (bool)$this->request->getQuery('no-hidden');\n $metrics = $this->getMetrics(Context::SCHOOL_CONTEXT, $noHidden);\n\n $this->set([\n '_serialize' => ['metrics'],\n 'metrics' => array_values($metrics),\n ]);\n }", "public function getMetric()\n {\n return $this->metric;\n }", "public function getMetric()\n {\n return $this->metric;\n }", "public function index()\n {\n \\Gate::authorize('view', 'competences_evaluations');\n $Evaluation = EvaluationCompetency::get();\n return $Evaluation;\n }", "public function actionEvaluate($id)\n {\n $model = $this->findModel($id);\n $instrument = Instrument::find()->where(['id' => $model->instrument_id])->one();\n $sections = Section::find()->where(['instrument_id' => $instrument->id ])->all();\n // echo $model->id;\n // die();\n $evalSections = $model->evaluationSections;\n $evalItems = [];\n $oldItems = [];\n if (!empty($evalSections)) {\n foreach ($evalSections as $indexSection => $modelSection) {\n \n $items = $modelSection->evaluationItems;\n $evalItems[$indexSection] = $items;\n $oldItems = ArrayHelper::merge(ArrayHelper::index($items, 'id'), $oldItems);\n \n }\n \n }\n if($model->evalBy->id !== Yii::$app->user->id){\n throw new \\yii\\web\\HttpException(401, 'You are Forbidden to Evaluate this Teacher for it is not yours to evaluate!');\n }elseif($model->status == 1){\n throw new \\yii\\web\\HttpException(401, \"You're done evaluating this teacher you cant change anything after you submit!\");\n }\n \n if (Yii::$app->request->post()) {\n // reset\n $evalItems = [];\n\n $oldSectionIDs = ArrayHelper::map($evalSections, 'id', 'id');\n $evalSections = Model::createMultiple(EvaluationSection::classname(), $evalSections);\n Model::loadMultiple($evalSections, Yii::$app->request->post());\n $deletedSectionIDs = array_diff($oldSectionIDs, array_filter(ArrayHelper::map($evalSections, 'id', 'id')));\n\n if (Yii::$app->request->isAjax) {\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ActiveForm::validateMultiple($evalSections);\n }\n\n // validate Evaluation and EvaluationSection models\n $valid = $model->validate();\n $valid = Model::validateMultiple($evalSections) && $valid;\n\n $itemsIDs = [];\n if (isset($_POST['EvaluationItem'][0][0])) {\n foreach ($_POST['EvaluationItem'] as $indexSection => $items) {\n $itemsIDs = ArrayHelper::merge($itemsIDs, array_filter(ArrayHelper::getColumn($items, 'id')));\n // die($itemsIDs);\n foreach ($items as $indexItem => $item) {\n $data['EvaluationItem'] = $item;\n $modelItem = (isset($item['id']) && isset($oldItems[$item['id']])) ? $oldItems[$item['id']] : new EvaluationItem;\n // $modelItem->scenario = 'update';\n $modelItem->load($data);\n $evalItems[$indexSection][$indexItem] = $modelItem;\n $valid = $modelItem->validate();\n }\n }\n }\n\n $oldItemsIDs = ArrayHelper::getColumn($oldItems, 'id');\n $deletedItemsIDs = array_diff($oldItemsIDs, $itemsIDs);\n\n if ($valid) {\n $transaction = Yii::$app->db->beginTransaction();\n try {\n if ($flag = $model->save(false)) {\n\n // if (! empty($deletedItemsIDs)) {\n // // EvaluationItem::deleteAll(['id' => $deletedItemsIDs]);\n // echo \"YEAH 1\";\n // die();\n // }\n\n // if (! empty($deletedSectionIDs)) {\n // // EvaluationsSection::deleteAll(['id' => $deletedSectionIDs]);\n // echo \"YEAH 2\";\n // die();\n // }\n \n foreach ($evalSections as $indexSection => $modelSection) {\n \n if ($flag === false) {\n break;\n }\n\n if (!($flag = $modelSection->save())) {\n break;\n }\n\n if (isset($evalItems[$indexSection]) && is_array($evalItems[$indexSection])) {\n foreach ($evalItems[$indexSection] as $indexItem => $modelItem) {\n \n if (!($flag = $modelItem->save(false))) {\n break;\n }\n }\n }\n }\n }\n $model->status = 1;\n $model->save();\n $transaction->commit();\n return $this->redirect(['/']);\n \n } catch (Exception $e) {\n $transaction->rollBack();\n }\n }\n }\n\n return $this->render('evaluate', [\n 'model' => $model,\n 'evalSections' => $evalSections,\n 'evalItems' => $evalItems\n ]);\n\n }", "protected function wrapResults($outputs)\n {\n return new Google_Analytics_GetMetrics_Results($outputs);\n }", "public function getDimensions() {\n\t\treturn $this->dimensions->toArray();\n\t}", "private function calculateMetrics($query_ids, $active_metrics, $rating_levels, $run_names) {\n /* Variables */\n /** @var $metric Metric */\n $num_found_final = $num_found_total_final = $relevant_total = $relevant_limited = array();\n $metrics_values = array(); // array for metrics values, cleared after each run\n $final_metrics_values = array(); // array for metrics values; passed at then end of the function\n foreach ($active_metrics as $metric) {\n $final_metrics_values[$metric->getId()] = array();\n }\n\n /* Iterate over all queries */\n for ($i = 0; $i < count($query_ids); $i++) {\n /* define empty arrays that will hold the single metrics' values */\n foreach ($active_metrics as $metric) {\n $metrics_values[$metric->getId()] = array();\n }\n\n /* Get number of relevant documents for this query */\n $relevant = $this->countRelevantDocuments($query_ids[$i], $rating_levels);\n $relevant_total[] = $relevant['relevant_total'];\n $relevant_limited[] = $relevant['relevant_limited'];\n\n /* Iterate over single runs */\n $num_found_for_this_query = $num_found_for_this_query_total = array();\n foreach ($run_names as $run_id) {\n $ranked_docs = null;\n\n /* Get number of documents found for this query in this run.\n $num_found_total holds the total number of documents found;\n $num_found may be limited if the constant Metrics::getMaximumLengthResultList() is set. */\n $docs_found = $this->sr_repo\n ->findTotalNumFoundForQueryInRun($query_ids[$i], $run_id);\n /* If no documents are found in a run, it is not reasonable to calculate metrics */\n if (empty($docs_found)) {\n $num_found = Constants::INVALID_VALUE;\n $num_found_total = Constants::INVALID_VALUE;\n foreach ($active_metrics as $metric) {\n $metrics_values[$metric->getId()][] = Constants::INVALID_VALUE;\n }\n } else { // documents were found\n $num_found_total = $this->metrics->getNumberOfDocumentsFound($docs_found, false);\n $num_found = $this->metrics->getNumberOfDocumentsFound($docs_found, true);\n unset($docs_found);\n\n /* Count number of relevant documents for specific ranks. */\n $relevant_docs = $this->countRelevantDocumentsForRanks($query_ids[$i], $run_id,\n $relevant_total[$i], $relevant_limited[$i]);\n $relevant_docs_in_run = $relevant_docs['relevant_docs_in_run'];\n $relevant_docs_up_to_rank_limit = $relevant_docs['relevant_docs_up_to_rank_limit'];\n $relevant_docs_up_to_rank_relevant_total = $relevant_docs['relevant_docs_up_to_rank_relevant_total'];\n $relevant_docs_up_to_rank_relevant_limited = $relevant_docs['relevant_docs_up_to_rank_relevant_limited'];\n\n /* Call metric functions based on the number of found relevant documents */\n if (Metrics::getLimitedResultList()) {\n foreach ($active_metrics as $metric) {\n /**\n * R-Precision\n */\n if ($metric->getName() === Constants::R_PRECISION) {\n $metrics_values[$metric->getId()][] = $this->callMetricForResultList(\n Constants::R_PRECISION,\n $relevant_docs_up_to_rank_relevant_limited,\n $relevant_limited[$i]);\n }\n /**\n * Precision\n */\n if ($metric->getName() === Constants::PRECISION) {\n $metric->getK() < 0\n ? $metrics_values[$metric->getId()][] = $this->callMetricForResultList(\n Constants::PRECISION,\n $relevant_docs_up_to_rank_limit,\n Metrics::getMaximumLengthResultList())\n : $metrics_values[$metric->getId()][] = $this->callMetricForResultList(\n Constants::PRECISION,\n $this->sr_repo->findRelevantDocsForQueryInRun(\n $query_ids[$i], $run_id, $metric->getK()\n )[0]['docs'],\n $metric->getK());\n\n }\n /**\n * Recall\n */\n if ($metric->getName() === Constants::RECALL) {\n $metric->getK() < 0\n ? $metrics_values[$metric->getId()][] = $this->callMetricForResultList(\n Constants::RECALL,\n $relevant_docs_in_run,\n $relevant_limited[$i])\n : $metrics_values[$metric->getId()][] = $this->callMetricForResultList(\n Constants::RECALL,\n $this->sr_repo->findRelevantDocsForQueryInRun(\n $query_ids[$i], $run_id, $metric->getK()\n )[0]['docs'],\n $relevant_limited[$i]);\n }\n }\n } else { // No limit set, use full result list\n foreach ($active_metrics as $metric) {\n /**\n * R-Precision\n */\n if ($metric->getName() === Constants::R_PRECISION) {\n $metrics_values[$metric->getId()][] = $this->callMetricForResultList(\n Constants::R_PRECISION,\n $relevant_docs_up_to_rank_relevant_total,\n $relevant_total[$i]);\n }\n /**\n * Precision\n */\n if ($metric->getName() === Constants::PRECISION) {\n $metric->getK() < 0\n ? $metrics_values[$metric->getId()][] = $this->callMetricForResultList(\n Constants::PRECISION,\n $relevant_docs_in_run,\n $num_found_total)\n : $metrics_values[$metric->getId()][] = $this->callMetricForResultList(\n Constants::PRECISION,\n// $relevant_docs_up_to_rank_precision_at,\n $this->sr_repo->findRelevantDocsForQueryInRun(\n $query_ids[$i], $run_id, $metric->getK()\n )[0]['docs'],\n $metric->getK());\n }\n /**\n * Recall\n */\n if ($metric->getName() === Constants::RECALL) {\n $metric->getK() < 0\n ? $metrics_values[$metric->getId()][] = $this->callMetricForResultList(\n Constants::RECALL,\n $relevant_docs_in_run,\n $relevant_total[$i])\n : $metrics_values[$metric->getId()][] = $this->callMetricForResultList(\n Constants::RECALL,\n// $relevant_docs_up_to_rank_recall_at,\n $this->sr_repo->findRelevantDocsForQueryInRun(\n $query_ids[$i], $run_id, $metric->getK()\n )[0]['docs'],\n $relevant_total[$i]);\n }\n }\n }\n\n } // End of single run\n\n /* Save data specific for this run in arrays */\n $num_found_for_this_query[] = $num_found;\n $num_found_for_this_query_total[] = $num_found_total;\n\n } // End of single query\n\n /* Save data specific for this query in arrays. */\n $num_found_final[] = $num_found_for_this_query;\n $num_found_total_final[] = $num_found_for_this_query_total;\n foreach ($active_metrics as $metric) {\n $final_metrics_values[$metric->getId()][] = $metrics_values[$metric->getId()];\n }\n\n } // End of iteration over all queries\n\n return array('total_relevant' => $relevant_total, 'r' => $relevant_limited, 'num_found' => $num_found_final,\n 'num_found_total' => $num_found_total_final, 'final_metrics_values' => $final_metrics_values);\n }", "public function getScores() {\n\t\treturn $this->scores;\n\t}", "public function export()\n {\n return $this->rules;\n }", "public function getResultAgainstMetric();", "public function getOutputValues_() {\n return $this->__outputValues;\n }", "public function getLatestEvaluation()\n {\n return $this->latest_evaluation;\n }", "public function getMetrics($quantity)\n {\n $metrics = $this->metrics()->latest()->take($quantity)->get();\n foreach( $metrics as $metric){\n $metric->created = $metric->created_at->diffForHumans();\n }\n return $metrics;\n }", "public function getMetrics($url, $update = false)\n {\n\n $client = new Client(['http_errors' => false]);\n\n $accessID = \"mozscape-20a941b7de\";\n $secretKey = \"9a7fbfb60876233101c42fdcaceb50e7\";\n\n $expires = time() + 300;\n\n $stringToSign = $accessID . \"\\n\" . $expires;\n\n $binarySignature = hash_hmac('sha1', $stringToSign, $secretKey, true);\n\n $urlSafeSignature = urlencode(base64_encode($binarySignature));\n\n $cols = 103683246117 + 144115188075855872;\n\n $limit = \"1\";\n\n $requestUrl = \"http://lsapi.seomoz.com/linkscape/url-metrics/\" . urlencode($url) . \"?Cols=\" . $cols . \"&Limit=\" . $limit . \"&AccessID=\" . $accessID . \"&Expires=\" . $expires . \"&Signature=\" . $urlSafeSignature;\n\n $res = [];\n\n try {\n\n $key = md5($url . 'moz');\n\n if ($update) {\n $body = Cache::remember($key, 43200, function () use ($client, $requestUrl) {\n sleep(11);\n $response = $client->get($requestUrl);\n $body = $response->getBody()->getContents();\n\n $body = json_decode($body);\n\n return $body;\n\n });\n } else {\n $body = Cache::get($key);\n }\n\n if ($body) {\n foreach ($this->metrics as $key => $metric) {\n if (property_exists($body, $key)) {\n $res[$key] = is_real($body->$key) ? round($body->$key, 2) : $body->$key;\n } else {\n $res[$key] = 'disable';\n\n }\n }\n }\n\n\n } catch (BadResponseException $e) {\n\n }\n\n return $res;\n\n }", "public function evaluation()\n {\n return $this->hasOne(\"App\\Services\\Evaluation\\Evaluation\", 'id_employee', 'id_assessor'); // one to many\n /*ถ้าตอน Query เอา table ไหนเป็นหลัก ตรง model ก็เอา pk ของ table นั้นขึ้นทีหลัง*/\n //return $this->hasMany(\"App\\Services\\Evaluation\\Evaluation\", 'id_assessor', 'id_employee'); // one to many\n }", "public function getModel()\n\t{\n\t\treturn $this->_values;\n\t}", "public function getEvaluationMessage()\n {\n return $this->evaluationMessage;\n }", "function nice_metrics($domain,$cols,$axis_values)\n\t\t{\n\t\t\tglobal $METRICS;\n\t\t\t$raw_data\t\t=\tself::send_api_request($domain,$cols,true);\n\t\t\t$nice_metrics\t=\tself::nicify_metrics($raw_data,$METRICS,$axis_values);\n\t\t\treturn $nice_metrics;\n\t\t}", "public function getDetailedAssessmentStatistics($active_metrics, $rating_levels, $run_names)\n {\n $qs = $this->loadQueries();\n $queries = $qs['queries'];\n $query_ids = $qs['query_ids'];\n\n $metrics = $this->calculateMetrics(\n $query_ids,\n $active_metrics,\n $rating_levels,\n $run_names\n );\n\n // Array for resulting statistics\n $result_array = array(\n 'queries' => $queries,\n 'query_ids' => $query_ids,\n 'r' => $metrics['r'],\n 'total_relevant' => $metrics['total_relevant'],\n 'num_found' => $metrics['num_found'],\n 'num_found_total' => $metrics['num_found_total'],\n 'final_metrics_values' => $metrics['final_metrics_values']\n );\n\n // Calculate average values for the metrics\n $result_array = $this->calculateAvgMetrics($result_array, $active_metrics, $run_names);\n\n return $result_array;\n }", "public function getMetricsSchemaUri()\n {\n return $this->metrics_schema_uri;\n }", "public function getDimensionValues() {\n\t\treturn $this->dimensionValues;\n\t}", "public function inspect_data()\n {\n $inspect = new Inspect;\n return $inspect->report();\n }", "public function __clone()\n {\n $metrics = [];\n foreach ($this->metrics as $metric) {\n $metrics[] = clone $metric;\n }\n $this->setMetrics($metrics);\n }", "public function metrics($user_id = 'me') {\n \t$result = $this->get(\"/v2/users/{$user_id}/metrics\");\n \treturn $result;\n }", "public function getVerticalMetrics() {}", "function accuracyMeasure() {\r\n\r\n\t\tif ($this->expectsPost(array('measureId', 'referenceTimestamp', 'userTimestamp'))) {\r\n\r\n\t\t\t$result['success'] = false;\r\n\r\n\t\t\t$watch = $this->watch->getWatchByMeasureId($this->measureId);\r\n\r\n\t\t\tif ($watch && \r\n\t\t\t\t$watch->userId == $this->session->userdata('userId')){\r\n\r\n\t\t\t\t//Add the watch measure\r\n\t\t\t\t$watchMeasure = $this->measure->addAccuracyMesure(\r\n\t\t\t\t\t$this->measureId,\r\n\t\t\t\t\t$this->referenceTimestamp/1000,\r\n\t\t\t\t\t$this->userTimestamp/1000\r\n\t\t\t\t);\r\n\r\n\r\n\t\t\t\t// If the computed accuracy makes sense, we return success\r\n\t\t\t\tif (is_numeric($watchMeasure->accuracy)) {\r\n\t\t\t\t\t$result['success'] = true;\r\n\t\t\t\t\t//We store the computed accuracy & percentile\r\n\t\t\t\t\t$result['accuracy'] = $watchMeasure->accuracy;\r\n\t\t\t\t\t$result['percentile'] = $watchMeasure->percentile;\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\techo json_encode($result);\r\n\t\t}\r\n\t}", "public function getScaling() {}", "public function getHourMetrics()\n {\n return $this->hourMetrics;\n }", "public function get_Eval(){\n return $this->eval_note;\n }", "public function getDimensions()\n {\n return $this->dimensions;\n }", "public function getMeasurements()\n {\n return $this->measurements instanceof ParcelMeasurementsBuilder ? $this->measurements->build() : $this->measurements;\n }", "public function getOutputValueCols()\n\t{\n\t\t$this->context = null;\n\t\t\n\t\treturn $this->outputValueCols;\n\t}", "public function index()\n {\n $evaluations = Evaluation::all();\n\n return view('evaluations.index', compact('evaluations'));\n }", "public function calculate()\n {\n $response = $this->call($this->getQueryParameters());\n\n return MatrixElementCollection::make($response);\n }", "public function show($id)\n {\n return new EvaluationResource(Evaluation::findOrFail($id));\n }", "protected function validate_shared_metrics( $metrics ) {\n\t\t$valid_metrics = apply_filters(\n\t\t\t'googlesitekit_shareable_analytics_4_metrics',\n\t\t\tarray(\n\t\t\t\t'activeUsers',\n\t\t\t\t'averageSessionDuration',\n\t\t\t\t'conversions',\n\t\t\t\t'engagedSessions',\n\t\t\t\t'engagementRate',\n\t\t\t\t'screenPageViews',\n\t\t\t\t'sessions',\n\t\t\t\t'sessionConversionRate',\n\t\t\t\t'totalUsers',\n\t\t\t)\n\t\t);\n\n\t\t$invalid_metrics = array_diff(\n\t\t\tarray_map(\n\t\t\t\tfunction ( $metric ) {\n\t\t\t\t\t// If there is an expression, it means the name is there as an alias, otherwise the name should be a valid metric name.\n\t\t\t\t\t// Therefore, the expression takes precedence to the name for the purpose of allow-list validation.\n\t\t\t\t\treturn ! empty( $metric->getExpression() ) ? $metric->getExpression() : $metric->getName();\n\t\t\t\t},\n\t\t\t\t$metrics\n\t\t\t),\n\t\t\t$valid_metrics\n\t\t);\n\n\t\tif ( count( $invalid_metrics ) > 0 ) {\n\t\t\t$message = count( $invalid_metrics ) > 1 ? sprintf(\n\t\t\t\t/* translators: %s: is replaced with a comma separated list of the invalid metrics. */\n\t\t\t\t__(\n\t\t\t\t\t'Unsupported metrics requested: %s',\n\t\t\t\t\t'google-site-kit'\n\t\t\t\t),\n\t\t\t\tjoin(\n\t\t\t\t\t/* translators: used between list items, there is a space after the comma. */\n\t\t\t\t\t__( ', ', 'google-site-kit' ),\n\t\t\t\t\t$invalid_metrics\n\t\t\t\t)\n\t\t\t) : sprintf(\n\t\t\t\t/* translators: %s: is replaced with the invalid metric. */\n\t\t\t\t__(\n\t\t\t\t\t'Unsupported metric requested: %s',\n\t\t\t\t\t'google-site-kit'\n\t\t\t\t),\n\t\t\t\t$invalid_metrics[0]\n\t\t\t);\n\n\t\t\tthrow new Invalid_Report_Metrics_Exception( $message );\n\t\t}\n\t}", "public function getReduce ()\r\n {\r\n return $this->_reduce;\r\n }", "public function getDimensions()\n\t{\n\t\treturn $this->dimensions;\n\t}", "public function edit(Evaluation $evaluation)\n {\n return $evaluation;\n }", "public function getMetric()\n {\n return isset($this->metric) ? $this->metric : '';\n }", "public function saveStatistics() {\r\n $this->_storage->saveStatistics();\r\n\r\n return $this;\r\n }", "public function detail() {\n return $this->hasMany('App\\Models\\EvaluationDetail');\n }", "public function model() {\n\t\treturn TABLE_BACKOFFICE_JOB_RESULTS;\n\t}", "public function getDimensions()\n {\n if(!$this->getData('dimensions')) {\n $this->setData('dimensions', $this->_getResource()->getDimensions($this));\n }\n return $this->getData('dimensions');\n }", "protected function renderData()\n {\n $data = $this->loadData();\n\n $rows = $data->getRows() ?: [];\n $number = $this->property('number') ?: 0;\n $this->vars['rows'] = $number > 0\n ? array_slice($rows, 0, $number)\n : $data->getRows();\n\n $this->vars['total'] = $data->getTotalsForAllResults()[$this->property('metric')];\n }", "public function Results()\n {\n return $this->mResults;\n }", "public function getMetrics(array $rsidList, $returnAsIdArray = false)\n {\n $response = $this->post('ReportSuite.GetAvailableMetrics', array('rsid_list' => $rsidList));\n\n if ($returnAsIdArray) {\n $filtered = array();\n foreach ($response as $reportSuiteMetrics) {\n foreach ($reportSuiteMetrics['available_metrics'] as $element) {\n $filtered[$element['metric_name']] = $element['display_name'];\n }\n }\n return array_unique($filtered);\n }\n return $this->returnResponse($response);\n }", "public function to_array() {\n\t\treturn $this->limits;\n\t}", "public function dataset()\n {\n return $this->data;\n }", "public function setMetric($var)\n {\n GPBUtil::checkString($var, True);\n $this->metric = $var;\n\n return $this;\n }", "public function setMetric($var)\n {\n GPBUtil::checkString($var, True);\n $this->metric = $var;\n\n return $this;\n }", "public function setMetric($var)\n {\n GPBUtil::checkString($var, True);\n $this->metric = $var;\n\n return $this;\n }", "public function getTimeSeries()\n {\n return $this->time_series;\n }", "public function getTimeSeries()\n {\n return $this->time_series;\n }", "public function getDatasetVariableSummariesList() {\n return $this->_get(2);\n }", "public function getRuns()\n {\n return $this->runs;\n }", "public function getEval()\n {\n return $this->hasOne(InterEvaluadores::className(), ['id' => 'eval_id']);\n }", "protected function getMetricsListType(): string\n {\n return ProductAdReportMetricsList::class;\n }" ]
[ "0.569445", "0.5561616", "0.5067835", "0.49275413", "0.48727837", "0.47632518", "0.4754828", "0.47540444", "0.4731787", "0.4720001", "0.47127786", "0.4695491", "0.45723277", "0.45359197", "0.45242766", "0.44899344", "0.4420185", "0.43643218", "0.43606356", "0.43500054", "0.43461162", "0.43412024", "0.42089957", "0.42029622", "0.4190906", "0.41749993", "0.41728267", "0.41728267", "0.4134861", "0.41172865", "0.4072984", "0.40709808", "0.40556923", "0.4053079", "0.4048986", "0.4040815", "0.40372047", "0.40264407", "0.402374", "0.40137178", "0.40137178", "0.40066674", "0.39899495", "0.3983518", "0.39783138", "0.39771062", "0.39768618", "0.39734915", "0.39673516", "0.39538413", "0.39087647", "0.39059395", "0.39045662", "0.39022392", "0.3892741", "0.3867024", "0.38598105", "0.38512638", "0.38424495", "0.3842076", "0.38408008", "0.38362265", "0.38297024", "0.38291362", "0.38290313", "0.38017094", "0.37978762", "0.37925717", "0.37893584", "0.3787121", "0.37817815", "0.37802824", "0.37723958", "0.37679878", "0.37564886", "0.37514433", "0.37419215", "0.3738289", "0.37325275", "0.37287053", "0.37173662", "0.3710784", "0.37066042", "0.36974183", "0.3695186", "0.36921108", "0.3688431", "0.3681817", "0.3678673", "0.3678673", "0.3678673", "0.3676809", "0.3676809", "0.36709493", "0.36693093", "0.36690205", "0.36619082" ]
0.5611355
4
Output only. Sliced evaluation metrics of the Model. The schema of the metrics is stored in [metrics_schema_uri][google.cloud.aiplatform.v1.ModelEvaluationSlice.metrics_schema_uri] Generated from protobuf field .google.protobuf.Value metrics = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
public function setMetrics($var) { GPBUtil::checkMessage($var, \Google\Protobuf\Value::class); $this->metrics = $var; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMetrics()\n {\n return $this->metrics;\n }", "public function getMetrics()\n {\n return $this->metrics;\n }", "public function getMetrics()\n {\n return $this->metrics;\n }", "public function getMetrics()\n {\n return $this->metrics;\n }", "public function getMetrics()\n\t{\n\t\treturn $this->metrics;\n\t}", "public function getMetrics(): array;", "public function index()\n {\n return evaluationSummary::all();\n }", "public function setMetrics($value)\n {\n return $this->set('Metrics', $value);\n }", "public function getMeasures() {\n return $this->measures;\n }", "public function retrieveReactorMetrics()\n {\n return $this->start()->uri(\"/api/reactor/metrics\")\n ->get()\n ->go();\n }", "public function getEvaluations();", "public function scores() {\n\n\t\treturn $this->hasMany('App\\EvaluationScore', 'evaluation_id', 'evaluation_id');\n\t}", "public function getQueryMetrics()\n {\n return $this->query_metrics;\n }", "public function setMetrics($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Notebooks\\V1\\RuntimeMetrics::class);\n $this->metrics = $var;\n\n return $this;\n }", "public function evaluations()\n {\n return $this->hasMany(Evaluation::class);\n }", "public function setQueryMetrics($var)\n {\n GPBUtil::checkMessage($var, QueryMetrics::class);\n $this->query_metrics = $var;\n\n return $this;\n }", "public function evaluations()\n {\n return $this->belongsToMany('App\\Evaluation');\n }", "public function getEvaluation()\n {\n return $this->evaluation;\n }", "public function availableMetrics()\n {\n return DashboardNova::allAvailableDashboardCards($this)->whereInstanceOf(Metric::class);\n }", "public function evaluations()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Evaluation', 'application_id');\n\t}", "public function evaluation()\n {\n return $this->hasMany('App\\Models\\Evaluation', 'user_id');\n }", "public function getMetrics(): Response\n {\n\n $registry = \\Prometheus\\CollectorRegistry::getDefault();\n\n $renderer = new RenderTextFormat();\n $result = $renderer->render($registry->getMetricFamilySamples());\n\n return $this->responseFactory->make($result, 200, ['Content-Type' => RenderTextFormat::MIME_TYPE]);\n }", "public function setMetrics(string $metrics): self\n {\n $this->options['metrics'] = $metrics;\n return $this;\n }", "public function ListModelEvaluationSlices(\\Google\\Cloud\\AIPlatform\\V1\\ListModelEvaluationSlicesRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/ListModelEvaluationSlices',\n $argument,\n ['\\Google\\Cloud\\AIPlatform\\V1\\ListModelEvaluationSlicesResponse', 'decode'],\n $metadata, $options);\n }", "public function index()\n\t{\n\t\t$metrics = Metric::all();\n\t\treturn $metrics;\n\t}", "protected function jobMetrics() {\n $metrics = array();\n if ($jobs = $this->getSteadyStateJobs()) {\n $iops = array();\n foreach(array_keys($jobs) as $job) {\n if (isset($jobs[$job]['write']['iops'])) $iops[] = $jobs[$job]['write']['iops'];\n }\n if ($iops) $metrics['iops'] = round(array_sum($iops)/count($iops));\n }\n return $metrics;\n }", "public function setSlice($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\AIPlatform\\V1\\ModelEvaluationSlice\\Slice::class);\n $this->slice = $var;\n\n return $this;\n }", "public function getObservations()\n {\n return $this->observations;\n }", "public function run()\n {\n $part_b_evals = [\n // self-evaluations col 1 part b\n ['group_id' => '2','choice_id' => '81','meta' => '1'],\n ['group_id' => '2','choice_id' => '85','meta' => '1'],\n ['group_id' => '2','choice_id' => '89','meta' => '1'],\n ['group_id' => '2','choice_id' => '93','meta' => '1'],\n ['group_id' => '2','choice_id' => '97','meta' => '1'],\n ['group_id' => '2','choice_id' => '101','meta' => '1'],\n ['group_id' => '2','choice_id' => '105','meta' => '1'],\n ['group_id' => '2','choice_id' => '109','meta' => '1'],\n ['group_id' => '2','choice_id' => '113','meta' => '1'],\n ['group_id' => '2','choice_id' => '117','meta' => '1'],\n ['group_id' => '2','choice_id' => '121','meta' => '1'],\n ['group_id' => '2','choice_id' => '125','meta' => '1'],\n ['group_id' => '2','choice_id' => '129','meta' => '1'],\n ['group_id' => '2','choice_id' => '133','meta' => '1'],\n ['group_id' => '2','choice_id' => '137','meta' => '1'],\n ['group_id' => '2','choice_id' => '141','meta' => '1'],\n ['group_id' => '2','choice_id' => '145','meta' => '1'],\n ['group_id' => '2','choice_id' => '149','meta' => '1'],\n ['group_id' => '2','choice_id' => '153','meta' => '1'],\n ['group_id' => '2','choice_id' => '157','meta' => '1'],\n\n // self-evaluations col 2 part b\n ['group_id' => '2','choice_id' => '82','meta' => '2'],\n ['group_id' => '2','choice_id' => '86','meta' => '2'],\n ['group_id' => '2','choice_id' => '90','meta' => '2'],\n ['group_id' => '2','choice_id' => '94','meta' => '2'],\n ['group_id' => '2','choice_id' => '98','meta' => '2'],\n ['group_id' => '2','choice_id' => '102','meta' => '2'],\n ['group_id' => '2','choice_id' => '106','meta' => '2'],\n ['group_id' => '2','choice_id' => '110','meta' => '2'],\n ['group_id' => '2','choice_id' => '114','meta' => '2'],\n ['group_id' => '2','choice_id' => '118','meta' => '2'],\n ['group_id' => '2','choice_id' => '122','meta' => '2'],\n ['group_id' => '2','choice_id' => '126','meta' => '2'],\n ['group_id' => '2','choice_id' => '130','meta' => '2'],\n ['group_id' => '2','choice_id' => '134','meta' => '2'],\n ['group_id' => '2','choice_id' => '138','meta' => '2'],\n ['group_id' => '2','choice_id' => '142','meta' => '2'],\n ['group_id' => '2','choice_id' => '146','meta' => '2'],\n ['group_id' => '2','choice_id' => '150','meta' => '2'],\n ['group_id' => '2','choice_id' => '154','meta' => '2'],\n ['group_id' => '2','choice_id' => '158','meta' => '2'],\n\n // self-evaluations col 3 part b\n ['group_id' => '2','choice_id' => '83','meta' => '3'],\n ['group_id' => '2','choice_id' => '87','meta' => '3'],\n ['group_id' => '2','choice_id' => '91','meta' => '3'],\n ['group_id' => '2','choice_id' => '95','meta' => '3'],\n ['group_id' => '2','choice_id' => '99','meta' => '3'],\n ['group_id' => '2','choice_id' => '103','meta' => '3'],\n ['group_id' => '2','choice_id' => '107','meta' => '3'],\n ['group_id' => '2','choice_id' => '111','meta' => '3'],\n ['group_id' => '2','choice_id' => '115','meta' => '3'],\n ['group_id' => '2','choice_id' => '119','meta' => '3'],\n ['group_id' => '2','choice_id' => '123','meta' => '3'],\n ['group_id' => '2','choice_id' => '127','meta' => '3'],\n ['group_id' => '2','choice_id' => '131','meta' => '3'],\n ['group_id' => '2','choice_id' => '135','meta' => '3'],\n ['group_id' => '2','choice_id' => '139','meta' => '3'],\n ['group_id' => '2','choice_id' => '143','meta' => '3'],\n ['group_id' => '2','choice_id' => '147','meta' => '3'],\n ['group_id' => '2','choice_id' => '151','meta' => '3'],\n ['group_id' => '2','choice_id' => '155','meta' => '3'],\n ['group_id' => '2','choice_id' => '159','meta' => '3'],\n\n // self-evaluations col 4 part b\n ['group_id' => '2','choice_id' => '84','meta' => '4'],\n ['group_id' => '2','choice_id' => '88','meta' => '4'],\n ['group_id' => '2','choice_id' => '92','meta' => '4'],\n ['group_id' => '2','choice_id' => '96','meta' => '4'],\n ['group_id' => '2','choice_id' => '100','meta' => '4'],\n ['group_id' => '2','choice_id' => '104','meta' => '4'],\n ['group_id' => '2','choice_id' => '108','meta' => '4'],\n ['group_id' => '2','choice_id' => '112','meta' => '4'],\n ['group_id' => '2','choice_id' => '116','meta' => '4'],\n ['group_id' => '2','choice_id' => '120','meta' => '4'],\n ['group_id' => '2','choice_id' => '124','meta' => '4'],\n ['group_id' => '2','choice_id' => '128','meta' => '4'],\n ['group_id' => '2','choice_id' => '132','meta' => '4'],\n ['group_id' => '2','choice_id' => '136','meta' => '4'],\n ['group_id' => '2','choice_id' => '140','meta' => '4'],\n ['group_id' => '2','choice_id' => '144','meta' => '4'],\n ['group_id' => '2','choice_id' => '148','meta' => '4'],\n ['group_id' => '2','choice_id' => '152','meta' => '4'],\n ['group_id' => '2','choice_id' => '156','meta' => '4'],\n ['group_id' => '2','choice_id' => '160','meta' => '4'],\n ];\n\n foreach ($part_b_evals as $key => $value) {\n Evaluation::create($value);\n }\n }", "public function evaluate();", "public function evaluate();", "public function index()\n {\n return Metric::all();\n }", "private function _getNumberOfMetrics() {}", "public function metricList(){\n\t\t\n\t\t$req = $this -> curl_req(\"GET\", \"api/v1/metrics\"); \n\t\t\n\t\t/* Check if the transaction was successfull and pass the data else return false */\n\t\t\n\t\treturn ($req[1]['http_code'] === 200) ? $req[0] : false;\n\t}", "public function index()\n {\n $evaluation = Evaluation::all();\n\n return response()->json($evaluation);\n }", "public function MCscore()\n {\n $MCscore = $this->getMCscores();\n\n return View::make('admin/reports/showMCscore')->with('results',$MCscore);\n }", "public function BatchImportModelEvaluationSlices(\\Google\\Cloud\\AIPlatform\\V1\\BatchImportModelEvaluationSlicesRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/BatchImportModelEvaluationSlices',\n $argument,\n ['\\Google\\Cloud\\AIPlatform\\V1\\BatchImportModelEvaluationSlicesResponse', 'decode'],\n $metadata, $options);\n }", "public function evaluate()\n {\n $result = [];\n\n foreach (array_keys($this->properties) as $key) {\n $validatorDefinition = $this->renderValidatorDefinition($key);\n\n $result[$validatorDefinition->getName()] = $validatorDefinition;\n }\n\n return $result;\n }", "public function run()\n {\n // DB::table('widgets')->truncate();\n\n $metrics = array(\n\narray(\n 'name' => 'Top Customers',\n 'type' => 'table',\n 'updates_default' => '600',\n 'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n 'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n 'related' => '',\n),\narray('name' => 'Number of Inactive Customers',\n 'type' => 'snapshot',\n 'updates_default' => '600',\n 'user_parameters' => '{\"env\":\"\",\"options\":{\"IC_TIME_FRAME\":{ \"value\":\"7\", \"description\":\"The time frame in days where activity is monitored.\"}}}', \n 'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}', \n 'related' => ''),\narray(\n\t'name' => 'Active Calls',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , \narray(\n\t'name' => 'New Active Customers',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"NAC_TIME_FRAME\":{\"value\":\"1\", \"description\":\"The time frame in days for a customer to be considered \\'new\\'.\")}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) ,\narray(\n\t'name' => 'Number Of Customers With Overdue Invoices',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"overdue\"}',\n\t'related' => '35'\n) , array(\n\t'name' => 'Generated Revenue',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"Revenue\"}',\n\t'related' => '36'\n) , array(\n\t'name' => 'Revenue This Month',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Number Of Calls Per Day',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'ASR',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"asr\"}',\n\t'related' => '37'\n) , array(\n\t'name' => 'Call Volume (ONNET)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_sip\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'SIP-UA\\' connection.\"}, \"ps_internal_um\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'INTERNAL\\' connection.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"ONNET\"}',\n\t'related' => '38,39'\n) , array(\n\t'name' => 'Total Registered Locations',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Connection Utilization (OB)',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"originate\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'ACD (OB)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_sip\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'SIP-UA\\' connection.\"}, \"ps_internal_um\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'INTERNAL\\' connection.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"originate\"}',\n\t'related' => '41'\n) , array(\n\t'name' => 'Failed Calls',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"FAILEDCALLS_TIME_FRAME\":{\"value\":\"600\", \"description\":\"The time frame in seconds that is considered for analysis.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'ACD & PDD By Vendor',\n\t'type' => 'table',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_vendor\": {\"value\":\"\"}, \"PDD_RED_THESHOLD\": {\"value\":\"10000\"}, \"PDD_YELLOW_THESHOLD\": {\"value\":\"4000\"}, \"SHOW_INTERNAL_CNX\":{\"value\":\"true\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Call Loss Ratio',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Nr Of Short Calls',\n\t'type' => 'table',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"UC_TOO_SHORT\":{\"value\":\"10\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":{\"1\":\"short\"}}',\n\t'related' => ''\n) , array(\n\t'name' => 'Nr Of Long Calls',\n\t'type' => 'table',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"UC_TOO_LONG\":{\"value\":\"7200\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":{\"1\":\"long\"}}',\n\t'related' => ''\n) , array(\n\t'name' => 'Top 10 Destinations',\n\t'type' => 'table',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"TOP_DESTINATIONS_TIME_FRAME\": {\"value\":\"3600\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Top Vendors (Outbound)',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"TOP_VENDORS_TIME_FRAME\":{\"value\":\"86400\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":{\"1\":\"originate\"}}',\n\t'related' => ''\n) , array(\n\t'name' => 'Top Vendors (Inbound)',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"TOP_VENDORS_TIME_FRAME\":{\"value\":\"86400\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":{\"1\"1:\"answer\"}}',\n\t'related' => ''\n) , array(\n\t'name' => 'PDD',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_vendor\":{\"value\":\"\",\"description\":\"The ID of the PortaSwitch internal vendor.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Active Calls by Customer',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Call volume by Customer',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Number Of Customers With Unpaid Invoices',\n\t'type' => 'snapshot',\n\t'updates_default' => '86400',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"unpaid\"}',\n\t'related' => '14'\n) , array(\n\t'name' => 'Incurred Cost',\n\t'type' => 'duration',\n\t'updates_default' => '86400',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"Cost\"}',\n\t'related' => '15'\n) , array(\n\t'name' => 'NER',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"ner\"}',\n\t'related' => '18'\n) , array(\n\t'name' => 'Call Volume (OB)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_vendor\": {\"value\":\"\", \"description\":\"The ID of the PortaSwitch internal vendor.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"OUT\"}',\n\t'related' => '19,39'\n) , array(\n\t'name' => 'Call Volume (IB)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_vendor\": {\"value\":\"\", \"description\":\"The ID of the PortaSwitch internal vendor.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"IN\"}',\n\t'related' => '19,38'\n) , array(\n\t'name' => 'Connection Utilization (IB)',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"answer\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'ACD (IB)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_sip\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'SIP-UA\\' connection.\"}, \"ps_internal_um\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'INTERNAL\\' connection.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"answer\"}',\n\t'related' => '23'\n)\n\n );\n\n // Uncomment the below to run the seeder\n DB::table('metrics')->insert($metrics);\n \n \n }", "public function getAggregateMetricResults()\n {\n return $this->aggregate_metric_results;\n }", "protected function resetMetrics()\n {\n $this->metrics = ['gauges' => [], 'counters' => []];\n }", "public function schools()\n {\n $noHidden = (bool)$this->request->getQuery('no-hidden');\n $metrics = $this->getMetrics(Context::SCHOOL_CONTEXT, $noHidden);\n\n $this->set([\n '_serialize' => ['metrics'],\n 'metrics' => array_values($metrics),\n ]);\n }", "public function getMetric()\n {\n return $this->metric;\n }", "public function getMetric()\n {\n return $this->metric;\n }", "public function index()\n {\n \\Gate::authorize('view', 'competences_evaluations');\n $Evaluation = EvaluationCompetency::get();\n return $Evaluation;\n }", "public function actionEvaluate($id)\n {\n $model = $this->findModel($id);\n $instrument = Instrument::find()->where(['id' => $model->instrument_id])->one();\n $sections = Section::find()->where(['instrument_id' => $instrument->id ])->all();\n // echo $model->id;\n // die();\n $evalSections = $model->evaluationSections;\n $evalItems = [];\n $oldItems = [];\n if (!empty($evalSections)) {\n foreach ($evalSections as $indexSection => $modelSection) {\n \n $items = $modelSection->evaluationItems;\n $evalItems[$indexSection] = $items;\n $oldItems = ArrayHelper::merge(ArrayHelper::index($items, 'id'), $oldItems);\n \n }\n \n }\n if($model->evalBy->id !== Yii::$app->user->id){\n throw new \\yii\\web\\HttpException(401, 'You are Forbidden to Evaluate this Teacher for it is not yours to evaluate!');\n }elseif($model->status == 1){\n throw new \\yii\\web\\HttpException(401, \"You're done evaluating this teacher you cant change anything after you submit!\");\n }\n \n if (Yii::$app->request->post()) {\n // reset\n $evalItems = [];\n\n $oldSectionIDs = ArrayHelper::map($evalSections, 'id', 'id');\n $evalSections = Model::createMultiple(EvaluationSection::classname(), $evalSections);\n Model::loadMultiple($evalSections, Yii::$app->request->post());\n $deletedSectionIDs = array_diff($oldSectionIDs, array_filter(ArrayHelper::map($evalSections, 'id', 'id')));\n\n if (Yii::$app->request->isAjax) {\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ActiveForm::validateMultiple($evalSections);\n }\n\n // validate Evaluation and EvaluationSection models\n $valid = $model->validate();\n $valid = Model::validateMultiple($evalSections) && $valid;\n\n $itemsIDs = [];\n if (isset($_POST['EvaluationItem'][0][0])) {\n foreach ($_POST['EvaluationItem'] as $indexSection => $items) {\n $itemsIDs = ArrayHelper::merge($itemsIDs, array_filter(ArrayHelper::getColumn($items, 'id')));\n // die($itemsIDs);\n foreach ($items as $indexItem => $item) {\n $data['EvaluationItem'] = $item;\n $modelItem = (isset($item['id']) && isset($oldItems[$item['id']])) ? $oldItems[$item['id']] : new EvaluationItem;\n // $modelItem->scenario = 'update';\n $modelItem->load($data);\n $evalItems[$indexSection][$indexItem] = $modelItem;\n $valid = $modelItem->validate();\n }\n }\n }\n\n $oldItemsIDs = ArrayHelper::getColumn($oldItems, 'id');\n $deletedItemsIDs = array_diff($oldItemsIDs, $itemsIDs);\n\n if ($valid) {\n $transaction = Yii::$app->db->beginTransaction();\n try {\n if ($flag = $model->save(false)) {\n\n // if (! empty($deletedItemsIDs)) {\n // // EvaluationItem::deleteAll(['id' => $deletedItemsIDs]);\n // echo \"YEAH 1\";\n // die();\n // }\n\n // if (! empty($deletedSectionIDs)) {\n // // EvaluationsSection::deleteAll(['id' => $deletedSectionIDs]);\n // echo \"YEAH 2\";\n // die();\n // }\n \n foreach ($evalSections as $indexSection => $modelSection) {\n \n if ($flag === false) {\n break;\n }\n\n if (!($flag = $modelSection->save())) {\n break;\n }\n\n if (isset($evalItems[$indexSection]) && is_array($evalItems[$indexSection])) {\n foreach ($evalItems[$indexSection] as $indexItem => $modelItem) {\n \n if (!($flag = $modelItem->save(false))) {\n break;\n }\n }\n }\n }\n }\n $model->status = 1;\n $model->save();\n $transaction->commit();\n return $this->redirect(['/']);\n \n } catch (Exception $e) {\n $transaction->rollBack();\n }\n }\n }\n\n return $this->render('evaluate', [\n 'model' => $model,\n 'evalSections' => $evalSections,\n 'evalItems' => $evalItems\n ]);\n\n }", "protected function wrapResults($outputs)\n {\n return new Google_Analytics_GetMetrics_Results($outputs);\n }", "public function getDimensions() {\n\t\treturn $this->dimensions->toArray();\n\t}", "public function getScores() {\n\t\treturn $this->scores;\n\t}", "private function calculateMetrics($query_ids, $active_metrics, $rating_levels, $run_names) {\n /* Variables */\n /** @var $metric Metric */\n $num_found_final = $num_found_total_final = $relevant_total = $relevant_limited = array();\n $metrics_values = array(); // array for metrics values, cleared after each run\n $final_metrics_values = array(); // array for metrics values; passed at then end of the function\n foreach ($active_metrics as $metric) {\n $final_metrics_values[$metric->getId()] = array();\n }\n\n /* Iterate over all queries */\n for ($i = 0; $i < count($query_ids); $i++) {\n /* define empty arrays that will hold the single metrics' values */\n foreach ($active_metrics as $metric) {\n $metrics_values[$metric->getId()] = array();\n }\n\n /* Get number of relevant documents for this query */\n $relevant = $this->countRelevantDocuments($query_ids[$i], $rating_levels);\n $relevant_total[] = $relevant['relevant_total'];\n $relevant_limited[] = $relevant['relevant_limited'];\n\n /* Iterate over single runs */\n $num_found_for_this_query = $num_found_for_this_query_total = array();\n foreach ($run_names as $run_id) {\n $ranked_docs = null;\n\n /* Get number of documents found for this query in this run.\n $num_found_total holds the total number of documents found;\n $num_found may be limited if the constant Metrics::getMaximumLengthResultList() is set. */\n $docs_found = $this->sr_repo\n ->findTotalNumFoundForQueryInRun($query_ids[$i], $run_id);\n /* If no documents are found in a run, it is not reasonable to calculate metrics */\n if (empty($docs_found)) {\n $num_found = Constants::INVALID_VALUE;\n $num_found_total = Constants::INVALID_VALUE;\n foreach ($active_metrics as $metric) {\n $metrics_values[$metric->getId()][] = Constants::INVALID_VALUE;\n }\n } else { // documents were found\n $num_found_total = $this->metrics->getNumberOfDocumentsFound($docs_found, false);\n $num_found = $this->metrics->getNumberOfDocumentsFound($docs_found, true);\n unset($docs_found);\n\n /* Count number of relevant documents for specific ranks. */\n $relevant_docs = $this->countRelevantDocumentsForRanks($query_ids[$i], $run_id,\n $relevant_total[$i], $relevant_limited[$i]);\n $relevant_docs_in_run = $relevant_docs['relevant_docs_in_run'];\n $relevant_docs_up_to_rank_limit = $relevant_docs['relevant_docs_up_to_rank_limit'];\n $relevant_docs_up_to_rank_relevant_total = $relevant_docs['relevant_docs_up_to_rank_relevant_total'];\n $relevant_docs_up_to_rank_relevant_limited = $relevant_docs['relevant_docs_up_to_rank_relevant_limited'];\n\n /* Call metric functions based on the number of found relevant documents */\n if (Metrics::getLimitedResultList()) {\n foreach ($active_metrics as $metric) {\n /**\n * R-Precision\n */\n if ($metric->getName() === Constants::R_PRECISION) {\n $metrics_values[$metric->getId()][] = $this->callMetricForResultList(\n Constants::R_PRECISION,\n $relevant_docs_up_to_rank_relevant_limited,\n $relevant_limited[$i]);\n }\n /**\n * Precision\n */\n if ($metric->getName() === Constants::PRECISION) {\n $metric->getK() < 0\n ? $metrics_values[$metric->getId()][] = $this->callMetricForResultList(\n Constants::PRECISION,\n $relevant_docs_up_to_rank_limit,\n Metrics::getMaximumLengthResultList())\n : $metrics_values[$metric->getId()][] = $this->callMetricForResultList(\n Constants::PRECISION,\n $this->sr_repo->findRelevantDocsForQueryInRun(\n $query_ids[$i], $run_id, $metric->getK()\n )[0]['docs'],\n $metric->getK());\n\n }\n /**\n * Recall\n */\n if ($metric->getName() === Constants::RECALL) {\n $metric->getK() < 0\n ? $metrics_values[$metric->getId()][] = $this->callMetricForResultList(\n Constants::RECALL,\n $relevant_docs_in_run,\n $relevant_limited[$i])\n : $metrics_values[$metric->getId()][] = $this->callMetricForResultList(\n Constants::RECALL,\n $this->sr_repo->findRelevantDocsForQueryInRun(\n $query_ids[$i], $run_id, $metric->getK()\n )[0]['docs'],\n $relevant_limited[$i]);\n }\n }\n } else { // No limit set, use full result list\n foreach ($active_metrics as $metric) {\n /**\n * R-Precision\n */\n if ($metric->getName() === Constants::R_PRECISION) {\n $metrics_values[$metric->getId()][] = $this->callMetricForResultList(\n Constants::R_PRECISION,\n $relevant_docs_up_to_rank_relevant_total,\n $relevant_total[$i]);\n }\n /**\n * Precision\n */\n if ($metric->getName() === Constants::PRECISION) {\n $metric->getK() < 0\n ? $metrics_values[$metric->getId()][] = $this->callMetricForResultList(\n Constants::PRECISION,\n $relevant_docs_in_run,\n $num_found_total)\n : $metrics_values[$metric->getId()][] = $this->callMetricForResultList(\n Constants::PRECISION,\n// $relevant_docs_up_to_rank_precision_at,\n $this->sr_repo->findRelevantDocsForQueryInRun(\n $query_ids[$i], $run_id, $metric->getK()\n )[0]['docs'],\n $metric->getK());\n }\n /**\n * Recall\n */\n if ($metric->getName() === Constants::RECALL) {\n $metric->getK() < 0\n ? $metrics_values[$metric->getId()][] = $this->callMetricForResultList(\n Constants::RECALL,\n $relevant_docs_in_run,\n $relevant_total[$i])\n : $metrics_values[$metric->getId()][] = $this->callMetricForResultList(\n Constants::RECALL,\n// $relevant_docs_up_to_rank_recall_at,\n $this->sr_repo->findRelevantDocsForQueryInRun(\n $query_ids[$i], $run_id, $metric->getK()\n )[0]['docs'],\n $relevant_total[$i]);\n }\n }\n }\n\n } // End of single run\n\n /* Save data specific for this run in arrays */\n $num_found_for_this_query[] = $num_found;\n $num_found_for_this_query_total[] = $num_found_total;\n\n } // End of single query\n\n /* Save data specific for this query in arrays. */\n $num_found_final[] = $num_found_for_this_query;\n $num_found_total_final[] = $num_found_for_this_query_total;\n foreach ($active_metrics as $metric) {\n $final_metrics_values[$metric->getId()][] = $metrics_values[$metric->getId()];\n }\n\n } // End of iteration over all queries\n\n return array('total_relevant' => $relevant_total, 'r' => $relevant_limited, 'num_found' => $num_found_final,\n 'num_found_total' => $num_found_total_final, 'final_metrics_values' => $final_metrics_values);\n }", "public function export()\n {\n return $this->rules;\n }", "public function getResultAgainstMetric();", "public function getOutputValues_() {\n return $this->__outputValues;\n }", "public function getLatestEvaluation()\n {\n return $this->latest_evaluation;\n }", "public function getMetrics($quantity)\n {\n $metrics = $this->metrics()->latest()->take($quantity)->get();\n foreach( $metrics as $metric){\n $metric->created = $metric->created_at->diffForHumans();\n }\n return $metrics;\n }", "public function getMetrics($url, $update = false)\n {\n\n $client = new Client(['http_errors' => false]);\n\n $accessID = \"mozscape-20a941b7de\";\n $secretKey = \"9a7fbfb60876233101c42fdcaceb50e7\";\n\n $expires = time() + 300;\n\n $stringToSign = $accessID . \"\\n\" . $expires;\n\n $binarySignature = hash_hmac('sha1', $stringToSign, $secretKey, true);\n\n $urlSafeSignature = urlencode(base64_encode($binarySignature));\n\n $cols = 103683246117 + 144115188075855872;\n\n $limit = \"1\";\n\n $requestUrl = \"http://lsapi.seomoz.com/linkscape/url-metrics/\" . urlencode($url) . \"?Cols=\" . $cols . \"&Limit=\" . $limit . \"&AccessID=\" . $accessID . \"&Expires=\" . $expires . \"&Signature=\" . $urlSafeSignature;\n\n $res = [];\n\n try {\n\n $key = md5($url . 'moz');\n\n if ($update) {\n $body = Cache::remember($key, 43200, function () use ($client, $requestUrl) {\n sleep(11);\n $response = $client->get($requestUrl);\n $body = $response->getBody()->getContents();\n\n $body = json_decode($body);\n\n return $body;\n\n });\n } else {\n $body = Cache::get($key);\n }\n\n if ($body) {\n foreach ($this->metrics as $key => $metric) {\n if (property_exists($body, $key)) {\n $res[$key] = is_real($body->$key) ? round($body->$key, 2) : $body->$key;\n } else {\n $res[$key] = 'disable';\n\n }\n }\n }\n\n\n } catch (BadResponseException $e) {\n\n }\n\n return $res;\n\n }", "public function evaluation()\n {\n return $this->hasOne(\"App\\Services\\Evaluation\\Evaluation\", 'id_employee', 'id_assessor'); // one to many\n /*ถ้าตอน Query เอา table ไหนเป็นหลัก ตรง model ก็เอา pk ของ table นั้นขึ้นทีหลัง*/\n //return $this->hasMany(\"App\\Services\\Evaluation\\Evaluation\", 'id_assessor', 'id_employee'); // one to many\n }", "public function getModel()\n\t{\n\t\treturn $this->_values;\n\t}", "public function getEvaluationMessage()\n {\n return $this->evaluationMessage;\n }", "function nice_metrics($domain,$cols,$axis_values)\n\t\t{\n\t\t\tglobal $METRICS;\n\t\t\t$raw_data\t\t=\tself::send_api_request($domain,$cols,true);\n\t\t\t$nice_metrics\t=\tself::nicify_metrics($raw_data,$METRICS,$axis_values);\n\t\t\treturn $nice_metrics;\n\t\t}", "public function getDetailedAssessmentStatistics($active_metrics, $rating_levels, $run_names)\n {\n $qs = $this->loadQueries();\n $queries = $qs['queries'];\n $query_ids = $qs['query_ids'];\n\n $metrics = $this->calculateMetrics(\n $query_ids,\n $active_metrics,\n $rating_levels,\n $run_names\n );\n\n // Array for resulting statistics\n $result_array = array(\n 'queries' => $queries,\n 'query_ids' => $query_ids,\n 'r' => $metrics['r'],\n 'total_relevant' => $metrics['total_relevant'],\n 'num_found' => $metrics['num_found'],\n 'num_found_total' => $metrics['num_found_total'],\n 'final_metrics_values' => $metrics['final_metrics_values']\n );\n\n // Calculate average values for the metrics\n $result_array = $this->calculateAvgMetrics($result_array, $active_metrics, $run_names);\n\n return $result_array;\n }", "public function getMetricsSchemaUri()\n {\n return $this->metrics_schema_uri;\n }", "public function getDimensionValues() {\n\t\treturn $this->dimensionValues;\n\t}", "public function inspect_data()\n {\n $inspect = new Inspect;\n return $inspect->report();\n }", "public function __clone()\n {\n $metrics = [];\n foreach ($this->metrics as $metric) {\n $metrics[] = clone $metric;\n }\n $this->setMetrics($metrics);\n }", "public function metrics($user_id = 'me') {\n \t$result = $this->get(\"/v2/users/{$user_id}/metrics\");\n \treturn $result;\n }", "public function getVerticalMetrics() {}", "function accuracyMeasure() {\r\n\r\n\t\tif ($this->expectsPost(array('measureId', 'referenceTimestamp', 'userTimestamp'))) {\r\n\r\n\t\t\t$result['success'] = false;\r\n\r\n\t\t\t$watch = $this->watch->getWatchByMeasureId($this->measureId);\r\n\r\n\t\t\tif ($watch && \r\n\t\t\t\t$watch->userId == $this->session->userdata('userId')){\r\n\r\n\t\t\t\t//Add the watch measure\r\n\t\t\t\t$watchMeasure = $this->measure->addAccuracyMesure(\r\n\t\t\t\t\t$this->measureId,\r\n\t\t\t\t\t$this->referenceTimestamp/1000,\r\n\t\t\t\t\t$this->userTimestamp/1000\r\n\t\t\t\t);\r\n\r\n\r\n\t\t\t\t// If the computed accuracy makes sense, we return success\r\n\t\t\t\tif (is_numeric($watchMeasure->accuracy)) {\r\n\t\t\t\t\t$result['success'] = true;\r\n\t\t\t\t\t//We store the computed accuracy & percentile\r\n\t\t\t\t\t$result['accuracy'] = $watchMeasure->accuracy;\r\n\t\t\t\t\t$result['percentile'] = $watchMeasure->percentile;\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\techo json_encode($result);\r\n\t\t}\r\n\t}", "public function getScaling() {}", "public function getHourMetrics()\n {\n return $this->hourMetrics;\n }", "public function get_Eval(){\n return $this->eval_note;\n }", "public function getDimensions()\n {\n return $this->dimensions;\n }", "public function getMeasurements()\n {\n return $this->measurements instanceof ParcelMeasurementsBuilder ? $this->measurements->build() : $this->measurements;\n }", "public function getOutputValueCols()\n\t{\n\t\t$this->context = null;\n\t\t\n\t\treturn $this->outputValueCols;\n\t}", "public function index()\n {\n $evaluations = Evaluation::all();\n\n return view('evaluations.index', compact('evaluations'));\n }", "public function calculate()\n {\n $response = $this->call($this->getQueryParameters());\n\n return MatrixElementCollection::make($response);\n }", "public function show($id)\n {\n return new EvaluationResource(Evaluation::findOrFail($id));\n }", "protected function validate_shared_metrics( $metrics ) {\n\t\t$valid_metrics = apply_filters(\n\t\t\t'googlesitekit_shareable_analytics_4_metrics',\n\t\t\tarray(\n\t\t\t\t'activeUsers',\n\t\t\t\t'averageSessionDuration',\n\t\t\t\t'conversions',\n\t\t\t\t'engagedSessions',\n\t\t\t\t'engagementRate',\n\t\t\t\t'screenPageViews',\n\t\t\t\t'sessions',\n\t\t\t\t'sessionConversionRate',\n\t\t\t\t'totalUsers',\n\t\t\t)\n\t\t);\n\n\t\t$invalid_metrics = array_diff(\n\t\t\tarray_map(\n\t\t\t\tfunction ( $metric ) {\n\t\t\t\t\t// If there is an expression, it means the name is there as an alias, otherwise the name should be a valid metric name.\n\t\t\t\t\t// Therefore, the expression takes precedence to the name for the purpose of allow-list validation.\n\t\t\t\t\treturn ! empty( $metric->getExpression() ) ? $metric->getExpression() : $metric->getName();\n\t\t\t\t},\n\t\t\t\t$metrics\n\t\t\t),\n\t\t\t$valid_metrics\n\t\t);\n\n\t\tif ( count( $invalid_metrics ) > 0 ) {\n\t\t\t$message = count( $invalid_metrics ) > 1 ? sprintf(\n\t\t\t\t/* translators: %s: is replaced with a comma separated list of the invalid metrics. */\n\t\t\t\t__(\n\t\t\t\t\t'Unsupported metrics requested: %s',\n\t\t\t\t\t'google-site-kit'\n\t\t\t\t),\n\t\t\t\tjoin(\n\t\t\t\t\t/* translators: used between list items, there is a space after the comma. */\n\t\t\t\t\t__( ', ', 'google-site-kit' ),\n\t\t\t\t\t$invalid_metrics\n\t\t\t\t)\n\t\t\t) : sprintf(\n\t\t\t\t/* translators: %s: is replaced with the invalid metric. */\n\t\t\t\t__(\n\t\t\t\t\t'Unsupported metric requested: %s',\n\t\t\t\t\t'google-site-kit'\n\t\t\t\t),\n\t\t\t\t$invalid_metrics[0]\n\t\t\t);\n\n\t\t\tthrow new Invalid_Report_Metrics_Exception( $message );\n\t\t}\n\t}", "public function getReduce ()\r\n {\r\n return $this->_reduce;\r\n }", "public function getDimensions()\n\t{\n\t\treturn $this->dimensions;\n\t}", "public function edit(Evaluation $evaluation)\n {\n return $evaluation;\n }", "public function getMetric()\n {\n return isset($this->metric) ? $this->metric : '';\n }", "public function saveStatistics() {\r\n $this->_storage->saveStatistics();\r\n\r\n return $this;\r\n }", "public function detail() {\n return $this->hasMany('App\\Models\\EvaluationDetail');\n }", "public function model() {\n\t\treturn TABLE_BACKOFFICE_JOB_RESULTS;\n\t}", "public function getDimensions()\n {\n if(!$this->getData('dimensions')) {\n $this->setData('dimensions', $this->_getResource()->getDimensions($this));\n }\n return $this->getData('dimensions');\n }", "protected function renderData()\n {\n $data = $this->loadData();\n\n $rows = $data->getRows() ?: [];\n $number = $this->property('number') ?: 0;\n $this->vars['rows'] = $number > 0\n ? array_slice($rows, 0, $number)\n : $data->getRows();\n\n $this->vars['total'] = $data->getTotalsForAllResults()[$this->property('metric')];\n }", "public function Results()\n {\n return $this->mResults;\n }", "public function getMetrics(array $rsidList, $returnAsIdArray = false)\n {\n $response = $this->post('ReportSuite.GetAvailableMetrics', array('rsid_list' => $rsidList));\n\n if ($returnAsIdArray) {\n $filtered = array();\n foreach ($response as $reportSuiteMetrics) {\n foreach ($reportSuiteMetrics['available_metrics'] as $element) {\n $filtered[$element['metric_name']] = $element['display_name'];\n }\n }\n return array_unique($filtered);\n }\n return $this->returnResponse($response);\n }", "public function to_array() {\n\t\treturn $this->limits;\n\t}", "public function dataset()\n {\n return $this->data;\n }", "public function setMetric($var)\n {\n GPBUtil::checkString($var, True);\n $this->metric = $var;\n\n return $this;\n }", "public function setMetric($var)\n {\n GPBUtil::checkString($var, True);\n $this->metric = $var;\n\n return $this;\n }", "public function setMetric($var)\n {\n GPBUtil::checkString($var, True);\n $this->metric = $var;\n\n return $this;\n }", "public function getTimeSeries()\n {\n return $this->time_series;\n }", "public function getTimeSeries()\n {\n return $this->time_series;\n }", "public function getDatasetVariableSummariesList() {\n return $this->_get(2);\n }", "public function getEval()\n {\n return $this->hasOne(InterEvaluadores::className(), ['id' => 'eval_id']);\n }", "public function getRuns()\n {\n return $this->runs;\n }", "protected function getMetricsListType(): string\n {\n return ProductAdReportMetricsList::class;\n }" ]
[ "0.56116253", "0.56116253", "0.56116253", "0.56116253", "0.5561861", "0.5068638", "0.49279192", "0.4874115", "0.47621956", "0.47547662", "0.47544748", "0.47316334", "0.47190127", "0.4712816", "0.46959665", "0.4571736", "0.45362362", "0.45252836", "0.44890985", "0.44203776", "0.4364844", "0.43611553", "0.43503174", "0.43449843", "0.43415996", "0.4208959", "0.4202978", "0.4191492", "0.41750875", "0.4172635", "0.4172635", "0.41351548", "0.41175", "0.40730873", "0.40712896", "0.4054422", "0.40524146", "0.40486848", "0.40413237", "0.40374485", "0.4028174", "0.40226808", "0.40146202", "0.40146202", "0.40065315", "0.39908758", "0.39840776", "0.3978079", "0.3976455", "0.39760664", "0.3974892", "0.39669293", "0.3955225", "0.39102167", "0.39065143", "0.3904627", "0.39029345", "0.38924956", "0.3868594", "0.38609886", "0.38509864", "0.38426262", "0.38422564", "0.3840024", "0.38372937", "0.38305506", "0.38297293", "0.3829336", "0.3801236", "0.37988633", "0.37934136", "0.37888208", "0.37867028", "0.3782888", "0.37800592", "0.37699524", "0.37693313", "0.3755824", "0.37519947", "0.37413186", "0.37391394", "0.37341276", "0.37307194", "0.37177905", "0.3711643", "0.3706056", "0.36970448", "0.36947984", "0.369061", "0.368796", "0.3681051", "0.36797848", "0.36797848", "0.36797848", "0.36776623", "0.36776623", "0.3671822", "0.36700726", "0.36696136", "0.3661553" ]
0.5695437
0
Output only. Timestamp when this ModelEvaluationSlice was created. Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
public function getCreateTime() { return $this->create_time; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCreateTs()\n {\n return $this->create_ts;\n }", "public function getCreateTime()\r\n {\r\n return $this->create_time;\r\n }", "public function getCreateTime() {\n return $this->create_time;\n }", "public function getCreateTime() {\n return $this->create_time;\n }", "public function getCreate_time()\r\n {\r\n return $this->create_time;\r\n }", "public function getCreatetime()\n {\n return $this->createtime;\n }", "public function getCreatetime()\n {\n return $this->createTime;\n }", "public function getCreateTime()\n {\n return $this->CreateTime;\n }", "public function getCreateTime()\n {\n return isset($this->create_time) ? $this->create_time : null;\n }", "public function getCreateTime()\n {\n return isset($this->create_time) ? $this->create_time : null;\n }", "public function getCreationDatetime()\n {\n return $this->getValue('nb_icontact_prospect_creation_datetime');\n }", "function getCreatedTime() {\n\t\tif (is_null($this->created_time)) {\n\t\t\t$this->created_time = new \\MongoDate();\n\t\t}\n\t\treturn $this->created_time;\n\t}", "public function getCreateTime(): int \n {\n return $this->create_time;\n }", "public function getVersionCreateTime()\n {\n return $this->version_create_time;\n }", "public function getDateCreate()\n\t{\n\t\treturn $this->dateCreate;\n\t}", "public function getTimestampCreated()\n {\n return $this->_getData(self::TIMESTAMP_CREATED);\n }", "public function getCreateAt()\n {\n return $this->create_at;\n }", "public function getDateCreate()\n {\n return $this->date_create;\n }", "public function getDateCreate()\n {\n return $this->date_create;\n }", "public function getCreate_at()\n {\n return $this->create_at;\n }", "public function getCreate_at()\n {\n return $this->create_at;\n }", "public function getDataCreationTimestamp() {\n return $this->tree->getDataCreationTimestamp();\n }", "public function getCreationTime()\n {\n return $this->creation_time;\n }", "public function getCreated();", "public function getCreated();", "public function getCreated();", "public function getCreated();", "public function getCreationTime(){\r\n\t\treturn $this->creationTime;\r\n\t}", "public function getCreationTime(){\n\t\treturn $this->creationTime;\n\t}", "public function getTimeCreated()\n {\n return $this->timeCreated;\n }", "public function getTimeCreated(){\n return $this->TIME_CREATED;\n }", "public function getDateCreation()\n {\n return $this->date_creation;\n }", "public function timestamp() {\n\t\t$this->updated_at = new \\DateTime;\n\n\t\tif ( ! $this->exists) $this->created_at = $this->updated_at;\n\t}", "public function getCreatedTime()\n\t{\n\t\treturn $this->createdTime; \n\n\t}", "public function getCreated() {}", "public function getCreated() {}", "public function getCreationTimestamp()\n {\n return isset($this->creation_timestamp) ? $this->creation_timestamp : '';\n }", "function get_timecreated() {\n return $this->timecreated;\n }", "public function getCreated()\r\n {\r\n return $this->created;\r\n }", "public function getCreationTime() {}", "public function getCreationTime() {}", "public function get_time_created(){\n\t\treturn $this->time_created;\n\t}", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getDate_creation()\n {\n return $this->date_creation;\n }", "public function getDistriCreateTime()\n {\n return $this->distri_create_time;\n }", "private function GetCreated()\n\t\t{\n\t\t\treturn $this->created;\n\t\t}", "public function getDateCreation()\n {\n return $this->dateCreation;\n }", "public function getDateCreation()\n {\n return $this->dateCreation;\n }", "public function getDateCreation()\n {\n return $this->dateCreation;\n }", "public function timestamp();", "public function getCreated()\n {\n return $this->_created;\n }" ]
[ "0.6070348", "0.5940268", "0.59172195", "0.59172195", "0.5888721", "0.57906085", "0.57338464", "0.5594861", "0.55478424", "0.55478424", "0.5545918", "0.5476266", "0.5440554", "0.540457", "0.53498346", "0.53193426", "0.5318991", "0.5304767", "0.5304767", "0.5275213", "0.5275213", "0.5271514", "0.5206973", "0.51846445", "0.51846445", "0.51846445", "0.51846445", "0.5176512", "0.51666224", "0.5158051", "0.5133833", "0.51115024", "0.50994575", "0.5097593", "0.50965464", "0.50965464", "0.5089794", "0.5088364", "0.50694364", "0.50684345", "0.5068127", "0.50681114", "0.5065631", "0.5065631", "0.5065631", "0.5065631", "0.5065631", "0.5065631", "0.5065631", "0.5065631", "0.5065631", "0.5065631", "0.5065631", "0.5065631", "0.5065631", "0.5065631", "0.5065631", "0.5065631", "0.5065631", "0.5065631", "0.5065631", "0.5065631", "0.5065631", "0.50620955", "0.5060279", "0.5047544", "0.5034828", "0.5034828", "0.5034828", "0.5034237", "0.5029338" ]
0.5908174
33
Output only. Timestamp when this ModelEvaluationSlice was created. Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
public function setCreateTime($var) { GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); $this->create_time = $var; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCreateTs()\n {\n return $this->create_ts;\n }", "public function getCreateTime()\r\n {\r\n return $this->create_time;\r\n }", "public function getCreateTime() {\n return $this->create_time;\n }", "public function getCreateTime() {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreateTime()\n {\n return $this->create_time;\n }", "public function getCreate_time()\r\n {\r\n return $this->create_time;\r\n }", "public function getCreatetime()\n {\n return $this->createtime;\n }", "public function getCreatetime()\n {\n return $this->createTime;\n }", "public function getCreateTime()\n {\n return $this->CreateTime;\n }", "public function getCreateTime()\n {\n return isset($this->create_time) ? $this->create_time : null;\n }", "public function getCreateTime()\n {\n return isset($this->create_time) ? $this->create_time : null;\n }", "public function getCreationDatetime()\n {\n return $this->getValue('nb_icontact_prospect_creation_datetime');\n }", "function getCreatedTime() {\n\t\tif (is_null($this->created_time)) {\n\t\t\t$this->created_time = new \\MongoDate();\n\t\t}\n\t\treturn $this->created_time;\n\t}", "public function getCreateTime(): int \n {\n return $this->create_time;\n }", "public function getVersionCreateTime()\n {\n return $this->version_create_time;\n }", "public function getDateCreate()\n\t{\n\t\treturn $this->dateCreate;\n\t}", "public function getCreateAt()\n {\n return $this->create_at;\n }", "public function getTimestampCreated()\n {\n return $this->_getData(self::TIMESTAMP_CREATED);\n }", "public function getDateCreate()\n {\n return $this->date_create;\n }", "public function getDateCreate()\n {\n return $this->date_create;\n }", "public function getCreate_at()\n {\n return $this->create_at;\n }", "public function getCreate_at()\n {\n return $this->create_at;\n }", "public function getDataCreationTimestamp() {\n return $this->tree->getDataCreationTimestamp();\n }", "public function getCreationTime()\n {\n return $this->creation_time;\n }", "public function getCreated();", "public function getCreated();", "public function getCreated();", "public function getCreated();", "public function getCreationTime(){\r\n\t\treturn $this->creationTime;\r\n\t}", "public function getCreationTime(){\n\t\treturn $this->creationTime;\n\t}", "public function getTimeCreated()\n {\n return $this->timeCreated;\n }", "public function getTimeCreated(){\n return $this->TIME_CREATED;\n }", "public function getDateCreation()\n {\n return $this->date_creation;\n }", "public function timestamp() {\n\t\t$this->updated_at = new \\DateTime;\n\n\t\tif ( ! $this->exists) $this->created_at = $this->updated_at;\n\t}", "public function getCreatedTime()\n\t{\n\t\treturn $this->createdTime; \n\n\t}", "public function getCreated() {}", "public function getCreated() {}", "public function getCreationTimestamp()\n {\n return isset($this->creation_timestamp) ? $this->creation_timestamp : '';\n }", "function get_timecreated() {\n return $this->timecreated;\n }", "public function getCreationTime() {}", "public function getCreationTime() {}", "public function getCreated()\r\n {\r\n return $this->created;\r\n }", "public function get_time_created(){\n\t\treturn $this->time_created;\n\t}", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getDate_creation()\n {\n return $this->date_creation;\n }", "public function getDistriCreateTime()\n {\n return $this->distri_create_time;\n }", "private function GetCreated()\n\t\t{\n\t\t\treturn $this->created;\n\t\t}", "public function getDateCreation()\n {\n return $this->dateCreation;\n }", "public function getDateCreation()\n {\n return $this->dateCreation;\n }", "public function getDateCreation()\n {\n return $this->dateCreation;\n }", "public function timestamp();", "public function getCreated()\n {\n return $this->_created;\n }" ]
[ "0.6069216", "0.5939619", "0.59165335", "0.59165335", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.5907571", "0.58877784", "0.5789733", "0.573304", "0.5594081", "0.55473465", "0.55473465", "0.5544649", "0.5474902", "0.54402256", "0.54033566", "0.53489006", "0.53174317", "0.5317389", "0.5303756", "0.5303756", "0.5273806", "0.5273806", "0.52701384", "0.5206132", "0.5182911", "0.5182911", "0.5182911", "0.5182911", "0.5175591", "0.5165739", "0.5156621", "0.5132403", "0.5110626", "0.5097656", "0.5095671", "0.5094869", "0.5094869", "0.5088643", "0.5087034", "0.50679195", "0.50676125", "0.50674546", "0.50666106", "0.5064219", "0.5064219", "0.5064219", "0.5064219", "0.5064219", "0.5064219", "0.5064219", "0.5064219", "0.5064219", "0.5064219", "0.5064219", "0.5064219", "0.5064219", "0.5064219", "0.5064219", "0.5064219", "0.5064219", "0.5064219", "0.5064219", "0.5064219", "0.5064219", "0.5061247", "0.50596285", "0.504546", "0.50340813", "0.50340813", "0.50340813", "0.5033237", "0.5027538" ]
0.0
-1
Output only. Aggregated explanation metrics for the Model's prediction output over the data this ModelEvaluation uses. This field is populated only if the Model is evaluated with explanations, and only for tabular Models. Generated from protobuf field .google.cloud.aiplatform.v1.ModelExplanation model_explanation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
public function getModelExplanation() { return $this->model_explanation; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setModelExplanation($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\AIPlatform\\V1\\ModelExplanation::class);\n $this->model_explanation = $var;\n\n return $this;\n }", "public function getExplanation() \n {\n return $this->explanation;\n }", "public function getExplanation(){\n\t\treturn $this->_explanation;\n\t}", "public function getExplanationSpec()\n {\n return $this->explanation_spec;\n }", "public static function get_explanation() {\n return get_string(self::get_event_string_name('_explanation'), 'mod_reader');\n }", "private function getExplanation() {\n $currentBy = null;\n $explanation = array();\n for ($i = 0; $i < $this->queryManager->length; $i++) {\n $word = $this->queryManager->words[$i];\n if ($word['processed'] && !isset($word['error'])) {\n $by = $word['by'];\n if ($by !== $currentBy) {\n $explanation[] = array(\n 'processor' => $by,\n 'word' => $word['word']\n );\n $currentBy = $by;\n }\n else {\n $explanation[count($explanation) - 1]['word'] .= ' ' . $word['word'];\n }\n }\n }\n return $explanation;\n }", "public function setExplanationSpec($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\AIPlatform\\V1\\ExplanationSpec::class);\n $this->explanation_spec = $var;\n\n return $this;\n }", "public function describe(Model $Model) {\n return $Model->schema;\n }", "public function getExplanation(): ?string\n {\n return $this->explanation;\n }", "public static function makeModelDetails($model)\n {\n $hiddenColumns=config('dashboard.hiddenColumns');\n $columns=array_diff(Schema::getColumnListing($model->getTable()),$hiddenColumns);\n $details=\"\";\n foreach($columns as $columnName)\n {\n $details.=$model->$columnName.\"\\n\";\n }\n return $details;\n }", "public function setExplanation(string $explanation)\n {\n $this->explanation = $explanation;\n }", "public function model()\n {\n return Answer::class;\n }", "public function getExplanation(Gri_Reward_Model_Reward_History $item)\n {\n return ''; // TODO\n }", "public function describe($model) { //IMPORTANTISIMO es el que devuelve el schema al Modelo\n\t\treturn $this->_schema;\n\t}", "public function setExplanation(?string $explanation): void\n {\n $this->explanation = $explanation;\n }", "public function explain(): ExplainResponse\n {\n $url = $this->url . '?' . http_build_query(array(\n 'operation' => 'explain',\n 'version' => $this->version,\n ));\n\n $body = $this->request('GET', $url);\n\n return new ExplainResponse($body, $this, $url);\n }", "public function getExplanation(\\Magento\\Reward\\Model\\Reward\\History $item)\n {\n return ''; // TODO\n }", "public function getAnswer()\n {\n return $this->answerModel;\n }", "public function getExhaustionExplanation ();", "public function getRationale()\n {\n return $this->rationale;\n }", "function describe($model) {\n\t\n\t}", "function describe(&$model) {\n\t\t$cache = parent::describe($model);\n\t\tif ($cache != null) {\n\t\t\treturn $cache;\n\t\t}\n\t\t$fields = false;\n\t\t$cols = $this->query('SHOW FULL COLUMNS FROM ' . $this->fullTableName($model));\n\n\t\tforeach ($cols as $column) {\n\t\t\t$colKey = array_keys($column);\n\t\t\tif (isset($column[$colKey[0]]) && !isset($column[0])) {\n\t\t\t\t$column[0] = $column[$colKey[0]];\n\t\t\t}\n\t\t\tif (isset($column[0])) {\n\t\t\t\t$fields[$column[0]['Field']] = array(\n\t\t\t\t\t'type' => $this->column($column[0]['Type']),\n\t\t\t\t\t'null' => ($column[0]['Null'] == 'YES' ? true : false),\n\t\t\t\t\t'default' => $column[0]['Default'],\n\t\t\t\t\t'length' => $this->length($column[0]['Type']),\n\t\t\t\t);\n\t\t\t\tif (!empty($column[0]['Key']) && isset($this->index[$column[0]['Key']])) {\n\t\t\t\t\t$fields[$column[0]['Field']]['key'] = $this->index[$column[0]['Key']];\n\t\t\t\t}\n\t\t\t\tforeach ($this->fieldParameters as $name => $value) {\n\t\t\t\t\tif (!empty($column[0][$value['column']])) {\n\t\t\t\t\t\t$fields[$column[0]['Field']][$name] = $column[0][$value['column']];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isset($fields[$column[0]['Field']]['collate'])) {\n\t\t\t\t\t$charset = $this->getCharsetName($fields[$column[0]['Field']]['collate']);\n\t\t\t\t\tif ($charset) {\n\t\t\t\t\t\t$fields[$column[0]['Field']]['charset'] = $charset;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->__cacheDescription($this->fullTableName($model, false), $fields);\n\t\treturn $fields;\n\t}", "public function getLatestActivityExtraDisplayStringByModel($model)\n {\n }", "public function setModel(\\App\\Entity\\Product\\Details\\Model $model = null) \n { \n $this->model = $model;\n \n return $this;\n }", "public function getResponseModel() \n {\n return $this->response_model;\n }", "public function reasonPhrase(): string\n {\n return $this->reasonPhrase;\n }", "public function createExplain( array $explJson ) {\n\t\t$description = $explJson['description'];\n\t\t$details = [];\n\t\t$ignored = null;\n\t\t$tieMatch = preg_match( '/max plus ([0-9.]+) times/', $description, $tieMatches );\n\t\t$prefixMatch = preg_match( '/\\:.*?\\*(\\^.+?)?, product of/', $description, $prefixMatches );\n\t\tif ( isset( $explJson['details'] ) ) {\n\t\t\t$details = $explJson['details'];\n\t\t}\n\n\t\tif ( self::strStartsWith( $description, 'score(' ) ) {\n\t\t\treturn new ScoreExplain( $explJson, $this );\n\t\t} elseif ( self::strStartsWith( $description, 'tf(' ) ) {\n\t\t\treturn null; // new DefaultSimTfExplain( $explJson, $this );\n\t\t} elseif ( self::strStartsWith( $description, 'idf(' ) ) {\n\t\t\treturn new DefaultSimIdfExplain( $explJson, $this );\n\t\t} elseif ( self::strStartsWith( $description, 'fieldWeight' ) ) {\n\t\t\treturn null; // new FieldWeightExplain( $explJson, $this );\n\t\t} elseif ( self::strStartsWith( $description, 'queryWeight' ) ) {\n\t\t\treturn null; // new QueryWeightExplain( $explJson, $this );\n\t\t} elseif ( self::strStartsWith( $description, 'ConstantScore' ) ) {\n\t\t\treturn new ConstantScoreExplain( $explJson, $this );\n\t\t} elseif ( self::strStartsWith( $description, 'MatchAllDocsQuery' ) ) {\n\t\t\treturn new MatchAllDocsExplain( $explJson, $this );\n\t\t} elseif ( self::strStartsWith( $description, 'weight(' ) ) {\n\t\t\treturn new WeightExplain( $explJson, $this );\n\t\t} elseif ( self::strStartsWith( $description, 'FunctionQuery' ) ) {\n\t\t\treturn new FunctionQueryExplain( $explJson, $this );\n\t\t} elseif ( self::strStartsWith( $description, 'Function for field' ) ) {\n\t\t\treturn new FieldFunctionQueryExplain( $explJson, $this );\n\t\t} elseif ( $prefixMatch ) {\n\t\t\treturn new WeightExplain( $explJson, $this );\n\t\t} elseif ( $explJson['value'] === 0.0 && (\n\t\t\t\tself::strStartsWith( $description, 'match on required clause' ) ||\n\t\t\t\tself::strStartsWith( $description, 'match filter' )\n\t\t\t) ) {\n\t\t\t// Because ElasticSearch function queries filter when they apply\n\t\t\t// boosts (this doesn't matter in scoring)\n\t\t\treturn null;\n\t\t} elseif ( self::strStartsWith( $description, 'queryBoost' ) ) {\n\t\t\tif ( $explJson['value'] === 1.0 ) {\n\t\t\t\t// ElasticSearch function queries always add 'queryBoost' of 1,\n\t\t\t\t// even when boost not specified\n\t\t\t\treturn null;\n\t\t\t}\n\t\t} elseif ( self::strStartsWith( $description, 'script score function, computed with script:' ) ) {\n\t\t\treturn new ScriptScoreFunctionExplain( $explJson, $this );\n\t\t} elseif ( self::strHasSubstr( $description, 'constant score' ) &&\n\t\t\tself::strHasSubstr( $description, 'no function provided' )\n\t\t) {\n\t\t\treturn null;\n\t\t} elseif ( $description === 'weight' ) {\n\t\t\treturn new FuncWeightExplain( $explJson, $this );\n\t\t} elseif ( $tieMatch ) {\n\t\t\treturn new DismaxTieExplain( $explJson, $this, (float)$tieMatches[1] );\n\t\t} elseif ( self::strHasSubstr( $description, 'max of' ) ) {\n\t\t\treturn $this->meOrOnlyChild( new DismaxExplain( $explJson, $this ) );\n\t\t} elseif ( self::strHasSubstr( $description, 'sum of' )\n\t\t\t\t|| self::strHasSubstr( $description, 'score mode [sum]' ) ) {\n\t\t\treturn $this->meOrOnlyChild( new SumExplain( $explJson, $this ) );\n\t\t} elseif ( self::strHasSubstr( $description, 'Math.min of' ) || $description === 'min of:' ) {\n\t\t\treturn $this->meOrOnlyChild( new MinExplain( $explJson, $this ) );\n\t\t} elseif ( self::strHasSubstr( $description, 'score mode [multiply]' ) ) {\n\t\t\treturn $this->meOrOnlyChild( new ProductExplain( $explJson, $this ) );\n\t\t} elseif ( self::strHasSubstr( $description, 'product of' ) ) {\n\t\t\tif ( count( $details ) === 2 ) {\n\t\t\t\tforeach ( $details as $detail ) {\n\t\t\t\t\tif ( self::strStartsWith( $detail['description'], 'coord(' ) ) {\n\t\t\t\t\t\treturn new CoordExplain( $explJson, $this, (float)$detail['value'] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $this->meOrOnlyChild( new ProductExplain( $explJson, $this ) );\n\t\t}\n\n\t\treturn new Explain( $explJson, $this );\n\t}", "public function getExplanationEntities(): ?array\n {\n return $this->explanationEntities;\n }", "public function getModel(){\n return $this->customAnswer;\n }", "public function get_problem_description(): string {\n return get_string($this->problem, 'filter_embedquestion', $this->problemdetails);\n }", "public function ExportModel(\\Google\\Cloud\\AIPlatform\\V1\\ExportModelRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/ExportModel',\n $argument,\n ['\\Google\\LongRunning\\Operation', 'decode'],\n $metadata, $options);\n }", "public function validateByModel()\r\n {\r\n $document = new ReplacementAttorneyDecisions($this->data);\r\n \r\n $validation = $document->validate(['when']);\r\n \r\n if(count($validation) == 0) {\r\n return ['isValid'=>true, 'messages' => []];\r\n }\r\n else {\r\n return [\r\n 'isValid'=>false,\r\n 'messages' => $this->modelValidationMessageConverter($validation),\r\n ];\r\n }\r\n }", "public function getReasonPhrase(): string\n {\n return $this->message->getReasonPhrase();\n }", "public function explain(): string|array\n {\n return Forrest::queryExplain($this->query);\n }", "public function introspect($model) {\n\t\treturn Admin::introspectModel($model);\n\t}", "public function describe()\n {\n return $this->morphOne(Describe::class, 'describe_able');\n }", "public function getDescriptionForEvent($eventName) {\n\t\treturn __CLASS__ . \" model has been {$eventName}\";\n\t}", "public function getModelDefinition(): array\n {\n return [\n 'id' => [ 'model' => null, 'array' => false ],\n 'values' => [ 'model' => ChunkRecommendationsValue::class, 'array' => true ],\n ];\n }", "public function getReasonPhrase()\n {\n return $this->reasonPhrase;\n }", "public function displayReason() {\n switch ($this->reason) { //Reasons should only hold an int 0-4\n case 0:\n return \"Invalid\";\n case 1:\n return \"Recommend\";\n case 2:\n return \"Criticism\";\n case 3:\n return \"Question\";\n case 4:\n return \"Other\";\n }\n }", "public function GetModel()\n {\n return $this->model;\n }", "protected function validationLogWarning($message, $explanation = null) {\n $this->validation_log[] = array(\n 'status' => self::VALIDATION_WARNING, \n 'message' => $message,\n 'explanation' => $explanation, \n );\n }", "public function getReasonPhrase()\n {\n // TODO: Implement getReasonPhrase() method.\n }", "public function reason()\n {\n return $this->response->getReasonPhrase();\n }", "public function setModelId($var)\n {\n GPBUtil::checkString($var, True);\n $this->model_id = $var;\n\n return $this;\n }", "protected function getModelInput(): string\n\t{\n\t\treturn trim($this->option('model'));\n\t}", "public function getReasonPhrase(): string\r\n {\r\n // TODO: Implement getReasonPhrase() method.\r\n return $this->reasonPhrase;\r\n }", "public function getModel(): Model\n {\n return $this->model;\n }", "public function getModel(): Model\n {\n return $this->model;\n }", "public function model()\n {\n return VoteDetails::class;\n }", "public function getRequestReasonDesc()\n\t{\n\t\treturn $this->request_reason_desc;\n\t}", "public function getModelPlural()\n {\n return strtolower(Text::plural($this->getModelSimpleName()));\n }", "public function getModel(): string\n {\n return $this->model;\n }", "public function getModel(): string\n {\n return $this->model;\n }", "public function getModel(): string\n {\n return $this->model;\n }", "private function serializeModel(Model $model)\n {\n $metadata = $model->getMetadata();\n $serialized = [\n '_id' => $model->getState()->is('new') ? null : $model->getId(),\n '_type' => $model->getType(),\n ];\n if ($this->depth > $this->maxDepth) {\n return $serialized;\n }\n\n // Attributes.\n foreach ($metadata->getAttributes() as $key => $attrMeta) {\n if (false === $this->shouldSerialize($model, $attrMeta)) {\n continue;\n }\n $serializer = $this->getCustomSerializer($model, $attrMeta);\n $value = $model->get($key);\n $serialized[$key] = $serializer ? $serializer($model, $value) : $this->serializeAttribute($value, $attrMeta);\n }\n\n // Embeds.\n foreach ($metadata->getEmbeds() as $key => $embeddedPropMeta) {\n if (false === $this->shouldSerialize($model, $embeddedPropMeta)) {\n continue;\n }\n $serializer = $this->getCustomSerializer($model, $embeddedPropMeta);\n $value = $model->get($key);\n $serialized[$key] = $serializer ? $serializer($model, $value) : $this->serializeEmbed($value, $embeddedPropMeta);\n }\n\n // Relationships.\n $model->enableCollectionAutoInit(false);\n $this->increaseDepth();\n foreach ($metadata->getRelationships() as $key => $relMeta) {\n if (false === $this->shouldSerialize($model, $relMeta)) {\n continue;\n }\n $serializer = $this->getCustomSerializer($model, $relMeta);\n $relationship = $model->get($key);\n $serialized[$key] = $serializer ? $serializer($model, $relationship) : $this->serializeRelationship($model, $relationship, $relMeta);\n }\n $this->decreaseDepth();\n $model->enableCollectionAutoInit(true);\n\n return $serialized;\n }", "public function getDescriptionForEvent($eventName)\n {\n return __CLASS__ . \" model has been {$eventName}\";\n }", "public function getDescriptionForEvent($eventName)\n {\n return __CLASS__ . \" model has been {$eventName}\";\n }", "public function getDescriptionForEvent($eventName)\n {\n return __CLASS__ . \" model has been {$eventName}\";\n }", "public function getDescriptionForEvent($eventName)\n {\n return __CLASS__ . \" model has been {$eventName}\";\n }", "public function getDescriptionForEvent($eventName)\n {\n return __CLASS__ . \" model has been {$eventName}\";\n }", "public function getReasonPhrase() : string\n {\n return $this->reasonPhrase ?? Response::CODE_LIST[$this->getStatusCode()];\n }", "public function model() {\n\t\treturn TABLE_BACKOFFICE_JOB_RESULTS;\n\t}", "public function getEdge(Model $model = null, $attributes = array())\n {\n $model = (!is_null($model)) ? $model : $this->parent->{$this->relation};\n\n // Indicate a unique relation since this only involves one other model.\n $unique = true;\n\n return new EdgeOut($this->query, $this->parent, $model, $this->relationType, $attributes, $unique);\n }", "public function model(Model $model)\n {\n return new ModelBuilder($model, $this->pdo, $this->handler);\n }", "public function getReason()\r\n {\r\n return $this->message;\r\n }", "public function analyze(AnalyzeModel $model) {\n\n $config = $this->initConfig();\n\n $config->setData($model->getData());\n $config->setQuery($model->getData('query'));\n $config->addHeaders($model->getData('header'));\n\n $config->setMethod(HttpClientConfiguration::METHOD_POST);\n $config->setType(HttpClientConfiguration::DATA_TYPE_JSON);\n $config->setURL(self::BASE_URL.'/analyze');\n\n return $this->sendRequest($config);\n }", "public function getModel() : Model\n {\n return $this->model;\n }", "public function getModel() {\n return $this->model;\n }", "public function getModel();", "public function getModel();", "public function getModel();", "public function explain($explain) {\n\t\t$this->_body['explain'] = $explain;\n\t\treturn $this ;\n\t}", "public function setModel(Model &$model) {\n\t\t$this->model = $model;\n\n\t\treturn $this;\n\t}", "public function getDescription()\n {\n return $this->message;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel(){\n\t\tif( isset($this->model) ){\n\t\t\treturn $this->model;\n\t\t}\n\t\t$nameModel = str_replace(' View' , 'Model' ,__CLASS__ );\n\t\t$this->model = new $nameModel();\n\t}", "public function getOriginalModel()\n {\n return $this->originalModel;\n }", "public static function getModel()\n {\n return self::$model;\n }", "public function model()\n {\n return Notice::class;\n }", "public function getModel()\n\t{\n\t\treturn $this->model;\n\t}", "public function explain( $query ) {\n return $this->client->rawCommand( 'FT.EXPLAIN', $this->searchQueryArgs( $query ) );\n }", "public function getOriginalModelInfo()\n {\n return $this->original_model_info;\n }", "public function getDescription(): string\n {\n return 'Se adiciona filtros a los indicadores y se ajusta el alias a la vista';\n }" ]
[ "0.8265784", "0.60117096", "0.59611213", "0.55231184", "0.5494088", "0.5212889", "0.50084597", "0.4992622", "0.49808276", "0.47574425", "0.47573847", "0.47028983", "0.46782732", "0.45411152", "0.447749", "0.4467165", "0.44563395", "0.44135985", "0.43776178", "0.4330168", "0.42531544", "0.4168688", "0.41493043", "0.4110157", "0.40896383", "0.4051608", "0.40388063", "0.40359274", "0.40313685", "0.40160975", "0.40055653", "0.40044117", "0.39940158", "0.39506626", "0.3921129", "0.389814", "0.38971266", "0.38926664", "0.38850167", "0.38848394", "0.38818753", "0.387967", "0.3873581", "0.38722572", "0.38589647", "0.38560116", "0.38458556", "0.38420638", "0.38420638", "0.38230318", "0.3822396", "0.3817926", "0.3816272", "0.3816272", "0.3816272", "0.38160273", "0.38058224", "0.38058224", "0.38058224", "0.38058224", "0.38058224", "0.3805629", "0.37985876", "0.37702253", "0.37498254", "0.37487918", "0.3746321", "0.3734669", "0.37326783", "0.37295794", "0.37295794", "0.37295794", "0.37284428", "0.37274253", "0.37222046", "0.37111253", "0.37111253", "0.37111253", "0.37111253", "0.37111253", "0.37111253", "0.37111253", "0.37111253", "0.37111253", "0.37111253", "0.37111253", "0.37111253", "0.37111253", "0.37111253", "0.37111253", "0.37111253", "0.37111253", "0.3707361", "0.3703196", "0.3702822", "0.370134", "0.37003064", "0.36962542", "0.36950132", "0.36918882" ]
0.7470063
1
Output only. Aggregated explanation metrics for the Model's prediction output over the data this ModelEvaluation uses. This field is populated only if the Model is evaluated with explanations, and only for tabular Models. Generated from protobuf field .google.cloud.aiplatform.v1.ModelExplanation model_explanation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
public function setModelExplanation($var) { GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\ModelExplanation::class); $this->model_explanation = $var; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModelExplanation()\n {\n return $this->model_explanation;\n }", "public function getExplanation() \n {\n return $this->explanation;\n }", "public function getExplanation(){\n\t\treturn $this->_explanation;\n\t}", "public function getExplanationSpec()\n {\n return $this->explanation_spec;\n }", "public static function get_explanation() {\n return get_string(self::get_event_string_name('_explanation'), 'mod_reader');\n }", "private function getExplanation() {\n $currentBy = null;\n $explanation = array();\n for ($i = 0; $i < $this->queryManager->length; $i++) {\n $word = $this->queryManager->words[$i];\n if ($word['processed'] && !isset($word['error'])) {\n $by = $word['by'];\n if ($by !== $currentBy) {\n $explanation[] = array(\n 'processor' => $by,\n 'word' => $word['word']\n );\n $currentBy = $by;\n }\n else {\n $explanation[count($explanation) - 1]['word'] .= ' ' . $word['word'];\n }\n }\n }\n return $explanation;\n }", "public function setExplanationSpec($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\AIPlatform\\V1\\ExplanationSpec::class);\n $this->explanation_spec = $var;\n\n return $this;\n }", "public function describe(Model $Model) {\n return $Model->schema;\n }", "public function getExplanation(): ?string\n {\n return $this->explanation;\n }", "public function setExplanation(string $explanation)\n {\n $this->explanation = $explanation;\n }", "public static function makeModelDetails($model)\n {\n $hiddenColumns=config('dashboard.hiddenColumns');\n $columns=array_diff(Schema::getColumnListing($model->getTable()),$hiddenColumns);\n $details=\"\";\n foreach($columns as $columnName)\n {\n $details.=$model->$columnName.\"\\n\";\n }\n return $details;\n }", "public function model()\n {\n return Answer::class;\n }", "public function getExplanation(Gri_Reward_Model_Reward_History $item)\n {\n return ''; // TODO\n }", "public function describe($model) { //IMPORTANTISIMO es el que devuelve el schema al Modelo\n\t\treturn $this->_schema;\n\t}", "public function setExplanation(?string $explanation): void\n {\n $this->explanation = $explanation;\n }", "public function explain(): ExplainResponse\n {\n $url = $this->url . '?' . http_build_query(array(\n 'operation' => 'explain',\n 'version' => $this->version,\n ));\n\n $body = $this->request('GET', $url);\n\n return new ExplainResponse($body, $this, $url);\n }", "public function getExplanation(\\Magento\\Reward\\Model\\Reward\\History $item)\n {\n return ''; // TODO\n }", "public function getAnswer()\n {\n return $this->answerModel;\n }", "public function getExhaustionExplanation ();", "public function getRationale()\n {\n return $this->rationale;\n }", "function describe($model) {\n\t\n\t}", "function describe(&$model) {\n\t\t$cache = parent::describe($model);\n\t\tif ($cache != null) {\n\t\t\treturn $cache;\n\t\t}\n\t\t$fields = false;\n\t\t$cols = $this->query('SHOW FULL COLUMNS FROM ' . $this->fullTableName($model));\n\n\t\tforeach ($cols as $column) {\n\t\t\t$colKey = array_keys($column);\n\t\t\tif (isset($column[$colKey[0]]) && !isset($column[0])) {\n\t\t\t\t$column[0] = $column[$colKey[0]];\n\t\t\t}\n\t\t\tif (isset($column[0])) {\n\t\t\t\t$fields[$column[0]['Field']] = array(\n\t\t\t\t\t'type' => $this->column($column[0]['Type']),\n\t\t\t\t\t'null' => ($column[0]['Null'] == 'YES' ? true : false),\n\t\t\t\t\t'default' => $column[0]['Default'],\n\t\t\t\t\t'length' => $this->length($column[0]['Type']),\n\t\t\t\t);\n\t\t\t\tif (!empty($column[0]['Key']) && isset($this->index[$column[0]['Key']])) {\n\t\t\t\t\t$fields[$column[0]['Field']]['key'] = $this->index[$column[0]['Key']];\n\t\t\t\t}\n\t\t\t\tforeach ($this->fieldParameters as $name => $value) {\n\t\t\t\t\tif (!empty($column[0][$value['column']])) {\n\t\t\t\t\t\t$fields[$column[0]['Field']][$name] = $column[0][$value['column']];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isset($fields[$column[0]['Field']]['collate'])) {\n\t\t\t\t\t$charset = $this->getCharsetName($fields[$column[0]['Field']]['collate']);\n\t\t\t\t\tif ($charset) {\n\t\t\t\t\t\t$fields[$column[0]['Field']]['charset'] = $charset;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->__cacheDescription($this->fullTableName($model, false), $fields);\n\t\treturn $fields;\n\t}", "public function getLatestActivityExtraDisplayStringByModel($model)\n {\n }", "public function setModel(\\App\\Entity\\Product\\Details\\Model $model = null) \n { \n $this->model = $model;\n \n return $this;\n }", "public function getResponseModel() \n {\n return $this->response_model;\n }", "public function reasonPhrase(): string\n {\n return $this->reasonPhrase;\n }", "public function createExplain( array $explJson ) {\n\t\t$description = $explJson['description'];\n\t\t$details = [];\n\t\t$ignored = null;\n\t\t$tieMatch = preg_match( '/max plus ([0-9.]+) times/', $description, $tieMatches );\n\t\t$prefixMatch = preg_match( '/\\:.*?\\*(\\^.+?)?, product of/', $description, $prefixMatches );\n\t\tif ( isset( $explJson['details'] ) ) {\n\t\t\t$details = $explJson['details'];\n\t\t}\n\n\t\tif ( self::strStartsWith( $description, 'score(' ) ) {\n\t\t\treturn new ScoreExplain( $explJson, $this );\n\t\t} elseif ( self::strStartsWith( $description, 'tf(' ) ) {\n\t\t\treturn null; // new DefaultSimTfExplain( $explJson, $this );\n\t\t} elseif ( self::strStartsWith( $description, 'idf(' ) ) {\n\t\t\treturn new DefaultSimIdfExplain( $explJson, $this );\n\t\t} elseif ( self::strStartsWith( $description, 'fieldWeight' ) ) {\n\t\t\treturn null; // new FieldWeightExplain( $explJson, $this );\n\t\t} elseif ( self::strStartsWith( $description, 'queryWeight' ) ) {\n\t\t\treturn null; // new QueryWeightExplain( $explJson, $this );\n\t\t} elseif ( self::strStartsWith( $description, 'ConstantScore' ) ) {\n\t\t\treturn new ConstantScoreExplain( $explJson, $this );\n\t\t} elseif ( self::strStartsWith( $description, 'MatchAllDocsQuery' ) ) {\n\t\t\treturn new MatchAllDocsExplain( $explJson, $this );\n\t\t} elseif ( self::strStartsWith( $description, 'weight(' ) ) {\n\t\t\treturn new WeightExplain( $explJson, $this );\n\t\t} elseif ( self::strStartsWith( $description, 'FunctionQuery' ) ) {\n\t\t\treturn new FunctionQueryExplain( $explJson, $this );\n\t\t} elseif ( self::strStartsWith( $description, 'Function for field' ) ) {\n\t\t\treturn new FieldFunctionQueryExplain( $explJson, $this );\n\t\t} elseif ( $prefixMatch ) {\n\t\t\treturn new WeightExplain( $explJson, $this );\n\t\t} elseif ( $explJson['value'] === 0.0 && (\n\t\t\t\tself::strStartsWith( $description, 'match on required clause' ) ||\n\t\t\t\tself::strStartsWith( $description, 'match filter' )\n\t\t\t) ) {\n\t\t\t// Because ElasticSearch function queries filter when they apply\n\t\t\t// boosts (this doesn't matter in scoring)\n\t\t\treturn null;\n\t\t} elseif ( self::strStartsWith( $description, 'queryBoost' ) ) {\n\t\t\tif ( $explJson['value'] === 1.0 ) {\n\t\t\t\t// ElasticSearch function queries always add 'queryBoost' of 1,\n\t\t\t\t// even when boost not specified\n\t\t\t\treturn null;\n\t\t\t}\n\t\t} elseif ( self::strStartsWith( $description, 'script score function, computed with script:' ) ) {\n\t\t\treturn new ScriptScoreFunctionExplain( $explJson, $this );\n\t\t} elseif ( self::strHasSubstr( $description, 'constant score' ) &&\n\t\t\tself::strHasSubstr( $description, 'no function provided' )\n\t\t) {\n\t\t\treturn null;\n\t\t} elseif ( $description === 'weight' ) {\n\t\t\treturn new FuncWeightExplain( $explJson, $this );\n\t\t} elseif ( $tieMatch ) {\n\t\t\treturn new DismaxTieExplain( $explJson, $this, (float)$tieMatches[1] );\n\t\t} elseif ( self::strHasSubstr( $description, 'max of' ) ) {\n\t\t\treturn $this->meOrOnlyChild( new DismaxExplain( $explJson, $this ) );\n\t\t} elseif ( self::strHasSubstr( $description, 'sum of' )\n\t\t\t\t|| self::strHasSubstr( $description, 'score mode [sum]' ) ) {\n\t\t\treturn $this->meOrOnlyChild( new SumExplain( $explJson, $this ) );\n\t\t} elseif ( self::strHasSubstr( $description, 'Math.min of' ) || $description === 'min of:' ) {\n\t\t\treturn $this->meOrOnlyChild( new MinExplain( $explJson, $this ) );\n\t\t} elseif ( self::strHasSubstr( $description, 'score mode [multiply]' ) ) {\n\t\t\treturn $this->meOrOnlyChild( new ProductExplain( $explJson, $this ) );\n\t\t} elseif ( self::strHasSubstr( $description, 'product of' ) ) {\n\t\t\tif ( count( $details ) === 2 ) {\n\t\t\t\tforeach ( $details as $detail ) {\n\t\t\t\t\tif ( self::strStartsWith( $detail['description'], 'coord(' ) ) {\n\t\t\t\t\t\treturn new CoordExplain( $explJson, $this, (float)$detail['value'] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $this->meOrOnlyChild( new ProductExplain( $explJson, $this ) );\n\t\t}\n\n\t\treturn new Explain( $explJson, $this );\n\t}", "public function getExplanationEntities(): ?array\n {\n return $this->explanationEntities;\n }", "public function getModel(){\n return $this->customAnswer;\n }", "public function get_problem_description(): string {\n return get_string($this->problem, 'filter_embedquestion', $this->problemdetails);\n }", "public function ExportModel(\\Google\\Cloud\\AIPlatform\\V1\\ExportModelRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/ExportModel',\n $argument,\n ['\\Google\\LongRunning\\Operation', 'decode'],\n $metadata, $options);\n }", "public function validateByModel()\r\n {\r\n $document = new ReplacementAttorneyDecisions($this->data);\r\n \r\n $validation = $document->validate(['when']);\r\n \r\n if(count($validation) == 0) {\r\n return ['isValid'=>true, 'messages' => []];\r\n }\r\n else {\r\n return [\r\n 'isValid'=>false,\r\n 'messages' => $this->modelValidationMessageConverter($validation),\r\n ];\r\n }\r\n }", "public function getReasonPhrase(): string\n {\n return $this->message->getReasonPhrase();\n }", "public function explain(): string|array\n {\n return Forrest::queryExplain($this->query);\n }", "public function introspect($model) {\n\t\treturn Admin::introspectModel($model);\n\t}", "public function describe()\n {\n return $this->morphOne(Describe::class, 'describe_able');\n }", "public function getDescriptionForEvent($eventName) {\n\t\treturn __CLASS__ . \" model has been {$eventName}\";\n\t}", "public function getModelDefinition(): array\n {\n return [\n 'id' => [ 'model' => null, 'array' => false ],\n 'values' => [ 'model' => ChunkRecommendationsValue::class, 'array' => true ],\n ];\n }", "public function getReasonPhrase()\n {\n return $this->reasonPhrase;\n }", "public function displayReason() {\n switch ($this->reason) { //Reasons should only hold an int 0-4\n case 0:\n return \"Invalid\";\n case 1:\n return \"Recommend\";\n case 2:\n return \"Criticism\";\n case 3:\n return \"Question\";\n case 4:\n return \"Other\";\n }\n }", "protected function validationLogWarning($message, $explanation = null) {\n $this->validation_log[] = array(\n 'status' => self::VALIDATION_WARNING, \n 'message' => $message,\n 'explanation' => $explanation, \n );\n }", "public function GetModel()\n {\n return $this->model;\n }", "public function getReasonPhrase()\n {\n // TODO: Implement getReasonPhrase() method.\n }", "public function reason()\n {\n return $this->response->getReasonPhrase();\n }", "public function setModelId($var)\n {\n GPBUtil::checkString($var, True);\n $this->model_id = $var;\n\n return $this;\n }", "protected function getModelInput(): string\n\t{\n\t\treturn trim($this->option('model'));\n\t}", "public function getReasonPhrase(): string\r\n {\r\n // TODO: Implement getReasonPhrase() method.\r\n return $this->reasonPhrase;\r\n }", "public function getModel(): Model\n {\n return $this->model;\n }", "public function getModel(): Model\n {\n return $this->model;\n }", "public function model()\n {\n return VoteDetails::class;\n }", "public function getRequestReasonDesc()\n\t{\n\t\treturn $this->request_reason_desc;\n\t}", "public function getModelPlural()\n {\n return strtolower(Text::plural($this->getModelSimpleName()));\n }", "public function getModel(): string\n {\n return $this->model;\n }", "public function getModel(): string\n {\n return $this->model;\n }", "public function getModel(): string\n {\n return $this->model;\n }", "private function serializeModel(Model $model)\n {\n $metadata = $model->getMetadata();\n $serialized = [\n '_id' => $model->getState()->is('new') ? null : $model->getId(),\n '_type' => $model->getType(),\n ];\n if ($this->depth > $this->maxDepth) {\n return $serialized;\n }\n\n // Attributes.\n foreach ($metadata->getAttributes() as $key => $attrMeta) {\n if (false === $this->shouldSerialize($model, $attrMeta)) {\n continue;\n }\n $serializer = $this->getCustomSerializer($model, $attrMeta);\n $value = $model->get($key);\n $serialized[$key] = $serializer ? $serializer($model, $value) : $this->serializeAttribute($value, $attrMeta);\n }\n\n // Embeds.\n foreach ($metadata->getEmbeds() as $key => $embeddedPropMeta) {\n if (false === $this->shouldSerialize($model, $embeddedPropMeta)) {\n continue;\n }\n $serializer = $this->getCustomSerializer($model, $embeddedPropMeta);\n $value = $model->get($key);\n $serialized[$key] = $serializer ? $serializer($model, $value) : $this->serializeEmbed($value, $embeddedPropMeta);\n }\n\n // Relationships.\n $model->enableCollectionAutoInit(false);\n $this->increaseDepth();\n foreach ($metadata->getRelationships() as $key => $relMeta) {\n if (false === $this->shouldSerialize($model, $relMeta)) {\n continue;\n }\n $serializer = $this->getCustomSerializer($model, $relMeta);\n $relationship = $model->get($key);\n $serialized[$key] = $serializer ? $serializer($model, $relationship) : $this->serializeRelationship($model, $relationship, $relMeta);\n }\n $this->decreaseDepth();\n $model->enableCollectionAutoInit(true);\n\n return $serialized;\n }", "public function getReasonPhrase() : string\n {\n return $this->reasonPhrase ?? Response::CODE_LIST[$this->getStatusCode()];\n }", "public function getDescriptionForEvent($eventName)\n {\n return __CLASS__ . \" model has been {$eventName}\";\n }", "public function getDescriptionForEvent($eventName)\n {\n return __CLASS__ . \" model has been {$eventName}\";\n }", "public function getDescriptionForEvent($eventName)\n {\n return __CLASS__ . \" model has been {$eventName}\";\n }", "public function getDescriptionForEvent($eventName)\n {\n return __CLASS__ . \" model has been {$eventName}\";\n }", "public function getDescriptionForEvent($eventName)\n {\n return __CLASS__ . \" model has been {$eventName}\";\n }", "public function model() {\n\t\treturn TABLE_BACKOFFICE_JOB_RESULTS;\n\t}", "public function getEdge(Model $model = null, $attributes = array())\n {\n $model = (!is_null($model)) ? $model : $this->parent->{$this->relation};\n\n // Indicate a unique relation since this only involves one other model.\n $unique = true;\n\n return new EdgeOut($this->query, $this->parent, $model, $this->relationType, $attributes, $unique);\n }", "public function model(Model $model)\n {\n return new ModelBuilder($model, $this->pdo, $this->handler);\n }", "public function analyze(AnalyzeModel $model) {\n\n $config = $this->initConfig();\n\n $config->setData($model->getData());\n $config->setQuery($model->getData('query'));\n $config->addHeaders($model->getData('header'));\n\n $config->setMethod(HttpClientConfiguration::METHOD_POST);\n $config->setType(HttpClientConfiguration::DATA_TYPE_JSON);\n $config->setURL(self::BASE_URL.'/analyze');\n\n return $this->sendRequest($config);\n }", "public function getReason()\r\n {\r\n return $this->message;\r\n }", "public function getModel() : Model\n {\n return $this->model;\n }", "public function getModel() {\n return $this->model;\n }", "public function getModel();", "public function getModel();", "public function getModel();", "public function setModel(Model &$model) {\n\t\t$this->model = $model;\n\n\t\treturn $this;\n\t}", "public function explain($explain) {\n\t\t$this->_body['explain'] = $explain;\n\t\treturn $this ;\n\t}", "public function getDescription()\n {\n return $this->message;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel()\n {\n return $this->model;\n }", "public function getModel(){\n\t\tif( isset($this->model) ){\n\t\t\treturn $this->model;\n\t\t}\n\t\t$nameModel = str_replace(' View' , 'Model' ,__CLASS__ );\n\t\t$this->model = new $nameModel();\n\t}", "public function getOriginalModel()\n {\n return $this->originalModel;\n }", "public static function getModel()\n {\n return self::$model;\n }", "public function getModel()\n\t{\n\t\treturn $this->model;\n\t}", "public function model()\n {\n return Notice::class;\n }", "public function explain( $query ) {\n return $this->client->rawCommand( 'FT.EXPLAIN', $this->searchQueryArgs( $query ) );\n }", "public function getOriginalModelInfo()\n {\n return $this->original_model_info;\n }", "public function getDescription(): string\n {\n return 'Se adiciona filtros a los indicadores y se ajusta el alias a la vista';\n }" ]
[ "0.7468113", "0.60093826", "0.5959063", "0.55214256", "0.54937595", "0.52105933", "0.5008461", "0.49912444", "0.49794704", "0.4758913", "0.47567737", "0.47027895", "0.4677348", "0.45392773", "0.44788244", "0.44666338", "0.44559315", "0.44129157", "0.43759972", "0.4328438", "0.42529112", "0.41669148", "0.41489717", "0.41113216", "0.40879482", "0.40505576", "0.40383714", "0.40332437", "0.40314355", "0.40129745", "0.4006913", "0.40023175", "0.3992836", "0.39489815", "0.3920725", "0.38962865", "0.38950348", "0.38912", "0.38834783", "0.38830954", "0.38810638", "0.3880713", "0.38723442", "0.38712928", "0.38603625", "0.3856552", "0.38445863", "0.38413405", "0.38413405", "0.38221687", "0.38207215", "0.38165465", "0.3815835", "0.3815835", "0.3815835", "0.38157746", "0.38047624", "0.38037103", "0.38037103", "0.38037103", "0.38037103", "0.38037103", "0.37968826", "0.37699234", "0.37505588", "0.37473994", "0.37465203", "0.37338433", "0.37316078", "0.3728591", "0.3728591", "0.3728591", "0.37285304", "0.37279755", "0.37188193", "0.371005", "0.371005", "0.371005", "0.371005", "0.371005", "0.371005", "0.371005", "0.371005", "0.371005", "0.371005", "0.371005", "0.371005", "0.371005", "0.371005", "0.371005", "0.371005", "0.371005", "0.37076148", "0.37033215", "0.37021315", "0.3699295", "0.3698956", "0.36964542", "0.3693737", "0.36896625" ]
0.8266735
0
obtenemos los datos del usuario autenticado
function index(){ $db_config_id = $this->session->userdata('db_config_id'); $licencias = $this->licencias->get_by_id($db_config_id); $lic = array(); foreach ($licencias as $key => $value) { $almacenes = $this->almacenes->get_by_id($value->id_almacen); $lic[] = [ 'nombre_empresa' => $value->nombre_empresa, 'fecha_vencimiento' => $value->fecha_vencimiento, 'descripcion' => $value->descripcion, 'valor_plan' => $value->valor_plan, 'nombre_plan' => $value->nombre_plan, 'almacen' => $almacenes['nombre'] ]; } $this->output->set_content_type('application/json')->set_output(json_encode(array('aaData' => $lic ))); /*$this->layout->template('member') ->show('licencias/index',array('data' => $lic));*/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function usuarios(){\n\t\tif ($_SERVER['REQUEST_METHOD'] != \"GET\") {\n\t\t\t# no se envian los usuarios, se envia un error\n\t\t\t$this->mostrarRespuesta($this->convertirJson($this->devolverError(1)), 405);\n\t\t}//es una petición GET\n\t\t//se realiza la consulta a la bd\n\t\t$query = $this->_conn->query(\n\t\t\t\"SELECT id, nombre, email \n\t\t\t FROM usuario\");\n\t\t//cantidad de usuarios\n\t\t$filas = $query->fetchAll(PDO::FETCH_ASSOC); \n \t$num = count($filas);\n \t//si devolvio un resultado, se envia al cliente\n \tif ($num > 0) { \n\t $respuesta['estado'] = 'correcto'; \n\t $respuesta['usuarios'] = $filas; \n\t $this->mostrarRespuesta($this->convertirJson($respuesta), 200); \n\t } //se envia un error \n\t $this->mostrarRespuesta($this->devolverError(2), 204);\n\t}", "public function autenticar(){\n\n $query = \"select id, nome, email from pessoa where email = :email and senha = :senha\";\n $stmt = $this->db->prepare($query);\n $stmt->bindValue(':email',$this->__get('email'));\n $stmt->bindValue(':senha',$this->__get('senha'));\n $stmt->execute();\n\n $usuario = $stmt->fetch(\\PDO::FETCH_ASSOC);\n \n if($usuario['id'] != '' && $usuario['nome'] != ''){\n $this->__set('id', $usuario['id']);\n $this->__set('nome', $usuario['nome']);\n }\n return $this;\n }", "public function listarUser() {\n if(IDUSER) {\n $eval = \"SELECT id,nombre,apellidos,email FROM users\";\n $peticion = $this->db->prepare($eval);\n $peticion->execute();\n $resultado = $peticion->fetchAll(PDO::FETCH_OBJ);\n exit(json_encode($resultado));\n } else {\n http_response_code(401);\n exit(json_encode([\"error\" => \"Fallo de autorizacion\"])); \n }\n }", "public function datos_usuario(){\n\t\t$data = json_decode(json_encode($_SESSION['USER']),true);\n\n\t\t$result = $this->_db->query(\"\n\t\tSELECT a.roleid FROM \".DB_PRE.\"role_assignments a, \".DB_PRE.\"context b \n\t\tWHERE a.userid = '$data[id]' AND a.contextid = b.id AND b.instanceid =\".ID_CURSO\n\t\t);\n\n\t\t$rol = 0;\n\t\tif (!$result) {\n\t\t\tprintf(\"Errormessage datos_usuario: %s\\n\", $this->_db->error);\n\t\t}else{\n\t $rol_user = $result->fetch_all(MYSQLI_ASSOC);\n\t if(count($rol_user) > 0){\n\t \t$rol = $rol_user['0']['roleid'];\n\t }\n \t}\n\n\t\t$usuario = array(\n\t\t\t\"id\" => $data['id'],\n\t\t\t\"nombre\" => $data['firstname'],\n\t\t\t\"apellido\" => $data['lastname'],\n\t\t\t\"codigo_estudiante\" => $data['idnumber'],\n\t\t\t\"rol\" => $rol\n\t\t);\n\n\t\t$datos_add = $this->_db->query(\"\n\t\t\tSELECT e.per_aca, b.id_facultad, a.id_programa, e.idnumber as codigo_curso, a.id_genero, a.idnumber\n\t\t\tFROM am_usuario a, am_programa b, \".DB_PRE.\"course e\n\t\t\tWHERE a.id_programa = b.id_programa\n\t\t\tAND e.id = \".ID_CURSO.\"\n\t\t\tAND id_moodle = \".$data['id']\n\t\t\t);\n\n\t\tif (!$datos_add) {\n\t\t\tprintf(\"Errormessage datos_add: %s\\n\", $this->_db->error);\n\t\t}else{\n\t\t\t$row = $datos_add->fetch_all(MYSQLI_ASSOC);\n\t\t\tforeach ($row as $key) {\n\t\t\t\tforeach ($key as $data => $value) {\n\t\t\t\t\t$usuario[$data] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $usuario;\n\t}", "private function consultar_usuario_todos() {\n $sentencia = \"select id,nombrecompleto ,correo,token from usuario u;\";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n }", "public function autualizar_dados_login()\n {\n \ttry {\n \t\t \n \t\t$con = FabricaDeConexao::conexao();\n \t\t \n \t\t$sqlquery = 'update usuario set usuario = :usuario,senha=md5(:senha),email = :email where id = :id; ';\n \t\t$stmt->$con-> prepare($sqlquery);\n \t\t$stmt->bindValue(':usuario',$dados->usuario);\n \t\t$stmt->bindValue(':senha',$dados->senha);\n \t\t$stmt->bindValue(':email',$dados->email);\n \t\t$stmt->bindValue(':id',$dados->id);\n \t\t\n \t\t$stmt->execute();\n \t\t$rowaf = $stmt->rowCount();\n \t\treturn $rowaf;\n \t}\n \tcatch (PDOException $ex)\n \t{\n \t\techo \"Erro: \".$ex->getMessage();\n \t}\n }", "public function recibirdatos() {\n\t\t$passSha1 = sha1($this->input->post('password'));\n\t\t$datos = array(\n\t\t\t'usuario' => $this->input->post('usuario'),\n\t\t\t'password' => $passSha1\n\t\t\t);\n\t\t//Llamamos al modelo, Si la autentificacion es correcta damos paso a la aplicacion y sino devolvemos al login\n\t\tif($this->login_model->obtenerPass($datos) == true){\n\t\t\t//Cargamos la pagina principal\n\t\t\t$this->session->set_userdata('usuario', $datos['usuario']);\n\t\t\t//Llamamos a la clase que realiza los test de caja blanca\n\t\t\t$this->testCajaBlanca($datos);\n\t\t\t$this->mostrarDatosUser();\n\t\t\t$this->session->set_userdata('Token', true);\n\t\t}else{\n\t\t\t$this->load->view('login');\n\t\t}\n\t}", "private function login(){\n\t\tif ($_SERVER['REQUEST_METHOD'] != \"POST\") {\n\t\t\t# no se envian los usuarios, se envia un error\n\t\t\t$this->mostrarRespuesta($this->convertirJson($this->devolverError(1)), 405);\n\t\t} //es una peticion POST\n\t\tif(isset($this->datosPeticion['email'], $this->datosPeticion['pwd'])){\n\t\t\t#el constructor padre se encarga de procesar los datos de entrada\n\t\t\t$email = $this->datosPeticion['email']; \n \t\t$pwd = $this->datosPeticion['pwd'];\n \t\t//si los datos de la solicitud no es tan vacios se procesa\n \t\tif (!empty($email) and !empty($pwd)){\n \t\t\t//se valida el email\n \t\t\tif (filter_var($email, FILTER_VALIDATE_EMAIL)) { \n \t\t\t//consulta preparada mysqli_real_escape()\n \t\t\t\t$query = $this->_conn->prepare(\n \t\t\t\t\t\"SELECT id, nombre, email, fRegistro \n \t\t\t\t\t FROM usuario \n \t\t\t\t\t WHERE email=:email AND password=:pwd \");\n \t\t\t\t//se le prestan los valores a la query\n \t\t\t\t$query->bindValue(\":email\", $email); \n \t\t\t$query->bindValue(\":pwd\", sha1($pwd)); \n \t\t\t$query->execute(); //se ejecuta la consulta\n \t\t\t//Se devuelve un respuesta a partir del resultado\n \t\t\tif ($fila = $query->fetch(PDO::FETCH_ASSOC)){ \n\t\t\t $respuesta['estado'] = 'correcto'; \n\t\t\t $respuesta['msg'] = 'Los datos pertenecen a un usuario registrado';\n\t\t\t //Datos del usuario \n\t\t\t $respuesta['usuario']['id'] = $fila['id']; \n\t\t\t $respuesta['usuario']['nombre'] = $fila['nombre']; \n\t\t\t $respuesta['usuario']['email'] = $fila['email']; \n\t\t\t $this->mostrarRespuesta($this->convertirJson($respuesta), 200); \n\t\t\t } \n \t\t\t}\n \t\t} \n\t\t} // se envia un mensaje de error\n\t\t$this->mostrarRespuesta($this->convertirJson($this->devolverError(3)), 400);\n\t}", "private function ifoCadUser()\n {\n $infoCadUser = new AdmsRead();\n $infoCadUser->fullRead(\"SELECT env_email_conf, adms_niveis_acesso_id, adms_sits_usuario_id FROM adms_cads_usuarios WHERE id =:id LIMIT :limit\", \"id=1&limit=1\");\n $this->IfoCadUser = $infoCadUser->getResultado();\n\n }", "public function autentificacion($username,$password){\n $userService = new UsuariosServiceImp();\n //objeto de tipo usuario\n $usuario = new Usuarios();\n //llamdo al metodo definido en la capa de servicio\n $usuario = $userService->buscarPorUsernamePassword($username,$password);\n if ( is_object($usuario)){\n /*\n variable de sesion mediante variables locales\n \n $_SESSION['nombre'] = $usuario->getNombre();\n $_SESSION['correo'] = $usuario->getEmail();\n $_SESSION['id'] = $usuario->getId();\n */\n /* variable de sesion mediante un arreglo asociado\n */\n $_SESSION['miSesion'] = array();\n $_SESSION['miSesion']['nombre'] = $usuario->getNombre();\n $_SESSION['miSesion']['correo'] = $usuario->getEmail();\n $_SESSION['miSesion']['id'] = $usuario->getId();\n \n //echo \"<br>El usuario es valido\";\n header(\"location:../view/productos.class.php\");\n }else{\n //echo \"<br>Este usuario no esta registrado en la base de datos\";\n header(\"location:../view/formLogin.html\");\n }\n }", "function compruebaLoginUsuario($bd){\n //Hago un filtrado previo por si hay valores indeseables en el array\n $arrayFiltrado=array();\n foreach ($_POST as $k => $v)\n $arrayFiltrado[$k] = filtrado($v);\n\n //Utilizo los objetos DAO para añadir el usuario a la BD\n $daoUsuario = new Usuarios($bd);\n $usuario = new Usuario();\n $usuario->setPassword($arrayFiltrado[\"password\"]);\n $usuario->setUsuario($arrayFiltrado[\"usuario\"]);\n $resultado = $daoUsuario->compruebaCredenciales($usuario);\n //Compruebo si tengo usuario\n if($resultado!=false) {\n $usuario->setPassword(null);\n $usuario->setId($resultado[\"id\"]);\n $usuario->setImagen($resultado[\"imagen\"]);\n return $usuario;\n }\n else\n return false;\n}", "public function getUsuariosLogin($datos)\n {\n $stmt = Conexion::conectar()->prepare('SELECT *from usuarios WHERE correo=:correo && password=:contrasena');\n $stmt->bindParam(\":correo\", $datos[\"correo\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":contrasena\", $datos[\"contrasena\"] , PDO::PARAM_STR);\n if($stmt->execute())\n {\n \n //Variables para iniciar una sesion \n \n $respuesta = $stmt->rowCount();\n $resultado =$stmt->fetch();\n session_start();\n $_SESSION[\"idUsuario\"]=$resultado[\"idUsuario\"];\n $_SESSION[\"nombre\"]=$resultado[\"nombre\"];\n $_SESSION[\"apellido\"]=$resultado[\"apellido\"];\n $_SESSION[\"nombre_usuario\"]=$resultado[\"nombre_usuario\"];\n $_SESSION[\"contrasena\"]=$resultado[\"password\"];\n $_SESSION[\"apellido\"]=$resultado[\"apellido\"];\n $_SESSION[\"correo\"]=$resultado[\"correo\"];\n $_SESSION[\"fecha_registro\"]=$resultado[\"fecha_registro\"];\n $_SESSION[\"ruta_img\"]=$resultado[\"ruta_img\"];\n $_SESSION[\"tipoUsuario\"]=$resultado[\"tipoUsuario\"];\n\n return $respuesta;\n }else\n {\n return \"error\";\n }\n }", "public function agregarUsuario(){\n \n }", "public function solicitaUsuario()\n {\n // Lo emitimos por evento\n $this->emit('cambioUsuario', $this->usuario);\n }", "public function readUserAuth(){\n $user = new \\Filebase\\Database([\n 'dir' => $this->getDataSource()\n ]);\n\n if ($user->has($this->username)) {\n $item = $user->get($this->username);\n $data = [\n 'result' => $item->auth,\n 'attribute' => [\n 'username' => $this->username\n ],\n 'status' => 'success',\n 'message' => 'Data found!'\n ];\n } else {\n $data = [\n 'status' => 'error',\n 'message' => 'User not found!'\n ];\n }\n return $data;\n }", "public static function getUsuarios()\n {\n $query = \"SELECT id,nombre,email,usuario,privilegio,fecha_registro FROM users\";\n\n self::getConexion();\n\n $resultado = self::$cnx->prepare($query);\n\n $resultado->execute();\n\n $filas = $resultado->fetchAll();\n\n return $filas;\n }", "public function autenticar($usr,$pwd) {\n $pwd=\"'\".$pwd.\"'\";\n $sql= 'SELECT * FROM empleados WHERE (\"idEmpleado\" = '.$usr.') AND (dni = '.$pwd.');';\n $empleado=\"\";\n $result = pg_query($sql);\n\n if ($result){\n $registro = pg_fetch_object($result);\n $empleado = $registro->nombres . \" \" . $registro->apellido;\n session_start(); //una vez que se que la persona que se quiere loguear es alguien autorizado inicio la sesion\n //cargo en la variable de sesion los datos de la persona que se loguea\n $_SESSION[\"idEmpleado\"]=$registro->idEmpleado;\n $_SESSION[\"dni\"]=$registro->dni;\n $_SESSION[\"fechaInicio\"]=$registro->fechaInicio;\n $_SESSION[\"nombres\"]=$registro->nombres;\n $_SESSION[\"apellido\"]=$registro->apellido;\n $_SESSION[\"i_lav\"]=$registro->i_lav;\n $_SESSION[\"f_lav\"]=$registro->f_lav;\n $_SESSION[\"i_s\"]=$registro->i_s;\n $_SESSION[\"f_s\"]=$registro->f_s;\n $_SESSION[\"i_d\"]=$registro->i_d;\n $_SESSION[\"f_d\"]=$registro->f_d;\n //$_SESSION[\"iex_lav\"]=$registro->iex_lav;\n //$_SESSION[\"fex_lav\"]=$registro->fex_lav;\n }\n return $empleado;\n }", "private function consultar_usuario_por_correo() {\n $sentencia = \"select id,nombrecompleto ,correo,token \"\n . \"from usuario u where u.correo ='{$this->referencia_a_buscar}'; \";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n }", "public function saveUsuario(){\n\t\t$conexion = new Database();\n if ($this->codigo){\n $query = sprintf('UPDATE agenda_usuario SET usuario = \"%s\" password = \"%s\" WHERE usuario_id = %d',\n $this->usuario,\n $this->password,\n $this->codigo);\n $rows = $conexion->exec( $query );\n }\n else{\n $query = sprintf('INSERT INTO agenda_usuario ( usuario, password) VALUES (\"%s\", \"%s\")',\n $this->usuario,\n $this->password );\n\t\t\t$rows = $conexion->exec( $query );\n $this->codigo = $conexion->lastInsertId();\n }\n }", "public function autenticar(Autenticar $autenticar){\n\n $sql = \"select * from tbl_funcionario where matricula = '\".$autenticar->getLogin().\"' and senha = '\".$autenticar->getSenha().\"'\";\n\n echo $sql;\n \n $pdoConn = $this->conn->startConnection();\n\n $select = $pdoConn->query($sql);\n\n if($rsContatos=$select->fetch(PDO::FETCH_ASSOC)){\n // echo \"AQQUI\";\n // var_dump($rsContatos);\n \n // require_once('model/usuarioCmsClass.php');\n $user = new UsuarioCms();\n\n $user->setId($rsContatos['id']);\n $user->setNome($rsContatos['nome']);\n $user->setLogin($rsContatos['matricula']);\n $user->setSenha($rsContatos['senha']);\n $user->setIdPermissao($rsContatos['id_permissao']);\n\n return $user;\n }else{\n return \"FALHA\";\n }\n\n $this->conn->closeConnection();\n\n }", "public function hacerLogin() {\n $user = json_decode(file_get_contents(\"php://input\"));\n\n if(!isset($user->email) || !isset($user->password)) {\n http_response_code(400);\n exit(json_encode([\"error\" => \"No se han enviado todos los parametros\"]));\n }\n \n //Primero busca si existe el usuario, si existe que obtener el id y la password.\n $peticion = $this->db->prepare(\"SELECT id,idRol,password FROM users WHERE email = ?\");\n $peticion->execute([$user->email]);\n $resultado = $peticion->fetchObject();\n \n if($resultado) {\n \n //Si existe un usuario con ese email comprobamos que la contraseña sea correcta.\n if(password_verify($user->password, $resultado->password)) {\n \n //Preparamos el token.\n $iat = time();\n $exp = $iat + 3600*24*2;\n $token = array(\n \"id\" => $resultado->id,\n \"iat\" => $iat,\n \"exp\" => $exp\n );\n \n //Calculamos el token JWT y lo devolvemos.\n $jwt = JWT::encode($token, CJWT);\n http_response_code(200);\n exit(json_encode($jwt . \"?\" . $resultado->idRol));\n \n } else {\n http_response_code(401);\n exit(json_encode([\"error\" => \"Password incorrecta\"]));\n }\n \n } else {\n http_response_code(404);\n exit(json_encode([\"error\" => \"No existe el usuario\"])); \n }\n }", "function modeloUserGetAll (){\n // Genero lo datos para la vista que no muestra la contraseña ni los códigos de estado o plan\n // sino su traducción a texto\n $db = AccesoDatos::getModelo();\n $tusuarios = $db->getUsuarios();\n foreach ($tusuarios as $clave=>$user){\n \n $tabla[$user->id]= ['nombre'=>$user->nombre,\n 'correo'=>$user->correo,\n 'plan'=>PLANES[$user->plan],\n 'estado'=>ESTADOS[$user->estado],\n ];\n }\n return $tabla;\n}", "public function getUsuario() {\n }", "public function dadosLogin(){\n\t\t$sql=\"select id_empresa from empresa where email=:email and senha=:senha\";\n\t\t//prepara o comando a ser executado no banco de dados\n\t\t$query=$this->con->prepare($sql);\n\t\t//set as variáveis no comando sql e executa no banco de dados\n\t\t$query->execute(array(\"email\"=>$this->email,\"senha\"=>$this->senha));\n\t\t//retorna resultado com um array assoc\n\t\t$resultado = $query->fetch(PDO::FETCH_ASSOC);\n\t\t//retorna os dados do usuário se estiver tudo ok, senão retorna falso\n\t\tif($resultado){\n\t\t\treturn $resultado;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function UserData(){\n\t\t$this->id = \"\"; \n\t\t$this->nombre =null;\n\t\t$this->cc = null;\n $this->email = null; \n\t\t$this->telefono =null;\n\t\t$this->rol = null;\n\t\t$this->user = null; \n\t\t$this->pass = null;\n \n\t}", "public function cargarUsuario(){\n $query = \"SELECT nombre, apellido, sexo, DATE_FORMAT(fecha_nac, '%d/%m/%Y') AS fecha_nac, correo FROM usuario WHERE codUsuario = \".parent::string($this->getCodUsuario()).\";\";\n $result = mysqli_query(parent::conexion(), $query);\n $arreglo = null;\n\n if(!$result){\n \t\tdie(\"Error\");\n } else{\n while($data = mysqli_fetch_assoc($result)){\n $arreglo[] = $data;\n \t\t }\n }\n\n parent::desconectar();\n return json_encode($arreglo);\n }", "function consult_login($dato){\n\t\t// se crean las variables que tentran la data correspondiente en la posicion que esta cada uno de estos datos\n\t\t$cedula=strip_tags($dato[0]);\n\t\t$contrasena=strip_tags($dato[1]);\n\t\t//se crea una variable que instancia la clase que coneccion a la base de datos\n\t\t$mysqli = new conect_database();\n\t\t// se rea una variable que sea igual a la variable que instancio la clase anterior y se realiza una respectiva consulta y se le mandan los respectivos datos\n\t\t$query = $mysqli->prepare(\"select id_usuarios,nombre_usuario,tipo_usuario from t_usuarios where usuario='\".$cedula.\"' and contrasena='\".$contrasena.\"'\");\n\t\t// se ejecuta lo que esta dentro de la variable anterior \n\t\t$query->execute();\t\n // se llama la una de las variables privadas que se crearon al principio y esta va a ser igual a la variable que contiene los datos de la consulta uy se obtienen los datos con get_result();\n\t\t$this->consult=$query->get_result();\n // se creaun bucle que es igual a data que sea igual al metodo inbocado en este caso la variable que contiela los datos de la consulta y se obtiene una colunma o un array (los datos)\n\t\twhile ($data=$this->consult->fetch_row()) {\n // llamamos a la otra variable privada que sera un array y contendra los datos\n\t\t\t$this->dataAll[]=$data;\n\n\t\t}\n // retornamos los datos \n\t\treturn $this->dataAll;\n\t}", "function ingresar($user,$password){\n\t\t$activo = true;\n\t\t$query = \"SELECT * FROM usuarios WHERE user='$user' and pass=$password and activo=1\";\n\t\t$link = conectar(); //llama a la funcion conectar de conex.php\n\t\t$result = $link->query($query); //envia el query a la BD\n\t\tif ($resultdb = mysqli_fetch_array($result) and $result->num_rows == 1) {\n\t\t\t$usuario = array('id'=>$resultdb['idUsuario'], \"nombre\"=>$resultdb['nombre'], \"user\"=>$resultdb['user'], \n\t\t\t\t'rol'=>$resultdb['rol'], \"token\"=>\"fake\");\n\t\t}\n\t\t$link->close();\t\t\n\t\techo json_encode($usuario);\t\n\t}", "function getUsuarios(){\n\t\n\t\treturn conectar()->query( \"SELECT * FROM usuarios\");\n\t}", "public function getdatosUsuarios(){\n\t\t$bd = new bd();\n\t\t$result = $bd->doSingleSelect($this->u_table,\"id = {$this->id}\");\n\t\tif($result){\n\t\t\t$this->datosUsuario($result[\"direccion\"], $result[\"telefono\"], $result[\"descripcion\"], $result[\"estados_id\"], $result[\"facebook\"], $result[\"twitter\"],$result[\"website\"],$result[\"certificado\"],$result[\"id_sede\"]);\n\t\t\t$this->id = $result[\"id\"];\n\t\t}else {\n\t\t\treturn false;\n\t\t}\n\t}", "function ListaUsuario() {\n\t\n\t\t\t$sql = \"SELECT usu.*, CONCAT_WS(' ', per.primer_nombre, per.primer_apellido) as nombre_completo, usu.nombre_usuario, rol.descripcion FROM usuario usu\n\t\t\t\t\tINNER JOIN rol rol ON rol.id = usu.rol_id\n\t\t\t\t\tINNER JOIN persona per ON per.id = usu.persona_id\";\n\t\t\t$db = new conexion();\n\t\t\t$result = $db->consulta($sql);\n\t\t\t$num = $db->encontradas($result);\n\t\t\t$respuesta->datos = [];\n\t\t\t$respuesta->mensaje = \"\";\n\t\t\t$respuesta->codigo = \"\";\n\t\t\tif ($num != 0) {\n\t\t\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t\t\t$respuesta->datos[] = mysql_fetch_array($result);\n\t\t\t\t}\n\t\t\t\t$respuesta->mensaje = \"Ok\";\n\t\t\t\t$respuesta->codigo = 1;\n\t\t\t} else {\n\t\t\t\t$respuesta->mensaje = \"No existen registros de roles.\";\n\t\t\t\t$respuesta->codigo = 0;\n\t\t\t}\n\t\t\treturn json_encode($respuesta);\n\t\t}", "public static function getAllUsuario(){\n $v = array();\n\t\t$conexion = new Database();\n $sql = sprintf('SELECT * FROM agenda_usuarios' );\n $rows = $conexion->query( $sql );\n\n foreach( $rows as $row ){\n\t\t\t$u = new Usuario();\n\t\t\t$u->usuario = $row['USUARIO'];\n $u->password = $row['PASSWORD'];\n $u->codigo = $row['USUARIO_ID'];\n\t\t\t$v[] = $u;\n\t\t}\n return $v;\n }", "public function usuario_post() {\n $respuesta = $this->Account_model->selectUsuario($this->post('usuario'), $this->post('contraseña'));\n if(!$respuesta) {\n $this->response('', 204);\n } else {\n $this->response($respuesta, 200);\n }\n }", "public function getUsuario(){\n return $this->usuario;\n }", "function post_conectar()\n\t{\n\t\t//En este metodo antiguamente se incluia codigo para asegurarse que el esquema de auditoria\n\t\t//guardara el usuario conectado.\n\t}", "public function buscarUsuarios(){\n\t\t}", "function obtenerDatosUsuario($parametros) {\n $sql = \"SELECT nombre, apellidos, email, telefono, dni, administrador, pass FROM usuarios WHERE dni = :dni\";\n\n //Preparamos la consulta\n $consulta_usuario = $this->conexionBBDD->prepare($sql,array());\n\n //Ejecutamos la consulta\n $consulta_usuario->execute($parametros);\n\n //Devolvemos los resultados\n return $consulta_usuario->fetch(PDO::FETCH_NUM);\n }", "public function login($user, $clave)\n {\n parent::conectar();\n\n \n\n // El metodo salvar sirve para escapar cualquier comillas doble o simple y otros caracteres que pueden vulnerar nuestra consulta SQL\n $user = parent::salvar($user);\n $clave = parent::salvar($clave);\n\n // Si necesitas filtrar las mayusculas y los acentos habilita las lineas 36 y 37 recuerda que en la base de datos debe estar filtrado tambien para una \n \n\t$consulta = 'select id, nombre, cargo from usuarios where email=\"'.$user.'\" and clave= MD5(\"'.$clave.'\")\n\t UNION SELECT codpaci, nombrep, cargo from customers where email =\"'.$user.'\" and clave= MD5(\"'.$clave.'\")';\n\t \n\t \n /*\n Verificamos si el usuario existe, la funcion verificarRegistros\n retorna el número de filas afectadas, en otras palabras si el\n usuario existe retornara 1 de lo contrario retornara 0\n */\n\n $verificar_usuario = parent::verificarRegistros($consulta);\n\n // si la consulta es mayor a 0 el usuario existe\n if($verificar_usuario > 0){\n\n \n\n /*\n Realizamos la misma consulta de la linea 55 pero esta ves transformaremos el resultado en un arreglo,\n ten mucho cuidado con usar el metodo consultaArreglo ya que devuelve un arreglo de la primera fila encontrada\n es decir, como nosotros solo validamos a un usuario no hay problema pero esta funcion no funciona si\n vas a listar a los usuarios, espero que me entiendan xd\n */\n\n $user = parent::consultaArreglo($consulta);\n\n /*\n Bien espero ser un poco claro en esta parte, la variable user\n en la linea 69 pasa a ser un arreglo con los campos consultados en la linea\n 48, entonces para acceder a los datos utilizamos $user[nombre_del_campo] Ok?\n bueno hagamos el ejercicio.\n */\n\n /*\n Inicializamos la sessión | Recuerda con las variables de sesión\n podemos acceder a la informacion desde cualquiera pagina siempre y cuando\n exista una sesión y ademas utilicemos el codigo de la linea 84\n */\n\n session_start();\n\n /*\n Las variables de sesion son muy faciles de usar, es como\n declarar una variable, lo unico diferente es que obligatoria mente\n debes usar $_SESSION[] y .... el nombre de la variable ya no sera asi\n $miVariable sino entre comillas dentro del arreglo de sesion, haber me\n dejo explicar, $_SESSION['miVariable'], recuerda que como declares la variable\n en este archivo asi mismo lo llamaras en los demas.\n */\n\n $_SESSION['id'] = $user['id'];\n $_SESSION['nombre'] = $user['nombre'];\n $_SESSION['cargo'] = $user['cargo'];\n\n /*\n Que porqué almacenamos cargo? es encillo en nuestros proyectos\n pueden existir archivos que solo puede ver un usuario con el cargo de\n administrador y no un usuario estandar, asi que la variable global de\n sesion nos ayudara a verificar el cargo del usuario que ha iniciado sesion\n Ok?\n */\n\n /*\n Recuerda:\n cargo con valor: 1 es: Administrador\n cargo con valor: 2 es: usuario estandar\n puedes agregar cuantos cargos desees, en este ejemplo solo uso 2\n */\n\n // Verificamos que cargo tiene l usuario y asi mismo dar la respuesta a ajax para que redireccione\n if($_SESSION['cargo'] == 1){\n echo 'view/admin/admin.php';\n }else if($_SESSION['cargo'] == 2){\n echo 'view/user/user.php';\n }\n\n\n // u.u finalizamos aqui :v\n\n }else{\n // El usuario y la clave son incorrectos\n echo 'error_3';\n }\n\n\n # Cerramos la conexion\n parent::cerrar();\n }", "public function obtener($antigua,$nueva){\n \n \n session_start();\n //busca en la tabla usuarios los campos donde el nombre sea igual a admin si no encuentra nada devuelve null\n \n $usuario = R::findOne('usuarios', 'alias=?', [\n $_SESSION['nombre']\n ]);\n \n \n //comprueba si la variable password es distinta al campo contraseña almacenado en la base de datos si es asi b octiene el valor=\"no\"\n if ( password_verify($antigua, $usuario->contrasena)) {\n \n \n $actualizar=R::load('usuarios',$usuario->id);\n $actualizar->contrasena = password_hash($nueva, PASSWORD_DEFAULT);\n $actualizar->confirmar_contrasena=password_hash($nueva, PASSWORD_DEFAULT);\n \n \n R::store($actualizar);\n redirect(base_url().\"usuario/Usuarios/accesoget\");\n \n }\n }", "static public function ctrIngresoUsuario()\n{ \n if(isset($_POST[\"ingUsuario\"]))\n {\n\n if(preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingUsuario\"]) && preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingPassword\"])) {\n\n\n //$encriptar = crypt($_POST[\"ingPassword\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n\t\t\t//print_r($_POST);\n $tabla = \"usuarios\";\n $item= \"codusuario\";\n $valor= $_POST[\"ingUsuario\"];\t\t\t\t\n\n $respuesta = ModeloUsuarios::mdlMostrarUsuarios($tabla, $item, $valor );\n\n if($respuesta[\"codusuario\"] == $_POST[\"ingUsuario\"] && $respuesta[\"clave\"] == $_POST[\"ingPassword\"] ){\n\n if($respuesta[\"bloqueado\"] == 0 ) {\n $_SESSION[\"iniciarSesion\"] = \"ok\";\n $_SESSION[\"id\"] = $respuesta[\"codusuario\"];\n $_SESSION[\"nombre\"] = $respuesta[\"nomusuario\"];\n $_SESSION[\"usuario\"] = $respuesta[\"codusuario\"];\n $_SESSION[\"perfil\"] = $respuesta[\"codperfil\"];\n $_SESSION[\"foto\"] = \"\";\n $_SESSION[\"id_local\"] = 1;\n\n date_default_timezone_set('America/Bogota');\n $fecha = date('Y-m-d');\n $hora = date('H:i:s');\n $fechaActual = $fecha.' '.$hora;\n\n $tabla = 'usuarios';\n $item1 = 'fecingreso';\n $valor1 = $fechaActual ;\n $item2 = 'codusuario';\n $valor2= $respuesta[\"codusuario\"] ;\n $respuestaUltimoLogin = ModeloUsuarios::mdlActualizarUsuario($tabla,$item1, $valor1, $item2, $valor2 );\n\n if($respuestaUltimoLogin == \"ok\")\n {\n echo '<script> window.location = \"inicio\"</script>';\n\n }\n\n } \n else \n echo '<br><div class=\"alert alert-danger\">El usuario no se encuentra activado.</div>';\n\n }else {\n\n echo '<br><div class=\"alert alert-danger\">Error al ingresar vuelve a intentarlo.</div>';\n }\t\t\t\t\n\n }//\n\n }\n\n}", "public function getUsers(){\n $query = \"SELECT * FROM usuario \";\n return self::getInstance()->consulta($query);\n }", "public function ctrIngresoUsuario(){\n\t\tif(isset($_POST[\"ingUsuario\"])){\n\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/',$_POST[\"ingUsuario\"]) && \n\t\t\t\tpreg_match('/^[a-zA-Z0-9]+$/',$_POST[\"ingPassword\"])){\n\n\t\t\t\t$tabla=\"usuarios\";\n\t\t\t$item=\"usuario\";\n\t\t\t$valor=$_POST[\"ingUsuario\"];\n\t\t\t$respuesta=ModeloUsuarios::MdlMostrarUsuarios($tabla,$item,$valor);\t\n\t\t\t //var_dump($respuesta[\"usuario\"]);\n\t\t\tif($respuesta[\"usuario\"]==$_POST[\"ingUsuario\"] && $respuesta[\"password\"]==$_POST[\"ingPassword\"]){\n\t\t\t\t$_SESSION[\"iniciarSesion\"]=\"ok\";\n\t\t\t\techo '<script>\n\t\t\t\twindow.location=\"inicio\";\n\t\t\t\t</script>';\n\t\t\t}else{\n\t\t\t\techo '<br><div class=\"alert alert-danger\">Error al ingresar, vuelva a intentarlo</div>';\n\t\t\t}\n\t\t}\n\t}\n }", "public function authenticate() {\r\n /*tomamos los 2 datos del from con el pass ya modificado*/\r\n $user = $this->input->post('email');\r\n $passever= md5($this->input->post('password'));\r\n /*cargamos el modelo y enviamos la consulta a la DB*/\r\n $this->load->model('User_model');\r\n $query = $this->User_model->authenticate($user, $passever); \r\n $row = $query->row_array();\r\n if (isset($row))\r\n {\r\n $user = array(\r\n 'id' => $row['id'],\r\n 'email' => $row['email'],\r\n 'password' => $row['password'],\r\n 'name' => $row['name'],\r\n 'tipo_usuario' => $row['tipo_usuario']\r\n ); \r\n $this->session->set_userdata('user', $user); \r\n if ($row['tipo_usuario']==1) {\r\n \r\n $this->load->view('Logueado/index');\r\n }else {\r\n $this->load->view('Logueado/indexuser');\r\n \r\n \r\n }\r\n } else \r\n { \r\n $data['error'] = \"Usuario o contraseña incorrecta, por favor vuelva a intentar\";\r\n $this->load->view('/Inicio/login',$data);\r\n }\r\n }", "private function crearUsuario(){\n \t\t#valida que la solicitud sea mediante un post \n\t if ($_SERVER['REQUEST_METHOD'] != \"POST\") {\n\t \t//envia un error \n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(1)), 405); \n\t }\n\t //valida que los datos a incorporar no sean vacios \n\t if (isset($this->datosPeticion['nombre'], $this->datosPeticion['email'], $this->datosPeticion['pwd'])){\n\t $nombre = $this->datosPeticion['nombre']; \n\t $pwd = $this->datosPeticion['pwd']; \n\t $email = $this->datosPeticion['email'];\n\n\t //valida la existemcia del usuario mediante el email \n\t if (!$this->existeUsuario($email)){ \n\t $query = $this->_conn->prepare(\n\t \t\"INSERT into usuario (nombre,email,password,fRegistro) \n\t \t VALUES (:nombre, :email, :pwd, NOW())\");\n\t //se le asignan los valores a las variables de la consulta \n\t $query->bindValue(\":nombre\", $nombre); \n\t $query->bindValue(\":email\", $email); \n\t $query->bindValue(\":pwd\", sha1($pwd)); \n\t $query->execute(); \n\t if ($query->rowCount() == 1){ // se inserto bien \n\t $id = $this->_conn->lastInsertId(); \n\t $respuesta['estado'] = 'correcto'; \n\t $respuesta['msg'] = 'usuario creado correctamente'; \n\t $respuesta['usuario']['id'] = $id; \n\t $respuesta['usuario']['nombre'] = $nombre; \n\t $respuesta['usuario']['email'] = $email; \n\t $this->mostrarRespuesta($this->convertirJson($respuesta), 200); \n\t } else //se envia un error de insercion en la bd\n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(7)), 400); \n\t } else //se envia un error del usuario no existe\n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(8)), 400); \n\t } else { \n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(7)), 400); \n\t } \n\t}", "static public function ctrIngresoUsuario(){\n\n\t\tif(isset($_POST[\"ingUsuario\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingUsuario\"]) &&\n\t\t\t preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingPassword\"])){\n\n\t\t\t\t$tabla = \"usuarios\";\n\n\t\t\t\t// $encriptar = crypt($_POST[\"ingPassword\"], '$2a$07$usesomesillystringforsalt$');\n\n\t\t\t\t$item = \"usu_descri\";\n\t\t\t\t$valor = $_POST[\"ingUsuario\"];\n\t\t\t\t$pass = $_POST[\"ingPassword\"];\n\n\t\t\t\t$respuesta = ModeloUsuarios::MdlMostrarUsuarios($tabla, $item, $valor);\n\n\t\t\t\t// var_dump($respuesta);\n\t\t\t\t// die();\n\n\t\t\t\tif($respuesta[\"usu_descri\"] == $_POST[\"ingUsuario\"] && $respuesta[\"clave\"] == $_POST[\"ingPassword\"])\n\t\t\t\t{\n\n\t\t\t\t\tif($respuesta['estado'] == 'A')\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$_SESSION[\"iniciarSesion\"] = \"ok\";\n\t\t\t\t\t\t$_SESSION[\"id\"] = $respuesta[\"id\"];\n\t\t\t\t\t\t// $_SESSION[\"nombre\"] = $respuesta[\"nombre\"];\n\t\t\t\t\t\t$_SESSION[\"usuario\"] = $respuesta[\"usu_descri\"];\n\t\t\t\t\t\t// $_SESSION[\"foto\"] = $respuesta[\"foto\"];\n\t\t\t\t\t\t// $_SESSION[\"perfil\"] = $respuesta[\"perfil\"];\n\n\t\t\t\t\t\techo '<script>\n\t\n\t\t\t\t\t\twindow.location = \"inicio\";\n\t\n\t\t\t\t\t\t</script>';\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 '<br><div class=\"alert alert-danger\">El usuario no esta activo, porfavor, comuniquese con el administrador</div>';\n\t\t\t\t\t}\n\n\t\t\t\t}else{\n\n\t\t\t\t\techo '<br><div class=\"alert alert-danger\">Error al ingresar, vuelve a intentarlo</div>';\n\n\t\t\t\t}\n\n\t\t\t}\t\n\n\t\t}\n\n\t}", "public function ctrIngresoUsuario(){\n\n\t\tif(isset($_POST[\"user01\"])){\n\n\t\t//\t if(preg_match('/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/', $_POST[\"ingresoEmail\"]) && preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingresoPassword\"])){\n\n\t\t\t \t//$encriptar = crypt($_POST[\"ingresoPassword\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n\t\t\t\t$encriptar = crypt($_POST[\"passwords01\"], '$2a$07$asxx54ahjppf17sd87a5a4dDDGsystemdevmybebe$');\n\n\t\t\t \t$tabla = \"genusuario\";\n\t\t\t \t$item = \"usunombre\";\n\t\t\t \t$valor = $_POST[\"user01\"];\n\n\t\t\t \t$respuesta = UserModel::mdlMostrarUsuarios($tabla, $item, $valor);\n\n\t\t\t\t//echo \"<pre>\".print_r($respuesta).\"</pre>\";\n\n\t\t\t \tif($respuesta[\"usunombre\"] == $_POST[\"user01\"] && $respuesta[\"usuclave\"] == $encriptar){\n\n\t\t\t \t\tif($respuesta[\"usuverific\"] == 0){\n\n\t\t\t \t\t\techo'<script>\n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\t\t \ttitle: \"¡ERROR!\",\n\t\t\t\t\t\t\t\t \ttext: \"¡El correo electrónico aún no ha sido verificado, por favor revise la bandeja de entrada o la carpeta SPAM de su correo electrónico para verificar la cuenta, o contáctese con nuestro soporte a info@valientesdigitales.com.co!\",\n\t\t\t\t\t\t\t\t \tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\t\t\tif(result.value){ \n\t\t\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t\t\t } \n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t</script>';\n\n\t\t\t\t\t\treturn;\n\n\t\t\t \t\t}else{\n\n\t\t\t \t\t\t$_SESSION[\"validarSesion\"] = \"ok\";\n\t\t\t \t\t\t$_SESSION[\"id\"] = $respuesta[\"oid\"];\n\n\t\t\t \t\t\t$ruta = RouteController::ctrRoute();\n\n\t\t\t \t\t\techo '<script>\n\t\t\t\t\t\n\t\t\t\t\t\t\twindow.location = \"'.$ruta.'backoffice\";\t\t\t\t\n\n\t\t\t\t\t\t</script>';\n\n\t\t\t \t\t}\n\n\t\t\t \t}else{\n\n\t\t\t \t\techo'<script>\n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\t \ttitle: \"¡ERROR!\",\n\t\t\t\t\t\t\t \ttext: \"¡El email o contraseña no coinciden!\",\n\t\t\t\t\t\t\t \tshowConfirmButton: true,\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\t\tif(result.value){ \n\t\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t\t } \n\t\t\t\t\t\t});\n\n\t\t\t\t\t</script>';\n\n\t\t\t \t}\n\n\n\t\t/*\t }else{\n\n\t\t\t \techo '<script>\n\n\t\t\t\t\tswal({\n\n\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\ttitle: \"¡CORREGIR!\",\n\t\t\t\t\t\ttext: \"¡No se permiten caracteres especiales en ninguno de los campos!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\n\t\t\t\t\t\t\thistory.back();\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\t\n\n\t\t\t\t</script>';\n\n\t\t\t }*/\n\n\t\t}\n\n\t}", "public function getUsuario(){\n $sql=\"SELECT id, tipo, tipo_identificacion, numero_identificacion, apellidos, nombres, razon_social, codigo, \n direccion, telefono1, telefono2, celular1, celular2, email1, email2, fecha_nacimiento, profesion, \n actividades, rol, fecha_registro, descripcion FROM ctk_usuario where estado=1\";\n //$sentencia=$this->conexion_db->prepare($sql);\n //$sentencia->execute(array());\n //$resultado=$sentencia->fetchAll(PDO::FETCH_ASSOC);\n //otra opcion \n //$resultado=$this->conexion_db->query($sql)->fetchAll(PDO::FETCH_ASSOC);\n $resultado=$this->conexion_db->query($sql)->fetchAll(PDO::FETCH_OBJ);\n //$sentencia->closeCursor();\n return $resultado;\n $this->conexion_db=null;\n \n //El ejemplo que se encuentra a continuacion realiza la consulta con la libreria mysqli\n /*\n $resultado=$this->conexion_db->query(\"SELECT codigo_ticket, abierto_por, fecha_apertura, fecha_cierre, \n descripcion_evento, tecnico_ctk FROM ctk_ticket WHERE tecnico_ctk='\".$buscar.\"'\");\n $ticket=$resultado->fetch_all(MYSQLI_ASSOC);\n return $ticket;\n */\n }", "public function readUsuarios()\n\t{\n\t\t$sql = 'SELECT IdRol, Nombre, Apellido, Telefono, Email, u.IdEstado, IdUsuario \n FROM usuarios u ORDER BY Apellido';\n\t\t$params = array(null);\n\t\treturn Database::getRows($sql, $params);\n\t}", "function validatedLogin($email,$contra){\n $query = \"SELECT\n id_usuario,\n nombre,\n apellidoP,\n apellidoM,\n email,\n fechaNac,\n nombreRol,\n valuePermission\n FROM\n usuario\n LEFT JOIN(rol) ON usuario.rol_id = rol.id_rol\n WHERE\n usuario.email = \".$this->db->escape($email).\" AND\n pass = \".$this->db->escape($contra).\"\n \";\n return $this->db->query($query);\n }", "public function usuariosActivos(){\n\t\t\n\t\t$resultado = array();\n\t\t\n\t\t$query = \"SELECT idUsuario, identificacion, nombre, apellido FROM tb_usuarios WHERE estado = 'A' AND agenda = 'Si'\";\n\t\t\n\t\t$conexion = parent::conexionCliente();\n\t\t\n \tif($res = $conexion->query($query)){\n \n /* obtener un array asociativo */\n while ($filas = $res->fetch_assoc()) {\n $resultado[] = $filas;\n } \n \n }//fin if\n\t\t\n return $resultado;\t\t\t\n\t\t\n\t}", "public function telaCadastroUsuario():void {\n $session =(Session::get('USER_AUTH'));\n if (!isset($session)) {\n $this->view('Home/login_viewer.php');\n }\n elseif ((int) Session::get('USER_ID')!==1) {\n Url::redirect(SELF::PAINEL_USUARIO);\n }\n else {\n $this->cabecalhoSistema();\n $this->view('Administrador/usuario/formulario_cadastro_usuario_viewer.php');\n $this->rodapeSistema();\n }\n }", "public function getCuentaUsuario(){\n return $this->cuentaUsuario;\n }", "static public function ctrLoginUser(){ \n\t\t\tif(isset($_POST[\"ingUser\"])){\n\t\t\t\t//Intento de Logeo\n\t\t\t\tif((preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingUser\"]))\n\t\t\t\t && (preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingPassword\"]))){\n\t\t\t\t\t\t$tabla = \"usuarios\";\t//Nombre de la Tabla\n\n\t\t\t\t\t\t$item = \"usuario\";\t\t//Columna a Verficar\n\t\t\t\t\t\t$valor = $_POST[\"ingUser\"];\n\n\t\t\t\t\t\t//Encriptar contraseña\n\t\t\t\t\t\t$crPassword = crypt($_POST[\"ingPassword\"], '$2a$08$abb55asfrga85df8g42g8fDDAS58olf973adfacmY28n05$');\n\n\t\t\t\t\t\t$respuesta = ModelUsers::mdlMostrarUsuarios($tabla, $item, $valor);\n\n\t\t\t\t\t\tif($respuesta[\"usuario\"] == $_POST[\"ingUser\"]\n\t\t\t\t\t\t\t&& $respuesta[\"password\"] == $crPassword){\n\t\t\t\t\t\t\t\tif($respuesta[\"estado\"] == '1'){\n\t\t\t\t\t\t\t\t\t//Coincide \n\t\t\t\t\t\t\t\t\t$_SESSION[\"login\"] = true;\n\t\t\t\t\t\t\t\t\t//Creamos variables de Sesion\n\t\t\t\t\t\t\t\t\t$_SESSION[\"user\"] = $respuesta;\n\t\t\t\t\t\t\t\t\t//Capturar Fecha y Hora de Login\n\t\t\t\t\t\t\t\t\tdate_default_timezone_set('America/Mexico_City');\n\t\t\t\t\t\t\t\t\t$fechaActual = date('Y-m-d H:i:s');\n\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t$item1 = \"ultimo_login\";\n\t\t\t\t\t\t\t\t\t$valor1 = $fechaActual;\n\t\t\t\t\t\t\t\t\t$item2 = \"id_usuario\";\n\t\t\t\t\t\t\t\t\t$valor2 = $respuesta[\"id_usuario\"];\n\n\t\t\t\t\t\t\t\t\t$ultimoLogin = ModelUsers::mdlActualizarUsuario($tabla, $item1, $valor1, $item2, $valor2);\n\n\t\t\t\t\t\t\t\t\tif($ultimoLogin)\t//Redireccionando\n\t\t\t\t\t\t\t\t\t\techo '<script>location.reload(true);</script>';\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\techo '<br><div class=\"alert alert-danger\">El usuario no esta activado</div>';\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\techo '<br><div class=\"alert alert-danger\">Error al ingresar, vuelve a intentarlo</div>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}", "private function consultar_usuario_por_id() {\n\n if (is_numeric($this->referencia_a_buscar)) {\n $id_a_buscar = intval($this->referencia_a_buscar);\n $sentencia = \"select id,nombrecompleto ,correo,token from usuario u where u.id= {$id_a_buscar};\";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n } else {\n $this->respuesta = null;\n }\n }", "public function getUsuario() {\n return $this->iUsuario;\n }", "public function getUserData(){\n try {\n $user = auth()->user();\n $us=new User();\n if($us->validaEmpresaActiva($user->id_emp)){\n $us=new User();\n $usuario=$us->getUserInfo($user->id);\n return response()->json($usuario);\n }else{\n return response()->json(false);\n }\n } catch (\\Exception $e) {\n return response()->json(\"Error: \".$e);\n }\n }", "public function authenticate()\n\t{\n\t\t\n\t\t$username=strtolower($this->username);\n\t\t// aca deber�a agregar la condici�n de activo\n\t\t $user=Usuario::model()->find('LOWER(nombre)=? and estado=1',array($username));\n\t\t if($user===null)\n\t\t\t$this->errorCode=self::ERROR_USERNAME_INVALID;\n\t\t else if(!$user->validatePassword($this->password))\n\t\t\t$this->errorCode=self::ERROR_PASSWORD_INVALID;\n\t\t else\n\t\t {\n\t\t\t$this->_id=$user->id;\n\t\t\t$this->username=$user->nombre; \n //si el estado es 0 le muestro un cartel avisando que debe completar sus datos sino se bloqueará\n /* if($user->estado==0 && !isset($_GET['act']))\n Yii::app()->user->setFlash(\"warning\",\"Debe completar sus datos personales sino su cuenta será deshabilitada.<br>\n \".CHtml::link('Completar',array('site/completarRegistro','act'=>$user->hash_activacion)));*/\n\t\t\t$this->errorCode=self::ERROR_NONE;\n\t\t }\n\treturn $this->errorCode==self::ERROR_NONE;\n\t}", "public function toUser($data){\n\t\t\t$this->email=$data['email'];\n\t\t\t$this->password=$data['password'];\n\t\t\t$this->nombre=$data['nombre'];\n\t\t\t$this->apellido=$data['apellido'];\n\t\t}", "public function getUsuario()\n {\n return $this->usuario;\n }", "public function updatedUsuario()\n {\n // Notificamos al otro componente el cambio\n $this->emit('cambioUsuario', $this->usuario);\n }", "public function login (){\n\n $dao = DAOFactory::getUsuarioDAO(); \n $GoogleID = $_POST['GoogleID']; \n $GoogleName = $_POST['GoogleName']; \n $GoogleImageURL = $_POST['GoogleImageURL']; \n $GoogleEmail = $_POST['GoogleEmail'];\n $usuario = $dao->queryByGoogle($GoogleID); \n if ($usuario == null){\n $usuario = new Usuario();\n $usuario->google = $GoogleID;\n $usuario->nombre = $GoogleName;\n $usuario->avatar = $GoogleImageURL;\n $usuario->correo = $GoogleEmail;\n print $dao->insert($usuario);\n $_SESSION[USUARIO] = serialize($usuario);\n //$usuario = unserialize($_SESSION[USUARIO]);\n } else {\n $_SESSION[USUARIO] = serialize($usuario);\n }\n }", "public function getUsuario()\r\n {\r\n return $this->usuario;\r\n }", "private function getListaUsuarioAutorizado()\r\n\t {\r\n\t \treturn [\r\n\t \t\t'adminteq',\r\n\t \t\t'pfranco',\r\n\t \t\t'kperez',\r\n\t \t];\r\n\t }", "public function actualizarUsuario()\n {\n //quitamos el id del array y lo guardamos a parte\n $datos = $_POST;\n $ciu = isset($datos['CIU']) ? $datos['CIU'] : $this->session->userdata(\"ciu\");\n unset($datos['CIU']);\n\n //miramos si ha enviado imagen de perfil. de ser asi se procesa en otro metodo aparte y se quita del array\n if (isset($datos['img'])) {\n self::actualizarImagenPerfil($datos['img']);\n unset($datos['img']);\n }\n\n echo $this->Usuarios_model->actualizarUsuario($ciu, $datos);\n }", "public function login($datos)\n {\n $stmt = Conexion::conectar()->prepare('SELECT *from usuarios WHERE nombre_usuario=:correo && password=:contrasena');\n $stmt->bindParam(\":correo\", $datos[\"correo\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":contrasena\", $datos[\"contrasena\"] , PDO::PARAM_STR);\n if($stmt->execute())\n {\n $respuesta = $stmt->rowCount();\n $resultado =$stmt->fetch();\n //Si el resultado returna mayor que uno es que si existe el usuario asi que inicia la sesion\n if($resultado[\"count(*)\"]>0)\n {\n return \"Datos no validos\";\n }else\n {\n session_start();\n $_SESSION[\"correo\"]=$resultado[\"correo\"];\n $_SESSION[\"nombre\"]=$resultado[\"nombre\"];\n return \"Correcto\";\n }\n\n \n }else\n {\n return \"error\";\n }\n }", "static public function getUsuario_credencial() {\n try {\n $sql = 'SELECT usuario_credencial.id, usuario_credencial.usuario_id, usuario_credencial.credencial_id FROM usuario_credencial';\n return dataBaseClass::getInstance()->query($sql)->fetchAll(PDO::FETCH_ASSOC);\n } catch (PDOException $e) {\n return $e;\n }\n }", "function login_user($user,$pass,$activo=false,$h=false){\n $c = ($h)?$pass:md5($pass);\n $sql = sprintf(\"SELECT * FROM `login` WHERE `email` = %s AND `contrasena` = %s AND `cloud` = %s LIMIT 1\",\n varSQL($user),\n varSQL($c),\n varSQL(__sistema));\n $datos = consulta($sql,true);\n if($datos != false){\n $_SESSION['usuario'] = $datos['resultado'][0]['id'];\n $_SESSION['session_key']= md5($pass);\n //obtener los datos adicionales del usuario en cuestion de acuerdo al perfil de usuario que pertenesca\n $sql = sprintf(\"SELECT * FROM `%s` WHERE `id_login` = %s\",(obtener_campo(sprintf(\"SELECT `tabla` FROM `usuarios_perfiles_link` WHERE `id_perfil` = %s\",varSQL($datos['resultado'][0]['perfil'])))),varSQL($datos['resultado'][0]['id']));\n $datos1 = consulta($sql,true);\n if($datos1!=false){\n unset($datos1['resultado'][0]['id']);\n $d = array_merge($datos['resultado'][0],$datos1['resultado'][0]);\n $_SESSION['data_login'] = $d;\n }else{\n $_SESSION['data_login'] = $datos['resultado'][0];\n }\n //obteniendo los detalles de los modulos disponibles para cada usuario\n $con = sprintf(\"SELECT * FROM `componentes_instalados` WHERE `id` IN(SELECT `id_componente` FROM `usuarios_perfiles_permisos` WHERE `id_perfil` = %s)\",varSQL($datos['resultado'][0]['perfil']));\n $r = consulta($con,true);\n //detalles del perfil\n $p = consulta(sprintf(\"SELECT `nombre`,`p` FROM `usuarios_perfiles` WHERE `id` = %s\",varSQL($datos['resultado'][0]['perfil'])),true);\n $_SESSION['usuario_perfil'] = $p['resultado'][0];\n $_SESSION['usuario_componentes'] = $r['resultado'];\n $detalles = array(\"estado\"=>\"ok\",\"detalles\"=>\"\");\n }else{\n $_SESSION['usuario']='';\n $_SESSION['session_key']='';\n $detalles = array(\"estado\"=>\"error\",\"detalles\"=>\"no_log_data\",\"mensaje\"=>\"Nombre de usuario o contrase&ntilde;a incorrecta\");\n }\n return $detalles;\n}", "private function consultar_usuario_por_nombre() {\n $sentencia = \"select id,nombrecompleto ,correo,token \"\n . \"from usuario u where u.nombrecompleto ilike '%{$this->referencia_a_buscar}%'; \";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n }", "public function auth(){\n return response()->json($this->usuario->api_Auth());\n }", "public function logUser(){\r\n\t\t$email = $_POST['login_email'];\r\n\t\t$password = $_POST['login_password'];\r\n\r\n\t\t$sql = \"SELECT * FROM users where email = ? and password = ? \";\r\n\t\t$query = $this->db->prepare($sql);\r\n\t\t$query->execute([$email,$password]);\r\n\t\t//rezultat smestamo u promenljivu loggedUser i stavljamo samo fetch zzbog toga sto vraca jedan rezultat\r\n\r\n\t\t$loggedUser = $query->fetch(PDO::FETCH_OBJ);\r\n\r\n\t\tif ($loggedUser != NULL) {\r\n\t\t\t//dodeljujemo sesiji celog usera (OBJEKAT)\r\n\t\t\t$_SESSION['loggedUser'] = $loggedUser;\r\n\t\t\t//ovde dodeljujemo usera iz baze varijabli login_result!!!\r\n\t\t\t$this->login_result = $loggedUser;\r\n\t\t}\r\n\t}", "function getAllUsuarios(){\n\t\t\tDB_DataObject::debugLevel(0);\n\t\t\t$obj = DB_DataObject::Factory('VenUsuario');\n\t\t\t$obj->find();\n\t\t\t$i = 0;\n\t\t\t$data='';\n\t\t\twhile($obj->fetch()){\n\t\t\t\t$data[$i]['idUsuario']=$obj->idUsuario;\n\t\t\t\t$data[$i]['idCargo']=$obj->idCargo;\n\t\t\t\t$nombreCargo=$this->getCargoById($obj->idCargo);\n\t\t\t\t$nombreCargo=utf8_encode($nombreCargo['nombre']);\n\t\t\t\t$data[$i]['cargo']= $nombreCargo;\n\t\t\t\t$data[$i]['nombre']=utf8_encode($obj->nombre);\n\t\t\t\t$data[$i]['apellido']=utf8_encode($obj->apellido);\n\t\t\t\t$data[$i]['email']=$obj->email;\n\t\t\t\t$data[$i]['usuario']=utf8_encode($obj->usuario);\n\t\t\t\t$data[$i]['contrasena']=utf8_encode($obj->contrasena);\n\t\t\t\t$data[$i]['puntos']=$obj->puntos;\n\t\t\t\t$data[$i]['estado']=$obj->estado;\n\t\t\t\t$data[$i]['fechaMod']=$obj->fechaMod;\n\t\t\t\t$data[$i]['fecha']=$obj->fecha;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$obj->free();\n\t\t\t//printVar($data,'getAllUsuarios');\n\t\t\treturn $data;\n\t\t}", "private function preAddUser(){\n $LMS = new LMS();\n $api = $LMS->getDataXUserPass($this->_user, $this->_pass, 'https://www.sistemauno.com/source/ws/uno_wsj_login.php');\n $this->_person = \"\";\n if ($this->isObjectAPI($api)) {\n //validar Permisos\n $FilterAPI = new FilterAPI($api);\n $this->_datPerson = $FilterAPI->runFilter($this->_user, $this->_pass);\n if (is_array($this->_datPerson)) {\n //si el usuario cuenta con un perfil apropiado se le pide que valide sus coreo\n $this->validateEmailUser();\n if($this->validUniqueMail()){\n $this->sendMail();\n $this->_response = \"1|\" . $this->_datPerson[email] . \"|\" . $this->_datPerson[personId] . \"|\" . $this->_code . \"|\" . $this->_datPerson['name'];\n }else{\n $this->_response = \"2|\" . $this->_datPerson[email] . \"|\" . $this->_datPerson[personId] . \"|\" . $this->_code . \"|\" . $this->_datPerson['name'];\n }\n } else {\n $this->_response = $this->_datPerson;\n }\n } else {\n $this->_response = $api;\n }\n }", "function cadastrarUser(){\n //$this->session->set_tempdata('erro-acesso', 'login e senha n&atilde;o correspondem!', 5);\n\t \n\t\t/*$verificarUser = $this->login->get_verificar_user('sytesraul', '513482am');\n\t\tif($verificarUser != null) :\n\t\t\techo \"USUARIO JA CADASTRADO \".$verificarUser->name_login;\n\t\tendif;*/\n\t //redirect('login/acessoAceito', 'refresh');\n\t \n\t\t$dados['titulo'] = 'Cadastrar Usuário';\n\t\t$dados['h2'] = 'Tela de Cadastro';\n\t\t$this->load->view('login/cadastrar_user_view', $dados);\n\t\t\n\t\t\n\t}", "public function Listar()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$result = array();\n\n\t\t\t$stm = $this->pdo->prepare(\"SELECT usuario.`correo`, `usuario`.`clave`, `rol`.`nomRol`, `datospersonales`.`Documento`\nFROM `usuario`\nLEFT JOIN `rol` ON `rol`.`nomRol` = `usuario`.`nomRol` \nLEFT JOIN `datospersonales` ON `datospersonales`.`Documento` = `usuario`.`Documento`\n WHERE correo is not null \");\n\t\t\t$stm->execute();\n\n\t\t\tforeach($stm->fetchAll(PDO::FETCH_OBJ) as $r)\n\t\t\t{\n\t\t\t\t$usu = new Usuario();\n\n\t\t\t\t$usu->__SET('correo', $r->correo);\n\t\t\t\t$usu->__SET('clave', $r->clave);\n\t\t\t\t$usu->__SET('nomRol', $r->nomRol);\n\t\t\t\t$usu->__SET('Documento', $r->Documento);\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t$result[] = $usu;\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tdie($e->getMessage());\n\t\t}\n\t}", "public function authCliente(Request $data){\n //dd(\"jano\");\n try{\n \n $verificar = User::where('email', $data->correo)->first();\n\n\n if(count($verificar)>0 && $verificar->id_rol == 4){ /**\"eres vendedor institucional\"**/\n \n if (\\Auth::attempt(['email' => $data->correo, 'password' => $data->pass])) {\n \n return redirect('/inicio_cliente'); \n }\n return redirect()->back()->withErrors(['datos incorrectos, intente nuevamente']);\n }\n return redirect()->back();\n }catch (\\Illuminate\\Database\\QueryException $e) {\n return redirect()->back()->withErrors(['Algo no anda bien, posiblemente datos mal ingresados o no hay conexión']);\n } \n\n }", "function obtenerUsuarios(){\n //Variable que almacena la consulta sql\n $sql = \"select login,Alias\n \t\t\tfrom ENTREGA\";\n\t\t//se ejecuta la query\n $resultado = $this->mysqli->query( $sql );\n if ( $resultado->num_rows == 0 ) { return null; }//miramos si el número de filas es 0.\n //Caragamos las tuplas resultado de la consulta en un array\n while($datos = mysqli_fetch_row ($resultado)){\n //Variable que almacena el array de las tuplas resultado de la query\n $miarray[] = $datos;\n }\n return $miarray;\n }", "public function actualizaSoloUsuario($dataArray){\n //deleted, created_at y updated_at son comunes, pero estos jamas se actualizaran por acá\n if (array_key_exists('password',$dataArray))\n $dataArray['password'] = bcrypt($dataArray['password']);\n \n $this->model->update($dataArray); //set data only in its PersonaNatural model\n }", "public function getUsuario()\n {\n return $this->usuario;\n }", "public function getUsuario()\n {\n return $this->usuario;\n }", "public function getUsuario()\n {\n return $this->usuario;\n }", "public function getUsuario()\n {\n return $this->usuario;\n }", "public function getUsuario( ){\n\t\t \treturn $this->usuario;\n\t\t }", "function fetchUsuario() {\n\n $usuarios = array();\n\n $con = new DB();\n $sql = $con->prepare(\"SELECT * FROM usuario\");\n $result = $con->executeQuery($sql);\n\n foreach ($result as $row) {\n $id = $row['id'];\n $username = $row['username'];\n $password = $row['password'];\n $email = $row['email'];\n $poblacion = $row['poblacion'];\n $idioma = $row['idioma'];\n $telefono = $row['telefono'];\n $url = $row['url'];\n $foto = $row['foto'];\n $textoPresentacion = $row['textoPresentacion'];\n $administrador = $row['esAdministrador'];\n $registrado = $row['esUsuarioRegistrado'];\n $professional = $row['esUsuarioProfesional'];\n $usuario = new Usuario($id, $username, $password, $email, $poblacion, $idioma, $telefono, $url, $foto, $textoPresentacion, $administrador, $registrado, $professional);\n array_push($usuarios, $usuario);\n }\n\n return $usuarios;\n }", "public function getUsuarios ():array {\n $tuser = [];\n $this->stmt_usuarios->setFetchMode(PDO::FETCH_CLASS, 'Usuario');\n \n if ( $this->stmt_usuarios->execute() ){\n while ( $user0 = $this->stmt_usuarios->fetch()){\n $tuser[]= $user0;\n }\n }\n return $tuser;\n }", "public static function getConnexionData()\n {\n return SessionUser::getAll();\n }", "public static function obtenerUsuarios()\n {\n $consulta = \"SELECT * FROM usuarios, usuarios_roles WHERE (usuarios.rol=usuarios_roles.id_rol) ORDER BY usuarios.nombres ASC\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }", "public function usuarioActual()\n {\n return $this->entregaActual->usuario ?? NULL;\n }", "static public function ctrIngresoUsuario()\n {\n\n if (isset($_POST['ingEmail'])) {\n if (\n preg_match('/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/', $_POST[\"ingEmail\"]) &&\n preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingPassword\"])\n ) {\n\n\n $encriptar = crypt($_POST[\"ingPassword\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n $tabla = \"usuarios\";\n $item = \"email\";\n $valor = $_POST[\"ingEmail\"];\n\n $respuesta = ModeloUsuarios::mdlMostrarUsuario($tabla, $item, $valor);\n\n /*Validacion junto con la BD*/\n if ($respuesta[\"email\"] == $_POST[\"ingEmail\"] && $respuesta[\"password\"] == $encriptar) {\n //validacion con la BD si ya esta verficado el email\n if ($respuesta['verificacion'] == 1) {\n echo '<script> \n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t title: \"¡NO HA VERIFICADO SU CORREO ELECTRONICO!\",\n\t\t\t\t\t\t\t\t text: \"¡Por favor revise la bandeja de entrada o la carpeta de SPAM, para verifcar la direccion de correo electronico ' . $_POST[\"ingEmail\"] . '\" ,\n\t\t\t\t\t\t\t\t type:\"error\",\n\t\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t closeOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction (isConfirm){\n\t\t\t\t\t\t\t if(isConfirm){\n\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t }\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t</script>';\n } else {\n\n /*Variables de sesion*/\n\n @session_start();\n $_SESSION['validarSesion'] = 'ok';\n $_SESSION['id'] = $respuesta['id'];\n $_SESSION['nombre'] = $respuesta['nombre'];\n $_SESSION['foto'] = $respuesta['foto'];\n $_SESSION['email'] = $respuesta['email'];\n $_SESSION['password'] = $respuesta['password'];\n $_SESSION['modo'] = $respuesta['modo'];\n\n //Utilizando del local storgae, alcenamos la ruta, para cuando inicie sesion, sea redireccionado hacia la ruta\n echo '\n <script> \n window.location = localStorage.getItem(\"rutaActual\");\n </script>\n ';\n\n\n }\n } else {\n echo '<script> \n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t title: \"¡ERROR AL INGRESAR!\",\n\t\t\t\t\t\t\t\t text: \"¡Por favor revise el correo electronico, o la contraseña\" ,\n\t\t\t\t\t\t\t\t type:\"error\",\n\t\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t closeOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction (isConfirm){\n\t\t\t\t\t\t\t if(isConfirm){\n\t\t\t\t\t\t\t window.location = localStorage.getItem(\"rutaActual\");\n\t\t\t\t\t\t\t }\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t</script>';\n }\n\n\n } else {\n echo '<script> \n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t title: \"¡ERROR!\",\n\t\t\t\t\t\t\t\t text: \"¡Error al ingresar al sistema, no se permiten caracteres especiales\",\n\t\t\t\t\t\t\t\t type:\"error\",\n\t\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t closeOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction (isConfirm){\n\t\t\t\t\t\t\t if(isConfirm){\n\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t }\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t</script>';\n }\n }\n\n\n }", "function adicionaUsuario() {\n $usuarioAtual = array(\n \"usuario\"=>$this->usuario,\n \"senha\"=>$this->senha,\n \"nome\"=>$this->nome,\n \"email\"=>$this->email\n );\n\n $usuarioAtual_str = json_encode($usuarioAtual);\n\n //retira o colchete e coloca a vírgula no arquivo\n $arquivo_str = file_get_contents(\"data/usuarios.json\");\n $arquivo_str_novo = str_replace(\"]\", \",\", $arquivo_str);\n\n //abre o arquivo\n $usuarios = fopen(\"data/usuarios.json\", \"w\"); //sobreescreve\n fwrite($usuarios, $arquivo_str_novo . $usuarioAtual_str . \"]\");\n fclose($usuarios);\n }", "function verificaLogin($errores,$db) {\r\n $email=$_POST['email'];\r\n $password=$_POST['password'];\r\n $encontreUsuario=false;\r\n $encontrePassword=false;\r\n $stmt=$db->prepare(\"SELECT * FROM jugadores where email=:email\");\r\n $stmt->bindValue(':email',$email);\r\n $stmt->execute();\r\n $consulta=$stmt->fetch(PDO::FETCH_ASSOC);\r\n if($consulta>0){\r\n $encontreUsuario=true;\r\n $contraseniaValida=password_verify($password,$consulta['password']);\r\n if($contraseniaValida){\r\n $_SESSION['usuario']=$consulta['usuario'];\r\n $_SESSION['nombre']=$consulta['name'];\r\n $_SESSION['previoLogueo']=false;\r\n $encontrePassword=true;\r\n header('Location: bienvenida.php');\r\n if(empty($errores)){\r\n if (!empty($_POST[\"guardar_clave\"])){\r\n setcookie(\"email\", $_POST['email'], time() + 365 * 24 * 60 * 60);\r\n echo $_COOKIE['email'];\r\n setcookie(\"password\", $_POST['password'], time() + 365 * 24 * 60 * 60);\r\n }\r\n else {\r\n if(isset($_COOKIE['email'])){\r\n setcookie('email',\"\");\r\n }\r\n if(isset($_COOKIE['password'])){\r\n setcookie('password',\"\");\r\n }\r\n }\r\n }\r\n }\r\n else{\r\n $errores[]=\"Verifique los datos\";\r\n return $errores;\r\n }\r\n }\r\n else {\r\n $errores[]=\"No existe el usuario\";\r\n return $errores;\r\n }\r\n /*foreach ($usuarioJSON as $usuario)\r\n {\r\n if ($usuario[\"email\"] == $_POST['email']){\r\n $encontreUsuario=true;\r\n //\r\n if(password_verify($_POST[\"password\"], $usuario[\"password\"])){\r\n $_SESSION['usuario']=$usuario['usuario'];\r\n $_SESSION['nombre']=$usuario['name'];\r\n $_SESSION['previoLogueo']=false;\r\n $encontrePassword=true;\r\n header('Location: bienvenida.php');\r\n if(empty($errores)){\r\n if (!empty($_POST[\"guardar_clave\"])){\r\n setcookie(\"email\", $_POST['email'], time() + 365 * 24 * 60 * 60);\r\n echo $_COOKIE['email'];\r\n setcookie(\"password\", $_POST['password'], time() + 365 * 24 * 60 * 60);\r\n }\r\n else {\r\n if(isset($_COOKIE['email'])){\r\n setcookie('email',\"\");\r\n }\r\n if(isset($_COOKIE['password'])){\r\n setcookie('password',\"\");\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if($encontreUsuario!=true){\r\n array_push($errores,'Por Favor verifique el nombre de usuario');\r\n }\r\n if ($encontrePassword!=true) {\r\n array_push($errores,'Contraseña incorrecta');\r\n }\r\n return $errores;*/\r\n}", "function abmUsuarios()\n {\n $this->checkCredentials();\n $users = $this->modelUser->getAllUsers();\n $this->view->showAbmUsuarios($users);\n }", "public function loginUser($user,$pwd){\n \n $pwdCr = mkpwd($pwd);\n \n \n \n $sql = new Sql();\n $userData = $sql->select('SELECT * FROM usuarios \n WHERE email_usuario = :email_usuario\n AND pwd_usuario = :pwd_usuario',array(':email_usuario'=>$user,':pwd_usuario'=>$pwdCr));\n \n if(!isSet($userData) || count($userData)==0){//CASO NADA RETORNADO\n return false;\n }elseif(count($userData)>0){//CASO DADOS RETORNADOS CONFERE O STATUS\n \n if($userData[0]['status_usuario']==0){\n \n return 0;//caso INATIVO entao retorna ZERO indicando cadastro NAO ATIVO\n \n }elseif($userData[0]['status_usuario']==1){//CASO USUARIO ATIVO GERA SESSION DO LOGIN\n \n \n //permissao do cliente\n $_SESSION['_uL'] = encode($userData[0]['permissao_usuario']);\n $_SESSION['logado'] = 'sim';\n \n //dados do usuario\n $_SESSION['_iU'] = encode($userData[0]['id_usuario']);\n $_SESSION['_iE'] = encode($userData[0]['id_empresa']);\n $_SESSION['_nU'] = encode($userData[0]['nome_usuario'] . ' ' . $userData[0]['sobrenome_usuario']);\n $_SESSION['_eU'] = encode($userData[0]['email_usuario']);\n \n return 1;\n }\n \n }\n \n \n }", "public function loginUsers($data) {\n try {\n $sql = \"SELECT usua_cedula, usua_contrasena FROM usuario WHERE usua_cedula = ?\";\n $query = $this->pdo->prepare($sql);\n $valid = $query->execute(array($data[0]));\n $valid= $query->fetch();\n\n if (password_verify($data[1], $valid[1])) { // Condicional para validar contrasena si es igual\n $sql1 = \"SELECT u.usua_id, CONCAT(UPPER(LEFT(u.usua_nombre1, 1)), LOWER(SUBSTRING(u.usua_nombre1,2))) AS usua_nombre1, u.usua_nombre2, CONCAT(UPPER(LEFT(u.usua_apellido1, 1)), LOWER(SUBSTRING(u.usua_apellido1,2))) AS usua_apellido1, u.usua_apellido2, u.usua_cedula, u.carg_id,\n u.usua_contrasena, u.clien_id, u.usua_estado, u.usua_modifica, u.usua_ingreso, u.sed_id, u.area_id\n FROM usuario AS u\n WHERE usua_cedula = ? \";\n $query = $this->pdo->prepare($sql1);\n $const= $query->execute(array($data[0]));\n $const= $query->fetch();\n\n if ($const[9] === \"1\" && $const[11] === \"1\") {\n session_start(); // Variables para iniciar session\n $_SESSION[\"validar\"] = true;\n $_SESSION[\"nombre\"] = $const[1];\n $_SESSION[\"apellido\"] = $const[3];\n $_SESSION[\"idusuario\"] = $const[0];\n $_SESSION[\"cargo\"] = $const[6];\n $_SESSION[\"idcliente\"] = $const[8];\n $_SESSION[\"sede\"] = $const[12];\n return true;\n }else if ($const[11] === \"0\" && $const[9] === \"1\"){\n session_start(); // Variables para iniciar session\n $_SESSION[\"cedula\"] = $const[5];\n return \"successpassword\";\n }\n }else {\n return \"authentication\";\n }\n\n } catch (Exception $e) {\n die($e->getMessage());\n }\n\n }", "function usuario($usuario) {\r\n $u = $this->consultar($usuario);\r\n $p = $this->perfil($u[\"perfil\"]);\r\n return(array_merge($u, $p));\r\n }", "public function authenticate() {\n /* Valido que el usuario exista */\n\n $valido_usuario = Users::model()->find(array(\n 'select' => 'count(*) as id',\n 'condition' => 'username = :username',\n 'params' => array(':username' => $this->username)\n ));\n if ($valido_usuario->id == 1) {\n /* Si existe el usuario consulto el usuario con su password */\n\n $valido_clave = Users::model()->find(array(\n 'select' => 'count(*) as id',\n 'condition' => 'username = :username AND password = :password',\n 'params' => array(':username' => $this->username, ':password' => $this->password)\n ));\n\n if ($valido_clave->id == 1) {\n\n $sql = new CDbCriteria();\n\n $sql->params = array(':username' => $this->username, ':password' => $this->password);\n $sql->condition = 'username = :username AND password = :password';\n\n $model = Users::model()->find($sql);\n\n $sql->with = array('rol', 'statusUser');\n\n\n $consulto_usuario = Users::model()->find($sql);\n\n if ($consulto_usuario->status_user_id == 1) {\n\n $this->setState('id', $consulto_usuario->id);\n $this->setState('rol', $consulto_usuario->rol_id);\n $this->errorCode = self::ERROR_NONE;\n\n /* Usuario Activo Procedo a crear la Session */\n } elseif ($consulto_usuario->status_user_id == 2) {\n /* Usuario Inactivo */\n Yii::app()->user->setFlash('alert-danger', \"Usuario \" . @$consulto_usuario->statusUser->name);\n $this->errorCode = self::ERROR_PASSWORD_INVALID;\n } elseif ($consulto_usuario->status_user_id == 3) {\n /* Usuario Bloqueado */\n Yii::app()->user->setFlash('alert-danger', \"Usuario \" . @$consulto_usuario->statusUser->name);\n $this->errorCode = self::ERROR_PASSWORD_INVALID;\n } elseif ($consulto_usuario->status_user_id == 4) {\n /* Usuario Suspendido */\n Yii::app()->user->setFlash('alert-danger', \"Usuario \" . @$consulto_usuario->statusUser->name);\n $this->errorCode = self::ERROR_PASSWORD_INVALID;\n } elseif ($consulto_usuario->status_user_id == 5) {\n /* Usuario debe validar Email */\n Yii::app()->user->setFlash('alert-danger', \"Su usuario debe activarlo confirmando en su correo electronico \");\n $this->errorCode = self::ERROR_PASSWORD_INVALID;\n }\n } else {\n /* CONTRASEÑA ERRADA */\n Yii::app()->user->setFlash('alert-danger', \"Contraseña Errada\");\n $this->errorCode = self::ERROR_PASSWORD_INVALID;\n }\n } else {\n /* NO EXISTE USUARIO' */\n Yii::app()->user->setFlash('alert-danger', \"Usuario no existe\");\n $this->errorCode = self::ERROR_PASSWORD_INVALID;\n }\n\n return !$this->errorCode;\n }", "function getUsuario($id){\n $conex=Conexion::getInstance();\n $sql=\"SELECT * FROM usuarios where usuarios.id=$id\";\n // Especificamos el fetch mode antes de llamar a fetch()\n $stmt = $conex->dbh->prepare($sql);\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n // Excecute\n $stmt->execute();\n // solo hay uno o ninguno\n $row = $stmt->fetch();\n if (!$row) {\n $oferta=NULL;\n }\n else {\n \n $oferta=['id'=> $row['id'],'usuario'=>$row['usuario'],'nombre'=>$row['nombre'],\n 'admin'=>$row['admin'], 'password'=>$row['password']];\n }\n return $oferta;\n}", "static public function ctrIngresoUsuario(){\n\t\t\n\t\tif (isset($_POST['user']) && isset($_POST['pass'])) {\n\t\t\tif (preg_match('/^[a-zA-Z-0-9 ]+$/', $_POST['user'])) {\n\t\t\t\tswitch ($_POST['rol']) {\n\t\t\t\t\tcase 'Encargado':\n\t\t\t\t\t\t$answer = adminph\\Attendant::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Propietario':\n\t\t\t\t\t\t$answer = adminph\\Propietary::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Arrendatario':\n\t\t\t\t\t\t$answer = adminph\\Lessee::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$answer = adminph\\User::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$password = $_POST[\"pass\"];\n\t\t\t\tif (is_object($answer)) {\n\t\t\t\t\tif (password_verify($password,$answer->password) ) {\n\t\t\t\t\t\tif ($answer->state == 1) {\n\t\t\t\t\t\t\tif ($_POST['rol'] == 'Otro') {\n\t\t\t\t\t\t\t\tsession(['rank' => $answer->type]);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tsession(['rank' => $_POST['rol']]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsession(['user' => $answer->username]);\n\t\t\t\t\t\t\tsession(['name' => $answer->name]);\n\t\t\t\t\t\t\tsession(['id' => $answer->id]);\n\t\t\t\t\t\t\tsession(['photo' => $answer->photo]);\n\t\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\t\t= REGISTRAR LOGIN =\n\t\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t\tdate_default_timezone_set('America/Bogota');\n\t\t\t\t\t\t\tsession(['log' => date(\"Y-m-d h:i:s\")]);\n\t\t\t\t\t\t\t$answer->last_log = session('log');\n\t\t\t\t\t\t\tif ($answer->save()) {\n\t\t\t\t\t\t\t\techo ' <script>\n\t\t\t\t\t\t\twindow.location = \"inicio\"; </script> ';\n\n\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\techo '<br><div class=\"alert alert-warning\" style=\"text-align: center;\" >Este usuario se encuentra desactivado, por favor contacte al administrador.</div>';\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\techo '<head><style type=\"text/css\" media=\"screen\">body{background:#4a6886;color:#fff;}</style></head><body><div class=\"alert alert-warning\" style=\"text-align: center; font-size: 30px;margin-top:15%\" >Las credenciales ingresadas no son correctas.</div><br><br><div style=\"text-align: center; margin-left: 35%;margin-top:5%; width:30%;background:#E75300; padding: 10px;\"><a href=\"/\"> <span style=\" font-size: 18px; color: #fff\"><b>Volver al inicio</b></span> </a></div></body>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function registrar_usuario($identificacion,$nombre,$apellidos,$correo,$password)\n\t{\n\t\t$respuesta= array();\n\t\t$usuario = new Usuario();\n\t\t$existe_usuario = $usuario->consultar_usuario($correo);\n\t\tif (empty($existe_usuario)) {\n\t\t\t$usuario_nuevo = $usuario->registrar_usuario($identificacion,$nombre,$apellidos,$correo,$password);\n\t\t\t$respuesta[\"usuario_nuevo\"]=$usuario_nuevo;\n\t\t\tif ($usuario_nuevo) {\n\t\t\t\t$respuesta[\"valor\"]=1; \n\t\t\t} else{\n\t\t\t\t$respuesta[\"valor\"]=0; \n\t\t\t}\n\t\t} else{\n\t\t\t$respuesta[\"valor\"]=2; \n\t\t}\n\t\techo json_encode($respuesta);\n\n\t}", "function all_usuarios(){\n\t\t$Query = 'SELECT * FROM tb_usuarios';\n\t\t$respuesta = ObtenerRegistros($Query);\t\n\t\treturn ConvertirUTF8($respuesta);\n\t}", "public function getLoggedUserData(){\r\n if($this->isUserLogged()){\r\n // ziskam data uzivatele ze session\r\n $userId = $_SESSION[$this->userSessionKey];\r\n // pokud nemam data uzivatele, tak vypisu chybu a vynutim odhlaseni uzivatele\r\n if($userId == null) {\r\n // nemam data uzivatele ze session - vypisu jen chybu, uzivatele odhlasim a vratim null\r\n echo \"SEVER ERROR: Data přihlášeného uživatele nebyla nalezena, a proto byl uživatel odhlášen.\";\r\n $this->userLogout();\r\n // vracim null\r\n return null;\r\n } else {\r\n // nactu data uzivatele z databaze\r\n $userData = $this->selectFromTable(TABLE_USER, \"id_uzivatel=$userId\");\r\n // mam data uzivatele?\r\n if(empty($userData)){\r\n // nemam - vypisu jen chybu, uzivatele odhlasim a vratim null\r\n echo \"ERROR: Data přihlášeného uživatele se nenachází v databázi (mohl být smazán), a proto byl uživatel odhlášen.\";\r\n $this->userLogout();\r\n return null;\r\n } else {\r\n // protoze DB vraci pole uzivatelu, tak vyjmu jeho prvni polozku a vratim ziskana data uzivatele\r\n return $userData[0];\r\n }\r\n }\r\n } else {\r\n // uzivatel neni prihlasen - vracim null\r\n return null;\r\n }\r\n }", "function consultarUsuario(){\n global $conexion, $data;\n $usuario = $data[\"usuario\"];\n $password = $data[\"password\"];\n $resultado = mysqli_query($conexion,\"SELECT * FROM usuario WHERE usu_email='$usuario' AND usu_clave='$password' \");\n echo validarError($conexion, false, $resultado);\n }" ]
[ "0.7082991", "0.6867975", "0.6771137", "0.67329943", "0.66772586", "0.6672708", "0.6661666", "0.6632486", "0.662623", "0.6567955", "0.6553557", "0.65481514", "0.65385675", "0.6520408", "0.65000457", "0.6489519", "0.6479963", "0.6479416", "0.64688605", "0.6468396", "0.64527285", "0.64397514", "0.64107496", "0.6400024", "0.63857484", "0.6353949", "0.63359547", "0.63341933", "0.633285", "0.63214463", "0.6320587", "0.63186276", "0.630456", "0.63014483", "0.6287447", "0.62856895", "0.6282366", "0.62768275", "0.62552494", "0.6247772", "0.6238844", "0.62370354", "0.6231916", "0.6214166", "0.6206973", "0.61956227", "0.61943287", "0.61891633", "0.6186553", "0.618396", "0.6182221", "0.617661", "0.6171909", "0.6169812", "0.6166164", "0.61650926", "0.6164779", "0.61641794", "0.6161738", "0.61599827", "0.61478335", "0.6137809", "0.6129341", "0.61275864", "0.6121085", "0.61195505", "0.6119188", "0.6115316", "0.6112262", "0.6109277", "0.6108098", "0.6104122", "0.60962814", "0.6096185", "0.60873514", "0.6086014", "0.608575", "0.60798305", "0.60798305", "0.60798305", "0.60798305", "0.6079097", "0.6074311", "0.6072761", "0.6070478", "0.6066295", "0.6063528", "0.60620016", "0.60564995", "0.6056461", "0.60555303", "0.605498", "0.6044422", "0.60432273", "0.6036972", "0.6036222", "0.6030633", "0.6028202", "0.6020999", "0.6010634", "0.60087585" ]
0.0
-1
TODO authorisation controls the device that they are wanting to edit
public function index(Request $request) { // $this->authorize('owns', $request->user()); // $devices = DB::table('devices')->get(); //Get all the devices that a user owns $devices = $request->user()->devices()->get(); //Get the device that is linked to the current kid $kidID = Session::get('current_kid'); $currentKid = App\Kid::find($kidID); return view('devices', [ 'devices' => $devices, 'kids' => $currentKid ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Device $device)\n {\n //\n }", "public function edit(Device $device)\n {\n //\n }", "public function edit(Device $device)\n {\n //\n }", "public function edit(Device_new $device_new)\n {\n //\n }", "private function set_device(){\n\t\n\t}", "public function testUpdateDevice()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/devices')\n ->mouseover('#devices-list-group a:nth-child(5) i.mdi-pencil')\n ->click('#devices-list-group a:nth-child(5) i.mdi-pencil')\n ->assertPathIs('/device/5/edit')\n ->assertSee('Update Electricity Meter')\n ->type('txt-name', 'Electricity Meter U')\n ->press('Save')\n ->assertPathIs('/devices')\n ->assertSee('Electricity Meter U');\n });\n }", "public function edit($id){\n $device = Device::loadById($id);\n echo $this->render('devices/edit.html.twig', ['device' => $device]);\n }", "public function update(){\n $id = filter_var($_POST['id'], FILTER_VALIDATE_INT);\n $data = $this->validateInput();\n if($id && $data){\n $device = Device::loadById($id);\n $device->setName($data['name']);\n $device->setIP($data['ip']);\n $device->setSubnet($data['subnet']);\n $device->setMAC(strtoupper($data['mac']));\n $device->update();\n $this->setSuccess('Device successfully edited!');\n }else{\n $this->setError('Error while saving device!');\n }\n\n\n header('Location: /devices');\n }", "public function edit_device($id)\n {\n $data = array(\n 'name' => $this->input->post('name'),\n 'ip' => ip2long($this->input->post('ip')),\n 'snmp_read' => $this->input->post('snmp_read'),\n 'snmp_write' => $this->input->post('snmp_write'),\n 'login' => $this->input->post('login'),\n 'password' => $this->input->post('password'),\n );\n $this->db->where('id', $id);\n $this->db->update('device', $data);\n return 1;\n }", "public function edit(){\r\n\t\t//$this->auth->set_access('edit');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}", "public function edit() {\n\t\t\t\n\t\t}", "public function edit(DeviceTypes $deviceTypes)\n {\n //\n }", "public function edit()\n\t{\n\t\t//\n\t}", "public function selectNewDevice(){\n\t\t$db = Db::getInstance();\n\n\t\t$req = $db->prepare('SELECT DeviceID FROM Devices ORDER BY RAND() LIMIT 1');\n\t\t$req->execute();\n\t\t$deviceIDNum = $req->fetch();\n\n\t\t$deviceID = $deviceID['DeviceID'];\n\n\t\t//Set all off first\n\t\t$req = $db->prepare(' UPDATE Devices SET ActiveControl = 0');\n\t\t$req->execute(array(':deviceID' => $deviceIDNum));\n\t\t$deviceID = $req->fetch();\n\n\t\t//Switch the selected one on:\n\t\t$req = $db->prepare(' UPDATE Devices SET ActiveControl = 1 WHERE DeviceID = :deviceID');\n\t\t$req->execute(array(':deviceID' => $deviceIDNum));\n\t\t$deviceID = $req->fetch();\n\n\t}", "public function testUpdateDeviceNoName()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/devices')\n ->mouseover('#devices-list-group a:nth-child(5) i.mdi-pencil')\n ->click('#devices-list-group a:nth-child(5) i.mdi-pencil')\n ->assertPathIs('/device/5/edit')\n ->assertSee('Update Electricity Meter U')\n ->type('txt-name', '')\n ->press('Save')\n ->assertPathIs('/device/5/edit')\n ->assertSee('You must provide a name');\n });\n }", "function logger_device_edition_page($id) {\n\n $query = db_select('logger_devices', 'd')\n ->fields('d', array('device', 'serial', 'description'))\n ->condition('d.device', $id);\n\n $query->join('logger_device_type', 't', 'd.type_id = t.id');\n $query->addField('t', 'name', 'type_name');\n\n $query->join('logger_device_firmware', 'f', 'd.firmware_id = f.id');\n $query->addField('f', 'version', 'firmware_version');\n\n $device = $query->execute()->fetchObject();\n\n $form = drupal_get_form('logger_device_form', $device);\n\n return drupal_render($form);\n}", "function device_update_get()\n {\n // Only the TP link smart plugs support broadcast scanning so far\n $deviceParams = array('id' => $this->get('id'), 'model' => 'HS110');\n $this->load->library('drivers/hs1xx', $deviceParams);\n\n print_r($this->hs1xx->updateDevices());\n }", "public function indexApUpdate(){\n //This will be used to display in the Wizard of available Realms in the Create screens of Vouchers; Permanent Users; and Devices\n $user = $this->Aa->user_for_token($this);\n if(!$user){ //If not a valid user\n return;\n }\n $this->_doApListFor($user,'update'); \n }", "public function edit()\n\t{\n\t\t\n\t}", "function edit_device_capability_process()\n\t{\n\t\t/**** Adding Device Manufacturer ***/\n\t\t\t$capability_name\t=\tmysql_escape_string($this->input->post('capability_name'));\n\t\t\t$capability_value\t=\tmysql_escape_string($this->input->post('capability_value'));\n\t\t\t$capability_id\t\t=\t$this->input->post('cap_id');\n\t\t\t$this->form_validation->set_rules('capability_name', 'Device capability Name', 'required|alpha_numeric_dash_space|callback_capability_name_check');\n\t\t\t$this->form_validation->set_rules('capability_value', 'Device capability value', 'required|alpha_numeric_dash_space');\n\t\t\t\n\t\t\tif($this->form_validation->run() == FALSE)\n\t\t\t{\n\t\t\t\t//$this->session->set_userdata('notification_message', ''.$this->lang->line(\"label_fill_device_capability\").'');\n\t\t\t\t$this->edit_device_capability($capability_id);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$update_data\t=\tarray(\"capability_name\" =>$capability_name,\n\t\t\t\t \"capability_value\" =>$capability_value\n\t\t\t\t );\t\n\t\t\t\t$where_arr\t\t=\tarray('capability_id' =>$capability_id);\n\t\t\t\t$tbl_name\t\t=\t'djx_device_capability';\n\t\t\t\t\n\t\t\t\t$this->mod_system_settings->update_data($update_data,$where_arr,$tbl_name);\n\t\t\t\t$this->session->set_flashdata('message', ''.$this->lang->line(\"notification_device_capability_updated_successfully\").'');\n\t\t\t\tredirect('admin/settings_device_capability');\n\t\t\t}\n\t}", "public function edit( )\r\n {\r\n //\r\n }", "public function edit() {\n }", "public function edit($id) {\n\t\t$device = Device::find($id);\n\t\treturn view('device.edit', ['device' => $device]);\n\t}", "public function edit()\n {\n \n }", "public function show(Device_new $device_new)\n {\n //\n }", "function editar_operador(){\t\t\n\t\t$this->accion=\"Editando Datos del Operador\";\n\t\tif (isset($_POST['envio']) && $_POST['envio']==\"Guardar\" && isset($_GET['id']) && $_GET['id']!=\"\"){\n\t\t\t$id=$_GET['id'];\n\t\t\t$this->asignar_valores();\n\t\t\t$sql=\"UPDATE operador SET cantidad_op='$this->cantidad', nombre_op='$this->nombre', apellido_op='$this->apellido', cedula_op='$this->cedula' WHERE id_op='$id'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\theader(\"location:/admin/operador/\");\n\t\t}else{\n\t\t\t\n\t\t\t$this->mostrar_operador();\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function editinformation() \n {\n UserModel::authentication();\n \n //get the session user\n $user = UserModel::user();\n\n UserModel::update_profile();\n }", "protected function canEdit() {}", "public function edit($id)\n {\n if (Auth::user()->ability('superadministrator', 'update-platforms')){\n return view('platform.update',[\n 'pageheader'=>'平台渠道',\n 'pagedescription'=>'更新',\n 'platform'=>PlatForm::findOrFail($id),\n ]);\n }\n return abort(403,config('yyxt.permission_deny'));\n }", "public function canBeEdited()\n {\n return true; ///< Every client sees only it's own information\n }", "function edit(){\n $this->connect(); // open connection\n $this->disconnect(); // close connection\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\n {\n \n \n }", "protected function editar()\n {\n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "function device_get()\n {\n // // Authenticate user (by session)\n // // Check if a user is currently logged in\n if(!$this->session->userdata('LoggedIn')){\n // die(\"Login Required\");\n }\n\n if(!$this->get('id')){\n $this->response(NULL, 400);\n }\n\n // Load the device model\n $this->load->model('device_model');\n \n // Get the required device parameters from the POST data\n $postDevice = $this->input->get('device');\n \n // Get the full device/system information\n $device = $this->device_model->getDeviceInfo( $this->get('id') );\n \n if($device){\n $this->response($device, 200); // 200 being the HTTP response code\n }else{\n $this->response(NULL, 404);\n }\n }", "function displayEditScreen()\t{\t \n\t\t// We handle here Edit mode or Preview Mode\n\t\t// Edit Mode : User can edit fields\n\t\t// Preview Mode : user can only see fields\t\n\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('displayEditScreen'=>'on'));\n\t\t$exporttype=$this->piVars['exporttype'];\n\t\t$print=$this->piVars['print'];\n\t\t$printerName=$this->piVars['printername'];\n\t\t$printServerName=$this->piVars['printservename'];\n\t\tif ($exporttype == 'PDF') $exporttype = \"PDFDET\";\n\t\t$this->conf['cmdmode']='edit';\t\n\t\t// We handle here Edit mode or Preview Mode\n\t \t// Edit Mode : User can edit fields\n\t \t// Preview Mode : user can only see fields\t \n\t \t//$this->markerArray['###BACK_URL###'] = \"\";\n\t \t\n\t\t//We handle backurl...\n\t\t/*if ($this->conf['edit.']['backPagePid'] && !$this->conf['no_action']) {\n\t\t\t$this->backURL=$this->pi_getPageLink($this->conf['edit.']['backPagePid']);\n\t\t\tif (!strpos($this->backURL,'?')) $this->backURL.='?';\n\t\t\t$this->markerArray['###BACK_URL###'] = $this->backURL;\n\t\t}*/\n\t\t// If editing is enabled\n\t\tif ($this->conf['edit'] || $this->preview || $this->conf['list'] )\t{\t\n\t\t\t// hack for lists in second plugin ... to be checked.., Will not work if we want to edit in second plugin ...\n\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('Edit or preview'=>'on'));\n\t\t\t$uid=$this->dataArr[$this->conf['uidField']]?$this->dataArr[$this->conf['uidField']]:$this->recUid;\n \t\t\tif ($this->conf['list.']['rUJoinField']=='uid' && $uid){\n \t\t\t\t\n\t\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('UIDFIELD'=>$this->conf['uidField'].' : '.$this->recUid));\n\t\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('dataArr'=>$this->dataArr[$this->conf['uidField']]));\n\t\t\t\t$origArr = $this->metafeeditlib->getRawRecord($this->theTable,$uid,$this->conf);\n\t\t\t\tif (!$origArr) die(__METHOD__.\":Detail mode and no id given for $this->theTable,$uid\");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('editMode'=>'on'));\n\n\t\t\t// here we handle foreign tables not the best way , we should work on join tables especially if we handle lists...\n\t\t\t\n\t\t\tif ($this->conf['foreignTables'] && is_array($origArr)) {\n\t\t\t\t\n\t\t\t\t//MM not implemented\n\t\t\t\t//Not MM\n\t\t\t\t\n\t\t\t\t$FTRels=t3lib_div::trimexplode(',',$this->conf['foreignTables']);\n\t\t\t\tforeach($FTRels as $FTRel) {\n\t\t\t\t\t$FTable=$GLOBALS['TCA'][$this->theTable]['columns'][$FTRel]['config']['foreign_table'];\n\t\t\t\t\t$FTUid=$origArr[$FTRel];\n\t\t\t\t\t// what if multiple ???\n\t\t\t\t\t// what if editmenu list ???\n\t\t\t\t\tif ($FTUid) {\n\t\t\t\t\t\t //on recup l'id de l'enregistrement a associer\n\t\t\t\t\t\tif ($GLOBALS['TCA'][$this->theTable]['columns'][$FTRel]['config']['MM']) { //si on est dans une MM faut d'abord recup les id de la table MM\n\t\t\t\t\t\t\t$MMT = $GLOBALS['TCA'][$this->theTable]['columns'][$FTRel]['config']['MM'];\n\t\t\t\t\t\t\t$LTUid=$origArr[\"uid\"];\n\t\t\t\t\t\t\t$MMTreq = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('*',$this->theTable,$MMT,$FTable,'AND '.$this->theTable.'.uid='.$origArr['uid']);\n\t\t\t\t\t\t\t$resu=$GLOBALS['TYPO3_DB']->sql_num_rows($MMTreq);\n\t\t\t\t\t\t\tif ($resu>=1) {\n\t\t\t\t\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($MMTreq)) {\n\t\t\t\t\t\t\t\t\tforeach($row as $key =>$val) $origArr[$FTRel.'.'.$key]=$val;\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\t// originally there only these 2 lines in this condition (if ($FTUid) )\n\t\t\t\t\t\t\t$FTorigArr = $GLOBALS['TSFE']->sys_page->getRawRecord($FTable, $FTUid);\n\t\t\t\t\t\t\tif (is_array($FTorigArr)) foreach($FTorigArr as $key =>$val) $origArr[$FTRel.'.'.$key]=$val;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$FTCA=$GLOBALS['TCA'][$FTable]['columns'];\n\t\t\t\t\t\t//krumo ($FTCA);\n\t\t\t\t\t\tif (is_array($FCTA)) foreach($FTCA as $key=>$val) {\n\t\t\t\t\t\t\tif (in_array(substr($FTCA,0,11),array('--div--;Tab','--fsb--;FSB','--fse--;FSE'))) continue;\n\t\t\t\t\t\t\t$this->markerArray['###FIELD_'.$FTRel.'.'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###FIELD_EVAL_'.$FTRel.'.'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###EVAL_ERROR_FIELD_'.$FTRel.'.'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###EVAL_ERROR_FIELD_'.$FTRel.'_'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###CSS_ERROR_FIELD_'.$FTRel.'.'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###CSS_ERROR_FIELD_'.$FTRel.'_'.$key.'###']='';\n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//<CBY> We go to detail mode directly if editUnique is true and there is only one elment to edit.\n\t\t\t$DBSELECT=$this->metafeeditlib->DBmayFEUserEditSelectMM($this->theTable,$GLOBALS['TSFE']->fe_user->user, $this->conf['allowedGroups'],$this->conf['fe_userEditSelf'],$mmTable,$this->conf).$GLOBALS['TSFE']->sys_page->deleteClause($this->theTable);\n\n\t\t\t$TABLES=$mmTable?$this->theTable.','.$mmTable:$this->theTable;\n\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('EDIT'=>$origArr));\n\t\t\tif (!is_array($origArr)&&$this->conf['editUnique']) {\n\t\t\t\t$lockPid = ($this->conf['edit.']['menuLockPid'] && $this->conf['pid'])? ' AND pid='.intval($this->thePid) : '';\n\t\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $TABLES, '1 '.$lockPid.$DBSELECT);\n\t\t\t\tif ($this->conf['debug']) \techo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('EDITUNIQUE TEST'=>$GLOBALS['TYPO3_DB']->SELECTquery('*', $TABLES, '1 '.$lockPid.$DBSELECT)));\n\t\t\t\t$resu=$GLOBALS['TYPO3_DB']->sql_num_rows($res);\n\t\t\t\tif ($resu>=1)\t{\n \t\t\t\t\twhile($menuRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\t\t\t\t$origArr = $GLOBALS['TSFE']->sys_page->getRawRecord($this->theTable, $menuRow[$this->conf['uidField']]);\n\t\t\t\t\t\t$this->recUid=$menuRow[$this->conf['uidField']];\n\t\t\t\t\t\t$this->conf['recUid']=$this->recUid;\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\n\t\t\t// <CBY>\n\t\t\t$this->markerArray['###REC_UID###']=$this->recUid;\n\t\t\t//if ($GLOBALS['TSFE']->loginUser || $this->aCAuth($origArr))\t{\t// Must be logged in OR be authenticated by the aC code in order to edit\n\t\t\tif (($GLOBALS['TSFE']->loginUser && $this->conf['requireLogin']) || ( $this->aCAuth($origArr)&& $this->conf['requireLogin'])||!$this->conf['requireLogin'])\t{\n\t\t\t\t// Must be logged in OR be authenticated by the aC code in order to edit\n\t\t\t\t// If the recUid selects a record.... (no check here)\n\t\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('EDIT'=>\"No login\"));\n\t\t\t\n\t\t\t\t// We come from ??\n\t\t\t\tif (is_array($origArr) && !($this->conf['inputvar.']['BACK'] && $this->conf['inputvar.']['cameFromBlog']))\t{\n\t\t\t\t\tif ($this->conf['blogData']) $this->preview=1; \n\t\t\t\t\t// we check if edit or preview mode is allowed ...\n\t\t\t\t\tif (!$this->conf['edit'] && !$this->preview )\t{\t// If editing is enabled\n\t\t\t\t\t\t$content.='meta_feedit : feadminlib.inc, Edit-option is not set and Preview-option is not set in TypoScript';\n\t\t\t\t\t\treturn $content;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ($this->conf['disableEdit'] && !$this->preview )\t{\t// If editing is enabled\n\t\t\t\t\t\t$content.='meta_feedit : feadminlib.inc, Edit-option disabled and Preview-option is not set in TypoScript';\n\t\t\t\t\t\treturn $content;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($this->aCAuth($origArr) || $this->metafeeditlib->DBmayFEUserEdit($this->theTable,$origArr, $GLOBALS['TSFE']->fe_user->user,$this->conf['allowedGroups'],$this->conf['fe_userEditSelf'],$this->conf))\t{\t\n\t\t\t\t\t\t// Display the form, if access granted.\n\t\t\t\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('EDIT'=>\"User may edit\"));\n\t\t\t\t\t\tif \t($this->conf['evalFunc'])\t{\n\t\t\t\t\t\t\t$origArr = $this->userProcess('evalFunc',$origArr);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->markerArray = $this->setfixed($this->markerArray, $this->conf['setfixed.'], $origArr);\n\t\t\t\t\t\t$content=$this->displayEditForm($origArr,$this->conf,$exporttype,$print,$printerName,$printServerName);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Else display error, that you could not edit that particular record...\t\n\t\t\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_NO_PERMISSIONS###');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// If the recUid did not select a record, we display a menu of records. (eg. if no recUid)\n\t\t\t\t\t// we check if list mode is allowed ...\n\t\t\t\t\tif (!$this->conf['list'])\t{\t// If editing is enabled\n\t\t\t\t\t\t\t$content.='List-option is not set in TypoScript';\n\t\t\t\t\t\t return $content;\n\t\t\t\t\t}\n\t\t\t\t\t//$content=($this->conf['general.']['listMode']==2)?$this->metafeeditgrid->displayGridScreen($TABLES,$DBSELECT,$this->conf):$this->displayListScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\tswitch($this->conf['general.']['listMode']) {\n\t\t\t\t\t\tcase 2 :\n\t\t\t\t\t\t\t$content=$this->metafeeditgrid->displayGridScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1 :\n\t\t\t\t\t\t\t\t//$content=$this->metafecalendar->displayCalendarScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\t\t\t$cal=t3lib_div::makeInstance('tx_metafeedit_calendar');\n\t\t\t\t\t\t $cal->initObj($this->metafeeditlib,$this->cObj);\n\t\t\t\t\t\t\t$content=$cal->displayCalendarScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault :\n\t\t\t\t\t\t\t$content=$this->displayListScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Finally this is if there is no login user. This must tell that you must login. Perhaps link to a page with create-user or login information.\n\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_AUTH###');\n\t\t\t}\n\t\t} else {\n\t\t\t$content.='Display Edit Screen : Edit-option , Preview-option or List-option is not set in TypoScript';\n\t\t}\n\t\treturn $content;\n\t}", "function update() {\n\t\t\tif ($this->id == null || $this->id == 0) return false;\n\n\t\t\t$this->conn = connectToDb(\"db_avalanche_store\");\n\n\t\t\t$update_query = \"UPDATE tbl_dev_info SET\n\t\t\t dev_name = '$this->dev_name',\n\t\t\t dev_desc = '$this->dev_description' WHERE user_id = '$this->id';\";\n\n\t\t\t$result = $this->conn->query($update_query);\n\n\t\t\t$this->conn->close();\n\n\t\t\tif (!$result) return false;\n\n\t\t\treturn true;\n\n\t\t}", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "protected function editLockPermissions() {}", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "abstract public function setDeviceInfo(Horde_ActiveSync_Device $data, array $dirty = array());", "public function edit(Product $product)\n {\n // Admin Only \n }", "public function update_device( $device_id = '', $did = '', $model = '', $hversion = '', $sversion = '', $type = '', $builder = '' ) {\n global $wpdb;\n\t\tglobal $rpids_api;\n \n try {\n // Process the parameters\n if( @$device_id != '' ) {\n $device_id = sanitize_text_field( $device_id );\n } else {\n throw new Exception( 'Device ID is required.' );\n }\n \n if( @$did != '' ) {\n $did = sanitize_text_field( $did );\n } else {\n $did = '0';\n }\n \n if( @$model != '' ) {\n $model = sanitize_text_field( $model );\n }\n \n if( @$hversion != '' ) {\n $hversion = sanitize_text_field( $hversion );\n }\n \n if( @$sversion != '' ) {\n $sversion = sanitize_text_field( $sversion );\n }\n \n if( @$type != '' ) {\n $type = sanitize_text_field( $type );\n }\n \n if( @$builder != '' ) {\n $builder = sanitize_text_field( $builder );\n }\n \n // Get the current user\n $current_user = wp_get_current_user();\n \n // Should we verify the device and claim it?\n $sql = \"SELECT * FROM `\" . rpids_tableprefix() . \"rpids_devices` WHERE `id`='\" . $device_id . \"';\";\n $device = $wpdb->get_row($sql, ARRAY_A);\n \n if( $device != null ) {\n // Device does not exist\n throw new Exception( 'Device ID does not exist.' );\n }\n \n if( $device['did'] != '0' ) {\n // Connect to the central server and claim the device\n $rpids_return = $rpids_api->update_device_info( $did, $model, $hversion, $sversion, $type, $builder );\n // Why email? If the device is given away or sold, but not removed from an account, we need to know who to contact for the new owner. \n // Check the status of $rpids_return. If it isn't success, change the DID to 0 and quietly fail.\n if( $rpids_return['status'] != 'success' ) {\n $did = '0';\n }\n \n // Looks like status == success\n }\n \n // Now, update the device in the database\n $new_device_info = array();\n if( @$did != '' ) {\n $new_device_info['did'] = $did;\n }\n \n if( @$model != '' ) {\n $new_device_info['model'] = $model;\n }\n \n if( @$hversion != '' ) {\n $new_device_info['hversion'] = $hversion;\n }\n \n if( @$sversion != '' ) {\n $new_device_info['sversion'] = $sversion;\n }\n \n if( @$type != '' ) {\n $new_device_info['type'] = $type;\n }\n \n if( @$builder != '' ) {\n $new_device_info['builder'] = $builder;\n }\n \n if( !$wpdb->update( rpids_tableprefix() . \"rpids_devices\", $new_device_info, array( 'id' => $device_id ) ) ) {\n throw new Exception( 'Error when updating the database. New info not saved.' );\n } else {\n return (object) array(\n \"status\" => \"success\",\n \"message\" => \"Device updated.\"\n );\n }\n\t\t} catch ( Exception $e ) {\n return (object) array(\n\t\t\t\t\"status\" => \"error\",\n\t\t\t\t\"message\" => $e->getMessage()\n\t\t\t);\n }\n }", "function edit_device_capability($capability_id = false)\n\t{\n\t\t\n\t\tif($capability_id !=false)\n\t\t{\n\t\t\t/*-------------------------------------------------------------\n\t\t\t\tBreadcrumb Setup Start\n\t\t\t -------------------------------------------------------------*/\n\t\t\t$link = breadcrumb();\n\t\t\t$data1['breadcrumb'] \t= $link;\n\t\t\t\n\t\t\t/*-------------------------------------------------------------\n\t\t\t\tPage Title showed at the content section of page\n\t\t\t -------------------------------------------------------------*/\n\t\t\t$data1['page_title'] \t\t\t\t= $this->lang->line('label_edit_device_capability');\t\n\t\t\t$data1['capability_id']\t\t\t=\t$capability_id;\t\n\t\t\t$data1['capability_data']\t\t=\t$this->mod_system_settings->get_device_capabilitys($capability_id);\n\t\t\t\t\n\t\t\t$data1['page_content']\t=\t$this->load->view('device_capability/edit_device_capability',$data1,true);\n\t\t\t$this->load->view('page_layout',$data1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tredirect('admin/settings_device_capability');\n\t\t}\n\t}", "public function edit()\n {\n //\n }", "function edit( $id = \"be1\") {\n\n\n\t\t// load user\n\t\t$this->data['backend'] = $this->Backend_config->get_one( $id );\n\n\t\t// call the parent edit logic\n\t\tparent::backendedit( $id );\n\t}", "public function edit() {\n\n }", "public function Edit()\n\t{\n\t\t\n\t}", "function rebuildDeviceData() {\n\t\tsystemLog::notice('Starting rebuild of device data');\n\t\t$oStmt = dbManager::getInstance()->prepare('SELECT deviceID FROM '.system::getConfig()->getDatabase('wurfl').'.devices WHERE rootDevice = 1');\n\t\tif ( $oStmt->execute() ) {\n\t\t\tforeach ( $oStmt as $row ) {\n\t\t\t\tsystemLog::getInstance()->setSource('rebuild]['.$row['deviceID']);\n\t\t\t\t$oDevice = wurflManager::getInstance($row['deviceID']);\n\t\t\t\tsystemLog::notice('Processing deviceID '.$row['deviceID']);\n\t\t\t\t$oDevice->setModelName($oDevice->getCapabilities()->getCapability('model_name'));\n\t\t\t\t\n\t\t\t\t$oMan = wurflManufacturer::getInstance($oDevice->getCapabilities()->getCapability('brand_name'));\n\t\t\t\tif ( $oMan->getManufacturerID() > 0 ) {\n\t\t\t\t\t$oDevice->setManufacturerID($oMan->getManufacturerID());\n\t\t\t\t}\n\t\t\t\t$oDevice->save();\n\t\t\t}\n\t\t}\n\t}", "function editAdminHandler() {\n global $inputs;\n\n updateDb('admin',[\n 'name' => $inputs['admin_username'],\n 'password' => $inputs['admin_password'],\n ], [\n 'id' => $inputs['id']\n ]);\n\n updateDb('admin_building',[\n 'building_id' => $inputs['admin_building'],\n ], [\n 'admin_id' => $inputs['id']\n ]);\n\n formatOutput(true, 'update success');\n}", "public function edit($name)\n {\n $user = $this->authUser;\n $no_device = empty($user->devices->first()) || is_null($user->devices);\n// dd(empty($user->devices->first()));\n $msg = '';\n if($no_device){\n\n $msg = \"It happened so, that we didn't receive your Locked Or Not device number.\n Please update your information and provide the Locked Or Not device number.\";\n\n }\n\n $unlocked_devices = $user->devices()->unlocked();\n $device_status = $unlocked_devices->count() == 0 ? 'locked' : 'unlocked';\n\n return view('profile.edit', compact('user', 'no_device', 'device_status', 'msg'))->withTitle('Update profile');\n }", "public function editAction() {\n $uid = $this->getInput('uid');\n $userInfo = Admin_Service_User::getUser(intval($uid));\n list(, $groups) = Admin_Service_Group::getAllGroup();\n $this->assign('userInfo', $userInfo);\n $this->assign('groups', $groups);\n $this->assign('status', $this->status);\n $this->assign(\"meunOn\", \"sys_user\");\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n { \n }", "function a_edit() {\n\t\tif (isset($_POST[\"btSubmit\"])) {\n\t\t\t$_POST['use_passw']=password_hash($_POST['use_passw'], PASSWORD_DEFAULT);\n\t\t\t$u=new User();\n\t\t\t$u->chargerDepuisTableau($_POST);\n\t\t\t$u->sauver();\n\t\t\theader(\"location:index.php?m=documents\");\n\t\t} else {\t\t\t\t\n\t\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t\t$u=new User($id);\n\t\t\textract($u->data);\t\n\t\t\trequire $this->gabarit;\n\t\t}\n\t}", "public function can_edit() {\n return true;\n }", "public function edit($id)\n\t{\n\t\t$equipment = equipment::where('id', $id)->first();\n\t\t$customers = Customer::lists('company_name', 'id');\n\t\t$manufacturers = Manufacturer::lists('manufacturer_name', 'id');\n\t\t\n\t\t//if(Auth::user()->hasRole('Manager') && $equipment->users()->find(Auth::user()->id)){\n\t\t\treturn view('equipments.edit', compact('equipment', 'customers', 'manufacturers'));\n\t\t//} else {\n\t\t\t//return Redirect::to('equipments')->with('alert', 'You do not have permission to edit this equipment');\n\t\t//}\n\t}", "public function edit()\n {\n\t$this->log(\"edit function\");\n\n \t// Check whether client is logged in\n // $logged_in = false;\n // if ($this->isLoggedIn()) {\n // $logged_in = true;\n // }\n\n // Get custom fields from Client controller => save\n \t$client_custom_fields = $this->Clients->getCustomFieldValues(1);\n return $this->set('client_custom_fields', $client_custom_fields);\n }", "function odbcdriver_edit($ext, $name, $driver, $setup, $description, $enable){\n $section = odbcdriver_get($ext);\n $section_name = $section['name'];\n exec(\"python /var/lib/asterisk/bin/rpclient.py DRIVER del=$section_name\");\n\tif($enable == 'yes'){\n\t\t$add_string = \"\".$name.\"-\".$driver.\"-\".$setup.\"-\".$description;\n\t\texec(\"python /var/lib/asterisk/bin/rpclient.py DRIVER add=$add_string\");\n\t}\n\t$sql=\"UPDATE odbcdriver set name='$name' where id='$ext'\";\n\tsql($sql);\n\t$sql=\"UPDATE odbcdriver set driver='$driver' where id='$ext'\";\n\tsql($sql);\n\t$sql=\"UPDATE odbcdriver set setup='$setup' where id='$ext'\";\n\tsql($sql);\n\t$sql=\"UPDATE odbcdriver set description='$description' where id='$ext'\";\n\tsql($sql);\n\t$sql=\"UPDATE odbcdriver set enable='$enable' where id='$ext'\";\n\tsql($sql);\n\n}", "public function edita()\n\t {\t\n\t\t$car=$_REQUEST['car'];\n\t\t$per=$_REQUEST['per'];\n\t\t$logi=$_REQUEST['logi'];\n\t\t$pas=$_REQUEST['pas'];\n\t\t$obs=$_REQUEST['obs'];\n\t\t$est=$_REQUEST['est'];\n\t\t\t//$usu=$_REQUEST['usu'];\n\t\t$user_data=array();\n\t\t$user_data['carnet']=$car;\n\t\t$user_data['login']=$logi;\n\t\t$user_data['password']=$pas;\n\t\t$user_data['estado']=$est;\n\t\t$user_data['observacion']=$obs;\n\t\t$user_data['perfil']=$per;\n\t\t\n\t\t//print_r($user_data);\n\t\t$usuario=new Usuarios;\n\t\t$usuario->edit($user_data);\n\t\t$data1=$usuario->lista();\n\t\t$this->principal();\n\t }", "function cfilesystem_edit() {\r\n\t\tglobal $conn;\r\n\r\n\t\t// Initialize table object\r\n\t\t$GLOBALS[\"filesystem\"] = new cfilesystem();\r\n\r\n\t\t// Initialize other table object\r\n\t\t$GLOBALS['grp'] = new cgrp();\r\n\r\n\t\t// Initialize other table object\r\n\t\t$GLOBALS['server_type'] = new cserver_type();\r\n\r\n\t\t// Initialize other table object\r\n\t\t$GLOBALS['users'] = new cusers();\r\n\r\n\t\t// Intialize page id (for backward compatibility)\r\n\t\tif (!defined(\"EW_PAGE_ID\"))\r\n\t\t\tdefine(\"EW_PAGE_ID\", 'edit', TRUE);\r\n\r\n\t\t// Initialize table name (for backward compatibility)\r\n\t\tif (!defined(\"EW_TABLE_NAME\"))\r\n\t\t\tdefine(\"EW_TABLE_NAME\", 'filesystem', TRUE);\r\n\r\n\t\t// Open connection to the database\r\n\t\t$conn = ew_Connect();\r\n\t}", "public function show(Device $device)\n {\n //\n }", "public function show(Device $device)\n {\n //\n }", "public function show(Device $device)\n {\n //\n }", "public function edit()\n { }", "function device_post()\n {\n // // Authenticate user (by session)\n // // Check if a user is currently logged in\n if(!$this->session->userdata('LoggedIn')){\n die(\"Login Required\");\n }\n\n if(!$this->get('id')){\n $this->response(NULL, 400);\n }\n\n // Load the device model\n $this->load->model('device_model');\n \n // Get the required device parameters from the POST data\n $postDevice = $this->post('device');\n $device_driver = $this->device_model->getDriverCode($this->get('id'));\n\n // Load the device driver library\n $deviceParams = array('id' => $this->get('id'), 'model' => 'HS110');\n $this->load->library('drivers/'.$device_driver, $deviceParams);\n\n // Send the command the the device\n $commandResult = $this->$device_driver->controlDevice($postDevice);\n\n // build up some response data\n // $data['jsonArray'] = array(\"device\" => $set_devinfo);\n $data = $commandResult;\n\n // print_r($data);\n\n // Check the response is not empty\n if(!empty($commandResult['response']) && ($commandResult['response']['error'] === 0)){\n // The command was sent and received by the device\n // Update the database\n $this->device_model->updateDevice($data);\n }else{\n // print(\"error\");\n // print_r($commandResult['response']);\n }\n\n // If the data array is not empty then display the response\n if($data)\n {\n $this->response($data, 200); // 200 being the HTTP response code\n }\n \n else\n {\n $this->response(NULL, 404);\n }\n }", "function canEdit() {\n\t\t\treturn true;\n\t\t}", "public function edit_deviceCategory($id){\n if(isset($this->session->userdata['admin_name']) && !empty($this->session->userdata['admin_name'])) {\n if(isset($id) && !empty($id)) {\n $category_detail = $this->requesttoserver->getDataCurl('devCategory_details/id/' . $id);\n $category_detail = json_decode($category_detail);\n if (isset($category_detail->status) == 'FALSE') {\n echo \"<h2 style='text-align: center;'>INVALID Device Category ID</h2>\";\n die;\n }\n else {\n $data['category_detail'] = $category_detail[0];\n }\n $data['title'] = 'PBD - Admin | Edit category ';\n $this->load->view('edit-device-category', $data);\n }\n else{\n echo \"<h2 style='text-align: center;'>Device Category ID not provided</h2>\";\n die;\n }\n }\n else{\n redirect('signin');\n }\n }", "public function devicedetailsAction ()\n {\n $db = Zend_Db_Table::getDefaultAdapter();\n $deviceID = $this->_getParam('deviceid', false);\n\n try\n {\n if ($deviceID > 0)\n {\n // get toners for device\n $select = $db->select()\n ->from([\n 't' => 'toners'\n ])\n ->join([\n 'td' => 'device_toners'\n ], 't.id = td.toner_id')\n ->where('td.master_device_id = ?', $deviceID);\n $stmt = $db->query($select);\n\n $result = $stmt->fetchAll();\n $toner_array = '';\n foreach ($result as $key)\n {\n if (!empty($toner_array))\n {\n $toner_array .= \",\";\n }\n $toner_array .= \"'\" . $key ['toner_id'] . \"'\";\n }\n\n $select = $db->select()\n ->from([\n 'md' => 'master_devices'\n ])\n ->joinLeft([\n 'm' => 'manufacturers'\n ], 'm.id = md.manufacturerId')\n ->joinLeft([\n 'rd' => 'replacement_devices'\n ], 'rd.masterDeviceId = md.id')\n ->where('md.id = ?', $deviceID);\n $stmt = $db->query($select);\n $row = $stmt->fetchAll();\n $launch_date = new Zend_Date($row [0] ['launchDate'], \"yyyy/mm/dd HH:ii:ss\");\n $formData = [\n 'launch_date' => $launch_date->toString('mm/dd/yyyy'),\n 'toner_config_id' => $row [0] ['tonerConfigId'],\n 'is_copier' => $row [0] ['isCopier'] ? true : false,\n 'is_fax' => $row [0] ['isFax'] ? true : false,\n 'is_duplex' => $row [0] ['isDuplex'] ? true : false,\n 'is_a3' => $row [0] ['isA3'] ? true : false,\n 'reportsTonerLevels' => $row [0] ['reportsTonerLevels'] ? true : false,\n 'is_replacement_device' => $row [0] ['isReplacementDevice'],\n 'watts_power_normal' => $row [0] ['wattsPowerNormal'],\n 'watts_power_idle' => $row [0] ['wattsPowerIdle'],\n 'device_price' => ($row [0] ['cost'] > 0 ? (float)$row [0] ['cost'] : \"\"),\n 'is_deleted' => $row [0] ['is_deleted'],\n 'toner_array' => $toner_array,\n 'replacement_category' => $row [0] ['replacementCategory'],\n 'print_speed' => $row [0] ['print_speed'],\n 'resolution' => $row [0] ['resolution'],\n 'monthly_rate' => $row [0] ['monthly_rate'],\n 'is_leased' => $row [0] ['isLeased'] ? true : false,\n 'leased_toner_yield' => $row [0] ['leasedTonerYield'],\n 'ppm_black' => $row [0] ['ppmBlack'],\n 'ppm_color' => $row [0] ['ppmColor'],\n 'partsCostPerPage' => $row [0] ['partsCostPerPage'],\n 'laborCostPerPage' => $row [0] ['laborCostPerPage'],\n ];\n }\n else\n {\n // empty form values\n $formData = [];\n }\n }\n catch (Exception $e)\n {\n // critical exception\n Throw new exception(\"Critical Error: Unable to find device.\", 0, $e);\n } // end catch\n\n $this->sendJson($formData);\n }", "public function edit_watch(){\r\n\t\tif($this->expectsPost(array('watchId','brand', 'name', 'yearOfBuy',\r\n\t\t\t'serial', 'caliber'))){\r\n\r\n\t\t\tif ($this->watch->editWatch($this->session->userdata('userId'),\r\n\t\t\t\t\t\t$this->watchId,\r\n\t\t\t\t\t\t$this->brand, $this->name,\r\n\t\t\t\t\t\t$this->yearOfBuy, $this->serial,\r\n\t\t\t\t\t\t$this->caliber)) {\r\n\r\n\t\t\t\t$this->_bodyData['success'] = 'Watch successfully updated!';\r\n\r\n\t\t\t}\r\n\r\n\t\t\t$this->constructMeasurePage();\r\n\t\t}\r\n\t}", "private function validateUpdate() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Fj_Service_Goods::getGoods(intval($id));\n $this->assign('dir', \"goods\");\n $this->assign('ueditor', true);\n\t\t$this->assign('info', $info);\n\t}", "function editPlatformForm($id)\n {\n global $mysqli;\n $sql=\"SELECT * FROM platforms WHERE platformID=$id\";\n $result=$mysqli->query($sql)or die(\"query failed due to \".mysqli_error());\n if($result->num_rows==0)//redirect if unknown id \n {\n logError(\"unkown platform id\");\n header(\"location:./platform.php\");\n exit(); \n }\n else\n {//load platform content to be edited\n $row=$result->fetch_assoc();\n $name=$row['platformName'];\n $icon= $row['platformIcon'];\n $id=$row['platformID'];\n echo '<form action=\"./platform.php?action=update&id='.$id.'\" method=\"post\" enctype=\"multipart/form-data\" id=\"editForm\">\n <label>Platform Name :</label><input type=\"text\" name=\"name\" value=\"'.$name.'\" /><br />\n <label>Platform Icon :</label><input type=\"file\" value=\"upload\" name=\"icon\" /><br />\n <input type=\"submit\" name=\"submit\" value=\"submit\" />\n </form>'; \n }\n }", "function filtered_device_list() {\n\t\treturn array(\n\t\t\t'custom-device' => array(\n\t\t\t\t'label' => __( 'Enter custom-device preview mode' ),\n\t\t\t\t'default' => true,\n\t\t\t),\n\t\t);\n\t}", "function mass_edit() {\n \tif ($this->getControllerName() == 'people') {\n $this->mass_edit_objects = Users::findByIds($this->request->post('selected_item_ids'), STATE_ARCHIVED, $this->logged_user->getMinVisibility());\n } // if\n\n parent::mass_edit();\n }", "public function manageDevice()\n {\n $result = DB::table('tbl_devices')\n ->join('tbl_devices_type','tbl_devices_type.id','=','tbl_devices.device_type')\n ->select('tbl_devices_type.*','tbl_devices.id','tbl_devices.serial_no')\n ->get();\n return view('device.manageDevice')->with('result',$result);\n }", "function admin_edit($vendor_id=null){\n\t\t\n \t\t$vendor_id = DECRYPT_DATA($vendor_id);\n\t\t$this->layout='backend/backend';\n\t\t$this->set(\"title_for_layout\",EDIT_VENDOR);\n\t\tif(!empty($this->data)){\n\t\t\t$data = $this->data;\n\t\t\t$data['Vendor']['id'] = DECRYPT_DATA($data['Vendor']['id']);\n\t\t\t$errors = $this->Vendor->validate_data($data);\n\t\t\tif(count($errors) == 0){\n\t\t\t\tif($this->data['Vendor']['image']['name'] != \"\"){\n\t\t\t\t\t\n\t\t\t\t\tApp::import(\"Component\",\"Upload\");\n\t\t\t\t\t$upload = new UploadComponent();\n\t\t\t\t\t$allowed_ext = array('jpg','jpeg','gif','png','JPG','JPEG','GIF','PNG');\n\t\t\t\t\t$path_info = pathinfo($this->data['Vendor']['image']['name']);\n\t\t\t\t\t$file_extension = strtolower($path_info['extension']);\n\t\t\t\t\tif(in_array($file_extension,$allowed_ext)){\n\t\t\t\t\t\t$file = $this->data['Vendor']['image'];\n\t\t\t\t\t\t$thumb_directory_path = $this->create_directory(\"vendor_image_thumb\");\n\t\t\t\t\t\t$actual_directory_path = $this->create_directory(\"vendor_image_actual\");\n\t\t\t\t\t\t$filename = str_replace(array(\" \",\".\"),\"\",md5(microtime())).\".\".$path_info['extension'];\n\t\t\t\t\t\t$rules['type'] = 'resizecrop';\n\t\t\t\t\t\t$rules['size'] = array (75,50); \n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(file_exists($thumb_directory_path.$data['Vendor']['previous_image'])) {\n\t\t\t\t\t\t unlink($thumb_directory_path.$data['Vendor']['previous_image']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(file_exists($actual_directory_path.$data['Vendor']['previous_image'])) {\n\t\t\t\t\t\t unlink($actual_directory_path.$data['Vendor']['previous_image']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$file_name = $upload->upload($file,$thumb_directory_path,$filename,$rules,$allowed_ext);\n\t\t\t\t\t\t$file_name = $upload->upload($file,$actual_directory_path,$filename,null,$allowed_ext);\n\t\t\t\t\t\tif($file_name){\n\t\t\t\t\t\t\tunset($data['Vendor']['previous_image']);\n\t\t\t\t\t\t\t$data['Vendor']['image'] = $filename;\n\t\t\t\t\t\t\tif($this->Vendor->save($data)){\n\t\t\t\t\t\t\t\t$this->Session->setFlash(RECORD_SAVE, 'message/green');\n\t\t\t\t\t\t\t\t$this->redirect(array('controller'=>\"vendors\",'action'=>'list','admin'=>true)); \n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$this->Session->setFlash(RECORD_ERROR, 'message/red');\n\t\t\t\t\t\t\t\t$this->redirect($this->referer()); \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\t$errors['image'][] = ERR_IMAGE_TYPE;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tunset($data['Vendor']['image']);\n\t\t\t\t\tunset($data['Vendor']['previous_image']);\n\t\t\t\t\tif($this->Vendor->save($data)){\n\t\t\t\t\t\t$this->Session->setFlash(RECORD_SAVE, 'message/green');\n\t\t\t\t\t\t$this->redirect(array(\"controller\"=>\"vendors\",\"action\"=>\"list\",\"admin\"=>true)); \n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->Session->setFlash(RECORD_ERROR, 'message/red');\n\t\t\t\t\t\t$this->redirect(array(\"controller\"=>\"vendors\",\"action\"=>\"edit\",$this->data['Vendor']['id'],\"admin\"=>true));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->set(\"errors\",$errors);\n\t\t\t\n\t\t}else if(isset($vendor_id)){\n\t\t\t\n\t\t\tif($this->is_id_exist($vendor_id,\"Vendor\")){\n\t\t\t\t$this->Vendor->id = $vendor_id;\n\t\t\t\t$data = $this->Vendor->read();\n\t\t\t\t$data['Vendor']['id'] = ENCRYPT_DATA($data['Vendor']['id']);\n\t\t\t\t$this->data = $data;\n\t\t\t}else{\n\t\t\t\t$this->Session->setFlash(NOT_FOUND_ERROR, 'message/red');\n\t\t\t\t$this->redirect(array(\"controller\"=>\"products\",'action'=>'list','admin'=>true));exit();\n\t\t\t}\n\t\t}\n\t\t\n \t}", "public function update(Request $request, Device $device)\n {\n\n }", "public function edit_toko(){\n\t}", "public function getEdit()\n\t{\n\t}", "public function editAction() {\n $id = $this->getInput('id');\n $info = Client_Service_Ad::getAd(intval($id));\n \n $this->assign('ad_type', self::AD_TYPE);\n $this->assign('ad_ptypes', $this->ad_ptypes);\n $this->assign('info', $info);\n }" ]
[ "0.72716296", "0.72716296", "0.72716296", "0.66405857", "0.6520857", "0.6475505", "0.6360235", "0.61721855", "0.6157174", "0.6037695", "0.5956484", "0.5940635", "0.59116346", "0.5898098", "0.58501357", "0.5849175", "0.58098483", "0.5806072", "0.57713515", "0.57611626", "0.5759833", "0.5738608", "0.5736691", "0.5715356", "0.56998426", "0.5691929", "0.56868035", "0.5659791", "0.5659438", "0.56478107", "0.5638336", "0.5630497", "0.5630497", "0.5599703", "0.55945015", "0.55878633", "0.55878633", "0.55878633", "0.5585421", "0.55703646", "0.55605465", "0.55544937", "0.55544937", "0.55544937", "0.55421686", "0.5527045", "0.5527045", "0.5527045", "0.5527045", "0.5527045", "0.5527045", "0.5527045", "0.5527045", "0.5527045", "0.5527045", "0.5527045", "0.5527045", "0.55137247", "0.5510061", "0.5506923", "0.55045307", "0.5503032", "0.5488708", "0.5474984", "0.5472564", "0.5466734", "0.54550916", "0.545273", "0.5439921", "0.5434146", "0.5434146", "0.5434146", "0.5434146", "0.5428854", "0.5427889", "0.5426136", "0.54196554", "0.5416462", "0.5415667", "0.54146266", "0.54060227", "0.54013187", "0.54013187", "0.54013187", "0.5396481", "0.5392449", "0.5390148", "0.538748", "0.5386023", "0.5377096", "0.5365037", "0.536073", "0.5358415", "0.53518647", "0.53448397", "0.53357357", "0.53342664", "0.533262", "0.5330602", "0.53265005", "0.531612" ]
0.0
-1
Get selected device and prepare all registered device
public function getKidAvailable(Request $request) { $selectedDevice = DB::table('devices') ->where('id', '=', $request['deviceId']) ->first(); $registeredDevices = $request->user()->devices()->get(); //Get all registered kids to filter out associated kids $registeredKids = $request->user()->kids()->get(); $index = 0; $registeredKidIdArray[$index] = array(); foreach ($registeredKids as $kid) { $registeredKidIdArray[$index] = $kid->id; $index++; } $kidIdArraylength = $index; //Start filtering out the kids with device $availableKidNames = []; $availableKidNames[-1] = "*Unregister Kid*"; $kidId = $selectedDevice->kid_id; if ($kidId != NULL) { $availableKidNames[0] = $selectedDevice->kid_id; $availableKidNames[$selectedDevice->kid_id] = DB::table('kids') ->where('id', '=', $kidId) ->value('name'); } foreach ($registeredDevices as $device) { if ($device->kid_id != NULL) { $unavailableKidId = array_search($device->kid_id, $registeredKidIdArray); $registeredKidIdArray[$unavailableKidId] = -1; } } //Add available kids to the response array for ($i = 0; $i < $kidIdArraylength; $i++) { $kidId = $registeredKidIdArray[$i]; if ($kidId != -1) { $availableKidNames[$registeredKidIdArray[$i]] = DB::table('kids') ->where('id', '=', $kidId) ->value('name'); } } echo json_encode($availableKidNames); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function set_device(){\n\t\n\t}", "private function handleDevices(){\n\t\t$devices = $this->object->devices; // все оборудование на объекте\n\n\t\tforeach($devices as $device){ // Проходимся по всему оборудованию\n\t\t\t$this->device = $device;\n\t\t\tforeach($device->reglaments as $reglament){ // Получаем все регламенты на оборудование\n\t\t\t\t$this->handleReglament($reglament);\n\t\t\t}\n\t\t\t$this->device = null;\n\t\t}\n\t}", "public function selectNewDevice(){\n\t\t$db = Db::getInstance();\n\n\t\t$req = $db->prepare('SELECT DeviceID FROM Devices ORDER BY RAND() LIMIT 1');\n\t\t$req->execute();\n\t\t$deviceIDNum = $req->fetch();\n\n\t\t$deviceID = $deviceID['DeviceID'];\n\n\t\t//Set all off first\n\t\t$req = $db->prepare(' UPDATE Devices SET ActiveControl = 0');\n\t\t$req->execute(array(':deviceID' => $deviceIDNum));\n\t\t$deviceID = $req->fetch();\n\n\t\t//Switch the selected one on:\n\t\t$req = $db->prepare(' UPDATE Devices SET ActiveControl = 1 WHERE DeviceID = :deviceID');\n\t\t$req->execute(array(':deviceID' => $deviceIDNum));\n\t\t$deviceID = $req->fetch();\n\n\t}", "abstract public function listDevices();", "function rebuildDeviceData() {\n\t\tsystemLog::notice('Starting rebuild of device data');\n\t\t$oStmt = dbManager::getInstance()->prepare('SELECT deviceID FROM '.system::getConfig()->getDatabase('wurfl').'.devices WHERE rootDevice = 1');\n\t\tif ( $oStmt->execute() ) {\n\t\t\tforeach ( $oStmt as $row ) {\n\t\t\t\tsystemLog::getInstance()->setSource('rebuild]['.$row['deviceID']);\n\t\t\t\t$oDevice = wurflManager::getInstance($row['deviceID']);\n\t\t\t\tsystemLog::notice('Processing deviceID '.$row['deviceID']);\n\t\t\t\t$oDevice->setModelName($oDevice->getCapabilities()->getCapability('model_name'));\n\t\t\t\t\n\t\t\t\t$oMan = wurflManufacturer::getInstance($oDevice->getCapabilities()->getCapability('brand_name'));\n\t\t\t\tif ( $oMan->getManufacturerID() > 0 ) {\n\t\t\t\t\t$oDevice->setManufacturerID($oMan->getManufacturerID());\n\t\t\t\t}\n\t\t\t\t$oDevice->save();\n\t\t\t}\n\t\t}\n\t}", "public function getDeployedDevices(){\r\n global $pdo;\r\n $select = $pdo->prepare(\"SELECT * FROM devices LEFT JOIN device_installations \r\n \t\tON devices.id=device_installations.device_id WHERE device_installations.status=1\");\r\n \t$select->execute();\r\n\t$devices=array();\r\n\twhile($row = $select->fetch(PDO::FETCH_ASSOC)){\r\n\t\t$devices[$row['device_id_string']]=$row;\r\n\t}\r\n\treturn $devices;\r\n\r\n}", "function device_get()\n {\n // // Authenticate user (by session)\n // // Check if a user is currently logged in\n if(!$this->session->userdata('LoggedIn')){\n // die(\"Login Required\");\n }\n\n if(!$this->get('id')){\n $this->response(NULL, 400);\n }\n\n // Load the device model\n $this->load->model('device_model');\n \n // Get the required device parameters from the POST data\n $postDevice = $this->input->get('device');\n \n // Get the full device/system information\n $device = $this->device_model->getDeviceInfo( $this->get('id') );\n \n if($device){\n $this->response($device, 200); // 200 being the HTTP response code\n }else{\n $this->response(NULL, 404);\n }\n }", "function device_update_get()\n {\n // Only the TP link smart plugs support broadcast scanning so far\n $deviceParams = array('id' => $this->get('id'), 'model' => 'HS110');\n $this->load->library('drivers/hs1xx', $deviceParams);\n\n print_r($this->hs1xx->updateDevices());\n }", "function devices_get()\n {\n // // Authenticate user (by session)\n // // Check if a user is currently logged in\n if(!$this->session->userdata('LoggedIn')){\n // die(\"Login Required\");\n }\n\n // Load the device model\n $this->load->model('device_model');\n\n // If the optional roomid parameter is supplied\n if($this->get('roomid')){\n // Get the devices from particular room\n $deviceList = $this->device_model->getAvailableDevicesByRoom( $this->get('roomid') );\n }else{\n // Get the from all rooms\n $deviceList = $this->device_model->getAvailableDevices();\n }\n\n // If the deviceList is not FALSE or NULL\n if($deviceList){\n $this->response($deviceList, 200); // 200 being the HTTP response code\n }else{\n $this->response(NULL, 404);\n }\n }", "public function all_devices() {\n\t\t// Global\n\t\tglobal $wpdb;\n\t\t\n\t\t// Load the devices from the database as an array\n\t\t$sql = \"SELECT * FROM `\" . rpids_tableprefix() . \"rpids_devices` ORDER BY `did` ASC;\";\n\t\t$devices = $wpdb->get_results( $sql, ARRAY_A );\n\t\t\n\t\t// Set the return object\n\t\t$return = new StdClass();\n\t\t\n\t\t// Loop through each device\n\t\tforeach( $devices as $device ) {\n\t\t\t// Add the device info to the return object\n\t\t\t$return->$device['id'] = new StdClass();\n $return->$device['id']->id = $device['id'];\n\t\t\t$return->$device['id']->did = $device['did'];\n\t\t\t$return->$device['id']->model = $device['model'];\n\t\t\t$return->$device['id']->hversion = $device['hversion'];\n\t\t\t$return->$device['id']->sversion = $device['sversion'];\n\t\t\t$return->$device['id']->type = $device['type'];\n\t\t\t$return->$device['id']->builder = $device['builder'];\n\t\t}\n\t\treturn (object) $return;\n\t}", "public abstract function registerDevice();", "public static function list_devices()\n {\n return self::$devices;\n }", "function get() \n {\n //parse params\n $this->parseGetParams();\n $responseData = array();\n\n foreach ($this->parameters as $key => $value)\n {\n if (strtolower($value) == \"all\")\n {\n $responseData = $this->queryAllDIIDInfo();\n }\n else\n {\n $responseData = $this->queryDIIDInfo($value);\n }\n }\n\n $this->generateResponseXML($responseData, \"device_instance\");\n }", "public function getDevices()\n {\n return $this->devices;\n }", "function getDevicesResult() {\n\treturn db_query(\"SELECT name as Name, lpad(hex(serial),16,'0') as Serial, type as Type, active as Active FROM Devices\");\n}", "public function getDeviceManufacturer() {}", "private function getDevices()\r\n {\r\n $UDN = $this->info->device->device->UDN;\r\n $data = '<?xml version=\"1.0\"?>\r\n <s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\r\n <s:Body>\r\n <u:GetEndDevices xmlns:u=\"urn:Belkin:service:bridge:1\">\r\n <ReqListType>SCAN_LIST</ReqListType>\r\n <DevUDN>'.$UDN.'</DevUDN>\r\n </u:GetEndDevices>\r\n </s:Body>\r\n </s:Envelope>';\r\n\r\n $headers_array = array(\r\n 'Content-type: text/xml; charset=\"utf-8\"',\r\n 'SOAPACTION: \"urn:Belkin:service:bridge:1#GetEndDevices\"',\r\n 'Accept: ',\r\n );\r\n $url = \"http://\".WEMO_IP.\":\".WEMO_PORT.\"/upnp/control/bridge1\";\r\n $response = $this->sendCurl($url,$data,$headers_array);\r\n\r\n // Fix the xml\r\n $response = str_replace('&lt;', '<', $response);\r\n $response = str_replace('&gt;', '>', $response);\r\n $response = str_replace('&quot;', '\"', $response);\r\n $response = str_replace(':', '', $response);\r\n // To be valid xml, the xml string must be at the front\r\n $response = str_replace('<?xml version=\"1.0\" encoding=\"utf-8\"?>', '', $response);\r\n $response = '<?xml version=\"1.0\" encoding=\"utf-8\"?>'.$response;\r\n\r\n // return $response;\r\n $response = $this->parseXML($response)->sBody->uGetEndDevicesResponse->DeviceLists\r\n ->DeviceLists->DeviceList->DeviceInfos;\r\n return $response;\r\n }", "function get_dev_data($host_data, $devid)\n{\n\n $arr = array ('command'=>'gpu','parameter'=>$devid);\n $dev_arr = send_request_to_host($arr, $host_data);\n \n return $dev_arr['GPU']['0'];\n}", "public function listDevices()\n {\n\t\t$data = $this->call(array(), \"GET\", \"devices.json\");\n\t\t$data = $data->{'devices'};\n\t\t$deviceArray = new ArrayObject();\n\t\tfor($i = 0; $i<count($data);$i++){\n\t\t\t$deviceArray->append(new Device($data[$i], $this));\n\t\t}\n\t\treturn $deviceArray;\n }", "public function devicedetailsAction ()\n {\n $db = Zend_Db_Table::getDefaultAdapter();\n $deviceID = $this->_getParam('deviceid', false);\n\n try\n {\n if ($deviceID > 0)\n {\n // get toners for device\n $select = $db->select()\n ->from([\n 't' => 'toners'\n ])\n ->join([\n 'td' => 'device_toners'\n ], 't.id = td.toner_id')\n ->where('td.master_device_id = ?', $deviceID);\n $stmt = $db->query($select);\n\n $result = $stmt->fetchAll();\n $toner_array = '';\n foreach ($result as $key)\n {\n if (!empty($toner_array))\n {\n $toner_array .= \",\";\n }\n $toner_array .= \"'\" . $key ['toner_id'] . \"'\";\n }\n\n $select = $db->select()\n ->from([\n 'md' => 'master_devices'\n ])\n ->joinLeft([\n 'm' => 'manufacturers'\n ], 'm.id = md.manufacturerId')\n ->joinLeft([\n 'rd' => 'replacement_devices'\n ], 'rd.masterDeviceId = md.id')\n ->where('md.id = ?', $deviceID);\n $stmt = $db->query($select);\n $row = $stmt->fetchAll();\n $launch_date = new Zend_Date($row [0] ['launchDate'], \"yyyy/mm/dd HH:ii:ss\");\n $formData = [\n 'launch_date' => $launch_date->toString('mm/dd/yyyy'),\n 'toner_config_id' => $row [0] ['tonerConfigId'],\n 'is_copier' => $row [0] ['isCopier'] ? true : false,\n 'is_fax' => $row [0] ['isFax'] ? true : false,\n 'is_duplex' => $row [0] ['isDuplex'] ? true : false,\n 'is_a3' => $row [0] ['isA3'] ? true : false,\n 'reportsTonerLevels' => $row [0] ['reportsTonerLevels'] ? true : false,\n 'is_replacement_device' => $row [0] ['isReplacementDevice'],\n 'watts_power_normal' => $row [0] ['wattsPowerNormal'],\n 'watts_power_idle' => $row [0] ['wattsPowerIdle'],\n 'device_price' => ($row [0] ['cost'] > 0 ? (float)$row [0] ['cost'] : \"\"),\n 'is_deleted' => $row [0] ['is_deleted'],\n 'toner_array' => $toner_array,\n 'replacement_category' => $row [0] ['replacementCategory'],\n 'print_speed' => $row [0] ['print_speed'],\n 'resolution' => $row [0] ['resolution'],\n 'monthly_rate' => $row [0] ['monthly_rate'],\n 'is_leased' => $row [0] ['isLeased'] ? true : false,\n 'leased_toner_yield' => $row [0] ['leasedTonerYield'],\n 'ppm_black' => $row [0] ['ppmBlack'],\n 'ppm_color' => $row [0] ['ppmColor'],\n 'partsCostPerPage' => $row [0] ['partsCostPerPage'],\n 'laborCostPerPage' => $row [0] ['laborCostPerPage'],\n ];\n }\n else\n {\n // empty form values\n $formData = [];\n }\n }\n catch (Exception $e)\n {\n // critical exception\n Throw new exception(\"Critical Error: Unable to find device.\", 0, $e);\n } // end catch\n\n $this->sendJson($formData);\n }", "public function getAllDevice(){\n $query = \"select distinct device_id from $this->basicSensorLog_tableName\";\n $result = $this->dbh->query($query);\n if($result->rowCount() > 0){\n return $result->fetchAll();\n }\n return null;\n }", "abstract public function loadDeviceInfo($device, $user = null, $params = array());", "public function additionDevice()\n {\n global $dbh;\n $sql = $dbh->prepare(\"INSERT INTO `device`(`nameva`, `nameve`, `deletv`)VALUES('$this->nameva' ,'$this->nameve' ,'$this->deletv')\");\n $result = $sql->execute();\n $id = $dbh->lastInsertId();\n return array ($result,$id);\n }", "public function get_device_registered($id, $port)\n {\n if(empty($port))\n {\n $ont_port = '';\n }\n else\n {\n $ont_port = '.'.$port;\n }\n $if_aliases = $this->device_model->get_device_interfaces_alias_sql($id);\n // get ONT Registered\n $oid = '1.3.6.1.4.1.2011.6.128.1.1.2.43.1.3'.$ont_port;\n $registered = $this->snmp_model->get_snmp_indexed_oid($id, $oid);\n // get ONT descs\n $oid = '1.3.6.1.4.1.2011.6.128.1.1.2.43.1.9'.$ont_port;\n $ont_desc = $this->snmp_model->get_snmp_indexed_oid($id, $oid);\n if(!empty($port))\n {\n // get ONT online\n $oid = '1.3.6.1.4.1.2011.6.128.1.1.2.62.1.21'.$ont_port;\n $ont_status = $this->snmp_model->get_snmp_indexed_oid($id, $oid);\n // get ONT signal\n $oid = '1.3.6.1.4.1.2011.6.128.1.1.2.51.1.4'.$ont_port;\n $ont_signal = $this->snmp_model->get_snmp_indexed_oid($id, $oid);\n }\n\n // set Desc by SNMP results\n foreach ($registered as $key => $item) {\n $registered[$key]['desc'] = $ont_desc[$key]['value'];\n $registered[$key]['signal'] = $ont_signal[$key]['value']/100;\n $registered[$key]['status'] = $ont_status[$key]['value'];\n $registered[$key]['if_alias'] = $if_aliases[$item['if_index']];\n }\n return $registered;\n }", "public function initial_device($id)\n {\n // get template\n $interfaces_tpl = $this->device_model->get_device_interfaces_tpl();\n // get snmp interfaces\n $interfaces = $this->snmp_model->get_device_interfaces_snmp($id);\n // перебор установленных плат\n foreach ($interfaces_tpl as $item) {\n // $key поиск наличия такой записи в таблице опроса устройства\n $key = array_search($item['if_index'], array_column($interfaces, 'ifIndex'));\n if ($key)\n {\n $data = array(\n 'id_device' => $id,\n 'if_index' => $item['if_index'],\n 'if_real_index' => $item['if_real_index'],\n 'ifName\t' => $item['ifName'],\n 'svlan' => null,\n 'cvlan_start' => $item['cvlan_start'],\n 'service_start' => $item['service_start'],\n 'active' => 1,\n );\n }\n else\n {\n $data = array(\n 'id_device' => $id,\n 'if_index' => $item['if_index'],\n 'if_real_index' => $item['if_real_index'],\n 'ifName\t' => $item['ifName'],\n 'svlan' => null,\n 'cvlan_start' => $item['cvlan_start'],\n 'service_start' => $item['service_start'],\n 'active' => 0,\n );\n }\n // add to DB\n $this->db->insert('interfaces', $data);\n }\n\n return 1;\n }", "public function __construct(){\n include('knowndevices.php');\n $this->knownDevices=$KNOWN_DEVICES;\n }", "public function GetDevices()\n {\n return $this->deviceManager;\n }", "function getAllDevices() {\n //get devices from tdtool\n $devs = shell_exec(\"tdtool --list-devices\");\n\n //turn raw result into array\n $devicelist = array();\n preg_match_all('/type=(?<type>\\w+)\\tid=(?<id>\\d+)\\tname=(?<name>[a-zA-ZæøåÆØÅ\\-]+)\\tlastsentcommand=(?<lastcommand>\\w+)/', $devs, $matches);\n for ($x = 0; $x < count($matches[0]); $x++) {\n $devicelist[] = array(\"id\" => $matches[\"id\"][$x], \"name\" => $matches[\"name\"][$x], \"lastcommand\" => $matches[\"lastcommand\"][$x]);\n }\n return $devicelist;\n}", "public function add_device( $did = '', $model = '', $hversion = '', $sversion = '', $type = '', $builder = '', $reg_device = '' ) {\n\t\tglobal $wpdb;\n\t\tglobal $rpids_api;\n \n try {\n // Process the parameters\n if( @$did != '' ) {\n $did = sanitize_text_field( $did );\n } else {\n $did = '0';\n }\n \n if( @$model != '' ) {\n $model = sanitize_text_field( $model );\n }\n \n if( @$hversion != '' ) {\n $hversion = sanitize_text_field( $hversion );\n }\n \n if( @$sversion != '' ) {\n $sversion = sanitize_text_field( $sversion );\n }\n \n if( @$type != '' ) {\n $type = sanitize_text_field( $type );\n }\n \n if( @$builder != '' ) {\n $builder = sanitize_text_field( $builder );\n }\n \n if( @$reg_device != '' ) {\n $reg_device = sanitize_text_field( $reg_device );\n } else {\n $reg_device = false;\n }\n \n // Get the current user\n $current_user = wp_get_current_user();\n \n if( $reg_device ) {\n // If $builder is empty, set it to the current user's email\n if( $builder = '' ) {\n $builder = $current_user->user_email;\n }\n \n // Register the device with the central server\n $rpids_register = $rpids_api->register_device( $model, $hversion, $sversion, $type, $builder );\n \n // Success? If yes, update the did variable\n if( $rpids_register['status'] == 'success' ) {\n $did = $rpids_register['did'];\n }\n }\n \n // Should we verify the device and claim it?\n if( $did != '0' ) {\n // DID is set (and not 0)\n // Check if the device is already in the database\n $sql = \"SELECT * FROM `\" . rpids_tableprefix() . \"rpids_devices` WHERE `did`='\" . $did . \"';\";\n $device = $wpdb->get_row($sql, ARRAY_A);\n \n if( $device != null ) {\n // Device has already been added\n throw new Exception( 'That device has already been added.' );\n } else {\n // Connect to the central server and claim the device\n $rpids_return = $rpids_api->claim_device( $did, $current_user->user_email );\n // Why email? If the device is given away or sold, but not removed from an account, we need to know who to contact for the new owner.\n \n // Check the status of $rpids_return\n if( $rpids_return['status'] == 'otheruser') {\n // The device is claimed by someone else\n throw new Exception( 'That device ID is already claimed. If you received the device used make sure the previous owner has transferred ownership.' );\n } elseif( $rpids_return['status'] == 'notfound') {\n // DID not found\n throw new Exception( 'That Device ID was not found. The device must be registered before you can add it.');\n } elseif( $rpids_return['status'] != 'success' ) {\n // Other error\n throw new Exception( 'Well that\\'s strange. Something went wrong, but we have no clue what.' );\n }\n \n // Looks like status == success\n // Get the device details\n $rpids_results = $rpids_api->get_device_info( $did );\n \n // Update the device info variables\n $model = sanitize_text_field( $rpids_results['model'] );\n $hversion = sanitize_text_field( $rpids_results['hversion'] );\n $sversion = sanitize_text_field( $rpids_results['sversion'] );\n $type = sanitize_text_field( $rpids_results['type'] );\n $builder = sanitize_text_field( $rpids_results['builder'] );\n }\n }\n \n // Now, add the device to the database\n $wpdb->insert( rpids_tableprefix() . \"rpids_devices\",\n array(\n \"did\" => $did,\n \"model\" => $model,\n\t\t\t\t \"hversion\" => $hversion,\n\t\t\t\t \"sversion\" => $sversion,\n\t\t\t\t \"type\" => $type,\n\t\t\t\t \"builder\" => $builder\n )\n );\n \n // Return success\n if( $reg_device ) {\n return (object) array(\n \"status\" => \"success\",\n \"message\" => \"Device registered and added.\"\n );\n }\n\t\t} catch ( Exception $e ) {\n return (object) array(\n\t\t\t\t\"status\" => \"error\",\n\t\t\t\t\"message\" => $e->getMessage()\n\t\t\t);\n }\n\t}", "public function devices()\n {\n $this->db->select('*');\n $this->db->select('*');\n $query = $this->db->get('analytics');\n \n }", "public function addDevice() {\n\t\t$attemps = 0;\n\t\t//Random number to be used as the Customer ID: \n\t\t$randomNumber;\n\n\t\tdo {\n\n\t\t\tif($attemps > 5){\n\t\t\t\t//More than five atetmpts to get an unused ID, something is BADLY wrong.\n\t\t\t\terror_log(\"FATAL ERROR, Unable to find a unique Id for the new Product\");\n\t\t\t\tdie();\n\t\t\t}\n\n \t\t//Generate a psudo random number for use as the id, no need for crytographic randomness, not thsi does pose a limuit on the number of custoemrs! :)\n\t\t\t$randomNumber = rand(100, 9999999);\n\n\t\t\t//Check to see that the index is not in use:\n\t\t\t$db = Db::getInstance();\n\n\t\t\t$req = $db->prepare('SELECT * FROM Devices Where DeviceID = :DeviceID limit 5');\n\t\t\t$req->execute(array(':DeviceID' => $randomNumber));\n\t\t\t$deviceIDGet = $req->fetchAll();\n\n\t\t\t$attemps++;\n\n\t\t} while (count($deviceIDGet) > 0);\n\n\n\t\t//Save the new Enquiry to the database with the generated unique ID.\n\t\t$db = Db::getInstance();\n\n\t\t$req = $db->prepare('INSERT INTO Devices(DeviceID) VALUES (:DeviceID)');\n\t\t$req->execute(array(':DeviceID' => $randomNumber ));\n\n\t\t//Return the New DevcieID\n\t\treturn $randomNumber;\n\n\t}", "public function searchForDeviceAction ()\n {\n $masterDeviceId = $this->getParam('masterDeviceId', false);\n\n if ($masterDeviceId !== false)\n {\n // TODO: Return a result (maybe move this whole thing over to the api module?)\n }\n else\n {\n $onlyQuoteDevices = $this->_getParam(\"onlyQuoteDevices\", false);\n $searchTerm = \"%\" . implode('%', explode(' ', $this->_getParam('searchTerm', ''))) . \"%\";\n $manufacturerId = $this->_getParam('manufacturerId', false);\n\n $filterByManufacturer = null;\n if ($manufacturerId !== false)\n {\n $manufacturer = ManufacturerMapper::getInstance()->find($manufacturerId);\n if ($manufacturer instanceof ManufacturerModel)\n {\n $filterByManufacturer = $manufacturer->id;\n }\n }\n\n if ($onlyQuoteDevices)\n {\n $jsonResponse = DeviceMapper::getInstance()->searchByName($searchTerm, Zend_Auth::getInstance()->getIdentity()->dealerId, $filterByManufacturer);\n }\n else\n {\n $jsonResponse = MasterDeviceMapper::getInstance()->searchByName($searchTerm, $filterByManufacturer);\n }\n }\n\n\n $this->sendJson($jsonResponse);\n\n }", "public static function get_all()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$devices = DB::table('devices')->get();\n\t\t\treturn $devices;\n\t\t}\n\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tLog::write('error', $e->getMessage());\n\t\t\tthrow $e;\n\t\t}\n\t}", "private function scp_enabled_device_classes()\r\n\t{\r\n\t\r\n\t\tif ($this->_specific_connect_class == null) {\r\n\t\r\n\t\t\ttry {\r\n\t\t\t\t\t\r\n\t\t\t\treturn new Thelist_Model_devicerouteros($this->_fqdn, $this->_auth_obj);\r\n\t\t\t\t\t\r\n\t\t\t} catch (Exception $e) {\r\n\t\t\t\t\t\r\n\t\t\t\tswitch($e->getCode()){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tcase 1;\r\n\t\t\t\t\treturn new Thelist_Model_devicebairos($this->_fqdn, $this->_auth_obj);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault;\r\n\t\t\t\t\tthrow $e;\r\n\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t} else if ($this->_specific_connect_class == 'routeros') {\r\n\t\r\n\t\t\t$device_routeros = new Thelist_Model_devicerouteros($this->_fqdn, $this->_auth_obj);\r\n\t\r\n\t\t\tif ($device_routeros != false) {\r\n\t\t\t\treturn $device_routeros;\r\n\t\t\t} else {\r\n\t\t\t\tthrow new exception(\"you specified \".$specific_class.\" as the class of device \".$this->_fqdn.\" this failed\");\r\n\t\t\t}\r\n\t\r\n\t\t} else if ($this->_specific_connect_class == 'bairos') {\r\n\t\t\t\t\r\n\t\t\t$device_bairos = new Thelist_Model_devicebairos($this->_fqdn, $this->_auth_obj);\r\n\t\t\t\t\r\n\t\t\tif ($device_bairos != false) {\r\n\t\t\t\treturn $device_bairos;\r\n\t\t\t} else {\r\n\t\t\t\tthrow new exception(\"you specified \".$specific_class.\" as the class of device \".$this->_fqdn.\" this failed\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function getDeviceDetailsfunction($userId){\r\n global $pdo;\t\r\n\t\t$select = $pdo->prepare(\"SELECT device_registry.* \r\n FROM users \r\n LEFT JOIN device_registry ON users.device=device_registry.id \r\n\t\t\t\t WHERE users.id = ?\");\r\n\t\t$select->execute(array($userId));\r\n\t\t$result_array = $select->fetch(PDO::FETCH_ASSOC);\r\n\t\treturn $result_array;\r\n\t}", "public function get_devices()\n {\n $this->db->from('device');\n $this->db->order_by('name', 'ASC');\n $this->db->join('device__types', 'device__types.id_type = device.device_type');\n $query = $this->db->get();\n return $query->result_array();\n }", "function common_device_init(){\r\n\t//Get perangkat mekanik yang terhubung\r\n\t//Get query dan pass\r\n\t$query = \"SELECT * FROM tbl_konfigurasi\";\r\n\t$conf = mysql_fetch_assoc(mysql_query($query));\r\n\t//Reset FIFO Camera\r\n\t$file = $_SERVER['DOCUMENT_ROOT'] . '/FIFO';\r\n\tfile_put_contents($file, '');\r\n\t//Get parameter mekanik yang diambil dari database\r\n\t$query = $conf['konfigurasi_query'];\r\n\t$pass = $conf['konfigurasi_pass'];\r\n\t$pwm = $conf['konfigurasi_pwm'];\r\n\t$servoX = $conf['konfigurasi_servoX'];\r\n\t$servoY = $conf['konfigurasi_servoY'];\r\n\t$laser = $conf['konfigurasi_laser'];\r\n\t$flash = $conf['konfigurasi_flash'];\r\n\t\r\n\t$dev = common_serial_get_connected_device($query, $pass);\r\n\t//Set variabel dev menjadi variabel sesi agar mudah diakses\r\n\tif(empty($dev) || !isset($dev)){\r\n \t\t$dev = '/dev/null';\r\n\t}\r\n\t$_SESSION['dev'] = $dev;\r\n\t//Simpan alamat perangkat terhubung\r\n\t$query = sprintf(\"UPDATE tbl_konfigurasi SET konfigurasi_dev = '%s'\", mysql_real_escape_string($dev));\r\n\t//Eksekusi query\r\n\tmysql_query($query);\r\n\t//Inisialisasi perangkat agar bisa digunakan\r\n\tcommon_init_serial($dev);\r\n\t//Set parameter mekanik sebelumnya\r\n\tcommon_serial_write('m'.$servoX.'o'.$servoY.'o',$dev);\r\n\tcommon_serial_write('p'.$pwm.'o',$dev);\r\n}", "function getRegisteredDevices() {\n\trequire_once __DIR__ . '/firebase.php';\n\n\t$firebase = new Firebase();\n\t$clientsJson = $firebase->getJson('');\n\t$devices = json_decode($clientsJson, true);\n\tforeach ( $devices as $key => $device ) {\n\t\tunset( $device[ 'messages' ] );\n\t\t$device[ 'deviceKey' ] = $key;\n\t\t$devices[ $key ] = $device;\n\t}\n\techo json_encode( $devices );\n}", "function getHardware(){\n \ttry{\n \t\t$db = getConnection();\n\n \t\t$sql = \"SELECT id,code,name FROM supported_hardware\";\n\t\t\t$stmt = $db->prepare($sql);\n\t\t\t$stmt->execute();\n\t\t\t$result = $stmt->fetchAll();\n\t\t\t\n\t\t\t$stmt = null;\n\t \t$db = null;\n\t\t}\n\t\tcatch(PDOException $e){\n\t\t echo $e->getMessage();\n\t }\n\t \n\t return $result;\n }", "function GetInfos($ID_Device,$xml_auth_rep,$type) {\n\t\tglobal $DB,$CFG_GLPI,$LANG;\n\n\t\t$config = new PluginFusioninventoryConfig;\n\n\t\tif ($ID_Device != \"all\") {\n\t\t\tswitch ($type) {\n\t\t\t\tcase NETWORKING_TYPE :\n\t\t\t\t\t$query = \"SELECT *\n FROM `glpi_plugin_fusioninventory_networking`\n WHERE `FK_networking`='\".$ID_Device.\"';\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase PRINTER_TYPE :\n\t\t\t\t\t$query = \"SELECT *\n FROM `glpi_plugin_fusioninventory_printers`\n WHERE `FK_printers`='\".$ID_Device.\"';\";\n\t\t\t\t\tbreak;\n\t\t\t}\t\t\n\t\t\t$result=$DB->query($query);\n\t\t\tif ($DB->numrows($result) > 0) {\n\t\t\t\t$ID_auth = $DB->result($result,0,\"FK_snmp_connection\");\n } else {\n\t\t\t\treturn;\n }\n\t\t} else {\n\t\t\t// Put Default community of devices\n\t\t\t$snmp_auth[0][\"Name\"] = \"Public-v2c\";\n\t\t\t$snmp_auth[0][\"snmp_version\"] = \"2c\";\n\t\t\t$snmp_auth[0][\"community\"] = \"public\";\n\t\t\t$snmp_auth[0][\"sec_name\"] = \"\";\n\t\t\t$snmp_auth[0][\"auth_protocol\"] = \"\";\n\t\t\t$snmp_auth[0][\"auth_passphrase\"] = \"\";\n\t\t\t$snmp_auth[0][\"priv_protocol\"] = \"\";\n\t\t\t$snmp_auth[0][\"priv_passphrase\"] = \"\";\t\t\t\n\t\t\t$snmp_auth[0][\"ID\"] = 0;\n\t\t\t$snmp_auth[1][\"Name\"] = \"Public-v1\";\n\t\t\t$snmp_auth[1][\"snmp_version\"] = \"1\";\n\t\t\t$snmp_auth[1][\"community\"] = \"public\";\n\t\t\t$snmp_auth[1][\"sec_name\"] = \"\";\n\t\t\t$snmp_auth[1][\"auth_protocol\"] = \"\";\n\t\t\t$snmp_auth[1][\"auth_passphrase\"] = \"\";\n\t\t\t$snmp_auth[1][\"priv_protocol\"] = \"\";\n\t\t\t$snmp_auth[1][\"priv_passphrase\"] = \"\";\t\t\n\t\t\t$snmp_auth[1][\"ID\"] = 0;\n\t\t}\n\n\t\tif ($config->getValue(\"authsnmp\") == \"file\") {\n\t\t\t$xml = simplexml_load_file($xml_auth_rep.\"auth.xml\");\n\t\t\n\t\t\t$i=-1;\n\t\t\tforeach($xml->auth[0] as $num) {\n\t\t\t\t$i++;\n\t\t\t\t$j = 0;\n\t\t\t\t$recup = 0;\n\t\t\t\tforeach($xml->auth->conf[$i] as $item) {\n\t\t\t\t\t$j++;\n\t\t\t\t\tswitch ($j) {\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tif ($ID_Device == \"all\") {\n\t\t\t\t\t\t\t\t$recup = 1;\n\t\t\t\t\t\t\t\t$snmp_auth[($i+2)][\"ID\"] = $item;\n\t\t\t\t\t\t\t} else if ($item == $ID_auth) {\n\t\t\t\t\t\t\t\t$recup = 1;\n }\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tif (($recup == \"1\") AND ($ID_Device != \"all\")) {\n\t\t\t\t\t\t\t\t$snmp_auth[\"Name\"] = $item;\n }\n\t\t\t\t\t\t\tif ($ID_Device == \"all\") {\n\t\t\t\t\t\t\t\t$snmp_auth[($i+2)][\"Name\"] = $item;\n }\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tif (($recup == \"1\") AND ($ID_Device != \"all\")) {\n\t\t\t\t\t\t\t\t$snmp_auth[\"snmp_version\"] = Dropdown::getDropdownName(\n \"glpi_plugin_fusioninventory_snmpversions\",$item);\n }\n\t\t\t\t\t\t\tif ($ID_Device == \"all\") {\n\t\t\t\t\t\t\t\t$snmp_auth[($i+2)][\"snmp_version\"] = Dropdown::getDropdownName(\n \"glpi_plugin_fusioninventory_snmpversions\",$item);\n }\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\tif (($recup == \"1\") AND ($ID_Device != \"all\")) {\n\t\t\t\t\t\t\t\t$snmp_auth[\"community\"] = $item;\n }\n\t\t\t\t\t\t\tif ($ID_Device == \"all\") {\n\t\t\t\t\t\t\t\t$snmp_auth[($i+2)][\"community\"] = $item;\n }\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\tif (($recup == \"1\") AND ($ID_Device != \"all\")) {\n\t\t\t\t\t\t\t\t$snmp_auth[\"sec_name\"] = $item;\n }\n\t\t\t\t\t\t\tif ($ID_Device == \"all\") {\n\t\t\t\t\t\t\t\t$snmp_auth[($i+2)][\"sec_name\"] = $item;\n }\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 7:\n\t\t\t\t\t\t\tif (($recup == \"1\") AND ($ID_Device != \"all\")) {\n\t\t\t\t\t\t\t\t$snmp_auth[\"auth_protocol\"] = Dropdown::getDropdownName(\n \"glpi_plugin_fusioninventory_snmpprotocolauths\",$item);\n }\n\t\t\t\t\t\t\tif ($ID_Device == \"all\") {\n\t\t\t\t\t\t\t\t$snmp_auth[($i+2)][\"auth_protocol\"] = Dropdown::getDropdownName(\n \"glpi_plugin_fusioninventory_snmpprotocolauths\",$item);\n }\n\t\t\t\t\t\t\tbreak;\n\n case 8:\n\t\t\t\t\t\t\tif (($recup == \"1\") AND ($ID_Device != \"all\")) {\n\t\t\t\t\t\t\t\t$snmp_auth[\"auth_passphrase\"] = $item;\n }\n\t\t\t\t\t\t\tif ($ID_Device == \"all\") {\n\t\t\t\t\t\t\t\t$snmp_auth[($i+2)][\"auth_passphrase\"] = $item;\n }\n\t\t\t\t\t\t\tbreak;\n \n\t\t\t\t\t\tcase 9:\n\t\t\t\t\t\t\tif (($recup == \"1\") AND ($ID_Device != \"all\")) {\n\t\t\t\t\t\t\t\t$snmp_auth[\"priv_protocol\"] = Dropdown::getDropdownName(\n \"glpi_plugin_fusioninventory_snmpprotocolprivs\",$item);\n }\n\t\t\t\t\t\t\tif ($ID_Device == \"all\") {\n\t\t\t\t\t\t\t\t\t$snmp_auth[($i+2)][\"priv_protocol\"] = Dropdown::getDropdownName(\n \"glpi_plugin_fusioninventory_snmpprotocolprivs\",$item);\n }\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 10:\n\t\t\t\t\t\t\tif (($recup == \"1\") AND ($ID_Device != \"all\")) {\n $snmp_auth[\"priv_passphrase\"] = $item;\n }\n\t\t\t\t\t\t\tif ($ID_Device == \"all\") {\n\t\t\t\t\t\t\t\t\t$snmp_auth[($i+2)][\"priv_passphrase\"] = $item;\n }\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t} else if ($config->getValue(\"authsnmp\") == \"DB\") {\n\t\t\tif ($ID_Device == \"all\") {\n\t\t\t\t$query = \"SELECT *\n FROM `glpi_plugin_fusioninventory_snmpauths`\";\n } else {\n\t\t\t\t$query = \"SELECT *\n FROM `glpi_plugin_fusioninventory_snmpauths`\n WHERE `ID`='\".$ID_auth.\"';\";\n\t\t\t}\n\t\t\t$result=$DB->query($query);\n\t\t\tif (($DB->numrows($result) == \"0\") AND ($ID_Device != \"all\")) {\n\t\t\t\t$snmp_auth[\"Name\"] = \"\";\n\t\t\t\t$snmp_auth[\"snmp_version\"] = \"\";\n\t\t\t\t$snmp_auth[\"community\"] = \"\";\n\t\t\t\t$snmp_auth[\"sec_name\"] = \"\";\n\t\t\t\t$snmp_auth[\"auth_protocol\"] = \"\";\n\t\t\t\t$snmp_auth[\"auth_passphrase\"] = \"\";\n\t\t\t\t$snmp_auth[\"priv_protocol\"] = \"\";\n\t\t\t\t$snmp_auth[\"priv_passphrase\"] = \"\";\n\t\t\t} else if ($ID_Device != \"all\") {\n\t\t\t\t$snmp_auth[\"Name\"] = $DB->result($result,0,\"name\");\n\t\t\t\t$snmp_auth[\"snmp_version\"] = Dropdown::getDropdownName(\n \"glpi_plugin_fusioninventory_snmpversions\",$DB->result($result,0,\n \"FK_snmp_version\"));\n\t\t\t\t$snmp_auth[\"community\"] = $DB->result($result,0,\"community\");\n\t\t\t\t$snmp_auth[\"sec_name\"] = $DB->result($result,0,\"sec_name\");\n\t\t\t\t$snmp_auth[\"auth_protocol\"] = Dropdown::getDropdownName(\n \"glpi_plugin_fusioninventory_snmpprotocolauths\",$DB->result($result,0,\n \"auth_protocol\"));\n\t\t\t\t$snmp_auth[\"auth_passphrase\"] = $DB->result($result,0,\"auth_passphrase\");\n\t\t\t\t$snmp_auth[\"priv_protocol\"] = Dropdown::getDropdownName(\n \"glpi_plugin_fusioninventory_snmpprotocolprivs\",$DB->result($result,0,\n \"priv_protocol\"));\n\t\t\t\t$snmp_auth[\"priv_passphrase\"] = $DB->result($result,0,\"priv_passphrase\");\n\t\t\t} else if ($ID_Device == \"all\") {\n\t\t\t\t$i = 2;\n\t\t\t\twhile ($data=$DB->fetch_array($result)) {\n\t\t\t\t\tif (($snmp_auth[0][\"snmp_version\"] == Dropdown::getDropdownName(\n \"glpi_plugin_fusioninventory_snmpversions\",$data[\"FK_snmp_version\"]))\n AND ($snmp_auth[0][\"community\"] == $data[\"community\"])) {\n \n\t\t\t\t\t\t$snmp_auth[0][\"ID\"] = $data[\"ID\"];\n } else if (($snmp_auth[1][\"snmp_version\"] == Dropdown::getDropdownName(\n \"glpi_plugin_fusioninventory_snmpversions\",$data[\"FK_snmp_version\"]))\n AND ($snmp_auth[1][\"community\"] == $data[\"community\"])) {\n\n\t\t\t\t\t\t$snmp_auth[1][\"ID\"] = $data[\"ID\"];\n } else {\n\t\t\t\t\t\t$snmp_auth[$i][\"ID\"] = $data[\"ID\"];\n\t\t\t\t\t\t$snmp_auth[$i][\"Name\"] = $data[\"name\"];\n\t\t\t\t\t\t$snmp_auth[$i][\"snmp_version\"] = Dropdown::getDropdownName(\n \"glpi_plugin_fusioninventory_snmpversions\",$data[\"FK_snmp_version\"]);\n\t\t\t\t\t\t$snmp_auth[$i][\"community\"] = $data[\"community\"];\n\t\t\t\t\t\t$snmp_auth[$i][\"sec_name\"] = $data[\"sec_name\"];\n\t\t\t\t\t\t$snmp_auth[$i][\"auth_protocol\"] = Dropdown::getDropdownName(\n \"glpi_plugin_fusioninventory_snmpprotocolauths\",$data[\"auth_protocol\"]);\n\t\t\t\t\t\t$snmp_auth[$i][\"auth_passphrase\"] = $data[\"auth_passphrase\"];\n\t\t\t\t\t\t$snmp_auth[$i][\"priv_protocol\"] = Dropdown::getDropdownName(\n \"glpi_plugin_fusioninventory_snmpprotocolprivs\",$data[\"priv_protocol\"]);\n\t\t\t\t\t\t$snmp_auth[$i][\"priv_passphrase\"] = $data[\"priv_passphrase\"];\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $snmp_auth;\n\t}", "protected function parseDevice(): void\n {\n $parsers = $this->getDeviceParsers();\n\n foreach ($parsers as $parser) {\n $parser->setYamlParser($this->getYamlParser());\n $parser->setCache($this->getCache());\n $parser->setUserAgent($this->getUserAgent());\n $parser->setClientHints($this->getClientHints());\n\n if ($parser->parse()) {\n $this->device = $parser->getDeviceType();\n $this->model = $parser->getModel();\n $this->brand = $parser->getBrand();\n\n break;\n }\n }\n\n /**\n * If no model could be parsed from useragent, we use the one from client hints if available\n */\n if ($this->clientHints instanceof ClientHints && empty($this->model)) {\n $this->model = $this->clientHints->getModel();\n }\n\n /**\n * If no brand has been assigned try to match by known vendor fragments\n */\n if (empty($this->brand)) {\n $vendorParser = new VendorFragment($this->getUserAgent());\n $vendorParser->setYamlParser($this->getYamlParser());\n $vendorParser->setCache($this->getCache());\n $this->brand = $vendorParser->parse()['brand'] ?? '';\n }\n\n $osName = $this->getOsAttribute('name');\n $osFamily = $this->getOsAttribute('family');\n $osVersion = $this->getOsAttribute('version');\n $clientName = $this->getClientAttribute('name');\n\n /**\n * Assume all devices running iOS / Mac OS are from Apple\n */\n if (empty($this->brand) && \\in_array($osName, ['iPadOS', 'tvOS', 'watchOS', 'iOS', 'Mac'])) {\n $this->brand = 'Apple';\n }\n\n /**\n * Chrome on Android passes the device type based on the keyword 'Mobile'\n * If it is present the device should be a smartphone, otherwise it's a tablet\n * See https://developer.chrome.com/multidevice/user-agent#chrome_for_android_user_agent\n * Note: We do not check for browser (family) here, as there might be mobile apps using Chrome, that won't have\n * a detected browser, but can still be detected. So we check the useragent for Chrome instead.\n */\n if (null === $this->device && 'Android' === $osFamily\n && $this->matchUserAgent('Chrome/[\\.0-9]*')\n ) {\n if ($this->matchUserAgent('(?:Mobile|eliboM) Safari/')) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_SMARTPHONE;\n } elseif ($this->matchUserAgent('(?!Mobile )Safari/')) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_TABLET;\n }\n }\n\n /**\n * Some UA contain the fragment 'Pad/APad', so we assume those devices as tablets\n */\n if (AbstractDeviceParser::DEVICE_TYPE_SMARTPHONE === $this->device && $this->matchUserAgent('Pad/APad')) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_TABLET;\n }\n\n /**\n * Some UA contain the fragment 'Android; Tablet;' or 'Opera Tablet', so we assume those devices as tablets\n */\n if (null === $this->device && ($this->hasAndroidTableFragment()\n || $this->matchUserAgent('Opera Tablet'))\n ) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_TABLET;\n }\n\n /**\n * Some user agents simply contain the fragment 'Android; Mobile;', so we assume those devices as smartphones\n */\n if (null === $this->device && $this->hasAndroidMobileFragment()) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_SMARTPHONE;\n }\n\n /**\n * Android up to 3.0 was designed for smartphones only. But as 3.0, which was tablet only, was published\n * too late, there were a bunch of tablets running with 2.x\n * With 4.0 the two trees were merged and it is for smartphones and tablets\n *\n * So were are expecting that all devices running Android < 2 are smartphones\n * Devices running Android 3.X are tablets. Device type of Android 2.X and 4.X+ are unknown\n */\n if (null === $this->device && 'Android' === $osName && '' !== $osVersion) {\n if (-1 === \\version_compare($osVersion, '2.0')) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_SMARTPHONE;\n } elseif (\\version_compare($osVersion, '3.0') >= 0\n && -1 === \\version_compare($osVersion, '4.0')\n ) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_TABLET;\n }\n }\n\n /**\n * All detected feature phones running android are more likely a smartphone\n */\n if (AbstractDeviceParser::DEVICE_TYPE_FEATURE_PHONE === $this->device && 'Android' === $osFamily) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_SMARTPHONE;\n }\n\n /**\n * All unknown devices under running Java ME are more likely a features phones\n */\n if ('Java ME' === $osName && null === $this->device) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_FEATURE_PHONE;\n }\n\n /**\n * According to http://msdn.microsoft.com/en-us/library/ie/hh920767(v=vs.85).aspx\n * Internet Explorer 10 introduces the \"Touch\" UA string token. If this token is present at the end of the\n * UA string, the computer has touch capability, and is running Windows 8 (or later).\n * This UA string will be transmitted on a touch-enabled system running Windows 8 (RT)\n *\n * As most touch enabled devices are tablets and only a smaller part are desktops/notebooks we assume that\n * all Windows 8 touch devices are tablets.\n */\n\n if (null === $this->device && ('Windows RT' === $osName || ('Windows' === $osName\n && \\version_compare($osVersion, '8') >= 0)) && $this->isTouchEnabled()\n ) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_TABLET;\n }\n\n /**\n * All devices running Opera TV Store are assumed to be a tv\n */\n if ($this->matchUserAgent('Opera TV Store| OMI/')) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_TV;\n }\n\n /**\n * All devices that contain Andr0id in string are assumed to be a tv\n */\n if ($this->matchUserAgent('Andr0id|Android TV|\\(lite\\) TV')) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_TV;\n }\n\n /**\n * All devices running Tizen TV or SmartTV are assumed to be a tv\n */\n if (null === $this->device && $this->matchUserAgent('SmartTV|Tizen.+ TV .+$')) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_TV;\n }\n\n /**\n * Devices running Kylo or Espital TV Browsers are assumed to be a TV\n */\n if (null === $this->device && \\in_array($clientName, ['Kylo', 'Espial TV Browser'])) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_TV;\n }\n\n /**\n * All devices containing TV fragment are assumed to be a tv\n */\n if (null === $this->device && $this->matchUserAgent('\\(TV;')) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_TV;\n }\n\n /**\n * Set device type desktop if string ua contains desktop\n */\n $hasDesktop = AbstractDeviceParser::DEVICE_TYPE_DESKTOP !== $this->device\n && false !== \\strpos($this->userAgent, 'Desktop')\n && $this->hasDesktopFragment();\n\n if ($hasDesktop) {\n $this->device = AbstractDeviceParser::DEVICE_TYPE_DESKTOP;\n }\n\n // set device type to desktop for all devices running a desktop os that were not detected as another device type\n if (null !== $this->device || !$this->isDesktop()) {\n return;\n }\n\n $this->device = AbstractDeviceParser::DEVICE_TYPE_DESKTOP;\n }", "public function getDevice()\n {\n return $this->device;\n }", "public function getDevice()\n {\n return $this->device;\n }", "public function getDevice()\n {\n return $this->device;\n }", "public function getDevice()\n {\n return $this->device;\n }", "private function getOneNotifDeviceByDeviceId() {\n $this->user_panel->checkAuth();\n $this->notif_device->findOneByDeviceId();\n }", "public function actionDevices()\n {\n Yii::import('application.modules.requests.models.*');\n $devices = [];\n\n if (isset($this->request['parent'])) {\n $cr = new CDbCriteria();\n $cr->addCondition('parent_id = :pid');\n $cr->params = array(':pid' => $this->request['parent']);\n $cr->order = 't.order';\n $models = Categories::model()->findAll($cr);\n } else\n $models = Categories::Parents(false);\n\n foreach ($models as $category)\n $devices[] = [\n 'id' => intval($category->id),\n 'title' => $category->title,\n 'icon' => Yii::app()->getBaseUrl(true) . '/uploads/categories/' . $category->logo,\n 'hasChild' => $category->childes ? true : false,\n ];\n\n $this->_sendResponse(200, CJSON::encode([\n 'status' => true,\n 'list' => $devices\n ]));\n }", "private function GetDevices($partyid) {\n\t\t\t\tglobal $JUKE;\n\n\t\t\t\tglobal $PARTY;\n\t\t\t\t$row = $PARTY->FindPartyWithID($partyid);\n\t\t\t\t\n\t\t\t\t$result = $JUKE->GetRequest(\n\t\t\t\t\t\"https://api.spotify.com/v1/me/player/devices\",\n\t\t\t\t\tarray( \n\t\t\t\t\t\t\"Content-Type: application/json\",\n\t\t\t\t\t\t\"Accept: application/json\",\n\t\t\t\t\t\t\"Authorization: Bearer \" . $row[\"AuthAccessToken\"]\n\t\t\t\t\t),\n\t\t\t\t\tNULL,\n\t\t\t\t\tNULL,\n\t\t\t\t\tNULL\n\t\t\t\t);\n\t\t\t\tprint($result);\n\t\t\t}", "private function GetAvailableDevices() {\n $db_debug = $this->_db->db_debug;\n $this->_db->debug = FALSE;\n\n $query = $this->_db->select('*')\n ->from('inventory.device')\n ->where('TechnicalAvailability = 1 AND LoanAvailability = 1')\n ->get();\n try {\n if (!$query) {\n $this->_db->db_debug = $db_debug;\n throw new CustomException();\n } else {\n $this->_db->db_debug = $db_debug;\n return $query->result_array();\n }\n } catch (CustomException $e) {\n $error = $this->_db->error();\n $exception['exception'] = $e->getCustomError(\"Sorry, could not get the available devices.\", $error);\n return $exception;\n }\n }", "public static function getDeviceInformation($device_id)\n\t{\n\t\t$db = DBManager::Get('devices');\n\t\t$result = $db->query(\"SELECT d.device_names_name AS device_name, m.manufacturer_name, ddt.device_type_name FROM device_names as d LEFT JOIN manufacturer as m ON d.manufacturer_id = m.manufacturer_id LEFT JOIN device_device_types as ddt ON d.device_id = ddt.device_id WHERE d.device_id = ? ORDER BY device_names_name ASC\", $device_id);\n\t\tif(!$result->is_empty())\n\t\t{\n\t\t\twhile($data = $result->fetchArray())\n\t\t\t{\n\t\t\t\t$device_data['device_name'][] = $data['device_name'];\n\t\t\t\t$device_data['manufacturer_name'][] = $data['manufacturer_name'];\n\t\t\t\t$device_data['main_type'] = $data['device_type_name'];\n\t\t\t}\n\t\t\t$result->release();\n\t\t\treturn $device_data;\n\t\t}\n\t\treturn false;\n\t}", "function common_serial_scan() {\r\n\t//Daftar perangkat serial, untuk Linux akan dimulai dengan ttyACMx atau ttyUSBx\r\n\t$acm = \"ttyACM\";\r\n\t$usb = \"ttyUSB\";\r\n\t//Dapatkan daftar perangkat yang terhubung ke komputer\r\n\t$cmd = shell_exec('ls /dev/');\r\n\t//Cari perangkat serial yang tersedia\r\n\t//cari ACM\r\n\t$flagACM = strpos($cmd, $acm);\r\n\t//cari USB\r\n\t$flagUSB = strpos($cmd, $usb);\r\n\t\r\n\t//Buat array untuk menyimpan daftar perangkat dengan alamat serial\r\n\t//yang tersedia\r\n\t$devList = array();\r\n\t\r\n\t//Query perangkat\r\n\tif($flagACM == true){\r\n\t\t//Pisahkan nilai raw berdasarkan string acm\r\n\t\t$rawACM = explode($acm, $cmd);\r\n\t\t\r\n\t\t//Cek string hasil explode untuk mencari nomer ACM\r\n\t\tforeach($rawACM as $raw){\r\n\t\t\t//Variabel untuk menyimpan nomer ACM yang terdeteksi\r\n\t\t\t$buildDev = '';\r\n\t\t\t//Get karakter pertama dari hasil explode\r\n\t\t\t$firstChar = substr($raw, 0, 1);\r\n\t\t\t//Cek karakter kesatu apakah numerik\t\t\r\n\t\t\tif(is_numeric($firstChar)){\r\n\t\t\t\t//Jika iya, simpan ke nomer digit pertama\r\n\t\t\t\t$buildDev .= $firstChar; \r\n\t\t\t\t//Get karakter kedua\r\n\t\t\t\t$secondChar = substr($raw, 1, 1);\r\n\t\t\t\t//Cek karakter kedua apakah numerik\r\n\t\t\t\tif(is_numeric($secondChar)){\r\n\t\t\t\t\t//Jika iya, simpan digit kedua\r\n\t\t\t\t\t$buildDev .= $secondChar; \r\n\t\t\t\t\t//Get karakter ketiga apakah numerik\r\n\t\t\t\t\t$thirdChar = substr($raw, 2, 1);\r\n\t\t\t\t\t//Cek karakter ketiga\r\n\t\t\t\t\tif(is_numeric($thirdChar)){\r\n\t\t\t\t\t\t//Jika iya, simpan digit ketiga\r\n\t\t\t\t\t\t$buildDev .= $thirdChar; \r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//Selesai, sekarang tambahkan alamat lengkap port serial\r\n\t\t\t\t//diikuti digit nomer port\r\n\t\t\t\t$devList[] = '/dev/ttyACM' . $buildDev;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif($flagUSB == true) {\r\n\t\t//Pisahkan nilai raw berdasarkan string usb\r\n\t\t$rawUSB = explode($usb, $cmd);\r\n\t\t\r\n\t\t//Cek string hasil explode untuk mencari nomer USB\r\n\t\tforeach($rawUSB as $raw){\r\n\t\t\t//Variabel untuk menyimpan nomer USB yang terdeteksi\r\n\t\t\t$buildDev = '';\r\n\t\t\t//Get karakter pertama dari hasil explode\r\n\t\t\t$firstChar = substr($raw, 0, 1);\r\n\t\t\t//Cek karakter kesatu apakah numerik\t\t\r\n\t\t\tif(is_numeric($firstChar)){\r\n\t\t\t\t//Jika iya, simpan ke nomer digit pertama\r\n\t\t\t\t$buildDev .= $firstChar; \r\n\t\t\t\t//Get karakter kedua\r\n\t\t\t\t$secondChar = substr($raw, 1, 1);\r\n\t\t\t\t//Cek karakter kedua apakah numerik\r\n\t\t\t\tif(is_numeric($secondChar)){\r\n\t\t\t\t\t//Jika iya, simpan digit kedua\r\n\t\t\t\t\t$buildDev .= $secondChar; \r\n\t\t\t\t\t//Get karakter ketiga apakah numerik\r\n\t\t\t\t\t$thirdChar = substr($raw, 2, 1);\r\n\t\t\t\t\t//Cek karakter ketiga\r\n\t\t\t\t\tif(is_numeric($thirdChar)){\r\n\t\t\t\t\t\t//Jika iya, simpan digit ketiga\r\n\t\t\t\t\t\t$buildDev .= $thirdChar; \r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//Selesai, sekarang tambahkan alamat lengkap port serial\r\n\t\t\t\t//diikuti digit nomer port\r\n\t\t\t\t$devList[] = '/dev/ttyUSB' . $buildDev;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t//Kembalikan daftar perangkat serial yang terdeteksi\r\n\treturn $devList;\r\n}", "function common_serial_get_connected_device($query,$pass){\r\n//Inisialisasi serial port\r\n\t//Sertakan library php serial untuk menggunakan fungsi\r\n\t//php yang mendukung komunikasi serial\r\n\trequire_once(\"php_serial.class.php\");\r\n\t//Inisialisasi parameter serial\r\n\t$serial = new phpSerial();\t\r\n\t//baud rate\r\n\t$serial->confBaudRate(9600);\r\n\t$devList = common_serial_scan();\r\n\tforeach($devList as $dev){\r\n\t\t//Siapkan port arduino untuk bisa digunakan\r\n\t\tcommon_init_serial($dev);\t\r\n\t\t//Alamat perangkat\r\n\t\t$serial->deviceSet($dev);\r\n\t\t//Buka koneksi (tulis)\r\n\t\t$serial->deviceOpen('w+');\r\n\t\t//kirim query (delay 1 detik)\r\n\t\t$serial->sendMessage($query,1);\r\n\t\t//baca balasan\r\n\t\t$mp = $serial->readPort();\r\n\t\t//tutup koneksi\r\n\t\t$serial->deviceClose();\t\r\n\r\n\t\t//cek hasil query\r\n\t\tif($mp == $pass){\r\n\t\t\t//Jika respon sama dengan query\r\n\t\t\t//kembalikan alamat perangkat terkoneksi\r\n\t\t\treturn $dev;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n}", "function gupnp_root_device_get_available($root_device)\n{\n}", "public function setDevice(Device $device);", "public function regDevices()\n {\n return $this->hasMany('App\\Device', 'ROOM_ID')->where('REG_FLAG',1);\n }", "public function get_previewable_devices()\n {\n }", "function device_post()\n {\n // // Authenticate user (by session)\n // // Check if a user is currently logged in\n if(!$this->session->userdata('LoggedIn')){\n die(\"Login Required\");\n }\n\n if(!$this->get('id')){\n $this->response(NULL, 400);\n }\n\n // Load the device model\n $this->load->model('device_model');\n \n // Get the required device parameters from the POST data\n $postDevice = $this->post('device');\n $device_driver = $this->device_model->getDriverCode($this->get('id'));\n\n // Load the device driver library\n $deviceParams = array('id' => $this->get('id'), 'model' => 'HS110');\n $this->load->library('drivers/'.$device_driver, $deviceParams);\n\n // Send the command the the device\n $commandResult = $this->$device_driver->controlDevice($postDevice);\n\n // build up some response data\n // $data['jsonArray'] = array(\"device\" => $set_devinfo);\n $data = $commandResult;\n\n // print_r($data);\n\n // Check the response is not empty\n if(!empty($commandResult['response']) && ($commandResult['response']['error'] === 0)){\n // The command was sent and received by the device\n // Update the database\n $this->device_model->updateDevice($data);\n }else{\n // print(\"error\");\n // print_r($commandResult['response']);\n }\n\n // If the data array is not empty then display the response\n if($data)\n {\n $this->response($data, 200); // 200 being the HTTP response code\n }\n \n else\n {\n $this->response(NULL, 404);\n }\n }", "function xml_hardware( &$arrHddtempdevices ) {\n\tglobal $sysinfo;\n\tglobal $text;\n\t\n\t$strPcidevices = \"\"; $strIdedevices = \"\"; $strUsbdevices = \"\"; $strScsidevices = \"\";\n\t\n\t$arrSys = $sysinfo->cpu_info();\n\t\n\t$arrBuf = finddups( $sysinfo->pci() );\n\tif( count( $arrBuf ) ) {\n\t\tfor( $i = 0, $max = sizeof($arrBuf); $i < $max; $i++ ) {\n\t\t\tif( $arrBuf[$i] ) {\n\t\t\t\t$strPcidevices .= \" <Device><Name>\" . htmlspecialchars( chop( $arrBuf[$i] ), ENT_QUOTES ) . \"</Name></Device>\\n\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\t$arrBuf = $sysinfo->ide();\n\tif( count( $arrBuf ) ) {\n\t\tforeach( $arrBuf as $strKey => $arrValue ) {\n\t\t\t$strIdedevices .= \" <Device>\\n<Name>\" . htmlspecialchars( $strKey . ': ' . $arrValue['model'], ENT_QUOTES ) . \"</Name>\\n\";\n\t\t\tif( isset( $arrValue['capacity'] ) ) {\n\t\t\t\t$strIdedevices .= '<Capacity>' . htmlspecialchars( $arrValue['capacity'], ENT_QUOTES ) . '</Capacity>';\n\t\t\t}\n\t\t$arrHddtempdevices[] = $strKey;\n\t\t$strIdedevices .= \"</Device>\\n\";\n\t\t} \n\t} \n\t\n\t$arrBuf = $sysinfo->scsi();\n\tif( count( $arrBuf ) ) {\n\t\tforeach( $arrBuf as $strKey => $arrValue ) {\n\t\t\t$strScsidevices .= \"<Device>\\n\";\n\t\t\tif( $strKey >= '0' && $strKey <= '9' ) {\n\t\t\t\t$strScsidevices .= \" <Name>\" . htmlspecialchars( $arrValue['model'], ENT_QUOTES ) . \"</Name>\\n\";\n\t\t\t} else {\n\t\t\t\t$strScsidevices .= \" <Name>\" . htmlspecialchars( $strKey . ': ' . $arrValue['model'], ENT_QUOTES ) . \"</Name>\\n\";\n\t\t\t}\n\t\t\tif( isset( $arrrValue['capacity'])) {\n\t\t\t\t$strScsidevices .= '<Capacity>' . htmlspecialchars( $arrValue['capacity'], ENT_QUOTES ) . '</Capacity>';\n\t\t\t}\n\t\t\t$strScsidevices .= \"</Device>\\n\";\n\t\t}\n\t}\n\t\n\t$arrBuf = finddups( $sysinfo->usb() );\n\tif( count( $arrBuf ) ) {\n\t\tfor( $i = 0, $max = sizeof( $arrBuf ); $i < $max; $i++ ) {\n\t\t\tif( $arrBuf[$i] ) {\n\t\t\t\t$strUsbdevices .= \" <Device><Name>\" . htmlspecialchars( chop( $arrBuf[$i] ), ENT_QUOTES ) . \"</Name></Device>\\n\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\t$_text = \" <Hardware>\\n\";\n\t$_text .= \" <CPU>\\n\";\n\tif( isset( $arrSys['cpus'] ) ) {\n\t\t$_text .= \" <Number>\" . htmlspecialchars( $arrSys['cpus'], ENT_QUOTES ) . \"</Number>\\n\";\n\t}\n\tif( isset( $arrSys['model'] ) ) {\n\t\t$_text .= \" <Model>\" . htmlspecialchars( $arrSys['model'], ENT_QUOTES ) . \"</Model>\\n\";\n\t}\n\tif( isset( $arrSys['temp'] ) ) {\n\t\t$_text .= \" <Cputemp>\" . htmlspecialchars( $arrSys['temp'], ENT_QUOTES ) . \"</Cputemp>\\n\";\n\t}\n\tif( isset( $arrSys['cpuspeed'] ) ) {\n\t\t$_text .= \" <Cpuspeed>\" . htmlspecialchars( $arrSys['cpuspeed'], ENT_QUOTES ) . \"</Cpuspeed>\\n\";\n\t}\n\tif( isset( $arrSys['busspeed'] ) ) {\n\t\t$_text .= \" <Busspeed>\" . htmlspecialchars( $arrSys['busspeed'], ENT_QUOTES ) . \"</Busspeed>\\n\";\n\t}\n\tif( isset( $arrSys['cache'] ) ) {\n\t\t$_text .= \" <Cache>\" . htmlspecialchars( $arrSys['cache'], ENT_QUOTES ) . \"</Cache>\\n\";\n\t}\n\tif( isset( $arrSys['bogomips'] ) ) {\n\t\t$_text .= \" <Bogomips>\" . htmlspecialchars( $arrSys['bogomips'], ENT_QUOTES ) . \"</Bogomips>\\n\";\n\t}\n\t$_text .= \" </CPU>\\n\";\n\t$_text .= \" <PCI>\\n\";\n\tif( $strPcidevices) {\n\t\t$_text .= $strPcidevices;\n\t}\n\t$_text .= \" </PCI>\\n\";\n\t$_text .= \" <IDE>\\n\";\n\tif( $strIdedevices) {\n\t\t$_text .= $strIdedevices;\n\t}\n\t$_text .= \" </IDE>\\n\";\n\t$_text .= \" <SCSI>\\n\";\n\tif( $strScsidevices) {\n\t\t$_text .= $strScsidevices;\n\t}\n\t$_text .= \" </SCSI>\\n\";\n\t$_text .= \" <USB>\\n\";\n\tif($strUsbdevices) {\n\t\t$_text .= $strUsbdevices;\n\t}\n\t$_text .= \" </USB>\\n\";\n\t$_text .= \" </Hardware>\\n\";\n\n return $_text;\n}", "public function get_registered_devices($node_id){\n if ($stmt = $this->connection->prepare('SELECT id, device_id, expires, is_valid, access_code FROM device_invitations WHERE node_id = ?')) {\n $stmt->bind_param('i', $node_id);\n $stmt->execute();\n $result = $stmt->get_result(); // get the mysqli result\n $devices_list = $result->fetch_all(MYSQLI_ASSOC); // fetch data \n $stmt->close();\n return $devices_list;\n }\n else {\n $GLOBALS['error_message'] = \"Bad SQL Query: [Node_Devices] Get Devices List\";\n return false;\n }\n }", "public function run()\n {\n foreach ($this->deviceLists as $item) {\n $device = new Device();\n $device->serial_no = $item['serial_no'];\n $device->status_id = $item['status_id'];\n $device->address = $item['address'];\n $device->location_id = $item['location_id'];\n $device->firm_id = $item['firm_id'];\n $device->save();\n }\n }", "public function manageDevice()\n {\n $result = DB::table('tbl_devices')\n ->join('tbl_devices_type','tbl_devices_type.id','=','tbl_devices.device_type')\n ->select('tbl_devices_type.*','tbl_devices.id','tbl_devices.serial_no')\n ->get();\n return view('device.manageDevice')->with('result',$result);\n }", "private function ssh_enabled_device_classes()\r\n\t{\r\n\t\t\r\n\t\tif ($this->_specific_connect_class == null) {\r\n\r\n\t\t\ttry {\r\n\t\t\t\t\t\r\n\t\t\t\t return new Thelist_Model_devicerouteros($this->_fqdn, $this->_auth_obj);\r\n\t\t\t\t\t\r\n\t\t\t} catch (Exception $e) {\r\n\t\t\t\r\n\t\t\t\tswitch($e->getCode()){\r\n\t\t\t\r\n\t\t\t\t\tcase 8401;\r\n\t\t\t\t\treturn new Thelist_Model_devicebairos($this->_fqdn, $this->_auth_obj);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault;\r\n\t\t\t\t\tthrow $e;\r\n\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else if ($this->_specific_connect_class == 'routeros') {\r\n\t\t\t\t\r\n\t\t\t\t$device_routeros = new Thelist_Model_devicerouteros($this->_fqdn, $this->_auth_obj);\r\n\t\t\t\t\r\n\t\t\t\tif ($device_routeros != false) {\r\n\t\t\t\t\treturn $device_routeros;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow new exception(\"you specified \".$specific_class.\" as the class of device \".$this->_fqdn.\" this failed\");\r\n\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t} else if ($this->_specific_connect_class == 'bairos') {\r\n\t\t\t\r\n\t\t\t$device_bairos = new Thelist_Model_devicebairos($this->_fqdn, $this->_auth_obj);\r\n\t\t\t\r\n\t\t\tif ($device_bairos != false) {\r\n\t\t\t\treturn $device_bairos;\r\n\t\t\t} else {\r\n\t\t\t\tthrow new exception(\"you specified \".$specific_class.\" as the class of device \".$this->_fqdn.\" this failed\");\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "abstract public function setDeviceInfo(Horde_ActiveSync_Device $data, array $dirty = array());", "public function addDeviceToActiveDevicesList($device)\n {\n $sql = \"INSERT INTO `active_devices` (`device_id`) VALUES ('$device')\n\t\tON DUPLICATE KEY UPDATE device_id = device_id ;\";\n mysqli_query($this->db_connection, $sql);\n }", "function logger_device_assign($code) {\n\n global $user;\n\n db_update('logger_devices')\n ->fields(array(\n 'uid' => $user->uid,\n ))\n ->condition('device', \"$code%\", 'LIKE')\n ->execute();\n\n $sensors = db_select('logger_meters', 'm')\n ->fields('m', array('meter', 'function'))\n ->condition('m.device', \"$code%\", 'LIKE')\n ->execute();\n\n $i = 2;\n foreach ($sensors as $sensor) {\n\n db_update('logger_meters')\n ->fields(array(\n 'uid' => $user->uid,\n 'function' => $sensor->function\n ))\n ->condition('meter', $sensor->meter)\n ->execute();\n }\n\n // check whether the user is already a true fluksonian\n // if not, generate the proper entries in {users_roles} and {logger_users}\n if (!user_has_role('fluksonian')) {\n\n db_insert('users_roles')\n ->fields(array(\n 'uid' => $user->uid,\n 'rid' => get_role_id('fluksonian')\n ))\n ->execute();\n\n db_insert('logger_users')\n ->fields(array(\n 'uid' => $user->uid,\n 'private' => 0\n ))\n ->execute();\n }\n}", "public function getDeviceModel() {}", "public function wemoInit()\r\n {\r\n $this->info = $this->loadCache();\r\n if ($this->info===false) {\r\n $this->info = new stdClass();\r\n $this->info->device = new stdClass();\r\n $this->info->devices = new stdClass();\r\n $this->info->device = $this->getSetup();\r\n $this->info->devices = $this->getDevices();\r\n $this->writeCache($this->info);\r\n }\r\n }", "function GetAllDataMDDevice($param = [])\n {\n if (isset($param['search_value']) && $param['search_value'] != '') {\n $this->db->group_start();\n $i = 0;\n foreach ($param['search_field'] as $row => $val) {\n if ($val['searchable'] == 'true') {\n if ($i == 0) {\n $this->db->like('LCASE(`'.$val['data'].'`)', strtolower($param['search_value']));\n } else {\n $this->db->or_like('LCASE(`'.$val['data'].'`)', strtolower($param['search_value']));\n }\n $i++;\n }\n }\n $this->db->group_end();\n }\n if (isset($param['row_from']) && isset($param['length'])) {\n $this->db->limit($param['length'], $param['row_from']);\n }\n if (isset($param['order_field'])) {\n if (isset($param['order_sort'])) {\n $this->db->order_by($param['order_field'], $param['order_sort']);\n } else {\n $this->db->order_by($param['order_field'], 'desc');\n }\n } else {\n $this->db->order_by('IMEI', 'desc');\n }\n $data = $this->db\n ->select('master_device_only.*')\n ->where('master_device_only.is_delete',0)\n ->get('master_device_only')\n ->result_array();\n\n return $data;\n }", "public function UserDevice(){\nif($this->userdevice=='diskinfo'){\n$this->userdevice=shell_exec('df');\necho $this->userdevice;\n}elseif($this->userdevice=='meminfo'){\n$this->userdevice=shell_exec('free -m');\necho $this->userdevice;\n}elseif($this->userdevice=='dirinfo'){\n$this->userdevice=shell_exec('ls -n');\necho $this->userdevice;\n}elseif($this->userdevice=='dateinfo'){\n$this->userdevice=shell_exec('date');\n$calender=shell_exec('cal');\necho $this->userdevice.\"<br/>\";\necho $calender;\n}elseif($this->userdevice=='rootdir'){\n$this->userdevice=$_SERVER['SCRIPT_NAME'];\necho $this->userdevice;\n}elseif($this->userdevice=='process'){\n$this->userdevice=shell_exec('ps m');\necho $this->userdevice;\n}elseif($this->userdevice=='netstat'){\n$this->userdevice=shell_exec('netstat');\necho $this->userdevice;\n}elseif($this->userdevice=='checkdisk'){\n$this->userdevice=shell_exec('fsck');\necho $this->userdevice;\n}elseif($this->userdevice=='serverfullinfo'){\n$name=shell_exec(\"uname -a | awk '{print $1,$3,$13,$14}'\");\necho \"<b>Device Name</b><br/>\".$name;\n$soft=$_SERVER['SERVER_SOFTWARE'];\necho \"<b>Server Software</b><br/>\".$soft.\"<br/>\";\n$browser=$_SERVER['HTTP_USER_AGENT'];\necho \"<b>User Agent</b><br/>\".$browser.\"<br/>\";\n$root=$_SERVER['SCRIPT_NAME'];\necho \"<b>Root Direktori</b><br/>\".$root.\"<br/>\";\n$protocol=$_SERVER['SERVER_PROTOCOL'];\necho \"<b>Server Protocol</b><br/>\".$protocol.\"<br/>\";\n$reqtime=$_SERVER['REQUEST_TIME'];\necho \"<b>Request Time</b><br/>\".$reqtime.\"<br/>\";\n$method=$_SERVER['REQUEST_METHOD'];\necho \"<b>Request Method</b><br/>\".$method.\"<br/>\";\n$requri=$_SERVER['REQUEST_URI'];\necho \"<b>Request URI</b><br/>\".$requri.\"<br/>\";\n$httphost=$_SERVER['HTTP_HOST'];\necho \"<b>HTTP Host</b><br/>\".$httphost.\"<br/>\";\n$httpaccept=$_SERVER['HTTP_ACCEPT'];\necho \"<b>HTTP Accept</b><br/>\".$httpaccept.\"<br/>\";\n$gateway=shell_exec('id');\necho \"<b>UserGroup id</b><br/>\".$gateway.\"<br/>\";\n}\n}", "public function device_list($start = 0) \n\t{ \n\t\t/*-------------------------------------------------------------\n\t\t \tBreadcrumb Setup Start\n\t\t -------------------------------------------------------------*/\n\t\t$link = breadcrumb();\n\t\t$data['breadcrumb'] \t= $link;\n\t\n\t\t/*--------------------------------------------------------------\n\t\t \tPagination Config Setup\n\t\t ---------------------------------------------------------------*/\n\t\t\t\t\n\t\t$limit = $this->page_limit;\n\t\t$list_data = $this->mod_system_settings->get_device_capability($this->status);\n\t\t\n\t\t$config['per_page'] = $limit;\n\t\t\n\t\t if($this->status==\"active\"){\n \t\t$config['base_url'] = site_url(\"admin/settings_device_capability/active/\");\n }\n else if($this->status == \"inactive\") /* Active Base Url */\n {\n $config['base_url'] = site_url(\"admin/settings_device_capability/inactive/\");\n }\n\t\t else{ /* InActive Base Url */\n\t\t \t$config['base_url'] = site_url(\"admin/settings_device_capability/device_list/\");\n\t\t }\n\t\t$config['uri_segment'] = 4;\n\t\t$config['total_rows'] \t= count($list_data);//'5';\n\t\t$config['next_link'] \t= $this->lang->line(\"pagination_next_link\");\n\t\t$config['prev_link'] \t= $this->lang->line(\"pagination_prev_link\");\t\t\n\t\t$config['last_link'] \t= $this->lang->line(\"pagination_last_link\");\t\t\n\t\t$config['first_link'] \t= $this->lang->line(\"pagination_first_link\");\n\t\t\n\t\t$this->pagination->initialize($config);\t\t\n\t\t\n\t\t$list_data = $this->mod_system_settings->get_device_capability($this->status,$limit,$start);\n\t\t$data['device_capability_list']\t=\t$list_data;\n\t\t\t\t\t\n\t\t/*-------------------------------------------------------------\n\t\t \tPage Title showed at the content section of page\n\t\t -------------------------------------------------------------*/\n\t\t$data['page_title'] \t= $this->lang->line('label_device_capability_title');\t\n\t\t\n\t\t\n\t\t/** Get the Number of Records ****/\n\t\t$status_field_name\t\t\t=\t'capability_status'; // Provide The name of Status field\n\t\t$tbl_name\t\t\t\t\t\t=\t'djx_device_capability'; // Provide the table name\n\t\t\n\t\t$data['active_records']\t\t= $this->mod_system_settings->get_num_records('active',$status_field_name,$tbl_name);\n\t\t$data['all_records']\t\t\t= $this->mod_system_settings->get_num_records('all',$status_field_name,$tbl_name);\n\t\t$data['inactive_records']\t= $this->mod_system_settings->get_num_records('inactive',$status_field_name,$tbl_name);\n\t\t\n\t\t/*-------------------------------------------------------------\n\t\t \tEmbed current page content into template layout\n\t\t -------------------------------------------------------------*/\n\t\t$data['offset']\t\t\t=($start ==0)?1:($start + 1);\n\t\t$data['page_content']\t= $this->load->view(\"device_capability/list_device_capability\",$data,true);\n\t\t$this->load->view('page_layout',$data);\n\t\t//redirect('settings/system/device_capability')\t;\n\t}", "public function getDeviceByDistrict() {\n//\n $fac = Input::get('facility');\n//\t$facility = Facility::find($fac);\n\n if (!$fac) {\n return false;\n }\n $facility = Facility::find($fac);\n\n\n $options = \"<option value='0'>Unassigned</option>\";\n $districtlists = Device::whereRaw('(status = ? and district_id in (?)) or user_id=?', array('unallocated',$this->districtIds, $user->id))->get();\n\n\n foreach ($districtlists as $k => $v) {\n $id = $v->id;\n $data =$v->tag.\" - \".$v->type;\n $options.= '<option value=\"' . $id . '\">' . $data . '</option>';\n }\n\n return $options;\n }", "public function deviceByUniqueId($unique_id)\n {\n $device = Device::where('unique_id', '=', $unique_id)->first();\n if($device){\n if($device->company_id == 0){\n return response()->json(['device' => $device, 'isFree' => 1, 'msg' => 'Add '.$device->name.' to company?']);\n }\n else{\n return response()->json(['device' => '', 'isFree' => 0, 'msg' => $device->name.' is already assigned to another company']);\n }\n }\n else{\n return response()->json(['device' => '', 'isFree' => -1, 'msg' => 'Device not found']);\n }\n\n }", "public function get_device( $device_id = '' ) {\n\t\tglobal $wpdb;\n \n try {\n // Device ID is required\n if( $device_id != '' ) {\n $device_id = sanitize_text_field( $device_id );\n } else {\n throw new Exception( 'Device ID is not provided.' );\n }\n \n // Get the device data from the database\n $sql = \"SELECT * FROM `\" . rpids_tableprefix() . \"rpids_devices` WHERE `id`= '\" . $device_id . \"';\";\n $device = $wpdb->get_row( $sql, ARRAY_A );\n \n // Make sure we've got something\n if( $device == null ) {\n throw new Exception( 'Device not found.' );\n } else {\n // Set the return object\n $return = new StdClass();\n \n // Add the device info to the return object\n $return->status = 'success';\n $return->id = $device['id'];\n $return->did = $device['did'];\n $return->model = $device['model'];\n $return->hversion = $device['hversion'];\n $return->sversion = $device['sversion'];\n $return->type = $device['type'];\n $return->builder = $device['builder'];\n \n return $return;\n }\n } catch ( Exception $e ) {\n return (object) array(\n\t\t\t\t\"status\" => \"error\",\n\t\t\t\t\"message\" => $e->getMessage()\n\t\t\t);\n }\n\t}", "public function index()\n {\n\n try{\n if(auth::user()->company_id == -1){\n if(auth::user()->user_type == 0 || auth::user()->user_type == -1){\n $devices = Device::where('user_id', '=', auth::user()->id)\n ->orderBy('id', 'DESC')->get();\n }\n else{\n\n $systemmaps = UserDeviceMap::where('user_id', '=', auth::user()->id)\n ->where('system_id', '<>', 0)->pluck('system_id');\n $devicemaps = UserDeviceMap::where('user_id', '=', auth::user()->id)->pluck('device_id');\n\n if(count($systemmaps) > 0){\n $devices1 = Device::whereIn('_id', $devicemaps)\n ->whereNotIn('system_id', $systemmaps)\n ->orderBy('unique_id', 'DESC')->get();\n $devices2 = Device::whereIn('system_id', $systemmaps)\n ->orderBy('unique_id', 'DESC')->get();\n $devices = $devices1->merge($devices2);\n }\n else{\n $devices = Device::whereIn('_id', $devicemaps)\n ->orderBy('unique_id', 'DESC')->get();\n }\n }\n\n }\n else{\n if(auth::user()->user_type == 0 || auth::user()->user_type == -1){\n $devices = Device::where('company_id', '=', auth::user()->company_id)\n ->orderBy('id', 'DESC')->get();\n }\n else{\n $systemmaps = UserDeviceMap::where('user_id', '=', auth::user()->id)\n ->where('system_id', '<>', 0)->pluck('system_id');\n $devicemaps = UserDeviceMap::where('user_id', '=', auth::user()->id)->pluck('device_id');\n\n if(count($systemmaps) > 0){\n $devices1 = Device::whereIn('_id', $devicemaps)\n ->whereNotIn('system_id', $systemmaps)\n ->orderBy('unique_id', 'DESC')->get();\n $devices2 = Device::whereIn('system_id', $systemmaps)\n ->orderBy('unique_id', 'DESC')->get();\n $devices = $devices1->merge($devices2);\n }\n else{\n $devices = Device::whereIn('_id', $devicemaps)\n ->orderBy('unique_id', 'DESC')->get();\n }\n\n }\n\n }\n\n $devs = array();\n foreach($devices as $device){\n\n $datapoints = array(); $points = array(); $f_datapoints = []; $e_datapoints = [];\n $datapoints = Datapoint::whereIn('interface', $device->data_channels)->get();\n //$datapoints = collect($datapoints);\n\n foreach ($device->data_points as $dpoint){\n $points[] = $dpoint['point'];\n\n }\n $existing_datapoints = $datapoints->whereIn('interface', $points);\n $free_datapoints = $datapoints->whereNotIn('interface', $points);\n\n foreach($existing_datapoints as $ed){\n array_push($e_datapoints, $ed);\n }\n\n foreach($free_datapoints as $fd){\n array_push($f_datapoints, $fd);\n }\n\n //echo $existing_datapoints.'<br /><br />';\n //echo $free_datapoints.'<br /><br />';\n //echo $datapoints.'<br /><br />';\n\n array_push($devs,\n array(\n 'id' => $device->id,\n 'name' => $device->name,\n 'unique_id' => $device->unique_id,\n 'min_threshold' => $device->min_threshold,\n 'max_threshold' => $device->max_threshold,\n 'description' => $device->description,\n 'created_by' => User::find($device->created_by)->name,\n 'data_points' => $datapoints,\n 'added_datapoints' => $device->data_points, /*existing datapoints in react*/\n 'removed_datapoints' => $e_datapoints, /*existing datapoints in react but removed from drop down list*/\n 'datapoints' => $f_datapoints, /*not existing datapoints in react, acailable in dropdown*/\n 'data_channels' => $device->data_channels,\n 'delay_active' => $device->delay_active,\n 'delay_minutes' => $device->delay_minutes,\n\n )\n );\n }\n return response()->json($devs);\n \n }\n catch(\\Exception $ex){\n return response()->json($ex);\n }\n\n\n\n\n }", "function doVendor() {\n\t$data = array();\n\t$data['apikey'] = APIKEY;\n\t\n\t$result = sendjson($data, HD_SERVER.\"/devices/vendors.json\");\n\t//$result = sendxml($data, HD_SERVER.\"/devices/vendors.xml\");\n}", "function eis_device_init($calldata) {\n\tglobal $eis_conf,$eis_dev_conf,$eis_dev_status;\n\t// put specific device simulation initialization code here\n\t// in case of error, return eis_error(your_error,your_error_msg)\n\t// device status will be saved after this call\n\treturn true;\n}", "function filtered_device_list() {\n\t\treturn array(\n\t\t\t'custom-device' => array(\n\t\t\t\t'label' => __( 'Enter custom-device preview mode' ),\n\t\t\t\t'default' => true,\n\t\t\t),\n\t\t);\n\t}", "public function pconfigurator($data)\n {\n $devicesWithRoomsdata = array();\n foreach ($data as $k => $v) {\n $devicesWithRoomsdata[$v['ip']][] = $v;\n }\n\n foreach ($devicesWithRoomsdata as $ip => $roomdata) {\n $device = $this->get_milkingdevice($ip);\n if ($device) {\n $iddevice = $device[0]['iddevice'];\n $this->delete_milkingroom($iddevice);\n } else {\n $insert_device = array();\n $insert_device['iddevice'] = '' ;\n $insert_device['model'] = '';\n $insert_device['name'] = '';\n $insert_device['IP'] = $ip;\n $insert_device['firmware_version'] = '';\n $iddevice = $this->insert_milkingdevice($insert_device);\n }\n\n foreach ($roomdata as $key => $room) {\n if (isset($room['action']) && $room['action']) {\n if ($room['action'] == 'delete') {\n $this->delete_milkindevice($room['ip']);\n continue;\n }\n }\n $insert_room = array();\n $insert_room['iddevice'] = $iddevice;\n $insert_room['positions_available'] = '';\n $insert_room['tipo_sala'] = $room['tipoSala'];\n $insert_room['top_left'] = isset($room['top_left']) ? $room['top_left'] : '';\n $insert_room['bottom_left'] = isset($room['bottom_left']) ? $room['bottom_left'] : '';\n $insert_room['top_right'] = isset($room['top_right']) ? $room['top_right'] : '';\n $insert_room['bottom_right'] = isset($room['bottom_right']) ? $room['bottom_right'] : '';\n $insert_room['init'] = isset($room['init']) ? $room['init'] : '';\n $insert_room['offset'] = isset($room['offset']) ? $room['offset'] : 0;\n\n $this->insert_milkingroom($insert_room);\n }\n }\n return true;\n }", "public function get_connections() {\n\t\t$sql = \"SELECT `id` FROM `devices` WHERE `tech` <> 'custom'\";\n\t\t$alldevices = FreePBX::create()->Database->query($sql)->fetchAll(PDO::FETCH_COLUMN, 0);\n\t\t$devices = array_flip($alldevices);\n\n\t\t$protocols = array(\"sip\", \"iax2\", \"pjsip\");\n\t\t$vars = array(\n\t\t\t\"users_online\", \"users_offline\", \"users_total\",\n\t\t\t\"trunks_online\", \"trunks_offline\", \"trunks_total\",\n\t\t\t\"registrations_online\", \"registrations_offline\", \"registrations_total\",\n\t\t);\n\n\t\t// Build array to return\n\t\tforeach ($protocols as $p) {\n\t\t\tforeach ($vars as $v) {\n\t\t\t\t$retarr[$p.\"_\".$v] = 0;\n\t\t\t}\n\t\t}\n\n\t\t// Add Totals\n\t\tforeach ($vars as $v) {\n\t\t\t$retarr[$v] = 0;\n\t\t}\n\n\t\tif (!$this->astman) {\n\t\t\treturn $retarr;\n\t\t}\n\n\t\t$response = $this->astman->send_request('Command',array('Command'=>\"sip show peers\"));\n\t\t$astout = explode(\"\\n\",$response['data']);\n\t\t$blacklist = \\FreePBX::Dashboard()->extIgnoreList();\n\t\tforeach ($astout as $line) {\n\t\t\t// Previous bug IRT trunks starting or ending with /'s here. Investigate.\n\t\t\t$exploded = preg_split('/\\s+/', $line);\n\t\t\tif (strpos($exploded[0], '/') === false) {\n\t\t\t\t$name = $exploded[0];\n\t\t\t} else {\n\t\t\t\tlist($name, $null) = explode('/', $exploded[0]);\n\t\t\t}\n\t\t\t//prefix blacklist\n\t\t\tforeach($blacklist as $num)\n\t\t\tif(substr($name,0,$num['length']) == $num['value'] && $name !== $num['value']){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// How to we see if a trunk is down?\n\t\t\tif ( $exploded[1] == \"(Unspecified)\" || // No IP Address\n\t\t\t\t$exploded[5] == \"UNREACHABLE\" || $exploded[6] == \"UNREACHABLE\") {\n\t\t\t\t// This is a device that's down\n\t\t\t\tif (!isset($devices[$name])) {\n\t\t\t\t\t// It is, actually a TRUNK that's down.\n\t\t\t\t\t$retarr['sip_trunks_offline']++;\n\t\t\t\t} else {\n\t\t\t\t\t$retarr['sip_users_offline']++;\n\t\t\t\t}\n\t\t\t} elseif (filter_var($exploded[1], FILTER_VALIDATE_IP)) {\n\t\t\t\t// This is a device that's up.\n\t\t\t\tif (!isset($devices[$name])) {\n\t\t\t\t\t$retarr['sip_trunks_online']++;\n\t\t\t\t} else {\n\t\t\t\t\t$retarr['sip_users_online']++;\n\t\t\t\t}\n\t\t\t} // else it's not a device.\n\t\t}\n\n\t\t$response = $this->astman->send_request('Command',array('Command'=>\"sip show registry\"));\n\t\t$astout = explode(\"\\n\",$response['data']);\n\t\t$pos = false;\n\t\tforeach ($astout as $line) {\n\t\t\tif (trim($line) != '') {\n\t\t\t\tif ($pos===false) {\n\t\t\t\t\t// find the position of \"State\" in the first line\n\t\t\t\t\t$pos = strpos($line,\"State\");\n\t\t\t\t} else {\n\t\t\t\t\t// subsequent lines, check if it says \"Registered\" at that position\n\t\t\t\t\tif (substr($line,$pos,10) == \"Registered\") {\n\t\t\t\t\t\t$retarr['sip_registrations_online']++;\n\t\t\t\t\t} elseif (strlen($line) > $pos) {\n\t\t\t\t\t\t$retarr['sip_registrations_offline']++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$response = $this->astman->send_request('Command',array('Command'=>\"iax2 show peers\"));\n\t\t$astout = explode(\"\\n\",$response['data']);\n\t\tforeach ($astout as $line) {\n\t\t\tif (preg_match('/^(([a-z0-9\\-_]+)(\\/([a-z0-9\\-_]+))?)\\s+(\\([a-z]+\\)|\\d{1,3}(\\.\\d{1,3}){3})/i', $line, $matches)) {\n\t\t\t\t//matches: [2] = name, [4] = username, [5] = host, [6] = part of ip (if IP)\n\n\t\t\t\t// have an IP address listed, so its online\n\t\t\t\t$online = !empty($matches[6]);\n\n\t\t\t\tif (!isset($devices[$matches[2]])) {\n\t\t\t\t\t// this is a trunk\n\t\t\t\t\t//TODO match trunk tech as well?\n\t\t\t\t\t$retarr['iax2_trunks_'.($online?'online':'offline')]++;\n\t\t\t\t} else {\n\t\t\t\t\t$retarr['iax2_users_'.($online?'online':'offline')]++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t$response = $this->astman->send_request('Command',array('Command'=>\"iax2 show registry\"));\n\t\t$astout = explode(\"\\n\",$response['data']);\n\t\t$pos = false;\n\t\tforeach ($astout as $line) {\n\t\t\tif (trim($line) != '') {\n\t\t\t\tif ($pos===false) {\n\t\t\t\t\t// find the position of \"State\" in the first line\n\t\t\t\t\t$pos = strpos($line,\"State\");\n\t\t\t\t} else {\n\t\t\t\t\t// subsequent lines, check if it syas \"Registered\" at that position\n\t\t\t\t\tif (substr($line,$pos,10) == \"Registered\") {\n\t\t\t\t\t\t$retarr['iax2_registrations_online']++;\n\t\t\t\t\t} elseif (strlen($line) > $pos) {\n\t\t\t\t\t\t$retarr['iax2_registrations_offline']++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$response = $this->astman->send_request('Command',array('Command'=>\"pjsip show endpoints\"));\n\t\t// This is an amazingly awful format to parse.\n\t\t$lines = explode(\"\\n\", $response['data']);\n\t\t$inheader = true;\n\t\t$istrunk = $isendpoint = false;\n\t\tforeach ($lines as $l) {\n\t\t\tif ($inheader) {\n\t\t\t\tif (isset($l[1]) && $l[1] == \"=\") {\n\t\t\t\t\t// Last line of the header.\n\t\t\t\t\t$inheader = false;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$l = trim($l);\n\t\t\tif (!$l) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If we have a line starting with 'Endpoint:' then we found one!\n\t\t\tif (strpos($l, \"Endpoint:\") === 0) {\n\t\t\t\tif (preg_match(\"/Endpoint:\\s+(.+)\\/(.+?)\\b\\s+(.+)/\", $l, $out)) {\n\t\t\t\t\t// Found a device\n\t\t\t\t\t$isendpoint = $out[1];\n\t\t\t\t\t$istrunk = false;\n\t\t\t\t\tif (isset($out[3]) && strpos($out[3], \"Unavail\") === 0) {\n\t\t\t\t\t\t// Unavailable endpoint.\n\t\t\t\t\t\t$retarr['pjsip_users_offline']++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$retarr['pjsip_users_online']++;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t} elseif (preg_match(\"/Endpoint:\\s+(.+?)\\b/\", $l, $out)) {\n\t\t\t\t\t// Found a trunk\n\t\t\t\t\t$isendpoint = false;\n\t\t\t\t\t$istrunk = $out[1];\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tthrow new \\Exception(\"Unable to parse endpoint $l\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we have a Contact: line, then that's something that's registered!\n\t\t\tif (strpos($l, \"Contact:\") === 0) {\n\t\t\t\tif ($isendpoint !== false) {\n\t\t\t\t\t// This is a registered endpoint\n\t\t\t\t\t$retarr['pjsip_registrations_online']++;\n\t\t\t\t} elseif ($istrunk !== false) {\n\t\t\t\t\t// Trunk status... Check for 'avail'\n\t\t\t\t\tif (strpos($l, \"Avail \") === false) {\n\t\t\t\t\t\t// Trunk down.\n\t\t\t\t\t\t$retarr['pjsip_trunks_offline']++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$retarr['pjsip_trunks_online']++;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrow new \\Exception(\"Found a contact before I figured out what it is!\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Now figure out the totals.\n\t\tforeach ($protocols as $p) {\n\t\t\t$users = $retarr[$p.\"_users_online\"]+$retarr[$p.\"_users_offline\"];\n\t\t\t$retarr[$p.\"_users_total\"] = $users;\n\n\t\t\t$trunks = $retarr[$p.\"_trunks_online\"]+$retarr[$p.\"_trunks_offline\"];\n\t\t\t$retarr[$p.\"_trunks_total\"] = $trunks;\n\n\t\t\t$regs = $retarr[$p.\"_registrations_online\"]+$retarr[$p.\"_registrations_offline\"];\n\t\t\t$retarr[$p.\"_registrations_total\"] = $regs;\n\t\t}\n\n\t\tforeach ($vars as $v) {\n\t\t\tforeach ($protocols as $p) {\n\t\t\t\t$retarr[$v] += $retarr[$p.\"_\".$v];\n\t\t\t}\n\t\t}\n\n\t\treturn $retarr;\n\t}", "public function get_device_by_id($id)\n {\n $this->db->from('device');\n $this->db->where('id', $id);\n $this->db->limit(1);\n $query = $this->db->get();\n return $query->row_array();\n }", "function get_device_status($conn) {\n\n\t$sql = \"\n\tSELECT devices.id, devices.title, devices.name , devices.port , device_categories.category, devices.status AS device_stat, device_status.status , device_status.status_code\n\tFROM devices\n\tJOIN device_categories ON devices.category_id = device_categories.id\n\tJOIN device_status ON devices.status = device_status.id\n\tWHERE 1 ORDER BY devices.id \";\n\n\t$result = mysqli_query($conn, $sql);\n\n\t$devices = [];\n\n\tif (!$result) {\n\t\tdie(\"Error description: \".mysqli_error($con));\n\t} else if (mysqli_num_rows($result) > 0) {\n\t\t// output data of each row\n\t\twhile ($row = mysqli_fetch_assoc($result)) {\n\t\t\t$devices[] = $row;\n\t\t}\n\t}\n\n\tmysqli_close($conn);\n\treturn $devices;\n\n}", "public function getDevice()\n {\n return $this->fileStructure->device;\n }", "public function index()\n {\n return Device::all();\n }", "function process_devs_disp($host_data)\n{\n global $id;\n\n $i = 0;\n $table = \"\";\n\n $arr = array ('command'=>'devs','parameter'=>'');\n $devs_arr = send_request_to_host($arr, $host_data);\n\n if ($devs_arr != null)\n {\n $id = $host_data['id'];\n while (isset($devs_arr['DEVS'][$i]))\n {\n $table .= process_dev_disp($devs_arr['DEVS'][$i]);\n $i++;\n }\n }\n\n return $table;\n}", "public function onDevices()\n {\n return $this->hasMany('App\\Device', 'ROOM_ID')->where('ONLINE_FLAG',1);\n }", "public function getOnlineDeviceList(){\n $query = \"select * from $this->onlineDevice_tableName\";\n $result = $this->dbh->query($query);\n if($result->rowCount() > 0 ){\n return $result->fetchAll();\n }\n return null;\n }", "public function get_subDevices(): array\n {\n return $this->get_subDevices_internal();\n }", "protected function detectUserDeviceDetails()\n {\n $userAgent = $_SERVER['HTTP_USER_AGENT']; \n \n if($userAgent) \n { \n\n \n /*\n * I have uncommented this to add new detection engine this is old code.. so In case any error comment the new detection code and uncomment the old one.\n * start\n *\n */\n \n //Iniate device detection using Device detection adapter\n //$deviceDetector = Nexva_DeviceDetection_Adapter_TeraWurfl::getInstance();\n \n //Detect the device\n //$exactMatch = $deviceDetector->detectDeviceByUserAgent($userAgent);\n \n //Device barand name\n //$this->_deviceDetails = $deviceDetector->getDeviceAttribute('product_info');\n \n \n /*\n * I have uncommented this to add new detection engine this is old code.. so In case any error comment the new detection code and uncomment the old one.\n * end\n *\n */\n \n \n \n \n /*\n * Detection Script Start we need to find a better way to implemnt this as i am doing this in hurry bcos shaun need to put this live up\n *\n *\n */\n \n $session = new Zend_Session_Namespace(\"devices_partner_web\");\n $deviceId = $session->deviceId;\n\n \n \n if(!isset($deviceId) and $session->is_check == false) {\n \n \t$deviceDetection = Nexva_DeviceDetection_Adapter_HandsetDetection::getInstance();\n \t$deviceInfo = $deviceDetection->getNexvaDeviceId($_SERVER['HTTP_USER_AGENT']);\n \t//If this is not a wireless device redirect to the main site\n \n \n \t// get properties from the Wurfl\n \t$brandName = $deviceInfo->brand;\n \t$modelName = $deviceInfo->model;\n \t$marketing_name = $deviceInfo->marketing_name;\n \t$inputMethod = $deviceInfo->pointing_method;\n \t$osVersion = $deviceInfo->device_os_version;\n \t$exactMatch = $deviceInfo;\n \t$deviceOs = $deviceInfo->platform;\n \t//get nexva device Id\n \t$deviceId = $deviceInfo->id;\n \t$isWireless = $deviceInfo->is_mobile_device;\n \t\n \t$session->deviceId = $deviceId;\n \t$session->is_mobile_device = $isWireless;\n \t$session->device_os_version =\n \t$session->platform = $deviceOs;\n \t$session->device_os_version = $osVersion;\n \t$session->pointing_method = $inputMethod;\n \t$session->marketing_name = $marketing_name;\n \t$session->model = $modelName;\n \t$session->brand = $brandName;\n \t$session->is_check = true;\n \t\n } else {\n // get properties from the Wurfl\n\n $deviceOs = $session->platform;\n $deviceId = $session->deviceId;\n $isWireless = $session->is_mobile_device;\n $deviceOs = $session->platform;\n $osVersion = $session->device_os_version;\n $inputMethod = $session->pointing_method;\n $marketing_name = $session->marketing_name;\n $brandName = $session->brand;\n $modelName = $session->model;\n }\n \n \t\n\n \t\n \n $this->_deviceDetails['brand_name'] = $brandName;\n $this->_deviceDetails['device_os_version'] = $osVersion;\n $this->_deviceDetails['device_os'] = $deviceOs;//($deviceOs == 'BlackBerry' ? 'RIM OS' : $deviceOs);\n $this->_deviceDetails['model_name'] = $modelName;\n $this->_deviceDetails['brand_name'] = $brandName;\n $this->_deviceDetails['pointing_method'] = $inputMethod;\n $this->_deviceDetails['is_wireless_device'] = $isWireless;\n \n \n \n // $this->_deviceDetails =\n \n \n /*\n * Detection Script End\n *\n *\n */\n \n\n /*\n if( $deviceOs == 'BlackBerry' && $osVersion == '10.0'){\n \n \n $skip_action_names = array('index');\n \n if (in_array( $this->getRequest ()->getActionName (), $skip_action_names ))\n {\n $this->_redirect('http://'. $_SERVER ['HTTP_HOST'].'/index/device-not-found'); \n }\n \n \n\n \n }\n \n \n */\n \n \n \n \n \n \n \n\n }\n else\n {\n $this->_deviceDetails = null;\n }\n \n }", "public function getdeviceid($id)\n{\n//echo \"SELECT `name`,`device_id` FROM `user` WHERE `userid` = '$id' \";\n$query = mysql_query(\"SELECT `name`,`device_id` FROM `user` WHERE `userid` = '$id' \");\n$row = mysql_num_rows($query);\nif($row == 1)\n{\n\nwhile($data = mysql_fetch_assoc($query))\n{\n\n$dev = $data;\nif($dev['device_id'] != \"\")\nreturn $dev;\nelse \nreturn 0;\n}\n\n}\nelse return 0;\n\n\n}", "public function device()\n {\n return $this->morphOne('App\\Device', 'provider');\n }", "function get_user_by_device_token($device_token)\n{\n global $conn;\n $q['query'] = \"SELECT * FROM `user_master` WHERE `device_token`='$device_token'\";\n $q['run'] = $conn->query($q['query']);\n $q['result'] = $q['run']->fetch_assoc();\n if ($q['result'])\n {\n return $q['result'];\n }\n else\n {\n $q1['query'] = \"SELECT * FROM `device_tokens` WHERE `device_token`='$device_token'\";\n $q1['run'] = $conn->query($q1['query']);\n $q1['result'] = $q1['run']->fetch_assoc();\n \n return $q1['result'];\n }\n\n}", "public function devices()\n {\n return $this->hasMany('SimulatorOperation\\Device');\n }", "private function GetDevicesByAvailability(bool $isAvailable) {\n if ($isAvailable) {\n return $this->GetAvailableDevices();\n } else {\n return $this->GetUnavailableDevices();\n }\n }", "private function telnet_enabled_device_classes()\r\n\t{\r\n\t\t//specific class is here so i can write logic to force a specific class to handle a particular device\r\n\t\t\r\n\t\tif ($this->_specific_connect_class == null) {\r\n\t\t\r\n\t\t\ttry {\r\n\t\t\t\t\t\r\n\t\t\t\treturn new Thelist_Model_devicecisco($this->_fqdn, $this->_auth_obj);\r\n\t\t\t\t\t\r\n\t\t\t} catch (Exception $e) {\r\n\t\t\t\t\t\r\n\t\t\t\tswitch($e->getCode()){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tcase 1;\r\n\t\t\t\t\t//return new bairos($this->_fqdn, $this->_auth_obj);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 2;\r\n\t\t\t\t\t//return $this->log_equipment_action('command_got_return', $e->getMessage(), $if_id);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault;\r\n\t\t\t\t\tthrow $e;\r\n\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t} else if ($this->_specific_connect_class == 'cisco') {\r\n\t\t\t\r\n\t\t\t$device_cisco = new Thelist_Model_devicecisco($this->_fqdn, $this->_auth_obj);\r\n\t\t\tif ($device_cisco != false) {\r\n\t\t\t\treturn $device_cisco;\r\n\t\t\t} else {\r\n\t\t\t\tthrow new exception(\"you specified \".$specific_class.\" as the class of device \".$this->_fqdn.\" this failed\");\t\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t} else if ($this->_specific_connect_class == 'routeros') {\r\n\t\t\t\r\n\t\t\t$device = new Thelist_Model_devicerouteros($this->_fqdn, $this->_auth_obj);\r\n\t\t\tif ($device != false) {\r\n\t\t\t\treturn $device;\r\n\t\t\t} else {\r\n\t\t\t\tthrow new exception(\"you specified \".$specific_class.\" as the class of device \".$this->_fqdn.\" this failed\");\r\n\t\t\t}\t\r\n\r\n\t\t}\r\n\t\r\n\t}", "public function getDevice(Request $request)\n {\n $onlineDevices = Device::where([['MANUFACTURER_ID',1],\n ['ONLINE_FLAG',1]])->get()->count();\n $offlineDevices = Device::where([['MANUFACTURER_ID',1],\n ['ONLINE_FLAG',0]])->get()->count();\n $devices = array(\n ['status' => 'Online Device/s', 'count' => $onlineDevices,\n 'color' => '#28a745'],\n ['status' => 'Offline Device/s', 'count' => $offlineDevices,\n 'color' => '#cc0000'],\n );\n return $devices;\n }", "public function index() {\n\t\tif (! Auth::check ()) {\n\t\t\treturn Redirect::to ( 'login' );\n\t\t}\n\t\t\n\t\t$username = Auth::user ()->username;\n\t\t$redis = Redis::connection ();\n\t\t$fcode = $redis->hget ( 'H_UserId_Cust_Map', $username . ':fcode' );\n\t\t\t\t\t\t\t\t\n\t\t$devicesList=$redis->smembers( 'S_Device_' . $fcode);\n\t\tlog::info( '------device list size---------- '.count($devicesList));\n\t\t$temp=0;\n\t\t$deviceMap=array();\n\t\tfor($i =0;$i<count($devicesList);$i++){\n\t\t\t$vechicle=$redis->hget ( 'H_Vehicle_Device_Map_' . $fcode, $devicesList[$i] );\n\t\t\t\n\n\t\t\tif($vechicle!==null)\n\t\t\t{\n\t\t\t\t$refData \t= $redis->hget ( 'H_RefData_' . $fcode, $vechicle );\n\t\t\t\t$refData\t= json_decode($refData,true);\n\t\t\t\t$orgId \t\t= isset($refData['OWN'])?$refData['OWN']:' ';\n\t\t\t\t$onboardDate=isset($refData['onboardDate'])?$refData['onboardDate']:'null';\n\t\t\t\t$vehicleExpiry=isset($refData['vehicleExpiry'])?$refData['vehicleExpiry']:'null';\n\t\t\t\t// log::info(isset($refData['OWN']));\n\t\t\t\t// log::info($orgId);\n\t\t\t\t// log::info(' dealer name ');\n // log::info($vehicleExpiry);\n\t\t\t\t$deviceMap \t= array_add($deviceMap,$i,$vechicle.','.$devicesList[$i].','.$orgId.','.$onboardDate.','.$vehicleExpiry);\n\t\t\t}\n\t\t\t\n\t\t\t$temp++;\n\t\t}\n\t\tlog::info( '------device map---------- '.count($deviceMap));\n\t\treturn View::make ( 'vdm.business.device', array (\n\t\t\t\t'deviceMap' => $deviceMap ) );\n\t\t\n\t}", "function getDetailAllDevice($account_id_local,$DbConnection)\n{\n $query=\"SELECT device_manufacturing_info.device_imei_no FROM device_manufacturing_info INNER JOIN device_assignment USE INDEX(dass_aid_status) ON device_manufacturing_info.device_imei_no=\".\n \"device_assignment.device_imei_no AND device_assignment.account_id='$account_id_local' AND device_assignment.status=1\";\n $result=mysql_query($query,$DbConnection);\n while($row=mysql_fetch_object($result))\n {\n //$device_imei_no=$row->device_imei_no;\t\t\n $data[]=array('device_imei_no'=>$row->device_imei_no);\t\n }\n return $data;\n}", "function doModel() {\n\t$data = array();\n\t$data['apikey'] = APIKEY;\n\t\n\t// Fetch model information about all nokia devices\n\t$data['vendor'] = \"Nokia\";\n\t\n\t$result = sendjson($data, HD_SERVER.\"/devices/models.json\");\n\t//$result = sendxml($data, HD_SERVER.\"/devices/models.xml\");\n}", "public function show(Device $device)\n {\n //\n }", "public function show(Device $device)\n {\n //\n }", "public function show(Device $device)\n {\n //\n }" ]
[ "0.6744169", "0.6722273", "0.65089124", "0.6367403", "0.613736", "0.6130698", "0.60902536", "0.60592014", "0.6047559", "0.60295933", "0.5969483", "0.59667045", "0.5843289", "0.57683235", "0.57330203", "0.56724316", "0.56403875", "0.5609289", "0.55846155", "0.55827385", "0.557", "0.556627", "0.55657554", "0.5556661", "0.5529148", "0.5524455", "0.55089647", "0.54866517", "0.5454879", "0.5451033", "0.5442314", "0.5427326", "0.5421098", "0.5401096", "0.5397018", "0.5392548", "0.53882724", "0.53531784", "0.5345486", "0.5324691", "0.5308875", "0.5306825", "0.5306825", "0.5306825", "0.5306825", "0.53035873", "0.52644503", "0.5258955", "0.5256806", "0.52437085", "0.52359205", "0.52284855", "0.52271456", "0.5206456", "0.52062434", "0.5199125", "0.518581", "0.5183432", "0.51813006", "0.5178344", "0.5127961", "0.51045895", "0.5097361", "0.507511", "0.5047305", "0.5031222", "0.5026066", "0.5015827", "0.5011328", "0.50097007", "0.49991283", "0.49906647", "0.49883413", "0.49766117", "0.4975899", "0.49696726", "0.49619177", "0.4935012", "0.4924689", "0.49200264", "0.4902747", "0.48999643", "0.4890086", "0.4888047", "0.48838174", "0.48727167", "0.48697108", "0.48688254", "0.48659375", "0.48656338", "0.48622954", "0.484074", "0.48364374", "0.4831975", "0.48250848", "0.4822906", "0.48208776", "0.48153007", "0.48147377", "0.48147377", "0.48147377" ]
0.0
-1
Display a listing of the resource.
public function index(Request $request) { $filter = $request->input('filter'); $per_page = $request->input('per_page'); $current_page = $request->input('current_page'); $sort_by = $request->input('sort_by'); $descending = $request->input('descending'); return $this->library->getlibrary($per_page, $current_page, $filter, $sort_by, $descending); }
{ "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(Request $request) { $form = json_decode($request->form); $libraryData = [ 'book_title' =>$form->book_title, 'book_number' =>$form->book_number, 'rack_number' =>$form->rack_number, 'publisher' =>$form->publisher, 'description' =>$form->description, 'author' =>$form->author, 'subject' =>$form->subject, 'get_book' =>$form->get_book, 'book_price' =>$form->book_price, 'return_book' =>$form->return_book, 'phone' =>$form->phone, ]; $library = $this->library->create($libraryData); if($library) { return ['library Message']; } return json_encode($this->library->find($id)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n 'description' => 'nullable|string',\n ]);\n\n $resource = Resource::create($request->all());\n\n if ( $request->hasFile('file') ) {\n $resourceFile = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resourceFile);\n $resource->file = $resourceFile;\n $resource->save();\n }\n\n if ( $request->submit == 'Save' ) {\n return redirect()->route('admin.resources.index')->with('success','Resource Successfully Uploaded');\n } else {\n return redirect()->route('admin.resources.create')->with('success','Resource Successfully Uploaded');\n }\n }", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72857565", "0.714571", "0.71328056", "0.66390204", "0.6620437", "0.6567189", "0.6526738", "0.65074694", "0.64491314", "0.63734114", "0.6370837", "0.63628685", "0.63628685", "0.63628685", "0.6342026", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964" ]
0.0
-1
Display the specified resource.
public function show($id) { return $this->library->findOrFail($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(library $library,$id) { return $this->library->findOrFail($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,library $library, $id) { $library = $this->library->findOrFail($id); $form = json_decode($request->form); $libraryData = [ 'book_title' =>$form->book_title, 'book_number' =>$form->book_number, 'rack_number' =>$form->rack_number, 'publisher' =>$form->publisher, 'description' =>$form->description, 'author' =>$form->author, 'subject' =>$form->subject, 'get_book' =>$form->get_book, 'book_price' =>$form->book_price, 'return_book' =>$form->return_book, 'phone' =>$form->phone, ]; $library->update($libraryData); return ['message' => 'Update 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(library $library) { $library = $this->library->find($id); $staff->delete(); }
{ "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}", "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 function delete(): void\n {\n unlink($this->path);\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 $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 File::find($id)->remove();\n \n return redirect()->route('files.index');\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 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 removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\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 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 removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "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 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 deleted(Storage $storage)\n {\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 removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "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 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 }", "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();", "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()\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.6673811", "0.66624975", "0.66376764", "0.66351163", "0.66280866", "0.65443397", "0.6543099", "0.64656305", "0.62881804", "0.61755043", "0.61278707", "0.6089098", "0.60534257", "0.6043048", "0.6006416", "0.593359", "0.5929751", "0.5923406", "0.59201753", "0.5904145", "0.58963126", "0.5895338", "0.589437", "0.589437", "0.589437", "0.589437", "0.58819216", "0.58684987", "0.5864614", "0.58097607", "0.57739484", "0.5761358", "0.57558876", "0.5750673", "0.5741367", "0.5734089", "0.57264656", "0.5715195", "0.5711313", "0.5707201", "0.57057804", "0.57053447", "0.5702519", "0.5698952", "0.56844676", "0.56844676", "0.56783324", "0.5677608", "0.56581664", "0.564899", "0.5648674", "0.5647576", "0.5641079", "0.5636559", "0.56325674", "0.5619814", "0.5615794", "0.5607223", "0.56022006", "0.5601402", "0.5601336", "0.56004316", "0.5590177", "0.55810463", "0.55665016", "0.5565872", "0.5565398", "0.5563011", "0.55565405", "0.5556361", "0.5549312", "0.5544914", "0.554211", "0.5540394", "0.5540394", "0.5537265", "0.5536237", "0.55310345", "0.55295527", "0.5529016", "0.5527304", "0.5527274", "0.5527126", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5523294", "0.55231583", "0.55181384" ]
0.0
-1
Collect gift wrapping totals
public function collect(\Magento\Sales\Model\Order\Invoice $invoice) { $order = $invoice->getOrder(); /** * Wrapping for items */ $invoiced = 0; $baseInvoiced = 0; foreach ($invoice->getAllItems() as $invoiceItem) { if (!$invoiceItem->getQty() || $invoiceItem->getQty() == 0) { continue; } $orderItem = $invoiceItem->getOrderItem(); if ($orderItem->getGwId() && $orderItem->getGwBasePrice() && $orderItem->getGwBasePrice() != $orderItem->getGwBasePriceInvoiced() ) { $orderItem->setGwBasePriceInvoiced($orderItem->getGwBasePrice()); $orderItem->setGwPriceInvoiced($orderItem->getGwPrice()); $baseInvoiced += $orderItem->getGwBasePrice() * $invoiceItem->getQty(); $invoiced += $orderItem->getGwPrice() * $invoiceItem->getQty(); } } if ($invoiced > 0 || $baseInvoiced > 0) { $order->setGwItemsBasePriceInvoiced($order->getGwItemsBasePriceInvoiced() + $baseInvoiced); $order->setGwItemsPriceInvoiced($order->getGwItemsPriceInvoiced() + $invoiced); $invoice->setGwItemsBasePrice($baseInvoiced); $invoice->setGwItemsPrice($invoiced); } /** * Wrapping for order */ if ($order->getGwId() && $order->getGwBasePrice() && $order->getGwBasePrice() != $order->getGwBasePriceInvoiced() ) { $order->setGwBasePriceInvoiced($order->getGwBasePrice()); $order->setGwPriceInvoiced($order->getGwPrice()); $invoice->setGwBasePrice($order->getGwBasePrice()); $invoice->setGwPrice($order->getGwPrice()); } /** * Printed card */ if ($order->getGwAddCard() && $order->getGwCardBasePrice() && $order->getGwCardBasePrice() != $order->getGwCardBasePriceInvoiced() ) { $order->setGwCardBasePriceInvoiced($order->getGwCardBasePrice()); $order->setGwCardPriceInvoiced($order->getGwCardPrice()); $invoice->setGwCardBasePrice($order->getGwCardBasePrice()); $invoice->setGwCardPrice($order->getGwCardPrice()); } $invoice->setBaseGrandTotal( $invoice->getBaseGrandTotal() + $invoice->getGwItemsBasePrice() + $invoice->getGwBasePrice() + $invoice->getGwCardBasePrice() ); $invoice->setGrandTotal( $invoice->getGrandTotal() + $invoice->getGwItemsPrice() + $invoice->getGwPrice() + $invoice->getGwCardPrice() ); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function giftwrapAmount_2() {\r\n $amountPrice = 0;\r\n $giftwrap_items = Mage::getModel('giftwrap/selection')->getSelection();\r\n $decrease = $this->getDecreasePrice();\r\n if (is_array($giftwrap_items)) {\r\n foreach ($giftwrap_items as $value) {\r\n $giftwrap = Mage::getModel('giftwrap/giftwrap')->load(\r\n $value['styleId']);\r\n $amountPrice += (float) $this->subGiftwrapTotal(\r\n $giftwrap->getPrice(), $value['itemId']);\r\n }\r\n }\r\n $items = Mage::getSingleton('checkout/cart')->getItems();\r\n $countProductGiftwrap = 0;\r\n foreach ($items as $item) {\r\n $productId = $item->getProductId();\r\n if (Mage::getModel('catalog/product')->load($productId)->getGiftwrap()) {\r\n $countProductGiftwrap++;\r\n }\r\n }\r\n $itemIds = array();\r\n if (is_array($giftwrap_items)) {\r\n foreach ($giftwrap_items as $value) {\r\n $itemIds[] = $value['itemId'];\r\n }\r\n }\r\n if ($decrease != 0 && in_array(0, $itemIds) && $countProductGiftwrap >= 2) {\r\n $amountPrice = $amountPrice - $amountPrice * $decrease / 100;\r\n }\r\n return $amountPrice;\r\n }", "function totals()\n\t{\n\t\treturn $this->_tour_voucher_contents['totals'];\n\t}", "function fantacalcio_calcola_totali($vote_round) {\n drupal_set_title(filter_xss('Risultati ' . $vote_round . '&ordf; giornata'));\n\n// $vote_round = get_last_votes();\n $teams = get_teams();\n $votes = get_votes($vote_round);\n $competitions = get_competitions();\n\n $matches = array();\n foreach ($competitions as $c_id => $competition) {\n $competition_round = get_last_competition_round($c_id);\n $matches_competitions = get_round_matches($competition_round, '', $c_id);\n\n $matches = array_merge($matches, $matches_competitions);\n }\n\n $out = '';\n\n $header = array(\"Comp\", \"Team1\", \"Voti\", \"Mod Dif\", \"Mod Centr\", \"+\", \"Tot\", \"Gol\", \"Team1\", \"Voti\", \"Mod Dif\", \"Mod Centr\", \"+\", \"Tot\", \"Gol\", \"W\");\n\n foreach ($matches as $m_id => $match) {\n $t1_id = $match->t1_id;\n $t2_id = $match->t2_id;\n $competition_round = $match->round;\n $c_id = get_cid_by_gid($match->g_id);\n\n $mod_por_1 = $match->mod_por_1;\n $mod_por_2 = $match->mod_por_2;\n $mod_dif_1 = $match->mod_dif_1;\n $mod_dif_2 = $match->mod_dif_2;\n $mod_centr_1 = $match->mod_centr_1;\n $mod_centr_2 = $match->mod_centr_2;\n $mod_att_1 = $match->mod_att_1;\n $mod_att_2 = $match->mod_att_2;\n \n $bonus_t1 = $match->bonus_t1;\n $bonus_t2 = $match->bonus_t2;\n\n $tot_voti_1 = get_totale($t1_id, $competition_round, $vote_round, $c_id, variable_get(\"fantacalcio_votes_provider\", 1));\n $tot_voti_2 = get_totale($t2_id, $competition_round, $vote_round, $c_id, variable_get(\"fantacalcio_votes_provider\", 1));\n\n $tot_1 = $tot_voti_1 + $mod_por_1 + $mod_dif_2 + $mod_centr_1 + $mod_att_1 + $bonus_t1;\n $tot_2 = $tot_voti_2 + $mod_por_2 + $mod_dif_1 + $mod_centr_2 + $mod_att_2 + $bonus_t2;\n\n $goals_1 = floor(($tot_1 -60) / 6);\n $goals_2 = floor(($tot_2 -60) / 6);\n $goals_1 = ($goals_1 >= 0) ? $goals_1 : 0;\n $goals_2 = ($goals_2 >= 0) ? $goals_2 : 0;\n \n //vittoria con scarto\n if (variable_get('fantacalcio_scarto', '0') && variable_get('fantacalcio_scarto_punti', '0') > 0) {\n if ( ($goals_1 == $goals_2) && ($tot_1 - $tot_2) > variable_get('fantacalcio_scarto_punti', '0') ) $goals_1++;\n if ( ($goals_1 == $goals_2) && ($tot_2 - $tot_1) > variable_get('fantacalcio_scarto_punti', '0') ) $goals_2++;\n }\n\n $winner_id = ($goals_1 > $goals_2) ? $t1_id : $t2_id;\n $winner_id = ($goals_1 == $goals_2) ? -1 : $winner_id;\n\n //aggiorno partite\n $sql = \"UPDATE {fanta_matches} SET \n pt_1 = '%f', \n pt_2 = '%f', \n tot_1 = '%f', \n tot_2 = '%f', \n goals_1 = '%d', \n goals_2 = '%d', \n played = 1, \n winner_id = '%d' \n WHERE m_id = '%d'\";\n $result = db_query($sql, $tot_voti_1, $tot_voti_2, $tot_1, $tot_2, $goals_1, $goals_2, $winner_id, $match->m_id);\n \n }\n\n $sqlx = \"SELECT * FROM {fanta_rounds_competitions} WHERE round = '%d'\";\n $resultx = db_query($sqlx, $vote_round);\n while ($rowx = db_fetch_array($resultx)) {\n $c_id = $rowx['c_id'];\n $competition_round = $rowx['competition_round'];\n\n $sql = \"SELECT * FROM {fanta_matches} \" .\n \"WHERE g_id IN (SELECT g_id FROM {fanta_groups} WHERE c_id = '%d') \" .\n \"AND round = '%d' \";\n $result = db_query($sql, $c_id, $competition_round);\n $out .= \"<h3>\" . check_plain($competitions[$c_id]->name) . \"</h3>\";\n\n $header = array(\"Squadra\", \"Punti\", \"Totale\", \"Goal\", \"Vincitore\");\n $rows = array();\n\n while ($row = db_fetch_array($result)) {\n $rows[$row['m_id'] . \"_1\"][] = $teams[$row['t1_id']]->name;\n $rows[$row['m_id'] . \"_1\"][] = $row['pt_1'];\n $rows[$row['m_id'] . \"_1\"][] = $row['tot_1'];\n $rows[$row['m_id'] . \"_1\"][] = $row['goals_1'];\n //$rows[$row['m_id'] . \"_1\"][] = $row['mod_att_1'];\n $rows[$row['m_id'] . \"_2\"][] = $teams[$row['t2_id']]->name;//squadra 2\n $rows[$row['m_id'] . \"_2\"][] = $row['pt_2'];\n $rows[$row['m_id'] . \"_2\"][] = $row['tot_2'];\n $rows[$row['m_id'] . \"_2\"][] = $row['goals_2'];\n $rows[$row['m_id'] . \"_2\"][] = ($row['winner_id'] == -1) ? \" - \" : $teams[$row['winner_id']]->name;\n \n $rows[$row['m_id'] . \"_3\"][] = array(\"data\" => \"<hr>\", \"colspan\" => 5);//separatore\n }\n $out .= theme_table($header, $rows);\n\n }\n\n return $out;\n}", "private function _getWrappingValues(){\n return number_format(Tools::ps_round($this->context->cart->getOrderTotal(TRUE, Cart::ONLY_WRAPPING), 2), 2, '.', '');\n }", "public function getTotals($dataObject)\n {\n $totals = array();\n\n $displayWrappingBothPrices = false;\n $displayWrappingIncludeTaxPrice = false;\n $displayCardBothPrices = false;\n $displayCardIncludeTaxPrice = false;\n\n if ($dataObject instanceof Mage_Sales_Model_Order\n || $dataObject instanceof Mage_Sales_Model_Order_Invoice\n || $dataObject instanceof Mage_Sales_Model_Order_Creditmemo) {\n $displayWrappingBothPrices = $this->displaySalesWrappingBothPrices();\n $displayWrappingIncludeTaxPrice = $this->displaySalesWrappingIncludeTaxPrice();\n $displayCardBothPrices = $this->displaySalesCardBothPrices();\n $displayCardIncludeTaxPrice = $this->displaySalesCardIncludeTaxPrice();\n } elseif ($dataObject instanceof Mage_Sales_Model_Quote_Address_Total) {\n $displayWrappingBothPrices = $this->displayCartWrappingBothPrices();\n $displayWrappingIncludeTaxPrice = $this->displayCartWrappingIncludeTaxPrice();\n $displayCardBothPrices = $this->displayCartCardBothPrices();\n $displayCardIncludeTaxPrice = $this->displayCartCardIncludeTaxPrice();\n }\n\n /**\n * Gift wrapping for order totals\n */\n if ($displayWrappingBothPrices || $displayWrappingIncludeTaxPrice) {\n if ($displayWrappingBothPrices) {\n $this->_addTotalToTotals(\n $totals,\n 'gw_order_excl',\n $dataObject->getGwPrice(),\n $dataObject->getGwBasePrice(),\n $this->__('Gift Wrapping for Order (Excl. Tax)')\n );\n }\n $this->_addTotalToTotals(\n $totals,\n 'gw_order_incl',\n $dataObject->getGwPrice() + $dataObject->getGwTaxAmount(),\n $dataObject->getGwBasePrice() + $dataObject->getGwBaseTaxAmount(),\n $this->__('Gift Wrapping for Order (Incl. Tax)')\n );\n } else {\n $this->_addTotalToTotals(\n $totals,\n 'gw_order',\n $dataObject->getGwPrice(),\n $dataObject->getGwBasePrice(),\n $this->__('Gift Wrapping for Order')\n );\n }\n\n /**\n * Gift wrapping for items totals\n */\n if ($displayWrappingBothPrices || $displayWrappingIncludeTaxPrice) {\n $this->_addTotalToTotals(\n $totals,\n 'gw_items_incl',\n $dataObject->getGwItemsPrice() + $dataObject->getGwItemsTaxAmount(),\n $dataObject->getGwItemsBasePrice() + $dataObject->getGwItemsBaseTaxAmount(),\n $this->__('Gift Wrapping for Items (Incl. Tax)')\n );\n if ($displayWrappingBothPrices) {\n $this->_addTotalToTotals(\n $totals,\n 'gw_items_excl',\n $dataObject->getGwItemsPrice(),\n $dataObject->getGwItemsBasePrice(),\n $this->__('Gift Wrapping for Items (Excl. Tax)')\n );\n }\n } else {\n $this->_addTotalToTotals(\n $totals,\n 'gw_items',\n $dataObject->getGwItemsPrice(),\n $dataObject->getGwItemsBasePrice(),\n $this->__('Gift Wrapping for Items')\n );\n }\n\n /**\n * Printed card totals\n */\n if ($displayCardBothPrices || $displayCardIncludeTaxPrice) {\n $this->_addTotalToTotals(\n $totals,\n 'gw_printed_card_incl',\n $dataObject->getGwCardPrice() + $dataObject->getGwCardTaxAmount(),\n $dataObject->getGwCardBasePrice() + $dataObject->getGwCardBaseTaxAmount(),\n $this->__('Printed Card (Incl. Tax)')\n );\n if ($displayCardBothPrices) {\n $this->_addTotalToTotals(\n $totals,\n 'gw_printed_card_excl',\n $dataObject->getGwCardPrice(),\n $dataObject->getGwCardBasePrice(),\n $this->__('Printed Card (Excl. Tax)')\n );\n }\n } else {\n $this->_addTotalToTotals(\n $totals,\n 'gw_printed_card',\n $dataObject->getGwCardPrice(),\n $dataObject->getGwCardBasePrice(),\n $this->__('Printed Card')\n );\n }\n\n return $totals;\n }", "function getTotalsForDisplay()\n {\n $amount = $this->getSource()->formatPriceTxt($this->getAmount());\n\n if ($this->getAmountPrefix()) {\n $amount = $this->getAmountPrefix() . $amount;\n }\n\n $title = __($this->getTitle());\n if ($this->getTitleSourceField()) {\n $label = $title . ' (' . $this->getTitleDescription() . '):';\n } else {\n $label = $title . ':';\n }\n\n $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;\n $total = ['amount' => $amount, 'label' => $label, 'font_size' => $fontSize];\n return [$total];\n }", "protected function _toHtml()\n {\n /** @var $totalsXmlObj Mage_XmlConnect_Model_Simplexml_Element */\n $totalsXmlObj = Mage::getModel('xmlconnect/simplexml_element', '<totals></totals>');\n\n foreach ($this->getQuote()->getTotals() as $total) {\n $code = $total->getCode();\n if ($code == 'giftwrapping') {\n continue;\n }\n\n $title = '';\n $value = null;\n $renderer = $this->_getTotalRenderer($code)->setTotal($total);\n\n switch ($code) {\n case 'subtotal':\n if ($renderer->displayBoth()) {\n $title = $this->__('Subtotal (Excl. Tax)');\n $this->_addTotalDataToXmlObj(\n $totalsXmlObj, $code . '_excl_tax', $title, $total->getValueExclTax()\n );\n\n $code = $code . '_incl_tax';\n $title = $this->__('Subtotal (Incl. Tax)');\n $value = $total->getValueInclTax();\n }\n break;\n case 'shipping':\n if ($renderer->displayBoth()) {\n $title = $renderer->getExcludeTaxLabel();\n $this->_addTotalDataToXmlObj(\n $totalsXmlObj, $code . '_excl_tax', $title, $renderer->getShippingExcludeTax()\n );\n\n $code = $code . '_incl_tax';\n $title = $renderer->getIncludeTaxLabel();\n $value = $renderer->getShippingIncludeTax();\n } else if ($renderer->displayIncludeTax()) {\n $value = $renderer->getShippingIncludeTax();\n } else {\n $value = $renderer->getShippingExcludeTax();\n }\n break;\n case 'grand_total':\n $grandTotalExlTax = $renderer->getTotalExclTax();\n $displayBoth = $renderer->includeTax() && $grandTotalExlTax >= 0;\n if ($displayBoth) {\n $title = $this->__('Grand Total (Excl. Tax)');\n $this->_addTotalDataToXmlObj(\n $totalsXmlObj, $code . '_excl_tax', $title, $grandTotalExlTax\n );\n $code = $code . '_incl_tax';\n $title = $this->__('Grand Total (Incl. Tax)');\n }\n break;\n case 'giftwrapping':\n foreach ($renderer->getValues() as $title => $value) {\n $this->_addTotalDataToXmlObj($totalsXmlObj, $code, $title, $value);\n }\n continue 2;\n case 'giftcardaccount':\n $cards = $renderer->getTotal()->getGiftCards();\n if (!$cards) {\n $cards = $renderer->getQuoteGiftCards();\n }\n if ($renderer->getTotal()->getValue()) {\n foreach ($cards as $cardCode) {\n $title = $this->__('Gift Card (%s)', $cardCode['c']);\n $value = $cardCode['c'];\n $totalXmlObj = $totalsXmlObj->addChild($code);\n $totalXmlObj->addChild('title', $totalsXmlObj->escapeXml($title));\n $totalXmlObj->addChild('value', $value);\n $value = Mage::helper('xmlconnect')->formatPriceForXml($cardCode['a']);\n $formattedValue = $this->getQuote()->getStore()->formatPrice($value, false);\n $totalXmlObj->addChild('formated_value', '-' . $formattedValue);\n }\n }\n continue 2;\n default:\n break;\n }\n if (empty($title)) {\n $title = $total->getTitle();\n }\n if (null === $value) {\n $value = $total->getValue();\n }\n if (null !== $value) {\n $this->_addTotalDataToXmlObj($totalsXmlObj, $code, $title, $value);\n }\n }\n\n return $this->getReturnObjectFlag() ? $totalsXmlObj : $totalsXmlObj->asNiceXml();\n }", "public function calculateTotals()\n {\n $in = $this->_calculateTotalsIn();\n $out = $this->_calculateTotalsOut();\n $rating = $this->_calculateTotalsByRating();\n \n $result = array_merge($in, $out, $rating);\n $output = array();\n \n if (count($result)) {\n foreach ($result as $row) {\n $id = in_array($row['type'], array('MANUFACTURER', 'STOCK_STATUS', 'RATING')) ? '0' : $row['id'];\n $gid = strtolower(substr($row['type'], 0, 1)) . $id;\n if (!isset($output[$gid])) {\n $output[$gid] = array();\n }\n $output[$gid][$row['val']] = $row['c'];\n }\n }\n \n return $output;\n }", "public function initTotals() {\n $helper = Mage::helper('cornerdrop_collect');\n\n /** @var Mage_Sales_Block_Order_Totals $parent */\n $parent = $this->getParentBlock();\n $source = $parent->getSource();\n $shipping_address = $source->getShippingAddress();\n if($shipping_address && $helper->isCornerDropAddress($source->getShippingAddress())) {\n $parent->addTotalBefore(\n new Varien_Object(array(\n 'code' => CornerDrop_Collect_Helper_Data::CORNERDROP_FEE_AMOUNT,\n 'value' => $source->getData(CornerDrop_Collect_Helper_Data::CORNERDROP_FEE_AMOUNT),\n 'base_value'=> $source->getData(CornerDrop_Collect_Helper_Data::BASE_CORNERDROP_FEE_AMOUNT),\n 'label' => $helper->getCornerDropFeeLabel()\n )\n ),\n 'shipping'\n );\n }\n }", "public function getGrandTotal();", "function getTotals(){\n\t\treturn $this->cache->getTotals();\n\t}", "public function getCollectionSumGross() {\n \n $sumGross = 0.00;\n \n if (is_array($this->itemsArr)) {\n foreach($this->itemsArr as $orderWrapperObj) {\n $sumGross += $orderWrapperObj->get_sumGross();\n }\n }\n \n return $sumGross;\n \n }", "abstract public function countTotal();", "public function getGrossTotal(): float;", "protected function _initTotals()\n {\n $this->_totals = array();\n $this->_totals['subtotal'] = new Varien_Object(array(\n 'code' => 'subtotal',\n 'value' => $this->getSource()->getSubtotal(),\n 'base_value' => $this->getSource()->getBaseSubtotal(),\n 'bluesnap_value' => $this->getSource()->getBluesnapSubtotal(),\n 'label' => $this->helper('sales')->__('Subtotal')\n ));\n\n /**\n * Add shipping\n */\n if (!$this->getSource()->getIsVirtual() && ((float)$this->getSource()->getShippingAmount() || $this->getSource()->getShippingDescription())) {\n $this->_totals['shipping'] = new Varien_Object(array(\n 'code' => 'shipping',\n 'value' => $this->getSource()->getShippingAmount(),\n 'base_value' => $this->getSource()->getBaseShippingAmount(),\n 'bluesnap_value' => $this->getSource()->getBluesnapShippingAmount(),\n 'label' => $this->helper('sales')->__('Shipping & Handling')\n ));\n }\n\n /**\n * Add discount\n */\n if (((float)$this->getSource()->getDiscountAmount()) != 0) {\n if ($this->getSource()->getDiscountDescription()) {\n $discountLabel = $this->helper('sales')->__('Discount (%s)', $this->getSource()->getDiscountDescription());\n } else {\n $discountLabel = $this->helper('sales')->__('Discount');\n }\n $this->_totals['discount'] = new Varien_Object(array(\n 'code' => 'discount',\n 'value' => $this->getSource()->getDiscountAmount(),\n 'base_value' => $this->getSource()->getBaseDiscountAmount(),\n 'bluesnap_value' => $this->getSource()->getBluesnapDiscountAmount(),\n 'label' => $discountLabel\n ));\n }\n\n $this->_totals['grand_total'] = new Varien_Object(array(\n 'code' => 'grand_total',\n 'strong' => true,\n 'value' => $this->getSource()->getGrandTotal(),\n 'base_value' => $this->getSource()->getBaseGrandTotal(),\n 'bluesnap_value' => $this->getSource()->getBluesnapGrandTotal(),\n 'label' => $this->helper('sales')->__('Grand Total'),\n 'area' => 'footer'\n ));\n\n\n //end parent totals\n\n $this->_totals['paid'] = new Varien_Object(array(\n 'code' => 'paid',\n 'strong' => true,\n 'value' => $this->getSource()->getTotalPaid(),\n 'base_value' => $this->getSource()->getBaseTotalPaid(),\n 'bluesnap_value' => $this->getSource()->getBluesnapTotalPaid(),\n 'label' => $this->helper('sales')->__('Total Paid'),\n 'area' => 'footer'\n ));\n $this->_totals['refunded'] = new Varien_Object(array(\n 'code' => 'refunded',\n 'strong' => true,\n 'value' => $this->getSource()->getTotalRefunded(),\n 'base_value' => $this->getSource()->getBaseTotalRefunded(),\n 'bluesnap_value' => $this->getSource()->getBluesnapTotalRefunded(),\n 'label' => $this->helper('sales')->__('Total Refunded'),\n 'area' => 'footer'\n ));\n $this->_totals['due'] = new Varien_Object(array(\n 'code' => 'due',\n 'strong' => true,\n 'value' => $this->getSource()->getTotalDue(),\n 'base_value' => $this->getSource()->getBaseTotalDue(),\n 'bluesnap_value' => $this->getSource()->getBluesnapTotalDue(),\n\n 'label' => $this->helper('sales')->__('Total Due'),\n 'area' => 'footer'\n ));\n return $this;\n }", "protected function _initTotals()\n {\n $this->_totals = array();\n\n //overridden store ship\n $storeship = Bm_Cmon::getWholesalerShipping($this->getOrder()->getRealOrderId());\n\n\n $_subtotal = 0;\n foreach ($this->getOrder()->getAllItems() as $orderItem) {\n\n \tif(Bm_Cmon::checkSkuOwner($orderItem->getSku())){\n \t\t$_subtotal+= $orderItem->getQtyOrdered()*$orderItem->getOriginalPrice();\n\n \t}\n \n \n\n }\n\n $this->_totals['subtotal'] = new Varien_Object(array(\n 'code' => 'subtotal',\n 'value' => $_subtotal,\n 'base_value'=> $this->getSource()->getBaseSubtotal(),\n 'label' => $this->helper('sales')->__('Subtotal')\n ));\n\n /**\n * overridden ship value\n */\n if (!$this->getSource()->getIsVirtual() && ((float) $this->getSource()->getShippingAmount() || $this->getSource()->getShippingDescription()))\n {\n \n $this->_totals['shipping'] = new Varien_Object(array(\n 'code' => 'shipping',\n 'value' => $storeship['value'], //$this->getSource()->getShippingAmount(),\n 'base_value'=> $this->getSource()->getBaseShippingAmount(),\n 'label' => $this->helper('sales')->__('Shipping & Handling')\n ));\n }\n\n /**\n * Add discount\n */\n\n /*\n if (((float)$this->getSource()->getDiscountAmount()) != 0) {\n if ($this->getSource()->getDiscountDescription()) {\n $discountLabel = $this->helper('sales')->__('Discount (%s)', $this->getSource()->getDiscountDescription());\n } else {\n $discountLabel = $this->helper('sales')->__('Discount');\n }\n $this->_totals['discount'] = new Varien_Object(array(\n 'code' => 'discount',\n 'value' => $this->getSource()->getDiscountAmount(),\n 'base_value'=> $this->getSource()->getBaseDiscountAmount(),\n 'label' => $discountLabel\n ));\n }\n\t\t*/\n\n\t\t//FIXME: implements discount logic\n $this->_totals['grand_total'] = new Varien_Object(array(\n 'code' => 'grand_total',\n 'strong' => true,\n 'value' => $_subtotal+$this->getSource()->getDiscountAmount()*(-1)+$storeship['value'],\n 'base_value'=> $this->getSource()->getBaseGrandTotal(),\n 'label' => $this->helper('sales')->__('Grand Total'),\n 'area' => 'footer'\n ));\n\n return $this;\n }", "private function getTotalsForDisplay()\n {\n\t\tif(\\Cart2Quote\\License\\Model\\License::getInstance()->isValid()) {\n\t\t\t$quote = $this->getQuote();\n $totals = [];\n $store = $this->getSource()->getStore();\n if ($this->_taxConfig->displaySalesTaxWithGrandTotal($store)) {\n return [];\n }\n $tax = 0;\n foreach ($quote->getAllVisibleItems() as $item) {\n $tax = $tax + $item->getTaxAmount();\n }\n //add shipping tax\n if ($quote->getShippingAddress()->getShippingTaxAmount()) {\n $tax = $tax + $quote->getShippingAddress()->getShippingTaxAmount();\n }\n if ($this->_taxConfig->displaySalesFullSummary($store)) {\n $totals = $this->getFullTaxInfo();\n }\n $tax = $quote->formatPriceTxt($tax);\n $totals = array_merge($totals, parent::getTotalsForDisplay());\n $totals[0]['amount'] = $tax;\n return $totals;\n\t\t}\n\t}", "public function get_totals() {\n\t\treturn empty( $this->totals ) ? $this->default_totals : $this->totals;\n\t}", "public function getTotalsForDisplay()\n {\n $vouchers = $this->getVouchers();\n if (empty($vouchers)) {\n return array();\n }\n\n $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;\n\n $total = array();\n foreach ($vouchers as $voucher) {\n $salePriceInclVat = $voucher['emag_sale_price'] + $voucher['emag_sale_price_vat'];\n\n $total[] = array(\n 'label' => $voucher['emag_voucher_name'] . ':',\n 'amount' => $this->getOrder()->formatPriceTxt($salePriceInclVat),\n 'font_size' => $fontSize,\n );\n }\n\n return $total;\n }", "public function getTotalsForDisplay()\n {\n $amount = $this->getOrder()->formatPriceTxt($this->getAmount());\n if ($this->getAmountPrefix()) {\n $amount = $this->getAmountPrefix().$amount;\n }\n $title = $this->_getSalesHelper()->__($this->getTitle());\n if ($this->getTitleSourceField()) {\n $label = $title . ' (' . $this->getTitleDescription() . '):';\n } else {\n $label = $title . ':';\n }\n\n $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;\n $total = array(\n 'amount' => $amount,\n 'label' => $label,\n 'font_size' => $fontSize\n );\n return array($total);\n }", "public function getTotal();", "public function getTotal();", "protected function _initTotals()\n {\n $source = $this->getSource();\n\n $this->_totals = array();\n $this->_totals['subtotal'] = new Varien_Object(array(\n 'code' => 'subtotal',\n 'value' => $source->getSubtotal(),\n 'label' => $this->__('Subtotal')\n ));\n\n\n /**\n * Add shipping\n */\n if (!$source->getIsVirtual() && ((float) $source->getShippingAmount() || $source->getShippingDescription()))\n {\n $this->_totals['shipping'] = new Varien_Object(array(\n 'code' => 'shipping',\n 'field' => 'shipping_amount',\n 'value' => $this->getSource()->getShippingAmount(),\n 'label' => $this->__('Shipping & Handling')\n ));\n }\n\n /**\n * Add discount\n */\n if (((float)$this->getSource()->getDiscountAmount()) != 0) {\n if ($this->getSource()->getDiscountDescription()) {\n $discountLabel = $this->__('Discount (%s)', $source->getDiscountDescription());\n } else {\n $discountLabel = $this->__('Discount');\n }\n $this->_totals['discount'] = new Varien_Object(array(\n 'code' => 'discount',\n 'field' => 'discount_amount',\n 'value' => $source->getDiscountAmount(),\n 'label' => $discountLabel\n ));\n }\n\n $this->_totals['grand_total'] = new Varien_Object(array(\n 'code' => 'grand_total',\n 'field' => 'grand_total',\n 'strong'=> true,\n 'value' => $source->getGrandTotal(),\n 'label' => $this->__('Grand Total')\n ));\n\n /**\n * Base grandtotal\n */\n if ($this->getOrder()->isCurrencyDifferent()) {\n $this->_totals['base_grandtotal'] = new Varien_Object(array(\n 'code' => 'base_grandtotal',\n 'value' => $this->getOrder()->formatBasePrice($source->getBaseGrandTotal()),\n 'label' => $this->__('Grand Total to be Charged'),\n 'is_formated' => true,\n ));\n }\n return $this;\n }", "public function initTotal()\n {\n // Return val.\n $temp = 0;\n // Add cone price.\n $temp += $this->coneType['price'];\n // Add all scoops of ice cream.\n foreach ($this->scoops as $scoop) {\n $temp += $scoop['price'];\n }\n // Return total item cost.\n return $temp;\n }", "public function initTotals()\n {\n $parent = $this->getParentBlock();\n $this->source = $parent->getSource();\n //@codingStandardsIgnoreLine\n $total = new \\Magento\\Framework\\DataObject(['code' => 'giftcard', 'block_name' => $this->getNameInLayout()]);\n $parent->removeTotal('giftcard');\n $parent->addTotal($total);\n return $this;\n }", "function calcTotals(){\n\t\t\n\t\tif($this->Review == true){/*\n\t\t\t$getRate = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t$getRate->mysql(\"SELECT `tax_percent` FROM `billship_tax_states` WHERE `tax_state` = '\".$this->CustBill['State'].\"';\");\n\t\t\t$getRate->mssql(\"SELECT tax_percent FROM billship_tax_states WHERE tax_state = '\".$this->CustBill['State'].\"';\");\n\t\t\tif($getRate->TotalRows() != 0){ $getRate = $getRate->Rows();\n\t\t\t\t$this->Totals['Tax'] += $this->Totals['Taxable'] * ($getRate[0]['tax_percent']/100);\n\t\t\t}\n\t\t\t$getRate = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t$getRate->mysql(\"SELECT `tax_count_percent` FROM `billship_tax_county` WHERE `tax_count_zip` = '\".$this->CustBill['Zip'].\"';\");\n\t\t\t$getRate->mssql(\"SELECT tax_count_percent FROM billship_tax_county WHERE tax_count_zip = '\".$this->CustBill['Zip'].\"';\");\n\t\t\tif($getRate->TotalRows() != 0){ $getRate = $getRate->Rows();\n\t\t\t\t$this->Totals['Tax'] += $this->Totals['Taxable'] * ($getRate[0]['tax_count_percent']/100);\n\t\t\t}\n\t\t\t\n\t\t\tif($this->Totals['Ship2'] > 0){\n\t\t\t\t$getRate = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t\t$getRate->mysql(\"SELECT `ship_limit_price`, `ship_limit_percent` FROM `billship_shipping_limits` WHERE `ship_limit_start_price` >= '\".$this->Totals['Total'].\"';\");\n\t\t\t\t$getRate->mssql(\"SELECT ship_limit_price, ship_limit_percent FROM billship_shipping_limits WHERE ship_limit_start_price >= '\".$this->Totals['Total'].\"';\");\n\t\t\t\t\t\t\t\n\t\t\t\tif($getRate->TotalRows() == 0){\n\t\t\t\t\t$getRate->mysql(\"SELECT `ship_limit_price`, `ship_limit_percent` FROM `billship_shipping_limits` WHERE `ship_limit_upper` = 'y';\");\n\t\t\t\t\t$getRate->mssql(\"SELECT ship_limit_price, ship_limit_percent FROM billship_shipping_limits WHERE ship_limit_upper = 'y';\");\n\t\t\t\t}\n\t\t\t\t$getRate = $getRate->Rows();\n\t\t\t\t$test_1 = $getRate[0]['ship_limit_price'];\n\t\t\t\t$test_2 = $this->Totals['Total']*($getRate[0]['ship_limit_percent']/100);\n\t\t\t\t\n\t\t\t\t$getRate = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t\t$getRate->mysql(\"SELECT `ship_limit_price`, `ship_limit_percent` FROM `billship_shipping_limits` WHERE `ship_limit_start_weight` >= '$weight';\");\n\t\t\t\t$getRate->mssql(\"SELECT ship_limit_price, ship_limit_percent FROM billship_shipping_limits WHERE ship_limit_start_weight >= '$weight';\");\n\t\t\t\t$getRate = $getRate->Rows();\n\t\t\t\t\n\t\t\t\t$test_3 = $getRate[0]['ship_limit_price'];\n\t\t\t\t$test_4 = $total*($getRate[0]['ship_limit_percent']/100);\n\t\t\t\t\n\t\t\t\t$this->Totals['Ship2'] = ($test_1 < $test_2) ? $test_2 : $test_1;\n\t\t\t\t$this->Totals['Ship2'] = ($this->Totals['Ship2'] < $test_3) ? $test_3 : $this->Totals['Ship2'];\n\t\t\t\t$this->Totals['Ship2'] = ($this->Totals['Ship2'] < $test_4) ? $test_4 : $this->Totals['Ship2'];\n\t\t\t\tif(strlen(trim($this->Totals['Ship2'])) > 0) $this->Totals['Ship'] = $this->Totals['Ship2'];\n\t\t\t}\n\t\t*/\n\t\t}\n\t\t$this->Totals['Grand'] = $this->Totals['Total']+$this->Totals['Ship']+$this->Totals['Tax']-$this->Totals['Disc']+$this->Totals['Ext']+$this->Totals['Freight'];\n\t}", "function wcfmgs_group_manager_stats_box() {\r\n \tglobal $WCFM, $wpdb, $WCFMgs;\r\n \t\r\n \t$is_marketplace = wcfm_is_marketplace();\r\n\t\tif( !$is_marketplace ) return;\r\n \t\r\n \t$manager_vendors = $this->wcfmgs_group_manager_allow_vendors_list( array(0), $is_marketplace );\r\n \t\r\n \t$gross_sales = 0;\r\n \t$total_commission = 0;\r\n \t$total_products = 0;\r\n \t$total_item_sales = 0;\r\n \t\r\n \tif( $manager_vendors && is_array( $manager_vendors ) && !empty( $manager_vendors ) ) {\r\n \t\t// Getting Products\r\n\t\t\t$products_args = array(\r\n\t\t\t\t\t\t\t\t\t'posts_per_page' => -1,\r\n\t\t\t\t\t\t\t\t\t'offset' => 0,\r\n\t\t\t\t\t\t\t\t\t'category' => '',\r\n\t\t\t\t\t\t\t\t\t'category_name' => '',\r\n\t\t\t\t\t\t\t\t\t'orderby' => 'date',\r\n\t\t\t\t\t\t\t\t\t'order' => 'DESC',\r\n\t\t\t\t\t\t\t\t\t'include' => '',\r\n\t\t\t\t\t\t\t\t\t'exclude' => '',\r\n\t\t\t\t\t\t\t\t\t'meta_key' => '',\r\n\t\t\t\t\t\t\t\t\t'meta_value' => '',\r\n\t\t\t\t\t\t\t\t\t'post_type' => 'product',\r\n\t\t\t\t\t\t\t\t\t'post_mime_type' => '',\r\n\t\t\t\t\t\t\t\t\t'post_parent' => '',\r\n\t\t\t\t\t\t\t\t\t//'author'\t => get_current_user_id(),\r\n\t\t\t\t\t\t\t\t\t'post_status' => array('draft', 'pending', 'publish'),\r\n\t\t\t\t\t\t\t\t\t'suppress_filters' => 0 \r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t$products_args = apply_filters( 'wcfm_products_args', $products_args );\r\n\t\t\t$wcfm_products_array = get_posts( $products_args );\r\n\t\t\t$total_products = count( $wcfm_products_array );\r\n\t\t\t\r\n \t\tforeach( $manager_vendors as $manager_vendor ) {\r\n \t\t\tif( $manager_vendor ) {\r\n\t\t\t\t\t$gross_sales += $WCFM->wcfm_vendor_support->wcfm_get_gross_sales_by_vendor( $manager_vendor );\r\n\t\t\t\t\t$total_commission += $WCFM->wcfm_vendor_support->wcfm_get_commission_by_vendor( $manager_vendor );\r\n\t\t\t\t\t$total_item_sales += $WCFM->wcfm_vendor_support->wcfm_get_total_sell_by_vendor( $manager_vendor );\r\n\t\t\t\t}\r\n \t\t}\r\n \t}\r\n \t\r\n \t?>\r\n\t\t<div class=\"wcfm_dashboard_stats\">\r\n\t\t\r\n\t\t <?php if ( apply_filters( 'wcfm_is_allow_orders', true ) && current_user_can( 'edit_shop_orders' ) ) { ?>\r\n\t\t\t\t<div class=\"wcfm_dashboard_stats_block\">\r\n\t\t\t\t\t<a href=\"<?php echo get_wcfm_orders_url(); ?>\">\r\n\t\t\t\t\t\t<span class=\"fa fa-currency\"><?php echo get_woocommerce_currency_symbol() ; ?></span>\r\n\t\t\t\t\t\t<div>\r\n\t\t\t\t\t\t\t<strong><?php echo wc_price( $gross_sales ); ?></strong><br />\r\n\t\t\t\t\t\t\t<?php _e( 'gross sales in last 7 days', 'wc-frontend-manager' ); ?>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</a>\r\n\t\t\t\t</div>\r\n\t\t\t<?php } ?>\r\n\t\t\r\n\t\t\t<?php if ( apply_filters( 'wcfm_is_allow_orders', true ) && current_user_can( 'edit_shop_orders' ) ) { ?>\r\n\t\t\t\t<?php\r\n\t\t\t\t$admin_fee_mode = false;\r\n\t\t\t\tif( $is_marketplace == 'wcfmmarketplace' ) {\r\n\t\t\t\t\tglobal $WCFMp;\r\n\t\t\t\t\tif (isset($WCFMp->wcfmmp_commission_options['commission_for'])) {\r\n\t\t\t\t\t\tif ($WCFMp->wcfmmp_commission_options['commission_for'] == 'admin') {\r\n\t\t\t\t\t\t\t$admin_fee_mode = true;\r\n\t\t\t\t\t\t\t$total_commission = $gross_sales - $total_commission;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} elseif( $is_marketplace == 'wcmarketplace' ) {\r\n\t\t\t\t\tglobal $WCMp;\r\n\t\t\t\t\tif (isset($WCMp->vendor_caps->payment_cap['revenue_sharing_mode'])) {\r\n\t\t\t\t\t\tif ($WCMp->vendor_caps->payment_cap['revenue_sharing_mode'] == 'admin') {\r\n\t\t\t\t\t\t\t$admin_fee_mode = true;\r\n\t\t\t\t\t\t\t$total_commission = $gross_sales - $total_commission;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} elseif( $is_marketplace == 'dokan' ) {\r\n\t\t\t\t\t$total_commission = $gross_sales - $total_commission;\r\n\t\t\t\t}\r\n\t\t\t\t?>\r\n\t\t\t\t<div class=\"wcfm_dashboard_stats_block\">\r\n\t\t\t\t\t<a href=\"<?php echo get_wcfm_orders_url( ); ?>\">\r\n\t\t\t\t\t\t<span class=\"fa fa-money\"></span>\r\n\t\t\t\t\t\t<div>\r\n\t\t\t\t\t\t\t<strong><?php echo wc_price( $total_commission ); ?></strong><br />\r\n\t\t\t\t\t\t\t<?php if( $admin_fee_mode ) { _e( 'admin fees in last 7 days', 'wc-frontend-manager' ); } else { _e( 'commission in last 7 days', 'wc-frontend-manager' ); } ?>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</a>\r\n\t\t\t\t</div>\r\n\t\t\t<?php } ?>\r\n\t\t\r\n\t\t\t<?php if ( current_user_can( 'edit_products' ) && apply_filters( 'wcfm_is_allow_manage_products', true ) ) { ?>\r\n\t\t\t\t<div class=\"wcfm_dashboard_stats_block\">\r\n\t\t\t\t\t<a href=\"<?php echo get_wcfm_products_url(); ?>\">\r\n\t\t\t\t\t\t<span class=\"fa fa-cubes\"></span>\r\n\t\t\t\t\t\t<div>\r\n\t\t\t\t\t\t\t<strong><?php echo $total_products; ?></strong><br />\r\n\t\t\t\t\t\t\t<?php _e( 'total products posted', 'wc-frontend-manager-groups-staffs' ); ?>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</a>\r\n\t\t\t\t</div>\r\n\t\t\t<?php } ?>\r\n\t\t\t\r\n\t\t\t<?php if ( apply_filters( 'wcfm_is_allow_orders', true ) && current_user_can( 'edit_shop_orders' ) ) { ?>\r\n\t\t\t\t<div class=\"wcfm_dashboard_stats_block\">\r\n\t\t\t\t\t<a href=\"<?php echo get_wcfm_orders_url(); ?>\">\r\n\t\t\t\t\t\t<span class=\"fa fa-cart-plus\"></span>\r\n\t\t\t\t\t\t<div>\r\n\t\t\t\t\t\t\t<?php printf( _n( \"<strong>%s item</strong><br />\", \"<strong>%s items</strong><br />\", $total_item_sales, 'wc-frontend-manager' ), $total_item_sales ); ?>\r\n\t\t\t\t\t\t\t<?php _e( 'sold in last 7 days', 'wc-frontend-manager' ); ?>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</a>\r\n\t\t\t\t</div>\r\n\t\t <?php } ?>\r\n\t\t</div>\r\n\t\t<div class=\"wcfm-clearfix\"></div>\r\n\t\t<?php\r\n }", "protected function _initTotals()\n {\n $source = $this->getSource();\n\n $this->_totals = [];\n $this->_totals['subtotal'] = new \\Magento\\Framework\\DataObject(\n ['code' => 'subtotal', 'value' => $source->getSubtotal(), 'label' => __('Subtotal')]\n );\n\n if ((double)$this->getOrder()->getPayment()->getAdditionalInformation('paypal_custom_fee') != 0) {\n $this->_totals['paypal_fee'] = new \\Magento\\Framework\\DataObject(\n [\n 'code' => 'paypal_fee',\n 'field' => 'paypal_fee',\n 'value' => $this->getOrder()->getPayment()->getAdditionalInformation('paypal_custom_fee'),\n 'label' => $this->getOrder()->getPayment()->getAdditionalInformation('base_paypal_custom_fee_description'),\n ]\n );\n }\n\n\n /**\n * Add discount\n */\n if ((double)$this->getSource()->getDiscountAmount() != 0) {\n if ($this->getSource()->getDiscountDescription()) {\n $discountLabel = __('Discount (%1)', $source->getDiscountDescription());\n } else {\n $discountLabel = __('Discount');\n }\n $this->_totals['discount'] = new \\Magento\\Framework\\DataObject(\n [\n 'code' => 'discount',\n 'field' => 'discount_amount',\n 'value' => $source->getDiscountAmount(),\n 'label' => $discountLabel,\n ]\n );\n }\n\n /**\n * Add shipping\n */\n if (!$source->getIsVirtual() && ((double)$source->getShippingAmount() || $source->getShippingDescription())) {\n $label = __('Shipping & Handling');\n if ($this->getSource()->getCouponCode() && !isset($this->_totals['discount'])) {\n $label = __('Shipping & Handling (%1)', $this->getSource()->getCouponCode());\n }\n\n $this->_totals['shipping'] = new \\Magento\\Framework\\DataObject(\n [\n 'code' => 'shipping',\n 'field' => 'shipping_amount',\n 'value' => $this->getSource()->getShippingAmount(),\n 'label' => $label,\n ]\n );\n }\n\n $this->_totals['grand_total'] = new \\Magento\\Framework\\DataObject(\n [\n 'code' => 'grand_total',\n 'field' => 'grand_total',\n 'strong' => true,\n 'value' => $source->getGrandTotal(),\n 'label' => __('Grand Total'),\n ]\n );\n\n /**\n * Base grandtotal\n */\n if ($this->getOrder()->isCurrencyDifferent()) {\n $this->_totals['base_grandtotal'] = new \\Magento\\Framework\\DataObject(\n [\n 'code' => 'base_grandtotal',\n 'value' => $this->getOrder()->formatBasePrice($source->getBaseGrandTotal()),\n 'label' => __('Grand Total to be Charged'),\n 'is_formated' => true,\n ]\n );\n }\n return $this;\n }", "protected function calculateGrandTotal()\n {\n $this->grandTotal = $this->subTotal + $this->gst + $this->unit->securityDeposit;\n }", "protected function mergeTotals() {\n $aOld = isset($this->aExistingOrder['Totals']) ? $this->aExistingOrder['Totals'] : array();\n $aNew = isset($this->aCurrentOrder['Totals']) ? $this->aCurrentOrder['Totals'] : array();\n foreach ($aNew as $iNewTotal => $aNewTotal) {\n foreach ($aOld as $iOldTotal => $aOldTotal) {\n if ($aOldTotal['Type'] == $aNewTotal['Type']) {\n $aOldTotal['Value']=isset($aOldTotal['Value'])?$aOldTotal['Value']:0;\n $aNewTotal['Value']=isset($aNewTotal['Value'])?$aNewTotal['Value']:0;\n if (method_exists($this, 'mergetotal'.$aNewTotal['Type'])) {\n $aNew[$iNewTotal] = $this->{'mergetotal'.$aNewTotal['Type']}($aOldTotal, $aNewTotal);\n } else {\n $aNew[$iNewTotal] = $this->mergeTotal($aOldTotal, $aNewTotal);\n }\n unset($aOld[$iOldTotal]);\n break;\n }\n }\n }\n foreach ($aOld as $aOldTotal) {\n $aNew[] = $aOldTotal;\n }\n return $aNew;\n }", "abstract protected function prepareTotalCount();", "public function getTotal()\n {\n $subTotal = $this->getSubTotal(false);\n\n $newTotal = 0.00;\n\n $process = 0;\n\n $conditions = $this\n ->getConditions()\n ->filter(function (CartCondition $cond) {\n return $cond->getTarget() === 'total';\n });\n\n // if no conditions were added, just return the sub total\n if (!$conditions->count()) {\n return Helpers::formatValue($subTotal, $this->config['format_numbers'], $this->config);\n }\n\n $conditions\n ->each(function (CartCondition $cond) use ($subTotal, &$newTotal, &$process) {\n $toBeCalculated = ($process > 0) ? $newTotal : $subTotal;\n\n $newTotal = $cond->applyCondition($toBeCalculated);\n\n $process++;\n });\n\n return Helpers::formatValue($newTotal, $this->config['format_numbers'], $this->config);\n }", "private function calculate_totals($project='events'){\n \n // Set flag 'something_was_paid', calculate totals\n $this->total = array();\n foreach ($this->rec_visit as $v_id=>$rec){\n foreach($this->money as $item){\n\tif (!($v = (b_posix::is_int(@$rec[$item]) \n\t\t ? $rec[$item]\n\t\t : 0))) continue;\n\tif ((strpos($item,'_r') == (strlen($item)-2)) && ($item != 'total_r')) $this->something_was_paid = True;\n\tif (($project === 'events') || ($project == @$rec['v_projectid'])) @$this->total[$item] += $v;\n }\n }\n }", "public function getTotalInvoiced();", "public function total(){\n $total = $this->qualification + $this->referee_report + $this->interview;\n }", "abstract public function prepareTotalCount();", "public function subtotal();", "public function calculate_grand_total() {\n\n $this->total_price = $this->individual_products_total + ($this->meal_deal_count * 3);\n\n $this->total = floatval(number_format($this->total_price, 2,'.',''));\n\n // Formats the final total into json format\n\n return $total_array = Array (\n 'total' => $this->total,\n );\n\n }", "public function formattedTotal(): string;", "public static function getTotals()\n {\n $subTotal = self::getSubTotal();\n $taxes = StoreTax::getTaxes();\n $addedTaxTotal = 0;\n $includedTaxTotal = 0;\n $taxCalc = Config::get('vividstore.calculation');\n\n if ($taxes) {\n foreach ($taxes as $tax) {\n if ($taxCalc != 'extract') {\n $addedTaxTotal += $tax['taxamount'];\n } else {\n $includedTaxTotal += $tax['taxamount'];\n }\n }\n }\n\n $shippingTotal = self::getShippingTotal();\n \n $total = ($subTotal + $addedTaxTotal + $shippingTotal);\n \n return array('subTotal'=>$subTotal,'taxes'=>$taxes, 'taxTotal'=>$addedTaxTotal + $includedTaxTotal, 'shippingTotal'=>$shippingTotal, 'total'=>$total);\n }", "public function createTotalsFromSums() {\n $subtotal = $this->ItemSubtotalSum;\n $this->data['Order']['subtotal'] = $subtotal;\n\n $tax = sprintf('%0.2f', $subtotal * $this->ShipmentTaxPercent * $this->Taxable);\n $this->data['Order']['tax'] = $tax;\n\n $this->data['Order']['total'] = $subtotal + $tax + $this->ShipmentSum;\n\n $this->data['Order']['order_item_count'] = $this->ItemCount;\n\n $this->data['Order']['weight'] = $this->ItemWeightSum;\n\n return array_intersect_key(\n $this->data['Order'],\n array(\n 'subtotal' => NULL,\n 'tax' => NULL,\n 'order_item_count' => NULL,\n 'weight' => NULL,\n 'total' => NULL,\n )\n );\n }", "private function get_shipping_item_totals()\r\n\t{\r\n\t\t$separate_value = $this->flexi->cart_contents['settings']['shipping']['data']['separate_value'];\r\n\t\t$separate_weight = $this->flexi->cart_contents['settings']['shipping']['data']['separate_weight'];\r\n\t\t\r\n\t\t$free_value = $this->flexi->cart_contents['settings']['shipping']['data']['free_value'];\r\n\t\t$free_weight = $this->flexi->cart_contents['settings']['shipping']['data']['free_weight'];\r\n\t\r\n\t\t$item_summary_total = $this->flexi->cart_contents['summary']['item_summary_total'];\r\n\t\t$total_weight = $this->flexi->cart_contents['summary']['total_weight'];\r\n\t\t\r\n\t\t$shipping_item_data['value'] = $this->format_calculation($item_summary_total - $separate_value - $free_value);\r\n\t\t$shipping_item_data['weight'] = $this->format_calculation($total_weight - $separate_weight - $free_weight);\r\n\r\n\t\treturn $shipping_item_data;\r\n\t}", "protected function _initTotals()\r\n {\r\n parent::_initTotals();\r\n $orderId = $this->getSource()->getId();\r\n\t\t//$base_orderId = 34243;\r\n\t\t$discount = $this->helper('auction')->getDiscountByOrderId($orderId);\r\n if (0) {\r\n $this->addTotalBefore(new Varien_Object(array(\r\n 'code' => 'auction',\r\n 'value' => $amount,\r\n 'base_value'=> $amount,\r\n 'label' => $this->helper('auction')->__('Auction Product Discount ').$amount.$this->helper('auction')->__('%'),\r\n ), array('shipping', 'tax')));\r\n }\r\n\r\n return $this;\r\n }", "public function total();", "public function total();", "public function total();", "public function getTotal()\n\t{\n\t\t$weeks_ids = FileStorage::getInstance()->getDirFileNames('weeks');\n\n\t\t$all_teams = Team::loadAll();\n\n\t\tforeach ($all_teams as $team) {\n\t\t\t$totals[$team->id] = (object)[\n\t\t\t\t'team_id' => $team->id,\n\t\t\t\t'Team' => $team->name,\n\t\t\t\t'PTS' => 0,\n\t\t\t\t'PLD' => max(array_merge($weeks_ids, [0])),\n\t\t\t\t'W' => 0,\n\t\t\t\t'D' => 0,\n\t\t\t\t'L' => 0,\n\t\t\t\t'GD' => 0,\n\t\t\t\t'numeric_pdc' => 0,\n\t\t\t];\n\t\t}\n\n\t\tforeach ($weeks_ids as $week_id) {\n\t\t\t$week = new LeagueWeek($week_id);\n\t\t\tforeach ($week->teams_results as $team_week_result) {\n\t\t\t\t$team_totals = $totals[$team_week_result->team_id];\n\n\t\t\t\t$team_totals->PTS = $team_totals->PTS + $team_week_result->PTS;\n\t\t\t\t$team_totals->W = $team_totals->W + $team_week_result->W;\n\t\t\t\t$team_totals->D = $team_totals->D + $team_week_result->D;\n\t\t\t\t$team_totals->L = $team_totals->L + $team_week_result->L;\n\t\t\t\t$team_totals->GD = $team_totals->GD + $team_week_result->GD;\n\t\t\t\t$team_totals->numeric_pdc = max(1, $team_totals->PTS + $team_totals->W - $team_totals->L + ($team_totals->GD));\n\n\t\t\t\t$totals[$team_week_result->team_id] = $team_totals;\n\t\t\t}\n\t\t}\n\n\t\t$common_numeric_pdc = array_reduce($totals, function($carry, $team_totals) {\n\t\t\treturn $carry + $team_totals->numeric_pdc;\n\t\t});\n\n\t\tforeach ($totals as $team_id => &$team_totals) {\n\t\t\tif($common_numeric_pdc <= 0) {\n\t\t\t\t$team_totals->PDC = 25 . '%';\n\t\t\t} else $team_totals->PDC = round(($team_totals->numeric_pdc / $common_numeric_pdc) * 100) . '%';\n\n\t\t}\n\n\t\tusort($totals, function ($a, $b) {\n\t\t\treturn $b->PTS > $a->PTS;\n\t\t});\n\n\t\treturn $totals;\n\t}", "public function totals()\n {\n return $this->get(self::BASE_PATH.'/totals');\n }", "protected function getTotal()\n {\n $total = 0;\n foreach ($this->entries as $entry) {\n $total += $entry['price'] * $entry['quantity'];\n }\n\n return $total;\n }", "function calculate_totals() {\n\t\t\tglobal $cmdeals;\n\t\t\t\n\t\t\t$this->reset_totals();\n\t\t\t\n\t\t\t// Get count of all items + weights + subtotal (we may need this for discounts)\n\t\t\tif (sizeof($this->cart_contents)>0) foreach ($this->cart_contents as $cart_item_key => $values) :\n\t\t\t\t\n\t\t\t\t$_deals = $values['data'];\n\t\t\t\t\n\t\t\t\t$this->cart_contents_count \t= $this->cart_contents_count + $values['quantity'];\n\t\t\t\t\n\t\t\t\t// Base Price (inlusive of tax for now)\n\t\t\t\t$base_price \t\t\t= $_deals->get_sale();\n\t\t\t\t\t\n // Sub total is based on base prices (without discounts)\n $this->subtotal \t\t\t= $this->subtotal + ( $base_price * $values['quantity'] );\n\t\t\t\t\t\t\t\t\n\t\t\tendforeach;\n\t\t\t\n\t\t\t\n\t\t\t\tif (sizeof($this->cart_contents)>0) : foreach ($this->cart_contents as $cart_item_key => $values) :\n\t\t\t\t\n\t\t\t\t\t/** \n\t\t\t\t\t * Prices exclude tax\n\t\t\t\t\t *\n\t\t\t\t\t * This calculation is simpler - work with the base, untaxed price.\n\t\t\t\t\t */\n\t\t\t\t\t$_deals = $values['data'];\n\t\n\t\t\t\t\t// Base Price (i.e. no tax, regardless of region)\n\t\t\t\t\t$base_price \t\t\t\t= $_deals->get_sale();\n\t\t\n\t\t\t\t\t// Discounted Price (base price with any pre-tax discounts applied\n\t\t\t\t\t$discounted_price \t\t\t= $this->get_discounted_price( $values, $base_price, true );\t\t\n \t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// Total item price (price, discount and quantity)\n\t\t\t\t\t$total_item_price \t\t\t= $discounted_price * $values['quantity'];\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// Cart contents total is based on discounted prices and is used for the final total calculation\n\t\t\t\t\t$this->cart_contents_total = $this->cart_contents_total \t\t+ $total_item_price;\n\t\t\t\t\n\t\t\t\tendforeach; endif;\n\t\t\t\n\t\t\t// Only go beyond this point if on the cart/checkout\n\t\t\tif (!is_checkout() && !defined('WPDEALS_CHECKOUT') && !is_ajax()) return;\n\t\t\t\n\t\t\t// VAT exemption done at this point - so all totals are correct before exemption\n\t\t\tif ($cmdeals->customer->is_vat_exempt()) :\n\t\t\t\t$this->shipping_tax_total = $this->tax_total = 0;\n\t\t\tendif;\n\t\t\t\n\t\t\t// Allow plugins to hook and alter totals before final total is calculated\n\t\t\tdo_action('cmdeals_calculate_totals', $this);\n\t\t\t\t\t\n\t\t\t/** \n\t\t\t * Grand Total\n\t\t\t *\n\t\t\t * Based on discounted deals prices, discounted tax, shipping cost + tax, and any discounts to be added after tax (e.g. store credit)\n\t\t\t */\n\t\t\t$this->total = $this->cart_contents_total + $this->discount_total;\n\t\t\t\n\t\t\tif ($this->total < 0) $this->total = 0;\n\t\t}", "function get_total_gifts(){\n $gifts = json_decode(file_get_contents(\"https://wsapi.bethel.edu/roar/total-gifts\"));\n //print_r($gifts);\n $total = $gifts->{'result'}[0][0];\n $total = number_format($total); // implode array with comma\n return \"$$total\";\n}", "protected function calculateAddOns()\n {\n $addOnsTotal = 0;\n $periodCount = $this->periods->count();\n\n if (!$this->groupedAddOns) return;\n\n foreach ($this->groupedAddOns as $groupedAddOn) {\n if ($this->isGroupedAddOnAssociatedToBooking($groupedAddOn)) {\n // If this grouped add-on was already associated to the booking, then we will\n // have to use the pricing at the point when the booking was created\n // for the calculation.\n\n $addOnTotal = $groupedAddOn->quantity * $this->getBookingGroupedAddOnPricing($groupedAddOn) * $periodCount;\n }\n else {\n // If it isn't we will use the grouped add-on's latest pricing.\n\n $addOnTotal = $groupedAddOn->quantity * $groupedAddOn->costPerUnit * $periodCount;\n }\n\n $addOnsTotal += $addOnTotal;\n\n $this->addCalculatedAddOn($groupedAddOn, $addOnTotal);\n }\n\n $this->addOnsTotal = $addOnsTotal;\n }", "public function getTotal()\n {\n $cart = $this->getContent();\n\n $sum = array_reduce($cart->all(), function ($a, ItemCollection $item) {\n return $a += $item->getPrice(false);\n }, 0);\n\n return Helpers::formatValue(floatval($sum), $this->config['format_numbers'], $this->config);\n }", "function getGrandtotal()\n {\n return $this->grandtotal;\n }", "private function setTotalAmounts()\n {\n $taxable\t= 0.00;\n $expenses = 0.00;\n $outlays\t= 0.00;\n\n foreach ($this->invoiceDetails as $invoiceDetail) {\n $amount = $invoiceDetail->getAmount();\n switch ($invoiceDetail->getType())\n {\n case 'incoming':\n $taxable += $amount;\n break;\n case 'expense':\n $taxable += $amount;\n $expenses += $amount;\n break;\n case 'outlay':\n $outlays += $amount;\n break;\n }\n }\n\n $this->setTotalTaxable($taxable);\n $this->setTotalExpenses($expenses);\n $this->setTotalOutlays($outlays);\n }", "protected function _beforeToHtml()\n {\n $this->_initTotals();\n foreach ($this->getChild() as $child) {\n if (method_exists($child, 'initTotals')) {\n $child->initTotals();\n }\n }\n return parent::_beforeToHtml();\n }", "protected function _initTotals() {\n parent::_initTotals();\n $order = $this->getOrder();\n $payment = $order->getPayment();\n $paymentMethodCode = $payment->getMethodInstance()->getCode();\n\n if (Mage::helper('ipgbase')->isIpagarePaymentMethod($paymentMethodCode)) {\n $amount = Mage::getModel($paymentMethodCode . '/discount')->getIpgDiscount($order);\n if (abs($amount) > 0) {\n $baseAmount = Mage::getModel($paymentMethodCode . '/discount')->getIpgBaseDiscount($order);\n $code = Mage::getModel($paymentMethodCode . '/discount')->getIpgDiscountCode();\n $this->addTotal(new Varien_Object(array(\n 'code' => $code,\n 'value' => $amount,\n 'base_value' => $baseAmount,\n 'label' => Mage::helper($paymentMethodCode)->__('Payment Discount'),\n )));\n }\n }\n return $this;\n }", "public function totalCount();", "public function totalCount();", "public function get_total()\n {\n }", "public function smart_coupons_discount_total_filters() {\n\t\t\tif ( WCS_SC_Compatibility::is_cart_contains_subscription() && WCS_SC_Compatibility::is_wcs_gte( '2.0.0' ) ) {\n\t\t\t\tadd_action( 'woocommerce_after_calculate_totals', array( $this, 'smart_coupons_after_calculate_totals' ), 999 );\n\t\t\t} else {\n\t\t\t\tadd_action( 'woocommerce_after_calculate_totals', array( $this, 'smart_coupons_after_calculate_totals' ), 999 );\n\t\t\t\tglobal $current_screen;\n\t\t\t\tif ( ! empty( $current_screen ) && 'edit-shop_order' !== $current_screen ) {\n\t\t\t\t\tadd_filter( 'woocommerce_order_get_total', array( $this, 'smart_coupons_order_discounted_total' ), 10, 2 );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function bill_total_sum($app_num, $name, $check_in) {\n\t\t$rooms = $this->edc_booking_model->get_guest_rooms($app_num, $name, $check_in);\n\t\t$room_details = array();\n\t\t//get whether double ac room is shared, or single\n\t\t$sno = 0;\n\t\tforeach($rooms as $room)\n\t\t{\n\t\t\t$room_details[$sno] = $this->edc_allotment_model->get_room_details($room['room_alloted']);\n\t\t\tif($room_details[$sno]['room_type'] == 'Double Bedded AC')\n\t\t\t\t$room_details[$sno]['single'] = $this->edc_booking_model->check_single_room($app_num, $name, $check_in, $room['room_alloted']);\t//0 -> single in total (400/600), 1 -> single in group(200/300), 2 -> double in group (400/600)\n\t\t\t$sno++;\n\t\t}\n\n\t\t$booking_details = $this->edc_booking_model->get_booking_details($app_num)[0];\n\t\t$purpose = $booking_details['purpose'];\n\t\t$school_guest = $booking_details['school_guest'];\n\t\t$check_out = $booking_details['check_out'];\n\n\t\t$day_time = 86400;\n\t\t$sno = 1;\n\t\t$total_sum = 0;\n\t\tforeach($room_details as $room)\n\t\t{\n\t\t\tif($purpose == 'Official')\n\t\t\t{\n\t\t\t\tif($room['room_type'] == 'Double Bedded AC')\n\t\t\t\t{\n\t\t\t\t\tif($room['single'] == 0 || $room['single'] == 2)\n\t\t\t\t\t\t$tariff = 600;\n\t\t\t\t\telse $tariff = 300;\n\t\t\t\t}\n\t\t\t\telse $tariff = 2500;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($room['room_type'] == 'Double Bedded AC')\n\t\t\t\t{\n\t\t\t\t\tif($room['single'] == 0 || $room['single'] == 2)\n\t\t\t\t\t\t$tariff = 800;\n\t\t\t\t\telse $tariff = 400;\n\t\t\t\t}\n\t\t\t\telse $tariff = 2500;\n\t\t\t}\n\t\t\tif($school_guest == '0')\n\t\t\t\t$subtotal = ceil((strtotime($check_out) - strtotime($check_in)) / $day_time) * $tariff;\n\t\t\telse $subtotal = 0;\n\t\t\t$total_sum += $subtotal;\n\t\t}\n\t\treturn $total_sum;\n\t}", "public function getBaseGrandTotal();", "public function testGetAllIncludeTotals()\n {\n $expected_page = 0;\n $expected_count = 2;\n\n $results = self::$api->getAll(['include_totals' => true], $expected_page, $expected_count);\n usleep(AUTH0_PHP_TEST_INTEGRATION_SLEEP);\n $this->assertArrayHasKey('total', $results);\n $this->assertEquals($expected_page * $expected_count, $results['start']);\n $this->assertEquals($expected_count, $results['limit']);\n $this->assertNotEmpty($results['client_grants']);\n }", "function add_custom_total_price($cart_object) {\r\r\n\t\tglobal $woocommerce, $bookyourtravel_accommodation_helper, $bookyourtravel_tour_helper, $bookyourtravel_cruise_helper, $bookyourtravel_car_rental_helper;\r\r\n\t\t\r\r\n\t\tforeach ( $cart_object->cart_contents as $key => $value ) {\r\r\n\t\t\r\r\n\t\t\t$cart_item_meta = $woocommerce->session->get(BOOKYOURTRAVEL_WOOCOMMERCE_BOOKING_SESSION_KEY . $key);\r\r\n\t\t\t\r\r\n\t\t\tif ($cart_item_meta != null) {\r\r\n\r\r\n\t\t\t\tif (isset($cart_item_meta[BOOKYOURTRAVEL_WOOCOMMERCE_ACCOMMODATION_BOOKING_ID])) {\r\r\n\t\t\t\t\r\r\n\t\t\t\t\t$accommodation_booking_id = intval($cart_item_meta[BOOKYOURTRAVEL_WOOCOMMERCE_ACCOMMODATION_BOOKING_ID]);\r\r\n\t\t\t\t\tif ($accommodation_booking_id > 0) {\r\r\n\t\t\t\t\t\t$booking_entry = $bookyourtravel_accommodation_helper->get_accommodation_booking($accommodation_booking_id);\r\r\n\t\t\t\t\t\t\r\r\n\t\t\t\t\t\tif ($booking_entry != null) {\r\r\n\t\t\t\t\t\t\t$value['data']->price = $booking_entry->total_price;\r\r\n\t\t\t\t\t\t}\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t} else if (isset($cart_item_meta[BOOKYOURTRAVEL_WOOCOMMERCE_TOUR_BOOKING_ID])) {\r\r\n\t\t\t\t\r\r\n\t\t\t\t\t$tour_booking_id = intval($cart_item_meta[BOOKYOURTRAVEL_WOOCOMMERCE_TOUR_BOOKING_ID]);\r\r\n\t\t\t\t\tif ($tour_booking_id > 0) {\r\r\n\t\t\t\t\t\t$booking_entry = $bookyourtravel_tour_helper->get_tour_booking($tour_booking_id);\r\r\n\t\t\t\t\t\t\r\r\n\t\t\t\t\t\tif ($booking_entry != null) {\r\r\n\t\t\t\t\t\t\t$value['data']->price = $booking_entry->total_price;\r\r\n\t\t\t\t\t\t}\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t} else if (isset($cart_item_meta[BOOKYOURTRAVEL_WOOCOMMERCE_CRUISE_BOOKING_ID])) {\r\r\n\t\t\t\t\r\r\n\t\t\t\t\t$cruise_booking_id = intval($cart_item_meta[BOOKYOURTRAVEL_WOOCOMMERCE_CRUISE_BOOKING_ID]);\r\r\n\t\t\t\t\tif ($cruise_booking_id > 0) {\r\r\n\t\t\t\t\t\t$booking_entry = $bookyourtravel_cruise_helper->get_cruise_booking($cruise_booking_id);\r\r\n\t\t\t\t\t\t\r\r\n\t\t\t\t\t\tif ($booking_entry != null) {\r\r\n\t\t\t\t\t\t\t$value['data']->price = $booking_entry->total_price;\r\r\n\t\t\t\t\t\t}\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t} else if (isset($cart_item_meta[BOOKYOURTRAVEL_WOOCOMMERCE_CAR_RENTAL_BOOKING_ID])) {\r\r\n\t\t\t\t\r\r\n\t\t\t\t\t$car_rental_booking_id = intval($cart_item_meta[BOOKYOURTRAVEL_WOOCOMMERCE_CAR_RENTAL_BOOKING_ID]);\r\r\n\t\t\t\t\tif ($car_rental_booking_id > 0) {\r\r\n\t\t\t\t\t\t$booking_entry = $bookyourtravel_car_rental_helper->get_car_rental_booking($car_rental_booking_id);\r\r\n\t\t\t\t\t\t\r\r\n\t\t\t\t\t\tif ($booking_entry != null) {\r\r\n\t\t\t\t\t\t\t$value['data']->price = $booking_entry->total_price;\r\r\n\t\t\t\t\t\t}\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t}\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t}", "public function itemTotal(): float;", "function total_itineraries()\n\t{\n\t\treturn $this->_tour_voucher_contents['total_itineraries'];\n\t}", "public function initTotals()\n {\n /* @var $items \\Magento\\Sales\\Model\\Order\\Item[] */\n $parent = $this->getParentBlock();\n $this->_order = $parent->getOrder();\n $this->_source = $parent->getSource();\n\n $items = $this->_source->getAllItems();\n $store = $this->_source->getStore();\n $subscriptionInitAmount = $this->_order->getSubscribenowInitAmount();\n $trialSubscriptionAmount = $this->_order->getSubscribenowTrialAmount();\n if ($subscriptionInitAmount > 0) {\n $initFee = new \\Magento\\Framework\\DataObject(\n [\n 'code' => 'subscribenow_init_amount',\n 'strong' => false,\n 'value' => $subscriptionInitAmount,\n 'label' => __('Initial Fee'),\n ]\n );\n if ($this->getBeforeCondition()) {\n $parent->addTotalBefore($initFee, $this->getBeforeCondition());\n } else {\n $parent->addTotal($initFee);\n }\n }\n if ($this->_order->getHasTrial()) {\n $trialFee = new \\Magento\\Framework\\DataObject(\n [\n 'code' => 'subscribenow_trial_amount',\n 'strong' => false,\n 'value' => $trialSubscriptionAmount,\n 'label' => __('Trial Fee'),\n ]\n );\n $parent->addTotal($trialFee, 'subscribenow_init_amount');\n }\n\n return $this;\n }", "function _totals() {\n if (!$this->staff) $this->_error('Access Denied', 403);\n\n $where = array('1=1');\n $args = array();\n \n if ($this->has_arg('bl')) {\n array_push($where, 's.beamlinename LIKE :'. (sizeof($args)+1));\n array_push($args, $this->arg('bl'));\n }\n if ($this->has_arg('run')) {\n array_push($where, 'vr.runid = :' . (sizeof($args)+1));\n array_push($args, $this->arg('run'));\n }\n \n if ($this->has_arg('year')) {\n array_push($where, \"r.starttimestamp > TO_DATE(:\".(sizeof($args)+1).\", 'HH24:MI DD-MM-YYYY')\");\n array_push($where, \"r.starttimestamp < TO_DATE(:\".(sizeof($args)+2).\", 'HH24:MI DD-MM-YYYY')\");\n array_push($args, '00:01 01-01-'.$this->arg('year'));\n array_push($args, '23:59 31-12-'.($this->arg('year')));\n }\n\n $where = implode(' AND ', $where);\n\n $median = $this->db->type() == 'mysql' ?\n // \"SUBSTRING_INDEX( SUBSTRING_INDEX( GROUP_CONCAT(CASE WHEN r.status='SUCCESS' then TIMESTAMPDIFF('SECOND', CAST(r.starttimestamp AS DATE), CAST(r.endtimestamp AS DATE)) END ORDER BY CASE WHEN r.status='SUCCESS' then TIMESTAMPDIFF('SECOND', CAST(r.starttimestamp AS DATE), CAST(r.endtimestamp AS DATE)) END), ',', COUNT(*)/2 ), ',', -1) as avgt\"\n \"AVG(CASE WHEN r.status='SUCCESS' then TIMESTAMPDIFF('SECOND', CAST(r.starttimestamp AS DATE), CAST(r.endtimestamp AS DATE)) END) as avgt\"\n : \"ROUND(MEDIAN(CASE WHEN r.status='SUCCESS' then TIMESTAMPDIFF('SECOND', CAST(r.starttimestamp AS DATE), CAST(r.endtimestamp AS DATE)) END),1) as avgt\";\n\n $totals = $this->db->pq(\"SELECT 'TOTAL' as vis, count(r.robotactionid) as num, count(CASE WHEN r.status='SUCCESS' then 1 end) as success, count(CASE WHEN r.status='ERROR' then 1 end) as error, count(CASE WHEN r.status='CRITICAL' then 1 end) as critical, count(CASE WHEN r.status='WARNING' then 1 end) as warning, count(CASE WHEN r.status='EPICSFAIL' then 1 end) as epicsfail, count(CASE WHEN r.status='COMMANDNOTSENT' then 1 end) as commandnotsent, \n $median\n FROM v_run vr \n INNER JOIN blsession s ON (s.startdate BETWEEN vr.startdate AND vr.enddate) \n INNER JOIN proposal p ON (p.proposalid = s.proposalid) \n INNER JOIN robotaction r ON (r.blsessionid = s.sessionid) \n WHERE p.proposalcode <> 'cm' AND $where AND r.actiontype = 'LOAD'\", $args);\n\n $tot = $this->db->pq(\"SELECT count(num) as tot FROM (\n SELECT count(r.robotactionid) as num \n FROM v_run vr \n INNER JOIN blsession s ON (s.startdate BETWEEN vr.startdate AND vr.enddate) \n INNER JOIN proposal p ON (p.proposalid = s.proposalid) \n INNER JOIN robotaction r ON (r.blsessionid = s.sessionid) \n WHERE p.proposalcode <> 'cm' AND $where AND (r.actiontype = 'LOAD') \n GROUP BY CONCAT(CONCAT(CONCAT(p.proposalcode, p.proposalnumber), '-'), s.visit_number)) inq\", $args);\n $tot = intval($tot[0]['TOT']);\n\n $start = 0;\n $pp = $this->has_arg('per_page') ? $this->arg('per_page') : 15;\n $end = $pp;\n \n if ($this->has_arg('page')) {\n $pg = $this->arg('page') - 1;\n $start = $pg*$pp;\n $end = $pg*$pp+$pp;\n }\n \n $st = sizeof($args)+1;\n $en = $st + 1;\n array_push($args, $start);\n array_push($args, $end);\n\n $median = $this->db->type() == 'mysql' ?\n // \"SUBSTRING_INDEX( SUBSTRING_INDEX( GROUP_CONCAT(CASE WHEN r.status='SUCCESS' then TIMESTAMPDIFF('SECOND', CAST(r.starttimestamp AS DATE), CAST(r.endtimestamp AS DATE)) END ORDER BY CASE WHEN r.status='SUCCESS' then TIMESTAMPDIFF('SECOND', CAST(r.starttimestamp AS DATE), CAST(r.endtimestamp AS DATE)) END), ',', COUNT(*)/2 ), ',', -1) as avgt\"\n \"ROUND(AVG(CASE WHEN r.status='SUCCESS' then TIMESTAMPDIFF('SECOND', CAST(r.starttimestamp AS DATE), CAST(r.endtimestamp AS DATE)) END),1) as avgt\"\n : \"ROUND(MEDIAN(CASE WHEN r.status='SUCCESS' then TIMESTAMPDIFF('SECOND', CAST(r.starttimestamp AS DATE), CAST(r.endtimestamp AS DATE)) END),1) as avgt\";\n\n $q = \"SELECT TO_CHAR(min(r.starttimestamp), 'DD-MM-YYYY HH24:MI:SS') as st, CONCAT(CONCAT(CONCAT(p.proposalcode,p.proposalnumber), '-'), s.visit_number) as vis, s.beamlinename as bl, count(r.robotactionid) as num, count(CASE WHEN r.status='SUCCESS' then 1 end) as success, count(CASE WHEN r.status='ERROR' then 1 end) as error, count(CASE WHEN r.status='CRITICAL' then 1 end) as critical, count(CASE WHEN r.status='WARNING' then 1 end) as warning, count(CASE WHEN r.status='EPICSFAIL' then 1 end) as epicsfail, count(CASE WHEN r.status='COMMANDNOTSENT' then 1 end) as commandnotsent, \n $median\n FROM v_run vr INNER JOIN blsession s ON (s.startdate BETWEEN vr.startdate AND vr.enddate) \n INNER JOIN proposal p ON (p.proposalid = s.proposalid) \n INNER JOIN robotaction r ON (r.blsessionid = s.sessionid) \n WHERE p.proposalcode <> 'cm' AND $where AND r.actiontype = 'LOAD' \n GROUP BY CONCAT(CONCAT(CONCAT(p.proposalcode,p.proposalnumber), '-'), s.visit_number), s.beamlinename \n ORDER BY min(r.starttimestamp) DESC\";\n \n $rows = $this->db->paginate($q, $args);\n $this->_output(array($totals[0], $tot, $rows));\n }", "private static function calculateTotalCost($collection)\n { \n $calls = $collection->all();\n $seconds = 0;\n foreach ($calls as $call) {\n $seconds = $seconds + $call->totaltime;\n }\n\n $minutes = ($seconds / 60); // convert billing seconds to minutes.\n $totalCost = $minutes * env('AVG_COST_PER_MIN');\n\n return number_format($totalCost, 2);\n }", "public function getSubtotal();", "public function buildTotals(InvoiceInterface $invoice);", "function total_itineraries()\n\t{\n\t\treturn $this->_tour_cart_contents['total_itineraries'];\n\t}", "function group_totals($data){\n $group_label = $data['record_params']['group_label'];\n $unique_groups = array();\n $sql_records = $data['data'];\n $sub_group_labels = $data['record_params']['sub_group_labels'];\n foreach($sql_records as $record){\n $unique_groups[] = $record->$data['record_params']['group_label'];\n }\n $unique_groups = array_unique($unique_groups);\n $records = array();\n $grand_total = array();\n $grand_total[$group_label] = 'Grand Total';\n foreach($data['record_params']['sub_group_labels'] as $sub_group_label){\n $grand_total[$sub_group_label] = '';\n }\n foreach($data['numeric'] as $numeric_label){\n $grand_total[$numeric_label] = 0;\n }\n foreach($unique_groups as $group){\n $totals = array();\n $totals[$group_label] = ''; \n $record_label = '';\n foreach($data['record_params']['sub_group_labels'] as $sub_group_label){\n $totals[$sub_group_label] = '';\n }\n foreach($data['numeric'] as $numeric_label){\n $totals[$numeric_label] = 0;\n }\n foreach($sql_records as $record){\n if($record->$group_label == $group){\n $records[] = $record;\n foreach($data['numeric'] as $numeric_label){\n if(sizeof($sub_group_labels) > 0)\n $totals[$numeric_label] = $totals[$numeric_label] + $record->$numeric_label;\n $grand_total[$numeric_label] = $grand_total[$numeric_label] + $record->$numeric_label;\n }\n }\n }\n if(sizeof($sub_group_labels) > 0){\n $totals[$group_label] = $group.' Total';\n $records[] = (object)$totals;\n }\n }\n $records[] = (object)$grand_total;\n return $records;\n }", "function showtotals(){\nglobal $XUSER, $SERVER, $ROOMS;\ncleanOnline();\n$q = DoQuery(\"SELECT * FROM $SERVER[TBL_PREFIX]online\");\n$RV[0] = 0; $RV[1] = 0; $RV[2] = 0;\nwhile($row = Do_Fetch_Row($q)){\n$q2 = DoQuery(\"SELECT * FROM $SERVER[TBL_PREFIX]users WHERE username='$row[1]'\");\n$row2 = Do_Fetch_Row($q2);\nif($row2[4] == 4 || $row2[4] == 5){\n$RV[0]++;\n}else{\n$RV[1]++;\n}\n}\ncleanRooms();\n$q = DoQuery(\"SELECT * FROM $SERVER[TBL_PREFIX]rooms\");\nwhile($row = Do_Fetch_Row($q)){\n$RV[2]++;\n}\nreturn $RV;\n}", "protected function _initTotals() {\n parent::_initTotals();\n $this->removeTotal('base_grandtotal');\n \n if ((float) $this->getSource()->getAdjustmentPositive()) {\n $total = new Varien_Object(array(\n 'code' => 'adjustment_positive',\n 'value' => $this->getSource()->getAdjustmentPositive(),\n 'label' => $this->__('Adjustment Refund')\n ));\n $this->addTotal($total);\n }\n \n if ((float) $this->getSource()->getAdjustmentNegative()) {\n $total = new Varien_Object(array(\n 'code' => 'adjustment_negative',\n 'value' => $this->getSource()->getAdjustmentNegative(),\n 'label' => $this->__('Adjustment Fee')\n ));\n $this->addTotal($total);\n }\n\n return $this;\n }", "function calculate_footers($data){\n\t\t$sumQty = 0.0;\n\t\t$sumSales = 0.0;\n\t\tforeach($data as $row){\n\t\t\t$sumQty += $row[3];\n\t\t\t$sumSales += $row[4];\n\t\t}\n\t\treturn array('Total',null,null,$sumQty,$sumSales);\n\t}", "protected function _calculateSectionTotals(&$results, $property) {\n\t\t$results['sectionTotals'][$property] = array(\n\t\t\t'elementCount' => 0,\n\t\t\t'score' => 0,\n\t\t\t'average' => 0,\n\t\t);\n\t\tif ($this->_contentObjectCount != 0) {\n\t\t\t$results['sectionTotals'][$property] = array(\n\t\t\t\t'elementCount' => $this->_contentObjectCount,\n\t\t\t\t'score' => $this->_contentScore,\n\t\t\t\t'average' => $this->_contentScore / $this->_contentObjectCount,\n\t\t\t);\n\t\t}\n\t\t$this->_totalElements += $this->_contentObjectCount;\n\t\t$this->_finalScore += $this->_contentScore;\n\t}", "public function _initTotals()\n {\n parent::_initTotals();\n $payment = $this->getOrder()->getPayment();\n if (substr($payment->getMethod(), 0, 5) != \"sisow\") {\n return $this;\n }\n $info = $payment->getMethodInstance()->getInfoInstance();\n if (!$info->getAdditionalInformation(\"invoice_fee\")) {\n return $this;\n }\n\n return Mage::helper('sisow/paymentfee')->addToBlock($this);\n }", "function _geneshop_update_total() {\n if (empty($_SESSION['basket']['items'])) {\n unset($_SESSION['basket']);\n }\n elseif (variable_get('geneshop_show_price', FALSE) && variable_get('geneshop_price_field', '')) {\n $sum = 0;\n foreach ($_SESSION['basket']['items'] as $item) {\n $sum += $item['price'];\n }\n $_SESSION['basket']['total_sum'] = $sum;\n }\n}", "public function __itemTotals() {\n\n //$this->request->data['items'] = array_values($this->request->data['items']);\n\n $itemsCount = isset($this->request->data['items']) ? count($this->request->data['items']) : 0;\n\n// pr($this->request->data['Item']);\n// die('asdas');\n\n\n\n for ($i = 0; $i < $itemsCount; $i++) {\n\n\n\n\n\n\n\n $this->request->data['items'][$i]['total'] = $this->__lineItemTotal($this->request->data['items'][$i]['qty'], $this->request->data['items'][$i]['price'], $this->request->data['items'][$i]['rate']);\n\n\n\n // collect unit name from unit model\n\n $unit = $this->Papers->Items->Units->find()\n ->where(['id'=>$this->request->data['items'][$i]['unit_id']])\n ->select(['name'])\n ->first()\n ->toArray();\n\n $this->request->data['items'][$i]['name'] = $unit['name'];\n }\n }", "private function _calculateTotalsIn()\n {\n $inStockStatus = self::$IN_STOCK_STATUS;\n $sql = new SqlStatement();\n $sql->select(array(\n 'af.group_id', \n 'af.product_id', \n 'af.type',\n 'value' => 'IF(type = \\'STOCK_STATUS\\' AND p.quantity > 0, ' . $inStockStatus . ', value)'))\n ->from(array('af' => self::FILTERS_TABLE))\n ->innerJoin(array('p' => 'product'), 'af.product_id = p.product_id')\n ->innerJoin(array('exclude' => self::RESULTS_TABLE), 'af.product_id = exclude.product_id');\n \n if ($this->conditions->price) {\n if ($this->conditions->price->min) {\n $sql->where(\"{$this->subquery->actualPrice} >= ?\", array($this->conditions->price->min));\n }\n if ($this->conditions->price->max) {\n $sql->where(\"{$this->subquery->actualPrice} <= ?\", array($this->conditions->price->max));\n }\n }\n \n if ($this->conditions->rating) {\n $sql->where('ROUND(total) IN ('. implode(',', $this->conditions->rating[0]) . ')');\n }\n \n if ( self::$HIDE_OUT_OF_STOCK ) {\n $sql->leftJoin(array('pov' => 'product_option_value'), 'af.product_id = pov.product_id AND af.value = pov.option_value_id AND af.type = \"OPTION\"')\n ->leftJoin(array('pov1' => 'product_option_value'), 'p.product_id = pov1.product_id')\n ->where('( (pov1.quantity IS NULL AND p.quantity > 0) OR '\n . '(pov1.quantity > 0 AND af.type != \"OPTION\") OR '\n . 'pov.quantity > 0 )')\n ->group(array('af.type', 'group_id', 'value', 'p.product_id'));\n }\n \n $sql2 = new SqlStatement();\n $sql2->select(array(\n 'id' => \"af.group_id\", \n 'val' => 'af.value', \n 'c' => 'COUNT(*)',\n 'type' => 'af.type',\n ))\n ->from(array('af' => $sql))\n ->group(array('af.type', 'af.group_id', 'af.value'));\n \n if (count($this->aggregate)) {\n foreach ($this->aggregate as $type => $group) {\n $sql2->where(\"((af.type = '$type' AND af.group_id NOT IN (\" . implode(',', array_keys($group)) . \")) OR af.type != '$type')\");\n }\n }\n \n $res = $this->db->query($sql2);\n \n return $res->rows;\n }", "function cfc_edd_checkout_final_total() {\n?>\n<p id=\"edd_final_total_wrap\">\n\t<strong><?php _e( 'Donation Total:', 'cfctranslation' ); ?></strong>\n\t<span class=\"edd_cart_amount\" data-subtotal=\"<?php echo edd_get_cart_subtotal(); ?>\" data-total=\"<?php echo edd_get_cart_subtotal(); ?>\"><?php edd_cart_total(); ?></span>\n</p>\n<?php\n}", "public function calculateAmount()\n {\n $photos = $this->photos()->get();\n $galleries = Gallery::whereHasPhotos($photos->lists('id'))->with('rates')->get();\n\n $amount = 0;\n $galleries->each(function ($gallery) use (&$amount, $photos) {\n\n // Determine how many photos we have in this gallery\n $count = $photos->filter(function ($photo) use ($gallery) {\n return $photo->attachment_id == $gallery->id;\n })->count();\n\n // Calculate which rate we fall into\n $rate = $gallery->rates->filter(function ($rate) use ($count) {\n return $rate->photos <= $count;\n })->min('price_per_photo');\n\n // Increment the total amount\n $amount += $count * $rate;\n });\n\n $this->amount = $amount;\n }", "public function getTotal(){\n $total=0;\n\n foreach ( $this->getOrderLines() as $ol){\n $total += $ol->getSubTotal();\n }\n \n return $total;\n }", "public function provideTotal()\n {\n return [\n [[1, 2, 5, 8], 16],\n [[-1, 2, 5, 8], 14],\n [[1, 2, 8], 11]\n ];\n }", "function statistics_extended_groups_property_count($property){\r\n\tglobal $CONFIG;\r\n\t$properties = $CONFIG->group;\r\n\t$labels = array();\r\n\t$totals = array();\r\n\tif(array_key_exists($property,$properties)){\r\n\t\tlist($type,$values) = $properties[$property];\r\n\t\tswitch($type){\r\n\t\t\tcase \"checkboxes\":\r\n\t\t\tcase \"radio\":\r\n\t\t\t\tforeach($values as $label=>$value){\r\n\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$value);\r\n\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t$labels[]=$value;\r\n\t\t\t\t\t$totals[$value]=$total;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"organizational_unit\":\r\n\t\t\t\t$query = \"SELECT string FROM {$CONFIG->dbprefix}metastrings WHERE id IN \";\r\n\t\t\t\t$query.=\"(SELECT value_id FROM {$CONFIG->dbprefix}metadata WHERE name_id=\";\r\n\t\t\t\t$query.=\"(SELECT id FROM {$CONFIG->dbprefix}metastrings WHERE string='{$property}'))\";\r\n\t\t\t\t$categories = get_data($query);\r\n\t\t\t\tif(!empty($categories)){\r\n\t\t\t\t\tforeach($categories as $category){\r\n\t\t\t\t\t\t$category = $category->string;\r\n\t\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$category);\r\n\t\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t\tlist($section,$department,$unit) = explode(\"||\",$category);\r\n\r\n\t\t\t\t\t\t$labels[$section]=$section;\r\n\t\t\t\t\t\t$totals[$section]+=$total;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"status\":\r\n\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true);\r\n\t\t\t\t$all_groups = elgg_get_entities($options);\r\n\t\t\t\t$values = array(\"preparation\"=>\"groups:extras:status:preparation\",\r\n\t\t\t\t\t\t\t\t\"active\"=>\"groups:extras:status:active\",\r\n\t\t\t\t\t\t\t\t\"inactive\"=>\"groups:extras:status:inactive\",\r\n\t\t\t\t\t\t\t\t\"closed\"=>\"groups:extras:status:closed\");\r\n\t\t\t\tforeach($values as $value=>$label){\r\n\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$value);\r\n\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t$labels[]=$label;\r\n\t\t\t\t\t$totals[$label]=(int)$total;\r\n\t\t\t\t}\r\n\t\t\t\t$totals[\"groups:extras:status:active\"]=$all_groups-$totals[\"groups:extras:status:inactive\"]-$totals[\"groups:extras:status:closed\"];\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\tswitch($property){\r\n\t\t\tcase \"content_privacy\":\r\n\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>\"no\");\r\n\t\t\t\t$count_no = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,);\r\n\t\t\t\t$all_groups = elgg_get_entities($options);\r\n\r\n\t\t\t\t// How content_privacy is a new feature it is no available for all groups\r\n\t\t\t\t$labels[]=\"yes\";\r\n\t\t\t\t$totals[\"yes\"]=$all_groups - $count_no;\r\n\t\t\t\t$labels[]=\"no\";\r\n\t\t\t\t$totals[\"no\"]=$count_no;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"membership\":\r\n\t\t\t\t$values = array( ACCESS_PRIVATE => elgg_echo('groups:access:private'), ACCESS_PUBLIC => elgg_echo('groups:access:public'));\r\n\t\t\t\tforeach($values as $value=>$label){\r\n\t\t\t\t\t$options = array(\"types\"=>\"group\",\"count\"=>true,\"metadata_names\"=>$property,\"metadata_values\"=>$value);\r\n\t\t\t\t\t$total = elgg_get_entities_from_metadata($options);\r\n\t\t\t\t\t$labels[]=$value;\r\n\t\t\t\t\t$totals[$value]=$total;\r\n\t\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn array($labels,$totals);\r\n}", "public function getSubtotalInvoiced();", "public function getTotal() {\n return $this->get(self::TOTAL);\n }", "public function getBaseTotalInvoiced();", "public function getTotalBilled() {\n\t\t$total = 0;\n\t\t\n\t\tforeach($this->invoice->all as $invoice) {\n\t\t\tforeach($invoice->lineitem->get()->all as $lineitem) {\n\t\t\t\t$total += $lineitem->amount;\n\t\t\t}\n\t\t}\n\t\treturn $total;\n\t}", "function cartTotal ($cartItems) {\n\n$grouped = $cartItems->groupBy(\"product_id\");\n$product_quantities = $grouped->map(function ($item, $key) {\n return [$key => $item->sum(\"qty\")];\n});\n$products_ids = array_keys($product_quantities->all());\n$products = Product::whereIn(\"id\", $products_ids)->select([\"price\", \"name\", \"id\", \"item_value_discount\", \"items_value_discount\", \"items_items_discount\"])->get();\n$products = $products->groupBy(\"id\");\n\n$item_value_discounts = collect([]);\n$items_value_discounts = collect([]);\n$items_items_discounts = collect([]);\n\nforeach ($products as $product) {\n if ($product[0]->item_value_discount) {\n \n $item_value_discounts->put($product[0]->id, $product[0]->getActiveItemValueDiscount());\n\n // $item_value_discounts = item_value_discount::where(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereDate(\"ends_at\", \">=\", date(\"Y-m-d\"));\n // })->orWhere(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereNull(\"ends_at\");\n // })->get();\n }\n if ($product[0]->items_value_discounts) {\n $items_value_discounts->put($product[0]->id, $product[0]->getActiveItemsValueDiscount());\n // $items_value_discounts = items_value_discount::where(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereDate(\"ends_at\", \">=\", date(\"Y-m-d\"));\n // })->orWhere(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereNull(\"ends_at\");\n // })->get();\n }\n if ($product[0]->items_items_discounts) {\n $items_items_discounts->put($product[0]->id, $product[0]->getActiveItemsItemsDiscount());\n // $items_items_discounts = items_items_discount::where(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereDate(\"ends_at\", \">=\", date(\"Y-m-d\"));\n // })->orWhere(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereNull(\"ends_at\");\n // })->get();\n }\n}\n// return $item_value_discounts;\n// return $items_value_discounts;\n// return $items_items_discounts;\n\n// if ($item_value_discounts)\n// $item_value_discounts = $item_value_discounts->groupBy(\"product_id\");\n// if ($items_value_discounts)\n// $items_value_discounts = $items_value_discounts->groupBy(\"product_id\");\n// if ($items_items_discounts)\n// $items_items_discounts = $items_items_discounts->groupBy(\"product_id\");\n// return $item_value_discounts;\n\n// return $items_value_discounts;\n// return $items_items_discounts;\n$product_prices_qty = collect([]);\n$product_present = collect([]);\nforeach ($products_ids as $products_id) {\n $product_qty = $product_quantities[$products_id][$products_id];\n $items_items_discounts_product_qty = $product_quantities[$products_id][$products_id];\n if (isset($items_value_discounts[$products_id])) {\n if ($items_value_discounts[$products_id] !== []) {\n foreach ($items_value_discounts[$products_id] as $discount) {\n $count = floor($product_qty / $discount->items_count);\n if ($count) {\n $product_prices_qty->push([\n \"product_id\" => $products_id,\n \"product_name\" => $products[$products_id][0]->name,\n \"qty\" => $discount->items_count * $count,\n \"price\" => $count*$discount->items_value,\n ]);\n $product_qty = $product_qty - ($count * $discount->items_count);\n }\n }\n }\n }\n if (isset($item_value_discounts[$products_id])) {\n if ($item_value_discounts[$products_id] !== []) {\n foreach ($item_value_discounts[$products_id] as $discount) {\n if ($product_qty) {\n $price = $products[$products_id][0]->price;\n $value = $discount->value;\n $percent = $discount->percent;\n \n if ($value && $percent) {\n $price = $price - $value;\n } else if ($value && !$percent) {\n $price = $price - $value;\n } else {\n $price = $price - (($percent / 100) * $price);\n }\n $total = $price*$product_qty;\n $product_prices_qty->push([\n \"product_id\" => $products_id,\n \"product_name\" => $products[$products_id][0]->name,\n \"qty\" => $product_qty,\n \"price\" => $total,\n ]);\n }\n }\n }\n }\n if (isset($items_items_discounts[$products_id])) {\n if ($items_items_discounts[$products_id] !== []) {\n $items_number = $items_items_discounts_product_qty;\n $max_get_number = 0;\n // $product_present = collect([]);\n foreach ($items_items_discounts[$products_id] as $discount) {\n $count = floor($items_number / $discount->buy_items_count);\n if (!$product_prices_qty->contains('product_id', $products_id)){\n $price = $products[$products_id][0]->price;\n $total = $price * $items_items_discounts_product_qty;\n $product_prices_qty->push([\n \"product_id\" => $products_id,\n \"qty\" => $items_items_discounts_product_qty,\n \"product_name\" => $products[$products_id][0]->name,\n \"price\" => $total,\n ]);\n }\n if ($count) {\n if ($discount->get_items_count > $max_get_number) {\n $max_get_number = $discount->get_items_count * $count;\n \n $offer = [\n \"product_id\" => $products_id,\n \"buy_items_count\" => $discount->buy_items_count,\n \"presents_count\" => $max_get_number,\n \"present_product_id\" => $discount->present_product_id,\n ];\n }\n }\n }\n $product_present->push($offer);\n }\n }\n}\n$data = [\"totals\" => $product_prices_qty, \"presents\" => $product_present];\nreturn $data;\n}", "public function individual_products_total() {\n\n foreach($this->remaining_category_price as $remaining_category_prices){\n $this->individual_products_total += $remaining_category_prices['price'];\n }\n\n }", "function dripdeals_add_to_cart_fragment($fragments)\n{\n \n global $woocommerce;\n $count = $woocommerce->cart->cart_contents_count;\n \n $fragments['.cart-count'] = \"<div class='cart-count'>\".$count.\"</div>\";\n return $fragments;\n \n}", "function panier_get_count() {\n global $panier;\n $resultat = 0;\n foreach ($panier as $item) {\n $resultat+= $item[PS_PANIER_ITEM_QTY];\n }\n return $resultat;\n}", "protected function calculate() {\n\t\t$this->calculate_item_totals();\n\t\t$this->calculate_shipping_totals();\n\t\t$this->calculate_fee_totals();\n\t\t$this->calculate_totals();\n\t}", "function custom_calculated_total( $total, $cart ){\n\n\t$packages = WC()->cart->get_shipping_packages();\n\t$cost = 0;\n\tif(count($packages) > 1){\n\t\t$chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods' )[0];\n\t\t$shipping_methods = WC()->session->get('shipping_for_package_0')['rates'];\n\t\tforeach ( $packages as $package ) {\n\t\t\tif($package[\"recurring_cart_key\"] === false){\n\t\t\t\t// Loop through the array\n\t\t\t\tforeach ( $shipping_methods as $method_id => $shipping_rate ){\n\t\t\t\t\t$cost = $shipping_rate->cost;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn round( $total - $cost, $cart->dp );\n\t}\n\n\t/*echo '<pre>';\n\tvar_dump($cost);\n\tvar_dump($total);\n\techo '</pre>';*/\nreturn $total;\n\n}", "protected function calculate_item_totals() {\n\t\t$this->get_items_from_cart();\n\t\t$this->calculate_item_subtotals();\n\t\t$this->calculate_discounts();\n\n\t\tforeach ( $this->items as $item_key => $item ) {\n\t\t\t$item->total = $this->get_discounted_price_in_cents( $item_key );\n\t\t\t$item->total_tax = 0;\n\n\t\t\tif ( has_filter( 'woocommerce_get_discounted_price' ) ) {\n\t\t\t\t/**\n\t\t\t\t * Allow plugins to filter this price like in the legacy cart class.\n\t\t\t\t *\n\t\t\t\t * This is legacy and should probably be deprecated in the future.\n\t\t\t\t * $item->object is the cart item object.\n\t\t\t\t * $this->cart is the cart object.\n\t\t\t\t */\n\t\t\t\t$item->total = wc_add_number_precision(\n\t\t\t\t\tapply_filters( 'woocommerce_get_discounted_price', wc_remove_number_precision( $item->total ), $item->object, $this->cart )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( $this->calculate_tax && $item->product->is_taxable() ) {\n\t\t\t\t$total_taxes = WC_Tax::calc_tax( $item->total, $item->tax_rates, $item->price_includes_tax );\n\t\t\t\t$item->taxes = $total_taxes;\n\t\t\t\t$item->total_tax = array_sum( array_map( array( $this, 'round_line_tax' ), $item->taxes ) );\n\n\t\t\t\tif ( $item->price_includes_tax ) {\n\t\t\t\t\t// Use unrounded taxes so we can re-calculate from the orders screen accurately later.\n\t\t\t\t\t$item->total = $item->total - array_sum( $item->taxes );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->cart->cart_contents[ $item_key ]['line_tax_data']['total'] = wc_remove_number_precision_deep( $item->taxes );\n\t\t\t$this->cart->cart_contents[ $item_key ]['line_total'] = wc_remove_number_precision( $item->total );\n\t\t\t$this->cart->cart_contents[ $item_key ]['line_tax'] = wc_remove_number_precision( $item->total_tax );\n\t\t}\n\n\t\t$this->set_total( 'items_total', array_sum( array_map( 'round', array_values( wp_list_pluck( $this->items, 'total' ) ) ) ) );\n\t\t$this->set_total( 'items_total_tax', array_sum( array_values( wp_list_pluck( $this->items, 'total_tax' ) ) ) );\n\n\t\t$this->cart->set_cart_contents_total( $this->get_total( 'items_total' ) );\n\t\t$this->cart->set_cart_contents_tax( array_sum( $this->get_merged_taxes( false, 'items' ) ) );\n\t\t$this->cart->set_cart_contents_taxes( $this->get_merged_taxes( false, 'items' ) );\n\t}", "function getGrandTotal(){\n\t\t$data = $this->_collectShippingInfo();\n\t\treturn $data->getGrandTotalInclTax();\n\t}", "function calculate()\n {\n $this->first_period = $this->second_period = $this->rebill_times = null;\n foreach ($this->getCalculators() as $calc)\n $calc->calculate($this);\n // now summarize all items to invoice totals\n $priceFields = array(\n 'first_subtotal' => null,\n 'first_discount' => 'first_discount',\n 'first_tax' => 'first_tax',\n 'first_shipping' => 'first_shipping',\n 'first_total' => 'first_total',\n 'second_subtotal' => null,\n 'second_discount' => 'second_discount',\n 'second_tax' => 'second_tax',\n 'second_shipping' => 'second_shipping',\n 'second_total' => 'second_total',\n );\n foreach ($priceFields as $k => $kk)\n $this->$k = 0.0;\n foreach ($this->getItems() as $item) {\n $this->first_subtotal += moneyRound($item->first_price * $item->qty);\n $this->second_subtotal += moneyRound($item->second_price * $item->qty);\n foreach ($priceFields as $k => $kk)\n $this->$k += $kk ? $item->$kk : 0;\n }\n foreach ($priceFields as $k => $kk)\n $this->$k = moneyRound($this->$k);\n /// set periods, it has been checked for compatibility in @see add()\n $mostExpensiveItem = null;\n foreach ($this->getItems() as $item) {\n if (!$mostExpensiveItem || $item->first_price > $mostExpensiveItem->first_price) {\n $mostExpensiveItem = $item;\n }\n $this->currency = $item->currency;\n if (empty($this->first_period) && $item->rebill_times)\n $this->first_period = $item->first_period;\n if (empty($this->second_period))\n $this->second_period = $item->second_period;\n if (empty($this->rebill_times))\n $this->rebill_times = $item->rebill_times;\n $this->rebill_times = max($this->rebill_times, $item->rebill_times);\n }\n\n // First period is empty, invoice has only one time items,\n // set first period from most expensive item.\n if (empty($this->first_period) && $mostExpensiveItem) {\n $this->first_period = $mostExpensiveItem->first_period;\n }\n\n if ($this->currency == Am_Currency::getDefault())\n $this->base_currency_multi = 1.0;\n else {\n $this->base_currency_multi = $this->getDi()->currencyExchangeTable->getRate($this->currency,\n sqlDate(!empty($this->tm_added) ? $this->tm_added : $this->getDi()->sqlDateTime));\n if (!$this->base_currency_multi)\n $this->base_currency_multi = 1;\n }\n $this->getDi()->hook->call(Am_Event::INVOICE_CALCULATE, array('invoice' => $this));\n\n $this->terms = null;\n if ((count($this->getItems()) == 1) &&\n ($item = $this->getItem(0)) &&\n ($item->item_type == 'product') &&\n ($pr = $item->tryLoadProduct()) &&\n ($bp = $pr->getBillingPlan()) &&\n $bp->terms) {\n\n if (((float)$bp->first_price == (float)$this->first_total) &&\n ($bp->first_period == $this->first_period) &&\n ((float)$bp->second_price == (float)$this->second_total) &&\n ($bp->second_period == $this->second_period) &&\n ($bp->rebill_times == $this->rebill_times)\n ) {\n $this->terms = $bp->terms;\n }\n }\n\n $this->terms = $this->getDi()->hook->filter($this->terms,\n Am_Event::INVOICE_TERMS, array('invoice' => $this));\n\n return $this;\n }" ]
[ "0.6608654", "0.6202052", "0.61806464", "0.61395675", "0.60550386", "0.6007371", "0.6003921", "0.5954043", "0.5899679", "0.5845012", "0.5842096", "0.58373773", "0.58167624", "0.5793125", "0.57864064", "0.57441926", "0.5717024", "0.57020766", "0.5692685", "0.5670977", "0.56605023", "0.56605023", "0.565899", "0.5655542", "0.5635945", "0.5615976", "0.5594965", "0.5582033", "0.55692476", "0.55688435", "0.5564659", "0.5543669", "0.5542597", "0.5528614", "0.5525637", "0.55172604", "0.54994935", "0.5496929", "0.5486415", "0.5480466", "0.5472765", "0.54718703", "0.5436245", "0.5424595", "0.5424595", "0.5424595", "0.5423924", "0.54196024", "0.53987473", "0.5398007", "0.5390762", "0.5380912", "0.5380161", "0.5379782", "0.53788984", "0.5366924", "0.53622144", "0.53391135", "0.53391135", "0.5333306", "0.5331787", "0.53308094", "0.53296447", "0.5328108", "0.5325361", "0.5317369", "0.5311508", "0.53099513", "0.52959055", "0.52957815", "0.528765", "0.5286299", "0.52857304", "0.5285304", "0.52727914", "0.5272459", "0.5266168", "0.5251384", "0.525131", "0.5248461", "0.524807", "0.5246565", "0.5245048", "0.5244928", "0.5240114", "0.52374184", "0.521745", "0.52143717", "0.51879746", "0.51773196", "0.5171356", "0.5168248", "0.51636904", "0.51523525", "0.5147763", "0.5146781", "0.5146335", "0.5145955", "0.5145359", "0.5134761" ]
0.54114664
48
$query = $this>db>query("select FROM users where id=$value");
function get_userdetails($value) { // return $query->result(); $this->db->select('up.*,us.*,cn.*,st.*,ct.*'); $this->db->from('users us'); $this->db->join('address up', 'up.id=us.addressid', 'left'); $this->db->join('countries cn', 'up.country=cn.id', 'left'); $this->db->join('states st', 'st.s_id=up.state', 'left'); $this->db->join('cities ct', 'up.city=ct.c_id', 'left'); $this->db->where('us.id', $value); $result = $this->db->get()->result(); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_user_by_ID($id){\n global $database;\n $query = \"SELECT * FROM \".TABLE_PREFIX.\"users WHERE ID = \" . $id;\n return $database->query( $query );\n}", "function getUserById($id) {\n // connexion à la BDD\n $db = connect();\n // requête\n $query = $db -> prepare('SELECT * FROM users WHERE id = :id');\n // exécution\n $query -> execute(array(\n ':id' => $id\n ));\n // renvoie un tableau associatif\n return $query -> fetch();\n}", "public function getUserID()\r\n{\r\n $query_string = \"SELECT userid FROM users \";\r\n $query_string .= \"WHERE username = :username\";\r\n\r\n return $query_string;\r\n}", "function getUsername($id){\n return sqlSelectOne(\"SELECT * FROM users WHERE user_id={$id}\", 'user_username');\n}", "function findById($db, $table, $primaryKey, $value, $options = '') {\n\t$query = 'SELECT * FROM ' . $table . ' WHERE ' . $primaryKey . '= :value ' . ' ' . $options ;\n\n\t$parameters = [\n\t\t'value' => $value\n\t];\n\n\t$result = runQuery($db, $query, $parameters);\n\n\treturn $result;\n}", "function getUserbyId($id){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn \t-> prepare('SELECT *\n\t\t\t\t\t\t\t\t\t\tFROM `clients`\n\t\t\t\t\t\t\t\t\t\tWHERE `id` = ?');\n\t\t$sth \t-> execute(array($id));\n\t\treturn \t$sth ;\n\t}", "function getUserById(){\n\t \n\t $sql = \"SELECT * FROM users WHERE User_id=\" . $User_id;\n\t $req = Database::getBdd()->prepare($sql);\n\t \n\t return $req->execute($sql);\n}", "function getUserId($user_name){\n return sqlSelectOne(\"SELECT * FROM users WHERE user_username='$user_name'\", 'user_id');\n}", "function user($id){\n\n $sql = \"SELECT * FROM users WHERE id=$id\";\n return fetch($sql);\n }", "function get_user_by_id($id) {\n $db = new PDO(\"mysql:host=localhost; dbname=registration\", \"root\", \"root\");\n $sql = \"SELECT * FROM users WHERE id=:id\";\n $statement = $db->prepare($sql);\n $statement->execute([\n 'id' => $id\n ]);\n $user = $statement->fetch(PDO::FETCH_ASSOC);\n return $user;\n}", "function selectUser($id) {\n $connection = openDb();\n $id = (int) $id;\n\n\n //Using prepared statements and parameterized queries:\n $sql = \"SELECT * FROM users_view WHERE ID = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"i\",$id);\n\n return executeQueryPrepared($stmt, $connection, true);\n}", "function search($id){\n\t\tglobal $conn;\n\t\t$sql = \"SELECT * FROM user where id=$id\";\n\t\t$stmt = $conn->prepare($sql);\n\t\t$r = $conn->query($sql);\n\t\treturn $r;\n\t}", "function getUserEmail($id){\n return sqlSelectOne(\"SELECT * FROM users WHERE user_id='$id'\", 'user_email');\n}", "function selectAccountByUserId($id) {\n $connection = openDb();\n $id = escape($id,$connection);\n $id = (int) $id;\n\n //Using prepared statements and parameterized queries:\n $sql = \"SELECT * FROM accounts WHERE USER = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"i\",$id);\n\n return executeQueryPrepared($stmt, $connection, true);\n}", "public function queryUsuario($value) {\n $sql = 'select \n a.email, \n b.id,\n b.gender, \n b.mailing_address,\n b.year_of_birth, \n b.level_of_education,\n b.country\n from auth_user a, auth_userprofile b \n where a.email = ? \n and a.id = b.user_id;';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->set($value);\n\t\t$result = QueryExecutor::execute($sqlQuery);\n return $result; \n }", "function find_user_by_id($id)\r\n{\r\n global $db;\r\n\r\n $q = $db->prepare('SELECT name, pseudo, email, city, country, twitter, github, \r\nfacebook, sex, available_for_hiring, bio FROM users WHERE id=?');\r\n $q->execute([$id]);\r\n\r\n $data = $q->fetch(PDO::FETCH_OBJ);\r\n\r\n $q->closeCursor();\r\n return $data;\r\n}", "function MostrarU($conexion, $id){\n $result = $conexion->query(\"SELECT * FROM usuario WHERE id_usuario=$id\");\n return $result;\n}", "function search($id){\n\t\tglobal $con;\n\t\t$query = \"select * from user where id = '$id'\";\n\t\t$res=$con->query($query);\n\t\treturn $res;\n\t}", "public static function find(string $idvalue)\n\t\t{\n\t\t\t$pk = self::get('id') ;\n\t\t\t$tb = self::get('tabla') ;\n\n\t\t\treturn Database::getInstance()\n\t\t\t\t\t->query(\"SELECT * FROM $tb \n\t\t\t\t\t \t WHERE $pk='$idvalue' ;\") \n\t\t\t\t\t->getObject(get_called_class()) ;\n\t\t}", "function userExists($parameter,$value) {\n\t$value = dbEscape($value);\n\treturn(dbResultExists(\"SELECT id FROM users WHERE $parameter='$value'\"));\n}", "function db_find ($table, $fields = '*', $id) {\n return db_select(\"SELECT $fields FROM $table WHERE id = ?\", array($id), true);\n}", "function get_user($value, $id)\n {\n $this->db->select($value);\n\t\t$this->db->from('tbl_users');\n\t\t$this->db->join('tbl_users_details', 'tbl_users.id=tbl_users_details.user_id');\n\t\t$this->db->where('tbl_users.id', $id);\n\t\t$query = $this->db->get();\n\t\treturn $query->row_array();\n }", "function usuarioID($id){\n\t\n\t$query = $this->db->from('usuario')->where('id',$id)->get();\n\n\t\t\tif($query-> num_rows() > 0){\n\t\t\t\treturn $query;\n\t\t\t\t}\n\t\n\t}", "public function read_by_id(){\n try {\n $userid = $this->id;\n\n // query to get specific users\n $this->_query = \"SELECT * FROM \" . $this->_dbtable . \" WHERE id=:userid\";\n\n\n // preparing query\n $statement = $this->_conn->prepare($this->_query);\n\n //binding params\n $statement->bindParam(\":userid\", $userid, PDO::PARAM_INT);\n\n // executing query\n $statement->execute();\n\n return $statement;\n }\n catch(PDOException $ex){\n echo \"Error\" . $ex->getMessage();\n }\n }", "function find($table, $id)\n{\n $data = connect()->query(\"SELECT * FROM $table WHERE id='$id'\");\n\n return $data->fetch_object();\n}", "function get_user_data($user_id){\n global $db;\n $sql = \"SELECT * FROM user WHERE user_id = '$user_id'\";\n $result = $db->query($sql)->fetch();\n return $result;\n}", "public function getUserIDandEmail()\r\n{\r\n $query_string = \"SELECT userid FROM users \";\r\n $query_string .= \"WHERE username = :username OR email = :email\";\r\n\r\n return $query_string;\r\n}", "public function selectUserById($id){\r\n //2 prepare la requete\r\n $stmt=$connexion->prepare(\r\n \"SELECT *\r\n FROM User\r\n WHERE id=:id\"\r\n );\r\n //3 execute la requete\r\n $stmt->execute(\r\n array('id'=>$id)\r\n );\r\n // 4 Recuperation resultat et stockage ds variable\r\n $user=$stmt->fetchObject('User');\r\n // 5 retourne la variable (reslutat)\r\n return $user;\r\n }", "function find_user($user_id) {\n global $db;\n $sql = \"SELECT * FROM users WHERE id = :user_id;\";\n $params = array(\n ':user_id' => $user_id\n );\n $records = exec_sql_query($db, $sql, $params)->fetchAll();\n if ($records) {\n // user_id is a unique field, so only 1 record should be selected.\n return $records[0];\n }\n // if nothing is returned earlier, then return NULL\n return NULL;\n}", "static function loadUser() : string\n {\n return \"SELECT *\n FROM users\n WHERE id = :id;\";\n }", "function find_user($user_id)\n{\n global $db;\n $sql = \"SELECT * FROM users WHERE id = :user_id;\";\n $params = array(':user_id' => $user_id);\n $users = exec_sql_query($db, $sql, $params)->fetchAll();\n if ($users) {\n return $users[0];\n }\n return NULL;\n}", "function getUserID($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from users where userid='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['userid'];\n\t}\n\n\t$crud->disconnect();\n}", "function get_user_booking_with_id($user_id){\n global $db;\n $sql = \"SELECT * FROM booking WHERE user_id = '$user_id'\";\n $result = $db->query($sql);\n return $result;\n}", "function getUserInfo($id) {\n global $db;\n\n $query = \"SELECT username, first, last, email, phone, bio FROM user WHERE id=:id\";\n $statement = $db->prepare($query);\n $statement->bindValue(':id', $id); \n $statement->execute();\n $results = $statement->fetch();\n $statement->closeCursor();\n return $results;\n}", "public function selectViaId($id){\n$sql = \"SELECT id, login, email, password, id_droits FROM utilisateurs WHERE id = :id\";\n$stmt = $this->pdo->prepare($sql);\n$stmt->execute([\n 'id' => $id\n]);\n$userid = $stmt->fetch(PDO::FETCH_ASSOC);\nif(!$userid)\n{\n return false;\n}\n else\n {\n return $userid;\n }\n}", "function getUserID($field, $value) {\n $con = getConnection();\n $value = mysqli_real_escape_string($con, $value);\n $query = \"SELECT user_id FROM user WHERE $field='$value'\";\n $result = mysqli_query($con,$query);\n return mysqli_fetch_array($result)['user_id'];\n}", "public function getAllUsers()\r\n{\r\n $query_string = \"SELECT userid, username \";\r\n $query_string .= \"FROM users \";\r\n\r\n return $query_string;\r\n}", "public function getUserDetails()\r\n{\r\n\t$query_string = \"SELECT userid, username, email, firstname, lastname \";\r\n $query_string .= \"FROM users \";\r\n $query_string .= \"WHERE \";\r\n $query_string .= \"username = :username\";\r\n\r\n return $query_string;\r\n}", "function selectAccountById($id) {\n $connection = openDb();\n\n //Using prepared statements:\n $id = (int) $id;\n $sql = \"SELECT * FROM accounts WHERE ID = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"i\",$id);\n\n return executeQueryPrepared($stmt, $connection, true);\n}", "function getUserName($id)\n {\n $db=Factory::getDatabase('slave');\n $db->query(\"select name from test WHERE id=$id limit 1\");\n }", "function getByID($table,$field,$value);", "function executeQuery($param,$id)\n {\n\n $consulta =\"SELECT $param from usuario where id='$id'\";\n if($resultado= $this->conexion->query($consulta)){ \n if ( $resultado->num_rows!=0 ) {\n while($fila= $resultado->fetch_assoc())\n {\n\n return $fila[\"$param\"] ;\n }//return $resultado->fetch_row();\n $resultado->close();\n }else\n { \n }\n $conexion->close();\n }\n\n }", "function getbyid($id){\n\t\t$this->db->where ('id', $id, \"=\");\n\t\t$res = $this->db->getOne('admin');\n\t\treturn $res;\n\t}", "function get_user_booking_using_id($user_id){\n global $db;\n $sql = \"SELECT * FROM booking WHERE user_id = '$user_id'\";\n $result = $db->query($sql)->fetch();\n return $result;\n}", "static function select($id = 0){\n $query = \"SELECT * FROM users where id = '$id' \";\n $pdo = new Connection();\n $pdo = $pdo->open();\n $results = $pdo->query($query);\n $rows = [];\n foreach($results->fetchAll() as $row){\n $rows[] = new User($row['username'], $row['password'], $row['id']);\n }\n return $rows;\n }", "public function getUserById($id){\n // Query for the user.\n $this->db->query('SELECT * FROM users WHERE id = :id');\n // Bind the values.\n $this->db->bind(':id', $id);\n // Return the row. \n $row = $this->db->single();\n\n return $row;\n }", "public function getstudentById ($student_number){\n $sqlQuery = \" SELECT * \";\n $sqlQuery .= \" FROM students \";\n $sqlQuery .= \" WHERE student_number=’ $student_number ’ \";\n $result = $this -> getDbManager () -> executeSelectQuery ( $sqlQuery );\n return ( $result );\n }", "public function selectUserbyId($id){\r\n\r\n $query = 'SELECT * FROM user_tbl WHERE id = ?';\r\n $stmt = $this->_db->prepare($query);\r\n $stmt->execute([$id]);\r\n $users = $stmt->fetchAll(PDO::FETCH_OBJ);\r\n if ($stmt->rowCount()){\r\n return $users;\r\n }\r\n\r\n }", "public static function query( $id ) {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"SELECT * FROM users WHERE id = ?\");\n\t\t$stmt->setFetchMode(PDO::FETCH_INTO, new User(null));\n\t\tif ($stmt->execute(array($id)))\n\t\t\treturn $stmt->fetch();\n\t\telse\n\t\t\treturn null;\n\t}", "public function getId($id){\n\t\t$query = $this->db->select()->from($this->tb)->where('idusers','=',\"$id\")->getOne();\n\t\treturn $query;\n\t}", "public function getUpdatedUserID()\r\n{\r\n $query_string = \"SELECT userid FROM users \";\r\n $query_string .= \"WHERE userid != :userid AND username = :username\";\r\n\r\n return $query_string;\r\n}", "function bd_usuarios_hash($id){\n return sql2value(\"\n SELECT clave\n FROM usuarios\n WHERE id LIKE '{$id}'or email LIKE '{$id}'\n LIMIT 1;\n \");\n}", "function recupereUser(PDO $bdd, $id)\r\n{\r\n $query = $bdd->prepare('SELECT * FROM utilisateur WHERE id = :id ');\r\n $query->bindValue(':id', $id);\r\n $query->execute();\r\n return $query->fetch();\r\n}", "function get_by_user_id($id){\n $id = (int)$id; //this is typecasting - if on the off chance a string got in here instead of a number, it will force it to be a number (SQL injection prevention), stored in $id\n $sql = \"SELECT * FROM posts WHERE user_id = '$id'\"; //change from users to posts for this case if copied from users\n\n $posts = $this->select($sql); //sql only brings back one from database, so we need to put a number\n\n return $posts; //brings it back\n}", "function getUserNameById($id) {\n global $pdo;\n $statement = $pdo->prepare('SELECT `firstname`, `lastname` FROM `user` WHERE `id` = :id');\n $statement->bindParam(\":id\", $id);\n $statement->execute();\n return $statement->fetch(PDO::FETCH_ASSOC);\n}", "function get_user_by_userid($db, $userid)\n{\n\n\t$sql = 'SELECT * FROM users where id='.$userid;\n\t$st = $db->prepare($sql);\n\t$st->execute();\n\t$us = $st->fetchAll();\n\treturn $us[0];\n}", "function get_user_by_user_id($user_id)\n{\n global $conn;\n $q['query'] = \"SELECT * FROM `user_master` WHERE `user_id`='$user_id'\";\n $q['run'] = $conn->query($q['query']);\n $q['result'] = $q['run']->fetch_assoc();\n\n return $q['result'];\n}", "function findbyid(){\r\n $conn=$this->connect();\r\n $id = $conn -> real_escape_string($this->id);\r\n $sql=\"SELECT * FROM quanly WHERE id = '$id'\";\r\n $result=$conn -> query($sql);\r\n $conn->close();\r\n return $result;\r\n }", "function getById($id, $table) {\n $sql = \"select * from {$table} where id = {$id}\";\n\n try {\n if(is_numeric($id))\n DB::select($sql);\n else\n throw new Exception(\"Only accepts numbers\");\n } catch(Exception $e) {\n echo \"Error: {$e->getMessage()}\";\n }\n }", "function mysql_auth_user_id($username)\n{\n return dbFetchCell(\"SELECT `user_id` FROM `users` WHERE `username` = ?\", array($username));\n}", "public function findBy($key,$value){ \n $arraytoret = array();\n $query='select *\n from Usuario\n where '.$key.'='.$value;\n $results = $this->driver->exec($query);\n return $this->factory($results);\n}", "public function getUserById($id){\n $this->db->query('SELECT * FROM users WHERE us_id = :id');\n // Bind values\n $this->db->bind(':id', $id);\n $row = $this->db->single();\n return $row;\n\n }", "public function foobar()\n {\n $result = $this->db->query_params(\"SELECT field FROM table WHERE something = $1 and something_else = $2\", array('foo', 'bar'));\n // use $result as usual ...\n }", "public function selectById($id) {\n\t\t//$stmt = $this->pdo->prepare($sql);\n\t\t//$stmt->bindValue(':id', $id);\n\t\t//$stmt->execute();\n\t\t//return $stmt->fetch(PDO::FETCH_ASSOC);\n\t}", "public function selectById($id);", "public function selectById($id);", "function userNameGet(PDO $db, $id)\n{\n $sql = \"SELECT name FROM users WHERE id = :id\";\n\n $stmt = $db->prepare($sql); \n $stmt->bindParam(':id', $id, PDO::PARAM_INT); \n $stmt->execute();\n $name=$stmt->fetch(PDO::FETCH_NUM);\n\n return $name;\n}", "function sqli($get = 1)\n{\n try {\n $db = new PDO('mysql:dbname=test;host=localhost;charset=UTF8', 'root', '071293');\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch (PDOException $pe) {\n echo $pe->getMessage();\n }\n\n $sql = \"SELECT * from test where id={$get}\";\n $stmt = $db->query($sql);\n\n var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));\n}", "function Get_data_byid($table,$where = '') {\n\t\treturn $this->db->query(\"SELECT * from $table $where;\");\t\n\t}", "function select($item,$table,$s_cul=0,$value=0){\r\n global $con;\r\n $query=$con->prepare(\"SELECT $item FROM $table where $s_cul=? \");\r\n $query->execute(array($value));\r\n $content=$query->fetchall();\r\n return $content;\r\n}", "function getUsername($id) { // Returns name of user with given id\n\t$id = intval($id);\n\treturn(dbFirstResult(\"SELECT username FROM users WHERE id=$id\"));\n}", "function select($id)\n{\n\n$sql = \"SELECT * FROM test WHERE id = $id;\";\n$result = $this->database->query($sql);\n$result = $this->database->result;\n$row = mysql_fetch_object($result);\n\n\n$this->id = $row->id;\n\n$this->name = $row->name;\n\n$this->vorname = $row->vorname;\n\n$this->adresse = $row->adresse;\n\n$this->telefon = $row->telefon;\n\n$this->jahr = $row->jahr;\n\n}", "function getUserById($id) {\n\t$result = mysql_query(\"SELECT userId, email, password FROM users where userId = $id\");\n\t$row = mysql_fetch_array($result, MYSQL_ASSOC);\n\tmysql_free_result($result);\n\treturn $row;\n}", "function findById($id){\n\t\tUtilidades::_log(\"findById($id)\");\n\t\t$query = \"SELECT id,name,account,surnames,email,pass,address,access\n\t\t\t\t\tFROM user WHERE id = $id\";\n\t\t$row = DB::ejecutarConsulta($query);\n\t\t\n\t\treturn new UserDAO($row[0]);\n\t}", "public function checkUserPassword()\r\n{\r\n $query_string = \"SELECT userid, username, password \";\r\n $query_string .= \"FROM users \";\r\n $query_string .= \"WHERE \";\r\n $query_string .= \"userid = :userid AND \";\r\n $query_string .= \"username = :username\";\r\n\r\n return $query_string;\r\n}", "public function getQueryBy($param, $value)\r\n {\r\n return $this->db\r\n ->select('*')\r\n ->from('semestre s')\r\n ->where($param, $value)\r\n ->get();\r\n }", "function SelectByIdFrom_UserDetails($dbhandle, $id, &$user)\n{\n $logger = LoggerSingleton::GetInstance();\t\n $logger->LogInfo(\"SelectByIdFrom_UserDetails : Enter ($id)\");\n\n global $UserDetailsTable_Id;\n global $UserDetailsTable_Name;\n global $UserDetailsTable_UserName;\n \n // select\n $query = \"SELECT * FROM $UserDetailsTable_Name\n WHERE $UserDetailsTable_Id = $id\";\n\n // execte\n $result = $dbhandle->query($query);\n\n if(FALSE == $result)\n {\n $logger->LogError(\"SelectByIdFrom_UserDetails : No records with id - $id found\");\n $status = false;\n }\n\n $num_rows = $result->num_rows;\n if($num_rows > 0)\n {\n while($row = $result->fetch_assoc())\n {\n $user = $row[\"$UserDetailsTable_UserName\"];\n }\n\n $status = true;\n } \n else\n {\n $logger->LogError(\"SelectByIdFrom_UserDetails : No records found\");\n $status = false;\n }\n\n return $status;\n}", "function get_user_by_id($user_id) {\n// echo $user_id; die;\n $this->db->select(\"*\", false);\n $this->db->where(\"id\", $user_id);\n $query = $this->db->get($this->user_table);\n $result = $query->row_array();\n// pr($result); die;\n return $result;\n }", "function select_by_id($tbl, $cols='*', $value=null, $id='id', $limit=1){\n $where = 1;\n if(isset($value)) $where=\"$id='$value'\";\n $sql = \"SELECT $cols FROM $tbl WHERE $where LIMIT $limit\";\n $result = $this->execute($sql) or $this->error($sql);\n $row = $this->next($result,'{}');\n return $row;\n }", "function getUserid($username) {\n\t$username = dbEscape($username);\n\treturn(dbFirstResult(\"SELECT id FROM users WHERE username='$username'\"));\n}", "function getUserById($user_id) {\n $query = \"SELECT * FROM users_account WHERE userid = ?\";\n $paramType = \"i\";\n $paramValue = array(\n $user_id\n );\n \n $result = $this->db_handle->runQuery($query, $paramType, $paramValue);\n return $result;\n }", "public function getSystemId()\r\n{\r\n $query_string = \"SELECT systemid FROM voting_system \";\r\n $query_string .= \"WHERE systemname = :systemname\";\r\n\r\n return $query_string;\r\n\r\n}", "function verifiRentsDetails($id)\n{\n\n $requete = \"SELECT idSnow FROM rentsdetails where idSnow='$id';\";\n $request = executeQuery($requete);\n\n\n return $request;\n}", "public function getUser($id){\n \t$sql = \"select * from `usuarios` where `id` = '$id'\";\n \t$result = parent::executaQuery($sql);\n $row = mysqli_fetch_object ( $result );\n return $row;\n }", "public function userbyid($id)\n {\n $sql=\"SELECT * FROM users where id='$id'\";\n\t $result = $this->db->query($sql);\n\t return $result->row();\n \n }", "public function __construct2($field_in_user_table,$value ) {\n\t\t$query=\"SELECT id from users where $field_in_user_table ='$value'\";\n\t\t$query_run=mysql_fetch_assoc(mysql_query($query));\n\t\tif($query_run)\n\t\t$this->user_id=$query_run[\"id\"];\t\n\t\telse\n\t\t{\n\t\techo 'No such user has been found !!';\n\t\texit();\n\t\t}\n\t}", "public function query($query= \"SELECT * FROM users_test\"){\n$result= mysqli_query($this->connection, $query);\nwhile ($row= mysqli_fetch_assoc($result)) {\n\techo \"ID=\" . $row['id'] . \"<br>\" ;\n\techo \"FIRST NAME=\" . $row['first_name'] . \"<br>\" ;\n\techo \"LAST NAME=\" . $row['last_name'] . \"<br>\" ;\n\techo \"USERNAME=\" . $row['username'] . \"<br>\" ;\n\techo \"PASSWORD=\" . $row['password'] . \"<br><br>\" ;\n\t\n}\n}", "public function readByUser(){\n //select all query\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE id_user=:id_user\";\n\n //perpare query\n $stmt = $this->conn->prepare($query);\n\n //sanitize\n $this->id_user=htmlspecialchars(strip_tags($this->id_user));\n\n //bind given value\n $stmt->bindparam(\":id_user\", $this->id_user);\n\n $stmt->execute();\n\n return $stmt;\n }", "function user_details_id ($id)\n\t\t{\n\t\t $query = \"select * from user_details where id = $id \" ; \n\t\t\t$data = mysql_query($query) ;\n\t\t\treturn $data ; \n\t\t}", "public function getUserRole()\r\n{\r\n $query_string = \"SELECT role FROM users \";\r\n $query_string .= \"WHERE userid = :userid\";\r\n\r\n return $query_string;\r\n}", "function get_user_by_id($id) {\r\n\t\t$query = $this->db->query('SELECT user_fname, user_lname, user_email\r\n\t\t\t\t\t\t\t\t\tFROM user\r\n\t\t\t\t\t\t\t\t\tWHERE user_id = '.$id.'');\r\n\t\treturn $query->result();\r\n\t}", "function get($id) {\n $tablename = $this->table_name;\n $query = \"SELECT * from \".$tablename.\" WHERE id='\".$id.\"';\";\n // prepare query statement\n if(!($result = mysqli_query($this->conn, $query))) {\n echo \"Could not execute query!<br>\";\n echo(\"Error description: \" . mysqli_error($this->conn));\n die(mysqli_error($this->conn));\n } else {\n return $result;\n }\n }", "function get_by_id($id) {\r\n $this->db->where('id', $id);\r\n return $this->db->get($this->tbl);\r\n }", "public static function findById($id)\n {\n $_id = \"'\".$id.\"'\";\n $qb = new QB;\n $qb->conn = static::getDB();\n $results = $qb->select('users', '*')\n ->where('id', '=', $_id)\n ->all();\n return $results;\n }", "public function findUserById()\n {\n $this->db->query('SELECT * FROM user WHERE id = :id');\n $this->db->bind(':id', $_SESSION['id']);\n \n $row = $this->db->single();\n \n return $row; \n }", "function fetchUserDetails($username=NULL,$token=NULL, $id=NULL){\n\tif($username!=NULL) {\n\t\t$column = \"username\";\n\t\t$data = $username;\n\t}elseif($id!=NULL) {\n\t\t$column = \"id\";\n\t\t$data = $id;\n\t}\n\t$db = DB::getInstance();\n\t$query = $db->query(\"SELECT * FROM users WHERE $column = $data LIMIT 1\");\n\t$results = $query->first();\n\treturn ($results);\n}", "function getUserFromDatabase($id)\n {\n $connect = new Config();\n $sql = 'SELECT * FROM user_db WHERE id = :id';\n $query = $connect->connectPDO()->prepare($sql);\n $query->bindParam(':id', $id, \\PDO::PARAM_INT);\n $query->execute();\n\n if ($user = $query->fetch(PDO::FETCH_ASSOC)) {\n return $user;\n } else {\n $_SESSION['error'] = ['No Such User Found'];\n }\n }", "function userFound($id)\n{\n global $conn;\n $stmt = $conn->prepare(\"SELECT * FROM users WHERE _id = '$id' ;\");\n $stmt->execute();\n $c = $stmt->rowCount();\n if ($c == 0) return \"not found\";\n return \"found\";\n}", "function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }", "function find_by_id($table,$id)\n{\n global $db;\n $id = (int)$id;\n if(tableExists($table)){\n $sql = $db->query(\"SELECT * FROM {$db->escape($table)} WHERE id='{$db->escape($id)}' LIMIT 1\");\n if($result = $db->fetch_assoc($sql))\n return $result;\n else\n return null;\n }\n}", "function find_by_id($table,$id)\n{\n global $db;\n $id = (int)$id;\n if(tableExists($table)) \n {\n /*\n $sql_result = $db->query(\"SELECT * FROM {$db->escape($table)} WHERE id='{$db->escape($id)}' LIMIT 1\");\n */\n $sql = \"SELECT * FROM \".$db->escape($table);\n $sql .= \" WHERE id=\".$db->escape($id);\n $sql .= \" LIMIT 1\";\n $sql_result = $db->query($sql);\n if( $result = $db->fetch_assoc($sql_result) )\n return $result;\n else\n return NULL;\n }\n else\n return NULL;\n}" ]
[ "0.7311796", "0.7254414", "0.7205307", "0.7173036", "0.71542346", "0.7068461", "0.70552593", "0.70499516", "0.69363374", "0.6933564", "0.6882222", "0.6797566", "0.6788", "0.6763899", "0.6757955", "0.6747805", "0.67220175", "0.6644879", "0.66435224", "0.6618483", "0.6613553", "0.6598315", "0.656966", "0.65695035", "0.65415716", "0.65370554", "0.6522101", "0.6512593", "0.65110415", "0.65081316", "0.65061927", "0.65026", "0.6479921", "0.64775956", "0.6468201", "0.6438042", "0.64374983", "0.6403711", "0.63741213", "0.6361539", "0.6351161", "0.63413244", "0.62715244", "0.62702703", "0.6269586", "0.62693655", "0.6267855", "0.62636137", "0.62558746", "0.625376", "0.62535405", "0.6251042", "0.6242823", "0.62420857", "0.62325907", "0.6231731", "0.6227833", "0.6220916", "0.619968", "0.6197801", "0.6195128", "0.61920834", "0.6189443", "0.6166407", "0.6157567", "0.6157567", "0.6143814", "0.6133874", "0.6128586", "0.61184955", "0.6098034", "0.60945284", "0.60936874", "0.60930634", "0.6092827", "0.6079468", "0.60767937", "0.60749", "0.6068788", "0.60586905", "0.60502017", "0.6040537", "0.6035088", "0.6032898", "0.601982", "0.6009916", "0.6005813", "0.59952515", "0.5993936", "0.5993437", "0.59909207", "0.5989671", "0.5988486", "0.5979531", "0.59793967", "0.5974116", "0.5968281", "0.59655476", "0.59539473", "0.5953725", "0.59462523" ]
0.0
-1
$query = $this>db>query("select FROM users where id=$value");
function get_userphoto($value) { // return $query->result(); $this->db->select('up.*,us.*'); $this->db->from('userprofile us'); $this->db->join('file up', 'up.id=us.profilepic', 'JOIN'); $this->db->where('us.useid', $value); $result = $this->db->get()->result(); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_user_by_ID($id){\n global $database;\n $query = \"SELECT * FROM \".TABLE_PREFIX.\"users WHERE ID = \" . $id;\n return $database->query( $query );\n}", "function getUserById($id) {\n // connexion à la BDD\n $db = connect();\n // requête\n $query = $db -> prepare('SELECT * FROM users WHERE id = :id');\n // exécution\n $query -> execute(array(\n ':id' => $id\n ));\n // renvoie un tableau associatif\n return $query -> fetch();\n}", "public function getUserID()\r\n{\r\n $query_string = \"SELECT userid FROM users \";\r\n $query_string .= \"WHERE username = :username\";\r\n\r\n return $query_string;\r\n}", "function getUsername($id){\n return sqlSelectOne(\"SELECT * FROM users WHERE user_id={$id}\", 'user_username');\n}", "function findById($db, $table, $primaryKey, $value, $options = '') {\n\t$query = 'SELECT * FROM ' . $table . ' WHERE ' . $primaryKey . '= :value ' . ' ' . $options ;\n\n\t$parameters = [\n\t\t'value' => $value\n\t];\n\n\t$result = runQuery($db, $query, $parameters);\n\n\treturn $result;\n}", "function getUserbyId($id){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn \t-> prepare('SELECT *\n\t\t\t\t\t\t\t\t\t\tFROM `clients`\n\t\t\t\t\t\t\t\t\t\tWHERE `id` = ?');\n\t\t$sth \t-> execute(array($id));\n\t\treturn \t$sth ;\n\t}", "function getUserById(){\n\t \n\t $sql = \"SELECT * FROM users WHERE User_id=\" . $User_id;\n\t $req = Database::getBdd()->prepare($sql);\n\t \n\t return $req->execute($sql);\n}", "function getUserId($user_name){\n return sqlSelectOne(\"SELECT * FROM users WHERE user_username='$user_name'\", 'user_id');\n}", "function user($id){\n\n $sql = \"SELECT * FROM users WHERE id=$id\";\n return fetch($sql);\n }", "function get_user_by_id($id) {\n $db = new PDO(\"mysql:host=localhost; dbname=registration\", \"root\", \"root\");\n $sql = \"SELECT * FROM users WHERE id=:id\";\n $statement = $db->prepare($sql);\n $statement->execute([\n 'id' => $id\n ]);\n $user = $statement->fetch(PDO::FETCH_ASSOC);\n return $user;\n}", "function selectUser($id) {\n $connection = openDb();\n $id = (int) $id;\n\n\n //Using prepared statements and parameterized queries:\n $sql = \"SELECT * FROM users_view WHERE ID = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"i\",$id);\n\n return executeQueryPrepared($stmt, $connection, true);\n}", "function search($id){\n\t\tglobal $conn;\n\t\t$sql = \"SELECT * FROM user where id=$id\";\n\t\t$stmt = $conn->prepare($sql);\n\t\t$r = $conn->query($sql);\n\t\treturn $r;\n\t}", "function getUserEmail($id){\n return sqlSelectOne(\"SELECT * FROM users WHERE user_id='$id'\", 'user_email');\n}", "function selectAccountByUserId($id) {\n $connection = openDb();\n $id = escape($id,$connection);\n $id = (int) $id;\n\n //Using prepared statements and parameterized queries:\n $sql = \"SELECT * FROM accounts WHERE USER = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"i\",$id);\n\n return executeQueryPrepared($stmt, $connection, true);\n}", "public function queryUsuario($value) {\n $sql = 'select \n a.email, \n b.id,\n b.gender, \n b.mailing_address,\n b.year_of_birth, \n b.level_of_education,\n b.country\n from auth_user a, auth_userprofile b \n where a.email = ? \n and a.id = b.user_id;';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->set($value);\n\t\t$result = QueryExecutor::execute($sqlQuery);\n return $result; \n }", "function find_user_by_id($id)\r\n{\r\n global $db;\r\n\r\n $q = $db->prepare('SELECT name, pseudo, email, city, country, twitter, github, \r\nfacebook, sex, available_for_hiring, bio FROM users WHERE id=?');\r\n $q->execute([$id]);\r\n\r\n $data = $q->fetch(PDO::FETCH_OBJ);\r\n\r\n $q->closeCursor();\r\n return $data;\r\n}", "function MostrarU($conexion, $id){\n $result = $conexion->query(\"SELECT * FROM usuario WHERE id_usuario=$id\");\n return $result;\n}", "function search($id){\n\t\tglobal $con;\n\t\t$query = \"select * from user where id = '$id'\";\n\t\t$res=$con->query($query);\n\t\treturn $res;\n\t}", "public static function find(string $idvalue)\n\t\t{\n\t\t\t$pk = self::get('id') ;\n\t\t\t$tb = self::get('tabla') ;\n\n\t\t\treturn Database::getInstance()\n\t\t\t\t\t->query(\"SELECT * FROM $tb \n\t\t\t\t\t \t WHERE $pk='$idvalue' ;\") \n\t\t\t\t\t->getObject(get_called_class()) ;\n\t\t}", "function userExists($parameter,$value) {\n\t$value = dbEscape($value);\n\treturn(dbResultExists(\"SELECT id FROM users WHERE $parameter='$value'\"));\n}", "function db_find ($table, $fields = '*', $id) {\n return db_select(\"SELECT $fields FROM $table WHERE id = ?\", array($id), true);\n}", "function get_user($value, $id)\n {\n $this->db->select($value);\n\t\t$this->db->from('tbl_users');\n\t\t$this->db->join('tbl_users_details', 'tbl_users.id=tbl_users_details.user_id');\n\t\t$this->db->where('tbl_users.id', $id);\n\t\t$query = $this->db->get();\n\t\treturn $query->row_array();\n }", "function usuarioID($id){\n\t\n\t$query = $this->db->from('usuario')->where('id',$id)->get();\n\n\t\t\tif($query-> num_rows() > 0){\n\t\t\t\treturn $query;\n\t\t\t\t}\n\t\n\t}", "public function read_by_id(){\n try {\n $userid = $this->id;\n\n // query to get specific users\n $this->_query = \"SELECT * FROM \" . $this->_dbtable . \" WHERE id=:userid\";\n\n\n // preparing query\n $statement = $this->_conn->prepare($this->_query);\n\n //binding params\n $statement->bindParam(\":userid\", $userid, PDO::PARAM_INT);\n\n // executing query\n $statement->execute();\n\n return $statement;\n }\n catch(PDOException $ex){\n echo \"Error\" . $ex->getMessage();\n }\n }", "function find($table, $id)\n{\n $data = connect()->query(\"SELECT * FROM $table WHERE id='$id'\");\n\n return $data->fetch_object();\n}", "function get_user_data($user_id){\n global $db;\n $sql = \"SELECT * FROM user WHERE user_id = '$user_id'\";\n $result = $db->query($sql)->fetch();\n return $result;\n}", "public function getUserIDandEmail()\r\n{\r\n $query_string = \"SELECT userid FROM users \";\r\n $query_string .= \"WHERE username = :username OR email = :email\";\r\n\r\n return $query_string;\r\n}", "public function selectUserById($id){\r\n //2 prepare la requete\r\n $stmt=$connexion->prepare(\r\n \"SELECT *\r\n FROM User\r\n WHERE id=:id\"\r\n );\r\n //3 execute la requete\r\n $stmt->execute(\r\n array('id'=>$id)\r\n );\r\n // 4 Recuperation resultat et stockage ds variable\r\n $user=$stmt->fetchObject('User');\r\n // 5 retourne la variable (reslutat)\r\n return $user;\r\n }", "function find_user($user_id) {\n global $db;\n $sql = \"SELECT * FROM users WHERE id = :user_id;\";\n $params = array(\n ':user_id' => $user_id\n );\n $records = exec_sql_query($db, $sql, $params)->fetchAll();\n if ($records) {\n // user_id is a unique field, so only 1 record should be selected.\n return $records[0];\n }\n // if nothing is returned earlier, then return NULL\n return NULL;\n}", "static function loadUser() : string\n {\n return \"SELECT *\n FROM users\n WHERE id = :id;\";\n }", "function find_user($user_id)\n{\n global $db;\n $sql = \"SELECT * FROM users WHERE id = :user_id;\";\n $params = array(':user_id' => $user_id);\n $users = exec_sql_query($db, $sql, $params)->fetchAll();\n if ($users) {\n return $users[0];\n }\n return NULL;\n}", "function getUserID($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from users where userid='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['userid'];\n\t}\n\n\t$crud->disconnect();\n}", "function get_user_booking_with_id($user_id){\n global $db;\n $sql = \"SELECT * FROM booking WHERE user_id = '$user_id'\";\n $result = $db->query($sql);\n return $result;\n}", "function getUserInfo($id) {\n global $db;\n\n $query = \"SELECT username, first, last, email, phone, bio FROM user WHERE id=:id\";\n $statement = $db->prepare($query);\n $statement->bindValue(':id', $id); \n $statement->execute();\n $results = $statement->fetch();\n $statement->closeCursor();\n return $results;\n}", "public function selectViaId($id){\n$sql = \"SELECT id, login, email, password, id_droits FROM utilisateurs WHERE id = :id\";\n$stmt = $this->pdo->prepare($sql);\n$stmt->execute([\n 'id' => $id\n]);\n$userid = $stmt->fetch(PDO::FETCH_ASSOC);\nif(!$userid)\n{\n return false;\n}\n else\n {\n return $userid;\n }\n}", "function getUserID($field, $value) {\n $con = getConnection();\n $value = mysqli_real_escape_string($con, $value);\n $query = \"SELECT user_id FROM user WHERE $field='$value'\";\n $result = mysqli_query($con,$query);\n return mysqli_fetch_array($result)['user_id'];\n}", "public function getAllUsers()\r\n{\r\n $query_string = \"SELECT userid, username \";\r\n $query_string .= \"FROM users \";\r\n\r\n return $query_string;\r\n}", "public function getUserDetails()\r\n{\r\n\t$query_string = \"SELECT userid, username, email, firstname, lastname \";\r\n $query_string .= \"FROM users \";\r\n $query_string .= \"WHERE \";\r\n $query_string .= \"username = :username\";\r\n\r\n return $query_string;\r\n}", "function selectAccountById($id) {\n $connection = openDb();\n\n //Using prepared statements:\n $id = (int) $id;\n $sql = \"SELECT * FROM accounts WHERE ID = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"i\",$id);\n\n return executeQueryPrepared($stmt, $connection, true);\n}", "function getUserName($id)\n {\n $db=Factory::getDatabase('slave');\n $db->query(\"select name from test WHERE id=$id limit 1\");\n }", "function getByID($table,$field,$value);", "function executeQuery($param,$id)\n {\n\n $consulta =\"SELECT $param from usuario where id='$id'\";\n if($resultado= $this->conexion->query($consulta)){ \n if ( $resultado->num_rows!=0 ) {\n while($fila= $resultado->fetch_assoc())\n {\n\n return $fila[\"$param\"] ;\n }//return $resultado->fetch_row();\n $resultado->close();\n }else\n { \n }\n $conexion->close();\n }\n\n }", "function getbyid($id){\n\t\t$this->db->where ('id', $id, \"=\");\n\t\t$res = $this->db->getOne('admin');\n\t\treturn $res;\n\t}", "function get_user_booking_using_id($user_id){\n global $db;\n $sql = \"SELECT * FROM booking WHERE user_id = '$user_id'\";\n $result = $db->query($sql)->fetch();\n return $result;\n}", "static function select($id = 0){\n $query = \"SELECT * FROM users where id = '$id' \";\n $pdo = new Connection();\n $pdo = $pdo->open();\n $results = $pdo->query($query);\n $rows = [];\n foreach($results->fetchAll() as $row){\n $rows[] = new User($row['username'], $row['password'], $row['id']);\n }\n return $rows;\n }", "public function getUserById($id){\n // Query for the user.\n $this->db->query('SELECT * FROM users WHERE id = :id');\n // Bind the values.\n $this->db->bind(':id', $id);\n // Return the row. \n $row = $this->db->single();\n\n return $row;\n }", "public function getstudentById ($student_number){\n $sqlQuery = \" SELECT * \";\n $sqlQuery .= \" FROM students \";\n $sqlQuery .= \" WHERE student_number=’ $student_number ’ \";\n $result = $this -> getDbManager () -> executeSelectQuery ( $sqlQuery );\n return ( $result );\n }", "public function selectUserbyId($id){\r\n\r\n $query = 'SELECT * FROM user_tbl WHERE id = ?';\r\n $stmt = $this->_db->prepare($query);\r\n $stmt->execute([$id]);\r\n $users = $stmt->fetchAll(PDO::FETCH_OBJ);\r\n if ($stmt->rowCount()){\r\n return $users;\r\n }\r\n\r\n }", "public static function query( $id ) {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"SELECT * FROM users WHERE id = ?\");\n\t\t$stmt->setFetchMode(PDO::FETCH_INTO, new User(null));\n\t\tif ($stmt->execute(array($id)))\n\t\t\treturn $stmt->fetch();\n\t\telse\n\t\t\treturn null;\n\t}", "public function getId($id){\n\t\t$query = $this->db->select()->from($this->tb)->where('idusers','=',\"$id\")->getOne();\n\t\treturn $query;\n\t}", "public function getUpdatedUserID()\r\n{\r\n $query_string = \"SELECT userid FROM users \";\r\n $query_string .= \"WHERE userid != :userid AND username = :username\";\r\n\r\n return $query_string;\r\n}", "function bd_usuarios_hash($id){\n return sql2value(\"\n SELECT clave\n FROM usuarios\n WHERE id LIKE '{$id}'or email LIKE '{$id}'\n LIMIT 1;\n \");\n}", "function recupereUser(PDO $bdd, $id)\r\n{\r\n $query = $bdd->prepare('SELECT * FROM utilisateur WHERE id = :id ');\r\n $query->bindValue(':id', $id);\r\n $query->execute();\r\n return $query->fetch();\r\n}", "function get_by_user_id($id){\n $id = (int)$id; //this is typecasting - if on the off chance a string got in here instead of a number, it will force it to be a number (SQL injection prevention), stored in $id\n $sql = \"SELECT * FROM posts WHERE user_id = '$id'\"; //change from users to posts for this case if copied from users\n\n $posts = $this->select($sql); //sql only brings back one from database, so we need to put a number\n\n return $posts; //brings it back\n}", "function getUserNameById($id) {\n global $pdo;\n $statement = $pdo->prepare('SELECT `firstname`, `lastname` FROM `user` WHERE `id` = :id');\n $statement->bindParam(\":id\", $id);\n $statement->execute();\n return $statement->fetch(PDO::FETCH_ASSOC);\n}", "function get_user_by_userid($db, $userid)\n{\n\n\t$sql = 'SELECT * FROM users where id='.$userid;\n\t$st = $db->prepare($sql);\n\t$st->execute();\n\t$us = $st->fetchAll();\n\treturn $us[0];\n}", "function get_user_by_user_id($user_id)\n{\n global $conn;\n $q['query'] = \"SELECT * FROM `user_master` WHERE `user_id`='$user_id'\";\n $q['run'] = $conn->query($q['query']);\n $q['result'] = $q['run']->fetch_assoc();\n\n return $q['result'];\n}", "function findbyid(){\r\n $conn=$this->connect();\r\n $id = $conn -> real_escape_string($this->id);\r\n $sql=\"SELECT * FROM quanly WHERE id = '$id'\";\r\n $result=$conn -> query($sql);\r\n $conn->close();\r\n return $result;\r\n }", "function getById($id, $table) {\n $sql = \"select * from {$table} where id = {$id}\";\n\n try {\n if(is_numeric($id))\n DB::select($sql);\n else\n throw new Exception(\"Only accepts numbers\");\n } catch(Exception $e) {\n echo \"Error: {$e->getMessage()}\";\n }\n }", "function mysql_auth_user_id($username)\n{\n return dbFetchCell(\"SELECT `user_id` FROM `users` WHERE `username` = ?\", array($username));\n}", "public function findBy($key,$value){ \n $arraytoret = array();\n $query='select *\n from Usuario\n where '.$key.'='.$value;\n $results = $this->driver->exec($query);\n return $this->factory($results);\n}", "public function getUserById($id){\n $this->db->query('SELECT * FROM users WHERE us_id = :id');\n // Bind values\n $this->db->bind(':id', $id);\n $row = $this->db->single();\n return $row;\n\n }", "public function foobar()\n {\n $result = $this->db->query_params(\"SELECT field FROM table WHERE something = $1 and something_else = $2\", array('foo', 'bar'));\n // use $result as usual ...\n }", "public function selectById($id) {\n\t\t//$stmt = $this->pdo->prepare($sql);\n\t\t//$stmt->bindValue(':id', $id);\n\t\t//$stmt->execute();\n\t\t//return $stmt->fetch(PDO::FETCH_ASSOC);\n\t}", "public function selectById($id);", "public function selectById($id);", "function userNameGet(PDO $db, $id)\n{\n $sql = \"SELECT name FROM users WHERE id = :id\";\n\n $stmt = $db->prepare($sql); \n $stmt->bindParam(':id', $id, PDO::PARAM_INT); \n $stmt->execute();\n $name=$stmt->fetch(PDO::FETCH_NUM);\n\n return $name;\n}", "function sqli($get = 1)\n{\n try {\n $db = new PDO('mysql:dbname=test;host=localhost;charset=UTF8', 'root', '071293');\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch (PDOException $pe) {\n echo $pe->getMessage();\n }\n\n $sql = \"SELECT * from test where id={$get}\";\n $stmt = $db->query($sql);\n\n var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));\n}", "function Get_data_byid($table,$where = '') {\n\t\treturn $this->db->query(\"SELECT * from $table $where;\");\t\n\t}", "function select($item,$table,$s_cul=0,$value=0){\r\n global $con;\r\n $query=$con->prepare(\"SELECT $item FROM $table where $s_cul=? \");\r\n $query->execute(array($value));\r\n $content=$query->fetchall();\r\n return $content;\r\n}", "function getUsername($id) { // Returns name of user with given id\n\t$id = intval($id);\n\treturn(dbFirstResult(\"SELECT username FROM users WHERE id=$id\"));\n}", "function select($id)\n{\n\n$sql = \"SELECT * FROM test WHERE id = $id;\";\n$result = $this->database->query($sql);\n$result = $this->database->result;\n$row = mysql_fetch_object($result);\n\n\n$this->id = $row->id;\n\n$this->name = $row->name;\n\n$this->vorname = $row->vorname;\n\n$this->adresse = $row->adresse;\n\n$this->telefon = $row->telefon;\n\n$this->jahr = $row->jahr;\n\n}", "function getUserById($id) {\n\t$result = mysql_query(\"SELECT userId, email, password FROM users where userId = $id\");\n\t$row = mysql_fetch_array($result, MYSQL_ASSOC);\n\tmysql_free_result($result);\n\treturn $row;\n}", "function findById($id){\n\t\tUtilidades::_log(\"findById($id)\");\n\t\t$query = \"SELECT id,name,account,surnames,email,pass,address,access\n\t\t\t\t\tFROM user WHERE id = $id\";\n\t\t$row = DB::ejecutarConsulta($query);\n\t\t\n\t\treturn new UserDAO($row[0]);\n\t}", "public function checkUserPassword()\r\n{\r\n $query_string = \"SELECT userid, username, password \";\r\n $query_string .= \"FROM users \";\r\n $query_string .= \"WHERE \";\r\n $query_string .= \"userid = :userid AND \";\r\n $query_string .= \"username = :username\";\r\n\r\n return $query_string;\r\n}", "public function getQueryBy($param, $value)\r\n {\r\n return $this->db\r\n ->select('*')\r\n ->from('semestre s')\r\n ->where($param, $value)\r\n ->get();\r\n }", "function SelectByIdFrom_UserDetails($dbhandle, $id, &$user)\n{\n $logger = LoggerSingleton::GetInstance();\t\n $logger->LogInfo(\"SelectByIdFrom_UserDetails : Enter ($id)\");\n\n global $UserDetailsTable_Id;\n global $UserDetailsTable_Name;\n global $UserDetailsTable_UserName;\n \n // select\n $query = \"SELECT * FROM $UserDetailsTable_Name\n WHERE $UserDetailsTable_Id = $id\";\n\n // execte\n $result = $dbhandle->query($query);\n\n if(FALSE == $result)\n {\n $logger->LogError(\"SelectByIdFrom_UserDetails : No records with id - $id found\");\n $status = false;\n }\n\n $num_rows = $result->num_rows;\n if($num_rows > 0)\n {\n while($row = $result->fetch_assoc())\n {\n $user = $row[\"$UserDetailsTable_UserName\"];\n }\n\n $status = true;\n } \n else\n {\n $logger->LogError(\"SelectByIdFrom_UserDetails : No records found\");\n $status = false;\n }\n\n return $status;\n}", "function get_user_by_id($user_id) {\n// echo $user_id; die;\n $this->db->select(\"*\", false);\n $this->db->where(\"id\", $user_id);\n $query = $this->db->get($this->user_table);\n $result = $query->row_array();\n// pr($result); die;\n return $result;\n }", "function select_by_id($tbl, $cols='*', $value=null, $id='id', $limit=1){\n $where = 1;\n if(isset($value)) $where=\"$id='$value'\";\n $sql = \"SELECT $cols FROM $tbl WHERE $where LIMIT $limit\";\n $result = $this->execute($sql) or $this->error($sql);\n $row = $this->next($result,'{}');\n return $row;\n }", "function getUserid($username) {\n\t$username = dbEscape($username);\n\treturn(dbFirstResult(\"SELECT id FROM users WHERE username='$username'\"));\n}", "function getUserById($user_id) {\n $query = \"SELECT * FROM users_account WHERE userid = ?\";\n $paramType = \"i\";\n $paramValue = array(\n $user_id\n );\n \n $result = $this->db_handle->runQuery($query, $paramType, $paramValue);\n return $result;\n }", "public function getSystemId()\r\n{\r\n $query_string = \"SELECT systemid FROM voting_system \";\r\n $query_string .= \"WHERE systemname = :systemname\";\r\n\r\n return $query_string;\r\n\r\n}", "function verifiRentsDetails($id)\n{\n\n $requete = \"SELECT idSnow FROM rentsdetails where idSnow='$id';\";\n $request = executeQuery($requete);\n\n\n return $request;\n}", "public function getUser($id){\n \t$sql = \"select * from `usuarios` where `id` = '$id'\";\n \t$result = parent::executaQuery($sql);\n $row = mysqli_fetch_object ( $result );\n return $row;\n }", "public function userbyid($id)\n {\n $sql=\"SELECT * FROM users where id='$id'\";\n\t $result = $this->db->query($sql);\n\t return $result->row();\n \n }", "public function __construct2($field_in_user_table,$value ) {\n\t\t$query=\"SELECT id from users where $field_in_user_table ='$value'\";\n\t\t$query_run=mysql_fetch_assoc(mysql_query($query));\n\t\tif($query_run)\n\t\t$this->user_id=$query_run[\"id\"];\t\n\t\telse\n\t\t{\n\t\techo 'No such user has been found !!';\n\t\texit();\n\t\t}\n\t}", "public function query($query= \"SELECT * FROM users_test\"){\n$result= mysqli_query($this->connection, $query);\nwhile ($row= mysqli_fetch_assoc($result)) {\n\techo \"ID=\" . $row['id'] . \"<br>\" ;\n\techo \"FIRST NAME=\" . $row['first_name'] . \"<br>\" ;\n\techo \"LAST NAME=\" . $row['last_name'] . \"<br>\" ;\n\techo \"USERNAME=\" . $row['username'] . \"<br>\" ;\n\techo \"PASSWORD=\" . $row['password'] . \"<br><br>\" ;\n\t\n}\n}", "public function readByUser(){\n //select all query\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE id_user=:id_user\";\n\n //perpare query\n $stmt = $this->conn->prepare($query);\n\n //sanitize\n $this->id_user=htmlspecialchars(strip_tags($this->id_user));\n\n //bind given value\n $stmt->bindparam(\":id_user\", $this->id_user);\n\n $stmt->execute();\n\n return $stmt;\n }", "function user_details_id ($id)\n\t\t{\n\t\t $query = \"select * from user_details where id = $id \" ; \n\t\t\t$data = mysql_query($query) ;\n\t\t\treturn $data ; \n\t\t}", "public function getUserRole()\r\n{\r\n $query_string = \"SELECT role FROM users \";\r\n $query_string .= \"WHERE userid = :userid\";\r\n\r\n return $query_string;\r\n}", "function get_user_by_id($id) {\r\n\t\t$query = $this->db->query('SELECT user_fname, user_lname, user_email\r\n\t\t\t\t\t\t\t\t\tFROM user\r\n\t\t\t\t\t\t\t\t\tWHERE user_id = '.$id.'');\r\n\t\treturn $query->result();\r\n\t}", "function get($id) {\n $tablename = $this->table_name;\n $query = \"SELECT * from \".$tablename.\" WHERE id='\".$id.\"';\";\n // prepare query statement\n if(!($result = mysqli_query($this->conn, $query))) {\n echo \"Could not execute query!<br>\";\n echo(\"Error description: \" . mysqli_error($this->conn));\n die(mysqli_error($this->conn));\n } else {\n return $result;\n }\n }", "function get_by_id($id) {\r\n $this->db->where('id', $id);\r\n return $this->db->get($this->tbl);\r\n }", "public static function findById($id)\n {\n $_id = \"'\".$id.\"'\";\n $qb = new QB;\n $qb->conn = static::getDB();\n $results = $qb->select('users', '*')\n ->where('id', '=', $_id)\n ->all();\n return $results;\n }", "public function findUserById()\n {\n $this->db->query('SELECT * FROM user WHERE id = :id');\n $this->db->bind(':id', $_SESSION['id']);\n \n $row = $this->db->single();\n \n return $row; \n }", "function fetchUserDetails($username=NULL,$token=NULL, $id=NULL){\n\tif($username!=NULL) {\n\t\t$column = \"username\";\n\t\t$data = $username;\n\t}elseif($id!=NULL) {\n\t\t$column = \"id\";\n\t\t$data = $id;\n\t}\n\t$db = DB::getInstance();\n\t$query = $db->query(\"SELECT * FROM users WHERE $column = $data LIMIT 1\");\n\t$results = $query->first();\n\treturn ($results);\n}", "function getUserFromDatabase($id)\n {\n $connect = new Config();\n $sql = 'SELECT * FROM user_db WHERE id = :id';\n $query = $connect->connectPDO()->prepare($sql);\n $query->bindParam(':id', $id, \\PDO::PARAM_INT);\n $query->execute();\n\n if ($user = $query->fetch(PDO::FETCH_ASSOC)) {\n return $user;\n } else {\n $_SESSION['error'] = ['No Such User Found'];\n }\n }", "function userFound($id)\n{\n global $conn;\n $stmt = $conn->prepare(\"SELECT * FROM users WHERE _id = '$id' ;\");\n $stmt->execute();\n $c = $stmt->rowCount();\n if ($c == 0) return \"not found\";\n return \"found\";\n}", "function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }", "function find_by_id($table,$id)\n{\n global $db;\n $id = (int)$id;\n if(tableExists($table)){\n $sql = $db->query(\"SELECT * FROM {$db->escape($table)} WHERE id='{$db->escape($id)}' LIMIT 1\");\n if($result = $db->fetch_assoc($sql))\n return $result;\n else\n return null;\n }\n}", "function find_by_id($table,$id)\n{\n global $db;\n $id = (int)$id;\n if(tableExists($table)) \n {\n /*\n $sql_result = $db->query(\"SELECT * FROM {$db->escape($table)} WHERE id='{$db->escape($id)}' LIMIT 1\");\n */\n $sql = \"SELECT * FROM \".$db->escape($table);\n $sql .= \" WHERE id=\".$db->escape($id);\n $sql .= \" LIMIT 1\";\n $sql_result = $db->query($sql);\n if( $result = $db->fetch_assoc($sql_result) )\n return $result;\n else\n return NULL;\n }\n else\n return NULL;\n}" ]
[ "0.7311796", "0.7254414", "0.7205307", "0.7173036", "0.71542346", "0.7068461", "0.70552593", "0.70499516", "0.69363374", "0.6933564", "0.6882222", "0.6797566", "0.6788", "0.6763899", "0.6757955", "0.6747805", "0.67220175", "0.6644879", "0.66435224", "0.6618483", "0.6613553", "0.6598315", "0.656966", "0.65695035", "0.65415716", "0.65370554", "0.6522101", "0.6512593", "0.65110415", "0.65081316", "0.65061927", "0.65026", "0.6479921", "0.64775956", "0.6468201", "0.6438042", "0.64374983", "0.6403711", "0.63741213", "0.6361539", "0.6351161", "0.63413244", "0.62715244", "0.62702703", "0.6269586", "0.62693655", "0.6267855", "0.62636137", "0.62558746", "0.625376", "0.62535405", "0.6251042", "0.6242823", "0.62420857", "0.62325907", "0.6231731", "0.6227833", "0.6220916", "0.619968", "0.6197801", "0.6195128", "0.61920834", "0.6189443", "0.6166407", "0.6157567", "0.6157567", "0.6143814", "0.6133874", "0.6128586", "0.61184955", "0.6098034", "0.60945284", "0.60936874", "0.60930634", "0.6092827", "0.6079468", "0.60767937", "0.60749", "0.6068788", "0.60586905", "0.60502017", "0.6040537", "0.6035088", "0.6032898", "0.601982", "0.6009916", "0.6005813", "0.59952515", "0.5993936", "0.5993437", "0.59909207", "0.5989671", "0.5988486", "0.5979531", "0.59793967", "0.5974116", "0.5968281", "0.59655476", "0.59539473", "0.5953725", "0.59462523" ]
0.0
-1
/ $query = $this>db>query("SELECT PACKAGE., group_concat(DISTINCT PACKFILE.imagepath order by PACKFILE.imagepath separator ',' ) AS packageImages, group_concat(DISTINCT LOCFILE.imagepath order by LOCFILE.imagepath separator ',' ) AS locationImages, group_concat(DISTINCT LOCAMENITIES.name order by LOCAMENITIES.name separator ',' ) AS locstionamineties, group_concat(DISTINCT PACKAMENITIES.name order by PACKAMENITIES.name separator ',' ) AS packaageamineties FROM `package` AS PACKAGE LEFT JOIN packageimage AS PACKIMAGE ON PACKIMAGE.package = PACKAGE.id LEFT JOIN file AS PACKFILE ON PACKFILE.id = PACKIMAGE.file LEFT JOIN location AS LOC ON LOC.id=PACKAGE.location LEFT JOIN address AS ADDRESS ON ADDRESS.id = LOC.locationaddress LEFT JOIN locationimage AS LOCIMAGE ON LOCIMAGE.location = LOC.id LEFT JOIN file AS LOCFILE ON LOCFILE.id = LOCIMAGE.id LEFT JOIN locationamenities AS LOCAMENITIESMAP ON LOCAMENITIESMAP.location = LOC.id LEFT JOIN amenities AS LOCAMENITIES ON LOCAMENITIES.id = LOCAMENITIESMAP.amenities LEFT JOIN packageamenities AS PACKMENITIESMAP ON PACKMENITIESMAP.package = PACKAGE.id LEFT JOIN amenities AS PACKAMENITIES ON PACKAMENITIES.id = PACKMENITIESMAP.amenities"); return $query>result_array();
function get_package_details($dis) { $this->db->select('package.*,package.id as packid,location.*,address.*,cities.*,file.* '); $this->db->from('package'); $this->db->join('cities', 'cities.c_id = package.location'); $this->db->join('address', 'address.city = cities.c_id'); $this->db->join('location', 'address.id = location.locationaddress'); // $this->db->join('packageimage','packageimage.package = package.id'); $this->db->join('file', 'file.id = package.thumbnailimage'); $this->db->where('cities.c_id', $dis); $query = $this->db->get(); $row = $query->result_array(); // echo $this->db->last_query();exit; return $row; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_all_package_details($dis)\n {\n $query = $this->db->query(\"SELECT \n PACKAGE.*, group_concat(DISTINCT PACKFILE.imagename order by PACKFILE.imagename separator ',' ) AS packageImages,\n group_concat(DISTINCT LOCFILE.imagepath order by LOCFILE.imagepath separator ',' ) AS locationImages,\n group_concat(DISTINCT LOCAMENITIES.name order by LOCAMENITIES.name separator ',' ) AS locstionamineties, \n group_concat(DISTINCT PACKAMENITIES.name order by PACKAMENITIES.name separator ',' ) AS packaageamineties \n FROM `package` AS PACKAGE \n LEFT JOIN packageimage AS PACKIMAGE ON PACKIMAGE.package = PACKAGE.id \n LEFT JOIN file AS PACKFILE ON PACKFILE.id = PACKIMAGE.file \n LEFT JOIN location AS LOC ON LOC.id=PACKAGE.location \n LEFT JOIN address AS ADDRESS ON ADDRESS.id = LOC.locationaddress \n LEFT JOIN locationimage AS LOCIMAGE ON LOCIMAGE.location = LOC.id \n LEFT JOIN file AS LOCFILE ON LOCFILE.id = LOCIMAGE.id \n LEFT JOIN locationamenities AS LOCAMENITIESMAP ON LOCAMENITIESMAP.location = LOC.id LEFT JOIN amenities AS LOCAMENITIES ON LOCAMENITIES.id = LOCAMENITIESMAP.amenities LEFT JOIN packageamenities AS PACKMENITIESMAP ON PACKMENITIESMAP.package = PACKAGE.id \n LEFT JOIN amenities AS PACKAMENITIES ON PACKAMENITIES.id = PACKMENITIESMAP.amenities WHERE PACKAGE.id =$dis\");\n return $query->result_array();\n }", "function get_all_package_details_admin($dis)\n {\n $query = $this->db->query(\"SELECT \n PACKAGE.*,LOC.id AS locationId, PACKAGE.id as ped, group_concat(DISTINCT PACKFILE.imagename order by PACKFILE.imagename separator ',' ) AS packageImages,\n group_concat(DISTINCT LOCFILE.imagepath order by LOCFILE.imagepath separator ',' ) AS locationImages,\n group_concat(DISTINCT LOCAMENITIES.name order by LOCAMENITIES.name separator ',' ) AS locstionamineties, \n group_concat(DISTINCT PACKAMENITIES.name order by PACKAMENITIES.name separator ',' ) AS packaageamineties \n FROM `package` AS PACKAGE \n LEFT JOIN packageimage AS PACKIMAGE ON PACKIMAGE.package = PACKAGE.id \n LEFT JOIN file AS PACKFILE ON PACKFILE.id = PACKIMAGE.file \n LEFT JOIN location AS LOC ON LOC.id=PACKAGE.location \n LEFT JOIN address AS ADDRESS ON ADDRESS.id = LOC.locationaddress \n LEFT JOIN locationimage AS LOCIMAGE ON LOCIMAGE.location = LOC.id \n LEFT JOIN file AS LOCFILE ON LOCFILE.id = LOCIMAGE.id \n LEFT JOIN locationamenities AS LOCAMENITIESMAP ON LOCAMENITIESMAP.location = LOC.id LEFT JOIN amenities AS LOCAMENITIES ON LOCAMENITIES.id = LOCAMENITIESMAP.amenities LEFT JOIN packageamenities AS PACKMENITIESMAP ON PACKMENITIESMAP.package = PACKAGE.id \n LEFT JOIN amenities AS PACKAMENITIES ON PACKAMENITIES.id = PACKMENITIESMAP.amenities WHERE PACKAGE.id = $dis\");\n return $query->result_array();\n }", "function get_all_package_details_view($dis)\n {\n $query = $this->db->query(\"SELECT \n PACKAGE.*, group_concat(DISTINCT PACKFILE.imagename order by PACKFILE.imagename separator ',' ) AS packageImages,\n group_concat(DISTINCT LOCFILE.imagepath order by LOCFILE.imagepath separator ',' ) AS locationImages,\n group_concat(DISTINCT LOCAMENITIES.name order by LOCAMENITIES.name separator ',' ) AS locstionamineties, \n group_concat(DISTINCT PACKAMENITIES.name order by PACKAMENITIES.name separator ',' ) AS packaageamineties \n FROM `package` AS PACKAGE \n LEFT JOIN packageimage AS PACKIMAGE ON PACKIMAGE.package = PACKAGE.id \n LEFT JOIN file AS PACKFILE ON PACKFILE.id = PACKIMAGE.file \n LEFT JOIN location AS LOC ON LOC.id=PACKAGE.location \n LEFT JOIN address AS ADDRESS ON ADDRESS.id = LOC.locationaddress \n LEFT JOIN locationimage AS LOCIMAGE ON LOCIMAGE.location = LOC.id \n LEFT JOIN file AS LOCFILE ON LOCFILE.id = LOCIMAGE.id \n LEFT JOIN locationamenities AS LOCAMENITIESMAP ON LOCAMENITIESMAP.location = LOC.id LEFT JOIN amenities AS LOCAMENITIES ON LOCAMENITIES.id = LOCAMENITIESMAP.amenities LEFT JOIN packageamenities AS PACKMENITIESMAP ON PACKMENITIESMAP.package = PACKAGE.id \n LEFT JOIN amenities AS PACKAMENITIES ON PACKAMENITIES.id = PACKMENITIESMAP.amenities where PACKAGE.id=$dis\");\n return $query->result_array();\n }", "function get_location_package_detail()\n {\n $this->db->select('package.*,package.id as packid,location.*,address.*,cities.*,file.* ');\n $this->db->from('package');\n $this->db->join('cities', 'cities.c_id = package.location');\n $this->db->join('address', 'address.city = cities.c_id');\n $this->db->join('location', 'address.id = location.locationaddress');\n // $this->db->join('packageimage','packageimage.package = package.id');\n $this->db->join('file', 'file.id = package.thumbnailimage');\n // $this->db->where('cities.c_id', $dis);\n $query = $this->db->get();\n $row = $query->result_array(); // echo $this->db->last_query();exit;\n return $row;\n }", "function getallepics()\n {\n //$allepics = \"SELECT * from epics\";\n $allepics= \"SELECT e.*,staff.*,epics_statuses.name as epicsname,team.name as teamname\n FROM epics AS e\n LEFT JOIN epics_statuses AS epics_statuses ON epics_statuses.id = e.e_status_id\n LEFT JOIN team AS team ON team.id = e.team_id\n LEFT JOIN staff AS staff ON staff.staff_id = e.e_owner\"; \n $allepicsresult = $this->ds->select($allepics); \n //print_r($myepicsresult);\n return $allepicsresult;\n }", "function getallproducts($warehouseid){\n \n $result = $this->db->query(\"SELECT a.*, \n b.id AS productid, b.`name` AS productname, b.`main_image` AS productimage, \n b.`price` AS product_price, b.`tax` AS product_tax, b.`description` AS product_description, b.`move_product_id` AS productuniqueid_forimages,\n c.`name` AS cat_name, c.`image` AS cat_image, d.`name` AS subcat_name, d.`image` AS subcat_image\n FROM warehouse_products a LEFT JOIN products b ON a.product=b.`id` LEFT JOIN category c ON b.`category_id` = c.`category_id` LEFT JOIN category d \n ON b.`sub_category_id` = d.`category_id` WHERE a.`warehouse` = \".$warehouseid.\" ORDER BY c.`name`, d.`name`\")->result();\n return $result;\n \n }", "function get_mapping() {\n\n\n $query = $this->db->query('SELECT\n A.map_id\n ,C1.stage_title AS place_name\n ,C2.stage_title AS dress_name\n ,C3.stage_title AS crown_name\n ,C4.stage_title AS stage_name\n ,C5.stage_title AS props_name\n ,B.character_name AS char_name \n ,A.image_path \nFROM mapping AS A\nINNER JOIN stage AS C1\n ON A.place_id = C1.id\nINNER JOIN stage AS C2\n ON A.dress_id = C2.id\n\n INNER JOIN stage AS C3\n ON A.crown_id = C3.id\n\n INNER JOIN stage AS C4\n ON A.stage_id = C4.id\n \n INNER JOIN stage AS C5\n ON A.props_id = C5.id\n\nINNER JOIN napoleon_characters AS B ON A.character_id = B.character_id');\n\n// $this->db->where('id', $intid);\n// $query = $this->db->get();\n// echo \"<pre>\";\n// print_r($query->result_array());\n// die;\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n else {\n return array();\n }\n }", "function getallproducts1($warehouseid){\n \n\n $products = $this->db->query(\"SELECT a.*, \n b.id AS productid, \n b.`name` AS productname, \n b.`main_image` AS productimage, \n b.`price` AS product_price, \n b.`tax` AS product_tax, \n b.`description` AS product_description, \n b.`move_product_id` AS productuniqueid_forimages,\n c.`name` AS cat_name, \n c.`image` AS cat_image, \n c.`category_id` AS category_id,\n d.`category_id` AS subcategory_id,\n d.`name` AS subcat_name, \n d.`image` AS subcat_image,\n d.`parent_id` AS parent_id,\n d.`shared_category` AS shared_category \n FROM warehouse_products a \n LEFT JOIN products b ON a.product=b.`id` \n LEFT JOIN category c ON b.`category_id` = c.`category_id` \n LEFT JOIN category d \n ON b.`sub_category_id` = d.`category_id` \n WHERE a.`warehouse` = \".$warehouseid.\" \n ORDER BY c.`name`, d.`name`\")->result();\n \n $sharedproducts=array();\n foreach($products as $product){\n if($product->shared_category !=null)\n array_push($sharedproducts, $product);\n }\n \n \n if(sizeof($products)>0){\n \n $this->db->query(\"TRUNCATE TABLE `tb_filteredproducts`\");\n \n foreach($products as $row) {\n $categoryimage=$row->cat_image;\n $imageheight=\"\";\n $imagewidth=\"\";\n if(strlen($categoryimage)>0){\n list($width, $height, $type, $attr) = getimagesize(\"https://mcflydelivery.com/public/uploads/category/thumbnail/\".$categoryimage);\n $imageheight=$height;\n $imagewidth=$width;\n }\n \n $query = \"INSERT INTO `tb_filteredproducts` set \n `id` = '\".$row->id.\"',\n `warehouse` = '\".$row->warehouse.\"',\n `product` = '\".$row->product.\"',\n `quantity` = '\".$row->quantity.\"',\n `min_capacity` = '\".$row->min_capacity.\"',\n `max_capacity` = '\".$row->max_capacity.\"',\n `avail_qty` = '\".$row->avail_qty.\"',\n `created_at` = '\".$row->created_at.\"',\n `updated_at` = '\".$row->updated_at.\"',\n `productid` = '\".$row->productid.\"',\n `productname` = '\".str_replace(\"'\",\"\",$row->productname).\"',\n `productimage` = '\".$row->productimage.\"',\n `product_price` = '\".$row->product_price.\"',\n `product_tax` = '\".$row->product_tax.\"',\n `product_description` = '\".$row->product_description.\"',\n `productuniqueid_forimages` = '\".$row->productuniqueid_forimages.\"',\n `cat_name` = '\".$row->cat_name.\"',\n `cat_image` = '\".$row->cat_image.\"',\n `cat_imageheight` = '\".$imageheight.\"',\n `cat_imagewidth` = '\".$imagewidth.\"',\n `category_id` = '\".$row->category_id.\"',\n `subcat_name` = '\".$row->subcat_name.\"',\n `subcategory_id` = '\".$row->subcategory_id.\"',\n `subcat_image` = '\".$row->subcat_image.\"',\n `parent_id` = '\".$row->parent_id.\"',\n `shared_category` = '\".$row->shared_category.\"';\";\n \n $this->db->query($query);\n \n }\n \n foreach($sharedproducts as $shared_product){ // for one shared product\n $sharedcategory_array= array();\n $sharedcategory_array=explode(\",\",$shared_product->shared_category);\n // print_r($shared_product);\n foreach($sharedcategory_array as $oneshared_category){\n if($oneshared_category !=$shared_product->category_id){ // if the shared category id item is not same with table id(current setted category id)\n // echo $oneshared_category;\n \n $selected_category_objectarray_from_categorytable = $this->db->where('category_id', $oneshared_category)->get('category')->result();\n \n if(sizeof($selected_category_objectarray_from_categorytable)>0){ // if the shared category is not deleted from category table\n $selected_category_object_from_categorytable=$selected_category_objectarray_from_categorytable[0];\n \n $categoryimage=$selected_category_object_from_categorytable->image;\n $imageheight=\"\";\n $imagewidth=\"\";\n if(strlen($categoryimage)>0){\n list($width, $height, $type, $attr) = getimagesize(\"https://mcflydelivery.com/public/uploads/category/thumbnail/\".$categoryimage);\n $imageheight=$height;\n $imagewidth=$width;\n }\n \n $query = \"INSERT INTO `tb_filteredproducts` set \n `id` = '\".$shared_product->id.\"',\n `warehouse` = '\".$shared_product->warehouse.\"',\n `product` = '\".$shared_product->product.\"',\n `quantity` = '\".$shared_product->quantity.\"',\n `min_capacity` = '\".$shared_product->min_capacity.\"',\n `max_capacity` = '\".$shared_product->max_capacity.\"',\n `avail_qty` = '\".$shared_product->avail_qty.\"',\n `created_at` = '\".$shared_product->created_at.\"',\n `updated_at` = '\".$shared_product->updated_at.\"',\n `productid` = '\".$shared_product->productid.\"',\n `productname` = '\".str_replace(\"'\",\"\",$shared_product->productname).\"',\n `productimage` = '\".$shared_product->productimage.\"',\n `product_price` = '\".$shared_product->product_price.\"',\n `product_tax` = '\".$shared_product->product_tax.\"',\n `product_description` = '\".$shared_product->product_description.\"',\n `productuniqueid_forimages` = '\".$shared_product->productuniqueid_forimages.\"',\n `cat_name` = '\".$selected_category_object_from_categorytable->name.\"',\n `cat_image` = '\".$selected_category_object_from_categorytable->image.\"',\n `cat_imageheight` = '\".$imageheight.\"',\n `cat_imagewidth` = '\".$imagewidth.\"',\n `category_id` = '\".$selected_category_object_from_categorytable->category_id.\"',\n `subcat_name` = '\".$shared_product->subcat_name.\"',\n `subcategory_id` = '\".$shared_product->subcategory_id.\"',\n `subcat_image` = '\".$shared_product->subcat_image.\"',\n `parent_id` = '\".$shared_product->parent_id.\"',\n `shared_category` = '\".$shared_product->shared_category.\"';\";\n \n $this->db->query($query);\n \n \n }\n }\n }\n } \n \n } \n \n \n $result = $this->db->query(\"SELECT * FROM `tb_filteredproducts` ORDER BY cat_name, subcat_name\")->result();\n return $result;\n }", "function join_product_table(){\n global $db;\n $sql =\" SELECT p.id,p.name,p.keywords,p.quantity,p.url,p.buy_price,p.sale_price,p.media_id,p.date,c.name\";\n $sql .=\" AS categorie,m.file_name AS image\";\n $sql .=\" FROM products p\";\n $sql .=\" LEFT JOIN categories c ON c.id = p.categorie_id\";\n $sql .=\" LEFT JOIN media m ON m.id = p.media_id\";\n $sql .=\" ORDER BY p.id ASC\";\n return find_by_sql($sql);\n\n }", "function getPackage(){\n\t\t $query = \"select package.id,package.pkg_cat_id,package.date_created,package.date_updated,package.icon_image,package.package_title,package.package_price,package.number_of_qty,package.slider_desc1,package.slider_image1,packages_category.packages_category_name from package inner join packages_category on package.pkg_cat_id = packages_category.id \";\n\t\t $result = mysql_query($query);\n\t\t if($result){\n\t\t\t$data = array();\n\t\t\twhile($row=mysql_fetch_assoc($result)){\n\t\t\t\t$row['icon_image'] = $row['icon_image'] !==\"\"? $this->Check_exists_img($row['icon_image']) : \"dist/img/boxed-bg.jpg\";\n\t\t\t\t$row['slider_image1'] = $row['slider_image1'] !==\"\"? $this->Check_exists_img($row['slider_image1']) : \"dist/img/boxed-bg.jpg\";\n\t\t\t\t\n\t\t\t\tarray_push($data,$row);\n\t\t\t }\n\t\t\t return $data;\n\t\t }else{\n\t\t\tdie(\"error in mysql query\" . mysql_error());\n\t\t }\n\t\t}", "function projectView($connect, $id) {\n\n\n $query = \"SELECT\n\t\t\t p.`id` AS id_project,\n\t\t\t p.`name`,\n\t\t\t p.description AS `description`,\n\t\t\t GROUP_CONCAT(DISTINCT s.id) AS images,\n\t\t\t s2.id AS title_img\n\t\t\t FROM project AS p\n\t\t\t LEFT JOIN `images` AS s2\n\t\t\t ON p.`id` = s2.`id_project`\n\t\t\t AND s2.is_title = 1\n\t\t\t AND s2.to_arc = 0\n\t\t\t AND s2.on_header = 0\n\t\t\t LEFT JOIN `images` AS s\n\t\t\t ON p.`id` = s.`id_project`\n\t\t\t AND s.is_title = 0\n\t\t\t AND s.to_arc = 0\n\t\t\t AND s.on_header = 0\n\t\t\t WHERE p.`to_arc` = 0\n \t\t AND p.`is_project` = 1\n \t\t\t AND p.id = $id\n\t\t\t GROUP BY p.`id` \";\n\t$query=mysqli_query($connect, $query);\n\n\t$aResult = mysqli_fetch_array($query);\n\n//\t$aResult = explode(\",\",$aResult[\"images\"]);\n\n// if(!$aResult) {\n// DIE(\"Грешка при заявката: \".mysqli_error($connect));\n// }\n return $aResult;\n}", "function immagini_get($id_imm=\"\"){\n $db = new db(DB_USER,DB_PASSWORD,DB_NAME,DB_HOST);\n\t\n\t$q_foto=\"SELECT immagine.* FROM imm_img JOIN immagine on immagine.id_img=imm_img.id_img WHERE imm_img.id_imm =$id_imm ORDER BY `ordine` ASC\";\n \n\t$r_foto=$db->query($q_foto);\n while($row_foto = mysql_fetch_assoc($r_foto))\n {\n $rows_foto[] = $row_foto;\n }\n \n return $rows_foto;\n\n \n}", "public function getProducts(){\n $query = \"SELECT \n products.id,\n products.name,\n products.description,\n products.price,\n images.image_file_name\n FROM products\n INNER JOIN products_images\n ON products.id = products_images.product_id\n INNER JOIN images\n ON products_images.image_id = images.image_id\";\n\n //-----construct query according to parameters supplied\n \n //create an array to pass string eg \"iii\" to bind_param\n $query_param_string = array();\n \n //create an array to pass values to the bind_param\n $query_param_values = array();\n \n //--TOTAL COUNT OF PRODUCTS\n //create an array to pass string eg \"iii\" to count total result\n $query_param_string_count = array();\n //create an array to pass values to to count total result\n $query_param_values_count = array();\n \n //--CATEGORIES\n //if there are categories selected, create a join with products_categories table\n //so we can find products in category or categories\n if( count( $this -> categories ) > 0 ){\n //store the name of the table in variable\n $tbl_products_categories = \"products_categories\";\n \n //string to add to query to join with products_categories table\n $category_join = \" INNER JOIN $tbl_products_categories ON products.id = $tbl_products_categories.product_id \";\n \n $category_query = array();\n foreach( $this -> categories as $cat ){\n //ignore if category = 0\n if( $cat !== 0 ){\n array_push( $category_query, \"$tbl_products_categories.category_id=?\");\n array_push( $query_param_string, \"i\" );\n array_push( $query_param_string_count, \"i\" );\n \n //we need each query param value as a reference\n array_push( $query_param_values, $cat );\n array_push( $query_param_values_count, $cat );\n }\n }\n //implode the categories into a string so we have\n //products_categories.category_id=? OR products_categories.category_id=?\n $cat_query_string = implode( \" OR \", $category_query );\n }\n \n //--PAGE\n //process page variables\n //to use pagination, we need to calculate offset\n //if we have 8 results per page, then offset is calculated using pagenumber $page -1 * perpage\n $offset = ($this -> page-1) * $this -> perpage;\n \n //add offset and limit to query_param_string array and query_param_values\n array_push( $query_param_string , \"i\" );\n array_push( $query_param_values , $this -> perpage );\n array_push( $query_param_string , \"i\" );\n array_push( $query_param_values , $offset );\n \n //add the query_param_string to the beginning of query_param_values\n //so we get the \"iii\" at the beginning of array\n array_unshift( $query_param_values, implode( \"\", $query_param_string ));\n //do the same for the count arrays\n array_unshift( $query_param_values_count, implode(\"\",$query_param_string_count) );\n \n //build the query with category parameters\n $limit = \" LIMIT ? OFFSET ?\";\n \n //add category join\n if( count( $this -> categories) > 0){\n $query = $query . \" \" . $category_join;\n //add category query string\n $query = $query . \" WHERE \" . $cat_query_string . \" AND products.active=1\";\n }\n \n //add grouping and sorting\n $query = $query . \" GROUP BY products.id\";\n //add sorting\n $query = $query . \" ORDER BY products.id ASC\";\n \n //create second query without the limit so we can get total number of products\n //without the pagination and limit (offset creates pages of result, \n //while limit limits the number of products per page)\n $count_query = $query;\n //add limit\n $query = $query . \" \" . $limit;\n \n //send the query to database using prepare\n $statement = $this -> connection -> prepare( $query );\n \n //create references to the array values using &$query_param_values\n //while adding to parameters array\n $parameters_array = array();\n foreach( $query_param_values as $key => $value ){\n $parameters_array[$key] = &$query_param_values[$key];\n }\n //do the same for count \n $parameters_array_count = array();\n foreach( $query_param_values_count as $key => $value ){\n $parameters_array_count[$key] = &$query_param_values_count[$key];\n }\n //use call_user_func_array to pass the array as a parameter to query\n //equivalent of calling bind_param(\"iii\",$var1,$var2,$var3)\n call_user_func_array( array($statement,'bind_param'), $parameters_array );\n \n //execute the query with the parameters\n if( $statement -> execute() ){\n $result = $statement -> get_result();\n //check number of rows in result\n if( $result -> num_rows > 0){\n $products = array();\n while( $row = $result -> fetch_assoc() ){\n $id = $row[\"id\"];\n $name = $row[\"name\"];\n $price = $row[\"price\"];\n $image_file_name = $row[\"image_file_name\"];\n $desc = new \\utilities\\TruncateWords( $row[\"description\"],15 );\n $description = $desc -> words;\n //$description = $row[\"description\"];\n array_push( $products, array( \n \"id\" => $id, \n \"name\" => $name, \n \"price\" => $price,\n \"description\" => $description, \n \"image_file_name\" => $image_file_name \n ) );\n }\n $statement -> close();\n //run the second query $count_query to get total number of products\n $statement = $this -> connection -> prepare($count_query);\n call_user_func_array( array($statement,'bind_param'), $parameters_array_count );\n $statement -> execute();\n $result = $statement -> get_result();\n $total = $result -> num_rows;\n \n $result_array = array();\n $result_array[\"total\"] = $total;\n $result_array[\"categories\"] = $this -> categories;\n $result_array[\"data\"] = $products;\n \n return $result_array;\n }\n else{\n return false;\n }\n }\n else {\n return false;\n }\n $statement -> close();\n }", "public function getDetalles()\n {\n $sql = \"select z.id,z.nombre, z.identificacion, z.estado_excluido, y.descripcion, w.categoria , (SELECT a.monto FROM appexamenisw2.categorias a,\n appexamenisw2.beneficios e, appexamenisw2.estudiantes b, appexamenisw2.beneficio__estudiantes c\n where a.descripcion = 'aeo'\n and b.id = c.estudiante_id\n and e.id = c.beneficio_id\n and a.id = e.categoria_id\n and b.id = z.id) as 'aeo' ,\n (SELECT a.monto FROM appexamenisw2.categorias a,\n appexamenisw2.beneficios e, appexamenisw2.estudiantes b, appexamenisw2.beneficio__estudiantes c\n where a.descripcion = 'alim'\n and b.id = c.estudiante_id\n and e.id = c.beneficio_id\n and a.id = e.categoria_id\n and b.id = z.id) as alim,\n (SELECT a.monto FROM appexamenisw2.categorias a,\n appexamenisw2.beneficios e, appexamenisw2.estudiantes b, appexamenisw2.beneficio__estudiantes c\n where a.descripcion = 'pare'\n and b.id = c.estudiante_id\n and e.id = c.beneficio_id\n and a.id = e.categoria_id\n and b.id = z.id) as pare\n from appexamenisw2.estudiantes z, appexamenisw2.beneficios y, appexamenisw2.categorias w,\n appexamenisw2.beneficio__estudiantes v\n where z.id = v.estudiante_id\n and y.id = v.beneficio_id\n and w.id = y.categoria_id\n group by z.id,z.nombre, z.identificacion, z.id, z.estado_excluido, y.descripcion,w.categoria\n order by z.id;\";\n\n $arrayDetalles = DB::connection('mysql')->select($sql);\n $ab = array();\n $ab = $arrayDetalles;\n foreach($ab as $t){\n $t->aeo = Crypt::decrypt($t->aeo);\n $t->alim = Crypt::decrypt($t->alim);\n $t->pare = Crypt::decrypt($t->pare);\n //$t->categoria = Crypt::decrypt($t->categoria);\n //$t->monto = Crypt::decrypt($t->monto);\n //return $t->monto;\n }\n return json_encode($ab);\n }", "function get_equipos_cat($where=null){\n \n if(!is_null($where)){\n $where='WHERE '.$where;\n }else{\n $where='';\n }\n\n $sql=\"select sub4.uni_acad,trim(d.apellido)||', '||trim(d.nombre) as docente_nombre,d.nro_docum,d.legajo,d.fec_nacim,coalesce(d.correo_institucional,'')||' '|| coalesce(d.correo_personal,'') as correo,sub4.id_designacion,sub4.cat_est,sub4.carac,sub4.desde,sub4.hasta,t_mo.descripcion as modulo,carga_horaria,observacion,case when trim(rol)='NE' then 'Aux' else 'Resp' end as rol,p.descripcion as periodo, dep.descripcion as dep,ar.descripcion as area,t_o.descripcion as ori,case when materia_conj is not null then materia_conj else m.desc_materia||'('||pl.cod_carrera||' de '||pl.uni_acad|| ')' end as desc_materia\n from(select sub2.id_designacion,sub2.id_materia,sub2.id_docente,sub2.id_periodo,sub2.modulo,sub2.carga_horaria,sub2.rol,sub2.observacion,cat_est,dedic,carac,desde,hasta,uni_acad,sub2.id_departamento,sub2.id_area,sub2.id_orientacion,string_agg(sub4.materia,'/') as materia_conj \n from (select distinct * from (\n select distinct upper(trim(m.desc_materia)) as desc_materia,a.anio,b.id_designacion,b.id_docente,d.legajo,a.id_periodo,a.modulo,a.carga_horaria,a.rol,a.observacion,a.id_materia,b.uni_acad,cat_estat||dedic as cat_est,dedic,carac,b.desde,b.hasta,b.id_departamento,b.id_area,b.id_orientacion,case when lic.id_novedad is null then 0 else 1 end as licencia\n from asignacion_materia a\n INNER JOIN materia m ON (m.id_materia=a.id_materia)\n INNER JOIN designacion b ON (a.id_designacion=b.id_designacion)\n INNER JOIN docente d ON (b.id_docente=d.id_docente)\n --esto para saber si esta de licencia dentro del periodo y anio en el que esta designado. Entonces con el filtro puedo descartar a los que no estan ejerciendo\n INNER JOIN mocovi_periodo_presupuestario p ON (a.anio=p.anio)\n LEFT OUTER JOIN ( select t_n.*,extract(year from t_n.desde) as anio\n from novedad t_n \n where t_n.tipo_nov in (1,4,2,3,5)\n ) lic ON (lic.id_designacion = a.id_designacion \n and lic.anio=a.anio \n and ((lic.tipo_nov in (2,3,5) and\n ((a.id_periodo=1 and lic.desde<=to_date(cast(p.anio as text)||'-07-01','YYYY-MM-DD')and lic.hasta>=p.fecha_inicio) or\n (a.id_periodo=2 and lic.desde<=p.fecha_fin and lic.hasta>=to_date(cast(p.anio as text)||'-07-01','YYYY-MM-DD')) or\n ((a.id_periodo=3 or a.id_periodo=4) and lic.desde<=p.fecha_fin and lic.hasta>=p.fecha_inicio )\n )\n ) or\n (\n lic.tipo_nov in (1,4) and \n ((a.id_periodo=1 and lic.desde<=to_date(cast(p.anio as text)||'-07-01','YYYY-MM-DD')and lic.desde>=p.fecha_inicio) or\n (a.id_periodo=2 and lic.desde<=p.fecha_fin and lic.desde>=to_date(cast(p.anio as text)||'-07-01','YYYY-MM-DD')) or\n ((a.id_periodo=3 or a.id_periodo=4) and lic.desde<=p.fecha_fin and lic.desde>=p.fecha_inicio )\n )\n ) ) \n )\n where not (b.hasta is not null and b.hasta<=b.desde)\n )sub1\n \".$where.\" ) sub2 \n LEFT OUTER JOIN \n ( select t_c.id_conjunto,t_p.anio,t_c.id_periodo,t_c.ua,t_e.id_materia\n from en_conjunto t_e,conjunto t_c, mocovi_periodo_presupuestario t_p\n WHERE t_e.id_conjunto=t_c.id_conjunto and t_p.id_periodo=t_c.id_periodo_pres \n )sub3 ON (sub3.ua=sub2.uni_acad and sub3.id_periodo=sub2.id_periodo and sub3.anio=sub2.anio and sub3.id_materia=sub2.id_materia)\n LEFT OUTER JOIN \n (select t_e.id_conjunto,t_e.id_materia,t_m.desc_materia||'('||t_p.cod_carrera||' de '||t_p.uni_acad||')' as materia from en_conjunto t_e,materia t_m ,plan_estudio t_p\n where t_e.id_materia=t_m.id_materia\n and t_p.id_plan=t_m.id_plan)sub4 ON sub4.id_conjunto=sub3.id_conjunto\n group by sub2.id_designacion,sub2.id_materia,sub2.id_docente,sub2.id_periodo,sub2.modulo,sub2.carga_horaria,sub2.rol,sub2.observacion,cat_est,dedic,carac,desde,hasta,uni_acad,sub2.id_departamento,sub2.id_area,sub2.id_orientacion)sub4\n LEFT OUTER JOIN docente d ON d.id_docente=sub4.id_docente\n LEFT OUTER JOIN periodo p ON p.id_periodo=sub4.id_periodo\n LEFT OUTER JOIN modulo t_mo ON sub4.modulo=t_mo.id_modulo\n LEFT OUTER JOIN departamento dep ON dep.iddepto=sub4.id_departamento\n LEFT OUTER JOIN area ar ON ar.idarea=sub4.id_area\n LEFT OUTER JOIN orientacion t_o ON (sub4.id_orientacion=t_o.idorient and ar.idarea=t_o.idarea)\n LEFT OUTER JOIN materia m ON m.id_materia=sub4.id_materia\n LEFT OUTER JOIN plan_estudio pl ON pl.id_plan=m.id_plan\n \n order by desc_materia,periodo,modulo,rol\";\n return toba::db('designa')->consultar($sql);\n }", "function produitLoadFull($db,$id){\n $id = (int) $id;\n $req = \"SELECT P.idproduit, P.modele, LEFT(P.descriptif,300) AS modele, C.genre, I.legend, GROUP_CONCAT(I.legend SEPARATOR '|||') AS theimages_titre, GROUP_CONCAT(C.genre SEPARATOR '|||') AS genre\n FROM produits P \n LEFT JOIN produits_has_categorie PHC \n ON PHC.produits_id = P.idproduit\n LEFT JOIN images I \n ON I.idmage = produits_idproduit\nWHERE P.idproduit=$idproduit\nGROUP BY P.idproduit\n \";\n $recup = mysqli_query($db,$req);\n // si on a 1 résultat\n if(mysqli_num_rows($recup)){\n // on utilise le fetch all car il peut y avoir plus d'un résultat\n return mysqli_fetch_assoc($recup);\n }\n // no result\n return false;\n}", "function getHotelMedia($txt_id,$spath){\n global $dbConn;\n $params9 = array(); \n global $link;\n// $query_hotels = \"SELECT id , filename as img , hotel_id FROM `discover_hotels_images` WHERE hotel_id = $txt_id ORDER BY default_pic DESC LIMIT 18\";\n $query_hotels = \"SELECT id , filename as img , hotel_id FROM `discover_hotels_images` WHERE hotel_id = :Txt_id ORDER BY default_pic DESC LIMIT 18\";\n $params9[] = array( \"key\" => \":Txt_id\",\n \"value\" =>$txt_id);\n $select = $dbConn->prepare($query_hotels);\n PDO_BIND_PARAM($select,$params9);\n $ret_hotels = $select->execute();\n $media_hotels = array();\n// $ret_hotels = db_query($query_hotels);\n $row = $select->fetchAll();\n// while($row = db_fetch_array($ret_hotels)){\n foreach($row as $row_item){\n $imgArr = array();\n $imgArr['img'] = $link.$row_item['img'];\n $imgArr['thumb'] = $link.\"thumb/\".$row_item['img'];\n\n $dims = imageGetDimensions( $spath . 'media/discover/' .$row_item['img']);\n\n $width = $dims['width'];\n $height = $dims['height'];\n //for large size\n $new_height = 256;\n $scaleWidth= 476/$width;\n $scaleHeight= 256/$height;\n if($scaleWidth>$scaleHeight){\n $new_width = $width*$scaleWidth;\n $new_height = $height*$scaleWidth;\n }else{\n $new_width = $width*$scaleHeight;\n $new_height = $height*$scaleHeight;\n }\n $dataw=$new_width;\n $datah = $new_height;\n //for medium size\n $new_height2 = 112;\n $scaleWidth2= 219/$width;\n $scaleHeight2= 112/$height;\n if($scaleWidth2>$scaleHeight2){\n $new_width2 = $width*$scaleWidth2;\n $new_height2 = $height*$scaleWidth2;\n }else{\n $new_width2 = $width*$scaleHeight2;\n $new_height2 = $height*$scaleHeight2;\n }\n $imgArr['imgWidth'] = $dataw;\n $imgArr['imgHeight'] = $datah;\n $imgArr['style'] = 'style=\"width:'.round($dataw).'px;height:'.round($datah).'px\"';\n $imgArr['mediumStyle'] = 'style=\"width:'.round($new_width2).'px;height:'.round($new_height2).'px\"';\n $media_hotels[] = $imgArr;\n }\n return $media_hotels;\n}", "public function readSum_article()\n\t{\n // ,group_concat(distinct t5.tb_name,t4.cateId),group_concat(distinct t5.name)\n\t\t// from article_item t1 \n\t\t// left outer join tags_insec_article t2 on t1.id=t2.acleId\n\t\t// left outer join tags t3 on t2.tagId = t3.id\n // left outer join cate_insec_article t4 on t1.id = t4.acleId\n // left outer join cate_tree t5 on t4.cateId = t5.id\n\t\t// group by t1.id\n\n\t\t$this->db->select('\n\t\tt1.id,\n\t\tgroup_concat(distinct t1.tb_name,t1.id),\n\t\tt1.title,\n\t\tt1.description,\n\t\tgroup_concat(distinct t3.tb_name,t2.tagId),\n\t\tgroup_concat(distinct t3.name),\n\t\tgroup_concat(distinct t5.tb_name, t4.cateId),\n\t\tgroup_concat(distinct t5.name)\n\t\t');\n\t $this->db->from('article_item t1'); \n\t $this->db->join('tags_insec_article t2', 't1.id=t2.acleId', 'left');\n\t $this->db->join('tags t3', 't2.tagId = t3.id', 'left');\n\t $this->db->join('cate_insec_article t4', 't1.id = t4.acleId', 'left');\n\t $this->db->join('cate_tree t5', 't4.cateId = t5.id', 'left');\n\t $this->db->group_by('t1.id'); \n\t $query = $this->db->get(); \n\t \n\t \n\t if($query->num_rows() != 0)\n\t {\n\t return $query->result_array();\n\t }\n\t else\n\t {\n\t return false;\n\t }\n\t}", "function get_pengeluaran_by_akun5digitl3($data){\n// var_dump($data);die;\n $str_ = '';\n if(count($data['array_id']) > 1){\n foreach($data['array_id'] as $id){\n $str_ .= \"rsa_2018.rsa_kuitansi.id_kuitansi = '{$id}' OR \" ;\n }\n $str_ = substr($str_,0, strlen($str_) - 3 );\n }else{\n $str_ = \"rsa_2018.rsa_kuitansi.id_kuitansi = '{$data['array_id'][0]}'\" ;\n }\n // echo $str_ ; die;\n $str = \"SELECT SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,7,10) AS rka,rsa_2018.rsa_kuitansi.id_kuitansi,SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,7,10) AS kode_usulan_rkat,rba_2018.komponen_input.nama_komponen,rba_2018.subkomponen_input.nama_subkomponen,rba_2018.akun_belanja.nama_akun5digit,\"\n . \"rsa_2018.rsa_kuitansi.kode_akun5digit,SUM(rsa_2018.rsa_kuitansi_detail.volume*rsa_2018.rsa_kuitansi_detail.harga_satuan) AS pengeluaran \"\n . \"FROM rsa_2018.rsa_kuitansi \"\n . \"JOIN rsa_2018.rsa_kuitansi_detail \"\n . \"ON rsa_2018.rsa_kuitansi_detail.id_kuitansi = rsa_2018.rsa_kuitansi.id_kuitansi \"\n . \"JOIN rba_2018.komponen_input ON rba_2018.komponen_input.kode_kegiatan = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,7,2) \"\n . \"AND rba_2018.komponen_input.kode_output = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,9,2) \"\n . \"AND rba_2018.komponen_input.kode_program = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,11,2) \"\n . \"AND rba_2018.komponen_input.kode_komponen = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,13,2) \"\n . \"JOIN rba_2018.subkomponen_input ON rba_2018.subkomponen_input.kode_kegiatan = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,7,2) \"\n . \"AND rba_2018.subkomponen_input.kode_output = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,9,2) \"\n . \"AND rba_2018.subkomponen_input.kode_program = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,11,2) \"\n . \"AND rba_2018.subkomponen_input.kode_komponen = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,13,2) \"\n . \"AND rba_2018.subkomponen_input.kode_subkomponen = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,15,2) \"\n . \"JOIN rba_2018.akun_belanja ON rba_2018.akun_belanja.kode_akun5digit = rsa_2018.rsa_kuitansi.kode_akun5digit \"\n . \"AND rba_2018.akun_belanja.kode_akun = rsa_2018.rsa_kuitansi.kode_akun \"\n . \"AND rba_2018.akun_belanja.sumber_dana = rsa_2018.rsa_kuitansi.sumber_dana \"\n . \"WHERE rsa_2018.rsa_kuitansi.kode_unit = '{$data['kode_unit_subunit']}' \"\n . \"AND rsa_2018.rsa_kuitansi.jenis = 'L3' \"\n . \"AND ( \" . $str_ . \" ) \"\n . \"AND rsa_2018.rsa_kuitansi.tahun = '{$data['tahun']}' \"\n . \"GROUP BY SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,7,10),SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,19,5) \"\n . \"ORDER BY SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,7,10) ASC,SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,19,5) ASC\";\n\n // echo $str;die;\n// var_dump($str);die;\n\n $q = $this->db->query($str);\n // var_dump($q->num_rows());die;\n if($q->num_rows() > 0){\n return $q->result();\n }else{\n return '';\n }\n }", "public function cpJoin() {\n $sql=\"select packages.packageName, prices.id, prices.price, products.productName, products.cid, prices.productID, prices.areaID, prices.packageID \"\n . \"from prices\"\n . \" inner join packages on packages.packageID=prices.packageID\"\n . \" inner join products on prices.productID=products.productID where products.cid='9'\";\n $sth=$this->dbh->prepare($sql);\n \n $sth->execute();\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n}", "public function getSplit() {\n $req = 'SELECT tbljobs.id_tbljob, tbljobs.id_info_job,\n customer, job, split, po_number, devis, info_jobs.instruction as info_jobs_instruction, info_jobs.commentaire as info_jobs_commentaire, inOut_recommendation,schedule_recommendation,\n activity_type, specific_test, order_val, order_est, order_est_subc,\n resp.technicien as resp,\n contacts.genre, contacts.prenom, contacts.nom, contacts.email as email, contacts.telephone as telephone, contacts.prenom, contacts.nom, contacts.departement, contacts.rue1, contacts.rue2, contacts.ville, contacts.pays,\n contacts2.genre as genre2, contacts2.prenom as prenom2, contacts2.nom as nom2, contacts2.email as email2, contacts2.telephone as telephone2,\n contacts3.genre as genre3, contacts3.prenom as prenom3, contacts3.nom as nom3, contacts3.email as email3, contacts3.telephone as telephone3,\n contacts4.genre as genre4, contacts4.prenom as prenom4, contacts4.nom as nom4, contacts4.email as email4, contacts4.telephone as telephone4,\n tbljob_commentaire, tbljob_instruction, tbljob_commentaire_qualite, planning, tbljob_frequence,\n GE, specific_protocol, special_instruction, staircase,\n createur, t1.technicien as nomCreateur, t2.technicien as comCheckeur,\n statuts.id_statut, statut, etape, statut_color, test_type, test_type_abbr, test_type_cust, ST,final, auxilaire, tbljobs.id_rawData, rawData.name, rawdatatobesent,\n report_rev, invoice_type, invoice_date, invoice_commentaire, invoice_lang, invoice_currency,\n specification, ref_matiere, matiere, tbljobs.waveform, GROUP_CONCAT(DISTINCT dessin SEPARATOR \" \") as dessin, GROUP_CONCAT(DISTINCT master_eprouvettes.id_dwg SEPARATOR \" \") as id_dessin,\n other_1, other_2, other_3, other_4, other_5,\n GROUP_CONCAT( DISTINCT round(c_temperature,0) ORDER BY c_temperature DESC SEPARATOR \" / \") as temperature,\n GROUP_CONCAT( DISTINCT round(c_frequence,1) ORDER BY c_frequence DESC SEPARATOR \" / \") as c_frequence,\n GROUP_CONCAT( DISTINCT round(c_frequence_STL,1) ORDER BY c_frequence_STL DESC SEPARATOR \" / \") as c_frequence_STL,\n GROUP_CONCAT( DISTINCT machine SEPARATOR \" / \") as machines,\n GROUP_CONCAT( DISTINCT cell_load_capacity SEPARATOR \" / \") as cell_load_capacity,\n if(type1.consigne_type=\"R\",GROUP_CONCAT( DISTINCT round(c_type_1_val,2) ORDER BY c_type_1_val DESC SEPARATOR \" / \"),\"\") as ratio1,\n if(type2.consigne_type=\"R\",GROUP_CONCAT( DISTINCT round(c_type_1_val,2) ORDER BY c_type_1_val DESC SEPARATOR \" / \"),\"\") as ratio2,\n sum(if(type_chauffage=\"Four\",1,0)) as four,\n sum(if(type_chauffage=\"Coil\",1,0)) as coil,\n type1.consigne_type as c_type_1, type2.consigne_type as c_type_2, c_unite,\n type1.id_consigne_type as id_c_type_1, type2.id_consigne_type as id_c_type_2,\n DyT_SubC, DyT_expected, DyT_Cust, available_expected, report_send,\n (SELECT DyT_expected FROM tbljobs t WHERE t.id_info_job=tbljobs.id_info_job AND t.phase<tbljobs.phase AND DyT_expected IS NOT NULL ORDER BY phase DESC LIMIT 1) AS available,\n checked, comments, contacts.adresse,\n contactST.id_contact as id_contactST, contactST.genre as genreST, contactST.prenom as prenomST, contactST.nom as nomST,entrepriseST.id_entreprise as id_entrepriseST, entrepriseST.entreprise as entrepriseST, entrepriseST.entreprise_abbr as entreprise_abbrST, refSubC,\n\n entreprises.entreprise, entreprises.VAT, entreprises.MRSASRef, entreprises.billing_rue1, entreprises.billing_rue2, entreprises.billing_ville, entreprises.billing_pays,\n\n count(distinct master_eprouvettes.id_master_eprouvette) as nbep,\n count(distinct eprouvettes.id_eprouvette) as nbtest,\n count(n_essai) as nbtestdone,\n COUNT(DISTINCT CASE WHEN n_essai is null THEN master_eprouvettes.id_master_eprouvette END) nbepleft,\n COUNT(DISTINCT CASE WHEN d_checked <=0 THEN master_eprouvettes.id_master_eprouvette END) nbepCheckedleft,\n\n sum(ceil(temps_essais)) as tpstest,\n sum(ceil(if(temps_essais is null,null,if(temps_essais>24, temps_essais-24,0)))) as hrsup,\n sum(ceil(\n if(temps_essais is null,\n if(\n IF(Cycle_final is null,Cycle_final_temp, cycle_final) >0 AND c_frequence is not null and c_frequence !=0,\n if(Cycle_STL is null and c_cycle_STL is null,\n IF(Cycle_final is null,Cycle_final_temp, cycle_final)/eprouvettes.c_frequence/3600,\n if(Cycle_STL is null,\n if(\n IF(Cycle_final is null,Cycle_final_temp, cycle_final)>c_cycle_STL,(c_cycle_STL/c_frequence+(IF(Cycle_final is null,Cycle_final_temp, cycle_final)-c_cycle_STL)/c_frequence_STL)/3600,\n (IF(Cycle_final is null,Cycle_final_temp, cycle_final)/c_frequence)/3600\n )\n ,if(\n IF(Cycle_final is null,Cycle_final_temp, cycle_final)>cycle_STL,\n (cycle_STL/c_frequence+(IF(Cycle_final is null,Cycle_final_temp, cycle_final)-cycle_STL)/c_frequence_STL)/3600,\n (IF(Cycle_final is null,Cycle_final_temp, cycle_final)/c_frequence)/3600\n )\n )\n ),\n 0)\n ,temps_essais\n )\n )) as tpscalc,\n\n sum(ceil(\n if(\n if(temps_essais is null,\n if(\n IF(Cycle_final is null,Cycle_final_temp, cycle_final) >0 AND c_frequence is not null and c_frequence !=0,\n if(\n Cycle_STL is null and c_cycle_STL is null,\n IF(\n Cycle_final is null,Cycle_final_temp, cycle_final)/eprouvettes.c_frequence/3600,\n if(\n Cycle_STL is null,\n if(\n IF(Cycle_final is null,Cycle_final_temp, cycle_final)>c_cycle_STL,\n (c_cycle_STL/c_frequence+(IF(Cycle_final is null,Cycle_final_temp, cycle_final)-c_cycle_STL)/c_frequence_STL)/3600,\n (IF(Cycle_final is null,Cycle_final_temp, cycle_final)/c_frequence)/3600\n )\n ,if(\n IF(Cycle_final is null,Cycle_final_temp, cycle_final)>cycle_STL,\n (cycle_STL/c_frequence+(IF(Cycle_final is null,Cycle_final_temp, cycle_final)-cycle_STL)/c_frequence_STL)/3600,\n (IF(Cycle_final is null,Cycle_final_temp, cycle_final)/c_frequence)/3600\n )\n )\n ),\n \"\")\n ,temps_essais\n )>24,\n if(temps_essais is null,\n if(IF(Cycle_final is null,Cycle_final_temp, cycle_final) >0 AND c_frequence is not null and c_frequence !=0,\n if(Cycle_STL is null and c_cycle_STL is null,\n IF(Cycle_final is null,Cycle_final_temp, cycle_final)/eprouvettes.c_frequence/3600,\n if(Cycle_STL is null,\n if(IF(Cycle_final is null,Cycle_final_temp, cycle_final)>c_cycle_STL,\n (c_cycle_STL/c_frequence+(IF(Cycle_final is null,Cycle_final_temp, cycle_final)-c_cycle_STL)/c_frequence_STL)/3600,\n (IF(Cycle_final is null,Cycle_final_temp, cycle_final)/c_frequence)/3600\n )\n ,if(IF(Cycle_final is null,Cycle_final_temp, cycle_final)>cycle_STL,\n (cycle_STL/c_frequence+(IF(Cycle_final is null,Cycle_final_temp, cycle_final)-cycle_STL)/c_frequence_STL)/3600,\n (IF(Cycle_final is null,Cycle_final_temp, cycle_final)/c_frequence)/3600\n )\n )\n ),\n \"\"\n )\n ,temps_essais\n )-24,\n 0\n )\n ))\n as tpssupcalc\n\n FROM tbljobs\n LEFT JOIN test_type ON test_type.id_test_type=tbljobs.id_type_essai\n LEFT JOIN info_jobs ON info_jobs.id_info_job=tbljobs.id_info_job\n LEFT JOIN eprouvettes ON eprouvettes.id_job=tbljobs.id_tbljob\n LEFT JOIN eprouvettes_temp ON eprouvettes_temp.id_eprouvettes_temp=eprouvettes.id_eprouvette\n LEFT JOIN enregistrementessais ON enregistrementessais.id_eprouvette=eprouvettes.id_eprouvette\n LEFT JOIN prestart ON prestart.id_prestart=enregistrementessais.id_prestart\n LEFT JOIN postes ON postes.id_poste=prestart.id_poste\n LEFT JOIN machines ON machines.id_machine=postes.id_machine\n LEFT JOIN chauffages ON chauffages.id_chauffage=postes.id_chauffage\n LEFT JOIN cell_load ON cell_load.id_cell_load=postes.id_cell_load\n LEFT JOIN master_eprouvettes ON master_eprouvettes.id_master_eprouvette=eprouvettes.id_master_eprouvette\n LEFT JOIN dessins ON dessins.id_dessin=master_eprouvettes.id_dwg\n LEFT JOIN techniciens resp ON resp.id_technicien=info_jobs.id_resp\n LEFT JOIN contacts ON contacts.id_contact=info_jobs.id_contact\n LEFT JOIN contacts contacts2 ON contacts2.id_contact=info_jobs.id_contact2\n LEFT JOIN contacts contacts3 ON contacts3.id_contact=info_jobs.id_contact3\n LEFT JOIN contacts contacts4 ON contacts4.id_contact=info_jobs.id_contact4\n LEFT JOIN contacts contactST ON contactST.id_contact=tbljobs.id_contactST\n LEFT JOIN entreprises entrepriseST ON entrepriseST.id_entreprise=contactST.ref_customer\n LEFT JOIN entreprises ON entreprises.id_entreprise=info_jobs.customer\n LEFT JOIN tbljobs_temp ON tbljobs_temp.id_tbljobs_temp=tbljobs.id_tbljob\n LEFT JOIN statuts ON statuts.id_statut=tbljobs_temp.id_statut_temp\n LEFT JOIN matieres ON matieres.id_matiere=info_jobs.id_matiere_std\n LEFT JOIN rawData ON rawData.id_rawData=tbljobs.id_rawData\n LEFT JOIN consigne_types as type1 ON type1.id_consigne_type=tbljobs.c_1\n LEFT JOIN consigne_types as type2 ON type2.id_consigne_type=tbljobs.c_2\n LEFT JOIN techniciens as t1 on t1.id_technicien=tbljobs.modif\n LEFT JOIN techniciens as t2 on t2.id_technicien=tbljobs.checked\n\n\n\n WHERE tbljobs.id_tbljob='.$this->id.'\n AND eprouvette_actif=1\n AND master_eprouvette_actif=1\n GROUP BY tbljobs.id_tbljob';\n //echo $req;\n return $this->db->getOne($req);\n }", "public function get_used_images(){\r $query = \"select `s`.`image` as `image` from `ct_services` as `s`\rUNION\rselect `sa`.`image` as `image` from `ct_services_addon` as `sa`\rUNION\rselect `setim`.`option_value` as `setimage` from `ct_settings` as `setim` where `option_name` = 'ct_company_logo'\";\r $result=mysqli_query($this->conn,$query);\r return $result;\r }", "public function getGruppi(){\n \n if($this->azienda>0){\n $cosa=(\" azienda = \".$this->azienda.\" OR owner=-1 \");\n\n $this->db->from(\"lm_categorie_prodotti\");\n \n $this->db->where($cosa);\n\n $query=$this->db->get();\n\n //$datas=$query->result();//\n $datas = $query->result_array();\n if(count($datas)>0){\n $gruppi=array();\n foreach($datas as $g){\n if($g[\"foto\"]==null){\n $g[\"foto\"]=\"/public/img/noimage.jpg\";\n }\n $gruppi[$g[\"gruppo\"]][]=$g;\n }\n }else{\n $cosa=(\"owner = \".$this->utente.\" OR owner = -1\");\n $this->db->from(\"lm_categorie_prodotti\");\n $this->db->where($cosa);\n\n $query=$this->db->get();\n $datas = $query->result_array();\n $gruppi=array();\n foreach($datas as $g){\n \n if($g[\"foto\"]==null){\n $g[\"foto\"]=\"/public/img/noimage.jpg\";\n }\n $gruppi[$g[\"gruppo\"]][]=$g;\n \n }\n }\n \n }else{\n redirect(\"/\");\n }\n \n return $gruppi;\n }", "function get_loop_list($pdb_id)\n {\n ### TESTING THIS QUERY -- REMOVE LINES 30-37 WHEN APPROVED\n // $this->db->select('group_concat(unit_id) AS unit_ids, LI.loop_id', FALSE)\n // ->from('loop_info AS LI')\n // ->join('loop_positions AS LP', 'LI.loop_id = LP.loop_id')\n // ->where('LI.pdb_id', $pdb_id)\n // ->group_by('LI.loop_id');\n // $query = $this->db->get();\n\n // if ( $query->num_rows() > 0 ) {\n // $data = array();\n // foreach($query->result() as $row) {\n // $data[] = '\"' . implode('\",\"', array($row->loop_id, $row->unit_ids)) . '\"';\n // }\n // $table = implode(\"\\n\", $data);\n // } else {\n // $table = 'No loops found';\n // }\n\n // return $table;\n\n\n $this->db->select('loop_info.loop_id, group_concat(unit_id order by position_2023) as unit_ids')\n ->from('loop_info')\n ->join('loop_positions', 'loop_info.loop_id = loop_positions.loop_id')\n ->where('loop_info.pdb_id', $pdb_id)\n ->group_by('loop_info.loop_id');\n $query = $this->db->get();\n\n if ( $query->num_rows() > 0 ) {\n $data = array();\n foreach($query->result() as $row) {\n $data[] = '\"' . implode('\",\"', array($row->loop_id, $row->unit_ids)) . '\"';\n }\n $table = implode(\"\\n\", $data);\n } else {\n $table = 'No loops found';\n }\n\n return $table; \n\n }", "public function get_all($pmss, $date1, $date2)\n {\n $query = $this->db->query(\"SELECT nid, duration_g, Integration, Integration_Default,Created, Published,Duration,\nsec_to_time(AVG(time_to_sec(TIMEDIFF( convert_tz(Published,'PST8PDT','GMT'), Created)))) 'ravg',\nsec_to_time(AVG(time_to_sec(TIMEDIFF( airbnb_created, convert_tz(Published,'PST8PDT','GMT'))))) 'aavg',\nsec_to_time(AVG(time_to_sec(TIMEDIFF( bookingcom_created, convert_tz(Published,'PST8PDT','GMT'))))) 'bavg',\nsec_to_time(AVG(time_to_sec(TIMEDIFF( homeaway_created, convert_tz(Published,'PST8PDT','GMT'))))) 'havg',\nsec_to_time(AVG(time_to_sec(TIMEDIFF( expedia_created, convert_tz(Published,'PST8PDT','GMT'))))) 'eavg',\nsec_to_time(AVG(time_to_sec(TIMEDIFF( tripadvisor_created, convert_tz(Published,'PST8PDT','GMT'))))) 'tavg'\n from(SELECT a.nid 'nid', DATE_FORMAT(timestamp1,'%Y-%m-%d') 'duration_g',\n\n\n-- sec_to_time(AVG(time_to_sec(TIMEDIFF( b.Published, timestamp1)))),\nif(cff.field_calendar_feed_format_value like 'haapi_%', 'homeaway API',cff.field_calendar_feed_format_value) 'Integration',\n cff.field_calendar_feed_format_value 'Integration_Default',\n timestamp1 'Created', \n b.Published 'Published', \n TIMEDIFF( b.Published, timestamp1) 'Duration', \n group_concat(\n if(\n cp.channel = 'airbnb', cp.created_ts, \n null\n )\n ) as 'airbnb_created', \n group_concat(\n if(\n cp.channel = 'bookingcom', cp.created_ts, \n null\n )\n ) as 'bookingcom_created', \n group_concat(\n if(\n cp.channel = 'homeaway', cp.created_ts, \n null\n )\n ) as 'homeaway_created', \n group_concat(\n if(\n cp.channel = 'expedia', cp.created_ts, \n null\n )\n ) as 'expedia_created', \n group_concat(\n if(\n cp.channel = 'tripadvisor', cp.created_ts, \n null\n )\n ) as 'tripadvisor_created' \nFROM \n (\n SELECT \n nid, \n uid, \n FROM_UNIXTIME(created) 'timestamp1' \n FROM \n node\n ) a \n left join (\n select \n min(psmnid), \n psmnid, \n nid, \n destination_state, \n created_at 'Published' \n from \n property_state_machine_notes \n where \n destination_state = 'live'\n group by nid\n ) b on b.nid = a.nid \n left join manager_cc_fees mc on mc.mid = a.uid \n left join channel_properties cp on cp.nid = a.nid \n left join field_data_field_calendar_feed_format cff on cff.entity_id = a.nid\nwhere timestamp1 between '\".$date1.\" 00:00:00' and '\".$date2.\" 23:59:59'\n$pmss\nand b.Published !='NULL'\n group by a.nid\n ) h\n group by h.duration_g\n \n;\");\n return $query->result_array();\n }", "public function cargar_cat($com, $anu, $id){\n\n try{\n \n \n $pdo = AccesoDB::getCon();\n\n if($com == -1){\n\n $sql = \"select distinct * from (\nselect count(p.id_promo) promo,a.id_anuncio, a.nom_anuncio,a.cat_anuncio , \nIFNULL((select ROUND((sum(b.nota_puntaje)/count(b.id_puntaje)), 0) from puntaje b where a.id_anuncio = b.fk_anuncio and b.vig_puntaje = 1),0) puntaje,\nIFNULL((select i.img from img_anuncio i where a.id_anuncio = i.fk_id_anuncio order by i.id_img limit 1),'https://www.w3schools.com/bootstrap4/img_avatar1.png') img\nfrom anuncios a left join promo p on a.id_anuncio = fk_id_anuncio and p.duracion_promo > sysdate() where a.comuna_anuncio <> :com and a.vig_anuncio = 1 and a.id_anuncio <> :id and a.cat_anuncio = (select z.cat_anuncio from anuncios z where z.id_anuncio = :id) and a.fec_termino_anuncio >= sysdate() \ngroup by a.id_anuncio, a.nom_anuncio,a.cat_anuncio \nunion all\nselect count(p.id_promo) promo,a.id_anuncio, a.nom_anuncio,a.cat_anuncio , \nIFNULL((select ROUND((sum(c.nota_puntaje)/count(c.id_puntaje)), 0) from puntaje c where a.id_anuncio = c.fk_anuncio and c.vig_puntaje = 1),0) puntaje,\nIFNULL((select i.img from img_anuncio i where a.id_anuncio = i.fk_id_anuncio order by i.id_img limit 1),'https://www.w3schools.com/bootstrap4/img_avatar1.png') img\nfrom anuncios a inner join cat_anuncio b on a.cat_anuncio = b.id_cat left join promo p on a.id_anuncio = fk_id_anuncio and p.duracion_promo > sysdate()\nwhere b.nom_cat like :anu and a.comuna_anuncio <> :com and a.vig_anuncio = 1 and a.id_anuncio <> :id and a.fec_termino_anuncio >= sysdate() \ngroup by a.id_anuncio, a.nom_anuncio,a.cat_anuncio ) a\";\n\n\n\n }elseif ($com == 0) {\n $sql = \"select distinct * from (\nselect count(p.id_promo) promo,a.id_anuncio, a.nom_anuncio,a.cat_anuncio , \nIFNULL((select ROUND((sum(b.nota_puntaje)/count(b.id_puntaje)), 0) from puntaje b where a.id_anuncio = b.fk_anuncio and b.vig_puntaje = 1),0) puntaje,\nIFNULL((select i.img from img_anuncio i where a.id_anuncio = i.fk_id_anuncio order by i.id_img limit 1),'https://www.w3schools.com/bootstrap4/img_avatar1.png') img\nfrom anuncios a left join promo p on a.id_anuncio = fk_id_anuncio and p.duracion_promo > sysdate() where (a.nom_anuncio like :anu or a.desc_anuncio like :anu) and a.vig_anuncio = 1 and a.id_anuncio <> :id and a.fec_termino_anuncio >= sysdate() \ngroup by a.id_anuncio, a.nom_anuncio,a.cat_anuncio \nunion all\nselect count(p.id_promo) promo,a.id_anuncio, a.nom_anuncio,a.cat_anuncio , \nIFNULL((select ROUND((sum(c.nota_puntaje)/count(c.id_puntaje)), 0) from puntaje c where a.id_anuncio = c.fk_anuncio and c.vig_puntaje = 1),0) puntaje,\nIFNULL((select i.img from img_anuncio i where a.id_anuncio = i.fk_id_anuncio order by i.id_img limit 1),'https://www.w3schools.com/bootstrap4/img_avatar1.png') img\nfrom anuncios a inner join cat_anuncio b on a.cat_anuncio = b.id_cat left join promo p on a.id_anuncio = fk_id_anuncio and p.duracion_promo > sysdate()\nwhere b.nom_cat like :anu and a.vig_anuncio = 1 and a.id_anuncio <> :id and a.fec_termino_anuncio >= sysdate() \ngroup by a.id_anuncio, a.nom_anuncio,a.cat_anuncio ) a\";\n \n\n\n\n\n }else{\n\n \n\n $sql = \"select distinct * from (\nselect count(p.id_promo) promo,a.id_anuncio, a.nom_anuncio,a.cat_anuncio , \nIFNULL((select ROUND((sum(b.nota_puntaje)/count(b.id_puntaje)), 0) from puntaje b where a.id_anuncio = b.fk_anuncio and b.vig_puntaje = 1),0) puntaje,\nIFNULL((select i.img from img_anuncio i where a.id_anuncio = i.fk_id_anuncio order by i.id_img limit 1),'https://www.w3schools.com/bootstrap4/img_avatar1.png') img\nfrom anuncios a left join promo p on a.id_anuncio = fk_id_anuncio and p.duracion_promo > sysdate() where (a.nom_anuncio like :anu or a.desc_anuncio like :anu) and (a.comuna_anuncio = 1 or a.comuna_anuncio = 0) and a.vig_anuncio = 1 and a.id_anuncio <> :id and a.fec_termino_anuncio >= sysdate() \ngroup by a.id_anuncio, a.nom_anuncio,a.cat_anuncio \nunion all\nselect count(p.id_promo) promo,a.id_anuncio, a.nom_anuncio,a.cat_anuncio , \nIFNULL((select ROUND((sum(c.nota_puntaje)/count(c.id_puntaje)), 0) from puntaje c where a.id_anuncio = c.fk_anuncio and c.vig_puntaje = 1),0) puntaje,\nIFNULL((select i.img from img_anuncio i where a.id_anuncio = i.fk_id_anuncio order by i.id_img limit 1),'https://www.w3schools.com/bootstrap4/img_avatar1.png') img\nfrom anuncios a inner join cat_anuncio b on a.cat_anuncio = b.id_cat left join promo p on a.id_anuncio = fk_id_anuncio and p.duracion_promo > sysdate()\nwhere b.nom_cat like :anu and (a.comuna_anuncio = 1 or a.comuna_anuncio = 0) and a.vig_anuncio = 1 and a.id_anuncio <> :id and a.fec_termino_anuncio >= sysdate() \ngroup by a.id_anuncio, a.nom_anuncio,a.cat_anuncio ) a\";\n}\n \n \n \n \n \n $anu = \"%\".$anu.\"%\"; \n \n \n\n $stmt = $pdo->prepare($sql);\n $stmt->bindParam(\":anu\", $anu, PDO::PARAM_STR);\n $stmt->bindParam(\":com\", $com, PDO::PARAM_INT);\n $stmt->bindParam(\":id\", $id, PDO::PARAM_INT);\n $stmt->execute();\n\n $response = $stmt->fetchAll();\n return $response;\n\n } catch (Exception $e) {\n echo\"<script type=\\\"text/javascript\\\">alert('Error, comuniquese con el administrador\". $e->getMessage().\" '); </script>\";\n }\n }", "function getItems()\n\t{\n\t\t$query = ' SELECT ' .\n\t\t\t$this->db->nameQuote('k2.alias') . ',' .\n\t\t\t$this->db->nameQuote('k2.title') . ',' .\n\t\t\t$this->db->nameQuote('k2.introtext') . ',' .\n\t\t\t$this->db->nameQuote('k2.plugins') . ',' .\n\t\t\t$this->db->nameQuote('loc.locations') . ',' .\n\n\t\t\t// Get all additional categories\n\t\t\t' ( SELECT ' .\n\t\t\t' GROUP_CONCAT(' . $this->db->nameQuote('cats.catid') . ')' .\n\t\t\t' FROM ' . $this->db->nameQuote('#__k2_additional_categories') . ' AS ' . $this->db->nameQuote('cats') .\n\t\t\t' WHERE ' . $this->db->nameQuote('k2.id') . ' = ' . $this->db->nameQuote('cats.itemId') .\n\t\t\t') AS ' . $this->db->nameQuote('categoryIDs') . ',' .\n\n\t\t\t// Get first additional categories name\n\t\t\t' ( SELECT ' .\n\t\t\t$this->db->nameQuote('cat.alias') .\n\t\t\t' FROM ' . $this->db->nameQuote('#__k2_categories') . ' AS ' . $this->db->nameQuote('cat') .\n\t\t\t' JOIN ' . $this->db->nameQuote('#__k2_additional_categories') . ' AS ' . $this->db->nameQuote('cats') .\n\t\t\t' ON (' . $this->db->nameQuote('cat.id') . ' = ' . $this->db->nameQuote('cats.catid') . ')' .\n\t\t\t' WHERE ' . $this->db->nameQuote('k2.id') . ' = ' . $this->db->nameQuote('cats.itemId') .\n\t\t\t' AND ' . $this->db->nameQuote('cat.id') . ' NOT IN (' . implode(',', $this->params->get('regionCategories')) . ')' .\n\t\t\t' AND ' . $this->db->nameQuote('parent') . ' = ' . $this->db->quote($this->params->get('primaryCategory')) .\n\t\t\t' LIMIT 1 ' .\n\t\t\t') AS ' . $this->db->nameQuote('category') .\n\n\t\t\t// Join K2 items, K2 locations and additional categories tables by item ID\n\t\t\t' FROM ' . $this->db->nameQuote('#__k2_items') . ' AS ' . $this->db->nameQuote('k2') .\n\t\t\t' JOIN ' . $this->db->nameQuote('#__k2_items_locations') . ' AS ' . $this->db->nameQuote('loc') .\n\t\t\t' ON (' . $this->db->nameQuote('loc.itemId') . ' = ' . $this->db->nameQuote('k2.id') . ')' .\n\t\t\t' JOIN ' . $this->db->nameQuote('#__k2_additional_categories') . ' AS ' . $this->db->nameQuote('cats') .\n\t\t\t' ON (' . $this->db->nameQuote('k2.id') . ' = ' . $this->db->nameQuote('cats.itemId') . ')' .\n\n\t\t\t// Limit results to items that only have the correct additional categories\n\t\t\t' WHERE ' . $this->db->nameQuote('cats.catid') . ' IN (' . implode(',', JRequest::getVar('categories')) . ')' .\n\n\t\t\t// Published items only\n\t\t\t' AND ' . $this->db->nameQuote('published') . ' = ' . $this->db->quote('1') .\n\t\t\t' AND ' . $this->db->nameQuote('k2.trash') . ' = ' . $this->db->quote('0');\n\n\t\t$this->db->setQuery($query);\n\n\t\treturn $this->setUniversalFields($this->db->loadObjectList());\n\t}", "public function getProductos72($inicio,$final,$agrupar=false){\n $sql=\"SET SQL_BIG_SELECTS=1\";\n $this->db->query($sql);\n ini_set('memory_limit', '-1');\n //ini_set('max_execution_time', 0);\n set_time_limit(300);\n $this->load->model('productos_');\n $sql=\"SELECT id_pe_producto,codigo_producto,nombre\n FROM `pe_boka` b \n LEFT JOIN pe_productos p ON p.id=b.id_pe_producto \n WHERE STYP=2 AND \n zeis>='$inicio' AND\n zeis<='$final 23:59:59'\n GROUP BY id_pe_producto,p.nombre\n \";\n \n $this->db->query(\"DELETE FROM pe_productos_excel WHERE 1\");\n $lineasProducto=array();\n $result=$this->db->query($sql)->result();\n $contador=0;\n foreach($result as $k=>$v){\n $id_pe_producto=$v->id_pe_producto;\n $codigo_producto=$v->codigo_producto; \n\n $sql=\"SELECT sum(pos1) as unidades,\n sum(gew1) as peso, \n sum(if(STYP=2,bt20,bt30)) as importe \n FROM `pe_boka` b \n WHERE (STYP=2 OR STYP=202) AND \n zeis>='$inicio' AND\n zeis<='$final 23:59:59' AND \n id_pe_producto='$id_pe_producto'\n \";\n $row=$this->db->query($sql)->row(); \n if(!isset($lineasProducto[$codigo_producto])){\n $lineasProducto[$codigo_producto]=array(\n 'unidades'=>$row->unidades,\n 'peso'=>$row->peso,\n 'importe'=>$row->importe,\n 'codigo_producto'=>$v->codigo_producto,\n 'nombre'=>$v->nombre,\n );\n }else{\n $lineasProducto[$codigo_producto]['unidades']+=$row->unidades;\n $lineasProducto[$codigo_producto]['peso']+=$row->peso;\n $lineasProducto[$codigo_producto]['importe']+=$row->importe;\n }\n $this->db->query(\"INSERT INTO pe_productos_excel SET \n codigo_producto='\".$v->codigo_producto.\"',\n nombre='\".$v->nombre.\"',\n cantidad='\".$row->unidades.\"',\n peso='\".$row->peso.\"',\n importe='\".$row->importe.\"'\n \");\n\n }\n return array('lineasProducto'=>$lineasProducto);\n }", "function allComponentes($codPrograma) {\n \n$sql= \"select a3.cod_componente, a1.nombre_componente, excusamedica, calamidad, transporte, estudio, nojustificada, trabajo, transportemenos, totalinasistencia\nfrom inasistencia_componente_j a1 , inasistencia_componente_noj a2, total_inasistencia_componente a3\nwhere \n\na1.nombre_componente=a2.nombre_componente and a1.nombre_componente=a3.nombre_componente\"\n;\n \n return DB::query($sql);\n }", "public function readDataPerbaikanBelum(){\n $sql = \"SELECT c.tanggal,c.nomor,c.no_inventaris,c.nama_user,b.cost_center,c.no_ex,GROUP_CONCAT(e.pekerjaan SEPARATOR '<br>') as pekerjaan FROM entri c,perbaikan e,kendaraan a,user b WHERE c.nomor = e.id_entri AND a.no_inventaris = c.no_inventaris AND c.id_status = 1 AND b.id_user = a.id_user GROUP BY c.nomor ORDER BY c.tanggal DESC\";\n $query = $this->db->query($sql);\n return $query;\n }", "public function getHessequaPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '109'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "function GetPackageGroupDataById($id_package) {\n \n $data = $this->db\n ->where('is_delete',0)\n ->where('id_status',1)\n ->where('id_package_group',$id_package)\n ->order_by('position','asc')\n ->get('package_group')\n ->row_array();\n \n if($data){\n // foreach ($data as $key=>$package_combo) {\n $data['item'] = $this->db\n ->where('id_package_group',$data['id_package_group'])\n ->get('package_group_item')\n ->result_array();\n\n //for christmas discount\n $real_price = $data['price'];\n $total_diskon_10 = floor( ( $real_price / 100) * 10 );\n \n $harga_natal = $real_price - $total_diskon_10; // 10% off for discount\n $data['real_price'] = $real_price;\n $data['price_diskon_10percent'] = $total_diskon_10;\n //$data['price_natal'] = $harga_natal;\n $data['price'] = $harga_natal; //final price\n\n foreach ($data['item'] as $key2 => $value) {\n $detail = $this->GetPackageByIdDataGroup($value['id_package'],$value['type']);\n $data['item'][$key2]['name'] = $detail['name'];\n $data['item'][$key2]['price'] = $detail['price'];\n }\n \n /*echo '<pre>';\n print_r($data);\n die();*/\n\n //}\n \n }\n \n \n return $data;\n }", "public function getMatzikamaPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '118'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getCapeAgulhasPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '112'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "function select_fitness_apk_data() {\n\n global $connection;\n\n $sql = \"SELECT app.description, app.app_name, app.developer, category.name, apk.version, apk.link, apk.size, app_image.link_img, app_image.alt\n FROM app INNER JOIN apk ON app.app_id=apk.app_id INNER JOIN app_image on app_image.app_id=apk.app_id INNER JOIN category on category.cat_id=app.cat_id \n WHERE category.cat_id=2\";\n\n return $connection->query($sql);\n }", "public function GetSQL()\n {\n\n \t$sql = \"\nSELECT \n\temployee.lastName AS employee_last_name,\n\temployee.firstName AS employee_first_name,\n\tcustomer.companyName AS customer_company,\n\torderDate,\n \tCOUNT(DISTINCT(orderDetail.id)) AS distinct_products_ordered,\n \tGROUP_CONCAT(DISTINCT productName) AS product_list,\n\tshipStateProvince,\n\tshipCity,\n\tshipAddress,\n\tshipName,\n\temployee.id AS employee_id,\n\tcustomer.id AS customer_id, \n\torder.id AS order_id\nFROM DURC_northwind_data.`order` \nJOIN DURC_northwind_model.employee ON \n\temployee.id =\n \temployee_id\nJOIN DURC_northwind_model.customer ON \n\tcustomer.id =\n \tcustomer_id\nJOIN DURC_northwind_data.orderDetail ON \n\torderDetail.order_id =\n \t`order`.id\nJOIN DURC_northwind_model.product ON \t\n\torderDetail.product_id =\n \tproduct.id \nGROUP BY `order`.id\n\";\n\t\t\n \treturn $sql;\n }", "public function getCommondata()\n {\n $select = $this->select()\n // ->setIntegrityCheck(false)\n ->from(array('album' => 'album'),array('Id','name_n'))\n ->join('album_det','album_det.Id = album.Id',array('album_det.Id'));\n // $result=$this->fetchAll($hhh);\n $result = $this->fetchAll($select);\n \n echo \"<pre>\";\n print_r($result);exit;\n return $result;\n\n }", "public function getSkuHierarchyElements ()\n{\n\n// $sql = \"select t1.id as sku_hierarchy_element_by_id,t1.element_name,t1.element_code,t1.element_description,t1.element_category_id,t1.parent_element_id,\n// t2.id as parent_layer_id,t3.id,t3.layer_name as element_category,\n// (Select b.element_name from tbld_sku_hierarchy_elements as b where t2.id = b.id)\n// as parent_element_name from tbld_sku_hierarchy_elements\n// as t1 left join tbld_sku_hierarchy_elements as t2 on t2.id = t1.parent_element_id\n// left join tbld_sku_hierarchy as t3 on t2.element_category_id = t3.id \";\n $sql = \"SELECT t1.*,t1.id as sku_hierarchy_element_by_id,t2.layer_name as element_category,t3.element_name as parent_element_name FROM `tbld_sku_hierarchy_elements` as t1\n left join `tbld_sku_hierarchy` as t2 on t1.element_category_id=t2.id\n left join `tbld_sku_hierarchy_elements` as t3 on t1.parent_element_id=t3.id\";\n $query = $this->db->query( $sql )->result_array();\n\n return $query;\n\n}", "public function myFindsimpleAll($criteria = array()) {\n //$em = $this->getDoctrine()->getManager();\n // $em = $this->getManager();\n //$values=array('a,partial b.{id,nomprojet},partial c.{id,nomUser},partial d.{id,nom,description},f,partial h.{id}');\n $values = 'a,partial b.{id,nomprojet},partial c.{id,nomUser},partial d.{id,nom,description},f,partial h.{id},';\n // $values='a,partial b.{id,nomprojet},partial c.{id,nomUser},partial GroupConcat(e.nomUser),partial d.{id,nom,description},f,partial h.{id}';\n /*\n * SELECT a.id , group_concat( b.b_val ) AS bvals\n> FROM b\n> LEFT JOIN ab ON b.id = ab.idb\n> LEFT JOIN a ON a.id = ab.ida\n> LEFT JOIN ab as ab2 ON ab2.ida = a.id \n> LEFT JOIN b as b2 ON b2.id = ab2.idb\n> WHERE b2.b_val='deuxbis'\n> GROUP BY a.id \n */\n $query = $this->_em->createQuery(\"\n SELECT a,b,c,d,f,g,h,e FROM ApplicationChangementsBundle:Changements a \n LEFT JOIN a.idProjet b\n LEFT JOIN a.demandeur c \n LEFT JOIN a.idStatus d \n LEFT JOIN a.idusers AS e ON e.id=a.id\n LEFT JOIN a.picture f\n LEFT JOIN a.idEnvironnement g \n LEFT JOIN a.comments h \n ORDER BY a.id\n \n \"\n );\n /*\n * $query = $this->_em->createQuery(\"\n SELECT a,b,c,d,GroupConcat( DISTINCT e.nomUser ),f,g,h FROM ApplicationChangementsBundle:Changements a \n LEFT JOIN a.idProjet b\n LEFT JOIN a.demandeur c \n LEFT JOIN a.idStatus d \n LEFT JOIN a.idusers e \n LEFT JOIN a.picture f\n LEFT JOIN a.idEnvironnement g \n LEFT JOIN a.comments h \n \"\n );\n * $query = $this->createQueryBuilder('a')\n ->select($values)\n // ->distinct('a')\n ->leftJoin('a.idProjet', 'b')\n ->leftJoin('a.demandeur', 'c')\n ->leftJoin('a.idStatus', 'd')\n ->leftJoin('a.picture', 'f')\n ->addSelect('g')\n ->leftJoin('a.idEnvironnement', 'g')\n // ->distinct('GroupConcat(g.nom)')\n ->leftJoin('a.comments', 'h')\n ->addSelect('partial e.{id,nomUser}')\n // ->distinct('GroupConcat(e.nomUser)')\n ->leftJoin('a.idusers', 'e');\n */\n /* GroupConcat(e.nomUser) */\n return $query;\n }", "public function getPacientePrestadoraArray(){\n $query = new Query;\n $query->select(['Paciente_prestadora.id, CONCAT(Paciente.nro_documento,\" (\",Paciente.nombre,\") \", Prestadoras.descripcion ) descripcion']) \n ->from( 'Prestadoras')\n ->join(\t'join', \n 'Paciente_prestadora',\n 'Prestadoras.id=Paciente_prestadora.prestadoras_id'\n ) \n ->join(\t'join', \n 'Paciente',\n 'Paciente.id=Paciente_prestadora.paciente_id'\n ) \n ->where([\"Paciente_prestadora.id\"=>$this->Paciente_prestadora_id]);\n \n $command = $query->createCommand();\n $data = $command->queryAll();\t\n $arrayData=array();\n if( !empty($data) and is_array($data) ){ //and array_key_exists('detallepedidopieza',$data) and array_key_exists('detalle_pedido_id',$data)){\n foreach ($data as $key => $arrayPacientePrestadora) {\n $arrayData[$arrayPacientePrestadora['id']]=$arrayPacientePrestadora['descripcion']; \n }\n }\n //todas los pacientes prestadoras\n $query = new Query;\n $query->select(['Paciente_prestadora.id, CONCAT(Paciente.nro_documento,\" (\",Paciente.nombre,\") \", Prestadoras.descripcion ) descripcion']) \n ->from( 'Prestadoras')\n ->join(\t'join', \n 'Paciente_prestadora',\n 'Prestadoras.id=Paciente_prestadora.prestadoras_id'\n ) \n ->join(\t'join', \n 'Paciente',\n 'Paciente.id=Paciente_prestadora.paciente_id'\n );\n \n $command = $query->createCommand();\n $data = $command->queryAll();\t\n if( !empty($data) and is_array($data) ){ //and array_key_exists('detallepedidopieza',$data) and array_key_exists('detalle_pedido_id',$data)){\n foreach ($data as $key => $arrayPacientePrestadora) {\n $arrayData[$arrayPacientePrestadora['id']]=$arrayPacientePrestadora['descripcion']; \n }\n } \n\n return $arrayData;\n }", "function GetLayout(){\n\t//Building the query\n\t$stringBuilder = \"SELECT l.layout_id, l.font, l.font_color, l.background_color, l.default_background, l.logo, fbg.location AS backgroundLocation, flogo.location AS logoLocation \";\n\t$stringBuilder .= \"FROM layout l \";\n\t$stringBuilder .= \"INNER JOIN `file` fbg ON fbg.file_id=l.default_background \";\n\t$stringBuilder .= \"INNER JOIN `file` flogo ON flogo.file_id=l.logo \";\n\t$stringBuilder .= \"ORDER BY l.layout_id DESC \";\t\n\n\t// Preparing query\n\t$query = GetDatabaseConnection()->prepare($stringBuilder);\n\t$query->execute(array()); //Putting in the parameters\n\t$result = $query->fetchAll(); //Fetching it\n\treturn $result;\n}", "function GetAllDataMDBundling($param = [])\n {\n //debugvar($param);\n if (isset($param['search_value']) && $param['search_value'] != '') {\n //echo 'asdsad';\n //debugvar($param);\n $this->db->group_start();\n $i = 0;\n foreach ($param['search_field'] as $row => $val) {\n if ($val['searchable'] == 'true') {\n if ($i == 0) {\n $this->db->like('LCASE(`'.$val['data'].'`)', strtolower($param['search_value']));\n } else {\n $this->db->or_like('LCASE(`'.$val['data'].'`)', strtolower($param['search_value']));\n }\n $i++;\n }\n }\n $this->db->group_end();\n }\n if (isset($param['row_from']) && isset($param['length'])) {\n $this->db->limit($param['length'], $param['row_from']);\n }\n if (isset($param['order_field'])) {\n if (isset($param['order_sort'])) {\n $this->db->order_by($param['order_field'], $param['order_sort']);\n } else {\n $this->db->order_by($param['order_field'], 'desc');\n }\n } else {\n $this->db->order_by('id', 'desc');\n }\n $data = $this->db\n /* ->select('Master_SPBundling.*,Master_SPBundling.MDN as id')\n ->where('Master_SPBundling.is_delete',0)\n ->get('Master_SPBundling')*/\n ->select('a.*,c.Product_Name_Combination,a.MDN as id')\n ->where('a.is_delete',0)\n ->join('incoming_product_summary b', 'b.id=a.Incoming_Product_Summary_no')\n ->join('t7_product_name_combination c', ' c.id=b.Product_Name_Combination_Code') \n ->get('Master_SPBundling a')\n ->result_array();\n\n return $data;\n }", "public function all()\r\n {\r\n // left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n // left join mshop_media as mm on mm.id = mpl.refid\r\n // left JOIN mshop_price as mpri on mpri.id = mpl.refid\r\n // where mpl.pos = 0 and mpl.domain in ('media','price')\";\r\n /*$qry1 = \"select mp.id as product_id, mp.code as product_code, mp.label as product_name, mm.preview as image_url from mshop_product as mp \r\n left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n left join mshop_media as mm on mm.id = mpl.refid\r\n where mpl.pos = 0 and mpl.domain in ('media')\";\r\n $qry2 = \"select mp.id as product_id, mp.label as product_name, mpri.value as product_price from mshop_product as mp \r\n left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n left JOIN mshop_price as mpri on mpri.id = mpl.refid\r\n where mpl.pos = 0 and mpl.domain in ('price')\";\r\n $products1 = DB::select($qry1);\r\n $products2 = DB::select($qry2); \r\n $i = 0;\r\n foreach($products1 as $products) {\r\n foreach($products2 as $product) {\r\n if($product->product_id === $products->product_id) {\r\n $products1[$i]->product_price = $product->product_price;\r\n }\r\n }\r\n $i++;\r\n }\r\n \r\n return $products1;*/\r\n }", "public function loadPopularSearchImages()\n\t{\n\t\t$query = PopularSearchImages::select('popular_search_images.keyword', \n\t\t\t\t\t\t\t\t\t\t\t\t'popular_search_images.query', \n\t\t\t\t\t\t\t\t\t\t\t\t'images.id', \n\t\t\t\t\t\t\t\t\t\t\t\t'images.short_name', \n\t\t\t\t\t\t\t\t\t\t\t\t'image_details.ratio', \n\t\t\t\t\t\t\t\t\t\t\t\tDB::raw('COUNT(keyword) as total_searched')\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t->leftJoin('images', 'images.id', '=', 'popular_search_images.image_id')\n\t\t\t\t\t\t\t\t\t\t->leftJoin('image_details', function($join){\n\t\t\t\t\t\t\t\t\t\t\t$join->on('image_details.image_id', '=', 'popular_search_images.image_id')\n\t\t\t\t\t\t\t\t\t\t\t\t\t->where('image_details.type', '=', 'main');\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t->groupBy('keyword')\n\t\t\t\t\t\t\t\t\t\t->orderBy('total_searched', 'desc')\n\t\t\t\t\t\t\t\t\t\t->take(16)\n\t\t\t\t\t\t\t\t\t\t->get();\n\t\t$arrReturn = [\n\t\t\t\t\t'arrKeywords' \t\t\t => [],\n\t\t\t\t\t'arrPopularSearchImages' => []\n\t\t\t\t];\n\t\tif( !$query->isempty() ) {\n\t\t\t$query = $query->toArray();\n\t\t\t$arrReturn['arrKeywords'] = $query;\n\t\t\t$dataKeywords = array_slice($arrReturn['arrKeywords'], 0, 8);\n\t\t\tforeach($dataKeywords as $keyword) {\n\t\t\t\tif( $keyword['ratio'] > 1 ) {\n\t\t\t\t\t$width = 450;\n\t \t\t\t$height = $width / $keyword['ratio'];\n\t\t\t\t} else {\n\t\t\t\t\t$height = 450;\n\t \t\t\t$width = $height * $keyword['ratio'];\n\t\t\t\t}\n\t\t\t\t$arrReturn['arrPopularSearchImages'][] = [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'path' => '/pic/crop/'.$keyword['short_name'].'-'.$keyword['id'].'.jpg',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'width' => $width,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'height' => $height,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'keyword' => $keyword['keyword'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'query' => $keyword['query']\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t];\n\t\t\t}\n\t\t}\n\n\t\t$html = View::make('frontend.types.popular-search-images')\n\t\t\t->with($arrReturn)->render();\n\t\treturn $html;\n\n\t}", "public function getOudtshoornPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '102'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getBergrivierPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '116'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getBitouPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '107'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function get_branch_products($branch_id)\n {\n // LEFT JOIN branch_products bp ON (p.product_id = bp.product_id)\n // WHERE branch_id=$branch_id\n // GROUP BY p.product_id \"); \n\n $query = $this->db->query(\" SELECT p.product_id, p.name AS product_name,p.price AS default_price,p.product_code AS productcode,bp.*,`pc`.`name` AS catName FROM product p LEFT JOIN branch_products bp ON (p.product_id = bp.product_id) LEFT JOIN branch b ON b.branch_id = bp.branch_id\n LEFT JOIN product_category pc ON pc.product_category_id = p.product_category_id WHERE bp.branch_id=$branch_id AND b.brand_id=(SELECT brand_id FROM branch b WHERE branch_id=$branch_id) GROUP BY p.product_id \");\n\n $result = $query->result_array();\n\n //$query = $this->db->get_where('branch_products', array('branch_products_id' => $id));\n // $rows = $query->num_rows();\n // echo 'ROWS:'.$rows;die;\n //$result = $query->result_array();\n // $str = $this->db->last_query();\n // echo $str;\n\n // $totalRows = $query->num_rows();\n\n // if( $totalRows > 0 )\n // {\n // $result = $query->result_array();\n // }\n // else\n // {\n // $query = $this->db->query(\" SELECT p.product_id, p.name AS product_name,p.price AS default_price,p.product_code AS productcode,bp.*,NULL AS is_available FROM product p\n // LEFT JOIN branch_products bp ON (p.product_id = bp.product_id)\n // GROUP BY p.product_id \"); \n // $result = $query->result_array(); \n // }\n\n return $result; \n }", "public function allProducts()\r\n {\r\n // left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n // left join mshop_media as mm on mm.id = mpl.refid\r\n // left JOIN mshop_price as mpri on mpri.id = mpl.refid\r\n // where mpl.pos = 0 and mpl.domain in ('media','price')\";\r\n $qry1 = \"select mp.id as product_id, mp.code as product_code, mp.label as product_name, mm.preview as image_url from mshop_product as mp \r\n left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n left join mshop_media as mm on mm.id = mpl.refid\r\n where mpl.pos = 0 and mpl.domain in ('media')\";\r\n $qry2 = \"select mp.id as product_id, mp.label as product_name, mpri.value as product_price from mshop_product as mp \r\n left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n left JOIN mshop_price as mpri on mpri.id = mpl.refid\r\n where mpl.pos = 0 and mpl.domain in ('price')\";\r\n $products1 = DB::select($qry1);\r\n $products2 = DB::select($qry2); \r\n $i = 0;\r\n foreach($products1 as $products) {\r\n foreach($products2 as $product) {\r\n if($product->product_id === $products->product_id) {\r\n $products1[$i]->product_price = $product->product_price;\r\n }\r\n }\r\n $i++;\r\n }\r\n return $products1;\r\n }", "function getListQuery()\n\t{\n\t\tglobal $jlistConfig; \n \n // Create a new query object.\n\t\t$db = $this->getDbo();\n\t\t$query = $db->getQuery(true);\n $user = JFactory::getUser();\n $groups = implode (',', $user->getAuthorisedViewLevels());\n \n\t\t// Select the required fields from the table.\n\t\t$query->select(\n\t\t\t$this->getState(\n\t\t\t\t'list.select',\n\t\t\t\t'a.file_id, a.file_title, a.file_alias, a.description, a.description_long, a.file_pic, a.images, a.price, a.release, a.file_language, a.system, '.\n 'a.license, a.url_license, a.license_agree, a.size, a.date_added, a.file_date, a.publish_from, a.publish_to, a.use_timeframe, a.url_download, a.preview_filename, '.\n 'a.other_file_id, a.md5_value, a.sha1_value, a.extern_file, a.extern_site, a.mirror_1, a.mirror_2, a.extern_site_mirror_1, a.extern_site_mirror_2, '.\n 'a.url_home, a.author, a.url_author, a.created_id, a.created_mail, a.modified_id, a.modified_date, a.submitted_by, a.set_aup_points, a.downloads, '.\n 'a.cat_id, a.changelog, a.password, a.password_md5, a.views, a.metakey, a.metadesc, a.robots, a.update_active, a.custom_field_1, '.\n 'a.custom_field_2, a.custom_field_3, a.custom_field_4, a.custom_field_5, a.custom_field_6, a.custom_field_7, a.custom_field_8, a.custom_field_9, '.\n 'a.custom_field_10, a.custom_field_11, a.custom_field_12, a.custom_field_13, a.custom_field_14, a.access, a.language, a.ordering, a.featured, '. \n 'a.published, a.checked_out, a.checked_out_time, ' .\n\t\t\t\t// use date_added if modified_date is 0\n // 'CASE WHEN a.modified_date = 0 THEN a.date_added ELSE a.modified_date END as modified, ' .\n 'a.modified_date as modified, ' .\n \t\t\t\t'a.modified_id,' .\n\t\t\t\t// use date_added if publish_from is 0\n\t\t\t\t'CASE WHEN a.publish_from = 0 THEN a.date_added ELSE a.publish_from END as publish_from,' .\n\t\t\t\t\t'a.publish_to, a.images, a.metakey, a.metadesc, a.access, ' .\n\t\t\t\t\t'a.downloads,'.' '.$query->length('a.description_long').' AS readmore'\n\t\t\t)\n\t\t);\n\n\t\t// Process an Archived Download layout\n\t\tif ($this->getState('filter.published') == 2) {\n\t\t\t// If badcats is not null, this means that the download is inside an archived category\n\t\t\t// In this case, the state is set to 2 to indicate Archived (even if the download state is Published)\n\t\t\t$query->select($this->getState('list.select', 'CASE WHEN badcats.id is null THEN a.published ELSE 2 END AS state'));\n\t\t}\n\t\telse {\n\t\t\t// Process non-archived layout\n\t\t\t// If badcats is not null, this means that the download is inside an unpublished category\n\t\t\t// In this case, the state is set to 0 to indicate Unpublished (even if the download state is Published)\n\t\t\t$query->select($this->getState('list.select', 'CASE WHEN badcats.id is not null THEN 0 ELSE a.published END AS state'));\n\t\t}\n\n\t\t$query->from('#__jdownloads_files AS a');\n \n // Join on files table.\n $query->select('aa.url_download AS filename_from_other_download');\n $query->join('LEFT', '#__jdownloads_files AS aa on aa.file_id = a.other_file_id'); \n\n\t\t// Join over the categories.\n\t\t$query->select('c.title AS category_title, c.access AS category_access, c.alias AS category_alias, c.cat_dir AS category_cat_dir, c.cat_dir_parent AS category_cat_dir_parent');\n\t\t$query->join('LEFT', '#__jdownloads_categories AS c ON c.id = a.cat_id');\n \n\t\t$query->join('LEFT', '#__users AS ua ON ua.id = a.created_id');\n\t\t$query->join('LEFT', '#__users AS uam ON uam.id = a.modified_id');\n\n // Join on user table.\n if ($jlistConfig['use.real.user.name.in.frontend']){\n $query->select('u.name AS creator');\n } else {\n $query->select('u.username AS creator');\n } \n $query->join('LEFT', '#__users AS u on u.id = a.created_id');\n \n if ($jlistConfig['use.real.user.name.in.frontend']){\n $query->select('u2.name AS modifier');\n } else {\n $query->select('u2.username AS modifier');\n } \n $query->join('LEFT', '#__users AS u2 on u2.id = a.modified_id'); \n \n // Join on license table.\n $query->select('l.title AS license_title, l.url AS license_url, l.description AS license_text, l.id as lid');\n $query->join('LEFT', '#__jdownloads_licenses AS l on l.id = a.license');\n \n // Join on ratings table.\n $query->select('ROUND(r.rating_sum / r.rating_count, 0) AS rating, r.rating_count as rating_count, r.rating_sum as rating_sum');\n $query->join('LEFT', '#__jdownloads_ratings AS r on r.file_id = a.file_id'); \n \n\t\t// Join over the categories to get parent category titles\n\t\t$query->select('parent.title as parent_title, parent.id as parent_id, parent.alias as parent_alias');\n\t\t$query->join('LEFT', '#__jdownloads_categories as parent ON parent.id = c.parent_id');\n \n // Join on menu table. We need the single download menu itemid when exist \n $query->select('menuf.id AS menuf_itemid');\n $query->join('LEFT', '(SELECT id, link, access, published from #__menu GROUP BY link) AS menuf on menuf.link LIKE CONCAT(\\'index.php?option=com_jdownloads&view=download&id=\\',a.file_id) AND menuf.published = 1 AND menuf.access IN ('.$groups.')') ;\n\n\t\t// Join to check for category published state in parent categories up the tree\n\t\t$query->select('c.published, CASE WHEN badcats.id is null THEN c.published ELSE 0 END AS parents_published');\n\t\t$subquery = 'SELECT cat.id as id FROM #__jdownloads_categories AS cat JOIN #__jdownloads_categories AS parent ';\n\t\t$subquery .= 'ON cat.lft BETWEEN parent.lft AND parent.rgt ';\n\t\t// Find any up-path categories that are not published\n\t\t// If all categories are published, badcats.id will be null, and we just use the download state\n\t\t$subquery .= ' AND parent.published != 1 GROUP BY cat.id ';\n\t\t// Select state to unpublished if up-path category is unpublished\n\t\t$publishedWhere = 'CASE WHEN badcats.id is null THEN a.published ELSE 0 END';\n \n\t\t$query->join('LEFT OUTER', '(' . $subquery . ') AS badcats ON badcats.id = c.id');\n\n\t\t// Filter by user id\n $query->where('a.created_id = '.$db->Quote($user->id)); \n \n // Filter by access level.\n\t\tif ($access = $this->getState('filter.access')) {\n\t\t\t$query->where('a.access IN ('.$groups.')');\n\t\t\t$query->where('c.access IN ('.$groups.')');\n\t\t}\n\n\t\t// Filter by published state\n\t\t$published = $this->getState('filter.published');\n\n\t\tif (is_numeric($published)) {\n\t\t\t// Use download state if badcats.id is null, otherwise, force 0 for unpublished\n\t\t\t$query->where($publishedWhere . ' = ' . (int) $published);\n\t\t}\n\t\telseif (is_array($published)) {\n\t\t\tArrayHelper::toInteger($published);\n\t\t\t$published = implode(',', $published);\n\t\t\t// Use download state if badcats.id is null, otherwise, force 0 for unpublished\n\t\t\t$query->where($publishedWhere . ' IN ('.$published.')');\n\t\t}\n \n // Filter by a single category\n $categoryId = $this->getState('filter.category_id');\n\n if (is_numeric($categoryId)) {\n $type = $this->getState('filter.category_id.include', true) ? '= ' : '<> ';\n\n $categoryEquals = 'a.cat_id '.$type.(int) $categoryId;\n $query->where($categoryEquals);\n } else { \n if (is_array($categoryId) && (count($categoryId) > 0)) {\n ArrayHelper::toInteger($categoryId);\n $categoryId = implode(',', $categoryId);\n if (!empty($categoryId)) {\n $type = $this->getState('filter.category_id.include', true) ? 'IN' : 'NOT IN';\n $query->where('a.cat_id '.$type.' ('.$categoryId.')');\n }\n } \n } \n\n\t\t// Filter by author\n\t\t$authorId = $this->getState('filter.author_id');\n\t\t$authorWhere = '';\n\n\t\tif (is_numeric($authorId)) {\n\t\t\t$type = $this->getState('filter.author_id.include', true) ? '= ' : '<> ';\n\t\t\t$authorWhere = 'a.created_id '.$type.(int) $authorId;\n\t\t}\n\t\telseif (is_array($authorId)) {\n\t\t\tArrayHelper::toInteger($authorId);\n\t\t\t$authorId = implode(',', $authorId);\n\n\t\t\tif ($authorId) {\n\t\t\t\t$type = $this->getState('filter.author_id.include', true) ? 'IN' : 'NOT IN';\n\t\t\t\t$authorWhere = 'a.created_id '.$type.' ('.$authorId.')';\n\t\t\t}\n\t\t}\n \n\t\tif (!empty($authorWhere)) {\n\t\t\t$query->where('('.$authorWhere.')');\n\t\t}\n\t\t\n\t\t// Filter by start and end dates.\n\t\t$nullDate\t= $db->Quote($db->getNullDate());\n\t\t$nowDate = $db->Quote(JFactory::getDate()->toSql()); // True to return the date string in the local time zone, false to return it in GMT.\n\n\t\t$query->where('(a.publish_from = '.$nullDate.' OR a.publish_from <= '.$nowDate.')');\n\t\t$query->where('(a.publish_to = '.$nullDate.' OR a.publish_to >= '.$nowDate.')');\n\n\t\t// Filter by Date Range or Relative Date\n\t\t$dateFiltering = $this->getState('filter.date_filtering', 'off');\n\t\t$dateField = $this->getState('filter.date_field', 'a.date_added');\n\n\t\tswitch ($dateFiltering)\n\t\t{\n\t\t\tcase 'range':\n\t\t\t\t$startDateRange = $db->Quote($this->getState('filter.start_date_range', $nullDate));\n\t\t\t\t$endDateRange = $db->Quote($this->getState('filter.end_date_range', $nullDate));\n\t\t\t\t$query->where('('.$dateField.' >= '.$startDateRange.' AND '.$dateField .\n\t\t\t\t\t' <= '.$endDateRange.')');\n\t\t\t\tbreak;\n\n\t\t\tcase 'relative':\n\t\t\t\t$relativeDate = (int) $this->getState('filter.relative_date', 0);\n\t\t\t\t$query->where($dateField.' >= DATE_SUB('.$nowDate.', INTERVAL ' .\n\t\t\t\t\t$relativeDate.' DAY)');\n\t\t\t\tbreak;\n\n\t\t\tcase 'off':\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// process the filter for list views with user-entered filters\n\t\t$params = $this->getState('params');\n\n\t\tif ((is_object($params)) && ($params->get('filter_field') != 'hide') && ($filter = $this->getState('list.filter'))) {\n\t\t\t// clean filter variable\n\t\t\t$filter = JString::strtolower($filter);\n\t\t\t$hitsFilter = intval($filter);\n\t\t\t$filter = $db->Quote('%'.$db->escape($filter, true).'%', false);\n\n\t\t\tswitch ($params->get('filter_field'))\n\t\t\t{\n\t\t\t\tcase 'author':\n\t\t\t\t\t$query->where(\n\t\t\t\t\t\t'LOWER(ua.name) LIKE '.$filter.' '\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'hits':\n\t\t\t\t\t$query->where('a.downloads >= '.$hitsFilter.' ');\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'title':\n\t\t\t\tdefault: // default to 'title' if parameter is not valid\n\t\t\t\t\t$query->where('LOWER( a.file_title ) LIKE '.$filter);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Filter by language\n\t\tif ($this->getState('filter.language')) {\n\t\t\t$query->where('a.language in ('.$db->quote(JFactory::getLanguage()->getTag()).','.$db->quote('*').')');\n\t\t}\n \n // Filter by uncategorised (cat_id = 1 for 'root')\n if ($this->getState('only_uncategorised')) {\n $query->where('a.cat_id = 1');\n }\n\n // Filter by featured state\n $featured = $this->getState('filter.featured');\n\n switch ($featured)\n {\n case 'hide':\n $query->where('a.featured = 0');\n break;\n\n case 'only':\n $query->where('a.featured = 1');\n break;\n\n case 'show':\n default:\n break;\n } \n \n\t\t// Add the list ordering clause.\n $order = $this->getState('list.ordering', 'a.ordering').' '.$this->getState('list.direction', 'ASC');\n $order = str_replace('DESC DESC','DESC', $order);\n $query->order($order);\n\t\t\n\t\treturn $query;\n\t}", "public function getRows($id = ''){ \r\n $this->db->select(\"*, (SELECT file_name FROM \".$this->imgTbl.\" WHERE gallery_id = \".$this->galleryTbl.\".id ORDER BY id DESC LIMIT 1) as default_image\"); \r\n $this->db->from($this->galleryTbl); \r\n if($id){ \r\n $this->db->where('id', $id); \r\n $query = $this->db->get(); \r\n $result = ($query->num_rows() > 0)?$query->row_array():array(); \r\n \r\n if(!empty($result)){ \r\n $this->db->select('*'); \r\n $this->db->from($this->imgTbl); \r\n $this->db->where('gallery_id', $result['id']); \r\n $this->db->order_by('id', 'desc'); \r\n $query = $this->db->get(); \r\n $result2 = ($query->num_rows() > 0)?$query->result_array():array(); \r\n $result['images'] = $result2; \r\n } \r\n }else{ \r\n $this->db->order_by('id', 'desc'); \r\n $query = $this->db->get(); \r\n $result = ($query->num_rows() > 0)?$query->result_array():array(); \r\n } \r\n \r\n // return fetched data \r\n return !empty($result)?$result:false; \r\n }", "function getProductos($userId) {\r\n\t\r\n\t\r\n\t\t/************************************************\r\n\t\tPRODUCTOS DE REPOSICIONES HECHAS EN TALLER\r\n\t\t************************************************/\r\n\t\t\r\n\t\t$sql = \"SELECT CI.*, Pr.nombre as producto, Pr.precio, M.nombre as modelo \r\n\t\t \t\tFROM colaimpresion CI\r\n\t\t\t\tINNER JOIN modelos M ON CI.modelos_id = M.id\r\n\t\t\t\tINNER JOIN productos Pr ON Pr.id = M.productos_id \r\n\t\t\t\tWHERE (CI.pedidos_id IS NULL) & (CI.belongsTo IS NULL) & (CI.ventas_id IS NULL)& (CI.producciones_id IS NULL)\r\n\t\t\t\tORDER BY Pr.nombre\"; \r\n\t\t\t\t\r\n\t \t$query = $this->con->prepare($sql, array(), MDB2_PREPARE_RESULT); \t\r\n\t \t$query = $query->execute();\t\r\n\t \t\r\n\t\t$results = $query->fetchAll();\r\n\t\t$i = 0;\r\n\t\t$resultsFormat = array();\r\n\t\t//Proceso los reposicion \r\n\t\t$resultsFormat['reposicion']['modelos'] = array();\r\n\t\t$m = 0;\r\n\t\twhile(($i < count($results))&&($results[$i]['pedidos_id'] == null)){\r\n\t\t\t$resultsFormat['reposicion']['modelos'][$m]['modelos_id'] = $results[$i]['modelos_id'];\r\n\t\t\t$resultsFormat['reposicion']['modelos'][$m]['id'] = $results[$i]['id'];\r\n\t\t\t$resultsFormat['reposicion']['modelos'][$m]['nombre'] = utf8_encode($results[$i]['producto']).'-'.utf8_encode($results[$i]['modelo']);\r\n\t\t\t$resultsFormat['reposicion']['modelos'][$m++]['precio'] = $results[$i++]['precio'];\t\t\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t/************************************************\r\n\t\tPRODUCTOS SUELTOS QUE EL USUARIO DESEA IMPRIMIR\r\n\t\t************************************************/ \r\n\t\t\t\t\t\r\n\t\t$sql = \"SELECT CI.*, Pr.nombre as producto, Pr.precio, M.nombre as modelo \r\n\t\t \t\tFROM colaimpresion CI\r\n\t\t\t\tINNER JOIN modelos M ON CI.modelos_id = M.id\r\n\t\t\t\tINNER JOIN productos Pr ON Pr.id = M.productos_id \r\n\t\t\t\tWHERE CI.belongsTo = $userId\r\n\t\t\t\tORDER BY Pr.nombre\"; \r\n\t\t\t\t\r\n\t \t$query = $this->con->prepare($sql, array(), MDB2_PREPARE_RESULT); \t\r\n\t \t$query = $query->execute();\t\r\n\t \t\r\n\t\t$results = $query->fetchAll();\r\n\t\t$i = 0;\r\n\t\t$resultsFormat['sueltos']['modelos'] = array();\r\n\t\t$m = 0;\r\n\t\twhile(($i < count($results))&&($results[$i]['pedidos_id'] == null)){\r\n\t\t\t$resultsFormat['sueltos']['modelos'][$m]['modelos_id'] = $results[$i]['modelos_id'];\r\n\t\t\t$resultsFormat['sueltos']['modelos'][$m]['id'] = $results[$i]['id'];\r\n\t\t\t$resultsFormat['sueltos']['modelos'][$m]['nombre'] = utf8_encode($results[$i]['producto']).'-'.utf8_encode($results[$i]['modelo']);\r\n\t\t\t$resultsFormat['sueltos']['modelos'][$m++]['precio'] = $results[$i++]['precio'];\t\t\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t/************************************************\r\n\t\tPRODUCTOS DE PEDIDOS HECHOS EN TALLER\r\n\t\t************************************************/\r\n\t\t\r\n\t\t\r\n\t\t$sql = \"SELECT CI.*, Pr.nombre as producto, Pr.id as productos_id, SUM(PM.cantidad) as cantidad, CL.nombre as clientePM, CL.localidad as localidad\r\n\t\t\t\tFROM colaimpresion CI\r\n\t\t\t\tINNER JOIN modelos M ON CI.modelos_id = M.id\r\n\t\t\t\tINNER JOIN productos Pr ON Pr.id = M.productos_id \r\n\t\t\t\tINNER JOIN pedidos_modelos PM ON (PM.modelos_id = M.id) & (PM.pedidos_id = CI.pedidos_id)\r\n\t\t\t\tINNER JOIN pedidos P ON PM.pedidos_id = P.id\r\n\t\t\t\tINNER JOIN clientespm CL ON P.clientesPM_id = CL.id\t\t\t\r\n\t\t\t\tGROUP BY CI.pedidos_id, M.productos_id\t\r\n\t\t\t\tORDER BY CI.pedidos_id\";\r\n\t\t\t\t\r\n\t\t$query = $this->con->prepare($sql, array(), MDB2_PREPARE_RESULT); \t\r\n\t \t$query = $query->execute();\t\r\n\t \t\r\n\t\t$results = $query->fetchAll();\r\n\t\t$i=0;\r\n\t\t$m = 0;\r\n\t\t$iF = 0;\r\n\t\t//Proceso los pedidos \r\n\t\twhile($i < count($results)){\r\n\t\t\t$resultsFormat['pedidos'][$iF]['pedidos_id'] = $results[$i]['pedidos_id'];\r\n\t\t\t$resultsFormat['pedidos'][$iF]['clientePM']= utf8_encode($results[$i]['clientePM']).' - '.utf8_encode($results[$i]['localidad']);\r\n\t\t\t//los modelos\r\n\t\t\t$resultsFormat['pedidos'][$iF]['modelos'] = array();\r\n\t\t\t$m = 0;\r\n\t\t\twhile(($i < count($results))&&($resultsFormat['pedidos'][$iF]['pedidos_id'] == $results[$i]['pedidos_id'])){\r\n\t\t\t\t$resultsFormat['pedidos'][$iF]['productos'][$m]['productos_id'] = $results[$i]['productos_id'];\r\n\t\t\t\t$resultsFormat['pedidos'][$iF]['productos'][$m]['id'] = $results[$i]['id'];\r\n\t\t\t\t$resultsFormat['pedidos'][$iF]['productos'][$m]['nombre'] = utf8_encode($results[$i]['producto']);\r\n\t\t\t\t$resultsFormat['pedidos'][$iF]['productos'][$m++]['cantidad'] = $results[$i++]['cantidad'];\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t$iF++;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t/************************************************\r\n\t\tPRODUCTOS DE PRODUCCIONES DEVUELTAS\r\n\t\t************************************************/\r\n\t\t\r\n\t\t$sql = \"SELECT CI.*, Pr.nombre as producto, Pr.precio, M.nombre as modelo, R.nombre as responsable \r\n\t\t\t\tFROM colaimpresion CI\r\n\t\t\t\tINNER JOIN modelos M ON CI.modelos_id = M.id\r\n\t\t\t\tINNER JOIN productos Pr ON Pr.id = M.productos_id \r\n\t\t\t\tINNER JOIN producciones_modelos PM ON (PM.modelos_id = M.id) & (PM.producciones_id = CI.producciones_id)\r\n\t\t\t\tINNER JOIN producciones P ON PM.producciones_id = P.id\r\n\t\t\t\tINNER JOIN responsables R ON P.responsables_id = R.id\t\t\t\r\n\t\t\t\tGROUP BY CI.producciones_id, PM.id\t\t\t\t\r\n\t\t\t\tORDER BY CI.producciones_id\";\r\n\t\t\t\t\r\n\t\t$query = $this->con->prepare($sql, array(), MDB2_PREPARE_RESULT); \t\r\n\t \t$query = $query->execute();\t\r\n\t \t\r\n\t\t$results = $query->fetchAll();\r\n\t\t$i=0;\r\n\t\t$m = 0;\r\n\t\t$iF = 0;\r\n\t\t//Proceso las producciones \r\n\t\twhile($i < count($results)){\r\n\t\t\t$resultsFormat['producciones'][$iF]['producciones_id'] = $results[$i]['producciones_id'];\r\n\t\t\t$resultsFormat['producciones'][$iF]['responsable']= utf8_encode($results[$i]['responsable']);\r\n\t\t\t//los modelos\r\n\t\t\t$resultsFormat['producciones'][$iF]['modelos'] = array();\r\n\t\t\t$m = 0;\r\n\t\t\twhile(($i < count($results))&&($resultsFormat['producciones'][$iF]['producciones_id'] == $results[$i]['producciones_id'])){\r\n\t\t\t\t$resultsFormat['producciones'][$iF]['modelos'][$m]['modelos_id'] = $results[$i]['modelos_id'];\r\n\t\t\t\t$resultsFormat['producciones'][$iF]['modelos'][$m]['id'] = $results[$i]['id'];\r\n\t\t\t\t$resultsFormat['producciones'][$iF]['modelos'][$m]['nombre'] = utf8_encode($results[$i]['producto']).'-'.utf8_encode($results[$i]['modelo']);\r\n\t\t\t\t$resultsFormat['producciones'][$iF]['modelos'][$m++]['precio'] = $results[$i++]['precio'];\t\r\n\t\t\t}\r\n\t\t\t$iF++;\r\n\t\t}\r\n\t\t\r\n\t\t/************************************************\r\n\t\tPRODUCTOS DE DEVOLUCIONES DE VENTAS\r\n\t\t************************************************/\r\n\t\t\r\n\t\t$sql = \"SELECT CI.*, Pr.nombre as producto, Pr.precio, M.nombre as modelo \r\n\t\t\t\tFROM colaimpresion CI\r\n\t\t\t\tINNER JOIN modelos M ON CI.modelos_id = M.id\r\n\t\t\t\tINNER JOIN productos Pr ON Pr.id = M.productos_id \r\n\t\t\t\tWHERE not(CI.ventas_id IS NULL)\r\n\t\t\t\tORDER BY CI.ventas_id\";\r\n\t\t\t\t\r\n\t\t$query = $this->con->prepare($sql, array(), MDB2_PREPARE_RESULT); \t\r\n\t \t$query = $query->execute();\t\r\n\t \t\r\n\t\t$results = $query->fetchAll();\r\n\t\t$i = 0;\r\n\t\t$resultsFormat['ventas']['modelos'] = array();\r\n\t\t$m = 0;\r\n\t\twhile(($i < count($results))&&($results[$i]['pedidos_id'] == null)){\r\n\t\t\t$resultsFormat['ventas']['modelos'][$m]['modelos_id'] = $results[$i]['modelos_id'];\r\n\t\t\t$resultsFormat['ventas']['modelos'][$m]['id'] = $results[$i]['id'];\r\n\t\t\t$resultsFormat['ventas']['modelos'][$m]['nombre'] = utf8_encode($results[$i]['producto']).'-'.utf8_encode($results[$i]['modelo']);\r\n\t\t\t$resultsFormat['ventas']['modelos'][$m++]['precio'] = $results[$i++]['precio'];\t\t\t\t\t\t\r\n\t\t}\r\n\r\n\t\treturn $resultsFormat;\r\n\t}", "public function getLaingsburgPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '105'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function listProductsPack($params)\n{\n // $prdId = $this->db->real_escape_string($params);\n // $qry = \"SELECT pr.prd_id, pr.prd_sku, pr.prd_name, pr.prd_price, pk.prd_parent \n // FROM ctt_products_packages AS pk\n // INNER JOIN ctt_products AS pr ON pr.prd_id = pk.prd_id\n // WHERE pk.prd_parent = $prdId AND prd_status =1;\";\n // return $this->db->query($qry);\n}", "public function getGeorgePropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '108'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function f_get_distPoints()\n {\n\n // $sql = $this->db->query(\"SELECT DISTINCT a.sl_no, b.bdo_name \n // FROM md_dist_point a , md_dm_bdo b \n // WHERE a.dist_cd = b.dist_cd\n // AND a.sdo = b.sdo_cd\n // AND a.bdo = b.sl_no \");\n\n$sql = $this->db->query(\"SELECT DISTINCT a.sl_no, b.bdo_name,c.sdo_name sdo_name,a.agent\n FROM md_dist_point a , md_dm_bdo b ,md_dm_sdo c\n WHERE a.dist_cd = b.dist_cd \n AND b.dist_cd = c.dist_cd\n and a.sdo =c.sl_no\n and a.bdo = b.sl_no\");\n echo $this->db->last_query();\n return $sql->result();\n \n }", "public function getSearchProducts($id=0,$limit=0, $start=0) {\n //$option = \"\";\n $value = \"\";\n if(isset($_REQUEST['country'])&&($_REQUEST['country']!='')){\n $this->session->set_userdata(\"value\",$_REQUEST['country']);\n $value = $this->session->userdata(\"value\");\n }\n \n $this->db->select(\"prod.store_id,st.store_name,st.store_slug,GROUP_CONCAT(DISTINCT(`pimg`.`image_path`)) as image_path,GROUP_CONCAT(DISTINCT(`pimg`.`image_id`)) as image_ids,patr.attribute_type_id,GROUP_CONCAT(patr.attribute_id) as attribute_id,pcat.category_id,(SELECT GROUP_CONCAT(DISTINCT(category_name)) as category_name \n FROM category\n WHERE category_id = pcat.category_id) as category_name,prod.product_id,prod.name,prod.offer_price,prod.inventory,prod.full_description,prod.upload_date,prod.actual_price,prod.sku\");\n $this->db->from('product prod');\n $this->db->join('product_attributes patr', 'prod.product_id=patr.product_id', 'INNER');\n $this->db->join('product_images pimg', 'prod.product_id=pimg.product_id', 'INNER');\n $this->db->join('product_category pcat', 'prod.product_id=pcat.product_id', 'INNER');\n $this->db->join('category cat', 'cat.category_id=pcat.product_category_id', 'INNER');\n $this->db->join('store st', 'st.store_id=prod.store_id', 'INNER');\n // $this->db->join('slider sl','st.store_id=sl.store_id','LEFT');\n if (isset($value) && ($value != \"\")) {\n $this->db->like('prod.name', $value);\n \n }\n \n // $this->db->where_in('cat.category_id', array('31','32','33'));\n $this->db->group_by('prod.product_id');\n\n\n //if($limit>0 && $start>0){\n $this->db->limit($limit, $start);\n // }\n $query = $this->db->get();\n\n\n return $query->result();\n }", "function get_all_data_gcs($id='',$id_transportista='',$id_empresa=''){\n\t\t$sQuery=\"SELECT \n\t\t\t\tcontrol_salida_extra.*,\n\t\t\t\tempresa.id as empresa_id, empresa.rif as empresa_rif, empresa.telefono as empresa_telefono, empresa.responsable as empresa_responsable, empresa.naturaleza as empresa_naturaleza, empresa.adelanto as empresa_adelanto, empresa.especial as empresa_especial, empresa.descripcion as empresa_descripcion,\n\t\t\t\ttransportista.id as transportista_id, transportista.rif as transportista_rif, transportista.telefono as transportista_telefono, transportista.nombre as transportista_nombre , transportista.apellido as transportista_apellido\n\t\t\t\tFROM control_salida_extra\n\t\t\t\tInner Join transportista ON control_salida_extra.id_transportista = transportista.id\n\t\t\t\tInner Join empresa ON control_salida_extra.id_empresa = empresa.id\n\t\t\t\t\n\t\t\t\tWHERE 1=1\";\n\t\tif($id) {\t$sQuery.=\" AND control_salida_extra.id in($id) \";\t}\n\t\tif($id_transportista) {\t$sQuery.=\" AND control_salida_extra.id_transportista = '$id_transportista' \";\t}\n\t\tif($id_empresa) {\t$sQuery.=\" AND empresa.id = '$id_empresa' \";\t}\n\t\t$sQuery.=\" ORDER BY empresa.naturaleza,empresa.descripcion,transportista.apellido,transportista.nombre,control_salida_extra.id_por_sucursal DESC \";\n\t\t//die($sQuery);\n\t\t\n\t\t$result=mssql_query($sQuery) or die(mssql_min_error_severity());\n\t\t$i=0;\n\t\twhile($row=mssql_fetch_array($result)){\n\t\t\tforeach($row as $key=>$value){\n\t\t\t\t$res_array[$i][$key]=$value;\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t\treturn($res_array);\n\t\t\n\t\t\t\t\n\t}", "function getImages($id,$table){\n\t\t$db;\t\t\t\t\n\t\t// Open the database connection\n\t\t//if (!($db = pg_connect( 'host=postgres.int.devisland.net dbname=db_piccicla user=piccicla password=fidelin1'))) {\n\t\tif (!($db = pg_connect( 'host=localhost dbname=landscape user=postgres password=fidelin1'))){\n\t\t// Handle errors\n\t\t // i used die because with echo the script continued\n\t\t //Echo \"{success:false, msg:'SQL ERROR: Connection failed'}\";\t\t\t \n\t\t die();\t\t\t\n\t\t}\n\t\t\t\n\t\t$sql = 'select \"LINK\" from \"landscape\".\"'.$table.'\" where \"ART_ID\"='.$id;\n\t\t\n\t\t$results = array();\n\n\t\t// Read all the data back in as associative arrays\n\t\tIf (!$rs = pg_query($db, $sql) ){\n\t\t\t\tif ($db){\n\t\t\t\t\tpg_close($db);\n\t\t\t\t}\n\t\t\t\ttrigger_error('problems reading the database');\n\t\t\t\tdie();\n\t\t}else{\t\t\n\t\twhile($obj = pg_fetch_object($rs)){\n\t\t\t$results[] = $obj;\n\t\t}}\n\t\t//close the connection\n\t\tpg_close($db);\n\t\t//print_r($results);\n\t\t//trigger_error('problems reading the database');\n //die();\n\t\treturn $results;\t\t\n}", "public function get_image_rows_data($gallery_id, $params, $total = FALSE) {\n global $wpdb;\n\t$rows = array();\n $order = $params['order'];\n $orderby = $params['orderby'];\n $page_per = $params['items_per_page'];\n $page_num = $params['page_num'];\n $search = $params['search'];\n\n $ecommerce_addon = function_exists('BWGEC');\n\n if ( !$total ) {\n $query = 'SELECT T_IMAGE.*';\n if ( $ecommerce_addon ) {\n $query .= \", T_PRICELISTS.title AS priselist_name, T_PRICELIST_ITEMS.item_longest_dimension, T_PRICELISTS.sections\";\n }\n }\n else {\n $query = 'SELECT COUNT(*)';\n }\n $query .= ' FROM `' . $wpdb->prefix . 'bwg_image` AS T_IMAGE';\n if ( $ecommerce_addon ) {\n $query .= \" LEFT JOIN `\" . $wpdb->prefix . \"wdpg_ecommerce_pricelists` AS T_PRICELISTS ON T_IMAGE.pricelist_id = T_PRICELISTS.id\";\n $query .= \" LEFT JOIN ( SELECT MAX(item_longest_dimension) AS item_longest_dimension, pricelist_id FROM `\" . $wpdb->prefix . \"wdpg_ecommerce_pricelist_items` GROUP BY pricelist_id) AS T_PRICELIST_ITEMS ON T_PRICELIST_ITEMS.pricelist_id = T_PRICELISTS.id\";\n }\n if ( !current_user_can('manage_options') && BWG()->options->image_role ) {\n $query .= \" WHERE author=\" . get_current_user_id();\n }\n else {\n $query .= \" WHERE author>=0\";\n }\n $query .= \" AND `gallery_id`=\" . $gallery_id;\n\t $search_where = '';\n if ( $search ) {\n $search_keys = explode(' ', trim($search));\n $alt_search = '(';\n $filename_search = '(';\n $description_search = '(';\n foreach( $search_keys as $search_key) {\n $alt_search .= '`T_IMAGE`.`alt` LIKE \"%' . trim($search_key) . '%\" AND ';\n $filename_search .= '`T_IMAGE`.`filename` LIKE \"%' . trim($search_key) . '%\" AND ';\n $description_search .= '`T_IMAGE`.`description` LIKE \"%' . trim($search_key) . '%\" AND ';\n }\n $alt_search = rtrim($alt_search, 'AND ');\n $alt_search .= ')';\n $filename_search = rtrim($filename_search, 'AND ');\n $filename_search .= ')';\n $description_search = rtrim($description_search, 'AND ');\n $description_search .= ')';\n $search_where = ' AND (' . $filename_search . ' OR ' . $alt_search . ' OR ' . $description_search . ') ';\n }\n\t$query .= $search_where;\n if ( !$total ) {\n $query .= ' ORDER BY `' . $orderby . '` ' . $order;\n $query .= ' LIMIT ' . $page_num . ',' . $page_per;\n }\n if ( !$total ) {\n $rows = $wpdb->get_results($query);\n if ( $ecommerce_addon ) {\n foreach ( $rows as $value ) {\n $value->not_set_items = 0;\n if ( $value->item_longest_dimension && strpos($value->sections, \"downloads\") !== FALSE ) {\n $file_path = str_replace(\"thumb\", \".original\", htmlspecialchars_decode(BWG()->upload_dir . $value->thumb_url, ENT_COMPAT | ENT_QUOTES));\n WDWLibrary::repair_image_original($file_path);\n list($img_width) = @getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));\n if ( $value->item_longest_dimension > $img_width ) {\n $value->not_set_items = 1;\n }\n }\n }\n }\n $rows['template'] = new stdClass();\n $rows['template']->id = \"tempid\";\n $rows['template']->gallery_id = $gallery_id;\n $rows['template']->order = 0;\n $rows['template']->published = 1;\n $rows['template']->tags = array();\n $rows['template']->image_url = \"tempimage_url\";\n $rows['template']->thumb_url = \"tempthumb_url\";\n $rows['template']->filename = \"tempfilename\";\n $rows['template']->date = \"tempdate\";\n $rows['template']->resolution = \"tempresolution\";\n $rows['template']->resolution_thumb = \"tempthumbresolution\";\n $rows['template']->size = \"tempsize\";\n $rows['template']->filetype = \"tempfiletype\";\n $rows['template']->description = \"tempdescription\";\n $rows['template']->alt = \"tempalt\";\n $rows['template']->author = get_current_user_id();\n $rows['template']->comment_count = 0;\n $rows['template']->avg_rating = 0;\n $rows['template']->rate_count = 0;\n $rows['template']->hit_count = 0;\n $rows['template']->redirect_url = '';\n $rows['template']->pricelist_id = 0;\n $rows['template']->priselist_name = '';\n $rows['template']->not_set_items = 0;\n $rows['template']->modified_date = '';\n\n foreach ( $rows as $key => $value ) {\n $value->tags = $this->get_tag_rows_data($value->id);\n $value->pure_image_url = $value->image_url;\n $value->pure_thumb_url = $value->thumb_url;\n $value->image_url = WDWLibrary::image_url_version($value->image_url, $value->modified_date);\n $value->thumb_url = WDWLibrary::image_url_version($value->thumb_url, $value->modified_date);\n if ( $key != 'template') {\n $value->pure_image_url = esc_url($value->pure_image_url);\n $value->pure_thumb_url = esc_url($value->pure_thumb_url);\n $value->image_url = esc_url($value->image_url);\n $value->thumb_url = esc_url($value->thumb_url);\n }\n }\n }\n else {\n $rows = $wpdb->get_var($query);\n }\n return $rows;\n }", "private function getMateriais() {\n\n $oDaoMaterial = new cl_matmater();\n $sCampos = \" m60_codmater as codigo, m60_descr as descricao, m61_descr as unidade\";\n\n $sCamposGrupo = \" , 0 as codigogrupo \";\n if ($this->lAgruparGrupoSubgrupo) {\n $sCamposGrupo = \" , m65_sequencial as codigogrupo \";\n }\n $sCampos .= $sCamposGrupo;\n\n $aOrdem = array();\n $aWhere = array();\n $aWhere[] = \" instit = {$this->iInstituicao} \";\n\n $aOrdem[] = \" m60_descr \";\n\n if ($this->sDepartamentos) {\n $aWhere[] = \" m70_coddepto in ({$this->sDepartamentos}) \";\n }\n\n if ($this->sGrupoSubgrupo) {\n $aWhere[] = \" db121_sequencial in ({$this->sGrupoSubgrupo}) \";\n }\n\n $sCampoDepartamento = \", 0 as depto, '' as departamento\";\n if ($this->iQuebraPagina == RelatorioDeDistribuicao::QUEBRA_PAGINA_DEPARTAMENTO) {\n $sCampoDepartamento = \", m70_coddepto as depto, descrdepto as departamento \";\n }\n $sCampos .= $sCampoDepartamento;\n $sWhere = \" where \" . implode(\" and \", $aWhere);\n $sOrdem = \" order by \" . implode(\", \", $aOrdem);\n\n $sql = \" select distinct {$sCampos} \";\n $sql .= \" from matmater \";\n $sql .= \" inner join matunid on m60_codmatunid = m61_codmatunid \";\n $sql .= \" inner join matmatermaterialestoquegrupo on m60_codmater = m68_matmater \";\n $sql .= \" inner join materialestoquegrupo on m68_materialestoquegrupo = m65_sequencial \";\n $sql .= \" inner join db_estruturavalor on db121_sequencial = m65_db_estruturavalor \";\n $sql .= \" inner join matestoque on m60_codmater = m70_codmatmater \";\n $sql .= \" inner join db_depart on coddepto = m70_coddepto \";\n\n\n $sql .= \"{$sWhere} {$sOrdem} \";\n\n $rsMateriais = $oDaoMaterial->sql_record($sql);\n\n $aMateriais = array();\n for ($i = 0; $i < $oDaoMaterial->numrows; $i++) {\n\n $oMaterial = db_utils::fieldsMemory($rsMateriais, $i);\n $oMaterial->totalPeriodo = 0.0;\n $oMaterial->mediaPeriodo = 0.0;\n $aMateriais[] = $oMaterial;\n\n if (!isset($this->aDepartamentos[$oMaterial->depto])) {\n\n $oDeptartamento = new stdClass();\n $oDeptartamento->codigo = $oMaterial->depto;\n $oDeptartamento->descricao = $oMaterial->departamento;\n $oDeptartamento->itens = array();\n $this->aDepartamentos[$oDeptartamento->codigo] = $oDeptartamento;\n }\n }\n return $aMateriais;\n }", "function sql_photo_tag($theme, $sorting)\n{\n if ($sorting == \"year\")\n $sort = \"RP.year, RL.location_name, RP.seqno\";\n else\n $sort = \"RL.location_name, RP.seqno\";\n\n $sql = \"\n select\n RL.line_state,\n RL.line_name,\n RL.location_state,\n RL.location_name,\n RP.file,\n RP.seqno,\n RP.year,\n IFNULL(U.fullname, IFNULL(RP.legacy_owner, 'Rolfe Bozier')) as owner,\n RP.owner_uid,\n RP.caption\n from\n r_line_location RL,\n r_location_photo RP left join r_user U on RP.owner_uid = U.uid\n where\n RL.location_state = RP.location_state\n and\n RL.location_name = RP.location_name\n and\n RL.mainline = 'Y'\n and\n RP.hold is null\n and\n FIND_IN_SET('$theme', RP.tags) > 0\n order by\n $sort\n \";\n\n return [$sql, [], []];\n}", "public function getAllProduct(){\n\t\t//query for get all data from tbl_product combinning with tbl_category(catName) and tbl_brand(brandName) using INNER JOIN\n\t\t$sql = \"SELECT tbl_product.*, tbl_category.catName, tbl_brand.brandName\n\t\t\t\tFROM tbl_product\n\t\t\t\tINNER JOIN tbl_category\n\t\t\t\tON tbl_product.catId = tbl_category.catId\n\t\t\t\tINNER JOIN tbl_brand\n\t\t\t\tON tbl_product.brandId = tbl_brand.brandId\n\t\t\t\tORDER BY tbl_product.pid DESC \";\n\t\t//Same Query using Alias(giving a temporary name to a table or Column)\n\t\t/*$sql = \"SELECT p.*, c.catName, b.brandName\n\t\t\t\tFROM tbl_product AS p, tbl_category AS c, tbl_brand AS b\n\t\t\t\tWHERE p.catId = c.catId AND p.brandId = b.brandId\n\t\t\t\tORDER BY p.pid DESC \";*/\n\t\t$result = $this->db->select($sql);\n\t\tif ($result) {\n\t\t\treturn $result;\n\t\t}else{\n\t\t\t$msg = \"<span class='error'>Product not found !.</span>\";\n\t\t\treturn $msg;\n\t\t}\n\t}", "function listQueryGajiHonorer() {\n $sql = \"select p.idpegawai,\" . static::schema() . \"f_namalengkap(gelardepan,namadepan,namatengah,namabelakang,gelarbelakang) as namalengkap,\n\t\t\t\t\tnamapendidikan,namaunit,th.nominal as tarif,g.isfinish,g.gajiditerima\n\t\t\t\t\tfrom \" . static::table('ga_gajipeg') . \" g \n\t\t\t\t\tleft join \" . static::table('ms_pegawai') . \" p on p.idpegawai=g.idpegawai\n\t\t\t\t\tleft join \" . static::table('lv_jenjangpendidikan') . \" j on j.idpendidikan=p.idpendidikan\n\t\t\t\t\tleft join \" . static::table('ms_unit') . \" u on u.idunit=p.idunit\n\t\t\t\t\tleft join \" . static::table('ga_tarifhonorer') . \" th on th.idpendidikan=p.idpendidikan\n\t\t\t\t\twhere p.idstatusaktif in (select idstatusaktif from \" . static::table('lv_statusaktif') . \" where isdigaji='Y')\n\t\t\t\t\tand idhubkerja in ('HP')\";\n return $sql;\n }", "function pnh_getdeals()\r\n\t{\r\n\t\t$sql = \"select ifnull(group_concat(smd.special_margin),0) as sm,d.publish,d.brandid,d.catid,i.orgprice,\r\n\t\t\t\t\t\ti.price,i.name,i.pic,i.pnh_id,i.id as itemid,\r\n\t\t\t\t\t\tb.name as brand,c.name as category \r\n\t\t\t\t\tfrom king_deals d \r\n\t\t\t\t\tjoin king_dealitems i on i.dealid=d.dealid \r\n\t\t\t\t\tjoin king_brands b on b.id=d.brandid \r\n\t\t\t\t\tjoin king_categories c on c.id=d.catid \r\n\t\t\t\t\tleft join pnh_special_margin_deals smd on i.id = smd.itemid and smd.from <= unix_timestamp() and smd.to >=unix_timestamp() \r\n\t\t\t\t\twhere i.is_pnh=1 \r\n\t\t\t\t\tgroup by i.id \r\n\t\t\t\t\torder by i.sno desc\r\n\t\t\t\t\tlimit 30 \r\n\t\t\t\t\";\r\n\t\treturn $this->db->query($sql)->result_array();\r\n\t}", "public function getShortSplit() {\n $req = 'SELECT tbljobs.id_tbljob, tbljobs.id_info_job,\n customer, job, split, po_number, devis, info_jobs.instruction as info_jobs_instruction, info_jobs.commentaire as info_jobs_commentaire, inOut_recommendation,schedule_recommendation,\n activity_type, specific_test,\n contacts.genre, contacts.prenom, contacts.nom, contacts.email as email, contacts.telephone as telephone, contacts.prenom, contacts.nom, contacts.departement, contacts.rue1, contacts.rue2, contacts.ville, contacts.pays,\n contacts2.genre as genre2, contacts2.prenom as prenom2, contacts2.nom as nom2, contacts2.email as email2, contacts2.telephone as telephone2,\n contacts3.genre as genre3, contacts3.prenom as prenom3, contacts3.nom as nom3, contacts3.email as email3, contacts3.telephone as telephone3,\n contacts4.genre as genre4, contacts4.prenom as prenom4, contacts4.nom as nom4, contacts4.email as email4, contacts4.telephone as telephone4,\n tbljob_commentaire, tbljob_instruction, tbljob_commentaire_qualite, planning, tbljob_frequence,\n GE, specific_protocol, special_instruction, staircase,\n createur, t1.technicien as nomCreateur, t2.technicien as comCheckeur,\n test_type, test_type_abbr, test_type_cust, ST,final, auxilaire, tbljobs.id_rawData,\n report_rev, invoice_type, invoice_date, invoice_commentaire, invoice_lang, invoice_currency,\n specification, ref_matiere, matiere, tbljobs.waveform,\n other_1, other_2, other_3, other_4, other_5,\n type1.consigne_type as c_type_1, type2.consigne_type as c_type_2, c_unite,\n type1.id_consigne_type as id_c_type_1, type2.id_consigne_type as id_c_type_2,\n DyT_SubC, DyT_expected, DyT_Cust, available_expected, report_send,\n checked, comments, contacts.adresse,\n contactST.id_contact as id_contactST, contactST.genre as genreST, contactST.prenom as prenomST, contactST.nom as nomST,entrepriseST.id_entreprise as id_entrepriseST, entrepriseST.entreprise as entrepriseST, entrepriseST.entreprise_abbr as entreprise_abbrST, refSubC,\n\n entreprises.entreprise, entreprises.VAT, entreprises.MRSASRef, entreprises.billing_rue1, entreprises.billing_rue2, entreprises.billing_ville, entreprises.billing_pays\n\n\n FROM tbljobs\n LEFT JOIN test_type ON test_type.id_test_type=tbljobs.id_type_essai\n LEFT JOIN info_jobs ON info_jobs.id_info_job=tbljobs.id_info_job\n LEFT JOIN contacts ON contacts.id_contact=info_jobs.id_contact\n LEFT JOIN contacts contacts2 ON contacts2.id_contact=info_jobs.id_contact2\n LEFT JOIN contacts contacts3 ON contacts3.id_contact=info_jobs.id_contact3\n LEFT JOIN contacts contacts4 ON contacts4.id_contact=info_jobs.id_contact4\n LEFT JOIN contacts contactST ON contactST.id_contact=tbljobs.id_contactST\n LEFT JOIN entreprises entrepriseST ON entrepriseST.id_entreprise=contactST.ref_customer\n LEFT JOIN entreprises ON entreprises.id_entreprise=info_jobs.customer\n LEFT JOIN matieres ON matieres.id_matiere=info_jobs.id_matiere_std\n LEFT JOIN consigne_types as type1 ON type1.id_consigne_type=tbljobs.c_1\n LEFT JOIN consigne_types as type2 ON type2.id_consigne_type=tbljobs.c_2\n LEFT JOIN techniciens as t1 on t1.id_technicien=tbljobs.modif\n LEFT JOIN techniciens as t2 on t2.id_technicien=tbljobs.checked\n\n\n WHERE tbljobs.id_tbljob='.$this->id.';';\n //echo $req;\n return $this->db->getOne($req);\n }", "public function getNominaEtau3($id,$idg)\n { \n $result=$this->adapter->query('select distinct c.idNom, c.id, a.idCon, \n case a.cCosEmp when 0 then a.idCcos\n when 1 then b.idCcos End as idCcos, \n case a.horasCal when 0 then 0 \n when 1 then (c.dias*'.$this->horasDias.') End as horas, 1, \n case when g.valor=2 then \n case when g.tipo = 1 then a.valor else 0 End\t\t\t\t \n when g.valor=1 then 0 \n End as dev, \n case when g.valor=2 then \n case when g.tipo = 2 then a.valor else 0 End\t\t\t\t \n when g.valor=1 then 0 \n\t\tEnd as ded, h.formula, c.dias, g.tipo , b.id as idEmp , g.idFor , a.diasLab, c.diasVac, a.vaca, \n case when ii.codigo is null then \"\" else ii.codigo end as nitTer \n from n_tip_auto_i a inner join a_empleados b on a.idTauto=b.idTau3\n inner join n_nomina_e c on b.id=c.idEmp \n inner join n_nomina d on d.id=c.idNom\n inner join n_tip_auto_tn e on e.idTnom=d.idTnom \n inner join n_tip_calendario f on f.id=d.idCal\n inner join n_conceptos g on g.id=a.idCon\n inner join n_formulas h on h.id=g.idFor\n left join n_terceros_s i on i.id = g.idTer \n left join n_terceros ii on ii.id = i.idTer \n WHERE not exists (SELECT null from n_nomina_e_d \n where c.id=idInom and a.idCon=idConc and a.idCcos=idCcos and tipo=1 ) \n and d.estado=0 and b.idGrup='.$idg.' and c.idNom='.$id,Adapter::QUERY_MODE_EXECUTE);\n $datos=$result->toArray();\n return $datos; \n }", "function displayOrganismList($db, &$annot_list){\n $query=\"select distinct o.organism_name as name,ucsc_db as version,\";\n $query.=\" o.organism_id,ov.organism_version_id as version_id\";\n $query.=\" from organism o,organism_version ov\";\n $query.=\" where o.organism_id=ov.organism_id \";\n if(!empty($db)){\n $list=array(); $list=explode(\",\",$db);$query.=\" and ucsc_db in(\";$i=0;\n while($i<count($list)){$db=$list[$i];\n if($i==0)$query.=\"'$db'\";else $query.=\",'$db'\";++$i;\n }$query.=\")\";\n }$query.=\" order by organism_name\";global $con;\n if(!$con)$con=getConnection();$result =mysql_query(\"$query\",$con);$data= array();\n if($result){\n while($row = mysql_fetch_assoc($result))\n { $name=$row[\"name\"];$version=$row[\"version\"];$org_id=$row[\"organism_id\"];$version_id=$row[\"version_id\"];\n $annot_list[]=array('organism'=>array('name'=>$name,'version'=>$version,'organism_id'=>$org_id,'version_id'=>$version_id));\n }mysql_free_result($result);\n } \n}", "function consultar($where='',$group='',$ord='') {\n if ($this->con->conectar() == true) {\n \n\t\t\t$Sql = \"SELECT \n\t\t\t\t\t\ttrabajador.trabCedula,\n\t\t\t\t\t\tCONCAT(trabajador.trabNombre,' ',trabajador.trabApellido) AS trabNombres,\n\t\t\t\t\t\ttrabajador.trabNombre, \n\t\t\t\t\t\ttrabajador.trabApellido,\n\t\t\t\t\t\ttrabajador.trabOrganismoId,\n\t\t\t\t\t\torganismo.organismoDescripcion,\n\t\t\t\t\t\ttrabajador.trabDepartmentoId,\n\t\t\t\t\t\tdepartamento.departamentoDescripcion,\n\t\t\t\t\t\ttipo_prestamo.tipoprestNombre,\t\n\t\t\t\t\t\tprestamos.*,\n\t\t\t\t\t\tliquidacion.*,\n\t\t\t\t\t\tdetalle_liquidacion.*\n\n\t\t\t\t\tFROM detalle_liquidacion\n\t\t\t\t\t\t\tLEFT JOIN prestamos ON detalle_liquidacion.detliqPrestamoId = prestamos.prestamoId\t\t\n\t\t\t\t\t\t\tLEFT JOIN tipo_prestamo ON prestamos.prestamoTipoprestId = tipo_prestamo.tipoprestId\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tLEFT JOIN trabajador ON trabajador.trabCedula = prestamos.prestamoTrabCedula\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tLEFT JOIN organismo ON trabajador.trabOrganismoId = organismo.organismoId\n\t\t\t\t\t\t\tLEFT JOIN departamento ON trabajador.trabDepartmentoId = departamento.departamentoId\n\t\t\t\t\t\t\tLEFT JOIN liquidacion ON detalle_liquidacion.detliqLiquidacionCodigo = liquidacion.liquidacionCodigo\n\n\t\t\t\t\t$where\t\n\t\t\t\t\t$group\n\t\t\t\t\t$ord\n\t\t\t\t\t\";\n $this->resultado= mysql_query($Sql);\n return true;\n }\n }", "public function getSkuName ()\n {\n $sql = \" SELECT t1.id,sku_name,sku_description,sku_code,sku_weight_id,sku_lpc,sku_volume,sku_launch_date,t8.sku_type_name,\n GROUP_CONCAT(t5.unit_name SEPARATOR '<br /><br />') AS unit,t2.quantity,\n GROUP_CONCAT(ROUND(t2.db_lifting_price,2) SEPARATOR '<br /><br />') as db_lifting_price ,\n GROUP_CONCAT(ROUND(t2.outlet_lifting_price,2) SEPARATOR '<br /><br />') AS outlet_lifting_price,\n GROUP_CONCAT(ROUND(t2.mrp_lifting_price,2) SEPARATOR '<br /><br /> ') AS mrp_lifting_price ,\n t3.element_name,t4.sku_active_status_name,t5.unit_name,t6.element_name as product,\n t7.element_name as catagory\n FROM tbld_sku AS t1\n INNER JOIN\n `tbli_sku_mou_price_mapping` AS t2\n ON t1.id = t2.sku_id\n INNER JOIN\n tbld_sku_active_status AS t4\n ON t1.sku_active_status_id = t4.id\n INNER JOIN\n tbld_sku_hierarchy_elements AS t3\n ON t1.parent_id = t3.id\n INNER JOIN\n tbld_unit AS t5\n ON t5.id= t2.mou_id\n left join tbld_sku_hierarchy_elements as t6\n on t6.id = t3.parent_element_id\n left join tbld_sku_hierarchy_elements as t7\n on t7.id = t6.parent_element_id\n left Join `tbld_sku_type` as t8\n On t1.sku_type_id=t8.id\n GROUP BY t2.sku_id\n ORDER BY t2.sku_id,t2.quantity asc\";\n $query = $this->db->query( $sql )->result_array();\n return $query;\n }", "public function Get_Category_Row_From_Category(){\n\n\n $query = $this->db->query(\"SELECT p.pid,GROUP_CONCAT(c.cname) as mysummary FROM products p, category c WHERE FIND_IN_SET(c.cid, p.product_category) GROUP BY p.pname ORDER BY p.pid\");\n\n //$result = $query->result();\n\n $result = $query->result();\n\n /*\n foreach ($result as $value){ \n \n $result[] = $value->mysummary; \n\n } */\n \n\n //print_r($result);\n //die();\n\n if(!empty($result)){\n\n return $result;\n\n }else{\n\n return false;\n }\n\n\n}", "public function getMosselBayPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '103'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getStellenboschPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '99'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "function getAllImages() {\r\r\n\t$PView = new PView;\r\r\n\t$Template = new Template;\r\r\n\tglobal $tp;\r\r\n\t\r\r\n\t$pv_Appl = $PView -> getAppl();\r\r\n\t$ImageData = array();\r\r\n\t\r\r\n// prepare album-handling\r\r\n\tif ($pv_Appl[0] == \"album\"){\r\r\n\t\t$ImageCount = $PView -> getAlbumImageCount();\r\r\n\t\t$details = $PView->getPView_config(\"album_details\");\r\r\n\t\t$message = LAN_ALBUM_9;\r\r\n\t}\r\r\n// prepare category-handling\r\r\n\tif ($pv_Appl[0] == \"cat\"){\r\r\n\t\t$ImageCount = $PView -> getCatImageCount($pv_Appl[1]);\r\r\n\t\t$details = $PView->getPView_config(\"cat_details\");\r\r\n\t\t$message = LAN_GALLERY_12;\r\r\n\t}\t\r\r\n// prepare userimage-handling\r\r\n\tif ($pv_Appl[0] == \"user\"){\r\r\n\t\t$ImageCount = $PView -> getUserImageCount($pv_Appl[1]);\r\r\n\t\t$details = $PView->getPView_config(\"user_details\");\r\r\n\t\t$message = LAN_GALLERY_13;\r\r\n\t}\r\r\n\t\r\r\n\tglobal $applImages;\r\r\n\t$ImageData = $PView->sortApplImages($applImages);\r\r\n\t$showDetails = explode(\"|\",$details);\r\r\n\t\r\r\n\tif ($ImageCount) {\r\r\n\t\t$cols = 1;\r\r\n\t\t$pics = $PView -> getPView_config(\"pics_per_page\");\r\r\n\t\t$picCount = 0;\r\r\n\t\t$colwidth = 100/$cols;\r\r\n\t\tif ($_GET['page']) {\r\r\n\t\t\t$page = $_GET['page'];\r\r\n\t\t}\r\r\n\t\t$Pages = ceil($ImageCount/$pics);\r\r\n\t\tif (!$page or $page > $Pages) {\r\r\n\t\t\t$page = 1;\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\t\r\r\n\t\t$out_AllImages = \"<tr>\";\r\r\n\t\tforeach ($ImageData as $dataset) {\r\r\n\t\t\t//PERMISSION!!!\r\r\n\t\t\tif ($PView -> getPermission(\"image\",$dataset['imageId'],\"View\")) {\r\r\n\t\t\t\t// insert images line by line, observe pagelimit\r\r\n\t\t\t\tif ($colCount == $cols) {\r\r\n\t\t\t\t\t$out_AllImages.= \"</tr><tr>\";\r\r\n\t\t\t\t\t$colCount = 0;\r\r\n\t\t\t\t}\r\r\n\t\t\t\tif ($picCount >= ($page - 1) * $pics && $picCount < $page * $pics) {\r\r\n\t\t\t\t\t$thumb = $PView -> getResizePath($dataset['imageId']);\r\r\n\t\t\t\t\tif ($PView->getPView_config(\"seo_links\")){\r\r\n\t\t\t\t\t\t$seo = \"&amp;name=\".$dataset['name'];\r\r\n\t\t\t\t\t} else {\r\r\n\t\t\t\t\t\t$seo = \"\";\r\r\n\t\t\t\t\t}\t\r\r\n\t\t\t\t\tif ($PView->getPView_config(\"center_thumbs\")){\r\r\n\t\t\t\t\t\t$infoPos = \"left:30%;\";\r\r\n\t\t\t\t\t} else{\r\r\n\t\t\t\t\t\t$infoPos = \"left:10px;\";\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\t$backgr = \"background:url(\".e_PLUGIN.\"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/images/gt.png) repeat;\";\t\t\r\r\n\t\t\t\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t$out_AllImages.= \"<td style='vertical-align:top;width:\".$colwidth.\"%; border: #b7b5b5 1px solid; padding:5px; \".$Template->getThumbPosition().\"'><div style='position:relative;'><div style='position:relative;'>\".$Template -> getImageLink($pv_Appl[0],$dataset,'resize','resize','pview_gal').\"</div>\";\r\r\n\t\t\t\t\t\r\r\n\t\t\t\t\t$out_AllImages.= \"<div style='position:absolute; bottom:10px; \".$infoPos.\" width:40%; border: 2px solid #b7b5b5; text-align:left; padding: 5px; \".$backgr.\"'>\";\r\r\n\t\t\t\t\tforeach($showDetails as $detail){\r\r\n\t\t\t\t\t\t\r\r\n\t\t\t\t\t\tswitch($detail){\r\r\n\t\t\t\t\t\t\tcase \"name\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<span><b>\".$tp -> toHTML($dataset['name']).\"</b></span>\";\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"descr\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($dataset['description']).\"</span>\";\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"user\":\r\r\n\t\t\t\t\t\t\t$userData = $PView->getUserData($dataset['uploaderUserId']);\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige aller Bilder des Users\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?user=\".$dataset['uploaderUserId'].\"'><span>\".$tp -> toHTML($userData['user_name']).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($userData['user_name']).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"cat\":\r\r\n\t\t\t\t\t\t\tif ($catData = $PView -> getCatData($dataset['cat'])){\r\r\n\t\t\t\t\t\t\t\t$catName = $catData['name'];\r\r\n\t\t\t\t\t\t\t} else {\r\r\n\t\t\t\t\t\t\t\t$catName = LAN_IMAGE_46;\r\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige aller Bilder der Kategorie\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\") && $dataset['cat']){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?cat=\".$dataset['cat'].\"'><span>\".LAN_IMAGE_45.\": \".$tp -> toHTML($catName).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".LAN_IMAGE_45.\": \".$tp -> toHTML($catName).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"date\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML(date('d.m.Y',$dataset['uploadDate'])).\"</span>\";\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"gal\":\r\r\n\t\t\t\t\t\t\t$albumData = $PView->getAlbumData($dataset['albumId']);\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige der Galerie\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?gallery=\".$albumData['galleryId'].\"'><span>\".$tp -> toHTML($PView->getGalleryName($albumData['galleryId'])).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($PView->getGalleryName($albumData['galleryId'])).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"album\":\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige aller Bilder des albums\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?album=\".$dataset['albumId'].\"'><span>\".$tp -> toHTML($PView->getAlbumName($dataset['albumId'])).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($PView->getAlbumName($dataset['albumId'])).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"edit\":\r\r\n\t\t\t\t\t\t\t//PERMISSION!!!\r\r\n\t\t\t\t\t\t\tif ($PView -> getPermission(\"album\",$dataset['sendImage'],\"Edit\")) {\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pview_actions.php?image=\".$dataset['imageId'].\"&amp;action=edit'><span>\".LAN_IMAGE_2.\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"send\":\r\r\n\t\t\t\t\t\t\t//PERMISSION!!!\r\r\n\t\t\t\t\t\t\tif (($PView -> getPView_config(\"email\") && $dataset['sendImage']) OR (ADMIN && $PView -> getPView_config(\"admin_Mode\"))){\r\r\n\t\t\t\t\t\t\t\tif ($PView -> getPermission(\"config\",\"permEmail\",\"\")) {\r\r\n\t\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='\".e_BASE.\"email.php?plugin:pviewgallery.\".$dataset['imageId'].\"'><span>\".LAN_IMAGE_48_1.\"</span></a>\";\r\r\n\t\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"comm\":\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"Comments\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br /><span>\".LAN_IMAGE_4.\": \".$PView -> getCommentsCount($dataset['imageId']).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t\tbreak;\t\r\r\n\t\t\t\t\t\t\tcase \"rating\":\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"Rating\")){\r\r\n\t\t\t\t\t\t\t\t$ratingData = $PView -> getRatingData($dataset['imageId']);\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br /><span>\".LAN_IMAGE_3.\": \".round($ratingData['value'],1).\" (\".$ratingData['count'].\")</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\t\r\r\n\t\t\t\t\t\t\tcase \"views\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".LAN_IMAGE_16.\": \".$tp -> toHTML($dataset['views']).\" \".LAN_IMAGE_17.\"</span>\";\r\r\n\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t}\t\t\t\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\t$out_AllImages.= \"</div></div></td>\";\t\t\r\r\n\t\t\t\t\t$colCount++;\r\r\n\t\t\t\t}\r\r\n\t\t\t\t$picCount++;\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t\t// fill row with empty cells\r\r\n\t\twhile ($colCount < $cols) {\r\r\n\t\t\t$out_AllImages.= \"<td>&nbsp;</td>\";\r\r\n\t\t\t$colCount++;\r\r\n\t\t}\r\r\n\t\t$out_AllImages.= \"</tr>\";\r\r\n\t\treturn $out_AllImages;\r\r\n\t}\r\r\n\treturn \"<div style='padding:10px;'>\".$message.\"</div>\";\r\r\n}", "function getDatos(){\n $res = $this->Consulta('SELECT C.*, P.id_planta FROM '.$this->Table .' C\n INNER JOIN\n equipos E ON E.id_equipos = C.`id_equipos`\n INNER JOIN\n secciones S ON S.id_secciones = E.id_secciones\n INNER JOIN\n plantas P ON P.id_planta = S.id_planta\n \n WHERE '.$this->PrimaryKey.' = '.$this->_datos);\n $resultado = $res[0];\n // $resultado = array_map('utf8_encode',$resultado);\n \n print_r( json_encode( $resultado ) );\n }", "public function getPetsByUsuario($id_usuario){\n $db = db_connect();\n $resultados = $db->table('pet')\n ->select('pet.*')\n ->select('galeria.imagem')\n ->select('usuario.nome as nome_usuario, usuario.telefone, usuario.email')\n ->select('saude.id_pet as saude_id_pet, vermifugado, vacinado, castrado, cuidados_especiais')\n ->select('personalidade.id_pet as personalidade_id_pet, docil, agressivo, calmo, brincalhao, sociavel, arisco, independente, carente, tenso, assustado, casa, apartamento')\n ->select('porte.descricao as porte_descricao')\n ->select('especie.descricao as especie_descricao')\n ->select('sexo.descricao as sexo_descricao')\n ->select('faixa_etaria.descricao as faixa_etaria_descricao')\n ->select('municipio.nome as municipio_nome, municipio.uf')\n ->join('usuario', 'usuario.id_usuario = pet.id_usuario', 'left')\n ->join('porte', 'porte.id_porte = pet.id_porte', 'left')\n ->join('especie', 'especie.id_especie = pet.id_especie', 'left')\n ->join('sexo', 'sexo.id_sexo = pet.id_sexo', 'left')\n ->join('faixa_etaria', 'faixa_etaria.id_faixa_etaria = pet.id_faixa_etaria', 'left')\n ->join('municipio', 'municipio.id_municipio = pet.id_municipio', 'left')\n ->join('saude', 'saude.id_pet = pet.id_pet', 'left')\n ->join('personalidade', 'personalidade.id_pet = pet.id_pet', 'left')\n ->join('galeria', 'galeria.id_pet = pet.id_pet', 'left')\n ->where('pet.id_usuario', $id_usuario)\n ->where('galeria.capa',1)\n ->where('pet.excluido',0)\n ->get()->getResultObject();\n $db->close();\n return $resultados; \n }", "public function getOverstrandPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '113'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function prepareResults()\n {\n $final_imageset = $this->_imagesets;\n foreach ($this->_imagesets as $run_id => $imageset) {\n if (!$this->_validateOutFiles($imageset['out_images'])) {\n unset($final_imageset[$run_id]);\n break;\n }\n $final_imageset[$run_id]['recordtodb'] = isset($imageset['out_images']['main']);\n// unset ($final_imageset[$run_id]['out_images']);\n foreach ($this->_image->getColours() as $colour) {\n $tmp_colour = $imageset[$colour];\n $final_imageset[$run_id][$colour] = $tmp_colour['colour'];\n $final_imageset[$run_id]['imlev'] = $tmp_colour['levels']['imlev'];\n foreach (['r', 'v'] as $levtype) {\n foreach (['min', 'max'] as $minmax) {\n $minkey = sprintf(\"%s%s_%s\", $minmax, $colour, $levtype);\n $final_imageset[$run_id][$minkey] = $tmp_colour['levels'][$levtype][$minmax];\n }\n }\n }\n $final_imageset[$run_id] = array_merge($final_imageset[$run_id], $this->_commons);\n }\n return $final_imageset;\n }", "public function store_items_report($category_id,$branch_id,$year,$month)\n {\n $query = $this->db->query(\" SELECT CASE WHEN sp.`unit`=0 THEN 'none' WHEN sp.`unit`=1 THEN 'kg' WHEN sp.`unit`=2 THEN 'gm' WHEN sp.`unit`=3 THEN 'l' WHEN sp.`unit`=4 THEN 'ml' END AS unit, sp.`name`, NULL AS open_stock, c.`cat_name`, spi.`price`, (SELECT SUM(ssi.`today_purchase_qty`) FROM store_inward ssi WHERE ssi.`store_product_inward_id` = spi.`store_product_inward_id`) AS purchase, (SELECT SUM(sub_sin.`instock`) FROM store_instock sub_sin WHERE sub_sin.`store_product_inward_id` = spi.`store_product_inward_id`) AS instock, NULL AS cons_amt, NULL AS close_amt\n FROM store_product_inward spi \n LEFT JOIN `store_inward` si ON si.`store_product_inward_id` = spi.`store_product_inward_id` \n LEFT JOIN `store_product` sp ON sp.`store_product_id` = spi.`store_product_id` \n LEFT JOIN `category` c ON c.`category_id` = sp.`category_id` \n LEFT JOIN `store_instock` s_in ON s_in.`store_product_inward_id` = spi.`store_product_inward_id` \n WHERE MONTH(si.`created`) = '\".$month.\"' AND YEAR(si.`created`) = '\".$year.\"' AND c.category_id='\".$category_id.\"' AND spi.branch_id='\".$branch_id.\"'\n GROUP BY sp.`store_product_id` \");\n\n // $str = $this->db->last_query();\n // echo $str;die;\n\n\n $result = $query->result_array();\n return $result;\n\n }", "public function getAllImageThatContaintedGeoLoacitonByUserID($userID){\n try{\n $object=array();\n\n if($stmt=$this->DataBaseCon->prepare(\"SELECT ImageDataSet.ImgID,ImageDataSet.ImgPathWithPrimalUrl,ImageDataSet.ImgPathWithResizeUrl,ImageDataSet.ImgPathWithIconUrl, ImageDataSet.ImgDate, EventDataSet.Longitude, EventDataSet.Latitude,LocationDataSet.Address FROM EventDataSet, ImageDataSet,LocationDataSet WHERE EventDataSet.ImgID = ImageDataSet.ImgID AND EventDataSet.EventID=LocationDataSet.EventID AND EventDataSet.Longitude is NOT null AND EventDataSet.Latitude is not NUll AND ImageDataSet.userID=?\")){\n $stmt->bind_param('s',$userID);\n $stmt->execute();\n $stmt->bind_result($ImgID,$ImgPathWithPrimalUrl,$ImgPathWithResizeUrl,$ImgPathWithIconUrl,$ImgDate,$Longitude,$Latitude,$Address);\n while ($stmt->fetch())\n {\n $array =array('imgID'=>$ImgID, 'imgPathWithPrimalUrl'=>$ImgPathWithPrimalUrl, 'imgPathWithResizeUrl'=>$ImgPathWithResizeUrl,'imgPathWithIconUrl'=>$ImgPathWithIconUrl,'imgDate'=>$ImgDate,'Longitude'=>$Longitude,'Latitude'=>$Latitude,'Address'=>$Address);\n array_push($object,$array);\n }\n $stmt -> close();\n if(count($object)>0){\n return $object;\n }\n else{\n return false;\n }\n }\n else{\n return false;\n }\n\n }catch(Expection $e){\n return false;\n }\n\n\n\n }", "function getImagesDamCat($limitImages=0) {\n\t $content.=$this->beginGallery($this->cObj->data['uid'],$limitImages);\n\t \n\t // add image\n $list= str_replace('tx_dam_cat_', '',$this->config['startingpointdamcat']);\n\n $listRecursive = $this->getRecursiveDamCat($list,$this->config['recursivedamcat']);\n $listArray = explode(',',$listRecursive);\n $files = Array();\n\t\tforeach($listArray as $cat) {\n\t\t\t\t\t\t\n\t\t\t// add images from categories\n\t\t\t$fields = 'tx_dam.uid,tx_dam.title,tx_dam.description,tx_dam.file_name,tx_dam.file_path';\n\t\t\t$tables = 'tx_dam,tx_dam_mm_cat';\n\t\t\t$temp_where = 'tx_dam.deleted = 0 AND tx_dam.hidden=0 AND tx_dam_mm_cat.uid_foreign='.$cat.' AND tx_dam_mm_cat.uid_local=tx_dam.uid';\n\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $tables, $temp_where);\n\t\t\t\n while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){\n $files[$row['uid']] = $row; # just add the image to an array\n\t\t\t}\n\t\t}\n\t\t\n if ($limitImages>0) {\n $files = $this->getSlicedRandomArray($files,0,$limitImages);\n }\t\n \n\t\t// add the image for real\n\t\tforeach ($files as $key=>$row) {\n $path = $row['file_path'].$row['file_name'];\n\n // add element to slideshow\n $content.=$this->addImage(\n\t\t $path,\n $row['title'], \n $row['description'], \n $this->config['showThumbs'],\n $this->config['showLightbox'],\n $path,\n $limitImages\n );\t\n }\t\t\t\n \n \n $content.=$this->endGallery();\n return $content;\n }", "function getAllRecord($limit,$column_name,$order){\n\t \t$sql = \"SELECT *,SUM(stage='288') As sum1, SUM(stage='289') As sum2, SUM(stage='291') As sum3, SUM(stage='293') As sum4, COUNT(DISTINCT cand_id) As count2,synonym.parentname As compa, a1.parentname As loca FROM pof LEFT JOIN pof_candidates ON pof.pof_id=pof_candidates.pofid LEFT JOIN synonym ON synonym.s_id=pof.client_id LEFT JOIN synonym As a1 ON a1.s_id=pof.location LEFT JOIN pof_cons ON pof.pof_id=pof_cons.pos_id LEFT JOIN companies_grade ON pof.grade=companies_grade.gid GROUP BY pof.pof_id ORDER BY \".$column_name.\" \".$order.\" LIMIT \" .$limit . \",20 \";\n\t $Q = $this->db->query($sql);\n\tif($Q->num_rows() > 0){\n\tforeach($Q->result() as $row)\n\t{\n\t $data[] = $row;\n\t}\n\t}\n\t $Q->free_result(); \n\t return $data; \n }", "function getFilesArray(){\n $result = db_select('fossee_banner_details','n')\n ->fields('n',array('id','file_name','status'))\n ->range(0,20)\n //->condition('n.status_bool',1,'=')\n ->execute();\n\n return $result;\n}", "public function getPromInformation($prom_id,$user_id){\n //\n // get id, idCompany, prom_text, company_name, latLng, logo_icon_start_with\n //\n $sql_check = \"SELECT \".\n \"promotions.id, \".\n \"promotions.idCompany, \".\n \"promotions.message as prom_text, \".\n \"company.name as company_name, \".\n \"GROUP_CONCAT( X( company.geographicPosition ) , ',', Y( company.geographicPosition ) ) AS latLng, \".\n \"LEFT(logoTypes.logo , 30) as logo_icon_start_with \".\n \"FROM promotions \".\n \"join company on ( company.id = promotions.idCompany ) \".\n \"join logoTypes on ( company.idLogosTypes = logoTypes.id ) \".\n \"where promotions.id =\".$prom_id ;\n\t\t\n $arrProm = $this->exec_query_0($sql_check,'SEL');\n if(empty($arrProm[\"id\"])){ \n //\n // promotion not exist\n //\n return FALSE; \n }\n else{\n\t\t\t $result_ = $arrProm;\n\t\t\t\t$result_['id'] = (isset($result_['id'])) ? (int)$result_['id']:$result_['id'];\n\t\t\t\t$result_['idCompany'] = (isset($result_['idCompany'])) ? (int)$result_['idCompany']:$result_['idCompany'];\n\t\t\t\tif(isset($result_['latLng'])) {\n\t\t\t\t\t$co_ordinates = (explode(\",\",$result_['latLng']));\n\t\t\t\t\t$result_['latLng'] = (isset($result_['latLng'])) ? array((float)$co_ordinates[0],(float)$co_ordinates[1]):$result_['idCompany'];\n\t\t\t\t}\n\t\t\t}\n \n //var_dump($arrProm);\n\n\n //\n // get date time life for a promotion\n //\n $sql_time_life = \"SELECT DATE, prom_time.time_ \".\n \"FROM ( \".\n \"SELECT idPromotions, GROUP_CONCAT( `00:00` , `01:00` , `02:00` , `03:00` , `04:00` , `05:00` , `06:00` , `07:00` , `08:00` , `09:00` , `10:00` , `11:00` , `12:00` , `13:00` , `14:00` , `15:00` , `16:00` , `17:00` , `18:00` , `19:00` , `20:00` , `21:00` , `22:00` , `23:00` ) time_ \".\n \"FROM promotionTime \".\n \"WHERE idPromotions = \".$prom_id.\n \")prom_time \".\n \"JOIN promotionsDate ON ( promotionsDate.idPromotions = prom_time.idPromotions ) \";\n $arrProm_timelife = $this->exec_query_0($sql_time_life,'ALL');\n //var_dump($arrProm_timelife);\n // get timelife prom\n foreach($arrProm_timelife as $index) {\n // build timelife\n foreach($index as $date_=>$time_) {\n // validate length of time_\n // it must be 24 for represent 24hrs\n if(strlen($time_) == 24){\n $time_array = array();\n // convert binary hr_string to hours 0= false 1=true\n for($i = 0;$i<strlen($time_);$i++){\n if($time_{$i})\n $time_array[] = $i;\n }\n }\n else{ continue;}\n $time_life[$index[\"DATE\"]] = $time_array;\n }\n }\n //var_dump($time_life);\n $result_[\"time_life\"] = $time_life;\n\n //\n // determine if promotion ID belong to:\n // 1) shared or owned route\n // 3) shared promotion\n \n //\n // TODO\n // when a Route is shared with an user, promotions assigned \n // to that route has to be assigned to the shared user to \n // matain data consistency\n $sql_route_assign = \"SELECT id,idRoute from promotionAssign where promotionAssign.idPromotions =\".$prom_id.\" and promotionAssign.idUsr =\".$user_id;\n $route_assign = $this->exec_query_0($sql_route_assign,'SEL');\n //var_dump($route_assign);\n\n // assign route id\n $result_[\"idRoute\"] = (empty($route_assign[\"idRoute\"])) ? \"SHARED_PROM\" : (int)$route_assign[\"idRoute\"];\n\n if(!empty($route_assign[\"id\"]) && isset($route_assign[\"id\"]) ){\n\t\t\t\t// insert promotionAssignId and date in promotionReceive table\n\t\t\t\t$sql_promo_assign = \"INSERT INTO `promotionReceive`(`id`, `idPromotionsAssing`, `date`) VALUES (0,\".$route_assign[\"id\"].\",'\".date('Y-m-d H:i:s').\"')\";\n\t\t\t\t$this->exec_query_0($sql_promo_assign,'INS');\n }\n else{ \n // assign promotion \n $sql_assign_prom = \"INSERT INTO `promotionAssign` (`id`, `idPromotions`, `idRoute`, `idRoutePoint`, `idUsr`, `idpromotionShared`, `valid`) VALUES (NULL, \".$prom_id.\", NULL, NULL, '\".$user_id.\"', NULL, '1')\"; \n $assign_id = $this->exec_query_0($sql_assign_prom,'INS');\n if($assign_id > 0){\n // set prom received\n $sql_promo_assign = \"INSERT INTO `promotionReceive`(`id`, `idPromotionsAssing`, `date`) VALUES (0,\".$assign_id.\",'\".date('Y-m-d H:i:s').\"')\";\n $receivedId = $this->exec_query_0($sql_promo_assign,'INS');\n // received prom error\n if($receivedId < 1){\n $this->arrResultData['success'] = 'false';\n $this->arrResultData['m'] = array(\"status\"=>'Fatal error, promotion received error');\n return FALSE;\n }\n }\n else{\n // assign prom error\n $this->arrResultData['success'] = 'false';\n $this->arrResultData['m'] = array(\"status\"=>'Fatal error, promotion not assigned');\n return FALSE;\n }\n }\n\t\t\t\n \t$this->arrResultData['m'] = $result_;\n return TRUE;\n }\n\t\t\n\t\t/*\n\t\t* Function to validata the request data\n\t\t*/\n\t\t\n\t\tpublic function validarEstructura($jsonEntrada) {\n\t\t\t$json = $jsonEntrada['PRO'];\n\t\t\t$arrResult = array();\n\t\t\t$this->debug = (isset($json[\"debug\"])) ? $json[\"debug\"] : FALSE;\n\t\t\tif($this->debug)\n\t\t\t\t$this->arrResultData['debug'][] = array(\"send query\"=>$json);\n\t\t\t\tif($this->validateData($json)) {\n //\n // validate user and passwd\n //\n $Obj_logIn = new LogIn();\n $arrResult = $Obj_logIn->authenticateUser($json['user'],$json['passwd']);\n\n\n if(!empty($arrResult)){\n $arrPromotion = $this->getPromInformation($json[\"prom_id\"],$arrResult[\"id\"]);\n if(empty($arrPromotion)) {\n\t\t\t\t\t\t\t$this->arrResultData['success'] = 'false';\n\t\t\t\t\t\t\t$this->arrResultData['m'] = 'Invalid promotion id';\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\t\t$this->arrResultData['success'] = 'false';\n\t\t\t\t\t\t\t$this->arrResultData['m'] = 'Invalid user or password';\n \t\t\t\t\t\tif($this->debug)\n\t \t\t\t\t\t\t$this->arrResultData['debug'][] = array(\"athentication\"=>\"fail\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\treturn $this->arrResultData;\n\t\t}\n\t\t\n\t\tfunction validateData($json) {\n\t\t\t$flag = 0;\n\t\t\t$this->debug = (isset($json[\"debug\"])) ? $json[\"debug\"] : FALSE;\n\t\t\t\n\t\t\t// check user index\n\t\t\tif(!array_key_exists(\"user\",$json) || empty($json['user'])) {\n\t\t\t\t$this->arrResultData['success'] = 'false';\n\t\t\t\t$this->arrResultData['m'] = 'user name is missing';\n\t\t\t\t if($this->debug)\n\t\t\t\t\t\t$this->arrResultData['debug'][] = array(\"user\"=>\"User name is missing or Invalid index\");\n\t\t\t\t\t$flag=1;\n\t\t\t }else\n\t\t\t {\n\t\t\t\tif(isset($json['user']) && strlen($json['user']) > 30) {\n\t\t\t\t\t$this->arrResultData['success'] = 'false';\n\t\t\t\t\t$this->arrResultData['m'] = 'user name mast be less than 30 character';\n\t\t\t\t if($this->debug)\n\t\t\t\t\t\t$this->arrResultData['debug'][] = array(\"user\"=>\"length of user name is exceed\");\n\t\t\t\t\t$flag=1;\n\t\t\t\t}\n\t\t\t\tif(is_integer($json[\"user\"])) {\n\t\t\t\t\t$this->arrResultData['success'] = 'false';\n\t\t\t\t\t$this->arrResultData['m'] = 'invalid user';\n\t\t\t\t\tif($this->debug)\n\t\t\t\t\t\t$this->arrResultData['debug'][] = array(\"user\"=>\"user mast be string format\");\n\t\t\t\t\t$flag=1;\n\t\t\t\t}\n\t\t\t }\n\t\t\t // check passwd index\n\t\t\t \n\t\t\t if(!array_key_exists(\"passwd\",$json) || empty($json['passwd'])) {\n\t\t\t\t$this->arrResultData['success'] = 'false';\n\t\t\t\t$this->arrResultData['m'] = 'passwd is missing';\n\t\t\t\t if($this->debug)\n\t\t\t\t\t\t$this->arrResultData['debug'][] = array(\"passwd\"=>\"password is missing or Invalid index\");\n\t\t\t\t\t$flag=1;\n\t\t\t }\n\t\t\t else {\n\t\t\t\tif(isset($json['passwd']) && strlen($json['passwd']) > 30) {\n\t\t\t\t\t$this->arrResultData['success'] = 'false';\n\t\t\t\t\t$this->arrResultData['m'] = 'password mast be less than 30 character';\n\t\t\t\t if($this->debug)\n\t\t\t\t\t\t$this->arrResultData['debug'][] = array(\"password\"=>\"length of password is exceed\");\n\t\t\t\t\t$flag=1;\n\t\t\t\t}\n\t\t\t\tif(is_integer($json[\"passwd\"])) {\n\t\t\t\t\t$this->arrResultData['success'] = 'false';\n\t\t\t\t\t$this->arrResultData['m'] = 'invalid password';\n\t\t\t\t\tif($this->debug)\n\t\t\t\t\t\t$this->arrResultData['debug'][] = array(\"password\"=>\"password mast be string format\");\n\t\t\t\t\t$flag=1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t \n\t\t\t // check prom_id index\n\t\t\t if(!array_key_exists(\"prom_id\",$json) || empty($json['prom_id'])) {\n\t\t\t\t$this->arrResultData['success'] = 'false';\n\t\t\t\t$this->arrResultData['m'] = 'Promotion Id is missing';\n\t\t\t\t if($this->debug)\n\t\t\t\t\t\t$this->arrResultData['debug'][] = array(\"prom_id\"=>\"Promotion Id is missing or Invalid index\");\n\t\t\t\t\t$flag=1;\n\t\t\t }else {\n\t\t\t\t\n\t\t\t\tif(!is_integer($json[\"prom_id\"])) {\n\t\t\t\t\t$this->arrResultData['success'] = 'false';\n\t\t\t\t\t$this->arrResultData['m'] = 'invalid promo id';\n\t\t\t\t\tif($this->debug)\n\t\t\t\t\t\t$this->arrResultData['debug'][] = array(\"prom_id\"=>\"Promotion Id must be numeric format\");\n\t\t\t\t\t$flag=1;\n\t\t\t\t}\n\t\t\t }\n\t\t\t \n\t\t\t \n\t\t\t if($flag) { return false; } else { return true;}\n\t\t\t \n\t\t} // end of validateData()\n\t\n\t}", "function GetLogo(){\n\t//Building the query\n\t$stringBuilder = \"SELECT f.location \";\n\t$stringBuilder .= \"FROM layout l \";\n\t$stringBuilder .= \"INNER JOIN `file` f ON f.file_id=l.logo \";\n\t$stringBuilder .= \"LIMIT 0,1 \";\n\t// Preparing query\n\t$query = GetDatabaseConnection()->prepare($stringBuilder);\n\t$query->execute();\n\t$result = $query->fetchAll(); //Fetching it\n\t$location = \"\";\n\tif (isset($result[0][\"location\"])) {\n\t\t$location = $result[0][\"location\"];\n\t}\n\treturn \"$location\";\n}", "public function BuscarKardexIngrediente() \n{\n\tself::SetNames();\n\t$sql =\"SELECT ingredientes.nomingrediente, ingredientes.unidadingrediente, ingredientes.cantingrediente , ingredientes.costoingrediente, kardexingredientes.codingrediente, kardexingredientes.codresponsableing, kardexingredientes.movimientoing, kardexingredientes.entradasing, kardexingredientes.salidasing, kardexingredientes.stockactualing, kardexingredientes.preciouniting, kardexingredientes.costototaling, kardexingredientes.documentoing, kardexingredientes.fechakardexing, proveedores.nomproveedor as proveedor, clientes.nomcliente as clientes FROM (ingredientes LEFT JOIN kardexingredientes ON ingredientes.codingrediente=kardexingredientes.codingrediente) LEFT JOIN proveedores ON proveedores.codproveedor=kardexingredientes.codresponsableing LEFT JOIN clientes ON clientes.codcliente=kardexingredientes.codresponsableing WHERE kardexingredientes.codingrediente = ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_GET[\"codingrediente\"]) );\n\t$stmt->execute();\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"<center><div class='alert alert-danger'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN MOVIMIENTOS EN KARDEX PARA EL INGREDIENTE INGRESADO</div></center>\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "function get_psb_group_by_tha() {\n $sql = \"SELECT * FROM psb p INNER JOIN psb_jalur jp ON p.jalurpsb_id = jp.jalurpsb_id GROUP BY psb_tha\";\n $query = $this->db->query($sql);\n if ($query->num_rows() > 0) {\n $result = $query->result_array();\n $query->free_result();\n return $result;\n } else {\n return 0;\n }\n }", "public function getAllImageByUserID($userID){\n try{\n $object=array();\n\n if($stmt=$this->DataBaseCon->prepare(\"SELECT ImageDataSet.ImgID,ImageDataSet.ImgPathWithPrimalUrl,ImageDataSet.ImgPathWithResizeUrl,ImageDataSet.ImgPathWithIconUrl, ImageDataSet.ImgDate, EventDataSet.Longitude, EventDataSet.Latitude,LocationDataSet.Address FROM EventDataSet, ImageDataSet,LocationDataSet WHERE EventDataSet.ImgID = ImageDataSet.ImgID AND EventDataSet.EventID=LocationDataSet.EventID AND ImageDataSet.userID=?\")){\n $stmt->bind_param('s',$userID);\n $stmt->execute();\n $stmt->bind_result($ImgID,$ImgPathWithPrimalUrl,$ImgPathWithResizeUrl,$ImgPathWithIconUrl,$ImgDate,$Longitude,$Latitude,$Address);\n while ($stmt->fetch())\n {\n $array =array('imgID'=>$ImgID, 'imgPathWithPrimalUrl'=>$ImgPathWithPrimalUrl, 'imgPathWithResizeUrl'=>$ImgPathWithResizeUrl,'imgPathWithIconUrl'=>$ImgPathWithIconUrl,'imgDate'=>$ImgDate,'Longitude'=>$Longitude,'Latitude'=>$Latitude,'Address'=>$Address);\n array_push($object,$array);\n }\n $stmt -> close();\n if(count($object)>0){\n return $object;\n }\n else{\n return false;\n }\n }\n else{\n return false;\n }\n\n }catch(Expection $e){\n return false;\n }\n\n\n\n }", "public function getProductCommentsAll($objectid, $page=1, $count=2){\n // if($res2->num_rows() <= 0) $res2 = [];\n // else $res2 = $res2->result_array();\n\n // if(isset($res2) && !empty($res2)) {\n // $idis = [];\n // foreach($res2 as $k => $one){\n // $idis[] = $one['catalogid'];\n // } unset($one);\n\n // $idis2 = [];\n // foreach($res2 as $k => $two){\n // $idis2[] = $two['main_id'];\n // } unset($two);\n\n // $array = [];\n // $array = array_merge($idis, $idis2);\n // $unique_array = [];\n // $unique_array = array_unique($array);\n // } else $unique_array = $objectid;\n\n // $result = $this->db->select('site_color_catalog.catalogid')\n // ->where_in('site_color_catalog.main_id', $unique_array)\n // ->from('site_color_catalog')->get()->result_array();\n\n // if(isset($result) && !empty($result)){\n // $idits = [];\n // foreach($result as $value){\n // $idits[] = $value['catalogid'];\n // }unset($value);\n // $all_result = [];\n // $all_result = array_unique($idits);\n // } else $all_result = $objectid;\n\n $objectid = (int)$objectid;\n if ($objectid <= 0) \n return array();\n if ($page == 0 || $page == 1)\n $page = 0;\n else\n $page = ($page * $count) - $count;\n \n $res = $this->db->select('site_comment.parent_id, site_comment.name, site_comment.text, site_comment.mark, site_comment.datetime')\n ->from('site_comment')\n ->where('site_comment.id_catalog', $objectid)\n ->where('site_comment.visible',1)\n ->order_by('datetime','DESC')\n //->limit($count, $page)\n ->get()\n ->result_array();\n\n foreach($res as $key => $value){\n if($value['parent_id'] > 0) unset($res[$key]);\n } unset($value);\n\n return $res;\n}", "function sql_query_registrosProcessamentoArquivo($sCampos = \"*\", $sWhere = null, $sGroupBy = null, $sOrderBy = null) {\n\n \t\n \t\n \t$sql = \"select case when quantidade_cgm = 1 \";\n $sql .= \" then true \";\n $sql .= \" else false \";\n $sql .= \" end as cnpj_valido, \";\n $sql .= \" * \";\n $sql .= \" from (select (select count(z01_numcgm) \";\n $sql .= \" from cgm \";\n $sql .= \" where z01_cgccpf =issarqsimplesreg.q23_cnpj) as quantidade_cgm, \";\n \t$sql .= !empty($sCampos) ? $sCampos : \"*\";\n $sql .= \" from issarqsimplesreg \";\n $sql .= \" inner join issarqsimples \";\n $sql .= \" on issarqsimples.q17_sequencial = issarqsimplesreg.q23_issarqsimples \";\n $sql .= \" left join issarqsimplesregissbase \";\n $sql .= \" on issarqsimplesregissbase.q134_issarqsimplesreg = issarqsimplesreg.q23_sequencial \";\n $sql .= \" inner join db_config \";\n $sql .= \" on db_config.codigo = issarqsimples.q17_instit \";\n \t$sql .= !empty($sWhere) ? \" where {$sWhere} \\n\" : \"\"; \n \t$sql .= !empty($sGroupBy) ? \" group by {$sGroupBy} \\n\" : \"\"; \n \t$sql .= !empty($sOrderBy) ? \" order by {$sOrderBy} \\n\" : \"\";\n $sql .= \" ) as x \";\n \treturn $sql;\n }", "function getDistinctVehicles($package_id){ \n\t$this->db->select('v.registration_number,v.id as vehicle_id');\n\t$this->db->distinct();\n\t$this->db->where('p.id',$package_id);\n\t$this->db->from('packages p');\n\t$this->db->join('package_itinerary pi','pi.package_id = p.id','left');\n\t$this->db->join('package_vehicles pv','pv.package_itinerary_id = pi.id','left');\n\t$this->db->join('vehicles v','pv.vehicle_id = v.id','left');\n\t$qry=$this->db->get(); \n\t\tif($qry->num_rows() > 0){\n\t\t\t\n\t\t\t$v_array= $qry->result_array();\n\t\t\tforeach ($v_array as $key=>$vehicle){\n\t\t\t\techo $vehicle['vehicle_id'];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getTheewaterskloofPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '115'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getKannalandPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '110'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getNominaEtau4($id,$idg)\n { \n $result=$this->adapter->query('select distinct c.idNom, c.id, a.idCon, \n case a.cCosEmp when 0 then a.idCcos\n when 1 then b.idCcos End as idCcos, \n case a.horasCal when 0 then 0 \n when 1 then (c.dias*'.$this->horasDias.') End as horas, 1, \n case when g.valor=2 then \n case when g.tipo = 1 then a.valor else 0 End\t\t\t\t \n when g.valor=1 then 0 \n End as dev, \n case when g.valor=2 then \n case when g.tipo = 2 then a.valor else 0 End\t\t\t\t \n when g.valor=1 then 0 \n\t\tEnd as ded, h.formula, c.dias, g.tipo , b.id as idEmp , g.idFor , a.diasLab, c.diasVac, a.vaca,\n case when ii.codigo is null then \"\" else ii.codigo end as nitTer \n from n_tip_auto_i a inner join a_empleados b on a.idTauto=b.idTau4 \n inner join n_nomina_e c on b.id=c.idEmp \n inner join n_nomina d on d.id=c.idNom\n inner join n_tip_auto_tn e on e.idTnom=d.idTnom \n inner join n_tip_calendario f on f.id=d.idCal\n inner join n_conceptos g on g.id=a.idCon\n inner join n_formulas h on h.id=g.idFor\n left join n_terceros_s i on i.id = g.idTer \n left join n_terceros ii on ii.id = i.idTer \n WHERE not exists (SELECT null from n_nomina_e_d \n where c.id=idInom and a.idCon=idConc and a.idCcos=idCcos and tipo=1 ) \n and d.estado=0 and b.idGrup='.$idg.' and c.idNom='.$id,Adapter::QUERY_MODE_EXECUTE);\n $datos=$result->toArray();\n return $datos; \n }", "function getallpicindb(&$pic_array, $startdir)\r\n{\r\n global $xoopsDB;\r\n\r\n $sql = \"SELECT filepath, filename \".\r\n \"FROM \".$xoopsDB->prefix(\"xcgal_pictures\").\" \".\r\n \"WHERE filepath LIKE '$startdir%'\";\r\n $result = $xoopsDB->query($sql);\r\n while ($row = $xoopsDB->fetchArray($result)) {\r\n $pic_file = $row['filepath'].$row['filename'];\r\n $pic_array[$pic_file]=1;\r\n }\r\n $xoopsDB->freeRecordSet($result);\r\n}", "public function listarPergunta($cod_pergunta){\n try{\n $pdo = conexao::getInstance();\n $listarpergunta=$pdo->prepare(\"SELECT q.nome as nomedoquestionario, q.detalhe descricao,d.titulo dimensao, GROUP_CONCAT(p.pergunta order by p.cod_pergunta ASC separator ';') as nomedapergunta,GROUP_CONCAT(p.cod_pergunta order by p.cod_pergunta ASC) as codigopergunta, pq.cod_questionario,pq.cod_pergunta from questionario as q, dimensao as d, pergunta p,pergunta_questionario as pq where pq.cod_questionario=q.cod_questionario AND pq.cod_pergunta=p.cod_pergunta AND pq.cod_questionario=:cod_questionario AND p.cod_dimensao=d.cod_dimensao group by p.cod_dimensao \n\n \");\n $listarpergunta->bindvalue(\":cod_questionario\",$cod_pergunta);\n $listarpergunta->execute();\n $perguntalist= array();\n while($perguntaObj=$listarpergunta->fetchObject(__CLASS__) ){\n $perguntalist[]=$perguntaObj;\n }\n return $perguntalist;\n } \n catch(PDOException $erro){\n echo $erro->getTraceAsString();\n }\n\n }", "function getResults(){\n\t\t//$nombre,$apellido,$ciudad,$provincia,$areas,$pais\n\t\t$db = $this->getDbo();\n\n\t\t$nombre = JFactory::getApplication()->input->getString('txtNombre');\n\t\t$apellido = JFactory::getApplication()->input->getString('txtApellido');\n\t\t$ciudad = JFactory::getApplication()->input->getString('txtCiudad');\n\t\t$provincia = JFactory::getApplication()->input->getString('txtProvincia');\n\t\t//$areas = JFactory::getApplication()->input->getString('txtProvincia');\n\t\t$pais = JFactory::getApplication()->input->getString('txtPais');\n\n\t\t$query = \"\n\t\t\tSELECT\n\t\t\t\tCONCAT(u.name, ' ', cp.zv_apellidopadre,' ', cp.zv_apellidomadre) AS name,\n\t\t\t\tu.name AS firstname,\n\t\t\t\tu.email AS email,\n\t\t\t\tcp.zv_apellidopadre AS apellidopadre,\n\t\t\t\tcp.zv_apellidomadre AS apellidomadre,\n\t\t\t\tCONCAT(cp.zv_apellidopadre,' ',cp.zv_apellidomadre) AS apellidos,\n\t\t\t\tcp.zv_telefono AS telefono,\n\t\t\t\tcp.zv_direccion AS direccion,\n\t\t\t\tcp.zv_direccionnumero AS numero,\n\t\t\t\tCONCAT(cp.zv_direccion,' ', cp.zv_direccionnumero) AS direccionCompleta,\n\t\t\t\tcp.zv_perfilacadmico AS perfil,\n\t\t\t\tIF(INSTR(cp.zv_autorizodivulgarmisdatosporalap,'instituc')>0,\n\t\t\t\t\tcp.zv_institucion ,-1)AS institucion\n\t\t\t\t,\n\t\t\t\tcp.zv_areainteres AS areas,\n\t\t\t\tcp.zv_direccionprovincia AS provincia,\n\t\t\t\tcp.user_id AS id\n\n\t\t\tFROM zv_zvcadastramento cp\n\t\t\tLEFT JOIN zv_users u ON cp.user_id = u.id\n\n\t\t\tWHERE\n\t\t\t\tcp.zv_socio = 1 AND\n\t\t\t\tu.name != 'administrator' AND\n\t\t\t\tIF(INSTR(cp.zv_autorizodivulgarmisdatosporalap,'nombre')>0,\n\t\t\t\t\tIF('' != '\".$nombre.\"',\n\t\t\t\t\t\tu.name like '%\".$nombre.\"%'\n\t\t\t\t\t,u.name like '%%')\n\t\t\t\t\tAND\n\t\t\t\t\tIF('' != '\".$apellido.\"',\n\t\t\t\t\t\tcp.zv_apellidomadre like '%\".$apellido.\"%'\n\t\t\t\t\t\t\t\tOR cp.zv_apellidopadre like '%\".$apellido.\"%'\n\t\t\t\t\t\t\t,cp.zv_apellidomadre like '%%'\n\t\t\t\t\t\t\t\tOR cp.zv_apellidopadre like '%%'\n\t\t\t\t\t\t\t)\n\n\t\t\t\t,'')\n\t\t\t\t\tAND\n\n\t\t\t\t\tIF('' != '\".$ciudad.\"',\n\t\t\t\t\t\tcp.zv_direccionciudad like '%\".$ciudad.\"%'\n\t\t\t\t\t,cp.zv_direccionciudad like '%%')\n\n\t\t\t\t\tAND\n\n\t\t\t\t\tIF('' != '\".$provincia.\"',\n\t\t\t\t\t\t\tcp.zv_direccionprovincia like '%\".$provincia.\"%'\n\t\t\t\t\t,cp.zv_direccionprovincia like '%%')\n\n\t\t\t\t\tAND\n\n\t\t\t\t\tIF('' != '\".$pais.\"',\n\t\t\t\t\t\t\tcp.zv_direccionpais like '%\".$pais.\"%'\n\t\t\t\t\t,cp.zv_direccionpais like '%%')\n\n\t\t\t\";\n\n\t\t/*\n\t\tforeach($areas as $area){\n\t\t\tforeach($fields as $field){\n\t\t\t\tif($field->fieldvalueid == $area){\n\t\t\t\t\t$query.=\n\t\t\t\t\t\t\"AND\n\t\t\t\t\t\t\tIF(INSTR(cp.zv_autorizodivulgarmisdatosporalap,'reas de inter') > 0,\n\t\t\t\t\t\t\t\tcp.zv_areainteres like'%\".$field->fieldtitle.\"%'\n\t\t\t\t\t\t\t,'')\";\n\t\t\t\t}\n\t\t\t}\n\t\t}*/\n\n\t\t$query .= \" ORDER BY name\";\n\n\n\t\t$users = $this->_getList($query);\n\n\t\treturn $users;\n\t}", "function consultaGrupos($idTutor)\n{\n $sql=\"SELECT DISTINCT gp.id_grupo as id ,\n gp.nombre_grupo as nombre ,\n gp.clave as clave,\n gp.id_escuela as \\\"idEscuela\\\",\n gp.id_empresa as \\\"idEmpresa\\\",\n gp.tipo_grupo as \\\"tipoGrupo\\\" \n FROM rel_curso_tutor r_c_t\n JOIN rel_curso_grupo r_c_g\n ON r_c_t.id_rel_curso_grupo = r_c_g.id_rel_curso_grupo\n JOIN grupo gp\n ON gp.id_grupo = r_c_g.id_grupo \n WHERE \tgp.status = 1\n AND r_c_t.id_tutor = \".$idTutor;\n \n $consultaGrupo= new Query(\"SG\");\n $consultaGrupo->sql=$sql;\n $resultado = $consultaGrupo->select(\"obj\");\n \n return $resultado;\n}", "function ambil_data()\n \t{\n \t\t$this->db->distinct();\n \t\t$this->db->select('bk.id_buku, s.nama_supplier, bk.judul, bk.tema, bk.penulis, bk.harga');\n \t\t$this->db->from('buku bk');\n \t\t$this->db->join('supplier s', 's.id_supplier = bk.id_supplier');\n \t\treturn $this->db->get($this->nama_table)->result();\n\n \t\t$data['buku'] = $this->db->order_by($this->id, $this->order);\n \t\treturn $this->db->get($this->nama_table)->result();\n \t}", "static public function getImagesfromCollectionID($theCollectionId){\n \n if ( ! Logger::isInitialized()){\n Logger::configure($_SERVER['DOCUMENT_ROOT'].'/log/LogConfig.xml');\n }\n $logger=Logger::getLogger(__CLASS__);\n $logger->trace(\"Enter\");\n $logger->trace(\"Get the images that belong to the collection id [ \" . $theCollectionId .\" ]\");\n $conn = new MySqlDAO(serverC, userC, pwdC, ddbbC);\n $conn->connect();\n \n if($conn->isConnected()){\n $logger->trace(\"The connection with the database was done with successfully\");\n \n $query = sprintf(\"select %s.%s as ImageId,\n %s.%s as CollectionId,\n %s.%s as CollectionName,\n %s.%s as ImageName,\n %s, %s from %s,%s,%s where\n %s.%s=%s.%s and %s.%s=%s.%s and\n %s.%s= %d order by ImageId desc\"\n ,TableImageC,TB_Image_IdC\n ,TableCollectionC,TB_Collection_IdCollectionC\n ,TableCollectionC,TB_Collection_CollectionNameC\n ,TableImageC,TB_Image_NameC\n ,TB_Image_PathC\n ,TB_Image_DescC\n ,TableImageC\n ,TableCollectionC\n ,TableImageCollectionC\n ,TableImageC,TB_Image_IdC\n ,TableImageCollectionC,TB_ImageCollection_idImageC\n ,TableImageCollectionC,TB_ImageCollection_idCollectionC\n ,TableCollectionC, TB_Collection_IdCollectionC\n ,TableCollectionC, TB_Collection_IdCollectionC\n ,$theCollectionId);\n \n $logger->trace(\"Execute query [ \" . $query . \" ]\");\n \n $result = $conn->query($query);\n if ($result != null){\n $rows;\n $numRows = count($result);\n $logger->trace(\"The query has [ \" . $numRows .\" ] rows\");\n for ($idx = 0;$idx < $numRows; $idx++){\n $rows[$idx] = new TB_IMAGE_COLLECTION($result[$idx][\"ImageId\"],\n $result[$idx][\"CollectionId\"],\n $result[$idx][\"CollectionName\"],\n $result[$idx][TB_Image_PathC],\n $result[$idx][\"ImageName\"],\n $result[$idx][TB_Image_DescC]);\n }\n }\n $conn->closeConnection();\n }else{\n \n $logger->error(\"An error was produced in the connection [ \" .\n $conn->getConnectError() . \" ]\");\n \n }\n $logger->trace(\"Exit\");\n return new DBIterator($rows);\n \n }" ]
[ "0.8179744", "0.7866503", "0.7787507", "0.70012915", "0.65295434", "0.64844096", "0.6406495", "0.6335919", "0.6269723", "0.62049764", "0.613909", "0.61388963", "0.61191493", "0.6097447", "0.6045244", "0.6044075", "0.6032203", "0.6009091", "0.5836144", "0.57888514", "0.5788476", "0.5785636", "0.5761534", "0.57545817", "0.57507896", "0.57463336", "0.5745862", "0.573118", "0.57067513", "0.5701413", "0.56981814", "0.56956947", "0.5680531", "0.5677362", "0.5655399", "0.5653827", "0.5624508", "0.5618943", "0.56169075", "0.56163985", "0.56150895", "0.56108856", "0.55925363", "0.5582447", "0.5572209", "0.5569562", "0.5566185", "0.5564727", "0.555318", "0.55519754", "0.55504537", "0.5543412", "0.55413175", "0.5530171", "0.5528081", "0.55221397", "0.55192167", "0.5510051", "0.55086595", "0.55017406", "0.5498693", "0.54985803", "0.54944116", "0.54865324", "0.5484814", "0.5479737", "0.54786503", "0.547559", "0.5475141", "0.546937", "0.5465947", "0.5459512", "0.5458181", "0.54574096", "0.54561645", "0.5453605", "0.545012", "0.544421", "0.544308", "0.5441864", "0.54410577", "0.5438537", "0.5437921", "0.54364467", "0.5435019", "0.5434477", "0.543015", "0.54246813", "0.5418111", "0.5414878", "0.54129446", "0.540824", "0.5405073", "0.5401838", "0.54013824", "0.5397912", "0.53954977", "0.53950113", "0.5391893", "0.5391874" ]
0.6609547
4
/ $query = $this>db>query("SELECT PACKAGE., group_concat(DISTINCT PACKFILE.imagepath order by PACKFILE.imagepath separator ',' ) AS packageImages, group_concat(DISTINCT LOCFILE.imagepath order by LOCFILE.imagepath separator ',' ) AS locationImages, group_concat(DISTINCT LOCAMENITIES.name order by LOCAMENITIES.name separator ',' ) AS locstionamineties, group_concat(DISTINCT PACKAMENITIES.name order by PACKAMENITIES.name separator ',' ) AS packaageamineties FROM `package` AS PACKAGE LEFT JOIN packageimage AS PACKIMAGE ON PACKIMAGE.package = PACKAGE.id LEFT JOIN file AS PACKFILE ON PACKFILE.id = PACKIMAGE.file LEFT JOIN location AS LOC ON LOC.id=PACKAGE.location LEFT JOIN address AS ADDRESS ON ADDRESS.id = LOC.locationaddress LEFT JOIN locationimage AS LOCIMAGE ON LOCIMAGE.location = LOC.id LEFT JOIN file AS LOCFILE ON LOCFILE.id = LOCIMAGE.id LEFT JOIN locationamenities AS LOCAMENITIESMAP ON LOCAMENITIESMAP.location = LOC.id LEFT JOIN amenities AS LOCAMENITIES ON LOCAMENITIES.id = LOCAMENITIESMAP.amenities LEFT JOIN packageamenities AS PACKMENITIESMAP ON PACKMENITIESMAP.package = PACKAGE.id LEFT JOIN amenities AS PACKAMENITIES ON PACKAMENITIES.id = PACKMENITIESMAP.amenities"); return $query>result_array();
function get_location_package_detail() { $this->db->select('package.*,package.id as packid,location.*,address.*,cities.*,file.* '); $this->db->from('package'); $this->db->join('cities', 'cities.c_id = package.location'); $this->db->join('address', 'address.city = cities.c_id'); $this->db->join('location', 'address.id = location.locationaddress'); // $this->db->join('packageimage','packageimage.package = package.id'); $this->db->join('file', 'file.id = package.thumbnailimage'); // $this->db->where('cities.c_id', $dis); $query = $this->db->get(); $row = $query->result_array(); // echo $this->db->last_query();exit; return $row; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_all_package_details($dis)\n {\n $query = $this->db->query(\"SELECT \n PACKAGE.*, group_concat(DISTINCT PACKFILE.imagename order by PACKFILE.imagename separator ',' ) AS packageImages,\n group_concat(DISTINCT LOCFILE.imagepath order by LOCFILE.imagepath separator ',' ) AS locationImages,\n group_concat(DISTINCT LOCAMENITIES.name order by LOCAMENITIES.name separator ',' ) AS locstionamineties, \n group_concat(DISTINCT PACKAMENITIES.name order by PACKAMENITIES.name separator ',' ) AS packaageamineties \n FROM `package` AS PACKAGE \n LEFT JOIN packageimage AS PACKIMAGE ON PACKIMAGE.package = PACKAGE.id \n LEFT JOIN file AS PACKFILE ON PACKFILE.id = PACKIMAGE.file \n LEFT JOIN location AS LOC ON LOC.id=PACKAGE.location \n LEFT JOIN address AS ADDRESS ON ADDRESS.id = LOC.locationaddress \n LEFT JOIN locationimage AS LOCIMAGE ON LOCIMAGE.location = LOC.id \n LEFT JOIN file AS LOCFILE ON LOCFILE.id = LOCIMAGE.id \n LEFT JOIN locationamenities AS LOCAMENITIESMAP ON LOCAMENITIESMAP.location = LOC.id LEFT JOIN amenities AS LOCAMENITIES ON LOCAMENITIES.id = LOCAMENITIESMAP.amenities LEFT JOIN packageamenities AS PACKMENITIESMAP ON PACKMENITIESMAP.package = PACKAGE.id \n LEFT JOIN amenities AS PACKAMENITIES ON PACKAMENITIES.id = PACKMENITIESMAP.amenities WHERE PACKAGE.id =$dis\");\n return $query->result_array();\n }", "function get_all_package_details_admin($dis)\n {\n $query = $this->db->query(\"SELECT \n PACKAGE.*,LOC.id AS locationId, PACKAGE.id as ped, group_concat(DISTINCT PACKFILE.imagename order by PACKFILE.imagename separator ',' ) AS packageImages,\n group_concat(DISTINCT LOCFILE.imagepath order by LOCFILE.imagepath separator ',' ) AS locationImages,\n group_concat(DISTINCT LOCAMENITIES.name order by LOCAMENITIES.name separator ',' ) AS locstionamineties, \n group_concat(DISTINCT PACKAMENITIES.name order by PACKAMENITIES.name separator ',' ) AS packaageamineties \n FROM `package` AS PACKAGE \n LEFT JOIN packageimage AS PACKIMAGE ON PACKIMAGE.package = PACKAGE.id \n LEFT JOIN file AS PACKFILE ON PACKFILE.id = PACKIMAGE.file \n LEFT JOIN location AS LOC ON LOC.id=PACKAGE.location \n LEFT JOIN address AS ADDRESS ON ADDRESS.id = LOC.locationaddress \n LEFT JOIN locationimage AS LOCIMAGE ON LOCIMAGE.location = LOC.id \n LEFT JOIN file AS LOCFILE ON LOCFILE.id = LOCIMAGE.id \n LEFT JOIN locationamenities AS LOCAMENITIESMAP ON LOCAMENITIESMAP.location = LOC.id LEFT JOIN amenities AS LOCAMENITIES ON LOCAMENITIES.id = LOCAMENITIESMAP.amenities LEFT JOIN packageamenities AS PACKMENITIESMAP ON PACKMENITIESMAP.package = PACKAGE.id \n LEFT JOIN amenities AS PACKAMENITIES ON PACKAMENITIES.id = PACKMENITIESMAP.amenities WHERE PACKAGE.id = $dis\");\n return $query->result_array();\n }", "function get_all_package_details_view($dis)\n {\n $query = $this->db->query(\"SELECT \n PACKAGE.*, group_concat(DISTINCT PACKFILE.imagename order by PACKFILE.imagename separator ',' ) AS packageImages,\n group_concat(DISTINCT LOCFILE.imagepath order by LOCFILE.imagepath separator ',' ) AS locationImages,\n group_concat(DISTINCT LOCAMENITIES.name order by LOCAMENITIES.name separator ',' ) AS locstionamineties, \n group_concat(DISTINCT PACKAMENITIES.name order by PACKAMENITIES.name separator ',' ) AS packaageamineties \n FROM `package` AS PACKAGE \n LEFT JOIN packageimage AS PACKIMAGE ON PACKIMAGE.package = PACKAGE.id \n LEFT JOIN file AS PACKFILE ON PACKFILE.id = PACKIMAGE.file \n LEFT JOIN location AS LOC ON LOC.id=PACKAGE.location \n LEFT JOIN address AS ADDRESS ON ADDRESS.id = LOC.locationaddress \n LEFT JOIN locationimage AS LOCIMAGE ON LOCIMAGE.location = LOC.id \n LEFT JOIN file AS LOCFILE ON LOCFILE.id = LOCIMAGE.id \n LEFT JOIN locationamenities AS LOCAMENITIESMAP ON LOCAMENITIESMAP.location = LOC.id LEFT JOIN amenities AS LOCAMENITIES ON LOCAMENITIES.id = LOCAMENITIESMAP.amenities LEFT JOIN packageamenities AS PACKMENITIESMAP ON PACKMENITIESMAP.package = PACKAGE.id \n LEFT JOIN amenities AS PACKAMENITIES ON PACKAMENITIES.id = PACKMENITIESMAP.amenities where PACKAGE.id=$dis\");\n return $query->result_array();\n }", "function get_package_details($dis)\n {\n $this->db->select('package.*,package.id as packid,location.*,address.*,cities.*,file.* ');\n $this->db->from('package');\n $this->db->join('cities', 'cities.c_id = package.location');\n $this->db->join('address', 'address.city = cities.c_id');\n $this->db->join('location', 'address.id = location.locationaddress');\n // $this->db->join('packageimage','packageimage.package = package.id');\n $this->db->join('file', 'file.id = package.thumbnailimage');\n $this->db->where('cities.c_id', $dis);\n $query = $this->db->get();\n $row = $query->result_array(); // echo $this->db->last_query();exit;\n return $row;\n }", "function getallepics()\n {\n //$allepics = \"SELECT * from epics\";\n $allepics= \"SELECT e.*,staff.*,epics_statuses.name as epicsname,team.name as teamname\n FROM epics AS e\n LEFT JOIN epics_statuses AS epics_statuses ON epics_statuses.id = e.e_status_id\n LEFT JOIN team AS team ON team.id = e.team_id\n LEFT JOIN staff AS staff ON staff.staff_id = e.e_owner\"; \n $allepicsresult = $this->ds->select($allepics); \n //print_r($myepicsresult);\n return $allepicsresult;\n }", "function getallproducts($warehouseid){\n \n $result = $this->db->query(\"SELECT a.*, \n b.id AS productid, b.`name` AS productname, b.`main_image` AS productimage, \n b.`price` AS product_price, b.`tax` AS product_tax, b.`description` AS product_description, b.`move_product_id` AS productuniqueid_forimages,\n c.`name` AS cat_name, c.`image` AS cat_image, d.`name` AS subcat_name, d.`image` AS subcat_image\n FROM warehouse_products a LEFT JOIN products b ON a.product=b.`id` LEFT JOIN category c ON b.`category_id` = c.`category_id` LEFT JOIN category d \n ON b.`sub_category_id` = d.`category_id` WHERE a.`warehouse` = \".$warehouseid.\" ORDER BY c.`name`, d.`name`\")->result();\n return $result;\n \n }", "function get_mapping() {\n\n\n $query = $this->db->query('SELECT\n A.map_id\n ,C1.stage_title AS place_name\n ,C2.stage_title AS dress_name\n ,C3.stage_title AS crown_name\n ,C4.stage_title AS stage_name\n ,C5.stage_title AS props_name\n ,B.character_name AS char_name \n ,A.image_path \nFROM mapping AS A\nINNER JOIN stage AS C1\n ON A.place_id = C1.id\nINNER JOIN stage AS C2\n ON A.dress_id = C2.id\n\n INNER JOIN stage AS C3\n ON A.crown_id = C3.id\n\n INNER JOIN stage AS C4\n ON A.stage_id = C4.id\n \n INNER JOIN stage AS C5\n ON A.props_id = C5.id\n\nINNER JOIN napoleon_characters AS B ON A.character_id = B.character_id');\n\n// $this->db->where('id', $intid);\n// $query = $this->db->get();\n// echo \"<pre>\";\n// print_r($query->result_array());\n// die;\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n else {\n return array();\n }\n }", "function getallproducts1($warehouseid){\n \n\n $products = $this->db->query(\"SELECT a.*, \n b.id AS productid, \n b.`name` AS productname, \n b.`main_image` AS productimage, \n b.`price` AS product_price, \n b.`tax` AS product_tax, \n b.`description` AS product_description, \n b.`move_product_id` AS productuniqueid_forimages,\n c.`name` AS cat_name, \n c.`image` AS cat_image, \n c.`category_id` AS category_id,\n d.`category_id` AS subcategory_id,\n d.`name` AS subcat_name, \n d.`image` AS subcat_image,\n d.`parent_id` AS parent_id,\n d.`shared_category` AS shared_category \n FROM warehouse_products a \n LEFT JOIN products b ON a.product=b.`id` \n LEFT JOIN category c ON b.`category_id` = c.`category_id` \n LEFT JOIN category d \n ON b.`sub_category_id` = d.`category_id` \n WHERE a.`warehouse` = \".$warehouseid.\" \n ORDER BY c.`name`, d.`name`\")->result();\n \n $sharedproducts=array();\n foreach($products as $product){\n if($product->shared_category !=null)\n array_push($sharedproducts, $product);\n }\n \n \n if(sizeof($products)>0){\n \n $this->db->query(\"TRUNCATE TABLE `tb_filteredproducts`\");\n \n foreach($products as $row) {\n $categoryimage=$row->cat_image;\n $imageheight=\"\";\n $imagewidth=\"\";\n if(strlen($categoryimage)>0){\n list($width, $height, $type, $attr) = getimagesize(\"https://mcflydelivery.com/public/uploads/category/thumbnail/\".$categoryimage);\n $imageheight=$height;\n $imagewidth=$width;\n }\n \n $query = \"INSERT INTO `tb_filteredproducts` set \n `id` = '\".$row->id.\"',\n `warehouse` = '\".$row->warehouse.\"',\n `product` = '\".$row->product.\"',\n `quantity` = '\".$row->quantity.\"',\n `min_capacity` = '\".$row->min_capacity.\"',\n `max_capacity` = '\".$row->max_capacity.\"',\n `avail_qty` = '\".$row->avail_qty.\"',\n `created_at` = '\".$row->created_at.\"',\n `updated_at` = '\".$row->updated_at.\"',\n `productid` = '\".$row->productid.\"',\n `productname` = '\".str_replace(\"'\",\"\",$row->productname).\"',\n `productimage` = '\".$row->productimage.\"',\n `product_price` = '\".$row->product_price.\"',\n `product_tax` = '\".$row->product_tax.\"',\n `product_description` = '\".$row->product_description.\"',\n `productuniqueid_forimages` = '\".$row->productuniqueid_forimages.\"',\n `cat_name` = '\".$row->cat_name.\"',\n `cat_image` = '\".$row->cat_image.\"',\n `cat_imageheight` = '\".$imageheight.\"',\n `cat_imagewidth` = '\".$imagewidth.\"',\n `category_id` = '\".$row->category_id.\"',\n `subcat_name` = '\".$row->subcat_name.\"',\n `subcategory_id` = '\".$row->subcategory_id.\"',\n `subcat_image` = '\".$row->subcat_image.\"',\n `parent_id` = '\".$row->parent_id.\"',\n `shared_category` = '\".$row->shared_category.\"';\";\n \n $this->db->query($query);\n \n }\n \n foreach($sharedproducts as $shared_product){ // for one shared product\n $sharedcategory_array= array();\n $sharedcategory_array=explode(\",\",$shared_product->shared_category);\n // print_r($shared_product);\n foreach($sharedcategory_array as $oneshared_category){\n if($oneshared_category !=$shared_product->category_id){ // if the shared category id item is not same with table id(current setted category id)\n // echo $oneshared_category;\n \n $selected_category_objectarray_from_categorytable = $this->db->where('category_id', $oneshared_category)->get('category')->result();\n \n if(sizeof($selected_category_objectarray_from_categorytable)>0){ // if the shared category is not deleted from category table\n $selected_category_object_from_categorytable=$selected_category_objectarray_from_categorytable[0];\n \n $categoryimage=$selected_category_object_from_categorytable->image;\n $imageheight=\"\";\n $imagewidth=\"\";\n if(strlen($categoryimage)>0){\n list($width, $height, $type, $attr) = getimagesize(\"https://mcflydelivery.com/public/uploads/category/thumbnail/\".$categoryimage);\n $imageheight=$height;\n $imagewidth=$width;\n }\n \n $query = \"INSERT INTO `tb_filteredproducts` set \n `id` = '\".$shared_product->id.\"',\n `warehouse` = '\".$shared_product->warehouse.\"',\n `product` = '\".$shared_product->product.\"',\n `quantity` = '\".$shared_product->quantity.\"',\n `min_capacity` = '\".$shared_product->min_capacity.\"',\n `max_capacity` = '\".$shared_product->max_capacity.\"',\n `avail_qty` = '\".$shared_product->avail_qty.\"',\n `created_at` = '\".$shared_product->created_at.\"',\n `updated_at` = '\".$shared_product->updated_at.\"',\n `productid` = '\".$shared_product->productid.\"',\n `productname` = '\".str_replace(\"'\",\"\",$shared_product->productname).\"',\n `productimage` = '\".$shared_product->productimage.\"',\n `product_price` = '\".$shared_product->product_price.\"',\n `product_tax` = '\".$shared_product->product_tax.\"',\n `product_description` = '\".$shared_product->product_description.\"',\n `productuniqueid_forimages` = '\".$shared_product->productuniqueid_forimages.\"',\n `cat_name` = '\".$selected_category_object_from_categorytable->name.\"',\n `cat_image` = '\".$selected_category_object_from_categorytable->image.\"',\n `cat_imageheight` = '\".$imageheight.\"',\n `cat_imagewidth` = '\".$imagewidth.\"',\n `category_id` = '\".$selected_category_object_from_categorytable->category_id.\"',\n `subcat_name` = '\".$shared_product->subcat_name.\"',\n `subcategory_id` = '\".$shared_product->subcategory_id.\"',\n `subcat_image` = '\".$shared_product->subcat_image.\"',\n `parent_id` = '\".$shared_product->parent_id.\"',\n `shared_category` = '\".$shared_product->shared_category.\"';\";\n \n $this->db->query($query);\n \n \n }\n }\n }\n } \n \n } \n \n \n $result = $this->db->query(\"SELECT * FROM `tb_filteredproducts` ORDER BY cat_name, subcat_name\")->result();\n return $result;\n }", "function join_product_table(){\n global $db;\n $sql =\" SELECT p.id,p.name,p.keywords,p.quantity,p.url,p.buy_price,p.sale_price,p.media_id,p.date,c.name\";\n $sql .=\" AS categorie,m.file_name AS image\";\n $sql .=\" FROM products p\";\n $sql .=\" LEFT JOIN categories c ON c.id = p.categorie_id\";\n $sql .=\" LEFT JOIN media m ON m.id = p.media_id\";\n $sql .=\" ORDER BY p.id ASC\";\n return find_by_sql($sql);\n\n }", "function getPackage(){\n\t\t $query = \"select package.id,package.pkg_cat_id,package.date_created,package.date_updated,package.icon_image,package.package_title,package.package_price,package.number_of_qty,package.slider_desc1,package.slider_image1,packages_category.packages_category_name from package inner join packages_category on package.pkg_cat_id = packages_category.id \";\n\t\t $result = mysql_query($query);\n\t\t if($result){\n\t\t\t$data = array();\n\t\t\twhile($row=mysql_fetch_assoc($result)){\n\t\t\t\t$row['icon_image'] = $row['icon_image'] !==\"\"? $this->Check_exists_img($row['icon_image']) : \"dist/img/boxed-bg.jpg\";\n\t\t\t\t$row['slider_image1'] = $row['slider_image1'] !==\"\"? $this->Check_exists_img($row['slider_image1']) : \"dist/img/boxed-bg.jpg\";\n\t\t\t\t\n\t\t\t\tarray_push($data,$row);\n\t\t\t }\n\t\t\t return $data;\n\t\t }else{\n\t\t\tdie(\"error in mysql query\" . mysql_error());\n\t\t }\n\t\t}", "function projectView($connect, $id) {\n\n\n $query = \"SELECT\n\t\t\t p.`id` AS id_project,\n\t\t\t p.`name`,\n\t\t\t p.description AS `description`,\n\t\t\t GROUP_CONCAT(DISTINCT s.id) AS images,\n\t\t\t s2.id AS title_img\n\t\t\t FROM project AS p\n\t\t\t LEFT JOIN `images` AS s2\n\t\t\t ON p.`id` = s2.`id_project`\n\t\t\t AND s2.is_title = 1\n\t\t\t AND s2.to_arc = 0\n\t\t\t AND s2.on_header = 0\n\t\t\t LEFT JOIN `images` AS s\n\t\t\t ON p.`id` = s.`id_project`\n\t\t\t AND s.is_title = 0\n\t\t\t AND s.to_arc = 0\n\t\t\t AND s.on_header = 0\n\t\t\t WHERE p.`to_arc` = 0\n \t\t AND p.`is_project` = 1\n \t\t\t AND p.id = $id\n\t\t\t GROUP BY p.`id` \";\n\t$query=mysqli_query($connect, $query);\n\n\t$aResult = mysqli_fetch_array($query);\n\n//\t$aResult = explode(\",\",$aResult[\"images\"]);\n\n// if(!$aResult) {\n// DIE(\"Грешка при заявката: \".mysqli_error($connect));\n// }\n return $aResult;\n}", "function immagini_get($id_imm=\"\"){\n $db = new db(DB_USER,DB_PASSWORD,DB_NAME,DB_HOST);\n\t\n\t$q_foto=\"SELECT immagine.* FROM imm_img JOIN immagine on immagine.id_img=imm_img.id_img WHERE imm_img.id_imm =$id_imm ORDER BY `ordine` ASC\";\n \n\t$r_foto=$db->query($q_foto);\n while($row_foto = mysql_fetch_assoc($r_foto))\n {\n $rows_foto[] = $row_foto;\n }\n \n return $rows_foto;\n\n \n}", "public function getProducts(){\n $query = \"SELECT \n products.id,\n products.name,\n products.description,\n products.price,\n images.image_file_name\n FROM products\n INNER JOIN products_images\n ON products.id = products_images.product_id\n INNER JOIN images\n ON products_images.image_id = images.image_id\";\n\n //-----construct query according to parameters supplied\n \n //create an array to pass string eg \"iii\" to bind_param\n $query_param_string = array();\n \n //create an array to pass values to the bind_param\n $query_param_values = array();\n \n //--TOTAL COUNT OF PRODUCTS\n //create an array to pass string eg \"iii\" to count total result\n $query_param_string_count = array();\n //create an array to pass values to to count total result\n $query_param_values_count = array();\n \n //--CATEGORIES\n //if there are categories selected, create a join with products_categories table\n //so we can find products in category or categories\n if( count( $this -> categories ) > 0 ){\n //store the name of the table in variable\n $tbl_products_categories = \"products_categories\";\n \n //string to add to query to join with products_categories table\n $category_join = \" INNER JOIN $tbl_products_categories ON products.id = $tbl_products_categories.product_id \";\n \n $category_query = array();\n foreach( $this -> categories as $cat ){\n //ignore if category = 0\n if( $cat !== 0 ){\n array_push( $category_query, \"$tbl_products_categories.category_id=?\");\n array_push( $query_param_string, \"i\" );\n array_push( $query_param_string_count, \"i\" );\n \n //we need each query param value as a reference\n array_push( $query_param_values, $cat );\n array_push( $query_param_values_count, $cat );\n }\n }\n //implode the categories into a string so we have\n //products_categories.category_id=? OR products_categories.category_id=?\n $cat_query_string = implode( \" OR \", $category_query );\n }\n \n //--PAGE\n //process page variables\n //to use pagination, we need to calculate offset\n //if we have 8 results per page, then offset is calculated using pagenumber $page -1 * perpage\n $offset = ($this -> page-1) * $this -> perpage;\n \n //add offset and limit to query_param_string array and query_param_values\n array_push( $query_param_string , \"i\" );\n array_push( $query_param_values , $this -> perpage );\n array_push( $query_param_string , \"i\" );\n array_push( $query_param_values , $offset );\n \n //add the query_param_string to the beginning of query_param_values\n //so we get the \"iii\" at the beginning of array\n array_unshift( $query_param_values, implode( \"\", $query_param_string ));\n //do the same for the count arrays\n array_unshift( $query_param_values_count, implode(\"\",$query_param_string_count) );\n \n //build the query with category parameters\n $limit = \" LIMIT ? OFFSET ?\";\n \n //add category join\n if( count( $this -> categories) > 0){\n $query = $query . \" \" . $category_join;\n //add category query string\n $query = $query . \" WHERE \" . $cat_query_string . \" AND products.active=1\";\n }\n \n //add grouping and sorting\n $query = $query . \" GROUP BY products.id\";\n //add sorting\n $query = $query . \" ORDER BY products.id ASC\";\n \n //create second query without the limit so we can get total number of products\n //without the pagination and limit (offset creates pages of result, \n //while limit limits the number of products per page)\n $count_query = $query;\n //add limit\n $query = $query . \" \" . $limit;\n \n //send the query to database using prepare\n $statement = $this -> connection -> prepare( $query );\n \n //create references to the array values using &$query_param_values\n //while adding to parameters array\n $parameters_array = array();\n foreach( $query_param_values as $key => $value ){\n $parameters_array[$key] = &$query_param_values[$key];\n }\n //do the same for count \n $parameters_array_count = array();\n foreach( $query_param_values_count as $key => $value ){\n $parameters_array_count[$key] = &$query_param_values_count[$key];\n }\n //use call_user_func_array to pass the array as a parameter to query\n //equivalent of calling bind_param(\"iii\",$var1,$var2,$var3)\n call_user_func_array( array($statement,'bind_param'), $parameters_array );\n \n //execute the query with the parameters\n if( $statement -> execute() ){\n $result = $statement -> get_result();\n //check number of rows in result\n if( $result -> num_rows > 0){\n $products = array();\n while( $row = $result -> fetch_assoc() ){\n $id = $row[\"id\"];\n $name = $row[\"name\"];\n $price = $row[\"price\"];\n $image_file_name = $row[\"image_file_name\"];\n $desc = new \\utilities\\TruncateWords( $row[\"description\"],15 );\n $description = $desc -> words;\n //$description = $row[\"description\"];\n array_push( $products, array( \n \"id\" => $id, \n \"name\" => $name, \n \"price\" => $price,\n \"description\" => $description, \n \"image_file_name\" => $image_file_name \n ) );\n }\n $statement -> close();\n //run the second query $count_query to get total number of products\n $statement = $this -> connection -> prepare($count_query);\n call_user_func_array( array($statement,'bind_param'), $parameters_array_count );\n $statement -> execute();\n $result = $statement -> get_result();\n $total = $result -> num_rows;\n \n $result_array = array();\n $result_array[\"total\"] = $total;\n $result_array[\"categories\"] = $this -> categories;\n $result_array[\"data\"] = $products;\n \n return $result_array;\n }\n else{\n return false;\n }\n }\n else {\n return false;\n }\n $statement -> close();\n }", "public function getDetalles()\n {\n $sql = \"select z.id,z.nombre, z.identificacion, z.estado_excluido, y.descripcion, w.categoria , (SELECT a.monto FROM appexamenisw2.categorias a,\n appexamenisw2.beneficios e, appexamenisw2.estudiantes b, appexamenisw2.beneficio__estudiantes c\n where a.descripcion = 'aeo'\n and b.id = c.estudiante_id\n and e.id = c.beneficio_id\n and a.id = e.categoria_id\n and b.id = z.id) as 'aeo' ,\n (SELECT a.monto FROM appexamenisw2.categorias a,\n appexamenisw2.beneficios e, appexamenisw2.estudiantes b, appexamenisw2.beneficio__estudiantes c\n where a.descripcion = 'alim'\n and b.id = c.estudiante_id\n and e.id = c.beneficio_id\n and a.id = e.categoria_id\n and b.id = z.id) as alim,\n (SELECT a.monto FROM appexamenisw2.categorias a,\n appexamenisw2.beneficios e, appexamenisw2.estudiantes b, appexamenisw2.beneficio__estudiantes c\n where a.descripcion = 'pare'\n and b.id = c.estudiante_id\n and e.id = c.beneficio_id\n and a.id = e.categoria_id\n and b.id = z.id) as pare\n from appexamenisw2.estudiantes z, appexamenisw2.beneficios y, appexamenisw2.categorias w,\n appexamenisw2.beneficio__estudiantes v\n where z.id = v.estudiante_id\n and y.id = v.beneficio_id\n and w.id = y.categoria_id\n group by z.id,z.nombre, z.identificacion, z.id, z.estado_excluido, y.descripcion,w.categoria\n order by z.id;\";\n\n $arrayDetalles = DB::connection('mysql')->select($sql);\n $ab = array();\n $ab = $arrayDetalles;\n foreach($ab as $t){\n $t->aeo = Crypt::decrypt($t->aeo);\n $t->alim = Crypt::decrypt($t->alim);\n $t->pare = Crypt::decrypt($t->pare);\n //$t->categoria = Crypt::decrypt($t->categoria);\n //$t->monto = Crypt::decrypt($t->monto);\n //return $t->monto;\n }\n return json_encode($ab);\n }", "function get_equipos_cat($where=null){\n \n if(!is_null($where)){\n $where='WHERE '.$where;\n }else{\n $where='';\n }\n\n $sql=\"select sub4.uni_acad,trim(d.apellido)||', '||trim(d.nombre) as docente_nombre,d.nro_docum,d.legajo,d.fec_nacim,coalesce(d.correo_institucional,'')||' '|| coalesce(d.correo_personal,'') as correo,sub4.id_designacion,sub4.cat_est,sub4.carac,sub4.desde,sub4.hasta,t_mo.descripcion as modulo,carga_horaria,observacion,case when trim(rol)='NE' then 'Aux' else 'Resp' end as rol,p.descripcion as periodo, dep.descripcion as dep,ar.descripcion as area,t_o.descripcion as ori,case when materia_conj is not null then materia_conj else m.desc_materia||'('||pl.cod_carrera||' de '||pl.uni_acad|| ')' end as desc_materia\n from(select sub2.id_designacion,sub2.id_materia,sub2.id_docente,sub2.id_periodo,sub2.modulo,sub2.carga_horaria,sub2.rol,sub2.observacion,cat_est,dedic,carac,desde,hasta,uni_acad,sub2.id_departamento,sub2.id_area,sub2.id_orientacion,string_agg(sub4.materia,'/') as materia_conj \n from (select distinct * from (\n select distinct upper(trim(m.desc_materia)) as desc_materia,a.anio,b.id_designacion,b.id_docente,d.legajo,a.id_periodo,a.modulo,a.carga_horaria,a.rol,a.observacion,a.id_materia,b.uni_acad,cat_estat||dedic as cat_est,dedic,carac,b.desde,b.hasta,b.id_departamento,b.id_area,b.id_orientacion,case when lic.id_novedad is null then 0 else 1 end as licencia\n from asignacion_materia a\n INNER JOIN materia m ON (m.id_materia=a.id_materia)\n INNER JOIN designacion b ON (a.id_designacion=b.id_designacion)\n INNER JOIN docente d ON (b.id_docente=d.id_docente)\n --esto para saber si esta de licencia dentro del periodo y anio en el que esta designado. Entonces con el filtro puedo descartar a los que no estan ejerciendo\n INNER JOIN mocovi_periodo_presupuestario p ON (a.anio=p.anio)\n LEFT OUTER JOIN ( select t_n.*,extract(year from t_n.desde) as anio\n from novedad t_n \n where t_n.tipo_nov in (1,4,2,3,5)\n ) lic ON (lic.id_designacion = a.id_designacion \n and lic.anio=a.anio \n and ((lic.tipo_nov in (2,3,5) and\n ((a.id_periodo=1 and lic.desde<=to_date(cast(p.anio as text)||'-07-01','YYYY-MM-DD')and lic.hasta>=p.fecha_inicio) or\n (a.id_periodo=2 and lic.desde<=p.fecha_fin and lic.hasta>=to_date(cast(p.anio as text)||'-07-01','YYYY-MM-DD')) or\n ((a.id_periodo=3 or a.id_periodo=4) and lic.desde<=p.fecha_fin and lic.hasta>=p.fecha_inicio )\n )\n ) or\n (\n lic.tipo_nov in (1,4) and \n ((a.id_periodo=1 and lic.desde<=to_date(cast(p.anio as text)||'-07-01','YYYY-MM-DD')and lic.desde>=p.fecha_inicio) or\n (a.id_periodo=2 and lic.desde<=p.fecha_fin and lic.desde>=to_date(cast(p.anio as text)||'-07-01','YYYY-MM-DD')) or\n ((a.id_periodo=3 or a.id_periodo=4) and lic.desde<=p.fecha_fin and lic.desde>=p.fecha_inicio )\n )\n ) ) \n )\n where not (b.hasta is not null and b.hasta<=b.desde)\n )sub1\n \".$where.\" ) sub2 \n LEFT OUTER JOIN \n ( select t_c.id_conjunto,t_p.anio,t_c.id_periodo,t_c.ua,t_e.id_materia\n from en_conjunto t_e,conjunto t_c, mocovi_periodo_presupuestario t_p\n WHERE t_e.id_conjunto=t_c.id_conjunto and t_p.id_periodo=t_c.id_periodo_pres \n )sub3 ON (sub3.ua=sub2.uni_acad and sub3.id_periodo=sub2.id_periodo and sub3.anio=sub2.anio and sub3.id_materia=sub2.id_materia)\n LEFT OUTER JOIN \n (select t_e.id_conjunto,t_e.id_materia,t_m.desc_materia||'('||t_p.cod_carrera||' de '||t_p.uni_acad||')' as materia from en_conjunto t_e,materia t_m ,plan_estudio t_p\n where t_e.id_materia=t_m.id_materia\n and t_p.id_plan=t_m.id_plan)sub4 ON sub4.id_conjunto=sub3.id_conjunto\n group by sub2.id_designacion,sub2.id_materia,sub2.id_docente,sub2.id_periodo,sub2.modulo,sub2.carga_horaria,sub2.rol,sub2.observacion,cat_est,dedic,carac,desde,hasta,uni_acad,sub2.id_departamento,sub2.id_area,sub2.id_orientacion)sub4\n LEFT OUTER JOIN docente d ON d.id_docente=sub4.id_docente\n LEFT OUTER JOIN periodo p ON p.id_periodo=sub4.id_periodo\n LEFT OUTER JOIN modulo t_mo ON sub4.modulo=t_mo.id_modulo\n LEFT OUTER JOIN departamento dep ON dep.iddepto=sub4.id_departamento\n LEFT OUTER JOIN area ar ON ar.idarea=sub4.id_area\n LEFT OUTER JOIN orientacion t_o ON (sub4.id_orientacion=t_o.idorient and ar.idarea=t_o.idarea)\n LEFT OUTER JOIN materia m ON m.id_materia=sub4.id_materia\n LEFT OUTER JOIN plan_estudio pl ON pl.id_plan=m.id_plan\n \n order by desc_materia,periodo,modulo,rol\";\n return toba::db('designa')->consultar($sql);\n }", "function produitLoadFull($db,$id){\n $id = (int) $id;\n $req = \"SELECT P.idproduit, P.modele, LEFT(P.descriptif,300) AS modele, C.genre, I.legend, GROUP_CONCAT(I.legend SEPARATOR '|||') AS theimages_titre, GROUP_CONCAT(C.genre SEPARATOR '|||') AS genre\n FROM produits P \n LEFT JOIN produits_has_categorie PHC \n ON PHC.produits_id = P.idproduit\n LEFT JOIN images I \n ON I.idmage = produits_idproduit\nWHERE P.idproduit=$idproduit\nGROUP BY P.idproduit\n \";\n $recup = mysqli_query($db,$req);\n // si on a 1 résultat\n if(mysqli_num_rows($recup)){\n // on utilise le fetch all car il peut y avoir plus d'un résultat\n return mysqli_fetch_assoc($recup);\n }\n // no result\n return false;\n}", "function getHotelMedia($txt_id,$spath){\n global $dbConn;\n $params9 = array(); \n global $link;\n// $query_hotels = \"SELECT id , filename as img , hotel_id FROM `discover_hotels_images` WHERE hotel_id = $txt_id ORDER BY default_pic DESC LIMIT 18\";\n $query_hotels = \"SELECT id , filename as img , hotel_id FROM `discover_hotels_images` WHERE hotel_id = :Txt_id ORDER BY default_pic DESC LIMIT 18\";\n $params9[] = array( \"key\" => \":Txt_id\",\n \"value\" =>$txt_id);\n $select = $dbConn->prepare($query_hotels);\n PDO_BIND_PARAM($select,$params9);\n $ret_hotels = $select->execute();\n $media_hotels = array();\n// $ret_hotels = db_query($query_hotels);\n $row = $select->fetchAll();\n// while($row = db_fetch_array($ret_hotels)){\n foreach($row as $row_item){\n $imgArr = array();\n $imgArr['img'] = $link.$row_item['img'];\n $imgArr['thumb'] = $link.\"thumb/\".$row_item['img'];\n\n $dims = imageGetDimensions( $spath . 'media/discover/' .$row_item['img']);\n\n $width = $dims['width'];\n $height = $dims['height'];\n //for large size\n $new_height = 256;\n $scaleWidth= 476/$width;\n $scaleHeight= 256/$height;\n if($scaleWidth>$scaleHeight){\n $new_width = $width*$scaleWidth;\n $new_height = $height*$scaleWidth;\n }else{\n $new_width = $width*$scaleHeight;\n $new_height = $height*$scaleHeight;\n }\n $dataw=$new_width;\n $datah = $new_height;\n //for medium size\n $new_height2 = 112;\n $scaleWidth2= 219/$width;\n $scaleHeight2= 112/$height;\n if($scaleWidth2>$scaleHeight2){\n $new_width2 = $width*$scaleWidth2;\n $new_height2 = $height*$scaleWidth2;\n }else{\n $new_width2 = $width*$scaleHeight2;\n $new_height2 = $height*$scaleHeight2;\n }\n $imgArr['imgWidth'] = $dataw;\n $imgArr['imgHeight'] = $datah;\n $imgArr['style'] = 'style=\"width:'.round($dataw).'px;height:'.round($datah).'px\"';\n $imgArr['mediumStyle'] = 'style=\"width:'.round($new_width2).'px;height:'.round($new_height2).'px\"';\n $media_hotels[] = $imgArr;\n }\n return $media_hotels;\n}", "public function readSum_article()\n\t{\n // ,group_concat(distinct t5.tb_name,t4.cateId),group_concat(distinct t5.name)\n\t\t// from article_item t1 \n\t\t// left outer join tags_insec_article t2 on t1.id=t2.acleId\n\t\t// left outer join tags t3 on t2.tagId = t3.id\n // left outer join cate_insec_article t4 on t1.id = t4.acleId\n // left outer join cate_tree t5 on t4.cateId = t5.id\n\t\t// group by t1.id\n\n\t\t$this->db->select('\n\t\tt1.id,\n\t\tgroup_concat(distinct t1.tb_name,t1.id),\n\t\tt1.title,\n\t\tt1.description,\n\t\tgroup_concat(distinct t3.tb_name,t2.tagId),\n\t\tgroup_concat(distinct t3.name),\n\t\tgroup_concat(distinct t5.tb_name, t4.cateId),\n\t\tgroup_concat(distinct t5.name)\n\t\t');\n\t $this->db->from('article_item t1'); \n\t $this->db->join('tags_insec_article t2', 't1.id=t2.acleId', 'left');\n\t $this->db->join('tags t3', 't2.tagId = t3.id', 'left');\n\t $this->db->join('cate_insec_article t4', 't1.id = t4.acleId', 'left');\n\t $this->db->join('cate_tree t5', 't4.cateId = t5.id', 'left');\n\t $this->db->group_by('t1.id'); \n\t $query = $this->db->get(); \n\t \n\t \n\t if($query->num_rows() != 0)\n\t {\n\t return $query->result_array();\n\t }\n\t else\n\t {\n\t return false;\n\t }\n\t}", "function get_pengeluaran_by_akun5digitl3($data){\n// var_dump($data);die;\n $str_ = '';\n if(count($data['array_id']) > 1){\n foreach($data['array_id'] as $id){\n $str_ .= \"rsa_2018.rsa_kuitansi.id_kuitansi = '{$id}' OR \" ;\n }\n $str_ = substr($str_,0, strlen($str_) - 3 );\n }else{\n $str_ = \"rsa_2018.rsa_kuitansi.id_kuitansi = '{$data['array_id'][0]}'\" ;\n }\n // echo $str_ ; die;\n $str = \"SELECT SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,7,10) AS rka,rsa_2018.rsa_kuitansi.id_kuitansi,SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,7,10) AS kode_usulan_rkat,rba_2018.komponen_input.nama_komponen,rba_2018.subkomponen_input.nama_subkomponen,rba_2018.akun_belanja.nama_akun5digit,\"\n . \"rsa_2018.rsa_kuitansi.kode_akun5digit,SUM(rsa_2018.rsa_kuitansi_detail.volume*rsa_2018.rsa_kuitansi_detail.harga_satuan) AS pengeluaran \"\n . \"FROM rsa_2018.rsa_kuitansi \"\n . \"JOIN rsa_2018.rsa_kuitansi_detail \"\n . \"ON rsa_2018.rsa_kuitansi_detail.id_kuitansi = rsa_2018.rsa_kuitansi.id_kuitansi \"\n . \"JOIN rba_2018.komponen_input ON rba_2018.komponen_input.kode_kegiatan = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,7,2) \"\n . \"AND rba_2018.komponen_input.kode_output = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,9,2) \"\n . \"AND rba_2018.komponen_input.kode_program = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,11,2) \"\n . \"AND rba_2018.komponen_input.kode_komponen = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,13,2) \"\n . \"JOIN rba_2018.subkomponen_input ON rba_2018.subkomponen_input.kode_kegiatan = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,7,2) \"\n . \"AND rba_2018.subkomponen_input.kode_output = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,9,2) \"\n . \"AND rba_2018.subkomponen_input.kode_program = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,11,2) \"\n . \"AND rba_2018.subkomponen_input.kode_komponen = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,13,2) \"\n . \"AND rba_2018.subkomponen_input.kode_subkomponen = SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,15,2) \"\n . \"JOIN rba_2018.akun_belanja ON rba_2018.akun_belanja.kode_akun5digit = rsa_2018.rsa_kuitansi.kode_akun5digit \"\n . \"AND rba_2018.akun_belanja.kode_akun = rsa_2018.rsa_kuitansi.kode_akun \"\n . \"AND rba_2018.akun_belanja.sumber_dana = rsa_2018.rsa_kuitansi.sumber_dana \"\n . \"WHERE rsa_2018.rsa_kuitansi.kode_unit = '{$data['kode_unit_subunit']}' \"\n . \"AND rsa_2018.rsa_kuitansi.jenis = 'L3' \"\n . \"AND ( \" . $str_ . \" ) \"\n . \"AND rsa_2018.rsa_kuitansi.tahun = '{$data['tahun']}' \"\n . \"GROUP BY SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,7,10),SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,19,5) \"\n . \"ORDER BY SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,7,10) ASC,SUBSTR(rsa_2018.rsa_kuitansi.kode_usulan_belanja,19,5) ASC\";\n\n // echo $str;die;\n// var_dump($str);die;\n\n $q = $this->db->query($str);\n // var_dump($q->num_rows());die;\n if($q->num_rows() > 0){\n return $q->result();\n }else{\n return '';\n }\n }", "public function cpJoin() {\n $sql=\"select packages.packageName, prices.id, prices.price, products.productName, products.cid, prices.productID, prices.areaID, prices.packageID \"\n . \"from prices\"\n . \" inner join packages on packages.packageID=prices.packageID\"\n . \" inner join products on prices.productID=products.productID where products.cid='9'\";\n $sth=$this->dbh->prepare($sql);\n \n $sth->execute();\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n}", "public function getSplit() {\n $req = 'SELECT tbljobs.id_tbljob, tbljobs.id_info_job,\n customer, job, split, po_number, devis, info_jobs.instruction as info_jobs_instruction, info_jobs.commentaire as info_jobs_commentaire, inOut_recommendation,schedule_recommendation,\n activity_type, specific_test, order_val, order_est, order_est_subc,\n resp.technicien as resp,\n contacts.genre, contacts.prenom, contacts.nom, contacts.email as email, contacts.telephone as telephone, contacts.prenom, contacts.nom, contacts.departement, contacts.rue1, contacts.rue2, contacts.ville, contacts.pays,\n contacts2.genre as genre2, contacts2.prenom as prenom2, contacts2.nom as nom2, contacts2.email as email2, contacts2.telephone as telephone2,\n contacts3.genre as genre3, contacts3.prenom as prenom3, contacts3.nom as nom3, contacts3.email as email3, contacts3.telephone as telephone3,\n contacts4.genre as genre4, contacts4.prenom as prenom4, contacts4.nom as nom4, contacts4.email as email4, contacts4.telephone as telephone4,\n tbljob_commentaire, tbljob_instruction, tbljob_commentaire_qualite, planning, tbljob_frequence,\n GE, specific_protocol, special_instruction, staircase,\n createur, t1.technicien as nomCreateur, t2.technicien as comCheckeur,\n statuts.id_statut, statut, etape, statut_color, test_type, test_type_abbr, test_type_cust, ST,final, auxilaire, tbljobs.id_rawData, rawData.name, rawdatatobesent,\n report_rev, invoice_type, invoice_date, invoice_commentaire, invoice_lang, invoice_currency,\n specification, ref_matiere, matiere, tbljobs.waveform, GROUP_CONCAT(DISTINCT dessin SEPARATOR \" \") as dessin, GROUP_CONCAT(DISTINCT master_eprouvettes.id_dwg SEPARATOR \" \") as id_dessin,\n other_1, other_2, other_3, other_4, other_5,\n GROUP_CONCAT( DISTINCT round(c_temperature,0) ORDER BY c_temperature DESC SEPARATOR \" / \") as temperature,\n GROUP_CONCAT( DISTINCT round(c_frequence,1) ORDER BY c_frequence DESC SEPARATOR \" / \") as c_frequence,\n GROUP_CONCAT( DISTINCT round(c_frequence_STL,1) ORDER BY c_frequence_STL DESC SEPARATOR \" / \") as c_frequence_STL,\n GROUP_CONCAT( DISTINCT machine SEPARATOR \" / \") as machines,\n GROUP_CONCAT( DISTINCT cell_load_capacity SEPARATOR \" / \") as cell_load_capacity,\n if(type1.consigne_type=\"R\",GROUP_CONCAT( DISTINCT round(c_type_1_val,2) ORDER BY c_type_1_val DESC SEPARATOR \" / \"),\"\") as ratio1,\n if(type2.consigne_type=\"R\",GROUP_CONCAT( DISTINCT round(c_type_1_val,2) ORDER BY c_type_1_val DESC SEPARATOR \" / \"),\"\") as ratio2,\n sum(if(type_chauffage=\"Four\",1,0)) as four,\n sum(if(type_chauffage=\"Coil\",1,0)) as coil,\n type1.consigne_type as c_type_1, type2.consigne_type as c_type_2, c_unite,\n type1.id_consigne_type as id_c_type_1, type2.id_consigne_type as id_c_type_2,\n DyT_SubC, DyT_expected, DyT_Cust, available_expected, report_send,\n (SELECT DyT_expected FROM tbljobs t WHERE t.id_info_job=tbljobs.id_info_job AND t.phase<tbljobs.phase AND DyT_expected IS NOT NULL ORDER BY phase DESC LIMIT 1) AS available,\n checked, comments, contacts.adresse,\n contactST.id_contact as id_contactST, contactST.genre as genreST, contactST.prenom as prenomST, contactST.nom as nomST,entrepriseST.id_entreprise as id_entrepriseST, entrepriseST.entreprise as entrepriseST, entrepriseST.entreprise_abbr as entreprise_abbrST, refSubC,\n\n entreprises.entreprise, entreprises.VAT, entreprises.MRSASRef, entreprises.billing_rue1, entreprises.billing_rue2, entreprises.billing_ville, entreprises.billing_pays,\n\n count(distinct master_eprouvettes.id_master_eprouvette) as nbep,\n count(distinct eprouvettes.id_eprouvette) as nbtest,\n count(n_essai) as nbtestdone,\n COUNT(DISTINCT CASE WHEN n_essai is null THEN master_eprouvettes.id_master_eprouvette END) nbepleft,\n COUNT(DISTINCT CASE WHEN d_checked <=0 THEN master_eprouvettes.id_master_eprouvette END) nbepCheckedleft,\n\n sum(ceil(temps_essais)) as tpstest,\n sum(ceil(if(temps_essais is null,null,if(temps_essais>24, temps_essais-24,0)))) as hrsup,\n sum(ceil(\n if(temps_essais is null,\n if(\n IF(Cycle_final is null,Cycle_final_temp, cycle_final) >0 AND c_frequence is not null and c_frequence !=0,\n if(Cycle_STL is null and c_cycle_STL is null,\n IF(Cycle_final is null,Cycle_final_temp, cycle_final)/eprouvettes.c_frequence/3600,\n if(Cycle_STL is null,\n if(\n IF(Cycle_final is null,Cycle_final_temp, cycle_final)>c_cycle_STL,(c_cycle_STL/c_frequence+(IF(Cycle_final is null,Cycle_final_temp, cycle_final)-c_cycle_STL)/c_frequence_STL)/3600,\n (IF(Cycle_final is null,Cycle_final_temp, cycle_final)/c_frequence)/3600\n )\n ,if(\n IF(Cycle_final is null,Cycle_final_temp, cycle_final)>cycle_STL,\n (cycle_STL/c_frequence+(IF(Cycle_final is null,Cycle_final_temp, cycle_final)-cycle_STL)/c_frequence_STL)/3600,\n (IF(Cycle_final is null,Cycle_final_temp, cycle_final)/c_frequence)/3600\n )\n )\n ),\n 0)\n ,temps_essais\n )\n )) as tpscalc,\n\n sum(ceil(\n if(\n if(temps_essais is null,\n if(\n IF(Cycle_final is null,Cycle_final_temp, cycle_final) >0 AND c_frequence is not null and c_frequence !=0,\n if(\n Cycle_STL is null and c_cycle_STL is null,\n IF(\n Cycle_final is null,Cycle_final_temp, cycle_final)/eprouvettes.c_frequence/3600,\n if(\n Cycle_STL is null,\n if(\n IF(Cycle_final is null,Cycle_final_temp, cycle_final)>c_cycle_STL,\n (c_cycle_STL/c_frequence+(IF(Cycle_final is null,Cycle_final_temp, cycle_final)-c_cycle_STL)/c_frequence_STL)/3600,\n (IF(Cycle_final is null,Cycle_final_temp, cycle_final)/c_frequence)/3600\n )\n ,if(\n IF(Cycle_final is null,Cycle_final_temp, cycle_final)>cycle_STL,\n (cycle_STL/c_frequence+(IF(Cycle_final is null,Cycle_final_temp, cycle_final)-cycle_STL)/c_frequence_STL)/3600,\n (IF(Cycle_final is null,Cycle_final_temp, cycle_final)/c_frequence)/3600\n )\n )\n ),\n \"\")\n ,temps_essais\n )>24,\n if(temps_essais is null,\n if(IF(Cycle_final is null,Cycle_final_temp, cycle_final) >0 AND c_frequence is not null and c_frequence !=0,\n if(Cycle_STL is null and c_cycle_STL is null,\n IF(Cycle_final is null,Cycle_final_temp, cycle_final)/eprouvettes.c_frequence/3600,\n if(Cycle_STL is null,\n if(IF(Cycle_final is null,Cycle_final_temp, cycle_final)>c_cycle_STL,\n (c_cycle_STL/c_frequence+(IF(Cycle_final is null,Cycle_final_temp, cycle_final)-c_cycle_STL)/c_frequence_STL)/3600,\n (IF(Cycle_final is null,Cycle_final_temp, cycle_final)/c_frequence)/3600\n )\n ,if(IF(Cycle_final is null,Cycle_final_temp, cycle_final)>cycle_STL,\n (cycle_STL/c_frequence+(IF(Cycle_final is null,Cycle_final_temp, cycle_final)-cycle_STL)/c_frequence_STL)/3600,\n (IF(Cycle_final is null,Cycle_final_temp, cycle_final)/c_frequence)/3600\n )\n )\n ),\n \"\"\n )\n ,temps_essais\n )-24,\n 0\n )\n ))\n as tpssupcalc\n\n FROM tbljobs\n LEFT JOIN test_type ON test_type.id_test_type=tbljobs.id_type_essai\n LEFT JOIN info_jobs ON info_jobs.id_info_job=tbljobs.id_info_job\n LEFT JOIN eprouvettes ON eprouvettes.id_job=tbljobs.id_tbljob\n LEFT JOIN eprouvettes_temp ON eprouvettes_temp.id_eprouvettes_temp=eprouvettes.id_eprouvette\n LEFT JOIN enregistrementessais ON enregistrementessais.id_eprouvette=eprouvettes.id_eprouvette\n LEFT JOIN prestart ON prestart.id_prestart=enregistrementessais.id_prestart\n LEFT JOIN postes ON postes.id_poste=prestart.id_poste\n LEFT JOIN machines ON machines.id_machine=postes.id_machine\n LEFT JOIN chauffages ON chauffages.id_chauffage=postes.id_chauffage\n LEFT JOIN cell_load ON cell_load.id_cell_load=postes.id_cell_load\n LEFT JOIN master_eprouvettes ON master_eprouvettes.id_master_eprouvette=eprouvettes.id_master_eprouvette\n LEFT JOIN dessins ON dessins.id_dessin=master_eprouvettes.id_dwg\n LEFT JOIN techniciens resp ON resp.id_technicien=info_jobs.id_resp\n LEFT JOIN contacts ON contacts.id_contact=info_jobs.id_contact\n LEFT JOIN contacts contacts2 ON contacts2.id_contact=info_jobs.id_contact2\n LEFT JOIN contacts contacts3 ON contacts3.id_contact=info_jobs.id_contact3\n LEFT JOIN contacts contacts4 ON contacts4.id_contact=info_jobs.id_contact4\n LEFT JOIN contacts contactST ON contactST.id_contact=tbljobs.id_contactST\n LEFT JOIN entreprises entrepriseST ON entrepriseST.id_entreprise=contactST.ref_customer\n LEFT JOIN entreprises ON entreprises.id_entreprise=info_jobs.customer\n LEFT JOIN tbljobs_temp ON tbljobs_temp.id_tbljobs_temp=tbljobs.id_tbljob\n LEFT JOIN statuts ON statuts.id_statut=tbljobs_temp.id_statut_temp\n LEFT JOIN matieres ON matieres.id_matiere=info_jobs.id_matiere_std\n LEFT JOIN rawData ON rawData.id_rawData=tbljobs.id_rawData\n LEFT JOIN consigne_types as type1 ON type1.id_consigne_type=tbljobs.c_1\n LEFT JOIN consigne_types as type2 ON type2.id_consigne_type=tbljobs.c_2\n LEFT JOIN techniciens as t1 on t1.id_technicien=tbljobs.modif\n LEFT JOIN techniciens as t2 on t2.id_technicien=tbljobs.checked\n\n\n\n WHERE tbljobs.id_tbljob='.$this->id.'\n AND eprouvette_actif=1\n AND master_eprouvette_actif=1\n GROUP BY tbljobs.id_tbljob';\n //echo $req;\n return $this->db->getOne($req);\n }", "public function get_used_images(){\r $query = \"select `s`.`image` as `image` from `ct_services` as `s`\rUNION\rselect `sa`.`image` as `image` from `ct_services_addon` as `sa`\rUNION\rselect `setim`.`option_value` as `setimage` from `ct_settings` as `setim` where `option_name` = 'ct_company_logo'\";\r $result=mysqli_query($this->conn,$query);\r return $result;\r }", "public function getGruppi(){\n \n if($this->azienda>0){\n $cosa=(\" azienda = \".$this->azienda.\" OR owner=-1 \");\n\n $this->db->from(\"lm_categorie_prodotti\");\n \n $this->db->where($cosa);\n\n $query=$this->db->get();\n\n //$datas=$query->result();//\n $datas = $query->result_array();\n if(count($datas)>0){\n $gruppi=array();\n foreach($datas as $g){\n if($g[\"foto\"]==null){\n $g[\"foto\"]=\"/public/img/noimage.jpg\";\n }\n $gruppi[$g[\"gruppo\"]][]=$g;\n }\n }else{\n $cosa=(\"owner = \".$this->utente.\" OR owner = -1\");\n $this->db->from(\"lm_categorie_prodotti\");\n $this->db->where($cosa);\n\n $query=$this->db->get();\n $datas = $query->result_array();\n $gruppi=array();\n foreach($datas as $g){\n \n if($g[\"foto\"]==null){\n $g[\"foto\"]=\"/public/img/noimage.jpg\";\n }\n $gruppi[$g[\"gruppo\"]][]=$g;\n \n }\n }\n \n }else{\n redirect(\"/\");\n }\n \n return $gruppi;\n }", "function get_loop_list($pdb_id)\n {\n ### TESTING THIS QUERY -- REMOVE LINES 30-37 WHEN APPROVED\n // $this->db->select('group_concat(unit_id) AS unit_ids, LI.loop_id', FALSE)\n // ->from('loop_info AS LI')\n // ->join('loop_positions AS LP', 'LI.loop_id = LP.loop_id')\n // ->where('LI.pdb_id', $pdb_id)\n // ->group_by('LI.loop_id');\n // $query = $this->db->get();\n\n // if ( $query->num_rows() > 0 ) {\n // $data = array();\n // foreach($query->result() as $row) {\n // $data[] = '\"' . implode('\",\"', array($row->loop_id, $row->unit_ids)) . '\"';\n // }\n // $table = implode(\"\\n\", $data);\n // } else {\n // $table = 'No loops found';\n // }\n\n // return $table;\n\n\n $this->db->select('loop_info.loop_id, group_concat(unit_id order by position_2023) as unit_ids')\n ->from('loop_info')\n ->join('loop_positions', 'loop_info.loop_id = loop_positions.loop_id')\n ->where('loop_info.pdb_id', $pdb_id)\n ->group_by('loop_info.loop_id');\n $query = $this->db->get();\n\n if ( $query->num_rows() > 0 ) {\n $data = array();\n foreach($query->result() as $row) {\n $data[] = '\"' . implode('\",\"', array($row->loop_id, $row->unit_ids)) . '\"';\n }\n $table = implode(\"\\n\", $data);\n } else {\n $table = 'No loops found';\n }\n\n return $table; \n\n }", "public function get_all($pmss, $date1, $date2)\n {\n $query = $this->db->query(\"SELECT nid, duration_g, Integration, Integration_Default,Created, Published,Duration,\nsec_to_time(AVG(time_to_sec(TIMEDIFF( convert_tz(Published,'PST8PDT','GMT'), Created)))) 'ravg',\nsec_to_time(AVG(time_to_sec(TIMEDIFF( airbnb_created, convert_tz(Published,'PST8PDT','GMT'))))) 'aavg',\nsec_to_time(AVG(time_to_sec(TIMEDIFF( bookingcom_created, convert_tz(Published,'PST8PDT','GMT'))))) 'bavg',\nsec_to_time(AVG(time_to_sec(TIMEDIFF( homeaway_created, convert_tz(Published,'PST8PDT','GMT'))))) 'havg',\nsec_to_time(AVG(time_to_sec(TIMEDIFF( expedia_created, convert_tz(Published,'PST8PDT','GMT'))))) 'eavg',\nsec_to_time(AVG(time_to_sec(TIMEDIFF( tripadvisor_created, convert_tz(Published,'PST8PDT','GMT'))))) 'tavg'\n from(SELECT a.nid 'nid', DATE_FORMAT(timestamp1,'%Y-%m-%d') 'duration_g',\n\n\n-- sec_to_time(AVG(time_to_sec(TIMEDIFF( b.Published, timestamp1)))),\nif(cff.field_calendar_feed_format_value like 'haapi_%', 'homeaway API',cff.field_calendar_feed_format_value) 'Integration',\n cff.field_calendar_feed_format_value 'Integration_Default',\n timestamp1 'Created', \n b.Published 'Published', \n TIMEDIFF( b.Published, timestamp1) 'Duration', \n group_concat(\n if(\n cp.channel = 'airbnb', cp.created_ts, \n null\n )\n ) as 'airbnb_created', \n group_concat(\n if(\n cp.channel = 'bookingcom', cp.created_ts, \n null\n )\n ) as 'bookingcom_created', \n group_concat(\n if(\n cp.channel = 'homeaway', cp.created_ts, \n null\n )\n ) as 'homeaway_created', \n group_concat(\n if(\n cp.channel = 'expedia', cp.created_ts, \n null\n )\n ) as 'expedia_created', \n group_concat(\n if(\n cp.channel = 'tripadvisor', cp.created_ts, \n null\n )\n ) as 'tripadvisor_created' \nFROM \n (\n SELECT \n nid, \n uid, \n FROM_UNIXTIME(created) 'timestamp1' \n FROM \n node\n ) a \n left join (\n select \n min(psmnid), \n psmnid, \n nid, \n destination_state, \n created_at 'Published' \n from \n property_state_machine_notes \n where \n destination_state = 'live'\n group by nid\n ) b on b.nid = a.nid \n left join manager_cc_fees mc on mc.mid = a.uid \n left join channel_properties cp on cp.nid = a.nid \n left join field_data_field_calendar_feed_format cff on cff.entity_id = a.nid\nwhere timestamp1 between '\".$date1.\" 00:00:00' and '\".$date2.\" 23:59:59'\n$pmss\nand b.Published !='NULL'\n group by a.nid\n ) h\n group by h.duration_g\n \n;\");\n return $query->result_array();\n }", "public function cargar_cat($com, $anu, $id){\n\n try{\n \n \n $pdo = AccesoDB::getCon();\n\n if($com == -1){\n\n $sql = \"select distinct * from (\nselect count(p.id_promo) promo,a.id_anuncio, a.nom_anuncio,a.cat_anuncio , \nIFNULL((select ROUND((sum(b.nota_puntaje)/count(b.id_puntaje)), 0) from puntaje b where a.id_anuncio = b.fk_anuncio and b.vig_puntaje = 1),0) puntaje,\nIFNULL((select i.img from img_anuncio i where a.id_anuncio = i.fk_id_anuncio order by i.id_img limit 1),'https://www.w3schools.com/bootstrap4/img_avatar1.png') img\nfrom anuncios a left join promo p on a.id_anuncio = fk_id_anuncio and p.duracion_promo > sysdate() where a.comuna_anuncio <> :com and a.vig_anuncio = 1 and a.id_anuncio <> :id and a.cat_anuncio = (select z.cat_anuncio from anuncios z where z.id_anuncio = :id) and a.fec_termino_anuncio >= sysdate() \ngroup by a.id_anuncio, a.nom_anuncio,a.cat_anuncio \nunion all\nselect count(p.id_promo) promo,a.id_anuncio, a.nom_anuncio,a.cat_anuncio , \nIFNULL((select ROUND((sum(c.nota_puntaje)/count(c.id_puntaje)), 0) from puntaje c where a.id_anuncio = c.fk_anuncio and c.vig_puntaje = 1),0) puntaje,\nIFNULL((select i.img from img_anuncio i where a.id_anuncio = i.fk_id_anuncio order by i.id_img limit 1),'https://www.w3schools.com/bootstrap4/img_avatar1.png') img\nfrom anuncios a inner join cat_anuncio b on a.cat_anuncio = b.id_cat left join promo p on a.id_anuncio = fk_id_anuncio and p.duracion_promo > sysdate()\nwhere b.nom_cat like :anu and a.comuna_anuncio <> :com and a.vig_anuncio = 1 and a.id_anuncio <> :id and a.fec_termino_anuncio >= sysdate() \ngroup by a.id_anuncio, a.nom_anuncio,a.cat_anuncio ) a\";\n\n\n\n }elseif ($com == 0) {\n $sql = \"select distinct * from (\nselect count(p.id_promo) promo,a.id_anuncio, a.nom_anuncio,a.cat_anuncio , \nIFNULL((select ROUND((sum(b.nota_puntaje)/count(b.id_puntaje)), 0) from puntaje b where a.id_anuncio = b.fk_anuncio and b.vig_puntaje = 1),0) puntaje,\nIFNULL((select i.img from img_anuncio i where a.id_anuncio = i.fk_id_anuncio order by i.id_img limit 1),'https://www.w3schools.com/bootstrap4/img_avatar1.png') img\nfrom anuncios a left join promo p on a.id_anuncio = fk_id_anuncio and p.duracion_promo > sysdate() where (a.nom_anuncio like :anu or a.desc_anuncio like :anu) and a.vig_anuncio = 1 and a.id_anuncio <> :id and a.fec_termino_anuncio >= sysdate() \ngroup by a.id_anuncio, a.nom_anuncio,a.cat_anuncio \nunion all\nselect count(p.id_promo) promo,a.id_anuncio, a.nom_anuncio,a.cat_anuncio , \nIFNULL((select ROUND((sum(c.nota_puntaje)/count(c.id_puntaje)), 0) from puntaje c where a.id_anuncio = c.fk_anuncio and c.vig_puntaje = 1),0) puntaje,\nIFNULL((select i.img from img_anuncio i where a.id_anuncio = i.fk_id_anuncio order by i.id_img limit 1),'https://www.w3schools.com/bootstrap4/img_avatar1.png') img\nfrom anuncios a inner join cat_anuncio b on a.cat_anuncio = b.id_cat left join promo p on a.id_anuncio = fk_id_anuncio and p.duracion_promo > sysdate()\nwhere b.nom_cat like :anu and a.vig_anuncio = 1 and a.id_anuncio <> :id and a.fec_termino_anuncio >= sysdate() \ngroup by a.id_anuncio, a.nom_anuncio,a.cat_anuncio ) a\";\n \n\n\n\n\n }else{\n\n \n\n $sql = \"select distinct * from (\nselect count(p.id_promo) promo,a.id_anuncio, a.nom_anuncio,a.cat_anuncio , \nIFNULL((select ROUND((sum(b.nota_puntaje)/count(b.id_puntaje)), 0) from puntaje b where a.id_anuncio = b.fk_anuncio and b.vig_puntaje = 1),0) puntaje,\nIFNULL((select i.img from img_anuncio i where a.id_anuncio = i.fk_id_anuncio order by i.id_img limit 1),'https://www.w3schools.com/bootstrap4/img_avatar1.png') img\nfrom anuncios a left join promo p on a.id_anuncio = fk_id_anuncio and p.duracion_promo > sysdate() where (a.nom_anuncio like :anu or a.desc_anuncio like :anu) and (a.comuna_anuncio = 1 or a.comuna_anuncio = 0) and a.vig_anuncio = 1 and a.id_anuncio <> :id and a.fec_termino_anuncio >= sysdate() \ngroup by a.id_anuncio, a.nom_anuncio,a.cat_anuncio \nunion all\nselect count(p.id_promo) promo,a.id_anuncio, a.nom_anuncio,a.cat_anuncio , \nIFNULL((select ROUND((sum(c.nota_puntaje)/count(c.id_puntaje)), 0) from puntaje c where a.id_anuncio = c.fk_anuncio and c.vig_puntaje = 1),0) puntaje,\nIFNULL((select i.img from img_anuncio i where a.id_anuncio = i.fk_id_anuncio order by i.id_img limit 1),'https://www.w3schools.com/bootstrap4/img_avatar1.png') img\nfrom anuncios a inner join cat_anuncio b on a.cat_anuncio = b.id_cat left join promo p on a.id_anuncio = fk_id_anuncio and p.duracion_promo > sysdate()\nwhere b.nom_cat like :anu and (a.comuna_anuncio = 1 or a.comuna_anuncio = 0) and a.vig_anuncio = 1 and a.id_anuncio <> :id and a.fec_termino_anuncio >= sysdate() \ngroup by a.id_anuncio, a.nom_anuncio,a.cat_anuncio ) a\";\n}\n \n \n \n \n \n $anu = \"%\".$anu.\"%\"; \n \n \n\n $stmt = $pdo->prepare($sql);\n $stmt->bindParam(\":anu\", $anu, PDO::PARAM_STR);\n $stmt->bindParam(\":com\", $com, PDO::PARAM_INT);\n $stmt->bindParam(\":id\", $id, PDO::PARAM_INT);\n $stmt->execute();\n\n $response = $stmt->fetchAll();\n return $response;\n\n } catch (Exception $e) {\n echo\"<script type=\\\"text/javascript\\\">alert('Error, comuniquese con el administrador\". $e->getMessage().\" '); </script>\";\n }\n }", "function getItems()\n\t{\n\t\t$query = ' SELECT ' .\n\t\t\t$this->db->nameQuote('k2.alias') . ',' .\n\t\t\t$this->db->nameQuote('k2.title') . ',' .\n\t\t\t$this->db->nameQuote('k2.introtext') . ',' .\n\t\t\t$this->db->nameQuote('k2.plugins') . ',' .\n\t\t\t$this->db->nameQuote('loc.locations') . ',' .\n\n\t\t\t// Get all additional categories\n\t\t\t' ( SELECT ' .\n\t\t\t' GROUP_CONCAT(' . $this->db->nameQuote('cats.catid') . ')' .\n\t\t\t' FROM ' . $this->db->nameQuote('#__k2_additional_categories') . ' AS ' . $this->db->nameQuote('cats') .\n\t\t\t' WHERE ' . $this->db->nameQuote('k2.id') . ' = ' . $this->db->nameQuote('cats.itemId') .\n\t\t\t') AS ' . $this->db->nameQuote('categoryIDs') . ',' .\n\n\t\t\t// Get first additional categories name\n\t\t\t' ( SELECT ' .\n\t\t\t$this->db->nameQuote('cat.alias') .\n\t\t\t' FROM ' . $this->db->nameQuote('#__k2_categories') . ' AS ' . $this->db->nameQuote('cat') .\n\t\t\t' JOIN ' . $this->db->nameQuote('#__k2_additional_categories') . ' AS ' . $this->db->nameQuote('cats') .\n\t\t\t' ON (' . $this->db->nameQuote('cat.id') . ' = ' . $this->db->nameQuote('cats.catid') . ')' .\n\t\t\t' WHERE ' . $this->db->nameQuote('k2.id') . ' = ' . $this->db->nameQuote('cats.itemId') .\n\t\t\t' AND ' . $this->db->nameQuote('cat.id') . ' NOT IN (' . implode(',', $this->params->get('regionCategories')) . ')' .\n\t\t\t' AND ' . $this->db->nameQuote('parent') . ' = ' . $this->db->quote($this->params->get('primaryCategory')) .\n\t\t\t' LIMIT 1 ' .\n\t\t\t') AS ' . $this->db->nameQuote('category') .\n\n\t\t\t// Join K2 items, K2 locations and additional categories tables by item ID\n\t\t\t' FROM ' . $this->db->nameQuote('#__k2_items') . ' AS ' . $this->db->nameQuote('k2') .\n\t\t\t' JOIN ' . $this->db->nameQuote('#__k2_items_locations') . ' AS ' . $this->db->nameQuote('loc') .\n\t\t\t' ON (' . $this->db->nameQuote('loc.itemId') . ' = ' . $this->db->nameQuote('k2.id') . ')' .\n\t\t\t' JOIN ' . $this->db->nameQuote('#__k2_additional_categories') . ' AS ' . $this->db->nameQuote('cats') .\n\t\t\t' ON (' . $this->db->nameQuote('k2.id') . ' = ' . $this->db->nameQuote('cats.itemId') . ')' .\n\n\t\t\t// Limit results to items that only have the correct additional categories\n\t\t\t' WHERE ' . $this->db->nameQuote('cats.catid') . ' IN (' . implode(',', JRequest::getVar('categories')) . ')' .\n\n\t\t\t// Published items only\n\t\t\t' AND ' . $this->db->nameQuote('published') . ' = ' . $this->db->quote('1') .\n\t\t\t' AND ' . $this->db->nameQuote('k2.trash') . ' = ' . $this->db->quote('0');\n\n\t\t$this->db->setQuery($query);\n\n\t\treturn $this->setUniversalFields($this->db->loadObjectList());\n\t}", "public function getProductos72($inicio,$final,$agrupar=false){\n $sql=\"SET SQL_BIG_SELECTS=1\";\n $this->db->query($sql);\n ini_set('memory_limit', '-1');\n //ini_set('max_execution_time', 0);\n set_time_limit(300);\n $this->load->model('productos_');\n $sql=\"SELECT id_pe_producto,codigo_producto,nombre\n FROM `pe_boka` b \n LEFT JOIN pe_productos p ON p.id=b.id_pe_producto \n WHERE STYP=2 AND \n zeis>='$inicio' AND\n zeis<='$final 23:59:59'\n GROUP BY id_pe_producto,p.nombre\n \";\n \n $this->db->query(\"DELETE FROM pe_productos_excel WHERE 1\");\n $lineasProducto=array();\n $result=$this->db->query($sql)->result();\n $contador=0;\n foreach($result as $k=>$v){\n $id_pe_producto=$v->id_pe_producto;\n $codigo_producto=$v->codigo_producto; \n\n $sql=\"SELECT sum(pos1) as unidades,\n sum(gew1) as peso, \n sum(if(STYP=2,bt20,bt30)) as importe \n FROM `pe_boka` b \n WHERE (STYP=2 OR STYP=202) AND \n zeis>='$inicio' AND\n zeis<='$final 23:59:59' AND \n id_pe_producto='$id_pe_producto'\n \";\n $row=$this->db->query($sql)->row(); \n if(!isset($lineasProducto[$codigo_producto])){\n $lineasProducto[$codigo_producto]=array(\n 'unidades'=>$row->unidades,\n 'peso'=>$row->peso,\n 'importe'=>$row->importe,\n 'codigo_producto'=>$v->codigo_producto,\n 'nombre'=>$v->nombre,\n );\n }else{\n $lineasProducto[$codigo_producto]['unidades']+=$row->unidades;\n $lineasProducto[$codigo_producto]['peso']+=$row->peso;\n $lineasProducto[$codigo_producto]['importe']+=$row->importe;\n }\n $this->db->query(\"INSERT INTO pe_productos_excel SET \n codigo_producto='\".$v->codigo_producto.\"',\n nombre='\".$v->nombre.\"',\n cantidad='\".$row->unidades.\"',\n peso='\".$row->peso.\"',\n importe='\".$row->importe.\"'\n \");\n\n }\n return array('lineasProducto'=>$lineasProducto);\n }", "function allComponentes($codPrograma) {\n \n$sql= \"select a3.cod_componente, a1.nombre_componente, excusamedica, calamidad, transporte, estudio, nojustificada, trabajo, transportemenos, totalinasistencia\nfrom inasistencia_componente_j a1 , inasistencia_componente_noj a2, total_inasistencia_componente a3\nwhere \n\na1.nombre_componente=a2.nombre_componente and a1.nombre_componente=a3.nombre_componente\"\n;\n \n return DB::query($sql);\n }", "public function readDataPerbaikanBelum(){\n $sql = \"SELECT c.tanggal,c.nomor,c.no_inventaris,c.nama_user,b.cost_center,c.no_ex,GROUP_CONCAT(e.pekerjaan SEPARATOR '<br>') as pekerjaan FROM entri c,perbaikan e,kendaraan a,user b WHERE c.nomor = e.id_entri AND a.no_inventaris = c.no_inventaris AND c.id_status = 1 AND b.id_user = a.id_user GROUP BY c.nomor ORDER BY c.tanggal DESC\";\n $query = $this->db->query($sql);\n return $query;\n }", "public function getHessequaPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '109'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "function GetPackageGroupDataById($id_package) {\n \n $data = $this->db\n ->where('is_delete',0)\n ->where('id_status',1)\n ->where('id_package_group',$id_package)\n ->order_by('position','asc')\n ->get('package_group')\n ->row_array();\n \n if($data){\n // foreach ($data as $key=>$package_combo) {\n $data['item'] = $this->db\n ->where('id_package_group',$data['id_package_group'])\n ->get('package_group_item')\n ->result_array();\n\n //for christmas discount\n $real_price = $data['price'];\n $total_diskon_10 = floor( ( $real_price / 100) * 10 );\n \n $harga_natal = $real_price - $total_diskon_10; // 10% off for discount\n $data['real_price'] = $real_price;\n $data['price_diskon_10percent'] = $total_diskon_10;\n //$data['price_natal'] = $harga_natal;\n $data['price'] = $harga_natal; //final price\n\n foreach ($data['item'] as $key2 => $value) {\n $detail = $this->GetPackageByIdDataGroup($value['id_package'],$value['type']);\n $data['item'][$key2]['name'] = $detail['name'];\n $data['item'][$key2]['price'] = $detail['price'];\n }\n \n /*echo '<pre>';\n print_r($data);\n die();*/\n\n //}\n \n }\n \n \n return $data;\n }", "public function getMatzikamaPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '118'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getCapeAgulhasPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '112'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "function select_fitness_apk_data() {\n\n global $connection;\n\n $sql = \"SELECT app.description, app.app_name, app.developer, category.name, apk.version, apk.link, apk.size, app_image.link_img, app_image.alt\n FROM app INNER JOIN apk ON app.app_id=apk.app_id INNER JOIN app_image on app_image.app_id=apk.app_id INNER JOIN category on category.cat_id=app.cat_id \n WHERE category.cat_id=2\";\n\n return $connection->query($sql);\n }", "public function GetSQL()\n {\n\n \t$sql = \"\nSELECT \n\temployee.lastName AS employee_last_name,\n\temployee.firstName AS employee_first_name,\n\tcustomer.companyName AS customer_company,\n\torderDate,\n \tCOUNT(DISTINCT(orderDetail.id)) AS distinct_products_ordered,\n \tGROUP_CONCAT(DISTINCT productName) AS product_list,\n\tshipStateProvince,\n\tshipCity,\n\tshipAddress,\n\tshipName,\n\temployee.id AS employee_id,\n\tcustomer.id AS customer_id, \n\torder.id AS order_id\nFROM DURC_northwind_data.`order` \nJOIN DURC_northwind_model.employee ON \n\temployee.id =\n \temployee_id\nJOIN DURC_northwind_model.customer ON \n\tcustomer.id =\n \tcustomer_id\nJOIN DURC_northwind_data.orderDetail ON \n\torderDetail.order_id =\n \t`order`.id\nJOIN DURC_northwind_model.product ON \t\n\torderDetail.product_id =\n \tproduct.id \nGROUP BY `order`.id\n\";\n\t\t\n \treturn $sql;\n }", "public function getCommondata()\n {\n $select = $this->select()\n // ->setIntegrityCheck(false)\n ->from(array('album' => 'album'),array('Id','name_n'))\n ->join('album_det','album_det.Id = album.Id',array('album_det.Id'));\n // $result=$this->fetchAll($hhh);\n $result = $this->fetchAll($select);\n \n echo \"<pre>\";\n print_r($result);exit;\n return $result;\n\n }", "public function getSkuHierarchyElements ()\n{\n\n// $sql = \"select t1.id as sku_hierarchy_element_by_id,t1.element_name,t1.element_code,t1.element_description,t1.element_category_id,t1.parent_element_id,\n// t2.id as parent_layer_id,t3.id,t3.layer_name as element_category,\n// (Select b.element_name from tbld_sku_hierarchy_elements as b where t2.id = b.id)\n// as parent_element_name from tbld_sku_hierarchy_elements\n// as t1 left join tbld_sku_hierarchy_elements as t2 on t2.id = t1.parent_element_id\n// left join tbld_sku_hierarchy as t3 on t2.element_category_id = t3.id \";\n $sql = \"SELECT t1.*,t1.id as sku_hierarchy_element_by_id,t2.layer_name as element_category,t3.element_name as parent_element_name FROM `tbld_sku_hierarchy_elements` as t1\n left join `tbld_sku_hierarchy` as t2 on t1.element_category_id=t2.id\n left join `tbld_sku_hierarchy_elements` as t3 on t1.parent_element_id=t3.id\";\n $query = $this->db->query( $sql )->result_array();\n\n return $query;\n\n}", "public function myFindsimpleAll($criteria = array()) {\n //$em = $this->getDoctrine()->getManager();\n // $em = $this->getManager();\n //$values=array('a,partial b.{id,nomprojet},partial c.{id,nomUser},partial d.{id,nom,description},f,partial h.{id}');\n $values = 'a,partial b.{id,nomprojet},partial c.{id,nomUser},partial d.{id,nom,description},f,partial h.{id},';\n // $values='a,partial b.{id,nomprojet},partial c.{id,nomUser},partial GroupConcat(e.nomUser),partial d.{id,nom,description},f,partial h.{id}';\n /*\n * SELECT a.id , group_concat( b.b_val ) AS bvals\n> FROM b\n> LEFT JOIN ab ON b.id = ab.idb\n> LEFT JOIN a ON a.id = ab.ida\n> LEFT JOIN ab as ab2 ON ab2.ida = a.id \n> LEFT JOIN b as b2 ON b2.id = ab2.idb\n> WHERE b2.b_val='deuxbis'\n> GROUP BY a.id \n */\n $query = $this->_em->createQuery(\"\n SELECT a,b,c,d,f,g,h,e FROM ApplicationChangementsBundle:Changements a \n LEFT JOIN a.idProjet b\n LEFT JOIN a.demandeur c \n LEFT JOIN a.idStatus d \n LEFT JOIN a.idusers AS e ON e.id=a.id\n LEFT JOIN a.picture f\n LEFT JOIN a.idEnvironnement g \n LEFT JOIN a.comments h \n ORDER BY a.id\n \n \"\n );\n /*\n * $query = $this->_em->createQuery(\"\n SELECT a,b,c,d,GroupConcat( DISTINCT e.nomUser ),f,g,h FROM ApplicationChangementsBundle:Changements a \n LEFT JOIN a.idProjet b\n LEFT JOIN a.demandeur c \n LEFT JOIN a.idStatus d \n LEFT JOIN a.idusers e \n LEFT JOIN a.picture f\n LEFT JOIN a.idEnvironnement g \n LEFT JOIN a.comments h \n \"\n );\n * $query = $this->createQueryBuilder('a')\n ->select($values)\n // ->distinct('a')\n ->leftJoin('a.idProjet', 'b')\n ->leftJoin('a.demandeur', 'c')\n ->leftJoin('a.idStatus', 'd')\n ->leftJoin('a.picture', 'f')\n ->addSelect('g')\n ->leftJoin('a.idEnvironnement', 'g')\n // ->distinct('GroupConcat(g.nom)')\n ->leftJoin('a.comments', 'h')\n ->addSelect('partial e.{id,nomUser}')\n // ->distinct('GroupConcat(e.nomUser)')\n ->leftJoin('a.idusers', 'e');\n */\n /* GroupConcat(e.nomUser) */\n return $query;\n }", "public function getPacientePrestadoraArray(){\n $query = new Query;\n $query->select(['Paciente_prestadora.id, CONCAT(Paciente.nro_documento,\" (\",Paciente.nombre,\") \", Prestadoras.descripcion ) descripcion']) \n ->from( 'Prestadoras')\n ->join(\t'join', \n 'Paciente_prestadora',\n 'Prestadoras.id=Paciente_prestadora.prestadoras_id'\n ) \n ->join(\t'join', \n 'Paciente',\n 'Paciente.id=Paciente_prestadora.paciente_id'\n ) \n ->where([\"Paciente_prestadora.id\"=>$this->Paciente_prestadora_id]);\n \n $command = $query->createCommand();\n $data = $command->queryAll();\t\n $arrayData=array();\n if( !empty($data) and is_array($data) ){ //and array_key_exists('detallepedidopieza',$data) and array_key_exists('detalle_pedido_id',$data)){\n foreach ($data as $key => $arrayPacientePrestadora) {\n $arrayData[$arrayPacientePrestadora['id']]=$arrayPacientePrestadora['descripcion']; \n }\n }\n //todas los pacientes prestadoras\n $query = new Query;\n $query->select(['Paciente_prestadora.id, CONCAT(Paciente.nro_documento,\" (\",Paciente.nombre,\") \", Prestadoras.descripcion ) descripcion']) \n ->from( 'Prestadoras')\n ->join(\t'join', \n 'Paciente_prestadora',\n 'Prestadoras.id=Paciente_prestadora.prestadoras_id'\n ) \n ->join(\t'join', \n 'Paciente',\n 'Paciente.id=Paciente_prestadora.paciente_id'\n );\n \n $command = $query->createCommand();\n $data = $command->queryAll();\t\n if( !empty($data) and is_array($data) ){ //and array_key_exists('detallepedidopieza',$data) and array_key_exists('detalle_pedido_id',$data)){\n foreach ($data as $key => $arrayPacientePrestadora) {\n $arrayData[$arrayPacientePrestadora['id']]=$arrayPacientePrestadora['descripcion']; \n }\n } \n\n return $arrayData;\n }", "function GetLayout(){\n\t//Building the query\n\t$stringBuilder = \"SELECT l.layout_id, l.font, l.font_color, l.background_color, l.default_background, l.logo, fbg.location AS backgroundLocation, flogo.location AS logoLocation \";\n\t$stringBuilder .= \"FROM layout l \";\n\t$stringBuilder .= \"INNER JOIN `file` fbg ON fbg.file_id=l.default_background \";\n\t$stringBuilder .= \"INNER JOIN `file` flogo ON flogo.file_id=l.logo \";\n\t$stringBuilder .= \"ORDER BY l.layout_id DESC \";\t\n\n\t// Preparing query\n\t$query = GetDatabaseConnection()->prepare($stringBuilder);\n\t$query->execute(array()); //Putting in the parameters\n\t$result = $query->fetchAll(); //Fetching it\n\treturn $result;\n}", "function GetAllDataMDBundling($param = [])\n {\n //debugvar($param);\n if (isset($param['search_value']) && $param['search_value'] != '') {\n //echo 'asdsad';\n //debugvar($param);\n $this->db->group_start();\n $i = 0;\n foreach ($param['search_field'] as $row => $val) {\n if ($val['searchable'] == 'true') {\n if ($i == 0) {\n $this->db->like('LCASE(`'.$val['data'].'`)', strtolower($param['search_value']));\n } else {\n $this->db->or_like('LCASE(`'.$val['data'].'`)', strtolower($param['search_value']));\n }\n $i++;\n }\n }\n $this->db->group_end();\n }\n if (isset($param['row_from']) && isset($param['length'])) {\n $this->db->limit($param['length'], $param['row_from']);\n }\n if (isset($param['order_field'])) {\n if (isset($param['order_sort'])) {\n $this->db->order_by($param['order_field'], $param['order_sort']);\n } else {\n $this->db->order_by($param['order_field'], 'desc');\n }\n } else {\n $this->db->order_by('id', 'desc');\n }\n $data = $this->db\n /* ->select('Master_SPBundling.*,Master_SPBundling.MDN as id')\n ->where('Master_SPBundling.is_delete',0)\n ->get('Master_SPBundling')*/\n ->select('a.*,c.Product_Name_Combination,a.MDN as id')\n ->where('a.is_delete',0)\n ->join('incoming_product_summary b', 'b.id=a.Incoming_Product_Summary_no')\n ->join('t7_product_name_combination c', ' c.id=b.Product_Name_Combination_Code') \n ->get('Master_SPBundling a')\n ->result_array();\n\n return $data;\n }", "public function all()\r\n {\r\n // left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n // left join mshop_media as mm on mm.id = mpl.refid\r\n // left JOIN mshop_price as mpri on mpri.id = mpl.refid\r\n // where mpl.pos = 0 and mpl.domain in ('media','price')\";\r\n /*$qry1 = \"select mp.id as product_id, mp.code as product_code, mp.label as product_name, mm.preview as image_url from mshop_product as mp \r\n left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n left join mshop_media as mm on mm.id = mpl.refid\r\n where mpl.pos = 0 and mpl.domain in ('media')\";\r\n $qry2 = \"select mp.id as product_id, mp.label as product_name, mpri.value as product_price from mshop_product as mp \r\n left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n left JOIN mshop_price as mpri on mpri.id = mpl.refid\r\n where mpl.pos = 0 and mpl.domain in ('price')\";\r\n $products1 = DB::select($qry1);\r\n $products2 = DB::select($qry2); \r\n $i = 0;\r\n foreach($products1 as $products) {\r\n foreach($products2 as $product) {\r\n if($product->product_id === $products->product_id) {\r\n $products1[$i]->product_price = $product->product_price;\r\n }\r\n }\r\n $i++;\r\n }\r\n \r\n return $products1;*/\r\n }", "public function loadPopularSearchImages()\n\t{\n\t\t$query = PopularSearchImages::select('popular_search_images.keyword', \n\t\t\t\t\t\t\t\t\t\t\t\t'popular_search_images.query', \n\t\t\t\t\t\t\t\t\t\t\t\t'images.id', \n\t\t\t\t\t\t\t\t\t\t\t\t'images.short_name', \n\t\t\t\t\t\t\t\t\t\t\t\t'image_details.ratio', \n\t\t\t\t\t\t\t\t\t\t\t\tDB::raw('COUNT(keyword) as total_searched')\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t->leftJoin('images', 'images.id', '=', 'popular_search_images.image_id')\n\t\t\t\t\t\t\t\t\t\t->leftJoin('image_details', function($join){\n\t\t\t\t\t\t\t\t\t\t\t$join->on('image_details.image_id', '=', 'popular_search_images.image_id')\n\t\t\t\t\t\t\t\t\t\t\t\t\t->where('image_details.type', '=', 'main');\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t->groupBy('keyword')\n\t\t\t\t\t\t\t\t\t\t->orderBy('total_searched', 'desc')\n\t\t\t\t\t\t\t\t\t\t->take(16)\n\t\t\t\t\t\t\t\t\t\t->get();\n\t\t$arrReturn = [\n\t\t\t\t\t'arrKeywords' \t\t\t => [],\n\t\t\t\t\t'arrPopularSearchImages' => []\n\t\t\t\t];\n\t\tif( !$query->isempty() ) {\n\t\t\t$query = $query->toArray();\n\t\t\t$arrReturn['arrKeywords'] = $query;\n\t\t\t$dataKeywords = array_slice($arrReturn['arrKeywords'], 0, 8);\n\t\t\tforeach($dataKeywords as $keyword) {\n\t\t\t\tif( $keyword['ratio'] > 1 ) {\n\t\t\t\t\t$width = 450;\n\t \t\t\t$height = $width / $keyword['ratio'];\n\t\t\t\t} else {\n\t\t\t\t\t$height = 450;\n\t \t\t\t$width = $height * $keyword['ratio'];\n\t\t\t\t}\n\t\t\t\t$arrReturn['arrPopularSearchImages'][] = [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'path' => '/pic/crop/'.$keyword['short_name'].'-'.$keyword['id'].'.jpg',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'width' => $width,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'height' => $height,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'keyword' => $keyword['keyword'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'query' => $keyword['query']\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t];\n\t\t\t}\n\t\t}\n\n\t\t$html = View::make('frontend.types.popular-search-images')\n\t\t\t->with($arrReturn)->render();\n\t\treturn $html;\n\n\t}", "public function getOudtshoornPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '102'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getBergrivierPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '116'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getBitouPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '107'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function get_branch_products($branch_id)\n {\n // LEFT JOIN branch_products bp ON (p.product_id = bp.product_id)\n // WHERE branch_id=$branch_id\n // GROUP BY p.product_id \"); \n\n $query = $this->db->query(\" SELECT p.product_id, p.name AS product_name,p.price AS default_price,p.product_code AS productcode,bp.*,`pc`.`name` AS catName FROM product p LEFT JOIN branch_products bp ON (p.product_id = bp.product_id) LEFT JOIN branch b ON b.branch_id = bp.branch_id\n LEFT JOIN product_category pc ON pc.product_category_id = p.product_category_id WHERE bp.branch_id=$branch_id AND b.brand_id=(SELECT brand_id FROM branch b WHERE branch_id=$branch_id) GROUP BY p.product_id \");\n\n $result = $query->result_array();\n\n //$query = $this->db->get_where('branch_products', array('branch_products_id' => $id));\n // $rows = $query->num_rows();\n // echo 'ROWS:'.$rows;die;\n //$result = $query->result_array();\n // $str = $this->db->last_query();\n // echo $str;\n\n // $totalRows = $query->num_rows();\n\n // if( $totalRows > 0 )\n // {\n // $result = $query->result_array();\n // }\n // else\n // {\n // $query = $this->db->query(\" SELECT p.product_id, p.name AS product_name,p.price AS default_price,p.product_code AS productcode,bp.*,NULL AS is_available FROM product p\n // LEFT JOIN branch_products bp ON (p.product_id = bp.product_id)\n // GROUP BY p.product_id \"); \n // $result = $query->result_array(); \n // }\n\n return $result; \n }", "public function allProducts()\r\n {\r\n // left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n // left join mshop_media as mm on mm.id = mpl.refid\r\n // left JOIN mshop_price as mpri on mpri.id = mpl.refid\r\n // where mpl.pos = 0 and mpl.domain in ('media','price')\";\r\n $qry1 = \"select mp.id as product_id, mp.code as product_code, mp.label as product_name, mm.preview as image_url from mshop_product as mp \r\n left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n left join mshop_media as mm on mm.id = mpl.refid\r\n where mpl.pos = 0 and mpl.domain in ('media')\";\r\n $qry2 = \"select mp.id as product_id, mp.label as product_name, mpri.value as product_price from mshop_product as mp \r\n left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n left JOIN mshop_price as mpri on mpri.id = mpl.refid\r\n where mpl.pos = 0 and mpl.domain in ('price')\";\r\n $products1 = DB::select($qry1);\r\n $products2 = DB::select($qry2); \r\n $i = 0;\r\n foreach($products1 as $products) {\r\n foreach($products2 as $product) {\r\n if($product->product_id === $products->product_id) {\r\n $products1[$i]->product_price = $product->product_price;\r\n }\r\n }\r\n $i++;\r\n }\r\n return $products1;\r\n }", "function getListQuery()\n\t{\n\t\tglobal $jlistConfig; \n \n // Create a new query object.\n\t\t$db = $this->getDbo();\n\t\t$query = $db->getQuery(true);\n $user = JFactory::getUser();\n $groups = implode (',', $user->getAuthorisedViewLevels());\n \n\t\t// Select the required fields from the table.\n\t\t$query->select(\n\t\t\t$this->getState(\n\t\t\t\t'list.select',\n\t\t\t\t'a.file_id, a.file_title, a.file_alias, a.description, a.description_long, a.file_pic, a.images, a.price, a.release, a.file_language, a.system, '.\n 'a.license, a.url_license, a.license_agree, a.size, a.date_added, a.file_date, a.publish_from, a.publish_to, a.use_timeframe, a.url_download, a.preview_filename, '.\n 'a.other_file_id, a.md5_value, a.sha1_value, a.extern_file, a.extern_site, a.mirror_1, a.mirror_2, a.extern_site_mirror_1, a.extern_site_mirror_2, '.\n 'a.url_home, a.author, a.url_author, a.created_id, a.created_mail, a.modified_id, a.modified_date, a.submitted_by, a.set_aup_points, a.downloads, '.\n 'a.cat_id, a.changelog, a.password, a.password_md5, a.views, a.metakey, a.metadesc, a.robots, a.update_active, a.custom_field_1, '.\n 'a.custom_field_2, a.custom_field_3, a.custom_field_4, a.custom_field_5, a.custom_field_6, a.custom_field_7, a.custom_field_8, a.custom_field_9, '.\n 'a.custom_field_10, a.custom_field_11, a.custom_field_12, a.custom_field_13, a.custom_field_14, a.access, a.language, a.ordering, a.featured, '. \n 'a.published, a.checked_out, a.checked_out_time, ' .\n\t\t\t\t// use date_added if modified_date is 0\n // 'CASE WHEN a.modified_date = 0 THEN a.date_added ELSE a.modified_date END as modified, ' .\n 'a.modified_date as modified, ' .\n \t\t\t\t'a.modified_id,' .\n\t\t\t\t// use date_added if publish_from is 0\n\t\t\t\t'CASE WHEN a.publish_from = 0 THEN a.date_added ELSE a.publish_from END as publish_from,' .\n\t\t\t\t\t'a.publish_to, a.images, a.metakey, a.metadesc, a.access, ' .\n\t\t\t\t\t'a.downloads,'.' '.$query->length('a.description_long').' AS readmore'\n\t\t\t)\n\t\t);\n\n\t\t// Process an Archived Download layout\n\t\tif ($this->getState('filter.published') == 2) {\n\t\t\t// If badcats is not null, this means that the download is inside an archived category\n\t\t\t// In this case, the state is set to 2 to indicate Archived (even if the download state is Published)\n\t\t\t$query->select($this->getState('list.select', 'CASE WHEN badcats.id is null THEN a.published ELSE 2 END AS state'));\n\t\t}\n\t\telse {\n\t\t\t// Process non-archived layout\n\t\t\t// If badcats is not null, this means that the download is inside an unpublished category\n\t\t\t// In this case, the state is set to 0 to indicate Unpublished (even if the download state is Published)\n\t\t\t$query->select($this->getState('list.select', 'CASE WHEN badcats.id is not null THEN 0 ELSE a.published END AS state'));\n\t\t}\n\n\t\t$query->from('#__jdownloads_files AS a');\n \n // Join on files table.\n $query->select('aa.url_download AS filename_from_other_download');\n $query->join('LEFT', '#__jdownloads_files AS aa on aa.file_id = a.other_file_id'); \n\n\t\t// Join over the categories.\n\t\t$query->select('c.title AS category_title, c.access AS category_access, c.alias AS category_alias, c.cat_dir AS category_cat_dir, c.cat_dir_parent AS category_cat_dir_parent');\n\t\t$query->join('LEFT', '#__jdownloads_categories AS c ON c.id = a.cat_id');\n \n\t\t$query->join('LEFT', '#__users AS ua ON ua.id = a.created_id');\n\t\t$query->join('LEFT', '#__users AS uam ON uam.id = a.modified_id');\n\n // Join on user table.\n if ($jlistConfig['use.real.user.name.in.frontend']){\n $query->select('u.name AS creator');\n } else {\n $query->select('u.username AS creator');\n } \n $query->join('LEFT', '#__users AS u on u.id = a.created_id');\n \n if ($jlistConfig['use.real.user.name.in.frontend']){\n $query->select('u2.name AS modifier');\n } else {\n $query->select('u2.username AS modifier');\n } \n $query->join('LEFT', '#__users AS u2 on u2.id = a.modified_id'); \n \n // Join on license table.\n $query->select('l.title AS license_title, l.url AS license_url, l.description AS license_text, l.id as lid');\n $query->join('LEFT', '#__jdownloads_licenses AS l on l.id = a.license');\n \n // Join on ratings table.\n $query->select('ROUND(r.rating_sum / r.rating_count, 0) AS rating, r.rating_count as rating_count, r.rating_sum as rating_sum');\n $query->join('LEFT', '#__jdownloads_ratings AS r on r.file_id = a.file_id'); \n \n\t\t// Join over the categories to get parent category titles\n\t\t$query->select('parent.title as parent_title, parent.id as parent_id, parent.alias as parent_alias');\n\t\t$query->join('LEFT', '#__jdownloads_categories as parent ON parent.id = c.parent_id');\n \n // Join on menu table. We need the single download menu itemid when exist \n $query->select('menuf.id AS menuf_itemid');\n $query->join('LEFT', '(SELECT id, link, access, published from #__menu GROUP BY link) AS menuf on menuf.link LIKE CONCAT(\\'index.php?option=com_jdownloads&view=download&id=\\',a.file_id) AND menuf.published = 1 AND menuf.access IN ('.$groups.')') ;\n\n\t\t// Join to check for category published state in parent categories up the tree\n\t\t$query->select('c.published, CASE WHEN badcats.id is null THEN c.published ELSE 0 END AS parents_published');\n\t\t$subquery = 'SELECT cat.id as id FROM #__jdownloads_categories AS cat JOIN #__jdownloads_categories AS parent ';\n\t\t$subquery .= 'ON cat.lft BETWEEN parent.lft AND parent.rgt ';\n\t\t// Find any up-path categories that are not published\n\t\t// If all categories are published, badcats.id will be null, and we just use the download state\n\t\t$subquery .= ' AND parent.published != 1 GROUP BY cat.id ';\n\t\t// Select state to unpublished if up-path category is unpublished\n\t\t$publishedWhere = 'CASE WHEN badcats.id is null THEN a.published ELSE 0 END';\n \n\t\t$query->join('LEFT OUTER', '(' . $subquery . ') AS badcats ON badcats.id = c.id');\n\n\t\t// Filter by user id\n $query->where('a.created_id = '.$db->Quote($user->id)); \n \n // Filter by access level.\n\t\tif ($access = $this->getState('filter.access')) {\n\t\t\t$query->where('a.access IN ('.$groups.')');\n\t\t\t$query->where('c.access IN ('.$groups.')');\n\t\t}\n\n\t\t// Filter by published state\n\t\t$published = $this->getState('filter.published');\n\n\t\tif (is_numeric($published)) {\n\t\t\t// Use download state if badcats.id is null, otherwise, force 0 for unpublished\n\t\t\t$query->where($publishedWhere . ' = ' . (int) $published);\n\t\t}\n\t\telseif (is_array($published)) {\n\t\t\tArrayHelper::toInteger($published);\n\t\t\t$published = implode(',', $published);\n\t\t\t// Use download state if badcats.id is null, otherwise, force 0 for unpublished\n\t\t\t$query->where($publishedWhere . ' IN ('.$published.')');\n\t\t}\n \n // Filter by a single category\n $categoryId = $this->getState('filter.category_id');\n\n if (is_numeric($categoryId)) {\n $type = $this->getState('filter.category_id.include', true) ? '= ' : '<> ';\n\n $categoryEquals = 'a.cat_id '.$type.(int) $categoryId;\n $query->where($categoryEquals);\n } else { \n if (is_array($categoryId) && (count($categoryId) > 0)) {\n ArrayHelper::toInteger($categoryId);\n $categoryId = implode(',', $categoryId);\n if (!empty($categoryId)) {\n $type = $this->getState('filter.category_id.include', true) ? 'IN' : 'NOT IN';\n $query->where('a.cat_id '.$type.' ('.$categoryId.')');\n }\n } \n } \n\n\t\t// Filter by author\n\t\t$authorId = $this->getState('filter.author_id');\n\t\t$authorWhere = '';\n\n\t\tif (is_numeric($authorId)) {\n\t\t\t$type = $this->getState('filter.author_id.include', true) ? '= ' : '<> ';\n\t\t\t$authorWhere = 'a.created_id '.$type.(int) $authorId;\n\t\t}\n\t\telseif (is_array($authorId)) {\n\t\t\tArrayHelper::toInteger($authorId);\n\t\t\t$authorId = implode(',', $authorId);\n\n\t\t\tif ($authorId) {\n\t\t\t\t$type = $this->getState('filter.author_id.include', true) ? 'IN' : 'NOT IN';\n\t\t\t\t$authorWhere = 'a.created_id '.$type.' ('.$authorId.')';\n\t\t\t}\n\t\t}\n \n\t\tif (!empty($authorWhere)) {\n\t\t\t$query->where('('.$authorWhere.')');\n\t\t}\n\t\t\n\t\t// Filter by start and end dates.\n\t\t$nullDate\t= $db->Quote($db->getNullDate());\n\t\t$nowDate = $db->Quote(JFactory::getDate()->toSql()); // True to return the date string in the local time zone, false to return it in GMT.\n\n\t\t$query->where('(a.publish_from = '.$nullDate.' OR a.publish_from <= '.$nowDate.')');\n\t\t$query->where('(a.publish_to = '.$nullDate.' OR a.publish_to >= '.$nowDate.')');\n\n\t\t// Filter by Date Range or Relative Date\n\t\t$dateFiltering = $this->getState('filter.date_filtering', 'off');\n\t\t$dateField = $this->getState('filter.date_field', 'a.date_added');\n\n\t\tswitch ($dateFiltering)\n\t\t{\n\t\t\tcase 'range':\n\t\t\t\t$startDateRange = $db->Quote($this->getState('filter.start_date_range', $nullDate));\n\t\t\t\t$endDateRange = $db->Quote($this->getState('filter.end_date_range', $nullDate));\n\t\t\t\t$query->where('('.$dateField.' >= '.$startDateRange.' AND '.$dateField .\n\t\t\t\t\t' <= '.$endDateRange.')');\n\t\t\t\tbreak;\n\n\t\t\tcase 'relative':\n\t\t\t\t$relativeDate = (int) $this->getState('filter.relative_date', 0);\n\t\t\t\t$query->where($dateField.' >= DATE_SUB('.$nowDate.', INTERVAL ' .\n\t\t\t\t\t$relativeDate.' DAY)');\n\t\t\t\tbreak;\n\n\t\t\tcase 'off':\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// process the filter for list views with user-entered filters\n\t\t$params = $this->getState('params');\n\n\t\tif ((is_object($params)) && ($params->get('filter_field') != 'hide') && ($filter = $this->getState('list.filter'))) {\n\t\t\t// clean filter variable\n\t\t\t$filter = JString::strtolower($filter);\n\t\t\t$hitsFilter = intval($filter);\n\t\t\t$filter = $db->Quote('%'.$db->escape($filter, true).'%', false);\n\n\t\t\tswitch ($params->get('filter_field'))\n\t\t\t{\n\t\t\t\tcase 'author':\n\t\t\t\t\t$query->where(\n\t\t\t\t\t\t'LOWER(ua.name) LIKE '.$filter.' '\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'hits':\n\t\t\t\t\t$query->where('a.downloads >= '.$hitsFilter.' ');\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'title':\n\t\t\t\tdefault: // default to 'title' if parameter is not valid\n\t\t\t\t\t$query->where('LOWER( a.file_title ) LIKE '.$filter);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Filter by language\n\t\tif ($this->getState('filter.language')) {\n\t\t\t$query->where('a.language in ('.$db->quote(JFactory::getLanguage()->getTag()).','.$db->quote('*').')');\n\t\t}\n \n // Filter by uncategorised (cat_id = 1 for 'root')\n if ($this->getState('only_uncategorised')) {\n $query->where('a.cat_id = 1');\n }\n\n // Filter by featured state\n $featured = $this->getState('filter.featured');\n\n switch ($featured)\n {\n case 'hide':\n $query->where('a.featured = 0');\n break;\n\n case 'only':\n $query->where('a.featured = 1');\n break;\n\n case 'show':\n default:\n break;\n } \n \n\t\t// Add the list ordering clause.\n $order = $this->getState('list.ordering', 'a.ordering').' '.$this->getState('list.direction', 'ASC');\n $order = str_replace('DESC DESC','DESC', $order);\n $query->order($order);\n\t\t\n\t\treturn $query;\n\t}", "public function getRows($id = ''){ \r\n $this->db->select(\"*, (SELECT file_name FROM \".$this->imgTbl.\" WHERE gallery_id = \".$this->galleryTbl.\".id ORDER BY id DESC LIMIT 1) as default_image\"); \r\n $this->db->from($this->galleryTbl); \r\n if($id){ \r\n $this->db->where('id', $id); \r\n $query = $this->db->get(); \r\n $result = ($query->num_rows() > 0)?$query->row_array():array(); \r\n \r\n if(!empty($result)){ \r\n $this->db->select('*'); \r\n $this->db->from($this->imgTbl); \r\n $this->db->where('gallery_id', $result['id']); \r\n $this->db->order_by('id', 'desc'); \r\n $query = $this->db->get(); \r\n $result2 = ($query->num_rows() > 0)?$query->result_array():array(); \r\n $result['images'] = $result2; \r\n } \r\n }else{ \r\n $this->db->order_by('id', 'desc'); \r\n $query = $this->db->get(); \r\n $result = ($query->num_rows() > 0)?$query->result_array():array(); \r\n } \r\n \r\n // return fetched data \r\n return !empty($result)?$result:false; \r\n }", "function getProductos($userId) {\r\n\t\r\n\t\r\n\t\t/************************************************\r\n\t\tPRODUCTOS DE REPOSICIONES HECHAS EN TALLER\r\n\t\t************************************************/\r\n\t\t\r\n\t\t$sql = \"SELECT CI.*, Pr.nombre as producto, Pr.precio, M.nombre as modelo \r\n\t\t \t\tFROM colaimpresion CI\r\n\t\t\t\tINNER JOIN modelos M ON CI.modelos_id = M.id\r\n\t\t\t\tINNER JOIN productos Pr ON Pr.id = M.productos_id \r\n\t\t\t\tWHERE (CI.pedidos_id IS NULL) & (CI.belongsTo IS NULL) & (CI.ventas_id IS NULL)& (CI.producciones_id IS NULL)\r\n\t\t\t\tORDER BY Pr.nombre\"; \r\n\t\t\t\t\r\n\t \t$query = $this->con->prepare($sql, array(), MDB2_PREPARE_RESULT); \t\r\n\t \t$query = $query->execute();\t\r\n\t \t\r\n\t\t$results = $query->fetchAll();\r\n\t\t$i = 0;\r\n\t\t$resultsFormat = array();\r\n\t\t//Proceso los reposicion \r\n\t\t$resultsFormat['reposicion']['modelos'] = array();\r\n\t\t$m = 0;\r\n\t\twhile(($i < count($results))&&($results[$i]['pedidos_id'] == null)){\r\n\t\t\t$resultsFormat['reposicion']['modelos'][$m]['modelos_id'] = $results[$i]['modelos_id'];\r\n\t\t\t$resultsFormat['reposicion']['modelos'][$m]['id'] = $results[$i]['id'];\r\n\t\t\t$resultsFormat['reposicion']['modelos'][$m]['nombre'] = utf8_encode($results[$i]['producto']).'-'.utf8_encode($results[$i]['modelo']);\r\n\t\t\t$resultsFormat['reposicion']['modelos'][$m++]['precio'] = $results[$i++]['precio'];\t\t\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t/************************************************\r\n\t\tPRODUCTOS SUELTOS QUE EL USUARIO DESEA IMPRIMIR\r\n\t\t************************************************/ \r\n\t\t\t\t\t\r\n\t\t$sql = \"SELECT CI.*, Pr.nombre as producto, Pr.precio, M.nombre as modelo \r\n\t\t \t\tFROM colaimpresion CI\r\n\t\t\t\tINNER JOIN modelos M ON CI.modelos_id = M.id\r\n\t\t\t\tINNER JOIN productos Pr ON Pr.id = M.productos_id \r\n\t\t\t\tWHERE CI.belongsTo = $userId\r\n\t\t\t\tORDER BY Pr.nombre\"; \r\n\t\t\t\t\r\n\t \t$query = $this->con->prepare($sql, array(), MDB2_PREPARE_RESULT); \t\r\n\t \t$query = $query->execute();\t\r\n\t \t\r\n\t\t$results = $query->fetchAll();\r\n\t\t$i = 0;\r\n\t\t$resultsFormat['sueltos']['modelos'] = array();\r\n\t\t$m = 0;\r\n\t\twhile(($i < count($results))&&($results[$i]['pedidos_id'] == null)){\r\n\t\t\t$resultsFormat['sueltos']['modelos'][$m]['modelos_id'] = $results[$i]['modelos_id'];\r\n\t\t\t$resultsFormat['sueltos']['modelos'][$m]['id'] = $results[$i]['id'];\r\n\t\t\t$resultsFormat['sueltos']['modelos'][$m]['nombre'] = utf8_encode($results[$i]['producto']).'-'.utf8_encode($results[$i]['modelo']);\r\n\t\t\t$resultsFormat['sueltos']['modelos'][$m++]['precio'] = $results[$i++]['precio'];\t\t\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t/************************************************\r\n\t\tPRODUCTOS DE PEDIDOS HECHOS EN TALLER\r\n\t\t************************************************/\r\n\t\t\r\n\t\t\r\n\t\t$sql = \"SELECT CI.*, Pr.nombre as producto, Pr.id as productos_id, SUM(PM.cantidad) as cantidad, CL.nombre as clientePM, CL.localidad as localidad\r\n\t\t\t\tFROM colaimpresion CI\r\n\t\t\t\tINNER JOIN modelos M ON CI.modelos_id = M.id\r\n\t\t\t\tINNER JOIN productos Pr ON Pr.id = M.productos_id \r\n\t\t\t\tINNER JOIN pedidos_modelos PM ON (PM.modelos_id = M.id) & (PM.pedidos_id = CI.pedidos_id)\r\n\t\t\t\tINNER JOIN pedidos P ON PM.pedidos_id = P.id\r\n\t\t\t\tINNER JOIN clientespm CL ON P.clientesPM_id = CL.id\t\t\t\r\n\t\t\t\tGROUP BY CI.pedidos_id, M.productos_id\t\r\n\t\t\t\tORDER BY CI.pedidos_id\";\r\n\t\t\t\t\r\n\t\t$query = $this->con->prepare($sql, array(), MDB2_PREPARE_RESULT); \t\r\n\t \t$query = $query->execute();\t\r\n\t \t\r\n\t\t$results = $query->fetchAll();\r\n\t\t$i=0;\r\n\t\t$m = 0;\r\n\t\t$iF = 0;\r\n\t\t//Proceso los pedidos \r\n\t\twhile($i < count($results)){\r\n\t\t\t$resultsFormat['pedidos'][$iF]['pedidos_id'] = $results[$i]['pedidos_id'];\r\n\t\t\t$resultsFormat['pedidos'][$iF]['clientePM']= utf8_encode($results[$i]['clientePM']).' - '.utf8_encode($results[$i]['localidad']);\r\n\t\t\t//los modelos\r\n\t\t\t$resultsFormat['pedidos'][$iF]['modelos'] = array();\r\n\t\t\t$m = 0;\r\n\t\t\twhile(($i < count($results))&&($resultsFormat['pedidos'][$iF]['pedidos_id'] == $results[$i]['pedidos_id'])){\r\n\t\t\t\t$resultsFormat['pedidos'][$iF]['productos'][$m]['productos_id'] = $results[$i]['productos_id'];\r\n\t\t\t\t$resultsFormat['pedidos'][$iF]['productos'][$m]['id'] = $results[$i]['id'];\r\n\t\t\t\t$resultsFormat['pedidos'][$iF]['productos'][$m]['nombre'] = utf8_encode($results[$i]['producto']);\r\n\t\t\t\t$resultsFormat['pedidos'][$iF]['productos'][$m++]['cantidad'] = $results[$i++]['cantidad'];\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t$iF++;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t/************************************************\r\n\t\tPRODUCTOS DE PRODUCCIONES DEVUELTAS\r\n\t\t************************************************/\r\n\t\t\r\n\t\t$sql = \"SELECT CI.*, Pr.nombre as producto, Pr.precio, M.nombre as modelo, R.nombre as responsable \r\n\t\t\t\tFROM colaimpresion CI\r\n\t\t\t\tINNER JOIN modelos M ON CI.modelos_id = M.id\r\n\t\t\t\tINNER JOIN productos Pr ON Pr.id = M.productos_id \r\n\t\t\t\tINNER JOIN producciones_modelos PM ON (PM.modelos_id = M.id) & (PM.producciones_id = CI.producciones_id)\r\n\t\t\t\tINNER JOIN producciones P ON PM.producciones_id = P.id\r\n\t\t\t\tINNER JOIN responsables R ON P.responsables_id = R.id\t\t\t\r\n\t\t\t\tGROUP BY CI.producciones_id, PM.id\t\t\t\t\r\n\t\t\t\tORDER BY CI.producciones_id\";\r\n\t\t\t\t\r\n\t\t$query = $this->con->prepare($sql, array(), MDB2_PREPARE_RESULT); \t\r\n\t \t$query = $query->execute();\t\r\n\t \t\r\n\t\t$results = $query->fetchAll();\r\n\t\t$i=0;\r\n\t\t$m = 0;\r\n\t\t$iF = 0;\r\n\t\t//Proceso las producciones \r\n\t\twhile($i < count($results)){\r\n\t\t\t$resultsFormat['producciones'][$iF]['producciones_id'] = $results[$i]['producciones_id'];\r\n\t\t\t$resultsFormat['producciones'][$iF]['responsable']= utf8_encode($results[$i]['responsable']);\r\n\t\t\t//los modelos\r\n\t\t\t$resultsFormat['producciones'][$iF]['modelos'] = array();\r\n\t\t\t$m = 0;\r\n\t\t\twhile(($i < count($results))&&($resultsFormat['producciones'][$iF]['producciones_id'] == $results[$i]['producciones_id'])){\r\n\t\t\t\t$resultsFormat['producciones'][$iF]['modelos'][$m]['modelos_id'] = $results[$i]['modelos_id'];\r\n\t\t\t\t$resultsFormat['producciones'][$iF]['modelos'][$m]['id'] = $results[$i]['id'];\r\n\t\t\t\t$resultsFormat['producciones'][$iF]['modelos'][$m]['nombre'] = utf8_encode($results[$i]['producto']).'-'.utf8_encode($results[$i]['modelo']);\r\n\t\t\t\t$resultsFormat['producciones'][$iF]['modelos'][$m++]['precio'] = $results[$i++]['precio'];\t\r\n\t\t\t}\r\n\t\t\t$iF++;\r\n\t\t}\r\n\t\t\r\n\t\t/************************************************\r\n\t\tPRODUCTOS DE DEVOLUCIONES DE VENTAS\r\n\t\t************************************************/\r\n\t\t\r\n\t\t$sql = \"SELECT CI.*, Pr.nombre as producto, Pr.precio, M.nombre as modelo \r\n\t\t\t\tFROM colaimpresion CI\r\n\t\t\t\tINNER JOIN modelos M ON CI.modelos_id = M.id\r\n\t\t\t\tINNER JOIN productos Pr ON Pr.id = M.productos_id \r\n\t\t\t\tWHERE not(CI.ventas_id IS NULL)\r\n\t\t\t\tORDER BY CI.ventas_id\";\r\n\t\t\t\t\r\n\t\t$query = $this->con->prepare($sql, array(), MDB2_PREPARE_RESULT); \t\r\n\t \t$query = $query->execute();\t\r\n\t \t\r\n\t\t$results = $query->fetchAll();\r\n\t\t$i = 0;\r\n\t\t$resultsFormat['ventas']['modelos'] = array();\r\n\t\t$m = 0;\r\n\t\twhile(($i < count($results))&&($results[$i]['pedidos_id'] == null)){\r\n\t\t\t$resultsFormat['ventas']['modelos'][$m]['modelos_id'] = $results[$i]['modelos_id'];\r\n\t\t\t$resultsFormat['ventas']['modelos'][$m]['id'] = $results[$i]['id'];\r\n\t\t\t$resultsFormat['ventas']['modelos'][$m]['nombre'] = utf8_encode($results[$i]['producto']).'-'.utf8_encode($results[$i]['modelo']);\r\n\t\t\t$resultsFormat['ventas']['modelos'][$m++]['precio'] = $results[$i++]['precio'];\t\t\t\t\t\t\r\n\t\t}\r\n\r\n\t\treturn $resultsFormat;\r\n\t}", "public function getLaingsburgPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '105'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function listProductsPack($params)\n{\n // $prdId = $this->db->real_escape_string($params);\n // $qry = \"SELECT pr.prd_id, pr.prd_sku, pr.prd_name, pr.prd_price, pk.prd_parent \n // FROM ctt_products_packages AS pk\n // INNER JOIN ctt_products AS pr ON pr.prd_id = pk.prd_id\n // WHERE pk.prd_parent = $prdId AND prd_status =1;\";\n // return $this->db->query($qry);\n}", "public function getGeorgePropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '108'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function f_get_distPoints()\n {\n\n // $sql = $this->db->query(\"SELECT DISTINCT a.sl_no, b.bdo_name \n // FROM md_dist_point a , md_dm_bdo b \n // WHERE a.dist_cd = b.dist_cd\n // AND a.sdo = b.sdo_cd\n // AND a.bdo = b.sl_no \");\n\n$sql = $this->db->query(\"SELECT DISTINCT a.sl_no, b.bdo_name,c.sdo_name sdo_name,a.agent\n FROM md_dist_point a , md_dm_bdo b ,md_dm_sdo c\n WHERE a.dist_cd = b.dist_cd \n AND b.dist_cd = c.dist_cd\n and a.sdo =c.sl_no\n and a.bdo = b.sl_no\");\n echo $this->db->last_query();\n return $sql->result();\n \n }", "public function getSearchProducts($id=0,$limit=0, $start=0) {\n //$option = \"\";\n $value = \"\";\n if(isset($_REQUEST['country'])&&($_REQUEST['country']!='')){\n $this->session->set_userdata(\"value\",$_REQUEST['country']);\n $value = $this->session->userdata(\"value\");\n }\n \n $this->db->select(\"prod.store_id,st.store_name,st.store_slug,GROUP_CONCAT(DISTINCT(`pimg`.`image_path`)) as image_path,GROUP_CONCAT(DISTINCT(`pimg`.`image_id`)) as image_ids,patr.attribute_type_id,GROUP_CONCAT(patr.attribute_id) as attribute_id,pcat.category_id,(SELECT GROUP_CONCAT(DISTINCT(category_name)) as category_name \n FROM category\n WHERE category_id = pcat.category_id) as category_name,prod.product_id,prod.name,prod.offer_price,prod.inventory,prod.full_description,prod.upload_date,prod.actual_price,prod.sku\");\n $this->db->from('product prod');\n $this->db->join('product_attributes patr', 'prod.product_id=patr.product_id', 'INNER');\n $this->db->join('product_images pimg', 'prod.product_id=pimg.product_id', 'INNER');\n $this->db->join('product_category pcat', 'prod.product_id=pcat.product_id', 'INNER');\n $this->db->join('category cat', 'cat.category_id=pcat.product_category_id', 'INNER');\n $this->db->join('store st', 'st.store_id=prod.store_id', 'INNER');\n // $this->db->join('slider sl','st.store_id=sl.store_id','LEFT');\n if (isset($value) && ($value != \"\")) {\n $this->db->like('prod.name', $value);\n \n }\n \n // $this->db->where_in('cat.category_id', array('31','32','33'));\n $this->db->group_by('prod.product_id');\n\n\n //if($limit>0 && $start>0){\n $this->db->limit($limit, $start);\n // }\n $query = $this->db->get();\n\n\n return $query->result();\n }", "function get_all_data_gcs($id='',$id_transportista='',$id_empresa=''){\n\t\t$sQuery=\"SELECT \n\t\t\t\tcontrol_salida_extra.*,\n\t\t\t\tempresa.id as empresa_id, empresa.rif as empresa_rif, empresa.telefono as empresa_telefono, empresa.responsable as empresa_responsable, empresa.naturaleza as empresa_naturaleza, empresa.adelanto as empresa_adelanto, empresa.especial as empresa_especial, empresa.descripcion as empresa_descripcion,\n\t\t\t\ttransportista.id as transportista_id, transportista.rif as transportista_rif, transportista.telefono as transportista_telefono, transportista.nombre as transportista_nombre , transportista.apellido as transportista_apellido\n\t\t\t\tFROM control_salida_extra\n\t\t\t\tInner Join transportista ON control_salida_extra.id_transportista = transportista.id\n\t\t\t\tInner Join empresa ON control_salida_extra.id_empresa = empresa.id\n\t\t\t\t\n\t\t\t\tWHERE 1=1\";\n\t\tif($id) {\t$sQuery.=\" AND control_salida_extra.id in($id) \";\t}\n\t\tif($id_transportista) {\t$sQuery.=\" AND control_salida_extra.id_transportista = '$id_transportista' \";\t}\n\t\tif($id_empresa) {\t$sQuery.=\" AND empresa.id = '$id_empresa' \";\t}\n\t\t$sQuery.=\" ORDER BY empresa.naturaleza,empresa.descripcion,transportista.apellido,transportista.nombre,control_salida_extra.id_por_sucursal DESC \";\n\t\t//die($sQuery);\n\t\t\n\t\t$result=mssql_query($sQuery) or die(mssql_min_error_severity());\n\t\t$i=0;\n\t\twhile($row=mssql_fetch_array($result)){\n\t\t\tforeach($row as $key=>$value){\n\t\t\t\t$res_array[$i][$key]=$value;\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t\treturn($res_array);\n\t\t\n\t\t\t\t\n\t}", "function getImages($id,$table){\n\t\t$db;\t\t\t\t\n\t\t// Open the database connection\n\t\t//if (!($db = pg_connect( 'host=postgres.int.devisland.net dbname=db_piccicla user=piccicla password=fidelin1'))) {\n\t\tif (!($db = pg_connect( 'host=localhost dbname=landscape user=postgres password=fidelin1'))){\n\t\t// Handle errors\n\t\t // i used die because with echo the script continued\n\t\t //Echo \"{success:false, msg:'SQL ERROR: Connection failed'}\";\t\t\t \n\t\t die();\t\t\t\n\t\t}\n\t\t\t\n\t\t$sql = 'select \"LINK\" from \"landscape\".\"'.$table.'\" where \"ART_ID\"='.$id;\n\t\t\n\t\t$results = array();\n\n\t\t// Read all the data back in as associative arrays\n\t\tIf (!$rs = pg_query($db, $sql) ){\n\t\t\t\tif ($db){\n\t\t\t\t\tpg_close($db);\n\t\t\t\t}\n\t\t\t\ttrigger_error('problems reading the database');\n\t\t\t\tdie();\n\t\t}else{\t\t\n\t\twhile($obj = pg_fetch_object($rs)){\n\t\t\t$results[] = $obj;\n\t\t}}\n\t\t//close the connection\n\t\tpg_close($db);\n\t\t//print_r($results);\n\t\t//trigger_error('problems reading the database');\n //die();\n\t\treturn $results;\t\t\n}", "public function get_image_rows_data($gallery_id, $params, $total = FALSE) {\n global $wpdb;\n\t$rows = array();\n $order = $params['order'];\n $orderby = $params['orderby'];\n $page_per = $params['items_per_page'];\n $page_num = $params['page_num'];\n $search = $params['search'];\n\n $ecommerce_addon = function_exists('BWGEC');\n\n if ( !$total ) {\n $query = 'SELECT T_IMAGE.*';\n if ( $ecommerce_addon ) {\n $query .= \", T_PRICELISTS.title AS priselist_name, T_PRICELIST_ITEMS.item_longest_dimension, T_PRICELISTS.sections\";\n }\n }\n else {\n $query = 'SELECT COUNT(*)';\n }\n $query .= ' FROM `' . $wpdb->prefix . 'bwg_image` AS T_IMAGE';\n if ( $ecommerce_addon ) {\n $query .= \" LEFT JOIN `\" . $wpdb->prefix . \"wdpg_ecommerce_pricelists` AS T_PRICELISTS ON T_IMAGE.pricelist_id = T_PRICELISTS.id\";\n $query .= \" LEFT JOIN ( SELECT MAX(item_longest_dimension) AS item_longest_dimension, pricelist_id FROM `\" . $wpdb->prefix . \"wdpg_ecommerce_pricelist_items` GROUP BY pricelist_id) AS T_PRICELIST_ITEMS ON T_PRICELIST_ITEMS.pricelist_id = T_PRICELISTS.id\";\n }\n if ( !current_user_can('manage_options') && BWG()->options->image_role ) {\n $query .= \" WHERE author=\" . get_current_user_id();\n }\n else {\n $query .= \" WHERE author>=0\";\n }\n $query .= \" AND `gallery_id`=\" . $gallery_id;\n\t $search_where = '';\n if ( $search ) {\n $search_keys = explode(' ', trim($search));\n $alt_search = '(';\n $filename_search = '(';\n $description_search = '(';\n foreach( $search_keys as $search_key) {\n $alt_search .= '`T_IMAGE`.`alt` LIKE \"%' . trim($search_key) . '%\" AND ';\n $filename_search .= '`T_IMAGE`.`filename` LIKE \"%' . trim($search_key) . '%\" AND ';\n $description_search .= '`T_IMAGE`.`description` LIKE \"%' . trim($search_key) . '%\" AND ';\n }\n $alt_search = rtrim($alt_search, 'AND ');\n $alt_search .= ')';\n $filename_search = rtrim($filename_search, 'AND ');\n $filename_search .= ')';\n $description_search = rtrim($description_search, 'AND ');\n $description_search .= ')';\n $search_where = ' AND (' . $filename_search . ' OR ' . $alt_search . ' OR ' . $description_search . ') ';\n }\n\t$query .= $search_where;\n if ( !$total ) {\n $query .= ' ORDER BY `' . $orderby . '` ' . $order;\n $query .= ' LIMIT ' . $page_num . ',' . $page_per;\n }\n if ( !$total ) {\n $rows = $wpdb->get_results($query);\n if ( $ecommerce_addon ) {\n foreach ( $rows as $value ) {\n $value->not_set_items = 0;\n if ( $value->item_longest_dimension && strpos($value->sections, \"downloads\") !== FALSE ) {\n $file_path = str_replace(\"thumb\", \".original\", htmlspecialchars_decode(BWG()->upload_dir . $value->thumb_url, ENT_COMPAT | ENT_QUOTES));\n WDWLibrary::repair_image_original($file_path);\n list($img_width) = @getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));\n if ( $value->item_longest_dimension > $img_width ) {\n $value->not_set_items = 1;\n }\n }\n }\n }\n $rows['template'] = new stdClass();\n $rows['template']->id = \"tempid\";\n $rows['template']->gallery_id = $gallery_id;\n $rows['template']->order = 0;\n $rows['template']->published = 1;\n $rows['template']->tags = array();\n $rows['template']->image_url = \"tempimage_url\";\n $rows['template']->thumb_url = \"tempthumb_url\";\n $rows['template']->filename = \"tempfilename\";\n $rows['template']->date = \"tempdate\";\n $rows['template']->resolution = \"tempresolution\";\n $rows['template']->resolution_thumb = \"tempthumbresolution\";\n $rows['template']->size = \"tempsize\";\n $rows['template']->filetype = \"tempfiletype\";\n $rows['template']->description = \"tempdescription\";\n $rows['template']->alt = \"tempalt\";\n $rows['template']->author = get_current_user_id();\n $rows['template']->comment_count = 0;\n $rows['template']->avg_rating = 0;\n $rows['template']->rate_count = 0;\n $rows['template']->hit_count = 0;\n $rows['template']->redirect_url = '';\n $rows['template']->pricelist_id = 0;\n $rows['template']->priselist_name = '';\n $rows['template']->not_set_items = 0;\n $rows['template']->modified_date = '';\n\n foreach ( $rows as $key => $value ) {\n $value->tags = $this->get_tag_rows_data($value->id);\n $value->pure_image_url = $value->image_url;\n $value->pure_thumb_url = $value->thumb_url;\n $value->image_url = WDWLibrary::image_url_version($value->image_url, $value->modified_date);\n $value->thumb_url = WDWLibrary::image_url_version($value->thumb_url, $value->modified_date);\n if ( $key != 'template') {\n $value->pure_image_url = esc_url($value->pure_image_url);\n $value->pure_thumb_url = esc_url($value->pure_thumb_url);\n $value->image_url = esc_url($value->image_url);\n $value->thumb_url = esc_url($value->thumb_url);\n }\n }\n }\n else {\n $rows = $wpdb->get_var($query);\n }\n return $rows;\n }", "private function getMateriais() {\n\n $oDaoMaterial = new cl_matmater();\n $sCampos = \" m60_codmater as codigo, m60_descr as descricao, m61_descr as unidade\";\n\n $sCamposGrupo = \" , 0 as codigogrupo \";\n if ($this->lAgruparGrupoSubgrupo) {\n $sCamposGrupo = \" , m65_sequencial as codigogrupo \";\n }\n $sCampos .= $sCamposGrupo;\n\n $aOrdem = array();\n $aWhere = array();\n $aWhere[] = \" instit = {$this->iInstituicao} \";\n\n $aOrdem[] = \" m60_descr \";\n\n if ($this->sDepartamentos) {\n $aWhere[] = \" m70_coddepto in ({$this->sDepartamentos}) \";\n }\n\n if ($this->sGrupoSubgrupo) {\n $aWhere[] = \" db121_sequencial in ({$this->sGrupoSubgrupo}) \";\n }\n\n $sCampoDepartamento = \", 0 as depto, '' as departamento\";\n if ($this->iQuebraPagina == RelatorioDeDistribuicao::QUEBRA_PAGINA_DEPARTAMENTO) {\n $sCampoDepartamento = \", m70_coddepto as depto, descrdepto as departamento \";\n }\n $sCampos .= $sCampoDepartamento;\n $sWhere = \" where \" . implode(\" and \", $aWhere);\n $sOrdem = \" order by \" . implode(\", \", $aOrdem);\n\n $sql = \" select distinct {$sCampos} \";\n $sql .= \" from matmater \";\n $sql .= \" inner join matunid on m60_codmatunid = m61_codmatunid \";\n $sql .= \" inner join matmatermaterialestoquegrupo on m60_codmater = m68_matmater \";\n $sql .= \" inner join materialestoquegrupo on m68_materialestoquegrupo = m65_sequencial \";\n $sql .= \" inner join db_estruturavalor on db121_sequencial = m65_db_estruturavalor \";\n $sql .= \" inner join matestoque on m60_codmater = m70_codmatmater \";\n $sql .= \" inner join db_depart on coddepto = m70_coddepto \";\n\n\n $sql .= \"{$sWhere} {$sOrdem} \";\n\n $rsMateriais = $oDaoMaterial->sql_record($sql);\n\n $aMateriais = array();\n for ($i = 0; $i < $oDaoMaterial->numrows; $i++) {\n\n $oMaterial = db_utils::fieldsMemory($rsMateriais, $i);\n $oMaterial->totalPeriodo = 0.0;\n $oMaterial->mediaPeriodo = 0.0;\n $aMateriais[] = $oMaterial;\n\n if (!isset($this->aDepartamentos[$oMaterial->depto])) {\n\n $oDeptartamento = new stdClass();\n $oDeptartamento->codigo = $oMaterial->depto;\n $oDeptartamento->descricao = $oMaterial->departamento;\n $oDeptartamento->itens = array();\n $this->aDepartamentos[$oDeptartamento->codigo] = $oDeptartamento;\n }\n }\n return $aMateriais;\n }", "function sql_photo_tag($theme, $sorting)\n{\n if ($sorting == \"year\")\n $sort = \"RP.year, RL.location_name, RP.seqno\";\n else\n $sort = \"RL.location_name, RP.seqno\";\n\n $sql = \"\n select\n RL.line_state,\n RL.line_name,\n RL.location_state,\n RL.location_name,\n RP.file,\n RP.seqno,\n RP.year,\n IFNULL(U.fullname, IFNULL(RP.legacy_owner, 'Rolfe Bozier')) as owner,\n RP.owner_uid,\n RP.caption\n from\n r_line_location RL,\n r_location_photo RP left join r_user U on RP.owner_uid = U.uid\n where\n RL.location_state = RP.location_state\n and\n RL.location_name = RP.location_name\n and\n RL.mainline = 'Y'\n and\n RP.hold is null\n and\n FIND_IN_SET('$theme', RP.tags) > 0\n order by\n $sort\n \";\n\n return [$sql, [], []];\n}", "public function getAllProduct(){\n\t\t//query for get all data from tbl_product combinning with tbl_category(catName) and tbl_brand(brandName) using INNER JOIN\n\t\t$sql = \"SELECT tbl_product.*, tbl_category.catName, tbl_brand.brandName\n\t\t\t\tFROM tbl_product\n\t\t\t\tINNER JOIN tbl_category\n\t\t\t\tON tbl_product.catId = tbl_category.catId\n\t\t\t\tINNER JOIN tbl_brand\n\t\t\t\tON tbl_product.brandId = tbl_brand.brandId\n\t\t\t\tORDER BY tbl_product.pid DESC \";\n\t\t//Same Query using Alias(giving a temporary name to a table or Column)\n\t\t/*$sql = \"SELECT p.*, c.catName, b.brandName\n\t\t\t\tFROM tbl_product AS p, tbl_category AS c, tbl_brand AS b\n\t\t\t\tWHERE p.catId = c.catId AND p.brandId = b.brandId\n\t\t\t\tORDER BY p.pid DESC \";*/\n\t\t$result = $this->db->select($sql);\n\t\tif ($result) {\n\t\t\treturn $result;\n\t\t}else{\n\t\t\t$msg = \"<span class='error'>Product not found !.</span>\";\n\t\t\treturn $msg;\n\t\t}\n\t}", "function listQueryGajiHonorer() {\n $sql = \"select p.idpegawai,\" . static::schema() . \"f_namalengkap(gelardepan,namadepan,namatengah,namabelakang,gelarbelakang) as namalengkap,\n\t\t\t\t\tnamapendidikan,namaunit,th.nominal as tarif,g.isfinish,g.gajiditerima\n\t\t\t\t\tfrom \" . static::table('ga_gajipeg') . \" g \n\t\t\t\t\tleft join \" . static::table('ms_pegawai') . \" p on p.idpegawai=g.idpegawai\n\t\t\t\t\tleft join \" . static::table('lv_jenjangpendidikan') . \" j on j.idpendidikan=p.idpendidikan\n\t\t\t\t\tleft join \" . static::table('ms_unit') . \" u on u.idunit=p.idunit\n\t\t\t\t\tleft join \" . static::table('ga_tarifhonorer') . \" th on th.idpendidikan=p.idpendidikan\n\t\t\t\t\twhere p.idstatusaktif in (select idstatusaktif from \" . static::table('lv_statusaktif') . \" where isdigaji='Y')\n\t\t\t\t\tand idhubkerja in ('HP')\";\n return $sql;\n }", "function pnh_getdeals()\r\n\t{\r\n\t\t$sql = \"select ifnull(group_concat(smd.special_margin),0) as sm,d.publish,d.brandid,d.catid,i.orgprice,\r\n\t\t\t\t\t\ti.price,i.name,i.pic,i.pnh_id,i.id as itemid,\r\n\t\t\t\t\t\tb.name as brand,c.name as category \r\n\t\t\t\t\tfrom king_deals d \r\n\t\t\t\t\tjoin king_dealitems i on i.dealid=d.dealid \r\n\t\t\t\t\tjoin king_brands b on b.id=d.brandid \r\n\t\t\t\t\tjoin king_categories c on c.id=d.catid \r\n\t\t\t\t\tleft join pnh_special_margin_deals smd on i.id = smd.itemid and smd.from <= unix_timestamp() and smd.to >=unix_timestamp() \r\n\t\t\t\t\twhere i.is_pnh=1 \r\n\t\t\t\t\tgroup by i.id \r\n\t\t\t\t\torder by i.sno desc\r\n\t\t\t\t\tlimit 30 \r\n\t\t\t\t\";\r\n\t\treturn $this->db->query($sql)->result_array();\r\n\t}", "public function getShortSplit() {\n $req = 'SELECT tbljobs.id_tbljob, tbljobs.id_info_job,\n customer, job, split, po_number, devis, info_jobs.instruction as info_jobs_instruction, info_jobs.commentaire as info_jobs_commentaire, inOut_recommendation,schedule_recommendation,\n activity_type, specific_test,\n contacts.genre, contacts.prenom, contacts.nom, contacts.email as email, contacts.telephone as telephone, contacts.prenom, contacts.nom, contacts.departement, contacts.rue1, contacts.rue2, contacts.ville, contacts.pays,\n contacts2.genre as genre2, contacts2.prenom as prenom2, contacts2.nom as nom2, contacts2.email as email2, contacts2.telephone as telephone2,\n contacts3.genre as genre3, contacts3.prenom as prenom3, contacts3.nom as nom3, contacts3.email as email3, contacts3.telephone as telephone3,\n contacts4.genre as genre4, contacts4.prenom as prenom4, contacts4.nom as nom4, contacts4.email as email4, contacts4.telephone as telephone4,\n tbljob_commentaire, tbljob_instruction, tbljob_commentaire_qualite, planning, tbljob_frequence,\n GE, specific_protocol, special_instruction, staircase,\n createur, t1.technicien as nomCreateur, t2.technicien as comCheckeur,\n test_type, test_type_abbr, test_type_cust, ST,final, auxilaire, tbljobs.id_rawData,\n report_rev, invoice_type, invoice_date, invoice_commentaire, invoice_lang, invoice_currency,\n specification, ref_matiere, matiere, tbljobs.waveform,\n other_1, other_2, other_3, other_4, other_5,\n type1.consigne_type as c_type_1, type2.consigne_type as c_type_2, c_unite,\n type1.id_consigne_type as id_c_type_1, type2.id_consigne_type as id_c_type_2,\n DyT_SubC, DyT_expected, DyT_Cust, available_expected, report_send,\n checked, comments, contacts.adresse,\n contactST.id_contact as id_contactST, contactST.genre as genreST, contactST.prenom as prenomST, contactST.nom as nomST,entrepriseST.id_entreprise as id_entrepriseST, entrepriseST.entreprise as entrepriseST, entrepriseST.entreprise_abbr as entreprise_abbrST, refSubC,\n\n entreprises.entreprise, entreprises.VAT, entreprises.MRSASRef, entreprises.billing_rue1, entreprises.billing_rue2, entreprises.billing_ville, entreprises.billing_pays\n\n\n FROM tbljobs\n LEFT JOIN test_type ON test_type.id_test_type=tbljobs.id_type_essai\n LEFT JOIN info_jobs ON info_jobs.id_info_job=tbljobs.id_info_job\n LEFT JOIN contacts ON contacts.id_contact=info_jobs.id_contact\n LEFT JOIN contacts contacts2 ON contacts2.id_contact=info_jobs.id_contact2\n LEFT JOIN contacts contacts3 ON contacts3.id_contact=info_jobs.id_contact3\n LEFT JOIN contacts contacts4 ON contacts4.id_contact=info_jobs.id_contact4\n LEFT JOIN contacts contactST ON contactST.id_contact=tbljobs.id_contactST\n LEFT JOIN entreprises entrepriseST ON entrepriseST.id_entreprise=contactST.ref_customer\n LEFT JOIN entreprises ON entreprises.id_entreprise=info_jobs.customer\n LEFT JOIN matieres ON matieres.id_matiere=info_jobs.id_matiere_std\n LEFT JOIN consigne_types as type1 ON type1.id_consigne_type=tbljobs.c_1\n LEFT JOIN consigne_types as type2 ON type2.id_consigne_type=tbljobs.c_2\n LEFT JOIN techniciens as t1 on t1.id_technicien=tbljobs.modif\n LEFT JOIN techniciens as t2 on t2.id_technicien=tbljobs.checked\n\n\n WHERE tbljobs.id_tbljob='.$this->id.';';\n //echo $req;\n return $this->db->getOne($req);\n }", "public function getNominaEtau3($id,$idg)\n { \n $result=$this->adapter->query('select distinct c.idNom, c.id, a.idCon, \n case a.cCosEmp when 0 then a.idCcos\n when 1 then b.idCcos End as idCcos, \n case a.horasCal when 0 then 0 \n when 1 then (c.dias*'.$this->horasDias.') End as horas, 1, \n case when g.valor=2 then \n case when g.tipo = 1 then a.valor else 0 End\t\t\t\t \n when g.valor=1 then 0 \n End as dev, \n case when g.valor=2 then \n case when g.tipo = 2 then a.valor else 0 End\t\t\t\t \n when g.valor=1 then 0 \n\t\tEnd as ded, h.formula, c.dias, g.tipo , b.id as idEmp , g.idFor , a.diasLab, c.diasVac, a.vaca, \n case when ii.codigo is null then \"\" else ii.codigo end as nitTer \n from n_tip_auto_i a inner join a_empleados b on a.idTauto=b.idTau3\n inner join n_nomina_e c on b.id=c.idEmp \n inner join n_nomina d on d.id=c.idNom\n inner join n_tip_auto_tn e on e.idTnom=d.idTnom \n inner join n_tip_calendario f on f.id=d.idCal\n inner join n_conceptos g on g.id=a.idCon\n inner join n_formulas h on h.id=g.idFor\n left join n_terceros_s i on i.id = g.idTer \n left join n_terceros ii on ii.id = i.idTer \n WHERE not exists (SELECT null from n_nomina_e_d \n where c.id=idInom and a.idCon=idConc and a.idCcos=idCcos and tipo=1 ) \n and d.estado=0 and b.idGrup='.$idg.' and c.idNom='.$id,Adapter::QUERY_MODE_EXECUTE);\n $datos=$result->toArray();\n return $datos; \n }", "function displayOrganismList($db, &$annot_list){\n $query=\"select distinct o.organism_name as name,ucsc_db as version,\";\n $query.=\" o.organism_id,ov.organism_version_id as version_id\";\n $query.=\" from organism o,organism_version ov\";\n $query.=\" where o.organism_id=ov.organism_id \";\n if(!empty($db)){\n $list=array(); $list=explode(\",\",$db);$query.=\" and ucsc_db in(\";$i=0;\n while($i<count($list)){$db=$list[$i];\n if($i==0)$query.=\"'$db'\";else $query.=\",'$db'\";++$i;\n }$query.=\")\";\n }$query.=\" order by organism_name\";global $con;\n if(!$con)$con=getConnection();$result =mysql_query(\"$query\",$con);$data= array();\n if($result){\n while($row = mysql_fetch_assoc($result))\n { $name=$row[\"name\"];$version=$row[\"version\"];$org_id=$row[\"organism_id\"];$version_id=$row[\"version_id\"];\n $annot_list[]=array('organism'=>array('name'=>$name,'version'=>$version,'organism_id'=>$org_id,'version_id'=>$version_id));\n }mysql_free_result($result);\n } \n}", "function consultar($where='',$group='',$ord='') {\n if ($this->con->conectar() == true) {\n \n\t\t\t$Sql = \"SELECT \n\t\t\t\t\t\ttrabajador.trabCedula,\n\t\t\t\t\t\tCONCAT(trabajador.trabNombre,' ',trabajador.trabApellido) AS trabNombres,\n\t\t\t\t\t\ttrabajador.trabNombre, \n\t\t\t\t\t\ttrabajador.trabApellido,\n\t\t\t\t\t\ttrabajador.trabOrganismoId,\n\t\t\t\t\t\torganismo.organismoDescripcion,\n\t\t\t\t\t\ttrabajador.trabDepartmentoId,\n\t\t\t\t\t\tdepartamento.departamentoDescripcion,\n\t\t\t\t\t\ttipo_prestamo.tipoprestNombre,\t\n\t\t\t\t\t\tprestamos.*,\n\t\t\t\t\t\tliquidacion.*,\n\t\t\t\t\t\tdetalle_liquidacion.*\n\n\t\t\t\t\tFROM detalle_liquidacion\n\t\t\t\t\t\t\tLEFT JOIN prestamos ON detalle_liquidacion.detliqPrestamoId = prestamos.prestamoId\t\t\n\t\t\t\t\t\t\tLEFT JOIN tipo_prestamo ON prestamos.prestamoTipoprestId = tipo_prestamo.tipoprestId\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tLEFT JOIN trabajador ON trabajador.trabCedula = prestamos.prestamoTrabCedula\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tLEFT JOIN organismo ON trabajador.trabOrganismoId = organismo.organismoId\n\t\t\t\t\t\t\tLEFT JOIN departamento ON trabajador.trabDepartmentoId = departamento.departamentoId\n\t\t\t\t\t\t\tLEFT JOIN liquidacion ON detalle_liquidacion.detliqLiquidacionCodigo = liquidacion.liquidacionCodigo\n\n\t\t\t\t\t$where\t\n\t\t\t\t\t$group\n\t\t\t\t\t$ord\n\t\t\t\t\t\";\n $this->resultado= mysql_query($Sql);\n return true;\n }\n }", "public function getSkuName ()\n {\n $sql = \" SELECT t1.id,sku_name,sku_description,sku_code,sku_weight_id,sku_lpc,sku_volume,sku_launch_date,t8.sku_type_name,\n GROUP_CONCAT(t5.unit_name SEPARATOR '<br /><br />') AS unit,t2.quantity,\n GROUP_CONCAT(ROUND(t2.db_lifting_price,2) SEPARATOR '<br /><br />') as db_lifting_price ,\n GROUP_CONCAT(ROUND(t2.outlet_lifting_price,2) SEPARATOR '<br /><br />') AS outlet_lifting_price,\n GROUP_CONCAT(ROUND(t2.mrp_lifting_price,2) SEPARATOR '<br /><br /> ') AS mrp_lifting_price ,\n t3.element_name,t4.sku_active_status_name,t5.unit_name,t6.element_name as product,\n t7.element_name as catagory\n FROM tbld_sku AS t1\n INNER JOIN\n `tbli_sku_mou_price_mapping` AS t2\n ON t1.id = t2.sku_id\n INNER JOIN\n tbld_sku_active_status AS t4\n ON t1.sku_active_status_id = t4.id\n INNER JOIN\n tbld_sku_hierarchy_elements AS t3\n ON t1.parent_id = t3.id\n INNER JOIN\n tbld_unit AS t5\n ON t5.id= t2.mou_id\n left join tbld_sku_hierarchy_elements as t6\n on t6.id = t3.parent_element_id\n left join tbld_sku_hierarchy_elements as t7\n on t7.id = t6.parent_element_id\n left Join `tbld_sku_type` as t8\n On t1.sku_type_id=t8.id\n GROUP BY t2.sku_id\n ORDER BY t2.sku_id,t2.quantity asc\";\n $query = $this->db->query( $sql )->result_array();\n return $query;\n }", "public function Get_Category_Row_From_Category(){\n\n\n $query = $this->db->query(\"SELECT p.pid,GROUP_CONCAT(c.cname) as mysummary FROM products p, category c WHERE FIND_IN_SET(c.cid, p.product_category) GROUP BY p.pname ORDER BY p.pid\");\n\n //$result = $query->result();\n\n $result = $query->result();\n\n /*\n foreach ($result as $value){ \n \n $result[] = $value->mysummary; \n\n } */\n \n\n //print_r($result);\n //die();\n\n if(!empty($result)){\n\n return $result;\n\n }else{\n\n return false;\n }\n\n\n}", "public function getMosselBayPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '103'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getStellenboschPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '99'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "function getAllImages() {\r\r\n\t$PView = new PView;\r\r\n\t$Template = new Template;\r\r\n\tglobal $tp;\r\r\n\t\r\r\n\t$pv_Appl = $PView -> getAppl();\r\r\n\t$ImageData = array();\r\r\n\t\r\r\n// prepare album-handling\r\r\n\tif ($pv_Appl[0] == \"album\"){\r\r\n\t\t$ImageCount = $PView -> getAlbumImageCount();\r\r\n\t\t$details = $PView->getPView_config(\"album_details\");\r\r\n\t\t$message = LAN_ALBUM_9;\r\r\n\t}\r\r\n// prepare category-handling\r\r\n\tif ($pv_Appl[0] == \"cat\"){\r\r\n\t\t$ImageCount = $PView -> getCatImageCount($pv_Appl[1]);\r\r\n\t\t$details = $PView->getPView_config(\"cat_details\");\r\r\n\t\t$message = LAN_GALLERY_12;\r\r\n\t}\t\r\r\n// prepare userimage-handling\r\r\n\tif ($pv_Appl[0] == \"user\"){\r\r\n\t\t$ImageCount = $PView -> getUserImageCount($pv_Appl[1]);\r\r\n\t\t$details = $PView->getPView_config(\"user_details\");\r\r\n\t\t$message = LAN_GALLERY_13;\r\r\n\t}\r\r\n\t\r\r\n\tglobal $applImages;\r\r\n\t$ImageData = $PView->sortApplImages($applImages);\r\r\n\t$showDetails = explode(\"|\",$details);\r\r\n\t\r\r\n\tif ($ImageCount) {\r\r\n\t\t$cols = 1;\r\r\n\t\t$pics = $PView -> getPView_config(\"pics_per_page\");\r\r\n\t\t$picCount = 0;\r\r\n\t\t$colwidth = 100/$cols;\r\r\n\t\tif ($_GET['page']) {\r\r\n\t\t\t$page = $_GET['page'];\r\r\n\t\t}\r\r\n\t\t$Pages = ceil($ImageCount/$pics);\r\r\n\t\tif (!$page or $page > $Pages) {\r\r\n\t\t\t$page = 1;\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\t\r\r\n\t\t$out_AllImages = \"<tr>\";\r\r\n\t\tforeach ($ImageData as $dataset) {\r\r\n\t\t\t//PERMISSION!!!\r\r\n\t\t\tif ($PView -> getPermission(\"image\",$dataset['imageId'],\"View\")) {\r\r\n\t\t\t\t// insert images line by line, observe pagelimit\r\r\n\t\t\t\tif ($colCount == $cols) {\r\r\n\t\t\t\t\t$out_AllImages.= \"</tr><tr>\";\r\r\n\t\t\t\t\t$colCount = 0;\r\r\n\t\t\t\t}\r\r\n\t\t\t\tif ($picCount >= ($page - 1) * $pics && $picCount < $page * $pics) {\r\r\n\t\t\t\t\t$thumb = $PView -> getResizePath($dataset['imageId']);\r\r\n\t\t\t\t\tif ($PView->getPView_config(\"seo_links\")){\r\r\n\t\t\t\t\t\t$seo = \"&amp;name=\".$dataset['name'];\r\r\n\t\t\t\t\t} else {\r\r\n\t\t\t\t\t\t$seo = \"\";\r\r\n\t\t\t\t\t}\t\r\r\n\t\t\t\t\tif ($PView->getPView_config(\"center_thumbs\")){\r\r\n\t\t\t\t\t\t$infoPos = \"left:30%;\";\r\r\n\t\t\t\t\t} else{\r\r\n\t\t\t\t\t\t$infoPos = \"left:10px;\";\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\t$backgr = \"background:url(\".e_PLUGIN.\"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/images/gt.png) repeat;\";\t\t\r\r\n\t\t\t\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t$out_AllImages.= \"<td style='vertical-align:top;width:\".$colwidth.\"%; border: #b7b5b5 1px solid; padding:5px; \".$Template->getThumbPosition().\"'><div style='position:relative;'><div style='position:relative;'>\".$Template -> getImageLink($pv_Appl[0],$dataset,'resize','resize','pview_gal').\"</div>\";\r\r\n\t\t\t\t\t\r\r\n\t\t\t\t\t$out_AllImages.= \"<div style='position:absolute; bottom:10px; \".$infoPos.\" width:40%; border: 2px solid #b7b5b5; text-align:left; padding: 5px; \".$backgr.\"'>\";\r\r\n\t\t\t\t\tforeach($showDetails as $detail){\r\r\n\t\t\t\t\t\t\r\r\n\t\t\t\t\t\tswitch($detail){\r\r\n\t\t\t\t\t\t\tcase \"name\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<span><b>\".$tp -> toHTML($dataset['name']).\"</b></span>\";\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"descr\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($dataset['description']).\"</span>\";\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"user\":\r\r\n\t\t\t\t\t\t\t$userData = $PView->getUserData($dataset['uploaderUserId']);\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige aller Bilder des Users\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?user=\".$dataset['uploaderUserId'].\"'><span>\".$tp -> toHTML($userData['user_name']).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($userData['user_name']).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"cat\":\r\r\n\t\t\t\t\t\t\tif ($catData = $PView -> getCatData($dataset['cat'])){\r\r\n\t\t\t\t\t\t\t\t$catName = $catData['name'];\r\r\n\t\t\t\t\t\t\t} else {\r\r\n\t\t\t\t\t\t\t\t$catName = LAN_IMAGE_46;\r\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige aller Bilder der Kategorie\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\") && $dataset['cat']){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?cat=\".$dataset['cat'].\"'><span>\".LAN_IMAGE_45.\": \".$tp -> toHTML($catName).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".LAN_IMAGE_45.\": \".$tp -> toHTML($catName).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"date\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML(date('d.m.Y',$dataset['uploadDate'])).\"</span>\";\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"gal\":\r\r\n\t\t\t\t\t\t\t$albumData = $PView->getAlbumData($dataset['albumId']);\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige der Galerie\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?gallery=\".$albumData['galleryId'].\"'><span>\".$tp -> toHTML($PView->getGalleryName($albumData['galleryId'])).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($PView->getGalleryName($albumData['galleryId'])).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"album\":\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige aller Bilder des albums\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?album=\".$dataset['albumId'].\"'><span>\".$tp -> toHTML($PView->getAlbumName($dataset['albumId'])).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($PView->getAlbumName($dataset['albumId'])).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"edit\":\r\r\n\t\t\t\t\t\t\t//PERMISSION!!!\r\r\n\t\t\t\t\t\t\tif ($PView -> getPermission(\"album\",$dataset['sendImage'],\"Edit\")) {\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pview_actions.php?image=\".$dataset['imageId'].\"&amp;action=edit'><span>\".LAN_IMAGE_2.\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"send\":\r\r\n\t\t\t\t\t\t\t//PERMISSION!!!\r\r\n\t\t\t\t\t\t\tif (($PView -> getPView_config(\"email\") && $dataset['sendImage']) OR (ADMIN && $PView -> getPView_config(\"admin_Mode\"))){\r\r\n\t\t\t\t\t\t\t\tif ($PView -> getPermission(\"config\",\"permEmail\",\"\")) {\r\r\n\t\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='\".e_BASE.\"email.php?plugin:pviewgallery.\".$dataset['imageId'].\"'><span>\".LAN_IMAGE_48_1.\"</span></a>\";\r\r\n\t\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"comm\":\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"Comments\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br /><span>\".LAN_IMAGE_4.\": \".$PView -> getCommentsCount($dataset['imageId']).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t\tbreak;\t\r\r\n\t\t\t\t\t\t\tcase \"rating\":\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"Rating\")){\r\r\n\t\t\t\t\t\t\t\t$ratingData = $PView -> getRatingData($dataset['imageId']);\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br /><span>\".LAN_IMAGE_3.\": \".round($ratingData['value'],1).\" (\".$ratingData['count'].\")</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\t\r\r\n\t\t\t\t\t\t\tcase \"views\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".LAN_IMAGE_16.\": \".$tp -> toHTML($dataset['views']).\" \".LAN_IMAGE_17.\"</span>\";\r\r\n\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t}\t\t\t\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\t$out_AllImages.= \"</div></div></td>\";\t\t\r\r\n\t\t\t\t\t$colCount++;\r\r\n\t\t\t\t}\r\r\n\t\t\t\t$picCount++;\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t\t// fill row with empty cells\r\r\n\t\twhile ($colCount < $cols) {\r\r\n\t\t\t$out_AllImages.= \"<td>&nbsp;</td>\";\r\r\n\t\t\t$colCount++;\r\r\n\t\t}\r\r\n\t\t$out_AllImages.= \"</tr>\";\r\r\n\t\treturn $out_AllImages;\r\r\n\t}\r\r\n\treturn \"<div style='padding:10px;'>\".$message.\"</div>\";\r\r\n}", "function getDatos(){\n $res = $this->Consulta('SELECT C.*, P.id_planta FROM '.$this->Table .' C\n INNER JOIN\n equipos E ON E.id_equipos = C.`id_equipos`\n INNER JOIN\n secciones S ON S.id_secciones = E.id_secciones\n INNER JOIN\n plantas P ON P.id_planta = S.id_planta\n \n WHERE '.$this->PrimaryKey.' = '.$this->_datos);\n $resultado = $res[0];\n // $resultado = array_map('utf8_encode',$resultado);\n \n print_r( json_encode( $resultado ) );\n }", "public function getPetsByUsuario($id_usuario){\n $db = db_connect();\n $resultados = $db->table('pet')\n ->select('pet.*')\n ->select('galeria.imagem')\n ->select('usuario.nome as nome_usuario, usuario.telefone, usuario.email')\n ->select('saude.id_pet as saude_id_pet, vermifugado, vacinado, castrado, cuidados_especiais')\n ->select('personalidade.id_pet as personalidade_id_pet, docil, agressivo, calmo, brincalhao, sociavel, arisco, independente, carente, tenso, assustado, casa, apartamento')\n ->select('porte.descricao as porte_descricao')\n ->select('especie.descricao as especie_descricao')\n ->select('sexo.descricao as sexo_descricao')\n ->select('faixa_etaria.descricao as faixa_etaria_descricao')\n ->select('municipio.nome as municipio_nome, municipio.uf')\n ->join('usuario', 'usuario.id_usuario = pet.id_usuario', 'left')\n ->join('porte', 'porte.id_porte = pet.id_porte', 'left')\n ->join('especie', 'especie.id_especie = pet.id_especie', 'left')\n ->join('sexo', 'sexo.id_sexo = pet.id_sexo', 'left')\n ->join('faixa_etaria', 'faixa_etaria.id_faixa_etaria = pet.id_faixa_etaria', 'left')\n ->join('municipio', 'municipio.id_municipio = pet.id_municipio', 'left')\n ->join('saude', 'saude.id_pet = pet.id_pet', 'left')\n ->join('personalidade', 'personalidade.id_pet = pet.id_pet', 'left')\n ->join('galeria', 'galeria.id_pet = pet.id_pet', 'left')\n ->where('pet.id_usuario', $id_usuario)\n ->where('galeria.capa',1)\n ->where('pet.excluido',0)\n ->get()->getResultObject();\n $db->close();\n return $resultados; \n }", "public function getOverstrandPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '113'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function prepareResults()\n {\n $final_imageset = $this->_imagesets;\n foreach ($this->_imagesets as $run_id => $imageset) {\n if (!$this->_validateOutFiles($imageset['out_images'])) {\n unset($final_imageset[$run_id]);\n break;\n }\n $final_imageset[$run_id]['recordtodb'] = isset($imageset['out_images']['main']);\n// unset ($final_imageset[$run_id]['out_images']);\n foreach ($this->_image->getColours() as $colour) {\n $tmp_colour = $imageset[$colour];\n $final_imageset[$run_id][$colour] = $tmp_colour['colour'];\n $final_imageset[$run_id]['imlev'] = $tmp_colour['levels']['imlev'];\n foreach (['r', 'v'] as $levtype) {\n foreach (['min', 'max'] as $minmax) {\n $minkey = sprintf(\"%s%s_%s\", $minmax, $colour, $levtype);\n $final_imageset[$run_id][$minkey] = $tmp_colour['levels'][$levtype][$minmax];\n }\n }\n }\n $final_imageset[$run_id] = array_merge($final_imageset[$run_id], $this->_commons);\n }\n return $final_imageset;\n }", "public function store_items_report($category_id,$branch_id,$year,$month)\n {\n $query = $this->db->query(\" SELECT CASE WHEN sp.`unit`=0 THEN 'none' WHEN sp.`unit`=1 THEN 'kg' WHEN sp.`unit`=2 THEN 'gm' WHEN sp.`unit`=3 THEN 'l' WHEN sp.`unit`=4 THEN 'ml' END AS unit, sp.`name`, NULL AS open_stock, c.`cat_name`, spi.`price`, (SELECT SUM(ssi.`today_purchase_qty`) FROM store_inward ssi WHERE ssi.`store_product_inward_id` = spi.`store_product_inward_id`) AS purchase, (SELECT SUM(sub_sin.`instock`) FROM store_instock sub_sin WHERE sub_sin.`store_product_inward_id` = spi.`store_product_inward_id`) AS instock, NULL AS cons_amt, NULL AS close_amt\n FROM store_product_inward spi \n LEFT JOIN `store_inward` si ON si.`store_product_inward_id` = spi.`store_product_inward_id` \n LEFT JOIN `store_product` sp ON sp.`store_product_id` = spi.`store_product_id` \n LEFT JOIN `category` c ON c.`category_id` = sp.`category_id` \n LEFT JOIN `store_instock` s_in ON s_in.`store_product_inward_id` = spi.`store_product_inward_id` \n WHERE MONTH(si.`created`) = '\".$month.\"' AND YEAR(si.`created`) = '\".$year.\"' AND c.category_id='\".$category_id.\"' AND spi.branch_id='\".$branch_id.\"'\n GROUP BY sp.`store_product_id` \");\n\n // $str = $this->db->last_query();\n // echo $str;die;\n\n\n $result = $query->result_array();\n return $result;\n\n }", "public function getAllImageThatContaintedGeoLoacitonByUserID($userID){\n try{\n $object=array();\n\n if($stmt=$this->DataBaseCon->prepare(\"SELECT ImageDataSet.ImgID,ImageDataSet.ImgPathWithPrimalUrl,ImageDataSet.ImgPathWithResizeUrl,ImageDataSet.ImgPathWithIconUrl, ImageDataSet.ImgDate, EventDataSet.Longitude, EventDataSet.Latitude,LocationDataSet.Address FROM EventDataSet, ImageDataSet,LocationDataSet WHERE EventDataSet.ImgID = ImageDataSet.ImgID AND EventDataSet.EventID=LocationDataSet.EventID AND EventDataSet.Longitude is NOT null AND EventDataSet.Latitude is not NUll AND ImageDataSet.userID=?\")){\n $stmt->bind_param('s',$userID);\n $stmt->execute();\n $stmt->bind_result($ImgID,$ImgPathWithPrimalUrl,$ImgPathWithResizeUrl,$ImgPathWithIconUrl,$ImgDate,$Longitude,$Latitude,$Address);\n while ($stmt->fetch())\n {\n $array =array('imgID'=>$ImgID, 'imgPathWithPrimalUrl'=>$ImgPathWithPrimalUrl, 'imgPathWithResizeUrl'=>$ImgPathWithResizeUrl,'imgPathWithIconUrl'=>$ImgPathWithIconUrl,'imgDate'=>$ImgDate,'Longitude'=>$Longitude,'Latitude'=>$Latitude,'Address'=>$Address);\n array_push($object,$array);\n }\n $stmt -> close();\n if(count($object)>0){\n return $object;\n }\n else{\n return false;\n }\n }\n else{\n return false;\n }\n\n }catch(Expection $e){\n return false;\n }\n\n\n\n }", "function getImagesDamCat($limitImages=0) {\n\t $content.=$this->beginGallery($this->cObj->data['uid'],$limitImages);\n\t \n\t // add image\n $list= str_replace('tx_dam_cat_', '',$this->config['startingpointdamcat']);\n\n $listRecursive = $this->getRecursiveDamCat($list,$this->config['recursivedamcat']);\n $listArray = explode(',',$listRecursive);\n $files = Array();\n\t\tforeach($listArray as $cat) {\n\t\t\t\t\t\t\n\t\t\t// add images from categories\n\t\t\t$fields = 'tx_dam.uid,tx_dam.title,tx_dam.description,tx_dam.file_name,tx_dam.file_path';\n\t\t\t$tables = 'tx_dam,tx_dam_mm_cat';\n\t\t\t$temp_where = 'tx_dam.deleted = 0 AND tx_dam.hidden=0 AND tx_dam_mm_cat.uid_foreign='.$cat.' AND tx_dam_mm_cat.uid_local=tx_dam.uid';\n\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $tables, $temp_where);\n\t\t\t\n while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){\n $files[$row['uid']] = $row; # just add the image to an array\n\t\t\t}\n\t\t}\n\t\t\n if ($limitImages>0) {\n $files = $this->getSlicedRandomArray($files,0,$limitImages);\n }\t\n \n\t\t// add the image for real\n\t\tforeach ($files as $key=>$row) {\n $path = $row['file_path'].$row['file_name'];\n\n // add element to slideshow\n $content.=$this->addImage(\n\t\t $path,\n $row['title'], \n $row['description'], \n $this->config['showThumbs'],\n $this->config['showLightbox'],\n $path,\n $limitImages\n );\t\n }\t\t\t\n \n \n $content.=$this->endGallery();\n return $content;\n }", "function getAllRecord($limit,$column_name,$order){\n\t \t$sql = \"SELECT *,SUM(stage='288') As sum1, SUM(stage='289') As sum2, SUM(stage='291') As sum3, SUM(stage='293') As sum4, COUNT(DISTINCT cand_id) As count2,synonym.parentname As compa, a1.parentname As loca FROM pof LEFT JOIN pof_candidates ON pof.pof_id=pof_candidates.pofid LEFT JOIN synonym ON synonym.s_id=pof.client_id LEFT JOIN synonym As a1 ON a1.s_id=pof.location LEFT JOIN pof_cons ON pof.pof_id=pof_cons.pos_id LEFT JOIN companies_grade ON pof.grade=companies_grade.gid GROUP BY pof.pof_id ORDER BY \".$column_name.\" \".$order.\" LIMIT \" .$limit . \",20 \";\n\t $Q = $this->db->query($sql);\n\tif($Q->num_rows() > 0){\n\tforeach($Q->result() as $row)\n\t{\n\t $data[] = $row;\n\t}\n\t}\n\t $Q->free_result(); \n\t return $data; \n }", "function getFilesArray(){\n $result = db_select('fossee_banner_details','n')\n ->fields('n',array('id','file_name','status'))\n ->range(0,20)\n //->condition('n.status_bool',1,'=')\n ->execute();\n\n return $result;\n}", "public function getPromInformation($prom_id,$user_id){\n //\n // get id, idCompany, prom_text, company_name, latLng, logo_icon_start_with\n //\n $sql_check = \"SELECT \".\n \"promotions.id, \".\n \"promotions.idCompany, \".\n \"promotions.message as prom_text, \".\n \"company.name as company_name, \".\n \"GROUP_CONCAT( X( company.geographicPosition ) , ',', Y( company.geographicPosition ) ) AS latLng, \".\n \"LEFT(logoTypes.logo , 30) as logo_icon_start_with \".\n \"FROM promotions \".\n \"join company on ( company.id = promotions.idCompany ) \".\n \"join logoTypes on ( company.idLogosTypes = logoTypes.id ) \".\n \"where promotions.id =\".$prom_id ;\n\t\t\n $arrProm = $this->exec_query_0($sql_check,'SEL');\n if(empty($arrProm[\"id\"])){ \n //\n // promotion not exist\n //\n return FALSE; \n }\n else{\n\t\t\t $result_ = $arrProm;\n\t\t\t\t$result_['id'] = (isset($result_['id'])) ? (int)$result_['id']:$result_['id'];\n\t\t\t\t$result_['idCompany'] = (isset($result_['idCompany'])) ? (int)$result_['idCompany']:$result_['idCompany'];\n\t\t\t\tif(isset($result_['latLng'])) {\n\t\t\t\t\t$co_ordinates = (explode(\",\",$result_['latLng']));\n\t\t\t\t\t$result_['latLng'] = (isset($result_['latLng'])) ? array((float)$co_ordinates[0],(float)$co_ordinates[1]):$result_['idCompany'];\n\t\t\t\t}\n\t\t\t}\n \n //var_dump($arrProm);\n\n\n //\n // get date time life for a promotion\n //\n $sql_time_life = \"SELECT DATE, prom_time.time_ \".\n \"FROM ( \".\n \"SELECT idPromotions, GROUP_CONCAT( `00:00` , `01:00` , `02:00` , `03:00` , `04:00` , `05:00` , `06:00` , `07:00` , `08:00` , `09:00` , `10:00` , `11:00` , `12:00` , `13:00` , `14:00` , `15:00` , `16:00` , `17:00` , `18:00` , `19:00` , `20:00` , `21:00` , `22:00` , `23:00` ) time_ \".\n \"FROM promotionTime \".\n \"WHERE idPromotions = \".$prom_id.\n \")prom_time \".\n \"JOIN promotionsDate ON ( promotionsDate.idPromotions = prom_time.idPromotions ) \";\n $arrProm_timelife = $this->exec_query_0($sql_time_life,'ALL');\n //var_dump($arrProm_timelife);\n // get timelife prom\n foreach($arrProm_timelife as $index) {\n // build timelife\n foreach($index as $date_=>$time_) {\n // validate length of time_\n // it must be 24 for represent 24hrs\n if(strlen($time_) == 24){\n $time_array = array();\n // convert binary hr_string to hours 0= false 1=true\n for($i = 0;$i<strlen($time_);$i++){\n if($time_{$i})\n $time_array[] = $i;\n }\n }\n else{ continue;}\n $time_life[$index[\"DATE\"]] = $time_array;\n }\n }\n //var_dump($time_life);\n $result_[\"time_life\"] = $time_life;\n\n //\n // determine if promotion ID belong to:\n // 1) shared or owned route\n // 3) shared promotion\n \n //\n // TODO\n // when a Route is shared with an user, promotions assigned \n // to that route has to be assigned to the shared user to \n // matain data consistency\n $sql_route_assign = \"SELECT id,idRoute from promotionAssign where promotionAssign.idPromotions =\".$prom_id.\" and promotionAssign.idUsr =\".$user_id;\n $route_assign = $this->exec_query_0($sql_route_assign,'SEL');\n //var_dump($route_assign);\n\n // assign route id\n $result_[\"idRoute\"] = (empty($route_assign[\"idRoute\"])) ? \"SHARED_PROM\" : (int)$route_assign[\"idRoute\"];\n\n if(!empty($route_assign[\"id\"]) && isset($route_assign[\"id\"]) ){\n\t\t\t\t// insert promotionAssignId and date in promotionReceive table\n\t\t\t\t$sql_promo_assign = \"INSERT INTO `promotionReceive`(`id`, `idPromotionsAssing`, `date`) VALUES (0,\".$route_assign[\"id\"].\",'\".date('Y-m-d H:i:s').\"')\";\n\t\t\t\t$this->exec_query_0($sql_promo_assign,'INS');\n }\n else{ \n // assign promotion \n $sql_assign_prom = \"INSERT INTO `promotionAssign` (`id`, `idPromotions`, `idRoute`, `idRoutePoint`, `idUsr`, `idpromotionShared`, `valid`) VALUES (NULL, \".$prom_id.\", NULL, NULL, '\".$user_id.\"', NULL, '1')\"; \n $assign_id = $this->exec_query_0($sql_assign_prom,'INS');\n if($assign_id > 0){\n // set prom received\n $sql_promo_assign = \"INSERT INTO `promotionReceive`(`id`, `idPromotionsAssing`, `date`) VALUES (0,\".$assign_id.\",'\".date('Y-m-d H:i:s').\"')\";\n $receivedId = $this->exec_query_0($sql_promo_assign,'INS');\n // received prom error\n if($receivedId < 1){\n $this->arrResultData['success'] = 'false';\n $this->arrResultData['m'] = array(\"status\"=>'Fatal error, promotion received error');\n return FALSE;\n }\n }\n else{\n // assign prom error\n $this->arrResultData['success'] = 'false';\n $this->arrResultData['m'] = array(\"status\"=>'Fatal error, promotion not assigned');\n return FALSE;\n }\n }\n\t\t\t\n \t$this->arrResultData['m'] = $result_;\n return TRUE;\n }\n\t\t\n\t\t/*\n\t\t* Function to validata the request data\n\t\t*/\n\t\t\n\t\tpublic function validarEstructura($jsonEntrada) {\n\t\t\t$json = $jsonEntrada['PRO'];\n\t\t\t$arrResult = array();\n\t\t\t$this->debug = (isset($json[\"debug\"])) ? $json[\"debug\"] : FALSE;\n\t\t\tif($this->debug)\n\t\t\t\t$this->arrResultData['debug'][] = array(\"send query\"=>$json);\n\t\t\t\tif($this->validateData($json)) {\n //\n // validate user and passwd\n //\n $Obj_logIn = new LogIn();\n $arrResult = $Obj_logIn->authenticateUser($json['user'],$json['passwd']);\n\n\n if(!empty($arrResult)){\n $arrPromotion = $this->getPromInformation($json[\"prom_id\"],$arrResult[\"id\"]);\n if(empty($arrPromotion)) {\n\t\t\t\t\t\t\t$this->arrResultData['success'] = 'false';\n\t\t\t\t\t\t\t$this->arrResultData['m'] = 'Invalid promotion id';\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\t\t$this->arrResultData['success'] = 'false';\n\t\t\t\t\t\t\t$this->arrResultData['m'] = 'Invalid user or password';\n \t\t\t\t\t\tif($this->debug)\n\t \t\t\t\t\t\t$this->arrResultData['debug'][] = array(\"athentication\"=>\"fail\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\treturn $this->arrResultData;\n\t\t}\n\t\t\n\t\tfunction validateData($json) {\n\t\t\t$flag = 0;\n\t\t\t$this->debug = (isset($json[\"debug\"])) ? $json[\"debug\"] : FALSE;\n\t\t\t\n\t\t\t// check user index\n\t\t\tif(!array_key_exists(\"user\",$json) || empty($json['user'])) {\n\t\t\t\t$this->arrResultData['success'] = 'false';\n\t\t\t\t$this->arrResultData['m'] = 'user name is missing';\n\t\t\t\t if($this->debug)\n\t\t\t\t\t\t$this->arrResultData['debug'][] = array(\"user\"=>\"User name is missing or Invalid index\");\n\t\t\t\t\t$flag=1;\n\t\t\t }else\n\t\t\t {\n\t\t\t\tif(isset($json['user']) && strlen($json['user']) > 30) {\n\t\t\t\t\t$this->arrResultData['success'] = 'false';\n\t\t\t\t\t$this->arrResultData['m'] = 'user name mast be less than 30 character';\n\t\t\t\t if($this->debug)\n\t\t\t\t\t\t$this->arrResultData['debug'][] = array(\"user\"=>\"length of user name is exceed\");\n\t\t\t\t\t$flag=1;\n\t\t\t\t}\n\t\t\t\tif(is_integer($json[\"user\"])) {\n\t\t\t\t\t$this->arrResultData['success'] = 'false';\n\t\t\t\t\t$this->arrResultData['m'] = 'invalid user';\n\t\t\t\t\tif($this->debug)\n\t\t\t\t\t\t$this->arrResultData['debug'][] = array(\"user\"=>\"user mast be string format\");\n\t\t\t\t\t$flag=1;\n\t\t\t\t}\n\t\t\t }\n\t\t\t // check passwd index\n\t\t\t \n\t\t\t if(!array_key_exists(\"passwd\",$json) || empty($json['passwd'])) {\n\t\t\t\t$this->arrResultData['success'] = 'false';\n\t\t\t\t$this->arrResultData['m'] = 'passwd is missing';\n\t\t\t\t if($this->debug)\n\t\t\t\t\t\t$this->arrResultData['debug'][] = array(\"passwd\"=>\"password is missing or Invalid index\");\n\t\t\t\t\t$flag=1;\n\t\t\t }\n\t\t\t else {\n\t\t\t\tif(isset($json['passwd']) && strlen($json['passwd']) > 30) {\n\t\t\t\t\t$this->arrResultData['success'] = 'false';\n\t\t\t\t\t$this->arrResultData['m'] = 'password mast be less than 30 character';\n\t\t\t\t if($this->debug)\n\t\t\t\t\t\t$this->arrResultData['debug'][] = array(\"password\"=>\"length of password is exceed\");\n\t\t\t\t\t$flag=1;\n\t\t\t\t}\n\t\t\t\tif(is_integer($json[\"passwd\"])) {\n\t\t\t\t\t$this->arrResultData['success'] = 'false';\n\t\t\t\t\t$this->arrResultData['m'] = 'invalid password';\n\t\t\t\t\tif($this->debug)\n\t\t\t\t\t\t$this->arrResultData['debug'][] = array(\"password\"=>\"password mast be string format\");\n\t\t\t\t\t$flag=1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t \n\t\t\t // check prom_id index\n\t\t\t if(!array_key_exists(\"prom_id\",$json) || empty($json['prom_id'])) {\n\t\t\t\t$this->arrResultData['success'] = 'false';\n\t\t\t\t$this->arrResultData['m'] = 'Promotion Id is missing';\n\t\t\t\t if($this->debug)\n\t\t\t\t\t\t$this->arrResultData['debug'][] = array(\"prom_id\"=>\"Promotion Id is missing or Invalid index\");\n\t\t\t\t\t$flag=1;\n\t\t\t }else {\n\t\t\t\t\n\t\t\t\tif(!is_integer($json[\"prom_id\"])) {\n\t\t\t\t\t$this->arrResultData['success'] = 'false';\n\t\t\t\t\t$this->arrResultData['m'] = 'invalid promo id';\n\t\t\t\t\tif($this->debug)\n\t\t\t\t\t\t$this->arrResultData['debug'][] = array(\"prom_id\"=>\"Promotion Id must be numeric format\");\n\t\t\t\t\t$flag=1;\n\t\t\t\t}\n\t\t\t }\n\t\t\t \n\t\t\t \n\t\t\t if($flag) { return false; } else { return true;}\n\t\t\t \n\t\t} // end of validateData()\n\t\n\t}", "function GetLogo(){\n\t//Building the query\n\t$stringBuilder = \"SELECT f.location \";\n\t$stringBuilder .= \"FROM layout l \";\n\t$stringBuilder .= \"INNER JOIN `file` f ON f.file_id=l.logo \";\n\t$stringBuilder .= \"LIMIT 0,1 \";\n\t// Preparing query\n\t$query = GetDatabaseConnection()->prepare($stringBuilder);\n\t$query->execute();\n\t$result = $query->fetchAll(); //Fetching it\n\t$location = \"\";\n\tif (isset($result[0][\"location\"])) {\n\t\t$location = $result[0][\"location\"];\n\t}\n\treturn \"$location\";\n}", "public function BuscarKardexIngrediente() \n{\n\tself::SetNames();\n\t$sql =\"SELECT ingredientes.nomingrediente, ingredientes.unidadingrediente, ingredientes.cantingrediente , ingredientes.costoingrediente, kardexingredientes.codingrediente, kardexingredientes.codresponsableing, kardexingredientes.movimientoing, kardexingredientes.entradasing, kardexingredientes.salidasing, kardexingredientes.stockactualing, kardexingredientes.preciouniting, kardexingredientes.costototaling, kardexingredientes.documentoing, kardexingredientes.fechakardexing, proveedores.nomproveedor as proveedor, clientes.nomcliente as clientes FROM (ingredientes LEFT JOIN kardexingredientes ON ingredientes.codingrediente=kardexingredientes.codingrediente) LEFT JOIN proveedores ON proveedores.codproveedor=kardexingredientes.codresponsableing LEFT JOIN clientes ON clientes.codcliente=kardexingredientes.codresponsableing WHERE kardexingredientes.codingrediente = ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_GET[\"codingrediente\"]) );\n\t$stmt->execute();\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"<center><div class='alert alert-danger'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN MOVIMIENTOS EN KARDEX PARA EL INGREDIENTE INGRESADO</div></center>\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "function get_psb_group_by_tha() {\n $sql = \"SELECT * FROM psb p INNER JOIN psb_jalur jp ON p.jalurpsb_id = jp.jalurpsb_id GROUP BY psb_tha\";\n $query = $this->db->query($sql);\n if ($query->num_rows() > 0) {\n $result = $query->result_array();\n $query->free_result();\n return $result;\n } else {\n return 0;\n }\n }", "public function getAllImageByUserID($userID){\n try{\n $object=array();\n\n if($stmt=$this->DataBaseCon->prepare(\"SELECT ImageDataSet.ImgID,ImageDataSet.ImgPathWithPrimalUrl,ImageDataSet.ImgPathWithResizeUrl,ImageDataSet.ImgPathWithIconUrl, ImageDataSet.ImgDate, EventDataSet.Longitude, EventDataSet.Latitude,LocationDataSet.Address FROM EventDataSet, ImageDataSet,LocationDataSet WHERE EventDataSet.ImgID = ImageDataSet.ImgID AND EventDataSet.EventID=LocationDataSet.EventID AND ImageDataSet.userID=?\")){\n $stmt->bind_param('s',$userID);\n $stmt->execute();\n $stmt->bind_result($ImgID,$ImgPathWithPrimalUrl,$ImgPathWithResizeUrl,$ImgPathWithIconUrl,$ImgDate,$Longitude,$Latitude,$Address);\n while ($stmt->fetch())\n {\n $array =array('imgID'=>$ImgID, 'imgPathWithPrimalUrl'=>$ImgPathWithPrimalUrl, 'imgPathWithResizeUrl'=>$ImgPathWithResizeUrl,'imgPathWithIconUrl'=>$ImgPathWithIconUrl,'imgDate'=>$ImgDate,'Longitude'=>$Longitude,'Latitude'=>$Latitude,'Address'=>$Address);\n array_push($object,$array);\n }\n $stmt -> close();\n if(count($object)>0){\n return $object;\n }\n else{\n return false;\n }\n }\n else{\n return false;\n }\n\n }catch(Expection $e){\n return false;\n }\n\n\n\n }", "public function getProductCommentsAll($objectid, $page=1, $count=2){\n // if($res2->num_rows() <= 0) $res2 = [];\n // else $res2 = $res2->result_array();\n\n // if(isset($res2) && !empty($res2)) {\n // $idis = [];\n // foreach($res2 as $k => $one){\n // $idis[] = $one['catalogid'];\n // } unset($one);\n\n // $idis2 = [];\n // foreach($res2 as $k => $two){\n // $idis2[] = $two['main_id'];\n // } unset($two);\n\n // $array = [];\n // $array = array_merge($idis, $idis2);\n // $unique_array = [];\n // $unique_array = array_unique($array);\n // } else $unique_array = $objectid;\n\n // $result = $this->db->select('site_color_catalog.catalogid')\n // ->where_in('site_color_catalog.main_id', $unique_array)\n // ->from('site_color_catalog')->get()->result_array();\n\n // if(isset($result) && !empty($result)){\n // $idits = [];\n // foreach($result as $value){\n // $idits[] = $value['catalogid'];\n // }unset($value);\n // $all_result = [];\n // $all_result = array_unique($idits);\n // } else $all_result = $objectid;\n\n $objectid = (int)$objectid;\n if ($objectid <= 0) \n return array();\n if ($page == 0 || $page == 1)\n $page = 0;\n else\n $page = ($page * $count) - $count;\n \n $res = $this->db->select('site_comment.parent_id, site_comment.name, site_comment.text, site_comment.mark, site_comment.datetime')\n ->from('site_comment')\n ->where('site_comment.id_catalog', $objectid)\n ->where('site_comment.visible',1)\n ->order_by('datetime','DESC')\n //->limit($count, $page)\n ->get()\n ->result_array();\n\n foreach($res as $key => $value){\n if($value['parent_id'] > 0) unset($res[$key]);\n } unset($value);\n\n return $res;\n}", "function sql_query_registrosProcessamentoArquivo($sCampos = \"*\", $sWhere = null, $sGroupBy = null, $sOrderBy = null) {\n\n \t\n \t\n \t$sql = \"select case when quantidade_cgm = 1 \";\n $sql .= \" then true \";\n $sql .= \" else false \";\n $sql .= \" end as cnpj_valido, \";\n $sql .= \" * \";\n $sql .= \" from (select (select count(z01_numcgm) \";\n $sql .= \" from cgm \";\n $sql .= \" where z01_cgccpf =issarqsimplesreg.q23_cnpj) as quantidade_cgm, \";\n \t$sql .= !empty($sCampos) ? $sCampos : \"*\";\n $sql .= \" from issarqsimplesreg \";\n $sql .= \" inner join issarqsimples \";\n $sql .= \" on issarqsimples.q17_sequencial = issarqsimplesreg.q23_issarqsimples \";\n $sql .= \" left join issarqsimplesregissbase \";\n $sql .= \" on issarqsimplesregissbase.q134_issarqsimplesreg = issarqsimplesreg.q23_sequencial \";\n $sql .= \" inner join db_config \";\n $sql .= \" on db_config.codigo = issarqsimples.q17_instit \";\n \t$sql .= !empty($sWhere) ? \" where {$sWhere} \\n\" : \"\"; \n \t$sql .= !empty($sGroupBy) ? \" group by {$sGroupBy} \\n\" : \"\"; \n \t$sql .= !empty($sOrderBy) ? \" order by {$sOrderBy} \\n\" : \"\";\n $sql .= \" ) as x \";\n \treturn $sql;\n }", "function getDistinctVehicles($package_id){ \n\t$this->db->select('v.registration_number,v.id as vehicle_id');\n\t$this->db->distinct();\n\t$this->db->where('p.id',$package_id);\n\t$this->db->from('packages p');\n\t$this->db->join('package_itinerary pi','pi.package_id = p.id','left');\n\t$this->db->join('package_vehicles pv','pv.package_itinerary_id = pi.id','left');\n\t$this->db->join('vehicles v','pv.vehicle_id = v.id','left');\n\t$qry=$this->db->get(); \n\t\tif($qry->num_rows() > 0){\n\t\t\t\n\t\t\t$v_array= $qry->result_array();\n\t\t\tforeach ($v_array as $key=>$vehicle){\n\t\t\t\techo $vehicle['vehicle_id'];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getTheewaterskloofPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '115'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getKannalandPropertyListImagesForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = '110'\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getNominaEtau4($id,$idg)\n { \n $result=$this->adapter->query('select distinct c.idNom, c.id, a.idCon, \n case a.cCosEmp when 0 then a.idCcos\n when 1 then b.idCcos End as idCcos, \n case a.horasCal when 0 then 0 \n when 1 then (c.dias*'.$this->horasDias.') End as horas, 1, \n case when g.valor=2 then \n case when g.tipo = 1 then a.valor else 0 End\t\t\t\t \n when g.valor=1 then 0 \n End as dev, \n case when g.valor=2 then \n case when g.tipo = 2 then a.valor else 0 End\t\t\t\t \n when g.valor=1 then 0 \n\t\tEnd as ded, h.formula, c.dias, g.tipo , b.id as idEmp , g.idFor , a.diasLab, c.diasVac, a.vaca,\n case when ii.codigo is null then \"\" else ii.codigo end as nitTer \n from n_tip_auto_i a inner join a_empleados b on a.idTauto=b.idTau4 \n inner join n_nomina_e c on b.id=c.idEmp \n inner join n_nomina d on d.id=c.idNom\n inner join n_tip_auto_tn e on e.idTnom=d.idTnom \n inner join n_tip_calendario f on f.id=d.idCal\n inner join n_conceptos g on g.id=a.idCon\n inner join n_formulas h on h.id=g.idFor\n left join n_terceros_s i on i.id = g.idTer \n left join n_terceros ii on ii.id = i.idTer \n WHERE not exists (SELECT null from n_nomina_e_d \n where c.id=idInom and a.idCon=idConc and a.idCcos=idCcos and tipo=1 ) \n and d.estado=0 and b.idGrup='.$idg.' and c.idNom='.$id,Adapter::QUERY_MODE_EXECUTE);\n $datos=$result->toArray();\n return $datos; \n }", "function getallpicindb(&$pic_array, $startdir)\r\n{\r\n global $xoopsDB;\r\n\r\n $sql = \"SELECT filepath, filename \".\r\n \"FROM \".$xoopsDB->prefix(\"xcgal_pictures\").\" \".\r\n \"WHERE filepath LIKE '$startdir%'\";\r\n $result = $xoopsDB->query($sql);\r\n while ($row = $xoopsDB->fetchArray($result)) {\r\n $pic_file = $row['filepath'].$row['filename'];\r\n $pic_array[$pic_file]=1;\r\n }\r\n $xoopsDB->freeRecordSet($result);\r\n}", "public function listarPergunta($cod_pergunta){\n try{\n $pdo = conexao::getInstance();\n $listarpergunta=$pdo->prepare(\"SELECT q.nome as nomedoquestionario, q.detalhe descricao,d.titulo dimensao, GROUP_CONCAT(p.pergunta order by p.cod_pergunta ASC separator ';') as nomedapergunta,GROUP_CONCAT(p.cod_pergunta order by p.cod_pergunta ASC) as codigopergunta, pq.cod_questionario,pq.cod_pergunta from questionario as q, dimensao as d, pergunta p,pergunta_questionario as pq where pq.cod_questionario=q.cod_questionario AND pq.cod_pergunta=p.cod_pergunta AND pq.cod_questionario=:cod_questionario AND p.cod_dimensao=d.cod_dimensao group by p.cod_dimensao \n\n \");\n $listarpergunta->bindvalue(\":cod_questionario\",$cod_pergunta);\n $listarpergunta->execute();\n $perguntalist= array();\n while($perguntaObj=$listarpergunta->fetchObject(__CLASS__) ){\n $perguntalist[]=$perguntaObj;\n }\n return $perguntalist;\n } \n catch(PDOException $erro){\n echo $erro->getTraceAsString();\n }\n\n }", "function getResults(){\n\t\t//$nombre,$apellido,$ciudad,$provincia,$areas,$pais\n\t\t$db = $this->getDbo();\n\n\t\t$nombre = JFactory::getApplication()->input->getString('txtNombre');\n\t\t$apellido = JFactory::getApplication()->input->getString('txtApellido');\n\t\t$ciudad = JFactory::getApplication()->input->getString('txtCiudad');\n\t\t$provincia = JFactory::getApplication()->input->getString('txtProvincia');\n\t\t//$areas = JFactory::getApplication()->input->getString('txtProvincia');\n\t\t$pais = JFactory::getApplication()->input->getString('txtPais');\n\n\t\t$query = \"\n\t\t\tSELECT\n\t\t\t\tCONCAT(u.name, ' ', cp.zv_apellidopadre,' ', cp.zv_apellidomadre) AS name,\n\t\t\t\tu.name AS firstname,\n\t\t\t\tu.email AS email,\n\t\t\t\tcp.zv_apellidopadre AS apellidopadre,\n\t\t\t\tcp.zv_apellidomadre AS apellidomadre,\n\t\t\t\tCONCAT(cp.zv_apellidopadre,' ',cp.zv_apellidomadre) AS apellidos,\n\t\t\t\tcp.zv_telefono AS telefono,\n\t\t\t\tcp.zv_direccion AS direccion,\n\t\t\t\tcp.zv_direccionnumero AS numero,\n\t\t\t\tCONCAT(cp.zv_direccion,' ', cp.zv_direccionnumero) AS direccionCompleta,\n\t\t\t\tcp.zv_perfilacadmico AS perfil,\n\t\t\t\tIF(INSTR(cp.zv_autorizodivulgarmisdatosporalap,'instituc')>0,\n\t\t\t\t\tcp.zv_institucion ,-1)AS institucion\n\t\t\t\t,\n\t\t\t\tcp.zv_areainteres AS areas,\n\t\t\t\tcp.zv_direccionprovincia AS provincia,\n\t\t\t\tcp.user_id AS id\n\n\t\t\tFROM zv_zvcadastramento cp\n\t\t\tLEFT JOIN zv_users u ON cp.user_id = u.id\n\n\t\t\tWHERE\n\t\t\t\tcp.zv_socio = 1 AND\n\t\t\t\tu.name != 'administrator' AND\n\t\t\t\tIF(INSTR(cp.zv_autorizodivulgarmisdatosporalap,'nombre')>0,\n\t\t\t\t\tIF('' != '\".$nombre.\"',\n\t\t\t\t\t\tu.name like '%\".$nombre.\"%'\n\t\t\t\t\t,u.name like '%%')\n\t\t\t\t\tAND\n\t\t\t\t\tIF('' != '\".$apellido.\"',\n\t\t\t\t\t\tcp.zv_apellidomadre like '%\".$apellido.\"%'\n\t\t\t\t\t\t\t\tOR cp.zv_apellidopadre like '%\".$apellido.\"%'\n\t\t\t\t\t\t\t,cp.zv_apellidomadre like '%%'\n\t\t\t\t\t\t\t\tOR cp.zv_apellidopadre like '%%'\n\t\t\t\t\t\t\t)\n\n\t\t\t\t,'')\n\t\t\t\t\tAND\n\n\t\t\t\t\tIF('' != '\".$ciudad.\"',\n\t\t\t\t\t\tcp.zv_direccionciudad like '%\".$ciudad.\"%'\n\t\t\t\t\t,cp.zv_direccionciudad like '%%')\n\n\t\t\t\t\tAND\n\n\t\t\t\t\tIF('' != '\".$provincia.\"',\n\t\t\t\t\t\t\tcp.zv_direccionprovincia like '%\".$provincia.\"%'\n\t\t\t\t\t,cp.zv_direccionprovincia like '%%')\n\n\t\t\t\t\tAND\n\n\t\t\t\t\tIF('' != '\".$pais.\"',\n\t\t\t\t\t\t\tcp.zv_direccionpais like '%\".$pais.\"%'\n\t\t\t\t\t,cp.zv_direccionpais like '%%')\n\n\t\t\t\";\n\n\t\t/*\n\t\tforeach($areas as $area){\n\t\t\tforeach($fields as $field){\n\t\t\t\tif($field->fieldvalueid == $area){\n\t\t\t\t\t$query.=\n\t\t\t\t\t\t\"AND\n\t\t\t\t\t\t\tIF(INSTR(cp.zv_autorizodivulgarmisdatosporalap,'reas de inter') > 0,\n\t\t\t\t\t\t\t\tcp.zv_areainteres like'%\".$field->fieldtitle.\"%'\n\t\t\t\t\t\t\t,'')\";\n\t\t\t\t}\n\t\t\t}\n\t\t}*/\n\n\t\t$query .= \" ORDER BY name\";\n\n\n\t\t$users = $this->_getList($query);\n\n\t\treturn $users;\n\t}", "function consultaGrupos($idTutor)\n{\n $sql=\"SELECT DISTINCT gp.id_grupo as id ,\n gp.nombre_grupo as nombre ,\n gp.clave as clave,\n gp.id_escuela as \\\"idEscuela\\\",\n gp.id_empresa as \\\"idEmpresa\\\",\n gp.tipo_grupo as \\\"tipoGrupo\\\" \n FROM rel_curso_tutor r_c_t\n JOIN rel_curso_grupo r_c_g\n ON r_c_t.id_rel_curso_grupo = r_c_g.id_rel_curso_grupo\n JOIN grupo gp\n ON gp.id_grupo = r_c_g.id_grupo \n WHERE \tgp.status = 1\n AND r_c_t.id_tutor = \".$idTutor;\n \n $consultaGrupo= new Query(\"SG\");\n $consultaGrupo->sql=$sql;\n $resultado = $consultaGrupo->select(\"obj\");\n \n return $resultado;\n}", "function ambil_data()\n \t{\n \t\t$this->db->distinct();\n \t\t$this->db->select('bk.id_buku, s.nama_supplier, bk.judul, bk.tema, bk.penulis, bk.harga');\n \t\t$this->db->from('buku bk');\n \t\t$this->db->join('supplier s', 's.id_supplier = bk.id_supplier');\n \t\treturn $this->db->get($this->nama_table)->result();\n\n \t\t$data['buku'] = $this->db->order_by($this->id, $this->order);\n \t\treturn $this->db->get($this->nama_table)->result();\n \t}", "static public function getImagesfromCollectionID($theCollectionId){\n \n if ( ! Logger::isInitialized()){\n Logger::configure($_SERVER['DOCUMENT_ROOT'].'/log/LogConfig.xml');\n }\n $logger=Logger::getLogger(__CLASS__);\n $logger->trace(\"Enter\");\n $logger->trace(\"Get the images that belong to the collection id [ \" . $theCollectionId .\" ]\");\n $conn = new MySqlDAO(serverC, userC, pwdC, ddbbC);\n $conn->connect();\n \n if($conn->isConnected()){\n $logger->trace(\"The connection with the database was done with successfully\");\n \n $query = sprintf(\"select %s.%s as ImageId,\n %s.%s as CollectionId,\n %s.%s as CollectionName,\n %s.%s as ImageName,\n %s, %s from %s,%s,%s where\n %s.%s=%s.%s and %s.%s=%s.%s and\n %s.%s= %d order by ImageId desc\"\n ,TableImageC,TB_Image_IdC\n ,TableCollectionC,TB_Collection_IdCollectionC\n ,TableCollectionC,TB_Collection_CollectionNameC\n ,TableImageC,TB_Image_NameC\n ,TB_Image_PathC\n ,TB_Image_DescC\n ,TableImageC\n ,TableCollectionC\n ,TableImageCollectionC\n ,TableImageC,TB_Image_IdC\n ,TableImageCollectionC,TB_ImageCollection_idImageC\n ,TableImageCollectionC,TB_ImageCollection_idCollectionC\n ,TableCollectionC, TB_Collection_IdCollectionC\n ,TableCollectionC, TB_Collection_IdCollectionC\n ,$theCollectionId);\n \n $logger->trace(\"Execute query [ \" . $query . \" ]\");\n \n $result = $conn->query($query);\n if ($result != null){\n $rows;\n $numRows = count($result);\n $logger->trace(\"The query has [ \" . $numRows .\" ] rows\");\n for ($idx = 0;$idx < $numRows; $idx++){\n $rows[$idx] = new TB_IMAGE_COLLECTION($result[$idx][\"ImageId\"],\n $result[$idx][\"CollectionId\"],\n $result[$idx][\"CollectionName\"],\n $result[$idx][TB_Image_PathC],\n $result[$idx][\"ImageName\"],\n $result[$idx][TB_Image_DescC]);\n }\n }\n $conn->closeConnection();\n }else{\n \n $logger->error(\"An error was produced in the connection [ \" .\n $conn->getConnectError() . \" ]\");\n \n }\n $logger->trace(\"Exit\");\n return new DBIterator($rows);\n \n }" ]
[ "0.8179744", "0.7866503", "0.7787507", "0.6609547", "0.65295434", "0.64844096", "0.6406495", "0.6335919", "0.6269723", "0.62049764", "0.613909", "0.61388963", "0.61191493", "0.6097447", "0.6045244", "0.6044075", "0.6032203", "0.6009091", "0.5836144", "0.57888514", "0.5788476", "0.5785636", "0.5761534", "0.57545817", "0.57507896", "0.57463336", "0.5745862", "0.573118", "0.57067513", "0.5701413", "0.56981814", "0.56956947", "0.5680531", "0.5677362", "0.5655399", "0.5653827", "0.5624508", "0.5618943", "0.56169075", "0.56163985", "0.56150895", "0.56108856", "0.55925363", "0.5582447", "0.5572209", "0.5569562", "0.5566185", "0.5564727", "0.555318", "0.55519754", "0.55504537", "0.5543412", "0.55413175", "0.5530171", "0.5528081", "0.55221397", "0.55192167", "0.5510051", "0.55086595", "0.55017406", "0.5498693", "0.54985803", "0.54944116", "0.54865324", "0.5484814", "0.5479737", "0.54786503", "0.547559", "0.5475141", "0.546937", "0.5465947", "0.5459512", "0.5458181", "0.54574096", "0.54561645", "0.5453605", "0.545012", "0.544421", "0.544308", "0.5441864", "0.54410577", "0.5438537", "0.5437921", "0.54364467", "0.5435019", "0.5434477", "0.543015", "0.54246813", "0.5418111", "0.5414878", "0.54129446", "0.540824", "0.5405073", "0.5401838", "0.54013824", "0.5397912", "0.53954977", "0.53950113", "0.5391893", "0.5391874" ]
0.70012915
3
/ $this>db>select('package.,package.id as packid,location.,address.,cities.,file.'); $this>db>from('package'); $this>db>join('cities','cities.c_id = package.location','left'); $this>db>join('address','address.city = cities.c_id'); $this>db>join('location','location.locationaddress = address.id'); $this>db>join('file','file.id = package.thumbnailimage'); $this>db>join('packageimage','packageimage.package = package.id','left'); $this>db>join('file','file.id = packageimage.file'); $this>db>where('package.id',$dis); $query = $this>db>get(); $row = $query>result_array();// echo $this>db>last_query();exit; return $row;
function get_all_package_details($dis) { $query = $this->db->query("SELECT PACKAGE.*, group_concat(DISTINCT PACKFILE.imagename order by PACKFILE.imagename separator ',' ) AS packageImages, group_concat(DISTINCT LOCFILE.imagepath order by LOCFILE.imagepath separator ',' ) AS locationImages, group_concat(DISTINCT LOCAMENITIES.name order by LOCAMENITIES.name separator ',' ) AS locstionamineties, group_concat(DISTINCT PACKAMENITIES.name order by PACKAMENITIES.name separator ',' ) AS packaageamineties FROM `package` AS PACKAGE LEFT JOIN packageimage AS PACKIMAGE ON PACKIMAGE.package = PACKAGE.id LEFT JOIN file AS PACKFILE ON PACKFILE.id = PACKIMAGE.file LEFT JOIN location AS LOC ON LOC.id=PACKAGE.location LEFT JOIN address AS ADDRESS ON ADDRESS.id = LOC.locationaddress LEFT JOIN locationimage AS LOCIMAGE ON LOCIMAGE.location = LOC.id LEFT JOIN file AS LOCFILE ON LOCFILE.id = LOCIMAGE.id LEFT JOIN locationamenities AS LOCAMENITIESMAP ON LOCAMENITIESMAP.location = LOC.id LEFT JOIN amenities AS LOCAMENITIES ON LOCAMENITIES.id = LOCAMENITIESMAP.amenities LEFT JOIN packageamenities AS PACKMENITIESMAP ON PACKMENITIESMAP.package = PACKAGE.id LEFT JOIN amenities AS PACKAMENITIES ON PACKAMENITIES.id = PACKMENITIESMAP.amenities WHERE PACKAGE.id =$dis"); return $query->result_array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_location_package_detail()\n {\n $this->db->select('package.*,package.id as packid,location.*,address.*,cities.*,file.* ');\n $this->db->from('package');\n $this->db->join('cities', 'cities.c_id = package.location');\n $this->db->join('address', 'address.city = cities.c_id');\n $this->db->join('location', 'address.id = location.locationaddress');\n // $this->db->join('packageimage','packageimage.package = package.id');\n $this->db->join('file', 'file.id = package.thumbnailimage');\n // $this->db->where('cities.c_id', $dis);\n $query = $this->db->get();\n $row = $query->result_array(); // echo $this->db->last_query();exit;\n return $row;\n }", "function get_package_details($dis)\n {\n $this->db->select('package.*,package.id as packid,location.*,address.*,cities.*,file.* ');\n $this->db->from('package');\n $this->db->join('cities', 'cities.c_id = package.location');\n $this->db->join('address', 'address.city = cities.c_id');\n $this->db->join('location', 'address.id = location.locationaddress');\n // $this->db->join('packageimage','packageimage.package = package.id');\n $this->db->join('file', 'file.id = package.thumbnailimage');\n $this->db->where('cities.c_id', $dis);\n $query = $this->db->get();\n $row = $query->result_array(); // echo $this->db->last_query();exit;\n return $row;\n }", "function get_all_package_details_view($dis)\n {\n $query = $this->db->query(\"SELECT \n PACKAGE.*, group_concat(DISTINCT PACKFILE.imagename order by PACKFILE.imagename separator ',' ) AS packageImages,\n group_concat(DISTINCT LOCFILE.imagepath order by LOCFILE.imagepath separator ',' ) AS locationImages,\n group_concat(DISTINCT LOCAMENITIES.name order by LOCAMENITIES.name separator ',' ) AS locstionamineties, \n group_concat(DISTINCT PACKAMENITIES.name order by PACKAMENITIES.name separator ',' ) AS packaageamineties \n FROM `package` AS PACKAGE \n LEFT JOIN packageimage AS PACKIMAGE ON PACKIMAGE.package = PACKAGE.id \n LEFT JOIN file AS PACKFILE ON PACKFILE.id = PACKIMAGE.file \n LEFT JOIN location AS LOC ON LOC.id=PACKAGE.location \n LEFT JOIN address AS ADDRESS ON ADDRESS.id = LOC.locationaddress \n LEFT JOIN locationimage AS LOCIMAGE ON LOCIMAGE.location = LOC.id \n LEFT JOIN file AS LOCFILE ON LOCFILE.id = LOCIMAGE.id \n LEFT JOIN locationamenities AS LOCAMENITIESMAP ON LOCAMENITIESMAP.location = LOC.id LEFT JOIN amenities AS LOCAMENITIES ON LOCAMENITIES.id = LOCAMENITIESMAP.amenities LEFT JOIN packageamenities AS PACKMENITIESMAP ON PACKMENITIESMAP.package = PACKAGE.id \n LEFT JOIN amenities AS PACKAMENITIES ON PACKAMENITIES.id = PACKMENITIESMAP.amenities where PACKAGE.id=$dis\");\n return $query->result_array();\n }", "function get_all_package_details_admin($dis)\n {\n $query = $this->db->query(\"SELECT \n PACKAGE.*,LOC.id AS locationId, PACKAGE.id as ped, group_concat(DISTINCT PACKFILE.imagename order by PACKFILE.imagename separator ',' ) AS packageImages,\n group_concat(DISTINCT LOCFILE.imagepath order by LOCFILE.imagepath separator ',' ) AS locationImages,\n group_concat(DISTINCT LOCAMENITIES.name order by LOCAMENITIES.name separator ',' ) AS locstionamineties, \n group_concat(DISTINCT PACKAMENITIES.name order by PACKAMENITIES.name separator ',' ) AS packaageamineties \n FROM `package` AS PACKAGE \n LEFT JOIN packageimage AS PACKIMAGE ON PACKIMAGE.package = PACKAGE.id \n LEFT JOIN file AS PACKFILE ON PACKFILE.id = PACKIMAGE.file \n LEFT JOIN location AS LOC ON LOC.id=PACKAGE.location \n LEFT JOIN address AS ADDRESS ON ADDRESS.id = LOC.locationaddress \n LEFT JOIN locationimage AS LOCIMAGE ON LOCIMAGE.location = LOC.id \n LEFT JOIN file AS LOCFILE ON LOCFILE.id = LOCIMAGE.id \n LEFT JOIN locationamenities AS LOCAMENITIESMAP ON LOCAMENITIESMAP.location = LOC.id LEFT JOIN amenities AS LOCAMENITIES ON LOCAMENITIES.id = LOCAMENITIESMAP.amenities LEFT JOIN packageamenities AS PACKMENITIESMAP ON PACKMENITIESMAP.package = PACKAGE.id \n LEFT JOIN amenities AS PACKAMENITIES ON PACKAMENITIES.id = PACKMENITIESMAP.amenities WHERE PACKAGE.id = $dis\");\n return $query->result_array();\n }", "public function cpJoin() {\n $sql=\"select packages.packageName, prices.id, prices.price, products.productName, products.cid, prices.productID, prices.areaID, prices.packageID \"\n . \"from prices\"\n . \" inner join packages on packages.packageID=prices.packageID\"\n . \" inner join products on prices.productID=products.productID where products.cid='9'\";\n $sth=$this->dbh->prepare($sql);\n \n $sth->execute();\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n}", "public function getJobp($id=''){\t\t\n $this->db->select(\"jobspreview.*,package.name as package_name,package.price as package_price,industry.name as industry_name\");\n $this->db->join(\"package\",\"jobspreview.package_id=package.id\",\"left\"); \n $this->db->join(\"industry\",\"jobspreview.industry_id=industry.id\",\"left\"); \n $this->db->where(\"jobspreview.id\",$id); \n $result = $this->db->get('jobspreview')->result();\n //echo $this->db->last_query(); die(); \n return $result;\t\t\n}", "function join_product_table(){\n global $db;\n $sql =\" SELECT p.id,p.name,p.keywords,p.quantity,p.url,p.buy_price,p.sale_price,p.media_id,p.date,c.name\";\n $sql .=\" AS categorie,m.file_name AS image\";\n $sql .=\" FROM products p\";\n $sql .=\" LEFT JOIN categories c ON c.id = p.categorie_id\";\n $sql .=\" LEFT JOIN media m ON m.id = p.media_id\";\n $sql .=\" ORDER BY p.id ASC\";\n return find_by_sql($sql);\n\n }", "function getPackage(){\n\t\t $query = \"select package.id,package.pkg_cat_id,package.date_created,package.date_updated,package.icon_image,package.package_title,package.package_price,package.number_of_qty,package.slider_desc1,package.slider_image1,packages_category.packages_category_name from package inner join packages_category on package.pkg_cat_id = packages_category.id \";\n\t\t $result = mysql_query($query);\n\t\t if($result){\n\t\t\t$data = array();\n\t\t\twhile($row=mysql_fetch_assoc($result)){\n\t\t\t\t$row['icon_image'] = $row['icon_image'] !==\"\"? $this->Check_exists_img($row['icon_image']) : \"dist/img/boxed-bg.jpg\";\n\t\t\t\t$row['slider_image1'] = $row['slider_image1'] !==\"\"? $this->Check_exists_img($row['slider_image1']) : \"dist/img/boxed-bg.jpg\";\n\t\t\t\t\n\t\t\t\tarray_push($data,$row);\n\t\t\t }\n\t\t\t return $data;\n\t\t }else{\n\t\t\tdie(\"error in mysql query\" . mysql_error());\n\t\t }\n\t\t}", "function customerPackage() {\n $sql = \"SELECT customers.package_id, customers.customer_id, customers.fname, customers.lname, customers.phone, customers.email, customers.state, packages.name\n FROM packages INNER JOIN customers ON packages.package_id = customers.package_id\";\n\n //Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //Execute\n $statement->execute();\n\n //Get the results\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "function getallproducts($warehouseid){\n \n $result = $this->db->query(\"SELECT a.*, \n b.id AS productid, b.`name` AS productname, b.`main_image` AS productimage, \n b.`price` AS product_price, b.`tax` AS product_tax, b.`description` AS product_description, b.`move_product_id` AS productuniqueid_forimages,\n c.`name` AS cat_name, c.`image` AS cat_image, d.`name` AS subcat_name, d.`image` AS subcat_image\n FROM warehouse_products a LEFT JOIN products b ON a.product=b.`id` LEFT JOIN category c ON b.`category_id` = c.`category_id` LEFT JOIN category d \n ON b.`sub_category_id` = d.`category_id` WHERE a.`warehouse` = \".$warehouseid.\" ORDER BY c.`name`, d.`name`\")->result();\n return $result;\n \n }", "public function get_locations_md($id = FALSE)\n{\n if ($id === FALSE)\n { //celle qui marche ..\n // $query = $this->db->get('locations');\n // return $query->result_array();\n $this->db->select('*'); \n $this->db->from('locations');\n $this->db->join ('carsToRent','carsToRent.ctr_id = locations.ctr_id');\n $this->db->join ('carDetails','carDetails.cd_id = carsToRent.cd_id');\n $this->db->join ('locationStatement','locationStatement.ls_id = locations.ls_id');\n $query = $this->db->get();\n return $query->result_array();\n \n }\n else {\n // $query = $this->db->get_where('locations', array('ctr_id' => $id));\n $this->db->select('*')\n ->from('locations')\n ->where('ctr_id',$id)\n ->join ('carDetails','carDetails.cd_id = locations.cd_id');\n $query = $this->db->get();\n return $query->row_array();\n }\n}", "public function getCommondata()\n {\n $select = $this->select()\n // ->setIntegrityCheck(false)\n ->from(array('album' => 'album'),array('Id','name_n'))\n ->join('album_det','album_det.Id = album.Id',array('album_det.Id'));\n // $result=$this->fetchAll($hhh);\n $result = $this->fetchAll($select);\n \n echo \"<pre>\";\n print_r($result);exit;\n return $result;\n\n }", "public function consultaOfertas(){\n //join Tabla2 T2 ON T1.PK = T2.FK\n \n //select * from Tabla1 T1, Tabla2 T2\n //WHERE T!.PK = T2.FK\n \n \n \n //$this->db->select(\"*\"); \n //$this->db->from(\"productos\");//nombrebase\n //$this->db->join(\"carrera\",\"alumno.idCarrera = carrera.idCarrera\");\n \n //$sql = $this->db->get();\n //return $sql->result();\n }", "public function listProductsPack($params)\n{\n // $prdId = $this->db->real_escape_string($params);\n // $qry = \"SELECT pr.prd_id, pr.prd_sku, pr.prd_name, pr.prd_price, pk.prd_parent \n // FROM ctt_products_packages AS pk\n // INNER JOIN ctt_products AS pr ON pr.prd_id = pk.prd_id\n // WHERE pk.prd_parent = $prdId AND prd_status =1;\";\n // return $this->db->query($qry);\n}", "function get_mapping() {\n\n\n $query = $this->db->query('SELECT\n A.map_id\n ,C1.stage_title AS place_name\n ,C2.stage_title AS dress_name\n ,C3.stage_title AS crown_name\n ,C4.stage_title AS stage_name\n ,C5.stage_title AS props_name\n ,B.character_name AS char_name \n ,A.image_path \nFROM mapping AS A\nINNER JOIN stage AS C1\n ON A.place_id = C1.id\nINNER JOIN stage AS C2\n ON A.dress_id = C2.id\n\n INNER JOIN stage AS C3\n ON A.crown_id = C3.id\n\n INNER JOIN stage AS C4\n ON A.stage_id = C4.id\n \n INNER JOIN stage AS C5\n ON A.props_id = C5.id\n\nINNER JOIN napoleon_characters AS B ON A.character_id = B.character_id');\n\n// $this->db->where('id', $intid);\n// $query = $this->db->get();\n// echo \"<pre>\";\n// print_r($query->result_array());\n// die;\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n else {\n return array();\n }\n }", "function getRows($params = array()){\r\r\n $this->db->select('a.*, b.product_name,b.cat_name,b.pro_id as product_code,b.main_img,b.price');\r\r\n $this->db->from($this->wishlistTbl.\" a\");\r\r\n $this->db->join('products b', 'b.id=a.product_id', 'left');\r\r\n $this->db->where('a.user_id',$params);\r\r\n // echo $this->db->last_query();\r\r\n //$cnt = $this->db->count_all_results();\r\r\n $query = $this->db->get();\r\r\n $result = ($query->num_rows() > 0)?$query->result_array():false;\r\r\n\r\r\n //return fetched data\r\r\n return $result;\r\r\n }", "function get_it($npm){\n $this->db->select('mahasiswa.*,prodi.nama_prodi');\n $this->db->from('mahasiswa');\n $this->db->where('npm', $npm);\n $this->db->join('prodi', 'prodi.id_prodi = mahasiswa.id_prodi', 'left');\n $this->db->order_by('id_mahasiswa', 'desc');\n $query = $this->db->get();\n return $query->row();\n }", "public function getAllProduct(){\n $this->db->select('p.id,p.title,p.image,c.category');\n $this->db->from('product p, category c');\n $this->db->where('p.status','t');\n $this->db->where('p.category_id=c.id');\n $this->db->order_by(\"id\", \"desc\");\n $query = $this->db->get();\n return $query->result(); \n }", "function getallepics()\n {\n //$allepics = \"SELECT * from epics\";\n $allepics= \"SELECT e.*,staff.*,epics_statuses.name as epicsname,team.name as teamname\n FROM epics AS e\n LEFT JOIN epics_statuses AS epics_statuses ON epics_statuses.id = e.e_status_id\n LEFT JOIN team AS team ON team.id = e.team_id\n LEFT JOIN staff AS staff ON staff.staff_id = e.e_owner\"; \n $allepicsresult = $this->ds->select($allepics); \n //print_r($myepicsresult);\n return $allepicsresult;\n }", "public function fetch_products() {\n $this->db->select('product.id,product.name,product.price,product.status,(SELECT product_images.image_name FROM product_images WHERE product_images.product_id = product.id ORDER BY id ASC LIMIT 1) AS pr_img');\n $this->db->from('product');\n $this->db->where('is_featured', '1');\n $r = $this->db->get();\n\n return $r->result_array();\n }", "function getJD($id){\n\t $data=array();\n\t\t $this->db->select('filepath,filename');\n\t\t $this->db->from('pof_attachment');\n\t\t $this->db->where('pof_id', $id);\n\t\t $Q = $this->db->get();\n\t\t if ($Q->num_rows() > 0){\n\t foreach ($Q->result_array() as $row)\n\t\t {\n\t $data=$row;\n\t }\n\t }\n\t $Q->free_result(); \n\t return $data; \n\t\t }", "function immagini_get($id_imm=\"\"){\n $db = new db(DB_USER,DB_PASSWORD,DB_NAME,DB_HOST);\n\t\n\t$q_foto=\"SELECT immagine.* FROM imm_img JOIN immagine on immagine.id_img=imm_img.id_img WHERE imm_img.id_imm =$id_imm ORDER BY `ordine` ASC\";\n \n\t$r_foto=$db->query($q_foto);\n while($row_foto = mysql_fetch_assoc($r_foto))\n {\n $rows_foto[] = $row_foto;\n }\n \n return $rows_foto;\n\n \n}", "function get_joinFG($data,$key=FALSE,$column=FALSE){ //Zulmi Adi Rizki 23 Juli 2013\n\t\t\n\t\tif($key == TRUE){\n\t\t\tif(!is_array($key)){\n\t\t\t\t$this->db->where($key);\n\t\t\t} else {\n\t\t\t\t$key = array_map('htmlentities', $key);\n\t\t\t\t$this->db->where($key);\n\t\t\t}\n\t\t}\n\t\t$this->db->select($column == FALSE ? \"*\" : $column)->from($this->table_name);\n\t\tforeach($data as $row){\n\t\t\tif($row[\"join_type\"] != NULL){\n\t\t\t\t$this->db->join($row[\"join_table\"],$row[\"table\"].\".\".$row[\"join_key\"].\"=\".$row[\"join_table\"].\".\".$row[\"join_key\"], $row[\"join_type\"]);\n\t\t\t} else {\n\t\t\t\t$this->db->join($row[\"join_table\"],$row[\"table\"].\".\".$row[\"join_key\"].\"=\".$row[\"join_table\"].\".\".$row[\"join_key\"]);\n\t\t\t}\n\t\t}\n\t\t$this->flexigrid->build_query();\n\t\t$return['records'] = $this->db->get();\n\t\t\n\t\tif($key == TRUE){\n\t\t\tif(!is_array($key)){\n\t\t\t\t$this->db->where($key);\n\t\t\t} else {\n\t\t\t\t$key = array_map('htmlentities', $key);\n\t\t\t\t$this->db->where($key);\n\t\t\t}\n\t\t}\n\t\t$this->db->select($column == FALSE ? \"*\" : $column)->from($this->table_name);\n\t\tforeach($data as $row){\n\t\t\tif($row[\"join_type\"] != NULL){\n\t\t\t\t$this->db->join($row[\"join_table\"],$row[\"table\"].\".\".$row[\"join_key\"].\"=\".$row[\"join_table\"].\".\".$row[\"join_key\"], $row[\"join_type\"]);\n\t\t\t} else {\n\t\t\t\t$this->db->join($row[\"join_table\"],$row[\"table\"].\".\".$row[\"join_key\"].\"=\".$row[\"join_table\"].\".\".$row[\"join_key\"]);\n\t\t\t}\n\t\t}\n\t\t$this->flexigrid->build_query(FALSE);\n\t\t$return['record_count'] = $this->db->count_all_results();\n\t\t\n\t\treturn $return;\n\t}", "function get_all()\n {\n $this->db->select('products.*, company_category.category');\n $this->db->join('company_category', 'company_category.id = products.cat_id');\n return $this->db->get($this->table)->result();\n }", "function getByIdPinjam($id){\n // $this->db->where('id_peminjaman',$id);\n // $query = $this->db->get('peminjaman');\n $query = $this->db->query(\"SELECT * FROM `peminjaman` LEFT JOIN prasarana ON peminjaman.id_prasarana = prasarana.id_prasarana LEFT JOIN sarana ON sarana.id_sarana = peminjaman.id_sarana where peminjaman.id_peminjaman = '$id'\");\n return $query->result_array(); //returns result in array forms(this is not necessary btw, let me know if u need only one line, or change \"$query->result_array()\" to \"$query->row()\")\n}", "function myjoin()\n {\n $this->db\n ->select('puestos.nombre AS pnombre')\n ->select('puestos.id AS pid')\n ->select('entidades.nombre AS enombre')\n ->select('entidades.id AS eid')\n ->select('departamentos.nombre AS dnombre')\n ->select('departamentos.id AS did')\n ->select('ubicaciones.nombre AS unombre')\n ->select('ubicaciones.id AS uid')\n ->join ('puestos', 'users.puesto = puestos.id' , 'left')\n ->join ('entidades', 'users.entidad = entidades.id' , 'left')\n ->join('departamentos', 'users.departamento = departamentos.id' , 'left')\n ->join('ubicaciones', 'users.ubicaciontrabajo = ubicaciones.id' , 'left');\n //$this->db->where('users.id',7);\n return $datosuser = $this->db->get('users')->result_array();\n }", "public function pagadaall(){\n$sql = $this->db->query(\"SELECT pago_factura.*, facturas.id_factura FROM pago_factura INNER JOIN facturas ON pago_factura.factura_id = facturas.id\");\nreturn $sql;\n}", "public function getAllProduct(){\n\t\t//query for get all data from tbl_product combinning with tbl_category(catName) and tbl_brand(brandName) using INNER JOIN\n\t\t$sql = \"SELECT tbl_product.*, tbl_category.catName, tbl_brand.brandName\n\t\t\t\tFROM tbl_product\n\t\t\t\tINNER JOIN tbl_category\n\t\t\t\tON tbl_product.catId = tbl_category.catId\n\t\t\t\tINNER JOIN tbl_brand\n\t\t\t\tON tbl_product.brandId = tbl_brand.brandId\n\t\t\t\tORDER BY tbl_product.pid DESC \";\n\t\t//Same Query using Alias(giving a temporary name to a table or Column)\n\t\t/*$sql = \"SELECT p.*, c.catName, b.brandName\n\t\t\t\tFROM tbl_product AS p, tbl_category AS c, tbl_brand AS b\n\t\t\t\tWHERE p.catId = c.catId AND p.brandId = b.brandId\n\t\t\t\tORDER BY p.pid DESC \";*/\n\t\t$result = $this->db->select($sql);\n\t\tif ($result) {\n\t\t\treturn $result;\n\t\t}else{\n\t\t\t$msg = \"<span class='error'>Product not found !.</span>\";\n\t\t\treturn $msg;\n\t\t}\n\t}", "function operasiJoin3(){\n\t\t$date = date('Y-m-d');\n\t\t$query = $this->db->query(\"SELECT k.id_kondisi, k .kondisi, k.id_alat, a.id_kategori, k.tanggal, k.keterangan AS keterangan_kondisi , a.nama_alat FROM kondisi k INNER JOIN alat a ON k.id_alat = a.id_alat WHERE k.tanggal='$date' GROUP BY a.id_alat\"); \n\t\treturn $query->result();\n\t}", "function GetChannelByIdMainPackage($id_package, $category_id) {\n \n \n $data= $this->db\n ->select('\n channel.*,\n package_channel.id_package\n ')\n ->join('channel','channel.id_channel = package_channel.id_channel','left')\n //->join('channel_category', 'channel_category.id_channel_category = channel.id_channel_category', 'left')\n ->where('package_channel.id_package',$id_package)\n ->where('channel.is_delete',0)\n ->where('channel.id_channel_category', $category_id)\n //->order_by('channel_category.position', 'asc')\n //->order_by('channel_category.id_channel_category','asc')\n ->order_by('channel.position_in_type','asc')\n ->order_by('channel.id_channel','desc')\n ->get('package_channel')\n ->result_array();\n \n \n return $data;\n }", "function ambil_data()\n \t{\n \t\t$this->db->distinct();\n \t\t$this->db->select('bk.id_buku, s.nama_supplier, bk.judul, bk.tema, bk.penulis, bk.harga');\n \t\t$this->db->from('buku bk');\n \t\t$this->db->join('supplier s', 's.id_supplier = bk.id_supplier');\n \t\treturn $this->db->get($this->nama_table)->result();\n\n \t\t$data['buku'] = $this->db->order_by($this->id, $this->order);\n \t\treturn $this->db->get($this->nama_table)->result();\n \t}", "function get_all_with_asso_car_detail()\n {\n try{\n $this->db->select('*');\n $this->db->from('car_detail a ' );\n $this->db->join('car_type b', 'b.type_id=a. type_id','left');\n $this->db->join('car_brand c', 'c.brand_id=a. brand_id','left');\n $this->db->join('car_version d', 'd.ver_id=a. ver_id','left');\n $query = $this->db->get(); \n if($query->num_rows() != 0){\n return $query->result_array();\n }else{\n return false;\n }\n } catch (Exception $ex) {\n throw new Exception('Car_detail_model model : Error in get_all_with_asso_car_detail function - ' . $ex);\n } \n }", "public function moinhat(){\n $this->db->select($this->column_bosuutap);\n $this->db->from(\"$this->table\");\n $this->db->join($this->table_trans, \"$this->table.id = $this->table_trans.id\");\n $this->db->where(\"$this->table_trans.language_code\", \"vi\");\n $this->db->order_by(\"$this->table.id\", 'DESC');\n $query = $this->db->get();//var_dump($this->db->last_query()); exit();\n return $query->result();\n }", "function getPackageByID($package_id){\n\t\t $query = \"select * from package where id = $package_id\";\n\t\t $result = mysql_query($query);\n\t\t if($result){\n\t\t\t$row = mysql_fetch_assoc($result);\n\t\t\t$row['icon_image'] = $row['icon_image'] !==\"\"? $this->Check_exists_img($row['icon_image']) : \"dist/img/boxed-bg.jpg\";\n\t\t\t$row['slider_image1'] = $row['slider_image1'] !==\"\"? $this->Check_exists_img($row['slider_image1']) : \"img/boxed-bg.jpg\";\n\t\t\t\n\t\t\treturn $row;\n\t\t }\n\t\t}", "public function query_employee(){\n $this->db->select('*');\n $this->db->from('hr_pic_center');\n $this->db->join('hr_section','hr_section.sec_id = hr_pic_center.pic_sec_id');\n $this->db->join('hr_position','hr_position.position_id = hr_pic_center.pic_position_id');\n $this->db->where('hr_pic_center.pic_upd','00');\n\n $employee = $this->db->get();\n return $employee;\n }", "public function getRows($id = ''){ \r\n $this->db->select(\"*, (SELECT file_name FROM \".$this->imgTbl.\" WHERE gallery_id = \".$this->galleryTbl.\".id ORDER BY id DESC LIMIT 1) as default_image\"); \r\n $this->db->from($this->galleryTbl); \r\n if($id){ \r\n $this->db->where('id', $id); \r\n $query = $this->db->get(); \r\n $result = ($query->num_rows() > 0)?$query->row_array():array(); \r\n \r\n if(!empty($result)){ \r\n $this->db->select('*'); \r\n $this->db->from($this->imgTbl); \r\n $this->db->where('gallery_id', $result['id']); \r\n $this->db->order_by('id', 'desc'); \r\n $query = $this->db->get(); \r\n $result2 = ($query->num_rows() > 0)?$query->result_array():array(); \r\n $result['images'] = $result2; \r\n } \r\n }else{ \r\n $this->db->order_by('id', 'desc'); \r\n $query = $this->db->get(); \r\n $result = ($query->num_rows() > 0)?$query->result_array():array(); \r\n } \r\n \r\n // return fetched data \r\n return !empty($result)?$result:false; \r\n }", "public function getDetalles()\n {\n $sql = \"select z.id,z.nombre, z.identificacion, z.estado_excluido, y.descripcion, w.categoria , (SELECT a.monto FROM appexamenisw2.categorias a,\n appexamenisw2.beneficios e, appexamenisw2.estudiantes b, appexamenisw2.beneficio__estudiantes c\n where a.descripcion = 'aeo'\n and b.id = c.estudiante_id\n and e.id = c.beneficio_id\n and a.id = e.categoria_id\n and b.id = z.id) as 'aeo' ,\n (SELECT a.monto FROM appexamenisw2.categorias a,\n appexamenisw2.beneficios e, appexamenisw2.estudiantes b, appexamenisw2.beneficio__estudiantes c\n where a.descripcion = 'alim'\n and b.id = c.estudiante_id\n and e.id = c.beneficio_id\n and a.id = e.categoria_id\n and b.id = z.id) as alim,\n (SELECT a.monto FROM appexamenisw2.categorias a,\n appexamenisw2.beneficios e, appexamenisw2.estudiantes b, appexamenisw2.beneficio__estudiantes c\n where a.descripcion = 'pare'\n and b.id = c.estudiante_id\n and e.id = c.beneficio_id\n and a.id = e.categoria_id\n and b.id = z.id) as pare\n from appexamenisw2.estudiantes z, appexamenisw2.beneficios y, appexamenisw2.categorias w,\n appexamenisw2.beneficio__estudiantes v\n where z.id = v.estudiante_id\n and y.id = v.beneficio_id\n and w.id = y.categoria_id\n group by z.id,z.nombre, z.identificacion, z.id, z.estado_excluido, y.descripcion,w.categoria\n order by z.id;\";\n\n $arrayDetalles = DB::connection('mysql')->select($sql);\n $ab = array();\n $ab = $arrayDetalles;\n foreach($ab as $t){\n $t->aeo = Crypt::decrypt($t->aeo);\n $t->alim = Crypt::decrypt($t->alim);\n $t->pare = Crypt::decrypt($t->pare);\n //$t->categoria = Crypt::decrypt($t->categoria);\n //$t->monto = Crypt::decrypt($t->monto);\n //return $t->monto;\n }\n return json_encode($ab);\n }", "public function get_single_package_detail($package_id) {\n $this->db->select('*');\n $this->db->from('business_programs');\n $this->db->where('id', $package_id);\n $query = $this->db->get();\n $query_result = $query->result();\n $package_details = array();\n if (!empty($query_result)) {\n $package_details['package'] = $query_result[0];\n } else {\n $package_details['package'] = $query_result;\n }\n $this->db->select('business_services.*,business_services_details.*');\n $this->db->from('business_services');\n $this->db->join('business_services_details', 'business_services.id = business_services_details.service_id');\n $this->db->where('business_services.program_id', $package_details['package']->id);\n $query1 = $this->db->get();\n $query_result1 = $query1->result();\n\n if (!empty($query_result1)) {\n $package_details['service'] = $query_result1;\n }\n return $package_details;\n }", "function get_by_id($id)\n {\n /*$this->db->where($this->id, $id);*/\n $this->db->where('persediaan.id_persediaan', $id);\n $this->db->join('puskesmas', 'puskesmas.id_puskesmas=persediaan.id_puskesmas');\n $this->db->join('obat', 'obat.kode=persediaan.kode');\n $this->db->select('persediaan.id_persediaan');\n $this->db->select('nama_puskesmas');\n $this->db->select('kode');\n $this->db->select('nama_obat');\n $this->db->select('stok_awal');\n return $this->db->get($this->table)->row();\n }", "function Select_Peminjaman()\n \t{\n \t\t$this->db->distinct();\n \t\t$this->db->select('pg.id_kir, b.nama_barang, b.size, b.jenis, pg.stok , l.store, l.lokasi, l.alamat');\n \t\t$this->db->from('pengirim pg');\n \t\t$this->db->join('barang b', 'b.id = pg.id');\n \t\t$this->db->join('lokasi l', 'l.id_lok = pg.id_lok');\n \t\treturn $this->db->get($this->nama_table)->result();\n\n\n \t\t//$data['peminjaman'] = $this->db->order_by($this->id, $this->order);\n \t\t//return $this->db->get($this->nama_table)->result();\n \t}", "function get_by_id($id) {\n $this->db->join('tbl_ijin','tbl_out.id_ijin=tbl_ijin.id_ijin');\n $this->db->join('tbl_perusahaan','tbl_out.id_perusahaan=tbl_perusahaan.id_perusahaan');\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_all_prodi()\n {\n $this->db->join('jurusan', 'jurusan.id_jurusan = prodi.fk_id_jurusan');\n $this->db->order_by('id_prodi', 'desc');\n return $this->db->get('prodi')->result_array();\n }", "public function getData()\n {\n\n\n $query = $this->db->from('job_ads')\n ->join('cities', 'cities.cityId=job_ads.cityId')\n ->join('paper', 'paper.paperId=job_ads.paperId')\n ->join('departments', 'departments.depttId=job_ads.depttId')\n ->join('categories', 'categories.catId=job_ads.catId')\n ->get();\n return $query->result();\n }", "function select($id){\r\n\t\t$query = \"SELECT *\";\r\n\t\t$query .= \" FROM db_equipment_gen INNER JOIN db_group ON equipment_id_link_group=group_id\";\r\n\t\t$query .= \" INNER JOIN db_equipment_list ON equipment_list_gen_link=equipment_gen_id\";\r\n\t\t$query .= \" INNER JOIN db_equipment_pic ON equipment_id_link_pic=equipment_pic_id\";\r\n\t\t$query .= \" LEFT JOIN db_address ON equipment_list_address_link=address_id\";\r\n\t\t$query .= \" LEFT JOIN db_status ON equipment_list_status_link=status_id WHERE equipment_list_id = :ID LIMIT 1\";\r\n\t\t\r\n\t\t$sth=$this->db->select($query,array(':ID'=>$id));\r\n\t\t\r\n\t\t\t$query = \"SELECT group_id,group_name FROM db_group WHERE group_status=0\";\r\n\t\t\t$group=$this->db->select($query,array());\r\n\t\t\t$query = \"SELECT status_id,status_name FROM db_status WHERE status_status=0\";\r\n\t\t\t$status=$this->db->select($query,array());\r\n\t\t\t$query = \"SELECT address_id,address_name FROM db_address WHERE address_status=0\";\r\n\t\t\t$address=$this->db->select($query,array());\r\n\t\t\r\n\t\t$data = array(\"equipment\",0,10,\"\",1,10,0,0,$sth,$group,$status,$address);\r\n\t\t\r\n\t\treturn $data;\r\n\t\t}", "public function ambil_id($id, $id_kamar){\n $hasil = $this->db->select('*');\n $hasil = $this->db->from('datakos');\n $hasil = $this->db->join('tipekamar','datakos.id_kos = tipekamar.id_kos', 'left');\n $hasil = $this->db->join('pemilik', 'datakos.id_pemilik = pemilik.id_pemilik');\n $hasil = $this->db->where('tipekamar.id_kos', $id );\n $hasil = $this->db->where('tipekamar.id_kamar', $id_kamar );\n $hasil = $this->db->limit('1');\n $query= $this->db->get();\n return $query->result_array();\n}", "public function get_branch_products($branch_id)\n {\n // LEFT JOIN branch_products bp ON (p.product_id = bp.product_id)\n // WHERE branch_id=$branch_id\n // GROUP BY p.product_id \"); \n\n $query = $this->db->query(\" SELECT p.product_id, p.name AS product_name,p.price AS default_price,p.product_code AS productcode,bp.*,`pc`.`name` AS catName FROM product p LEFT JOIN branch_products bp ON (p.product_id = bp.product_id) LEFT JOIN branch b ON b.branch_id = bp.branch_id\n LEFT JOIN product_category pc ON pc.product_category_id = p.product_category_id WHERE bp.branch_id=$branch_id AND b.brand_id=(SELECT brand_id FROM branch b WHERE branch_id=$branch_id) GROUP BY p.product_id \");\n\n $result = $query->result_array();\n\n //$query = $this->db->get_where('branch_products', array('branch_products_id' => $id));\n // $rows = $query->num_rows();\n // echo 'ROWS:'.$rows;die;\n //$result = $query->result_array();\n // $str = $this->db->last_query();\n // echo $str;\n\n // $totalRows = $query->num_rows();\n\n // if( $totalRows > 0 )\n // {\n // $result = $query->result_array();\n // }\n // else\n // {\n // $query = $this->db->query(\" SELECT p.product_id, p.name AS product_name,p.price AS default_price,p.product_code AS productcode,bp.*,NULL AS is_available FROM product p\n // LEFT JOIN branch_products bp ON (p.product_id = bp.product_id)\n // GROUP BY p.product_id \"); \n // $result = $query->result_array(); \n // }\n\n return $result; \n }", "function operasiJoin4($date){\t\n\t\t$query = $this->db->query(\"SELECT k.id_kondisi, k .kondisi, k.id_alat, a.id_kategori, k.tanggal, k.keterangan AS keterangan_kondisi , a.nama_alat FROM kondisi k INNER JOIN alat a ON k.id_alat = a.id_alat WHERE k.tanggal='$date' GROUP BY a.id_alat\"); \n\t\treturn $query->result();\n\t}", "function GetPackageGroupDataById($id_package) {\n \n $data = $this->db\n ->where('is_delete',0)\n ->where('id_status',1)\n ->where('id_package_group',$id_package)\n ->order_by('position','asc')\n ->get('package_group')\n ->row_array();\n \n if($data){\n // foreach ($data as $key=>$package_combo) {\n $data['item'] = $this->db\n ->where('id_package_group',$data['id_package_group'])\n ->get('package_group_item')\n ->result_array();\n\n //for christmas discount\n $real_price = $data['price'];\n $total_diskon_10 = floor( ( $real_price / 100) * 10 );\n \n $harga_natal = $real_price - $total_diskon_10; // 10% off for discount\n $data['real_price'] = $real_price;\n $data['price_diskon_10percent'] = $total_diskon_10;\n //$data['price_natal'] = $harga_natal;\n $data['price'] = $harga_natal; //final price\n\n foreach ($data['item'] as $key2 => $value) {\n $detail = $this->GetPackageByIdDataGroup($value['id_package'],$value['type']);\n $data['item'][$key2]['name'] = $detail['name'];\n $data['item'][$key2]['price'] = $detail['price'];\n }\n \n /*echo '<pre>';\n print_r($data);\n die();*/\n\n //}\n \n }\n \n \n return $data;\n }", "function projectView($connect, $id) {\n\n\n $query = \"SELECT\n\t\t\t p.`id` AS id_project,\n\t\t\t p.`name`,\n\t\t\t p.description AS `description`,\n\t\t\t GROUP_CONCAT(DISTINCT s.id) AS images,\n\t\t\t s2.id AS title_img\n\t\t\t FROM project AS p\n\t\t\t LEFT JOIN `images` AS s2\n\t\t\t ON p.`id` = s2.`id_project`\n\t\t\t AND s2.is_title = 1\n\t\t\t AND s2.to_arc = 0\n\t\t\t AND s2.on_header = 0\n\t\t\t LEFT JOIN `images` AS s\n\t\t\t ON p.`id` = s.`id_project`\n\t\t\t AND s.is_title = 0\n\t\t\t AND s.to_arc = 0\n\t\t\t AND s.on_header = 0\n\t\t\t WHERE p.`to_arc` = 0\n \t\t AND p.`is_project` = 1\n \t\t\t AND p.id = $id\n\t\t\t GROUP BY p.`id` \";\n\t$query=mysqli_query($connect, $query);\n\n\t$aResult = mysqli_fetch_array($query);\n\n//\t$aResult = explode(\",\",$aResult[\"images\"]);\n\n// if(!$aResult) {\n// DIE(\"Грешка при заявката: \".mysqli_error($connect));\n// }\n return $aResult;\n}", "function GetLayout(){\n\t//Building the query\n\t$stringBuilder = \"SELECT l.layout_id, l.font, l.font_color, l.background_color, l.default_background, l.logo, fbg.location AS backgroundLocation, flogo.location AS logoLocation \";\n\t$stringBuilder .= \"FROM layout l \";\n\t$stringBuilder .= \"INNER JOIN `file` fbg ON fbg.file_id=l.default_background \";\n\t$stringBuilder .= \"INNER JOIN `file` flogo ON flogo.file_id=l.logo \";\n\t$stringBuilder .= \"ORDER BY l.layout_id DESC \";\t\n\n\t// Preparing query\n\t$query = GetDatabaseConnection()->prepare($stringBuilder);\n\t$query->execute(array()); //Putting in the parameters\n\t$result = $query->fetchAll(); //Fetching it\n\treturn $result;\n}", "function get_table_join($select_data, $table, $join_table, $join_data, $join_type, $where_data){\n\t\n\t$this->db->select($select_data);\n\t$this->db->from($table);\n\t$this->db->join($join_table, $join_data, $join_type);\n\t$this->db->where($where_data);\n\t$this->db->order_by(\"sub1_id\",\"asc\");\n\t\n\t$query = $this->db->get();\n\t$result = $query->result_array(); \n\treturn $result;\t\n}", "function operasiJoin2(){\n\t\t$date = date('Y-m-d');\n\t\t$query = $this->db->query(\"SELECT o.id_operasi, o.operasi, o.id_alat, a.id_kategori, o.tanggal, o.keterangan, a.nama_alat FROM operasi o INNER JOIN alat a ON o.id_alat = a.id_alat\"); \n\t\treturn $query->result();\n\t}", "function get_prodi($id_prodi)\n {\n // return $this->db->get_where('prodi',array('id_prodi'=>$id_prodi))->row_array();\n\n $this->db->select ( '\n prodi.*, \n jurusan.id_jurusan as id_jurusan, \n jurusan.nama_jurusan\n ' );\n $this->db->join('jurusan', 'jurusan.id_jurusan = prodi.fk_id_jurusan');\n\n $query = $this->db->get_where('prodi', array('prodi.id_prodi' => $id_prodi));\n \n return $query->row();\n }", "function get_list()\n {\n \tif($this->table_name === null)\n \t\treturn false;\n \t\n \t$select = \"{$this->table_name}.*\";\n $select .= \", deposito.no_rekening, nasabah.NAMA_NASABAH, nasabah.ALAMAT,\";\n \t\n\t\t// ADD YOUR SELECT FROM JOIN HERE <------------------------------------------------------\n\t\t// for example $select .= \", user_log.created_date, user_log.update_date\";\n\t\t\n \tif(!empty($this->relation))\n \t\tforeach($this->relation as $relation)\n \t\t{\n \t\t\tlist($field_name , $related_table , $related_field_title) = $relation;\n \t\t\t$unique_join_name = $this->_unique_join_name($field_name);\n \t\t\t$unique_field_name = $this->_unique_field_name($field_name);\n \t\t\t\n\t\t\t\tif(strstr($related_field_title,'{'))\n \t\t\t\t$select .= \", CONCAT('\".str_replace(array('{','}'),array(\"',COALESCE({$unique_join_name}.\",\", ''),'\"),str_replace(\"'\",\"\\\\'\",$related_field_title)).\"') as $unique_field_name\";\n \t\t\telse \t\t\t\n \t\t\t\t$select .= \", $unique_join_name.$related_field_title as $unique_field_name\";\n \t\t\t\n \t\t\tif($this->field_exists($related_field_title))\n \t\t\t\t$select .= \", {$this->table_name}.$related_field_title as '{$this->table_name}.$related_field_title'\";\n \t\t}\n \t\t\n \t$this->db->select($select, false);\n \t\n // ADD YOUR JOIN HERE for example: <------------------------------------------------------\n // $this->db->join('user_log','user_log.user_id = users.id');\n $this->db->join('nasabah','nasabah.NASABAH_ID = '.$this->table_name.'.NASABAH_ID');\n \t$results = $this->db->get($this->table_name)->result();\n \t\n \treturn $results;\n }", "public function get_records() {\n\n $this->db->where('`entry_id` IN (SELECT MAX(`entry_id`) FROM `entries` GROUP BY `b_id`)', NULL, FALSE);\n $this->db->select('b_name');\n $this->db->select('entry_type');\n $this->db->select('outcome');\n $this->db->select('entries.b_id');\n\n $this->db->select(\"DATE_FORMAT(entry_date,'%b %d, %Y') AS entry_date\");\n $this->db->select('notes');\n $this->db->from('entries');\n\n $this->db->join('type', 'type.type_id = entries.type_id');\n $this->db->join('business', 'business.b_id = entries.b_id');\n $this->db->join('outcomes', 'outcomes.out_id = entries.out_id');\n\n $this->db->order_by('entry_date', 'desc');\n\n $query = $this->db->get();\n\n return $query->result();\n\n }", "public function Franchisepackagelist($masterid) {\n $this->db->select('accounts.package_id,packages.item_limit,packages.name');\n $this->db->where('accounts.account_id', $masterid);\n $this->db->where('account_type', 2);\n $this->db->from('accounts');\n $this->db->join('packages', 'accounts.package_id=packages.id');\n $this->db->group_by('accounts.package_id');\n $package = $this->db->get()->result();\n return $package;\n }", "function get_tarifkelas($id)\n {\n $this->db->select('a.*,b.kelas');\n $this->db->from('m_tarifkelas a');\n $this->db->join('m_kelas b', 'a.kdkelas = b.kdkelas', 'LEFT');\n $this->db->where('a.kdtarif', $id);\n return $this->db->get()->result();\n }", "public function lipstick()\n {\n // FROM `tb_barang` JOIN `kategori`\n // ON `tb_barang`.`id_kategori` = `kategori`.`id_kategori`\n // WHERE `id_kategori` = $id_kategori\n // \";\n // return $this->db->query($query)->result_array();\n\n return $this->db->get_where('tb_barang', ['id_kategori' => '1'])->result_array();\n }", "function get_all_m_jadwal_praktek_antrian($jadwal_praktek_fk)\n {\n $where ='';\n if ($jadwal_praktek_fk!=0) {\n $where = \"AND a.jadwal_praktek_fk='$jadwal_praktek_fk'\";\n }\n $this->db->query(\" SELECT *,a.pk as id,b.nama as pasien,c.id_session_jadwal, d.metode_bayar\n FROM m_jadwal_praktek_antrian a\n LEFT JOIN m_kontak b on a.pasien_fk = b.pk\n LEFT JOIN m_jadwal_praktek c on a.jadwal_praktek_fk = c.pk \n\t\t\t\t\t\t\t\t LEFT JOIN m_metode_pembayaran d on a.metode_pembayaran_fk = d.pk\n WHERE 1=1 $where ORDER BY jadwal_praktek_fk,nomor_urut asc\")->result_array();\n\n\n /*$this->db->get('m_jadwal_praktek_antrian')->result_array();*/\n }", "function GetPackageByIdData($id_package) {\n $data = $this->db\n ->where('id_status',1)\n ->where('is_delete',0)\n ->where('id_package',$id_package)\n ->limit(1)\n ->get('package')\n ->row_array();\n return $data;\n }", "function get_single_object_info($id,$table, $Manipulation){\r\n $this->db->select('*');\r\n // $this->db->select('c.name as country_name');\r\n $this->db->from($table);\r\n // $this->db->join('country c','c.id = u.country','LEFT');\r\n $this->db->where($Manipulation,$id);\r\n $query = $this->db->get();\r\n $query = $query->row(); \r\n return $query;\r\n }", "public function imgShow($id)\n {\n $this->db->where('id', $id);\n $query1 = $this->db->from('job_ads')\n ->join('cities', 'cities.cityId=job_ads.cityId')\n ->join('paper', 'paper.paperId=job_ads.paperId')\n ->join('departments', 'departments.depttId=job_ads.depttId')\n ->join('categories', 'categories.catId=job_ads.catId')\n ->get();\n return $query1->row_array();\n }", "public function get_recipe_information() {\n $this->db->select('recipe.id,recipe.ar_name as rec_ar_name,recipe.en_name as rec_en_name,recipe.details,recipe.barcode,recipe_information.invoice_number,recipe_information.size,recipe_information.color,recipe_information.weight,recipe_information.expirey_date,recipe_information.cost_price,recipe_information.sale_price,recipe_information.whole_price,recipe_information.qty,brand.en_name as brand_en_name,brand.ar_name as brand_ar_name,supplier.name,recipe_information.disable as info_disable,recipe.disable as rec_disable ');\n $this->db->from('recipe');\n $this->db->join('recipe_information', 'recipe.id = recipe_information.recipe_id','left');\n $this->db->join('brand', 'brand.id = recipe.brand_id','left');\n $this->db->join('supplier', 'supplier.id = recipe_information.supplier_id','left');\n $query = $this->db->get();\n return $query->result();\n }", "function get_join($data,$key=FALSE,$single=FALSE,$column=FALSE){ //Zulmi Adi Rizki 23 Juli 2013\n\t\tforeach($data as $row){\n\t\t\t$this->db->join($row[\"join_table\"],$row[\"table\"].\".\".$row[\"join_key\"].\"=\".$row[\"join_table\"].\".\".$row[\"join_key\"]);\n\t\t}\n\t\tif($key == TRUE){\n\t\t\tif(!is_array($key)){\n\t\t\t\t$this->db->where($key);\n\t\t\t} else {\n\t\t\t\t$key = array_map('htmlentities', $key);\n\t\t\t\t$this->db->where($key);\n\t\t\t}\n\t\t}\n\t\tcount($this->db->ar_orderby) || $this->db->order_by($this->order_by);\n\t\t$this->db->select($column == FALSE ? \"*\" : $column)->from($this->table_name);\n\t\t$single == FALSE || $this->db->limit(1);\n\t\t$method = $single ? 'row_array' : 'result_array';\n\t\treturn $this->db->get()->$method();\n\t}", "public function getall_details4($id){\n\t \t $query=\"SELECT ads.*,user.phone,user.address FROM ads INNER JOIN user ON ads.email=user.email WHERE no='$id' \";\n\t \t $result=$this->db->select( $query);\n\t \t return $result;\n\n\n\t }", "function tampil_data()\n\t{\n\t\t# perintah join digunakan untuk menggabungkan 2 table, yaitu penduduk dan kematian, agar data yang tampil lebih detail, karena pada tabel kematian hanya terdapat sedikit kolom, sehingga dengan menambah kolom nik, maka data yang ada di tabel penduduk juga otomatis terdeteksi karena perintah join, dengan aturan, nik harus sama antara tabel kematian dan nik yang ada di penduduk.\n\t\treturn $this->db->query(\"SELECT*FROM `kematian` left join penduduk on kematian.nik = penduduk.nik\")->result();\n\t}", "Function getsqlproduit($id)\n{\n $query='SELECT PR.prix,PR.description,PR.titre as titre,PR.prix,PR.photo,PR.ref,PR.description,PR.idcat,CA.titre as cat_titre from produits PR, categories CA where PR.idcat=CA.idcat and pr.idpr='.$id.';';\n $result=selectTable($query);\n if($result==false){\n return false;\n }else{\n return $result[0];\n }\n // test si resultat est ok et gérer renvoi\n\n}", "public function ambil_data()\n {\n $this->db->select('berita.*, kategori.nama_kategori');\n $this->db->from('berita');\n $this->db->join('kategori', 'kategori.id_kategori = berita.id_kategori','left');\n $this->db->order_by('tanggal', 'ASC');\n $query = $this->db->get();\n return $query;\n }", "function getOrder_detail($orderid){\n$reesult= array();\n$result=$this->db->where(\"order_id\", $orderid)->get('order_products')->result();\n return $result;\n }", "public function get_details_post()\n{\n $where = array('id'=>1);\n //$where1 = array('status'=>1,'company_id'=>$id);\n $data = $this->model->getAllwhere('details',$where,',id,company_name,theme_color,lat,long,gst_no,punch_line,logo,CONCAT(\"'.base_url().'\",\"asset/uploads/\",logo)AS logo,CONCAT(\"'.base_url().'\",\"asset/uploads/\",logo)AS logo','ASC');\n //print_r($data);\n $resp = array('rccode' => 200,'message' =>\"success\", 'detials'=>$data);\n $this->response($resp);\n}", "public function getAllByUser(){\n $sql = \"SELECT p.* FROM pedidos p \"\n //. \"INNER JOIN lineas_pedidos lp ON p.id = lp.pedido_id \"\n . \"WHERE p.usuario_id = {$this->getUsuario_id()} ORDER BY id DESC\";\n\n $pedido = $this->db->query($sql);\n\n \n //echo $this->db->error;\n \n return $pedido;\n \n}", "public function getImgByProduct($id){\n $this->db->select('*');\n $this->db->where('id_product', $id);\n $this->db->from($this->product_img); \n return $this->db->get();\n }", "public function getAll() {\n $this->db->select('a.id_tp as \"id_tp\", a.id_hewan as \"id_hewan\", b.nama as \"hewan\", a.id_pegawai_k as \"id_pegawai_k\", c.nama as \"Kasir\", a.id_pegawai_cs as \"id_pegawai_cs\", d.nama as \"customer_service\",\n a.kode as \"kode\", a.tanggal as \"tanggal\", \n a.sub_total as \"sub_total\", a.total_harga as \"total_harga\", a.status as \"status\",a.created_at as \"created_at\", a.updated_at as \"updated_at\",\n a.created_by as \"created_by\", a.updated_by as \"updated_by\"');\n $this->db->from('transaksi_produk a');\n $this->db->join('hewan b', 'id_hewan');\n $this->db->join('pegawai c', 'a.id_pegawai_cs = c.id_pegawai');\n $this->db->join('pegawai d', 'a.id_pegawai_cs = d.id_pegawai');\n $this->db->where('a.status =', 'Penjualan');\n return $query = $this->db->get()->result_array(); \n }", "public function query(){\n // $this->db->select('idk,id_kain,nm_kain')\n $this->db->select('*')\n ->from($this->table);\n }", "public function importData()\n {\n /*$this->db->where('delete_status','0'); \n $data = $this->db->get('item');\n \treturn $data->result();*/\n \treturn $this->db->SELECT('c.category_name,u.unit_name,i.hsn_code,t.tax_name,i.item_name,i.item_description,i.purchase_price,i.sales_price')\n\t\t\t\t\t\t\t->FROM('category c')\n\t\t\t\t\t\t\t->JOIN('item i','i.category_id=c.id')\n\t\t\t\t\t\t\t->JOIN('tax t','i.tax_id=t.tax_id')\n\t\t\t\t\t\t\t->JOIN('unit u','i.unit_id=u.id')\n\t\t\t\t\t\t\t->get()\n\t\t\t\t\t\t\t->row();\n\n /*$this->db->select('c.category_name,u.unit_name,t.tax_name,i.item_name,i.item_description,i.purchase_price,i.sales_price');\n $this->db->from('item i');\n $this->db->join('category c','c.id = i.category_id');\n $this->db->join('tax t','t.tax_id = i.tax_id');\n $this->db->join('unit u','u.id = i._id');*/\n\n\n }", "public function masterpackagelist($masterid) {\n $this->db->select('accounts.package_id,packages.item_limit,packages.name');\n $this->db->where('accounts.account_id', $masterid);\n $this->db->where('account_type', 1);\n $this->db->from('accounts');\n $this->db->join('packages', 'accounts.package_id=packages.id');\n $this->db->group_by('accounts.package_id');\n $package = $this->db->get()->result();\n return $package;\n }", "function getById($id){\n // $query = $this->db->query(\"select * FROM prasarana INNER JOIN peminjaman ON prasarana.id_prasarana = peminjaman.id_prasarana INNER JOIN verifikasi ON verifikasi.id_peminjaman = peminjaman.id_peminjaman LEFT JOIN mahasiswa ON mahasiswa.nim = peminjaman.nim LEFT JOIN staff ON staff.nip = peminjaman.nip WHERE peminjaman.nim = '123' or peminjaman.nip = '123'\");\n $query = $this->db->query(\"SELECT * FROM `peminjaman` left join prasarana on peminjaman.id_prasarana = prasarana.id_prasarana left join sarana on sarana.id_sarana = peminjaman.id_sarana LEFT JOIN pengembalian ON pengembalian.id_peminjaman = peminjaman.id_peminjaman LEFT JOIN verifikasi ON verifikasi.id_peminjaman = peminjaman.id_peminjaman LEFT JOIN mahasiswa ON mahasiswa.nim = peminjaman.nim LEFT JOIN staff ON staff.nip = peminjaman.nip WHERE peminjaman.nim = '$id' or peminjaman.nip = '$id' order by peminjaman.id_peminjaman ASC\");\n // $this->db->where('nim',$id);\n // $query = $this->db->get('peminjaman');\n return $query->result(); //returns result in array forms(this is not necessary btw, let me know if u need only one line, or change \"$query->result_array()\" to \"$query->row()\")\n}", "function goods_viewImgProduct(){\n $sql = \"select * from gd_image where get_imgid=:get_imgid order by gd_imgid ASC\";\n $args = [':get_imgid'=>$this->id];\n return $this->run($sql, $args);\n }", "public function select_driver_location1()\n {\n $this->db->select('user.*');\n\t$this->db->from('user');\n\t$this->db->join('orders', 'user.user_id = orders.driver_id', 'left'); \t \n\t$this->db->where('user.user_type', 2);\n\t$this->db->where('user.login_status', \"yes\");\n\t$query = $this->db->get();\n\t$data1= $query->result(); \n\t//print_r($data1);die;\n\t//$data11='';\n \n\t\tforeach($data1 as $row)\n\t\t{\n\t\t\n\t\t$data[]=array(\"lat\"=>$row->latitude,\"lng\"=>$row->longitude,\"description\"=>$row->sub.\"<div class='shub'><img src='http://freebizoffer.com/apptech/pick&drop/courierapp/api/upload/$row->profile_image' style='float:left;margin-right:10px; border-radius: 100%;\n border: 1px solid #fff;\n margin-left: 5px;\n margin-top: 5px;\n margin-bottom: 0px;' width='50' height='50'></td><td>Driver-\". $row->firstname .\"\". $row->lastname .\"<br>Driver Id-\". $row->user_id .\"<br>Type -\". $row->vehicle_type,\"image\"=>\"https://cdn4.iconfinder.com/data/icons/car-silhouettes/1000/city-car-512.png\",\"vehicle_type\"=>$row->vehicle_type);\n\t\t}\n\t\t//print_r($data);die;\n return $data;\n }", "public function data($id = null)\n\t{\n if($id != null)\n {\n return $this->db->get($this->table, \"*\", [$this->primaryKey => $id]);\n }\n else\n {\n // return $this->db->query(\"SELECT bidang.*, pegawai.nama FROM bidang JOIN pegawai ON bidang.nip = pegawai.nip\")->fetchAll(PDO::FETCH_ASSOC);\n return $this->db->query(\"SELECT * from bidang\")->fetchAll(PDO::FETCH_ASSOC);\n }\n\t}", "public function f_get_distPoints()\n {\n\n // $sql = $this->db->query(\"SELECT DISTINCT a.sl_no, b.bdo_name \n // FROM md_dist_point a , md_dm_bdo b \n // WHERE a.dist_cd = b.dist_cd\n // AND a.sdo = b.sdo_cd\n // AND a.bdo = b.sl_no \");\n\n$sql = $this->db->query(\"SELECT DISTINCT a.sl_no, b.bdo_name,c.sdo_name sdo_name,a.agent\n FROM md_dist_point a , md_dm_bdo b ,md_dm_sdo c\n WHERE a.dist_cd = b.dist_cd \n AND b.dist_cd = c.dist_cd\n and a.sdo =c.sl_no\n and a.bdo = b.sl_no\");\n echo $this->db->last_query();\n return $sql->result();\n \n }", "function operasiJoin(){\n\t\t$date = date('Y-m-d');\n\t\t$query = $this->db->query(\"SELECT o.id_operasi, o.operasi, o.id_alat, a.id_kategori, o.tanggal, o.keterangan, a.nama_alat FROM operasi o INNER JOIN alat a ON o.id_alat = a.id_alat WHERE o.tanggal = '$date'\"); \n\t\treturn $query->result();\n\t}", "public function selectAllJabatan(){\n\n // return $query->result();\n $this->db->select('t_user.jabatan, t_user.tipe');\n $this->db->from($this->tableName);\n $this->db->group_by('jabatan');\n return $this->db->get(); \n }", "function get_by_idpuskesmas($id)\n {\n $this->db->where('persediaan.id_puskesmas', $id);\n $this->db->join('puskesmas', 'puskesmas.id_puskesmas=persediaan.id_puskesmas');\n $this->db->join('obat', 'obat.kode=persediaan.kode');\n $this->db->select('id_persediaan');\n $this->db->select('persediaan.id_puskesmas');\n $this->db->select('persediaan.kode');\n $this->db->select('nama_obat');\n $this->db->select('stok_awal');\n return $this->db->get($this->table)->row();\n }", "function fetch_datas()\n {\n $query = $this->db->get($this->tbl_qr);\n return $query->result_array();\n }", "function get_by_id($id)\n {\n $this->db->select('*');\n $this->db->join('pohon', 'pohon.id_pohon = penanaman.id_pohon');\n $this->db->join('users', 'users.id_user = penanaman.id_user');\n $this->db->join('petak', 'petak.id_petak = penanaman.id_petak');\n $this->db->join('pendaftaran', 'pendaftaran.id_pendaftaran = penanaman.nama_penanam');\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "public function getSingleProduct($id){\r\n\r\n\t$query = \"SELECT p.*,c.catName,b.brandName\r\nFROM tbl_product as p,tbl_category as c, tbl_brand as b\r\nWHERE p.catId = c.catId AND p.brandId = b.brandId AND p.productId = '$id'\";\r\n\t$result = $this->db->select($query);\r\n\treturn $result;\r\n}", "function select_by_idbrand($id_brand) {\t\t\n\t $fields = 'ac_product.id_product AS id_product, ac_product.name_product AS name_product, ac_product.slug_product AS slug_product, ac_product.price_product AS price_product, ac_product.discount AS discount, ac_product.after_price_discount AS after_price_discount, ac_product.description_product AS description_product, ac_product.picture_product AS picture_product, ac_brand.name_brand AS id_brand, ac_brand.slug_brand AS slug_brand';\n\n $this->db->select($fields); \n $this->db->from('ac_product');\n $this->db->join('ac_brand', 'ac_brand.id_brand = ac_product.id_brand','left');\n $this->db->where(array('ac_product.id_brand'=>$id_brand));\n $this->db->or_where(array('ac_brand.slug_brand'=>$id_brand));\n $this->db->order_by('created_at','desc');\n $query = $this->db->get();\n \n return $query->row();\n\t}", "function get_project_id_gallery($project_id){\n $id=base64_decode($project_id)/98765;\n $get_all_gallery_img=\"SELECT * FROM rmd_gallery_img WHERE project_id='$id'\";\n $get_all=$this->db->query($get_all_gallery_img);\n return $get_all->result();\n }", "function ambil_data(){\n\t\t$this->db->order_by($this->id_admin,$this->order);\n\t\treturn $this->db->get($this->nama_table)->result();\n\t}", "function getImages($id,$table){\n\t\t$db;\t\t\t\t\n\t\t// Open the database connection\n\t\t//if (!($db = pg_connect( 'host=postgres.int.devisland.net dbname=db_piccicla user=piccicla password=fidelin1'))) {\n\t\tif (!($db = pg_connect( 'host=localhost dbname=landscape user=postgres password=fidelin1'))){\n\t\t// Handle errors\n\t\t // i used die because with echo the script continued\n\t\t //Echo \"{success:false, msg:'SQL ERROR: Connection failed'}\";\t\t\t \n\t\t die();\t\t\t\n\t\t}\n\t\t\t\n\t\t$sql = 'select \"LINK\" from \"landscape\".\"'.$table.'\" where \"ART_ID\"='.$id;\n\t\t\n\t\t$results = array();\n\n\t\t// Read all the data back in as associative arrays\n\t\tIf (!$rs = pg_query($db, $sql) ){\n\t\t\t\tif ($db){\n\t\t\t\t\tpg_close($db);\n\t\t\t\t}\n\t\t\t\ttrigger_error('problems reading the database');\n\t\t\t\tdie();\n\t\t}else{\t\t\n\t\twhile($obj = pg_fetch_object($rs)){\n\t\t\t$results[] = $obj;\n\t\t}}\n\t\t//close the connection\n\t\tpg_close($db);\n\t\t//print_r($results);\n\t\t//trigger_error('problems reading the database');\n //die();\n\t\treturn $results;\t\t\n}", "function lista_tamanhos_produto($id)\n {\n #return $this->db->get_where('tamanhos_produtos',array('produtoID'=>$id))->row_array();\n $this->db->select('*'); \n #$this->db->from('tamanhos_produtos');\n $this->db->where('produtoID',$id);\n $this->db->order_by('idT', 'desc');\n $this->db->join('produtos','tamanhos_produtos.produtoID = produtos.idP');\n $this->db->join('cores','tamanhos_produtos.corID = cores.id');\n $this->db->join('tamanhos','tamanhos_produtos.tamanhoID = tamanhos.id');\n return $this->db->get('tamanhos_produtos')->result_array();\n \n }", "public function getapplyjobcu($uid)\n{\n\n $this->db->select(\"user_applied_jobs.*,jobs.job_title,jobs.map_address,users.first_name,users.last_name,users.image,staff_basicinfo.current_location\");\n $this->db->join(\"jobs\",\"user_applied_jobs.job_id=jobs.id\",\"left\");\n $this->db->join(\"users\",\"user_applied_jobs.user_id=users.id\",\"left\");\n $this->db->join(\"staff_basicinfo\",\"user_applied_jobs.user_id= staff_basicinfo.staff_id\",\"left\"); \n $this->db->where(\"user_applied_jobs.job_userid\",$uid);\n $this->db->where(\"users.first_name!=\",''); \n $this->db->where(\"jobs.job_title!=\",''); \n $this->db->order_by(\"user_applied_jobs.id\",\"desc\"); \n $result = $this->db->get('user_applied_jobs')->result();\n //echo $this->db->last_query(); die();\n return $result;\t\t\n}", "public function index()\n {\n //\n //$j = 1;\n //$p = Project::all()->toArray(); \n // dd();\n //$i = Image::all()->toArray(); \n $pim=DB::select(\"SELECT projects.pid, projects.pname, projects.description, projects.category, uploads.img, uploads.des from projects INNER JOIN uploads on projects.pname = uploads.des\");\n //dd($pi);\n // foreach($p as $pi)\n //{\n /*for($j=0;$j<count($p);$j++)\n {\n $i= Image::all()->where('des', $p[$j]['pname'])->toArray(); \n \n }*/\n //$j = $j+1;\n //} \n //dd($i);\n return view('myworks', compact('pim'));\n\n }", "function find_all_sale(){\n global $db;\n $sql = \"SELECT s.id,s.qty,s.price,s.date,p.name\";\n $sql .= \" FROM sales s\";\n $sql .= \" LEFT JOIN products p ON s.product_id = p.id\";\n $sql .= \" ORDER BY s.date DESC\";\n return find_by_sql($sql);\n }", "function all(){\n try{\n $link= connecter_db();\n $rp=$link->prepare(\"select * from etudiant order by id desc\");\n $rp->execute();\n $resultat= $rp->fetchAll(); \n\n return $resultat;\n }catch(PDOException $e ){\n die (\"erreur de recuperation des etudiants dans la base de donnees \".$e->getMessage());\n }\n\n}", "function get_join_by($data,$key=FALSE,$single=FALSE,$column=FALSE){ //Zulmi Adi Rizki 23 Juli 2013\n\t\tforeach($data as $row){\n\t\t\t$this->db->join($row[\"join_table\"],$row[\"table\"].\".\".$row[\"join_key\"].\"=\".$row[\"join_table\"].\".\".$row[\"join_key\"]);\n\t\t}\n\t\tif($key == TRUE){\n\t\t\tif(!is_array($key)){\n\t\t\t\t$this->db->where($key);\n\t\t\t} else {\n\t\t\t\t$key = array_map('htmlentities', $key);\n\t\t\t\t$this->db->where($key);\n\t\t\t}\n\t\t}\n\t\tcount($this->db->ar_orderby) || $this->db->order_by($this->order_by);\n\t\t$this->db->select($column == FALSE ? \"*\" : $column)->from($this->table_name);\n\t\t$single == FALSE || $this->db->limit(1);\n\t\t$method = $single ? 'row_array' : 'result_array';\n\t\treturn $this->db->get()->$method();\n\t}", "function getDistinctVehicles($package_id){ \n\t$this->db->select('v.registration_number,v.id as vehicle_id');\n\t$this->db->distinct();\n\t$this->db->where('p.id',$package_id);\n\t$this->db->from('packages p');\n\t$this->db->join('package_itinerary pi','pi.package_id = p.id','left');\n\t$this->db->join('package_vehicles pv','pv.package_itinerary_id = pi.id','left');\n\t$this->db->join('vehicles v','pv.vehicle_id = v.id','left');\n\t$qry=$this->db->get(); \n\t\tif($qry->num_rows() > 0){\n\t\t\t\n\t\t\t$v_array= $qry->result_array();\n\t\t\tforeach ($v_array as $key=>$vehicle){\n\t\t\t\techo $vehicle['vehicle_id'];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getimagebykatid($id){\n $query = $this->db->table($this->table)\n ->where('kategori_id',$id)\n ->where('status_cd','normal')\n ->get();\n return $query;\n }", "public function fetch_multi($s_where=null,$i_start=null,$i_limit=null)\r\n {\r\n try\r\n {\r\n \t$ret_=array();\r\n \t$s_qry=\"SELECT * \r\n\t\t\t\t\tFROM \".$this->tbl.\" n \"\r\n\t\t\t\t\t.($s_where!=\"\"?$s_where:\"\" ).(is_numeric($i_start) && is_numeric($i_limit)?\r\n\t\t\t\t\t\"Limit \".intval($i_start).\",\".intval($i_limit):\"\" );\r\n $rs=$this->db->query($s_qry);\r\n $i_cnt=0;\r\n if($rs->num_rows()>0)\r\n {\r\n foreach($rs->result() as $row)\r\n {\r\n $ret_[$i_cnt][\"id\"]\t\t\t\t=\t$row->i_id;////always integer\r\n $ret_[$i_cnt][\"s_title\"]\t\t\t=\tstripslashes($row->s_title); \r\n\t\t\t\t $s_desc \t\t\t\t\t\t\t= \tstrip_tags(stripslashes($row->s_description));\r\n\t\t\t\t if(strlen($s_desc)>197)\r\n\t\t\t\t \t$s_desc \t\t\t\t\t\t= \tsubstr_replace($s_desc,'...',200);\r\n $ret_[$i_cnt][\"s_description\"]\t= \t$s_desc ; \r\n $ret_[$i_cnt][\"s_photo\"]\t\t\t=\tstripslashes($row->s_photo); \r\n $ret_[$i_cnt][\"dt_created_on\"]\t=\tdate($this->conf[\"site_date_format\"],intval($row->dt_cr_date)); \r\n $ret_[$i_cnt][\"i_is_active\"]\t\t=\tintval($row->i_is_active); \r\n\t\t\t\t $ret_[$i_cnt][\"s_is_active\"]\t\t=\t(intval($row->i_is_active)==1?\"Active\":\"Inactive\");\r\n \r\n $i_cnt++;\r\n } \r\n $rs->free_result(); \r\n }\r\n unset($s_qry,$rs,$row,$i_cnt,$s_where,$i_start,$i_limit, $s_desc);\r\n return $ret_;\r\n \r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n } \r\n }" ]
[ "0.8500659", "0.846435", "0.7556596", "0.7391785", "0.70706904", "0.7030467", "0.6920653", "0.68823594", "0.6570544", "0.64417833", "0.6374068", "0.6291693", "0.6277971", "0.625091", "0.62468886", "0.6218365", "0.6213862", "0.6186039", "0.617729", "0.6164808", "0.61534756", "0.61457044", "0.6130054", "0.61297196", "0.61054796", "0.6102879", "0.6076834", "0.60707486", "0.6063085", "0.6024245", "0.6021016", "0.600384", "0.5984854", "0.59564674", "0.5955652", "0.5949004", "0.5948068", "0.59475994", "0.5946558", "0.59433824", "0.5937291", "0.59349346", "0.5931227", "0.5930218", "0.5922885", "0.5921018", "0.5914747", "0.5912532", "0.5911138", "0.5910725", "0.5906087", "0.590342", "0.59030163", "0.588451", "0.5881158", "0.5873716", "0.58673006", "0.5862057", "0.585764", "0.5846836", "0.5832235", "0.58297044", "0.5827303", "0.58181673", "0.58157116", "0.5807369", "0.580534", "0.5799784", "0.5790625", "0.57889146", "0.5786651", "0.5783988", "0.57719535", "0.57709676", "0.5767685", "0.5766103", "0.576415", "0.57618314", "0.57573026", "0.5755176", "0.5752944", "0.5752725", "0.57506704", "0.5742793", "0.574055", "0.57396024", "0.57387006", "0.573813", "0.5736366", "0.57298166", "0.5722299", "0.5722002", "0.5717773", "0.57157785", "0.57157695", "0.5711935", "0.57116085", "0.57108516", "0.57107", "0.57039416" ]
0.782018
2
/ $this>db>select('package.,package.id as packid,location.,address.,cities.,file.'); $this>db>from('package'); $this>db>join('cities','cities.c_id = package.location','left'); $this>db>join('address','address.city = cities.c_id'); $this>db>join('location','location.locationaddress = address.id'); $this>db>join('file','file.id = package.thumbnailimage'); $this>db>join('packageimage','packageimage.package = package.id','left'); $this>db>join('file','file.id = packageimage.file'); $this>db>where('package.id',$dis); $query = $this>db>get(); $row = $query>result_array();// echo $this>db>last_query();exit; return $row;
function get_all_package_details_view($dis) { $query = $this->db->query("SELECT PACKAGE.*, group_concat(DISTINCT PACKFILE.imagename order by PACKFILE.imagename separator ',' ) AS packageImages, group_concat(DISTINCT LOCFILE.imagepath order by LOCFILE.imagepath separator ',' ) AS locationImages, group_concat(DISTINCT LOCAMENITIES.name order by LOCAMENITIES.name separator ',' ) AS locstionamineties, group_concat(DISTINCT PACKAMENITIES.name order by PACKAMENITIES.name separator ',' ) AS packaageamineties FROM `package` AS PACKAGE LEFT JOIN packageimage AS PACKIMAGE ON PACKIMAGE.package = PACKAGE.id LEFT JOIN file AS PACKFILE ON PACKFILE.id = PACKIMAGE.file LEFT JOIN location AS LOC ON LOC.id=PACKAGE.location LEFT JOIN address AS ADDRESS ON ADDRESS.id = LOC.locationaddress LEFT JOIN locationimage AS LOCIMAGE ON LOCIMAGE.location = LOC.id LEFT JOIN file AS LOCFILE ON LOCFILE.id = LOCIMAGE.id LEFT JOIN locationamenities AS LOCAMENITIESMAP ON LOCAMENITIESMAP.location = LOC.id LEFT JOIN amenities AS LOCAMENITIES ON LOCAMENITIES.id = LOCAMENITIESMAP.amenities LEFT JOIN packageamenities AS PACKMENITIESMAP ON PACKMENITIESMAP.package = PACKAGE.id LEFT JOIN amenities AS PACKAMENITIES ON PACKAMENITIES.id = PACKMENITIESMAP.amenities where PACKAGE.id=$dis"); return $query->result_array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_location_package_detail()\n {\n $this->db->select('package.*,package.id as packid,location.*,address.*,cities.*,file.* ');\n $this->db->from('package');\n $this->db->join('cities', 'cities.c_id = package.location');\n $this->db->join('address', 'address.city = cities.c_id');\n $this->db->join('location', 'address.id = location.locationaddress');\n // $this->db->join('packageimage','packageimage.package = package.id');\n $this->db->join('file', 'file.id = package.thumbnailimage');\n // $this->db->where('cities.c_id', $dis);\n $query = $this->db->get();\n $row = $query->result_array(); // echo $this->db->last_query();exit;\n return $row;\n }", "function get_package_details($dis)\n {\n $this->db->select('package.*,package.id as packid,location.*,address.*,cities.*,file.* ');\n $this->db->from('package');\n $this->db->join('cities', 'cities.c_id = package.location');\n $this->db->join('address', 'address.city = cities.c_id');\n $this->db->join('location', 'address.id = location.locationaddress');\n // $this->db->join('packageimage','packageimage.package = package.id');\n $this->db->join('file', 'file.id = package.thumbnailimage');\n $this->db->where('cities.c_id', $dis);\n $query = $this->db->get();\n $row = $query->result_array(); // echo $this->db->last_query();exit;\n return $row;\n }", "function get_all_package_details($dis)\n {\n $query = $this->db->query(\"SELECT \n PACKAGE.*, group_concat(DISTINCT PACKFILE.imagename order by PACKFILE.imagename separator ',' ) AS packageImages,\n group_concat(DISTINCT LOCFILE.imagepath order by LOCFILE.imagepath separator ',' ) AS locationImages,\n group_concat(DISTINCT LOCAMENITIES.name order by LOCAMENITIES.name separator ',' ) AS locstionamineties, \n group_concat(DISTINCT PACKAMENITIES.name order by PACKAMENITIES.name separator ',' ) AS packaageamineties \n FROM `package` AS PACKAGE \n LEFT JOIN packageimage AS PACKIMAGE ON PACKIMAGE.package = PACKAGE.id \n LEFT JOIN file AS PACKFILE ON PACKFILE.id = PACKIMAGE.file \n LEFT JOIN location AS LOC ON LOC.id=PACKAGE.location \n LEFT JOIN address AS ADDRESS ON ADDRESS.id = LOC.locationaddress \n LEFT JOIN locationimage AS LOCIMAGE ON LOCIMAGE.location = LOC.id \n LEFT JOIN file AS LOCFILE ON LOCFILE.id = LOCIMAGE.id \n LEFT JOIN locationamenities AS LOCAMENITIESMAP ON LOCAMENITIESMAP.location = LOC.id LEFT JOIN amenities AS LOCAMENITIES ON LOCAMENITIES.id = LOCAMENITIESMAP.amenities LEFT JOIN packageamenities AS PACKMENITIESMAP ON PACKMENITIESMAP.package = PACKAGE.id \n LEFT JOIN amenities AS PACKAMENITIES ON PACKAMENITIES.id = PACKMENITIESMAP.amenities WHERE PACKAGE.id =$dis\");\n return $query->result_array();\n }", "function get_all_package_details_admin($dis)\n {\n $query = $this->db->query(\"SELECT \n PACKAGE.*,LOC.id AS locationId, PACKAGE.id as ped, group_concat(DISTINCT PACKFILE.imagename order by PACKFILE.imagename separator ',' ) AS packageImages,\n group_concat(DISTINCT LOCFILE.imagepath order by LOCFILE.imagepath separator ',' ) AS locationImages,\n group_concat(DISTINCT LOCAMENITIES.name order by LOCAMENITIES.name separator ',' ) AS locstionamineties, \n group_concat(DISTINCT PACKAMENITIES.name order by PACKAMENITIES.name separator ',' ) AS packaageamineties \n FROM `package` AS PACKAGE \n LEFT JOIN packageimage AS PACKIMAGE ON PACKIMAGE.package = PACKAGE.id \n LEFT JOIN file AS PACKFILE ON PACKFILE.id = PACKIMAGE.file \n LEFT JOIN location AS LOC ON LOC.id=PACKAGE.location \n LEFT JOIN address AS ADDRESS ON ADDRESS.id = LOC.locationaddress \n LEFT JOIN locationimage AS LOCIMAGE ON LOCIMAGE.location = LOC.id \n LEFT JOIN file AS LOCFILE ON LOCFILE.id = LOCIMAGE.id \n LEFT JOIN locationamenities AS LOCAMENITIESMAP ON LOCAMENITIESMAP.location = LOC.id LEFT JOIN amenities AS LOCAMENITIES ON LOCAMENITIES.id = LOCAMENITIESMAP.amenities LEFT JOIN packageamenities AS PACKMENITIESMAP ON PACKMENITIESMAP.package = PACKAGE.id \n LEFT JOIN amenities AS PACKAMENITIES ON PACKAMENITIES.id = PACKMENITIESMAP.amenities WHERE PACKAGE.id = $dis\");\n return $query->result_array();\n }", "public function cpJoin() {\n $sql=\"select packages.packageName, prices.id, prices.price, products.productName, products.cid, prices.productID, prices.areaID, prices.packageID \"\n . \"from prices\"\n . \" inner join packages on packages.packageID=prices.packageID\"\n . \" inner join products on prices.productID=products.productID where products.cid='9'\";\n $sth=$this->dbh->prepare($sql);\n \n $sth->execute();\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n}", "public function getJobp($id=''){\t\t\n $this->db->select(\"jobspreview.*,package.name as package_name,package.price as package_price,industry.name as industry_name\");\n $this->db->join(\"package\",\"jobspreview.package_id=package.id\",\"left\"); \n $this->db->join(\"industry\",\"jobspreview.industry_id=industry.id\",\"left\"); \n $this->db->where(\"jobspreview.id\",$id); \n $result = $this->db->get('jobspreview')->result();\n //echo $this->db->last_query(); die(); \n return $result;\t\t\n}", "function join_product_table(){\n global $db;\n $sql =\" SELECT p.id,p.name,p.keywords,p.quantity,p.url,p.buy_price,p.sale_price,p.media_id,p.date,c.name\";\n $sql .=\" AS categorie,m.file_name AS image\";\n $sql .=\" FROM products p\";\n $sql .=\" LEFT JOIN categories c ON c.id = p.categorie_id\";\n $sql .=\" LEFT JOIN media m ON m.id = p.media_id\";\n $sql .=\" ORDER BY p.id ASC\";\n return find_by_sql($sql);\n\n }", "function getPackage(){\n\t\t $query = \"select package.id,package.pkg_cat_id,package.date_created,package.date_updated,package.icon_image,package.package_title,package.package_price,package.number_of_qty,package.slider_desc1,package.slider_image1,packages_category.packages_category_name from package inner join packages_category on package.pkg_cat_id = packages_category.id \";\n\t\t $result = mysql_query($query);\n\t\t if($result){\n\t\t\t$data = array();\n\t\t\twhile($row=mysql_fetch_assoc($result)){\n\t\t\t\t$row['icon_image'] = $row['icon_image'] !==\"\"? $this->Check_exists_img($row['icon_image']) : \"dist/img/boxed-bg.jpg\";\n\t\t\t\t$row['slider_image1'] = $row['slider_image1'] !==\"\"? $this->Check_exists_img($row['slider_image1']) : \"dist/img/boxed-bg.jpg\";\n\t\t\t\t\n\t\t\t\tarray_push($data,$row);\n\t\t\t }\n\t\t\t return $data;\n\t\t }else{\n\t\t\tdie(\"error in mysql query\" . mysql_error());\n\t\t }\n\t\t}", "function customerPackage() {\n $sql = \"SELECT customers.package_id, customers.customer_id, customers.fname, customers.lname, customers.phone, customers.email, customers.state, packages.name\n FROM packages INNER JOIN customers ON packages.package_id = customers.package_id\";\n\n //Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //Execute\n $statement->execute();\n\n //Get the results\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "function getallproducts($warehouseid){\n \n $result = $this->db->query(\"SELECT a.*, \n b.id AS productid, b.`name` AS productname, b.`main_image` AS productimage, \n b.`price` AS product_price, b.`tax` AS product_tax, b.`description` AS product_description, b.`move_product_id` AS productuniqueid_forimages,\n c.`name` AS cat_name, c.`image` AS cat_image, d.`name` AS subcat_name, d.`image` AS subcat_image\n FROM warehouse_products a LEFT JOIN products b ON a.product=b.`id` LEFT JOIN category c ON b.`category_id` = c.`category_id` LEFT JOIN category d \n ON b.`sub_category_id` = d.`category_id` WHERE a.`warehouse` = \".$warehouseid.\" ORDER BY c.`name`, d.`name`\")->result();\n return $result;\n \n }", "public function get_locations_md($id = FALSE)\n{\n if ($id === FALSE)\n { //celle qui marche ..\n // $query = $this->db->get('locations');\n // return $query->result_array();\n $this->db->select('*'); \n $this->db->from('locations');\n $this->db->join ('carsToRent','carsToRent.ctr_id = locations.ctr_id');\n $this->db->join ('carDetails','carDetails.cd_id = carsToRent.cd_id');\n $this->db->join ('locationStatement','locationStatement.ls_id = locations.ls_id');\n $query = $this->db->get();\n return $query->result_array();\n \n }\n else {\n // $query = $this->db->get_where('locations', array('ctr_id' => $id));\n $this->db->select('*')\n ->from('locations')\n ->where('ctr_id',$id)\n ->join ('carDetails','carDetails.cd_id = locations.cd_id');\n $query = $this->db->get();\n return $query->row_array();\n }\n}", "public function getCommondata()\n {\n $select = $this->select()\n // ->setIntegrityCheck(false)\n ->from(array('album' => 'album'),array('Id','name_n'))\n ->join('album_det','album_det.Id = album.Id',array('album_det.Id'));\n // $result=$this->fetchAll($hhh);\n $result = $this->fetchAll($select);\n \n echo \"<pre>\";\n print_r($result);exit;\n return $result;\n\n }", "public function consultaOfertas(){\n //join Tabla2 T2 ON T1.PK = T2.FK\n \n //select * from Tabla1 T1, Tabla2 T2\n //WHERE T!.PK = T2.FK\n \n \n \n //$this->db->select(\"*\"); \n //$this->db->from(\"productos\");//nombrebase\n //$this->db->join(\"carrera\",\"alumno.idCarrera = carrera.idCarrera\");\n \n //$sql = $this->db->get();\n //return $sql->result();\n }", "public function listProductsPack($params)\n{\n // $prdId = $this->db->real_escape_string($params);\n // $qry = \"SELECT pr.prd_id, pr.prd_sku, pr.prd_name, pr.prd_price, pk.prd_parent \n // FROM ctt_products_packages AS pk\n // INNER JOIN ctt_products AS pr ON pr.prd_id = pk.prd_id\n // WHERE pk.prd_parent = $prdId AND prd_status =1;\";\n // return $this->db->query($qry);\n}", "function get_mapping() {\n\n\n $query = $this->db->query('SELECT\n A.map_id\n ,C1.stage_title AS place_name\n ,C2.stage_title AS dress_name\n ,C3.stage_title AS crown_name\n ,C4.stage_title AS stage_name\n ,C5.stage_title AS props_name\n ,B.character_name AS char_name \n ,A.image_path \nFROM mapping AS A\nINNER JOIN stage AS C1\n ON A.place_id = C1.id\nINNER JOIN stage AS C2\n ON A.dress_id = C2.id\n\n INNER JOIN stage AS C3\n ON A.crown_id = C3.id\n\n INNER JOIN stage AS C4\n ON A.stage_id = C4.id\n \n INNER JOIN stage AS C5\n ON A.props_id = C5.id\n\nINNER JOIN napoleon_characters AS B ON A.character_id = B.character_id');\n\n// $this->db->where('id', $intid);\n// $query = $this->db->get();\n// echo \"<pre>\";\n// print_r($query->result_array());\n// die;\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n else {\n return array();\n }\n }", "function getRows($params = array()){\r\r\n $this->db->select('a.*, b.product_name,b.cat_name,b.pro_id as product_code,b.main_img,b.price');\r\r\n $this->db->from($this->wishlistTbl.\" a\");\r\r\n $this->db->join('products b', 'b.id=a.product_id', 'left');\r\r\n $this->db->where('a.user_id',$params);\r\r\n // echo $this->db->last_query();\r\r\n //$cnt = $this->db->count_all_results();\r\r\n $query = $this->db->get();\r\r\n $result = ($query->num_rows() > 0)?$query->result_array():false;\r\r\n\r\r\n //return fetched data\r\r\n return $result;\r\r\n }", "function get_it($npm){\n $this->db->select('mahasiswa.*,prodi.nama_prodi');\n $this->db->from('mahasiswa');\n $this->db->where('npm', $npm);\n $this->db->join('prodi', 'prodi.id_prodi = mahasiswa.id_prodi', 'left');\n $this->db->order_by('id_mahasiswa', 'desc');\n $query = $this->db->get();\n return $query->row();\n }", "public function getAllProduct(){\n $this->db->select('p.id,p.title,p.image,c.category');\n $this->db->from('product p, category c');\n $this->db->where('p.status','t');\n $this->db->where('p.category_id=c.id');\n $this->db->order_by(\"id\", \"desc\");\n $query = $this->db->get();\n return $query->result(); \n }", "function getallepics()\n {\n //$allepics = \"SELECT * from epics\";\n $allepics= \"SELECT e.*,staff.*,epics_statuses.name as epicsname,team.name as teamname\n FROM epics AS e\n LEFT JOIN epics_statuses AS epics_statuses ON epics_statuses.id = e.e_status_id\n LEFT JOIN team AS team ON team.id = e.team_id\n LEFT JOIN staff AS staff ON staff.staff_id = e.e_owner\"; \n $allepicsresult = $this->ds->select($allepics); \n //print_r($myepicsresult);\n return $allepicsresult;\n }", "public function fetch_products() {\n $this->db->select('product.id,product.name,product.price,product.status,(SELECT product_images.image_name FROM product_images WHERE product_images.product_id = product.id ORDER BY id ASC LIMIT 1) AS pr_img');\n $this->db->from('product');\n $this->db->where('is_featured', '1');\n $r = $this->db->get();\n\n return $r->result_array();\n }", "function getJD($id){\n\t $data=array();\n\t\t $this->db->select('filepath,filename');\n\t\t $this->db->from('pof_attachment');\n\t\t $this->db->where('pof_id', $id);\n\t\t $Q = $this->db->get();\n\t\t if ($Q->num_rows() > 0){\n\t foreach ($Q->result_array() as $row)\n\t\t {\n\t $data=$row;\n\t }\n\t }\n\t $Q->free_result(); \n\t return $data; \n\t\t }", "function immagini_get($id_imm=\"\"){\n $db = new db(DB_USER,DB_PASSWORD,DB_NAME,DB_HOST);\n\t\n\t$q_foto=\"SELECT immagine.* FROM imm_img JOIN immagine on immagine.id_img=imm_img.id_img WHERE imm_img.id_imm =$id_imm ORDER BY `ordine` ASC\";\n \n\t$r_foto=$db->query($q_foto);\n while($row_foto = mysql_fetch_assoc($r_foto))\n {\n $rows_foto[] = $row_foto;\n }\n \n return $rows_foto;\n\n \n}", "function get_joinFG($data,$key=FALSE,$column=FALSE){ //Zulmi Adi Rizki 23 Juli 2013\n\t\t\n\t\tif($key == TRUE){\n\t\t\tif(!is_array($key)){\n\t\t\t\t$this->db->where($key);\n\t\t\t} else {\n\t\t\t\t$key = array_map('htmlentities', $key);\n\t\t\t\t$this->db->where($key);\n\t\t\t}\n\t\t}\n\t\t$this->db->select($column == FALSE ? \"*\" : $column)->from($this->table_name);\n\t\tforeach($data as $row){\n\t\t\tif($row[\"join_type\"] != NULL){\n\t\t\t\t$this->db->join($row[\"join_table\"],$row[\"table\"].\".\".$row[\"join_key\"].\"=\".$row[\"join_table\"].\".\".$row[\"join_key\"], $row[\"join_type\"]);\n\t\t\t} else {\n\t\t\t\t$this->db->join($row[\"join_table\"],$row[\"table\"].\".\".$row[\"join_key\"].\"=\".$row[\"join_table\"].\".\".$row[\"join_key\"]);\n\t\t\t}\n\t\t}\n\t\t$this->flexigrid->build_query();\n\t\t$return['records'] = $this->db->get();\n\t\t\n\t\tif($key == TRUE){\n\t\t\tif(!is_array($key)){\n\t\t\t\t$this->db->where($key);\n\t\t\t} else {\n\t\t\t\t$key = array_map('htmlentities', $key);\n\t\t\t\t$this->db->where($key);\n\t\t\t}\n\t\t}\n\t\t$this->db->select($column == FALSE ? \"*\" : $column)->from($this->table_name);\n\t\tforeach($data as $row){\n\t\t\tif($row[\"join_type\"] != NULL){\n\t\t\t\t$this->db->join($row[\"join_table\"],$row[\"table\"].\".\".$row[\"join_key\"].\"=\".$row[\"join_table\"].\".\".$row[\"join_key\"], $row[\"join_type\"]);\n\t\t\t} else {\n\t\t\t\t$this->db->join($row[\"join_table\"],$row[\"table\"].\".\".$row[\"join_key\"].\"=\".$row[\"join_table\"].\".\".$row[\"join_key\"]);\n\t\t\t}\n\t\t}\n\t\t$this->flexigrid->build_query(FALSE);\n\t\t$return['record_count'] = $this->db->count_all_results();\n\t\t\n\t\treturn $return;\n\t}", "function get_all()\n {\n $this->db->select('products.*, company_category.category');\n $this->db->join('company_category', 'company_category.id = products.cat_id');\n return $this->db->get($this->table)->result();\n }", "function getByIdPinjam($id){\n // $this->db->where('id_peminjaman',$id);\n // $query = $this->db->get('peminjaman');\n $query = $this->db->query(\"SELECT * FROM `peminjaman` LEFT JOIN prasarana ON peminjaman.id_prasarana = prasarana.id_prasarana LEFT JOIN sarana ON sarana.id_sarana = peminjaman.id_sarana where peminjaman.id_peminjaman = '$id'\");\n return $query->result_array(); //returns result in array forms(this is not necessary btw, let me know if u need only one line, or change \"$query->result_array()\" to \"$query->row()\")\n}", "function myjoin()\n {\n $this->db\n ->select('puestos.nombre AS pnombre')\n ->select('puestos.id AS pid')\n ->select('entidades.nombre AS enombre')\n ->select('entidades.id AS eid')\n ->select('departamentos.nombre AS dnombre')\n ->select('departamentos.id AS did')\n ->select('ubicaciones.nombre AS unombre')\n ->select('ubicaciones.id AS uid')\n ->join ('puestos', 'users.puesto = puestos.id' , 'left')\n ->join ('entidades', 'users.entidad = entidades.id' , 'left')\n ->join('departamentos', 'users.departamento = departamentos.id' , 'left')\n ->join('ubicaciones', 'users.ubicaciontrabajo = ubicaciones.id' , 'left');\n //$this->db->where('users.id',7);\n return $datosuser = $this->db->get('users')->result_array();\n }", "public function pagadaall(){\n$sql = $this->db->query(\"SELECT pago_factura.*, facturas.id_factura FROM pago_factura INNER JOIN facturas ON pago_factura.factura_id = facturas.id\");\nreturn $sql;\n}", "public function getAllProduct(){\n\t\t//query for get all data from tbl_product combinning with tbl_category(catName) and tbl_brand(brandName) using INNER JOIN\n\t\t$sql = \"SELECT tbl_product.*, tbl_category.catName, tbl_brand.brandName\n\t\t\t\tFROM tbl_product\n\t\t\t\tINNER JOIN tbl_category\n\t\t\t\tON tbl_product.catId = tbl_category.catId\n\t\t\t\tINNER JOIN tbl_brand\n\t\t\t\tON tbl_product.brandId = tbl_brand.brandId\n\t\t\t\tORDER BY tbl_product.pid DESC \";\n\t\t//Same Query using Alias(giving a temporary name to a table or Column)\n\t\t/*$sql = \"SELECT p.*, c.catName, b.brandName\n\t\t\t\tFROM tbl_product AS p, tbl_category AS c, tbl_brand AS b\n\t\t\t\tWHERE p.catId = c.catId AND p.brandId = b.brandId\n\t\t\t\tORDER BY p.pid DESC \";*/\n\t\t$result = $this->db->select($sql);\n\t\tif ($result) {\n\t\t\treturn $result;\n\t\t}else{\n\t\t\t$msg = \"<span class='error'>Product not found !.</span>\";\n\t\t\treturn $msg;\n\t\t}\n\t}", "function operasiJoin3(){\n\t\t$date = date('Y-m-d');\n\t\t$query = $this->db->query(\"SELECT k.id_kondisi, k .kondisi, k.id_alat, a.id_kategori, k.tanggal, k.keterangan AS keterangan_kondisi , a.nama_alat FROM kondisi k INNER JOIN alat a ON k.id_alat = a.id_alat WHERE k.tanggal='$date' GROUP BY a.id_alat\"); \n\t\treturn $query->result();\n\t}", "function GetChannelByIdMainPackage($id_package, $category_id) {\n \n \n $data= $this->db\n ->select('\n channel.*,\n package_channel.id_package\n ')\n ->join('channel','channel.id_channel = package_channel.id_channel','left')\n //->join('channel_category', 'channel_category.id_channel_category = channel.id_channel_category', 'left')\n ->where('package_channel.id_package',$id_package)\n ->where('channel.is_delete',0)\n ->where('channel.id_channel_category', $category_id)\n //->order_by('channel_category.position', 'asc')\n //->order_by('channel_category.id_channel_category','asc')\n ->order_by('channel.position_in_type','asc')\n ->order_by('channel.id_channel','desc')\n ->get('package_channel')\n ->result_array();\n \n \n return $data;\n }", "function ambil_data()\n \t{\n \t\t$this->db->distinct();\n \t\t$this->db->select('bk.id_buku, s.nama_supplier, bk.judul, bk.tema, bk.penulis, bk.harga');\n \t\t$this->db->from('buku bk');\n \t\t$this->db->join('supplier s', 's.id_supplier = bk.id_supplier');\n \t\treturn $this->db->get($this->nama_table)->result();\n\n \t\t$data['buku'] = $this->db->order_by($this->id, $this->order);\n \t\treturn $this->db->get($this->nama_table)->result();\n \t}", "function get_all_with_asso_car_detail()\n {\n try{\n $this->db->select('*');\n $this->db->from('car_detail a ' );\n $this->db->join('car_type b', 'b.type_id=a. type_id','left');\n $this->db->join('car_brand c', 'c.brand_id=a. brand_id','left');\n $this->db->join('car_version d', 'd.ver_id=a. ver_id','left');\n $query = $this->db->get(); \n if($query->num_rows() != 0){\n return $query->result_array();\n }else{\n return false;\n }\n } catch (Exception $ex) {\n throw new Exception('Car_detail_model model : Error in get_all_with_asso_car_detail function - ' . $ex);\n } \n }", "public function moinhat(){\n $this->db->select($this->column_bosuutap);\n $this->db->from(\"$this->table\");\n $this->db->join($this->table_trans, \"$this->table.id = $this->table_trans.id\");\n $this->db->where(\"$this->table_trans.language_code\", \"vi\");\n $this->db->order_by(\"$this->table.id\", 'DESC');\n $query = $this->db->get();//var_dump($this->db->last_query()); exit();\n return $query->result();\n }", "function getPackageByID($package_id){\n\t\t $query = \"select * from package where id = $package_id\";\n\t\t $result = mysql_query($query);\n\t\t if($result){\n\t\t\t$row = mysql_fetch_assoc($result);\n\t\t\t$row['icon_image'] = $row['icon_image'] !==\"\"? $this->Check_exists_img($row['icon_image']) : \"dist/img/boxed-bg.jpg\";\n\t\t\t$row['slider_image1'] = $row['slider_image1'] !==\"\"? $this->Check_exists_img($row['slider_image1']) : \"img/boxed-bg.jpg\";\n\t\t\t\n\t\t\treturn $row;\n\t\t }\n\t\t}", "public function query_employee(){\n $this->db->select('*');\n $this->db->from('hr_pic_center');\n $this->db->join('hr_section','hr_section.sec_id = hr_pic_center.pic_sec_id');\n $this->db->join('hr_position','hr_position.position_id = hr_pic_center.pic_position_id');\n $this->db->where('hr_pic_center.pic_upd','00');\n\n $employee = $this->db->get();\n return $employee;\n }", "public function getRows($id = ''){ \r\n $this->db->select(\"*, (SELECT file_name FROM \".$this->imgTbl.\" WHERE gallery_id = \".$this->galleryTbl.\".id ORDER BY id DESC LIMIT 1) as default_image\"); \r\n $this->db->from($this->galleryTbl); \r\n if($id){ \r\n $this->db->where('id', $id); \r\n $query = $this->db->get(); \r\n $result = ($query->num_rows() > 0)?$query->row_array():array(); \r\n \r\n if(!empty($result)){ \r\n $this->db->select('*'); \r\n $this->db->from($this->imgTbl); \r\n $this->db->where('gallery_id', $result['id']); \r\n $this->db->order_by('id', 'desc'); \r\n $query = $this->db->get(); \r\n $result2 = ($query->num_rows() > 0)?$query->result_array():array(); \r\n $result['images'] = $result2; \r\n } \r\n }else{ \r\n $this->db->order_by('id', 'desc'); \r\n $query = $this->db->get(); \r\n $result = ($query->num_rows() > 0)?$query->result_array():array(); \r\n } \r\n \r\n // return fetched data \r\n return !empty($result)?$result:false; \r\n }", "public function getDetalles()\n {\n $sql = \"select z.id,z.nombre, z.identificacion, z.estado_excluido, y.descripcion, w.categoria , (SELECT a.monto FROM appexamenisw2.categorias a,\n appexamenisw2.beneficios e, appexamenisw2.estudiantes b, appexamenisw2.beneficio__estudiantes c\n where a.descripcion = 'aeo'\n and b.id = c.estudiante_id\n and e.id = c.beneficio_id\n and a.id = e.categoria_id\n and b.id = z.id) as 'aeo' ,\n (SELECT a.monto FROM appexamenisw2.categorias a,\n appexamenisw2.beneficios e, appexamenisw2.estudiantes b, appexamenisw2.beneficio__estudiantes c\n where a.descripcion = 'alim'\n and b.id = c.estudiante_id\n and e.id = c.beneficio_id\n and a.id = e.categoria_id\n and b.id = z.id) as alim,\n (SELECT a.monto FROM appexamenisw2.categorias a,\n appexamenisw2.beneficios e, appexamenisw2.estudiantes b, appexamenisw2.beneficio__estudiantes c\n where a.descripcion = 'pare'\n and b.id = c.estudiante_id\n and e.id = c.beneficio_id\n and a.id = e.categoria_id\n and b.id = z.id) as pare\n from appexamenisw2.estudiantes z, appexamenisw2.beneficios y, appexamenisw2.categorias w,\n appexamenisw2.beneficio__estudiantes v\n where z.id = v.estudiante_id\n and y.id = v.beneficio_id\n and w.id = y.categoria_id\n group by z.id,z.nombre, z.identificacion, z.id, z.estado_excluido, y.descripcion,w.categoria\n order by z.id;\";\n\n $arrayDetalles = DB::connection('mysql')->select($sql);\n $ab = array();\n $ab = $arrayDetalles;\n foreach($ab as $t){\n $t->aeo = Crypt::decrypt($t->aeo);\n $t->alim = Crypt::decrypt($t->alim);\n $t->pare = Crypt::decrypt($t->pare);\n //$t->categoria = Crypt::decrypt($t->categoria);\n //$t->monto = Crypt::decrypt($t->monto);\n //return $t->monto;\n }\n return json_encode($ab);\n }", "public function get_single_package_detail($package_id) {\n $this->db->select('*');\n $this->db->from('business_programs');\n $this->db->where('id', $package_id);\n $query = $this->db->get();\n $query_result = $query->result();\n $package_details = array();\n if (!empty($query_result)) {\n $package_details['package'] = $query_result[0];\n } else {\n $package_details['package'] = $query_result;\n }\n $this->db->select('business_services.*,business_services_details.*');\n $this->db->from('business_services');\n $this->db->join('business_services_details', 'business_services.id = business_services_details.service_id');\n $this->db->where('business_services.program_id', $package_details['package']->id);\n $query1 = $this->db->get();\n $query_result1 = $query1->result();\n\n if (!empty($query_result1)) {\n $package_details['service'] = $query_result1;\n }\n return $package_details;\n }", "function get_by_id($id)\n {\n /*$this->db->where($this->id, $id);*/\n $this->db->where('persediaan.id_persediaan', $id);\n $this->db->join('puskesmas', 'puskesmas.id_puskesmas=persediaan.id_puskesmas');\n $this->db->join('obat', 'obat.kode=persediaan.kode');\n $this->db->select('persediaan.id_persediaan');\n $this->db->select('nama_puskesmas');\n $this->db->select('kode');\n $this->db->select('nama_obat');\n $this->db->select('stok_awal');\n return $this->db->get($this->table)->row();\n }", "function Select_Peminjaman()\n \t{\n \t\t$this->db->distinct();\n \t\t$this->db->select('pg.id_kir, b.nama_barang, b.size, b.jenis, pg.stok , l.store, l.lokasi, l.alamat');\n \t\t$this->db->from('pengirim pg');\n \t\t$this->db->join('barang b', 'b.id = pg.id');\n \t\t$this->db->join('lokasi l', 'l.id_lok = pg.id_lok');\n \t\treturn $this->db->get($this->nama_table)->result();\n\n\n \t\t//$data['peminjaman'] = $this->db->order_by($this->id, $this->order);\n \t\t//return $this->db->get($this->nama_table)->result();\n \t}", "function get_by_id($id) {\n $this->db->join('tbl_ijin','tbl_out.id_ijin=tbl_ijin.id_ijin');\n $this->db->join('tbl_perusahaan','tbl_out.id_perusahaan=tbl_perusahaan.id_perusahaan');\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_all_prodi()\n {\n $this->db->join('jurusan', 'jurusan.id_jurusan = prodi.fk_id_jurusan');\n $this->db->order_by('id_prodi', 'desc');\n return $this->db->get('prodi')->result_array();\n }", "public function getData()\n {\n\n\n $query = $this->db->from('job_ads')\n ->join('cities', 'cities.cityId=job_ads.cityId')\n ->join('paper', 'paper.paperId=job_ads.paperId')\n ->join('departments', 'departments.depttId=job_ads.depttId')\n ->join('categories', 'categories.catId=job_ads.catId')\n ->get();\n return $query->result();\n }", "function select($id){\r\n\t\t$query = \"SELECT *\";\r\n\t\t$query .= \" FROM db_equipment_gen INNER JOIN db_group ON equipment_id_link_group=group_id\";\r\n\t\t$query .= \" INNER JOIN db_equipment_list ON equipment_list_gen_link=equipment_gen_id\";\r\n\t\t$query .= \" INNER JOIN db_equipment_pic ON equipment_id_link_pic=equipment_pic_id\";\r\n\t\t$query .= \" LEFT JOIN db_address ON equipment_list_address_link=address_id\";\r\n\t\t$query .= \" LEFT JOIN db_status ON equipment_list_status_link=status_id WHERE equipment_list_id = :ID LIMIT 1\";\r\n\t\t\r\n\t\t$sth=$this->db->select($query,array(':ID'=>$id));\r\n\t\t\r\n\t\t\t$query = \"SELECT group_id,group_name FROM db_group WHERE group_status=0\";\r\n\t\t\t$group=$this->db->select($query,array());\r\n\t\t\t$query = \"SELECT status_id,status_name FROM db_status WHERE status_status=0\";\r\n\t\t\t$status=$this->db->select($query,array());\r\n\t\t\t$query = \"SELECT address_id,address_name FROM db_address WHERE address_status=0\";\r\n\t\t\t$address=$this->db->select($query,array());\r\n\t\t\r\n\t\t$data = array(\"equipment\",0,10,\"\",1,10,0,0,$sth,$group,$status,$address);\r\n\t\t\r\n\t\treturn $data;\r\n\t\t}", "public function ambil_id($id, $id_kamar){\n $hasil = $this->db->select('*');\n $hasil = $this->db->from('datakos');\n $hasil = $this->db->join('tipekamar','datakos.id_kos = tipekamar.id_kos', 'left');\n $hasil = $this->db->join('pemilik', 'datakos.id_pemilik = pemilik.id_pemilik');\n $hasil = $this->db->where('tipekamar.id_kos', $id );\n $hasil = $this->db->where('tipekamar.id_kamar', $id_kamar );\n $hasil = $this->db->limit('1');\n $query= $this->db->get();\n return $query->result_array();\n}", "public function get_branch_products($branch_id)\n {\n // LEFT JOIN branch_products bp ON (p.product_id = bp.product_id)\n // WHERE branch_id=$branch_id\n // GROUP BY p.product_id \"); \n\n $query = $this->db->query(\" SELECT p.product_id, p.name AS product_name,p.price AS default_price,p.product_code AS productcode,bp.*,`pc`.`name` AS catName FROM product p LEFT JOIN branch_products bp ON (p.product_id = bp.product_id) LEFT JOIN branch b ON b.branch_id = bp.branch_id\n LEFT JOIN product_category pc ON pc.product_category_id = p.product_category_id WHERE bp.branch_id=$branch_id AND b.brand_id=(SELECT brand_id FROM branch b WHERE branch_id=$branch_id) GROUP BY p.product_id \");\n\n $result = $query->result_array();\n\n //$query = $this->db->get_where('branch_products', array('branch_products_id' => $id));\n // $rows = $query->num_rows();\n // echo 'ROWS:'.$rows;die;\n //$result = $query->result_array();\n // $str = $this->db->last_query();\n // echo $str;\n\n // $totalRows = $query->num_rows();\n\n // if( $totalRows > 0 )\n // {\n // $result = $query->result_array();\n // }\n // else\n // {\n // $query = $this->db->query(\" SELECT p.product_id, p.name AS product_name,p.price AS default_price,p.product_code AS productcode,bp.*,NULL AS is_available FROM product p\n // LEFT JOIN branch_products bp ON (p.product_id = bp.product_id)\n // GROUP BY p.product_id \"); \n // $result = $query->result_array(); \n // }\n\n return $result; \n }", "function operasiJoin4($date){\t\n\t\t$query = $this->db->query(\"SELECT k.id_kondisi, k .kondisi, k.id_alat, a.id_kategori, k.tanggal, k.keterangan AS keterangan_kondisi , a.nama_alat FROM kondisi k INNER JOIN alat a ON k.id_alat = a.id_alat WHERE k.tanggal='$date' GROUP BY a.id_alat\"); \n\t\treturn $query->result();\n\t}", "function GetPackageGroupDataById($id_package) {\n \n $data = $this->db\n ->where('is_delete',0)\n ->where('id_status',1)\n ->where('id_package_group',$id_package)\n ->order_by('position','asc')\n ->get('package_group')\n ->row_array();\n \n if($data){\n // foreach ($data as $key=>$package_combo) {\n $data['item'] = $this->db\n ->where('id_package_group',$data['id_package_group'])\n ->get('package_group_item')\n ->result_array();\n\n //for christmas discount\n $real_price = $data['price'];\n $total_diskon_10 = floor( ( $real_price / 100) * 10 );\n \n $harga_natal = $real_price - $total_diskon_10; // 10% off for discount\n $data['real_price'] = $real_price;\n $data['price_diskon_10percent'] = $total_diskon_10;\n //$data['price_natal'] = $harga_natal;\n $data['price'] = $harga_natal; //final price\n\n foreach ($data['item'] as $key2 => $value) {\n $detail = $this->GetPackageByIdDataGroup($value['id_package'],$value['type']);\n $data['item'][$key2]['name'] = $detail['name'];\n $data['item'][$key2]['price'] = $detail['price'];\n }\n \n /*echo '<pre>';\n print_r($data);\n die();*/\n\n //}\n \n }\n \n \n return $data;\n }", "function projectView($connect, $id) {\n\n\n $query = \"SELECT\n\t\t\t p.`id` AS id_project,\n\t\t\t p.`name`,\n\t\t\t p.description AS `description`,\n\t\t\t GROUP_CONCAT(DISTINCT s.id) AS images,\n\t\t\t s2.id AS title_img\n\t\t\t FROM project AS p\n\t\t\t LEFT JOIN `images` AS s2\n\t\t\t ON p.`id` = s2.`id_project`\n\t\t\t AND s2.is_title = 1\n\t\t\t AND s2.to_arc = 0\n\t\t\t AND s2.on_header = 0\n\t\t\t LEFT JOIN `images` AS s\n\t\t\t ON p.`id` = s.`id_project`\n\t\t\t AND s.is_title = 0\n\t\t\t AND s.to_arc = 0\n\t\t\t AND s.on_header = 0\n\t\t\t WHERE p.`to_arc` = 0\n \t\t AND p.`is_project` = 1\n \t\t\t AND p.id = $id\n\t\t\t GROUP BY p.`id` \";\n\t$query=mysqli_query($connect, $query);\n\n\t$aResult = mysqli_fetch_array($query);\n\n//\t$aResult = explode(\",\",$aResult[\"images\"]);\n\n// if(!$aResult) {\n// DIE(\"Грешка при заявката: \".mysqli_error($connect));\n// }\n return $aResult;\n}", "function GetLayout(){\n\t//Building the query\n\t$stringBuilder = \"SELECT l.layout_id, l.font, l.font_color, l.background_color, l.default_background, l.logo, fbg.location AS backgroundLocation, flogo.location AS logoLocation \";\n\t$stringBuilder .= \"FROM layout l \";\n\t$stringBuilder .= \"INNER JOIN `file` fbg ON fbg.file_id=l.default_background \";\n\t$stringBuilder .= \"INNER JOIN `file` flogo ON flogo.file_id=l.logo \";\n\t$stringBuilder .= \"ORDER BY l.layout_id DESC \";\t\n\n\t// Preparing query\n\t$query = GetDatabaseConnection()->prepare($stringBuilder);\n\t$query->execute(array()); //Putting in the parameters\n\t$result = $query->fetchAll(); //Fetching it\n\treturn $result;\n}", "function get_table_join($select_data, $table, $join_table, $join_data, $join_type, $where_data){\n\t\n\t$this->db->select($select_data);\n\t$this->db->from($table);\n\t$this->db->join($join_table, $join_data, $join_type);\n\t$this->db->where($where_data);\n\t$this->db->order_by(\"sub1_id\",\"asc\");\n\t\n\t$query = $this->db->get();\n\t$result = $query->result_array(); \n\treturn $result;\t\n}", "function operasiJoin2(){\n\t\t$date = date('Y-m-d');\n\t\t$query = $this->db->query(\"SELECT o.id_operasi, o.operasi, o.id_alat, a.id_kategori, o.tanggal, o.keterangan, a.nama_alat FROM operasi o INNER JOIN alat a ON o.id_alat = a.id_alat\"); \n\t\treturn $query->result();\n\t}", "function get_prodi($id_prodi)\n {\n // return $this->db->get_where('prodi',array('id_prodi'=>$id_prodi))->row_array();\n\n $this->db->select ( '\n prodi.*, \n jurusan.id_jurusan as id_jurusan, \n jurusan.nama_jurusan\n ' );\n $this->db->join('jurusan', 'jurusan.id_jurusan = prodi.fk_id_jurusan');\n\n $query = $this->db->get_where('prodi', array('prodi.id_prodi' => $id_prodi));\n \n return $query->row();\n }", "function get_list()\n {\n \tif($this->table_name === null)\n \t\treturn false;\n \t\n \t$select = \"{$this->table_name}.*\";\n $select .= \", deposito.no_rekening, nasabah.NAMA_NASABAH, nasabah.ALAMAT,\";\n \t\n\t\t// ADD YOUR SELECT FROM JOIN HERE <------------------------------------------------------\n\t\t// for example $select .= \", user_log.created_date, user_log.update_date\";\n\t\t\n \tif(!empty($this->relation))\n \t\tforeach($this->relation as $relation)\n \t\t{\n \t\t\tlist($field_name , $related_table , $related_field_title) = $relation;\n \t\t\t$unique_join_name = $this->_unique_join_name($field_name);\n \t\t\t$unique_field_name = $this->_unique_field_name($field_name);\n \t\t\t\n\t\t\t\tif(strstr($related_field_title,'{'))\n \t\t\t\t$select .= \", CONCAT('\".str_replace(array('{','}'),array(\"',COALESCE({$unique_join_name}.\",\", ''),'\"),str_replace(\"'\",\"\\\\'\",$related_field_title)).\"') as $unique_field_name\";\n \t\t\telse \t\t\t\n \t\t\t\t$select .= \", $unique_join_name.$related_field_title as $unique_field_name\";\n \t\t\t\n \t\t\tif($this->field_exists($related_field_title))\n \t\t\t\t$select .= \", {$this->table_name}.$related_field_title as '{$this->table_name}.$related_field_title'\";\n \t\t}\n \t\t\n \t$this->db->select($select, false);\n \t\n // ADD YOUR JOIN HERE for example: <------------------------------------------------------\n // $this->db->join('user_log','user_log.user_id = users.id');\n $this->db->join('nasabah','nasabah.NASABAH_ID = '.$this->table_name.'.NASABAH_ID');\n \t$results = $this->db->get($this->table_name)->result();\n \t\n \treturn $results;\n }", "public function get_records() {\n\n $this->db->where('`entry_id` IN (SELECT MAX(`entry_id`) FROM `entries` GROUP BY `b_id`)', NULL, FALSE);\n $this->db->select('b_name');\n $this->db->select('entry_type');\n $this->db->select('outcome');\n $this->db->select('entries.b_id');\n\n $this->db->select(\"DATE_FORMAT(entry_date,'%b %d, %Y') AS entry_date\");\n $this->db->select('notes');\n $this->db->from('entries');\n\n $this->db->join('type', 'type.type_id = entries.type_id');\n $this->db->join('business', 'business.b_id = entries.b_id');\n $this->db->join('outcomes', 'outcomes.out_id = entries.out_id');\n\n $this->db->order_by('entry_date', 'desc');\n\n $query = $this->db->get();\n\n return $query->result();\n\n }", "public function Franchisepackagelist($masterid) {\n $this->db->select('accounts.package_id,packages.item_limit,packages.name');\n $this->db->where('accounts.account_id', $masterid);\n $this->db->where('account_type', 2);\n $this->db->from('accounts');\n $this->db->join('packages', 'accounts.package_id=packages.id');\n $this->db->group_by('accounts.package_id');\n $package = $this->db->get()->result();\n return $package;\n }", "function get_tarifkelas($id)\n {\n $this->db->select('a.*,b.kelas');\n $this->db->from('m_tarifkelas a');\n $this->db->join('m_kelas b', 'a.kdkelas = b.kdkelas', 'LEFT');\n $this->db->where('a.kdtarif', $id);\n return $this->db->get()->result();\n }", "public function lipstick()\n {\n // FROM `tb_barang` JOIN `kategori`\n // ON `tb_barang`.`id_kategori` = `kategori`.`id_kategori`\n // WHERE `id_kategori` = $id_kategori\n // \";\n // return $this->db->query($query)->result_array();\n\n return $this->db->get_where('tb_barang', ['id_kategori' => '1'])->result_array();\n }", "function get_all_m_jadwal_praktek_antrian($jadwal_praktek_fk)\n {\n $where ='';\n if ($jadwal_praktek_fk!=0) {\n $where = \"AND a.jadwal_praktek_fk='$jadwal_praktek_fk'\";\n }\n $this->db->query(\" SELECT *,a.pk as id,b.nama as pasien,c.id_session_jadwal, d.metode_bayar\n FROM m_jadwal_praktek_antrian a\n LEFT JOIN m_kontak b on a.pasien_fk = b.pk\n LEFT JOIN m_jadwal_praktek c on a.jadwal_praktek_fk = c.pk \n\t\t\t\t\t\t\t\t LEFT JOIN m_metode_pembayaran d on a.metode_pembayaran_fk = d.pk\n WHERE 1=1 $where ORDER BY jadwal_praktek_fk,nomor_urut asc\")->result_array();\n\n\n /*$this->db->get('m_jadwal_praktek_antrian')->result_array();*/\n }", "function GetPackageByIdData($id_package) {\n $data = $this->db\n ->where('id_status',1)\n ->where('is_delete',0)\n ->where('id_package',$id_package)\n ->limit(1)\n ->get('package')\n ->row_array();\n return $data;\n }", "function get_single_object_info($id,$table, $Manipulation){\r\n $this->db->select('*');\r\n // $this->db->select('c.name as country_name');\r\n $this->db->from($table);\r\n // $this->db->join('country c','c.id = u.country','LEFT');\r\n $this->db->where($Manipulation,$id);\r\n $query = $this->db->get();\r\n $query = $query->row(); \r\n return $query;\r\n }", "public function imgShow($id)\n {\n $this->db->where('id', $id);\n $query1 = $this->db->from('job_ads')\n ->join('cities', 'cities.cityId=job_ads.cityId')\n ->join('paper', 'paper.paperId=job_ads.paperId')\n ->join('departments', 'departments.depttId=job_ads.depttId')\n ->join('categories', 'categories.catId=job_ads.catId')\n ->get();\n return $query1->row_array();\n }", "public function get_recipe_information() {\n $this->db->select('recipe.id,recipe.ar_name as rec_ar_name,recipe.en_name as rec_en_name,recipe.details,recipe.barcode,recipe_information.invoice_number,recipe_information.size,recipe_information.color,recipe_information.weight,recipe_information.expirey_date,recipe_information.cost_price,recipe_information.sale_price,recipe_information.whole_price,recipe_information.qty,brand.en_name as brand_en_name,brand.ar_name as brand_ar_name,supplier.name,recipe_information.disable as info_disable,recipe.disable as rec_disable ');\n $this->db->from('recipe');\n $this->db->join('recipe_information', 'recipe.id = recipe_information.recipe_id','left');\n $this->db->join('brand', 'brand.id = recipe.brand_id','left');\n $this->db->join('supplier', 'supplier.id = recipe_information.supplier_id','left');\n $query = $this->db->get();\n return $query->result();\n }", "function get_join($data,$key=FALSE,$single=FALSE,$column=FALSE){ //Zulmi Adi Rizki 23 Juli 2013\n\t\tforeach($data as $row){\n\t\t\t$this->db->join($row[\"join_table\"],$row[\"table\"].\".\".$row[\"join_key\"].\"=\".$row[\"join_table\"].\".\".$row[\"join_key\"]);\n\t\t}\n\t\tif($key == TRUE){\n\t\t\tif(!is_array($key)){\n\t\t\t\t$this->db->where($key);\n\t\t\t} else {\n\t\t\t\t$key = array_map('htmlentities', $key);\n\t\t\t\t$this->db->where($key);\n\t\t\t}\n\t\t}\n\t\tcount($this->db->ar_orderby) || $this->db->order_by($this->order_by);\n\t\t$this->db->select($column == FALSE ? \"*\" : $column)->from($this->table_name);\n\t\t$single == FALSE || $this->db->limit(1);\n\t\t$method = $single ? 'row_array' : 'result_array';\n\t\treturn $this->db->get()->$method();\n\t}", "public function getall_details4($id){\n\t \t $query=\"SELECT ads.*,user.phone,user.address FROM ads INNER JOIN user ON ads.email=user.email WHERE no='$id' \";\n\t \t $result=$this->db->select( $query);\n\t \t return $result;\n\n\n\t }", "function tampil_data()\n\t{\n\t\t# perintah join digunakan untuk menggabungkan 2 table, yaitu penduduk dan kematian, agar data yang tampil lebih detail, karena pada tabel kematian hanya terdapat sedikit kolom, sehingga dengan menambah kolom nik, maka data yang ada di tabel penduduk juga otomatis terdeteksi karena perintah join, dengan aturan, nik harus sama antara tabel kematian dan nik yang ada di penduduk.\n\t\treturn $this->db->query(\"SELECT*FROM `kematian` left join penduduk on kematian.nik = penduduk.nik\")->result();\n\t}", "Function getsqlproduit($id)\n{\n $query='SELECT PR.prix,PR.description,PR.titre as titre,PR.prix,PR.photo,PR.ref,PR.description,PR.idcat,CA.titre as cat_titre from produits PR, categories CA where PR.idcat=CA.idcat and pr.idpr='.$id.';';\n $result=selectTable($query);\n if($result==false){\n return false;\n }else{\n return $result[0];\n }\n // test si resultat est ok et gérer renvoi\n\n}", "public function ambil_data()\n {\n $this->db->select('berita.*, kategori.nama_kategori');\n $this->db->from('berita');\n $this->db->join('kategori', 'kategori.id_kategori = berita.id_kategori','left');\n $this->db->order_by('tanggal', 'ASC');\n $query = $this->db->get();\n return $query;\n }", "function getOrder_detail($orderid){\n$reesult= array();\n$result=$this->db->where(\"order_id\", $orderid)->get('order_products')->result();\n return $result;\n }", "public function get_details_post()\n{\n $where = array('id'=>1);\n //$where1 = array('status'=>1,'company_id'=>$id);\n $data = $this->model->getAllwhere('details',$where,',id,company_name,theme_color,lat,long,gst_no,punch_line,logo,CONCAT(\"'.base_url().'\",\"asset/uploads/\",logo)AS logo,CONCAT(\"'.base_url().'\",\"asset/uploads/\",logo)AS logo','ASC');\n //print_r($data);\n $resp = array('rccode' => 200,'message' =>\"success\", 'detials'=>$data);\n $this->response($resp);\n}", "public function getAllByUser(){\n $sql = \"SELECT p.* FROM pedidos p \"\n //. \"INNER JOIN lineas_pedidos lp ON p.id = lp.pedido_id \"\n . \"WHERE p.usuario_id = {$this->getUsuario_id()} ORDER BY id DESC\";\n\n $pedido = $this->db->query($sql);\n\n \n //echo $this->db->error;\n \n return $pedido;\n \n}", "public function getImgByProduct($id){\n $this->db->select('*');\n $this->db->where('id_product', $id);\n $this->db->from($this->product_img); \n return $this->db->get();\n }", "public function getAll() {\n $this->db->select('a.id_tp as \"id_tp\", a.id_hewan as \"id_hewan\", b.nama as \"hewan\", a.id_pegawai_k as \"id_pegawai_k\", c.nama as \"Kasir\", a.id_pegawai_cs as \"id_pegawai_cs\", d.nama as \"customer_service\",\n a.kode as \"kode\", a.tanggal as \"tanggal\", \n a.sub_total as \"sub_total\", a.total_harga as \"total_harga\", a.status as \"status\",a.created_at as \"created_at\", a.updated_at as \"updated_at\",\n a.created_by as \"created_by\", a.updated_by as \"updated_by\"');\n $this->db->from('transaksi_produk a');\n $this->db->join('hewan b', 'id_hewan');\n $this->db->join('pegawai c', 'a.id_pegawai_cs = c.id_pegawai');\n $this->db->join('pegawai d', 'a.id_pegawai_cs = d.id_pegawai');\n $this->db->where('a.status =', 'Penjualan');\n return $query = $this->db->get()->result_array(); \n }", "public function query(){\n // $this->db->select('idk,id_kain,nm_kain')\n $this->db->select('*')\n ->from($this->table);\n }", "public function importData()\n {\n /*$this->db->where('delete_status','0'); \n $data = $this->db->get('item');\n \treturn $data->result();*/\n \treturn $this->db->SELECT('c.category_name,u.unit_name,i.hsn_code,t.tax_name,i.item_name,i.item_description,i.purchase_price,i.sales_price')\n\t\t\t\t\t\t\t->FROM('category c')\n\t\t\t\t\t\t\t->JOIN('item i','i.category_id=c.id')\n\t\t\t\t\t\t\t->JOIN('tax t','i.tax_id=t.tax_id')\n\t\t\t\t\t\t\t->JOIN('unit u','i.unit_id=u.id')\n\t\t\t\t\t\t\t->get()\n\t\t\t\t\t\t\t->row();\n\n /*$this->db->select('c.category_name,u.unit_name,t.tax_name,i.item_name,i.item_description,i.purchase_price,i.sales_price');\n $this->db->from('item i');\n $this->db->join('category c','c.id = i.category_id');\n $this->db->join('tax t','t.tax_id = i.tax_id');\n $this->db->join('unit u','u.id = i._id');*/\n\n\n }", "public function masterpackagelist($masterid) {\n $this->db->select('accounts.package_id,packages.item_limit,packages.name');\n $this->db->where('accounts.account_id', $masterid);\n $this->db->where('account_type', 1);\n $this->db->from('accounts');\n $this->db->join('packages', 'accounts.package_id=packages.id');\n $this->db->group_by('accounts.package_id');\n $package = $this->db->get()->result();\n return $package;\n }", "function getById($id){\n // $query = $this->db->query(\"select * FROM prasarana INNER JOIN peminjaman ON prasarana.id_prasarana = peminjaman.id_prasarana INNER JOIN verifikasi ON verifikasi.id_peminjaman = peminjaman.id_peminjaman LEFT JOIN mahasiswa ON mahasiswa.nim = peminjaman.nim LEFT JOIN staff ON staff.nip = peminjaman.nip WHERE peminjaman.nim = '123' or peminjaman.nip = '123'\");\n $query = $this->db->query(\"SELECT * FROM `peminjaman` left join prasarana on peminjaman.id_prasarana = prasarana.id_prasarana left join sarana on sarana.id_sarana = peminjaman.id_sarana LEFT JOIN pengembalian ON pengembalian.id_peminjaman = peminjaman.id_peminjaman LEFT JOIN verifikasi ON verifikasi.id_peminjaman = peminjaman.id_peminjaman LEFT JOIN mahasiswa ON mahasiswa.nim = peminjaman.nim LEFT JOIN staff ON staff.nip = peminjaman.nip WHERE peminjaman.nim = '$id' or peminjaman.nip = '$id' order by peminjaman.id_peminjaman ASC\");\n // $this->db->where('nim',$id);\n // $query = $this->db->get('peminjaman');\n return $query->result(); //returns result in array forms(this is not necessary btw, let me know if u need only one line, or change \"$query->result_array()\" to \"$query->row()\")\n}", "function goods_viewImgProduct(){\n $sql = \"select * from gd_image where get_imgid=:get_imgid order by gd_imgid ASC\";\n $args = [':get_imgid'=>$this->id];\n return $this->run($sql, $args);\n }", "public function select_driver_location1()\n {\n $this->db->select('user.*');\n\t$this->db->from('user');\n\t$this->db->join('orders', 'user.user_id = orders.driver_id', 'left'); \t \n\t$this->db->where('user.user_type', 2);\n\t$this->db->where('user.login_status', \"yes\");\n\t$query = $this->db->get();\n\t$data1= $query->result(); \n\t//print_r($data1);die;\n\t//$data11='';\n \n\t\tforeach($data1 as $row)\n\t\t{\n\t\t\n\t\t$data[]=array(\"lat\"=>$row->latitude,\"lng\"=>$row->longitude,\"description\"=>$row->sub.\"<div class='shub'><img src='http://freebizoffer.com/apptech/pick&drop/courierapp/api/upload/$row->profile_image' style='float:left;margin-right:10px; border-radius: 100%;\n border: 1px solid #fff;\n margin-left: 5px;\n margin-top: 5px;\n margin-bottom: 0px;' width='50' height='50'></td><td>Driver-\". $row->firstname .\"\". $row->lastname .\"<br>Driver Id-\". $row->user_id .\"<br>Type -\". $row->vehicle_type,\"image\"=>\"https://cdn4.iconfinder.com/data/icons/car-silhouettes/1000/city-car-512.png\",\"vehicle_type\"=>$row->vehicle_type);\n\t\t}\n\t\t//print_r($data);die;\n return $data;\n }", "public function data($id = null)\n\t{\n if($id != null)\n {\n return $this->db->get($this->table, \"*\", [$this->primaryKey => $id]);\n }\n else\n {\n // return $this->db->query(\"SELECT bidang.*, pegawai.nama FROM bidang JOIN pegawai ON bidang.nip = pegawai.nip\")->fetchAll(PDO::FETCH_ASSOC);\n return $this->db->query(\"SELECT * from bidang\")->fetchAll(PDO::FETCH_ASSOC);\n }\n\t}", "public function f_get_distPoints()\n {\n\n // $sql = $this->db->query(\"SELECT DISTINCT a.sl_no, b.bdo_name \n // FROM md_dist_point a , md_dm_bdo b \n // WHERE a.dist_cd = b.dist_cd\n // AND a.sdo = b.sdo_cd\n // AND a.bdo = b.sl_no \");\n\n$sql = $this->db->query(\"SELECT DISTINCT a.sl_no, b.bdo_name,c.sdo_name sdo_name,a.agent\n FROM md_dist_point a , md_dm_bdo b ,md_dm_sdo c\n WHERE a.dist_cd = b.dist_cd \n AND b.dist_cd = c.dist_cd\n and a.sdo =c.sl_no\n and a.bdo = b.sl_no\");\n echo $this->db->last_query();\n return $sql->result();\n \n }", "function operasiJoin(){\n\t\t$date = date('Y-m-d');\n\t\t$query = $this->db->query(\"SELECT o.id_operasi, o.operasi, o.id_alat, a.id_kategori, o.tanggal, o.keterangan, a.nama_alat FROM operasi o INNER JOIN alat a ON o.id_alat = a.id_alat WHERE o.tanggal = '$date'\"); \n\t\treturn $query->result();\n\t}", "public function selectAllJabatan(){\n\n // return $query->result();\n $this->db->select('t_user.jabatan, t_user.tipe');\n $this->db->from($this->tableName);\n $this->db->group_by('jabatan');\n return $this->db->get(); \n }", "function get_by_idpuskesmas($id)\n {\n $this->db->where('persediaan.id_puskesmas', $id);\n $this->db->join('puskesmas', 'puskesmas.id_puskesmas=persediaan.id_puskesmas');\n $this->db->join('obat', 'obat.kode=persediaan.kode');\n $this->db->select('id_persediaan');\n $this->db->select('persediaan.id_puskesmas');\n $this->db->select('persediaan.kode');\n $this->db->select('nama_obat');\n $this->db->select('stok_awal');\n return $this->db->get($this->table)->row();\n }", "function fetch_datas()\n {\n $query = $this->db->get($this->tbl_qr);\n return $query->result_array();\n }", "function get_by_id($id)\n {\n $this->db->select('*');\n $this->db->join('pohon', 'pohon.id_pohon = penanaman.id_pohon');\n $this->db->join('users', 'users.id_user = penanaman.id_user');\n $this->db->join('petak', 'petak.id_petak = penanaman.id_petak');\n $this->db->join('pendaftaran', 'pendaftaran.id_pendaftaran = penanaman.nama_penanam');\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "public function getSingleProduct($id){\r\n\r\n\t$query = \"SELECT p.*,c.catName,b.brandName\r\nFROM tbl_product as p,tbl_category as c, tbl_brand as b\r\nWHERE p.catId = c.catId AND p.brandId = b.brandId AND p.productId = '$id'\";\r\n\t$result = $this->db->select($query);\r\n\treturn $result;\r\n}", "function select_by_idbrand($id_brand) {\t\t\n\t $fields = 'ac_product.id_product AS id_product, ac_product.name_product AS name_product, ac_product.slug_product AS slug_product, ac_product.price_product AS price_product, ac_product.discount AS discount, ac_product.after_price_discount AS after_price_discount, ac_product.description_product AS description_product, ac_product.picture_product AS picture_product, ac_brand.name_brand AS id_brand, ac_brand.slug_brand AS slug_brand';\n\n $this->db->select($fields); \n $this->db->from('ac_product');\n $this->db->join('ac_brand', 'ac_brand.id_brand = ac_product.id_brand','left');\n $this->db->where(array('ac_product.id_brand'=>$id_brand));\n $this->db->or_where(array('ac_brand.slug_brand'=>$id_brand));\n $this->db->order_by('created_at','desc');\n $query = $this->db->get();\n \n return $query->row();\n\t}", "function get_project_id_gallery($project_id){\n $id=base64_decode($project_id)/98765;\n $get_all_gallery_img=\"SELECT * FROM rmd_gallery_img WHERE project_id='$id'\";\n $get_all=$this->db->query($get_all_gallery_img);\n return $get_all->result();\n }", "function ambil_data(){\n\t\t$this->db->order_by($this->id_admin,$this->order);\n\t\treturn $this->db->get($this->nama_table)->result();\n\t}", "function getImages($id,$table){\n\t\t$db;\t\t\t\t\n\t\t// Open the database connection\n\t\t//if (!($db = pg_connect( 'host=postgres.int.devisland.net dbname=db_piccicla user=piccicla password=fidelin1'))) {\n\t\tif (!($db = pg_connect( 'host=localhost dbname=landscape user=postgres password=fidelin1'))){\n\t\t// Handle errors\n\t\t // i used die because with echo the script continued\n\t\t //Echo \"{success:false, msg:'SQL ERROR: Connection failed'}\";\t\t\t \n\t\t die();\t\t\t\n\t\t}\n\t\t\t\n\t\t$sql = 'select \"LINK\" from \"landscape\".\"'.$table.'\" where \"ART_ID\"='.$id;\n\t\t\n\t\t$results = array();\n\n\t\t// Read all the data back in as associative arrays\n\t\tIf (!$rs = pg_query($db, $sql) ){\n\t\t\t\tif ($db){\n\t\t\t\t\tpg_close($db);\n\t\t\t\t}\n\t\t\t\ttrigger_error('problems reading the database');\n\t\t\t\tdie();\n\t\t}else{\t\t\n\t\twhile($obj = pg_fetch_object($rs)){\n\t\t\t$results[] = $obj;\n\t\t}}\n\t\t//close the connection\n\t\tpg_close($db);\n\t\t//print_r($results);\n\t\t//trigger_error('problems reading the database');\n //die();\n\t\treturn $results;\t\t\n}", "function lista_tamanhos_produto($id)\n {\n #return $this->db->get_where('tamanhos_produtos',array('produtoID'=>$id))->row_array();\n $this->db->select('*'); \n #$this->db->from('tamanhos_produtos');\n $this->db->where('produtoID',$id);\n $this->db->order_by('idT', 'desc');\n $this->db->join('produtos','tamanhos_produtos.produtoID = produtos.idP');\n $this->db->join('cores','tamanhos_produtos.corID = cores.id');\n $this->db->join('tamanhos','tamanhos_produtos.tamanhoID = tamanhos.id');\n return $this->db->get('tamanhos_produtos')->result_array();\n \n }", "public function getapplyjobcu($uid)\n{\n\n $this->db->select(\"user_applied_jobs.*,jobs.job_title,jobs.map_address,users.first_name,users.last_name,users.image,staff_basicinfo.current_location\");\n $this->db->join(\"jobs\",\"user_applied_jobs.job_id=jobs.id\",\"left\");\n $this->db->join(\"users\",\"user_applied_jobs.user_id=users.id\",\"left\");\n $this->db->join(\"staff_basicinfo\",\"user_applied_jobs.user_id= staff_basicinfo.staff_id\",\"left\"); \n $this->db->where(\"user_applied_jobs.job_userid\",$uid);\n $this->db->where(\"users.first_name!=\",''); \n $this->db->where(\"jobs.job_title!=\",''); \n $this->db->order_by(\"user_applied_jobs.id\",\"desc\"); \n $result = $this->db->get('user_applied_jobs')->result();\n //echo $this->db->last_query(); die();\n return $result;\t\t\n}", "public function index()\n {\n //\n //$j = 1;\n //$p = Project::all()->toArray(); \n // dd();\n //$i = Image::all()->toArray(); \n $pim=DB::select(\"SELECT projects.pid, projects.pname, projects.description, projects.category, uploads.img, uploads.des from projects INNER JOIN uploads on projects.pname = uploads.des\");\n //dd($pi);\n // foreach($p as $pi)\n //{\n /*for($j=0;$j<count($p);$j++)\n {\n $i= Image::all()->where('des', $p[$j]['pname'])->toArray(); \n \n }*/\n //$j = $j+1;\n //} \n //dd($i);\n return view('myworks', compact('pim'));\n\n }", "function find_all_sale(){\n global $db;\n $sql = \"SELECT s.id,s.qty,s.price,s.date,p.name\";\n $sql .= \" FROM sales s\";\n $sql .= \" LEFT JOIN products p ON s.product_id = p.id\";\n $sql .= \" ORDER BY s.date DESC\";\n return find_by_sql($sql);\n }", "function all(){\n try{\n $link= connecter_db();\n $rp=$link->prepare(\"select * from etudiant order by id desc\");\n $rp->execute();\n $resultat= $rp->fetchAll(); \n\n return $resultat;\n }catch(PDOException $e ){\n die (\"erreur de recuperation des etudiants dans la base de donnees \".$e->getMessage());\n }\n\n}", "function get_join_by($data,$key=FALSE,$single=FALSE,$column=FALSE){ //Zulmi Adi Rizki 23 Juli 2013\n\t\tforeach($data as $row){\n\t\t\t$this->db->join($row[\"join_table\"],$row[\"table\"].\".\".$row[\"join_key\"].\"=\".$row[\"join_table\"].\".\".$row[\"join_key\"]);\n\t\t}\n\t\tif($key == TRUE){\n\t\t\tif(!is_array($key)){\n\t\t\t\t$this->db->where($key);\n\t\t\t} else {\n\t\t\t\t$key = array_map('htmlentities', $key);\n\t\t\t\t$this->db->where($key);\n\t\t\t}\n\t\t}\n\t\tcount($this->db->ar_orderby) || $this->db->order_by($this->order_by);\n\t\t$this->db->select($column == FALSE ? \"*\" : $column)->from($this->table_name);\n\t\t$single == FALSE || $this->db->limit(1);\n\t\t$method = $single ? 'row_array' : 'result_array';\n\t\treturn $this->db->get()->$method();\n\t}", "function getDistinctVehicles($package_id){ \n\t$this->db->select('v.registration_number,v.id as vehicle_id');\n\t$this->db->distinct();\n\t$this->db->where('p.id',$package_id);\n\t$this->db->from('packages p');\n\t$this->db->join('package_itinerary pi','pi.package_id = p.id','left');\n\t$this->db->join('package_vehicles pv','pv.package_itinerary_id = pi.id','left');\n\t$this->db->join('vehicles v','pv.vehicle_id = v.id','left');\n\t$qry=$this->db->get(); \n\t\tif($qry->num_rows() > 0){\n\t\t\t\n\t\t\t$v_array= $qry->result_array();\n\t\t\tforeach ($v_array as $key=>$vehicle){\n\t\t\t\techo $vehicle['vehicle_id'];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getimagebykatid($id){\n $query = $this->db->table($this->table)\n ->where('kategori_id',$id)\n ->where('status_cd','normal')\n ->get();\n return $query;\n }", "public function fetch_multi($s_where=null,$i_start=null,$i_limit=null)\r\n {\r\n try\r\n {\r\n \t$ret_=array();\r\n \t$s_qry=\"SELECT * \r\n\t\t\t\t\tFROM \".$this->tbl.\" n \"\r\n\t\t\t\t\t.($s_where!=\"\"?$s_where:\"\" ).(is_numeric($i_start) && is_numeric($i_limit)?\r\n\t\t\t\t\t\"Limit \".intval($i_start).\",\".intval($i_limit):\"\" );\r\n $rs=$this->db->query($s_qry);\r\n $i_cnt=0;\r\n if($rs->num_rows()>0)\r\n {\r\n foreach($rs->result() as $row)\r\n {\r\n $ret_[$i_cnt][\"id\"]\t\t\t\t=\t$row->i_id;////always integer\r\n $ret_[$i_cnt][\"s_title\"]\t\t\t=\tstripslashes($row->s_title); \r\n\t\t\t\t $s_desc \t\t\t\t\t\t\t= \tstrip_tags(stripslashes($row->s_description));\r\n\t\t\t\t if(strlen($s_desc)>197)\r\n\t\t\t\t \t$s_desc \t\t\t\t\t\t= \tsubstr_replace($s_desc,'...',200);\r\n $ret_[$i_cnt][\"s_description\"]\t= \t$s_desc ; \r\n $ret_[$i_cnt][\"s_photo\"]\t\t\t=\tstripslashes($row->s_photo); \r\n $ret_[$i_cnt][\"dt_created_on\"]\t=\tdate($this->conf[\"site_date_format\"],intval($row->dt_cr_date)); \r\n $ret_[$i_cnt][\"i_is_active\"]\t\t=\tintval($row->i_is_active); \r\n\t\t\t\t $ret_[$i_cnt][\"s_is_active\"]\t\t=\t(intval($row->i_is_active)==1?\"Active\":\"Inactive\");\r\n \r\n $i_cnt++;\r\n } \r\n $rs->free_result(); \r\n }\r\n unset($s_qry,$rs,$row,$i_cnt,$s_where,$i_start,$i_limit, $s_desc);\r\n return $ret_;\r\n \r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n } \r\n }" ]
[ "0.8500659", "0.846435", "0.782018", "0.7391785", "0.70706904", "0.7030467", "0.6920653", "0.68823594", "0.6570544", "0.64417833", "0.6374068", "0.6291693", "0.6277971", "0.625091", "0.62468886", "0.6218365", "0.6213862", "0.6186039", "0.617729", "0.6164808", "0.61534756", "0.61457044", "0.6130054", "0.61297196", "0.61054796", "0.6102879", "0.6076834", "0.60707486", "0.6063085", "0.6024245", "0.6021016", "0.600384", "0.5984854", "0.59564674", "0.5955652", "0.5949004", "0.5948068", "0.59475994", "0.5946558", "0.59433824", "0.5937291", "0.59349346", "0.5931227", "0.5930218", "0.5922885", "0.5921018", "0.5914747", "0.5912532", "0.5911138", "0.5910725", "0.5906087", "0.590342", "0.59030163", "0.588451", "0.5881158", "0.5873716", "0.58673006", "0.5862057", "0.585764", "0.5846836", "0.5832235", "0.58297044", "0.5827303", "0.58181673", "0.58157116", "0.5807369", "0.580534", "0.5799784", "0.5790625", "0.57889146", "0.5786651", "0.5783988", "0.57719535", "0.57709676", "0.5767685", "0.5766103", "0.576415", "0.57618314", "0.57573026", "0.5755176", "0.5752944", "0.5752725", "0.57506704", "0.5742793", "0.574055", "0.57396024", "0.57387006", "0.573813", "0.5736366", "0.57298166", "0.5722299", "0.5722002", "0.5717773", "0.57157785", "0.57157695", "0.5711935", "0.57116085", "0.57108516", "0.57107", "0.57039416" ]
0.7556596
3
$query = $this>db>query("select FROM users where id=$value");
function get_userdetails_register($value) { // return $query->result(); $this->db->select('up.*,us.*,cn.*,st.*,ct.*'); $this->db->from('users us'); $this->db->join('address up', 'up.id=us.addressid', 'left'); $this->db->join('countries cn', 'up.country=cn.id', 'left'); $this->db->join('states st', 'st.s_id=up.state', 'left'); $this->db->join('cities ct', 'up.city=ct.c_id', 'left'); $this->db->where('us.id', $value); $result = $this->db->get()->result(); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_user_by_ID($id){\n global $database;\n $query = \"SELECT * FROM \".TABLE_PREFIX.\"users WHERE ID = \" . $id;\n return $database->query( $query );\n}", "function getUserById($id) {\n // connexion à la BDD\n $db = connect();\n // requête\n $query = $db -> prepare('SELECT * FROM users WHERE id = :id');\n // exécution\n $query -> execute(array(\n ':id' => $id\n ));\n // renvoie un tableau associatif\n return $query -> fetch();\n}", "public function getUserID()\r\n{\r\n $query_string = \"SELECT userid FROM users \";\r\n $query_string .= \"WHERE username = :username\";\r\n\r\n return $query_string;\r\n}", "function getUsername($id){\n return sqlSelectOne(\"SELECT * FROM users WHERE user_id={$id}\", 'user_username');\n}", "function findById($db, $table, $primaryKey, $value, $options = '') {\n\t$query = 'SELECT * FROM ' . $table . ' WHERE ' . $primaryKey . '= :value ' . ' ' . $options ;\n\n\t$parameters = [\n\t\t'value' => $value\n\t];\n\n\t$result = runQuery($db, $query, $parameters);\n\n\treturn $result;\n}", "function getUserbyId($id){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn \t-> prepare('SELECT *\n\t\t\t\t\t\t\t\t\t\tFROM `clients`\n\t\t\t\t\t\t\t\t\t\tWHERE `id` = ?');\n\t\t$sth \t-> execute(array($id));\n\t\treturn \t$sth ;\n\t}", "function getUserById(){\n\t \n\t $sql = \"SELECT * FROM users WHERE User_id=\" . $User_id;\n\t $req = Database::getBdd()->prepare($sql);\n\t \n\t return $req->execute($sql);\n}", "function getUserId($user_name){\n return sqlSelectOne(\"SELECT * FROM users WHERE user_username='$user_name'\", 'user_id');\n}", "function user($id){\n\n $sql = \"SELECT * FROM users WHERE id=$id\";\n return fetch($sql);\n }", "function get_user_by_id($id) {\n $db = new PDO(\"mysql:host=localhost; dbname=registration\", \"root\", \"root\");\n $sql = \"SELECT * FROM users WHERE id=:id\";\n $statement = $db->prepare($sql);\n $statement->execute([\n 'id' => $id\n ]);\n $user = $statement->fetch(PDO::FETCH_ASSOC);\n return $user;\n}", "function selectUser($id) {\n $connection = openDb();\n $id = (int) $id;\n\n\n //Using prepared statements and parameterized queries:\n $sql = \"SELECT * FROM users_view WHERE ID = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"i\",$id);\n\n return executeQueryPrepared($stmt, $connection, true);\n}", "function search($id){\n\t\tglobal $conn;\n\t\t$sql = \"SELECT * FROM user where id=$id\";\n\t\t$stmt = $conn->prepare($sql);\n\t\t$r = $conn->query($sql);\n\t\treturn $r;\n\t}", "function getUserEmail($id){\n return sqlSelectOne(\"SELECT * FROM users WHERE user_id='$id'\", 'user_email');\n}", "function selectAccountByUserId($id) {\n $connection = openDb();\n $id = escape($id,$connection);\n $id = (int) $id;\n\n //Using prepared statements and parameterized queries:\n $sql = \"SELECT * FROM accounts WHERE USER = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"i\",$id);\n\n return executeQueryPrepared($stmt, $connection, true);\n}", "public function queryUsuario($value) {\n $sql = 'select \n a.email, \n b.id,\n b.gender, \n b.mailing_address,\n b.year_of_birth, \n b.level_of_education,\n b.country\n from auth_user a, auth_userprofile b \n where a.email = ? \n and a.id = b.user_id;';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->set($value);\n\t\t$result = QueryExecutor::execute($sqlQuery);\n return $result; \n }", "function find_user_by_id($id)\r\n{\r\n global $db;\r\n\r\n $q = $db->prepare('SELECT name, pseudo, email, city, country, twitter, github, \r\nfacebook, sex, available_for_hiring, bio FROM users WHERE id=?');\r\n $q->execute([$id]);\r\n\r\n $data = $q->fetch(PDO::FETCH_OBJ);\r\n\r\n $q->closeCursor();\r\n return $data;\r\n}", "function MostrarU($conexion, $id){\n $result = $conexion->query(\"SELECT * FROM usuario WHERE id_usuario=$id\");\n return $result;\n}", "function search($id){\n\t\tglobal $con;\n\t\t$query = \"select * from user where id = '$id'\";\n\t\t$res=$con->query($query);\n\t\treturn $res;\n\t}", "public static function find(string $idvalue)\n\t\t{\n\t\t\t$pk = self::get('id') ;\n\t\t\t$tb = self::get('tabla') ;\n\n\t\t\treturn Database::getInstance()\n\t\t\t\t\t->query(\"SELECT * FROM $tb \n\t\t\t\t\t \t WHERE $pk='$idvalue' ;\") \n\t\t\t\t\t->getObject(get_called_class()) ;\n\t\t}", "function userExists($parameter,$value) {\n\t$value = dbEscape($value);\n\treturn(dbResultExists(\"SELECT id FROM users WHERE $parameter='$value'\"));\n}", "function db_find ($table, $fields = '*', $id) {\n return db_select(\"SELECT $fields FROM $table WHERE id = ?\", array($id), true);\n}", "function get_user($value, $id)\n {\n $this->db->select($value);\n\t\t$this->db->from('tbl_users');\n\t\t$this->db->join('tbl_users_details', 'tbl_users.id=tbl_users_details.user_id');\n\t\t$this->db->where('tbl_users.id', $id);\n\t\t$query = $this->db->get();\n\t\treturn $query->row_array();\n }", "public function read_by_id(){\n try {\n $userid = $this->id;\n\n // query to get specific users\n $this->_query = \"SELECT * FROM \" . $this->_dbtable . \" WHERE id=:userid\";\n\n\n // preparing query\n $statement = $this->_conn->prepare($this->_query);\n\n //binding params\n $statement->bindParam(\":userid\", $userid, PDO::PARAM_INT);\n\n // executing query\n $statement->execute();\n\n return $statement;\n }\n catch(PDOException $ex){\n echo \"Error\" . $ex->getMessage();\n }\n }", "function usuarioID($id){\n\t\n\t$query = $this->db->from('usuario')->where('id',$id)->get();\n\n\t\t\tif($query-> num_rows() > 0){\n\t\t\t\treturn $query;\n\t\t\t\t}\n\t\n\t}", "function find($table, $id)\n{\n $data = connect()->query(\"SELECT * FROM $table WHERE id='$id'\");\n\n return $data->fetch_object();\n}", "function get_user_data($user_id){\n global $db;\n $sql = \"SELECT * FROM user WHERE user_id = '$user_id'\";\n $result = $db->query($sql)->fetch();\n return $result;\n}", "public function getUserIDandEmail()\r\n{\r\n $query_string = \"SELECT userid FROM users \";\r\n $query_string .= \"WHERE username = :username OR email = :email\";\r\n\r\n return $query_string;\r\n}", "public function selectUserById($id){\r\n //2 prepare la requete\r\n $stmt=$connexion->prepare(\r\n \"SELECT *\r\n FROM User\r\n WHERE id=:id\"\r\n );\r\n //3 execute la requete\r\n $stmt->execute(\r\n array('id'=>$id)\r\n );\r\n // 4 Recuperation resultat et stockage ds variable\r\n $user=$stmt->fetchObject('User');\r\n // 5 retourne la variable (reslutat)\r\n return $user;\r\n }", "function find_user($user_id) {\n global $db;\n $sql = \"SELECT * FROM users WHERE id = :user_id;\";\n $params = array(\n ':user_id' => $user_id\n );\n $records = exec_sql_query($db, $sql, $params)->fetchAll();\n if ($records) {\n // user_id is a unique field, so only 1 record should be selected.\n return $records[0];\n }\n // if nothing is returned earlier, then return NULL\n return NULL;\n}", "static function loadUser() : string\n {\n return \"SELECT *\n FROM users\n WHERE id = :id;\";\n }", "function find_user($user_id)\n{\n global $db;\n $sql = \"SELECT * FROM users WHERE id = :user_id;\";\n $params = array(':user_id' => $user_id);\n $users = exec_sql_query($db, $sql, $params)->fetchAll();\n if ($users) {\n return $users[0];\n }\n return NULL;\n}", "function getUserID($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from users where userid='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['userid'];\n\t}\n\n\t$crud->disconnect();\n}", "function get_user_booking_with_id($user_id){\n global $db;\n $sql = \"SELECT * FROM booking WHERE user_id = '$user_id'\";\n $result = $db->query($sql);\n return $result;\n}", "function getUserInfo($id) {\n global $db;\n\n $query = \"SELECT username, first, last, email, phone, bio FROM user WHERE id=:id\";\n $statement = $db->prepare($query);\n $statement->bindValue(':id', $id); \n $statement->execute();\n $results = $statement->fetch();\n $statement->closeCursor();\n return $results;\n}", "public function selectViaId($id){\n$sql = \"SELECT id, login, email, password, id_droits FROM utilisateurs WHERE id = :id\";\n$stmt = $this->pdo->prepare($sql);\n$stmt->execute([\n 'id' => $id\n]);\n$userid = $stmt->fetch(PDO::FETCH_ASSOC);\nif(!$userid)\n{\n return false;\n}\n else\n {\n return $userid;\n }\n}", "function getUserID($field, $value) {\n $con = getConnection();\n $value = mysqli_real_escape_string($con, $value);\n $query = \"SELECT user_id FROM user WHERE $field='$value'\";\n $result = mysqli_query($con,$query);\n return mysqli_fetch_array($result)['user_id'];\n}", "public function getAllUsers()\r\n{\r\n $query_string = \"SELECT userid, username \";\r\n $query_string .= \"FROM users \";\r\n\r\n return $query_string;\r\n}", "public function getUserDetails()\r\n{\r\n\t$query_string = \"SELECT userid, username, email, firstname, lastname \";\r\n $query_string .= \"FROM users \";\r\n $query_string .= \"WHERE \";\r\n $query_string .= \"username = :username\";\r\n\r\n return $query_string;\r\n}", "function selectAccountById($id) {\n $connection = openDb();\n\n //Using prepared statements:\n $id = (int) $id;\n $sql = \"SELECT * FROM accounts WHERE ID = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"i\",$id);\n\n return executeQueryPrepared($stmt, $connection, true);\n}", "function getUserName($id)\n {\n $db=Factory::getDatabase('slave');\n $db->query(\"select name from test WHERE id=$id limit 1\");\n }", "function getByID($table,$field,$value);", "function executeQuery($param,$id)\n {\n\n $consulta =\"SELECT $param from usuario where id='$id'\";\n if($resultado= $this->conexion->query($consulta)){ \n if ( $resultado->num_rows!=0 ) {\n while($fila= $resultado->fetch_assoc())\n {\n\n return $fila[\"$param\"] ;\n }//return $resultado->fetch_row();\n $resultado->close();\n }else\n { \n }\n $conexion->close();\n }\n\n }", "function getbyid($id){\n\t\t$this->db->where ('id', $id, \"=\");\n\t\t$res = $this->db->getOne('admin');\n\t\treturn $res;\n\t}", "function get_user_booking_using_id($user_id){\n global $db;\n $sql = \"SELECT * FROM booking WHERE user_id = '$user_id'\";\n $result = $db->query($sql)->fetch();\n return $result;\n}", "static function select($id = 0){\n $query = \"SELECT * FROM users where id = '$id' \";\n $pdo = new Connection();\n $pdo = $pdo->open();\n $results = $pdo->query($query);\n $rows = [];\n foreach($results->fetchAll() as $row){\n $rows[] = new User($row['username'], $row['password'], $row['id']);\n }\n return $rows;\n }", "public function getUserById($id){\n // Query for the user.\n $this->db->query('SELECT * FROM users WHERE id = :id');\n // Bind the values.\n $this->db->bind(':id', $id);\n // Return the row. \n $row = $this->db->single();\n\n return $row;\n }", "public function getstudentById ($student_number){\n $sqlQuery = \" SELECT * \";\n $sqlQuery .= \" FROM students \";\n $sqlQuery .= \" WHERE student_number=’ $student_number ’ \";\n $result = $this -> getDbManager () -> executeSelectQuery ( $sqlQuery );\n return ( $result );\n }", "public function selectUserbyId($id){\r\n\r\n $query = 'SELECT * FROM user_tbl WHERE id = ?';\r\n $stmt = $this->_db->prepare($query);\r\n $stmt->execute([$id]);\r\n $users = $stmt->fetchAll(PDO::FETCH_OBJ);\r\n if ($stmt->rowCount()){\r\n return $users;\r\n }\r\n\r\n }", "public static function query( $id ) {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"SELECT * FROM users WHERE id = ?\");\n\t\t$stmt->setFetchMode(PDO::FETCH_INTO, new User(null));\n\t\tif ($stmt->execute(array($id)))\n\t\t\treturn $stmt->fetch();\n\t\telse\n\t\t\treturn null;\n\t}", "public function getUpdatedUserID()\r\n{\r\n $query_string = \"SELECT userid FROM users \";\r\n $query_string .= \"WHERE userid != :userid AND username = :username\";\r\n\r\n return $query_string;\r\n}", "public function getId($id){\n\t\t$query = $this->db->select()->from($this->tb)->where('idusers','=',\"$id\")->getOne();\n\t\treturn $query;\n\t}", "function bd_usuarios_hash($id){\n return sql2value(\"\n SELECT clave\n FROM usuarios\n WHERE id LIKE '{$id}'or email LIKE '{$id}'\n LIMIT 1;\n \");\n}", "function recupereUser(PDO $bdd, $id)\r\n{\r\n $query = $bdd->prepare('SELECT * FROM utilisateur WHERE id = :id ');\r\n $query->bindValue(':id', $id);\r\n $query->execute();\r\n return $query->fetch();\r\n}", "function get_by_user_id($id){\n $id = (int)$id; //this is typecasting - if on the off chance a string got in here instead of a number, it will force it to be a number (SQL injection prevention), stored in $id\n $sql = \"SELECT * FROM posts WHERE user_id = '$id'\"; //change from users to posts for this case if copied from users\n\n $posts = $this->select($sql); //sql only brings back one from database, so we need to put a number\n\n return $posts; //brings it back\n}", "function get_user_by_userid($db, $userid)\n{\n\n\t$sql = 'SELECT * FROM users where id='.$userid;\n\t$st = $db->prepare($sql);\n\t$st->execute();\n\t$us = $st->fetchAll();\n\treturn $us[0];\n}", "function getUserNameById($id) {\n global $pdo;\n $statement = $pdo->prepare('SELECT `firstname`, `lastname` FROM `user` WHERE `id` = :id');\n $statement->bindParam(\":id\", $id);\n $statement->execute();\n return $statement->fetch(PDO::FETCH_ASSOC);\n}", "function get_user_by_user_id($user_id)\n{\n global $conn;\n $q['query'] = \"SELECT * FROM `user_master` WHERE `user_id`='$user_id'\";\n $q['run'] = $conn->query($q['query']);\n $q['result'] = $q['run']->fetch_assoc();\n\n return $q['result'];\n}", "function findbyid(){\r\n $conn=$this->connect();\r\n $id = $conn -> real_escape_string($this->id);\r\n $sql=\"SELECT * FROM quanly WHERE id = '$id'\";\r\n $result=$conn -> query($sql);\r\n $conn->close();\r\n return $result;\r\n }", "function getById($id, $table) {\n $sql = \"select * from {$table} where id = {$id}\";\n\n try {\n if(is_numeric($id))\n DB::select($sql);\n else\n throw new Exception(\"Only accepts numbers\");\n } catch(Exception $e) {\n echo \"Error: {$e->getMessage()}\";\n }\n }", "function mysql_auth_user_id($username)\n{\n return dbFetchCell(\"SELECT `user_id` FROM `users` WHERE `username` = ?\", array($username));\n}", "public function findBy($key,$value){ \n $arraytoret = array();\n $query='select *\n from Usuario\n where '.$key.'='.$value;\n $results = $this->driver->exec($query);\n return $this->factory($results);\n}", "public function getUserById($id){\n $this->db->query('SELECT * FROM users WHERE us_id = :id');\n // Bind values\n $this->db->bind(':id', $id);\n $row = $this->db->single();\n return $row;\n\n }", "public function foobar()\n {\n $result = $this->db->query_params(\"SELECT field FROM table WHERE something = $1 and something_else = $2\", array('foo', 'bar'));\n // use $result as usual ...\n }", "public function selectById($id) {\n\t\t//$stmt = $this->pdo->prepare($sql);\n\t\t//$stmt->bindValue(':id', $id);\n\t\t//$stmt->execute();\n\t\t//return $stmt->fetch(PDO::FETCH_ASSOC);\n\t}", "public function selectById($id);", "public function selectById($id);", "function userNameGet(PDO $db, $id)\n{\n $sql = \"SELECT name FROM users WHERE id = :id\";\n\n $stmt = $db->prepare($sql); \n $stmt->bindParam(':id', $id, PDO::PARAM_INT); \n $stmt->execute();\n $name=$stmt->fetch(PDO::FETCH_NUM);\n\n return $name;\n}", "function sqli($get = 1)\n{\n try {\n $db = new PDO('mysql:dbname=test;host=localhost;charset=UTF8', 'root', '071293');\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch (PDOException $pe) {\n echo $pe->getMessage();\n }\n\n $sql = \"SELECT * from test where id={$get}\";\n $stmt = $db->query($sql);\n\n var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));\n}", "function Get_data_byid($table,$where = '') {\n\t\treturn $this->db->query(\"SELECT * from $table $where;\");\t\n\t}", "function select($item,$table,$s_cul=0,$value=0){\r\n global $con;\r\n $query=$con->prepare(\"SELECT $item FROM $table where $s_cul=? \");\r\n $query->execute(array($value));\r\n $content=$query->fetchall();\r\n return $content;\r\n}", "function getUsername($id) { // Returns name of user with given id\n\t$id = intval($id);\n\treturn(dbFirstResult(\"SELECT username FROM users WHERE id=$id\"));\n}", "function getUserById($id) {\n\t$result = mysql_query(\"SELECT userId, email, password FROM users where userId = $id\");\n\t$row = mysql_fetch_array($result, MYSQL_ASSOC);\n\tmysql_free_result($result);\n\treturn $row;\n}", "function select($id)\n{\n\n$sql = \"SELECT * FROM test WHERE id = $id;\";\n$result = $this->database->query($sql);\n$result = $this->database->result;\n$row = mysql_fetch_object($result);\n\n\n$this->id = $row->id;\n\n$this->name = $row->name;\n\n$this->vorname = $row->vorname;\n\n$this->adresse = $row->adresse;\n\n$this->telefon = $row->telefon;\n\n$this->jahr = $row->jahr;\n\n}", "public function checkUserPassword()\r\n{\r\n $query_string = \"SELECT userid, username, password \";\r\n $query_string .= \"FROM users \";\r\n $query_string .= \"WHERE \";\r\n $query_string .= \"userid = :userid AND \";\r\n $query_string .= \"username = :username\";\r\n\r\n return $query_string;\r\n}", "function findById($id){\n\t\tUtilidades::_log(\"findById($id)\");\n\t\t$query = \"SELECT id,name,account,surnames,email,pass,address,access\n\t\t\t\t\tFROM user WHERE id = $id\";\n\t\t$row = DB::ejecutarConsulta($query);\n\t\t\n\t\treturn new UserDAO($row[0]);\n\t}", "public function getQueryBy($param, $value)\r\n {\r\n return $this->db\r\n ->select('*')\r\n ->from('semestre s')\r\n ->where($param, $value)\r\n ->get();\r\n }", "function SelectByIdFrom_UserDetails($dbhandle, $id, &$user)\n{\n $logger = LoggerSingleton::GetInstance();\t\n $logger->LogInfo(\"SelectByIdFrom_UserDetails : Enter ($id)\");\n\n global $UserDetailsTable_Id;\n global $UserDetailsTable_Name;\n global $UserDetailsTable_UserName;\n \n // select\n $query = \"SELECT * FROM $UserDetailsTable_Name\n WHERE $UserDetailsTable_Id = $id\";\n\n // execte\n $result = $dbhandle->query($query);\n\n if(FALSE == $result)\n {\n $logger->LogError(\"SelectByIdFrom_UserDetails : No records with id - $id found\");\n $status = false;\n }\n\n $num_rows = $result->num_rows;\n if($num_rows > 0)\n {\n while($row = $result->fetch_assoc())\n {\n $user = $row[\"$UserDetailsTable_UserName\"];\n }\n\n $status = true;\n } \n else\n {\n $logger->LogError(\"SelectByIdFrom_UserDetails : No records found\");\n $status = false;\n }\n\n return $status;\n}", "function get_user_by_id($user_id) {\n// echo $user_id; die;\n $this->db->select(\"*\", false);\n $this->db->where(\"id\", $user_id);\n $query = $this->db->get($this->user_table);\n $result = $query->row_array();\n// pr($result); die;\n return $result;\n }", "function select_by_id($tbl, $cols='*', $value=null, $id='id', $limit=1){\n $where = 1;\n if(isset($value)) $where=\"$id='$value'\";\n $sql = \"SELECT $cols FROM $tbl WHERE $where LIMIT $limit\";\n $result = $this->execute($sql) or $this->error($sql);\n $row = $this->next($result,'{}');\n return $row;\n }", "function getUserid($username) {\n\t$username = dbEscape($username);\n\treturn(dbFirstResult(\"SELECT id FROM users WHERE username='$username'\"));\n}", "function getUserById($user_id) {\n $query = \"SELECT * FROM users_account WHERE userid = ?\";\n $paramType = \"i\";\n $paramValue = array(\n $user_id\n );\n \n $result = $this->db_handle->runQuery($query, $paramType, $paramValue);\n return $result;\n }", "public function getSystemId()\r\n{\r\n $query_string = \"SELECT systemid FROM voting_system \";\r\n $query_string .= \"WHERE systemname = :systemname\";\r\n\r\n return $query_string;\r\n\r\n}", "function verifiRentsDetails($id)\n{\n\n $requete = \"SELECT idSnow FROM rentsdetails where idSnow='$id';\";\n $request = executeQuery($requete);\n\n\n return $request;\n}", "public function getUser($id){\n \t$sql = \"select * from `usuarios` where `id` = '$id'\";\n \t$result = parent::executaQuery($sql);\n $row = mysqli_fetch_object ( $result );\n return $row;\n }", "public function userbyid($id)\n {\n $sql=\"SELECT * FROM users where id='$id'\";\n\t $result = $this->db->query($sql);\n\t return $result->row();\n \n }", "public function __construct2($field_in_user_table,$value ) {\n\t\t$query=\"SELECT id from users where $field_in_user_table ='$value'\";\n\t\t$query_run=mysql_fetch_assoc(mysql_query($query));\n\t\tif($query_run)\n\t\t$this->user_id=$query_run[\"id\"];\t\n\t\telse\n\t\t{\n\t\techo 'No such user has been found !!';\n\t\texit();\n\t\t}\n\t}", "public function query($query= \"SELECT * FROM users_test\"){\n$result= mysqli_query($this->connection, $query);\nwhile ($row= mysqli_fetch_assoc($result)) {\n\techo \"ID=\" . $row['id'] . \"<br>\" ;\n\techo \"FIRST NAME=\" . $row['first_name'] . \"<br>\" ;\n\techo \"LAST NAME=\" . $row['last_name'] . \"<br>\" ;\n\techo \"USERNAME=\" . $row['username'] . \"<br>\" ;\n\techo \"PASSWORD=\" . $row['password'] . \"<br><br>\" ;\n\t\n}\n}", "public function readByUser(){\n //select all query\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE id_user=:id_user\";\n\n //perpare query\n $stmt = $this->conn->prepare($query);\n\n //sanitize\n $this->id_user=htmlspecialchars(strip_tags($this->id_user));\n\n //bind given value\n $stmt->bindparam(\":id_user\", $this->id_user);\n\n $stmt->execute();\n\n return $stmt;\n }", "function user_details_id ($id)\n\t\t{\n\t\t $query = \"select * from user_details where id = $id \" ; \n\t\t\t$data = mysql_query($query) ;\n\t\t\treturn $data ; \n\t\t}", "public function getUserRole()\r\n{\r\n $query_string = \"SELECT role FROM users \";\r\n $query_string .= \"WHERE userid = :userid\";\r\n\r\n return $query_string;\r\n}", "function get_user_by_id($id) {\r\n\t\t$query = $this->db->query('SELECT user_fname, user_lname, user_email\r\n\t\t\t\t\t\t\t\t\tFROM user\r\n\t\t\t\t\t\t\t\t\tWHERE user_id = '.$id.'');\r\n\t\treturn $query->result();\r\n\t}", "function get($id) {\n $tablename = $this->table_name;\n $query = \"SELECT * from \".$tablename.\" WHERE id='\".$id.\"';\";\n // prepare query statement\n if(!($result = mysqli_query($this->conn, $query))) {\n echo \"Could not execute query!<br>\";\n echo(\"Error description: \" . mysqli_error($this->conn));\n die(mysqli_error($this->conn));\n } else {\n return $result;\n }\n }", "function get_by_id($id) {\r\n $this->db->where('id', $id);\r\n return $this->db->get($this->tbl);\r\n }", "public static function findById($id)\n {\n $_id = \"'\".$id.\"'\";\n $qb = new QB;\n $qb->conn = static::getDB();\n $results = $qb->select('users', '*')\n ->where('id', '=', $_id)\n ->all();\n return $results;\n }", "public function findUserById()\n {\n $this->db->query('SELECT * FROM user WHERE id = :id');\n $this->db->bind(':id', $_SESSION['id']);\n \n $row = $this->db->single();\n \n return $row; \n }", "function fetchUserDetails($username=NULL,$token=NULL, $id=NULL){\n\tif($username!=NULL) {\n\t\t$column = \"username\";\n\t\t$data = $username;\n\t}elseif($id!=NULL) {\n\t\t$column = \"id\";\n\t\t$data = $id;\n\t}\n\t$db = DB::getInstance();\n\t$query = $db->query(\"SELECT * FROM users WHERE $column = $data LIMIT 1\");\n\t$results = $query->first();\n\treturn ($results);\n}", "function getUserFromDatabase($id)\n {\n $connect = new Config();\n $sql = 'SELECT * FROM user_db WHERE id = :id';\n $query = $connect->connectPDO()->prepare($sql);\n $query->bindParam(':id', $id, \\PDO::PARAM_INT);\n $query->execute();\n\n if ($user = $query->fetch(PDO::FETCH_ASSOC)) {\n return $user;\n } else {\n $_SESSION['error'] = ['No Such User Found'];\n }\n }", "function userFound($id)\n{\n global $conn;\n $stmt = $conn->prepare(\"SELECT * FROM users WHERE _id = '$id' ;\");\n $stmt->execute();\n $c = $stmt->rowCount();\n if ($c == 0) return \"not found\";\n return \"found\";\n}", "function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }", "function find_by_id($table,$id)\n{\n global $db;\n $id = (int)$id;\n if(tableExists($table)){\n $sql = $db->query(\"SELECT * FROM {$db->escape($table)} WHERE id='{$db->escape($id)}' LIMIT 1\");\n if($result = $db->fetch_assoc($sql))\n return $result;\n else\n return null;\n }\n}", "function getAllUserIds($filter) {\n\t//SELECT id FROM students\n\t$sql = \"SELECT id FROM users WHERE $filter = 1\";\n\t$userIds = queryColumn($sql);\n\n\treturn $userIds;\n}" ]
[ "0.7311286", "0.72528756", "0.7204952", "0.7173042", "0.7154566", "0.7069112", "0.7054563", "0.7050288", "0.6936244", "0.6933399", "0.6882406", "0.67987984", "0.67882276", "0.67638427", "0.67573804", "0.6748018", "0.67209", "0.66460663", "0.6643948", "0.6618941", "0.6614083", "0.6597689", "0.65699685", "0.65676785", "0.654108", "0.6537027", "0.65223587", "0.65122", "0.65117955", "0.65085477", "0.6506953", "0.65021086", "0.64802045", "0.6478129", "0.64673674", "0.6439127", "0.64369017", "0.64039904", "0.63742715", "0.6361487", "0.6351408", "0.63409686", "0.62705696", "0.62704605", "0.6269206", "0.6268798", "0.6268109", "0.62635297", "0.6255954", "0.62529045", "0.6252551", "0.625123", "0.62417704", "0.62412226", "0.6232357", "0.62321514", "0.6228167", "0.6221649", "0.61998135", "0.6199114", "0.61942744", "0.6191642", "0.6189115", "0.6166418", "0.6156291", "0.6156291", "0.6143753", "0.6134065", "0.6129203", "0.6119044", "0.60979587", "0.6093839", "0.60934496", "0.6093126", "0.60929304", "0.6079386", "0.607739", "0.6073875", "0.60680205", "0.6059702", "0.6050391", "0.6040533", "0.6035123", "0.60322434", "0.60200083", "0.6009189", "0.6006075", "0.59967554", "0.5994697", "0.59924394", "0.5991064", "0.59902185", "0.5987463", "0.59794873", "0.59792167", "0.59741175", "0.596859", "0.5966082", "0.5953626", "0.59533846", "0.59460306" ]
0.0
-1
/ $result = $this>db>query('SELECT order. from order us INNER JOIN users ON up.id=us.bookedby WHERE and us.gender =' . $params['gender'] . ' AND us.age BETWEEN ' . $params['age_from'] . ' AND ' . $params['age_to'] . ' AND us.user_id !=' . $params['user_id'] . ' AND up.country_id =' . $params['country'] . ' AND us.status =1 and up.visibility="true" '.$search.$privateprofile.' ORDER BY us.user_id'); echo $this>db>last_query(); us.gender ='.$params['gender'].' AND return $result>result();
function searchmonthresult($mon, $loc) { $this->db->select('order.*,users.*,order.id as oid,file.*,package.*,cities.*,order.amount as am,guest.firstname as fr,guest.lastname as lr'); $this->db->from('order'); $this->db->join('package', 'package.id = order.package', 'left'); $this->db->join('orderguest', 'orderguest.orderid = order.id', 'left'); $this->db->join('guest', 'guest.id = orderguest.guest', 'left'); $this->db->join('users', 'order.bookedby = users.id', 'left'); $this->db->join('userprofile', 'userprofile.useid = users.id', 'left'); $this->db->join('cities', 'cities.c_id = package.location', 'left'); $this->db->join('file', 'file.id = userprofile. profilepic', 'left'); $this->db->where('package.location', $loc); $this->db->where('MONTH(order.orderplacedate)', $mon); // $this->db->order_by("order.orderplacedate", "desc"); $this->db->where('order.admin_cancel', null); $this->db->where('order.user_cancel', null); $query = $this->db->get(); $row = $query->result_array(); return $row; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generate_query($gender) {\n global $person_array_data;\n return \"SELECT *\n FROM gegevens \n INNER JOIN get_answers ON gegevens.id = get_answers.person_id\n INNER JOIN get_importance ON gegevens.id = get_importance.person_id\n INNER JOIN get_desired ON gegevens.id = get_desired.person_id\n WHERE age >= ({$person_array_data['age']} / 2 + 6) \n AND age <= ({$person_array_data['age']} * 2 - 12) AND id <> {$person_array_data['id']} \n AND name <> '' AND gender = {$gender}\n GROUP BY gegevens.id\";\n }", "public function getAllUserProfilesByAdvanceSearch($request,$gender) {\n extract($request);\n $sql = \"SELECT * FROM user_profile_tab,user_tab WHERE user_tab.user_id = user_profile_tab.user_id AND user_tab.user_gender != '$gender' \";\n\n if ($language != '') {\n $sql .= \"AND user_profile_tab.user_mother_tongue = '$language' \";\n }\n if ($religion != '') {\n $sql .= \"AND user_tab.user_caste = '$religion' \";\n }\n if ($filter_aged_from != '') {\n $sql .= \"AND DATEDIFF(CURRENT_DATE, user_profile_tab.user_dob) >= ('$filter_aged_from' * 365.25) \";\n }\n if ($filter_aged_to != '') {\n $sql .= \"AND DATEDIFF(CURRENT_DATE, user_profile_tab.user_dob) <= ('$filter_aged_to' * 365.25) \";\n }\n if ($maritalStatus != '') {\n $sql .= \"AND user_profile_tab.user_marital_status = '$maritalStatus'\";\n }\n\n if ($country != '') {\n $countryName = '';\n $countryId = '';\n $countries = explode(\"/\", $country);\n $countryName = $countries[0]; // piece1\n $countryId = $countries[1]; // piece2\n $sql .= \"AND user_profile_tab.user_country = '$countryName' \";\n }\n\n if ($state != '') {\n $stateName = '';\n $stateId = '';\n $states = explode(\"/\", $state);\n $stateName = $states[0]; // piece1\n $stateId = $states[1]; // piece2\n $sql .= \"AND user_profile_tab.user_state = '$stateName' \";\n }\n if ($city != '') {\n $sql .= \"AND user_profile_tab.user_city = '$city' \";\n }\n// if ($filter_member_id != '') {\n// $sql .= \"AND user_profile_tab.user_profile_key = '$filter_member_id' \";\n// }\n if ($working_field != '') {\n $sql .= \"AND user_profile_tab.user_working_field = '$working_field' \";\n }\n if ($occupation != '') {\n $sql .= \"AND user_profile_tab.user_occupation_type = '$occupation' \";\n }\n if ($education != '') {\n $sql .= \"AND user_profile_tab.user_education_field = '$education' \";\n }\n if ($max_height != '') {\n $sql .= \"AND user_profile_tab.user_height <= '$max_height' \";\n }\n if ($min_height != '') {\n $sql .= \"AND user_profile_tab.user_height >= '$min_height' \";\n }\n if ($from_weight != '') {\n $sql .= \"AND user_profile_tab.user_weight >= '$from_weight' \";\n }\n if ($to_weight != '') {\n $sql .= \"AND user_profile_tab.user_weight <= '$to_weight' \";\n }\n if ($from_salary != '') {\n $sql .= \"AND user_profile_tab.user_annual_income >= '$from_salary' \";\n }\n if ($to_salary != '') {\n $sql .= \"AND user_profile_tab.user_annual_income <= '$to_salary' \";\n }\n $sql .= \"AND user_tab.user_status='1' AND user_tab.user_doc_verified='1' ORDER BY user_tab.user_id DESC\";\n $result = $this->db->query($sql);\n if ($result->num_rows() <= 0) {\n return false;\n } else {\n return $result->result_array();\n }\n }", "public function getuser($rid='',$surid='')\n{\n if($rid!=''){\n $this -> db -> order_by('FIELD (users.id,'.$rid.')', 'desc', FALSE);\t \n }\n else if($surid!=''){\n $this -> db ->like('users.first_name',$surid);\t \n } \n else{\n\t $this->db->order_by(\"users.id\",\"desc\");\n\t}\t\n\t\n $uid = $this->session->userdata('user_id');\t\n $this->db->select(\"DISTINCT(users.username),users.*\");\n $this->db->join(\"userschating a\",\"users.id=a.rid\",\"left\");\n $this->db->join(\"userschating b\",\"users.id=b.sid\",\"left\");\n //$this->db->where('user.id !=',$uid); \n $this->db->where(\"users.id !=$uid AND (a.rid=$uid OR b.sid=$uid OR b.rid=$uid OR a.sid=$uid)\");\n $this->db->order_by('users.id','desc');\n \n $result=$this->db->get(\"users\")->result(); \n //echo $this->db->last_query(); die;\n\tforeach($result as $key=>$row)\n\t{\n\t$id =$row->id;\t\n\t$this->db->select(\"count(status) as no\");\n\t$this->db->where(\"status\" ,0);\n\t$this->db->where(\"sid\",$id);\n\t$this->db->where(\"rid\",$uid);\t\n $da = $this->db->get(\"userschating\")->result();\n $no = $da[0]->no;\n $result[$key]->no = $no;\t\n\t}\n\treturn $result;\n\t\n}", "public function get_user_info($userId,$searchId){\n $sql = \"SELECT u.firstName,s.searchName from users u,searchcriteria s where u.userId = s.userId AND u.userId =$userId AND s.searchId =$searchId AND s.deleteFlag !=1 AND u.deleteFlag !=1\";\n $result = $this->db->query($sql);\n return $result->result_array(); \n }", "public function getAllUsersData($userInfo,$searchVal)\r\n {\r\n \t$user_id = $userInfo->getUserIdInfo();\r\n \t$user_id=$user_id['id'];\r\n \t//$user_id=17;\n \t$this->db->Fields(array('u.id','u.first_name','u.middle_name','u.last_name','u.gender','u.email_primary','u.profile_image','f.status'));\n $this->db->From('users u,friends f');\r\n $this->db->Where(array(\"user_id=\".$user_id.\" AND friend_id=u.id AND u.status='A' AND\r\n\t\t\t (f.status='F' OR f.status='R' OR f.status='W') AND\r\n\t\t\t (u.first_name like '%\".$searchVal.\"%' OR\r\n\t\t\t u.middle_name like '%\".$searchVal.\"%' OR\r\n\t\t\t u.last_name like '%\".$searchVal.\"%' OR\r\n\t\t\t u.email_primary like '%\".$searchVal.\"%') \"),true); \t\n \t$this->db->Select();\n \t$result1 = $this->db->resultArray();\r\n \t\r\n \t$this->db->unsetValues();\r\n \t\r\n \t$this->db->Fields(array('u.id'));\n $this->db->From('users u,friends f');\r\n $this->db->Where(array(\"user_id=\".$user_id.\"\r\n\t\t\t AND friend_id=u.id AND u.status='A'\r\n\t\t\t AND (f.status='F' OR f.status='R' OR f.status='W')\r\n\t\t\t AND (u.first_name like '%\".$searchVal.\"%'\r\n\t\t\t OR u.middle_name like '%\".$searchVal.\"%'\r\n\t\t\t OR u.last_name like '%\".$searchVal.\"%'\r\n\t\t\t OR u.email_primary like '%\".$searchVal.\"%') \"),true);\r\n \t$this->db->Select();\n \t$result2 = $this->db->resultArray();\r\n\r\n \t$myStr=\"1,\";\r\n\t\tforeach($result2 as $keys=>$values){\r\n\t\t\tforeach ($values as $key=>$value)\r\n\t\t\t{\r\n\t\t\t\t$myStr.=$value.\",\";\r\n\t\t\t}\r\n\t\t}\t\t \r\n \t$myStr=substr($myStr,0,-1);\r\n \t\r\n \t$this->db->unsetValues();\r\n \t$this->db->Fields(array('id','first_name','middle_name','last_name','gender','email_primary','profile_image','status'));\r\n \t$this->db->From('users');\r\n \t$this->db->Where(array(\"(status = 'A' AND\r\n\t\t\t (first_name like '%\".$searchVal.\"%'\r\n\t\t\t OR middle_name like '%\".$searchVal.\"%'\r\n\t\t\t OR last_name like '%\".$searchVal.\"%'\r\n\t\t\t OR email_primary like '%\".$searchVal.\"%'))\r\n\t\t\t AND id NOT IN (\".$myStr.\")\r\n\t\t\t AND id <> \".$user_id.\" \"),true);\r\n \t$this->db->Select();\n \t$result = $this->db->resultArray();\r\n \t$result=array_merge($result1,$result);\r\n \treturn($result);\r\n }", "function account_user($uid)\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('account');\n\t\t$this->db->where('pack_status','Y');\n\t\t$this->db->where('paystatus','TRUE');\n\t\t$this->db->where('approved','Y');\n\t\t$this->db->where('status','Y');\n\t\t$this->db->where('deleted','N');\n\t\t$this->db->where('user_id',$uid);\n\t\t$query = $this->db->get();\n\t\treturn $query;\t\n\t}", "function get_user($limit)\r\n {\r\n //$query=$this->db->query(\"SELECT *FROM user INNER JOIN division ON user.storeid=division.storeid WHERE \");\r\n/*$this->db->select('user.first_name,user.last_name,user.emailid,user.phone,user.fax,user.userid,user.storeid,user.isactive,\r\ndivision.store_name,division.division_type,division.divisionid');\r\n $this->db->from('user,division,user_division');\r\n $this->db->where('(user.userid=user_division.userid)');\r\n $this->db->where('(user.storeid=division.storeid)');\r\n $this->db->WHERE ('(user.storeid !=123456)');\r\n $this->db->group_by('user_division.userid');\r\n //$this->db->limit($limit);\r\n \r\n $query = $this->db->get();\r\necho $this->db->last_query();*/\r\n$query=$this->db->query(\"SELECT *FROM user INNER join division ON user.storeid=division.storeid $limit\");\r\n\r\n return $query->result_array(); \r\n }", "function getUsersAccount($param=array(),$sWhere=null,$sOrder=null,$length=null,$start=null,$is_active=null){\r\n\t\tif(empty($param)) return array();\r\n\t\t$this->db->select(TBL_USERS.'.email,'.TBL_USERS.'.password,'.TBL_USERS.'.is_active,'.TBL_USER_INFORMATION.'.sales_rip,'.TBL_USERS.'.role,'.TBL_USERS.'.job_title,'.TBL_USER_INFORMATION.'.*,'.TBL_MST_COUNTRIES.'.title as country,'.TBL_MST_STATES.'.title as state,'.TBL_MST_CITIES.'.title as city,'.TBL_MST_STORES.'.title as store');\r\n\t\t$this->db->from(TBL_USERS);\r\n\t\t$this->db->join(TBL_USER_INFORMATION,TBL_USER_INFORMATION.'.tbl_users_id='.TBL_USERS.'.id');\r\n\t\t$this->db->join(TBL_MST_COUNTRIES, TBL_MST_COUNTRIES.'.id='.TBL_USER_INFORMATION.\".mst_countries_id\",'left');\r\n\t\t$this->db->join(TBL_MST_STATES, TBL_MST_STATES.'.id='.TBL_USER_INFORMATION.\".mst_states_id\",'left');\r\n\t\t$this->db->join(TBL_MST_CITIES, TBL_MST_CITIES.'.id='.TBL_USER_INFORMATION.\".mst_cities_id\",'left');\r\n\t\t$this->db->join(TBL_MST_STORES, TBL_MST_STORES.'.id='.TBL_USER_INFORMATION.\".store_id\",'left');\r\n\t\t//echo $this->db->_compile_select();die;\r\n\t\t\r\n\t\tif(isset($param['role']) && $param['role']!=''){\r\n\t\t\t$this->db->where(TBL_USERS.'.role = \"'.$param['role'].'\"');\t\r\n\t\t}\r\n\t\tif(isset($param['sales_rip_id']) && $param['sales_rip_id']!=''){\r\n\t\t\t$this->db->where(TBL_USERS.'.id = \"'.$param['sales_rip_id'].'\"');\t\r\n\t\t}\r\n\t\t\r\n\t\tif(isset($param['manager_id']) && $param['manager_id']!=''){\r\n\t\t\t$this->db->where(TBL_USERS.'.parent_report_id = \"'.$param['manager_id'].'\"');\t\r\n\t\t}\r\n\t\t\r\n\t\tif(isset($param['director_id']) && $param['director_id']!=''){\r\n\t\t\t$this->db->where_in('parent_report_id',$param['director_id']);\r\n\t\t}\r\n\t\tif(isset($sWhere) && trim($sWhere) != ''){\r\n\t\t\t$this->db->where('('.$sWhere.')');\r\n\t\t}\r\n\t\tif(isset($sOrder) && trim($sOrder) != ''){\r\n\t\t\t$this->db->order_by($sOrder);\r\n\t\t} \r\n\t\tif(isset($length) && $length != ''){\r\n\t\t\t$this->db->limit($length,$start);\r\n\t\t}\r\n\t\tif($is_active!=null){\r\n\t\t\t$this->db->where(array(TBL_USERS.'.is_active'=>$is_active));\r\n\t\t}\r\n\t\t//$this->db->group_by(TBL_USERS.'.id');\r\n\t\t\r\n\t \t//echo $this->db->_compile_select(); die; \r\n\t\t$recordSets = $this->db->get();\r\n\t\t\r\n\t\t$data = $recordSets->result();\r\n\t\t\r\n\t\treturn $data;\t\r\n\t\t\r\n\t}", "public function get_other_library($user){\n $query=$this->db->query('SELECT * FROM `user_books` INNER JOIN users ON user_books.user_email=users.email WHERE `availability`=1 AND users.username=\"'.$user['sent_by'].'\" ');\n return $query->result();\n }", "public function searchUserByGender($gender){\r\n $result = $this->DB->fetchAll('select * from user where gender = ?',array($gender));\r\n return $this->formatResult($result);\r\n }", "public function filter_books20($data){\n $query=$this->db->query('SELECT * FROM `user_books` INNER JOIN `users` ON `users`.`username` = `user_books`.`user_username` WHERE `availability`=\"1\" AND `cond` = \"'.$data['cond'].'\" AND `book_genre` = \"'.$data['book_genre'].'\" AND `users`.`user_region` = \"'.$data['region'].'\" AND NOT `user_username`= \"'.$data['username'].'\" ORDER BY `date_added` DESC LIMIT 150;');\n return $query->result();\n }", "public function searchByProfile_id() {\n $gender = $this->session->userdata('key_gender');\n extract($_GET);\n //print_r($_GET);\n $result = $this->Searchbyprofileid_model->searchByProfile_id($filter_member_id, $gender);\n if (!$result) {\n echo '500';\n } else {\n print_r(json_encode($result));\n }\n }", "public function get_profile_details($user_id)\n {\n $sql = \"SELECT u.id as user_id, \n u.profile_code,\n u.bio_info,\n u.created_at as register_date,\n u.email,\n u.last_name,\n u.first_name,\n ub.middlename,\n u.fullname_last_edited,\n uc.address,\n rc.name as country,\n (case u.gender\n when 'N' then CONCAT('Others','',u.gender_custom)\n when 'F' then 'Female'\n when 'M' then 'Male'\n else ''\n end) 'gender',\n u.gender_num_times_edited,\n ub.birthday,\n u.birthyear,\n u.birthdate_num_times_edited,\n ub.politics as political_view,\n ub.religion,\n rb.name as bloodtype,\n uc.contact1,\n uc.contact2,\n uc.contact3,\n uc.webtitle1, \n uc.weblink1, \n uc.webtitle2, \n uc.weblink2,\n uc.webtitle3, \n uc.weblink3,\n coalesce(a.comments,0) + coalesce(b.discussion,0)as total_comments,\n coalesce(m.friends,0) as total_friends,\n coalesce(n.followers,0) as total_followers,\n coalesce(o.following,0) as total_following,\n coalesce(c.post,0) as total_post,\n coalesce(c.image,0) as total_images,\n coalesce(c.poll,0) as total_poll,\n coalesce(c.question,0) as total_question,\n coalesce(c.article,0) as total_article,\n (coalesce(d.yaycontent,0) + coalesce(e.yaycomment,0) + coalesce(f.yayreply,0) + coalesce(g.yayreplyl2,0) + coalesce(h.yayreplyl3,0) + coalesce(i.yaydiscussion,0) + coalesce(j.yaytopicreply,0) + coalesce(k.yaytopicreplyl2,0) + coalesce(l.yaytopicreplyl3,0)) as totalyayreceived,\n (coalesce(d.naycontent,0) + coalesce(e.naycomment,0) + coalesce(f.nayreply,0) + coalesce(g.nayreplyl2,0) + coalesce(h.nayreplyl3,0) + coalesce(i.naydiscussion,0) + coalesce(j.naytopicreply,0) + coalesce(k.naytopicreplyl2,0) + coalesce(l.naytopicreplyl3,0)) as totalnayreceived,\n us.credential_type,\n us.credential_refid,\n (case us.credential_type\n when 1 then ugen.general_info\n when 2 then CONCAT(ucol.course, ', ', ucol.schoolname)\n when 3 then CONCAT(uwork.position, ', ', uwork.companyname,', ',uwork.location)\n end) 'credential',\n\t (coalesce(ugen2.total,0) + coalesce(ucol2.total,0) + coalesce(uwork2.total,0)) as total_credentials\n FROM users u\n LEFT JOIN userbasicinfo ub ON u.id = ub.user_id\n LEFT JOIN usercontactinfo uc ON uc.user_id = u.id\n LEFT JOIN refcountry rc ON rc.id = uc.country \n LEFT JOIN refbloodtype rb ON rb.id = ub.bloodtype\n LEFT OUTER JOIN(SELECT po.user_id, \n count(*) comments\n FROM postopinion po\n WHERE po.deleted_at IS NULL AND po.mask= 0\n GROUP BY po.user_id) as a ON a.user_id = u.id\t\n LEFT OUTER JOIN(SELECT top_o.user_id,\n count(*) discussion\n FROM topicopinion top_o\n WHERE top_o.deleted_at IS NULL AND top_o.mask=0\n GROUP BY top_o.user_id) as b ON b.user_id = u.id \n LEFT OUTER JOIN (select pc.user_id,\n sum(Case when type = 'F' then 1 else 0 end) image,\n sum(Case when type = 'Q' then 1 else 0 end) question,\n sum(Case when type = 'A' then 1 else 0 end) article,\n sum(Case when type = 'P' then 1 else 0 end) poll,\n count(*) post\n FROM postcontent pc\n WHERE pc.deleted_at IS NULL and pc.mask=0\n GROUP BY pc.user_id) as c ON c.user_id = u.id \n LEFT OUTER JOIN (select pca.postcontent_id, pc.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycontent,\n sum(Case when approvalrate = 'N' then 1 else 0 end) naycontent\n FROM postcontentapprovalrate pca\n LEFT JOIN postcontent pc ON pc.id=pca.postcontent_id\n WHERE pc.deleted_at IS NULL AND pc.mask=0\n GROUP BY pc.user_id) as d ON d.user_id = u.id\n LEFT OUTER JOIN (select poa.postopinion_id, po.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycomment,\n sum(Case when approvalrate = 'N' then 1 else 0 end) naycomment\n FROM postopinionapprovalrate poa\n LEFT JOIN postopinion po ON po.id = poa.postopinion_id\n LEFT JOIN postcontent pc ON pc.id=po.postcontent_id\n WHERE pc.deleted_at IS NULL AND po.deleted_at IS NULL AND po.mask=0\n GROUP BY po.user_id) as e ON e.user_id = u.id\n LEFT OUTER JOIN (select pra.postreply_id, pra.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yayreply,\n sum(Case when approvalrate = 'N' then 1 else 0 end) nayreply\n FROM postreplyapprovalrate pra\n LEFT JOIN postreply pr ON pr.id = pra.postreply_id\n LEFT JOIN postopinion po ON po.id = pr.postopinion_id\n LEFT JOIN postcontent pc ON pc.id=po.postcontent_id\n WHERE pc.deleted_at IS NULL AND po.deleted_at IS NULL \n AND pr.deleted_at IS NULL AND pr.mask=0\n GROUP BY pr.user_id) as f ON f.user_id = u.id\n LEFT OUTER JOIN (select pral2.postreplyL2_id, pral2.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yayreplyl2,\n sum(Case when approvalrate = 'N' then 1 else 0 end) nayreplyl2\n FROM postreplyL2approvalrate pral2\n LEFT JOIN postreplyL2 pr2 ON pr2.id = pral2.postreplyL2_id\n LEFT JOIN postreply pr ON pr.id = pr2.postreply_id\n LEFT JOIN postopinion po ON po.id = pr.postopinion_id\n LEFT JOIN postcontent pc ON pc.id=po.postcontent_id\n WHERE pc.deleted_at IS NULL AND po.deleted_at IS NULL \n AND pr.deleted_at IS NULL AND pr2.deleted_at AND pr2.mask=0\n GROUP BY pr2.user_id) as g ON g.user_id = u.id\n LEFT OUTER JOIN (select pral3.postreplyL3_id, pral3.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yayreplyl3,\n sum(Case when approvalrate = 'N' then 1 else 0 end) nayreplyl3\n FROM postreplyL3approvalrate pral3\n LEFT JOIN postreplyL3 pr3 ON pr3.id = pral3.postreplyL3_id\n LEFT JOIN postreplyL2 pr2 ON pr2.id = pr3.postreplyL2_id\n LEFT JOIN postreply pr ON pr.id = pr2.postreply_id\n LEFT JOIN postopinion po ON po.id = pr.postopinion_id\n LEFT JOIN postcontent pc ON pc.id=po.postcontent_id\n WHERE pc.deleted_at IS NULL AND po.deleted_at IS NULL \n AND pr.deleted_at IS NULL AND pr2.deleted_at \n AND pr3.deleted_at IS NULL AND pr3.mask=0\n GROUP BY pr3.user_id) as h ON h.user_id = u.id\n LEFT OUTER JOIN (select toa.topicopinion_id, ton.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaydiscussion,\n sum(Case when approvalrate = 'N' then 1 else 0 end) naydiscussion\n FROM topicopinionapprovalrate toa\n LEFT JOIN topicopinion ton ON ton.id = toa.topicopinion_id\n LEFT JOIN topic t ON t.id=ton.topic_id\n WHERE t.deleted_at IS NULL AND ton.deleted_at IS NULL AND ton.mask=0\n GROUP BY ton.user_id) as i ON i.user_id = u.id\n LEFT OUTER JOIN (select tra.topicreply_id, tra.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaytopicreply,\n sum(Case when approvalrate = 'N' then 1 else 0 end) naytopicreply\n FROM topicreplyapprovalrate tra\n LEFT JOIN topicreply tr ON tr.id = tra.topicreply_id\n LEFT JOIN topicopinion ton ON ton.id = tr.topicopinion_id\n LEFT JOIN topic t ON t.id=ton.topic_id\n WHERE t.deleted_at IS NULL AND ton.deleted_at IS NULL \n AND tr.deleted_at IS NULL AND tr.mask=0\n GROUP BY tr.user_id) as j ON j.user_id = u.id\n LEFT OUTER JOIN (select tral2.topicreplyl2_id, tral2.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaytopicreplyl2,\n sum(Case when approvalrate = 'N' then 1 else 0 end) naytopicreplyl2\n FROM topicreplyl2approvalrate tral2\n LEFT JOIN topicreplyl2 tr2 ON tr2.id = tral2.topicreplyl2_id\n LEFT JOIN topicreply tr ON tr.id = tr2.topicreply_id\n LEFT JOIN topicopinion ton ON ton.id = tr.topicopinion_id\n LEFT JOIN topic t ON t.id=ton.topic_id\n WHERE t.deleted_at IS NULL AND ton.deleted_at IS NULL \n AND tr.deleted_at IS NULL AND tr2.deleted_at IS NULL AND tr2.mask=0\n GROUP BY tr2.user_id) as k ON k.user_id = u.id\n LEFT OUTER JOIN (select tral3.topicreplyl3_id, tral3.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaytopicreplyl3,\n sum(Case when approvalrate = 'N' then 1 else 0 end) naytopicreplyl3\n FROM topicreplyl3approvalrate tral3\n LEFT JOIN topicreplyl3 tr3 ON tr3.id = tral3.topicreplyl3_id\n LEFT JOIN topicreplyl2 tr2 ON tr2.id = tr3.topicreplyl2_id\n LEFT JOIN topicreply tr ON tr.id = tr2.topicreply_id\n LEFT JOIN topicopinion ton ON ton.id = tr.topicopinion_id\n LEFT JOIN topic t ON t.id=ton.topic_id\n WHERE t.deleted_at IS NULL AND ton.deleted_at IS NULL \n AND tr.deleted_at IS NULL AND tr2.deleted_at IS NULL \n AND tr3.deleted_at IS NULL AND tr3.mask=0\n GROUP BY tr3.user_id) as l ON l.user_id = u.id\n LEFT OUTER JOIN(SELECT uf.user_one_id, \n count(*) friends\n FROM userfriends uf\n WHERE uf.status=1\n GROUP BY uf.user_one_id) as m ON m.user_one_id = u.id\t\n LEFT OUTER JOIN(SELECT ua.user_two_id, \n count(*) followers\n FROM useracquiantances ua\n WHERE ua.status=1\n GROUP BY ua.user_two_id) as n ON n.user_two_id = u.id\n LEFT OUTER JOIN(SELECT ua2.user_one_id, \n count(*) following\n FROM useracquiantances ua2\n WHERE ua2.status=1\n GROUP BY ua2.user_one_id) as o ON o.user_one_id = u.id\n LEFT JOIN usersettings us on us.user_id = u.id\n LEFT JOIN usergeneralinfo ugen ON ugen.user_id = us.user_id AND ugen.id = us.credential_refid\n LEFT JOIN usereduccollege ucol ON ucol.user_id = us.user_id AND ucol.id = us.credential_refid\n LEFT JOIN userworkhistory uwork ON uwork.user_id = us.user_id AND uwork.id = us.credential_refid\n LEFT OUTER JOIN (SELECT usergeneralinfo.user_id,\n COUNT(*) total\n FROM usergeneralinfo\n GROUP BY usergeneralinfo.user_id) as ugen2 ON ugen2.user_id = u.id\n LEFT OUTER JOIN (SELECT usereduccollege.user_id,\n COUNT(*) total\n FROM usereduccollege\n GROUP BY usereduccollege.user_id) as ucol2 ON ucol2.user_id = u.id\n LEFT OUTER JOIN (SELECT userworkhistory.user_id,\n COUNT(*) total\n FROM userworkhistory\n GROUP BY userworkhistory.user_id) as uwork2 ON uwork2.user_id = u.id\n WHERE u.id = {$user_id}\";\n \n return DB::select(DB::raw($sql));\n }", "public function get_preference_detail($userId,$searchId){\n //$userId = $post_data['userId'];\n //$searchId = $post_data['searchId'];\n\n $sql =\"SELECT s.*,u.userId,u.firstName,u.lastName\n \n FROM searchcriteria s,users u WHERE u.userId = s.userId AND s.deleteFlag != 1 AND s.searchId = $searchId AND s.userId =$userId\";\n \n $record = $this->db->query($sql);\n if($record->num_rows()>0){\n return $record->result_array()[0];\n //print_r($record->result_array());exit();\n } \n }", "function get_user_details($user_id, $cond = array()) {\n\n $ci = & get_instance();\n $lang_id = get_current_language();\n $user = array();\n $lang_case = \"`id`.`lang_id`= CASE WHEN (EXISTS (SELECT id FROM \" . INTERESTS_DATA . \" WHERE lang_id = '$lang_id') ) THEN $lang_id ELSE 1 END\";\n\n $ci->db->select(\"u.id as uid,u.plan_expire as u_plan_expire,u.plan_type as u_plan_type,u.plan_id as u_plan_id, u.*, pr.*, f.*, f.id as file_id, fam.id as fam_id,fam.plan_expire,fam.plan_type,fam.plan_id, fam.*\");\n $ci->db->from(USER . \" u\");\n $ci->db->join(PROFILE . \" pr\", \"pr.user_id = u.id\", 'left');\n $ci->db->join(FILES . \" f\", \"pr.profile_Image = f.id\", 'left');\n $ci->db->join(FAMILY_USERS . \" fu\", \"fu.user_id = u.id\", 'left');\n $ci->db->join(FAMILY . \" fam\", \"fu.family_id = fam.id\", 'left');\n $ci->db->where(\"u.id\", $user_id);\n $query = $ci->db->get();\n\n\n if ($query->num_rows() > 0) {\n $result = $query->result_array();\n $user = $result[0];\n\n// Get data from for user interests\n $ci->db->select(\"i.*, id.content\");\n $ci->db->from(INTERESTS . \" i\");\n $ci->db->join(PROFILE_INTEREST . \" pi\", \"pi.interest_id = i.id\");\n $ci->db->join(INTERESTS_DATA . \" id\", \"id.interest_id = i.id\");\n $ci->db->where(\"pi.user_id\", $user_id);\n $ci->db->where($lang_case);\n//$ci->db->distinct();\n $query_int = $ci->db->get();\n if ($query_int->num_rows() > 0) {\n $details = $query_int->result_array();\n $user['interest'] = $details;\n } else {\n $user['interest'] = array();\n }\n\n // Get data from for user family children\n $ci->db->select(\"fc.*\");\n $ci->db->from(FAMILY . \" f\");\n $ci->db->join(FAMILY_CHILDREN . \" fc\", \"f.id = fc.family_id\");\n $ci->db->join(FAMILY_USERS . \" fu\", \"fu.family_id = fc.family_id\");\n $ci->db->where(\"fu.user_id\", $user_id);\n//$ci->db->distinct();\n $query_child = $ci->db->get();\n if ($query_child->num_rows() > 0) {\n $details = $query_child->result_array();\n $user['family_children'] = $details;\n } else {\n $user['family_children'] = array();\n }\n\n// Get data from for user family pets\n $ci->db->select(\"fp.*\");\n $ci->db->from(FAMILY . \" f\");\n $ci->db->join(FAMILY_PETS . \" fp\", \"f.id = fp.family_id\");\n $ci->db->join(FAMILY_USERS . \" fu\", \"fu.family_id = fp.family_id\");\n $ci->db->where(\"fu.user_id\", $user_id);\n//$ci->db->distinct();\n $query_pets = $ci->db->get();\n if ($query_pets->num_rows() > 0) {\n $details = $query_pets->result_array();\n $user['family_pets'] = $details;\n } else {\n $user['family_pets'] = array();\n }\n\n// Get data from for user family elders\n $ci->db->select(\"fe.*\");\n $ci->db->from(FAMILY . \" f\");\n $ci->db->join(FAMILY_ELDERS . \" fe\", \"f.id = fe.family_id\");\n $ci->db->join(FAMILY_USERS . \" fu\", \"fu.family_id = fe.family_id\");\n $ci->db->where(\"fu.user_id\", $user_id);\n//$ci->db->distinct();\n $query_elders = $ci->db->get();\n if ($query_elders->num_rows() > 0) {\n $details = $query_elders->result_array();\n $user['family_elders'] = $details;\n } else {\n $user['family_elders'] = array();\n }\n /**\n $family_users = array();\n $users = family_user();\n // pre($users);\n $ids = array_column($users, 'user_id');\n foreach ($ids as $user) {\n $userinfo = get_user_basic_info($user);\n $userinfo['is_user'] = 1;\n $userinfo['user_id'] = $user;\n $family_users[] = $userinfo;\n }\n\n $ci->db->where(\"family_id\", $_SESSION['userSession']['family_id']);\n $qqur = $ci->db->get(PARENT_ADMIN);\n $res_parent = $qqur->result_array();\n foreach ($res_parent as $parent) {\n if(in_array($parent['user_id'], array_column($family_users, 'user_id'))) {\n $family_users[$parent['user_id']]['role'] = $parent['role'];\n }\n if ($family_users[$parent['user_id']]) {\n $family_users[$parent['user_id']]['role'] = $parent['role'];\n }else{\n\n }\n }\n * */\n $ci->db->select(\"pa.*\");\n $ci->db->from(FAMILY . \" f\");\n $ci->db->join(PARENT_ADMIN . \" pa\", \"f.id = pa.family_id\");\n $ci->db->join(FAMILY_USERS . \" fu\", \"fu.family_id = pa.family_id\");\n $ci->db->where(\"fu.user_id\", $user_id);\n //$ci->db->distinct();\n $query_elders = $ci->db->get();\n if ($query_elders->num_rows() > 0) {\n $details = $query_elders->result_array();\n $user['family_admin'] = $details;\n } else {\n $user['family_admin'] = array();\n }\n\n// Get data from for user family home address\n $ci->db->select(\"ha.*, cd.content\");\n $ci->db->from(FAMILY . \" f\");\n $ci->db->join(HOME_ADDRESS . \" ha\", \"f.id = ha.family_id\");\n $ci->db->join(FAMILY_USERS . \" fu\", \"fu.family_id = ha.family_id\");\n $ci->db->join(COUNTRY . \" c\", \"ha.country = c.id\", 'left');\n $ci->db->join(COUNTRY_DATA . \" cd\", \"cd.country_id = ha.country\", 'left');\n $ci->db->where(\"fu.user_id\", $user_id);\n $query_add = $ci->db->get();\n if ($query_add->num_rows() > 0) {\n $details = $query_add->row_array();\n $user['home_address'] = $details;\n } else {\n $user['home_address'] = array();\n }\n\n// Get data from for user family emergency Contact\n $ci->db->select(\"ec.*, cd.content\");\n $ci->db->from(FAMILY . \" f\");\n $ci->db->join(EMERGENCY_CONTACT . \" ec\", \"f.id = ec.family_id\");\n $ci->db->join(FAMILY_USERS . \" fu\", \"fu.family_id = ec.family_id\");\n $ci->db->join(COUNTRY . \" c\", \"ec.country = c.id\", 'left');\n $ci->db->join(COUNTRY_DATA . \" cd\", \"cd.country_id = ec.country\", 'left');\n $ci->db->where(\"fu.user_id\", $user_id);\n $query_eme = $ci->db->get();\n if ($query_eme->num_rows() > 0) {\n $details = $query_eme->row_array();\n $user['emergency_contact'] = $details;\n } else {\n $user['emergency_contact'] = array();\n }\n\n// Get data from for user family doctor\n $ci->db->select(\"d.*, cd.content\");\n $ci->db->from(FAMILY . \" f\");\n $ci->db->join(DOCTOR . \" d\", \"f.id = d.family_id\");\n $ci->db->join(FAMILY_USERS . \" fu\", \"fu.family_id = d.family_id\");\n $ci->db->join(COUNTRY . \" c\", \"d.country = c.id\", 'left');\n $ci->db->join(COUNTRY_DATA . \" cd\", \"cd.country_id = d.country\", 'left');\n $ci->db->where(\"fu.user_id\", $user_id);\n $query_doc = $ci->db->get();\n if ($query_doc->num_rows() > 0) {\n $details = $query_doc->row_array();\n $user['doctor'] = $details;\n } else {\n $user['doctor'] = array();\n }\n\n// Get data from for user family Gallery\n $ci->db->select(\"fg.*\");\n $ci->db->from(FAMILY . \" f\");\n $ci->db->join(FAMILY_GALLERY . \" fg\", \"f.id = fg.family_id\");\n $ci->db->join(FAMILY_USERS . \" fu\", \"fu.family_id = fg.family_id\");\n $ci->db->where(\"fu.user_id\", $user_id);\n $query_gal = $ci->db->get();\n $user['family_gallery'] = ($query_gal->num_rows() > 0) ? $query_gal->result_array() : array();\n\n// Get data from for user family friends\n $ci->db->select(\"fr.*\");\n $ci->db->from(FAMILY . \" f\");\n $ci->db->join(FRIENDS . \" fr\", \"f.id = fr.from_id OR f.id = fr.to_id\");\n $ci->db->join(FAMILY_USERS . \" fu\", \"fu.family_id = fr.from_id OR fu.family_id = fr.to_id\");\n $ci->db->where(\"fu.user_id\", $user_id);\n $ci->db->distinct();\n $query_fr = $ci->db->get();\n $user['friends'] = ($query_fr->num_rows() > 0) ? $query_fr->result_array() : array();\n }\n return $user;\n}", "function queryRicercaAvanzata ($info_utente, $hobby){\r\n \r\n // condizione dell'info utente\r\n $cond_info_utente = '';\r\n $cond_hobby = '';\r\n \r\n foreach ($info_utente as $key => $value) {\r\n if($value != 'NULL'){\r\n $cond_info_utente .= $key . '=' . $value . ' AND ';\r\n } \r\n }\r\n \r\n //considero il caso cui siano stati inseriti hobby nella ricerca\r\n //in caso affermativo viene aggiunta la condizione per gli hobby\r\n if(!empty($hobby)){\r\n foreach ($hobby as $key => $value) {\r\n $cond_hobby .= 'tipo_hobby' . '=' . $value . ' OR '; \r\n } \r\n $condizione = (trim($cond_info_utente . '(' . $cond_hobby , 'OR ')) . ')'; \r\n }\r\n // nel caso gli hobby non siano stati inseriti ripulisco la condizione togliendo and finali e \r\n // considero solo come condizione le info utente\r\n else{\r\n $condizione = trim($cond_info_utente , 'AND ');\r\n }\r\n \r\n $sql = 'SELECT email_utente, nickname, utente_esperto, utente_seguito, utente_seguace, path_img_profilo, data_ora_richiesta, ' .\r\n 'richiesta_accettata, data_ora_risposta ' . \r\n 'FROM (utente NATURAL JOIN info_utente ) LEFT OUTER JOIN seguaci_seguiti ' . \r\n 'ON email_utente = utente_seguito AND utente_seguace =' . \r\n \"'\" . $_SESSION['email_utente'] . \"' \" .\r\n 'WHERE email_utente IN (' .\r\n 'SELECT email_utente ' .\r\n 'FROM info_utente NATURAL LEFT OUTER JOIN hobby ' .\r\n 'WHERE ' . $condizione . ')'; \r\n\r\n return $sql;\r\n}", "public function fetchProfileDetails($userId)\n {\n $sql = \"SELECT quotes.id, quotes.content, genre1.genre1, genre2.genre2, genre3.genre3, author.author, users.firstname, users.lastname, users.username, users.email, users.gender, users.dt\n FROM quoteLovers\n INNER JOIN quotes ON quoteLovers.quote=quotes.id\n INNER JOIN users ON quoteLovers.user=users.id\n INNER JOIN genre1 ON quoteLovers.genre1=genre1.id\n INNER JOIN genre2 ON quoteLovers.genre2=genre2.id\n INNER JOIN genre3 ON quoteLovers.genre3=genre3.id\n INNER JOIN author ON quoteLovers.author=author.id\n WHERE quoteLovers.user='$userId'\";\n\n $query = mysqli_query($this->con, $sql);\n return $query; \n }", "function getuser()\n\t {\n\t \t//$this->db->where('as', null);\n\t \t\n\t \t$where = '(status=\"aktif\" or status is null)';\n \t$this->db->where($where);\n \t\t\n\t \t$query = $this->db->get('user');\n\t \tif ($query -> num_rows() > 0)\n\t\t{\n\t \t\treturn $query->result();\n\t \t}else{\n\t \t\treturn false;\n\t \t}\n\t }", "function users_by_hobby_id($hobby_id,$total=5,$exclude=array()){\r\n\r\n//get subscribers\r\n$users=$this->get_subscribers($hobby_id,$total,$exclude);\r\n\r\n//final arrary to be returned\r\n$return=array();\r\n\r\nif(!count($users))return $return;\r\n\r\n//form SQL query\r\n$sql=\"select id,first,last,country from userdata where \". SQL_valid_users(false). \" && \".SQL_not_in($this->get_uids($users),\"id\",false).\" order by RAND()\";\r\n\r\n$mysqli =new mysqli($GLOBALS['host'],$GLOBALS['db_user'],$GLOBALS['db_passwd'],$GLOBALS['selected_db']);\r\n\r\nif($result=$mysqli->query($sql))\r\n{\r\nif($result->num_rows>0)\r\n{\r\nwhile($row=$result->fetch_array())\r\n{\r\n$return[]=$row;\r\n}\r\n}\r\n}\r\n\r\nreturn $return;\r\n\r\n}", "function queryRicercaTuttiGliUtenti(){\r\n \r\n $sql = 'SELECT email_utente, nickname, utente_esperto, utente_seguito, utente_seguace, path_img_profilo, data_ora_richiesta, ' .\r\n 'richiesta_accettata, data_ora_risposta ' . \r\n 'FROM (utente NATURAL JOIN info_utente ) LEFT OUTER JOIN seguaci_seguiti ' . \r\n 'ON email_utente = utente_seguito AND utente_seguace =' . \r\n \"'\" . $_SESSION['email_utente'] . \"'\" ;\r\n \r\n return $sql;\r\n}", "public function get_user_search_info($userId,$searchId){\n $sql = \"SELECT u.firstName,s.searchName from users u,searchcriteria s where u.userId =$userId AND s.searchId =$searchId AND s.deleteFlag !=1 AND u.deleteFlag !=1 \";\n $result = $this->db->query($sql);\n return $result->result_array(); \n }", "function find_allusersearch_desc($user) {\n global $db;\n {\n return find_by_sql(\"SELECT * FROM search WHERE user='{$db->escape($user)}' ORDER BY id DESC\");\n }\n}", "function search($db,$page,$per,$status='',$year=0,$month=0,$userid=0)\r\n\t{\r\n//if($condition=='name'){\r\n//$sql.=\" and b.name like '%\".$keys.\"%'\";\r\n//}\r\n\t\t$sql = \"select * from \".AGENT_TOTAL_TABLE.\" where id>0\";\r\n\t\t\tif($status>-1){\r\n\t\t\t\t$sql.=\" and status ='\".$status.\"'\";\r\n\t\t\t}\r\n\t\t\tif($year>0){\r\n\t\t\t\t$sql.=\" and year ='\".$year.\"'\";\r\n\t\t\t}\r\n\t\t\tif($month>0){\r\n\t\t\t\t$sql.=\" and month ='\".$month.\"'\";\r\n\t\t\t}\r\n\t\t\tif($userid>0){\r\n\t\t\t\t$sql.=\" and agent_userid ='\".$userid.\"'\";\r\n\t\t\t}\r\n\t\t$sql.=\" order by id desc\";\r\n//\t\techo $sql;\r\n\t\t$pager = get_pager_data($db, $sql, $page,$per);\r\n\t\treturn $pager;\r\n\t}", "public function getUsers($userid=''){\n $this->db->select($this->users.'.*');\n $this->db->select($this->address.'.address,country,latitude,longitude,map_address');\n $this->db->select($this->plan.'.name as plan_name,amount as plan_amount');\n $this->db->select($this->role.'.role as role_name');\n $this->db->select($this->offers.'.offer_name,description as offer_description ,discount_amount as offer_discount_amount ,discount_percentage as offer_discount_percentage,from_date as plan_from_date,to_date as plan_to_date');\n $this->db->select($this->industry.'.id as indusctryId');\n $this->db->select($this->industry.'.name as indusctryName');\n\n $this->db->from($this->users);\n $this->db->join($this->plan,$this->plan.'.id='.$this->users.'.plan_id','left');\n $this->db->join($this->role,$this->role.'.id='.$this->users.'.role','left');\n $this->db->join($this->offers,$this->offers.'.id='.$this->users.'.offer_id','left');\n $this->db->join($this->industry,$this->industry.'.id='.$this->users.'.industry_id','left');\n $this->db->join($this->address,$this->address.'.user_id='.$this->users.'.id','right');\n \n \n $this->db->where($this->users.'.delete', 0);\n if(!empty($userid)){\n $this->db->where($this->users.'.id',$userid);\n }\n\n\n $query = $this->db->get();\n // echo $this->db->last_query(); die;\n\n if($query->num_rows()>0){\n if(!empty($userid)){\n return $query->row();\n }else{\n return $query->result_array();\n }\n }else{\n return False;\n }\n\n }", "function get_user_latest_search_info($loginUserId){\n $sql = \"SELECT u.userId,u.firstName,u.lastName,u.email,u.deleteFlag,u.sherpaSignedup,s.searchId,s.idealMovingDate,s.minPrice,s.maxPrice,s.minBedroom,s.maxBedroom \n FROM users u \n LEFT JOIN searchcriteria s ON u.userId = s.userId \n WHERE u.userId = $loginUserId AND u.deleteFlag != 1 \n GROUP BY s.searchId ORDER BY s.searchId DESC LIMIT 1;\n \";\n $result = $this->db->query($sql);\n if($result->num_rows()>0){\n return $result->result_array();\n }else{\n return false;\n }\n \n }", "function tutor_info_sql($userid,$verified,$specific_account = 1) {\n\t\t$sql = \"SELECT tutor_info.* FROM tutor_info,hod_info WHERE tutor_info.verified = '{$verified}' AND hod_info.user_id = '{$userid}' AND tutor_info.department = hod_info.department \";\n\t\tif($specific_account != 1){\n\t\t\t$sql .= \"AND tutor_info.user_id = '{$specific_account}' \";\n\t\t}\n\t\treturn $sql;\n\t}", "function getPersonalInboxQueries($connection,$userId,$inboxMessageSearch){\n $query = \"SELECT fpd.*,fu.name AS user_name,fu.profile_pic AS user_profile,fpd.datetime as posted_time FROM forum_personal_discussion fpd LEFT JOIN forum_users fu on fu.user_id=fpd.user_id WHERE fpd.person_id='$userId' \";\n\n // echo $query;\n if ($inboxMessageSearch){\n $query .= \" AND ( fpd.discussion_title LIKE '%{$inboxMessageSearch}%' OR fpd.message LIKE '%{$inboxMessageSearch}%' OR fu.name LIKE '%{$inboxMessageSearch}%') \";\n }\n $query .= ' ORDER BY datetime DESC';\n $result = $connection->query($query);\n return $result;\n }", "public function filter_books50($data){\n $query=$this->db->query('SELECT * FROM `user_books` INNER JOIN `users` ON `users`.`username` = `user_books`.`user_username` WHERE `availability`=\"1\" AND `cond` = \"'.$data['cond'].'\" AND `lang` = \"'.$data['lang'].'\" AND `users`.`user_region` = \"'.$data['region'].'\" AND NOT `user_username`= \"'.$data['username'].'\" ORDER BY `date_added` DESC LIMIT 150;');\n return $query->result();\n }", "public function filter_books10($data){\n $query=$this->db->query('SELECT * FROM `user_books` INNER JOIN `users` ON `users`.`username` = `user_books`.`user_username` WHERE `availability`=\"1\" AND `cond` = \"'.$data['cond'].'\" AND `lang` = \"'.$data['lang'].'\" AND `book_genre` = \"'.$data['book_genre'].'\" AND `users`.`user_region` = \"'.$data['region'].'\" AND NOT `user_username`= \"'.$data['username'].'\" ORDER BY `date_added` DESC LIMIT 150;');\n return $query->result();\n }", "static function advancedSearchUser($user = null, $operator = 'AND', $order = 'id', $begin = 0)\r\n {\r\n if ($user === null)\r\n {\r\n return null;\r\n }\r\n\r\n $tableUser = DatabaseManager::getNameTable('TABLE_USER');\r\n $tableChurch = DatabaseManager::getNameTable('TABLE_CHURCH');\r\n\r\n $username = $user->getUsername();\r\n $type = $user->getType();\r\n $online = $user->getOffline();\r\n $user->getId() == 0 ? $id = '' : $id = $user->getId();\r\n\r\n if ($online == 'true')\r\n {\r\n $online = \"0\";\r\n }\r\n else\r\n {\r\n $online = \"\";\r\n }\r\n\r\n if ($type == '0')\r\n {\r\n $type = \"\";\r\n }\r\n else if ($type == '1')\r\n {\r\n $type = \"A\";\r\n }\r\n else if ($type == '2')\r\n {\r\n $type = \"G\";\r\n }\r\n\r\n $queryChurch = \"(\";\r\n $posibleChurch = $user->getIdChurch();\r\n\r\n if ($posibleChurch !== NULL) //If exist church\r\n {\r\n for ($i = 0; $i < sizeof($posibleChurch) - 1; $i++)\r\n {\r\n $queryChurch = $queryChurch . $posibleChurch[$i]->getId() . \",\";\r\n }\r\n\r\n $queryChurch = $queryChurch.$posibleChurch[sizeof($posibleChurch)-1]->getId(). \")\";\r\n $queryChurch = \"(c.id IN \" . $queryChurch . \")\";\r\n }\r\n\r\n $query = \"SELECT b.* FROM $tableUser AS b\r\n JOIN $tableChurch AS c ON b.idChurch = c.id\r\n WHERE b.id LIKE '%$id%' $operator\r\n b.type LIKE '%$type%' $operator\r\n b.username LIKE '%$username%' $operator \";\r\n\r\n if ($online !== '')\r\n {\r\n $query = $query . \"b.offline = $online $operator \";\r\n }\r\n\r\n if ($queryChurch != '(')\r\n {\r\n $query = $query . $queryChurch . \" \";\r\n }\r\n else\r\n {\r\n $query = $query . \"(c.id IN ())\" . \" \";\r\n }\r\n if ($order == 'username')\r\n {\r\n $query = $query . \" ORDER BY b.username\";\r\n }\r\n else if ($order == 'nameChurch')\r\n {\r\n $query = $query . \" ORDER BY c.name\";\r\n }\r\n else\r\n {\r\n $query = $query . \" ORDER BY b.id DESC\";\r\n }\r\n\r\n $query = $query. \" LIMIT \" . strval($begin * 10) . \", 11 \";\r\n\r\n $arrayUsers = DatabaseManager::multiFetchAssoc($query);\r\n $users = array();\r\n\r\n if ($arrayUsers !== NULL)\r\n {\r\n $i = 0;\r\n foreach ($arrayUsers as $user) \r\n {\r\n if ($i == 10)\r\n {\r\n continue;\r\n }\r\n\r\n $users[] = self::ArrayToUser($user);\r\n $i++;\r\n }\r\n\r\n return $users;\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }", "public function searchSuppliers($suppliername, $country, $city, $town) {\n\n $this->db->select('');\n $this->db->where('user_id !=', 1);\n if (!empty($suppliername))\n $this->db->like($suppliername);\n if (!empty($country))\n $this->db->where($country);\n if (!empty($city))\n $this->db->where($city);\n if (!empty($town))\n $this->db->where($town);\n\n $this->db->order_by('user_name', 'asc');\n\n $this->db->from('user');\n $this->db->join('country','user.country =country.id');\n $this->db->join('states','user.state =states.state_code');\n $this->db->join('tbl_categorydesign','user.user_id =tbl_categorydesign.uId');\n\n $query = $this->db->get();\n\n return $query->result();\n}", "function GetUserInfromation($userID=false,$languageID=false)\n\t{\n\t\t$this->db->query(\"select rp_users.userEmail,rp_user_details.userCompanyName from rp_users,rp_user_details where rp_users.userID='$userID' and rp_user_details.userID='$userID' and rp_users.userStatus='Active' and rp_user_details.languageID='$languageID'\");\n\t\treturn $qry->result();\n\t}", "function get_userdetails($value)\n {\n // return $query->result();\n $this->db->select('up.*,us.*,cn.*,st.*,ct.*');\n $this->db->from('users us');\n $this->db->join('address up', 'up.id=us.addressid', 'left');\n $this->db->join('countries cn', 'up.country=cn.id', 'left');\n $this->db->join('states st', 'st.s_id=up.state', 'left');\n $this->db->join('cities ct', 'up.city=ct.c_id', 'left');\n $this->db->where('us.id', $value);\n $result = $this->db->get()->result();\n return $result;\n }", "public function getAllUserProfiles() {\n $gender = $this->session->userdata('key_gender');\n extract($_GET);\n //print_r($_GET);\n $result = $this->Searchbyprofileid_model->getAllUserProfiles($gender);\n if (!$result) {\n echo '500';\n } else {\n print_r(json_encode($result));\n }\n }", "function hod_info_sql($userid,$verified,$specific_account = 1) {\n\t\t$sql = \"SELECT hod_info.* FROM hod_info WHERE hod_info.verified = '{$verified}' \";\n\t\tif($specific_account != 1){\n\t\t\t$sql .= \"AND hod_info.user_id = '{$specific_account}' \";\n\t\t}\n\t\treturn $sql;\n\t}", "function userRequestFetch(){\n\n $userRequest=mysql_query(\"SELECT user,friend FROM Friend\n WHERE user=(SELECT user_id FROM Account WHERE user_email='$_SESSION[user_email]')\n AND friend=(SELECT user_id FROM Account WHERE user_email='$_SESSION[friend_email]')\") \n or die(\"<p>user request failed.</p>\");\n\n $userRequestFetch=mysql_fetch_array($userRequest);\n\n return $userRequestFetch;\n }", "function suchPerson($muster) {\n //$pre = ($_SESSION[\"preon\"])?\"%\":\"\"; //wiederspricht sich mit der Zeile danach\n $pre = isset($muster[\"pre\"])?$_SESSION[\"pre\"]:\"\";\n $fuzzy=$muster[\"fuzzy\"];\n $andor = $muster[\"andor\"];\n $rechte=berechtigung(\"cp_\");\n\n $joinCustomer = \" left join customer K on C.cp_cv_id=K.id\";\n $joinVendor = \" left join vendor V on C.cp_cv_id=V.id\";\n if ($muster[\"cp_name\"]==\"~\") {\n $where=\"and upper(cp_name) ~ '^\\[^A-Z\\].*$'\";\n } else {\n $dbf = array(\"cp_name\", \"cp_givenname\", \"cp_gender\", \"cp_title\" ,\n \"cp_street\", \"cp_zipcode\", \"cp_city\", \"cp_country\", \"country\",\n \"cp_phone1\", \"cp_fax\", \"cp_homepage\", \"cp_email\",\n \"cp_notes\", \"cp_stichwort1\",\"cp_birthday\", \"cp_beziehung\",\n \"cp_abteilung\", \"cp_position\", \"cp_cv_id\", \"cp_owener\");\n $keys=array_keys($muster);\n $anzahl=count($keys);\n $where=\"\";\n if ( isset( $muster[\"customer_name\"] ) ) {\n $whereCustomer = \"K.name ilike '$pre\" . $muster[\"customer_name\"] . \"$fuzzy'\";\n $whereVendor = \"V.name ilike '$pre\" . $muster[\"customer_name\"] . \"$fuzzy'\";\n } else {\n $whereCustomer = '1=1';\n $whereVendor = '1=1';\n }\n\n $daten=false;\n $tbl0=false;\n\n $where = array();\n for ($i=0; $i<$anzahl; $i++) {\n if (in_array($keys[$i],$dbf) && $muster[$keys[$i]]) {\n $suchwort=trim($muster[$keys[$i]]);\n $suchwort=strtr($suchwort,\"*?\",\"%_\");\n if ($keys[$i]==\"cp_birthday\") {$d=explode(\"\\.\",$suchwort); $suchwort=$d[2].\"-\".$d[1].\"-\".$d[0]; };\n if ($keys[$i]==\"cp_phone1\") {\n //Telefonnummer in beliebigen Telefonfeld suchen.\n $tmp =\"(cp_phone1 like '\".$pre.$suchwort.\"$fuzzy' \";\n $tmp .=\"or cp_phone2 like '\".$pre.$suchwort.\"$fuzzy' \";\n $tmp .=\"or cp_mobile1 like '\".$pre.$suchwort.\"$fuzzy' \";\n $tmp .=\"or cp_mobile2 like '\".$pre.$suchwort.\"$fuzzy' \";\n $tmp .=\"or cp_satphone like '\".$pre.$suchwort.\"$fuzzy')\";\n $where[] = $tmp;\n } else {\n $where[].=$keys[$i].\" ilike '\".$pre.$suchwort.\"$fuzzy'\";\n }\n }\n }\n $where = implode (\" $andor \",$where);\n $x=0;\n }\n $felderContact=\"C.cp_id, C.cp_cv_id, C.cp_title, C.cp_name, C.cp_givenname, C.cp_fax, C.cp_email, C.cp_gender as cp_gender\";\n $felderContcatOrCustomerVendor=\"COALESCE (C.cp_country, country) as cp_country,COALESCE (C.cp_zipcode, zipcode) as cp_zipcode,\n COALESCE (C.cp_city, city) as cp_city, COALESCE (C.cp_street, street) as cp_street,\n COALESCE (NULLIF (C.cp_phone1, ''), NULLIF (C.cp_mobile1, ''), phone) as cp_phone1\";\n\n\n $rs0=array(); //leere arrays initialisieren, damit es keinen fehler bei der funktion array_merge gibt\n if ($muster[\"customer\"]){ //auf checkbox customer mit Titel Kunden prüfen\n $sql0=\"select $felderContact, $felderContcatOrCustomerVendor, K.name as name, K.language_id as language_id,\n 'C' as tbl from contacts C$joinCustomer where C.cp_cv_id=K.id and ($whereCustomer $andor $where) and $rechte order by cp_name\";\n $rs0=$GLOBALS['dbh']->getAll($sql0);\n if (!$rs0) $rs0=array();\n }\n $rs1=array(); //s.o.\n if ($muster[\"vendor\"]){ //auf checkbox vendor mit Titel Lieferant prüfen\n $sql0=\"select $felderContact, $felderContcatOrCustomerVendor, V.name as name, V.language_id as language_id, 'V' as tbl\n from contacts C$joinVendor where C.cp_cv_id=V.id and ($whereVendor $andor $where) and $rechte order by cp_name\";\n $rs1=$GLOBALS['dbh']->getAll($sql0);\n if (!$rs1) $rs1=array();\n }\n $rs2=array(); //s.o.\n if ( isset( $muster[\"deleted\"] ) ) { //auf checkbox deleted mit Titel \"gelöschte Ansprechpartner (Kunden und Lieferanten)\" prüfen\n // es gibt nicht nur gelöschte Personen, sonder auch Personen ohne Zuordnung zu Firmen, z.B. private Adressen\n $sql0=\"select $felderContact, C.cp_country, C.cp_zipcode, C.cp_city, C.cp_street, C.cp_phone1,\n '' as name,'P' as tbl from contacts C where $rechte and (\".$where.\") and C.cp_cv_id is null order by cp_name\";\n $rs2=$GLOBALS['dbh']->getAll($sql0);\n if (!$rs2) $rs2=array();\n }\n return array_merge($rs0,$rs1,$rs2); //alle ergebnisse zusammenziehen und zurückgeben\n}", "public function listbooking($user=\"\") {\n \t$this->db->select('rumah.*, booking.*');\n\t\t$this->db->from('rumah');\n\t\t$this->db->where('rumah.user', $user);\n\t\t$this->db->join('users','users.id = rumah.user','right');\n\t\t$this->db->join('booking','booking.rumah = rumah.id','right');\n\t\t$this->db->order_by('rumah.id','desc');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array(); \n }", "function make_query($logged_person){\n $table_name = \"LogInTable\"; \n $sql = \"SELECT * FROM $table_name WHERE \";\n \n //attributes \n $value = $logged_person->funcitional_query(\"account\",$logged_person->account);\n $sql .= $value.\" and \"; \n \n $value = $logged_person->funcitional_query(\"research_group\", $logged_person->research_group);\n $sql .= $value.\" and \"; \n\n $value = $logged_person->funcitional_query(\"password\", $logged_person->password);\n $sql .= $value.\" \"; \n \n return $sql; \n }", "function get_all_genders()\n\t\t{\n\t\t\t$query=\"SELECT * from tbl_gender\";\n\t\t\t$result = execute_query($query);\n\t\t\treturn new readonlyresultset($result);\n\t\t}", "function company_following_user_query( $company_id=\"\", $following_type='', $user_id, $current_user_id=\"\", $short_type='' )\n\t{\n\t\t//echo $current_user_id.\"<br>\";\n\t\t$sql = \"SELECT UFC.id, UFC.user_id, UFC.company_id, UFC.following_date, UFC.following_type, UFC.user_id AS next_user_id,\n\t\t\t\tU.users_firstname, U.users_lastname, \n\t\t\t\tIF(U.users_profilepic IS NULL OR U.users_profilepic = '', 'no-image.png', U.users_profilepic)AS users_profilepic,\n\t\t\t\tfnStripTags(U.users_bio) AS users_bio, IF(U.users_phone IS NULL OR U.users_phone = '', 'N/A', U.users_phone) AS users_phone, U.users_current_employer,U.users_current_title,\n\t\t\t\thia_cities.name AS city_name, hia_states.name AS state_name, hia_countries.name AS country_name,\n\t\t\t\tUCV.company_id AS viewing_company_id, UCV.id AS viewing_id, UCV.viewing_date AS max_view_date\n\t\t\t\tFROM hia_user_following_company AS UFC\n\t\t\t\tJOIN hia_users AS U ON( UFC.user_id = U.users_id )\n\t\t\t\tLEFT JOIN hia_cities ON (U.users_city = hia_cities.id)\n\t\t\t\tLEFT JOIN hia_states ON (U.users_state = hia_states.id)\n\t\t\t\tLEFT JOIN hia_countries ON (U.users_country = hia_countries.id)\n\t\t\t\tLEFT JOIN \n\t\t\t\t\t(\n\t\t\t\t\t\tSELECT id, user_id, company_id, viewing_type, MAX(viewing_date) AS viewing_date \n\t\t\t\t\t\tFROM hia_user_view_company WHERE company_id = '$company_id' AND viewing_type = 'company'\n\t\t\t\t\t\tGROUP BY user_id\n\t\t\t\t\t\t\n\t\t\t\t\t) UCV ON (U.users_id = UCV.user_id AND UCV.company_id = '$company_id' )\n\t\t\t\tWHERE U.users_type != '3'\n\t\t\t\tAND U.users_status != '1'\n\t\t\t\tAND U.company_type != '1' \";\n\n\t\tif ($following_type != \"\") {\n\t\t\t$sql.= \" AND UFC.following_type = '$following_type' \";\n\t\t}\n\t\t\t\t\n\t\tif ($user_id != \"\") {\n\t\t\t$sql.= \" AND UFC.user_id = '$user_id' \";\n\t\t}\n\t\t\t\t\n\t\tif ($company_id != \"\") {\n\t\t\t$sql.= \" AND UFC.company_id = '$company_id' \";\n\t\t}\n\t\tif ($current_user_id != \"\" && $short_type =='next') {\n\t\t\t$sql.= \" AND UFC.user_id > '$current_user_id' \";\n\t\t}\n\t\tif ($current_user_id != \"\" && $short_type =='prev') {\n\t\t\t$sql.= \" AND UFC.user_id < '$current_user_id' \";\n\t\t}\n\t\t\n\n\t\tif ( $short_type=='prev') {\n\t\t\t$sql.= \" ORDER BY UFC.user_id DESC \";\n\t\t}\n\t\telse {\n\t\t\t$sql.= \" ORDER BY UFC.user_id ASC \";\n\t\t}\n\t\t//echo $sql;exit;\n\n\t\tif ( ! $this->db->simple_query($sql))\n\t\t{\n\t\t\t$error = $this->db->error();\n\t\t\t//print_r($error);\n\t\t\t//exit();\n\t\t\treturn $error;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = $this->db->query($sql);\n\t\t\t\n\t\t\treturn $query->result_array();\n\t\t}\n\t\t\n\t}", "public function getUserDetails() {\n $usersDetails = $this->db->prepare(\n 'SELECT \n `us`.`lastname`\n ,`us`.`firstname`\n ,DATE_FORMAT(`pat`.`birthDate`, \\'%d/%m/%Y\\') AS `birthDateFr` \n ,`pat`.`birthDate`\n ,`pat`.`phoneNumbers`\n ,`us`.`mail`\n FROM \n `dom20_users` as `us`\n INNER JOIN \n `dom20_patients` AS `pat`\n ON `us`.`id` = `pat`.`id_dom20_users`\n WHERE\n `us`.`id` = :id \n ');\n $usersDetails->bindValue(':id', $this->id, PDO::PARAM_INT);\n $usersDetails->execute();\n return $usersDetails->fetch(PDO::FETCH_OBJ);\n \n }", "function getDetail($memberID, $query) {\r\n $completeQuery = \"SELECT $query FROM USER LEFT JOIN BUSINESS on USER.businessID=BUSINESS.businessID WHERE USER.UserID='$memberID'\";\r\n $sql = $this->db->prepare($completeQuery);\r\n if($sql->execute());\r\n return $sql->fetchall();\r\n return false;\r\n }", "function rel_cliente_ag(){\r\n\t\t$db = banco();\r\n\t\t\r\n\t\t$query =\"SELECT user.cod, user.name, user.cpf, cliente.fone, especialidade.nom_espec, consulta.dt_consul, consulta.aprovado, consulta.presente\r\n\t\t\t\tFROM user, cliente, consulta, especialidade\r\n\t\t\t\tWHERE user.cod = cliente.cod_clien AND\r\n\t\t\t\t\t user.cod = consulta.cod_clien AND\r\n\t\t\t\t\t consulta.cd_esp = especialidade.cod_espec\r\n\t\t\t\t\t \r\n\t\t\t\t\";\r\n\t\t$row = $db->query($query);\r\n\t\t$db->close();\r\n\t\treturn $row;\t\r\n\t}", "function allusers($condition=\"\")\n\t{ \n\t // $sql = \"select gene_user_id,gene_generation,gene_name,gene_surname,gene_sex,gene_birthday,gene_deathday from tab_gene_user\";\n\t\t$sql = \"select * from tab_gene_user\";\n\t\tif($condition)\n\t\t{\n\t\t\t$sql .=\" \".\"WHERE\".\" \".\"LastModifiedTime > '$condition'\";\n\t\t\t\n\t\t}\n\t\t$res = $this->db->readValues($sql); \n\t\tif(count($res)> 0 )\n\t\t{\n return $res;\n\t\t}\n\t}", "public function filter_books30($data){\n $query=$this->db->query('SELECT * FROM `user_books` INNER JOIN `users` ON `users`.`username` = `user_books`.`user_username` WHERE `availability`=\"1\" AND `lang` = \"'.$data['lang'].'\" AND `book_genre` = \"'.$data['book_genre'].'\" AND `users`.`user_region` = \"'.$data['region'].'\" AND NOT `user_username`= \"'.$data['username'].'\" ORDER BY `date_added` DESC LIMIT 150;');\n return $query->result();\n }", "function student_info_sql($userid,$verified,$specific_account = 1) {\n\t\t$sql = \"SELECT student_info.course as department,student_info.* FROM student_info,tutor_info WHERE student_info.verified = '{$verified}' AND tutor_info.user_id = '{$userid}' AND tutor_info.department = student_info.course AND tutor_info.semester = student_info.semester \";\n\t\tif($specific_account != 1){\n\t\t\t$sql .= \"AND student_info.user_id = '{$specific_account}' \";\n\t\t}\n\t\treturn $sql;\n\t}", "function mentor_list($limit='',$start=0,$condition='')\n{\n\tglobal $DB;\n\t$sql =\"SELECT u.id,u.firstname,u.lastname,u.email,u.city,u.picture,u.department FROM {user} u left join {user_info_data} ud on ud.userid=u.id \";\n\t$sql.=\"WHERE ud.data='mentor data' and ud.acceptterms=1 and u.deleted=0 $condition order by u.timemodified desc limit $start,$limit\";\n\t//echo $sql;die;\n\t$result = $DB->get_records_sql($sql);\n\tif(count($result)>0){\n\t\tforeach($result as $mentordata)\n\t\t{\n\t\t\t$user = new stdClass();\n\t\t\t$user->id = $mentordata->id;\n\t\t\t//$picture = get_userprofilepic($user);\n\t\t\t$userurl = getuser_profilelink($user->id);\n\t\t\t$usrimg = get_userprofilepic($user);\n\t\t\t$picture ='<div class=\"left picture\"><a href=\"'.$userurl.'\" >'.$usrimg.'</a></div>'; \n\t\t\t$mentordata->picture = $picture;\n\t\t}\n\t}\n\treturn $result;\n}", "function get_people($selected_country)\n \n {\n\t\n\t//$query = $this->db->query(\"SELECT*FROM person WHERE countryid =$selected_country\" );\n\t\n\t$data = array();\n\t\n\t$query = $this->db->get_where('person', array('countryid' => $selected_country));\n\t\n\tforeach($query-> result_array() as $row)\n\t\n\t {\n\t $data[] = $row;\n\t /*\n\t echo $row->name.'<br>';\n\t echo $row->description .'<br>';\n\t echo $row->wlink .'<br>';\n\t */\n\t }\n\t\n\treturn $data;\n\t\n\t}", "public function get_claimed_data($params = \"\" , $page = \"all\")\n {\n\n $this->db->select(\"user_id, username, first_name, last_name, email, address, created\")->from( $this->tableName);\n $this->db->join('user_profiles', 'user_profiles.user_id = users.id');\n $this->db->where ('has_claimed', '1');\n \n $query = '';\n $result = array();\n \n if (!empty($params))\n {\n //echo \"1\";\n if ( (($params [\"num_rows\"] * $params [\"page\"]) >= 0 && $params [\"num_rows\"] > 0))\n {\n //echo \"2\";\n if ($params [\"search\"] === TRUE)\n {\n //echo \"3\";\n $ops = array (\n\n \"eq\" => \"=\",\n \"ne\" => \"<>\",\n \"lt\" => \"<\",\n \"le\" => \"<=\",\n \"gt\" => \">\",\n \"ge\" => \">=\"\n );\n\n }\n\n if ( !empty ($params['search_field_1']))\n {\n $this->db->where ($params['search_field_1'], $params['user_id']);\n }\n\n if ( !empty ($params['search_field_2']))\n {\n $this->db->where ($params['search_field_2'], \"1\");\n }\n\n //$this->db->order_by( \"{$params['sort_by']}\", $params [\"sort_direction\"] );\n\n if ($page != \"all\")\n {\n $this->db->limit ($params [\"num_rows\"], $params [\"num_rows\"] * ($params [\"page\"] - 1) );\n }\n\n $query = $this->db->get();\n $result = $query->result_array();\n }\n }\n else\n {\n $this->db->limit (5);\n $query = $this->db->get ($this->_table);\n $result = $query->result_array();\n \n }\n \n return $result;\n }", "public function getinteresteduser($uid)\n{\n $this->db->select(\"job_like_staff.*,jobs.job_title,jobs.map_address,users.first_name,users.last_name,users.image,staff_basicinfo.current_location\");\n $this->db->join(\"jobs\",\"job_like_staff.job_id=jobs.id\",\"left\");\n $this->db->join(\"users\",\"job_like_staff.user_id=users.id\",\"left\");\n $this->db->join(\"staff_basicinfo\",\"job_like_staff.user_id= staff_basicinfo.staff_id\",\"left\"); \n $this->db->where(\"job_like_staff.job_userid\",$uid); \n $this->db->group_by(\"job_like_staff.id\",\"desc\"); \n $this->db->order_by(\"job_like_staff.id\",\"desc\"); \n $result = $this->db->get('job_like_staff')->result(); \n return $result;\t\t\t\n}", "function get_user_join_gender($from=null, $to=null)\r\n {\r\n if($to ==null) $to =date('Y-m-d');\r\n if($from==null) $from=date('Y-m-d', strtotime(\"-1 week\", strtotime($to)));\r\n \r\n $printYear = ((int)(substr($from, 0, 4))<(int)(date('Y')))?true:false;\r\n\r\n $period = new DatePeriod(\r\n new DateTime($from),\r\n new DateInterval('P1D'),\r\n new DateTime($to)\r\n );\r\n\r\n $output = array(array('날짜', '남자', '여자'));\r\n $data = array();\r\n\r\n //query\r\n $sql = \"SELECT DATE_FORMAT(created, '%Y-%m-%d') as joined,\r\n SUM(case when gender = 'm' then 1 else 0 end) as gender_m_count, \r\n SUM(case when gender = 'f' then 1 else 0 end) as gender_f_count, \r\n count(user_id) as user_count\r\n from users \r\n left join user_profiles on users.id = user_profiles.user_id \r\n WHERE activated =? and created between ? and ?\r\n group by joined\"; \r\n $query = $this->db->query($sql, array(1, $from, $to, $from, $to));\r\n foreach ($query->result() as $row)\r\n {\r\n $data[$row->joined] = array(round($row->gender_f_count*100/$row->user_count), round($row->gender_m_count*100/$row->user_count));\r\n }\r\n\r\n $i = 1;\r\n foreach ($period as $date) {\r\n $output[$i] = array($date->format((($printYear)?'Y년 ':'').' m월 d일'), isset($data[$date->format('Y-m-d')][0])?$data[$date->format('Y-m-d')][0]:0, isset($data[$date->format('Y-m-d')][1])?$data[$date->format('Y-m-d')][1]:0);\r\n $i++;\r\n }\r\n\r\n return $output; \r\n /*\r\n //---- dummy data\r\n $dateNum = floor((strtotime($to)-strtotime($from))/86400)+1;\r\n $output = array(array('날짜' , '남자', '여자'));\r\n if($dateNum>0){\r\n for($i=1;$i<=$dateNum;$i++){\r\n $date = date(\"m월 d일\",strtotime(($i-$dateNum).\" day\", strtotime($to)));\r\n $num1 = rand(0, 70);\r\n $num2 = 100 - $num1;\r\n $output[$i] = array($date, $num1, $num2);\r\n }\r\n }\r\n return $output;*/\r\n }", "function user_digitalwalletfamily_info($user_id)\n {\n\t\t$select = array('intID', 'vchFamilyName', 'vchFamilyAddress', 'vchFamilyPhone', 'dt_Date');\n\t\t\n\t $this->db->select($select)->from('user_digitalwallet_family')->where('user_id', $user_id);\n\t $this->db->order_by('intID', 'desc');\n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\treturn $query->result_array();\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n }", "function list_get() {\n $user = $this->get('user');\n $fromdate = $this->get('fromdate');\n $todate = $this->get('todate');\n $status = $this->get('status');\n $role = $this->get('role');\n \n $condition = \" and order_id!=''\";\n $branch = $this->get('branch');\n if($branch != \"\") {\n if($role!=\"DEALER\")\n $condition .= \" and o.branch_id='$branch'\";\n }\n \n \n if(($status!= \"Received\" && $status!= \"Delivered\" && $status!= \"Rejected\" && $status!=\"rejected\") && ($role==\"DEALER\" || $role==\"SE\"))\n $condition .= \" and o.parent_order='0'\"; // and o.parent_order='0'\n \n if($role==\"DEALER\" && $user!=\"\")\n $condition .= \" and o.orderedby='$user'\"; // and o.parent_order='0'\n else if($role==\"SE\" && $user!=\"\") {\n \n $seller_info = \"\";\n //echo \"select GROUP_CONCAT(`seller`) as seller_info from branch_dealers where sales_manager='$user' and branch='$branch'\";\n $deal_query = $this->model_all->getTableDataFromQuery(\"select GROUP_CONCAT(`seller`) as seller_info from branch_dealers where sales_manager='$user' and branch='$branch'\");\n if($deal_query->num_rows()>0){\n $deal_rs = $deal_query->row();\n $seller_info = $deal_rs->seller_info;\n if($seller_info!=\"\"){\n $seller_info = trim($seller_info,\",\");\n $condition .= \" and (o.orderedby IN ($seller_info) or o.created_by='$user')\";\n \n }else{\n \n $condition .= \" and o.created_by='$user'\";\n }\n \n \n \n }else{\n $condition .= \" and o.created_by='$user'\";\n \n }\n \n \n \n }\n \n \n \n \n\n if ($status == \"Cancelled\") {\n $condition .= \" and o.status='Cancelled'\";\n } else if ($status == \"Ordered\") {\n $condition .= \" and o.status='Ordered'\";\n } else if ($status == \"Delivered\") {\n $condition .= \" and o.status='Delivered' and o.seller_accept='1' \"; // and delivery_recieved='1'\n } else if ($status == \"Received\") {\n $condition .= \" and o.status='Delivered' and o.dboy_accept='1'\";\n } else if ($status == \"Rejected\" || $status == \"rejected\") {\n $condition .= \" and o.status='Delivered' and o.delivery_reject='1'\";\n } else if ($status == \"Pending\") {\n $condition .= \" and o.status not in ('Cancelled','Delivered','Ordered')\";\n } else if ($status == \"track\") {\n $condition .= \" and o.status not in ('Cancelled')\";\n } else if ($status == \"Denied\") {\n $condition .= \" and ((o.fa_status='2') or (o.fa_status='1' and o.admin_status='2') or (o.fa_status='2' and o.admin_status='2'))\";\n } else if ($status == \"Dispatch_Reject\") {\n $condition .= \" and o.status='Rejected' and o.dboy_accept='2'\";\n } \n\n \n \n\n if ($fromdate != \"\" && $todate == \"\") {\n $fromdate = date(\"Y-m-d\", strtotime($fromdate));\n $condition .= \" and date(o.`orderedon`)='$fromdate'\";\n } else if ($fromdate != \"\" && $todate != \"\") {\n $fromdate = date(\"Y-m-d\", strtotime($fromdate));\n $todate = date(\"Y-m-d\", strtotime($todate));\n $condition .= \" and o.`orderedon` between '$fromdate 00:00:00' and '$todate 23:59:59'\";\n }\n\n \n \n\n $result_set = $this->model_all->getTableDataFromQuery(\"select o.id, o.order_id, o.orderedon, o.status, o.orderedby, o.created_by,o.order_value,o.payment_type,o.credit_date,s.id as dealer_id,s.company_name as dealer_name,o.parent_order from seller_orders o,sellers s where o.orderedby=s.id $condition order by o.orderedon desc\");\n \n if ($result_set->num_rows() > 0) {\n $result[\"status\"] = 1;\n $result[\"message\"] = \"Records Found\";\n $result[\"total_records\"] = $result_set->num_rows(); \n \n\n\n foreach ($result_set->result_array() as $row) {\n if($row[\"orderedby\"]!=$row[\"created_by\"]){\n\n $emp_qry = $this->model_all->getTableDataFromQuery(\"select e.first_name as emp_name,e.mobile,b.name as branch_name from employees e,branches b where e.branch=b.id and e.id='$row[created_by]'\");\n if($emp_qry->num_rows()>0){\n $emp_rs=$emp_qry->row();\n $row[\"takenby_name\"] = $emp_rs->emp_name;\n $row[\"takenby_branch\"] = $emp_rs->branch_name;\n $row[\"takenby_contact\"] = $emp_rs->mobile;\n }else{\n $row[\"takenby_name\"] = \"-\";\n $row[\"takenby_branch\"] = \"-\";\n $row[\"takenby_contact\"] = \"-\"; \n }\n \n }else{\n $row[\"takenby_name\"] = \"Self\";\n $row[\"takenby_branch\"] = \"-\";\n $row[\"takenby_contact\"] = \"-\"; \n }\n if($row['credit_date']!=\"\"){\n $row['credit_date'] = date(\"d-m-Y\", strtotime($row['credit_date']));\n } \n $row['orderedon'] = date(\"d-m-Y\", strtotime($row['orderedon']));\n $result[\"records\"][] = $row;\n }\n $this->response($result, 200);\n exit;\n } else {\n $result[\"status\"] = 0;\n $result[\"message\"] = \"No records Found\";\n $this->response($result, 200);\n exit;\n }\n }", "function user($id){\n \n \n$db = new Database();\n$db->connect();\n\n$db->select(\"user\",'*',null,'id_user ='.$id); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$res = $db->getResult();\n\nforeach($res as $x => $x_value){\n /****************************/\n$id_nationality=$x_value[\"id_nationality\"];\n$db->select(\"nationalities\",'*',null,'id_nationalities='.$id_nationality); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$nationalities = $db->getResult();\n $res[0][\"id_nationality\"]=$nationalities[0];\n\n /*************************/\n $id_rules=$x_value[\"id_rules\"];\n$db->select(\"rules\",'*',null,'id_rules='.$id_rules); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$rules = $db->getResult();\n $res[0][\"id_rules\"]=$rules[0];\n\n\n\n /********************************/\n $id_direct_manger=$x_value[\"id_direct_manger\"];\n$db->select(\"user\",'*',null,'id_user='.$id_direct_manger); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$direct = $db->getResult();\n $name_user=$direct[0][\"f_name_user\"].\" \".$direct[0][\"m_name_user\"].\" \".$direct[0][\"l_name_user\"];\n $res[0][\"id_direct_manger\"]=$name_user;\n\n\n /***************************************/\n $id_payroll_groups=$x_value[\"id_payroll_groups\"];\n$db->select(\"payroll_groups\",'*',null,'id_payroll_groups='.$id_payroll_groups); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$payroll_groups = $db->getResult();\n$res[0][\"payroll_groups\"]=$payroll_groups[0];\n\n$db->select(\"pay_grou_valu\",'*',null,'id_payroll_groups='.$id_payroll_groups); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$pay_grou_valu = $db->getResult();\n$res[0][\"payroll_groups\"]=$pay_grou_valu;\n\n\nforeach($pay_grou_valu as $xx => $x_valuee)\n {\n $db->select(\"payroll_value\",'*',null,'id_payroll_value='.$res[0][\"payroll_groups\"][$xx][\"id_payroll_value\"]); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$payroll_value = $db->getResult();\n//echo $xx;\n $res[0][\"payroll_groups\"][$xx][\"id_payroll_value\"]=$payroll_value[0];\n\n }\n\n\n\n\n\n\n\n\n /***************************************/\n\n $id_categories=$x_value[\"id_categories\"];\n$db->select(\"categories\",'*',null,'id_categories='.$id_categories); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$categories = $db->getResult();\n $res[0][\"id_categories\"]=$categories[0];\n\n /***************************************/\n\n $id_departments=$x_value[\"id_departments\"];\n$db->select(\"departments\",'*',null,'id_departments='.$id_departments); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$departments = $db->getResult();\n $res[0][\"id_departments\"]=$departments[0];\n\n /***************************************/\n\n $id_positions=$x_value[\"id_positions\"];\n$db->select(\"positions\",'*',null,'id_positions='.$id_positions); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$positions = $db->getResult();\n$res[0][\"id_positions\"]=$positions[0];\n//echo '<pre>';\n//print_r($res[0]);\n//echo '<pre>';\n /***************************************/\n\n $id_user=$x_value[\"id_user\"];\n\n$db->select(\"attendance\",'*',null,'user_id='.$id_user); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$attendance = $db->getResult();\n$res[0][\"attendance\"]=$attendance;\n\n\n/***************************************/\n\n$db->select(\"pr_user_insurance\",'*',null,'id_user='.$id_user); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$pr_user_insurance = $db->getResult();\n\nforeach ($pr_user_insurance as $key => $valu){\n $valu[\"id_insurance\"];\n\n $db->select(\"insurance_setup\",'*',null,\"`name_insurance`='\".$valu[\"id_insurance\"].\"'\"); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$insurance_setup = $db->getResult();\n//echo $xx;\n $res[0][\"insurance\"][$key]=$insurance_setup[0];\n\n};\n\n/*************************/\n$db->select(\"pr_user_languages\",'*',null,'id_user='.$id_user); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$pr_user_languages = $db->getResult();\n$i=0;\nforeach ($pr_user_languages as $key => $valu){\n $valu[\"id_languages\"];\n\n $db->select(\"languages\",'*',null,\"`name_languages`='\".$valu[\"id_languages\"].\"'\"); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$languages = $db->getResult();\n//echo $xx;\n $res[0][\"languages\"][$key]=$languages[0];\n\n};\n\n/*************************/\n$db->select(\"pr_user_licenes\",'*',null,'id_user='.$id_user); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$pr_user_licenes = $db->getResult();\n$i=0;\nforeach ($pr_user_licenes as $key => $valu){\n $valu[\"id_licenes\"];\n $db->select(\"licenses\",'*',null,\"`name_licenses`='\".$valu[\"id_licenes\"].\"'\"); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$licenes = $db->getResult();\n//echo $xx;\n $res[0][\"licenses\"][$key]=$licenes[0];\n\n};\n\n/*************************/\n$db->select(\"pr_user_skills\",'*',null,'id_user='.$id_user); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$pr_user_skills = $db->getResult();\n$i=0;\nforeach ($pr_user_skills as $key => $valu){\n $valu[\"id_skills\"];\n $db->select(\"skills\",'*',null,\"`name_skills`='\".$valu[\"id_skills\"].\"'\"); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$skills = $db->getResult();\n//echo $xx;\n $res[0][\"skills\"][$key]=$skills[0];\n\n};\n\n/*************************/\n$db->select(\"pr_user_tax\",'*',null,'id_user='.$id_user); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$pr_user_tax = $db->getResult();\n$i=0;\nforeach ($pr_user_tax as $key => $valu){\n $valu[\"id_tax\"];\n\n\n $db->select(\"tax\",'*',null,\"`name_tax`='\".$valu[\"id_tax\"].\"'\"); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$tax = $db->getResult();\n//echo $xx;\n $res[0][\"tax\"][$key]=$tax[0];\n\n};\n/*************************/\n$db->select(\"pr_user_leaves\",'*',null,'id_user='.$id_user); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$pr_user_leaves = $db->getResult();\n$i=0;\nforeach ($pr_user_leaves as $key => $valu){\n $valu[\"id_leaves\"];\n\n $db->select(\"leaves_rules\",'*',null,\"`name`='\".$valu[\"id_leaves\"].\"'\"); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$leaves = $db->getResult();\n//echo $xx;\n $res[0][\"leaves\"][$key]=$leaves[0];\n $leaves[0][\"name\"];\n\n $db->select(\"my_leaves\",'*',null,\"`id_leaves`='\".$leaves[0][\"name\"].\"' AND `id_user`='\".$res[0][\"id_user\"].\"'\"); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$my_leaves = $db->getResult();\nforeach ($my_leaves as $keys => $valus){\n\n $res[0][\"leaves\"][$key][\"my_leaves\"][$keys]=$valus;\n\n}\n};\n\n\n\n\n\n\n}\n\n\n\n $return=$res[0];\nreturn $return;\n\n \n \n\n \n}", "function find_all_user(){\n global $db;\n $results = array();\n $sql = \"SELECT u.id,u.clave,u.nivel_usuario,u.status,u.ultimo_login,u.name,u.IdDepartamento,\";\n $sql .=\"g.group_name \";\n $sql .=\"FROM users u \";\n $sql .=\"LEFT JOIN user_groups g \";\n $sql .=\"ON g.group_level=u.nivel_usuario ORDER BY u.clave ASC\";\n $result = find_by_sql($sql);\n return $result;\n}", "function search_user(){\n\t\trequire_once(\"dbconnection.php\");\n\t\t$obj=new dbconnection();\n\t\t$con=$obj->getcon();\n\t\t\n\t\t\n\t\t$dbh=$obj->get_pod();\n\n\t\t$search_by = $_POST['search_by'];\n\n\t\t$sqlget = \"SELECT * FROM users WHERE uname='$search_by';\";\n\t\t$resultget = mysqli_query($con,$sqlget) or die(\"SQL Error : \".mysqli_error($con));\n\t\t$recget= mysqli_fetch_assoc($resultget);\n\n\t\techo json_encode($recget);\n\t\t\n\t}", "function get_by_gender() {\n return $this->mysqli->query(\"SELECT * FROM `product_variations` JOIN `products` on `product_variations`.`product_id` = `products`.`product_id` WHERE 1 ORDER BY `gender`, `price` ASC\");\n }", "function query_select_address($userId) {\n global $connection;\n\n //construct query:\n $query = \"SELECT street, zip, city, country FROM address \";\n $query .= \"WHERE user_id={$userId}; \";\n\n $result = mysqli_query($connection, $query);\n\n if($result) {\n return mysqli_fetch_assoc($result);\n } else {\n return 0;\n }\n}", "function pass_book_list($where=\"1\",$where_array,$sort_by=\"\"){\n\t\t$data= $this->select_query(\"money_in_out a,transaction_type b,transaction_from c,users e \",\"a.id,a.trans_from,a.trans_for_id,a.amount,a.balance,a.created_datetime,e.name,e.user_name,c.name as from_name,b.name as t_type,a.trans_type\",\"a.trans_type=b.id and a.trans_from=c.id and a.created_by=e.id and \".$where,$where_array,$sort_by);\n\t\treturn $data;\n\t}", "public function get_all_alamat(){\n \n\t$query = $this->db->query(\"select *,case when gender = '1' then 'Pria' else 'Wanita' end as genderstatus,date_format(start_date,'%d %M %Y') as tanggalmasuknya from human_pa_md_emp_personal order by personnel_id asc\");\n\n \treturn $query;\n\t}", "function getAllBookings($userID){\n $query = $this->db->query(\"SELECT bookings.*,buildings.name as buildingName, buildings.id as buildingID ,rooms.name as roomName,rooms.floorNumber , rooms.type from bookings join rooms on rooms.roomId = bookings.roomID join buildings on buildings.id = rooms.buildingId where userID = $userID\");\n\n if($query->num_rows()>0)\n {\n $response['status'] = 'success';\n $response['data']=$this->getParticipantsForMeetings($query->result_array());\n }\n else\n {\n $response['status'] = 'failure';\n $response['code'] = 'database failure';\n\n }\n return $response;\n }", "function getSearchAllAuction($id_user, $link) {\n $query = \"\n select * \n from auctions \n where \n id_user != '\" . mysql_real_escape_string($id_user) . \"' and \n id_auction not in (\n select id_auction \n from auction_follow \n where id_user = '\" . mysql_real_escape_string($id_user) . \"'\n\t\t \n )\n \";\n\n $result = selectBD($query, $link);\n return $result;\n}", "function friendFetch(){\n\n $friend=mysql_query(\"SELECT user_firstname,user_surname,user_birthday,user_gender,user_study,user_work,user_email FROM User,Account\n WHERE User.user_id=(SELECT user_id FROM Account WHERE user_email='$_SESSION[friend_email]')\n AND user_email='$_SESSION[friend_email]'\") or die(\"<p>Friend fetch failed.</p>\");\n\n $friendFetch=mysql_fetch_array($friend);\n\n return $friendFetch;\n}", "public function user_detail($userid)\r\n {\r\n\t$this->db->select('user.first_name,user.last_name,user.emailid,user.phone,user.fax,user.userid,user.storeid,user.isactive,user.notify,user.updated_on,division.store_name,division.division_type,user.ismanage_product,division.divisionid,user.password,division.regionid');\r\n\t\t$this->db->from('user,division,user_division');\r\n\t\t$this->db->where('(user.userid=user_division.userid)');\r\n\t\t$this->db->where('(user.storeid=division.storeid)');\r\n\t\t$this->db->where('(division.divisionid=user_division.divisionid)');\t\r\n\t $this->db->where('user.userid', $userid);\r\n\t\t//$this->db->where('user_division.isdefault', 1);\t\t\r\n $query = $this->db->get();\r\n\t\t//echo $str = $this->db->last_query();\r\n\t\treturn $query->result_array();\t\r\n\t\t\r\n }", "function getVendors(){\n $datarow = NULL;\n try\n {\n $db = new Database();\n $db->connect();\n \n $sql = \"SELECT userid,firstname,lastname,category,categorycode,phonenumber,email,agebracket,country,countrycode,gender,town,userstatus,xikilaaccount,bancoaccount,wantbancoaccount,creationdate FROM registration \".\n \"where userstatus=:userstatus\";\n $params = array(\":userstatus\" => 1);\n $results = $db->runSelect($sql,$params);\n \n if ($results != null){\n $datarow = $results;\n }\t\t\n }\n catch(PDOException $ex) {\n echo $ex->getMessage();\n }\n return $datarow;\n }", "public function queryUsuario($value) {\n $sql = 'select \n a.email, \n b.id,\n b.gender, \n b.mailing_address,\n b.year_of_birth, \n b.level_of_education,\n b.country\n from auth_user a, auth_userprofile b \n where a.email = ? \n and a.id = b.user_id;';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->set($value);\n\t\t$result = QueryExecutor::execute($sqlQuery);\n return $result; \n }", "public function select_totalpaid_payments_u_users(){\n\n\n$sql = \"SELECT payments.id,payments.date,SUM(payments.amount) AS 'amount',\npayments.payment_method,payments.member_id,users.name,users.member_id\nFROM payments \nINNER JOIN users\nON\npayments.member_id = users.member_id GROUP BY users.member_id\";\n\n if(!$this->query($sql)->_error){\n\n return $this;\n \n } \n return false;\n }", "public function suggestedPartners($id)\n {\n $details = DB::table('profiles')\n ->where('user_id','=',$id)\n ->get();\n\n foreach($details as $raw)\n {\n $gender=$raw->gender;\n $age = $raw->age;\n $religion = $raw->religion;\n $motherT = $raw->motherTongue;\n $height= $raw->height;\n $complexion =$raw->complexion;\n $location =$raw->location;\n $languages = $raw->languages;\n\n\n if($gender == 'Male')\n {\n $final=DB::table('profiles')\n ->join('users', 'users.id', '=', 'profiles.user_id')\n ->where('profiles.user_id','!=', Auth::user()->id)\n ->where('profiles.location','=',$location)\n ->where('profiles.religion','=',$religion)\n ->where('profiles.motherTongue','=',$motherT)\n ->where('profiles.gender','!=',$gender)\n ->where('profiles.age','<',$age)\n ->where('profiles.height','<',$height)\n ->where('profiles.complexion','=',$complexion)\n ->where('profiles.languages','=',$languages)\n ->where('users.is_admin','=',0)\n ->where('users.user_activate_state','=','activate')\n ->get();\n }\n else\n {\n $final=DB::table('profiles')\n ->join('users', 'users.id', '=', 'profiles.user_id')\n ->where('profiles.user_id','!=', Auth::user()->id)\n ->where('profiles.location','=',$location)\n ->where('profiles.religion','=',$religion)\n ->where('profiles.motherTongue','=',$motherT)\n ->where('profiles.gender','!=',$gender)\n ->where('profiles.age','>',$age)\n ->where('profiles.height','>',$height)\n ->where('profiles.complexion','=',$complexion)\n ->where('profiles.languages','=',$languages)\n ->where('users.is_admin','=',0)\n ->where('users.user_activate_state','=','activate')\n ->get();\n }\n\n //check if has any results from the query\n if(count($final)<1)\n {\n $final = \"No Result\";\n\n //if query does not have any result return this\n return view('ajax.suggestedPartners')->with('final',$final);\n }\n\n //if query has values return this\n return view('ajax.suggestedPartners')->with('final',$final);\n }\n\n //return (\"Hi\");\n\n }", "function myjoin()\n {\n $this->db\n ->select('puestos.nombre AS pnombre')\n ->select('puestos.id AS pid')\n ->select('entidades.nombre AS enombre')\n ->select('entidades.id AS eid')\n ->select('departamentos.nombre AS dnombre')\n ->select('departamentos.id AS did')\n ->select('ubicaciones.nombre AS unombre')\n ->select('ubicaciones.id AS uid')\n ->join ('puestos', 'users.puesto = puestos.id' , 'left')\n ->join ('entidades', 'users.entidad = entidades.id' , 'left')\n ->join('departamentos', 'users.departamento = departamentos.id' , 'left')\n ->join('ubicaciones', 'users.ubicaciontrabajo = ubicaciones.id' , 'left');\n //$this->db->where('users.id',7);\n return $datosuser = $this->db->get('users')->result_array();\n }", "function user_viewed_company_query($user_id='', $viewing_type='', $company_id=\"\",$lebel=\"\")\n\t{\n\t\t$sql = \"SELECT MAX(UVC.viewing_date) AS viewing_date,\n\t\t\t\tUVC.id, UVC.user_id, UVC.company_id, UVC.viewing_type, \n\t\t\t\tIF(CU.users_profilepic IS NULL OR CU.users_profilepic = '', 'no_company_logo.png', CU.users_profilepic)AS users_profilepic,\n\t\t\t\tU.users_firstname, U.users_lastname, \n\t\t\t\tC.company_name, C.company_logo,\n\t\t\t\tfnStripTags(CU.users_bio) AS users_bio, CU.users_id AS company_user_id, CU.users_bio AS full_com_desc,\n\t\t\t\t IF(CU.users_phone IS NULL OR CU.users_phone = '', 'N/A', CU.users_phone) AS users_phone, \n\t\t\t\thia_cities.name AS city_name, hia_states.name AS state_name, hia_countries.name AS country_name\n\t\t\t\tFROM hia_user_view_company AS UVC\n\t\t\t\tJOIN hia_users AS U ON( UVC.user_id = U.users_id )\n\t\t\t\tJOIN hia_company AS C ON (UVC.company_id = C.company_id)\n\t\t\t\tJOIN hia_users AS CU ON( C.company_id = CU.users_companyid AND CU.users_type = '2' AND CU.users_status != '1')\n\t\t\t\tLEFT JOIN hia_cities ON (CU.users_city = hia_cities.id)\n\t\t\t\tLEFT JOIN hia_states ON (CU.users_state = hia_states.id)\n\t\t\t\tLEFT JOIN hia_countries ON (CU.users_country = hia_countries.id)\n\t\t\t\tWHERE U.users_type != '3'\n\t\t\t\tAND U.users_status != '1' \n\t\t\t\tAND UVC.company_id NOT IN (SELECT company_id FROM hia_user_following_company WHERE user_id = '$user_id' AND following_type = 'user') \";\n\n\t\tif ($viewing_type != \"\") {\n\t\t\t$sql.= \" AND UVC.viewing_type = '$viewing_type' \";\n\t\t}\n\t\t\t\t\n\t\tif ($user_id != \"\") {\n\t\t\t$sql.= \" AND UVC.user_id = '$user_id' \";\n\t\t}\n\t\t\t\t\n\t\t// if ($company_id != \"\") {\n\t\t// \t$sql.= \" AND UVC.company_id = '$company_id' \";\n\t\t// }\n\n\t\tif ($company_id != \"\") {\t\t\t\n\t\t\tif($lebel == 'next'){\n\t\t\t\t$sql.= \" AND CU.users_id > '$company_id' \";\t\t\t\t\n\t\t\t}\n\t\t\tif($lebel == 'prev'){\n\t\t\t\t$sql.= \" AND CU.users_id < '$company_id' \";\t\t\t\t \n\t\t\t}\n\t\t}\n\n\t\t// if($lebel == 'next'){\n\t\t// \t$sql.= \" GROUP BY UVC.company_id \";\t\n\t\t// }\n\t\tif($lebel == 'prev'){\n\t\t\t$sql.= \" GROUP BY UVC.company_id order by UVC.company_id DESC \";\t\n\t\t}else{\n\t\t\t$sql.= \" GROUP BY UVC.company_id \";\t\n\t\t}\n\t\t//echo $sql;exit;\n\n\t\tif ( ! $this->db->simple_query($sql))\n\t\t{\n\t\t\t$error = $this->db->error();\n\t\t\t//print_r($error);\n\t\t\t//exit();\n\t\t\treturn $error;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = $this->db->query($sql);\n\t\t\t\n\t\t\treturn $query->result_array();\n\t\t}\n\t\t\n\t}", "function get_deli_boy( $conds = array(), $limit = false, $offset = false )\n\t{\n\n\t\t$this->custom_conds();\n\t\t$this->db->select('core_users.*'); \n\t\t$this->db->from('core_users');\n\t\t$this->db->where('role_id', $conds['role_id']);\n\t\t$this->db->where('status!=', $conds['status']);\n\n\n\t\t// deli status condition \n\t\tif ( isset( $conds['deliboy_status'] )) {\n\t\t\tif ($conds['deliboy_status'] != \"\" ) {\n\t\t\t\tif ($conds['deliboy_status'] != '0') {\n\t\t\t\t\t$this->db->where( 'status', $conds['deliboy_status'] );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t//print_r($conds);die;\n\n\n\t\tif ( $limit ) {\n\t\t// if there is limit, set the limit\n\t\t\t\n\t\t\t$this->db->limit($limit);\n\t\t}\n\t\t\n\t\tif ( $offset ) {\n\t\t// if there is offset, set the offset,\n\t\t\t\n\t\t\t$this->db->offset($offset);\n\t\t}\n\n\t\treturn $this->db->get();\n\t\t//print_r($this->db->last_query());die;\n\t}", "function get_searchbyemailid($username,$emailaddress)\n{\n\tglobal $log;\n\tglobal $current_user;\n\trequire_once(\"modules/Users/Users.php\");\n\t$seed_user=new Users();\n\t$user_id=$seed_user->retrieve_user_id($username);\n\t$current_user=$seed_user;\n\t$current_user->retrieve_entity_info($user_id, 'Users');\n\trequire('user_privileges/user_privileges_'.$current_user->id.'.php');\n\trequire('user_privileges/sharing_privileges_'.$current_user->id.'.php');\n\t$log->debug(\"Entering get_searchbyemailid(\".$username.\",\".$emailaddress.\") method ...\");\n\t$query = \"select vtiger_contactdetails.lastname,vtiger_contactdetails.firstname,\n\t\t\t\t\tvtiger_contactdetails.contactid, vtiger_contactdetails.salutation,\n\t\t\t\t\tvtiger_contactdetails.email,vtiger_contactdetails.title,\n\t\t\t\t\tvtiger_contactdetails.mobile,vtiger_account.accountname,\n\t\t\t\t\tvtiger_account.accountid as accountid from vtiger_contactdetails\n\t\t\t\t\t\tinner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid\n\t\t\t\t\t\tinner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid\n\t\t\t\t\t\tleft join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid\n\t\t\t\t\t\tleft join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid\n\t\t\t LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\";\n\t$query .= getNonAdminAccessControlQuery('Contacts',$current_user);\n\t$query .= \"where vtiger_crmentity.deleted=0\";\n\tif(trim($emailaddress) != '') {\n\t\t$query .= \" and ((vtiger_contactdetails.email like '\". formatForSqlLike($emailaddress) .\n\t\t\"') or vtiger_contactdetails.lastname REGEXP REPLACE('\".$emailaddress.\n\t\t\"',' ','|') or vtiger_contactdetails.firstname REGEXP REPLACE('\".$emailaddress.\n\t\t\"',' ','|')) and vtiger_contactdetails.email != ''\";\n\t} else {\n\t\t$query .= \" and (vtiger_contactdetails.email like '\". formatForSqlLike($emailaddress) .\n\t\t\"' and vtiger_contactdetails.email != '')\";\n\t}\n\n\t$log->debug(\"Exiting get_searchbyemailid method ...\");\n\treturn $this->plugin_process_list_query($query);\n}", "public function getUserIDandEmail()\r\n{\r\n $query_string = \"SELECT userid FROM users \";\r\n $query_string .= \"WHERE username = :username OR email = :email\";\r\n\r\n return $query_string;\r\n}", "public function get_profile($uid){\r\n $query = \"SELECT members.mem_id, users.uid\r\n FROM members\r\n INNER JOIN users ON members.fk_users_id = users.uid\r\n WHERE uid = $uid\";\r\n \r\n $result = $this->db->query($query) or die($this->db->error); \r\n $user_data = $result->fetch_array(MYSQLI_ASSOC);\r\n \r\n }", "function getByUserId($userId){\n $this->db->where(\"nim = '$userId' or nip='$userId'\");\n $query = $this->db->get('peminjaman');\n $result = $query->result_array();\n return $result;\n}", "function get_businessinformation(){\t\t\r\n $this->db->select('bi.id as id, bi.business_name, bi.status, business_categories.business_category_name, bi.phone_number, bi.email, bi.street_address, bi.categories, bi.city, bi.state, bi.zip_code, bi.created_by, users.first_name');\r\n\t\t\t $this->db->from('business_information as bi' );\r\n\t\t\t $this->db->join('users', 'bi.created_by = users.id','left');\r\n\t\t\t $this->db->join('business_categories', 'bi.categories = business_categories.id','left');\r\n\t\t\t\t $this->db->group_by(\"bi.id\"); \r\n\t\t\t\t\r\n\t\t\t\t $menu = $this->session->userdata('admin');\r\n\t\t\t\t\tif($menu!='1'){\t\t\t\t\t\t\r\n\t\t\t\t\t\t$user = $this->session->userdata('id');\r\n\t\t\t\t\t\t$this->db->where('bi.created_by', $user);\r\n\t\t\t\t\t}\r\n\t\t\t \r\n\t\t\t\t $query = $this->db->get();\r\n\t\t\t $result = $query->result();\r\n\t\t\t return $result;\t\t\t\t\r\n }", "function get_user_details_byid($user_id) {\n\n $ci = & get_instance();\n $qur = $ci->db->query(\"SELECT * FROM `users` u INNER JOIN `users_profiles` up ON u.id = up.user_id WHERE u.id=\".$user_id);\n if($qur->num_rows() > 0) {\n $row = $qur->result_array();\n $email = $row[0]['email'];\n $f_name = $row[0]['f_name'];\n return ['email'=>$email,'f_name'=>$f_name];\n }else{\n return [];\n }\n}", "function search_customers($search){\n $like=array('first_name'=>$search,'email'=>$search,'company_name'=>$search,'phone'=>$search,'email'=>$search); \n $this->db->select('customer_category.discount,customers.*')->from('customers')->where('customers.branch_id', $this->session->userdata('branch_id'))->where('customers.active_status',1)->where('customers.delete_status',0);\n $this->db->join('customer_category','customer_category.guid=customers.category_id AND customers.active_status=1 AND customers.delete_status=0','left');\n $this->db->or_like($like);\n $sql= $this->db->get();\n $data=array();\n foreach ($sql->result() as $row){\n if($row->active_status==1 && $row->delete_status==0){\n $data[]=$row;\n }\n }\n return $data;\n }", "function fetchEntrantsForAdvanceInfo($condition = \"\",$order = \"user_id\")\n\t{\n\t\t$arrlist = array();\n\t\t$i = 0;\n\t\t\n\t\t$condition = explode(\"||##||\",$condition);\n\t\t\n\t\t$sQuery = \"SELECT u.user_id,u.client_id,u.user_username,u.user_firstname,u.user_lastname,u.user_email FROM \".DB_PREFIX.\"user u WHERE 1 = 1 AND u.user_id not in(select user_id from \".DB_PREFIX.\"entry e WHERE 1 \" . $condition[1] . \" ) \" . $condition[0] . \" ORDER BY \".$order;\n\t\t$rs = $this->runquery($sQuery);\n\t\t\n\t\treturn $rs;\n\t}", "function find_us(){\n global $db;\n $results = array();\n // SELECT usuarios.IdUsuario,usuarios.Clave, rol.Nombre,subdireccion.Subdireccion,departamento.Departamento FROM usuarios INNER JOIN rol ON usuarios.IdRol =rol.IdRol INNER JOIN departamento ON departamento.IdDepartamento=usuarios.IdDepartamento INNER JOIN subdireccion ON departamento.IdSubdireccion = subdireccion.id')\n $sql = \"SELECT u.id,u.clave,u.nivel_usuario,u.status,u.ultimo_login,s.Subdireccion,d.Departamento\";\n $sql .=\"g.group_name \";\n $sql .=\"FROM users u \";\n $sql .=\"LEFT JOIN departamento d \";\n $sql .=\"ON d.id=u.IdDepartamento\";\n $sql .=\"LEFT JOIN subdireccion s \";\n $sql .=\"ON s.id=u.Id ORDER BY u.clave ASC\";\n $sql .=\"LEFT JOIN user_groups g \";\n $sql .=\"ON g.group_level=u.nivel_usuario ORDER BY u.clave ASC\";\n $result = find_by_sql($sql);\n return $result;\n}", "public function check_userdata($quizweb_user_id,$birthdate,$standard,$gender){\n// $this->db->select('*');\n // print_r($user_mobile); die();\n$this->db->where('user_id',$quizweb_user_id);\n$this->db->where('birthdate',$birthdate);\n$this->db->where('standard',$standard);\n$this->db->where('gender',$gender);\n\n$this->db->from('userprofile_master');\n$query = $this->db->get();\n$result = $query->result_array();\n// print_r($result); die();\nreturn $result;\n}", "public function get_user_orderdetails($page='',$skey='')\n {\n \t$lstart = (intval($page)-1)*10;\n \t$lend = 10;\n\n \t$sql = \"select a.* from user_register as a inner join tb_orders_prowise as b on a.uid=b.UserId where a.uid=b.UserId\";\n\n \t$finalsql = $sql;\n \t$tot = $this->db->query($finalsql);\n \tif($lstart < 0)\n \t\t$lstart = '0';\n \t//$sql.=\" GROUP BY GoldRateId order by GoldRateId DESC LIMIT $lstart,$lend\";\n \t$total = $tot->num_rows();\n \t$result = $this->db->query($sql)->result();\n \treturn array(\"total\"=>$total,\"userdetails\"=>$result);\n }", "public function show_profile()\n\t\t{\n\t\t\t$this->db->select('admin_user_profile.reason,admin_user_profile.status as status,users.ID as uid,users.first_name as firstname,users.last_name as lastname,user_profile.*');\n\t\t $this->db->from('user_profile');\n\t\t $this->db->join(\"users\",'user_profile.user_id = users.ID');\n\t\t $this->db->join(\"admin_user_profile\",'admin_user_profile.blocked_id = users.ID');\n\n\t\t //$this->db->order_by(\"user_profile.id\",\"desc\");\n\t\t $query \t\t=\t$this->db->get();\n\t\t\t$userdata\t=\t$query->result_array();\n\t\t\t//print_r($userdata);exit;\n\t\t\tif($userdata)\n\t\t\t{ \t\n\t\t\t\treturn $userdata;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\t\t\t \n\t\t}", "function friendRequestFetch(){\n\n $friendRequest=mysql_query(\"SELECT user,friend FROM Friend\n WHERE user=(SELECT user_id FROM Account WHERE user_email='$_SESSION[friend_email]')\n AND friend=(SELECT user_id FROM Account WHERE user_email='$_SESSION[user_email]')\") \n or die(\"<p>Friend request failed</p>\");\n\n $friendRequestFetch=mysql_fetch_array($friendRequest);\n\n return $friendRequestFetch;;\n }", "private function grup_sql()\n\t{\n\t\tif ($this->session->grup == 4)\n\t\t{\n\t\t\t$kf = $this->session->user;\n\t\t\t$filter_sql= \" AND a.id_user = $kf\";\n\t\t\treturn $filter_sql;\n\t\t}\n\t}", "function get_user_percentage_gender_age($from=null, $to=null)\r\n {\r\n if($to ==null) $to =date('Y-m-d');\r\n if($from==null) $from=date('Y-m-d', strtotime(\"-1 week\", strtotime($to)));\r\n \r\n $list = array(\r\n array(0),\r\n array(1, 10),\r\n range(11, 15),\r\n range(16, 19),\r\n range(20, 22),\r\n range(23, 25),\r\n range(26, 28),\r\n range(29, 30),\r\n range(31, 40),\r\n range(41, 200)\r\n );\r\n\r\n //select DATE_FORMAT(CURRENT_DATE, '%Y')-DATE_FORMAT(birth, '%Y')+1 as age, SUM(case when gender = 'm' then 1 else 0 end) as gender_m_count, SUM(case when gender = 'f' then 1 else 0 end) as gender_f_count, count(user_id) as user_count, all_count from users left join user_profiles on users.id = user_profiles.user_id join (select count(id) as all_count from users where activated=1) all_user group by age\r\n $output = array(array('연령' , '남비율', '여비율'));\r\n $data = array();\r\n\r\n $i = 1;\r\n //query\r\n $sql = \"SELECT DATE_FORMAT(CURRENT_DATE, '%Y')-DATE_FORMAT(birth, '%Y')+1 as age,\r\n SUM(case when gender = 'm' then 1 else 0 end) as gender_m_count, \r\n SUM(case when gender = 'f' then 1 else 0 end) as gender_f_count, \r\n count(user_id) as user_count, all_count \r\n from users \r\n left join user_profiles on users.id = user_profiles.user_id \r\n join (select count(id) as all_count from users where activated=? and created >= ? and created <= ?) all_user \r\n WHERE created between ? and ?\r\n group by age\"; \r\n $query = $this->db->query($sql, array(1, $from, $to, $from, $to));\r\n foreach ($query->result() as $row)\r\n {\r\n if(is_null($row->age)) continue;\r\n foreach($list as $k=>$v){\r\n if(in_array($row->age, $v)){\r\n $data[$k]['m'] += round($row->gender_m_count*100/$row->all_count, 2);\r\n $data[$k]['f'] += round($row->gender_f_count*100/$row->all_count, 2);\r\n }\r\n }\r\n }\r\n\r\n foreach($list as $k=>$v){\r\n $i = $k+1;\r\n $output[$i][0] = (string)((count($v)>1)?$v[0].\"~\".$v[count($v)-1]:\"{$v[0]}\");\r\n $output[$i][1] = round($data[$k]['m'], 2);\r\n $output[$i][2] = round($data[$k]['f'], 2);\r\n }\r\n\r\n return $output; \r\n /*\r\n //---- dummy data\r\n $dateNum = floor((strtotime($to)-strtotime($from))/86400)+1;\r\n $output = array(array('연령' , '남비율', '여비율'));\r\n if($dateNum>0){\r\n $AxisX = array(\"0\", \"1~10\", \"11~15\", \"16~19\", \"20~22\", \"23~25\", \"26~28\", \"29~30\", \"31~40\", \"41~\");\r\n $i = 1;\r\n foreach($AxisX as $text){\r\n $normal = array(\"11~15\", \"16~19\", \"26~28\", \"29~30\", \"31~40\", \"41~\");\r\n $large = array(\"20~22\", \"23~25\", \"26~28\");\r\n if(in_array($text, $normal)){\r\n $num1 = rand(30, 70);\r\n $num2 = 100-$num1;\r\n } else if(in_array($text, $large)){\r\n $num1 = rand(30, 70);\r\n $num2 = 100-$num1;\r\n } else{\r\n $num1 = 0;\r\n $num2 = 0;\r\n }\r\n $output[$i] = array($text, $num1, $num2);\r\n $i++;\r\n }\r\n }\r\n return $output;*/\r\n }", "function get_userdetails_register($value)\n {\n // return $query->result();\n $this->db->select('up.*,us.*,cn.*,st.*,ct.*');\n $this->db->from('users us');\n $this->db->join('address up', 'up.id=us.addressid', 'left');\n $this->db->join('countries cn', 'up.country=cn.id', 'left');\n $this->db->join('states st', 'st.s_id=up.state', 'left');\n $this->db->join('cities ct', 'up.city=ct.c_id', 'left');\n $this->db->where('us.id', $value);\n $result = $this->db->get()->result();\n return $result;\n }", "function esadmin($user){\r\n$sql_queryadmin = \"Select * From usuario inner join administrador \r\n\t\t\t\t\ton administrador.admin_id = usuario.login \r\n\t\t\t\t\tWhere login = '$user';\";\t\r\n$result = pg_query($sql_queryadmin);\r\nreturn $result;}", "function esadmin($user){\r\n$sql_queryadmin = \"Select * From usuario inner join administrador \r\n\t\t\t\t\ton administrador.admin_id = usuario.login \r\n\t\t\t\t\tWhere login = '$user';\";\t\r\n$result = pg_query($sql_queryadmin);\r\nreturn $result;}", "public function gettopDbeeusers($limit=2,$dbeeID='',$datefrom='', $dateto='') \n { \n $db = $this->getDbTable();\n $select = $db->select();\n /*$select->distinct('dbee.User')->from( array('dbee' => 'tblDbees'), array('DbeeID'=>'dbee.DbeeID',new Zend_Db_Expr(\"COUNT(dbee.DbeeID) AS total\") ));\n $select->join( array('u' => 'tblUsers'), 'u.UserID=dbee.User', array( 'UserID' => 'u.UserID','username' => 'u.Name','lname' => 'u.lname','image' =>'u.ProfilePic','uname' =>'u.Username') );\n $select->setIntegrityCheck( false ); \n $select->where('u.Status = ?', '1');\n $select->where(\"dbee.clientID = ?\", clientID);\n\n if(!empty($datefrom) && !empty($dateto)){\n $select->where(\"dbee.PostDate >= ?\", date('Y-m-d H:i:s',strtotime($datefrom)));\n $select->where(\"dbee.PostDate <= ?\", date('Y-m-d H:i:s',strtotime($dateto)));\n } \n $select->group ( array (\"dbee.User\") );\n $select->order('total DESC');*/\n\n $select->distinct('act.act_userId')->from( array('act' => 'tblactivity'), array('DbeeID'=>'act.act_userId',new Zend_Db_Expr(\"COUNT(act.act_id) AS total\"), new Zend_Db_Expr(\" sum( case when act_type=1 then 1 else 0 end) as postCount\" ), new Zend_Db_Expr(\" sum( case when act_type=2 then 1 else 0 end) as commentCount\" )));\n $select->join( array('u' => 'tblUsers'), 'u.UserID=act.act_userId', array( 'UserID' => 'u.UserID','username' => 'u.Name','lname' => 'u.lname','image' =>'u.ProfilePic','uname' =>'u.Username') );\n $select->setIntegrityCheck( false ); \n $select->where('u.Status = ?', '1');\n $select->where('u.Role != ?', '1');\n $select->where(\"act.clientID = ?\", clientID);\n $select->where(\"act.act_type = 1 OR act.act_type = 2\" );\n\n /*SELECT DISTINCT `act`.`act_userId` AS `DbeeID`, COUNT(act.act_id) AS total,sum(case when act_type=1 then 1 else 0 end) postCount,sum(case when act_type=2 then 1 else 0 end) commentCount ,`u`.`UserID`, `u`.`Name` AS `username`, `u`.`lname`, `u`.`ProfilePic` AS `image`, `u`.`Username` AS `uname` FROM `tblactivity` AS `act` INNER JOIN `tblUsers` AS `u` ON u.UserID=act.act_userId WHERE (u.Status = '1') AND (u.Role != '1') AND (act.clientID = '1') AND (act.act_type = 1 OR act.act_type = 2) GROUP BY `act`.`act_userId` ORDER BY `total` DESC*/\n\n if(!empty($datefrom) && !empty($dateto)){\n $select->where(\"act.act_date >= ?\", date('Y-m-d H:i:s',strtotime($datefrom)));\n $select->where(\"act.act_date <= ?\", date('Y-m-d H:i:s',strtotime($dateto)));\n } \n $select->group ( array (\"act.act_userId\") );\n $select->order('total DESC');\n if($limit!='all')\n $select->LIMIT($limit, 0);\n //echo $select; exit;\n $result= $db->fetchAll($select); \n return $result; \n }", "public function query($user, $or)\r\n {\r\n $sql = \"\";\r\n if ($or) {\r\n $sql = \"select * from user where account='\" . $user->account . \"' \";\r\n } else {\r\n $sql = \"select * from user where account='\" . $user->account . \"'and password='\" . $user->password . \"'\";\r\n }\r\n\r\n// $sql = \"select * from user where account='\" . $user->account . \"' \" . $or_ . \" password='\" . $user->password . \"'\";\r\n\r\n// $sql = printf($sql, $user->accound, $user->password);\r\n\r\n $result = MyDao::queryForResult($sql);\r\n\r\n $has = false;\r\n\r\n while ($obj = mysqli_fetch_object($result)) {\r\n $has = true;\r\n }\r\n return $has;\r\n }", "function get_user_booking_with_id($user_id){\n global $db;\n $sql = \"SELECT * FROM booking WHERE user_id = '$user_id'\";\n $result = $db->query($sql);\n return $result;\n}", "function if_user_has_booking($user_id){\n global $db;\n $sql = \"SELECT * FROM booking WHERE user_id = '$user_id';\";\n $result = $db->query($sql);\n return $result;\n}", "function getGender($user, $gender) {\n\t$result = dbQuery(\"SELECT * FROM users WHERE username = '$user'\");\n\t$row = mysql_fetch_array($result);\n\n\t if( $row['gender'] == $gender ) \n\t {\n\t\t return true;\n\t\t } \n\t\t else\n\t\t {\n\t\t \t return false;\n\t\t }\n}", "function getUsulanByIdUsulan($id){\n\t\t$query = $this->db->query(\"SELECT * from usulan,pagu,user where usulan.ID_USER=user.ID_USER AND ID_USULAN = '$id' AND usulan.TAHUN_ANGGARAN = pagu.TAHUN_ANGGARAN\")->row_array();\n\t\treturn $query;\n\t}", "public function show_profile(){\n\n $query = $this->db->select(\"person.fname, person.lname, person.yob, author_registration.picture_url\")\n ->from(\"person\")\n ->join(\"author_registration\", \"person.person_id = author_registration.person_id\")\n ->get();\n\n return $query;\n }", "public function get_commute_detail($userId,$searchId){\n // $userId = $post_data['userId'];\n // $searchId = $post_data['searchId'];\n\n $sql =\"SELECT c.commuteId,c.commuteName,c.destination,c.timeofCommuting,c.modeOfCommute,c.maxCommuteTime,c.destLatitude,c.destLongitude,c.primaryCommute \n FROM commute c,users u WHERE u.userId = c.userId AND c.searchId = $searchId AND c.deleteFlag != 1 AND c.userId =$userId\";\n $record = $this->db->query($sql);\n if($record->num_rows()>0){\n return $record->result_array(); \n } \n }", "function getByUser($uid) {\n // Run the query and get the user details\n $query = sprintf(\"SELECT p.id,\n p.uid,\n p.typeid,\n p.amount,\n p.token,\n p.createdOn,\n pt.desc\n FROM Payments p\n INNER JOIN PaymentTypes pt ON pt.id = p.typeid\n WHERE p.uid=%u\n ORDER BY p.createdOn DESC\",\n $uid);\n\n $conn = \\DB\\getConnection();\n $result = $conn->query($query);\n\n return $result;\n}", "function get_itmanger(){\n\t\t//$query = \"SELECT EMP_NAME from emp_basic_info where emp_num='11252'\";\n\t\t$where_clause = \" where users.department_id=110 \";\n\t\n\t\t$query = \"SELECT users.user_id, users.name from users join userrole on users.user_id = userrole.user_id $where_clause and role_id IN (10, 11) order by role_id desc\";\n\t\t$query = $this->db->query($query);\n\t\t$result = $query->row();\n\t\tif(isset($result->name)){\n\t\t\treturn $result->name;\n\t\t}\n\t\telse \n\t\t\treturn null;\n\t}", "function find_all_user(){\n global $db;\n $results = array();\n $sql = \"SELECT u.id,u.name,u.username,u.user_level,u.status,u.last_login,email,\";\n $sql .=\"g.group_name \";\n $sql .=\"FROM users u \";\n $sql .=\"LEFT JOIN user_groups g \";\n $sql .=\"ON g.group_level=u.user_level ORDER BY u.name ASC\";\n $result = find_by_sql($sql);\n return $result;\n }" ]
[ "0.66441077", "0.6509538", "0.6286658", "0.6274298", "0.6199759", "0.61170787", "0.6114104", "0.60891664", "0.6076646", "0.6070852", "0.60519606", "0.6040938", "0.6032481", "0.60305417", "0.6026498", "0.5964746", "0.5963975", "0.5945471", "0.5939202", "0.59375876", "0.5935925", "0.59354097", "0.59349394", "0.5927222", "0.59243053", "0.5912528", "0.5904657", "0.59013486", "0.5862425", "0.5851449", "0.58489877", "0.58384216", "0.58355", "0.58149856", "0.58090645", "0.5805585", "0.5800333", "0.57996064", "0.579099", "0.57899743", "0.57793945", "0.577867", "0.5769161", "0.57647175", "0.575722", "0.5749257", "0.5748003", "0.5745322", "0.5738263", "0.5736583", "0.5734389", "0.57301766", "0.5729655", "0.57290465", "0.57260454", "0.57255286", "0.572121", "0.57197404", "0.57108736", "0.57012355", "0.569915", "0.5696094", "0.56917167", "0.56911844", "0.5690292", "0.5683408", "0.56712455", "0.5669493", "0.56676507", "0.56648886", "0.56617457", "0.5661332", "0.5660007", "0.565885", "0.56546354", "0.56473583", "0.56470305", "0.56381744", "0.5635395", "0.5630217", "0.5629258", "0.56273854", "0.5627075", "0.5625285", "0.5619517", "0.5619372", "0.561891", "0.5618873", "0.56151444", "0.56151444", "0.5610745", "0.5610654", "0.5600007", "0.55992824", "0.5597268", "0.55964935", "0.5593781", "0.5592812", "0.5591116", "0.5584738", "0.5582181" ]
0.0
-1
/ $result = $this>db>query('SELECT order. from order us INNER JOIN users ON up.id=us.bookedby WHERE and us.gender =' . $params['gender'] . ' AND us.age BETWEEN ' . $params['age_from'] . ' AND ' . $params['age_to'] . ' AND us.user_id !=' . $params['user_id'] . ' AND up.country_id =' . $params['country'] . ' AND us.status =1 and up.visibility="true" '.$search.$privateprofile.' ORDER BY us.user_id'); echo $this>db>last_query(); us.gender ='.$params['gender'].' AND return $result>result();
function searchmonthresultnow($mon) { $this->db->select('order.*,users.*,order.id as oid,file.*,package.*,cities.*,order.amount as am,guest.firstname as fr,guest.lastname as lr'); $this->db->from('order'); $this->db->join('package', 'package.id = order.package', 'left'); $this->db->join('orderguest', 'orderguest.orderid = order.id', 'left'); $this->db->join('guest', 'guest.id = orderguest.guest', 'left'); $this->db->join('users', 'order.bookedby = users.id', 'left'); $this->db->join('userprofile', 'userprofile.useid = users.id', 'left'); $this->db->join('cities', 'cities.c_id = package.location', 'left'); $this->db->join('file', 'file.id = userprofile. profilepic', 'left'); $this->db->where('MONTH(order.orderplacedate)', $mon); // $this->db->order_by("order.orderplacedate", "desc"); $this->db->where('order.user_cancel', null); $this->db->where('order.admin_cancel', null); $query = $this->db->get(); $row = $query->result_array(); return $row; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generate_query($gender) {\n global $person_array_data;\n return \"SELECT *\n FROM gegevens \n INNER JOIN get_answers ON gegevens.id = get_answers.person_id\n INNER JOIN get_importance ON gegevens.id = get_importance.person_id\n INNER JOIN get_desired ON gegevens.id = get_desired.person_id\n WHERE age >= ({$person_array_data['age']} / 2 + 6) \n AND age <= ({$person_array_data['age']} * 2 - 12) AND id <> {$person_array_data['id']} \n AND name <> '' AND gender = {$gender}\n GROUP BY gegevens.id\";\n }", "public function getAllUserProfilesByAdvanceSearch($request,$gender) {\n extract($request);\n $sql = \"SELECT * FROM user_profile_tab,user_tab WHERE user_tab.user_id = user_profile_tab.user_id AND user_tab.user_gender != '$gender' \";\n\n if ($language != '') {\n $sql .= \"AND user_profile_tab.user_mother_tongue = '$language' \";\n }\n if ($religion != '') {\n $sql .= \"AND user_tab.user_caste = '$religion' \";\n }\n if ($filter_aged_from != '') {\n $sql .= \"AND DATEDIFF(CURRENT_DATE, user_profile_tab.user_dob) >= ('$filter_aged_from' * 365.25) \";\n }\n if ($filter_aged_to != '') {\n $sql .= \"AND DATEDIFF(CURRENT_DATE, user_profile_tab.user_dob) <= ('$filter_aged_to' * 365.25) \";\n }\n if ($maritalStatus != '') {\n $sql .= \"AND user_profile_tab.user_marital_status = '$maritalStatus'\";\n }\n\n if ($country != '') {\n $countryName = '';\n $countryId = '';\n $countries = explode(\"/\", $country);\n $countryName = $countries[0]; // piece1\n $countryId = $countries[1]; // piece2\n $sql .= \"AND user_profile_tab.user_country = '$countryName' \";\n }\n\n if ($state != '') {\n $stateName = '';\n $stateId = '';\n $states = explode(\"/\", $state);\n $stateName = $states[0]; // piece1\n $stateId = $states[1]; // piece2\n $sql .= \"AND user_profile_tab.user_state = '$stateName' \";\n }\n if ($city != '') {\n $sql .= \"AND user_profile_tab.user_city = '$city' \";\n }\n// if ($filter_member_id != '') {\n// $sql .= \"AND user_profile_tab.user_profile_key = '$filter_member_id' \";\n// }\n if ($working_field != '') {\n $sql .= \"AND user_profile_tab.user_working_field = '$working_field' \";\n }\n if ($occupation != '') {\n $sql .= \"AND user_profile_tab.user_occupation_type = '$occupation' \";\n }\n if ($education != '') {\n $sql .= \"AND user_profile_tab.user_education_field = '$education' \";\n }\n if ($max_height != '') {\n $sql .= \"AND user_profile_tab.user_height <= '$max_height' \";\n }\n if ($min_height != '') {\n $sql .= \"AND user_profile_tab.user_height >= '$min_height' \";\n }\n if ($from_weight != '') {\n $sql .= \"AND user_profile_tab.user_weight >= '$from_weight' \";\n }\n if ($to_weight != '') {\n $sql .= \"AND user_profile_tab.user_weight <= '$to_weight' \";\n }\n if ($from_salary != '') {\n $sql .= \"AND user_profile_tab.user_annual_income >= '$from_salary' \";\n }\n if ($to_salary != '') {\n $sql .= \"AND user_profile_tab.user_annual_income <= '$to_salary' \";\n }\n $sql .= \"AND user_tab.user_status='1' AND user_tab.user_doc_verified='1' ORDER BY user_tab.user_id DESC\";\n $result = $this->db->query($sql);\n if ($result->num_rows() <= 0) {\n return false;\n } else {\n return $result->result_array();\n }\n }", "public function getuser($rid='',$surid='')\n{\n if($rid!=''){\n $this -> db -> order_by('FIELD (users.id,'.$rid.')', 'desc', FALSE);\t \n }\n else if($surid!=''){\n $this -> db ->like('users.first_name',$surid);\t \n } \n else{\n\t $this->db->order_by(\"users.id\",\"desc\");\n\t}\t\n\t\n $uid = $this->session->userdata('user_id');\t\n $this->db->select(\"DISTINCT(users.username),users.*\");\n $this->db->join(\"userschating a\",\"users.id=a.rid\",\"left\");\n $this->db->join(\"userschating b\",\"users.id=b.sid\",\"left\");\n //$this->db->where('user.id !=',$uid); \n $this->db->where(\"users.id !=$uid AND (a.rid=$uid OR b.sid=$uid OR b.rid=$uid OR a.sid=$uid)\");\n $this->db->order_by('users.id','desc');\n \n $result=$this->db->get(\"users\")->result(); \n //echo $this->db->last_query(); die;\n\tforeach($result as $key=>$row)\n\t{\n\t$id =$row->id;\t\n\t$this->db->select(\"count(status) as no\");\n\t$this->db->where(\"status\" ,0);\n\t$this->db->where(\"sid\",$id);\n\t$this->db->where(\"rid\",$uid);\t\n $da = $this->db->get(\"userschating\")->result();\n $no = $da[0]->no;\n $result[$key]->no = $no;\t\n\t}\n\treturn $result;\n\t\n}", "public function get_user_info($userId,$searchId){\n $sql = \"SELECT u.firstName,s.searchName from users u,searchcriteria s where u.userId = s.userId AND u.userId =$userId AND s.searchId =$searchId AND s.deleteFlag !=1 AND u.deleteFlag !=1\";\n $result = $this->db->query($sql);\n return $result->result_array(); \n }", "public function getAllUsersData($userInfo,$searchVal)\r\n {\r\n \t$user_id = $userInfo->getUserIdInfo();\r\n \t$user_id=$user_id['id'];\r\n \t//$user_id=17;\n \t$this->db->Fields(array('u.id','u.first_name','u.middle_name','u.last_name','u.gender','u.email_primary','u.profile_image','f.status'));\n $this->db->From('users u,friends f');\r\n $this->db->Where(array(\"user_id=\".$user_id.\" AND friend_id=u.id AND u.status='A' AND\r\n\t\t\t (f.status='F' OR f.status='R' OR f.status='W') AND\r\n\t\t\t (u.first_name like '%\".$searchVal.\"%' OR\r\n\t\t\t u.middle_name like '%\".$searchVal.\"%' OR\r\n\t\t\t u.last_name like '%\".$searchVal.\"%' OR\r\n\t\t\t u.email_primary like '%\".$searchVal.\"%') \"),true); \t\n \t$this->db->Select();\n \t$result1 = $this->db->resultArray();\r\n \t\r\n \t$this->db->unsetValues();\r\n \t\r\n \t$this->db->Fields(array('u.id'));\n $this->db->From('users u,friends f');\r\n $this->db->Where(array(\"user_id=\".$user_id.\"\r\n\t\t\t AND friend_id=u.id AND u.status='A'\r\n\t\t\t AND (f.status='F' OR f.status='R' OR f.status='W')\r\n\t\t\t AND (u.first_name like '%\".$searchVal.\"%'\r\n\t\t\t OR u.middle_name like '%\".$searchVal.\"%'\r\n\t\t\t OR u.last_name like '%\".$searchVal.\"%'\r\n\t\t\t OR u.email_primary like '%\".$searchVal.\"%') \"),true);\r\n \t$this->db->Select();\n \t$result2 = $this->db->resultArray();\r\n\r\n \t$myStr=\"1,\";\r\n\t\tforeach($result2 as $keys=>$values){\r\n\t\t\tforeach ($values as $key=>$value)\r\n\t\t\t{\r\n\t\t\t\t$myStr.=$value.\",\";\r\n\t\t\t}\r\n\t\t}\t\t \r\n \t$myStr=substr($myStr,0,-1);\r\n \t\r\n \t$this->db->unsetValues();\r\n \t$this->db->Fields(array('id','first_name','middle_name','last_name','gender','email_primary','profile_image','status'));\r\n \t$this->db->From('users');\r\n \t$this->db->Where(array(\"(status = 'A' AND\r\n\t\t\t (first_name like '%\".$searchVal.\"%'\r\n\t\t\t OR middle_name like '%\".$searchVal.\"%'\r\n\t\t\t OR last_name like '%\".$searchVal.\"%'\r\n\t\t\t OR email_primary like '%\".$searchVal.\"%'))\r\n\t\t\t AND id NOT IN (\".$myStr.\")\r\n\t\t\t AND id <> \".$user_id.\" \"),true);\r\n \t$this->db->Select();\n \t$result = $this->db->resultArray();\r\n \t$result=array_merge($result1,$result);\r\n \treturn($result);\r\n }", "function account_user($uid)\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('account');\n\t\t$this->db->where('pack_status','Y');\n\t\t$this->db->where('paystatus','TRUE');\n\t\t$this->db->where('approved','Y');\n\t\t$this->db->where('status','Y');\n\t\t$this->db->where('deleted','N');\n\t\t$this->db->where('user_id',$uid);\n\t\t$query = $this->db->get();\n\t\treturn $query;\t\n\t}", "function get_user($limit)\r\n {\r\n //$query=$this->db->query(\"SELECT *FROM user INNER JOIN division ON user.storeid=division.storeid WHERE \");\r\n/*$this->db->select('user.first_name,user.last_name,user.emailid,user.phone,user.fax,user.userid,user.storeid,user.isactive,\r\ndivision.store_name,division.division_type,division.divisionid');\r\n $this->db->from('user,division,user_division');\r\n $this->db->where('(user.userid=user_division.userid)');\r\n $this->db->where('(user.storeid=division.storeid)');\r\n $this->db->WHERE ('(user.storeid !=123456)');\r\n $this->db->group_by('user_division.userid');\r\n //$this->db->limit($limit);\r\n \r\n $query = $this->db->get();\r\necho $this->db->last_query();*/\r\n$query=$this->db->query(\"SELECT *FROM user INNER join division ON user.storeid=division.storeid $limit\");\r\n\r\n return $query->result_array(); \r\n }", "function getUsersAccount($param=array(),$sWhere=null,$sOrder=null,$length=null,$start=null,$is_active=null){\r\n\t\tif(empty($param)) return array();\r\n\t\t$this->db->select(TBL_USERS.'.email,'.TBL_USERS.'.password,'.TBL_USERS.'.is_active,'.TBL_USER_INFORMATION.'.sales_rip,'.TBL_USERS.'.role,'.TBL_USERS.'.job_title,'.TBL_USER_INFORMATION.'.*,'.TBL_MST_COUNTRIES.'.title as country,'.TBL_MST_STATES.'.title as state,'.TBL_MST_CITIES.'.title as city,'.TBL_MST_STORES.'.title as store');\r\n\t\t$this->db->from(TBL_USERS);\r\n\t\t$this->db->join(TBL_USER_INFORMATION,TBL_USER_INFORMATION.'.tbl_users_id='.TBL_USERS.'.id');\r\n\t\t$this->db->join(TBL_MST_COUNTRIES, TBL_MST_COUNTRIES.'.id='.TBL_USER_INFORMATION.\".mst_countries_id\",'left');\r\n\t\t$this->db->join(TBL_MST_STATES, TBL_MST_STATES.'.id='.TBL_USER_INFORMATION.\".mst_states_id\",'left');\r\n\t\t$this->db->join(TBL_MST_CITIES, TBL_MST_CITIES.'.id='.TBL_USER_INFORMATION.\".mst_cities_id\",'left');\r\n\t\t$this->db->join(TBL_MST_STORES, TBL_MST_STORES.'.id='.TBL_USER_INFORMATION.\".store_id\",'left');\r\n\t\t//echo $this->db->_compile_select();die;\r\n\t\t\r\n\t\tif(isset($param['role']) && $param['role']!=''){\r\n\t\t\t$this->db->where(TBL_USERS.'.role = \"'.$param['role'].'\"');\t\r\n\t\t}\r\n\t\tif(isset($param['sales_rip_id']) && $param['sales_rip_id']!=''){\r\n\t\t\t$this->db->where(TBL_USERS.'.id = \"'.$param['sales_rip_id'].'\"');\t\r\n\t\t}\r\n\t\t\r\n\t\tif(isset($param['manager_id']) && $param['manager_id']!=''){\r\n\t\t\t$this->db->where(TBL_USERS.'.parent_report_id = \"'.$param['manager_id'].'\"');\t\r\n\t\t}\r\n\t\t\r\n\t\tif(isset($param['director_id']) && $param['director_id']!=''){\r\n\t\t\t$this->db->where_in('parent_report_id',$param['director_id']);\r\n\t\t}\r\n\t\tif(isset($sWhere) && trim($sWhere) != ''){\r\n\t\t\t$this->db->where('('.$sWhere.')');\r\n\t\t}\r\n\t\tif(isset($sOrder) && trim($sOrder) != ''){\r\n\t\t\t$this->db->order_by($sOrder);\r\n\t\t} \r\n\t\tif(isset($length) && $length != ''){\r\n\t\t\t$this->db->limit($length,$start);\r\n\t\t}\r\n\t\tif($is_active!=null){\r\n\t\t\t$this->db->where(array(TBL_USERS.'.is_active'=>$is_active));\r\n\t\t}\r\n\t\t//$this->db->group_by(TBL_USERS.'.id');\r\n\t\t\r\n\t \t//echo $this->db->_compile_select(); die; \r\n\t\t$recordSets = $this->db->get();\r\n\t\t\r\n\t\t$data = $recordSets->result();\r\n\t\t\r\n\t\treturn $data;\t\r\n\t\t\r\n\t}", "public function get_other_library($user){\n $query=$this->db->query('SELECT * FROM `user_books` INNER JOIN users ON user_books.user_email=users.email WHERE `availability`=1 AND users.username=\"'.$user['sent_by'].'\" ');\n return $query->result();\n }", "public function searchUserByGender($gender){\r\n $result = $this->DB->fetchAll('select * from user where gender = ?',array($gender));\r\n return $this->formatResult($result);\r\n }", "public function filter_books20($data){\n $query=$this->db->query('SELECT * FROM `user_books` INNER JOIN `users` ON `users`.`username` = `user_books`.`user_username` WHERE `availability`=\"1\" AND `cond` = \"'.$data['cond'].'\" AND `book_genre` = \"'.$data['book_genre'].'\" AND `users`.`user_region` = \"'.$data['region'].'\" AND NOT `user_username`= \"'.$data['username'].'\" ORDER BY `date_added` DESC LIMIT 150;');\n return $query->result();\n }", "public function searchByProfile_id() {\n $gender = $this->session->userdata('key_gender');\n extract($_GET);\n //print_r($_GET);\n $result = $this->Searchbyprofileid_model->searchByProfile_id($filter_member_id, $gender);\n if (!$result) {\n echo '500';\n } else {\n print_r(json_encode($result));\n }\n }", "public function get_profile_details($user_id)\n {\n $sql = \"SELECT u.id as user_id, \n u.profile_code,\n u.bio_info,\n u.created_at as register_date,\n u.email,\n u.last_name,\n u.first_name,\n ub.middlename,\n u.fullname_last_edited,\n uc.address,\n rc.name as country,\n (case u.gender\n when 'N' then CONCAT('Others','',u.gender_custom)\n when 'F' then 'Female'\n when 'M' then 'Male'\n else ''\n end) 'gender',\n u.gender_num_times_edited,\n ub.birthday,\n u.birthyear,\n u.birthdate_num_times_edited,\n ub.politics as political_view,\n ub.religion,\n rb.name as bloodtype,\n uc.contact1,\n uc.contact2,\n uc.contact3,\n uc.webtitle1, \n uc.weblink1, \n uc.webtitle2, \n uc.weblink2,\n uc.webtitle3, \n uc.weblink3,\n coalesce(a.comments,0) + coalesce(b.discussion,0)as total_comments,\n coalesce(m.friends,0) as total_friends,\n coalesce(n.followers,0) as total_followers,\n coalesce(o.following,0) as total_following,\n coalesce(c.post,0) as total_post,\n coalesce(c.image,0) as total_images,\n coalesce(c.poll,0) as total_poll,\n coalesce(c.question,0) as total_question,\n coalesce(c.article,0) as total_article,\n (coalesce(d.yaycontent,0) + coalesce(e.yaycomment,0) + coalesce(f.yayreply,0) + coalesce(g.yayreplyl2,0) + coalesce(h.yayreplyl3,0) + coalesce(i.yaydiscussion,0) + coalesce(j.yaytopicreply,0) + coalesce(k.yaytopicreplyl2,0) + coalesce(l.yaytopicreplyl3,0)) as totalyayreceived,\n (coalesce(d.naycontent,0) + coalesce(e.naycomment,0) + coalesce(f.nayreply,0) + coalesce(g.nayreplyl2,0) + coalesce(h.nayreplyl3,0) + coalesce(i.naydiscussion,0) + coalesce(j.naytopicreply,0) + coalesce(k.naytopicreplyl2,0) + coalesce(l.naytopicreplyl3,0)) as totalnayreceived,\n us.credential_type,\n us.credential_refid,\n (case us.credential_type\n when 1 then ugen.general_info\n when 2 then CONCAT(ucol.course, ', ', ucol.schoolname)\n when 3 then CONCAT(uwork.position, ', ', uwork.companyname,', ',uwork.location)\n end) 'credential',\n\t (coalesce(ugen2.total,0) + coalesce(ucol2.total,0) + coalesce(uwork2.total,0)) as total_credentials\n FROM users u\n LEFT JOIN userbasicinfo ub ON u.id = ub.user_id\n LEFT JOIN usercontactinfo uc ON uc.user_id = u.id\n LEFT JOIN refcountry rc ON rc.id = uc.country \n LEFT JOIN refbloodtype rb ON rb.id = ub.bloodtype\n LEFT OUTER JOIN(SELECT po.user_id, \n count(*) comments\n FROM postopinion po\n WHERE po.deleted_at IS NULL AND po.mask= 0\n GROUP BY po.user_id) as a ON a.user_id = u.id\t\n LEFT OUTER JOIN(SELECT top_o.user_id,\n count(*) discussion\n FROM topicopinion top_o\n WHERE top_o.deleted_at IS NULL AND top_o.mask=0\n GROUP BY top_o.user_id) as b ON b.user_id = u.id \n LEFT OUTER JOIN (select pc.user_id,\n sum(Case when type = 'F' then 1 else 0 end) image,\n sum(Case when type = 'Q' then 1 else 0 end) question,\n sum(Case when type = 'A' then 1 else 0 end) article,\n sum(Case when type = 'P' then 1 else 0 end) poll,\n count(*) post\n FROM postcontent pc\n WHERE pc.deleted_at IS NULL and pc.mask=0\n GROUP BY pc.user_id) as c ON c.user_id = u.id \n LEFT OUTER JOIN (select pca.postcontent_id, pc.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycontent,\n sum(Case when approvalrate = 'N' then 1 else 0 end) naycontent\n FROM postcontentapprovalrate pca\n LEFT JOIN postcontent pc ON pc.id=pca.postcontent_id\n WHERE pc.deleted_at IS NULL AND pc.mask=0\n GROUP BY pc.user_id) as d ON d.user_id = u.id\n LEFT OUTER JOIN (select poa.postopinion_id, po.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycomment,\n sum(Case when approvalrate = 'N' then 1 else 0 end) naycomment\n FROM postopinionapprovalrate poa\n LEFT JOIN postopinion po ON po.id = poa.postopinion_id\n LEFT JOIN postcontent pc ON pc.id=po.postcontent_id\n WHERE pc.deleted_at IS NULL AND po.deleted_at IS NULL AND po.mask=0\n GROUP BY po.user_id) as e ON e.user_id = u.id\n LEFT OUTER JOIN (select pra.postreply_id, pra.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yayreply,\n sum(Case when approvalrate = 'N' then 1 else 0 end) nayreply\n FROM postreplyapprovalrate pra\n LEFT JOIN postreply pr ON pr.id = pra.postreply_id\n LEFT JOIN postopinion po ON po.id = pr.postopinion_id\n LEFT JOIN postcontent pc ON pc.id=po.postcontent_id\n WHERE pc.deleted_at IS NULL AND po.deleted_at IS NULL \n AND pr.deleted_at IS NULL AND pr.mask=0\n GROUP BY pr.user_id) as f ON f.user_id = u.id\n LEFT OUTER JOIN (select pral2.postreplyL2_id, pral2.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yayreplyl2,\n sum(Case when approvalrate = 'N' then 1 else 0 end) nayreplyl2\n FROM postreplyL2approvalrate pral2\n LEFT JOIN postreplyL2 pr2 ON pr2.id = pral2.postreplyL2_id\n LEFT JOIN postreply pr ON pr.id = pr2.postreply_id\n LEFT JOIN postopinion po ON po.id = pr.postopinion_id\n LEFT JOIN postcontent pc ON pc.id=po.postcontent_id\n WHERE pc.deleted_at IS NULL AND po.deleted_at IS NULL \n AND pr.deleted_at IS NULL AND pr2.deleted_at AND pr2.mask=0\n GROUP BY pr2.user_id) as g ON g.user_id = u.id\n LEFT OUTER JOIN (select pral3.postreplyL3_id, pral3.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yayreplyl3,\n sum(Case when approvalrate = 'N' then 1 else 0 end) nayreplyl3\n FROM postreplyL3approvalrate pral3\n LEFT JOIN postreplyL3 pr3 ON pr3.id = pral3.postreplyL3_id\n LEFT JOIN postreplyL2 pr2 ON pr2.id = pr3.postreplyL2_id\n LEFT JOIN postreply pr ON pr.id = pr2.postreply_id\n LEFT JOIN postopinion po ON po.id = pr.postopinion_id\n LEFT JOIN postcontent pc ON pc.id=po.postcontent_id\n WHERE pc.deleted_at IS NULL AND po.deleted_at IS NULL \n AND pr.deleted_at IS NULL AND pr2.deleted_at \n AND pr3.deleted_at IS NULL AND pr3.mask=0\n GROUP BY pr3.user_id) as h ON h.user_id = u.id\n LEFT OUTER JOIN (select toa.topicopinion_id, ton.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaydiscussion,\n sum(Case when approvalrate = 'N' then 1 else 0 end) naydiscussion\n FROM topicopinionapprovalrate toa\n LEFT JOIN topicopinion ton ON ton.id = toa.topicopinion_id\n LEFT JOIN topic t ON t.id=ton.topic_id\n WHERE t.deleted_at IS NULL AND ton.deleted_at IS NULL AND ton.mask=0\n GROUP BY ton.user_id) as i ON i.user_id = u.id\n LEFT OUTER JOIN (select tra.topicreply_id, tra.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaytopicreply,\n sum(Case when approvalrate = 'N' then 1 else 0 end) naytopicreply\n FROM topicreplyapprovalrate tra\n LEFT JOIN topicreply tr ON tr.id = tra.topicreply_id\n LEFT JOIN topicopinion ton ON ton.id = tr.topicopinion_id\n LEFT JOIN topic t ON t.id=ton.topic_id\n WHERE t.deleted_at IS NULL AND ton.deleted_at IS NULL \n AND tr.deleted_at IS NULL AND tr.mask=0\n GROUP BY tr.user_id) as j ON j.user_id = u.id\n LEFT OUTER JOIN (select tral2.topicreplyl2_id, tral2.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaytopicreplyl2,\n sum(Case when approvalrate = 'N' then 1 else 0 end) naytopicreplyl2\n FROM topicreplyl2approvalrate tral2\n LEFT JOIN topicreplyl2 tr2 ON tr2.id = tral2.topicreplyl2_id\n LEFT JOIN topicreply tr ON tr.id = tr2.topicreply_id\n LEFT JOIN topicopinion ton ON ton.id = tr.topicopinion_id\n LEFT JOIN topic t ON t.id=ton.topic_id\n WHERE t.deleted_at IS NULL AND ton.deleted_at IS NULL \n AND tr.deleted_at IS NULL AND tr2.deleted_at IS NULL AND tr2.mask=0\n GROUP BY tr2.user_id) as k ON k.user_id = u.id\n LEFT OUTER JOIN (select tral3.topicreplyl3_id, tral3.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaytopicreplyl3,\n sum(Case when approvalrate = 'N' then 1 else 0 end) naytopicreplyl3\n FROM topicreplyl3approvalrate tral3\n LEFT JOIN topicreplyl3 tr3 ON tr3.id = tral3.topicreplyl3_id\n LEFT JOIN topicreplyl2 tr2 ON tr2.id = tr3.topicreplyl2_id\n LEFT JOIN topicreply tr ON tr.id = tr2.topicreply_id\n LEFT JOIN topicopinion ton ON ton.id = tr.topicopinion_id\n LEFT JOIN topic t ON t.id=ton.topic_id\n WHERE t.deleted_at IS NULL AND ton.deleted_at IS NULL \n AND tr.deleted_at IS NULL AND tr2.deleted_at IS NULL \n AND tr3.deleted_at IS NULL AND tr3.mask=0\n GROUP BY tr3.user_id) as l ON l.user_id = u.id\n LEFT OUTER JOIN(SELECT uf.user_one_id, \n count(*) friends\n FROM userfriends uf\n WHERE uf.status=1\n GROUP BY uf.user_one_id) as m ON m.user_one_id = u.id\t\n LEFT OUTER JOIN(SELECT ua.user_two_id, \n count(*) followers\n FROM useracquiantances ua\n WHERE ua.status=1\n GROUP BY ua.user_two_id) as n ON n.user_two_id = u.id\n LEFT OUTER JOIN(SELECT ua2.user_one_id, \n count(*) following\n FROM useracquiantances ua2\n WHERE ua2.status=1\n GROUP BY ua2.user_one_id) as o ON o.user_one_id = u.id\n LEFT JOIN usersettings us on us.user_id = u.id\n LEFT JOIN usergeneralinfo ugen ON ugen.user_id = us.user_id AND ugen.id = us.credential_refid\n LEFT JOIN usereduccollege ucol ON ucol.user_id = us.user_id AND ucol.id = us.credential_refid\n LEFT JOIN userworkhistory uwork ON uwork.user_id = us.user_id AND uwork.id = us.credential_refid\n LEFT OUTER JOIN (SELECT usergeneralinfo.user_id,\n COUNT(*) total\n FROM usergeneralinfo\n GROUP BY usergeneralinfo.user_id) as ugen2 ON ugen2.user_id = u.id\n LEFT OUTER JOIN (SELECT usereduccollege.user_id,\n COUNT(*) total\n FROM usereduccollege\n GROUP BY usereduccollege.user_id) as ucol2 ON ucol2.user_id = u.id\n LEFT OUTER JOIN (SELECT userworkhistory.user_id,\n COUNT(*) total\n FROM userworkhistory\n GROUP BY userworkhistory.user_id) as uwork2 ON uwork2.user_id = u.id\n WHERE u.id = {$user_id}\";\n \n return DB::select(DB::raw($sql));\n }", "public function get_preference_detail($userId,$searchId){\n //$userId = $post_data['userId'];\n //$searchId = $post_data['searchId'];\n\n $sql =\"SELECT s.*,u.userId,u.firstName,u.lastName\n \n FROM searchcriteria s,users u WHERE u.userId = s.userId AND s.deleteFlag != 1 AND s.searchId = $searchId AND s.userId =$userId\";\n \n $record = $this->db->query($sql);\n if($record->num_rows()>0){\n return $record->result_array()[0];\n //print_r($record->result_array());exit();\n } \n }", "function get_user_details($user_id, $cond = array()) {\n\n $ci = & get_instance();\n $lang_id = get_current_language();\n $user = array();\n $lang_case = \"`id`.`lang_id`= CASE WHEN (EXISTS (SELECT id FROM \" . INTERESTS_DATA . \" WHERE lang_id = '$lang_id') ) THEN $lang_id ELSE 1 END\";\n\n $ci->db->select(\"u.id as uid,u.plan_expire as u_plan_expire,u.plan_type as u_plan_type,u.plan_id as u_plan_id, u.*, pr.*, f.*, f.id as file_id, fam.id as fam_id,fam.plan_expire,fam.plan_type,fam.plan_id, fam.*\");\n $ci->db->from(USER . \" u\");\n $ci->db->join(PROFILE . \" pr\", \"pr.user_id = u.id\", 'left');\n $ci->db->join(FILES . \" f\", \"pr.profile_Image = f.id\", 'left');\n $ci->db->join(FAMILY_USERS . \" fu\", \"fu.user_id = u.id\", 'left');\n $ci->db->join(FAMILY . \" fam\", \"fu.family_id = fam.id\", 'left');\n $ci->db->where(\"u.id\", $user_id);\n $query = $ci->db->get();\n\n\n if ($query->num_rows() > 0) {\n $result = $query->result_array();\n $user = $result[0];\n\n// Get data from for user interests\n $ci->db->select(\"i.*, id.content\");\n $ci->db->from(INTERESTS . \" i\");\n $ci->db->join(PROFILE_INTEREST . \" pi\", \"pi.interest_id = i.id\");\n $ci->db->join(INTERESTS_DATA . \" id\", \"id.interest_id = i.id\");\n $ci->db->where(\"pi.user_id\", $user_id);\n $ci->db->where($lang_case);\n//$ci->db->distinct();\n $query_int = $ci->db->get();\n if ($query_int->num_rows() > 0) {\n $details = $query_int->result_array();\n $user['interest'] = $details;\n } else {\n $user['interest'] = array();\n }\n\n // Get data from for user family children\n $ci->db->select(\"fc.*\");\n $ci->db->from(FAMILY . \" f\");\n $ci->db->join(FAMILY_CHILDREN . \" fc\", \"f.id = fc.family_id\");\n $ci->db->join(FAMILY_USERS . \" fu\", \"fu.family_id = fc.family_id\");\n $ci->db->where(\"fu.user_id\", $user_id);\n//$ci->db->distinct();\n $query_child = $ci->db->get();\n if ($query_child->num_rows() > 0) {\n $details = $query_child->result_array();\n $user['family_children'] = $details;\n } else {\n $user['family_children'] = array();\n }\n\n// Get data from for user family pets\n $ci->db->select(\"fp.*\");\n $ci->db->from(FAMILY . \" f\");\n $ci->db->join(FAMILY_PETS . \" fp\", \"f.id = fp.family_id\");\n $ci->db->join(FAMILY_USERS . \" fu\", \"fu.family_id = fp.family_id\");\n $ci->db->where(\"fu.user_id\", $user_id);\n//$ci->db->distinct();\n $query_pets = $ci->db->get();\n if ($query_pets->num_rows() > 0) {\n $details = $query_pets->result_array();\n $user['family_pets'] = $details;\n } else {\n $user['family_pets'] = array();\n }\n\n// Get data from for user family elders\n $ci->db->select(\"fe.*\");\n $ci->db->from(FAMILY . \" f\");\n $ci->db->join(FAMILY_ELDERS . \" fe\", \"f.id = fe.family_id\");\n $ci->db->join(FAMILY_USERS . \" fu\", \"fu.family_id = fe.family_id\");\n $ci->db->where(\"fu.user_id\", $user_id);\n//$ci->db->distinct();\n $query_elders = $ci->db->get();\n if ($query_elders->num_rows() > 0) {\n $details = $query_elders->result_array();\n $user['family_elders'] = $details;\n } else {\n $user['family_elders'] = array();\n }\n /**\n $family_users = array();\n $users = family_user();\n // pre($users);\n $ids = array_column($users, 'user_id');\n foreach ($ids as $user) {\n $userinfo = get_user_basic_info($user);\n $userinfo['is_user'] = 1;\n $userinfo['user_id'] = $user;\n $family_users[] = $userinfo;\n }\n\n $ci->db->where(\"family_id\", $_SESSION['userSession']['family_id']);\n $qqur = $ci->db->get(PARENT_ADMIN);\n $res_parent = $qqur->result_array();\n foreach ($res_parent as $parent) {\n if(in_array($parent['user_id'], array_column($family_users, 'user_id'))) {\n $family_users[$parent['user_id']]['role'] = $parent['role'];\n }\n if ($family_users[$parent['user_id']]) {\n $family_users[$parent['user_id']]['role'] = $parent['role'];\n }else{\n\n }\n }\n * */\n $ci->db->select(\"pa.*\");\n $ci->db->from(FAMILY . \" f\");\n $ci->db->join(PARENT_ADMIN . \" pa\", \"f.id = pa.family_id\");\n $ci->db->join(FAMILY_USERS . \" fu\", \"fu.family_id = pa.family_id\");\n $ci->db->where(\"fu.user_id\", $user_id);\n //$ci->db->distinct();\n $query_elders = $ci->db->get();\n if ($query_elders->num_rows() > 0) {\n $details = $query_elders->result_array();\n $user['family_admin'] = $details;\n } else {\n $user['family_admin'] = array();\n }\n\n// Get data from for user family home address\n $ci->db->select(\"ha.*, cd.content\");\n $ci->db->from(FAMILY . \" f\");\n $ci->db->join(HOME_ADDRESS . \" ha\", \"f.id = ha.family_id\");\n $ci->db->join(FAMILY_USERS . \" fu\", \"fu.family_id = ha.family_id\");\n $ci->db->join(COUNTRY . \" c\", \"ha.country = c.id\", 'left');\n $ci->db->join(COUNTRY_DATA . \" cd\", \"cd.country_id = ha.country\", 'left');\n $ci->db->where(\"fu.user_id\", $user_id);\n $query_add = $ci->db->get();\n if ($query_add->num_rows() > 0) {\n $details = $query_add->row_array();\n $user['home_address'] = $details;\n } else {\n $user['home_address'] = array();\n }\n\n// Get data from for user family emergency Contact\n $ci->db->select(\"ec.*, cd.content\");\n $ci->db->from(FAMILY . \" f\");\n $ci->db->join(EMERGENCY_CONTACT . \" ec\", \"f.id = ec.family_id\");\n $ci->db->join(FAMILY_USERS . \" fu\", \"fu.family_id = ec.family_id\");\n $ci->db->join(COUNTRY . \" c\", \"ec.country = c.id\", 'left');\n $ci->db->join(COUNTRY_DATA . \" cd\", \"cd.country_id = ec.country\", 'left');\n $ci->db->where(\"fu.user_id\", $user_id);\n $query_eme = $ci->db->get();\n if ($query_eme->num_rows() > 0) {\n $details = $query_eme->row_array();\n $user['emergency_contact'] = $details;\n } else {\n $user['emergency_contact'] = array();\n }\n\n// Get data from for user family doctor\n $ci->db->select(\"d.*, cd.content\");\n $ci->db->from(FAMILY . \" f\");\n $ci->db->join(DOCTOR . \" d\", \"f.id = d.family_id\");\n $ci->db->join(FAMILY_USERS . \" fu\", \"fu.family_id = d.family_id\");\n $ci->db->join(COUNTRY . \" c\", \"d.country = c.id\", 'left');\n $ci->db->join(COUNTRY_DATA . \" cd\", \"cd.country_id = d.country\", 'left');\n $ci->db->where(\"fu.user_id\", $user_id);\n $query_doc = $ci->db->get();\n if ($query_doc->num_rows() > 0) {\n $details = $query_doc->row_array();\n $user['doctor'] = $details;\n } else {\n $user['doctor'] = array();\n }\n\n// Get data from for user family Gallery\n $ci->db->select(\"fg.*\");\n $ci->db->from(FAMILY . \" f\");\n $ci->db->join(FAMILY_GALLERY . \" fg\", \"f.id = fg.family_id\");\n $ci->db->join(FAMILY_USERS . \" fu\", \"fu.family_id = fg.family_id\");\n $ci->db->where(\"fu.user_id\", $user_id);\n $query_gal = $ci->db->get();\n $user['family_gallery'] = ($query_gal->num_rows() > 0) ? $query_gal->result_array() : array();\n\n// Get data from for user family friends\n $ci->db->select(\"fr.*\");\n $ci->db->from(FAMILY . \" f\");\n $ci->db->join(FRIENDS . \" fr\", \"f.id = fr.from_id OR f.id = fr.to_id\");\n $ci->db->join(FAMILY_USERS . \" fu\", \"fu.family_id = fr.from_id OR fu.family_id = fr.to_id\");\n $ci->db->where(\"fu.user_id\", $user_id);\n $ci->db->distinct();\n $query_fr = $ci->db->get();\n $user['friends'] = ($query_fr->num_rows() > 0) ? $query_fr->result_array() : array();\n }\n return $user;\n}", "function queryRicercaAvanzata ($info_utente, $hobby){\r\n \r\n // condizione dell'info utente\r\n $cond_info_utente = '';\r\n $cond_hobby = '';\r\n \r\n foreach ($info_utente as $key => $value) {\r\n if($value != 'NULL'){\r\n $cond_info_utente .= $key . '=' . $value . ' AND ';\r\n } \r\n }\r\n \r\n //considero il caso cui siano stati inseriti hobby nella ricerca\r\n //in caso affermativo viene aggiunta la condizione per gli hobby\r\n if(!empty($hobby)){\r\n foreach ($hobby as $key => $value) {\r\n $cond_hobby .= 'tipo_hobby' . '=' . $value . ' OR '; \r\n } \r\n $condizione = (trim($cond_info_utente . '(' . $cond_hobby , 'OR ')) . ')'; \r\n }\r\n // nel caso gli hobby non siano stati inseriti ripulisco la condizione togliendo and finali e \r\n // considero solo come condizione le info utente\r\n else{\r\n $condizione = trim($cond_info_utente , 'AND ');\r\n }\r\n \r\n $sql = 'SELECT email_utente, nickname, utente_esperto, utente_seguito, utente_seguace, path_img_profilo, data_ora_richiesta, ' .\r\n 'richiesta_accettata, data_ora_risposta ' . \r\n 'FROM (utente NATURAL JOIN info_utente ) LEFT OUTER JOIN seguaci_seguiti ' . \r\n 'ON email_utente = utente_seguito AND utente_seguace =' . \r\n \"'\" . $_SESSION['email_utente'] . \"' \" .\r\n 'WHERE email_utente IN (' .\r\n 'SELECT email_utente ' .\r\n 'FROM info_utente NATURAL LEFT OUTER JOIN hobby ' .\r\n 'WHERE ' . $condizione . ')'; \r\n\r\n return $sql;\r\n}", "public function fetchProfileDetails($userId)\n {\n $sql = \"SELECT quotes.id, quotes.content, genre1.genre1, genre2.genre2, genre3.genre3, author.author, users.firstname, users.lastname, users.username, users.email, users.gender, users.dt\n FROM quoteLovers\n INNER JOIN quotes ON quoteLovers.quote=quotes.id\n INNER JOIN users ON quoteLovers.user=users.id\n INNER JOIN genre1 ON quoteLovers.genre1=genre1.id\n INNER JOIN genre2 ON quoteLovers.genre2=genre2.id\n INNER JOIN genre3 ON quoteLovers.genre3=genre3.id\n INNER JOIN author ON quoteLovers.author=author.id\n WHERE quoteLovers.user='$userId'\";\n\n $query = mysqli_query($this->con, $sql);\n return $query; \n }", "function getuser()\n\t {\n\t \t//$this->db->where('as', null);\n\t \t\n\t \t$where = '(status=\"aktif\" or status is null)';\n \t$this->db->where($where);\n \t\t\n\t \t$query = $this->db->get('user');\n\t \tif ($query -> num_rows() > 0)\n\t\t{\n\t \t\treturn $query->result();\n\t \t}else{\n\t \t\treturn false;\n\t \t}\n\t }", "function users_by_hobby_id($hobby_id,$total=5,$exclude=array()){\r\n\r\n//get subscribers\r\n$users=$this->get_subscribers($hobby_id,$total,$exclude);\r\n\r\n//final arrary to be returned\r\n$return=array();\r\n\r\nif(!count($users))return $return;\r\n\r\n//form SQL query\r\n$sql=\"select id,first,last,country from userdata where \". SQL_valid_users(false). \" && \".SQL_not_in($this->get_uids($users),\"id\",false).\" order by RAND()\";\r\n\r\n$mysqli =new mysqli($GLOBALS['host'],$GLOBALS['db_user'],$GLOBALS['db_passwd'],$GLOBALS['selected_db']);\r\n\r\nif($result=$mysqli->query($sql))\r\n{\r\nif($result->num_rows>0)\r\n{\r\nwhile($row=$result->fetch_array())\r\n{\r\n$return[]=$row;\r\n}\r\n}\r\n}\r\n\r\nreturn $return;\r\n\r\n}", "function queryRicercaTuttiGliUtenti(){\r\n \r\n $sql = 'SELECT email_utente, nickname, utente_esperto, utente_seguito, utente_seguace, path_img_profilo, data_ora_richiesta, ' .\r\n 'richiesta_accettata, data_ora_risposta ' . \r\n 'FROM (utente NATURAL JOIN info_utente ) LEFT OUTER JOIN seguaci_seguiti ' . \r\n 'ON email_utente = utente_seguito AND utente_seguace =' . \r\n \"'\" . $_SESSION['email_utente'] . \"'\" ;\r\n \r\n return $sql;\r\n}", "function find_allusersearch_desc($user) {\n global $db;\n {\n return find_by_sql(\"SELECT * FROM search WHERE user='{$db->escape($user)}' ORDER BY id DESC\");\n }\n}", "public function get_user_search_info($userId,$searchId){\n $sql = \"SELECT u.firstName,s.searchName from users u,searchcriteria s where u.userId =$userId AND s.searchId =$searchId AND s.deleteFlag !=1 AND u.deleteFlag !=1 \";\n $result = $this->db->query($sql);\n return $result->result_array(); \n }", "function search($db,$page,$per,$status='',$year=0,$month=0,$userid=0)\r\n\t{\r\n//if($condition=='name'){\r\n//$sql.=\" and b.name like '%\".$keys.\"%'\";\r\n//}\r\n\t\t$sql = \"select * from \".AGENT_TOTAL_TABLE.\" where id>0\";\r\n\t\t\tif($status>-1){\r\n\t\t\t\t$sql.=\" and status ='\".$status.\"'\";\r\n\t\t\t}\r\n\t\t\tif($year>0){\r\n\t\t\t\t$sql.=\" and year ='\".$year.\"'\";\r\n\t\t\t}\r\n\t\t\tif($month>0){\r\n\t\t\t\t$sql.=\" and month ='\".$month.\"'\";\r\n\t\t\t}\r\n\t\t\tif($userid>0){\r\n\t\t\t\t$sql.=\" and agent_userid ='\".$userid.\"'\";\r\n\t\t\t}\r\n\t\t$sql.=\" order by id desc\";\r\n//\t\techo $sql;\r\n\t\t$pager = get_pager_data($db, $sql, $page,$per);\r\n\t\treturn $pager;\r\n\t}", "public function getUsers($userid=''){\n $this->db->select($this->users.'.*');\n $this->db->select($this->address.'.address,country,latitude,longitude,map_address');\n $this->db->select($this->plan.'.name as plan_name,amount as plan_amount');\n $this->db->select($this->role.'.role as role_name');\n $this->db->select($this->offers.'.offer_name,description as offer_description ,discount_amount as offer_discount_amount ,discount_percentage as offer_discount_percentage,from_date as plan_from_date,to_date as plan_to_date');\n $this->db->select($this->industry.'.id as indusctryId');\n $this->db->select($this->industry.'.name as indusctryName');\n\n $this->db->from($this->users);\n $this->db->join($this->plan,$this->plan.'.id='.$this->users.'.plan_id','left');\n $this->db->join($this->role,$this->role.'.id='.$this->users.'.role','left');\n $this->db->join($this->offers,$this->offers.'.id='.$this->users.'.offer_id','left');\n $this->db->join($this->industry,$this->industry.'.id='.$this->users.'.industry_id','left');\n $this->db->join($this->address,$this->address.'.user_id='.$this->users.'.id','right');\n \n \n $this->db->where($this->users.'.delete', 0);\n if(!empty($userid)){\n $this->db->where($this->users.'.id',$userid);\n }\n\n\n $query = $this->db->get();\n // echo $this->db->last_query(); die;\n\n if($query->num_rows()>0){\n if(!empty($userid)){\n return $query->row();\n }else{\n return $query->result_array();\n }\n }else{\n return False;\n }\n\n }", "function get_user_latest_search_info($loginUserId){\n $sql = \"SELECT u.userId,u.firstName,u.lastName,u.email,u.deleteFlag,u.sherpaSignedup,s.searchId,s.idealMovingDate,s.minPrice,s.maxPrice,s.minBedroom,s.maxBedroom \n FROM users u \n LEFT JOIN searchcriteria s ON u.userId = s.userId \n WHERE u.userId = $loginUserId AND u.deleteFlag != 1 \n GROUP BY s.searchId ORDER BY s.searchId DESC LIMIT 1;\n \";\n $result = $this->db->query($sql);\n if($result->num_rows()>0){\n return $result->result_array();\n }else{\n return false;\n }\n \n }", "function tutor_info_sql($userid,$verified,$specific_account = 1) {\n\t\t$sql = \"SELECT tutor_info.* FROM tutor_info,hod_info WHERE tutor_info.verified = '{$verified}' AND hod_info.user_id = '{$userid}' AND tutor_info.department = hod_info.department \";\n\t\tif($specific_account != 1){\n\t\t\t$sql .= \"AND tutor_info.user_id = '{$specific_account}' \";\n\t\t}\n\t\treturn $sql;\n\t}", "function getPersonalInboxQueries($connection,$userId,$inboxMessageSearch){\n $query = \"SELECT fpd.*,fu.name AS user_name,fu.profile_pic AS user_profile,fpd.datetime as posted_time FROM forum_personal_discussion fpd LEFT JOIN forum_users fu on fu.user_id=fpd.user_id WHERE fpd.person_id='$userId' \";\n\n // echo $query;\n if ($inboxMessageSearch){\n $query .= \" AND ( fpd.discussion_title LIKE '%{$inboxMessageSearch}%' OR fpd.message LIKE '%{$inboxMessageSearch}%' OR fu.name LIKE '%{$inboxMessageSearch}%') \";\n }\n $query .= ' ORDER BY datetime DESC';\n $result = $connection->query($query);\n return $result;\n }", "public function filter_books50($data){\n $query=$this->db->query('SELECT * FROM `user_books` INNER JOIN `users` ON `users`.`username` = `user_books`.`user_username` WHERE `availability`=\"1\" AND `cond` = \"'.$data['cond'].'\" AND `lang` = \"'.$data['lang'].'\" AND `users`.`user_region` = \"'.$data['region'].'\" AND NOT `user_username`= \"'.$data['username'].'\" ORDER BY `date_added` DESC LIMIT 150;');\n return $query->result();\n }", "public function filter_books10($data){\n $query=$this->db->query('SELECT * FROM `user_books` INNER JOIN `users` ON `users`.`username` = `user_books`.`user_username` WHERE `availability`=\"1\" AND `cond` = \"'.$data['cond'].'\" AND `lang` = \"'.$data['lang'].'\" AND `book_genre` = \"'.$data['book_genre'].'\" AND `users`.`user_region` = \"'.$data['region'].'\" AND NOT `user_username`= \"'.$data['username'].'\" ORDER BY `date_added` DESC LIMIT 150;');\n return $query->result();\n }", "static function advancedSearchUser($user = null, $operator = 'AND', $order = 'id', $begin = 0)\r\n {\r\n if ($user === null)\r\n {\r\n return null;\r\n }\r\n\r\n $tableUser = DatabaseManager::getNameTable('TABLE_USER');\r\n $tableChurch = DatabaseManager::getNameTable('TABLE_CHURCH');\r\n\r\n $username = $user->getUsername();\r\n $type = $user->getType();\r\n $online = $user->getOffline();\r\n $user->getId() == 0 ? $id = '' : $id = $user->getId();\r\n\r\n if ($online == 'true')\r\n {\r\n $online = \"0\";\r\n }\r\n else\r\n {\r\n $online = \"\";\r\n }\r\n\r\n if ($type == '0')\r\n {\r\n $type = \"\";\r\n }\r\n else if ($type == '1')\r\n {\r\n $type = \"A\";\r\n }\r\n else if ($type == '2')\r\n {\r\n $type = \"G\";\r\n }\r\n\r\n $queryChurch = \"(\";\r\n $posibleChurch = $user->getIdChurch();\r\n\r\n if ($posibleChurch !== NULL) //If exist church\r\n {\r\n for ($i = 0; $i < sizeof($posibleChurch) - 1; $i++)\r\n {\r\n $queryChurch = $queryChurch . $posibleChurch[$i]->getId() . \",\";\r\n }\r\n\r\n $queryChurch = $queryChurch.$posibleChurch[sizeof($posibleChurch)-1]->getId(). \")\";\r\n $queryChurch = \"(c.id IN \" . $queryChurch . \")\";\r\n }\r\n\r\n $query = \"SELECT b.* FROM $tableUser AS b\r\n JOIN $tableChurch AS c ON b.idChurch = c.id\r\n WHERE b.id LIKE '%$id%' $operator\r\n b.type LIKE '%$type%' $operator\r\n b.username LIKE '%$username%' $operator \";\r\n\r\n if ($online !== '')\r\n {\r\n $query = $query . \"b.offline = $online $operator \";\r\n }\r\n\r\n if ($queryChurch != '(')\r\n {\r\n $query = $query . $queryChurch . \" \";\r\n }\r\n else\r\n {\r\n $query = $query . \"(c.id IN ())\" . \" \";\r\n }\r\n if ($order == 'username')\r\n {\r\n $query = $query . \" ORDER BY b.username\";\r\n }\r\n else if ($order == 'nameChurch')\r\n {\r\n $query = $query . \" ORDER BY c.name\";\r\n }\r\n else\r\n {\r\n $query = $query . \" ORDER BY b.id DESC\";\r\n }\r\n\r\n $query = $query. \" LIMIT \" . strval($begin * 10) . \", 11 \";\r\n\r\n $arrayUsers = DatabaseManager::multiFetchAssoc($query);\r\n $users = array();\r\n\r\n if ($arrayUsers !== NULL)\r\n {\r\n $i = 0;\r\n foreach ($arrayUsers as $user) \r\n {\r\n if ($i == 10)\r\n {\r\n continue;\r\n }\r\n\r\n $users[] = self::ArrayToUser($user);\r\n $i++;\r\n }\r\n\r\n return $users;\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }", "public function searchSuppliers($suppliername, $country, $city, $town) {\n\n $this->db->select('');\n $this->db->where('user_id !=', 1);\n if (!empty($suppliername))\n $this->db->like($suppliername);\n if (!empty($country))\n $this->db->where($country);\n if (!empty($city))\n $this->db->where($city);\n if (!empty($town))\n $this->db->where($town);\n\n $this->db->order_by('user_name', 'asc');\n\n $this->db->from('user');\n $this->db->join('country','user.country =country.id');\n $this->db->join('states','user.state =states.state_code');\n $this->db->join('tbl_categorydesign','user.user_id =tbl_categorydesign.uId');\n\n $query = $this->db->get();\n\n return $query->result();\n}", "function GetUserInfromation($userID=false,$languageID=false)\n\t{\n\t\t$this->db->query(\"select rp_users.userEmail,rp_user_details.userCompanyName from rp_users,rp_user_details where rp_users.userID='$userID' and rp_user_details.userID='$userID' and rp_users.userStatus='Active' and rp_user_details.languageID='$languageID'\");\n\t\treturn $qry->result();\n\t}", "function get_userdetails($value)\n {\n // return $query->result();\n $this->db->select('up.*,us.*,cn.*,st.*,ct.*');\n $this->db->from('users us');\n $this->db->join('address up', 'up.id=us.addressid', 'left');\n $this->db->join('countries cn', 'up.country=cn.id', 'left');\n $this->db->join('states st', 'st.s_id=up.state', 'left');\n $this->db->join('cities ct', 'up.city=ct.c_id', 'left');\n $this->db->where('us.id', $value);\n $result = $this->db->get()->result();\n return $result;\n }", "public function getAllUserProfiles() {\n $gender = $this->session->userdata('key_gender');\n extract($_GET);\n //print_r($_GET);\n $result = $this->Searchbyprofileid_model->getAllUserProfiles($gender);\n if (!$result) {\n echo '500';\n } else {\n print_r(json_encode($result));\n }\n }", "function hod_info_sql($userid,$verified,$specific_account = 1) {\n\t\t$sql = \"SELECT hod_info.* FROM hod_info WHERE hod_info.verified = '{$verified}' \";\n\t\tif($specific_account != 1){\n\t\t\t$sql .= \"AND hod_info.user_id = '{$specific_account}' \";\n\t\t}\n\t\treturn $sql;\n\t}", "function userRequestFetch(){\n\n $userRequest=mysql_query(\"SELECT user,friend FROM Friend\n WHERE user=(SELECT user_id FROM Account WHERE user_email='$_SESSION[user_email]')\n AND friend=(SELECT user_id FROM Account WHERE user_email='$_SESSION[friend_email]')\") \n or die(\"<p>user request failed.</p>\");\n\n $userRequestFetch=mysql_fetch_array($userRequest);\n\n return $userRequestFetch;\n }", "function suchPerson($muster) {\n //$pre = ($_SESSION[\"preon\"])?\"%\":\"\"; //wiederspricht sich mit der Zeile danach\n $pre = isset($muster[\"pre\"])?$_SESSION[\"pre\"]:\"\";\n $fuzzy=$muster[\"fuzzy\"];\n $andor = $muster[\"andor\"];\n $rechte=berechtigung(\"cp_\");\n\n $joinCustomer = \" left join customer K on C.cp_cv_id=K.id\";\n $joinVendor = \" left join vendor V on C.cp_cv_id=V.id\";\n if ($muster[\"cp_name\"]==\"~\") {\n $where=\"and upper(cp_name) ~ '^\\[^A-Z\\].*$'\";\n } else {\n $dbf = array(\"cp_name\", \"cp_givenname\", \"cp_gender\", \"cp_title\" ,\n \"cp_street\", \"cp_zipcode\", \"cp_city\", \"cp_country\", \"country\",\n \"cp_phone1\", \"cp_fax\", \"cp_homepage\", \"cp_email\",\n \"cp_notes\", \"cp_stichwort1\",\"cp_birthday\", \"cp_beziehung\",\n \"cp_abteilung\", \"cp_position\", \"cp_cv_id\", \"cp_owener\");\n $keys=array_keys($muster);\n $anzahl=count($keys);\n $where=\"\";\n if ( isset( $muster[\"customer_name\"] ) ) {\n $whereCustomer = \"K.name ilike '$pre\" . $muster[\"customer_name\"] . \"$fuzzy'\";\n $whereVendor = \"V.name ilike '$pre\" . $muster[\"customer_name\"] . \"$fuzzy'\";\n } else {\n $whereCustomer = '1=1';\n $whereVendor = '1=1';\n }\n\n $daten=false;\n $tbl0=false;\n\n $where = array();\n for ($i=0; $i<$anzahl; $i++) {\n if (in_array($keys[$i],$dbf) && $muster[$keys[$i]]) {\n $suchwort=trim($muster[$keys[$i]]);\n $suchwort=strtr($suchwort,\"*?\",\"%_\");\n if ($keys[$i]==\"cp_birthday\") {$d=explode(\"\\.\",$suchwort); $suchwort=$d[2].\"-\".$d[1].\"-\".$d[0]; };\n if ($keys[$i]==\"cp_phone1\") {\n //Telefonnummer in beliebigen Telefonfeld suchen.\n $tmp =\"(cp_phone1 like '\".$pre.$suchwort.\"$fuzzy' \";\n $tmp .=\"or cp_phone2 like '\".$pre.$suchwort.\"$fuzzy' \";\n $tmp .=\"or cp_mobile1 like '\".$pre.$suchwort.\"$fuzzy' \";\n $tmp .=\"or cp_mobile2 like '\".$pre.$suchwort.\"$fuzzy' \";\n $tmp .=\"or cp_satphone like '\".$pre.$suchwort.\"$fuzzy')\";\n $where[] = $tmp;\n } else {\n $where[].=$keys[$i].\" ilike '\".$pre.$suchwort.\"$fuzzy'\";\n }\n }\n }\n $where = implode (\" $andor \",$where);\n $x=0;\n }\n $felderContact=\"C.cp_id, C.cp_cv_id, C.cp_title, C.cp_name, C.cp_givenname, C.cp_fax, C.cp_email, C.cp_gender as cp_gender\";\n $felderContcatOrCustomerVendor=\"COALESCE (C.cp_country, country) as cp_country,COALESCE (C.cp_zipcode, zipcode) as cp_zipcode,\n COALESCE (C.cp_city, city) as cp_city, COALESCE (C.cp_street, street) as cp_street,\n COALESCE (NULLIF (C.cp_phone1, ''), NULLIF (C.cp_mobile1, ''), phone) as cp_phone1\";\n\n\n $rs0=array(); //leere arrays initialisieren, damit es keinen fehler bei der funktion array_merge gibt\n if ($muster[\"customer\"]){ //auf checkbox customer mit Titel Kunden prüfen\n $sql0=\"select $felderContact, $felderContcatOrCustomerVendor, K.name as name, K.language_id as language_id,\n 'C' as tbl from contacts C$joinCustomer where C.cp_cv_id=K.id and ($whereCustomer $andor $where) and $rechte order by cp_name\";\n $rs0=$GLOBALS['dbh']->getAll($sql0);\n if (!$rs0) $rs0=array();\n }\n $rs1=array(); //s.o.\n if ($muster[\"vendor\"]){ //auf checkbox vendor mit Titel Lieferant prüfen\n $sql0=\"select $felderContact, $felderContcatOrCustomerVendor, V.name as name, V.language_id as language_id, 'V' as tbl\n from contacts C$joinVendor where C.cp_cv_id=V.id and ($whereVendor $andor $where) and $rechte order by cp_name\";\n $rs1=$GLOBALS['dbh']->getAll($sql0);\n if (!$rs1) $rs1=array();\n }\n $rs2=array(); //s.o.\n if ( isset( $muster[\"deleted\"] ) ) { //auf checkbox deleted mit Titel \"gelöschte Ansprechpartner (Kunden und Lieferanten)\" prüfen\n // es gibt nicht nur gelöschte Personen, sonder auch Personen ohne Zuordnung zu Firmen, z.B. private Adressen\n $sql0=\"select $felderContact, C.cp_country, C.cp_zipcode, C.cp_city, C.cp_street, C.cp_phone1,\n '' as name,'P' as tbl from contacts C where $rechte and (\".$where.\") and C.cp_cv_id is null order by cp_name\";\n $rs2=$GLOBALS['dbh']->getAll($sql0);\n if (!$rs2) $rs2=array();\n }\n return array_merge($rs0,$rs1,$rs2); //alle ergebnisse zusammenziehen und zurückgeben\n}", "public function listbooking($user=\"\") {\n \t$this->db->select('rumah.*, booking.*');\n\t\t$this->db->from('rumah');\n\t\t$this->db->where('rumah.user', $user);\n\t\t$this->db->join('users','users.id = rumah.user','right');\n\t\t$this->db->join('booking','booking.rumah = rumah.id','right');\n\t\t$this->db->order_by('rumah.id','desc');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array(); \n }", "function make_query($logged_person){\n $table_name = \"LogInTable\"; \n $sql = \"SELECT * FROM $table_name WHERE \";\n \n //attributes \n $value = $logged_person->funcitional_query(\"account\",$logged_person->account);\n $sql .= $value.\" and \"; \n \n $value = $logged_person->funcitional_query(\"research_group\", $logged_person->research_group);\n $sql .= $value.\" and \"; \n\n $value = $logged_person->funcitional_query(\"password\", $logged_person->password);\n $sql .= $value.\" \"; \n \n return $sql; \n }", "function get_all_genders()\n\t\t{\n\t\t\t$query=\"SELECT * from tbl_gender\";\n\t\t\t$result = execute_query($query);\n\t\t\treturn new readonlyresultset($result);\n\t\t}", "function company_following_user_query( $company_id=\"\", $following_type='', $user_id, $current_user_id=\"\", $short_type='' )\n\t{\n\t\t//echo $current_user_id.\"<br>\";\n\t\t$sql = \"SELECT UFC.id, UFC.user_id, UFC.company_id, UFC.following_date, UFC.following_type, UFC.user_id AS next_user_id,\n\t\t\t\tU.users_firstname, U.users_lastname, \n\t\t\t\tIF(U.users_profilepic IS NULL OR U.users_profilepic = '', 'no-image.png', U.users_profilepic)AS users_profilepic,\n\t\t\t\tfnStripTags(U.users_bio) AS users_bio, IF(U.users_phone IS NULL OR U.users_phone = '', 'N/A', U.users_phone) AS users_phone, U.users_current_employer,U.users_current_title,\n\t\t\t\thia_cities.name AS city_name, hia_states.name AS state_name, hia_countries.name AS country_name,\n\t\t\t\tUCV.company_id AS viewing_company_id, UCV.id AS viewing_id, UCV.viewing_date AS max_view_date\n\t\t\t\tFROM hia_user_following_company AS UFC\n\t\t\t\tJOIN hia_users AS U ON( UFC.user_id = U.users_id )\n\t\t\t\tLEFT JOIN hia_cities ON (U.users_city = hia_cities.id)\n\t\t\t\tLEFT JOIN hia_states ON (U.users_state = hia_states.id)\n\t\t\t\tLEFT JOIN hia_countries ON (U.users_country = hia_countries.id)\n\t\t\t\tLEFT JOIN \n\t\t\t\t\t(\n\t\t\t\t\t\tSELECT id, user_id, company_id, viewing_type, MAX(viewing_date) AS viewing_date \n\t\t\t\t\t\tFROM hia_user_view_company WHERE company_id = '$company_id' AND viewing_type = 'company'\n\t\t\t\t\t\tGROUP BY user_id\n\t\t\t\t\t\t\n\t\t\t\t\t) UCV ON (U.users_id = UCV.user_id AND UCV.company_id = '$company_id' )\n\t\t\t\tWHERE U.users_type != '3'\n\t\t\t\tAND U.users_status != '1'\n\t\t\t\tAND U.company_type != '1' \";\n\n\t\tif ($following_type != \"\") {\n\t\t\t$sql.= \" AND UFC.following_type = '$following_type' \";\n\t\t}\n\t\t\t\t\n\t\tif ($user_id != \"\") {\n\t\t\t$sql.= \" AND UFC.user_id = '$user_id' \";\n\t\t}\n\t\t\t\t\n\t\tif ($company_id != \"\") {\n\t\t\t$sql.= \" AND UFC.company_id = '$company_id' \";\n\t\t}\n\t\tif ($current_user_id != \"\" && $short_type =='next') {\n\t\t\t$sql.= \" AND UFC.user_id > '$current_user_id' \";\n\t\t}\n\t\tif ($current_user_id != \"\" && $short_type =='prev') {\n\t\t\t$sql.= \" AND UFC.user_id < '$current_user_id' \";\n\t\t}\n\t\t\n\n\t\tif ( $short_type=='prev') {\n\t\t\t$sql.= \" ORDER BY UFC.user_id DESC \";\n\t\t}\n\t\telse {\n\t\t\t$sql.= \" ORDER BY UFC.user_id ASC \";\n\t\t}\n\t\t//echo $sql;exit;\n\n\t\tif ( ! $this->db->simple_query($sql))\n\t\t{\n\t\t\t$error = $this->db->error();\n\t\t\t//print_r($error);\n\t\t\t//exit();\n\t\t\treturn $error;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = $this->db->query($sql);\n\t\t\t\n\t\t\treturn $query->result_array();\n\t\t}\n\t\t\n\t}", "public function getUserDetails() {\n $usersDetails = $this->db->prepare(\n 'SELECT \n `us`.`lastname`\n ,`us`.`firstname`\n ,DATE_FORMAT(`pat`.`birthDate`, \\'%d/%m/%Y\\') AS `birthDateFr` \n ,`pat`.`birthDate`\n ,`pat`.`phoneNumbers`\n ,`us`.`mail`\n FROM \n `dom20_users` as `us`\n INNER JOIN \n `dom20_patients` AS `pat`\n ON `us`.`id` = `pat`.`id_dom20_users`\n WHERE\n `us`.`id` = :id \n ');\n $usersDetails->bindValue(':id', $this->id, PDO::PARAM_INT);\n $usersDetails->execute();\n return $usersDetails->fetch(PDO::FETCH_OBJ);\n \n }", "function getDetail($memberID, $query) {\r\n $completeQuery = \"SELECT $query FROM USER LEFT JOIN BUSINESS on USER.businessID=BUSINESS.businessID WHERE USER.UserID='$memberID'\";\r\n $sql = $this->db->prepare($completeQuery);\r\n if($sql->execute());\r\n return $sql->fetchall();\r\n return false;\r\n }", "function rel_cliente_ag(){\r\n\t\t$db = banco();\r\n\t\t\r\n\t\t$query =\"SELECT user.cod, user.name, user.cpf, cliente.fone, especialidade.nom_espec, consulta.dt_consul, consulta.aprovado, consulta.presente\r\n\t\t\t\tFROM user, cliente, consulta, especialidade\r\n\t\t\t\tWHERE user.cod = cliente.cod_clien AND\r\n\t\t\t\t\t user.cod = consulta.cod_clien AND\r\n\t\t\t\t\t consulta.cd_esp = especialidade.cod_espec\r\n\t\t\t\t\t \r\n\t\t\t\t\";\r\n\t\t$row = $db->query($query);\r\n\t\t$db->close();\r\n\t\treturn $row;\t\r\n\t}", "function allusers($condition=\"\")\n\t{ \n\t // $sql = \"select gene_user_id,gene_generation,gene_name,gene_surname,gene_sex,gene_birthday,gene_deathday from tab_gene_user\";\n\t\t$sql = \"select * from tab_gene_user\";\n\t\tif($condition)\n\t\t{\n\t\t\t$sql .=\" \".\"WHERE\".\" \".\"LastModifiedTime > '$condition'\";\n\t\t\t\n\t\t}\n\t\t$res = $this->db->readValues($sql); \n\t\tif(count($res)> 0 )\n\t\t{\n return $res;\n\t\t}\n\t}", "public function filter_books30($data){\n $query=$this->db->query('SELECT * FROM `user_books` INNER JOIN `users` ON `users`.`username` = `user_books`.`user_username` WHERE `availability`=\"1\" AND `lang` = \"'.$data['lang'].'\" AND `book_genre` = \"'.$data['book_genre'].'\" AND `users`.`user_region` = \"'.$data['region'].'\" AND NOT `user_username`= \"'.$data['username'].'\" ORDER BY `date_added` DESC LIMIT 150;');\n return $query->result();\n }", "function student_info_sql($userid,$verified,$specific_account = 1) {\n\t\t$sql = \"SELECT student_info.course as department,student_info.* FROM student_info,tutor_info WHERE student_info.verified = '{$verified}' AND tutor_info.user_id = '{$userid}' AND tutor_info.department = student_info.course AND tutor_info.semester = student_info.semester \";\n\t\tif($specific_account != 1){\n\t\t\t$sql .= \"AND student_info.user_id = '{$specific_account}' \";\n\t\t}\n\t\treturn $sql;\n\t}", "function mentor_list($limit='',$start=0,$condition='')\n{\n\tglobal $DB;\n\t$sql =\"SELECT u.id,u.firstname,u.lastname,u.email,u.city,u.picture,u.department FROM {user} u left join {user_info_data} ud on ud.userid=u.id \";\n\t$sql.=\"WHERE ud.data='mentor data' and ud.acceptterms=1 and u.deleted=0 $condition order by u.timemodified desc limit $start,$limit\";\n\t//echo $sql;die;\n\t$result = $DB->get_records_sql($sql);\n\tif(count($result)>0){\n\t\tforeach($result as $mentordata)\n\t\t{\n\t\t\t$user = new stdClass();\n\t\t\t$user->id = $mentordata->id;\n\t\t\t//$picture = get_userprofilepic($user);\n\t\t\t$userurl = getuser_profilelink($user->id);\n\t\t\t$usrimg = get_userprofilepic($user);\n\t\t\t$picture ='<div class=\"left picture\"><a href=\"'.$userurl.'\" >'.$usrimg.'</a></div>'; \n\t\t\t$mentordata->picture = $picture;\n\t\t}\n\t}\n\treturn $result;\n}", "function get_people($selected_country)\n \n {\n\t\n\t//$query = $this->db->query(\"SELECT*FROM person WHERE countryid =$selected_country\" );\n\t\n\t$data = array();\n\t\n\t$query = $this->db->get_where('person', array('countryid' => $selected_country));\n\t\n\tforeach($query-> result_array() as $row)\n\t\n\t {\n\t $data[] = $row;\n\t /*\n\t echo $row->name.'<br>';\n\t echo $row->description .'<br>';\n\t echo $row->wlink .'<br>';\n\t */\n\t }\n\t\n\treturn $data;\n\t\n\t}", "public function get_claimed_data($params = \"\" , $page = \"all\")\n {\n\n $this->db->select(\"user_id, username, first_name, last_name, email, address, created\")->from( $this->tableName);\n $this->db->join('user_profiles', 'user_profiles.user_id = users.id');\n $this->db->where ('has_claimed', '1');\n \n $query = '';\n $result = array();\n \n if (!empty($params))\n {\n //echo \"1\";\n if ( (($params [\"num_rows\"] * $params [\"page\"]) >= 0 && $params [\"num_rows\"] > 0))\n {\n //echo \"2\";\n if ($params [\"search\"] === TRUE)\n {\n //echo \"3\";\n $ops = array (\n\n \"eq\" => \"=\",\n \"ne\" => \"<>\",\n \"lt\" => \"<\",\n \"le\" => \"<=\",\n \"gt\" => \">\",\n \"ge\" => \">=\"\n );\n\n }\n\n if ( !empty ($params['search_field_1']))\n {\n $this->db->where ($params['search_field_1'], $params['user_id']);\n }\n\n if ( !empty ($params['search_field_2']))\n {\n $this->db->where ($params['search_field_2'], \"1\");\n }\n\n //$this->db->order_by( \"{$params['sort_by']}\", $params [\"sort_direction\"] );\n\n if ($page != \"all\")\n {\n $this->db->limit ($params [\"num_rows\"], $params [\"num_rows\"] * ($params [\"page\"] - 1) );\n }\n\n $query = $this->db->get();\n $result = $query->result_array();\n }\n }\n else\n {\n $this->db->limit (5);\n $query = $this->db->get ($this->_table);\n $result = $query->result_array();\n \n }\n \n return $result;\n }", "public function getinteresteduser($uid)\n{\n $this->db->select(\"job_like_staff.*,jobs.job_title,jobs.map_address,users.first_name,users.last_name,users.image,staff_basicinfo.current_location\");\n $this->db->join(\"jobs\",\"job_like_staff.job_id=jobs.id\",\"left\");\n $this->db->join(\"users\",\"job_like_staff.user_id=users.id\",\"left\");\n $this->db->join(\"staff_basicinfo\",\"job_like_staff.user_id= staff_basicinfo.staff_id\",\"left\"); \n $this->db->where(\"job_like_staff.job_userid\",$uid); \n $this->db->group_by(\"job_like_staff.id\",\"desc\"); \n $this->db->order_by(\"job_like_staff.id\",\"desc\"); \n $result = $this->db->get('job_like_staff')->result(); \n return $result;\t\t\t\n}", "function user_digitalwalletfamily_info($user_id)\n {\n\t\t$select = array('intID', 'vchFamilyName', 'vchFamilyAddress', 'vchFamilyPhone', 'dt_Date');\n\t\t\n\t $this->db->select($select)->from('user_digitalwallet_family')->where('user_id', $user_id);\n\t $this->db->order_by('intID', 'desc');\n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\treturn $query->result_array();\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n }", "function list_get() {\n $user = $this->get('user');\n $fromdate = $this->get('fromdate');\n $todate = $this->get('todate');\n $status = $this->get('status');\n $role = $this->get('role');\n \n $condition = \" and order_id!=''\";\n $branch = $this->get('branch');\n if($branch != \"\") {\n if($role!=\"DEALER\")\n $condition .= \" and o.branch_id='$branch'\";\n }\n \n \n if(($status!= \"Received\" && $status!= \"Delivered\" && $status!= \"Rejected\" && $status!=\"rejected\") && ($role==\"DEALER\" || $role==\"SE\"))\n $condition .= \" and o.parent_order='0'\"; // and o.parent_order='0'\n \n if($role==\"DEALER\" && $user!=\"\")\n $condition .= \" and o.orderedby='$user'\"; // and o.parent_order='0'\n else if($role==\"SE\" && $user!=\"\") {\n \n $seller_info = \"\";\n //echo \"select GROUP_CONCAT(`seller`) as seller_info from branch_dealers where sales_manager='$user' and branch='$branch'\";\n $deal_query = $this->model_all->getTableDataFromQuery(\"select GROUP_CONCAT(`seller`) as seller_info from branch_dealers where sales_manager='$user' and branch='$branch'\");\n if($deal_query->num_rows()>0){\n $deal_rs = $deal_query->row();\n $seller_info = $deal_rs->seller_info;\n if($seller_info!=\"\"){\n $seller_info = trim($seller_info,\",\");\n $condition .= \" and (o.orderedby IN ($seller_info) or o.created_by='$user')\";\n \n }else{\n \n $condition .= \" and o.created_by='$user'\";\n }\n \n \n \n }else{\n $condition .= \" and o.created_by='$user'\";\n \n }\n \n \n \n }\n \n \n \n \n\n if ($status == \"Cancelled\") {\n $condition .= \" and o.status='Cancelled'\";\n } else if ($status == \"Ordered\") {\n $condition .= \" and o.status='Ordered'\";\n } else if ($status == \"Delivered\") {\n $condition .= \" and o.status='Delivered' and o.seller_accept='1' \"; // and delivery_recieved='1'\n } else if ($status == \"Received\") {\n $condition .= \" and o.status='Delivered' and o.dboy_accept='1'\";\n } else if ($status == \"Rejected\" || $status == \"rejected\") {\n $condition .= \" and o.status='Delivered' and o.delivery_reject='1'\";\n } else if ($status == \"Pending\") {\n $condition .= \" and o.status not in ('Cancelled','Delivered','Ordered')\";\n } else if ($status == \"track\") {\n $condition .= \" and o.status not in ('Cancelled')\";\n } else if ($status == \"Denied\") {\n $condition .= \" and ((o.fa_status='2') or (o.fa_status='1' and o.admin_status='2') or (o.fa_status='2' and o.admin_status='2'))\";\n } else if ($status == \"Dispatch_Reject\") {\n $condition .= \" and o.status='Rejected' and o.dboy_accept='2'\";\n } \n\n \n \n\n if ($fromdate != \"\" && $todate == \"\") {\n $fromdate = date(\"Y-m-d\", strtotime($fromdate));\n $condition .= \" and date(o.`orderedon`)='$fromdate'\";\n } else if ($fromdate != \"\" && $todate != \"\") {\n $fromdate = date(\"Y-m-d\", strtotime($fromdate));\n $todate = date(\"Y-m-d\", strtotime($todate));\n $condition .= \" and o.`orderedon` between '$fromdate 00:00:00' and '$todate 23:59:59'\";\n }\n\n \n \n\n $result_set = $this->model_all->getTableDataFromQuery(\"select o.id, o.order_id, o.orderedon, o.status, o.orderedby, o.created_by,o.order_value,o.payment_type,o.credit_date,s.id as dealer_id,s.company_name as dealer_name,o.parent_order from seller_orders o,sellers s where o.orderedby=s.id $condition order by o.orderedon desc\");\n \n if ($result_set->num_rows() > 0) {\n $result[\"status\"] = 1;\n $result[\"message\"] = \"Records Found\";\n $result[\"total_records\"] = $result_set->num_rows(); \n \n\n\n foreach ($result_set->result_array() as $row) {\n if($row[\"orderedby\"]!=$row[\"created_by\"]){\n\n $emp_qry = $this->model_all->getTableDataFromQuery(\"select e.first_name as emp_name,e.mobile,b.name as branch_name from employees e,branches b where e.branch=b.id and e.id='$row[created_by]'\");\n if($emp_qry->num_rows()>0){\n $emp_rs=$emp_qry->row();\n $row[\"takenby_name\"] = $emp_rs->emp_name;\n $row[\"takenby_branch\"] = $emp_rs->branch_name;\n $row[\"takenby_contact\"] = $emp_rs->mobile;\n }else{\n $row[\"takenby_name\"] = \"-\";\n $row[\"takenby_branch\"] = \"-\";\n $row[\"takenby_contact\"] = \"-\"; \n }\n \n }else{\n $row[\"takenby_name\"] = \"Self\";\n $row[\"takenby_branch\"] = \"-\";\n $row[\"takenby_contact\"] = \"-\"; \n }\n if($row['credit_date']!=\"\"){\n $row['credit_date'] = date(\"d-m-Y\", strtotime($row['credit_date']));\n } \n $row['orderedon'] = date(\"d-m-Y\", strtotime($row['orderedon']));\n $result[\"records\"][] = $row;\n }\n $this->response($result, 200);\n exit;\n } else {\n $result[\"status\"] = 0;\n $result[\"message\"] = \"No records Found\";\n $this->response($result, 200);\n exit;\n }\n }", "function get_user_join_gender($from=null, $to=null)\r\n {\r\n if($to ==null) $to =date('Y-m-d');\r\n if($from==null) $from=date('Y-m-d', strtotime(\"-1 week\", strtotime($to)));\r\n \r\n $printYear = ((int)(substr($from, 0, 4))<(int)(date('Y')))?true:false;\r\n\r\n $period = new DatePeriod(\r\n new DateTime($from),\r\n new DateInterval('P1D'),\r\n new DateTime($to)\r\n );\r\n\r\n $output = array(array('날짜', '남자', '여자'));\r\n $data = array();\r\n\r\n //query\r\n $sql = \"SELECT DATE_FORMAT(created, '%Y-%m-%d') as joined,\r\n SUM(case when gender = 'm' then 1 else 0 end) as gender_m_count, \r\n SUM(case when gender = 'f' then 1 else 0 end) as gender_f_count, \r\n count(user_id) as user_count\r\n from users \r\n left join user_profiles on users.id = user_profiles.user_id \r\n WHERE activated =? and created between ? and ?\r\n group by joined\"; \r\n $query = $this->db->query($sql, array(1, $from, $to, $from, $to));\r\n foreach ($query->result() as $row)\r\n {\r\n $data[$row->joined] = array(round($row->gender_f_count*100/$row->user_count), round($row->gender_m_count*100/$row->user_count));\r\n }\r\n\r\n $i = 1;\r\n foreach ($period as $date) {\r\n $output[$i] = array($date->format((($printYear)?'Y년 ':'').' m월 d일'), isset($data[$date->format('Y-m-d')][0])?$data[$date->format('Y-m-d')][0]:0, isset($data[$date->format('Y-m-d')][1])?$data[$date->format('Y-m-d')][1]:0);\r\n $i++;\r\n }\r\n\r\n return $output; \r\n /*\r\n //---- dummy data\r\n $dateNum = floor((strtotime($to)-strtotime($from))/86400)+1;\r\n $output = array(array('날짜' , '남자', '여자'));\r\n if($dateNum>0){\r\n for($i=1;$i<=$dateNum;$i++){\r\n $date = date(\"m월 d일\",strtotime(($i-$dateNum).\" day\", strtotime($to)));\r\n $num1 = rand(0, 70);\r\n $num2 = 100 - $num1;\r\n $output[$i] = array($date, $num1, $num2);\r\n }\r\n }\r\n return $output;*/\r\n }", "function user($id){\n \n \n$db = new Database();\n$db->connect();\n\n$db->select(\"user\",'*',null,'id_user ='.$id); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$res = $db->getResult();\n\nforeach($res as $x => $x_value){\n /****************************/\n$id_nationality=$x_value[\"id_nationality\"];\n$db->select(\"nationalities\",'*',null,'id_nationalities='.$id_nationality); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$nationalities = $db->getResult();\n $res[0][\"id_nationality\"]=$nationalities[0];\n\n /*************************/\n $id_rules=$x_value[\"id_rules\"];\n$db->select(\"rules\",'*',null,'id_rules='.$id_rules); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$rules = $db->getResult();\n $res[0][\"id_rules\"]=$rules[0];\n\n\n\n /********************************/\n $id_direct_manger=$x_value[\"id_direct_manger\"];\n$db->select(\"user\",'*',null,'id_user='.$id_direct_manger); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$direct = $db->getResult();\n $name_user=$direct[0][\"f_name_user\"].\" \".$direct[0][\"m_name_user\"].\" \".$direct[0][\"l_name_user\"];\n $res[0][\"id_direct_manger\"]=$name_user;\n\n\n /***************************************/\n $id_payroll_groups=$x_value[\"id_payroll_groups\"];\n$db->select(\"payroll_groups\",'*',null,'id_payroll_groups='.$id_payroll_groups); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$payroll_groups = $db->getResult();\n$res[0][\"payroll_groups\"]=$payroll_groups[0];\n\n$db->select(\"pay_grou_valu\",'*',null,'id_payroll_groups='.$id_payroll_groups); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$pay_grou_valu = $db->getResult();\n$res[0][\"payroll_groups\"]=$pay_grou_valu;\n\n\nforeach($pay_grou_valu as $xx => $x_valuee)\n {\n $db->select(\"payroll_value\",'*',null,'id_payroll_value='.$res[0][\"payroll_groups\"][$xx][\"id_payroll_value\"]); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$payroll_value = $db->getResult();\n//echo $xx;\n $res[0][\"payroll_groups\"][$xx][\"id_payroll_value\"]=$payroll_value[0];\n\n }\n\n\n\n\n\n\n\n\n /***************************************/\n\n $id_categories=$x_value[\"id_categories\"];\n$db->select(\"categories\",'*',null,'id_categories='.$id_categories); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$categories = $db->getResult();\n $res[0][\"id_categories\"]=$categories[0];\n\n /***************************************/\n\n $id_departments=$x_value[\"id_departments\"];\n$db->select(\"departments\",'*',null,'id_departments='.$id_departments); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$departments = $db->getResult();\n $res[0][\"id_departments\"]=$departments[0];\n\n /***************************************/\n\n $id_positions=$x_value[\"id_positions\"];\n$db->select(\"positions\",'*',null,'id_positions='.$id_positions); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$positions = $db->getResult();\n$res[0][\"id_positions\"]=$positions[0];\n//echo '<pre>';\n//print_r($res[0]);\n//echo '<pre>';\n /***************************************/\n\n $id_user=$x_value[\"id_user\"];\n\n$db->select(\"attendance\",'*',null,'user_id='.$id_user); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$attendance = $db->getResult();\n$res[0][\"attendance\"]=$attendance;\n\n\n/***************************************/\n\n$db->select(\"pr_user_insurance\",'*',null,'id_user='.$id_user); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$pr_user_insurance = $db->getResult();\n\nforeach ($pr_user_insurance as $key => $valu){\n $valu[\"id_insurance\"];\n\n $db->select(\"insurance_setup\",'*',null,\"`name_insurance`='\".$valu[\"id_insurance\"].\"'\"); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$insurance_setup = $db->getResult();\n//echo $xx;\n $res[0][\"insurance\"][$key]=$insurance_setup[0];\n\n};\n\n/*************************/\n$db->select(\"pr_user_languages\",'*',null,'id_user='.$id_user); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$pr_user_languages = $db->getResult();\n$i=0;\nforeach ($pr_user_languages as $key => $valu){\n $valu[\"id_languages\"];\n\n $db->select(\"languages\",'*',null,\"`name_languages`='\".$valu[\"id_languages\"].\"'\"); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$languages = $db->getResult();\n//echo $xx;\n $res[0][\"languages\"][$key]=$languages[0];\n\n};\n\n/*************************/\n$db->select(\"pr_user_licenes\",'*',null,'id_user='.$id_user); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$pr_user_licenes = $db->getResult();\n$i=0;\nforeach ($pr_user_licenes as $key => $valu){\n $valu[\"id_licenes\"];\n $db->select(\"licenses\",'*',null,\"`name_licenses`='\".$valu[\"id_licenes\"].\"'\"); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$licenes = $db->getResult();\n//echo $xx;\n $res[0][\"licenses\"][$key]=$licenes[0];\n\n};\n\n/*************************/\n$db->select(\"pr_user_skills\",'*',null,'id_user='.$id_user); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$pr_user_skills = $db->getResult();\n$i=0;\nforeach ($pr_user_skills as $key => $valu){\n $valu[\"id_skills\"];\n $db->select(\"skills\",'*',null,\"`name_skills`='\".$valu[\"id_skills\"].\"'\"); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$skills = $db->getResult();\n//echo $xx;\n $res[0][\"skills\"][$key]=$skills[0];\n\n};\n\n/*************************/\n$db->select(\"pr_user_tax\",'*',null,'id_user='.$id_user); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$pr_user_tax = $db->getResult();\n$i=0;\nforeach ($pr_user_tax as $key => $valu){\n $valu[\"id_tax\"];\n\n\n $db->select(\"tax\",'*',null,\"`name_tax`='\".$valu[\"id_tax\"].\"'\"); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$tax = $db->getResult();\n//echo $xx;\n $res[0][\"tax\"][$key]=$tax[0];\n\n};\n/*************************/\n$db->select(\"pr_user_leaves\",'*',null,'id_user='.$id_user); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$pr_user_leaves = $db->getResult();\n$i=0;\nforeach ($pr_user_leaves as $key => $valu){\n $valu[\"id_leaves\"];\n\n $db->select(\"leaves_rules\",'*',null,\"`name`='\".$valu[\"id_leaves\"].\"'\"); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$leaves = $db->getResult();\n//echo $xx;\n $res[0][\"leaves\"][$key]=$leaves[0];\n $leaves[0][\"name\"];\n\n $db->select(\"my_leaves\",'*',null,\"`id_leaves`='\".$leaves[0][\"name\"].\"' AND `id_user`='\".$res[0][\"id_user\"].\"'\"); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$my_leaves = $db->getResult();\nforeach ($my_leaves as $keys => $valus){\n\n $res[0][\"leaves\"][$key][\"my_leaves\"][$keys]=$valus;\n\n}\n};\n\n\n\n\n\n\n}\n\n\n\n $return=$res[0];\nreturn $return;\n\n \n \n\n \n}", "function find_all_user(){\n global $db;\n $results = array();\n $sql = \"SELECT u.id,u.clave,u.nivel_usuario,u.status,u.ultimo_login,u.name,u.IdDepartamento,\";\n $sql .=\"g.group_name \";\n $sql .=\"FROM users u \";\n $sql .=\"LEFT JOIN user_groups g \";\n $sql .=\"ON g.group_level=u.nivel_usuario ORDER BY u.clave ASC\";\n $result = find_by_sql($sql);\n return $result;\n}", "function search_user(){\n\t\trequire_once(\"dbconnection.php\");\n\t\t$obj=new dbconnection();\n\t\t$con=$obj->getcon();\n\t\t\n\t\t\n\t\t$dbh=$obj->get_pod();\n\n\t\t$search_by = $_POST['search_by'];\n\n\t\t$sqlget = \"SELECT * FROM users WHERE uname='$search_by';\";\n\t\t$resultget = mysqli_query($con,$sqlget) or die(\"SQL Error : \".mysqli_error($con));\n\t\t$recget= mysqli_fetch_assoc($resultget);\n\n\t\techo json_encode($recget);\n\t\t\n\t}", "function get_by_gender() {\n return $this->mysqli->query(\"SELECT * FROM `product_variations` JOIN `products` on `product_variations`.`product_id` = `products`.`product_id` WHERE 1 ORDER BY `gender`, `price` ASC\");\n }", "function query_select_address($userId) {\n global $connection;\n\n //construct query:\n $query = \"SELECT street, zip, city, country FROM address \";\n $query .= \"WHERE user_id={$userId}; \";\n\n $result = mysqli_query($connection, $query);\n\n if($result) {\n return mysqli_fetch_assoc($result);\n } else {\n return 0;\n }\n}", "function pass_book_list($where=\"1\",$where_array,$sort_by=\"\"){\n\t\t$data= $this->select_query(\"money_in_out a,transaction_type b,transaction_from c,users e \",\"a.id,a.trans_from,a.trans_for_id,a.amount,a.balance,a.created_datetime,e.name,e.user_name,c.name as from_name,b.name as t_type,a.trans_type\",\"a.trans_type=b.id and a.trans_from=c.id and a.created_by=e.id and \".$where,$where_array,$sort_by);\n\t\treturn $data;\n\t}", "public function get_all_alamat(){\n \n\t$query = $this->db->query(\"select *,case when gender = '1' then 'Pria' else 'Wanita' end as genderstatus,date_format(start_date,'%d %M %Y') as tanggalmasuknya from human_pa_md_emp_personal order by personnel_id asc\");\n\n \treturn $query;\n\t}", "function getAllBookings($userID){\n $query = $this->db->query(\"SELECT bookings.*,buildings.name as buildingName, buildings.id as buildingID ,rooms.name as roomName,rooms.floorNumber , rooms.type from bookings join rooms on rooms.roomId = bookings.roomID join buildings on buildings.id = rooms.buildingId where userID = $userID\");\n\n if($query->num_rows()>0)\n {\n $response['status'] = 'success';\n $response['data']=$this->getParticipantsForMeetings($query->result_array());\n }\n else\n {\n $response['status'] = 'failure';\n $response['code'] = 'database failure';\n\n }\n return $response;\n }", "function getSearchAllAuction($id_user, $link) {\n $query = \"\n select * \n from auctions \n where \n id_user != '\" . mysql_real_escape_string($id_user) . \"' and \n id_auction not in (\n select id_auction \n from auction_follow \n where id_user = '\" . mysql_real_escape_string($id_user) . \"'\n\t\t \n )\n \";\n\n $result = selectBD($query, $link);\n return $result;\n}", "function friendFetch(){\n\n $friend=mysql_query(\"SELECT user_firstname,user_surname,user_birthday,user_gender,user_study,user_work,user_email FROM User,Account\n WHERE User.user_id=(SELECT user_id FROM Account WHERE user_email='$_SESSION[friend_email]')\n AND user_email='$_SESSION[friend_email]'\") or die(\"<p>Friend fetch failed.</p>\");\n\n $friendFetch=mysql_fetch_array($friend);\n\n return $friendFetch;\n}", "public function user_detail($userid)\r\n {\r\n\t$this->db->select('user.first_name,user.last_name,user.emailid,user.phone,user.fax,user.userid,user.storeid,user.isactive,user.notify,user.updated_on,division.store_name,division.division_type,user.ismanage_product,division.divisionid,user.password,division.regionid');\r\n\t\t$this->db->from('user,division,user_division');\r\n\t\t$this->db->where('(user.userid=user_division.userid)');\r\n\t\t$this->db->where('(user.storeid=division.storeid)');\r\n\t\t$this->db->where('(division.divisionid=user_division.divisionid)');\t\r\n\t $this->db->where('user.userid', $userid);\r\n\t\t//$this->db->where('user_division.isdefault', 1);\t\t\r\n $query = $this->db->get();\r\n\t\t//echo $str = $this->db->last_query();\r\n\t\treturn $query->result_array();\t\r\n\t\t\r\n }", "function getVendors(){\n $datarow = NULL;\n try\n {\n $db = new Database();\n $db->connect();\n \n $sql = \"SELECT userid,firstname,lastname,category,categorycode,phonenumber,email,agebracket,country,countrycode,gender,town,userstatus,xikilaaccount,bancoaccount,wantbancoaccount,creationdate FROM registration \".\n \"where userstatus=:userstatus\";\n $params = array(\":userstatus\" => 1);\n $results = $db->runSelect($sql,$params);\n \n if ($results != null){\n $datarow = $results;\n }\t\t\n }\n catch(PDOException $ex) {\n echo $ex->getMessage();\n }\n return $datarow;\n }", "public function queryUsuario($value) {\n $sql = 'select \n a.email, \n b.id,\n b.gender, \n b.mailing_address,\n b.year_of_birth, \n b.level_of_education,\n b.country\n from auth_user a, auth_userprofile b \n where a.email = ? \n and a.id = b.user_id;';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->set($value);\n\t\t$result = QueryExecutor::execute($sqlQuery);\n return $result; \n }", "public function select_totalpaid_payments_u_users(){\n\n\n$sql = \"SELECT payments.id,payments.date,SUM(payments.amount) AS 'amount',\npayments.payment_method,payments.member_id,users.name,users.member_id\nFROM payments \nINNER JOIN users\nON\npayments.member_id = users.member_id GROUP BY users.member_id\";\n\n if(!$this->query($sql)->_error){\n\n return $this;\n \n } \n return false;\n }", "public function suggestedPartners($id)\n {\n $details = DB::table('profiles')\n ->where('user_id','=',$id)\n ->get();\n\n foreach($details as $raw)\n {\n $gender=$raw->gender;\n $age = $raw->age;\n $religion = $raw->religion;\n $motherT = $raw->motherTongue;\n $height= $raw->height;\n $complexion =$raw->complexion;\n $location =$raw->location;\n $languages = $raw->languages;\n\n\n if($gender == 'Male')\n {\n $final=DB::table('profiles')\n ->join('users', 'users.id', '=', 'profiles.user_id')\n ->where('profiles.user_id','!=', Auth::user()->id)\n ->where('profiles.location','=',$location)\n ->where('profiles.religion','=',$religion)\n ->where('profiles.motherTongue','=',$motherT)\n ->where('profiles.gender','!=',$gender)\n ->where('profiles.age','<',$age)\n ->where('profiles.height','<',$height)\n ->where('profiles.complexion','=',$complexion)\n ->where('profiles.languages','=',$languages)\n ->where('users.is_admin','=',0)\n ->where('users.user_activate_state','=','activate')\n ->get();\n }\n else\n {\n $final=DB::table('profiles')\n ->join('users', 'users.id', '=', 'profiles.user_id')\n ->where('profiles.user_id','!=', Auth::user()->id)\n ->where('profiles.location','=',$location)\n ->where('profiles.religion','=',$religion)\n ->where('profiles.motherTongue','=',$motherT)\n ->where('profiles.gender','!=',$gender)\n ->where('profiles.age','>',$age)\n ->where('profiles.height','>',$height)\n ->where('profiles.complexion','=',$complexion)\n ->where('profiles.languages','=',$languages)\n ->where('users.is_admin','=',0)\n ->where('users.user_activate_state','=','activate')\n ->get();\n }\n\n //check if has any results from the query\n if(count($final)<1)\n {\n $final = \"No Result\";\n\n //if query does not have any result return this\n return view('ajax.suggestedPartners')->with('final',$final);\n }\n\n //if query has values return this\n return view('ajax.suggestedPartners')->with('final',$final);\n }\n\n //return (\"Hi\");\n\n }", "function myjoin()\n {\n $this->db\n ->select('puestos.nombre AS pnombre')\n ->select('puestos.id AS pid')\n ->select('entidades.nombre AS enombre')\n ->select('entidades.id AS eid')\n ->select('departamentos.nombre AS dnombre')\n ->select('departamentos.id AS did')\n ->select('ubicaciones.nombre AS unombre')\n ->select('ubicaciones.id AS uid')\n ->join ('puestos', 'users.puesto = puestos.id' , 'left')\n ->join ('entidades', 'users.entidad = entidades.id' , 'left')\n ->join('departamentos', 'users.departamento = departamentos.id' , 'left')\n ->join('ubicaciones', 'users.ubicaciontrabajo = ubicaciones.id' , 'left');\n //$this->db->where('users.id',7);\n return $datosuser = $this->db->get('users')->result_array();\n }", "function user_viewed_company_query($user_id='', $viewing_type='', $company_id=\"\",$lebel=\"\")\n\t{\n\t\t$sql = \"SELECT MAX(UVC.viewing_date) AS viewing_date,\n\t\t\t\tUVC.id, UVC.user_id, UVC.company_id, UVC.viewing_type, \n\t\t\t\tIF(CU.users_profilepic IS NULL OR CU.users_profilepic = '', 'no_company_logo.png', CU.users_profilepic)AS users_profilepic,\n\t\t\t\tU.users_firstname, U.users_lastname, \n\t\t\t\tC.company_name, C.company_logo,\n\t\t\t\tfnStripTags(CU.users_bio) AS users_bio, CU.users_id AS company_user_id, CU.users_bio AS full_com_desc,\n\t\t\t\t IF(CU.users_phone IS NULL OR CU.users_phone = '', 'N/A', CU.users_phone) AS users_phone, \n\t\t\t\thia_cities.name AS city_name, hia_states.name AS state_name, hia_countries.name AS country_name\n\t\t\t\tFROM hia_user_view_company AS UVC\n\t\t\t\tJOIN hia_users AS U ON( UVC.user_id = U.users_id )\n\t\t\t\tJOIN hia_company AS C ON (UVC.company_id = C.company_id)\n\t\t\t\tJOIN hia_users AS CU ON( C.company_id = CU.users_companyid AND CU.users_type = '2' AND CU.users_status != '1')\n\t\t\t\tLEFT JOIN hia_cities ON (CU.users_city = hia_cities.id)\n\t\t\t\tLEFT JOIN hia_states ON (CU.users_state = hia_states.id)\n\t\t\t\tLEFT JOIN hia_countries ON (CU.users_country = hia_countries.id)\n\t\t\t\tWHERE U.users_type != '3'\n\t\t\t\tAND U.users_status != '1' \n\t\t\t\tAND UVC.company_id NOT IN (SELECT company_id FROM hia_user_following_company WHERE user_id = '$user_id' AND following_type = 'user') \";\n\n\t\tif ($viewing_type != \"\") {\n\t\t\t$sql.= \" AND UVC.viewing_type = '$viewing_type' \";\n\t\t}\n\t\t\t\t\n\t\tif ($user_id != \"\") {\n\t\t\t$sql.= \" AND UVC.user_id = '$user_id' \";\n\t\t}\n\t\t\t\t\n\t\t// if ($company_id != \"\") {\n\t\t// \t$sql.= \" AND UVC.company_id = '$company_id' \";\n\t\t// }\n\n\t\tif ($company_id != \"\") {\t\t\t\n\t\t\tif($lebel == 'next'){\n\t\t\t\t$sql.= \" AND CU.users_id > '$company_id' \";\t\t\t\t\n\t\t\t}\n\t\t\tif($lebel == 'prev'){\n\t\t\t\t$sql.= \" AND CU.users_id < '$company_id' \";\t\t\t\t \n\t\t\t}\n\t\t}\n\n\t\t// if($lebel == 'next'){\n\t\t// \t$sql.= \" GROUP BY UVC.company_id \";\t\n\t\t// }\n\t\tif($lebel == 'prev'){\n\t\t\t$sql.= \" GROUP BY UVC.company_id order by UVC.company_id DESC \";\t\n\t\t}else{\n\t\t\t$sql.= \" GROUP BY UVC.company_id \";\t\n\t\t}\n\t\t//echo $sql;exit;\n\n\t\tif ( ! $this->db->simple_query($sql))\n\t\t{\n\t\t\t$error = $this->db->error();\n\t\t\t//print_r($error);\n\t\t\t//exit();\n\t\t\treturn $error;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = $this->db->query($sql);\n\t\t\t\n\t\t\treturn $query->result_array();\n\t\t}\n\t\t\n\t}", "function get_deli_boy( $conds = array(), $limit = false, $offset = false )\n\t{\n\n\t\t$this->custom_conds();\n\t\t$this->db->select('core_users.*'); \n\t\t$this->db->from('core_users');\n\t\t$this->db->where('role_id', $conds['role_id']);\n\t\t$this->db->where('status!=', $conds['status']);\n\n\n\t\t// deli status condition \n\t\tif ( isset( $conds['deliboy_status'] )) {\n\t\t\tif ($conds['deliboy_status'] != \"\" ) {\n\t\t\t\tif ($conds['deliboy_status'] != '0') {\n\t\t\t\t\t$this->db->where( 'status', $conds['deliboy_status'] );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t//print_r($conds);die;\n\n\n\t\tif ( $limit ) {\n\t\t// if there is limit, set the limit\n\t\t\t\n\t\t\t$this->db->limit($limit);\n\t\t}\n\t\t\n\t\tif ( $offset ) {\n\t\t// if there is offset, set the offset,\n\t\t\t\n\t\t\t$this->db->offset($offset);\n\t\t}\n\n\t\treturn $this->db->get();\n\t\t//print_r($this->db->last_query());die;\n\t}", "function get_searchbyemailid($username,$emailaddress)\n{\n\tglobal $log;\n\tglobal $current_user;\n\trequire_once(\"modules/Users/Users.php\");\n\t$seed_user=new Users();\n\t$user_id=$seed_user->retrieve_user_id($username);\n\t$current_user=$seed_user;\n\t$current_user->retrieve_entity_info($user_id, 'Users');\n\trequire('user_privileges/user_privileges_'.$current_user->id.'.php');\n\trequire('user_privileges/sharing_privileges_'.$current_user->id.'.php');\n\t$log->debug(\"Entering get_searchbyemailid(\".$username.\",\".$emailaddress.\") method ...\");\n\t$query = \"select vtiger_contactdetails.lastname,vtiger_contactdetails.firstname,\n\t\t\t\t\tvtiger_contactdetails.contactid, vtiger_contactdetails.salutation,\n\t\t\t\t\tvtiger_contactdetails.email,vtiger_contactdetails.title,\n\t\t\t\t\tvtiger_contactdetails.mobile,vtiger_account.accountname,\n\t\t\t\t\tvtiger_account.accountid as accountid from vtiger_contactdetails\n\t\t\t\t\t\tinner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid\n\t\t\t\t\t\tinner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid\n\t\t\t\t\t\tleft join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid\n\t\t\t\t\t\tleft join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid\n\t\t\t LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\";\n\t$query .= getNonAdminAccessControlQuery('Contacts',$current_user);\n\t$query .= \"where vtiger_crmentity.deleted=0\";\n\tif(trim($emailaddress) != '') {\n\t\t$query .= \" and ((vtiger_contactdetails.email like '\". formatForSqlLike($emailaddress) .\n\t\t\"') or vtiger_contactdetails.lastname REGEXP REPLACE('\".$emailaddress.\n\t\t\"',' ','|') or vtiger_contactdetails.firstname REGEXP REPLACE('\".$emailaddress.\n\t\t\"',' ','|')) and vtiger_contactdetails.email != ''\";\n\t} else {\n\t\t$query .= \" and (vtiger_contactdetails.email like '\". formatForSqlLike($emailaddress) .\n\t\t\"' and vtiger_contactdetails.email != '')\";\n\t}\n\n\t$log->debug(\"Exiting get_searchbyemailid method ...\");\n\treturn $this->plugin_process_list_query($query);\n}", "public function getUserIDandEmail()\r\n{\r\n $query_string = \"SELECT userid FROM users \";\r\n $query_string .= \"WHERE username = :username OR email = :email\";\r\n\r\n return $query_string;\r\n}", "public function get_profile($uid){\r\n $query = \"SELECT members.mem_id, users.uid\r\n FROM members\r\n INNER JOIN users ON members.fk_users_id = users.uid\r\n WHERE uid = $uid\";\r\n \r\n $result = $this->db->query($query) or die($this->db->error); \r\n $user_data = $result->fetch_array(MYSQLI_ASSOC);\r\n \r\n }", "function getByUserId($userId){\n $this->db->where(\"nim = '$userId' or nip='$userId'\");\n $query = $this->db->get('peminjaman');\n $result = $query->result_array();\n return $result;\n}", "function get_businessinformation(){\t\t\r\n $this->db->select('bi.id as id, bi.business_name, bi.status, business_categories.business_category_name, bi.phone_number, bi.email, bi.street_address, bi.categories, bi.city, bi.state, bi.zip_code, bi.created_by, users.first_name');\r\n\t\t\t $this->db->from('business_information as bi' );\r\n\t\t\t $this->db->join('users', 'bi.created_by = users.id','left');\r\n\t\t\t $this->db->join('business_categories', 'bi.categories = business_categories.id','left');\r\n\t\t\t\t $this->db->group_by(\"bi.id\"); \r\n\t\t\t\t\r\n\t\t\t\t $menu = $this->session->userdata('admin');\r\n\t\t\t\t\tif($menu!='1'){\t\t\t\t\t\t\r\n\t\t\t\t\t\t$user = $this->session->userdata('id');\r\n\t\t\t\t\t\t$this->db->where('bi.created_by', $user);\r\n\t\t\t\t\t}\r\n\t\t\t \r\n\t\t\t\t $query = $this->db->get();\r\n\t\t\t $result = $query->result();\r\n\t\t\t return $result;\t\t\t\t\r\n }", "function get_user_details_byid($user_id) {\n\n $ci = & get_instance();\n $qur = $ci->db->query(\"SELECT * FROM `users` u INNER JOIN `users_profiles` up ON u.id = up.user_id WHERE u.id=\".$user_id);\n if($qur->num_rows() > 0) {\n $row = $qur->result_array();\n $email = $row[0]['email'];\n $f_name = $row[0]['f_name'];\n return ['email'=>$email,'f_name'=>$f_name];\n }else{\n return [];\n }\n}", "function search_customers($search){\n $like=array('first_name'=>$search,'email'=>$search,'company_name'=>$search,'phone'=>$search,'email'=>$search); \n $this->db->select('customer_category.discount,customers.*')->from('customers')->where('customers.branch_id', $this->session->userdata('branch_id'))->where('customers.active_status',1)->where('customers.delete_status',0);\n $this->db->join('customer_category','customer_category.guid=customers.category_id AND customers.active_status=1 AND customers.delete_status=0','left');\n $this->db->or_like($like);\n $sql= $this->db->get();\n $data=array();\n foreach ($sql->result() as $row){\n if($row->active_status==1 && $row->delete_status==0){\n $data[]=$row;\n }\n }\n return $data;\n }", "function fetchEntrantsForAdvanceInfo($condition = \"\",$order = \"user_id\")\n\t{\n\t\t$arrlist = array();\n\t\t$i = 0;\n\t\t\n\t\t$condition = explode(\"||##||\",$condition);\n\t\t\n\t\t$sQuery = \"SELECT u.user_id,u.client_id,u.user_username,u.user_firstname,u.user_lastname,u.user_email FROM \".DB_PREFIX.\"user u WHERE 1 = 1 AND u.user_id not in(select user_id from \".DB_PREFIX.\"entry e WHERE 1 \" . $condition[1] . \" ) \" . $condition[0] . \" ORDER BY \".$order;\n\t\t$rs = $this->runquery($sQuery);\n\t\t\n\t\treturn $rs;\n\t}", "function find_us(){\n global $db;\n $results = array();\n // SELECT usuarios.IdUsuario,usuarios.Clave, rol.Nombre,subdireccion.Subdireccion,departamento.Departamento FROM usuarios INNER JOIN rol ON usuarios.IdRol =rol.IdRol INNER JOIN departamento ON departamento.IdDepartamento=usuarios.IdDepartamento INNER JOIN subdireccion ON departamento.IdSubdireccion = subdireccion.id')\n $sql = \"SELECT u.id,u.clave,u.nivel_usuario,u.status,u.ultimo_login,s.Subdireccion,d.Departamento\";\n $sql .=\"g.group_name \";\n $sql .=\"FROM users u \";\n $sql .=\"LEFT JOIN departamento d \";\n $sql .=\"ON d.id=u.IdDepartamento\";\n $sql .=\"LEFT JOIN subdireccion s \";\n $sql .=\"ON s.id=u.Id ORDER BY u.clave ASC\";\n $sql .=\"LEFT JOIN user_groups g \";\n $sql .=\"ON g.group_level=u.nivel_usuario ORDER BY u.clave ASC\";\n $result = find_by_sql($sql);\n return $result;\n}", "public function get_user_orderdetails($page='',$skey='')\n {\n \t$lstart = (intval($page)-1)*10;\n \t$lend = 10;\n\n \t$sql = \"select a.* from user_register as a inner join tb_orders_prowise as b on a.uid=b.UserId where a.uid=b.UserId\";\n\n \t$finalsql = $sql;\n \t$tot = $this->db->query($finalsql);\n \tif($lstart < 0)\n \t\t$lstart = '0';\n \t//$sql.=\" GROUP BY GoldRateId order by GoldRateId DESC LIMIT $lstart,$lend\";\n \t$total = $tot->num_rows();\n \t$result = $this->db->query($sql)->result();\n \treturn array(\"total\"=>$total,\"userdetails\"=>$result);\n }", "public function check_userdata($quizweb_user_id,$birthdate,$standard,$gender){\n// $this->db->select('*');\n // print_r($user_mobile); die();\n$this->db->where('user_id',$quizweb_user_id);\n$this->db->where('birthdate',$birthdate);\n$this->db->where('standard',$standard);\n$this->db->where('gender',$gender);\n\n$this->db->from('userprofile_master');\n$query = $this->db->get();\n$result = $query->result_array();\n// print_r($result); die();\nreturn $result;\n}", "public function show_profile()\n\t\t{\n\t\t\t$this->db->select('admin_user_profile.reason,admin_user_profile.status as status,users.ID as uid,users.first_name as firstname,users.last_name as lastname,user_profile.*');\n\t\t $this->db->from('user_profile');\n\t\t $this->db->join(\"users\",'user_profile.user_id = users.ID');\n\t\t $this->db->join(\"admin_user_profile\",'admin_user_profile.blocked_id = users.ID');\n\n\t\t //$this->db->order_by(\"user_profile.id\",\"desc\");\n\t\t $query \t\t=\t$this->db->get();\n\t\t\t$userdata\t=\t$query->result_array();\n\t\t\t//print_r($userdata);exit;\n\t\t\tif($userdata)\n\t\t\t{ \t\n\t\t\t\treturn $userdata;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\t\t\t \n\t\t}", "function friendRequestFetch(){\n\n $friendRequest=mysql_query(\"SELECT user,friend FROM Friend\n WHERE user=(SELECT user_id FROM Account WHERE user_email='$_SESSION[friend_email]')\n AND friend=(SELECT user_id FROM Account WHERE user_email='$_SESSION[user_email]')\") \n or die(\"<p>Friend request failed</p>\");\n\n $friendRequestFetch=mysql_fetch_array($friendRequest);\n\n return $friendRequestFetch;;\n }", "private function grup_sql()\n\t{\n\t\tif ($this->session->grup == 4)\n\t\t{\n\t\t\t$kf = $this->session->user;\n\t\t\t$filter_sql= \" AND a.id_user = $kf\";\n\t\t\treturn $filter_sql;\n\t\t}\n\t}", "function get_userdetails_register($value)\n {\n // return $query->result();\n $this->db->select('up.*,us.*,cn.*,st.*,ct.*');\n $this->db->from('users us');\n $this->db->join('address up', 'up.id=us.addressid', 'left');\n $this->db->join('countries cn', 'up.country=cn.id', 'left');\n $this->db->join('states st', 'st.s_id=up.state', 'left');\n $this->db->join('cities ct', 'up.city=ct.c_id', 'left');\n $this->db->where('us.id', $value);\n $result = $this->db->get()->result();\n return $result;\n }", "function get_user_percentage_gender_age($from=null, $to=null)\r\n {\r\n if($to ==null) $to =date('Y-m-d');\r\n if($from==null) $from=date('Y-m-d', strtotime(\"-1 week\", strtotime($to)));\r\n \r\n $list = array(\r\n array(0),\r\n array(1, 10),\r\n range(11, 15),\r\n range(16, 19),\r\n range(20, 22),\r\n range(23, 25),\r\n range(26, 28),\r\n range(29, 30),\r\n range(31, 40),\r\n range(41, 200)\r\n );\r\n\r\n //select DATE_FORMAT(CURRENT_DATE, '%Y')-DATE_FORMAT(birth, '%Y')+1 as age, SUM(case when gender = 'm' then 1 else 0 end) as gender_m_count, SUM(case when gender = 'f' then 1 else 0 end) as gender_f_count, count(user_id) as user_count, all_count from users left join user_profiles on users.id = user_profiles.user_id join (select count(id) as all_count from users where activated=1) all_user group by age\r\n $output = array(array('연령' , '남비율', '여비율'));\r\n $data = array();\r\n\r\n $i = 1;\r\n //query\r\n $sql = \"SELECT DATE_FORMAT(CURRENT_DATE, '%Y')-DATE_FORMAT(birth, '%Y')+1 as age,\r\n SUM(case when gender = 'm' then 1 else 0 end) as gender_m_count, \r\n SUM(case when gender = 'f' then 1 else 0 end) as gender_f_count, \r\n count(user_id) as user_count, all_count \r\n from users \r\n left join user_profiles on users.id = user_profiles.user_id \r\n join (select count(id) as all_count from users where activated=? and created >= ? and created <= ?) all_user \r\n WHERE created between ? and ?\r\n group by age\"; \r\n $query = $this->db->query($sql, array(1, $from, $to, $from, $to));\r\n foreach ($query->result() as $row)\r\n {\r\n if(is_null($row->age)) continue;\r\n foreach($list as $k=>$v){\r\n if(in_array($row->age, $v)){\r\n $data[$k]['m'] += round($row->gender_m_count*100/$row->all_count, 2);\r\n $data[$k]['f'] += round($row->gender_f_count*100/$row->all_count, 2);\r\n }\r\n }\r\n }\r\n\r\n foreach($list as $k=>$v){\r\n $i = $k+1;\r\n $output[$i][0] = (string)((count($v)>1)?$v[0].\"~\".$v[count($v)-1]:\"{$v[0]}\");\r\n $output[$i][1] = round($data[$k]['m'], 2);\r\n $output[$i][2] = round($data[$k]['f'], 2);\r\n }\r\n\r\n return $output; \r\n /*\r\n //---- dummy data\r\n $dateNum = floor((strtotime($to)-strtotime($from))/86400)+1;\r\n $output = array(array('연령' , '남비율', '여비율'));\r\n if($dateNum>0){\r\n $AxisX = array(\"0\", \"1~10\", \"11~15\", \"16~19\", \"20~22\", \"23~25\", \"26~28\", \"29~30\", \"31~40\", \"41~\");\r\n $i = 1;\r\n foreach($AxisX as $text){\r\n $normal = array(\"11~15\", \"16~19\", \"26~28\", \"29~30\", \"31~40\", \"41~\");\r\n $large = array(\"20~22\", \"23~25\", \"26~28\");\r\n if(in_array($text, $normal)){\r\n $num1 = rand(30, 70);\r\n $num2 = 100-$num1;\r\n } else if(in_array($text, $large)){\r\n $num1 = rand(30, 70);\r\n $num2 = 100-$num1;\r\n } else{\r\n $num1 = 0;\r\n $num2 = 0;\r\n }\r\n $output[$i] = array($text, $num1, $num2);\r\n $i++;\r\n }\r\n }\r\n return $output;*/\r\n }", "function esadmin($user){\r\n$sql_queryadmin = \"Select * From usuario inner join administrador \r\n\t\t\t\t\ton administrador.admin_id = usuario.login \r\n\t\t\t\t\tWhere login = '$user';\";\t\r\n$result = pg_query($sql_queryadmin);\r\nreturn $result;}", "function esadmin($user){\r\n$sql_queryadmin = \"Select * From usuario inner join administrador \r\n\t\t\t\t\ton administrador.admin_id = usuario.login \r\n\t\t\t\t\tWhere login = '$user';\";\t\r\n$result = pg_query($sql_queryadmin);\r\nreturn $result;}", "public function gettopDbeeusers($limit=2,$dbeeID='',$datefrom='', $dateto='') \n { \n $db = $this->getDbTable();\n $select = $db->select();\n /*$select->distinct('dbee.User')->from( array('dbee' => 'tblDbees'), array('DbeeID'=>'dbee.DbeeID',new Zend_Db_Expr(\"COUNT(dbee.DbeeID) AS total\") ));\n $select->join( array('u' => 'tblUsers'), 'u.UserID=dbee.User', array( 'UserID' => 'u.UserID','username' => 'u.Name','lname' => 'u.lname','image' =>'u.ProfilePic','uname' =>'u.Username') );\n $select->setIntegrityCheck( false ); \n $select->where('u.Status = ?', '1');\n $select->where(\"dbee.clientID = ?\", clientID);\n\n if(!empty($datefrom) && !empty($dateto)){\n $select->where(\"dbee.PostDate >= ?\", date('Y-m-d H:i:s',strtotime($datefrom)));\n $select->where(\"dbee.PostDate <= ?\", date('Y-m-d H:i:s',strtotime($dateto)));\n } \n $select->group ( array (\"dbee.User\") );\n $select->order('total DESC');*/\n\n $select->distinct('act.act_userId')->from( array('act' => 'tblactivity'), array('DbeeID'=>'act.act_userId',new Zend_Db_Expr(\"COUNT(act.act_id) AS total\"), new Zend_Db_Expr(\" sum( case when act_type=1 then 1 else 0 end) as postCount\" ), new Zend_Db_Expr(\" sum( case when act_type=2 then 1 else 0 end) as commentCount\" )));\n $select->join( array('u' => 'tblUsers'), 'u.UserID=act.act_userId', array( 'UserID' => 'u.UserID','username' => 'u.Name','lname' => 'u.lname','image' =>'u.ProfilePic','uname' =>'u.Username') );\n $select->setIntegrityCheck( false ); \n $select->where('u.Status = ?', '1');\n $select->where('u.Role != ?', '1');\n $select->where(\"act.clientID = ?\", clientID);\n $select->where(\"act.act_type = 1 OR act.act_type = 2\" );\n\n /*SELECT DISTINCT `act`.`act_userId` AS `DbeeID`, COUNT(act.act_id) AS total,sum(case when act_type=1 then 1 else 0 end) postCount,sum(case when act_type=2 then 1 else 0 end) commentCount ,`u`.`UserID`, `u`.`Name` AS `username`, `u`.`lname`, `u`.`ProfilePic` AS `image`, `u`.`Username` AS `uname` FROM `tblactivity` AS `act` INNER JOIN `tblUsers` AS `u` ON u.UserID=act.act_userId WHERE (u.Status = '1') AND (u.Role != '1') AND (act.clientID = '1') AND (act.act_type = 1 OR act.act_type = 2) GROUP BY `act`.`act_userId` ORDER BY `total` DESC*/\n\n if(!empty($datefrom) && !empty($dateto)){\n $select->where(\"act.act_date >= ?\", date('Y-m-d H:i:s',strtotime($datefrom)));\n $select->where(\"act.act_date <= ?\", date('Y-m-d H:i:s',strtotime($dateto)));\n } \n $select->group ( array (\"act.act_userId\") );\n $select->order('total DESC');\n if($limit!='all')\n $select->LIMIT($limit, 0);\n //echo $select; exit;\n $result= $db->fetchAll($select); \n return $result; \n }", "public function query($user, $or)\r\n {\r\n $sql = \"\";\r\n if ($or) {\r\n $sql = \"select * from user where account='\" . $user->account . \"' \";\r\n } else {\r\n $sql = \"select * from user where account='\" . $user->account . \"'and password='\" . $user->password . \"'\";\r\n }\r\n\r\n// $sql = \"select * from user where account='\" . $user->account . \"' \" . $or_ . \" password='\" . $user->password . \"'\";\r\n\r\n// $sql = printf($sql, $user->accound, $user->password);\r\n\r\n $result = MyDao::queryForResult($sql);\r\n\r\n $has = false;\r\n\r\n while ($obj = mysqli_fetch_object($result)) {\r\n $has = true;\r\n }\r\n return $has;\r\n }", "function get_user_booking_with_id($user_id){\n global $db;\n $sql = \"SELECT * FROM booking WHERE user_id = '$user_id'\";\n $result = $db->query($sql);\n return $result;\n}", "function if_user_has_booking($user_id){\n global $db;\n $sql = \"SELECT * FROM booking WHERE user_id = '$user_id';\";\n $result = $db->query($sql);\n return $result;\n}", "function getGender($user, $gender) {\n\t$result = dbQuery(\"SELECT * FROM users WHERE username = '$user'\");\n\t$row = mysql_fetch_array($result);\n\n\t if( $row['gender'] == $gender ) \n\t {\n\t\t return true;\n\t\t } \n\t\t else\n\t\t {\n\t\t \t return false;\n\t\t }\n}", "function getUsulanByIdUsulan($id){\n\t\t$query = $this->db->query(\"SELECT * from usulan,pagu,user where usulan.ID_USER=user.ID_USER AND ID_USULAN = '$id' AND usulan.TAHUN_ANGGARAN = pagu.TAHUN_ANGGARAN\")->row_array();\n\t\treturn $query;\n\t}", "public function get_commute_detail($userId,$searchId){\n // $userId = $post_data['userId'];\n // $searchId = $post_data['searchId'];\n\n $sql =\"SELECT c.commuteId,c.commuteName,c.destination,c.timeofCommuting,c.modeOfCommute,c.maxCommuteTime,c.destLatitude,c.destLongitude,c.primaryCommute \n FROM commute c,users u WHERE u.userId = c.userId AND c.searchId = $searchId AND c.deleteFlag != 1 AND c.userId =$userId\";\n $record = $this->db->query($sql);\n if($record->num_rows()>0){\n return $record->result_array(); \n } \n }", "public function show_profile(){\n\n $query = $this->db->select(\"person.fname, person.lname, person.yob, author_registration.picture_url\")\n ->from(\"person\")\n ->join(\"author_registration\", \"person.person_id = author_registration.person_id\")\n ->get();\n\n return $query;\n }", "function getByUser($uid) {\n // Run the query and get the user details\n $query = sprintf(\"SELECT p.id,\n p.uid,\n p.typeid,\n p.amount,\n p.token,\n p.createdOn,\n pt.desc\n FROM Payments p\n INNER JOIN PaymentTypes pt ON pt.id = p.typeid\n WHERE p.uid=%u\n ORDER BY p.createdOn DESC\",\n $uid);\n\n $conn = \\DB\\getConnection();\n $result = $conn->query($query);\n\n return $result;\n}", "function get_itmanger(){\n\t\t//$query = \"SELECT EMP_NAME from emp_basic_info where emp_num='11252'\";\n\t\t$where_clause = \" where users.department_id=110 \";\n\t\n\t\t$query = \"SELECT users.user_id, users.name from users join userrole on users.user_id = userrole.user_id $where_clause and role_id IN (10, 11) order by role_id desc\";\n\t\t$query = $this->db->query($query);\n\t\t$result = $query->row();\n\t\tif(isset($result->name)){\n\t\t\treturn $result->name;\n\t\t}\n\t\telse \n\t\t\treturn null;\n\t}", "function find_all_user(){\n global $db;\n $results = array();\n $sql = \"SELECT u.id,u.name,u.username,u.user_level,u.status,u.last_login,email,\";\n $sql .=\"g.group_name \";\n $sql .=\"FROM users u \";\n $sql .=\"LEFT JOIN user_groups g \";\n $sql .=\"ON g.group_level=u.user_level ORDER BY u.name ASC\";\n $result = find_by_sql($sql);\n return $result;\n }" ]
[ "0.6643569", "0.65078014", "0.6285301", "0.62733924", "0.6197882", "0.611622", "0.6113177", "0.60883147", "0.6076401", "0.6070369", "0.605047", "0.60389423", "0.6031657", "0.6029758", "0.6025028", "0.596376", "0.5963382", "0.59444654", "0.5937881", "0.593766", "0.59352493", "0.5934934", "0.5934349", "0.5925905", "0.59229255", "0.59127617", "0.5903454", "0.58996993", "0.5860963", "0.58513355", "0.5848116", "0.5838275", "0.58347034", "0.5812992", "0.580889", "0.5804783", "0.57994777", "0.579928", "0.5790612", "0.5789668", "0.5778613", "0.57782364", "0.57690626", "0.5765469", "0.57560515", "0.57478786", "0.5747818", "0.57437444", "0.57374305", "0.57345647", "0.57330376", "0.5729109", "0.5728705", "0.57282364", "0.57256496", "0.5724281", "0.57199484", "0.5719908", "0.5711244", "0.5700877", "0.5698148", "0.5695835", "0.5691684", "0.5690609", "0.5689802", "0.56838727", "0.5671019", "0.56692433", "0.5666154", "0.56644803", "0.56609166", "0.5660555", "0.5658678", "0.56583774", "0.5653479", "0.5647117", "0.5646615", "0.5636758", "0.56344557", "0.56308514", "0.56280696", "0.56267697", "0.5626042", "0.56236", "0.561897", "0.561874", "0.5618089", "0.5616897", "0.5615417", "0.5615417", "0.5610796", "0.5610562", "0.56009877", "0.5599868", "0.55970544", "0.55958915", "0.5592593", "0.55922854", "0.5591484", "0.5584804", "0.5580338" ]
0.0
-1
/ $this>db>select('package.,package.id as packid,location.,address.,cities.,file.'); $this>db>from('package'); $this>db>join('cities','cities.c_id = package.location','left'); $this>db>join('address','address.city = cities.c_id'); $this>db>join('location','location.locationaddress = address.id'); $this>db>join('file','file.id = package.thumbnailimage'); $this>db>join('packageimage','packageimage.package = package.id','left'); $this>db>join('file','file.id = packageimage.file'); $this>db>where('package.id',$dis); $query = $this>db>get(); $row = $query>result_array();// echo $this>db>last_query();exit; return $row;
function get_all_package_details_admin($dis) { $query = $this->db->query("SELECT PACKAGE.*,LOC.id AS locationId, PACKAGE.id as ped, group_concat(DISTINCT PACKFILE.imagename order by PACKFILE.imagename separator ',' ) AS packageImages, group_concat(DISTINCT LOCFILE.imagepath order by LOCFILE.imagepath separator ',' ) AS locationImages, group_concat(DISTINCT LOCAMENITIES.name order by LOCAMENITIES.name separator ',' ) AS locstionamineties, group_concat(DISTINCT PACKAMENITIES.name order by PACKAMENITIES.name separator ',' ) AS packaageamineties FROM `package` AS PACKAGE LEFT JOIN packageimage AS PACKIMAGE ON PACKIMAGE.package = PACKAGE.id LEFT JOIN file AS PACKFILE ON PACKFILE.id = PACKIMAGE.file LEFT JOIN location AS LOC ON LOC.id=PACKAGE.location LEFT JOIN address AS ADDRESS ON ADDRESS.id = LOC.locationaddress LEFT JOIN locationimage AS LOCIMAGE ON LOCIMAGE.location = LOC.id LEFT JOIN file AS LOCFILE ON LOCFILE.id = LOCIMAGE.id LEFT JOIN locationamenities AS LOCAMENITIESMAP ON LOCAMENITIESMAP.location = LOC.id LEFT JOIN amenities AS LOCAMENITIES ON LOCAMENITIES.id = LOCAMENITIESMAP.amenities LEFT JOIN packageamenities AS PACKMENITIESMAP ON PACKMENITIESMAP.package = PACKAGE.id LEFT JOIN amenities AS PACKAMENITIES ON PACKAMENITIES.id = PACKMENITIESMAP.amenities WHERE PACKAGE.id = $dis"); return $query->result_array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_location_package_detail()\n {\n $this->db->select('package.*,package.id as packid,location.*,address.*,cities.*,file.* ');\n $this->db->from('package');\n $this->db->join('cities', 'cities.c_id = package.location');\n $this->db->join('address', 'address.city = cities.c_id');\n $this->db->join('location', 'address.id = location.locationaddress');\n // $this->db->join('packageimage','packageimage.package = package.id');\n $this->db->join('file', 'file.id = package.thumbnailimage');\n // $this->db->where('cities.c_id', $dis);\n $query = $this->db->get();\n $row = $query->result_array(); // echo $this->db->last_query();exit;\n return $row;\n }", "function get_package_details($dis)\n {\n $this->db->select('package.*,package.id as packid,location.*,address.*,cities.*,file.* ');\n $this->db->from('package');\n $this->db->join('cities', 'cities.c_id = package.location');\n $this->db->join('address', 'address.city = cities.c_id');\n $this->db->join('location', 'address.id = location.locationaddress');\n // $this->db->join('packageimage','packageimage.package = package.id');\n $this->db->join('file', 'file.id = package.thumbnailimage');\n $this->db->where('cities.c_id', $dis);\n $query = $this->db->get();\n $row = $query->result_array(); // echo $this->db->last_query();exit;\n return $row;\n }", "function get_all_package_details($dis)\n {\n $query = $this->db->query(\"SELECT \n PACKAGE.*, group_concat(DISTINCT PACKFILE.imagename order by PACKFILE.imagename separator ',' ) AS packageImages,\n group_concat(DISTINCT LOCFILE.imagepath order by LOCFILE.imagepath separator ',' ) AS locationImages,\n group_concat(DISTINCT LOCAMENITIES.name order by LOCAMENITIES.name separator ',' ) AS locstionamineties, \n group_concat(DISTINCT PACKAMENITIES.name order by PACKAMENITIES.name separator ',' ) AS packaageamineties \n FROM `package` AS PACKAGE \n LEFT JOIN packageimage AS PACKIMAGE ON PACKIMAGE.package = PACKAGE.id \n LEFT JOIN file AS PACKFILE ON PACKFILE.id = PACKIMAGE.file \n LEFT JOIN location AS LOC ON LOC.id=PACKAGE.location \n LEFT JOIN address AS ADDRESS ON ADDRESS.id = LOC.locationaddress \n LEFT JOIN locationimage AS LOCIMAGE ON LOCIMAGE.location = LOC.id \n LEFT JOIN file AS LOCFILE ON LOCFILE.id = LOCIMAGE.id \n LEFT JOIN locationamenities AS LOCAMENITIESMAP ON LOCAMENITIESMAP.location = LOC.id LEFT JOIN amenities AS LOCAMENITIES ON LOCAMENITIES.id = LOCAMENITIESMAP.amenities LEFT JOIN packageamenities AS PACKMENITIESMAP ON PACKMENITIESMAP.package = PACKAGE.id \n LEFT JOIN amenities AS PACKAMENITIES ON PACKAMENITIES.id = PACKMENITIESMAP.amenities WHERE PACKAGE.id =$dis\");\n return $query->result_array();\n }", "function get_all_package_details_view($dis)\n {\n $query = $this->db->query(\"SELECT \n PACKAGE.*, group_concat(DISTINCT PACKFILE.imagename order by PACKFILE.imagename separator ',' ) AS packageImages,\n group_concat(DISTINCT LOCFILE.imagepath order by LOCFILE.imagepath separator ',' ) AS locationImages,\n group_concat(DISTINCT LOCAMENITIES.name order by LOCAMENITIES.name separator ',' ) AS locstionamineties, \n group_concat(DISTINCT PACKAMENITIES.name order by PACKAMENITIES.name separator ',' ) AS packaageamineties \n FROM `package` AS PACKAGE \n LEFT JOIN packageimage AS PACKIMAGE ON PACKIMAGE.package = PACKAGE.id \n LEFT JOIN file AS PACKFILE ON PACKFILE.id = PACKIMAGE.file \n LEFT JOIN location AS LOC ON LOC.id=PACKAGE.location \n LEFT JOIN address AS ADDRESS ON ADDRESS.id = LOC.locationaddress \n LEFT JOIN locationimage AS LOCIMAGE ON LOCIMAGE.location = LOC.id \n LEFT JOIN file AS LOCFILE ON LOCFILE.id = LOCIMAGE.id \n LEFT JOIN locationamenities AS LOCAMENITIESMAP ON LOCAMENITIESMAP.location = LOC.id LEFT JOIN amenities AS LOCAMENITIES ON LOCAMENITIES.id = LOCAMENITIESMAP.amenities LEFT JOIN packageamenities AS PACKMENITIESMAP ON PACKMENITIESMAP.package = PACKAGE.id \n LEFT JOIN amenities AS PACKAMENITIES ON PACKAMENITIES.id = PACKMENITIESMAP.amenities where PACKAGE.id=$dis\");\n return $query->result_array();\n }", "public function cpJoin() {\n $sql=\"select packages.packageName, prices.id, prices.price, products.productName, products.cid, prices.productID, prices.areaID, prices.packageID \"\n . \"from prices\"\n . \" inner join packages on packages.packageID=prices.packageID\"\n . \" inner join products on prices.productID=products.productID where products.cid='9'\";\n $sth=$this->dbh->prepare($sql);\n \n $sth->execute();\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n}", "public function getJobp($id=''){\t\t\n $this->db->select(\"jobspreview.*,package.name as package_name,package.price as package_price,industry.name as industry_name\");\n $this->db->join(\"package\",\"jobspreview.package_id=package.id\",\"left\"); \n $this->db->join(\"industry\",\"jobspreview.industry_id=industry.id\",\"left\"); \n $this->db->where(\"jobspreview.id\",$id); \n $result = $this->db->get('jobspreview')->result();\n //echo $this->db->last_query(); die(); \n return $result;\t\t\n}", "function join_product_table(){\n global $db;\n $sql =\" SELECT p.id,p.name,p.keywords,p.quantity,p.url,p.buy_price,p.sale_price,p.media_id,p.date,c.name\";\n $sql .=\" AS categorie,m.file_name AS image\";\n $sql .=\" FROM products p\";\n $sql .=\" LEFT JOIN categories c ON c.id = p.categorie_id\";\n $sql .=\" LEFT JOIN media m ON m.id = p.media_id\";\n $sql .=\" ORDER BY p.id ASC\";\n return find_by_sql($sql);\n\n }", "function getPackage(){\n\t\t $query = \"select package.id,package.pkg_cat_id,package.date_created,package.date_updated,package.icon_image,package.package_title,package.package_price,package.number_of_qty,package.slider_desc1,package.slider_image1,packages_category.packages_category_name from package inner join packages_category on package.pkg_cat_id = packages_category.id \";\n\t\t $result = mysql_query($query);\n\t\t if($result){\n\t\t\t$data = array();\n\t\t\twhile($row=mysql_fetch_assoc($result)){\n\t\t\t\t$row['icon_image'] = $row['icon_image'] !==\"\"? $this->Check_exists_img($row['icon_image']) : \"dist/img/boxed-bg.jpg\";\n\t\t\t\t$row['slider_image1'] = $row['slider_image1'] !==\"\"? $this->Check_exists_img($row['slider_image1']) : \"dist/img/boxed-bg.jpg\";\n\t\t\t\t\n\t\t\t\tarray_push($data,$row);\n\t\t\t }\n\t\t\t return $data;\n\t\t }else{\n\t\t\tdie(\"error in mysql query\" . mysql_error());\n\t\t }\n\t\t}", "function customerPackage() {\n $sql = \"SELECT customers.package_id, customers.customer_id, customers.fname, customers.lname, customers.phone, customers.email, customers.state, packages.name\n FROM packages INNER JOIN customers ON packages.package_id = customers.package_id\";\n\n //Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //Execute\n $statement->execute();\n\n //Get the results\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "function getallproducts($warehouseid){\n \n $result = $this->db->query(\"SELECT a.*, \n b.id AS productid, b.`name` AS productname, b.`main_image` AS productimage, \n b.`price` AS product_price, b.`tax` AS product_tax, b.`description` AS product_description, b.`move_product_id` AS productuniqueid_forimages,\n c.`name` AS cat_name, c.`image` AS cat_image, d.`name` AS subcat_name, d.`image` AS subcat_image\n FROM warehouse_products a LEFT JOIN products b ON a.product=b.`id` LEFT JOIN category c ON b.`category_id` = c.`category_id` LEFT JOIN category d \n ON b.`sub_category_id` = d.`category_id` WHERE a.`warehouse` = \".$warehouseid.\" ORDER BY c.`name`, d.`name`\")->result();\n return $result;\n \n }", "public function get_locations_md($id = FALSE)\n{\n if ($id === FALSE)\n { //celle qui marche ..\n // $query = $this->db->get('locations');\n // return $query->result_array();\n $this->db->select('*'); \n $this->db->from('locations');\n $this->db->join ('carsToRent','carsToRent.ctr_id = locations.ctr_id');\n $this->db->join ('carDetails','carDetails.cd_id = carsToRent.cd_id');\n $this->db->join ('locationStatement','locationStatement.ls_id = locations.ls_id');\n $query = $this->db->get();\n return $query->result_array();\n \n }\n else {\n // $query = $this->db->get_where('locations', array('ctr_id' => $id));\n $this->db->select('*')\n ->from('locations')\n ->where('ctr_id',$id)\n ->join ('carDetails','carDetails.cd_id = locations.cd_id');\n $query = $this->db->get();\n return $query->row_array();\n }\n}", "public function getCommondata()\n {\n $select = $this->select()\n // ->setIntegrityCheck(false)\n ->from(array('album' => 'album'),array('Id','name_n'))\n ->join('album_det','album_det.Id = album.Id',array('album_det.Id'));\n // $result=$this->fetchAll($hhh);\n $result = $this->fetchAll($select);\n \n echo \"<pre>\";\n print_r($result);exit;\n return $result;\n\n }", "public function consultaOfertas(){\n //join Tabla2 T2 ON T1.PK = T2.FK\n \n //select * from Tabla1 T1, Tabla2 T2\n //WHERE T!.PK = T2.FK\n \n \n \n //$this->db->select(\"*\"); \n //$this->db->from(\"productos\");//nombrebase\n //$this->db->join(\"carrera\",\"alumno.idCarrera = carrera.idCarrera\");\n \n //$sql = $this->db->get();\n //return $sql->result();\n }", "public function listProductsPack($params)\n{\n // $prdId = $this->db->real_escape_string($params);\n // $qry = \"SELECT pr.prd_id, pr.prd_sku, pr.prd_name, pr.prd_price, pk.prd_parent \n // FROM ctt_products_packages AS pk\n // INNER JOIN ctt_products AS pr ON pr.prd_id = pk.prd_id\n // WHERE pk.prd_parent = $prdId AND prd_status =1;\";\n // return $this->db->query($qry);\n}", "function get_mapping() {\n\n\n $query = $this->db->query('SELECT\n A.map_id\n ,C1.stage_title AS place_name\n ,C2.stage_title AS dress_name\n ,C3.stage_title AS crown_name\n ,C4.stage_title AS stage_name\n ,C5.stage_title AS props_name\n ,B.character_name AS char_name \n ,A.image_path \nFROM mapping AS A\nINNER JOIN stage AS C1\n ON A.place_id = C1.id\nINNER JOIN stage AS C2\n ON A.dress_id = C2.id\n\n INNER JOIN stage AS C3\n ON A.crown_id = C3.id\n\n INNER JOIN stage AS C4\n ON A.stage_id = C4.id\n \n INNER JOIN stage AS C5\n ON A.props_id = C5.id\n\nINNER JOIN napoleon_characters AS B ON A.character_id = B.character_id');\n\n// $this->db->where('id', $intid);\n// $query = $this->db->get();\n// echo \"<pre>\";\n// print_r($query->result_array());\n// die;\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n else {\n return array();\n }\n }", "function getRows($params = array()){\r\r\n $this->db->select('a.*, b.product_name,b.cat_name,b.pro_id as product_code,b.main_img,b.price');\r\r\n $this->db->from($this->wishlistTbl.\" a\");\r\r\n $this->db->join('products b', 'b.id=a.product_id', 'left');\r\r\n $this->db->where('a.user_id',$params);\r\r\n // echo $this->db->last_query();\r\r\n //$cnt = $this->db->count_all_results();\r\r\n $query = $this->db->get();\r\r\n $result = ($query->num_rows() > 0)?$query->result_array():false;\r\r\n\r\r\n //return fetched data\r\r\n return $result;\r\r\n }", "function get_it($npm){\n $this->db->select('mahasiswa.*,prodi.nama_prodi');\n $this->db->from('mahasiswa');\n $this->db->where('npm', $npm);\n $this->db->join('prodi', 'prodi.id_prodi = mahasiswa.id_prodi', 'left');\n $this->db->order_by('id_mahasiswa', 'desc');\n $query = $this->db->get();\n return $query->row();\n }", "public function getAllProduct(){\n $this->db->select('p.id,p.title,p.image,c.category');\n $this->db->from('product p, category c');\n $this->db->where('p.status','t');\n $this->db->where('p.category_id=c.id');\n $this->db->order_by(\"id\", \"desc\");\n $query = $this->db->get();\n return $query->result(); \n }", "function getallepics()\n {\n //$allepics = \"SELECT * from epics\";\n $allepics= \"SELECT e.*,staff.*,epics_statuses.name as epicsname,team.name as teamname\n FROM epics AS e\n LEFT JOIN epics_statuses AS epics_statuses ON epics_statuses.id = e.e_status_id\n LEFT JOIN team AS team ON team.id = e.team_id\n LEFT JOIN staff AS staff ON staff.staff_id = e.e_owner\"; \n $allepicsresult = $this->ds->select($allepics); \n //print_r($myepicsresult);\n return $allepicsresult;\n }", "public function fetch_products() {\n $this->db->select('product.id,product.name,product.price,product.status,(SELECT product_images.image_name FROM product_images WHERE product_images.product_id = product.id ORDER BY id ASC LIMIT 1) AS pr_img');\n $this->db->from('product');\n $this->db->where('is_featured', '1');\n $r = $this->db->get();\n\n return $r->result_array();\n }", "function getJD($id){\n\t $data=array();\n\t\t $this->db->select('filepath,filename');\n\t\t $this->db->from('pof_attachment');\n\t\t $this->db->where('pof_id', $id);\n\t\t $Q = $this->db->get();\n\t\t if ($Q->num_rows() > 0){\n\t foreach ($Q->result_array() as $row)\n\t\t {\n\t $data=$row;\n\t }\n\t }\n\t $Q->free_result(); \n\t return $data; \n\t\t }", "function immagini_get($id_imm=\"\"){\n $db = new db(DB_USER,DB_PASSWORD,DB_NAME,DB_HOST);\n\t\n\t$q_foto=\"SELECT immagine.* FROM imm_img JOIN immagine on immagine.id_img=imm_img.id_img WHERE imm_img.id_imm =$id_imm ORDER BY `ordine` ASC\";\n \n\t$r_foto=$db->query($q_foto);\n while($row_foto = mysql_fetch_assoc($r_foto))\n {\n $rows_foto[] = $row_foto;\n }\n \n return $rows_foto;\n\n \n}", "function get_joinFG($data,$key=FALSE,$column=FALSE){ //Zulmi Adi Rizki 23 Juli 2013\n\t\t\n\t\tif($key == TRUE){\n\t\t\tif(!is_array($key)){\n\t\t\t\t$this->db->where($key);\n\t\t\t} else {\n\t\t\t\t$key = array_map('htmlentities', $key);\n\t\t\t\t$this->db->where($key);\n\t\t\t}\n\t\t}\n\t\t$this->db->select($column == FALSE ? \"*\" : $column)->from($this->table_name);\n\t\tforeach($data as $row){\n\t\t\tif($row[\"join_type\"] != NULL){\n\t\t\t\t$this->db->join($row[\"join_table\"],$row[\"table\"].\".\".$row[\"join_key\"].\"=\".$row[\"join_table\"].\".\".$row[\"join_key\"], $row[\"join_type\"]);\n\t\t\t} else {\n\t\t\t\t$this->db->join($row[\"join_table\"],$row[\"table\"].\".\".$row[\"join_key\"].\"=\".$row[\"join_table\"].\".\".$row[\"join_key\"]);\n\t\t\t}\n\t\t}\n\t\t$this->flexigrid->build_query();\n\t\t$return['records'] = $this->db->get();\n\t\t\n\t\tif($key == TRUE){\n\t\t\tif(!is_array($key)){\n\t\t\t\t$this->db->where($key);\n\t\t\t} else {\n\t\t\t\t$key = array_map('htmlentities', $key);\n\t\t\t\t$this->db->where($key);\n\t\t\t}\n\t\t}\n\t\t$this->db->select($column == FALSE ? \"*\" : $column)->from($this->table_name);\n\t\tforeach($data as $row){\n\t\t\tif($row[\"join_type\"] != NULL){\n\t\t\t\t$this->db->join($row[\"join_table\"],$row[\"table\"].\".\".$row[\"join_key\"].\"=\".$row[\"join_table\"].\".\".$row[\"join_key\"], $row[\"join_type\"]);\n\t\t\t} else {\n\t\t\t\t$this->db->join($row[\"join_table\"],$row[\"table\"].\".\".$row[\"join_key\"].\"=\".$row[\"join_table\"].\".\".$row[\"join_key\"]);\n\t\t\t}\n\t\t}\n\t\t$this->flexigrid->build_query(FALSE);\n\t\t$return['record_count'] = $this->db->count_all_results();\n\t\t\n\t\treturn $return;\n\t}", "function get_all()\n {\n $this->db->select('products.*, company_category.category');\n $this->db->join('company_category', 'company_category.id = products.cat_id');\n return $this->db->get($this->table)->result();\n }", "function getByIdPinjam($id){\n // $this->db->where('id_peminjaman',$id);\n // $query = $this->db->get('peminjaman');\n $query = $this->db->query(\"SELECT * FROM `peminjaman` LEFT JOIN prasarana ON peminjaman.id_prasarana = prasarana.id_prasarana LEFT JOIN sarana ON sarana.id_sarana = peminjaman.id_sarana where peminjaman.id_peminjaman = '$id'\");\n return $query->result_array(); //returns result in array forms(this is not necessary btw, let me know if u need only one line, or change \"$query->result_array()\" to \"$query->row()\")\n}", "function myjoin()\n {\n $this->db\n ->select('puestos.nombre AS pnombre')\n ->select('puestos.id AS pid')\n ->select('entidades.nombre AS enombre')\n ->select('entidades.id AS eid')\n ->select('departamentos.nombre AS dnombre')\n ->select('departamentos.id AS did')\n ->select('ubicaciones.nombre AS unombre')\n ->select('ubicaciones.id AS uid')\n ->join ('puestos', 'users.puesto = puestos.id' , 'left')\n ->join ('entidades', 'users.entidad = entidades.id' , 'left')\n ->join('departamentos', 'users.departamento = departamentos.id' , 'left')\n ->join('ubicaciones', 'users.ubicaciontrabajo = ubicaciones.id' , 'left');\n //$this->db->where('users.id',7);\n return $datosuser = $this->db->get('users')->result_array();\n }", "public function pagadaall(){\n$sql = $this->db->query(\"SELECT pago_factura.*, facturas.id_factura FROM pago_factura INNER JOIN facturas ON pago_factura.factura_id = facturas.id\");\nreturn $sql;\n}", "public function getAllProduct(){\n\t\t//query for get all data from tbl_product combinning with tbl_category(catName) and tbl_brand(brandName) using INNER JOIN\n\t\t$sql = \"SELECT tbl_product.*, tbl_category.catName, tbl_brand.brandName\n\t\t\t\tFROM tbl_product\n\t\t\t\tINNER JOIN tbl_category\n\t\t\t\tON tbl_product.catId = tbl_category.catId\n\t\t\t\tINNER JOIN tbl_brand\n\t\t\t\tON tbl_product.brandId = tbl_brand.brandId\n\t\t\t\tORDER BY tbl_product.pid DESC \";\n\t\t//Same Query using Alias(giving a temporary name to a table or Column)\n\t\t/*$sql = \"SELECT p.*, c.catName, b.brandName\n\t\t\t\tFROM tbl_product AS p, tbl_category AS c, tbl_brand AS b\n\t\t\t\tWHERE p.catId = c.catId AND p.brandId = b.brandId\n\t\t\t\tORDER BY p.pid DESC \";*/\n\t\t$result = $this->db->select($sql);\n\t\tif ($result) {\n\t\t\treturn $result;\n\t\t}else{\n\t\t\t$msg = \"<span class='error'>Product not found !.</span>\";\n\t\t\treturn $msg;\n\t\t}\n\t}", "function operasiJoin3(){\n\t\t$date = date('Y-m-d');\n\t\t$query = $this->db->query(\"SELECT k.id_kondisi, k .kondisi, k.id_alat, a.id_kategori, k.tanggal, k.keterangan AS keterangan_kondisi , a.nama_alat FROM kondisi k INNER JOIN alat a ON k.id_alat = a.id_alat WHERE k.tanggal='$date' GROUP BY a.id_alat\"); \n\t\treturn $query->result();\n\t}", "function GetChannelByIdMainPackage($id_package, $category_id) {\n \n \n $data= $this->db\n ->select('\n channel.*,\n package_channel.id_package\n ')\n ->join('channel','channel.id_channel = package_channel.id_channel','left')\n //->join('channel_category', 'channel_category.id_channel_category = channel.id_channel_category', 'left')\n ->where('package_channel.id_package',$id_package)\n ->where('channel.is_delete',0)\n ->where('channel.id_channel_category', $category_id)\n //->order_by('channel_category.position', 'asc')\n //->order_by('channel_category.id_channel_category','asc')\n ->order_by('channel.position_in_type','asc')\n ->order_by('channel.id_channel','desc')\n ->get('package_channel')\n ->result_array();\n \n \n return $data;\n }", "function ambil_data()\n \t{\n \t\t$this->db->distinct();\n \t\t$this->db->select('bk.id_buku, s.nama_supplier, bk.judul, bk.tema, bk.penulis, bk.harga');\n \t\t$this->db->from('buku bk');\n \t\t$this->db->join('supplier s', 's.id_supplier = bk.id_supplier');\n \t\treturn $this->db->get($this->nama_table)->result();\n\n \t\t$data['buku'] = $this->db->order_by($this->id, $this->order);\n \t\treturn $this->db->get($this->nama_table)->result();\n \t}", "function get_all_with_asso_car_detail()\n {\n try{\n $this->db->select('*');\n $this->db->from('car_detail a ' );\n $this->db->join('car_type b', 'b.type_id=a. type_id','left');\n $this->db->join('car_brand c', 'c.brand_id=a. brand_id','left');\n $this->db->join('car_version d', 'd.ver_id=a. ver_id','left');\n $query = $this->db->get(); \n if($query->num_rows() != 0){\n return $query->result_array();\n }else{\n return false;\n }\n } catch (Exception $ex) {\n throw new Exception('Car_detail_model model : Error in get_all_with_asso_car_detail function - ' . $ex);\n } \n }", "public function moinhat(){\n $this->db->select($this->column_bosuutap);\n $this->db->from(\"$this->table\");\n $this->db->join($this->table_trans, \"$this->table.id = $this->table_trans.id\");\n $this->db->where(\"$this->table_trans.language_code\", \"vi\");\n $this->db->order_by(\"$this->table.id\", 'DESC');\n $query = $this->db->get();//var_dump($this->db->last_query()); exit();\n return $query->result();\n }", "function getPackageByID($package_id){\n\t\t $query = \"select * from package where id = $package_id\";\n\t\t $result = mysql_query($query);\n\t\t if($result){\n\t\t\t$row = mysql_fetch_assoc($result);\n\t\t\t$row['icon_image'] = $row['icon_image'] !==\"\"? $this->Check_exists_img($row['icon_image']) : \"dist/img/boxed-bg.jpg\";\n\t\t\t$row['slider_image1'] = $row['slider_image1'] !==\"\"? $this->Check_exists_img($row['slider_image1']) : \"img/boxed-bg.jpg\";\n\t\t\t\n\t\t\treturn $row;\n\t\t }\n\t\t}", "public function query_employee(){\n $this->db->select('*');\n $this->db->from('hr_pic_center');\n $this->db->join('hr_section','hr_section.sec_id = hr_pic_center.pic_sec_id');\n $this->db->join('hr_position','hr_position.position_id = hr_pic_center.pic_position_id');\n $this->db->where('hr_pic_center.pic_upd','00');\n\n $employee = $this->db->get();\n return $employee;\n }", "public function getRows($id = ''){ \r\n $this->db->select(\"*, (SELECT file_name FROM \".$this->imgTbl.\" WHERE gallery_id = \".$this->galleryTbl.\".id ORDER BY id DESC LIMIT 1) as default_image\"); \r\n $this->db->from($this->galleryTbl); \r\n if($id){ \r\n $this->db->where('id', $id); \r\n $query = $this->db->get(); \r\n $result = ($query->num_rows() > 0)?$query->row_array():array(); \r\n \r\n if(!empty($result)){ \r\n $this->db->select('*'); \r\n $this->db->from($this->imgTbl); \r\n $this->db->where('gallery_id', $result['id']); \r\n $this->db->order_by('id', 'desc'); \r\n $query = $this->db->get(); \r\n $result2 = ($query->num_rows() > 0)?$query->result_array():array(); \r\n $result['images'] = $result2; \r\n } \r\n }else{ \r\n $this->db->order_by('id', 'desc'); \r\n $query = $this->db->get(); \r\n $result = ($query->num_rows() > 0)?$query->result_array():array(); \r\n } \r\n \r\n // return fetched data \r\n return !empty($result)?$result:false; \r\n }", "public function getDetalles()\n {\n $sql = \"select z.id,z.nombre, z.identificacion, z.estado_excluido, y.descripcion, w.categoria , (SELECT a.monto FROM appexamenisw2.categorias a,\n appexamenisw2.beneficios e, appexamenisw2.estudiantes b, appexamenisw2.beneficio__estudiantes c\n where a.descripcion = 'aeo'\n and b.id = c.estudiante_id\n and e.id = c.beneficio_id\n and a.id = e.categoria_id\n and b.id = z.id) as 'aeo' ,\n (SELECT a.monto FROM appexamenisw2.categorias a,\n appexamenisw2.beneficios e, appexamenisw2.estudiantes b, appexamenisw2.beneficio__estudiantes c\n where a.descripcion = 'alim'\n and b.id = c.estudiante_id\n and e.id = c.beneficio_id\n and a.id = e.categoria_id\n and b.id = z.id) as alim,\n (SELECT a.monto FROM appexamenisw2.categorias a,\n appexamenisw2.beneficios e, appexamenisw2.estudiantes b, appexamenisw2.beneficio__estudiantes c\n where a.descripcion = 'pare'\n and b.id = c.estudiante_id\n and e.id = c.beneficio_id\n and a.id = e.categoria_id\n and b.id = z.id) as pare\n from appexamenisw2.estudiantes z, appexamenisw2.beneficios y, appexamenisw2.categorias w,\n appexamenisw2.beneficio__estudiantes v\n where z.id = v.estudiante_id\n and y.id = v.beneficio_id\n and w.id = y.categoria_id\n group by z.id,z.nombre, z.identificacion, z.id, z.estado_excluido, y.descripcion,w.categoria\n order by z.id;\";\n\n $arrayDetalles = DB::connection('mysql')->select($sql);\n $ab = array();\n $ab = $arrayDetalles;\n foreach($ab as $t){\n $t->aeo = Crypt::decrypt($t->aeo);\n $t->alim = Crypt::decrypt($t->alim);\n $t->pare = Crypt::decrypt($t->pare);\n //$t->categoria = Crypt::decrypt($t->categoria);\n //$t->monto = Crypt::decrypt($t->monto);\n //return $t->monto;\n }\n return json_encode($ab);\n }", "public function get_single_package_detail($package_id) {\n $this->db->select('*');\n $this->db->from('business_programs');\n $this->db->where('id', $package_id);\n $query = $this->db->get();\n $query_result = $query->result();\n $package_details = array();\n if (!empty($query_result)) {\n $package_details['package'] = $query_result[0];\n } else {\n $package_details['package'] = $query_result;\n }\n $this->db->select('business_services.*,business_services_details.*');\n $this->db->from('business_services');\n $this->db->join('business_services_details', 'business_services.id = business_services_details.service_id');\n $this->db->where('business_services.program_id', $package_details['package']->id);\n $query1 = $this->db->get();\n $query_result1 = $query1->result();\n\n if (!empty($query_result1)) {\n $package_details['service'] = $query_result1;\n }\n return $package_details;\n }", "function get_by_id($id)\n {\n /*$this->db->where($this->id, $id);*/\n $this->db->where('persediaan.id_persediaan', $id);\n $this->db->join('puskesmas', 'puskesmas.id_puskesmas=persediaan.id_puskesmas');\n $this->db->join('obat', 'obat.kode=persediaan.kode');\n $this->db->select('persediaan.id_persediaan');\n $this->db->select('nama_puskesmas');\n $this->db->select('kode');\n $this->db->select('nama_obat');\n $this->db->select('stok_awal');\n return $this->db->get($this->table)->row();\n }", "function Select_Peminjaman()\n \t{\n \t\t$this->db->distinct();\n \t\t$this->db->select('pg.id_kir, b.nama_barang, b.size, b.jenis, pg.stok , l.store, l.lokasi, l.alamat');\n \t\t$this->db->from('pengirim pg');\n \t\t$this->db->join('barang b', 'b.id = pg.id');\n \t\t$this->db->join('lokasi l', 'l.id_lok = pg.id_lok');\n \t\treturn $this->db->get($this->nama_table)->result();\n\n\n \t\t//$data['peminjaman'] = $this->db->order_by($this->id, $this->order);\n \t\t//return $this->db->get($this->nama_table)->result();\n \t}", "function get_by_id($id) {\n $this->db->join('tbl_ijin','tbl_out.id_ijin=tbl_ijin.id_ijin');\n $this->db->join('tbl_perusahaan','tbl_out.id_perusahaan=tbl_perusahaan.id_perusahaan');\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "function get_all_prodi()\n {\n $this->db->join('jurusan', 'jurusan.id_jurusan = prodi.fk_id_jurusan');\n $this->db->order_by('id_prodi', 'desc');\n return $this->db->get('prodi')->result_array();\n }", "public function getData()\n {\n\n\n $query = $this->db->from('job_ads')\n ->join('cities', 'cities.cityId=job_ads.cityId')\n ->join('paper', 'paper.paperId=job_ads.paperId')\n ->join('departments', 'departments.depttId=job_ads.depttId')\n ->join('categories', 'categories.catId=job_ads.catId')\n ->get();\n return $query->result();\n }", "function select($id){\r\n\t\t$query = \"SELECT *\";\r\n\t\t$query .= \" FROM db_equipment_gen INNER JOIN db_group ON equipment_id_link_group=group_id\";\r\n\t\t$query .= \" INNER JOIN db_equipment_list ON equipment_list_gen_link=equipment_gen_id\";\r\n\t\t$query .= \" INNER JOIN db_equipment_pic ON equipment_id_link_pic=equipment_pic_id\";\r\n\t\t$query .= \" LEFT JOIN db_address ON equipment_list_address_link=address_id\";\r\n\t\t$query .= \" LEFT JOIN db_status ON equipment_list_status_link=status_id WHERE equipment_list_id = :ID LIMIT 1\";\r\n\t\t\r\n\t\t$sth=$this->db->select($query,array(':ID'=>$id));\r\n\t\t\r\n\t\t\t$query = \"SELECT group_id,group_name FROM db_group WHERE group_status=0\";\r\n\t\t\t$group=$this->db->select($query,array());\r\n\t\t\t$query = \"SELECT status_id,status_name FROM db_status WHERE status_status=0\";\r\n\t\t\t$status=$this->db->select($query,array());\r\n\t\t\t$query = \"SELECT address_id,address_name FROM db_address WHERE address_status=0\";\r\n\t\t\t$address=$this->db->select($query,array());\r\n\t\t\r\n\t\t$data = array(\"equipment\",0,10,\"\",1,10,0,0,$sth,$group,$status,$address);\r\n\t\t\r\n\t\treturn $data;\r\n\t\t}", "public function ambil_id($id, $id_kamar){\n $hasil = $this->db->select('*');\n $hasil = $this->db->from('datakos');\n $hasil = $this->db->join('tipekamar','datakos.id_kos = tipekamar.id_kos', 'left');\n $hasil = $this->db->join('pemilik', 'datakos.id_pemilik = pemilik.id_pemilik');\n $hasil = $this->db->where('tipekamar.id_kos', $id );\n $hasil = $this->db->where('tipekamar.id_kamar', $id_kamar );\n $hasil = $this->db->limit('1');\n $query= $this->db->get();\n return $query->result_array();\n}", "public function get_branch_products($branch_id)\n {\n // LEFT JOIN branch_products bp ON (p.product_id = bp.product_id)\n // WHERE branch_id=$branch_id\n // GROUP BY p.product_id \"); \n\n $query = $this->db->query(\" SELECT p.product_id, p.name AS product_name,p.price AS default_price,p.product_code AS productcode,bp.*,`pc`.`name` AS catName FROM product p LEFT JOIN branch_products bp ON (p.product_id = bp.product_id) LEFT JOIN branch b ON b.branch_id = bp.branch_id\n LEFT JOIN product_category pc ON pc.product_category_id = p.product_category_id WHERE bp.branch_id=$branch_id AND b.brand_id=(SELECT brand_id FROM branch b WHERE branch_id=$branch_id) GROUP BY p.product_id \");\n\n $result = $query->result_array();\n\n //$query = $this->db->get_where('branch_products', array('branch_products_id' => $id));\n // $rows = $query->num_rows();\n // echo 'ROWS:'.$rows;die;\n //$result = $query->result_array();\n // $str = $this->db->last_query();\n // echo $str;\n\n // $totalRows = $query->num_rows();\n\n // if( $totalRows > 0 )\n // {\n // $result = $query->result_array();\n // }\n // else\n // {\n // $query = $this->db->query(\" SELECT p.product_id, p.name AS product_name,p.price AS default_price,p.product_code AS productcode,bp.*,NULL AS is_available FROM product p\n // LEFT JOIN branch_products bp ON (p.product_id = bp.product_id)\n // GROUP BY p.product_id \"); \n // $result = $query->result_array(); \n // }\n\n return $result; \n }", "function operasiJoin4($date){\t\n\t\t$query = $this->db->query(\"SELECT k.id_kondisi, k .kondisi, k.id_alat, a.id_kategori, k.tanggal, k.keterangan AS keterangan_kondisi , a.nama_alat FROM kondisi k INNER JOIN alat a ON k.id_alat = a.id_alat WHERE k.tanggal='$date' GROUP BY a.id_alat\"); \n\t\treturn $query->result();\n\t}", "function GetPackageGroupDataById($id_package) {\n \n $data = $this->db\n ->where('is_delete',0)\n ->where('id_status',1)\n ->where('id_package_group',$id_package)\n ->order_by('position','asc')\n ->get('package_group')\n ->row_array();\n \n if($data){\n // foreach ($data as $key=>$package_combo) {\n $data['item'] = $this->db\n ->where('id_package_group',$data['id_package_group'])\n ->get('package_group_item')\n ->result_array();\n\n //for christmas discount\n $real_price = $data['price'];\n $total_diskon_10 = floor( ( $real_price / 100) * 10 );\n \n $harga_natal = $real_price - $total_diskon_10; // 10% off for discount\n $data['real_price'] = $real_price;\n $data['price_diskon_10percent'] = $total_diskon_10;\n //$data['price_natal'] = $harga_natal;\n $data['price'] = $harga_natal; //final price\n\n foreach ($data['item'] as $key2 => $value) {\n $detail = $this->GetPackageByIdDataGroup($value['id_package'],$value['type']);\n $data['item'][$key2]['name'] = $detail['name'];\n $data['item'][$key2]['price'] = $detail['price'];\n }\n \n /*echo '<pre>';\n print_r($data);\n die();*/\n\n //}\n \n }\n \n \n return $data;\n }", "function projectView($connect, $id) {\n\n\n $query = \"SELECT\n\t\t\t p.`id` AS id_project,\n\t\t\t p.`name`,\n\t\t\t p.description AS `description`,\n\t\t\t GROUP_CONCAT(DISTINCT s.id) AS images,\n\t\t\t s2.id AS title_img\n\t\t\t FROM project AS p\n\t\t\t LEFT JOIN `images` AS s2\n\t\t\t ON p.`id` = s2.`id_project`\n\t\t\t AND s2.is_title = 1\n\t\t\t AND s2.to_arc = 0\n\t\t\t AND s2.on_header = 0\n\t\t\t LEFT JOIN `images` AS s\n\t\t\t ON p.`id` = s.`id_project`\n\t\t\t AND s.is_title = 0\n\t\t\t AND s.to_arc = 0\n\t\t\t AND s.on_header = 0\n\t\t\t WHERE p.`to_arc` = 0\n \t\t AND p.`is_project` = 1\n \t\t\t AND p.id = $id\n\t\t\t GROUP BY p.`id` \";\n\t$query=mysqli_query($connect, $query);\n\n\t$aResult = mysqli_fetch_array($query);\n\n//\t$aResult = explode(\",\",$aResult[\"images\"]);\n\n// if(!$aResult) {\n// DIE(\"Грешка при заявката: \".mysqli_error($connect));\n// }\n return $aResult;\n}", "function GetLayout(){\n\t//Building the query\n\t$stringBuilder = \"SELECT l.layout_id, l.font, l.font_color, l.background_color, l.default_background, l.logo, fbg.location AS backgroundLocation, flogo.location AS logoLocation \";\n\t$stringBuilder .= \"FROM layout l \";\n\t$stringBuilder .= \"INNER JOIN `file` fbg ON fbg.file_id=l.default_background \";\n\t$stringBuilder .= \"INNER JOIN `file` flogo ON flogo.file_id=l.logo \";\n\t$stringBuilder .= \"ORDER BY l.layout_id DESC \";\t\n\n\t// Preparing query\n\t$query = GetDatabaseConnection()->prepare($stringBuilder);\n\t$query->execute(array()); //Putting in the parameters\n\t$result = $query->fetchAll(); //Fetching it\n\treturn $result;\n}", "function get_table_join($select_data, $table, $join_table, $join_data, $join_type, $where_data){\n\t\n\t$this->db->select($select_data);\n\t$this->db->from($table);\n\t$this->db->join($join_table, $join_data, $join_type);\n\t$this->db->where($where_data);\n\t$this->db->order_by(\"sub1_id\",\"asc\");\n\t\n\t$query = $this->db->get();\n\t$result = $query->result_array(); \n\treturn $result;\t\n}", "function operasiJoin2(){\n\t\t$date = date('Y-m-d');\n\t\t$query = $this->db->query(\"SELECT o.id_operasi, o.operasi, o.id_alat, a.id_kategori, o.tanggal, o.keterangan, a.nama_alat FROM operasi o INNER JOIN alat a ON o.id_alat = a.id_alat\"); \n\t\treturn $query->result();\n\t}", "function get_prodi($id_prodi)\n {\n // return $this->db->get_where('prodi',array('id_prodi'=>$id_prodi))->row_array();\n\n $this->db->select ( '\n prodi.*, \n jurusan.id_jurusan as id_jurusan, \n jurusan.nama_jurusan\n ' );\n $this->db->join('jurusan', 'jurusan.id_jurusan = prodi.fk_id_jurusan');\n\n $query = $this->db->get_where('prodi', array('prodi.id_prodi' => $id_prodi));\n \n return $query->row();\n }", "function get_list()\n {\n \tif($this->table_name === null)\n \t\treturn false;\n \t\n \t$select = \"{$this->table_name}.*\";\n $select .= \", deposito.no_rekening, nasabah.NAMA_NASABAH, nasabah.ALAMAT,\";\n \t\n\t\t// ADD YOUR SELECT FROM JOIN HERE <------------------------------------------------------\n\t\t// for example $select .= \", user_log.created_date, user_log.update_date\";\n\t\t\n \tif(!empty($this->relation))\n \t\tforeach($this->relation as $relation)\n \t\t{\n \t\t\tlist($field_name , $related_table , $related_field_title) = $relation;\n \t\t\t$unique_join_name = $this->_unique_join_name($field_name);\n \t\t\t$unique_field_name = $this->_unique_field_name($field_name);\n \t\t\t\n\t\t\t\tif(strstr($related_field_title,'{'))\n \t\t\t\t$select .= \", CONCAT('\".str_replace(array('{','}'),array(\"',COALESCE({$unique_join_name}.\",\", ''),'\"),str_replace(\"'\",\"\\\\'\",$related_field_title)).\"') as $unique_field_name\";\n \t\t\telse \t\t\t\n \t\t\t\t$select .= \", $unique_join_name.$related_field_title as $unique_field_name\";\n \t\t\t\n \t\t\tif($this->field_exists($related_field_title))\n \t\t\t\t$select .= \", {$this->table_name}.$related_field_title as '{$this->table_name}.$related_field_title'\";\n \t\t}\n \t\t\n \t$this->db->select($select, false);\n \t\n // ADD YOUR JOIN HERE for example: <------------------------------------------------------\n // $this->db->join('user_log','user_log.user_id = users.id');\n $this->db->join('nasabah','nasabah.NASABAH_ID = '.$this->table_name.'.NASABAH_ID');\n \t$results = $this->db->get($this->table_name)->result();\n \t\n \treturn $results;\n }", "public function get_records() {\n\n $this->db->where('`entry_id` IN (SELECT MAX(`entry_id`) FROM `entries` GROUP BY `b_id`)', NULL, FALSE);\n $this->db->select('b_name');\n $this->db->select('entry_type');\n $this->db->select('outcome');\n $this->db->select('entries.b_id');\n\n $this->db->select(\"DATE_FORMAT(entry_date,'%b %d, %Y') AS entry_date\");\n $this->db->select('notes');\n $this->db->from('entries');\n\n $this->db->join('type', 'type.type_id = entries.type_id');\n $this->db->join('business', 'business.b_id = entries.b_id');\n $this->db->join('outcomes', 'outcomes.out_id = entries.out_id');\n\n $this->db->order_by('entry_date', 'desc');\n\n $query = $this->db->get();\n\n return $query->result();\n\n }", "public function Franchisepackagelist($masterid) {\n $this->db->select('accounts.package_id,packages.item_limit,packages.name');\n $this->db->where('accounts.account_id', $masterid);\n $this->db->where('account_type', 2);\n $this->db->from('accounts');\n $this->db->join('packages', 'accounts.package_id=packages.id');\n $this->db->group_by('accounts.package_id');\n $package = $this->db->get()->result();\n return $package;\n }", "function get_tarifkelas($id)\n {\n $this->db->select('a.*,b.kelas');\n $this->db->from('m_tarifkelas a');\n $this->db->join('m_kelas b', 'a.kdkelas = b.kdkelas', 'LEFT');\n $this->db->where('a.kdtarif', $id);\n return $this->db->get()->result();\n }", "public function lipstick()\n {\n // FROM `tb_barang` JOIN `kategori`\n // ON `tb_barang`.`id_kategori` = `kategori`.`id_kategori`\n // WHERE `id_kategori` = $id_kategori\n // \";\n // return $this->db->query($query)->result_array();\n\n return $this->db->get_where('tb_barang', ['id_kategori' => '1'])->result_array();\n }", "function get_all_m_jadwal_praktek_antrian($jadwal_praktek_fk)\n {\n $where ='';\n if ($jadwal_praktek_fk!=0) {\n $where = \"AND a.jadwal_praktek_fk='$jadwal_praktek_fk'\";\n }\n $this->db->query(\" SELECT *,a.pk as id,b.nama as pasien,c.id_session_jadwal, d.metode_bayar\n FROM m_jadwal_praktek_antrian a\n LEFT JOIN m_kontak b on a.pasien_fk = b.pk\n LEFT JOIN m_jadwal_praktek c on a.jadwal_praktek_fk = c.pk \n\t\t\t\t\t\t\t\t LEFT JOIN m_metode_pembayaran d on a.metode_pembayaran_fk = d.pk\n WHERE 1=1 $where ORDER BY jadwal_praktek_fk,nomor_urut asc\")->result_array();\n\n\n /*$this->db->get('m_jadwal_praktek_antrian')->result_array();*/\n }", "function GetPackageByIdData($id_package) {\n $data = $this->db\n ->where('id_status',1)\n ->where('is_delete',0)\n ->where('id_package',$id_package)\n ->limit(1)\n ->get('package')\n ->row_array();\n return $data;\n }", "function get_single_object_info($id,$table, $Manipulation){\r\n $this->db->select('*');\r\n // $this->db->select('c.name as country_name');\r\n $this->db->from($table);\r\n // $this->db->join('country c','c.id = u.country','LEFT');\r\n $this->db->where($Manipulation,$id);\r\n $query = $this->db->get();\r\n $query = $query->row(); \r\n return $query;\r\n }", "public function imgShow($id)\n {\n $this->db->where('id', $id);\n $query1 = $this->db->from('job_ads')\n ->join('cities', 'cities.cityId=job_ads.cityId')\n ->join('paper', 'paper.paperId=job_ads.paperId')\n ->join('departments', 'departments.depttId=job_ads.depttId')\n ->join('categories', 'categories.catId=job_ads.catId')\n ->get();\n return $query1->row_array();\n }", "public function get_recipe_information() {\n $this->db->select('recipe.id,recipe.ar_name as rec_ar_name,recipe.en_name as rec_en_name,recipe.details,recipe.barcode,recipe_information.invoice_number,recipe_information.size,recipe_information.color,recipe_information.weight,recipe_information.expirey_date,recipe_information.cost_price,recipe_information.sale_price,recipe_information.whole_price,recipe_information.qty,brand.en_name as brand_en_name,brand.ar_name as brand_ar_name,supplier.name,recipe_information.disable as info_disable,recipe.disable as rec_disable ');\n $this->db->from('recipe');\n $this->db->join('recipe_information', 'recipe.id = recipe_information.recipe_id','left');\n $this->db->join('brand', 'brand.id = recipe.brand_id','left');\n $this->db->join('supplier', 'supplier.id = recipe_information.supplier_id','left');\n $query = $this->db->get();\n return $query->result();\n }", "function get_join($data,$key=FALSE,$single=FALSE,$column=FALSE){ //Zulmi Adi Rizki 23 Juli 2013\n\t\tforeach($data as $row){\n\t\t\t$this->db->join($row[\"join_table\"],$row[\"table\"].\".\".$row[\"join_key\"].\"=\".$row[\"join_table\"].\".\".$row[\"join_key\"]);\n\t\t}\n\t\tif($key == TRUE){\n\t\t\tif(!is_array($key)){\n\t\t\t\t$this->db->where($key);\n\t\t\t} else {\n\t\t\t\t$key = array_map('htmlentities', $key);\n\t\t\t\t$this->db->where($key);\n\t\t\t}\n\t\t}\n\t\tcount($this->db->ar_orderby) || $this->db->order_by($this->order_by);\n\t\t$this->db->select($column == FALSE ? \"*\" : $column)->from($this->table_name);\n\t\t$single == FALSE || $this->db->limit(1);\n\t\t$method = $single ? 'row_array' : 'result_array';\n\t\treturn $this->db->get()->$method();\n\t}", "public function getall_details4($id){\n\t \t $query=\"SELECT ads.*,user.phone,user.address FROM ads INNER JOIN user ON ads.email=user.email WHERE no='$id' \";\n\t \t $result=$this->db->select( $query);\n\t \t return $result;\n\n\n\t }", "function tampil_data()\n\t{\n\t\t# perintah join digunakan untuk menggabungkan 2 table, yaitu penduduk dan kematian, agar data yang tampil lebih detail, karena pada tabel kematian hanya terdapat sedikit kolom, sehingga dengan menambah kolom nik, maka data yang ada di tabel penduduk juga otomatis terdeteksi karena perintah join, dengan aturan, nik harus sama antara tabel kematian dan nik yang ada di penduduk.\n\t\treturn $this->db->query(\"SELECT*FROM `kematian` left join penduduk on kematian.nik = penduduk.nik\")->result();\n\t}", "Function getsqlproduit($id)\n{\n $query='SELECT PR.prix,PR.description,PR.titre as titre,PR.prix,PR.photo,PR.ref,PR.description,PR.idcat,CA.titre as cat_titre from produits PR, categories CA where PR.idcat=CA.idcat and pr.idpr='.$id.';';\n $result=selectTable($query);\n if($result==false){\n return false;\n }else{\n return $result[0];\n }\n // test si resultat est ok et gérer renvoi\n\n}", "public function ambil_data()\n {\n $this->db->select('berita.*, kategori.nama_kategori');\n $this->db->from('berita');\n $this->db->join('kategori', 'kategori.id_kategori = berita.id_kategori','left');\n $this->db->order_by('tanggal', 'ASC');\n $query = $this->db->get();\n return $query;\n }", "function getOrder_detail($orderid){\n$reesult= array();\n$result=$this->db->where(\"order_id\", $orderid)->get('order_products')->result();\n return $result;\n }", "public function get_details_post()\n{\n $where = array('id'=>1);\n //$where1 = array('status'=>1,'company_id'=>$id);\n $data = $this->model->getAllwhere('details',$where,',id,company_name,theme_color,lat,long,gst_no,punch_line,logo,CONCAT(\"'.base_url().'\",\"asset/uploads/\",logo)AS logo,CONCAT(\"'.base_url().'\",\"asset/uploads/\",logo)AS logo','ASC');\n //print_r($data);\n $resp = array('rccode' => 200,'message' =>\"success\", 'detials'=>$data);\n $this->response($resp);\n}", "public function getAllByUser(){\n $sql = \"SELECT p.* FROM pedidos p \"\n //. \"INNER JOIN lineas_pedidos lp ON p.id = lp.pedido_id \"\n . \"WHERE p.usuario_id = {$this->getUsuario_id()} ORDER BY id DESC\";\n\n $pedido = $this->db->query($sql);\n\n \n //echo $this->db->error;\n \n return $pedido;\n \n}", "public function getImgByProduct($id){\n $this->db->select('*');\n $this->db->where('id_product', $id);\n $this->db->from($this->product_img); \n return $this->db->get();\n }", "public function getAll() {\n $this->db->select('a.id_tp as \"id_tp\", a.id_hewan as \"id_hewan\", b.nama as \"hewan\", a.id_pegawai_k as \"id_pegawai_k\", c.nama as \"Kasir\", a.id_pegawai_cs as \"id_pegawai_cs\", d.nama as \"customer_service\",\n a.kode as \"kode\", a.tanggal as \"tanggal\", \n a.sub_total as \"sub_total\", a.total_harga as \"total_harga\", a.status as \"status\",a.created_at as \"created_at\", a.updated_at as \"updated_at\",\n a.created_by as \"created_by\", a.updated_by as \"updated_by\"');\n $this->db->from('transaksi_produk a');\n $this->db->join('hewan b', 'id_hewan');\n $this->db->join('pegawai c', 'a.id_pegawai_cs = c.id_pegawai');\n $this->db->join('pegawai d', 'a.id_pegawai_cs = d.id_pegawai');\n $this->db->where('a.status =', 'Penjualan');\n return $query = $this->db->get()->result_array(); \n }", "public function query(){\n // $this->db->select('idk,id_kain,nm_kain')\n $this->db->select('*')\n ->from($this->table);\n }", "public function importData()\n {\n /*$this->db->where('delete_status','0'); \n $data = $this->db->get('item');\n \treturn $data->result();*/\n \treturn $this->db->SELECT('c.category_name,u.unit_name,i.hsn_code,t.tax_name,i.item_name,i.item_description,i.purchase_price,i.sales_price')\n\t\t\t\t\t\t\t->FROM('category c')\n\t\t\t\t\t\t\t->JOIN('item i','i.category_id=c.id')\n\t\t\t\t\t\t\t->JOIN('tax t','i.tax_id=t.tax_id')\n\t\t\t\t\t\t\t->JOIN('unit u','i.unit_id=u.id')\n\t\t\t\t\t\t\t->get()\n\t\t\t\t\t\t\t->row();\n\n /*$this->db->select('c.category_name,u.unit_name,t.tax_name,i.item_name,i.item_description,i.purchase_price,i.sales_price');\n $this->db->from('item i');\n $this->db->join('category c','c.id = i.category_id');\n $this->db->join('tax t','t.tax_id = i.tax_id');\n $this->db->join('unit u','u.id = i._id');*/\n\n\n }", "public function masterpackagelist($masterid) {\n $this->db->select('accounts.package_id,packages.item_limit,packages.name');\n $this->db->where('accounts.account_id', $masterid);\n $this->db->where('account_type', 1);\n $this->db->from('accounts');\n $this->db->join('packages', 'accounts.package_id=packages.id');\n $this->db->group_by('accounts.package_id');\n $package = $this->db->get()->result();\n return $package;\n }", "function getById($id){\n // $query = $this->db->query(\"select * FROM prasarana INNER JOIN peminjaman ON prasarana.id_prasarana = peminjaman.id_prasarana INNER JOIN verifikasi ON verifikasi.id_peminjaman = peminjaman.id_peminjaman LEFT JOIN mahasiswa ON mahasiswa.nim = peminjaman.nim LEFT JOIN staff ON staff.nip = peminjaman.nip WHERE peminjaman.nim = '123' or peminjaman.nip = '123'\");\n $query = $this->db->query(\"SELECT * FROM `peminjaman` left join prasarana on peminjaman.id_prasarana = prasarana.id_prasarana left join sarana on sarana.id_sarana = peminjaman.id_sarana LEFT JOIN pengembalian ON pengembalian.id_peminjaman = peminjaman.id_peminjaman LEFT JOIN verifikasi ON verifikasi.id_peminjaman = peminjaman.id_peminjaman LEFT JOIN mahasiswa ON mahasiswa.nim = peminjaman.nim LEFT JOIN staff ON staff.nip = peminjaman.nip WHERE peminjaman.nim = '$id' or peminjaman.nip = '$id' order by peminjaman.id_peminjaman ASC\");\n // $this->db->where('nim',$id);\n // $query = $this->db->get('peminjaman');\n return $query->result(); //returns result in array forms(this is not necessary btw, let me know if u need only one line, or change \"$query->result_array()\" to \"$query->row()\")\n}", "function goods_viewImgProduct(){\n $sql = \"select * from gd_image where get_imgid=:get_imgid order by gd_imgid ASC\";\n $args = [':get_imgid'=>$this->id];\n return $this->run($sql, $args);\n }", "public function select_driver_location1()\n {\n $this->db->select('user.*');\n\t$this->db->from('user');\n\t$this->db->join('orders', 'user.user_id = orders.driver_id', 'left'); \t \n\t$this->db->where('user.user_type', 2);\n\t$this->db->where('user.login_status', \"yes\");\n\t$query = $this->db->get();\n\t$data1= $query->result(); \n\t//print_r($data1);die;\n\t//$data11='';\n \n\t\tforeach($data1 as $row)\n\t\t{\n\t\t\n\t\t$data[]=array(\"lat\"=>$row->latitude,\"lng\"=>$row->longitude,\"description\"=>$row->sub.\"<div class='shub'><img src='http://freebizoffer.com/apptech/pick&drop/courierapp/api/upload/$row->profile_image' style='float:left;margin-right:10px; border-radius: 100%;\n border: 1px solid #fff;\n margin-left: 5px;\n margin-top: 5px;\n margin-bottom: 0px;' width='50' height='50'></td><td>Driver-\". $row->firstname .\"\". $row->lastname .\"<br>Driver Id-\". $row->user_id .\"<br>Type -\". $row->vehicle_type,\"image\"=>\"https://cdn4.iconfinder.com/data/icons/car-silhouettes/1000/city-car-512.png\",\"vehicle_type\"=>$row->vehicle_type);\n\t\t}\n\t\t//print_r($data);die;\n return $data;\n }", "public function data($id = null)\n\t{\n if($id != null)\n {\n return $this->db->get($this->table, \"*\", [$this->primaryKey => $id]);\n }\n else\n {\n // return $this->db->query(\"SELECT bidang.*, pegawai.nama FROM bidang JOIN pegawai ON bidang.nip = pegawai.nip\")->fetchAll(PDO::FETCH_ASSOC);\n return $this->db->query(\"SELECT * from bidang\")->fetchAll(PDO::FETCH_ASSOC);\n }\n\t}", "public function f_get_distPoints()\n {\n\n // $sql = $this->db->query(\"SELECT DISTINCT a.sl_no, b.bdo_name \n // FROM md_dist_point a , md_dm_bdo b \n // WHERE a.dist_cd = b.dist_cd\n // AND a.sdo = b.sdo_cd\n // AND a.bdo = b.sl_no \");\n\n$sql = $this->db->query(\"SELECT DISTINCT a.sl_no, b.bdo_name,c.sdo_name sdo_name,a.agent\n FROM md_dist_point a , md_dm_bdo b ,md_dm_sdo c\n WHERE a.dist_cd = b.dist_cd \n AND b.dist_cd = c.dist_cd\n and a.sdo =c.sl_no\n and a.bdo = b.sl_no\");\n echo $this->db->last_query();\n return $sql->result();\n \n }", "function operasiJoin(){\n\t\t$date = date('Y-m-d');\n\t\t$query = $this->db->query(\"SELECT o.id_operasi, o.operasi, o.id_alat, a.id_kategori, o.tanggal, o.keterangan, a.nama_alat FROM operasi o INNER JOIN alat a ON o.id_alat = a.id_alat WHERE o.tanggal = '$date'\"); \n\t\treturn $query->result();\n\t}", "public function selectAllJabatan(){\n\n // return $query->result();\n $this->db->select('t_user.jabatan, t_user.tipe');\n $this->db->from($this->tableName);\n $this->db->group_by('jabatan');\n return $this->db->get(); \n }", "function get_by_idpuskesmas($id)\n {\n $this->db->where('persediaan.id_puskesmas', $id);\n $this->db->join('puskesmas', 'puskesmas.id_puskesmas=persediaan.id_puskesmas');\n $this->db->join('obat', 'obat.kode=persediaan.kode');\n $this->db->select('id_persediaan');\n $this->db->select('persediaan.id_puskesmas');\n $this->db->select('persediaan.kode');\n $this->db->select('nama_obat');\n $this->db->select('stok_awal');\n return $this->db->get($this->table)->row();\n }", "function fetch_datas()\n {\n $query = $this->db->get($this->tbl_qr);\n return $query->result_array();\n }", "function get_by_id($id)\n {\n $this->db->select('*');\n $this->db->join('pohon', 'pohon.id_pohon = penanaman.id_pohon');\n $this->db->join('users', 'users.id_user = penanaman.id_user');\n $this->db->join('petak', 'petak.id_petak = penanaman.id_petak');\n $this->db->join('pendaftaran', 'pendaftaran.id_pendaftaran = penanaman.nama_penanam');\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "public function getSingleProduct($id){\r\n\r\n\t$query = \"SELECT p.*,c.catName,b.brandName\r\nFROM tbl_product as p,tbl_category as c, tbl_brand as b\r\nWHERE p.catId = c.catId AND p.brandId = b.brandId AND p.productId = '$id'\";\r\n\t$result = $this->db->select($query);\r\n\treturn $result;\r\n}", "function select_by_idbrand($id_brand) {\t\t\n\t $fields = 'ac_product.id_product AS id_product, ac_product.name_product AS name_product, ac_product.slug_product AS slug_product, ac_product.price_product AS price_product, ac_product.discount AS discount, ac_product.after_price_discount AS after_price_discount, ac_product.description_product AS description_product, ac_product.picture_product AS picture_product, ac_brand.name_brand AS id_brand, ac_brand.slug_brand AS slug_brand';\n\n $this->db->select($fields); \n $this->db->from('ac_product');\n $this->db->join('ac_brand', 'ac_brand.id_brand = ac_product.id_brand','left');\n $this->db->where(array('ac_product.id_brand'=>$id_brand));\n $this->db->or_where(array('ac_brand.slug_brand'=>$id_brand));\n $this->db->order_by('created_at','desc');\n $query = $this->db->get();\n \n return $query->row();\n\t}", "function get_project_id_gallery($project_id){\n $id=base64_decode($project_id)/98765;\n $get_all_gallery_img=\"SELECT * FROM rmd_gallery_img WHERE project_id='$id'\";\n $get_all=$this->db->query($get_all_gallery_img);\n return $get_all->result();\n }", "function ambil_data(){\n\t\t$this->db->order_by($this->id_admin,$this->order);\n\t\treturn $this->db->get($this->nama_table)->result();\n\t}", "function getImages($id,$table){\n\t\t$db;\t\t\t\t\n\t\t// Open the database connection\n\t\t//if (!($db = pg_connect( 'host=postgres.int.devisland.net dbname=db_piccicla user=piccicla password=fidelin1'))) {\n\t\tif (!($db = pg_connect( 'host=localhost dbname=landscape user=postgres password=fidelin1'))){\n\t\t// Handle errors\n\t\t // i used die because with echo the script continued\n\t\t //Echo \"{success:false, msg:'SQL ERROR: Connection failed'}\";\t\t\t \n\t\t die();\t\t\t\n\t\t}\n\t\t\t\n\t\t$sql = 'select \"LINK\" from \"landscape\".\"'.$table.'\" where \"ART_ID\"='.$id;\n\t\t\n\t\t$results = array();\n\n\t\t// Read all the data back in as associative arrays\n\t\tIf (!$rs = pg_query($db, $sql) ){\n\t\t\t\tif ($db){\n\t\t\t\t\tpg_close($db);\n\t\t\t\t}\n\t\t\t\ttrigger_error('problems reading the database');\n\t\t\t\tdie();\n\t\t}else{\t\t\n\t\twhile($obj = pg_fetch_object($rs)){\n\t\t\t$results[] = $obj;\n\t\t}}\n\t\t//close the connection\n\t\tpg_close($db);\n\t\t//print_r($results);\n\t\t//trigger_error('problems reading the database');\n //die();\n\t\treturn $results;\t\t\n}", "function lista_tamanhos_produto($id)\n {\n #return $this->db->get_where('tamanhos_produtos',array('produtoID'=>$id))->row_array();\n $this->db->select('*'); \n #$this->db->from('tamanhos_produtos');\n $this->db->where('produtoID',$id);\n $this->db->order_by('idT', 'desc');\n $this->db->join('produtos','tamanhos_produtos.produtoID = produtos.idP');\n $this->db->join('cores','tamanhos_produtos.corID = cores.id');\n $this->db->join('tamanhos','tamanhos_produtos.tamanhoID = tamanhos.id');\n return $this->db->get('tamanhos_produtos')->result_array();\n \n }", "public function getapplyjobcu($uid)\n{\n\n $this->db->select(\"user_applied_jobs.*,jobs.job_title,jobs.map_address,users.first_name,users.last_name,users.image,staff_basicinfo.current_location\");\n $this->db->join(\"jobs\",\"user_applied_jobs.job_id=jobs.id\",\"left\");\n $this->db->join(\"users\",\"user_applied_jobs.user_id=users.id\",\"left\");\n $this->db->join(\"staff_basicinfo\",\"user_applied_jobs.user_id= staff_basicinfo.staff_id\",\"left\"); \n $this->db->where(\"user_applied_jobs.job_userid\",$uid);\n $this->db->where(\"users.first_name!=\",''); \n $this->db->where(\"jobs.job_title!=\",''); \n $this->db->order_by(\"user_applied_jobs.id\",\"desc\"); \n $result = $this->db->get('user_applied_jobs')->result();\n //echo $this->db->last_query(); die();\n return $result;\t\t\n}", "public function index()\n {\n //\n //$j = 1;\n //$p = Project::all()->toArray(); \n // dd();\n //$i = Image::all()->toArray(); \n $pim=DB::select(\"SELECT projects.pid, projects.pname, projects.description, projects.category, uploads.img, uploads.des from projects INNER JOIN uploads on projects.pname = uploads.des\");\n //dd($pi);\n // foreach($p as $pi)\n //{\n /*for($j=0;$j<count($p);$j++)\n {\n $i= Image::all()->where('des', $p[$j]['pname'])->toArray(); \n \n }*/\n //$j = $j+1;\n //} \n //dd($i);\n return view('myworks', compact('pim'));\n\n }", "function find_all_sale(){\n global $db;\n $sql = \"SELECT s.id,s.qty,s.price,s.date,p.name\";\n $sql .= \" FROM sales s\";\n $sql .= \" LEFT JOIN products p ON s.product_id = p.id\";\n $sql .= \" ORDER BY s.date DESC\";\n return find_by_sql($sql);\n }", "function all(){\n try{\n $link= connecter_db();\n $rp=$link->prepare(\"select * from etudiant order by id desc\");\n $rp->execute();\n $resultat= $rp->fetchAll(); \n\n return $resultat;\n }catch(PDOException $e ){\n die (\"erreur de recuperation des etudiants dans la base de donnees \".$e->getMessage());\n }\n\n}", "function get_join_by($data,$key=FALSE,$single=FALSE,$column=FALSE){ //Zulmi Adi Rizki 23 Juli 2013\n\t\tforeach($data as $row){\n\t\t\t$this->db->join($row[\"join_table\"],$row[\"table\"].\".\".$row[\"join_key\"].\"=\".$row[\"join_table\"].\".\".$row[\"join_key\"]);\n\t\t}\n\t\tif($key == TRUE){\n\t\t\tif(!is_array($key)){\n\t\t\t\t$this->db->where($key);\n\t\t\t} else {\n\t\t\t\t$key = array_map('htmlentities', $key);\n\t\t\t\t$this->db->where($key);\n\t\t\t}\n\t\t}\n\t\tcount($this->db->ar_orderby) || $this->db->order_by($this->order_by);\n\t\t$this->db->select($column == FALSE ? \"*\" : $column)->from($this->table_name);\n\t\t$single == FALSE || $this->db->limit(1);\n\t\t$method = $single ? 'row_array' : 'result_array';\n\t\treturn $this->db->get()->$method();\n\t}", "function getDistinctVehicles($package_id){ \n\t$this->db->select('v.registration_number,v.id as vehicle_id');\n\t$this->db->distinct();\n\t$this->db->where('p.id',$package_id);\n\t$this->db->from('packages p');\n\t$this->db->join('package_itinerary pi','pi.package_id = p.id','left');\n\t$this->db->join('package_vehicles pv','pv.package_itinerary_id = pi.id','left');\n\t$this->db->join('vehicles v','pv.vehicle_id = v.id','left');\n\t$qry=$this->db->get(); \n\t\tif($qry->num_rows() > 0){\n\t\t\t\n\t\t\t$v_array= $qry->result_array();\n\t\t\tforeach ($v_array as $key=>$vehicle){\n\t\t\t\techo $vehicle['vehicle_id'];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getimagebykatid($id){\n $query = $this->db->table($this->table)\n ->where('kategori_id',$id)\n ->where('status_cd','normal')\n ->get();\n return $query;\n }", "public function fetch_multi($s_where=null,$i_start=null,$i_limit=null)\r\n {\r\n try\r\n {\r\n \t$ret_=array();\r\n \t$s_qry=\"SELECT * \r\n\t\t\t\t\tFROM \".$this->tbl.\" n \"\r\n\t\t\t\t\t.($s_where!=\"\"?$s_where:\"\" ).(is_numeric($i_start) && is_numeric($i_limit)?\r\n\t\t\t\t\t\"Limit \".intval($i_start).\",\".intval($i_limit):\"\" );\r\n $rs=$this->db->query($s_qry);\r\n $i_cnt=0;\r\n if($rs->num_rows()>0)\r\n {\r\n foreach($rs->result() as $row)\r\n {\r\n $ret_[$i_cnt][\"id\"]\t\t\t\t=\t$row->i_id;////always integer\r\n $ret_[$i_cnt][\"s_title\"]\t\t\t=\tstripslashes($row->s_title); \r\n\t\t\t\t $s_desc \t\t\t\t\t\t\t= \tstrip_tags(stripslashes($row->s_description));\r\n\t\t\t\t if(strlen($s_desc)>197)\r\n\t\t\t\t \t$s_desc \t\t\t\t\t\t= \tsubstr_replace($s_desc,'...',200);\r\n $ret_[$i_cnt][\"s_description\"]\t= \t$s_desc ; \r\n $ret_[$i_cnt][\"s_photo\"]\t\t\t=\tstripslashes($row->s_photo); \r\n $ret_[$i_cnt][\"dt_created_on\"]\t=\tdate($this->conf[\"site_date_format\"],intval($row->dt_cr_date)); \r\n $ret_[$i_cnt][\"i_is_active\"]\t\t=\tintval($row->i_is_active); \r\n\t\t\t\t $ret_[$i_cnt][\"s_is_active\"]\t\t=\t(intval($row->i_is_active)==1?\"Active\":\"Inactive\");\r\n \r\n $i_cnt++;\r\n } \r\n $rs->free_result(); \r\n }\r\n unset($s_qry,$rs,$row,$i_cnt,$s_where,$i_start,$i_limit, $s_desc);\r\n return $ret_;\r\n \r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n } \r\n }" ]
[ "0.8500659", "0.846435", "0.782018", "0.7556596", "0.70706904", "0.7030467", "0.6920653", "0.68823594", "0.6570544", "0.64417833", "0.6374068", "0.6291693", "0.6277971", "0.625091", "0.62468886", "0.6218365", "0.6213862", "0.6186039", "0.617729", "0.6164808", "0.61534756", "0.61457044", "0.6130054", "0.61297196", "0.61054796", "0.6102879", "0.6076834", "0.60707486", "0.6063085", "0.6024245", "0.6021016", "0.600384", "0.5984854", "0.59564674", "0.5955652", "0.5949004", "0.5948068", "0.59475994", "0.5946558", "0.59433824", "0.5937291", "0.59349346", "0.5931227", "0.5930218", "0.5922885", "0.5921018", "0.5914747", "0.5912532", "0.5911138", "0.5910725", "0.5906087", "0.590342", "0.59030163", "0.588451", "0.5881158", "0.5873716", "0.58673006", "0.5862057", "0.585764", "0.5846836", "0.5832235", "0.58297044", "0.5827303", "0.58181673", "0.58157116", "0.5807369", "0.580534", "0.5799784", "0.5790625", "0.57889146", "0.5786651", "0.5783988", "0.57719535", "0.57709676", "0.5767685", "0.5766103", "0.576415", "0.57618314", "0.57573026", "0.5755176", "0.5752944", "0.5752725", "0.57506704", "0.5742793", "0.574055", "0.57396024", "0.57387006", "0.573813", "0.5736366", "0.57298166", "0.5722299", "0.5722002", "0.5717773", "0.57157785", "0.57157695", "0.5711935", "0.57116085", "0.57108516", "0.57107", "0.57039416" ]
0.7391785
4
function that works to validate and cleaning the wield
function validar_campo($campo){ $campo = trim($campo); $campo = stripcslashes($campo); $campo = htmlspecialchars($campo); return $campo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sanitizeName() {\n $pattern = \"/[0-9`!@#$%^&*()_+\\-=\\[\\]{};':\\\"\\\\|,.<>\\/?~]/\";\n if (!preg_match($pattern, $this->fname) && !preg_match($pattern, $this->lname)) {\n $this->fname = trim($this->fname);\n $this->lname = trim($this->lname);\n } else {\n die(\"Error. Check your form data\");\n }\n }", "protected function sanitize() {}", "abstract public function sanitize();", "public function sanitiseData(): void\n {\n $this->firstLine = self::sanitiseString($this->firstLine);\n self::validateExistsAndLength($this->firstLine, 1000);\n $this->secondLine = self::sanitiseString($this->secondLine);\n self::validateExistsAndLength($this->secondLine, 1000);\n $this->town = self::sanitiseString($this->town);\n self::validateExistsAndLength($this->town, 255);\n $this->postcode = self::sanitiseString($this->postcode);\n self::validateExistsAndLength($this->postcode, 10);\n $this->county = self::sanitiseString($this->county);\n self::validateExistsAndLength($this->county, 255);\n $this->country = self::sanitiseString($this->country);\n self::validateExistsAndLength($this->country, 255);\n }", "function clean($before);", "function tidyInputs(){\n\tglobal $nric,$firstName,$lastName,$dob,$address1,$address2,$poCode,\n$homeNum,$handphoneNum,$email,$description;\n\tglobal $faID;\n\t\n\t$nric = preg_replace('/[^a-zA-Z0-9]/','',$nric);\n\t$firstName = preg_replace('/[^a-zA-Z0-9 ]/','',$firstName);\n\t$lastName = preg_replace('/[^a-zA-Z0-9 ]/','',$lastName);\n\t$dob = preg_replace('/[^0-9-]/','',$dob);\n\t$address1 = preg_replace('/[^a-zA-Z0-9 -_.,#]/','',$address1);\n\t$address2 = preg_replace('/[^a-zA-Z0-9 -_.,#]/','',$address2);\n\t$poCode = preg_replace('/[^0-9]/','',$poCode);\n\t$homeNum = preg_replace('/[^0-9]/','',$homeNum);\n\t$handphoneNum = preg_replace('/[^0-9]/','',$handphoneNum);\n\t$email = preg_replace('/[^a-zA-Z0-9@._-]/','',$email);\n\t$description = preg_replace('/[^a-zA-Z0-9 -_.,#]/','',$description);\n\t\n\t$faID = preg_replace('/[^0-9]/','',$faID);\n}", "public function sanitize() {\n }", "function sanitizeFields()\n\t{\n\t\tif(isset($this->sanitize) && isset($this->data[$this->name]))\n\t\t{\n\t\t\tforeach($this->data[$this->name] as $field => $value)\n\t\t\t{\n\t\t\t\tif(isset($this->sanitize[$field]))\n\t\t\t\t{\n\t\t\t\t\tif(!is_array($this->sanitize[$field]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->data[$this->name][$field] = $this->sanitize($this->data[$this->name][$field], $this->sanitize[$field]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tforeach($this->sanitize[$field] as $action)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->data[$this->name][$field] = $this->sanitize($this->data[$this->name][$field], $action);\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\n\t}", "function cleanInput($data){ //sanitize data \n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "public function sanitize_input_fields()\n {\n }", "function clean_input($data){\r\n\t\t\t\t\t$data = trim($data);\r\n\t\t\t\t\t$data = stripslashes($data);\r\n\t\t\t\t\t$data = htmlspecialchars($data);\r\n\t\t\t\t\treturn $data;\r\n\t\t\t\t}", "public function clean()\n\t{\n\t\tforeach ($this->dirtyFields AS $field)\n\t\t\t$this->cleanField($field);\n\t}", "public function validation($data){\n //trims any white space from data\n $data = trim($data); \n //removes backslashes\n $data = stripcslashes($data); \n //converts special characters to normal \n $data = htmlspecialchars($data); \n //return the formatted data\n return $data; \n }", "public function sanitize() {\n\n\t\t// load the tool that we want to use in the xss filtering process\n\t\t$this->loadTool();\n\n\t\tif (is_array($_GET) AND count($_GET) > 0) {\n\n\t\t\t$_GET = $this->clean_input_data($_GET);\n\t\t}\n\t\tif (is_array($_POST) AND count($_POST) > 0) {\n\n\t\t\t$_POST = $this->clean_input_data($_POST);\n\t\t}\n\t\tif (is_array($_COOKIE) AND count($_COOKIE) > 0) {\n\n\t\t\t$_COOKIE = $this->clean_input_data($_COOKIE);\n\t\t}\n\t\tif (is_array($_FILES) AND count($_FILES) > 0) {\n\n\t\t\t//$_FILES = $this->clean_input_data($_FILES, true);\n\t\t}\n\n\t}", "function cleanInputs($data) {\n\t$data = trim($data);\n\t$data = stripslashes($data);\n\t$data = htmlspecialchars($data);\n\treturn $data;\n}", "function cleanInputs($data) {\n\t$data = trim($data);\n\t$data = stripslashes($data);\n\t$data = htmlspecialchars($data);\n\treturn $data;\n}", "function validation($data)\n{\n\t$data = htmlspecialchars($data);\n\t$data = trim($data);\n\t$data = stripcslashes($data);\n\treturn $data;\n}", "function valid_get($data) {\n\t\t\t$data = trim($data); //trim - функция удаляет пробелы до и после слова но в самом слове пробелы не удаляет\n\t\t\t$data = stripslashes($data); //stripslashes — Удаляет экранирование символов\n\t\t\t$data = strip_tags($data); //strip_tags — Удаляет теги HTML и PHP из строки\n\t\t\t$data = htmlspecialchars($data); //htmlspecialchars — Преобразует специальные символы в HTML-сущности\n\t\t\treturn $data;\n\t }", "function validate($data)\n{\n global $db;\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function validate_input($data)\n{\n $data = stripslashes($data);\n // $data = preg_replace('/\\s+/', '', $data);\n $data = htmlspecialchars($data);\n \n //$data = trim($data);\n $data = str_replace(\"'\", \"\", $data);\n $data = str_replace(\" \", \"\", $data);\n $data = mb_strtolower($data);\n\n return $data;\n}", "function validate($data){\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "protected function _validate() {\n\t}", "function check_input($data, $problem='')\n{\n$data = trim($data);\n$data = stripslashes($data);\n$data = htmlspecialchars($data);\nif ($problem && strlen($data) == 0)\n{\nshow_error($problem);\n}\nreturn $data;\n}", "function check_input($data, $problem='')\n{\n$data = trim($data);\n$data = stripslashes($data);\n$data = htmlspecialchars($data);\nif ($problem && strlen($data) == 0)\n{\nshow_error($problem);\n}\nreturn $data;\n}", "function validate($data){\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function cleanInput($data) {\r\n\t\t\t$data = trim($data);\r\n\t\t\t$data = stripslashes($data);\r\n\t\t\t$data = htmlspecialchars($data);\r\n\t\t\treturn $data;\r\n\t\t}", "function clean_input($data){\r\n\t$data = trim($data);\r\n\t$data = stripslashes($data);\r\n\t$data = htmlspecialchars($data);\r\n\treturn $data;\t\r\n}", "public function cleanseFields() {\n $this->dictionary->remove('nospam');\n $this->dictionary->remove('blank');\n $submitVar = $this->controller->getProperty('submitVar');\n if (!empty($submitVar)) {\n $this->dictionary->remove($submitVar);\n }\n }", "function validate($data) {\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//VALIDATES INPUT DATA\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function validate($data)\n {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function validate($data){\n $data = trim($data); // Supprime les espaces (ou d'autres caracteres) en debut et fin de chaine \n $data = stripslashes($data); //Supprime les antislashs d'une chaine\n $data = htmlspecialchars($data); //Convertit les caracteres speciaux en entites HTML\n return $data;\n}", "function validate($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function validate($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "protected function prepareValidations() {}", "protected function localValidation()\n\t\t{\n\t\t}", "function StripValidator ()\n {\n\n $this->params['chars'] = array();\n\n }", "protected function prepareForValidation()\n {\n $input = array_filter(\n $this->all(['voucher-start', 'voucher-end', 'centre', 'date-sent']),\n 'strlen'\n );\n\n foreach ($input as $key => $value) {\n if (in_array($key, ['voucher-start', 'voucher-end'])) {\n $clean = Voucher::cleanCodes((array)$value);\n $input[$key] = strtoupper((array_shift($clean)));\n }\n }\n // replace old input with new input\n $this->replace($input);\n }", "function clean_input($data) \n{\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\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}", "function cleanInput($data) { \r\n return htmlspecialchars(stripslashes(trim($data)));\r\n }", "function validateSanitizeMealName($meal_mealname){\n\t\t\tglobal $validForm, $meal_mealname_Err;\t//Use the GLOBAL Version of these variables instead of making them local\n\t\t\tif($meal_mealname==\"\"){\n\t\t\t\t$meal_mealname_Err = \"*Meal name is required\";\n\t\t\t\t$validForm = false;\n\t\t\t}\n\t\t\t// Remove all illegal characters from meal name\n\t\t\t$sanitized_meal_mealname = filter_var($meal_mealname, FILTER_SANITIZE_STRING);\n\t\t\treturn $sanitized_meal_mealname;\n\t\t}", "public function clean()\n\t{\n\t\t(($sPlugin = Phpfox_Plugin::get('gradeservice.component_controller_admincp_fields_clean')) ? eval($sPlugin) : false);\n\t}", "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 clean_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "public function sanitizeFreeText()\n {\n $this->label = AdapterUtil::reencode($this->label);\n $this->street = AdapterUtil::reencode($this->street);\n $this->locality = AdapterUtil::reencode($this->locality);\n $this->region = AdapterUtil::reencode($this->region);\n $this->country = AdapterUtil::reencode($this->country);\n }", "function clean_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return !empty($data) ? $data : false;\n}", "function clean_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return !empty($data) ? $data : false;\n}", "function sanitize_text_field($str)\n {\n }", "function cleanInput($data)\n{\n    $data = trim($data);\n\n // gunakan stripslashes untuk elakkan  double escape if magic_quotes_gpc is enabledif(get_magic_quotes_gpc()){\n $data = stripslashes($data);}", "function sanitize_validate_input($data){\n\t\t \t \t$data = filter_var($data, FILTER_SANITIZE_STRING);\n\t\t \t \t//$data = filter_var($data, FILTER_VALIDATE_EMAIL);\n\t\t \t \t$data = stripcslashes($data);\n\t\t \t \t$data = trim($data);\n\t\t \t \t$data = htmlspecialchars($data);\n\t\t \t \t\n\t\t \t \treturn $data; }", "function validate($inputs) {\r\n $inputs = trim($inputs);\r\n $inputs = stripslashes($inputs);\r\n $inputs = htmlspecialchars($inputs);\r\n return $inputs;\r\n }", "public function __sanitise() { $this->username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_SPECIAL_CHARS);\n $this->password = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);\n $hashed_password = password_hash($password, PASSWORD_BCRYPT);\n $this->email = filter_input(INPUT_POST, 'email', FILTER_SANITIZE_SPECIAL_CHARS);\n $this->usertype = filter_input(INPUT_POST, 'lib_code', FILTER_SANITIZE_SPECIAL_CHARS);\n }", "function _xss_clean($field, $is_image = FALSE)\r\n\t{\r\n\t\t$this->{$field} = xss_clean($this->{$field}, $is_image);\r\n\t}", "function cleanInput($data) {\n\t\t$data = trim($data);\n\t\t$data = stripslashes($data);\n\t\t$data = htmlspecialchars($data);\n\t\treturn $data;\n\t}", "function clean_input($data) {\n $data = trim($data); // strips whitespace from beginning/end\n $data = stripslashes($data); // remove backslashes\n $data = htmlspecialchars($data); // replace special characters with HTML entities\n return $data;\n}", "function cleanInput($data)\n\t{\n\t\t$data = trim($data);\n\t\t$data = stripslashes($data);\n\t\t$data = htmlspecialchars($data);\n\t\treturn $data;\n\t}", "public function normalizeData()\n {\n if (is_numeric($this->Streetname2)) {\n $this->HouseNumber = $this->Streetname2;\n $this->Streetname2 = \"\";\n }\n\n// Sometimes people will input - To mean Idfk why are you asking me to input this?\n if ($this->Phone && strlen($this->Phone) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid Phone [$this->Phone] ignoring\"));\n $this->Phone = '';\n }\n\n if ($this->State && strlen($this->State) < 2) {\n $this->addMessage($this->getFormatedMessage(\"Invalid State [$this->State] ignoring\"));\n $this->State = '';\n }\n\n if ($this->CompanyName && strlen($this->CompanyName) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid CompanyName[$this->CompanyName] ignoring \"));\n $this->CompanyName = '';\n }\n\n $this->Description = $this->escapeTextData($this->Description);\n if ($this->Description && strlen($this->Description) > 255) {\n $this->Description = substr($this->Description, 0, 255);\n\n //Make sure we are not sending a broken special char\n $descChars = str_split($this->Description); \n for ($i = 254; $i > 251; --$i) {\n if ($descChars[$i] == '&') {\n $this->Description = substr($this->Description, 0, $i);\n }\n }\n }\n\n if($this->Description && strlen($this->Description) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid description $this->Description ignoring \"));\n $this->Description = ''; \n }\n }", "function gboutique_validate_options($input) {\r\n\t // strip html from textboxes\r\n\t$input['email'] = wp_filter_nohtml_kses($input['email']); // Sanitize textarea input (strip html tags, and escape characters)\r\n\t$input['pass'] = wp_filter_nohtml_kses($input['pass']); // Sanitize textbox input (strip html tags, and escape characters)\r\n\t$input['spreadsheetKey'] = wp_filter_nohtml_kses($input['spreadsheetKey']);\r\n\t$input['apiKey'] = wp_filter_nohtml_kses($input['apiKey']);\r\n\t$input['emailapiKey'] = wp_filter_nohtml_kses($input['emailapiKey']);\r\n\treturn $input;\r\n}", "function clean($value = \"\") {\r\n $value = trim($value);\r\n $value = stripslashes($value);\r\n $value = strip_tags($value);\r\n $value = htmlspecialchars($value);\r\n \r\n\t\treturn $value;\t\t\r\n}", "function validateInputs(){\n\tglobal $nric,$firstName,$lastName,$dob,$address1,$address2,$poCode,\n$homeNum,$handphoneNum,$email,$description;\n\tglobal $faID;\n\tif(!matchRegex($nric,'/^[a-zA-Z0-9]*$/')) { return false; }\n\tif(!matchRegex($firstName,'/^[a-zA-Z0-9 ]*$/')) { return false; }\n\tif(!matchRegex($lastName,'/^[a-zA-Z0-9 ]*$/')) { return false; }\n\tif(!matchRegex($dob,'/^[0-9-]*$/')) { return false; }\n\tif(!matchRegex($address1,'/^[a-zA-Z0-9 -_.,#]*$/')) { return false; }\n\tif(!matchRegex($address2,'/^[a-zA-Z0-9 -_.,#]*$/')) { return false; }\n\tif(!matchRegex($poCode,'/^[0-9]*$/')) { return false; }\n\tif(!matchRegex($homeNum,'/^[0-9]*$/')) { return false; }\n\tif(!matchRegex($handphoneNum,'/^[0-9]*$/')) { return false; }\n\tif(!matchRegex($email,'/^[a-zA-Z0-9@._-]*$/')) { return false; }\n\tif(!matchRegex($description,'/^[a-zA-Z0-9 -_.,#]*$/')) { return false; }\n\t\n\treturn true;\n}", "function cleanseTheData($data) \n\t\t{\n \t\t\t$data = trim($data);\n\t\t\t$data = stripslashes($data);\n\t\t\t$data = htmlspecialchars($data);\n\t\t\treturn $data;\n\t\t}", "public function validated();", "public function clean()\n\t{\n\t}", "public function clean() {}", "public static function validate() {}", "public function validate_fields() {\n \n\t\t\n \n\t\t}", "public function validation();", "function make_clean($value) {\n\t\t$legal_chars = \"%[^0-9a-zA-Z������� ]%\"; //allow letters, numbers & space\n\t\t$new_value = preg_replace($legal_chars,\"\",$value); //replace with \"\"\n\t\treturn $new_value;\n\t}", "function _sanitize_text_fields($str, $keep_newlines = \\false)\n {\n }", "public function sanitize()\n {\n $purifier = $this->_purifier;\n $this->_sanitized_data = array_map(\n function ($field) use ($purifier) {\n return $purifier->purify($field);\n },\n $this->_data\n );\n }", "public function validation($data) {\n\t\t $data = trim($data);\n\t\t $data = htmlspecialchars($data);\n\t \t $data = strip_tags($data);\n\n\t\t return $data;\n\t }", "function clean($data){\n\t\t$this->data = $data;\n\t\t$data = trim($data);\n\t\t$data = stripcslashes($data);\n\t\t$data = htmlspecialchars($data);\n\t\treturn $data;\n\t}", "private static function clean_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function check_input($data)\n{\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n\t$data = strtolower($data);\n return $data;\n}", "function cleanInput($data) { \n return htmlspecialchars(stripslashes(trim($data)));\n}", "function validate()\n\t{\n\t}", "function cmh_validate_options($input) {\r\n\t // strip html from textboxes\r\n\t$input['textarea_one'] = wp_filter_nohtml_kses($input['textarea_one']); // Sanitize textarea input (strip html tags, and escape characters)\r\n\t$input['txt_one'] = wp_filter_nohtml_kses($input['txt_one']); // Sanitize textbox input (strip html tags, and escape characters)\r\n\treturn $input;\r\n}", "function cleanData($data){\n\t\t$data = trim($data);\n\t\t$data = stripslashes($data);\n\t\t$data = htmlspecialchars($data);\n\t\treturn $data;\n\t}", "abstract public function validate();", "abstract public function validate();", "function cleanInput($data) { \n return htmlspecialchars(stripslashes(trim($data)));\n}", "function cleanInput ($input) { // meie e-mail jõuab siia ning salvestatakse inputi sisse\n\n //input = sisestatud e-mail\n\n $input = trim ($input);\n $input = stripslashes ($input); //võtab kaldkriipsud ära\n $input = htmlspecialchars ($input); //\n return $input;\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}", "private function proccess()\n {\n foreach ($this->validate as $name => $value) {\n $rules = $this->rules[$name];\n \n /* Let's see is this value a required, e.g not empty */\n if (preg_match('~req~', $rules)) {\n if ($this->isEmpty($value)) {\n $this->errors[] = $this->filterName($name) . ' can\\'t be empty, please enter required data.';\n continue; // We will display only one error per input\n }\n }\n \n /**\n * Let's see is this value needs to be integer\n */\n if (preg_match('~int~', $rules)) {\n if (!$this->isInt($value)) {\n $this->errors[] = $this->filterName($name) . ' is not number, please enter number.';\n continue; // We will display only one error per input\n }\n }\n \n /**\n * Let's see is this value needs to be text\n */\n if (preg_match('~text~', $rules)) {\n if (!$this->isText($value)) {\n $this->errors[] = $this->filterName($name) . ' is not text, please enter only letters.';\n continue; // We will display only one error per input\n }\n }\n \n /* This is good input */\n $this->data[$name] = $value;\n }\n }", "function check_input ($data)\n{\n $data = trim($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function check_input($data){\n if(isset($data)){\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n $data = strip_tags($data);\n $data = htmlentities($data);\n return $data;\n }\n}", "public function clean() {\n\t\t\n\t}", "function check_input($data, $problem='')\n {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n if ($problem && strlen($data) == 0){\n show_error($problem);\n }\n return $data;\n }", "public function clean() {\n\t\tglobal $warnings;\n\n\t\t// it's not at CBW\n\t\tif ($this->location != 1) {\n\t\t\t$warnings[2][] = \"keg \" . $this->id . \"_\" . $this->size . \" was not marked as being at HQ\";\n\t\t\t$this->location = 1;\n\t\t}\n\t\t// it had beer in it\n\t\tif ($this->beer != 0) {\n\t\t\t$warnings[2][] = \"keg \" . $this->id . \"_\" . $this->size . \" was not marked as empty\";\n\t\t\t$this->beer = 0;\n\t\t}\n\t\t// it's not dirty\n\t\tif ($this->status != 1) {\n\t\t\t$warnings[2][] = \"keg \" . $this->id . \"_\" . $this->size . \" was not marked as dirty\";\n\t\t}\n\n\t\t$this->status = 2;\n\t\t$this->update();\n\t}", "protected function prepareForValidation()\n {\n if($this->name != null) {\n $this->merge([\n 'name' => filter_var($this->name, FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->email != null) {\n $this->merge([\n 'email' => filter_var(trim($this->email), FILTER_SANITIZE_EMAIL),\n ]);\n }\n\n if($this->leader != null) {\n $this->merge([\n 'leader' => filter_var($this->leader, FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->gruplac != null) {\n $this->merge([\n 'gruplac' => filter_var(trim($this->gruplac), FILTER_SANITIZE_URL),\n ]);\n }\n\n if($this->minciencias_code != null) {\n $this->merge([\n 'minciencias_code' => filter_var(trim($this->minciencias_code), FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->minciencias_category != null) {\n $this->merge([\n 'minciencias_category' => filter_var($this->minciencias_category, FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->website != null) {\n $this->merge([\n 'website' => filter_var(trim($this->website), FILTER_SANITIZE_URL),\n ]);\n }\n\n if($this->educational_institution_id != null) {\n $this->merge([\n 'educational_institution_id' => (integer) filter_var($this->educational_institution_id, FILTER_SANITIZE_NUMBER_INT),\n ]);\n }\n }", "function clean($data) {\n\t$data = trim($data);\n\t$data = stripslashes($data);\n\t$data = htmlspecialchars($data);\n\treturn $data;\n}", "function check_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function validar_campo($campo){\n\n $campo = trim($campo);\n $campo = stripcslashes($campo);\n $campo = htmlspecialchars($campo);\n\n return $campo;\n}", "function cleanInput($data) {\n\t\n\treturn htmlspecialchars(stripslashes(trim($data)));\n}", "public function clean($data)\n {\n foreach($this->getFields() as $name => $field) {\n $field->clean($data[$name]);\n }\n }", "function _prepare_validation()\n\t{\n\t\t$this->load->library('form_validation');\t\n\t\t$this->form_validation->set_error_delimiters('<div class=\"error\">', '</div>');\n\t\t//Setting Validation Rule\t\n\t\t$this->form_validation->set_rules('samity_id','Code','trim|required|xss_clean|max_length[100]');\n\t\t$this->form_validation->set_rules('cbo_samity_day','Samity Day','trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('txt_effective_date','Effective Date','trim|required|max_length[10]|is_date|xss_clean|callback_check_samity_effective_date');\t\n\t}", "public abstract function validation();", "function validateSanitizeMealIngredients($meal_ingredients){\n\t\t\tglobal $validForm, $meal_ingredients_Err;\n\t\t\t$sanitized_meal_ingredients = filter_var($meal_ingredients, FILTER_SANITIZE_STRING);\n\t\t\treturn $sanitized_meal_ingredients;\n\t\t}", "abstract function clean ();", "function validate_input(string $data) :string\n{\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}" ]
[ "0.67863536", "0.67008454", "0.6636676", "0.65600944", "0.6522659", "0.65072054", "0.6492995", "0.64596725", "0.6452155", "0.6430617", "0.6430045", "0.64240617", "0.6385068", "0.6360522", "0.62608695", "0.62608695", "0.62220424", "0.6191984", "0.6191954", "0.6177083", "0.6176196", "0.61750656", "0.6169938", "0.6169938", "0.61629754", "0.6157903", "0.6154058", "0.6148946", "0.6146072", "0.6142142", "0.61294407", "0.611972", "0.611972", "0.61033887", "0.610087", "0.60926825", "0.6084358", "0.60796386", "0.60780656", "0.60736686", "0.60622764", "0.6056168", "0.6038143", "0.60380167", "0.60330904", "0.6029754", "0.6029754", "0.6027107", "0.60250574", "0.6021774", "0.60137045", "0.60072684", "0.6004497", "0.5996872", "0.5988936", "0.5979031", "0.59712213", "0.59668684", "0.5951271", "0.5937141", "0.5932463", "0.5932403", "0.59233636", "0.5918071", "0.59033865", "0.5901552", "0.58970624", "0.58939445", "0.5893626", "0.5889456", "0.5889079", "0.5887538", "0.58805317", "0.5879789", "0.58796895", "0.58708525", "0.5867562", "0.58664846", "0.5863139", "0.5863139", "0.5862362", "0.58595794", "0.5855763", "0.5851884", "0.584177", "0.5840543", "0.5840362", "0.58399945", "0.58358854", "0.583459", "0.5831023", "0.5828291", "0.5814982", "0.58003676", "0.5798395", "0.57981515", "0.57972324", "0.5794155", "0.5791234", "0.5786698" ]
0.59906316
54
this is a recommended way to declare event handlers
public static function boot() { parent::boot(); static::deleting(function($category) { $ids = $category->posts()->pluck("id")->toArray(); // set category id to default (uncategorize) Post::whereIn('id', $ids)->update(['category_id' => 1]); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function defineHandlers() {\n EventsManager::listen('on_rawtext_to_richtext', 'on_rawtext_to_richtext');\n EventsManager::listen('on_daily', 'on_daily');\n EventsManager::listen('on_wireframe_updates', 'on_wireframe_updates');\n }", "public static function events();", "function defineHandlers(&$events) {\n /*\n * example handlers see: handlers/on_admin_sections.php and handlers/on_build_menu.php\n * \n */\n\n //$events->listen('on_build_menu', 'on_build_menu');\n //$events->listen('on_admin_sections', 'on_admin_sections');\n }", "public function attachEvents();", "public function attachEvents();", "public function onEvent();", "public static function __events () {\n \n }", "abstract function HookEvents();", "function ibase_set_event_handler($event_handler, $event_name1, $event_name2 = NULL, $_ = NULL)\n{\n}", "function ibase_set_event_handler($connection, $event_handler, $event_name1, $event_name2 = NULL, $_ = NULL)\n{\n}", "private function init_event_listeners() {\n\t\t// add_action('wp_ajax_example_action', [$this, 'example_function']);\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 }", "function eventclass_slot()\n\t{\n\n//\tonscreen events\n\n\t}", "public function setEventHandlers()\n {\n Event::on(Menu::className(), ActiveRecord::EVENT_AFTER_DELETE, function ($event) {\n \n // Delete the children\n if (!$event->sender->deleteChildren())\n throw new \\yii\\base\\Exception(Yii::t('app', 'There was an error while deleting this item'));\n });\n \n // Set eventhandlers for the 'MenuItem' model\n Event::on(MenuItem::className(), ActiveRecord::EVENT_AFTER_DELETE, function ($event) {\n \n // Delete the children\n if (!$event->sender->deleteChildren())\n throw new \\yii\\base\\Exception(Yii::t('app', 'There was an error while deleting this item'));\n }); \n }", "protected function initHandlers()\n\t{\n\t}", "public function registerEvents()\n {\n if (!empty($this->clientEvents)) {\n $js = [];\n foreach ($this->clientEvents as $event => $handle) {\n $handle = new JsExpression($handle);\n $js[] = \"$({$this->var}).on('{$event}', {$handle});\";\n }\n $this->getView()->registerJs(implode(PHP_EOL, $js));\n }\n }", "function onEvent($element_id)\r\n\t{\r\n\t\t\r\n\t}", "private function registerEventHandlers()\n {\n $this->subscribeEvent(\n 'Enlight_Controller_Dispatcher_ControllerPath_Frontend_PaymentProcessorCsrf',\n 'onGetControllerPathFrontend'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Dispatcher_ControllerPath_Frontend_PaymentProcessor',\n 'onGetControllerPathFrontend'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Dispatcher_ControllerPath_Frontend_PaymentInformation',\n 'onGetControllerPathFrontendInformation'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Backend_Order_Save',\n 'onOrderSaveAction'\n );\n $this->subscribeEvent(\n 'Enlight_Bootstrap_InitResource_VrpayecommerceClient',\n 'onInitResourceVrpayecommerceClient'\n );\n $this->subscribeEvent(\n 'Shopware_Modules_Admin_GetPaymentMeans_DataFilter',\n 'onGetPaymentMeans'\n );\n $this->subscribeEvent(\n 'Shopware_Modules_Admin_GetPaymentMeanById_DataFilter',\n 'onGetPaymentMeanById'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch',\n 'onPostDispatch'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Frontend_Account',\n 'onPostDispatchTemplate'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Frontend_Checkout',\n 'onPostDispatchFinish'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Frontend_Checkout',\n 'onFrontendCheckoutPostDispatch'\n );\n }", "public function get_handler()\n {\n }", "public function HookEvents() {\n\t\tadd_action( 'add_attachment', array( $this, 'EventFileUploaded' ) );\n\t\tadd_action( 'delete_attachment', array( $this, 'EventFileUploadedDeleted' ) );\n\t\tadd_action( 'admin_init', array( $this, 'EventAdminInit' ) );\n\t}", "function get_handler() {\r\n }", "abstract protected function handle($event);", "public function add_event_handler($event, $callback);", "public function send_events()\n {\n }", "private static function event()\n {\n $files = ['Event', 'EventListener'];\n $folder = static::$root.'Event'.'/';\n\n self::call($files, $folder);\n\n $files = ['ManyListenersArgumentsException'];\n $folder = static::$root.'Event/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "abstract protected function registerHandlers();", "abstract public function handler() : void;", "private function createMyEvents()\n {\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Frontend_Checkout',\n 'onPostDispatchCheckoutSecure'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_Checkout_PreRedirect',\n 'onPreRedirectToPayPal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch_Frontend_PaymentPaypal',\n 'onPreDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_Webhook',\n 'onPaymentPaypalWebhook'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_PlusRedirect',\n 'onPaymentPaypalPlusRedirect'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Frontend_Account',\n 'onPostDispatchAccount'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Javascript',\n 'onCollectJavascript'\n );\n $this->subscribeEvent(\n 'Shopware_Components_Document::assignValues::after',\n 'onBeforeRenderDocument'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Backend_Config',\n 'onPostDispatchConfig'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_Order',\n 'onPostDispatchOrder'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_PaymentPaypal',\n 'onPostDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Less',\n 'addLessFiles'\n );\n $this->subscribeEvent(\n 'Enlight_Bootstrap_InitResource_paypal_plus.rest_client',\n 'onInitRestClient'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Dispatcher_ControllerPath_Api_PaypalPaymentInstruction',\n 'onGetPaymentInstructionsApiController'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Front_StartDispatch',\n 'onEnlightControllerFrontStartDispatch'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch',\n 'onPreDispatchSecure'\n );\n }", "public function handles_events()\n\t{\n\t\treturn false;\n\t}", "protected function setupListeners()\n {\n //\n }", "public function __registerEvents() {\n $code = \"wk_pa_add_column_menu\";\n $trigger = \"admin/view/common/column_left/before\";\n $action = \"wk_pricealert/event/addCommonMenu\";\n $this->helper_event->addEvent($code, $trigger, $action);\n\n //add event to add the menu in the admin end code ends here\n $code = \"wk_pa_addJs_product\";\n $trigger = \"admin/view/catalog/product_form/before\";\n $action = \"wk_pricealert/event/addProductPageJs\";\n $this->helper_event->addEvent($code, $trigger, $action);\n\n //add event to add the menu in the admin end code ends here\n $code = \"wk_pa_product_model_add\";\n $trigger = \"admin/model/catalog/product/addProduct/after\";\n $action = \"wk_pricealert/event/addAlertProduct\";\n $this->helper_event->addEvent($code, $trigger, $action);\n\n $code = \"wk_pa_product_model_update\";\n $trigger = \"admin/model/catalog/product/editProduct/before\";\n $action = \"wk_pricealert/event/updateAlertProduct\";\n $this->helper_event->addEvent($code, $trigger, $action);\n\n //add event to add the menu in the admin end code ends here\n $code = \"wk_pricealert_addJs_edit\";\n $trigger = \"admin/controller/catalog/product/add/before\";\n $action = \"wk_pricealert/event/addProductPageJs\";\n $this->helper_event->addEvent($code, $trigger, $action);\n //add event to add the menu in the admin end code ends here\n $code = \"wk_pricealert_addJs_add\";\n $trigger = \"admin/controller/catalog/product/edit/before\";\n $action = \"wk_pricealert/event/addProductPageJs\";\n $this->helper_event->addEvent($code, $trigger, $action);\n\n $code = \"wk_pricealert_header\";\n $trigger = \"catalog/view/common/header/before\";\n $action = \"extension/module/wk_pricealert/addJsFile\";\n $this->model_setting_event->addEvent($code, $trigger, $action);\n\n $code = \"wk_pricealert_account_view\";\n $trigger = \"catalog/controller/account/account/before\";\n $action = \"extension/module/wk_pricealert/addAccountPageJsFile\";\n $this->model_setting_event->addEvent($code, $trigger, $action);\n\n $code = \"wk_pa_product_model_delete\";\n $trigger = \"admin/model/catalog/product/deleteProduct/before\";\n $action = \"wk_pricealert/event/deleteAlertProduct\";\n $this->helper_event->addEvent($code, $trigger, $action);\n }", "function Events()\n\t{\n\t\t/* Calls the WebPage's constructor. This must be done to\n\t\t ensure that WebPage is properly instantiated. The \n\t\t parameter specifies a string to be displayed in the\n\t\t browser's title bar. */\n\t\tparent::WebPage('Demonstrating basic Events');\n\t\t// Calls the CreateButton function, which is defined below\n\t\t$this->CreateButton();\n\t}", "public function registerEvents() {\n $this->cx->getEvents()->addEvent('model/expired');\n $this->cx->getEvents()->addEvent('model/terminated');\n $this->cx->getEvents()->addEvent('model/payComplete');\n }", "protected function registerInputEvents() {\n\t\t$this->getEventLoop()->addEventListener('HANG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->offHook = (bool)$event['value'];\n\n\t\t\t// Trigger specific events for receiver up and down states\n\t\t\t$eventName = $this->isOffHook() ? 'RECEIVER_UP' : 'RECEIVER_DOWN';\n\t\t\t$this->fireEvents($eventName, $event);\n\t\t});\n\n\t\t$this->getEventLoop()->addEventListener('TRIG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->dialling = (bool)$event['value'];\n\t\t});\n\n\t\t// Proxy registration for all EventLoop events to pass them back up to our own listeners\n\t\t$this->getEventLoop()->addEventListener(true, function ($event, $type) {\n\t\t\t// Fire event to our own listeners\n\t\t\t$this->fireEvents($type, $event);\n\t\t});\n\t}", "function vtlib_handler($modulename, $event_type) {\n\t\tif($event_type == 'module.postinstall') {\n\t\t\t// TODO Handle post installation actions\n\t\t\t$this->setModuleSeqNumber('configure', $modulename, $modulename.'-', '0000001');\n\t\t} else if($event_type == 'module.disabled') {\n\t\t\t// TODO Handle actions when this module is disabled.\n\t\t} else if($event_type == 'module.enabled') {\n\t\t\t// TODO Handle actions when this module is enabled.\n\t\t} else if($event_type == 'module.preuninstall') {\n\t\t\t// TODO Handle actions when this module is about to be deleted.\n\t\t} else if($event_type == 'module.preupdate') {\n\t\t\t// TODO Handle actions before this module is updated.\n\t\t} else if($event_type == 'module.postupdate') {\n\t\t\t// TODO Handle actions after this module is updated.\n\t\t}\n\t}", "public function setupEventListeners()\r\n\t{\r\n\t\t$blueprints = craft()->courier_blueprints->getAllBlueprints();\r\n\t\t$availableEvents = $this->getAvailableEvents();\r\n\r\n\t\t// Setup event listeners for each blueprint\r\n\t\tforeach ($blueprints as $blueprint) {\r\n\t\t\tif (!$blueprint->eventTriggers) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tforeach ($blueprint->eventTriggers as $event) {\r\n\t\t\t\t// Is event currently enabled?\r\n\t\t\t\tif (!isset($availableEvents[$event])) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tcraft()->on($event, function(Event $event) use ($blueprint) {\r\n\t\t\t\t\tcraft()->courier_blueprints->checkEventConditions($event, $blueprint);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// On the event that an email is sent, create a successful delivery record\r\n\t\tcraft()->on('courier_emails.onAfterBlueprintEmailSent', [\r\n\t\t\tcraft()->courier_deliveries,\r\n\t\t\t'createDelivery'\r\n\t\t]);\r\n\r\n\t\t// On the event that an email fails to send, create a failed delivery record\r\n\t\tcraft()->on('courier_emails.onAfterBlueprintEmailFailed', [\r\n\t\t\tcraft()->courier_deliveries,\r\n\t\t\t'createDelivery',\r\n\t\t]);\r\n\t}", "function _on_handle($handler, $args)\n {\n $this->_request_data['schemadb'] = midcom_helper_datamanager2_schema::load_database($this->_config->get('schemadb'));\n $this->_request_data['schemadb_location'] = midcom_helper_datamanager2_schema::load_database($this->_config->get('schemadb_location'));\n $this->_request_data['prefix'] = $_MIDCOM->get_context_data(MIDCOM_CONTEXT_ANCHORPREFIX);\n $this->_request_data['datamanager'] = new midcom_helper_datamanager2_datamanager($this->_request_data['schemadb']);\n $this->_request_data['datamanager_location'] = new midcom_helper_datamanager2_datamanager($this->_request_data['schemadb_location']);\n \n $_MIDCOM->add_link_head(array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => MIDCOM_STATIC_URL . '/fi.kilonkipinat.events/fi_kilonkipinat_events.css', 'media' => 'all'));\n \n $_MIDCOM->add_link_head\n (\n array\n (\n 'rel' => 'alternate',\n 'type' => 'application/rss+xml',\n 'title' => $this->_l10n->get('rss 2.0 feed'),\n 'href' => $_MIDCOM->get_context_data(MIDCOM_CONTEXT_ANCHORPREFIX) . 'rss.xml',\n )\n );\n\n $this->_populate_node_toolbar();\n\n return true;\n }", "function setEventType() // OK\n {\n }", "private function subscribeEvents()\n {\n // Subscribe the needed event for less merge and compression\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Less',\n 'addLessFiles'\n );\n\n $this->subscribeEvent(\n 'Shopware_Controllers_Widgets_Emotion_AddElement',\n 'onEmotionAddElement'\n );\n\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Frontend',\n 'onPostDispatchFrontend'\n );\n }", "function init() {\n\t\tevent_declare('EVENT_MANAGE_USER_FORM');\n\t\tplugin_event_hook('EVENT_MANAGE_USER_FORM', 'DefUgroup');\n\t\t// Delete usergroups when user is deleted\n\t\tevent_declare('EVENT_ACCOUNT_DELETED');\n\t\tplugin_event_hook('EVENT_ACCOUNT_DELETED', 'DelUgroup');\n\t}", "public function listeners($event);", "public function getter_event_callback()\n\t{\n\t\treturn $this->event_callback = \"on\".$this->qualified_name;\n\t}", "public function insertMenuEvent(){\n //\n }", "abstract public function getEventName();", "public function setDispatcherEvents()\n\t{\n\t\t$this->dispatcher = (new Dispatcher())->register($this->routes);\n\t}", "private function init_nopriv_event_listeners() {\n\t\t// add_action('wp_ajax_nopriv_example_action', [$this, 'example_function']);\n\t}", "public function event()\r\n {\r\n\r\n $event = new Event();\r\n $event->afterDelete = function (EyufScholar $model) {\r\n //User::deleteAll(['id' => $model->user_id]);\r\n };\r\n\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n /// Az::$app->App->eyuf->scholar->sendNotifyToAdmin($model);\r\n };\r\n /*\r\n $event->beforeDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterRefresh = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterFind = function (EyufScholar $model) {\r\n return null;\r\n };\r\n */\r\n return $event;\r\n\r\n }", "public function subscribe(): void\n {\n foreach (static::$eventHandlerMap as $eventName => $handler) {\n $this->events->listen($eventName, [$this, $handler]);\n }\n }", "public static function event_method()\n {\n return true;\n }", "protected function registerListeners()\n {\n }", "public function __initEvents($app)\n {\n }", "function vtlib_handler($moduleName, $eventType) {\n\t\tglobal $adb;\n \t\tif($eventType == 'module.postinstall') {\n\t\t\t$this->addlinks();\n\t\t} else if($eventType == 'module.enabled') {\n\t\t\t$this->addlinks();\n\t\t} else if($eventType == 'module.disabled') {\n\t\t\t$this->removelinks();\n\t\t} else if($eventType == 'module.preuninstall') {\n\t\t\t$this->removelinks();\n\t\t} else if($eventType == 'module.preupdate') {\n\t\t\t// TODO Handle actions before this module is updated.\n\t\t} else if($eventType == 'module.postupdate') {\n\t\t\t// TODO Handle actions after this module is updated.\n\t\t}\n \t}", "public function getEventDispatch();", "public function registerEvents() {\n $this->registerEvent(Api_TraderApiEvents::AJAX_PLUGIN, \"ajaxPlugin\");\n $this->registerEvent(Api_TraderApiEvents::USER_REGISTER_CHECK, \"userRegisterCheck\");\n $this->registerEvent(Api_TraderApiEvents::USER_NEW, \"userNew\");\n $this->registerEvent(Api_TraderApiEvents::USER_DELETE, \"userDelete\");\n $this->registerEvent(Api_TraderApiEvents::USER_PROFILE_CHECK, \"userProfileCheck\");\n $this->registerEvent(Api_TraderApiEvents::USER_PROFILE_CHANGE, \"userProfileChange\");\n $this->registerEvent(Api_TraderApiEvents::ADMIN_WELCOME_TODO, \"adminWelcomeTodo\");\n $this->registerEvent(Api_TraderApiEvents::TEMPLATE_PLUGIN_FUNCTION, \"templateFunction\");\n return true;\n }", "public function handle($event)\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 testEventCallBackCreate()\n {\n }", "public function aim_register_handler()\r\n\t{\r\n\t\tforeach (func_get_args() as $arg) {\r\n\t\t\tif (is_array($arg) && count($arg) >= 1) {\r\n\t\t\t\tforeach ($arg as $k => $v) {\r\n if (empty($v[1]) || is_null($v[1]) || !isset($v[1])) $v[1] = CLIENT_DEFAULT;\r\n $k = strtolower($k);\r\n\t\t\t\t\t$this->core->handlers[$k] = array('name' => $k, 'callback' => $v[0], 'type' => $v[1]);\r\n\t\t\t\t} \r\n\t\t\t} else {\r\n\t\t\t\t$this->core->aim_debug('Empty/invalid array cannot be a handler in ' . __FUNCTION__, AIM_WARN);\r\n\t\t\t} \r\n\t\t}\r\n\t}", "function __construct(){\n\t\tcs_event_hook('head_script', NULL, array($this, 'head_script'));\n\t\t\n\t\t// hook buttons into head_css\n\t\tcs_event_hook('head_css', NULL, array($this, 'head_css'));\n\t\t\n\t\t// hook buttons in theme layer\n\t\tcs_event_hook('ra_post_buttons', NULL, array($this, 'ra_post_buttons'));\n\t\t\n\t\t\n\t}", "public function setupErrorHandler()\n {\n $this->error_handler = set_error_handler(array($this, 'error_handler'));\n }", "protected function _subscribeToEngineEvents()\n {\n $controller = $this->getController();\n $controller->addEventListener(\n Streamwide_Engine_Events_Event::ENDOFFAX,\n array(\n 'callback' => array( $this, 'onEndOfFax' ),\n 'options' => array( 'autoRemove' => 'before' )\n )\n );\n $controller->addEventListener(\n Streamwide_Engine_Events_Event::FAXPAGE,\n array( 'callback' => array( $this, 'onFaxPage' ) )\n );\n }", "private function _initEvents()\n {\n $onOrder = function(array $params, Pike_Grid_DataSource_Solarium $dataSource) {\n $sidx = $params['sidx'];\n\n switch (strtoupper($params['sord'])) {\n case 'DESC':\n $sord = Solarium_Query_Select::SORT_DESC;\n break;\n default:\n $sord = Solarium_Query_Select::SORT_ASC;\n break;\n }\n\n $query = $dataSource->getQuery();\n $query->clearSorts();\n $query->addSort($sidx, $sord);\n };\n\n $this->_onOrder = $onOrder;\n\n $onFilter = function(array $params, Pike_Grid_DataSource_Solarium $dataSource) {\n $solariumQueryHelper = new Solarium_Query_Helper();\n $filters = json_decode($params['filters']);\n\n $query = $dataSource->getQuery();\n $queryString = '';\n\n foreach ($filters->rules as $field) {\n if ('' != $field->data) {\n $queryString .= $field->field . ':'\n . $solariumQueryHelper->escapeTerm($field->data) . ' AND ';\n }\n }\n\n if ('' != $queryString) {\n $queryString = substr($queryString, 0, strlen($queryString) - 4);\n $query->setQuery($queryString);\n }\n };\n\n $this->_onFilter = $onFilter;\n }", "public function getModelEvents();", "public function postEventadd();", "abstract protected function register_hook_callbacks();", "public function on($eventName, $callable);", "public function on($eventName, $callable);", "private function listeners()\n {\n foreach ($this['config']['listeners'] as $eventName => $classService) {\n $this['dispatcher']->addListener($classService::NAME, [new $classService($this), 'dispatch']);\n }\n }", "public function listeners($eventName);", "function setHandlers($a_xml_parser)\n\t{\n\t\txml_set_object($a_xml_parser,$this);\n\t\txml_set_element_handler($a_xml_parser,'handlerBeginTag','handlerEndTag');\n\t\txml_set_character_data_handler($a_xml_parser,'handlerCharacterData');\n\t}", "public static function init() {\n set_error_handler(array(\"app\\core\\ErrorHandler\", \"handleError\"));\n set_exception_handler(array(\"app\\core\\ErrorHandler\", \"handleException\"));\n }", "public function listenForEvents()\n {\n Event::listen(DummyEvent::class, DummyListener::class);\n\n event(new DummyEvent);\n }", "public function event()\n\t{\n\t\tif (defined('ADMIN_THEME'))\n\t\t{\n\t\t\t$this->CI->type->add_misc($this->CI->type->load_view('codemirror', 'codemirror_admin', null));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->CI->type->add_misc($this->CI->type->load_view('codemirror', 'codemirror_entry_form', null));\n\t\t}\n\t}", "function eventclass_offeraride()\n\t{\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\n//\tonscreen events\n\n\t}", "function __construct()\n\t{\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}", "public static function getSubscribedEvents();", "public static function getSubscribedEvents();", "function __construct()\n\t{\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\t\t$this->events[\"BeforeShowView\"]=true;\n\n\n//\tonscreen events\n\n\t}", "private function installEvents()\n {\n $this->load->model('setting/event');\n\n $this->model_setting_event->addEvent(\n 'payment_mundipagg',\n 'catalog/model/account/customer/editCustomer/after',\n 'extension/payment/mundipagg_events/onCustomerEdit'\n );\n \n $this->model_setting_event->addEvent(\n 'payment_mundipagg',\n 'catalog/model/account/address/addAddress/after',\n 'extension/payment/mundipagg_events/onAddressAdd'\n );\n }", "protected function setListeners()\n\t{\n\t\t$this->templates->listenEmitBasic('foreach', array($this, 'tpl_foreach'));\n\t\t$this->templates->listenEmitBasic('not-last', array($this, 'tpl_not_last'));\n\t}", "public static function registerListeners()\n {\n static::creating('Wildside\\Userstamps\\Listeners\\Creating@handle');\n static::updating('Wildside\\Userstamps\\Listeners\\Updating@handle');\n\n if( method_exists(get_called_class(), 'deleting') )\n {\n static::deleting('Wildside\\Userstamps\\Listeners\\Deleting@handle');\n }\n\n if( method_exists(get_called_class(), 'restoring') )\n {\n static::restoring('Wildside\\Userstamps\\Listeners\\Restoring@handle');\n }\n }", "public function handle(EventInterface $event): void;", "public function init()\n\t{\n\t\tEvents::register('user_insert', array($this, 'user_insert'));\n\t\tEvents::register('user_insert_ldap', array($this, 'user_insert_ldap'));\n\t\tEvents::register('user_update', array($this, 'user_update'));\n\t\tEvents::register('user_delete', array($this, 'user_delete'));\n\t\tEvents::register('users_import', array($this, 'users_import'));\n\t}", "function __construct()\n\t{\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\n\t\t$this->events[\"BeforeShowAdd\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"IsRecordEditable\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"AfterDelete\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\n//\tonscreen events\n\n\t}", "function handle() ;", "function register(Doku_Event_Handler $controller){\n $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'handle_toolbar', array ());\n }", "function eventRegister($eventName, EventListener $listener);", "function MyEvents_Handle_Open()\n {\n $this->InscriptionsObj()->InitActions();\n\n echo\n $this->OpenEventsHtmlTable().\n \"\";\n }", "protected function defineActivationHooks(): void {\n\t\t$backend = $this->getBackend();\n\t\t$pluginName = $this->getFilename();\n\t\t$handlers = [\"activate\", \"deactivate\", \"uninstall\"];\n\t\tforeach ($handlers as $handler) {\n\t\t\t\n\t\t\t// for each of our handlers, we hook an action handler to our\n\t\t\t// backend component. the purpose of the BackendInterface is\n\t\t\t// to guarantee that we have three methods, one for each of\n\t\t\t// these hooks.\n\t\t\t\n\t\t\t$hook = $handler . \"_\" . $pluginName;\n\t\t\t$this->loader->addAction($hook, $backend, $handler);\n\t\t}\n\t}", "public static function setHandlers(): void\n {\n set_error_handler(static::getDriverClass() . '::error');\n set_exception_handler(static::getDriverClass() . '::exception');\n register_shutdown_function(static::getDriverClass() . '::fatal');\n }", "protected function register() {\n\t\tset_error_handler(array($this, 'handleException'));\n\t\tset_exception_handler(array($this, 'handleError'));\n\t\tregister_shutdown_function(array($this, 'handleShutdown'));\n\t}", "public function on($event, $callback){ }", "function _init(&$event)\r\n\t\t{\r\n\t\t\tparent::_init($event);\r\n\t\t\t\r\n\t\t\t$this->inp\t\t\t\t=\t&$event->object('input_validation', array(&$event));\r\n\t\t\t$this->data_validation\t=\t&$event->object('data_validation', array(&$event));\r\n\t\t}", "function setEventType()\n {\n $this->_eventType = 12;\n }", "private static function EventList ()\n {\n return array (\n \"a\" => array (),\n \"button\" => array (\n \"onblur\", \"onclick\", \"ondblclick\",\n \"onfocus\", \"onmousedown\", \"onmousemove\",\n \"onmouseout\", \"onmouseover\", \"onmouseup\",\n \"onkeydown\", \"onkeypress\", \"onkeyup\",\n ),\n );\n }", "abstract public function register_hook_callbacks();", "public function __construct()\n\t{\n\t\t$this->delegate = Delegate_1::fromMethod($this, 'onEvent');\n\t}", "public function getUploadEventHandler();", "protected function initializeEvents()\n\t{\n\t\tparent::initializeEvents();\n\t\t$this->events->add('beforeRender');\n\t\t$this->events->add('render');\n\t}", "protected function registerEvents(): void\n {\n $events = $this->app->make(Dispatcher::class);\n\n foreach ($this->events as $event => $listeners) {\n foreach ($listeners as $listener) {\n $events->listen($event, $listener);\n }\n }\n }", "public function event(): EventDispatcherInterface;" ]
[ "0.75742733", "0.752896", "0.71913016", "0.71722144", "0.71722144", "0.7073291", "0.6940903", "0.6872092", "0.67953676", "0.6693472", "0.6566793", "0.6523815", "0.6418676", "0.64019406", "0.63164854", "0.6185274", "0.6162404", "0.6160069", "0.6120508", "0.6115503", "0.61116064", "0.6049092", "0.6032573", "0.60226417", "0.6000559", "0.599048", "0.598836", "0.596326", "0.5921414", "0.5916224", "0.59091014", "0.58902955", "0.586087", "0.5824528", "0.58062816", "0.58027923", "0.5787095", "0.57866406", "0.57810444", "0.576898", "0.5752332", "0.57286185", "0.57233644", "0.5717403", "0.5713125", "0.57059586", "0.5704589", "0.5695757", "0.5672876", "0.56567305", "0.56436574", "0.56422603", "0.5638097", "0.5637416", "0.5636081", "0.56343997", "0.56335306", "0.5633354", "0.5623335", "0.56223387", "0.561935", "0.56170505", "0.56082845", "0.5597528", "0.55845183", "0.5580927", "0.5580927", "0.55796725", "0.5576906", "0.5570971", "0.55704767", "0.5570281", "0.55651116", "0.5559709", "0.5559047", "0.55537397", "0.55537397", "0.55511487", "0.55473876", "0.5544937", "0.55398256", "0.55382544", "0.55358714", "0.5535349", "0.55280924", "0.55241", "0.5519011", "0.5516248", "0.5516185", "0.5512911", "0.55123144", "0.55091894", "0.5506518", "0.550486", "0.55045766", "0.5503946", "0.5486812", "0.54812896", "0.5478575", "0.5474097", "0.5472807" ]
0.0
-1
Register the api endpoints
public function register_api_endpoints() { register_rest_route( 'nock/v1', '/messages', array( 'methods' => array( 'POST' ), 'callback' => array( $this, 'send_message' ), ) ); register_rest_route( 'nock/v1', '/accounts', array( 'methods' => array( 'GET' ), 'callback' => array( $this, 'get_accounts' ), ) ); register_rest_route( 'nock/v1', '/groups', array( 'methods' => array( 'GET' ), 'callback' => array( $this, 'get_groups' ), ) ); register_rest_route( 'nock/v1', '/sms', array( 'methods' => array( 'GET', 'POST' ), 'callback' => array( $this, 'capture_sms' ), ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function register_endpoints() {\n // endpoints will be registered here\n register_rest_route( Liang_API_Endpoints::$base_url, '/index', array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array( 'Liang_API_Endpoints', 'get_index' ),\n ) );\n }", "function register_endpoints(){\n\t$route_base = 'wc/v1';\n\n\tregister_rest_route($route_base, '/posts', array(\n\t\t'methods' => 'GET',\n\t\t'callback' => 'api_get_posts',\n\t\t'permission_callback' => 'helper_authentication_check'\n\t));\n\n\tregister_rest_route($route_base, '/posts/(?P<post_id>\\d+)', array(\n\t\t'methods' => 'GET',\n\t\t'callback' => 'api_get_post',\n\t\t'permission_callback' => 'helper_authentication_check'\n\t));\n}", "public static function register_rest_routes() {\n\t\tforeach (static::$apis as $api) {\n\t\t\t$api->register_rest_route();\n\t\t}\n }", "public static function registerCoreEndpoints() {\n\t\tif (\\UserConfig::$apiNamespace) {\n\t\t\tself::register(\\UserConfig::$apiNamespace, 'GET', new \\StartupAPI\\API\\v1\\User\\Get());\n\t\t\tself::register(\\UserConfig::$apiNamespace, 'GET', new \\StartupAPI\\API\\v1\\Accounts());\n\t\t}\n\t}", "private function registerApiRoutes(): void\n {\n $detect = app(Detect::class);\n $monitor = app(Monitor::class);\n\n $type = Settings::TYPE__ROUTE_API_FILE;\n if (!$detect->resourceEnabled($type)) {\n return;\n }\n\n $monitor->startTimer('register ' . $type);\n\n foreach ($detect->getRouteApiFiles() as $path) {\n Route::middleware($detect->routeApiMiddleware())\n ->group($detect->basePath($path));\n }\n $monitor->incRegCount($type, count($detect->getRouteApiFiles()));\n\n $monitor->stopTimer('register ' . $type);\n }", "public static function register_endpoints() {\n\t\t\n $namespace = sprintf( 'wp/%s', API_VERSION );\n \n // Create a new blank package\n register_rest_route( $namespace, API_PREFIX . 'package/add', array(\n 'methods' => 'GET',\n 'callback' => array( 'Doolittle_Package_REST_API_Endpoints', 'add' ),\n ) );\n \n // Delete a package\n register_rest_route( $namespace, API_PREFIX . 'package/delete', array(\n 'methods' => 'POST',\n 'callback' => array( 'Doolittle_Package_REST_API_Endpoints', 'delete' ),\n 'args' => array(\n 'post_ids' => array(\n 'required' => true,\n 'type' => 'object',\n 'description' => 'Package post_ids',\n ) \n )\n ) );\n \n \n // Delete a package\n register_rest_route( $namespace, API_PREFIX . 'package/update', array(\n 'methods' => 'POST',\n 'callback' => array( 'Doolittle_Package_REST_API_Endpoints', 'update' ),\n 'args' => array(\n 'data' => array(\n 'required' => true,\n 'type' => 'object',\n 'description' => 'Package form',\n ) \n )\n ) );\n\t}", "function registerEndpoints()\n{\n $namespace = 'travel-review-app/v1';\n\n register_rest_route(\n $namespace,\n '/destinations-default-wordpress',\n [\n 'methods' => 'GET',\n 'callback' => 'listDestinationsDefaultWordPress',\n ]\n );\n}", "public static function registerEndpoints() {\n $register = register_rest_route(\n\t\t\t'UKM', \n\t\t\t'/informasjon/', \n\t\t\t[\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => ['UKMwpAPI', 'informasjonsMeny'],\n\t\t\t\t'args' => []\n\t\t\t]\n );\n\n /**\n * ENDPOINT 4: Innlegg i bloggen\n */\n $register = register_rest_route(\n\t\t\t'UKM', \n\t\t\t'/nyheter/', \n\t\t\t[\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => ['UKMwpAPI', 'nyheter'],\n\t\t\t\t'args' => []\n\t\t\t]\n );\n\n\n /**\n * ENDPOINT 5: Innlegg fra kategori\n */\n $register = register_rest_route(\n\t\t\t'UKM', \n\t\t\t'/kategori/(?P<id>\\d+)', \n\t\t\t[\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => ['UKMwpAPI', 'kategori'],\n\t\t\t\t'args' => []\n\t\t\t]\n );\n\n /**\n * ENDPOINT 1 Info om en gitt post\n */\n $register = register_rest_route(\n 'UKM',\n '/post/(?P<id>\\d+)',\n [\n 'methods' => 'GET',\n\t\t\t\t'callback' => ['UKMwpAPI', 'post'],\n 'args' => ['id']\n ]\n );\n\n /**\n * ENDPOINT 2: Innholdet i en post\n */\n $register = register_rest_route(\n 'UKM',\n '/content/(?P<id>\\d+)',\n [\n 'methods' => 'GET',\n\t\t\t\t'callback' => ['UKMwpAPI', 'postContent'],\n 'args' => ['id']\n ]\n );\n }", "public function register_api_routes( Config $config ) {\n\t\t\\AM\\Endpoint\\Example_Endpoint::init( $config );\n\t}", "public static function prefix_add_api_endpoints()\n {\n add_rewrite_tag('%rewrite_class%', '([^&/]+)'); //([0-9]+)\n add_rewrite_tag('%rewrite_method%', '([^&/]+)'); //([0-9]+)\n add_rewrite_rule(self::getRewriteAPIPrefix() . '/?([^/]*)/([^/]*)/?', 'index.php?rewrite_class=$matches[1]&rewrite_method=$matches[2]', 'top');\n }", "public function register_routes() {\n $namespace = 'junglehunter/v1';\n register_rest_route(\n $namespace,\n '/all',\n array(\n 'methods' => 'GET',\n 'callback' => array($this, 'junglehunter_get_all')\n )\n );\n }", "public function register()\n\t{\n $this->registerApi();\n\t}", "protected function registerApiRoutes()\n {\n if (config('firefly.api.enabled')) {\n Route::group(config('firefly.api'), function () {\n $this->loadRoutesFrom(__DIR__.'/../routes/api.php');\n });\n }\n }", "function register_api_routes() {\n\tregister_rest_route( Altis\\API_NAMESPACE, '/telemetry', [\n\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t'permission_callback' => function () {\n\t\t\treturn is_user_logged_in();\n\t\t},\n\t\t'callback' => __NAMESPACE__ . '\\\\handle_telemetry_endpoint',\n\t\t'args' => [\n\t\t\t'opt_in' => [\n\t\t\t\t'type' => 'boolean',\n\t\t\t\t'default' => false,\n\t\t\t],\n\t\t],\n\t] );\n}", "public function register_endpoints() {\n\n foreach (static::$endpoints as $endpoint => $function) {\n\n $regular = 'wp_ajax_' . $endpoint;\n $nopriv = 'wp_ajax_nopriv_' . $endpoint;\n\n add_action( $regular, array( $this, $function ) );\n add_action( $nopriv, array( $this, $function ) );\n\n }\n }", "public function rest_api_init() {\n register_rest_route('h5p/v1', '/post/(?P<id>\\d+)', array(\n 'methods' => 'GET',\n 'callback' => array($this, 'rest_api_post'),\n 'args' => array(\n 'id' => array(\n 'validate_callback' => function ($param, $request, $key) {\n return $param == intval($param);\n }\n ),\n ),\n 'permission_callback' => array($this, 'rest_api_permission')\n ));\n\n register_rest_route('h5p/v1', 'all', array(\n 'methods' => 'GET',\n 'callback' => array($this, 'rest_api_all'),\n 'permission_callback' => array($this, 'rest_api_permission')\n ));\n }", "function onibus_endpoint_init() {\n\n\t$namespace = API_VERSAO;\n\n register_rest_route( $namespace, '/onibus/get-info-geral/',\n\n\t array(\n\t 'methods' \t=> 'GET',\n\t 'callback' \t=> 'get_informacoes_gerais_onibus',\n\t 'permission_callback' => function () {\n\t \treturn is_user_logged_in();\n\t }\n\t )\n\n );\n register_rest_route( $namespace, '/onibus/set-info-geral/',\n\n\t array(\n\t 'methods' \t=> 'POST',\n\t 'callback' \t=> 'set_informacoes_gerais_onibus',\n\t 'permission_callback' => function () {\n\t \treturn is_user_logged_in();\n\t }\n\t )\n\n );\n register_rest_route( $namespace, '/onibus/',\n\n\t array(\n\t 'methods' \t=> 'GET',\n\t 'callback' \t=> 'get_all_onibus',\n\t 'permission_callback' => function () {\n\t \treturn is_user_logged_in();\n\t }\n\t )\n\n );\n register_rest_route( $namespace, '/onibus/(?P<id>\\d+)',\n\n\t array(\n\t 'methods' \t=> 'GET',\n\t 'callback' \t=> 'get_onibus_by_id',\n\t 'permission_callback' => function () {\n\t \treturn is_user_logged_in();\n\t }\n\t )\n\n );\n register_rest_route( $namespace, '/onibus/create/',\n\n\t array(\n\t\t\t'methods' => 'POST',\n\t\t\t'callback' => 'adicionar_onibus',\n\t\t\t'permission_callback' => function () {\n\t\t\t \treturn is_user_logged_in();\n\t\t\t}\n\t\t)\n\n );\n register_rest_route( $namespace, '/onibus/update/',\n\n\t array(\n\t\t\t'methods' => 'POST',\n\t\t\t'callback' => 'editar_onibus',\n\t\t\t'permission_callback' => function () {\n\t\t\t \treturn is_user_logged_in();\n\t\t\t}\n\t\t)\n\n );\n register_rest_route( $namespace, '/onibus/delete/',\n\n\t array(\n\t\t\t'methods' => 'POST',\n\t\t\t'callback' => 'deletar_onibus',\n\t\t\t'permission_callback' => function () {\n\t\t\t \treturn is_user_logged_in();\n\t\t\t}\n\t\t)\n\n );\n\n}", "public function configureApiPaths();", "public function register_routes()\n {\n\n $namespace = 'api/v1';\n $base = 'categories';\n\n register_rest_route($namespace, '/' . $base, array(\n array(\n 'methods' => WP_REST_Server::CREATABLE,\n 'callback' => array($this, 'create_item'),\n 'permission_callback' => array($this, 'create_item_permissions_check'),\n 'args' => $this->get_endpoint_args_for_item_schema(true),\n ),\n ));\n\n register_rest_route($namespace, '/' . $base . '/(?P<id>\\d+)', array(\n array(\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => array($this, 'update_item'),\n 'permission_callback' => array($this, 'create_item_permissions_check'),\n 'args' => $this->get_endpoint_args_for_item_schema(true),\n ),\n ));\n }", "protected function register_rewrite_endpoints() {\n\t\tif ( ! empty( $this->endpoints ) ) {\n\t\t\tforeach ( $this->endpoints as $slug => $arr ) {\n\t\t\t\tadd_rewrite_endpoint( $slug, $arr['type'] );\n\t\t\t}\n\t\t}\n\t}", "public function add_api_routes()\n {\n /*\n * Only Apikey validate urls\n *\n */ \n register_rest_route($this->namespace, 'login', [\n 'methods' => 'POST',\n 'callback' => array($this, 'get_login'), \n 'args' => array(\n 'deviceToken' => array(\n 'required' => false,\n ),\n 'deviceId' => array(\n 'required' => true,\n 'description' => __('Please Enter deviceId',$this->plugin_name),\n ),\n 'deviceType' => array(\n 'required' => true,\n 'description' => __('Please Enter deviceType',$this->plugin_name),\n 'type' => 'string',\n 'enum' => array('1','2','3',),\n ),\n 'username' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => __('Please Enter Username',$this->plugin_name),\n ),\n 'password' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => __('Please Enter Password',$this->plugin_name),\n ),\n )\n ]);\n\n register_rest_route($this->namespace, 'logout', array(\n 'methods' => 'POST',\n 'callback' => array($this, 'logout'),\n )); \n register_rest_route($this->namespace, 'register', array(\n 'methods' => 'POST',\n 'callback' => array($this, 'register'),\n 'args' => array(\n 'deviceToken' => array(\n 'required' => false,\n ),\n 'deviceId' => array(\n 'required' => true,\n 'description' => __('Please Enter deviceId',$this->plugin_name),\n ),\n 'deviceType' => array(\n 'required' => true,\n 'description' => __('Please Enter deviceType',$this->plugin_name),\n 'type' => 'string',\n 'enum' => array('1','2','3',),\n ),\n 'email' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => 'The user\\'s email address',\n 'format' => 'email'\n ),\n 'username' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => __('Please Enter Username',$this->plugin_name),\n ),\n 'password' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => __('Please Enter Password',$this->plugin_name),\n ),\n 'fname' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => __('Please Enter Password',$this->plugin_name),\n ),\n 'lname' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => __('Please Enter Password',$this->plugin_name),\n ),\n\n )\n ));\n\n register_rest_route($this->namespace, 'forgotpassword', array(\n 'methods' => 'POST',\n 'callback' => array($this, 'forgotpassword'),\n 'args' => array(\n 'email' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => 'The user\\'s email address',\n 'format' => 'email'\n ),\n )\n ));\n\n register_rest_route($this->namespace, 'fblogin', array(\n 'methods' => 'POST',\n 'callback' => array($this, 'fblogin'),\n 'args' => array(\n 'email' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => 'The user\\'s email address',\n 'format' => 'email'\n ),\n )\n ));\n\n\n \n /*\n * Only Apikey and access token after login.\n *\n */ \n\n \n \n }", "protected function registerRoutes()\n {\n $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');\n }", "public function register_routes() {\n\n register_rest_route( $this->namespace, '/' . $this->base, array(\n array(\n 'methods' => WP_REST_Server::CREATABLE,\n 'callback' => array( $this->service, 'create' ),\n 'permission_callback' => array( $this, 'getAdminUserCheck' ),\n 'args' => $this->get_endpoint_args_for_item_schema( true ),\n 'accept_json' => true\n ),\n ) );\n\n register_rest_route( $this->namespace, '/' . $this->base . '/(?P<id>[\\d]+)', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array( $this->service, 'get' ),\n 'permission_callback' => array( $this, 'getAllUserCheck' ),\n 'args' => array(\n 'context' => array(\n 'default' => 'view',\n )\n ),\n ),\n\n array(\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => array( $this->service, 'update' ),\n 'permission_callback' => array( $this, 'getAdminUserCheck' ),\n 'args' => $this->get_endpoint_args_for_item_schema( false ),\n 'accept_json' => true\n ),\n\n array(\n 'methods' => WP_REST_Server::DELETABLE,\n 'callback' => array( $this->service, 'delete' ),\n 'permission_callback' => array( $this, 'getAdminUserCheck' ),\n 'args' => array(\n 'force' => array(\n 'default' => false,\n ),\n ),\n ),\n ) );\n }", "public function add_endpoints() {\n\t\tadd_rewrite_endpoint( self::$endpoint, EP_ROOT | EP_PAGES );\n\t\t//flush_rewrite_rules();\n\t}", "public function register_rest_routes() {\n\t\t/**\n\t\t * Setting up custom route for podcast\n\t\t */\n\t\tregister_rest_route(\n\t\t\t'ssp/v1',\n\t\t\t'/podcast',\n\t\t\tarray(\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => array( $this, 'get_rest_podcast' ),\n\t\t\t)\n\t\t);\n\n\t\t/**\n\t\t * Setting up custom route for podcast\n\t\t */\n\t\tregister_rest_route(\n\t\t\t'ssp/v1',\n\t\t\t'/podcast_update',\n\t\t\tarray(\n\t\t\t\t'methods' => 'POST',\n\t\t\t\t'callback' => array( $this, 'update_rest_podcast' ),\n\t\t\t)\n\t\t);\n\n\t\t/**\n\t\t * Setting up custom route for episodes\n\t\t */\n\t\t$controller = new Episodes_Controller();\n\t\t$controller->register_routes();\n\n\t}", "public function register_routes() {\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_item' ),\n\t\t\t\t'args' => array(),\n\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'update_item' ),\n\t\t\t\t'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),\n\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t),\n\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t) );\n\t}", "public function rest_api_init_action() {\r\n \r\n register_rest_route('api-bearer-auth/v1', '/login', [\r\n 'methods' => 'POST',\r\n 'callback' => [$this, 'callback_login'],\r\n 'args' => [\r\n 'username' => [\r\n 'required' => true,\r\n ],\r\n 'password' => [\r\n 'required' => true,\r\n ],\r\n ]\r\n ]);\r\n \r\n register_rest_route('api-bearer-auth/v1', '/tokens/refresh', [\r\n 'methods' => 'POST',\r\n 'callback' => [$this, 'callback_refresh_token'],\r\n 'args' => [\r\n 'token' => [\r\n 'required' => true\r\n ]\r\n ]\r\n ]);\r\n \r\n }", "public function add_endpoints() {\n\t\tadd_rewrite_endpoint( $this->endpoint, EP_ROOT | EP_PAGES );\n\t}", "public function register_routes() {\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_shops' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>.+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_shop' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base . '/manager', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'register_shop_manager' ),\n\t\t\t)\n\t\t) );\n\t}", "public function add_rest_api_routes() {\n\t\t// Clerk setting get configuration endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/getconfig',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'getconfig_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Clerk setting set configuration endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/setconfig',\n\t\t\tarray(\n\t\t\t\t'methods' => 'POST',\n\t\t\t\t'callback' => array( $this, 'setconfig_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Product endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/product',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'product_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Product endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/page',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'page_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Category endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/category',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'category_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Order endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/order',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'order_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Customer endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/customer',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'customer_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Version endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/version',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'version_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Version endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/plugin',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'plugin_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Log endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/log',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'log_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\t}", "public function register_routes() {\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_items' ),\n\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t'args' => array(),\n\t\t\t)\n\t\t) );\n }", "public function register_routes() {\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_items' ),\n\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t'args' => $this->get_collection_params(),\n\t\t\t),\n\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<status>[\\w-]+)', array(\n\t\t\t'args' => array(\n\t\t\t\t'status' => array(\n\t\t\t\t\t'description' => __( 'An alphanumeric identifier for the status.' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_item' ),\n\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t\t'args' => array(\n\t\t\t\t\t'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t) );\n\t}", "public function register_routes() {\n\t\t$version = '1';\n\t\t$namespace = 'askmedesk/v' . $version;\n register_rest_route( $namespace, '/tipi-richiesta', array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => [$this, 'get_tipi_richiesta'],\n 'permission_callback' => [$this, 'askmedesk_permission_check']\n\t\t));\n\t\tregister_rest_route($namespace, '/creazione-richiesta', array(\n\t\t\t'methods' => WP_REST_Server::CREATABLE,\n\t\t\t'callback' => [$this, 'crea_richiesta'],\n\t\t\t'permission_callback' => [$this, 'askmedesk_permission_check'],\n\t\t\t'args' => $this->get_endpoint_args_for_item_schema( false )\n\t\t));\n\t}", "function register_routes(){\n \tregister_rest_route( parent::get_api_base(), $this->controller . 'get' , array(\n \t\t'methods' => WP_REST_Server::READABLE,\n \t\t'callback' => array($this,'run_cron'),\n\n \t\t//'permission_callback' => array( $this, 'get_item_permissions_check' ),\n \t));\n\t}", "public function registerRoutes()\n {\n $namespace = $this->getNameSpace();\n\n register_rest_route($namespace, '/' . self::ROUTE_UPDATE_CALLBACK, [\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => array( $this, 'updateTrapp' ),\n 'permission_callback' => array( $this, 'updateTrappPermissions' ),\n ]);\n }", "public function route() {\r\n register_rest_route( 'api/v1', '/web-data-endpoint', array(\r\n 'methods' => 'GET',\r\n 'callback' => array( $this, 'callback' )\r\n ) );\r\n }", "public function getApiEndpoint();", "function spf_register_route(){\n register_rest_route('wooapp/v1','/shop/products',Array(\n 'methods' => 'GET',\n 'callback' => 'spf_get_shop_products',\n ));\n\n register_rest_route('wooapp/v1', '/auth/register', [\n 'methods' => 'POST',\n 'callback' => 'spf_register_new_user',\n ]);\n\n register_rest_route('wooapp/v1', '/auth/login', [\n 'methods' => 'POST',\n 'callback' => 'spf_login_user',\n ]);\n}", "public static function register(): void\n {\n if (! Route::hasMacro('apiMediaResource')) {\n Route::macro('apiMediaResource', function ($name, $controller) {\n Route::get(\"$name\", \"$controller@index\")->name(\"$name.index\");\n Route::get(\"$name/{media}\", \"$controller@show\")->where('media', '.*')->name(\"$name.show\");\n Route::patch(\"$name/{media}/rename\", \"$controller@rename\")->where('media', '.*')->name(\"$name.rename\");\n Route::post(\"$name/{media}/copy\", \"$controller@copy\")->where('media', '.*')->name(\"$name.copy\");\n Route::patch(\"$name/{media}/move\", \"$controller@move\")->where('media', '.*')->name(\"$name.move\");\n Route::post(\"$name/{media}/download\", \"$controller@download\")->where('media', '.*')->name(\"$name.download\");\n Route::delete(\"$name/delete\", \"$controller@delete\")->name(\"$name.delete\");\n Route::post(\"$name/upload\", \"$controller@upload\")->name(\"$name.upload\");\n Route::post(\"$name/add\", \"$controller@add\")->name(\"$name.add\");\n Route::post(\"$name/zip\", \"$controller@zip\")->name(\"$name.zip\");\n });\n }\n }", "public function register_routes() {\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base,\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback' => array( $this, 'parse_url_details' ),\n\t\t\t\t\t'args' => array(\n\t\t\t\t\t\t'url' => array(\n\t\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t\t'description' => __( 'The URL to process.' ),\n\t\t\t\t\t\t\t'validate_callback' => 'wp_http_validate_url',\n\t\t\t\t\t\t\t'sanitize_callback' => 'sanitize_url',\n\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'permission_callback' => array( $this, 'permissions_check' ),\n\t\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t}", "protected function mapApiRoutes(): void\n {\n Route::prefix(config('joy-voyager-bread-notification.route_prefix', 'api'))\n ->middleware('api')\n ->group(__DIR__ . '/../routes/api.php');\n }", "public function register_routes() {\n\n\t\tregister_rest_route( $this->namespace, '/location', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::CREATABLE,\n\t\t\t\t'callback' => array( $this, 'update_user_location' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/quiz-result', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'save_quiz_result' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/ranking/(?P<park>.+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_ranking' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/point/(?P<slug>.+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_point' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/point/(?P<id>.+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'set_point_location' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/option/(?P<key>.+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_option' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/user', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'update_user' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/photo', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'upload_photo' ),\n\t\t\t)\n\t\t) );\n\t}", "public function register_routes() {\n register_rest_route(\n $this->namespace, '/' . $this->base, array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array( $this, 'get_announcements' ),\n 'args' => array_merge(\n $this->get_collection_params(), array(\n 'status' => array(\n 'type' => 'string',\n 'description' => __( 'Announcement status', 'dokan' ),\n 'required' => false,\n ),\n )\n ),\n 'permission_callback' => array( $this, 'get_announcement_permissions_check' ),\n ),\n array(\n 'methods' => WP_REST_Server::CREATABLE,\n 'callback' => array( $this, 'create_announcement' ),\n 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ),\n 'permission_callback' => array( $this, 'create_announcement_permissions_check' ),\n ),\n )\n );\n\n register_rest_route(\n $this->namespace, '/' . $this->base . '/(?P<id>[\\d]+)/', array(\n 'args' => array(\n 'id' => array(\n 'description' => __( 'Unique identifier for the object.', 'dokan' ),\n 'type' => 'integer',\n ),\n ),\n\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array( $this, 'get_announcement' ),\n 'permission_callback' => array( $this, 'get_announcement_permissions_check' ),\n ),\n\n array(\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => array( $this, 'update_announcement' ),\n 'permission_callback' => array( $this, 'get_announcement_permissions_check' ),\n ),\n\n array(\n 'methods' => WP_REST_Server::DELETABLE,\n 'callback' => array( $this, 'delete_announcement' ),\n 'permission_callback' => array( $this, 'get_announcement_permissions_check' ),\n ),\n\n )\n );\n\n register_rest_route(\n $this->namespace, '/' . $this->base . '/(?P<id>[\\d]+)/restore', array(\n 'args' => array(\n 'id' => array(\n 'description' => __( 'Unique identifier for the object.', 'dokan' ),\n 'type' => 'integer',\n ),\n ),\n\n array(\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => array( $this, 'restore_announcement' ),\n 'permission_callback' => array( $this, 'restore_announcement_permissions_check' ),\n ),\n )\n );\n\n register_rest_route(\n $this->namespace, '/' . $this->base . '/batch', array(\n array(\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => array( $this, 'batch_items' ),\n 'permission_callback' => array( $this, 'batch_items_permissions_check' ),\n 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),\n ),\n )\n );\n }", "protected function mapApiRoutes()\n {\n Route::prefix('api')\n ->middleware('api')\n ->namespace($this->namespace)\n ->group(base_path('routes/api.php'));\n\n Route::group([\n 'middleware' => ['api', 'cors'],\n 'namespace' => $this->namespace,\n 'prefix' => 'api',\n ], function ($router) {\n Route::group(['middleware' => 'auth:api'], function() {\n Route::post('posts', 'PostController@store');\n Route::put('posts/{post}', 'PostController@update');\n Route::delete('posts/{post}', 'PostController@delete');\n Route::post('posts/{post}/likes', 'LikeController@create')->middleware('likes');\n Route::delete('posts/{post}/likes', 'LikeController@delete');\n Route::post('posts/{post}/comments', 'CommentController@create');\n Route::put('posts/{post}/comments/{comment_id}', 'CommentController@edit');\n Route::delete('posts/{post}/comments/{comment_id}', 'CommentController@delete');\n });\n \n Route::get('posts', 'PostController@index');\n Route::get('posts/{post}', 'PostController@show');\n Route::get('hashtags', 'HashtagController@index');\n Route::get('hashtags/{hashtag}', 'HashtagController@search');\n Route::post('register', 'Auth\\RegisterController@register');\n Route::post('login', 'Auth\\LoginController@login');\n Route::post('logout', 'Auth\\LoginController@logout');\n Route::get('/validate-token', function () {\n return ['data' => 'Token is valid'];\n })->middleware('auth:api');\n });\n }", "protected function _initApi() {\n\t$this->bootstrap('Zend');\n\t$this->bootstrap('ApiRoutes');\n }", "public function registerExternalEndpoints()\n {\n Route::post('encode/notify', [\n 'as' => 'decoy::encode@notify',\n 'uses' => '\\Bkwld\\Decoy\\Controllers\\Encoder@notify',\n ]);\n }", "public function custom_api() {\n\n\t\t$this->register_new_route( 'cases', '_user', WP_REST_Server::READABLE, array( $this, 'read' ) );\n\n\t\t$this->register_new_route( 'cases', '', WP_REST_Server::EDITABLE, array( $this, 'update' ) );\n\n\t\t$this->register_new_route( 'cases', '', WP_REST_Server::DELETABLE, array( $this, 'delete' ) );\n\n\t\t$this->register_new_route( 'cases', '_user', WP_REST_Server::CREATABLE, array( $this, 'create' ) );\n\t}", "public function register() {\n\t\tadd_action(\n\t\t\t'rest_api_init',\n\t\t\tfunction() {\n\t\t\t\t$this->register_routes();\n\t\t\t}\n\t\t);\n\n\t\tadd_filter(\n\t\t\t'do_parse_request',\n\t\t\tfunction( $do_parse_request, $wp ) {\n\t\t\t\tadd_filter(\n\t\t\t\t\t'query_vars',\n\t\t\t\t\tfunction( $vars ) use ( $wp ) {\n\t\t\t\t\t\t// Unsets standard public query vars to escape conflicts between WordPress core\n\t\t\t\t\t\t// and Google Site Kit APIs which happen when WordPress incorrectly parses request\n\t\t\t\t\t\t// arguments.\n\n\t\t\t\t\t\t$unset_vars = ( $wp->request && stripos( $wp->request, trailingslashit( rest_get_url_prefix() ) . self::REST_ROOT ) !== false ) // Check regular permalinks.\n\t\t\t\t\t\t\t|| ( empty( $wp->request ) && stripos( $this->context->input()->filter( INPUT_GET, 'rest_route' ), self::REST_ROOT ) !== false ); // Check plain permalinks.\n\n\t\t\t\t\t\tif ( $unset_vars ) {\n\t\t\t\t\t\t\t// List of variable names to remove from public query variables list.\n\t\t\t\t\t\t\treturn array_values(\n\t\t\t\t\t\t\t\tarray_diff(\n\t\t\t\t\t\t\t\t\t$vars,\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'orderby',\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\n\t\t\t\t\t\treturn $vars;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\treturn $do_parse_request;\n\t\t\t},\n\t\t\t10,\n\t\t\t2\n\t\t);\n\t}", "public function register_routes() {\n register_rest_route( $this->namespace, '/' . $this->rest_base, array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array( $this, 'get_items' ),\n 'permission_callback' => array( $this, 'get_items_permissions_check' ),\n 'args' => $this->get_collection_params(),\n 'show_in_index' => true,\n ),\n array(\n 'methods' => WP_REST_Server::CREATABLE,\n 'callback' => array( $this, 'create_item' ),\n 'permission_callback' => array( $this, 'create_item_permissions_check' ),\n 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ),\n 'show_in_index' => true,\n ),\n 'schema' => array( $this, 'get_public_item_schema' ),\n ) );\n\n register_rest_route( $this->namespace, '/back_project', array(\n array(\n 'methods' => WP_REST_Server::CREATABLE,\n 'callback' => array($this, 'backProjectApiCallback'),\n 'permission_callback' => array( $this, 'get_items_permissions_check' ),\n 'args' => array(\n 'project_id' => array(\n 'validate_callback' => function($param, $request, $key) {\n return is_numeric( $param );\n }\n ),\n 'amount' => array(\n 'validate_callback' => function($param, $request, $key) {\n return is_numeric( $param );\n }\n ),\n ),\n ),\n ) );\n\n register_rest_route( $this->namespace, '/get_balance', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array($this, 'getBalance'),\n 'permission_callback' => array( $this, 'get_items_permissions_check' ),\n ),\n ) );\n\n register_rest_route( $this->namespace, '/get_transactions', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array($this, 'getTransactions'),\n 'permission_callback' => array( $this, 'get_items_permissions_check' ),\n ),\n ) );\n\n /**\n * endpoint for sending coins to all accounts\n */\n register_rest_route( $this->namespace, '/setCoinsToAll', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array($this, 'setCoinsToAll'),\n 'permission_callback' => array( $this, 'get_items_permissions_check' ),\n 'args' => array(\n 'amount' => array(\n 'validate_callback' => function($param, $request, $key) {\n return is_numeric( $param );\n }\n ),\n ),\n ),\n ) );\n\n register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\\d]+)', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array( $this, 'get_item' ),\n 'permission_callback' => array( $this, 'get_item_permissions_check' ),\n 'args' => array(\n 'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n ),\n 'show_in_index' => true,\n ),\n array(\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => array( $this, 'update_item' ),\n 'permission_callback' => array( $this, 'update_item_permissions_check' ),\n 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),\n 'show_in_index' => true,\n ),\n array(\n 'methods' => WP_REST_Server::DELETABLE,\n 'callback' => array( $this, 'delete_item' ),\n 'permission_callback' => array( $this, 'delete_item_permissions_check' ),\n 'args' => array(\n 'force' => array(\n 'default' => true,\n 'description' => __( 'Whether to bypass trash and force deletion.' ),\n ),\n ),\n 'show_in_index' => false,\n ),\n 'schema' => array( $this, 'get_public_item_schema' ),\n ) );\n }", "public function register()\n {\n // 自定义 api 异常拦截\n $this->registerExceptionHandler();\n }", "public function register_routes() {\n\t\tregister_rest_route( $this->namespace, $this->route, [\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => [$this, 'get_options']\n\t\t\t],\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => [$this, 'update_options'],\n\t\t\t\t'permission_callback' => [$this, 'update_option_permissions_check']\n\t\t\t],\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::DELETABLE,\n\t\t\t\t'callback' => [$this, 'delete_options'],\n\t\t\t\t'permission_callback' => [$this, 'delete_option_permissions_check']\n\t\t\t]\n\t\t] );\n\n\t\tregister_rest_route( $this->namespace, $this->route . '/(?P<slug>.+)', [\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => [$this, 'get_option']\n\t\t\t],\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => [$this, 'update_option'],\n\t\t\t\t'permission_callback' => [$this, 'update_option_permissions_check']\n\t\t\t],\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::DELETABLE,\n\t\t\t\t'callback' => [$this, 'delete_option'],\n\t\t\t\t'permission_callback' => [$this, 'delete_option_permissions_check']\n\t\t\t]\n\t\t] );\n\t}", "public function getApiEndpoints(): array;", "protected function registerRoutes()\n {\n Route::group($this->routeConfiguration(), function () {\n $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');\n });\n }", "protected function registerRoutes()\n {\n Route::group($this->routeConfiguration(), function () {\n $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');\n });\n }", "public function init_rest_endpoints( $namespace ) {\n\n\t\t$endpoints = [\n\t\t\t'/collections/' . $this->category . '/' => [\n\t\t\t\t\\WP_REST_Server::CREATABLE => 'rest_list',\n\t\t\t],\n\t\t\t'/collection/' . $this->category . '/' => [\n\t\t\t\t\\WP_REST_Server::READABLE => 'rest_single',\n\t\t\t],\n\t\t\t// Importing a template to library.\n\t\t\t'/import/' . $this->category . '/process' => [\n\t\t\t\t\\WP_REST_Server::CREATABLE => 'rest_process_import',\n\t\t\t],\n\t\t\t// Creating a new page\n\t\t\t'/create/' . $this->category . '/process' => [\n\t\t\t\t\\WP_REST_Server::CREATABLE => 'rest_process_create',\n\t\t\t],\n\t\t\t// Inserting content onto a page.\n\t\t\t'/insert/' . $this->category . '/process' => [\n\t\t\t\t\\WP_REST_Server::CREATABLE => 'rest_process_insert',\n\t\t\t],\n\t\t];\n\n\t\tforeach ( $endpoints as $endpoint => $details ) {\n\t\t\tforeach ( $details as $method => $callback ) {\n\t\t\t\tregister_rest_route(\n\t\t\t\t\t$namespace, $endpoint, [\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'methods' => $method,\n\t\t\t\t\t\t\t'callback' => [ $this, $callback ],\n\t\t\t\t\t\t\t'permission_callback' => [ $this, 'rest_permission_check' ],\n\t\t\t\t\t\t\t'args' => [],\n\t\t\t\t\t\t],\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t}", "function api_wines_routes_api(){\n register_rest_route( 'bestwines/v1', '/wines', array(\n 'methods' => 'GET',\n 'callback' => 'api_get_wines',\n ));\n}", "public function register_rest_routes() {\n\t\t$controllers = array(\n\t\t\t'GF_REST_Entries_Controller',\n\t\t\t'GF_REST_Entry_Properties_Controller',\n\t\t\t'GF_REST_Entry_Notifications_Controller',\n\t\t\t'GF_REST_Notes_Controller',\n\t\t\t'GF_REST_Entry_Notes_Controller',\n\t\t\t'GF_REST_Form_Entries_Controller',\n\t\t\t'GF_REST_Form_Results_Controller',\n\t\t\t'GF_REST_Form_Submissions_Controller',\n\t\t\t'GF_REST_Forms_Controller',\n\t\t\t'GF_REST_Feeds_Controller',\n\t\t\t'GF_REST_Form_Feeds_Controller',\n\t\t);\n\n\t\tforeach ( $controllers as $controller ) {\n\t\t\t$controller_obj = new $controller();\n\t\t\t$controller_obj->register_routes();\n\t\t}\n\t}", "public function register_routes() {\n\n\t\t$namespace = $this->namespace;\n\n\t\t$base = $this->rest_base;\n\n\t\tregister_rest_route( $namespace, '/' . $base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::CREATABLE,\n\t\t\t\t'callback' => array( $this, 'create_item' ),\n\t\t\t\t'permission_callback' => array( $this, 'create_item_permissions_check' ),\n\t\t\t\t'args' => $this->get_collection_params(),\n\t\t\t),\n\t\t) );\n\t}", "public function register_routes(): void {\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base,\n\t\t\t[\n\t\t\t\t[\n\t\t\t\t\t'methods' => WP_REST_Server::ALLMETHODS,\n\t\t\t\t\t'callback' => [ $this, 'status_check' ],\n\t\t\t\t\t'permission_callback' => [ $this, 'status_check_permissions_check' ],\n\t\t\t\t\t'args' => [\n\t\t\t\t\t\t'content' => [\n\t\t\t\t\t\t\t'description' => __( 'Test HTML content.', 'web-stories' ),\n\t\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t\t'type' => 'string',\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}", "function register_rest_routes() {\n\tif ( class_exists( '\\WP_REST_Controller' ) ) {\n\t\tinclude_once __DIR__ . '/wprest-shortcodes-controller.php';\n\t\t$controller = new rest\\WPREST_Shortcodes_Controller();\n\t\t$controller->register_routes();\n\t}\n}", "public function add_endpoint() {\r\n add_rewrite_rule('^api/films/?(\\w+)?/?','index.php?__api=1&films=$matches[1]','top');\r\n }", "public function register()\n {\n AdminRoute::api('\\Admin\\Fields\\ModelsField', function () {\n $this->registerRoutes();\n });\n }", "public function register_routes() {\n register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\\d]+)/feedback', [\n [\n 'methods' => WP_REST_Server::CREATABLE,\n 'callback' => [$this, 'handle_feedback'],\n 'permission_callback' => array($this, 'create_item_permissions_check'),\n 'args' => [\n 'name' => [\n 'type' => 'string',\n 'sanitize_callback' => 'sanitize_text_field',\n ],\n 'email' => [\n 'description' => __('Email address of the author.'),\n 'type' => 'string',\n 'format' => 'email',\n ],\n 'subject' => [\n 'required' => true,\n 'type' => 'string',\n 'sanitize_callback' => 'sanitize_text_field',\n ],\n 'message' => [\n 'required' => true,\n 'type' => 'string',\n 'sanitize_callback' => 'sanitize_textarea_field',\n ],\n ],\n ]\n ] );\n\n register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\\d]+)/helpfullness', [\n [\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => [$this, 'update_helpfullness'],\n 'args' => [\n 'type' => [\n 'required' => true,\n 'type' => 'string',\n 'enum' => ['positive', 'negative'],\n ],\n ],\n ]\n ] );\n\n register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\\d]+)/parents', [\n [\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => [$this, 'get_parents'],\n ]\n ] );\n\n register_rest_route( $this->namespace, '/' . $this->rest_base . '/search', [\n [\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => [$this, 'search_docs'],\n 'args' => [\n 'query' => [\n 'required' => true,\n 'type' => 'string',\n 'description' => __('Limit results to those matching a string.', 'muiteer'),\n 'sanitize_callback' => 'sanitize_text_field',\n 'validate_callback' => 'rest_validate_request_arg',\n ],\n 'in' => [\n 'required' => false,\n 'type' => 'integer',\n 'description' => __('The ID for the parent of the object.', 'muiteer'),\n 'sanitize_callback' => 'absint',\n 'validate_callback' => 'rest_validate_request_arg',\n ],\n 'page' => array(\n 'description' => __('Current page of the collection.', 'muiteer'),\n 'type' => 'integer',\n 'default' => 1,\n 'sanitize_callback' => 'absint',\n 'validate_callback' => 'rest_validate_request_arg',\n 'minimum' => 1,\n ),\n 'per_page' => array(\n 'description' => __('Maximum number of items to be returned in result set.', 'muiteer'),\n 'type' => 'integer',\n 'default' => 10,\n 'minimum' => 1,\n 'maximum' => 100,\n 'sanitize_callback' => 'absint',\n 'validate_callback' => 'rest_validate_request_arg',\n ),\n ],\n ]\n ] );\n }", "public function addEndpoints()\n {\n foreach ($this->endpoints as $endpoint) {\n add_rewrite_endpoint(pll__($endpoint), EP_ROOT | EP_PAGES);\n }\n }", "public function register_routes() {\n\t\t$public_post_types = $this->post_type_helper->get_public_post_types();\n\n\t\tforeach ( $public_post_types as $post_type ) {\n\t\t\t\\register_rest_field( $post_type, self::YOAST_HEAD_FIELD_NAME, [ 'get_callback' => [ $this, 'for_post' ] ] );\n\t\t}\n\n\t\t$public_taxonomies = $this->taxonomy_helper->get_public_taxonomies();\n\n\t\tforeach ( $public_taxonomies as $taxonomy ) {\n\t\t\tif ( $taxonomy === 'post_tag' ) {\n\t\t\t\t$taxonomy = 'tag';\n\t\t\t}\n\t\t\t\\register_rest_field( $taxonomy, self::YOAST_HEAD_FIELD_NAME, [ 'get_callback' => [ $this, 'for_term' ] ] );\n\t\t}\n\n\t\t\\register_rest_field( 'user', self::YOAST_HEAD_FIELD_NAME, [ 'get_callback' => [ $this, 'for_author' ] ] );\n\n\t\t\\register_rest_field( 'type', self::YOAST_HEAD_FIELD_NAME, [ 'get_callback' => [ $this, 'for_post_type_archive' ] ] );\n\t}", "protected function mapApiRoutes()\n {\n $apiRoutes = [];\n\n foreach (File::allFiles(base_path('routes')) as $route) {\n preg_match('/api\\.(v[0-9]+)\\.php/', $route->getPathName()) ? array_push($apiRoutes, $route->getPathname()) : null;\n }\n\n Route::prefix('api')->middleware('api')->namespace($this->namespace)->group(base_path('routes/api.php'));\n\n foreach ($apiRoutes as $api) {\n preg_match('/api\\.v([0-9]+)\\.php/', $api, $version);\n\n Route::group([\n 'middleware' => ['api', 'api.version:' . $version[1]],\n 'namespace' => 'App\\Http\\Controllers\\API\\V' . $version[1],\n 'prefix' => 'api/v' . $version[1],\n ], function () use ($api) {\n require $api;\n });\n }\n }", "protected function mapApiRoutes()\n {\n Route::prefix('api')\n ->middleware('api')\n ->namespace('Datakrama\\Lapiuth\\Controllers')\n ->group(function () {\n $this->loadRoutesFrom(__DIR__.'/routes/api.php');\n });\n }", "protected function mapApiRoutes()\n {\n Route::prefix('api')\n ->middleware('api')\n ->namespace($this->namespace)\n ->group(base_path('routes/api.php'));\n }", "protected function mapApiRoutes()\n {\n Route::prefix('api')\n ->middleware('api')\n ->namespace($this->namespace)\n ->group(base_path('routes/api.php'));\n }", "protected function mapApiRoutes()\n {\n Route::prefix('api')\n ->middleware('api')\n ->namespace($this->namespace)\n ->group(base_path('routes/api.php'));\n }", "protected function mapApiRoutes()\n {\n Route::prefix('api')\n ->middleware('api')\n ->namespace($this->namespace)\n ->group(base_path('routes/api.php'));\n }", "protected function mapApiRoutes()\n {\n Route::prefix('api')\n ->middleware('api')\n ->namespace($this->namespace)\n ->group(base_path('routes/api.php'));\n }", "protected function mapApiRoutes()\n {\n Route::prefix('api')\n ->middleware('api')\n ->namespace($this->namespace)\n ->group(base_path('routes/api.php'));\n }", "protected function mapApiRoutes()\n {\n Route::prefix('api')\n ->middleware('api')\n ->namespace($this->namespace)\n ->group(base_path('routes/api.php'));\n }", "protected function mapApiRoutes()\n {\n Route::prefix('api')\n ->middleware('api')\n ->namespace($this->namespace)\n ->group(base_path('Modules/Post/routes/api.php'));\n }", "public function register()\n {\n $this->endpoints\n ->add(Image\\Endpoint::class);\n }", "protected function mapApiRoutes()\n {\n Route::prefix('api')\n ->middleware('api')\n ->namespace($this->namespace)\n ->group(base_path('routes/api/api.php'));\n }", "protected function registerRoutes() {\n\n $this->get('/crossword', 'getCrossword');\n $this->post('/crossword', 'saveUserState');\n //not used\n //$this->get('/crossword', 'getCrossword');\n //$this->get('/wordData', 'getWordData');\n //);\n }", "protected function mapApiRoutes()\n {\n Route::prefix('api')\n ->middleware('api')\n ->namespace($this->namespace)\n ->group(base_path('routes/api.php'));\n }", "protected function mapApiRoutes()\n {\n Route::prefix('api')\n ->middleware('api')\n ->namespace($this->namespace)\n ->group(base_path('routes/api.php'));\n }", "protected function mapApiRoutes()\n {\n Route::prefix('api')\n ->middleware('api')\n ->namespace($this->namespace)\n ->group(base_path('routes/api.php'));\n }", "public static function init() {\n\t\tstatic::$apis = [\n\t\t\t'content' => new Content_API(),\n\t\t\t'contributors' => new Contributors_API(),\n\t\t\t'dashboards' => new Dashboards_API(),\n\t\t\t'options' => new Options_API(),\n\t\t\t'post_types' => new Post_Types_API(),\n\t\t\t'quick_cards' => new Quick_Cards_API(),\n\t\t];\n\n\t\tadd_action( 'rest_api_init', [__CLASS__, 'register_rest_routes'] );\n\n\t}", "protected function mapApiRoutes()\n {\n $locale = Request::segment(1);\n $this->app->setLocale($locale);\n\n Route::prefix(\"$locale/api\")\n ->middleware('api')\n ->namespace($this->namespace)\n ->group(base_path('routes/api.php'));\n }", "public function setDefaultRoutes()\n {\n // Hello World route\n static::$api->get('/', function() {\n \n return array('Hello World');\n });\n\n // Get all registered post types \n $post_types = get_post_types(array(), 'objects');\n\n /////////////////////////////////////////////////\n // Add endpoints for all available posts types //\n /////////////////////////////////////////////////\n foreach ($post_types as $slug => $post_type) {\n\n if ($post_type->public) {\n\n $resource_name = Bebop::util('slugify', $post_type->labels->name);\n\n // Add post resource\n static::$api->get(\"$resource_name(/)(:id)\", function($id = null) use($post_type, $resource_name) {\n\n if (is_numeric($id)) {\n\n // Override context\n Bebop::Context()->overrideCurrent('api/single/'. $resource_name);\n\n $post = get_post($id);\n\n if ($post instanceof \\WP_Post) {\n\n if (ModelFactory::canManufacture($post->post_type)) {\n \n $post = ModelFactory::create($post->post_type, array($post));\n }\n\n $response = $post;\n }\n\n } else {\n\n // Override context\n Bebop::Context()->overrideCurrent('api/archive/'. $resource_name);\n\n if (isset($_GET['type'])) \n unset($_GET['type']);\n\n if ($resource_name == 'media') {\n\n if (isset($_GET['status'])) \n unset($_GET['status']);\n\n $_GET['post_type'] = 'attachment';\n $_GET['post_status'] = 'inherit';\n\n } else {\n\n $_GET['post_type'] = $post_type->name;\n }\n\n $response = Db::wpQuery($_GET)->setOption('with_meta', true)->execute();\n\n if ($response['items']) {\n\n foreach ($response['items'] as $index => $post) {\n \n if (ModelFactory::canManufacture($post->post_type)) {\n\n $response['items'][$index] = ModelFactory::create($post->post_type, array($post));\n }\n }\n }\n }\n\n // Enable developers to modify response for target resource\n $response = apply_filters(\"bebop:api:$resource_name:response\", $response);\n\n // Return response\n return $response;\n });\n \n /////////////////////////////////////\n // Get all or individual post meta //\n /////////////////////////////////////\n static::$api->get(\"$resource_name/:post_id/meta/:meta_key(/)(:meta_id)\", function($post_id, $meta_key, $meta_id = null) use($post_type, $resource_name) {\n\n // Throw error if post do not exist\n if (!get_post($post_id) instanceof \\WP_Post)\n throw new ApiException(\"Target entry do not exist\", 404);\n\n // Get meta data\n $post_meta = Bebop::PostMeta($post_id, array(\n 'projection' => self::$postmeta_projection\n ));\n\n $response = $meta_id ? $post_meta->get($meta_key, $meta_id) : $post_meta->getAll($meta_key);\n\n // Enable developers to modify response\n $response = apply_filters(\"bebop:api:postmeta:$meta_key:response\", $response, $post_id);\n\n // Enable developers to modify response\n $response = apply_filters('bebop:api:postmeta:response', $response, $meta_key, $post_id);\n\n // Return response\n return $response;\n });\n\n /////////////////////////////\n // Create single post meta //\n /////////////////////////////\n static::$api->post(\"$resource_name/:post_id/meta/:meta_key(/)\", function($post_id, $meta_key) {\n\n // Check if current user can edit the target post\n if (!current_user_can('edit_post', $post_id))\n throw new ApiException(\"You cannot edit the target entry\", 403);\n \n // Get request body\n $data = json_decode(static::$api->router()->request()->getBody(), true);\n\n // Throw error if payload is null\n if (is_null($data))\n throw new ApiException(\"You cannot send an empty request body\", 400);\n\n // Defined storage method\n $storage_method = isset($_GET['storage_method']) ? $_GET['storage_method'] : 'json';\n\n // Check storage type\n if (!in_array($storage_method, array('json', 'serialize')))\n throw new ApiException(\"Storage method needs to be either 'json' or 'serialize'\", 400);\n\n // Throw error if post do not exist\n if (!get_post($post_id) instanceof \\WP_Post)\n throw new ApiException(\"Target entry do not exist\", 404);\n\n // Instantiate PostMeta object\n $post_meta = Bebop::PostMeta($post_id, array(\n 'projection' => self::$postmeta_projection\n ));\n\n // Add new meta row\n $new_item = $post_meta->add($meta_key, $data, $storage_method);\n\n // Throw error if it was not able to create new postmeta item\n if (!$new_item)\n throw new ApiException(\"Failed to create new postmeta item\", 500);\n\n // Return response\n return $new_item;\n });\n \n /////////////////////////////\n // Update single post meta //\n /////////////////////////////\n static::$api->put(\"$resource_name/:post_id/meta/:meta_key/:meta_id(/)\", function($post_id, $meta_key, $meta_id) {\n\n // Check if current user can edit the target post\n if (!current_user_can('edit_post', $post_id))\n throw new ApiException(\"You cannot edit the target entry\", 403);\n\n // Get request body\n $data = json_decode(static::$api->router()->request()->getBody(), true);\n\n // Throw error if payload is null\n if (is_null($data))\n throw new ApiException(\"You cannot send an empty request body\", 400);\n\n // Defined storage method\n $storage_method = isset($_GET['storage_method']) ? $_GET['storage_method'] : 'json';\n\n // Check storage type\n if (!in_array($storage_method, array('json', 'serialize')))\n throw new ApiException(\"Storage method needs to be either 'json' or 'serialize'\", 400);\n\n // Throw error if post do not exist\n if (!get_post($post_id) instanceof \\WP_Post)\n throw new ApiException(\"Target entry do not exist\", 404);\n\n // Instantiate PostMeta object\n $post_meta = Bebop::PostMeta($post_id, array(\n 'projection' => self::$postmeta_projection\n ));\n\n // Update Meta\n $updated_item = $post_meta->update($meta_key, $meta_id, $data, $storage_method);\n\n // Throw error if it was not able to update the target postmeta item\n if (!$updated_item)\n throw new ApiException(\"Failed to update postmeta item\", 500);\n\n // Return updated item\n return $updated_item;\n });\n\n /////////////////////////////\n // Delete single post meta //\n /////////////////////////////\n static::$api->delete(\"$resource_name/:post_id/meta/:meta_key/:meta_id(/)\", function($post_id, $meta_key, $meta_id) use($post_type, $resource_name) {\n\n // Check if current user can edit the target post\n if (!current_user_can('edit_post', $post_id))\n throw new ApiException(\"You cannot edit the target entry\", 403);\n\n // Throw error if post do not exist\n if (!get_post($post_id) instanceof \\WP_Post)\n throw new ApiException(\"Target entry do not exist\", 404);\n\n // Instantiate PostMeta object\n $post_meta = Bebop::PostMeta($post_id, array(\n 'projection' => self::$postmeta_projection\n ));\n\n // Delete post meta\n $remaining_items = $post_meta->delete($meta_key, $meta_id);\n\n // Return remaining items\n return $remaining_items;\n });\n\n }\n }\n\n // Add endpoint to inform about available endpoints\n static::$api->get(\"_resources(/)\", function() use($post_types) {\n\n if (!current_user_can('manage_options')) {\n \n static::$api->router()->slim()->halt(403, json_encode(array(\n 'error' => array(\n 'status' => 403,\n 'message' => \"You're not an authorized user.\"\n )\n )));\n\n exit;\n }\n\n $base_url = '/'. static::$api->getBaseUrl();\n\n // Loop through all defined routes\n foreach (static::$api->routes()->getAll() as $route) {\n\n $resources[] = array(\n 'method' => strtoupper($route->getMethod()),\n 'endpoint' => $base_url . ltrim($route->getPath(), '/')\n );\n }\n\n // Return resources\n return $resources;\n });\n\n return $this;\n }", "protected function mapApiRoutes()\n {\n Route::middleware('api')\n ->namespace($this->namespace.'\\Api')\n ->prefix('api')\n ->group(base_path('routes/api.php'));\n }", "private function loadEndpoints() {\n $this->endpoints = array(\n '2020-08-06' => array(\n 'base_api_endpoint' => 'https://cloudapi.inflowinventory.com/',\n 'categories' => $this->companyID . '/categories/'\n )\n );\n }", "public static function api()\n {\n Route::get( 'images', '\\\\' .ApiController::class . '@index' )\n ->name( 'api.images.index' );\n Route::get( 'images/{image}', '\\\\' .ApiController::class . '@show' )\n ->name( 'api.images.show' );\n Route::post( 'images', '\\\\' .ApiController::class . '@store' )\n ->name( 'api.images.store' );\n Route::delete( 'images/{image}', '\\\\' .ApiController::class . '@destroy' )\n ->name( 'api.images.destroy' );\n }", "protected function mapApiRoutes()\n {\n Route::group([\n 'middleware' => ['api', 'auth:api'],\n 'namespace' => $this->namespace,\n 'prefix' => 'api',\n ], function ($router) {\n require base_path('routes/api.php');\n });\n }", "protected function mapApiRoutes()\n {\n Route::group([\n 'namespace' => $this->namespace,\n 'prefix' => 'api/v1'\n ], function ($router) { // Unprotected API routes\n Route::post('/emailConfirmation/{hash}', 'Auth\\RegisterController@emailConfirmation');\n Route::resource('/contactUs', 'ContactUsController', ['only' => ['store']]);\n /* From the http://<mysite.com>/public/#/sendFreeSMS send button\n * http://www.pse-screener.com/api/v1/sendFreeSms */\n Route::resource('/sendFreeSms', 'SendFreeSmsController', ['only' => ['store']]);\n\n /** From the downstream, retrieving the SMS messages to be sent because AWS cannot have modem.\n * No auth:api at the moment\n */\n Route::get('/smsMessages', 'SmsMessagesController@index');\n\n\n Route::group(['middleware' => 'auth:api'], function($router) {\n // Inside here are protected API routes\n require base_path('routes/api.php');\n });\n });\n }", "protected function mapApiRoutes()\n {\n Route::group([\n 'middleware' => 'api',\n 'namespace' => $this->namespace,\n 'prefix' => 'api',\n ], function ($router) {\n require base_path('routes/api.php');\n });\n }", "public function register_routes() {\n\n\t\t// Get current user per the JWT token. Depends on JWT plugin.\n\t\tregister_rest_route(\n\t\t\t'wpcampus',\n\t\t\t'/auth/user/',\n\t\t\t[\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => [ $this, 'get_current_user' ],\n\t\t\t]\n\t\t);\n\t}", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }" ]
[ "0.8080517", "0.7846165", "0.7774615", "0.7600209", "0.7541139", "0.7498955", "0.74355704", "0.73620445", "0.7305557", "0.72888184", "0.7284769", "0.72552246", "0.7178271", "0.7132534", "0.71237344", "0.7120145", "0.7096956", "0.70135885", "0.69850636", "0.6933622", "0.6900877", "0.6895813", "0.68695647", "0.6852275", "0.6845321", "0.67723304", "0.67454636", "0.6713274", "0.668652", "0.6670842", "0.6661607", "0.66581535", "0.6652985", "0.662504", "0.66236955", "0.6584266", "0.6583319", "0.6580422", "0.6572945", "0.6571408", "0.6569691", "0.6563265", "0.6561424", "0.6546262", "0.6532698", "0.65149057", "0.65120393", "0.64983463", "0.6490319", "0.6481263", "0.64764625", "0.6475424", "0.647446", "0.647446", "0.6468165", "0.6458303", "0.6449947", "0.644954", "0.64161474", "0.6415723", "0.64124453", "0.640519", "0.6405151", "0.64022714", "0.63950735", "0.63938934", "0.636386", "0.63626516", "0.63554454", "0.63554454", "0.63554454", "0.63554454", "0.63554454", "0.63554454", "0.63521695", "0.63492763", "0.6347742", "0.6335628", "0.6316935", "0.6316935", "0.6316935", "0.63006616", "0.62995225", "0.62964034", "0.6286551", "0.6286513", "0.62849325", "0.6276309", "0.6275372", "0.6255971", "0.6253726", "0.62367076", "0.623445", "0.623445", "0.623445", "0.623445", "0.623445", "0.623445", "0.623445", "0.623445" ]
0.82707596
0
Check to see if the eventType is an SMS request.
public function capture_sms( $request ) { if ( 'sms' !== $request->get_param( 'eventType' ) ) { wp_send_json_error(); } // Capture all of the request parameters. $message = $request->get_param( 'text' ); $from = str_replace( '+', '', $request->get_param( 'from' ) ); $to = str_replace( '+', '', $request->get_param( 'to' ) ); // Find the account. $account = $this->plugin->accounts->get_by_number( $to ); // Stop if we can't find an account. if ( ! $account ) { wp_send_json_error(); } // Stop if the message is blank. if ( empty( $message ) ) { wp_send_json_error(); } $subscriber_id = $this->plugin->subscribers->get_id_by_number( $from ); // Create the subscriber if they don't exist. if ( ! $subscriber_id ) { $subscriber_id = $this->plugin->subscribers->create( $from, $account['id'] ); } // Create the message. $message_id = $this->plugin->messages->create( $message, $account['id'], 'incoming' ); // Attach the sender to the message. $message_groups = $this->plugin->messages->attach_subscribers( $message_id, array( $subscriber_id ) ); wp_send_json_success( $message_groups ); $keyword_ids = get_post_meta( $nock_number->ID, 'keywords', true ); $keywords = array(); foreach ( $keyword_ids as $keyword_id ) { $keywords[] = strtolower( get_the_title( $keyword_id ) ); } $first_word = $this->get_first_word_of_sms( $message ); if ( ! in_array( $first_word, $keywords ) ) { return false; } echo "Add the user if they don't already exist"; exit; $message_args = array( 'post_type' => 'message', 'post_status' => 'publish', 'post_content' => $message, 'post_date' => $request->get_param( 'time' ), 'meta_input' => array( 'type' => $request->get_param( 'eventType' ), 'direction' => $request->get_param( 'direction' ), 'from_number' => $from, 'to_number' => $to, 'message_id' => $request->get_param( 'messageId' ), 'message_uri' => $request->get_param( 'messageUri' ), 'status' => $request->get_param( 'state' ), ), ); $message_id = wp_insert_post( $message_args ); if ( get_option( 'op_forwarding_number' ) === $from ) { $this->reply_to_sms( $message ); } else { $this->forward_sms_to_phone( $from, $message ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isSMSAllowed(){\n return ($this->sms_token != \"0\");\n }", "public function matchesRequest()\n {\n return $this->event->get('token') === $this->config->get('token') && ($this->event->get('type') === 'MESSAGE' || $this->event->get('type') === 'CARD_CLICKED');\n }", "public function matchesRequest(): bool\n {\n return $this->validateSignature() && $this->payload->get('webhook_event_type') === static::EVENT_TYPE;\n }", "private function is_sms_error($status) {\n return !(is_null($status) || $status == '' || $status == 'Delivered (0)' || $status == 'Received by recipient');\n }", "public function isRequest();", "public function matchesRequest()\n {\n return $this->event->has('queryText') && $this->payload->has('originalDetectIntentRequest');\n }", "public static function checkRequest($request)\n {\n $request = json_decode($request);\n\n $isMessaging = isset($request->activities[0]);\n if ($isMessaging && count($request->activities)) {\n return true;\n }\n return false;\n }", "public function isSent() {}", "public function isSent() : bool {\n $status = $this->delivery_status;\n return\n $status === WebhookEvent::EVENT_SENT ||\n $status === WebhookEvent::EVENT_OPEN ||\n $status === WebhookEvent::EVENT_CLICK ||\n $status === WebhookEvent::EVENT_UNSUB ||\n $status === WebhookEvent::EVENT_SPAM;\n }", "public function existsRequestToken()\n {\n // load token\n $store = $this->getStore();\n $type = $store->loadToken($this);\n\n // get consumer\n $this->_consumer = call_user_func($this->_get_consumer_handler, $store->getConsumerKey());\n\n // return result\n if ($type=='request') {\n return true;\n }\n return false;\n }", "public function isActionRequest()\n\t{\n\t\t$this->_checkRequestType();\n\t\treturn $this->_isActionRequest;\n\t}", "protected function isRequestMobile() {\n\t\t$mobileUserAgents = array(\n\t\t\t'iPhone', 'MIDP', 'AvantGo', 'BlackBerry', 'J2ME', 'Opera Mini', 'DoCoMo', 'NetFront',\n\t\t\t'Nokia', 'PalmOS', 'PalmSource', 'portalmmm', 'Plucker', 'ReqwirelessWeb', 'iPod', 'iPad',\n\t\t\t'SonyEricsson', 'Symbian', 'UP\\.Browser', 'Windows CE', 'Xiino', 'Android'\n\t\t);\n\t\t$currentUserAgent = $this->getRemote('userAgent');\n\t\tforeach($mobileUserAgents as $userAgent) {\n\t\t\tif(strpos($currentUserAgent, $userAgent) !== false) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private function is_request( $type ) {\n switch ( $type ) {\n case 'admin':\n return is_admin();\n case 'ajax':\n return defined( 'DOING_AJAX' );\n case 'cron':\n return defined( 'DOING_CRON' );\n case 'frontend':\n return ( ! is_admin() );\n }\n }", "public function getSmsAllowed()\n {\n return $this->smsAllowed;\n }", "public function isSpam() : bool {\n return $this->delivery_status === WebhookEvent::EVENT_SPAM;\n }", "public static function is_event_request($requestData = null, $contentTypes = null)\n {\n if (!$requestData) {\n $requestData = $_SERVER;\n }\n\n if (!$contentTypes) {\n $contentTypes = static::$eventContentTypes;\n }\n\n switch (false) { // All of these things must be true\n case isset($requestData['REQUEST_METHOD']):\n case $requestData['REQUEST_METHOD'] == 'POST':\n case isset($requestData['CONTENT_TYPE']):\n case in_array($requestData['CONTENT_TYPE'], $contentTypes):\n return false;\n }\n\n return array_search($requestData['CONTENT_TYPE'], $contentTypes);\n }", "private function is_request( $type )\n {\n switch ( $type ) {\n case 'admin':\n return is_admin();\n case 'ajax':\n return defined( 'DOING_AJAX' );\n case 'cron':\n return defined( 'DOING_CRON' );\n case 'frontend':\n return (!is_admin() || defined( 'DOING_AJAX' )) && !defined( 'DOING_CRON' );\n }\n }", "protected static function isInternalRequestType() {}", "protected static function isInternalRequestType() {}", "function _sms($alarm)\n {\n }", "public function is_there_scheduled_sms() {\r\n\t\t\t$query = 'SELECT `messageid` FROM `scheduled_sms` WHERE `is_sent` = 0 AND `scheduled_time` < now();';\r\n\t\t\t$statement = $this->con->prepare($query);\r\n\t\t\t$statement->execute();\r\n\t\t\t$valid = ($statement->rowCount() >= 1);\r\n\t\t\t$statement->closeCursor();\r\n\t\t\treturn $valid;\r\n\t\t}", "private function is_request( $type ) {\n\t\t\tswitch ( $type ) {\n\t\t\t\tcase 'admin' :\n\t\t\t\t\treturn is_admin();\n\t\t\t\tcase 'ajax' :\n\t\t\t\t\treturn defined( 'DOING_AJAX' );\n\t\t\t\tcase 'cron' :\n\t\t\t\t\treturn defined( 'DOING_CRON' );\n\t\t\t\tcase 'frontend' :\n\t\t\t\t\treturn ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' );\n\t\t\t}\n\t\t}", "private function is_request( $type ) {\n\t\t\tswitch ( $type ) {\n\t\t\t\tcase 'admin' :\n\t\t\t\t\treturn is_admin();\n\t\t\t\tcase 'ajax' :\n\t\t\t\t\treturn defined( 'DOING_AJAX' );\n\t\t\t\tcase 'cron' :\n\t\t\t\t\treturn defined( 'DOING_CRON' );\n\t\t\t\tcase 'frontend' :\n\t\t\t\t\treturn ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' );\n\t\t\t}\n\t\t}", "public function supportSms() {\n return $this->har_sms;\n }", "public function isSent() {\n\treturn $this->status != self::$WAITING;\n }", "static function hasMessage()\n {\n foreach (self::TYPES as $type)\n {\n if (self::has($type)) return true;\n }\n return false;\n }", "public static function shouldReceive()\n {\n }", "public static function shouldReceive()\n {\n }", "public static function shouldReceive()\n {\n }", "public static function shouldReceive()\n {\n }", "public function getIsGetRequest()\n\t{\n\t\treturn ($this->getRequestType() == 'GET');\n\t}", "private function getTypeOfRequest() {\n\t\t\n\t\t// If this is a POST request, likely it's Google, but let's check to confirm\n\t\tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\t\t\ttry {\n\t\t\t\t$json = file_get_contents($this->inputStream);\n\t\t\t\t$action = json_decode($json, true);\n\t\t\t\tif ($action == '' or $action == null) {\n\t\t\t\t\treturn 'other';\n }\n // Confirm that this request matches the projectID // TODO\n\t\t\t\t$this->decodedWebhook = $action; // Make the webhook JSON available to the class\n\t\t\t\treturn 'webhook';\n\t\t\t}\n\t\t\tcatch (Exception $e) {\n\t\t\t\treturn 'other';\n\t\t\t}\n\t\t}\n return 'other'; // Else, just return something else\n\t}", "private function is_request($type){\n switch ($type){\n case 'admin' :\n return is_admin();\n case 'ajax' :\n return defined( 'DOING_AJAX' );\n case 'cron' :\n return defined( 'DOING_CRON' );\n case 'frontend' :\n return (!is_admin() || defined('DOING_AJAX')) && ! defined('DOING_CRON');\n }\n }", "public function isSendType()\n {\n return $this->type_id == TransferType::SEND;\n }", "public function isSent()\n {\n return $this->isInStatus($this::SENT);\n }", "function is_request($meta = array())\n {\n }", "public static function isRequest() {\n\t return http_response_code()!==FALSE;\n\t}", "function read_extension_phone_number_detect_sms_feature(){\n global $platform;\n $endpoint = \"/restapi/v1.0/account/~/extension/~/phone-number\";\n $resp = $platform->get($endpoint);\n $jsonObj = $resp->json();\n foreach ($resp->json()->records as $record){\n foreach ($record->features as $feature){\n if ($feature == \"SmsSender\"){\n // If a user has multiple phone numbers, check and decide which number\n // to be used for sending SMS message.\n return send_sms($record->phoneNumber);\n }\n }\n }\n if (count($jsonObj->records) == 0){\n exit(\"This user does not own a phone number!\");\n }else{\n exit(\"None of this user's phone number(s) has the SMS capability!\");\n }\n}", "public function matchesRequest()\n {\n return $this->event->get('AccountSid') && !(is_null($this->event->get('Latitude')) || is_null($this->event->get('Longitude')));\n }", "private function sendSms( string $message , string $mobile ): bool\n {\n return true;\n }", "protected function isBotRequest() {\n return (\n isset($_SERVER['HTTP_USER_AGENT'])\n && preg_match('/bot|crawl|slurp|spider|mediapartners/i', $_SERVER['HTTP_USER_AGENT'])\n );\n }", "public function canProcessRequest()\n\t{\n\t\t// Check the validity of the function name\n\t\tif(($this->sRequestedFunction) && !$this->validateFunction($this->sRequestedFunction))\n\t\t{\n\t\t\t$this->sRequestedFunction = null;\n\t\t}\n\t\treturn ($this->sRequestedFunction != null);\n\t}", "public function isSending()\n {\n return $this->status === 'sending';\n }", "protected function getRequestType()\r\n {\r\n return array_key_exists('StatusCode', $this->request_data) && is_numeric($this->request_data['StatusCode'])\r\n ? self::REQ_NOTIFICATION\r\n : self::REQ_CUSTOMER_REDIRECT;\r\n }", "public function isSessionMessage() {}", "function schedulesms() {\n \t\t\n \t\tConfigure::write('debug', 0);\n \t\t\n \t\t$this->send(true, $_REQUEST['message'], $_REQUEST['mobile'], $_REQUEST['skey'], $_REQUEST['senderid'], \n \t\t\t\t\t\t\t$_REQUEST['group'], $_REQUEST['tag'], $_REQUEST['date'], $_REQUEST['response']);\n \t\t\n \t}", "public function getRequest(): ?CheckingSmsMessageStatusRequest {\n return parent::getRequest();\n }", "public function request( string $type ): bool {\n\t\tswitch ( $type ) {\n\t\t\tcase 'backend':\n\t\t\t\treturn $this->is_admin_backend();\n\n\t\t\tcase 'ajax':\n\t\t\t\treturn $this->is_ajax();\n\n\t\t\tcase 'installing_wp':\n\t\t\t\treturn $this->is_installing_wp();\n\n\t\t\tcase 'rest':\n\t\t\t\treturn $this->is_rest();\n\n\t\t\tcase 'cron':\n\t\t\t\treturn $this->is_cron();\n\n\t\t\tcase 'frontend':\n\t\t\t\treturn $this->is_frontend();\n\n\t\t\tcase 'cli':\n\t\t\t\treturn $this->is_cli();\n\n\t\t\tcase 'amp':\n\t\t\t\treturn $this->is_amp();\n\n\t\t\tdefault:\n\t\t\t\t_doing_it_wrong( __METHOD__, esc_html( sprintf( 'Unknown request type: %s', $type ) ), '1.0.0' );\n\n\t\t\t\treturn false;\n\t\t}\n\t}", "public function isVerificationRequest(): bool\n {\n return $this->request->getParameter('hub_mode') === 'subscribe' && $this->request->getParameter('hub_verify_token');\n }", "public function isMessage()\n {\n return !empty(self::$message);\n }", "public function hasBeenSent()\n {\n return $this->status === 'sent';\n }", "public function isSent(): bool\n {\n return $this->status === static::STATUS_QUEUED || $this->status === static::STATUS_COMPLETE;\n }", "public static function is_request()\n\t{\n\t\treturn self::$is_server;\n\t}", "private function _checkRequestType()\n\t{\n\t\tif ($this->_checkedRequestType)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// If there's a token in the query string, then that should take precedence over everything else\n\t\tif (!$this->getQuery(craft()->config->get('tokenParam')))\n\t\t{\n\t\t\t$firstSegment = $this->getSegment(1);\n\n\t\t\t// Is this a resource request?\n\t\t\tif ($firstSegment == craft()->config->getResourceTrigger())\n\t\t\t{\n\t\t\t\t$this->_isResourceRequest = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Is this an action request?\n\t\t\t\tif ($this->_isCpRequest)\n\t\t\t\t{\n\t\t\t\t\t$loginPath = craft()->config->getCpLoginPath();\n\t\t\t\t\t$logoutPath = craft()->config->getCpLogoutPath();\n\t\t\t\t\t$setPasswordPath = craft()->config->getCpSetPasswordPath();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$loginPath = trim(craft()->config->getLocalized('loginPath'), '/');\n\t\t\t\t\t$logoutPath = trim(craft()->config->getLocalized('logoutPath'), '/');\n\t\t\t\t\t$setPasswordPath = trim(craft()->config->getLocalized('setPasswordPath'), '/');\n\t\t\t\t}\n\n\t\t\t\t$verifyEmailPath = 'verifyemail';\n\n\t\t\t\tif (\n\t\t\t\t\t($triggerMatch = ($firstSegment == craft()->config->get('actionTrigger') && count($this->_segments) > 1)) ||\n\t\t\t\t\t($actionParam = $this->getParam('action')) !== null ||\n\t\t\t\t\t($specialPath = in_array($this->_path, array($loginPath, $logoutPath, $setPasswordPath, $verifyEmailPath)))\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$this->_isActionRequest = true;\n\n\t\t\t\t\tif ($triggerMatch)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_actionSegments = array_slice($this->_segments, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse if ($actionParam)\n\t\t\t\t\t{\n\t\t\t\t\t\t$actionParam = $this->decodePathInfo($actionParam);\n\t\t\t\t\t\t$this->_actionSegments = array_filter(explode('/', $actionParam));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($this->_path == $loginPath)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->_actionSegments = array('users', 'login');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ($this->_path == $logoutPath)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->_actionSegments = array('users', 'logout');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ($this->_path == $verifyEmailPath)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->_actionSegments = array('users', 'verifyemail');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->_actionSegments = array('users', 'setpassword');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->_checkedRequestType = true;\n\t}", "public function is_month_request() {\n\n\t\t\tif ( ! wp_doing_ajax() ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif ( ! isset( $_REQUEST['action'] ) || 'jet_engine_calendar_get_month' !== $_REQUEST['action'] ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t}", "public function isRequest(): bool\n {\n return $this->form->getMethod() == $this->request->getMethod();\n }", "public function hasReceivedMoved()\n {\n return (\n $this->_movedSignal instanceof Streamwide_Engine_Signal\n && $this->_movedSignal->getName() === Streamwide_Engine_Signal::MOVED\n );\n }", "public function flybitsSMS(Request $request)\n {\n // 1) Get all data from webhook payload\n $data = $request->all();\n \n // 2) Send SMS to recipient phone number with payload text message\n Twilio::message('6475566309', $data[\"phone\"], $data[\"text\"]);\n \n // 3) Respond to webhook request (nothing to return)\n return response()->noContent();\n }", "public function isReceiveType()\n {\n return $this->type_id == TransferType::RECEIVE;\n }", "public function isXmlHttpRequest() {\n $header = $this->getHeader(Header::HEADER_REQUEST_WITH);\n if (!$header) {\n return false;\n }\n\n return $header == self::XML_HTTP_REQUEST;\n }", "public function isMessage() {\n return (bool) (!empty(self::$message));\n }", "public function isFlashRequest()\n {\n $header = $this->getHeaders()->get('USER_AGENT');\n return false !== $header && stristr($header->getFieldValue(), ' flash');\n }", "public function isRequest(): bool {\n return $this->options['request'] ?? false;\n }", "public function IsSoapRequest(){\r\n\t\treturn !$this->IsHtmlRequested()&&!$this->IsWsdlRequested()&&!$this->IsPhpRequested();\r\n\t}", "public function isMessage() {\n return (bool) !empty(self::$message);\n }", "public function validateInboundMessage(){\n\t\t$hashData = $this->timestamp . \"\" . $this->token;\n\t\t$computedSignature = hash_hmac(\"sha256\",$hashData , $this->MGAPIKEY);\n\t\t$providedSignature = $this->signature;\n\t\tif ($computedSignature == $providedSignature){\n\t\t\tif($this->validateSender()){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function hasRequest(): bool;", "public function hasRequest(): bool;", "public function getCanSendMediaMessages(): bool\n {\n return $this->getCanSendAudios() ||\n $this->getCanSendDocuments() ||\n $this->getCanSendPhotos() ||\n $this->getCanSendVideos() ||\n $this->getCanSendVideoNotes() ||\n $this->getCanSendVoiceNotes();\n }", "function check_for_querystrings() {\r\n\t\t\tif ( isset( $_REQUEST['message'] ) ) {\r\n\t\t\t\tUM()->shortcodes()->message_mode = true;\r\n\t\t\t}\r\n\t\t}", "public function postQuickSMS(Request $request)\n {\n $v = \\Validator::make($request->all(), [\n 'recipients' => 'required', 'message' => 'required', 'message_type' => 'required', 'remove_duplicate' => 'required', 'country_code' => 'required', 'sms_gateway' => 'required', 'delimiter' => 'required'\n ]);\n\n if ($v->fails()) {\n return redirect('user/sms/quick-sms')->withInput($request->all())->withErrors($v->errors());\n }\n\n\n $message = $request->message;\n\n\n if (app_config('fraud_detection') == 1) {\n $spam_word = SpamWord::all()->toArray();\n if (isset($spam_word) && is_array($spam_word) && count($spam_word) > 0) {\n $spam_word = array_column($spam_word, 'word');\n $check = array_filter($spam_word, function ($word) use ($message) {\n if (strpos($message, $word)) {\n return true;\n }\n return false;\n });\n\n if (isset($check) && is_array($check) && count($check) > 0) {\n return redirect('user/sms/quick-sms')->with([\n 'message' => language_data('Your are sending fraud message', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n }\n }\n\n $client = Client::find(Auth::guard('client')->user()->id);\n $sms_count = $client->sms_limit;\n $sender_id = $request->sender_id;\n\n if (app_config('sender_id_verification') == '1') {\n if ($sender_id == null) {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('This Sender ID have Blocked By Administrator', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n }\n\n if ($sender_id != '' && app_config('sender_id_verification') == '1') {\n $all_sender_id = SenderIdManage::all();\n $all_ids = [];\n\n foreach ($all_sender_id as $sid) {\n $client_array = json_decode($sid->cl_id);\n\n if (isset($client_array) && is_array($client_array) && in_array('0', $client_array)) {\n array_push($all_ids, $sender_id);\n } elseif (isset($client_array) && is_array($client_array) && in_array(Auth::guard('client')->user()->id, $client_array)) {\n array_push($all_ids, $sid->sender_id);\n }\n }\n $all_ids = array_unique($all_ids);\n\n if (!in_array($sender_id, $all_ids)) {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('This Sender ID have Blocked By Administrator', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n }\n\n try {\n\n if ($request->delimiter == 'automatic') {\n $recipients = multi_explode(array(\",\", \"\\n\", \";\", \" \", \"|\"), $request->recipients);\n } elseif ($request->delimiter == ';') {\n $recipients = explode(';', $request->recipients);\n } elseif ($request->delimiter == ',') {\n $recipients = explode(',', $request->recipients);\n } elseif ($request->delimiter == '|') {\n $recipients = explode('|', $request->recipients);\n } elseif ($request->delimiter == 'tab') {\n $recipients = explode(' ', $request->recipients);\n } elseif ($request->delimiter == 'new_line') {\n $recipients = explode(\"\\n\", $request->recipients);\n } else {\n return redirect('user/sms/quick-sms')->with([\n 'message' => 'Invalid delimiter',\n 'message_important' => true\n ]);\n }\n\n $results = array_filter($recipients);\n\n if (isset($results) && is_array($results) && count($results) <= 100) {\n\n $gateway = SMSGateways::find($request->sms_gateway);\n if ($gateway->status != 'Active') {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('SMS gateway not active', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n $gateway_credential = null;\n $cg_info = null;\n if ($gateway->custom == 'Yes') {\n if ($gateway->type == 'smpp') {\n $gateway_credential = SMSGatewayCredential::where('gateway_id', $request->sms_gateway)->where('status', 'Active')->first();\n if ($gateway_credential == null) {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('SMS gateway not active.Contact with Provider', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n } else {\n $cg_info = CustomSMSGateways::where('gateway_id', $request->sms_gateway)->first();\n }\n\n } else {\n $gateway_credential = SMSGatewayCredential::where('gateway_id', $request->sms_gateway)->where('status', 'Active')->first();\n if ($gateway_credential == null) {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('SMS gateway not active.Contact with Provider', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n }\n\n $msg_type = $request->message_type;\n\n\n if ($msg_type != 'plain' && $msg_type != 'unicode' && $msg_type != 'voice' && $msg_type != 'mms' && $msg_type != 'arabic') {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('Invalid message type', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n if ($msg_type == 'voice') {\n if ($gateway->voice != 'Yes') {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('SMS Gateway not supported Voice feature', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n }\n\n if ($msg_type == 'mms') {\n\n if ($gateway->mms != 'Yes') {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('SMS Gateway not supported MMS feature', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n $image = $request->image;\n\n if ($image == '') {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('MMS file required', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n if (app_config('AppStage') != 'Demo') {\n if (isset($image) && in_array(strtolower($image->getClientOriginalExtension()), array(\"png\", \"jpeg\", \"gif\", 'jpg', 'mp3', 'mp4', '3gp', 'mpg', 'mpeg'))) {\n $destinationPath = public_path() . '/assets/mms_file/';\n $image_name = $image->getClientOriginalName();\n $image_name = str_replace(\" \", \"-\", $image_name);\n Input::file('image')->move($destinationPath, $image_name);\n $media_url = asset('assets/mms_file/' . $image_name);\n\n } else {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('Upload .png or .jpeg or .jpg or .gif or .mp3 or .mp4 or .3gp or .mpg or .mpeg file', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n } else {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('MMS is disable in demo mode', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n } else {\n $media_url = null;\n if ($message == '') {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('Message required', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n }\n\n\n if ($msg_type == 'plain' || $msg_type == 'voice' || $msg_type == 'mms') {\n $msgcount = strlen(preg_replace('/\\s+/', ' ', trim($message)));\n if ($msgcount <= 160) {\n $msgcount = 1;\n } else {\n $msgcount = $msgcount / 157;\n }\n }\n if ($msg_type == 'unicode' || $msg_type == 'arabic') {\n $msgcount = mb_strlen(preg_replace('/\\s+/', ' ', trim($message)), 'UTF-8');\n\n if ($msgcount <= 70) {\n $msgcount = 1;\n } else {\n $msgcount = $msgcount / 67;\n }\n }\n\n $msgcount = ceil($msgcount);\n\n\n $get_cost = 0;\n $get_inactive_coverage = [];\n\n $filtered_data = [];\n $blacklist = BlackListContact::select('numbers')->where('user_id', Auth::guard('client')->user()->id)->get()->toArray();\n\n if ($blacklist && is_array($blacklist) && count($blacklist) > 0) {\n\n $blacklist = array_column($blacklist, 'numbers');\n\n array_filter($results, function ($element) use ($blacklist, &$filtered_data, $request) {\n $element = trim($element);\n if ($request->country_code != 0) {\n $element = $request->country_code . ltrim($element, '0');\n }\n if (!in_array($element, $blacklist)) {\n if ($request->country_code != 0) {\n $element = ltrim($element, $request->country_code);\n }\n array_push($filtered_data, $element);\n }\n });\n\n $results = array_values($filtered_data);\n }\n\n if (count($results) <= 0) {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('Recipient empty', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n if ($request->remove_duplicate == 'yes') {\n $results = array_map('trim', $results);\n $results = array_unique($results, SORT_REGULAR);\n }\n\n $results = array_values($results);\n\n $get_final_data = [];\n\n foreach ($results as $r) {\n\n $phone = str_replace(['(', ')', '+', '-', ' '], '', trim($r));\n\n if (validate_phone_number($phone)) {\n\n if ($request->country_code == 0) {\n if ($gateway->settings == 'FortDigital') {\n $c_phone = 61;\n } else {\n $c_phone = PhoneNumber::get_code($phone);\n }\n } else {\n $phone = $request->country_code . ltrim($phone, '0');\n $c_phone = $request->country_code;\n }\n\n $sms_cost = IntCountryCodes::where('country_code', $c_phone)->where('active', '1')->first();\n\n if ($sms_cost) {\n\n $phoneUtil = PhoneNumberUtil::getInstance();\n $phoneNumberObject = $phoneUtil->parse('+' . $phone, null);\n $area_code_exist = $phoneUtil->getLengthOfGeographicalAreaCode($phoneNumberObject);\n\n if ($area_code_exist) {\n $format = $phoneUtil->format($phoneNumberObject, PhoneNumberFormat::INTERNATIONAL);\n $get_format_data = explode(\" \", $format);\n $operator_settings = explode('-', $get_format_data[1])[0];\n\n } else {\n $carrierMapper = PhoneNumberToCarrierMapper::getInstance();\n $operator_settings = $carrierMapper->getNameForNumber($phoneNumberObject, 'en');\n }\n\n $get_operator = Operator::where('operator_setting', $operator_settings)->where('coverage_id', $sms_cost->id)->first();\n if ($get_operator) {\n\n $sms_charge = $get_operator->plain_price;\n\n if ($msg_type == 'plain' || $msg_type == 'unicode' || $msg_type == 'arabic') {\n $sms_charge = $get_operator->plain_price;\n }\n\n if ($msg_type == 'voice') {\n $sms_charge = $get_operator->voice_price;\n }\n\n if ($msg_type == 'mms') {\n $sms_charge = $get_operator->mms_price;\n }\n\n $get_cost += $sms_charge;\n } else {\n $sms_charge = $sms_cost->plain_tariff;\n\n if ($msg_type == 'plain' || $msg_type == 'unicode' || $msg_type == 'arabic') {\n $sms_charge = $sms_cost->plain_tariff;\n }\n\n if ($msg_type == 'voice') {\n $sms_charge = $sms_cost->voice_tariff;\n }\n\n if ($msg_type == 'mms') {\n $sms_charge = $sms_cost->mms_tariff;\n }\n\n $get_cost += $sms_charge;\n }\n } else {\n array_push($get_inactive_coverage, $phone);\n continue;\n }\n\n array_push($get_final_data, $phone);\n }\n }\n\n $total_cost = $get_cost * $msgcount;\n\n if ($total_cost == 0) {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('You do not have enough sms balance', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n if ($total_cost > $sms_count) {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('You do not have enough sms balance', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n $remain_sms = $sms_count - $total_cost;\n $client->sms_limit = $remain_sms;\n $client->save();\n\n foreach ($get_final_data as $r) {\n $phone = str_replace(['(', ')', '+', '-', ' '], '', trim($r));\n\n if ($msg_type == 'plain' || $msg_type == 'unicode' || $msg_type == 'arabic') {\n $this->dispatch(new SendBulkSMS($client->id, $phone, $gateway, $gateway_credential, $sender_id, $message, $msgcount, $cg_info, '', $msg_type));\n }\n if ($msg_type == 'voice') {\n $this->dispatch(new SendBulkVoice($client->id, $phone, $gateway, $gateway_credential, $sender_id, $message, $msgcount));\n }\n if ($msg_type == 'mms') {\n $this->dispatch(new SendBulkMMS($client->id, $phone, $gateway, $gateway_credential, $sender_id, $message, $media_url));\n }\n }\n\n if (isset($get_inactive_coverage) && is_array($get_inactive_coverage) && count($get_inactive_coverage) > 0) {\n $inactive_phone = implode('; ', $get_inactive_coverage);\n return redirect('user/sms/quick-sms')->with([\n 'message' => 'This phone number(s) ' . $inactive_phone . ' not send for inactive coverage issue'\n ]);\n }\n\n return redirect('user/sms/quick-sms')->with([\n 'message' => language_data('Please check sms history for status', Auth::guard('client')->user()->lan_id)\n ]);\n } else {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('You can not send more than 100 sms using quick sms option', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n } catch (\\Exception $e) {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => $e->getMessage(),\n 'message_important' => true\n ]);\n }\n\n }", "public function isMessage() {\n return (bool) !empty($this->message);\n }", "public function isMessage() {\n return (bool) !empty($this->message);\n }", "public function isMessage() {\n return (bool) !empty($this->message);\n }", "public function isMessage() {\n return (bool) !empty($this->message);\n }", "public function canProcessRequest(Request $request)\n {\n $hasEventKey = $request->has($this->eventKey);\n if ($hasEventKey === false) {\n return false;\n }\n\n $isCorrectEvent = $request->get($this->eventKey) == $this->eventValue;\n\n return $isCorrectEvent;\n }", "public function isMessage(): bool\n {\n return $this->code >= CODE_CONTINUE &&\n $this->code < CODE_OK;\n }", "public function smsIn(Request $request)\n {\n $this->request = $request;\n if(!$this->isApiKeyValid($request->get('api')))\n {\n return response(\"Error! API key is not given or is invalid!\", 401)\n ->header('Content-Type', 'text/plain');\n }\n Log::info($request);\n $reponseMsgs = [];\n $phone = $request->msisdn;\n $this->receivedSms = trim($request->message);\n //check if a dalili user\n $this->user = SmsUser::where('phone', $phone)->first();\n if ($this->user && $this->user->isActive)\n {\n //check last menu item\n $this->lastSmsOut = SmsOut::where(['user_id' => $this->user->id])\n ->orderBy('id', 'DESC')->first();\n //get menu\n if ($this->lastSmsOut) {\n $this->currentMenu= SmsMenu::find($this->lastSmsOut->menu_id);\n //check if selected option is valid\n $this->selectedOption = $this->getSelectedOption();\n if ($this->selectedOption) {\n //save sms in\n $this->saveInboundSms();\n //in case of errors, go to main menu\n// try\n {\n $reponseMsgs = $this->goToNextMenu();\n }\n// catch(\\Exception $e)\n// {\n// $reponseMsgs = $this->goToNextMenu($this->getMenuByName(SmsHelper::MENU_MAIN_OPTIONS));\n// if(count($reponseMsgs)>0){\n// $reponseMsgs[0] = SmsHelper::ERROR_MSG[$this->getLocale()] .\"\\n\". $reponseMsgs[0];\n// }\n// }\n } else {\n //if unsubscribing\n if(strtoupper($this->receivedSms) == SmsHelper::KEY_DALILI_UNSUBSCRIBE){\n $this->user->isActive = 0;\n $this->user->save();\n $reponseMsgs = $this->goToNextMenu($this->getMenuByName(SmsHelper::MENU_MAIN_UNSUBSCRIBE));\n }\n //if has finished registration and has requested main menu\n elseif ($this->user->village_id &&\n (strtoupper($this->receivedSms) == self::DALILI_REG_KEY ||\n strtoupper($this->receivedSms) === SmsHelper::MENU_COMMON_OPTIONS_MAIN_MENU_CODE))\n {\n //show main menu\n $this->saveInboundSms();\n $reponseMsgs = $this->goToNextMenu($this->getMenuByName(SmsHelper::MENU_MAIN_OPTIONS));\n }else\n {\n //INVALID\n $this->isInvalidChoice = true;\n //get next menu\n $this->nextMenu = SmsMenu::find($this->lastSmsOut->menu_id);\n $this->saveInboundSms(true);\n //resend current menu\n $this->resendOutboundSms();\n $reponseMsgs[] = SmsHelper::INVALID_OPTION_MSG[$this->getLocale()].\"\\n\" .\n $this->lastSmsOut->message;\n }\n }\n }\n\n } else\n { //new user\n //check if Dalili registration\n if (strtoupper($this->receivedSms) == self::DALILI_REG_KEY)\n {\n //check if previously registered - reset\n if ($this->user){\n $this->user->isActive = 1;\n $this->user->village_id = null;\n $this->user->region_id = null;\n $this->user->language_code = null;\n $this->user->save();\n }\n else{\n //register user\n $this->user = SmsUser::create([\n 'phone' => $phone,\n 'country_code' => self::COUNTRY_CODE,\n 'last_request_time' => Carbon::now()\n ]);\n }\n //store msg\n $this->currentMenu = $this->getMenuByName(SmsHelper::MENU_MAIN_REGISTRATION);\n $this->saveInboundSms();\n $reponseMsgs = $this->goToNextMenu();\n } else\n {\n //ignore msg\n //$reponseMsg = [];//$this->testMethod();//\"Not a Dalili user\";\n\n }\n }\n\n //check if send sms $returnSmsContentResponse\n foreach ($reponseMsgs as $msg)\n {\n if(!$this->isInvalidChoice)\n $this->saveOutboundSms($msg);\n if($this->replySms) {\n $res = $this->sendSms($phone, $msg);\n //dd($res->getStatusCode());\n if($res->getStatusCode() == 200) {\n $this->nextSmsOut->is_sent = true;\n $this->nextSmsOut->save();\n }\n }\n }\n\n $reponseText = 'Ok';\n if($this->returnSmsContentResponse)\n $reponseText = join(\"\\n\", $reponseMsgs);\n //return \\response()->json($reponseMsg);\n return response($reponseText, 200)\n ->header('Content-Type', 'text/plain');\n }", "public static function method($type) {\n return $_SERVER['REQUEST_METHOD'] == strtoupper($type);\n }", "public function get_mms_status()\n {\n if ($this->_mms_status && is_array($this->_mms_status)) {\n return $this->_mms_status;\n } else {\n return FALSE;\n }\n }", "public function smsSend($opt=array()){\n\n\tif($opt['receiver'] == '') return false;\n\n\t$context = stream_context_create(\n\t\tarray( \n\t\t\t'http' => array( \n\t\t\t'method' => 'POST', \n\t\t\t'content' => http_build_query($opt), \n\t\t)\n\t));\n\n\t$back = file_get_contents('http://www.sms-web20.com/gateway/send.php', false, $context); \n\t\n#\t$this->pre($back);\n\t\n#\tdie();\n\t\n\treturn true;\n}", "private function _check_media_type()\n\t{\n\t\t// Parse the GET param if we haven't yet.\n\t\tif (! isset($this->media_filter)) {\n\t\t\t$this->media_filter = array();\n\t\t\tif (isset($_GET['m']))\n\t\t\t{\n\t\t\t\t$this->media_filter = $_GET['m'];\n\t\t\t\tif (! is_array($this->media_filter))\n\t\t\t\t{\n\t\t\t\t\t$this->media_filter = explode(',',$this->media_filter);\n\t\t\t\t}\n\t\t\t\t// Keep only the\n\t\t\t\t$this->media_filter = array_intersect(array_keys($this->media_values), $this->media_filter);\n\t\t\t}\n\t\t}\n\n\t\t// Return filters, if any\n\t\tif (count($this->media_filter) > 0)\n\t\t{\n\t\t\treturn $this->media_filter;\n\t\t}\n\n\t\treturn FALSE;\n\t}", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "public function doesSupportRichMessage()\n {\n return in_array($this->requestSource, $this->supportedRichMessagePlatforms);\n }", "function get_allowed_woo_status_ps_sms()\n{\n if (!function_exists('wc_get_order_statuses'))\n return;\n $statuses = wc_get_order_statuses() ? wc_get_order_statuses() : array();\n $order_status_settings = ps_sms_options('order_status', 'sms_buyer_settings', array());\n $allowed_statuses = array();\n foreach ((array) $statuses as $status_val => $status_name) {\n if (in_array(substr($status_val, 3), $order_status_settings))\n $allowed_statuses[substr($status_val, 3)] = $status_name;\n }\n return $allowed_statuses;\n}", "public function getReadSMS()\n\t{\n // isRead = false\n return $this->_getAndParse($this->_serverPath['getSMS'], true);\n\t}", "public function canHandleRequest();", "public function canHandleRequest();", "protected function checkType($type)\n {\n return $type === 'application/x-shockwave-flash' ||\n substr_compare($type, 'audio/', 0, 6) === 0;\n }", "public function mp_hook_smsabo($req){\n\n\t\t// if we have product access\n\t\tif($this->env_get('mp_mobile:product_access')){\n\n\t\t\t// but demand contigent and having 0\n\t\t\tif(h::gX($req, 'demand_contingent') and $this->env_get('mp_mobile:product_contingent') < 1){\n\n\t\t\t\t// return locked state\n\t\t\t\treturn $this->load_page('abo/locked', 423);\n\t\t\t\t}\n\n\t\t\t// no more processing\n\t\t\treturn null;\n\t\t\t}\n\n\t\t// return offer page\n\t\treturn $this->load_page('abo/offer_sms/operator_'.($this->env_get('mp_mobile:operatorID') ?: 0));\n\t\t}", "public function hasMsg(){\n return $this->_has(18);\n }", "public function hasWeddingmsg(){\n return $this->_has(25);\n }", "function filterRequest($msg){\n if(isset($_GET['type'])){\n $type = $_GET['type'];\n\n // Verify data type\n if($type == 'data'){\n handleDataRequest($msg);\n }else if($type == 'multiple'){\n handleMultipleData($msg);\n }else if($type == 'station'){\n handleStationsRequest($msg);\n }else{\n $msg->message = 'Requested type not existing!';\n $msg->toJson();\n }\n }else{\n $msg->message = 'Type not set!';\n $msg->toJson();\n }\n}", "function canHandleRequest() ;", "public function check($type)\n {\n switch ($type)\n {\n case Signature::TYPE_SUBSCRIBO_BASIC:\n if (empty($this->basicToken)) {\n return false;\n }\n return true;\n case Signature::TYPE_SUBSCRIBO_DIGEST:\n if (empty($this->digestToken)) {\n return false;\n }\n if (empty($this->digestSecret)) {\n return false;\n }\n return true;\n default:\n return false;\n }\n }", "public function send_sms(SMS $sms, $type = self::TYPE_5, $test = False)\n {\n $url = self::api_base_url;\n $url .= ($test) ? self::test_send : self::send;\n\n switch ($type) {\n case self::TYPE_4:\n case self::TYPE_5:\n case self::TYPE_6:\n case self::TYPE_7:\n case self::TYPE_8:\n $url .= self::url_params() . $sms->url_params() . \"&type={$type}\";\n $url .= ($test) ? '&from=NEWS' : '&from=' . self::from;\n $client = new GC();\n $response = $client->request('GET', $url);\n $data = self::JsonInAr($response->getBody());\n\n if($data[1])\n {\n $result = $data[0]->result;\n switch ($result)\n {\n case 'accepted':\n break;\n default:\n throw new SMS_API_Exception($data[0]->reason);\n break;\n }\n }\n else\n throw new SMS_Exception(SMS_Exception::API_JSON_ERROR);\n break;\n default:\n throw new SMS_Exception(SMS_Exception::INCORRECT_TYPE);\n break;\n }\n }", "public function action_request( $screen ) {\n\t\tif ( ! $this->is_screen() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * Fires an Action to allow Form actions to be hooked to\n\t\t */\n\t\treturn do_action( 'tribe_aggregator_page_request' );\n\t}" ]
[ "0.64914817", "0.6016387", "0.57523", "0.56649125", "0.5653523", "0.5612888", "0.560875", "0.55393994", "0.5502099", "0.54469043", "0.5410059", "0.5343858", "0.53288096", "0.5304688", "0.5301122", "0.52791387", "0.5267956", "0.5266232", "0.5266232", "0.5235135", "0.52292746", "0.522353", "0.522353", "0.52218866", "0.52083695", "0.5198793", "0.5170344", "0.5170344", "0.5170344", "0.5170344", "0.5169012", "0.5152356", "0.51180273", "0.51143026", "0.50842404", "0.5077182", "0.50764465", "0.506985", "0.50455016", "0.50431424", "0.5033091", "0.50223416", "0.5020446", "0.50148165", "0.50128347", "0.5004375", "0.4996795", "0.49857625", "0.49648967", "0.49527594", "0.4944151", "0.49363962", "0.49210554", "0.49145195", "0.4912963", "0.4912787", "0.49031693", "0.49026906", "0.49020588", "0.4901755", "0.4899647", "0.48827383", "0.48786762", "0.48771408", "0.48767895", "0.48759714", "0.48758417", "0.48758417", "0.48756647", "0.48745137", "0.48647088", "0.48417887", "0.48417887", "0.48417887", "0.48417887", "0.48412937", "0.48405766", "0.48309118", "0.48153362", "0.48095426", "0.4793518", "0.479219", "0.47909293", "0.47909293", "0.47909293", "0.47909293", "0.47901788", "0.47886536", "0.4782137", "0.47775632", "0.47775632", "0.47753465", "0.47571355", "0.47570017", "0.47539657", "0.4746828", "0.47455227", "0.47381714", "0.4734895", "0.47347516" ]
0.58440435
2
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}", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "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 }", "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 }", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\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}", "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 }", "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 }", "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 }", "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.82678324", "0.8173564", "0.78118384", "0.7706353", "0.76816905", "0.7659159", "0.74858105", "0.7406485", "0.7298472", "0.7253435", "0.7196091", "0.7174443", "0.7016074", "0.6989523", "0.69837826", "0.69728553", "0.69640046", "0.69357765", "0.6897687", "0.689282", "0.68775725", "0.6868809", "0.68633306", "0.6839021", "0.6779905", "0.6705274", "0.6670987", "0.66623807", "0.6652613", "0.6643801", "0.6616729", "0.66143125", "0.65891534", "0.6449129", "0.64461046", "0.6429425", "0.6426337", "0.63015336", "0.6298573", "0.6294075", "0.62801653", "0.6259914", "0.62554234", "0.6167662", "0.61630553", "0.61601174", "0.6141946", "0.6137726", "0.6134302", "0.6133732", "0.61287725", "0.6110795", "0.60950965", "0.6089703", "0.60768735", "0.6066286", "0.60595477", "0.6055387", "0.60451794", "0.6028352", "0.60246956", "0.60228956", "0.6019088", "0.6012698", "0.6011448", "0.60113615", "0.60076576", "0.6004189", "0.5998927", "0.5997798", "0.5993557", "0.59863526", "0.59863526", "0.59863526", "0.59706056", "0.59546155", "0.59493065", "0.5940633", "0.59251904", "0.59143347", "0.5913916", "0.59121555", "0.59111917", "0.5909761", "0.59026676", "0.59009403", "0.5899209", "0.58973104", "0.58964044", "0.58933777", "0.5888429", "0.58760023", "0.5869122", "0.5863149", "0.58622074", "0.5849116", "0.5838678", "0.5831741", "0.5824525", "0.58167094", "0.58122987" ]
0.0
-1
Show the application dashboard.
public function index() { return view('home'); }
{ "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
Fill the repository with registered routes
public function registerRouteTemplates() { foreach (Route::getRoutes()->getRoutes() as $route) { if(!$route->template()) continue; $this->register('route', $route->getName(), $route->template()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function populate_router() {\n if (Cache::has(APP_NAME.\"_Marmalade\\Router\\Routes\")) {\n $this->routes = Cache::get(APP_NAME.\"_Marmalade\\Router\\Routes\");\n } else {\n $this->build_route_map(Routes::load_routes());\n if (ENABLE_CACHE) {\n Cache::set(APP_NAME.\"_Marmalade\\Router\\Routes\", $this->routes);\n }\n }\n }", "private function register_routes() {\n\t\t$routes = $this->get_routes();\n\t\tforeach ( $routes as $route ) {\n\t\t\t$route->register();\n\t\t}\n\t}", "protected function prepareRoutes ()\n {\n foreach ($this->routes as $index => $route) {\n $this->registerNamedRoute($route);\n $this->registerRouteMethods($route, $index);\n }\n }", "private function load_routes() {\n\n // 1. plugins routes\n foreach($this->context->plugins() as $plugin) {\n \n if(false === $plugin->is_type('IRoutesPlugin')) continue;\n\n foreach($plugin->routes() as $route_value) {\n $this->routes[]= $route_value;\n }\n }\n\n // 2. config.xml routes\n $config_routes= $this->context->config()->routes();\n // XXX: review, maybe Route[] should be returned by configurator?\n foreach( $config_routes as $r ) {\n // xxx. requirements\n $this->routes[]= new Route( \n (string)trim($r['name']), // name\n (string)trim($r['value']), // definition\n $this->context->config()->route_defaults($r) // array with defaults\n );\n }\n\n // Medick::dump($this->routes);\n\n // xxx: throw exception if 0 routes?\n }", "public function declare_routes(){\n\n $this->routes = \\Chocolatine\\get_configuration( 'routes' );\n $view_manager = \\Chocolatine\\get_manager('view');\n\n /**\n * Declare all route\n */\n foreach ( $this->routes as $key => $current_route) {\n\n $this->router->map(['GET', 'POST'], $current_route['route'] ,function ($request, $response, $args) {\n\n $router = \\Chocolatine\\get_service( 'Router' );\n return $router->controller( $request, $response, $args );\n\n });\n\n }\n\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes() {\n\t\t$public_post_types = $this->post_type_helper->get_public_post_types();\n\n\t\tforeach ( $public_post_types as $post_type ) {\n\t\t\t\\register_rest_field( $post_type, self::YOAST_HEAD_FIELD_NAME, [ 'get_callback' => [ $this, 'for_post' ] ] );\n\t\t}\n\n\t\t$public_taxonomies = $this->taxonomy_helper->get_public_taxonomies();\n\n\t\tforeach ( $public_taxonomies as $taxonomy ) {\n\t\t\tif ( $taxonomy === 'post_tag' ) {\n\t\t\t\t$taxonomy = 'tag';\n\t\t\t}\n\t\t\t\\register_rest_field( $taxonomy, self::YOAST_HEAD_FIELD_NAME, [ 'get_callback' => [ $this, 'for_term' ] ] );\n\t\t}\n\n\t\t\\register_rest_field( 'user', self::YOAST_HEAD_FIELD_NAME, [ 'get_callback' => [ $this, 'for_author' ] ] );\n\n\t\t\\register_rest_field( 'type', self::YOAST_HEAD_FIELD_NAME, [ 'get_callback' => [ $this, 'for_post_type_archive' ] ] );\n\t}", "public function register_routes() {\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_shops' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>.+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_shop' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base . '/manager', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'register_shop_manager' ),\n\t\t\t)\n\t\t) );\n\t}", "public function initializeRoutes()\n {\n $this->get(\"/\", \"index\");\n }", "function create_initial_rest_routes()\n {\n }", "protected function loadRoutes()\n {\n $router = $this->app->make(Router::class);\n\n $router->pattern('url', '.+');\n\n $router->pattern('pageToken', '\\[a-z0-9]+');\n $router->bind('pageToken', function ($token) {\n $repository = $this->app->make(WikiEngine::class)->repository();\n\n $page = $repository->pageByToken($token);\n\n // Throw 404 error if page not found by token\n if ($page === null) {\n abort(404);\n }\n\n return $page;\n });\n\n $router->pattern('userId', '\\d+');\n $router->model('userId', User::class, function () {\n abort(404);\n });\n\n if (!$this->app->make('app')->routesAreCached()) {\n $attributes = [\n 'namespace' => 'ViKon\\\\Wiki\\\\Http\\\\Controller',\n ];\n $router->group($attributes, function () {\n require __DIR__ . '/Http/routes.php';\n });\n }\n }", "public function initRoutes()\r\n {\r\n $route = new Route();\r\n\r\n $routesConf = include __DIR__ . '/../../config/routes.inc.php';\r\n\r\n foreach ($routesConf as $routeConf) {\r\n\r\n $uri = $routeConf['uri'];\r\n\r\n if (preg_match_all('/\\$(.*?(?=\\/)|.*?$)/', $routeConf['uri'], $matches)) {\r\n $uri = preg_replace('/\\$(.*?(?=\\/)|.*?$)/', '.*', $routeConf['uri']);\r\n }\r\n\r\n $route->add($uri, $routeConf, $matches[1], function($params) {\r\n $this->config->route = $params['config'];\r\n\r\n $args = [];\r\n if (isset($params['arguments'])) {\r\n $args = $params['arguments'];\r\n }\r\n\r\n $controller = new $params['config']['controller']($this->config, $this->db, $args);\r\n\r\n $controller->indexAction();\r\n });\r\n }\r\n\r\n $findUrl = $route->submit();\r\n\r\n if (!$findUrl) {\r\n header('HTTP/1.0 404 Not Found');\r\n include_once __DIR__ . '/../../../src/Views/errors/404_de.html';\r\n }\r\n }", "protected function loadRoute()\n {\n $this->post('/task', 'task.controller:saveAction');\n\n // Url for update task\n $this->put('/task/{id}', 'task.controller:updateAction');\n\n // Url for see one task\n $this->get('/task/{id}', 'task.controller:getAction');\n\n // Url for delete task\n $this->delete('/task/{id}', 'task.controller:deleteAction');\n\n // Url for list of tasks\n $this->get('/task', 'task.controller:listAction');\n\n //Get Tag list\n $this->get('/tags', 'tag.controller:listAction');\n\n //Add tag to task\n $this->post('/addTag', 'tag.controller:setTagAction');\n\n //Add tag to tag list\n $this->post('/tag', 'tag.controller:saveAction');\n\n //Search by tag\n $this->get('/search/tag', 'tag.controller:searchAction'); \n\n // Url for delete tag in tag list\n $this->delete('/tag', 'tag.controller:deleteAction');\n \n // Url for auth github\n $this->post('/github', 'github.controller:authAction'); \n }", "private function setRoutes() : void\n {\n $this->routes = $this->routeProvider->getRoutes();\n $this->syRouteCollection = new RouteCollection();\n foreach ($this->routes as $route) {\n $syRoute = new SymfonyRoute(\n $route->getPath(),\n $route->getParamsDefaults(),\n $route->getParamsRequirements(),\n [],\n '',\n [],\n $route->getMethods()\n );\n $this->syRouteCollection->add($route->getName(), $syRoute);\n }\n }", "public function register_routes() {\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_items' ),\n\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t'args' => array(),\n\t\t\t)\n\t\t) );\n }", "public function register_routes() {\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_item' ),\n\t\t\t\t'args' => array(),\n\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'update_item' ),\n\t\t\t\t'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),\n\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t),\n\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t) );\n\t}", "protected function setUpRoutes()\n {\n parent::setUpRoutes();\n $this->setRoutes([\n 'createInvitationLink' => 'private/product-reviews/business-units/{businessUnitId}/invitation-links?token={token}',\n 'findPrivate' => 'private/product-reviews/business-units/{businessUnitId}/reviews?token={token}'\n ]);\n }", "protected function registerRoutes() {\n\n $this->get('/crossword', 'getCrossword');\n $this->post('/crossword', 'saveUserState');\n //not used\n //$this->get('/crossword', 'getCrossword');\n //$this->get('/wordData', 'getWordData');\n //);\n }", "private function loadRoutes() {\n $routesJson = file_get_contents('config/routing.json');\n $routesArray = json_decode($routesJson, true);\n\n foreach ($routesArray as $routeElement) {\n $route = new Route($routeElement['route'], array(\n 'controller' => $routeElement['controller'],\n 'action' => $routeElement['action']\n ));\n $this->routeCollection->add($routeElement['name'], $route);\n }\n }", "public function register_routes() {\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base,\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback' => array( $this, 'parse_url_details' ),\n\t\t\t\t\t'args' => array(\n\t\t\t\t\t\t'url' => array(\n\t\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t\t'description' => __( 'The URL to process.' ),\n\t\t\t\t\t\t\t'validate_callback' => 'wp_http_validate_url',\n\t\t\t\t\t\t\t'sanitize_callback' => 'sanitize_url',\n\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'permission_callback' => array( $this, 'permissions_check' ),\n\t\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t}", "public function register_routes() {\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_items' ),\n\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t'args' => $this->get_collection_params(),\n\t\t\t),\n\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<status>[\\w-]+)', array(\n\t\t\t'args' => array(\n\t\t\t\t'status' => array(\n\t\t\t\t\t'description' => __( 'An alphanumeric identifier for the status.' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_item' ),\n\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t\t'args' => array(\n\t\t\t\t\t'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t) );\n\t}", "public function register_routes() {\n $namespace = 'junglehunter/v1';\n register_rest_route(\n $namespace,\n '/all',\n array(\n 'methods' => 'GET',\n 'callback' => array($this, 'junglehunter_get_all')\n )\n );\n }", "public function __construct()\n {\n $this->routes = array();\n }", "protected function routes()\n {\n Nova::routes()\n ->withAuthenticationRoutes()\n ->withPasswordResetRoutes()\n ->register();\n }", "protected function routes()\n {\n Nova::routes()\n ->withAuthenticationRoutes()\n ->withPasswordResetRoutes()\n ->register();\n }", "public static function register_rest_routes() {\n\t\tforeach (static::$apis as $api) {\n\t\t\t$api->register_rest_route();\n\t\t}\n }", "public function routes()\n {\n register_rest_route('can', '/donation-forms', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'fundraisingPages'\n ],\n ]);\n\n register_rest_route('can', '/forms', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'forms'\n ],\n ]);\n\n register_rest_route('can', '/petitions', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'petitions'\n ],\n ]);\n\n register_rest_route('can', '/person/add', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'addPerson'\n ],\n ]);\n }", "protected function _loadRoutes()\n\t{\n\t\t$this->_routes['/^\\/login\\/?$/'] = '/account/login';\n\t}", "public function __construct() {\n $this->setRoutes(array(\n 'user' => 'getAllUsers',\n 'user/:userId' => 'getCertainUser',\n 'fixName/:variableName' => 'anotherMethod'\n ));\n }", "private function registerRoutes(){\n $appRouter = require_once __DIR__.'/../../routes/app.php';\n $this->registerApplicationRoutes($appRouter);\n $this->registerApplicationRoutes($appRouter, false);\n $this->registerAuthenticationRoutes();\n }", "public function register_rest_routes() {\n\t\t$controllers = array(\n\t\t\t'GF_REST_Entries_Controller',\n\t\t\t'GF_REST_Entry_Properties_Controller',\n\t\t\t'GF_REST_Entry_Notifications_Controller',\n\t\t\t'GF_REST_Notes_Controller',\n\t\t\t'GF_REST_Entry_Notes_Controller',\n\t\t\t'GF_REST_Form_Entries_Controller',\n\t\t\t'GF_REST_Form_Results_Controller',\n\t\t\t'GF_REST_Form_Submissions_Controller',\n\t\t\t'GF_REST_Forms_Controller',\n\t\t\t'GF_REST_Feeds_Controller',\n\t\t\t'GF_REST_Form_Feeds_Controller',\n\t\t);\n\n\t\tforeach ( $controllers as $controller ) {\n\t\t\t$controller_obj = new $controller();\n\t\t\t$controller_obj->register_routes();\n\t\t}\n\t}", "public function register_routes() {\n\n\t\t\\add_filter( 'do_parse_request', array( $this, 'handle_routing' ) );\n\n\t}", "public function register_routes() {\n\n\t\tregister_rest_route( $this->namespace, '/location', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::CREATABLE,\n\t\t\t\t'callback' => array( $this, 'update_user_location' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/quiz-result', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'save_quiz_result' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/ranking/(?P<park>.+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_ranking' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/point/(?P<slug>.+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_point' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/point/(?P<id>.+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'set_point_location' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/option/(?P<key>.+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_option' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/user', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'update_user' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/photo', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'upload_photo' ),\n\t\t\t)\n\t\t) );\n\t}", "public function register_routes( Collection $routes );", "protected function defineRoutes()\n {\n $this->register(ImageServiceProvider::class);\n if (! $this->app->routesAreCached()) {\n $router = app('router');\n $router->group([\n 'namespace' => 'Socieboy\\Jupiter\\Http\\Controllers',\n 'middleware' => 'web',\n ], function ($router) {\n require __DIR__.'/../Http/routes.php';\n });\n }\n }", "protected function registerRoutes()\n {\n $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');\n }", "public function register_routes() {\n\n\t\t$namespace = $this->namespace;\n\n\t\t$base = $this->rest_base;\n\n\t\tregister_rest_route( $namespace, '/' . $base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::CREATABLE,\n\t\t\t\t'callback' => array( $this, 'create_item' ),\n\t\t\t\t'permission_callback' => array( $this, 'create_item_permissions_check' ),\n\t\t\t\t'args' => $this->get_collection_params(),\n\t\t\t),\n\t\t) );\n\t}", "public function __construct() {\n\t\t$this->getRoutes = array();\n\t\t$this->postRoutes = array();\n\t}", "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}", "public function register_routes()\n {\n\n $namespace = 'api/v1';\n $base = 'categories';\n\n register_rest_route($namespace, '/' . $base, array(\n array(\n 'methods' => WP_REST_Server::CREATABLE,\n 'callback' => array($this, 'create_item'),\n 'permission_callback' => array($this, 'create_item_permissions_check'),\n 'args' => $this->get_endpoint_args_for_item_schema(true),\n ),\n ));\n\n register_rest_route($namespace, '/' . $base . '/(?P<id>\\d+)', array(\n array(\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => array($this, 'update_item'),\n 'permission_callback' => array($this, 'create_item_permissions_check'),\n 'args' => $this->get_endpoint_args_for_item_schema(true),\n ),\n ));\n }", "public function register_routes() {\n\n\t\t\t$collection_params = $this->get_collection_params();\n\t\t\t$schema = $this->get_item_schema();\n\n\t\t\t$get_item_args = array(\n\t\t\t\t'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t\t);\n\n\t\t\tregister_rest_route(\n\t\t\t\t$this->namespace,\n\t\t\t\t'/' . $this->rest_base . '/(?P<id>[\\d]+)/' . $this->rest_sub_base,\n\t\t\t\tarray(\n\t\t\t\t\t'args' => array(\n\t\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t\t'description' => esc_html__( 'User ID', 'learndash' ),\n\t\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t\t\t'callback' => array( $this, 'get_user_groups' ),\n\t\t\t\t\t\t'permission_callback' => array( $this, 'get_user_groups_permissions_check' ),\n\t\t\t\t\t\t'args' => $this->get_collection_params(),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t\t\t'callback' => array( $this, 'update_user_groups' ),\n\t\t\t\t\t\t'permission_callback' => array( $this, 'update_user_groups_permissions_check' ),\n\t\t\t\t\t\t'args' => array(\n\t\t\t\t\t\t\t'group_ids' => array(\n\t\t\t\t\t\t\t\t'description' => esc_html__( 'Group IDs to add to User.', 'learndash' ),\n\t\t\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'integer',\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\tarray(\n\t\t\t\t\t\t'methods' => WP_REST_Server::DELETABLE,\n\t\t\t\t\t\t'callback' => array( $this, 'delete_user_groups' ),\n\t\t\t\t\t\t'permission_callback' => array( $this, 'delete_user_groups_permissions_check' ),\n\t\t\t\t\t\t'args' => array(\n\t\t\t\t\t\t\t'group_ids' => array(\n\t\t\t\t\t\t\t\t'description' => esc_html__( 'Group IDs to remove from User.', 'learndash' ),\n\t\t\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'integer',\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'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}", "private static function setupRoutes()\n {\n $container = self::$kernel->getContainer();\n $router = $container->get('router');\n self::$login_url = $router->generate('fos_user_security_login');\n }", "public function __construct(){\n\n $this->routes = new \\SplObjectStorage();\n\n }", "public function register_routes() {\n register_rest_route( $this->namespace, '/' . $this->rest_base, array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array( $this, 'get_items' ),\n 'permission_callback' => array( $this, 'get_items_permissions_check' ),\n 'args' => $this->get_collection_params(),\n 'show_in_index' => true,\n ),\n array(\n 'methods' => WP_REST_Server::CREATABLE,\n 'callback' => array( $this, 'create_item' ),\n 'permission_callback' => array( $this, 'create_item_permissions_check' ),\n 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ),\n 'show_in_index' => true,\n ),\n 'schema' => array( $this, 'get_public_item_schema' ),\n ) );\n\n register_rest_route( $this->namespace, '/back_project', array(\n array(\n 'methods' => WP_REST_Server::CREATABLE,\n 'callback' => array($this, 'backProjectApiCallback'),\n 'permission_callback' => array( $this, 'get_items_permissions_check' ),\n 'args' => array(\n 'project_id' => array(\n 'validate_callback' => function($param, $request, $key) {\n return is_numeric( $param );\n }\n ),\n 'amount' => array(\n 'validate_callback' => function($param, $request, $key) {\n return is_numeric( $param );\n }\n ),\n ),\n ),\n ) );\n\n register_rest_route( $this->namespace, '/get_balance', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array($this, 'getBalance'),\n 'permission_callback' => array( $this, 'get_items_permissions_check' ),\n ),\n ) );\n\n register_rest_route( $this->namespace, '/get_transactions', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array($this, 'getTransactions'),\n 'permission_callback' => array( $this, 'get_items_permissions_check' ),\n ),\n ) );\n\n /**\n * endpoint for sending coins to all accounts\n */\n register_rest_route( $this->namespace, '/setCoinsToAll', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array($this, 'setCoinsToAll'),\n 'permission_callback' => array( $this, 'get_items_permissions_check' ),\n 'args' => array(\n 'amount' => array(\n 'validate_callback' => function($param, $request, $key) {\n return is_numeric( $param );\n }\n ),\n ),\n ),\n ) );\n\n register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\\d]+)', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array( $this, 'get_item' ),\n 'permission_callback' => array( $this, 'get_item_permissions_check' ),\n 'args' => array(\n 'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n ),\n 'show_in_index' => true,\n ),\n array(\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => array( $this, 'update_item' ),\n 'permission_callback' => array( $this, 'update_item_permissions_check' ),\n 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),\n 'show_in_index' => true,\n ),\n array(\n 'methods' => WP_REST_Server::DELETABLE,\n 'callback' => array( $this, 'delete_item' ),\n 'permission_callback' => array( $this, 'delete_item_permissions_check' ),\n 'args' => array(\n 'force' => array(\n 'default' => true,\n 'description' => __( 'Whether to bypass trash and force deletion.' ),\n ),\n ),\n 'show_in_index' => false,\n ),\n 'schema' => array( $this, 'get_public_item_schema' ),\n ) );\n }", "public function registerSiteRoutes()\n\t{\n\t\t// NOTE: the second route is used to capture files in subdirectories as well\n\t\treturn array(\n\t\t\t'internal/(?P<id>.\\d*)' => array('action' => 'AssetManagement/Assets/findById'),\n\t\t\t'internal/(?P<directory>.*)/(?P<name>.*)' => array('action' => 'AssetManagement/Assets/findInDirectory')\n\t\t);\n\t}", "protected function loadRoutes()\n {\n if (!$this->app->routesAreCached()) {\n $this->routes($this->app->make(Router::class));\n }\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n $this->mapArticleRoutes();\n $this->mapVideoRoutes();\n $this->mapProductRoutes();\n $this->mapHarvestRoutes();\n $this->mapUserRoutes();\n $this->mapCategoryRoutes();\n $this->mapRegionRoutes();\n $this->mapUnitRoutes();\n $this->mapOrderRoutes();\n $this->mapLandRoutes();\n $this->mapBannerRoutes();\n $this->mapAdminRoutes();\n\n //\n }", "public function register_routes() {\n\t\t$version = '1';\n\t\t$namespace = 'askmedesk/v' . $version;\n register_rest_route( $namespace, '/tipi-richiesta', array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => [$this, 'get_tipi_richiesta'],\n 'permission_callback' => [$this, 'askmedesk_permission_check']\n\t\t));\n\t\tregister_rest_route($namespace, '/creazione-richiesta', array(\n\t\t\t'methods' => WP_REST_Server::CREATABLE,\n\t\t\t'callback' => [$this, 'crea_richiesta'],\n\t\t\t'permission_callback' => [$this, 'askmedesk_permission_check'],\n\t\t\t'args' => $this->get_endpoint_args_for_item_schema( false )\n\t\t));\n\t}", "protected function loadRoutes()\n {\n $this->app->call([$this, 'map']);\n }", "public function register_routes() {\n # GET/POST /products\n $routes[$this->base] = array(\n array( array( $this, 'get_products' ), WC_API_Server::READABLE ),\n array( array( $this, 'create_product' ), WC_API_SERVER::CREATABLE | WC_API_Server::ACCEPT_DATA ),\n );\n }", "public function register_routes() {\n register_rest_route(\n $this->namespace, '/' . $this->base, array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array( $this, 'get_announcements' ),\n 'args' => array_merge(\n $this->get_collection_params(), array(\n 'status' => array(\n 'type' => 'string',\n 'description' => __( 'Announcement status', 'dokan' ),\n 'required' => false,\n ),\n )\n ),\n 'permission_callback' => array( $this, 'get_announcement_permissions_check' ),\n ),\n array(\n 'methods' => WP_REST_Server::CREATABLE,\n 'callback' => array( $this, 'create_announcement' ),\n 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ),\n 'permission_callback' => array( $this, 'create_announcement_permissions_check' ),\n ),\n )\n );\n\n register_rest_route(\n $this->namespace, '/' . $this->base . '/(?P<id>[\\d]+)/', array(\n 'args' => array(\n 'id' => array(\n 'description' => __( 'Unique identifier for the object.', 'dokan' ),\n 'type' => 'integer',\n ),\n ),\n\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array( $this, 'get_announcement' ),\n 'permission_callback' => array( $this, 'get_announcement_permissions_check' ),\n ),\n\n array(\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => array( $this, 'update_announcement' ),\n 'permission_callback' => array( $this, 'get_announcement_permissions_check' ),\n ),\n\n array(\n 'methods' => WP_REST_Server::DELETABLE,\n 'callback' => array( $this, 'delete_announcement' ),\n 'permission_callback' => array( $this, 'get_announcement_permissions_check' ),\n ),\n\n )\n );\n\n register_rest_route(\n $this->namespace, '/' . $this->base . '/(?P<id>[\\d]+)/restore', array(\n 'args' => array(\n 'id' => array(\n 'description' => __( 'Unique identifier for the object.', 'dokan' ),\n 'type' => 'integer',\n ),\n ),\n\n array(\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => array( $this, 'restore_announcement' ),\n 'permission_callback' => array( $this, 'restore_announcement_permissions_check' ),\n ),\n )\n );\n\n register_rest_route(\n $this->namespace, '/' . $this->base . '/batch', array(\n array(\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => array( $this, 'batch_items' ),\n 'permission_callback' => array( $this, 'batch_items_permissions_check' ),\n 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),\n ),\n )\n );\n }", "public function register_routes() {\n\t\tregister_rest_route( $this->namespace, $this->route, [\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => [$this, 'get_options']\n\t\t\t],\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => [$this, 'update_options'],\n\t\t\t\t'permission_callback' => [$this, 'update_option_permissions_check']\n\t\t\t],\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::DELETABLE,\n\t\t\t\t'callback' => [$this, 'delete_options'],\n\t\t\t\t'permission_callback' => [$this, 'delete_option_permissions_check']\n\t\t\t]\n\t\t] );\n\n\t\tregister_rest_route( $this->namespace, $this->route . '/(?P<slug>.+)', [\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => [$this, 'get_option']\n\t\t\t],\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => [$this, 'update_option'],\n\t\t\t\t'permission_callback' => [$this, 'update_option_permissions_check']\n\t\t\t],\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::DELETABLE,\n\t\t\t\t'callback' => [$this, 'delete_option'],\n\t\t\t\t'permission_callback' => [$this, 'delete_option_permissions_check']\n\t\t\t]\n\t\t] );\n\t}", "public function register_routes() {\n register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\\d]+)/feedback', [\n [\n 'methods' => WP_REST_Server::CREATABLE,\n 'callback' => [$this, 'handle_feedback'],\n 'permission_callback' => array($this, 'create_item_permissions_check'),\n 'args' => [\n 'name' => [\n 'type' => 'string',\n 'sanitize_callback' => 'sanitize_text_field',\n ],\n 'email' => [\n 'description' => __('Email address of the author.'),\n 'type' => 'string',\n 'format' => 'email',\n ],\n 'subject' => [\n 'required' => true,\n 'type' => 'string',\n 'sanitize_callback' => 'sanitize_text_field',\n ],\n 'message' => [\n 'required' => true,\n 'type' => 'string',\n 'sanitize_callback' => 'sanitize_textarea_field',\n ],\n ],\n ]\n ] );\n\n register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\\d]+)/helpfullness', [\n [\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => [$this, 'update_helpfullness'],\n 'args' => [\n 'type' => [\n 'required' => true,\n 'type' => 'string',\n 'enum' => ['positive', 'negative'],\n ],\n ],\n ]\n ] );\n\n register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\\d]+)/parents', [\n [\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => [$this, 'get_parents'],\n ]\n ] );\n\n register_rest_route( $this->namespace, '/' . $this->rest_base . '/search', [\n [\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => [$this, 'search_docs'],\n 'args' => [\n 'query' => [\n 'required' => true,\n 'type' => 'string',\n 'description' => __('Limit results to those matching a string.', 'muiteer'),\n 'sanitize_callback' => 'sanitize_text_field',\n 'validate_callback' => 'rest_validate_request_arg',\n ],\n 'in' => [\n 'required' => false,\n 'type' => 'integer',\n 'description' => __('The ID for the parent of the object.', 'muiteer'),\n 'sanitize_callback' => 'absint',\n 'validate_callback' => 'rest_validate_request_arg',\n ],\n 'page' => array(\n 'description' => __('Current page of the collection.', 'muiteer'),\n 'type' => 'integer',\n 'default' => 1,\n 'sanitize_callback' => 'absint',\n 'validate_callback' => 'rest_validate_request_arg',\n 'minimum' => 1,\n ),\n 'per_page' => array(\n 'description' => __('Maximum number of items to be returned in result set.', 'muiteer'),\n 'type' => 'integer',\n 'default' => 10,\n 'minimum' => 1,\n 'maximum' => 100,\n 'sanitize_callback' => 'absint',\n 'validate_callback' => 'rest_validate_request_arg',\n ),\n ],\n ]\n ] );\n }", "public function bindRoutesToControllers()\n {\n $api = $this->app[\"controllers_factory\"];\n\n $api->get('/tests/{name}/{data_array}', \"schema.controller:getTests\");\n\n $this->app->mount('/', $api);\n }", "public function route()\n {\n $this->dashboardRouting($this->relativeCmsUri);\n $this->logOffRouting($this->request, $this->relativeCmsUri);\n $this->apiRouting($this->relativeCmsUri);\n $this->documentRouting($this->userRights, $this->relativeCmsUri);\n $this->valuelistsRouting($this->userRights, $this->relativeCmsUri);\n $this->sitemapRouting($this->userRights, $this->relativeCmsUri);\n $this->redirectRouting($this->userRights, $this->relativeCmsUri);\n $this->imageRouting($this->userRights, $this->relativeCmsUri);\n $this->filesRouting($this->userRights, $this->relativeCmsUri);\n $this->configurationRouting($this->userRights, $this->relativeCmsUri);\n $this->searchRouting($this->relativeCmsUri);\n }", "public function register_rest_routes() {\n\t\t/**\n\t\t * Setting up custom route for podcast\n\t\t */\n\t\tregister_rest_route(\n\t\t\t'ssp/v1',\n\t\t\t'/podcast',\n\t\t\tarray(\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => array( $this, 'get_rest_podcast' ),\n\t\t\t)\n\t\t);\n\n\t\t/**\n\t\t * Setting up custom route for podcast\n\t\t */\n\t\tregister_rest_route(\n\t\t\t'ssp/v1',\n\t\t\t'/podcast_update',\n\t\t\tarray(\n\t\t\t\t'methods' => 'POST',\n\t\t\t\t'callback' => array( $this, 'update_rest_podcast' ),\n\t\t\t)\n\t\t);\n\n\t\t/**\n\t\t * Setting up custom route for episodes\n\t\t */\n\t\t$controller = new Episodes_Controller();\n\t\t$controller->register_routes();\n\n\t}", "public function getRoutes() {}", "public static function routes(): void\n {\n //\n }", "public function register_routes() {\n\n register_rest_route( $this->namespace, '/' . $this->base, array(\n array(\n 'methods' => WP_REST_Server::CREATABLE,\n 'callback' => array( $this->service, 'create' ),\n 'permission_callback' => array( $this, 'getAdminUserCheck' ),\n 'args' => $this->get_endpoint_args_for_item_schema( true ),\n 'accept_json' => true\n ),\n ) );\n\n register_rest_route( $this->namespace, '/' . $this->base . '/(?P<id>[\\d]+)', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array( $this->service, 'get' ),\n 'permission_callback' => array( $this, 'getAllUserCheck' ),\n 'args' => array(\n 'context' => array(\n 'default' => 'view',\n )\n ),\n ),\n\n array(\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => array( $this->service, 'update' ),\n 'permission_callback' => array( $this, 'getAdminUserCheck' ),\n 'args' => $this->get_endpoint_args_for_item_schema( false ),\n 'accept_json' => true\n ),\n\n array(\n 'methods' => WP_REST_Server::DELETABLE,\n 'callback' => array( $this->service, 'delete' ),\n 'permission_callback' => array( $this, 'getAdminUserCheck' ),\n 'args' => array(\n 'force' => array(\n 'default' => false,\n ),\n ),\n ),\n ) );\n }", "protected function loadRoutes()\n {\n $routeLoader = $this->container->get('routing.loader');\n $routes = $this->routes;\n foreach ($this->bundles as $bundle) {\n if (!$this->loaded[$bundle]) {\n $resource = $this->container->get('kernel')->locateResource(sprintf('@%s/Controller/', $bundle));\n $routes = array_merge($routes, $routeLoader->load($resource)->all());\n }\n }\n\n foreach($routes as $routeName => $route) {\n if (array_key_exists('label', $route->getOptions())) {\n $this->routes[$routeName] = $route;\n }\n }\n }", "protected function routes()\n {\n if ($this->app->routesAreCached()) {\n return;\n }\n\n\n /**\n * Porteiro; Routes\n */\n $this->loadRoutesForRiCa(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'routes');\n }", "protected function registerRoutes()\n {\n $this->registerWebRoutes();\n $this->registerApiRoutes();\n }", "protected function registerRoutes()\n {\n Route::group($this->routeConfiguration(), function () {\n $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');\n });\n }", "protected function registerRoutes()\n {\n Route::group($this->routeConfiguration(), function () {\n $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');\n });\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n $this->mapACLRoutes(); \n //\n }", "public function initialize()\n {\n $configs = \\Phpfox::get('router.provider')->loadConfigs();\n\n $this->phrases = $configs['phrases'];\n\n foreach ($configs['chains'] as $v) {\n\n if (!isset($v['chain'])) {\n throw new InvalidArgumentException(var_export($v, 1));\n }\n $key = $v['chain'];\n unset($v['chain']);\n if (!isset($this->routes[$key])) {\n $this->routes[$key] = new Routing($key, null);\n }\n $this->routes[$key]->chain($this->build($v));\n }\n\n foreach ($configs['routes'] as $key => $v) {\n if (strpos($key, '.')) {\n list($group) = explode('.', $key, 2);\n $this->routes[$group]->add(new Routing($key, $this->build($v)));\n } else {\n $this->routes[$key] = new Routing($key, $this->build($v));\n }\n }\n }", "public function registerRoutes() {\n $this->addRoute('default');\n }", "protected function initRoutes() {\n\t\t$routes['index'] = array(\n\t\t\t'route' => '/',\n\t\t\t'controller' => 'IndexController',\n\t\t\t'action' => 'index'\n\t\t);\n\n\t\t$routes['home'] = array(\n\t\t\t'route' => '/home',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'home'\n\t\t);\n\n\t\t$routes['autenticar'] = array(\n\t\t\t'route' => '/autenticar',\n\t\t\t'controller' => 'AuthController',\n\t\t\t'action' => 'autenticar'\n\t\t);\n\n\t\t$routes['editar'] = array(\n\t\t\t'route' => '/editar',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'editar'\n\t\t);\n\n\t\t$routes['sair'] = array(\n\t\t\t'route' => '/sair',\n\t\t\t'controller' => 'AuthController',\n\t\t\t'action' => 'sair'\n\t\t);\n\t\t##### Fim rotas principais #####\n\n\t\t// ***** Inicio usuario ***** //\n\t\t$routes['usuario'] = array(\n\t\t\t'route' => '/usuario',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'usuario'\n\t\t);\n\n\t\t$routes['cadastrar'] = array(\n\t\t\t'route' => '/cadastrar',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'cadastrar'\n\t\t);\n\n\t\t$routes['registrar'] = array(\n\t\t\t'route' => '/registrar',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'registrar'\n\t\t);\n\n\t\t$routes['acaousuario'] = array(\n\t\t\t'route' => '/acaousuario',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'botoesUsuario'\n\t\t);\n\n\t\t$routes['editaruser'] = array(\n\t\t\t'route' => '/editaruser',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'editarUser'\n\t\t);\n\t\t##### Fim usuario #####\n\n\t\t// ***** Inicio Produto ***** //\n\t\t$routes['produto'] = array(\n\t\t\t'route' => '/produto',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'produto'\n\t\t);\n\n\t\t$routes['cadastrarprod'] = array(\n\t\t\t'route' => '/cadastrarprod',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'cadastrarProd'\n\t\t);\n\n\t\t$routes['registrarprod'] = array(\n\t\t\t'route' => '/registrarprod',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'registrarProd'\n\t\t);\n\n\t\t$routes['acaoproduto'] = array(\n\t\t\t'route' => '/acaoproduto',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'botoesProduto'\n\t\t);\n\n\t\t$routes['editarprod'] = array(\n\t\t\t'route' => '/editarprod',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'editarProd'\n\t\t);\n\t\t##### Fim Produtos #####\n\t\t\n\t\t// ***** Inicio carrinho ***** //\n\t\t$routes['carrinho'] = array(\n\t\t\t'route' => '/carrinho',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'carrinho'\n\t\t);\n\n\t\t$routes['finalizar'] = array(\n\t\t\t'route' => '/finalizar',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'finalizar'\n\t\t);\n\t\t##### Fim carrinho #####\n\t\t\n\t\t// ***** Inicio pedido ***** //\n\t\t$routes['pedido'] = array(\n\t\t\t'route' => '/pedido',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'pedido'\n\t\t);\n\t\t##### Fim pedido #####\n\n\t\t// ***** Inicio Relatorio ***** //\n\t\t$routes['relatorio'] = array(\n\t\t\t'route' => '/relatorio',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'relatorio'\n\t\t);\n\t\t##### Fim Relatorio #####\n\t\t$this->setRoutes($routes);\n\t}", "protected function loadRoutesForBoot(): void\n {\n $this->configureRateLimiting();\n $apiRoutes = $this->getApiRoutesFromContainers();\n $webRoutes = $this->getWebRoutesFromContainers();\n\n $this->routes(function () use ($apiRoutes, $webRoutes) {\n foreach ($apiRoutes as $route){\n Route::middleware('api')\n ->prefix('api')\n ->group($route);\n }\n\n foreach ($webRoutes as $route){\n Route::middleware('web')\n ->group($route);\n }\n });\n }" ]
[ "0.6743783", "0.6709166", "0.662569", "0.6557571", "0.6524404", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.65121615", "0.6511611", "0.6476931", "0.6454291", "0.64301705", "0.64114666", "0.64091873", "0.63985384", "0.63936436", "0.6386696", "0.6370334", "0.6343389", "0.6318258", "0.6287732", "0.62688726", "0.6266593", "0.624968", "0.6244388", "0.6237874", "0.6231383", "0.6231383", "0.62297606", "0.6229069", "0.6225316", "0.6225287", "0.6207412", "0.61973053", "0.619068", "0.6151162", "0.61145884", "0.6111849", "0.6101232", "0.60616636", "0.6036137", "0.60262626", "0.59991616", "0.5984122", "0.5977173", "0.597631", "0.5975607", "0.59753746", "0.59699196", "0.595872", "0.5955378", "0.59541124", "0.5950139", "0.59408027", "0.5931893", "0.59299356", "0.59281546", "0.5915012", "0.59112304", "0.590766", "0.5897137", "0.58899546", "0.58811975", "0.58797187", "0.58685", "0.58660984", "0.58660984", "0.58550507", "0.58500344", "0.5837051", "0.5832147", "0.5831106" ]
0.0
-1
Get all registered templates
public function getTemplates() { return $this->templates; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getTemplatesUsed()\n {\n return static::$allTemplates;\n }", "public function getAllTemplates() {\n $pages = Templates::templates()->get();\n\n return response()->json($pages);\n }", "function templates()\n {\n return [];\n }", "public function getTemplates (){\n $dir = conf::pathHtdocs() . \"/templates\";\n $templates = file::getFileList($dir, array('dir_only' => true));\n\n $ary = array ();\n foreach ($templates as $val){\n $info = $this->getSingleTemplate($val);\n if (empty($info)) {\n continue;\n }\n $ary[] = $info;\n }\n return $ary;\n }", "public function getTemplates()\n {\n $templates = SSViewer::get_templates_by_class(static::class, '', __CLASS__);\n // Prefer any custom template\n if ($this->getTemplate()) {\n array_unshift($templates, $this->getTemplate());\n }\n return $templates;\n }", "public function getAllTemplates(){ //return all templates in database to the select to choose from templates\n return TemplatesResource::collection(TemplateProject::all());\n }", "public function index() {\n $templates = Template::all();\n return $templates;\n }", "function getTemplates() {\n\n // Lets load the data if it doesn't already exist\n if (empty($this->_data)) {\n\n // constructs the query\n $query = ' SELECT * '\n . ' FROM #__templateck';\n\n // retrieves the data\n $this->_data = $this->_getList($query);\n }\n\n return $this->_data;\n }", "public function get_templates()\n {\n $template = new MailTemplate();\n return $template->findAll();\n }", "function ListTemplates()\r\n\t\t{\r\n\t\t\t\r\n\t\t\tglobal $Config;\r\n\t\t\t\r\n\t\t\t$sql = \"select * from templates order by TemplateDisplayName asc\" ; \r\n\t\t\treturn $this->get_results($sql);\t\t\r\n\t }", "public function getTemplates() {\n $pages = Templates::templates()->paginate(Templates::getPageSize());\n\n return response()->json($pages);\n }", "public function getTemplates(){\n\t\n\t\tif( empty($this->_templates) ){\n\t\n\t\t\t$query\t= $this->_db->getQuery(true);\n\t\t\t\n\t\t\t$query->select( 't.tmpl_id AS value, t.tmpl_name AS text' );\n\t\t\t$query->from( '#__zbrochure_templates AS t' );\n\t\t\t$query->where( 't.tmpl_published = 1' );\n\t\t\t\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$this->_templates = $this->_db->loadObjectList();\n\n\t\t}\n\t\t\n\t\treturn $this->_templates;\n\t\n\t}", "public function getTemplates()\n {\n return [\n 'paths' => [\n 'app' => ['templates/app'],\n 'error' => ['templates/error'],\n 'layout' => ['templates/layout'],\n 'oauth' => ['templates/oauth'],\n ],\n ];\n }", "public function getTemplates()\n {\n $finder = Finder::create()\n ->files()\n ->name('*.sql')\n ->in($this->rootDir.'/../templates')\n ;\n\n $templates = [];\n\n /** @var SplFileInfo $file */\n foreach ($finder as $file) {\n $templates[] = $file->getRelativePathname();\n }\n\n return $templates;\n }", "public function GetSavedTemplates() {\n\t\t$templates = &drupal_static(__FUNCTION__, NULL, $this->reset);\n\n\t\tif (!isset($templates)) {\n\t\t\t$templates = db_select('{'.ACQUIA_COMPOSER_TEMPLATES_TABLE.'}', 'ac')\n\t\t\t\t->fields('ac')\n\t\t\t\t->execute()\n\t\t\t\t->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t\tif (!count($templates)) {\n\t\t\t\t$templates = array();\n\t\t\t}\n\t\t}\n\t\treturn $templates;\n\t}", "public function get()\n {\n return $this->templates;\n }", "public function getTemplateList() {\n\t\t$aArgs = func_get_args();\n\t\t$aRet = call_user_func_array( array( $this, 'getTemplates' ), $aArgs );\n\t\treturn implode( '|', $aRet );\n\t}", "function getAllPageTemplates() {\n global $wpdb;\n return $wpdb->get_col(\"SELECT DISTINCT meta_value FROM wp_postmeta WHERE meta_key = '_wp_page_template'\"); \n }", "private function find_templates () {\r\n\t\t$results = array();\r\n\r\n\t\t$files = WooDojo_Utils::glob_php( '*.php', GLOB_MARK, $this->templates_dir );\r\n\r\n\t\tif ( is_array( $files ) && count( $files ) > 0 ) {\r\n\t\t\tforeach ( $files as $k => $v ) {\r\n\t\t\t\t$data = $this->get_template_data( $v );\r\n\t\t\t\tif ( is_object( $data ) && isset( $data->title ) ) {\r\n\t\t\t\t\t$results[$v] = $data->title;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $results;\r\n\t}", "protected function getAvailableTemplates( )\n\t{\n\t\t$available_templates = $this->getConfig( 'templates' );\n\n\t\treturn $available_templates;\n\t}", "public function getTemplates()\n {\n return [\n// 'paths' => [\n// 'auth' => [__DIR__ . '/../templates/auth'],\n//\n// 'app' => [__DIR__ . '/../templates/app'],\n// 'error' => [__DIR__ . '/../templates/error'],\n// 'layout' => [__DIR__ . '/../templates/layout'],\n// ],\n ];\n }", "public function getTemplates()\n {\n return [\n 'paths' => [\n 'app' => [__DIR__ . '/../templates/app'],\n 'error' => [__DIR__ . '/../templates/error'],\n 'layout' => [__DIR__ . '/../templates/layout'],\n 'mail' => [__DIR__ . '/../templates/mail'],\n ],\n ];\n }", "public function viewProvider()\n {\n $config = $this->getMartyConfig();\n $templateDir = $config['templateDir'];\n $templates = [];\n $it = new \\RecursiveIteratorIterator(new \\RecursiveDirectoryIterator($templateDir));\n /** @var \\SplFileInfo $file */\n foreach ($it as $file) {\n if ($file->isFile() && $file->getExtension() == 'tpl') {\n $templateName = substr($file->getPathname(), strlen($templateDir) + 1);\n $templateId = str_replace(['/', '.tpl'], ['.', ''], $templateName);\n $templates[$templateId] = [$templateName];\n }\n }\n\n return $templates;\n }", "public function getShowTemplates();", "public function getTemplates() : array\n {\n return [\n 'paths' => [\n 'elements' => [__DIR__ . '/../templates/'],\n ],\n ];\n }", "public function retrieveMessageTemplates()\n {\n return $this->start()->uri(\"/api/message/template\")\n ->get()\n ->go();\n }", "public function get_custom_templates()\n {\n }", "protected function templates(): array\n {\n return [\n 'links' => [\n 'home' => route('templates.show', 'home/index'),\n ],\n ];\n }", "function customcert_get_templates() {\n global $DB;\n\n return $DB->get_records_menu('customcert_template', array(), 'name ASC', 'id, name');\n}", "public function getAllScreenTemplates() {\n return $this->container->get('doctrine')\n ->getRepository('Os2DisplayCoreBundle:ScreenTemplate')\n ->findAll();\n }", "public function getTemplates() : array\n {\n return [\n 'paths' => [\n 'route' => [__DIR__ . '/../templates/route'],\n 'route-admin' => [__DIR__ . '/../templates/route-admin'],\n ],\n ];\n }", "protected function getTemplates()\r\n\t{\r\n\t\t$templates = array();\r\n\t\tforeach ($this->getProjectDao()->getAllModelTemplates() as $template)\r\n\t\t\t$templates[$template->ID] = $template->Template;\r\n\t\treturn $templates;\r\n\t}", "public function allPages()\n {\n $this->get('/', function(Request $request, Response $response) {\n $templates = [];\n foreach(new DirectoryIterator($this->basePath . '/src/views/') as $fileInfo) {\n if ($fileInfo->isFile() && strtolower($fileInfo->getExtension()) === 'twig') {\n $baseName = $fileInfo->getBasename('.twig');\n\n $templates[$baseName] = [\n 'name' => $baseName,\n 'has_data' => file_exists($this->basePath . '/src/data/' . $baseName . '.php'),\n ];\n }\n }\n ksort($templates);\n\n return $this->view->render($response, 'app_pages.twig', ['templates' => $templates, 'css_url' => $cssUrl]);\n })->setName('templates.list');\n\n return $this;\n }", "function _get_templates()\n\t{\n\t\t$location = FILESYSTEM_PATH .'modules/customcats/templates/cattemplates/';\n\t\t$filelist=array();\n\t\tif ($handle = opendir($location))\n\t\t{\n\t\t\twhile (false !== ($file = readdir($handle)))\n\t\t\t{\n\t\t\t\tif ($file != \".\" && $file != \"..\" && $file!=\".svn\" && $file!=\"index.htm\")\n\t\t\t\t{\n\t\t\t\t\t$filelist[]=$file;\n\t\t\t\t}\n\t\t\t}\n \t\t\tclosedir($handle);\n\t\t}\n\t\treturn $filelist;\n\t}", "function getTemplates( $cwd = '.' ) {\n\n // New list\n $templates = array();\n\n // Use cache\n if ( !is_file( \"{$cwd}/tmp/cache/templates.cache\" ) ) {\n\n // Handle themes here\n $list = browse( \"{$cwd}/templates/\", false, true, false );\n\n // Loop\n foreach ( $list as $dir ) {\n\n // Definitions?\n if ( is_file( \"{$cwd}/templates/{$dir}/manifest.json\" ) ) {\n\n // Get json\n $loadedFile = json_decode( file_get_contents( \"{$cwd}/templates/{$dir}/manifest.json\" ), true );\n\n // Verify List - Do not append unless manifest is correct\n if ( !empty( $loadedFile[ 'name' ] ) && is_file( \"{$cwd}/templates/{$dir}/{$loadedFile['template']}\" ) ) {\n\n // This is JSON from the template\n $templates[ $dir ] = $loadedFile;\n\n // Add full path to the variable\n $templates[ $dir ][ 'path' ] = \"/templates/{$dir}\";\n\n }\n\n }\n\n }\n\n // Sort them ascending\n asort( $templates );\n\n // Store cache\n file_put_contents( \"{$cwd}/tmp/cache/templates.cache\", json_encode( $templates ) );\n\n } else {\n\n return json_decode( file_get_contents( \"{$cwd}/tmp/cache/templates.cache\" ), true );\n\n }\n\n return $templates;\n\n }", "public function getAllSlideTemplates() {\n return $this->container->get('doctrine')\n ->getRepository('Os2DisplayCoreBundle:SlideTemplate')\n ->findAll();\n }", "function GetDocumentTemplates()\n\t{\n\t\t$result = $this->sendRequest(\"GetDocumentTemplates\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function getCreatedTemplates ()\n {\n // Get all the templates\n $table = DB::select('select id_template, name_template, created_at, icon from ezz_templates');\n return response()->json([\n 'templates' => $table\n ], 200);\n }", "public function getTemplates($context = null);", "public function getTemplateNames() {\n\t\treturn array_keys(self::$_config->template->toArray());\n\t}", "public function getTemplatesFromDB();", "public function getFormTemplates();", "public function retrieveEmailTemplates()\n {\n return $this->start()->uri(\"/api/email/template\")\n ->get()\n ->go();\n }", "public function onGetPageTemplates(Event $event)\n {\n $event->types->scanTemplates(__DIR__.\"/templates\");\n }", "public function getAllSMSTemplates()\n {\n $selectTempsql = 'SELECT temp_id, temp_name FROM ' . _DB_PREFIX_ . 'onehop_sms_templates';\n $selectTempsql .= ' WHERE 1 Order By temp_name ASC';\n $templateRes = Db::getInstance()->ExecuteS($selectTempsql);\n return $templateRes;\n }", "public function getTemplates() {\n\n\t\t$aArgs = func_get_args();\n\t\t$aRet = array();\n\t\t\n\t\tforeach ( $this->_aTemplates as $sTemplate => $aGroup ) {\n\t\t\t$bMatch = TRUE;\n\t\t\tforeach ( $aArgs as $sMatchGroup ) {\n\t\t\t\tif ( !in_array( $sMatchGroup, $aGroup ) ) {\n\t\t\t\t\t$bMatch = FALSE;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( $bMatch ) $aRet[] = $sTemplate;\n\t\t}\n\t\t\n\t\treturn $aRet;\n\t}", "public function registerMailTemplates()\n {\n return [];\n }", "private function registerTemplates()\n {\n if (!isset($this->config['templates']) || !count($this->config['templates'])) {\n return;\n }\n\n $templatesToAdd = [];\n foreach ($this->config['templates'] as $templateName) {\n $templatesToAdd[ sanitize_title_with_dashes($templateName) ] = $templateName;\n }\n\n add_filter('theme_page_templates', function ($templates) use ($templatesToAdd) {\n foreach ($templatesToAdd as $slug => $name) {\n $templates[ $slug ] = $name;\n }\n return $templates;\n });\n }", "public function getTemplates()\n\t{\n\t\t$templates = [\n\t\t\t'br' => '<br/>',\n\t\t\t'e' => '',\n\t\t\t'i' => '',\n\t\t\t'p' => '<p><xsl:apply-templates/></p>',\n\t\t\t's' => ''\n\t\t];\n\n\t\tforeach ($this->configurator->tags as $tagName => $tag)\n\t\t{\n\t\t\tif (isset($tag->template))\n\t\t\t{\n\t\t\t\t$templates[$tagName] = (string) $tag->template;\n\t\t\t}\n\t\t}\n\n\t\tksort($templates);\n\n\t\treturn $templates;\n\t}", "public function get_post_templates()\n {\n }", "protected function _loadTemplates()\n {\n $this->_tpl = array();\n $dir = Solar_Class::dir($this, 'Data');\n $list = glob($dir . '*.php');\n foreach ($list as $file) {\n \n // strip .php off the end of the file name to get the key\n $key = substr(basename($file), 0, -4);\n \n // load the file template\n $this->_tpl[$key] = file_get_contents($file);\n \n // we need to add the php-open tag ourselves, instead of\n // having it in the template file, becuase the PEAR packager\n // complains about parsing the skeleton code.\n // \n // however, only do this on non-view files.\n if (substr($key, 0, 4) != 'view') {\n $this->_tpl[$key] = \"<?php\\n\" . $this->_tpl[$key];\n }\n }\n }", "public function getConfiguratedTemplates() {\n\t\t$sql = 'SELECT * FROM '.$this->tablePrefix.UserAgentThemeSwitcherData::BROWSERS_TABLE;\n\t\t$results = $this->connection->get_results($sql);\n\n\t\treturn $results;\n\t}", "public static function list_templates()\n\t{\n\n\t\t$functions = get_class_methods('Controller_Admin_Documents');\n\n\t\t$doc_gen_functions = NULL;\n\t\tforeach ($functions as $key => $function)\n\t\t{\n\t\t\tif (strpos($function, 'action_doc_template') !== FALSE)\n\t\t\t{\n\t\t\t\t$cache = explode('action_doc_', $function);\n\t\t\t\t$doc_gen_functions[] = $cache[1];\n\t\t\t}\n\t\t}\n\n\t\treturn $doc_gen_functions;\n\t}", "function getPrintTemplates(){\r\n require $this->sRessourcesFile;\r\n if (in_array(\"print_templates\", $this->aSelectedFields)){\r\n $aParams['sSchemaVmap'] = array('value' => $this->aProperties['schema_vmap'], 'type' => 'schema_name');\r\n $aParams['group_id'] = array('value' => $this->aValues['my_vitis_id'], 'type' => 'number');\r\n $oPDOresult = $this->oConnection->oBd->executeWithParams($aSql['getGroupPrintTemplates'], $aParams);\r\n\t\t$sListPrintTemplateId = \"\";\r\n\t\t$aListPrintTemplateName = array();\r\n\t\twhile($aLigne=$this->oConnection->oBd->ligneSuivante ($oPDOresult)) {\r\n\t\t\tif ($sListPrintTemplateId == \"\"){\r\n\t\t\t\t$sListPrintTemplateId = $aLigne[\"printtemplate_id\"];\r\n\t\t\t}else{\r\n\t\t\t\t$sListPrintTemplateId .= \"|\".$aLigne[\"printtemplate_id\"];\r\n\t\t\t}\r\n $aListPrintTemplateName[] = $aLigne[\"name\"];\r\n\t\t}\r\n\t\t$oPDOresult=$this->oConnection->oBd->fermeResultat();\r\n $this->aFields['print_templates'] = $sListPrintTemplateId;\r\n $this->aFields['print_templates_label'] = implode(',', $aListPrintTemplateName);\r\n }\r\n }", "public function get_templates($data)\n {\n $res = $this->service->getApi()->getAllTemplates();\n return $res;\n }", "public function loadTemplates() {\n // Get database hooks.\n $doctrine = $this->container->get('doctrine');\n $slideTemplateRepository = $doctrine->getRepository('Os2DisplayCoreBundle:SlideTemplate');\n $screenemplateRepository = $doctrine->getRepository('Os2DisplayCoreBundle:ScreenTemplate');\n $entityManager = $doctrine->getManager();\n\n // Get parameters.\n $path = $this->container->get('kernel')->getRootDir() . '/../web/';\n $serverAddress = $this->container->getParameter('absolute_path_to_server');\n\n // Locate templates in /web/bundles/\n $templates = $this->findTemplates($path . 'bundles/');\n\n foreach ($templates['slides'] as $config) {\n $dir = explode('/web/', pathinfo($config, PATHINFO_DIRNAME));\n $this->loadSlideTemplate($config, $slideTemplateRepository, $entityManager, $dir[1], $serverAddress, $path);\n }\n\n foreach ($templates['screens'] as $config) {\n $dir = explode('/web/', pathinfo($config, PATHINFO_DIRNAME));\n $this->loadScreenTemplate($config, $screenemplateRepository, $entityManager, $dir[1], $serverAddress, $path);\n }\n\n // Get all templates from the database, and push update to screens.\n $existingTemplates = $screenemplateRepository->findAll();\n $middlewareService = $this->container->get('os2display.middleware.communication');\n foreach ($existingTemplates as $template) {\n foreach ($template->getScreens() as $screen) {\n $middlewareService->pushScreenUpdate($screen);\n }\n }\n }", "protected function getTemplatesRequest(){\n\t\t\n\t\t//If the user is logged in\n\t\tif($this->getModel()->checkLogin(true))\n\t\t{\n\t\t\t// Set the state and tell plugins.\n\t\t\t$this->setState('GETTING_TEMPLATES_LIST');\n\t\t\t$this->notifyObservers();\n\t\t\t\n\t\t\t//Gets template data\n\t\t\t$data = $this->getModel()->getFeaturedTemplates();\n\t\t\t\n\t\t\t//Show data\n\t\t\t$this->getView()->showInstallableTemplates($data);\n\t\t}\n\t}", "static public function listTemplates($type)\n {\n $templates = array();\n\n $_templates = Horde::loadConfiguration('templates.php', '_templates', 'whups');\n foreach ($_templates as $name => $info) {\n if ($info['type'] == $type) {\n $templates[$name] = $info['name'];\n }\n }\n\n return $templates;\n }", "function GetTemplates($userid=0)\n\t{\n\t\t$this->GetDb();\n\n\t\t$qry = \"SELECT templateid, name, ownerid FROM \" \n\t\t . SENDSTUDIO_TABLEPREFIX \n\t\t . \"templates\";\n\t\t\n\t\tif ($userid) {\n\t\t\t$qry .= \" AS t, \" . SENDSTUDIO_TABLEPREFIX \n\t\t\t . \" usergroups_access AS a \"\n\t\t\t . \" WHERE \"\n\t\t\t . \" a.resourceid = t.templateid AND \" \n\t\t\t . \" a.resourcetype = 'templates' \";\n\t\t\t$qry .= \" OR t.ownerid='\" . $this->Db->Quote($userid) . \"'\";\n\t\t} else {\n\t\t\tif (!$this->TemplateAdmin()) {\n\t\t\t\t$qry .= \" WHERE ownerid='\" . $this->Db->Quote($this->userid) . \"'\";\n\t\t\t\t\n\t\t\t\tif (!empty($this->access['templates'])) {\n\t\t\t\t\t$qry .= \" OR templateid IN (\" . implode(',', $this->access['templates']) . \")\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$qry .= \" OR isglobal='1'\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$qry .= \" ORDER BY LOWER(name) ASC\";\n\n\t\t$templates = array();\n\t\t$result = $this->Db->Query($qry);\n\t\t\n\t\twhile ($row = $this->Db->Fetch($result)) {\n\t\t\t$templates[$row['templateid']] = $row['name'];\n\t\t}\n\n\t\treturn $templates;\n\t}", "function campaignTemplates() {\n $params = array();\n return $this->callServer(\"campaignTemplates\", $params);\n }", "public function index()\n {\n $templates = $this->templates->paginate('name');\n\n return view('templates.index', compact('templates'));\n }", "function getTemplateFiles()\r\n{\r\n\t$directory = \"models/site-templates/\";\r\n\t$languages = glob($directory . \"*.css\");\r\n\t//print each file name\r\n\treturn $languages;\r\n}", "public function getEmailTemplates()\n {\n try {\n return json_decode($this->filesystem->get($this->storagePath));\n } catch (Exception $e) {\n return [];\n }\n }", "function scan_templates_for_translations () {\r\n $this->CI->load->helper( 'file' );\r\n $filename = config_item( 'dummy_translates_filename' );\r\n\r\n // Clean Pattern for new file\r\n $clean_pattern = \"<?php\\n\";\r\n\r\n // Emptying file\r\n write_file( $filename, $clean_pattern );\r\n\r\n $path = realpath( config_item( 'current_template_uri' ) );\r\n $directory = new RecursiveDirectoryIterator( $path );\r\n $iterator = new RecursiveIteratorIterator( $directory );\r\n\r\n // Regex for no deprecated twig templates\r\n $regex = '/^((?!DEPRECATED).)*\\.twig$/i';\r\n $file_iterator = new RegexIterator( $iterator, $regex, RecursiveRegexIterator::GET_MATCH );\r\n\r\n $files = 0;\r\n $arr_strings = array();\r\n\r\n foreach( $file_iterator as $name => $object ) {\r\n $files++;\r\n\r\n // Mega regex for Quoted String tokens with escapable quotes\r\n // http://www.metaltoad.com/blog/regex-quoted-string-escapable-quotes\r\n $pattern = '/{%\\s?trans\\s?((?<![\\\\\\\\])[\\'\"])((?:.(?!(?<![\\\\\\\\])\\1))*.?)\\1/';\r\n $current_file = fopen( $name, 'r' );\r\n\r\n while ( ( $buffer = fgets( $current_file ) ) !== false ) {\r\n if ( preg_match_all( $pattern, $buffer, $matches ) ) {\r\n foreach( $matches[ 2 ] as $match ) {\r\n // Escaping quotes not yet escaped\r\n $match = preg_replace( '/(?<![\\\\\\\\])(\\'|\")/', \"\\'\", $match );\r\n array_push( $arr_strings, \"echo _( '$match' );\\n\" );\r\n }\r\n }\r\n }\r\n\r\n fclose( $current_file );\r\n }\r\n\r\n // Remove duplicates\r\n $arr_strings = array_unique( $arr_strings );\r\n write_file( $filename, implode( $arr_strings ), 'a' );\r\n\r\n $result = array(\r\n 'templates' => $files,\r\n 'strings' => count( $arr_strings ),\r\n 'output' => $filename,\r\n 'lint' => check_php_file_syntax( $filename )\r\n );\r\n\r\n return $result;\r\n }", "public function index()\n\t{\n\t $this->authorize('index', 'Template');\n\n\t $templates = $this->templateLoader->loadAll();\n\n\t $perPage = $this->request->get('per_page', 10);\n\t $page = $this->request->get('page', 1);\n\n\t if ($this->request->has('query')) {\n\t $templates = $templates->filter(function($template) {\n\t return str_contains(strtolower($template['name']), $this->request->get('query'));\n });\n }\n\n if ($orderBy = $this->request->get('order_by', 'updated_at')) {\n $desc = $this->request->get('order_dir', 'desc') === 'desc';\n $templates = $templates->sortBy($orderBy, SORT_REGULAR, $desc);\n }\n\n\t $pagination = new LengthAwarePaginator(\n\t $templates->slice($perPage * ($page - 1), $perPage)->values(),\n count($templates),\n $perPage,\n $page\n );\n\n\t return $this->success(['pagination' => $pagination]);\n\t}", "public function getTemplatesForJsRouter(): array\n\t{\n\t\t$customRootTemplates = [];\n\t\tforeach ($this->customRoots as $entityTypeId => $customRoot)\n\t\t{\n\t\t\t$customRootTemplates[$entityTypeId] = $this->prepareTemplatesForRoot($entityTypeId);\n\t\t}\n\n\t\treturn [\n\t\t\t'defaultRootUrlTemplates' => $this->prepareTemplatesForRoot(),\n\t\t\t'customRootUrlTemplates' => $customRootTemplates,\n\t\t];\n\t}", "public function getAll(array $filters = null)\n {\n $response = $this->mailjet->get(Resources::$Template,\n ['filters' => $filters]);\n if (!$response->success()) {\n $this->throwError(\"TemplateManager :getAll() failed\", $response);\n }\n\n return $response->getData();\n }", "public function getTemplates()\n {\n return $this->hasMany(Template::className(), ['atk_id' => 'id']);\n }", "function wpsl_get_templates() {\n\n $templates = array(\n array(\n 'id' => 'default',\n 'name' => __( 'Default', 'wpsl' ),\n 'path' => WPSL_PLUGIN_DIR . 'frontend/templates/default.php'\n ),\n array(\n 'id' => 'below_map',\n 'name' => __( 'Show the store list below the map', 'wpsl' ),\n 'path' => WPSL_PLUGIN_DIR . 'frontend/templates/store-listings-below.php'\n )\n );\n\n return apply_filters( 'wpsl_templates', $templates );\n}", "public function get_available_templates($contextid) {\n\n $fs = get_file_storage();\n $files = $fs->get_area_files($contextid, 'mod_surveypro', SURVEYPRO_TEMPLATEFILEAREA, 0, 'sortorder', false);\n if (empty($files)) {\n return array();\n }\n\n $templates = array();\n foreach ($files as $file) {\n $templates[] = $file;\n }\n\n return $templates;\n }", "function tidyt_get_simple_feed_templates($name){\n $templates = array();\n $paged = array();\n\n $paged = tidyt_get_paged_template_functions($name);\n\n $templates = array_merge($paged, $templates);\n\n return $templates;\n}", "public function onGetPageTemplates($event) {\n $types = $event->types;\n $locator = $this->grav['locator'];\n $types->scanBlueprints($locator->findResource('plugin://' . $this->name . '/blueprints'));\n $types->scanTemplates($locator->findResource('plugin://' . $this->name . '/templates'));\n }", "public function index()\n\t{\n\t\t$cat = EmailCategory::all();\n\t\t$userId = Auth::id();\n\t\t$ut = UserTemplate::all()->where('user', $userId);\n\t\treturn view('predefinedTemplates')->with(array('cat'=>$cat, 'ut'=> $ut));\n\t}", "function defaultTemplate(){\n $this->addLocations(); // add addon files to pathfinder\n return array($this->template_file);\n }", "function getFormTemplates(){\n\t\t$AccessToken = Auth::token();\n\t\t$baseUrl = url . '/api/v1/' . customerAlias . '/' . databaseAlias;\n\t\t$endpoint = '/formtemplates';\n\t\t$request = $baseUrl . $endpoint;\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, array(\n\t\t CURLOPT_HTTPGET => true,\n\t\t CURLOPT_HTTPHEADER => array(\n\t\t\t\t'Authorization: Bearer ' . $AccessToken),\n\t\t CURLOPT_URL => $request,\n\t\t\tCURLOPT_RETURNTRANSFER => 1\n\t\t ));\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $response;\n\t}", "function getTemplateFiles() // used in admin_configuration.php\r\n\r\n{\r\n\r\n\t$directory = \"models/site-templates/\";\r\n\r\n\t$languages = glob($directory . \"*.css\");\r\n\r\n\t//print each file name\r\n\r\n\treturn $languages;\r\n\r\n}", "public function getPushoverTemplateDropdownValues()\n\t{\n\t\t$templates = [];\n\n\t\t$finder = new FileFinder();\n\t\t$finder->setOption('name_regex', '/^.*\\.ss$/');\n\n $parent = $this->getFormParent();\n\t\t\n if (!$parent) {\n return [];\n }\n\n $pushoverTemplateDirectory = $parent->config()->get('pushover_template_directory');\n $templateDirectory = ModuleResourceLoader::resourcePath($pushoverTemplateDirectory);\n\n if (!$templateDirectory) {\n\t\t\treturn [];\n }\n\t\t\n $found = $finder->find(BASE_PATH . DIRECTORY_SEPARATOR . $templateDirectory);\n\n\t\tforeach ($found as $key => $value) {\n\t\t\t$template = pathinfo($value);\n $absoluteFilename = $template['dirname'] . DIRECTORY_SEPARATOR . $template['filename'];\n\n // Optionally remove vendor/ path prefixes\n $resource = ModuleResourceLoader::singleton()->resolveResource($templateDirectory);\n if ($resource instanceof ModuleResource && $resource->getModule()) {\n $prefixToStrip = $resource->getModule()->getPath();\n } else {\n $prefixToStrip = BASE_PATH;\n }\n $templatePath = substr($absoluteFilename, strlen($prefixToStrip) + 1);\n\n // Optionally remove \"templates/\" prefixes\n if (preg_match('/(?<=templates\\/).*$/', $templatePath, $matches)) {\n $templatePath = $matches[0];\n }\n\n $templates[$templatePath] = $template['filename'];\n }\n return $templates;\n\t}", "function scanPmanTemplates()\n {\n $tp = DB_DAtaObject::Factory('core_template');\n \n foreach ($this->modules() as $m){\n //var_dump($m);\n // templates...\n $ar = $this->scanDir(array(\n 'tdir' => \"Pman/$m/templates\",\n 'subdir' => '',\n 'match' => '/\\.(html|txt|abw)$/',\n 'skipdir' => array('images','css','js'),\n \n ));\n // print_r($ar);\n \n foreach($ar as $pg) {\n \n $temp = $tp->syncTemplatePage(array(\n 'base' =>'Pman.'.$m, \n 'template_dir' => \"Pman/$m/templates\",\n 'template' => $pg\n ));\n if ($temp) {\n $ids[] = $temp->id;\n }\n }\n // should clean up old templates..\n // php files..\n $ar = $this->scanDir(array(\n 'tdir' => \"Pman/$m\",\n 'subdir' => '',\n 'match' => '/\\.(php)$/',\n 'skipdir' => array('templates'),\n \n ));\n \n \n foreach($ar as $pg) {\n \n $temp = $tp->syncPhpGetText(array(\n 'base' =>'Pman.'.$m, \n 'template_dir' => \"Pman/$m\",\n 'template' => $pg\n ));\n if ($temp) {\n $ids[] = $temp->id;\n }\n \n }\n \n \n \n \n \n //$tp->syncTemplatePage($pg);\n }\n $del = DB_DataObject::factory('core_template');\n $del->whereAddIn('!id', $ids, 'int');\n $del->whereAddIn('view_name', $this->modules(), 'string');\n $del->whereAddIn('filetype' , array( 'php', 'html' ), 'string');\n $delids = $del->fetchAll('id');\n if ($delids) {\n DB_DataObject::factory('core_template')->query(\n 'update core_template set is_deleted = 1 where id in('. implode(',', $delids). ')'\n );\n }\n \n }", "static public function getMailServerRegisteredTemplateUids()\r\n {\r\n if (!defined('HTTP_CONTEXT')) {\r\n throw new Warecorp_Exception('HTTP_CONTEXT is not defined');\r\n }\r\n \r\n $cache = Warecorp_Cache::getCache('memory');\r\n \r\n if ( ($registeredTemplateUids = $cache->load('registeredTemplateUids') ) == false) {\r\n // create list of registered templates\r\n \r\n // may throws exception\r\n $client = Warecorp::getMailServerTemplateClient();\r\n \r\n $registeredTemplateUids = array();\r\n $registeredTemplates = $client->getRegisteredTemplates(HTTP_CONTEXT);\r\n foreach ($registeredTemplates as $template) {\r\n $registeredTemplateUids[] = $template['uid'];\r\n }\r\n \r\n // save to cache\r\n $cache->save($registeredTemplateUids, 'registeredTemplateUids', array('mailtemplates') );\r\n }\r\n \r\n return $registeredTemplateUids;\r\n }", "function templates()\r\n\t{\r\n\t\t$websitepath = $this->website_path;\r\n\t\t$theme = $this->theme;\r\n\t\t$directory = $_SERVER['DOCUMENT_ROOT'].$websitepath.'themes/'.$theme.'';\r\n\t\tif(file_exists($directory))\r\n\t\t{\r\n\t\t\tif ($handle = opendir($_SERVER['DOCUMENT_ROOT'].$websitepath.'themes/'.$theme.'')) { \r\n\t\t\t\t$i = 0;\r\n\t\t\t\twhile (false !== ($file = readdir($handle)))\r\n\t\t\t\t{ \r\n\t\t\t\t\tif ($file != \".\" && $file != \"..\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(!is_dir($_SERVER['DOCUMENT_ROOT'].$websitepath.'themes/'.$theme.''.$file.''))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$myFile = $_SERVER['DOCUMENT_ROOT'].$websitepath.'themes/'.$theme.''.$file;\r\n\t\t\t\t\t\t\t$fh = fopen($myFile, 'r');\r\n\t\t\t\t\t\t\t$theData = fread($fh, 5000);\r\n\t\t\t\t\t\t\tfclose($fh);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$pos = strrpos($theData, \"{{{{{KSD Template\");\r\n\t\t\t\t\t\t\tif ($pos === false) { // note: three equal signs\r\n\t\t\t\t\t\t\t\t//die(\"Not a template.\");\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$array1 = explode(\"}}}}}\",$theData);\r\n\t\t\t\t\t\t\t\t$array2 = explode(\"{{{{{\",$array1[0]);\r\n\t\t\t\t\t\t\t\t$data = $array2[1];\r\n\t\t\t\t\t\t\t\t$array3 = explode(\",\",$data);\r\n\t\t\t\t\t\t\t\t$filearray[$i]['file'] = $file; \r\n\t\t\t\t\t\t\t\t$filearray[$i]['name'] = $array3[1]; \r\n\t\t\t\t\t\t\t\t$i++;\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}// END while\t\r\n\t\t\t\tclosedir($handle);\r\n\t\t\t} \r\n\t\t} else {\r\n\t\t\techo(\"$directory <br />NOT EXISTS\");\r\n\t\t}\r\n\t\treturn $filearray;\r\n\t}", "public function getMailTemplates()\n {\n $arrTemplates = array();\n $objTemplates = Database::getInstance()->execute(\"SELECT id,name,category FROM tl_mail_templates ORDER BY category, name\");\n\n while( $objTemplates->next() )\n {\n if ($objTemplates->category == '')\n {\n $arrTemplates[$objTemplates->id] = $objTemplates->name;\n }\n else\n {\n $arrTemplates[$objTemplates->category][$objTemplates->id] = $objTemplates->name;\n }\n }\n\n return $arrTemplates;\n }", "function Get_admin_system_emails_tmpl_names()\r\n {\r\n $CI = &get_instance();\r\n $CI->load->model('mail_model');\r\n //read the whole info about templates and get template names for admin only\r\n $templates_info = $CI->mail_model->Get_system_email_data('ADMIN_TEMPLATES_NAMES');\r\n return $templates_info;\r\n }", "public function readCollectionOfPossibleTemplatesToBeInstalledFromFileSystem(){\n\t\t$rootTemplateFoldersToBeMapped = array();\n\t\t$rootTemplateFoldersToBeMapped = $this->searchFolderForTemplatesToBeMapped($this->absoluteRootTemplatesBasePath);\n\t\t//Get all Extension Templates below Root Folders\n\t\t$templateFoldersToBeMapped = array();\n\t\tforeach($rootTemplateFoldersToBeMapped as $rootTemplateFolder) {\n\t\t\t$extensionTempateFoldersToBeMappedFromThisRootTemplate = $this->searchFolderForTemplatesToBeMapped($this->absoluteRootTemplatesBasePath . $rootTemplateFolder . '/' . $this->subFolderNameForExtensionTemplateStructure . '/');\n\n\t\t\tforeach($extensionTempateFoldersToBeMappedFromThisRootTemplate as $extensionTempateFoldersToBeMappedFromThisRootTemplate) {\n\t\t\t\t$templateFoldersToBeMapped[] = $rootTemplateFolder . '/' . $this->subFolderNameForExtensionTemplateStructure . '/' . $extensionTempateFoldersToBeMappedFromThisRootTemplate;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//merge extension and root template folders\n\t\t$templateFoldersToBeMapped = array_merge(\n\t\t\t$rootTemplateFoldersToBeMapped, \n\t\t\t$templateFoldersToBeMapped\n\t\t);\n\t\t\n\t\treturn $templateFoldersToBeMapped;\n\t}", "public function getPaths(): array\n {\n $templatePaths = [];\n\n $paths = $this->blade->getFinder()->getPaths();\n $hints = $this->blade->getFinder()->getHints();\n\n foreach ($paths as $path) {\n $templatePaths[] = new TemplatePath($path);\n }\n foreach ($hints as $namespace => $paths) {\n foreach ($paths as $path) {\n $templatePaths[] = new TemplatePath($path, $namespace);\n }\n }\n\n return array_reverse($templatePaths);\n }", "public function getWaiverTemplates()\n {\n $url = SmartwaiverRoutes::getWaiverTemplates();\n $this->sendGetRequest($url);\n\n try\n {\n // Map array data from API JSON response to a SmartwaiverWaiver object\n $templates = array_map(function ($data) {\n return new SmartwaiverTemplate($data);\n }, $this->lastResponse->responseData);\n }\n catch(InvalidArgumentException $e)\n {\n throw new SmartwaiverSDKException(\n $this->lastResponse->getGuzzleResponse(),\n $this->lastResponse->getGuzzleBody(),\n $e->getMessage()\n );\n }\n\n // Return array of retrieved templates\n return $templates;\n }", "static function getAllSettingsTemplates($a_type)\r\n\t{\r\n\t\tglobal $ilDB;\r\n\r\n\t\t$set = $ilDB->query(\"SELECT * FROM adm_settings_template \".\r\n\t\t\t\" WHERE type = \".$ilDB->quote($a_type, \"text\").\r\n\t\t\t\" ORDER BY title\");\r\n\r\n\t\t$settings_template = array();\r\n\t\twhile ($rec = $ilDB->fetchAssoc($set))\r\n\t\t{\r\n\t\t\t$settings_template[] = $rec;\r\n\t\t}\r\n\r\n\t\treturn $settings_template;\r\n\t}", "static function getTemplates($id) {\n return EmailmarketingTemplates::includedInCampaign($id);\n }", "public function getTemplateCaches()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('templateCaches');\n }", "public static function register_templates() {\n if (version_compare(floatval(get_bloginfo('version')), '4.7', '<')) {\n // 4.6 and older\n add_filter('page_attributes_dropdown_pages_args', array(get_called_class(), 'register_project_templates'));\n } else {\n // Add a filter to the wp 4.7 version attributes metabox\n add_filter('theme_page_templates', array(get_called_class(), 'add_new_template'));\n }\n // Add a filter to the save post to inject out template into the page cache\n add_filter('wp_insert_post_data', array(get_called_class(), 'register_project_templates'));\n // Add a filter to the template include to determine if the page has our \n // template assigned and return it's path\n add_filter('template_include', array(get_called_class(), 'view_project_template'));\n }", "private function generate() {\r\n\t\t$frontend = $this->getFrontend();\r\n\t\t// Clone the Template rendering object since we don't want to influence the processing:\r\n\t\t/** @var $template \\TYPO3\\CMS\\Core\\TypoScript\\TemplateService */\r\n\t\t$template = clone $frontend->tmpl;\r\n\t\t$template->start ( $frontend->sys_page->getRootLine($this->getTemplatePageId($frontend)));\r\n\r\n\t\t$keysToBeCached = array('config.', 'includeLibs.', 'lib.', 'plugin.', 'tt_content', 'tt_content.');\r\n\t\t/** @var $event Tx_Extracache_System_Event_Events_Event */\r\n\t\t$event = GeneralUtility::makeInstance('Tx_Extracache_System_Event_Events_Event', self::EVENT_Generate, $this, $keysToBeCached);\r\n\t\t$this->getEventDispatcher()->triggerEvent($event);\r\n\r\n\t\t$cache = array();\r\n\t\tforeach ($event->getInfos() as $keyToBeCached) {\r\n\t\t\t$cache[$keyToBeCached] = $template->setup[$keyToBeCached];\r\n\t\t}\r\n\r\n\t\t$this->persistCache($cache);\r\n\r\n\t\treturn $cache;\r\n\t}", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "function fetch_templates( $module_id = false ) // fetch templates for module or all or global\n\t{\n\t\tif( $module_id ) {\n\t\t\t$this->db->where( 'module_id', $module_id );\n\t\t}\n\t\t$query=$this->db->get( 'templates' );\n\t\t$this->db->flush_cache();\n\t\treturn $query->result_array();\n\t}", "public function templates()\n {\n $this->authorize();\n\n ee()->load->helper('form');\n ee()->load->library('form_validation');\n ee()->load->model('publisher_template');\n\n if (empty($_POST))\n {\n $vars = array(\n 'hidden' => array(),\n 'save_url' => ee()->publisher_helper_cp->mod_link('templates', array(), TRUE),\n 'templates' => ee()->publisher_template->get_by_group()\n );\n\n return ee()->load->view('templates', $vars, TRUE);\n }\n else\n {\n ee()->publisher_template->save_translations();\n ee()->session->set_flashdata('message_success', lang('publisher_templates_saved'));\n ee()->publisher_helper_url->redirect(ee()->publisher_helper_cp->mod_link('templates'));\n }\n }", "private function _refreshTemplates() {\n $token = $this->_token;\n $response = $this->_apiClient->GET(\"sessions/$token/templates\", ['accept-language' => $this->_language]);\n if ($response->isError()) {\n throw $response->asException();\n }\n $templates = [];\n $raw_templates = $response->body;\n foreach ($raw_templates as $raw_template) {\n $template = new Template($this->_apiClient, $this, $this->_language, 'sessions/' . $this->getUUID() . '/templates/' . $raw_template['template_id']);\n $template->_pushUpdate($raw_template);\n $templates[] = $template;\n }\n $this->_templates = $templates;\n }" ]
[ "0.77786213", "0.77758807", "0.777329", "0.7628569", "0.76211154", "0.7559123", "0.75454825", "0.74529827", "0.74315405", "0.74222404", "0.73970556", "0.7306813", "0.71853477", "0.7184847", "0.7173892", "0.71689403", "0.7130889", "0.7124364", "0.7108149", "0.7093164", "0.70836663", "0.70328224", "0.70320916", "0.7007534", "0.69988185", "0.6988671", "0.6958585", "0.68680626", "0.6857715", "0.68502", "0.6846268", "0.6831402", "0.6813849", "0.6794675", "0.67911875", "0.677441", "0.67600775", "0.6757699", "0.6692652", "0.66894585", "0.6677723", "0.6653931", "0.6645663", "0.664188", "0.6639992", "0.657666", "0.65732145", "0.65326107", "0.6515796", "0.6472005", "0.64631265", "0.6461377", "0.6448488", "0.6439545", "0.64339536", "0.6416891", "0.64127755", "0.6411648", "0.63536954", "0.6344267", "0.63385797", "0.62811846", "0.62799436", "0.62652373", "0.6247559", "0.62434196", "0.62377787", "0.62326205", "0.62320924", "0.6227171", "0.6216901", "0.62104166", "0.61848986", "0.6165533", "0.61479676", "0.6145363", "0.6144578", "0.61433005", "0.6141483", "0.61371714", "0.6107985", "0.6101651", "0.61013323", "0.61004233", "0.6099885", "0.6097852", "0.6087638", "0.6084267", "0.60809505", "0.6064173", "0.6059878", "0.6059878", "0.6059878", "0.6059878", "0.6059878", "0.6059878", "0.6054582", "0.60514313", "0.6048244" ]
0.76799786
4
Get all registered pages
public function getPages() { return $this->pages; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPages();", "public function getPages() {}", "public function getAllPages()\n {\n // Get a list of all viewable pages\n $home = Page::getByID(1);\n $homeStr = $home->getCollectionPath();\n\n $pl = new PageList();\n $pl->filterByPath($homeStr, TRUE);\n $pl->ignoreAliases();\n\n $allowedPages = (array) $pl->get();\n $perm = new Permissions($home);\n\n if($perm->canRead()) array_unshift($allowedPages, $home);\n\n $this->set('allowedPages', $allowedPages);\n }", "public function all()\n {\n return Page::all();\n }", "static function get_pages(){\n\t\tglobal $wpdb;\n\t\t$sql = \"SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'page' AND post_status = 'publish'\";\n\t\t\n\t\treturn $wpdb->get_results($sql);\n\t}", "function get_all_page_ids()\n {\n }", "function wv_wp_page_list() {\n\n $arglist = array(\n 'sort_order' => 'ASC',\n 'sort_column' => 'post_title',\n 'hierarchical' => 1,\n 'post_type' => 'page',\n 'post_status' => 'publish'\n );\n $mypages = get_pages($arglist);\n return $mypages;\n }", "public function get_instance_pages() {\n\n\t\t\t$base_path = $this->component_path( 'pages/' );\n\n\t\t\treturn array(\n\t\t\t\t'Jet_Engine_Relations_Page_List' => $base_path . 'list.php',\n\t\t\t\t'Jet_Engine_Relations_Page_Edit' => $base_path . 'edit.php',\n\t\t\t);\n\t\t}", "public function allPages()\n {\n $this->get('/', function(Request $request, Response $response) {\n $templates = [];\n foreach(new DirectoryIterator($this->basePath . '/src/views/') as $fileInfo) {\n if ($fileInfo->isFile() && strtolower($fileInfo->getExtension()) === 'twig') {\n $baseName = $fileInfo->getBasename('.twig');\n\n $templates[$baseName] = [\n 'name' => $baseName,\n 'has_data' => file_exists($this->basePath . '/src/data/' . $baseName . '.php'),\n ];\n }\n }\n ksort($templates);\n\n return $this->view->render($response, 'app_pages.twig', ['templates' => $templates, 'css_url' => $cssUrl]);\n })->setName('templates.list');\n\n return $this;\n }", "public function load_all_pages() {\n if (!$this->loadedallpages) {\n $manager = languagelesson_page_type_manager::get($this);\n $this->pages = $manager->load_all_pages($this);\n $this->loadedallpages = true;\n }\n return $this->pages;\n }", "public function allpages() {\n $query = $this->db->get('page');\n return $query->result();\n }", "public function GetPages(){\n\t\t$this->MediaType = 'application/xhtml+xml';\n\t\t$this->SetFileName();\n\t\treturn $this->get();\t\n\t}", "public function allpagesActionGet() : object\n {\n $page = $this->app->page;\n $title = \"Alla pages i databasen\";\n $db = $this->app->db;\n\n $db->connect();\n $sql = <<<EOD\nSELECT\n *,\n CASE \n WHEN (deleted <= NOW()) THEN \"isDeleted\"\n WHEN (published <= NOW()) THEN \"isPublished\"\n ELSE \"notPublished\"\n END AS status\nFROM content\nWHERE type=?\n;\nEOD;\n $resultset = $db->executeFetchAll($sql, [\"page\"]);\n\n $page->add(\"cms/header\");\n $page->add(\"cms/allpages\", [\n \"resultset\" => $resultset\n ]);\n return $page->render([\n \"title\" => $title\n ]);\n }", "public function getPages() {\r\n\t$pages = array();\r\n\tforeach ($this->pages as $key => $page) {\r\n\t $page = $this->getPage($key);\r\n\t if ($page != FALSE)\r\n\t\t$pages[$key] = $page;\r\n\t}\r\n\treturn $pages;\r\n }", "public function pages() {\n\t\t// Build the MindTouch API URL to fetch the pages.\n\t\t$url = \"pages\";\n\n\t\t// Get output from API.\n\t\t$output = $this->get($url);\n\n\t\t// Parse the output.\n\t\t$output = $this->parseOutput($output);\n\n\t\treturn $output;\n\t}", "protected function _getPages(){\n $pages = array(\n array(\n 'main' => array(\n 'label' => 'Dashboard',\n 'controller' => 'dashboard',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Summary',\n 'controller' => 'dashboard',\n 'action' => 'index',\n ),\n array(\n 'label' => 'Profile',\n 'controller' => 'profile',\n 'action' => 'index',\n ),\n \tarray(\n \t\t'label' => 'Phpinfo',\n \t\t'controller' => 'system',\n \t\t'action' => 'phpinfo',\n \t),\n ),\n ),\n array(\n 'main' => array(\n 'label' => 'System',\n 'controller' => 'system',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Groups',\n 'controller' => 'groups',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Users',\n 'controller' => 'users',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Privileges',\n 'controller' => 'privileges',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Flags',\n 'controller' => 'flags',\n 'action' => 'index',\n 'scope' => '*'\n ),\n ),\n\n ),\n array(\n 'main' => array(\n 'label' => 'Parameters',\n 'controller' => 'portails',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Portails',\n 'controller' => 'portails',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'PortailUrl',\n 'controller' => 'portailurl',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Paramètres',\n 'controller' => 'params',\n 'action' => 'index',\n //'scope' => '*'\n ),\n array(\n 'label' => 'Mails',\n 'controller' => 'mails',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Exporter',\n 'controller' => 'params',\n 'action' => 'exportparam',\n //'scope' => 'export'\n ),\n ),\n ),\n array(\n 'main' => array(\n 'label' => 'Tools',\n 'controller' => 'tools',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Generate Models',\n 'controller' => 'generate',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Clear Cache',\n 'controller' => 'tools',\n 'action' => 'cleancache',\n //'scope' => '*'\n ),\n array(\n 'label' => 'Bdd',\n 'controller' => 'tools',\n 'action' => 'adminer',\n //'scope' => '*'\n ),\n\n ),\n ),\n array(\n 'main' => array(\n 'label' => 'Backups',\n 'controller' => 'backup',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Backup Bdd',\n 'controller' => 'backup',\n 'action' => 'bdd',\n //'scope' => '*'\n ),\n array(\n 'label' => 'Backup Files',\n 'controller' => 'backup',\n 'action' => 'files',\n //'scope' => '*'\n ),\n\n ),\n ),\n array(\n 'main' => array(\n 'label' => 'Benchmark',\n 'controller' => 'benchmark',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Benchmark 1',\n 'controller' => 'benchmark',\n 'action' => 'benchmark1',\n //'scope' => '*'\n ),\n array(\n 'label' => 'Benchmark 2',\n 'controller' => 'benchmark',\n 'action' => 'benchmark2',\n //'scope' => '*'\n ),\n\n ),\n ),\n array(\n 'main' => array(\n 'label' => 'Examples',\n 'controller' => 'system',\n 'action' => 'example'\n ),\n 'pages' => array(\n array(\n 'label' => 'Theme',\n 'controller' => 'system',\n 'action' => 'example',\n //'scope' => '*'\n ),\n array(\n 'label' => 'Errors',\n 'controller' => 'system',\n 'action' => 'example-errors',\n //'scope' => '*'\n ),\n\n ),\n\n ),\n );\n\n return $pages;\n }", "public function getPages()\n\t{\n\t\treturn $this->dashletdefs['pages'];\n\t}", "public static function find_all()\n\t{\n\t\t# TODO: return WikirPage instances\n\t\treturn file_list_dir(option('pages_dir'));\n\t}", "function getPages() {\n\t\t$sql = 'SELECT * FROM page WHERE vis = 1 ORDER BY psn';\n\t\t$qrh = mysqli_query($this->lnk, $sql);\n\t\t$i = 1;\n\t\t\n\t\t// iterate and extract data to be passed to view\n\t\twhile ( $res = mysqli_fetch_array($qrh)) {\n\t\t\t$results[] = array('id' => $res['id'],'name' => $res['nam']);\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\treturn $results;\n\t\t\n\t}", "public function getPages()\n {\n list($page_id, $scope_pages, $scope_page_type) = array(\n $this['page_id'],\n $this['scope']['pages'],\n $this['scope']['page_type']\n );\n\n $result_pages = array();\n\n if ($scope_pages == 'this') {\n /**\n * Only current page\n */\n $result_pages[] = $page_id;\n } elseif (in_array($scope_pages, array('descendants', 'children'))) {\n /**\n * All descendants\n */\n $finder = fx::data('content')->descendantsOf($page_id);\n if ($scope_page_type) {\n $finder->where('type', $scope_page_type);\n }\n $result_pages = array_merge($result_pages, $finder->all()->getValues('id'));\n /**\n * With self page\n */\n if ($scope_pages == 'descendants') {\n $result_pages[] = $page_id;\n }\n }\n return array_unique($result_pages);\n }", "final public function getPages(): array\n {\n return $this->pages;\n }", "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 getPages()\n\t {\n\t \t$args = array(\n\t\t\t\t'sort_order' => 'asc',\n\t\t\t\t'sort_column' => 'post_title',\n\t\t\t\t'hierarchical' => 1,\n\t\t\t\t'child_of' => 0,\n\t\t\t\t'parent' => -1,\n\t\t\t\t'post_type' => 'page',\n\t\t\t\t'post_status' => 'publish'\n\t\t\t); \n\n\t\t\treturn get_pages($args);\n\t }", "public function getPage();", "public function pagesOnly() {}", "public function get_all_registered()\n {\n }", "public function get_all_registered()\n {\n }", "public function getPages()\n {\n $pages = array();\n $reader = new AnnotationReader();\n\n foreach($this->compositionBundles as $compositionBundle) {\n $dir = $this->kernel->locateResource($compositionBundle, null, true) . 'Controller/';\n\n $finder = new Finder();\n $finder->files()->in($dir)->depth('== 0')->name('*Controller.php');\n\n foreach ($finder as $file) {\n $className = str_replace('.php', '', $file->getFilename());\n $path = str_replace(str_replace('app', '', str_replace('\\\\', '/', $this->kernel->getRootDir())), '', str_replace('\\\\', '/', $file->getPathname()));\n $path = str_replace('src', '', $path);\n $path = str_replace('/', '\\\\', $path);\n $path = str_replace('.php', '', $path);\n $c = new \\ReflectionClass($path);\n\n $methods = $c->getMethods();\n\n foreach($methods as $method) {\n // check whether the method is an action and therefore a page\n if (strpos($method->getName(), 'Action') !== false) {\n // setup a fresh page object\n $page = new Page();\n $page->setController(substr($className, 0, -10));\n $action = substr($method->getShortName(), 0, -6);\n $page->setAction($action);\n\n // create name from composer annotation\n $composerAnnotation = $reader->getMethodAnnotation($method, 'Terrific\\ComposerBundle\\Annotation\\Composer');\n if($composerAnnotation == null) {\n $name = $action;\n }\n else {\n $name = $composerAnnotation->getName();\n }\n\n $page->setName($name);\n\n // create url from route annotation\n $routeAnnotation = $reader->getMethodAnnotation($method, 'Symfony\\Component\\Routing\\Annotation\\Route');\n\n $page->setUrl($this->router->generate($routeAnnotation->getName()));\n\n $pages[] = $page;\n }\n }\n }\n }\n\n return $pages;\n }", "protected function getPage() {}", "protected function getPage() {}", "public function getPages()\n {\n $types = Page::all();\n $values = [];\n foreach ($types as $key) {\n $values[] = $key->page;\n }\n return $values;\n }", "public function getPages()\n {\n return $this->getPosts();\n }", "public function getPage() {}", "public function getPage() {}", "public function getPages()\n {\n return $this->_pages;\n }", "public function getPages()\n {\n return $this->_pages;\n }", "function getPages()\n\t{\n\t\t$pages = $this->input->post('pages');\n\t\t$response = $this->mapi->getPages($pages);\n\n\t\techo json_encode($response);\n\t}", "function getPages() {\r\n\tglobal $S;\r\n\tif (!is_array($S->arbo)) {\r\n\t\trequire_once('../lib/class/class_arbo.php');\r\n\t\t$S =& new ARBO();\r\n\t\t$S->fields = array('id', 'pid', 'type_id', 'titre_fr');\r\n\t\t$S->buildArbo();\r\n\t}\r\n\t$options = array();\r\n\tforeach($S->arbo as $rid=>$tmp) {\r\n\t\t$options[urlencode($S->arbo[$rid]['url'])] = $S->arbo[$rid]['titre_fr'].' (#'.$rid.')';\r\n\t}\r\n\treturn $options;\r\n}", "function shoutbox_pages() {\n\t\tglobal $lang;\n\t\t$pages[] = array(\n\t\t\t'func' => 'posts',\n\t\t\t'title' => $lang['shoutbox']['page posts']\n\t\t);\n\t\t$pages[] = array(\n\t\t\t'func' => 'clean',\n\t\t\t'title' => $lang['shoutbox']['clean shoutbox']\n\t\t);\n\t\t$pages[] = array(\n\t\t\t'func' => 'settings',\n\t\t\t'title' => $lang['shoutbox']['page settings']\n\t\t);\n\t\t$pages[] = array(\n\t\t\t'func' => 'check_updates',\n\t\t\t'title' => $lang['shoutbox']['updates']\n\t\t);\n\t\treturn $pages;\n\t}", "public function showListPages(){\n\n $client = new Client();\n $result = $client->get('https://graph.facebook.com/v6.0/3693880870623784/accounts', [\n 'headers' => [\n 'Accept' => 'application/json',\n 'Authorization' => 'Bearer '.Session::get('access_token')\n ]\n ]);\n\n $pages = json_decode($result->getBody());\n\n return view('home', compact('pages'));\n }", "public function getPages() : array\n {\n return $this->pages;\n }", "public function getPages()\r\n {\r\n return $this->_pages;\r\n }", "private function getPages()\n {\n $directory = __DIR__.'/Page/';\n // remove .. and . folder in unix\n $pageFolders = array_diff(scandir($directory), array('..', '.'));\n\n return $pageFolders;\n }", "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 getList($page);", "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}", "public function index()\n {\n $pages = Page::active()->orderBy('order' , 'DESC')->get();\n\n return PageResource::collection($pages);\n }", "public function getPagesAction()\r\n {\r\n $modelPage = $this->getServiceLocator()->get('DotsPages\\Db\\Model\\Page');\r\n $query = $this->getRequest()->getQuery()->toArray();\r\n $pages = $modelPage->getAllLikeTitle('%' . $query['term'] . '%');\r\n $data = array();\r\n foreach($pages as $page){\r\n $data[] = array(\r\n 'id'=>$page->id,\r\n 'label'=>$page->title,\r\n 'value'=>$page->title,\r\n );\r\n }\r\n return $this->jsonResponse($data);\r\n }", "public function getWikiPages()\n {\n if ($this->request->get('explore')) {\n // Fetch the pages tree to a specified page\n return $this->explorePagesTo($this->request->get('page'));\n }\n\n if ($this->request->get('wiki')) {\n // Get the root pages of a wiki\n return $this->getWikiRootPages($this->request->get('wiki'));\n }\n\n // Get the child pages of a page\n return $this->getPageChilds($this->request->get('page'));\n }", "public function pages()\n {\n return $this->morphedByMany('App\\Page', 'imageable');\n }", "public function index()\n {\n return response()->json(Page::all());\n }", "public function getPages()\n\t{\n\t\treturn $this->_pages;\n\t}", "public function getPages(){\n $defaultTheme = env('THEME', 'default');\n $path = app_path() . \"/../resources/views/themes/$defaultTheme/\";\n $pagePath = $path . \"pages\";\n $metaFilePath = $path . \"$defaultTheme.json\";\n\n try{\n\n $validator = file_exists($metaFilePath) && is_dir($pagePath);\n if ($validator){\n // Read file list from directory\n $pages = [];\n if ($dh = opendir($pagePath)){\n while (($file = readdir($dh)) !== false){\n $filePath = $pagePath . '/' . $file; \n if ($file == '.' || $file == '..') {\n continue;\n }\n $content = file_get_contents($filePath);\n $info = $this->extractInfo($content);\n $pages[] = [\n 'name' => $file,\n 'page-name' => substr($file, 0, strpos($file, '.')),\n 'info' => isset($info[1]) ? json_decode($info[1], true) : null\n ];\n }\n closedir($dh);\n }\n return $pages;\n }\n else{\n return [];\n }\n }\n catch (\\Exception $e){ \n return [];\n }\n }", "public function getPagesAction() {\n\n //FETCH\n $paramss = array();\n $paramss['title'] = $this->_getParam('text');\n $paramss['viewer_id'] = Engine_Api::_()->user()->getViewer()->getIdentity();\n $paramss['limit'] = $this->_getParam('limit', 40);\n $paramss['orderby'] = 'title ASC';\n $usersitepages = Engine_Api::_()->getDbtable('pages', 'sitepage')->getSuggestClaimPage($paramss);\n $data = array();\n $mode = $this->_getParam('struct');\n if ($mode == 'text') {\n foreach ($usersitepages as $usersitepage) {\n $content_photo = $this->view->itemPhoto($usersitepage, 'thumb.icon');\n $data[] = array(\n 'id' => $usersitepage->page_id,\n 'label' => $usersitepage->title,\n 'photo' => $content_photo\n );\n }\n } else {\n foreach ($usersitepages as $usersitepage) {\n $content_photo = $this->view->itemPhoto($usersitepage, 'thumb.icon');\n $data[] = array(\n 'id' => $usersitepage->page_id,\n 'label' => $usersitepage->title,\n 'photo' => $content_photo\n );\n }\n }\n return $this->_helper->json($data);\n }", "function listAllPages() {\n $PAGES_PATH = $_SERVER['DOCUMENT_ROOT'] . '/pages';\n //Ignore '.', '..', and '.gitkeep' in the returned directory array:\n $files = array_diff(scandir($PAGES_PATH), array('.', '..', '.gitkeep'));\n\n //ignore if there are no pages\n if ($files) {\n foreach($files as $file) {\n $pageName = substr($file, 0, strrpos($file, \".\"));\n echo '<li class=\"pages-menu-item\"><a href=\"/pages/' . $pageName . '.php\" id=\"pages-menu-' . $pageName . '\" style=\"text-decoration: none; color: #FFFFFF;\">' . $pageName . '</a></li>';\n }\n }\n }", "public function get_pages() {\n\t\tif (!isset($this->_xml->pages)\n\t\t\t\t|| !isset($this->_xml->pages->page)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$pages_info = array();\n\t\tforeach ($this->_xml->pages->page as $page_node) {\n\t\t\t$this->parse_page($page_node, $pages_info);\n\t\t}\n\t\treturn $pages_info;\n\t}", "function findPageUrls();", "private static function admin_pages() {\n\t\tglobal $wpseo_admin_pages;\n\n\t\treturn $wpseo_admin_pages;\n\t}", "public static function getPages(): ?array\n {\n return collect(Filament::getPages())\n ->filter(function ($page) {\n if (Utils::isGeneralExcludeEnabled()) {\n return ! in_array(Str::afterLast($page, '\\\\'), Utils::getExcludedPages());\n }\n\n return true;\n })\n ->reduce(function ($pages, $page) {\n $prepend = Str::of(Utils::getPagePermissionPrefix())->append('_');\n $name = Str::of(class_basename($page))\n ->prepend($prepend);\n\n $pages[\"{$name}\"] = \"{$name}\";\n\n return $pages;\n }, collect())\n ->toArray();\n }", "public function action_ajax_get_pages_list() {\n\t\t// Get the media model\n\t\t$plugin_model = new Model_Pages();\n\n\t\t// Get the complete list of Pages\n\t\t$list = array();\n\t\tforeach ($plugin_model->get_all_pages('name_tag ASC') as $item) {\n\t\t\tarray_push($list, $item);\n\t\t}\n\n\t\t// Return\n\t\t$this->auto_render = false;\n\t\t$this->response->body(json_encode($list));\n\t}", "public function get_pages()\n\t{\n\t\treturn $this->_EE->db->select(array('heading', 'short_name'))\n\t\t\t ->get('exp_dd_doc_sections')\n\t\t\t ->result_array();\n\t}", "public function getPageUris();", "function ajan_core_get_directory_pages() {\n\tglobal $wpdb;\n\n\t// Look in cache first\n\t$pages = wp_cache_get( 'directory_pages', 'bp' );\n\n\tif ( false === $pages ) {\n\n\t\t// Set pages as standard class\n\t\t$pages = new stdClass;\n\n\t\t// Get pages and IDs\n\t\t$page_ids = ajan_core_get_directory_page_ids();\n\t\tif ( !empty( $page_ids ) ) {\n\n\t\t\t// Always get page data from the root blog, except on multiblog mode, when it comes\n\t\t\t// from the current blog\n\t\t\t$posts_table_name = ajan_is_multiblog_mode() ? $wpdb->posts : $wpdb->get_blog_prefix( ajan_get_root_blog_id() ) . 'posts';\n\t\t\t$page_ids_sql = implode( ',', wp_parse_id_list( $page_ids ) );\n\t\t\t$page_names = $wpdb->get_results( \"SELECT ID, post_name, post_parent, post_title FROM {$posts_table_name} WHERE ID IN ({$page_ids_sql}) AND post_status = 'publish' \" );\n\n\t\t\tforeach ( (array) $page_ids as $component_id => $page_id ) {\n\t\t\t\tforeach ( (array) $page_names as $page_name ) {\n\t\t\t\t\tif ( $page_name->ID == $page_id ) {\n\t\t\t\t\t\tif ( !isset( $pages->{$component_id} ) || !is_object( $pages->{$component_id} ) ) {\n\t\t\t\t\t\t\t$pages->{$component_id} = new stdClass;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$pages->{$component_id}->name = $page_name->post_name;\n\t\t\t\t\t\t$pages->{$component_id}->id = $page_name->ID;\n\t\t\t\t\t\t$pages->{$component_id}->title = $page_name->post_title;\n\t\t\t\t\t\t$slug[] = $page_name->post_name;\n\n\t\t\t\t\t\t// Get the slug\n\t\t\t\t\t\twhile ( $page_name->post_parent != 0 ) {\n\t\t\t\t\t\t\t$parent = $wpdb->get_results( $wpdb->prepare( \"SELECT post_name, post_parent FROM {$posts_table_name} WHERE ID = %d\", $page_name->post_parent ) );\n\t\t\t\t\t\t\t$slug[] = $parent[0]->post_name;\n\t\t\t\t\t\t\t$page_name->post_parent = $parent[0]->post_parent;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$pages->{$component_id}->slug = implode( '/', array_reverse( (array) $slug ) );\n\t\t\t\t\t}\n\n\t\t\t\t\tunset( $slug );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\twp_cache_set( 'directory_pages', $pages, 'bp' );\n\t}\n\n\treturn apply_filters( 'ajan_core_get_directory_pages', $pages );\n}", "public function get_all()\n {\n $all = array();\n\n foreach (array(PUBLISHER_STATUS_OPEN, PUBLISHER_STATUS_DRAFT) as $status)\n {\n foreach(ee()->publisher_model->languages as $lang_id => $data)\n {\n $all[$status][$lang_id] = ee()->publisher_site_pages->get($lang_id, FALSE, $status, TRUE);\n }\n }\n\n return $all;\n }", "public function get_page();", "private function extract_pages(){\r\n $dom = new DOMDocument();\r\n @$dom->loadHTMLFile($this->get_sitemap_url());\r\n $dOMXPath = new DOMXPath($dom);\r\n foreach ($dOMXPath->query(\"//urlset/url/loc\") as $node) {\r\n $this->add_page($node->nodeValue);\r\n }\r\n\t}", "public function pages_list() {\n\n $all_pages = Page::select('id', 'type', 'title', 'heading')->get()->toArray();\n\n $all_pages = count($all_pages) > 0 ? array_chunk($all_pages, 4) : [];\n\n $all_pages = ['success'=>true, 'data'=>$all_pages];\n\n return response()->json($all_pages, 200);\n\n }", "public function actionList()\n {\n $this->adminOnly();\n\n $pages = $this->findAll();\n return $this->render('@custom_pages/views/common/list', [\n 'pages' => $pages,\n 'label' => Yii::createObject($this->getPageClassName())->getLabel(),\n 'subNav' => \\humhub\\modules\\custom_pages\\widgets\\ContainerPageMenu::widget()\n ]);\n }", "public function getPages()\n {\n return $this->getTable('ExhibitPage')->findBy(array('exhibit' => $this->id, 'sort_field' => 'order'));\n }", "public function index()\n {\n return PageResource::collection(Page::whereNull('parent_id')->get());\n // return response()->json(Page::orderBy('id')->get());\n }", "protected function init_pages() {\r\n\t\t\t$include_array = [];\r\n\r\n\t\t\t$files = glob( $this->include_path . '/Page/*.php' );\r\n\t\t\t$obj = new ReflectionClass( $this );\r\n\r\n\t\t\tforeach ( $files as $file ) {\r\n\t\t\t\t$name = basename( $file );\r\n\t\t\t\t$not_included = array();\r\n\t\t\t\tif ( ! in_array( $name, $not_included ) ) {\r\n\t\t\t\t\t$name = str_replace( '.php', '', $name );\r\n\t\t\t\t\t$namespace = $obj->getNamespaceName();\r\n\t\t\t\t\tarray_push( $include_array, $namespace . '\\\\Page\\\\' . $name );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tforeach ( $include_array as $page ) {\r\n\t\t\t\tnew $page( $this->include_path );\r\n\t\t\t}\r\n\r\n\t\t}", "public function getPageFolders();", "function fetchAllPages() {\n try {\n global $db_table_prefix;\n\n $results = array();\n\n $db = pdoConnect();\n\n $query = \"SELECT\n id,\n page,\n private\n FROM \".$db_table_prefix.\"pages\";\n\n $stmt = $db->prepare($query);\n\n if (!$stmt->execute()){\n // Error\n return false;\n }\n\n while ($r = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $page = $r['page'];\n $results[$page] = $r;\n }\n $stmt = null;\n\n return $results;\n } catch (PDOException $e) {\n addAlert(\"danger\", \"Oops, looks like our database encountered an error.\");\n error_log(\"Error in \" . $e->getFile() . \" on line \" . $e->getLine() . \": \" . $e->getMessage());\n return false;\n } catch (ErrorException $e) {\n addAlert(\"danger\", \"Oops, looks like our server might have goofed. If you're an admin, please check the PHP error logs.\");\n return false;\n }\n}", "public function actionIndex()\n\t{\n\t\t$this->session->delete('page.lastSearch');\n\n\t\treturn $this->template->partial('content', 'pages/index', [\n\t\t\t'pages' => Page::findAll('SELECT * FROM nerd_pages'),\n\t\t]);\n\t}", "private function loadPages()\n {\n $webClient = new WebClient();\n $allPages = [];\n $choppedUrls = array_chunk($this->newUrls, self::PAGES_PER_TIME);\n foreach ($choppedUrls as $iteration => $urlsChunk) {\n $currentPages = $webClient->multiGet($this->newUrls);\n $allPages = array_merge($allPages, $currentPages);\n\n $urlsChunkCount = count($urlsChunk);\n $pagesLoaded = $urlsChunkCount < self::PAGES_PER_TIME ?\n $urlsChunkCount\n : ($iteration + 1) * self::PAGES_PER_TIME;\n $this->outputMessage(sprintf('... loaded %s pages', $pagesLoaded));\n }\n\n return $allPages;\n }", "function allPagesObject()\n\t{\n\t\tglobal $tpl;\n\t\t\n\t\t$this->checkPermission(\"read\");\n\t\t\n\t\tinclude_once(\"./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php\");\n\t\t\n\t\t$this->addPagesSubTabs();\n\t\t\n\t\t$table_gui = new ilWikiPagesTableGUI($this, \"allPages\",\n\t\t\t$this->object->getId(), IL_WIKI_ALL_PAGES);\n\t\t\t\n\t\t$this->setSideBlock();\n\t\t$tpl->setContent($table_gui->getHTML());\n\t}", "protected function getUpdatablePages() {}", "abstract protected function getPage() ;", "function fetchAllPages() {\n\t$db = DB::getInstance();\n\t$query = $db->query(\"SELECT id, page, private FROM pages ORDER BY id DESC\");\n\t$pages = $query->results();\n\t//return $pages;\n\n\tif (isset($row)){\n\t\treturn ($row);\n\t}else{\n\t\treturn $pages;\n\t}\n}", "public function getPages()\n {\n $pages = Page::all();\n\n return Datatables::of($pages)\n ->editColumn('title', '<a href=\"{{ url(\\'admin/pages/\\'.$id) }}\" target=\"_blank\"><b>{{ $title }}</b></a>')\n ->addColumn('actions', function ($page) {\n $editBtn = '<a style=\"margin-right: 0.1em;\" href=\"' . url('admin/pages/' . $page->id . '/edit') . '\" title=\"Edit\"><i class=\"fa fa-2 fa-pencil\"></i></a>';\n\n $deleteBtn = '&nbsp;<a href=\"' . url('admin/pages/' . $page->id) . '\" class=\"message_box text-danger\" data-box=\"#message-box-delete\" data-action=\"DELETE\" title=\"Delete\"><i class=\"fa fa-2 fa-remove\"></i></i></a>';\n\n $viewBtn = '<a style=\"margin-right: 0.2em;\" href=\"' . url($page->slug) . '\" title=\"View\" target=\"blank\"><i class=\"fa fa-2 fa-eye\"></i></a>';\n\n $buttons = '' . $editBtn . $viewBtn . $deleteBtn;\n return $buttons;\n })->make(true);\n }", "protected function findAll()\n {\n return ContainerPage::find()->contentContainer($this->contentContainer)->all();\n }", "public function getPages()\n\t{\n\t\treturn $this->getOptionData('tl_page');\n\t}", "public function getListPage(){\n\t\ttry{\n\t\t\t$sql = \"SELECT * FROM page\";\n\t\t\t$stmt = $this->_db->prepare($sql);\n\t\t\t$stmt->execute();\n\t\t\tif($stmt->errorCode() != 0){\n\t\t\t\t$error = $stmt->errorInfo();\n\t\t\t\tthrow new SQLException($error[2], $error[0], $sql, \"Impossible d'obtenir la liste des pages\");\n\t\t\t}\n\t\t\t$list = array();\n\t\t\twhile ($data = $stmt->fetch(PDO::FETCH_ASSOC)){\n\t\t\t\t$list[] = new Page($data);\n\t\t\t}\n\t\t\treturn $list;\n\t\t}catch(PDOException $e){\n\t\t\tthrow new DatabaseException($e->getCode(), $e->getMessage(), \"Impossible d'obtenir la liste des pages\");\n\t\t}\n\t}", "static protected function getPageCache()\n {\n return GeneralUtility::makeInstance(CacheManager::class)->getCache('pages');\n }", "function load_site_pages()\n\t{\n $sites\t\t\t= ee()->TMPL->fetch_param('site', '');\n\t\t$current_site\t= ee()->config->item('site_short_name');\n\n\t\t// Always include the current site\n\n\t\t$site_names = explode('|', $sites);\n\n\t\tif ( ! in_array($current_site, $site_names))\n\t\t{\n\t\t\t$site_names[] = $current_site;\n\t\t}\n\n\t\t// Fetch all pages\n\t\t$sites = ee('Model')->get('Site')\n\t\t\t->fields('site_id', 'site_name', 'site_pages')\n\t\t\t->filter('site_name', $site_names)\n\t\t\t->all();\n\n\t\t$new_pages = array();\n\n\t\tforeach($sites as $site)\n\t\t{\n\t\t\tif (is_array($site->site_pages))\n\t\t\t{\n\t\t\t\t$new_pages += $site->site_pages;\n\t\t\t}\n\t\t}\n\n\t\t// Update config\n\n\t\tee()->config->set_item('site_pages', $new_pages);\n\n\t\treturn '';\n\t}", "public function getPageTypes() {}", "public function getPageItems()\n {\n }", "public function setPages() {\n $this->pages = array(\n array(\n 'page_title' => 'Open Badge',\n 'menu_title' => 'Open Badge',\n 'capability' => 'manage_options',\n 'menu_slug' => self::SLUG_PLUGIN,\n 'callback' => array(DashboardTemp::class, 'main'),\n 'icon_url' => 'dashicons-awards',\n 'position' => '110'\n )\n );\n }", "public static function getAll () {\n\t\treturn self::$registered;\n\t}", "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 $exploded = explode(\"/\", $this->_url);\n if (count($exploded) > 1) {\n $this->page(intval($exploded[1]));\n } else {\n $this->page(0);\n }\n }", "public function index()\n {\n $pages = Page::get();\n return view(\"admin.pages.index\")\n ->with(compact('pages',$pages));\n }", "public function index()\n {\n $title = 'List Pages';\n\n $root = Page::find(1);\n //return $root;\n\n //$pages = $root->getImmediateDescendants(); // changed so we can use 'where' etc\n $pages = $root->children()->where('on_main_nav', 1)->get();\n //return $pages;\n\n $hidden = $root->children()->where('on_main_nav', 0)->get();\n\n return view('pages.backend.page.index', compact('title', 'root', 'pages', 'hidden'));\n }", "private function indexAction()\n {\n $page = isset($_GET['page']) ? substr($_GET['page'],0,-1) : \"home\" ;\n $this->reg->pages->getPageContent(strtolower($page));\n }", "public function pages()\n {\n $modular = [];\n\n foreach ($this->items as $path => $slug) {\n $page = $this->pages->get($path);\n if ($page !== null && !$page->isModule()) {\n $modular[$path] = $slug;\n }\n }\n $this->items = $modular;\n\n return $this;\n }", "public function get_pages() {\n $pages = get_pages();\n $pages_options = array();\n if ( $pages ) {\n foreach ( $pages as $page ) {\n $pages_options[ $page->ID ] = $page->post_title;\n }\n }\n\n return $pages_options;\n }", "public function registerPageParams()\n {\n return [];\n }", "public function index()\n {\n $pages = Analytics::fetchMostVisitedPages(Period::days(7), 20);\n dd($pages);\n return view('home');\n }" ]
[ "0.7813104", "0.7778047", "0.7456479", "0.7223744", "0.71910393", "0.71492004", "0.71483415", "0.7055427", "0.7003869", "0.70018125", "0.69908166", "0.69633824", "0.6958579", "0.6947709", "0.69149125", "0.69148505", "0.6904714", "0.69045925", "0.6854421", "0.68485326", "0.6839262", "0.6822071", "0.679897", "0.6793111", "0.6789515", "0.67528975", "0.6752296", "0.67398834", "0.67324466", "0.67315024", "0.6711237", "0.671068", "0.67045796", "0.67045796", "0.6679483", "0.6679483", "0.6667237", "0.6661451", "0.6656806", "0.6653006", "0.6652908", "0.6638826", "0.6618583", "0.6604715", "0.65787107", "0.6560062", "0.65516627", "0.65391296", "0.65334207", "0.6531241", "0.6530789", "0.65288115", "0.6526213", "0.6525365", "0.6497044", "0.6460485", "0.64509577", "0.64439", "0.64302987", "0.64259183", "0.6423896", "0.64139986", "0.6403442", "0.639839", "0.63675886", "0.6345441", "0.63403714", "0.6337105", "0.63185805", "0.62908953", "0.6264493", "0.62604934", "0.6259181", "0.6250652", "0.62418616", "0.6234874", "0.6219122", "0.6205167", "0.6188582", "0.6186828", "0.6185023", "0.61469", "0.6145162", "0.6139577", "0.6124073", "0.6114913", "0.61140287", "0.6111721", "0.6107811", "0.6100386", "0.6096952", "0.6096396", "0.608706", "0.6086169", "0.60855156", "0.6081016", "0.6077869", "0.60768884" ]
0.67441493
29
Get a registered page template by its key
public function getPageTemplate($name) { if(array_key_exists($name, $this->pages)) { return $this->templates[$this->pages[$name]]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLoaded($type, $key)\n {\n foreach ($this->loaded as $identifier => $template) {\n if($identifier === $type . '.' . $key) return $template;\n }\n }", "public function getTemplateOf($key)\n {\n return $this->template[$this->mappedFields[$key]];\n }", "public function register($type, $key, $template)\n {\n if(!array_key_exists($template, $this->templates)) {\n $this->templates[$template] = new $template;\n }\n\n $this->pages[$type . '.' . $key] = $template;\n\n return $this->templates[$template];\n }", "function get_template_of_page($pageid=null)\n{\n\tif ($pageid===null)\n\t{\n\t\tglobal $post;\n\t\t$pageid = $post->ID;\n\t}\n\treturn get_post_meta($pageid, '_wp_page_template', true);\n}", "public function get_page_template($post_id){\n\t\t$value = 'page_template';\n\n\t\t$query = $this->db->prepare(\"SELECT * FROM `nw_postmeta` WHERE `post_id` = ? AND `meta_key`= ? \");\n\t\t$query-> bindValue(1, $post_id);\n\t\t$query-> bindValue(2, $value);\n\n\t\ttry{\n\t\t\t$query->execute();\n\t\t\t$data = $query->fetch();\n\n\t\t\treturn $data;\n\t\t}catch(PDOException $e){\n\t\t\tdie($e ->getMessage());\n\t\t}\n\t}", "abstract public function getTemplate();", "public static function getTplKit($key){ \r\n return self::$tpls[$key]; \r\n }", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function loadMatchingTemplate()\n {\n $assignments = self::getAssignments();\n $hlp = $this;\n $matches = array_filter($assignments, function ($data) use ($hlp) {\n return $hlp::matchPagePattern($data['pattern']);\n });\n\n $template = array_pop($matches);\n return $template;\n }", "public function load($type, $key, $throwOnMissing)\n {\n $name = $type . '.' . $key;\n\n if(!($template = $this->getPageTemplate($name))) {\n throw new TemplateNotFoundException($this->pages[$name] ?? null, $name);\n }\n\n if(!isset($this->loaded[$name])) {\n $this->loaded[$name] = $template->getNewTemplate($type, $key, $throwOnMissing);\n }\n else {\n $this->loaded[$name]->load($throwOnMissing);\n }\n\n return $this->loaded[$name];\n }", "function getPageTemplate($post_ID) { \n return get_post_meta( $post_ID, '_wp_page_template', true ); \n }", "function get_template()\n {\n }", "function getTemplate();", "public function findByKey($key)\n {\n return Page::where('key', $key)->first();\n }", "function kcsite_getPageByTempate($filename, $field = null, $path = 'page-templates/'){\n\t// page-templates/education_login.php\n\n\t$pages = get_pages(array(\n\t 'meta_key' => '_wp_page_template',\n\t 'meta_value' => $path . $filename,\n\t 'hierarchical' => 0\n\t));\n\tif($field != null){\n\t\t// print_r($pages[0]);exit;\n\t\t// print_r($pages[0]->$field);exit;\n\t\treturn $pages[0]->$field;\n\t} else {\n\t\treturn $pages[0];\n\t}\n\t// print_r($pages);exit;\n\n}", "public function getTemplate() {}", "public static function template_option($key) {\n $settings = self::get_page_settings('_mkb_page_template_settings');\n\n if (isset($settings) && isset($settings[$key])) {\n return $settings[$key];\n } else {\n return null;\n }\n }", "public function getTemplate($name){\n if(isset($name)){\n return $this->template[$name]; // $this->envir->loadTemplate($template)\n }\n return $this->template[$this->templace_interator++]; // $this->envir->loadTemplate($template)\n }", "public static function getTemplatePage()\n {\n return self::$templatePage;\n }", "public function template() {\n\n // check for a cached template name\n if(isset($this->cache['template'])) return $this->cache['template'];\n\n // get the template name\n $templateName = $this->intendedTemplate();\n\n if($this->kirby->registry->get('template', $templateName)) {\n return $this->cache['template'] = $templateName; \n } else {\n return $this->cache['template'] = 'default';\n }\n\n }", "protected function getPageTemplate()\n {\n return new Template();\n }", "function getPagesByTemplate( $query ){\n global $pagenow; \n if ($this->isPageType() && is_admin() && $pagenow=='edit.php' && $this->isTeplateSet()) {\n $query->query_vars['meta_key'] = '_wp_page_template';\n $query->query_vars['meta_value'] = $_GET['template'];\n }\n }", "private function getTemplateForPage($page)\n {\n return (view()->exists($page->template)) ? $page->template : 'default';\n }", "function templates_example()\n{\n /* Get post object by its template */\n $post = \\ActiTemplate\\Template::getTemplatePageObject('page-contact.php');\n\n /* Get post ID by its template */\n $postID = \\ActiTemplate\\Template::getTemplatePageId('page-contact.php');\n\n /* Get post url by its template */\n $url = \\ActiTemplate\\Template::getTemplatePageUrl('page-contact.php');\n}", "function get_paged_template()\n {\n }", "function get_page_by_template( $template_name ) {\r\n\t$args = array(\r\n\t\t'posts_per_page' => 1,\r\n\t\t'post_type' => 'page',\r\n\t\t'orderby' => 'post_title',\r\n\t\t'order' => 'ASC',\r\n\t\t'meta_key' => '_wp_page_template',\r\n\t\t'meta_value' => $template_name\r\n\t);\r\n\r\n\t$pages = get_posts( $args );\r\n\r\n\treturn ( count( $pages ) ) ? $pages[0] : false;\r\n}", "public function getPageKey();", "public function getMessageTemplate($key)\n {\n if (array_key_exists($key, $this->_messageTemplates)) {\n return $this->_messageTemplates[$key];\n }\n }", "function get_template($template){\n\n\t\t\t$login_arr = $this->action_parser($this->action,'template') ;\n\n\t\t\t$pos = array_search($template, $login_arr['template']['name']); \n\n\t\t\treturn $login_arr['template']['path'][$pos];\n\n\t\t}", "private function getTemplate()\n {\n $key = $this->getTemplateKey();\n\n // find template for refused short notice\n if (\n $this->busReg->isShortNoticeRefused() === true\n && isset(self::$templatesRefusedShortNotice[$key])\n ) {\n return self::$templatesRefusedShortNotice[$key];\n }\n\n // find template by status\n if (isset(self::$templates[$key])) {\n return self::$templates[$key];\n }\n\n throw new BadRequestException('Template not found for bus registration');\n }", "function f_get_template(){\n /// you need get info config in setting then insert here. the present it default\n $host = $this->host;\n $slugs = $this->slugs;\n $key = $this->key;\n $ajax_url = $this->ajax_url;\n $elementor = $this->elementor;\n/// get slug from url and remove element empty\n $slug = array_filter( explode('/', $_SERVER['REQUEST_URI']) );\n // check exist in slugs config\n if( isset( $slugs[$slug[1]] )){\n $template_api = $slugs[$slug[1]];\n $template_api['action'] = 'action_slug_api';\n $template_api['key'] = $key;\n $template_api['ajax_url'] = $ajax_url;\n $template_api['elementor'] = $elementor;\n $template_api['name'] = $slug[1];\n // check type template list or template single\n if($template_api['slug']){\n $template_api['url'] = $host.$template_api['url'].$slug[2];\n }else{\n $template_api['url'] = $host.$template_api['url'];\n }\n $this->do_template($template_api);\n\n }\n }", "public function get_template()\n {\n }", "public function get_template()\n {\n }", "public function page( $template )\n {\n // Get the current post ID\n $post_id = get_the_ID();\n\n // Get the current post slug\n $slug = get_page_uri($post_id);\n\n // Check pages directory for page\n if( $found = locate_template('templates/page/' . $slug . '.php') )\n {\n return $found;\n }\n\n // Check for generic page template\n if( $found = locate_template('templates/page.php') )\n {\n return $found;\n }\n\n // Use wp default location\n return $template;\n\n }", "public function getTemplate(): TemplateInterface;", "abstract public function getTemplate($tpl);", "function view($template,$getKey=''){\r\n\t\tif($getKey != '')\r\n\t\t\t$getStr = implode('=',$getKey);\r\n\t\trequire(dirname(__FILE__).'/template/'.$template.'.php');\r\n\t}", "public function getPage($key)\n {\n $page = SitePage::where('key', $key)->where('is_visible', 1)->first();\n if(!$page) abort(404);\n return view('pages.page', ['page' => $page]);\n }", "public function getTemplate($key, $language_id)\n {\n if ($template = EmailTemplateTranslation::findOne([\n 'template_id' => EmailTemplate::getIdByKey($key),\n 'language_id' => $language_id\n ])) {\n return Template::buildTemplate($template);\n }\n\n return null;\n }", "public function getTemplate() \n {\n return $_SESSION['template'];\n \n }", "public function __get($key)\r\n {\r\n return $this->_smarty->getTemplateVars($key);\r\n }", "function get_template($template)\n {\n $login_arr = $this->action_parser($this->action, 'template');\n $pos = array_search($template, $login_arr['template']['name']);\n return $login_arr['template']['path'][$pos];\n }", "function get_template($template)\n {\n\n $login_arr = $this->action_parser($this->action, 'template');\n\n $pos = array_search($template, $login_arr['template']['name']);\n\n return $login_arr['template']['path'][$pos];\n }", "public function getTemplate(string $template_name) {\n /*if (isset($this->templates[$template_name]) && $this->templates[$template_name]->name != $template_name)\n throw new Exception(\"name conflict occurred on template ('{$this->templates[$template_name]->name}' found at '$template_name')\");\n else*/\n if (!isset($this->templates[$template_name]))\n throw new Exception(\"there is not a template named '$template_name'\");\n\n return $this->templates[$template_name];\n }", "protected function getTemplate($template) {\n\t\tif (!array_key_exists($template, $this->templates)) {\n\t\t\tif (is_file(D_LAYOUTS.$this->layout.'/templates/'.$template.'.tpl')) {\n\t\t\t\t$this->templates[$template] = file_get_contents(D_LAYOUTS.$this->layout.'/templates/'.$template.'.tpl');\n\t\t\t\treturn $this->templates[$template];\n\t\t\t} else {\n\t\t\t\ttrigger_error('Template '.$template.'.tpl does not exist in '.D_LAYOUTS.$this->layout.'/templates.', E_USER_ERROR);\n\t\t\t}\n\t\t} else {\n\t\t\treturn $this->templates[$template];\n\t\t}\n\t}", "public function getTemplate($templateName) {\n $findOptions = array(\n\t\t\t'conditions' => array(\n\t\t\t\t'LabelTemplate.template_name' => $templateName,\n\t\t\t),\n\t\t\t'fields' => array('LabelTemplate.*'),\n\t\t);\n\n\t\t$template = $this->find( 'first', $findOptions );\n $template = Hash::get($template, 'LabelTemplate.template');\n \n return $template;\n }", "public function findTemplate(string $index): Template\n {\n $template = $this->getByIndex($index);\n\n if ($template instanceof Template) {\n return $template;\n }\n\n // Oops, template not found\n throw TemplateNotFoundException::create($index);\n }", "public function __get($key)\n {\n return $this->get_template_vars($key);\n }", "public function getByKey($key);", "static public function getMailServerTemplate($templateKey)\r\n {\r\n return $templateKey;\r\n }", "public function loadTemplate()\n\t{\n\t\t$t_location = \\IPS\\Request::i()->t_location;\n\t\t$t_key = \\IPS\\Request::i()->t_key;\n\t\t\n\t\tif ( $t_location === 'block' and $t_key === '_default_' and isset( \\IPS\\Request::i()->block_key ) )\n\t\t{\n\t\t\t/* Find it from the normal template system */\n\t\t\tif ( isset( \\IPS\\Request::i()->block_app ) )\n\t\t\t{\n\t\t\t\t$plugin = \\IPS\\Widget::load( \\IPS\\Application::load( \\IPS\\Request::i()->block_app ), \\IPS\\Request::i()->block_key, mt_rand() );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$plugin = \\IPS\\Widget::load( \\IPS\\Plugin::load( \\IPS\\Request::i()->block_plugin ), \\IPS\\Request::i()->block_key, mt_rand() );\n\t\t\t}\n\t\t\t\n\t\t\t$location = $plugin->getTemplateLocation();\n\t\t\t\n\t\t\t$templateBits = \\IPS\\Theme::master()->getRawTemplates( $location['app'], $location['location'], $location['group'], \\IPS\\Theme::RETURN_ALL );\n\t\t\t$templateBit = $templateBits[ $location['app'] ][ $location['location'] ][ $location['group'] ][ $location['name'] ];\n\t\t\t\n\t\t\tif ( ! isset( \\IPS\\Request::i()->noencode ) OR ! \\IPS\\Request::i()->noencode )\n\t\t\t{\n\t\t\t\t$templateBit['template_content'] = htmlentities( $templateBit['template_content'], ENT_DISALLOWED, 'UTF-8', TRUE );\n\t\t\t}\n\t\t\t\n\t\t\t$templateArray = array(\n\t\t\t\t'template_id' \t\t\t=> $templateBit['template_id'],\n\t\t\t\t'template_key' \t\t\t=> 'template_' . $templateBit['template_name'] . '.' . $templateBit['template_id'],\n\t\t\t\t'template_title'\t\t=> $templateBit['template_name'],\n\t\t\t\t'template_desc' \t\t=> null,\n\t\t\t\t'template_content' \t\t=> $templateBit['template_content'],\n\t\t\t\t'template_location' \t=> null,\n\t\t\t\t'template_group' \t\t=> null,\n\t\t\t\t'template_container' \t=> null,\n\t\t\t\t'template_rel_id' \t\t=> null,\n\t\t\t\t'template_user_created' => null,\n\t\t\t\t'template_user_edited' => null,\n\t\t\t\t'template_params' \t => $templateBit['template_data']\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif ( \\is_numeric( $t_key ) )\n\t\t\t\t{\n\t\t\t\t\t$template = \\IPS\\cms\\Templates::load( $t_key, 'template_id' );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$template = \\IPS\\cms\\Templates::load( $t_key );\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch( \\OutOfRangeException $ex )\n\t\t\t{\n\t\t\t\t\\IPS\\Output::i()->json( array( 'error' => true ) );\n\t\t\t}\n\n\t\t\tif ( $template !== null )\n\t\t\t{\n\t\t\t\t$templateArray = array(\n\t 'template_id' \t\t\t=> $template->id,\n\t 'template_key' \t\t\t=> $template->key,\n\t 'template_title'\t\t=> $template->title,\n\t 'template_desc' \t\t=> $template->desc,\n\t 'template_content' \t\t=> ( isset( \\IPS\\Request::i()->noencode ) AND \\IPS\\Request::i()->noencode ) ? $template->content : htmlentities( $template->content, ENT_DISALLOWED, 'UTF-8', TRUE ),\n\t 'template_location' \t=> $template->location,\n\t 'template_group' \t\t=> $template->group,\n\t 'template_container' \t=> $template->container,\n\t 'template_rel_id' \t\t=> $template->rel_id,\n\t 'template_user_created' => $template->user_created,\n\t 'template_user_edited' => $template->user_edited,\n\t 'template_params' \t => $template->params\n\t );\n\t\t\t}\n\t\t}\n\n\t\tif ( \\IPS\\Request::i()->show == 'json' )\n\t\t{\n\t\t\t\\IPS\\Output::i()->json( $templateArray );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\\IPS\\Output::i()->sendOutput( \\IPS\\Theme::i()->getTemplate( 'global', 'core' )->blankTemplate( \\IPS\\Theme::i()->getTemplate( 'templates', 'cms', 'admin' )->viewTemplate( $templateArray ) ), 200, 'text/html', \\IPS\\Output::i()->httpHeaders );\n\t\t}\n\t}", "function get_template($id, $type)\n{\n\t$query = \"SELECT template from users WHERE id='$id'\";\n\t$result = mysql_query($query) or die('Hiba a lekérdezésben: ' . mysql_error());\n\t$user = mysql_fetch_array($result, MYSQL_ASSOC);\n\tmysql_free_result($result);\n\t\n\t$less = explode(\"<post>\", $user['template']);\n\tif ($type == \"header\")\n\t\treturn $less[0];\n\telse\n\t{\n\t\t$less = explode(\"</post>\", $less[1]);\n\t\tif ($type == \"footer\")\n\t\t\t\treturn $less[1];\n\t\telse\n\t\t\treturn $less[0]; // post\n\t}\n}", "function stage_get_fallback_template($chosen_key, $default_key = null, $data = array())\n{\n // Does the file exist -> return\n $path = Settings::getFallbackTemplatePath($chosen_key, $default_key);\n return stage_render_template($path, $data);\n}", "public function getByKeyWithTranslation($key, $language)\n {\n return EmailTemplate::find()\n ->byKey($key)\n ->withTranslation($language)\n ->one();\n }", "function fetch($tpl, $key)\n\t {\n\t\t\treturn $this->data[$tpl]->data[$key];\t\n\t }", "public function getTemplate(): string;", "public function getTemplate(): string;", "public function getTemplate(): string;", "public function getTemplate(): string;", "public function findOneByTemplateId($key, $con = null)\n {\n return $this->findPk($key, $con);\n }", "function LoadTemplate( $name )\n{\n if ( file_exists(\"$name.html\") ) return file_get_contents(\"$name.html\");\n if ( file_exists(\"templates/$name.html\") ) return file_get_contents(\"templates/$name.html\");\n if ( file_exists(\"../templates/$name.html\") ) return file_get_contents(\"../templates/$name.html\");\n}", "function iron_get_page_for_post_type ( $post_type = '', $page_template = '' ) {\n\n\tif ( $post_type )\n\t{\n\t\t$page_id = get_iron_option('page_for_' . $post_type . 's');\n\n\t\tif ( empty($page_id) && ! empty($page_template) ) {\n\t\t\t$page = get_pages(array(\n\t\t\t\t'meta_key' => '_wp_page_template',\n\t\t\t\t'meta_value' => $page_template,\n\t\t\t\t'number' => 1\n\t\t\t));\n\n\t\t\tif ( ! empty($page) )\n\t\t\t\t$page_id = $page[0]->ID;\n\t\t}\n\n\t\tif ( $page_id )\n\t\t\treturn $page_id;\n\t}\n\n\treturn 0;\n}", "public static function loadTemplateData()\n {\n $templateId = 0;\n $app = Factory::getApplication();\n\n if ($app->isClient('site'))\n {\n $currentTemplate = $app->getTemplate(true);\n $templateId = $currentTemplate->id ?? 0;\n\n\t\t\t/**\n\t\t\t * If a page/menu is assigned to a specific template\n\t\t\t * then get the template ID.\n\t\t\t */\n\t\t\t$activeMenu = $app->getMenu()->getActive();\n\n\t\t\tif (!empty($activeMenu) && !empty($activeMenu->template_style_id))\n\t\t\t{\n\t\t\t\t$templateId = $activeMenu->template_style_id;\n\t\t\t}\n }\n else\n {\n if ($app->input->get('option') === 'com_ajax' && $app->input->get('helix') === 'ultimate')\n {\n $templateId = $app->input->get('id', 0, 'INT');\n }\n }\n\n\t\tif (empty($templateId))\n\t\t{\n\t\t\t$templateId = $app->input->get('helix_id', 0, 'INT');\n\t\t}\n\n if($templateId)\n {\n $template = [];\n\n $draftKeyOptions = [\n 'option' => 'com_ajax',\n 'helix' => 'ultimate',\n 'status' => 'draft',\n 'id' => $templateId\n ];\n\n $draftKey = self::generateKey($draftKeyOptions);\n $cache = new HelixCache($draftKey);\n\n /**\n * Check the fetch destination. If it is iframe then load the settings\n * from draft, otherwise if it is document that means this request\n * comes from the original site visit. So load from saved cache.\n */\n $requestFromIframe = $app->input->get('helixMode', '') === 'edit';\n \n if ($cache->contains() && $requestFromIframe)\n {\n $template = $cache->loadData();\n }\n else\n {\n $keyOptions = [\n 'option' => 'com_ajax',\n 'helix' => 'ultimate',\n 'status' => 'init',\n 'id' => $templateId\n ];\n \n $key = self::generateKey($keyOptions);\n $cache->setCacheKey($key);\n \n if ($cache->contains())\n {\n $template = $cache->loadData();\n }\n else\n {\n $template = self::getTemplateStyle($templateId); \n }\n }\n\n\t\t\tif (isset($template->template) && !empty($template->template))\n\t\t\t{\n\t\t\t\tif (!empty($template->params) && \\is_string($template->params))\n\t\t\t\t{\n\t\t\t\t\t$template->params = new Registry($template->params);\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * If params field is found empty in the database or cache then\n\t\t\t\t * read the default options.json file from the template and assign\n\t\t\t\t * the options as template params.\n\t\t\t\t */\n\t\t\t\telseif (empty($template->params))\n\t\t\t\t{\n\t\t\t\t\t$filePath = JPATH_ROOT . '/templates/' . $template->template . '/' . 'options.json';\n\n\t\t\t\t\tif (\\file_exists($filePath))\n\t\t\t\t\t{\n\t\t\t\t\t\t$defaultParams = \\file_get_contents($filePath);\n\t\t\t\t\t\t$template->params = new Registry($defaultParams);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$template->params = new Registry;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn $template;\n\t\t\t}\n }\n\n $template = new \\stdClass;\n $template->template = 'system';\n $template->params = new Registry;\n\n return $template;\n }", "function getTemplate( $page ) \n {\n $contents = '';\n \n $fileName = $page->getBLTemplateName();\n \n $pathToTemplates = $this->values[ ModuleCreator::KEY_PATH_RAD_ROOT ];\n $pathToTemplates .= 'data/'.ModuleCreator::PATH_OBJECT_BL;\n \n $contents = file_get_contents( $pathToTemplates.$fileName );\n \n return $contents;\n }", "public function fromTemplatePage($pageNumber);", "public function getItem($key);", "public function getItem($key);", "public function getItem($key);", "public function getItem($key);", "public static function uriKey()\n {\n return 'temply-pages-templates';\n }", "public function getProfileTemplate (){\n $db = new db();\n $db->connect();\n $row = $db->selectOne('settings', 'id', 1);\n return $row['template'];\n }", "function youpztStore_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) {\n if ( $args && is_array( $args ) ) {\n extract( $args );\n }\n\n $located = youpztStore_locate_template( $template_name, $template_path, $default_path );\n\n if ( ! file_exists( $located ) ) {\n //_doing_it_wrong( __FUNCTION__, sprintf( '<code>%s</code> does not exist.', $located ), '2.1' );\n return;\n }\n\n // Allow 3rd party plugin filter template file from their plugin.\n $located = apply_filters('youpztStore_get_template', $located, $template_name, $args, $template_path, $default_path );\n\n include( $located );\n\n}", "public function view_project_template( $template ) {\n\n global $post;\n\n if ( !isset( $post ) ) return $template;\n\n if ( ! isset( $this->templates[ get_post_meta( $post->ID, '_wp_page_template', true ) ] ) ) {\n return $template;\n } // end if\n\n $template_loader = new Uou_Atmf_Load_Template();\n\n if( is_page_template( 'atmf-search.php' ) ){\n $file = $template_loader->locate_template( 'atmf-search.php' );\n }\n\n\n // $file = plugin_dir_path( __FILE__ ) . 'templates/' . get_post_meta( $post->ID, '_wp_page_template', true );\n\n if( file_exists( $file ) ) {\n return $file;\n } // end if\n\n return $template;\n\n }", "public function findOneByTemplateName($templateName);", "public function findTemplate() {\n\n\t\t$templatePath = $this->_template;\n\n\t\tif (empty($templatePath)) {\n\n\t\t\t$templateFolders = array();\n\n\t\t\tif (strlen($tmp = $this->_Model->templatePath)) {\n\t\t\t\t$templateFolders[] = \\Finder::joinPath(APP_ROOT, $tmp);\n\t\t\t}\n\t\t\t// bubble up for template path\n\t\t\telseif (strlen($tmp = $this->_Model->getBubbler()->templatePath)) {\n\t\t\t\t$templateFolders[] = \\Finder::joinPath(APP_ROOT, $tmp);\n\t\t\t}\n\t\t\t// I should add the root page model's template path if exists\n\t\t\t$templateFolders[] = NINJA_ROOT . '/src/ninja/Mod/' . $this->_Module->getModName() . '/template';\n\n\t\t\t$templateFolders = array_unique($templateFolders);\n\n\t\t\t$templateNames = array();\n\t\t\t// I respect what's set in the model, and it should not be invalid\n\t\t\tif (strlen($templateName = $this->_Model->template)) {\n\t\t\t\t$templateNames[]= $templateName;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$Module = $this->_Module;\n\t\t\t\t$modName = $Module->getModName();\n\n\t\t\t\t$a = $Module::moduleNameByClassname(get_class($this->_Model));\n\t\t\t\t$templateNames[] = \\Finder::joinPath($modName, \\Finder::classToPath($a));\n\t\t\t\t$b = $Module::moduleNameByClassname(get_class($this->_Module));\n\t\t\t\t$templateNames[] = \\Finder::joinPath($modName, \\Finder::classToPath($b));\n\t\t\t}\n\n\t\t\t$extension = '.html.mustache';\n\n\t\t\t// for debug\n\t\t\t//echop($templateFolders); echop($templateNames); die;\n\n\t\t\t$templatePath = \\Finder::fileByFolders($templateFolders, $templateNames, $extension);\n\n\t\t}\n\n\t\treturn $templatePath;\n\n\t}", "public function getItem($key){}", "public function getTemplateForPage(ContentPage $contentPage)\n {\n if (null !== $contentPage->getTemplateId())\n {\n return $contentPage->getTemplate()->getTemplateName();\n }\n\n return $this->defaultTemplate;\n }", "public function getTemplate($context = null);", "public function locate( $template, $type, $templates )\n {\n // Set template path\n $this->path = $template;\n\n // Set template type\n $this->type = $type;\n\n // Get the current post ID\n $post_id = get_the_ID();\n\n // Get the current post type\n $post_type = get_post_type($post_id);\n\n // Get the current post slug\n $post_slug = get_page_uri($post_id);\n\n\n switch($type)\n {\n case 'page':\n\n // Search for page slug template\n if( $found = $this->find('page/'.$post_slug) ) break;\n\n // Search for page template\n $found = $this->find('page');\n\n break;\n\n case 'frontpage':\n\n // Search for front template\n $found = $this->find('front');\n\n break;\n\n default:\n // Search for template by type\n $found = $this->find($type);\n break;\n }\n\n // Check if we found a template file\n if( ! empty($found) )\n {\n // Update template path\n $this->path = $found;\n\n return $found;\n }\n\n\n return $template;\n }", "function customcert_get_templates() {\n global $DB;\n\n return $DB->get_records_menu('customcert_template', array(), 'name ASC', 'id, name');\n}", "public function get_template($template_type, $template_name)\n\t{\n\t\treturn cms_orm('CmsModuleTemplate')->find_by_module_and_template_type_and_name($this->get_name(), $template_type, $template_name);\n\t}", "protected function getCurrentPageIdFromRootTemplate() {}", "function get_template( $template_id = false )\n\t{\n\t\tif($template_id) {\n\t\t\t$this->db->where( 'template_id', $template_id );\n\t\t}\n\t\telse {\n\t\t\t$this->db->where( 'is_default', 1 );\n\t\t\t$this->db->where( 'module_id', 1 );\n\t\t}\n\t\t$this->db->limit(1);\n\t\t$query=$this->db->get( 'templates' );\n\t\t$this->db->flush_cache();\n\t\treturn $query->row_array();\n\t}", "protected function _parseTemplate($key)\n {\n $data = array(\n '{:class}' => $this->_class,\n '{:extends}' => $this->_extends,\n '{:model_name}' => $this->_model_name,\n );\n \n return str_replace(\n array_keys($data),\n array_values($data),\n $this->_tpl[$key]\n );\n }", "public function get_template_name(){\n\n return str_replace(\"_\",\"\",str_replace(\"_page\", \"\", get_class($this))) . \".tpl\";\n }", "function bethel_custom_template() {\n global $post;\n if (is_page() && isset($post) && is_object($post)) {\n $post->page_template = get_post_meta( $post->ID, '_wp_page_template', true );\n }\n}", "public static function get_template_by_name($conn, $template_name)\n { \n Ossim_db::check_connection($conn);\n \n $template_data = array();\n \n $query = \"SELECT HEX(id) as id, name FROM acl_templates WHERE name = ?\"; \n \n $rs_1 = $conn->Execute($query, array($template_name));\n \n if (!$rs_1)\n {\n Av_exception::write_log(Av_exception::DB_ERROR, $conn->ErrorMsg());\n } \n else \n { \n while (!$rs_1->EOF) \n {\n $template_id = $rs_1->fields['id'];\n \n //Menu permissions\n $query_2 = \"SELECT p.* FROM acl_templates_perms tp, acl_perm p WHERE tp.ac_templates_id=UNHEX(?) AND tp.ac_perm_id=p.id\";\n \n $rs_2 = $conn->Execute($query_2, array($template_id));\n \n if (!$rs_2) \n {\n Av_exception::write_log(Av_exception::DB_ERROR, $conn->ErrorMsg());\n } \n else \n {\n $perms = array();\n \n while (!$rs_2->EOF) \n {\n $perms[$rs_2->fields['id']] = $rs_2->fields['value'];\n \n $rs_2->MoveNext();\n }\n \n $template_data[$template_id] = array(\n 'id' => $template_id,\n 'name' => $rs_1->fields['name'],\n 'perms' => $perms\n );\n }\n \n $rs_1->MoveNext();\n }\n }\n \n return $template_data;\n }", "abstract public function getConcrete($key);", "abstract public function getTemplateFile();", "public static function get($key);", "public static function get($key);", "public function template() {\n\t\tif( !$this->template ) {\n\t\t\t$this->template = new Template( $this->template_id );\n\t\t}//end if\n\t\treturn $this->template;\n\t}", "function db_get_template ($tpl_name, &$tpl_source, &$smarty_obj) {\n Global $loq;\n $rs = $loq->_adb->Execute(\"select template from \".T_TEMPLATES.\" where templatename='$tpl_id'\");\n if($rs !== false && !$rs->EOF){\n $tpl_source = $rs->fields[0];\n }\n return true;\n}", "public function load(string $templateName): string;", "public function loadTemplate()\n {\n return json_decode(file_get_contents(app_path(self::BASE_TEMPLATE_PATH)), true);\n }" ]
[ "0.6835244", "0.68187505", "0.66107136", "0.64733446", "0.6429965", "0.6366654", "0.6358171", "0.6322886", "0.6322886", "0.6322886", "0.6322886", "0.6322886", "0.6322886", "0.6303399", "0.6285417", "0.6230982", "0.62103844", "0.620904", "0.6192194", "0.61918855", "0.61767834", "0.6159007", "0.6126495", "0.60795313", "0.597949", "0.597845", "0.59588146", "0.59529215", "0.59504277", "0.59471977", "0.59445363", "0.5928655", "0.5920183", "0.5910644", "0.58868086", "0.5878667", "0.5807844", "0.5807102", "0.57948846", "0.57692647", "0.57318234", "0.5730621", "0.57246035", "0.5708748", "0.57054317", "0.5703432", "0.5668324", "0.5650224", "0.5647674", "0.56439435", "0.5619889", "0.5610415", "0.5609021", "0.55895436", "0.5576451", "0.5569556", "0.55660665", "0.55462897", "0.55328214", "0.5524756", "0.5522162", "0.5522162", "0.5522162", "0.5522162", "0.5521182", "0.551769", "0.551465", "0.550886", "0.5500503", "0.54981756", "0.5484271", "0.5484271", "0.5484271", "0.5484271", "0.5479293", "0.5478045", "0.5477844", "0.5475097", "0.54739326", "0.5457171", "0.54560065", "0.5431144", "0.54233557", "0.5418151", "0.5418046", "0.54166824", "0.5405492", "0.5401804", "0.5396977", "0.53907585", "0.53817403", "0.5379185", "0.53666556", "0.53608435", "0.53561056", "0.53561056", "0.53554595", "0.5355355", "0.53450024", "0.5341416" ]
0.6233195
15
Load a new Page Template Instance
public function load($type, $key, $throwOnMissing) { $name = $type . '.' . $key; if(!($template = $this->getPageTemplate($name))) { throw new TemplateNotFoundException($this->pages[$name] ?? null, $name); } if(!isset($this->loaded[$name])) { $this->loaded[$name] = $template->getNewTemplate($type, $key, $throwOnMissing); } else { $this->loaded[$name]->load($throwOnMissing); } return $this->loaded[$name]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function loadTemplate() {\n\t\t\tinclude('template.inc.php');\n\t\t\t$this->mainTemplate = new Template();\n\t\t\t$this->mainTemplate->readTpl('main');\n\t\t}", "public function loadTemplate()\n\t\t{\n\t\t}", "public function __construct () {\n $this->template = new PageTemplate ();\n }", "public function __construct () {\n $this->template = new PageTemplate ();\n }", "public function __construct () {\n $this->template = new PageTemplate ();\n }", "protected function getPageTemplate()\n {\n return new Template();\n }", "public function initTemplate() {}", "function load_template($template_name='default', Page $p)\n{\n\t$template_path = TEMPLATES_DIR . \"/\" . $template_name . \"/template.php\";\n\n\tif(!file_exists($template_path)) throw new FrameworkException(\"$template_path: template doesn't exist\");\n\n\t$p->setTemplate($template_path);\n\t$p->display();\n}", "public function Load() : void\n {\n do_action('template_redirect');\n\n $this->Template === self::VIRTUAL_PAGE_TEMPLATE ? $Template = self::VIRTUAL_PAGE_TEMPLATE : $Template = locate_template(array_filter($this->Templates));\n $filtered = apply_filters('template_include', apply_filters('WP_Plugin_virtual_page_template', $Template));\n if(empty($filtered) || file_exists($filtered))\n {\n $Template = $filtered;\n }\n if(!empty($Template) && file_exists($Template)) \n {\n add_action('wp_enqueue_scripts',function (){$this->Define_Resources();});\n require_once $Template;\n }\n }", "public function createPageUsingTemplateObject()\n\t{\n\t\tglobal $tpl, $lng, $ilCtrl;\n\n\t\t$form = $this->initTemplateSelectionForm();\n\t\tif ($form->checkInput())\n\t\t{\n\t\t\t$a_page = $_POST[\"page\"];\n\t\t\t$this->object->createWikiPage($a_page, (int) $_POST[\"page_templ\"]);\n\n\t\t\t// redirect to newly created page\n\t\t\t$ilCtrl->setParameterByClass(\"ilwikipagegui\", \"page\", ilWikiUtil::makeUrlTitle(($a_page)));\n\t\t\t$ilCtrl->redirectByClass(\"ilwikipagegui\", \"edit\");\n\n\t\t\tilUtil::sendSuccess($lng->txt(\"msg_obj_modified\"), true);\n\t\t\t$ilCtrl->redirect($this, \"\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form->setValuesByPost();\n\t\t\t$tpl->setContent($form->getHtml());\n\t\t}\n\t}", "private function load_template()\r\n\t{\r\n\t\tif(! $this -> loaded)\r\n\t\t{\r\n\t\t\t$controller = $this -> sp -> targetdir().\"/\".sp_StaticProjector::templates_dir.\"/\".$this->name.\"_controller.php\";\r\n\t\t\tsp_StaticRegister::push_object(\"sp\", $this -> sp);\r\n\t\t\t\r\n\t\t\tif(!file_exists($controller))\r\n\t\t\t{\r\n $controller = $this -> sp -> coretemplatesdir().\"/\".$this->name.\"_controller.php\";\r\n if(! file_exists($controller)) {\r\n $controller = $this -> sp -> coretemplatesdir().\"/default_controller.php\";\r\n }\r\n\t\t\t\t/*if($this -> name == \"default\")\r\n\t\t\t\t{\r\n\t\t\t\t\t$default_controller = $this -> sp -> defaultsdir().\"/default_controller.php\";\r\n\t\t\t\t\t@copy($default_controller, $controller);\r\n\t\t\t\t\tchmod($controller,sp_StaticProjector::file_create_rights);\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$base_code = file_get_contents($this -> sp -> defaultsdir().\"/new_controller.txt\");\r\n\t\t\t\t\t$controller_code = str_replace(\"%controller_name%\", $this->name.\"_controller\", $base_code);\r\n\t\t\t\t\tfile_put_contents($controller, $controller_code);\r\n\t\t\t\t}*/\r\n\t\t\t}\r\n\t\t\trequire_once($controller);\r\n\r\n\t\t\t$template = $this -> sp -> targetdir().\"/\".sp_StaticProjector::templates_dir.\"/\".$this->name.\"_template.php\";\r\n\t\t\tif(!file_exists($template))\r\n\t\t\t{\r\n $template = $this -> sp -> coretemplatesdir().\"/\".$this->name.\"_template.php\";\r\n if(! file_exists($template)) {\r\n $template = $this -> sp -> coretemplatesdir().\"/default_template.php\";\r\n }\r\n\t\t\t\t/*if($this -> name == \"default\")\r\n\t\t\t\t{\r\n\t\t\t\t\t$default_template = $this -> sp -> defaultsdir().\"/default_template.php\";\r\n\t\t\t\t\t@copy($default_template, $template);\r\n\t\t\t\t\tchmod($template,sp_StaticProjector::file_create_rights);\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$chunks_code = \"\";\r\n\t\t\t\t\t$chunk_base = file_get_contents($this -> sp -> defaultsdir().\"/new_template_chunk.txt\");\r\n\t\t\t\t\tforeach($this -> sp -> get_config() -> default_templates_chunks() as $chunk)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$chunks_code .= str_replace(\"%chunk_name%\",$chunk,$chunk_base);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$template_base = file_get_contents($this -> sp -> defaultsdir().\"/new_template.txt\");\r\n\t\t\t\t\t$template_code = str_replace(\"%template_name%\", $this -> name.\"_template\", $template_base);\r\n\t\t\t\t\t$template_code = str_replace(\"%template_chunks%\", $chunks_code, $template_code);\r\n\t\t\t\t\tfile_put_contents($template, $template_code);\r\n\t\t\t\t}*/\r\n\t\t\t}\r\n\t\t\trequire_once($template);\r\n\t\t\tsp_StaticRegister::pop_object(\"sp\");\r\n\t\t\t\r\n\t\t\t$this -> loaded = true;\r\n\t\t}\r\n\t}", "public function ClassTemplate(){\n\t\t$this->template = new Template;\n\t}", "protected function instantiateTemplate() {\n\t\t$baseTemplate = '\\\\'. \\Autoload::TEMPLATE_NAMESPACE .'\\\\Base';\n\t\t$templateName = '\\\\'. \\Autoload::TEMPLATE_NAMESPACE .'\\\\'. $this->getDocument()->getTemplateName();\n\t\tif( $templateName != null && class_exists( $templateName ) )\n\t\t\treturn new $templateName( $this, $this->getRequestHandler(), $this->getDocument() );\n\t\telseif( class_exists( $baseTemplate ) )\n\t\t\treturn new $baseTemplate( $this, $this->getRequestHandler(), $this->getDocument() );\n\t\telse\n\t\t\tthrow new Exception( \"Template '\". $templateName .\"' could not be found.\" );\n\t\treturn null;\n\t}", "private function initializeTemplate() {\n\t\t$this->doc = t3lib_div::makeInstance('bigDoc');\n\t\t$this->doc->backPath = $GLOBALS['BACK_PATH'];\n\t\t$this->doc->docType = 'xhtml_strict';\n\t\t$this->doc->styleSheetFile2\n\t\t\t= '../typo3conf/ext/realty/BackEnd/BackEnd.css';\n\n\t\t$this->template\n\t\t\t= tx_oelib_TemplateRegistry::getInstance()->getByFileName(\n\t\t\t\t'EXT:realty/BackEnd/mod_template.html'\n\t\t);\n\t}", "public function loadTemplate()\n\t{\n\t\t$t_location = \\IPS\\Request::i()->t_location;\n\t\t$t_key = \\IPS\\Request::i()->t_key;\n\t\t\n\t\tif ( $t_location === 'block' and $t_key === '_default_' and isset( \\IPS\\Request::i()->block_key ) )\n\t\t{\n\t\t\t/* Find it from the normal template system */\n\t\t\tif ( isset( \\IPS\\Request::i()->block_app ) )\n\t\t\t{\n\t\t\t\t$plugin = \\IPS\\Widget::load( \\IPS\\Application::load( \\IPS\\Request::i()->block_app ), \\IPS\\Request::i()->block_key, mt_rand() );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$plugin = \\IPS\\Widget::load( \\IPS\\Plugin::load( \\IPS\\Request::i()->block_plugin ), \\IPS\\Request::i()->block_key, mt_rand() );\n\t\t\t}\n\t\t\t\n\t\t\t$location = $plugin->getTemplateLocation();\n\t\t\t\n\t\t\t$templateBits = \\IPS\\Theme::master()->getRawTemplates( $location['app'], $location['location'], $location['group'], \\IPS\\Theme::RETURN_ALL );\n\t\t\t$templateBit = $templateBits[ $location['app'] ][ $location['location'] ][ $location['group'] ][ $location['name'] ];\n\t\t\t\n\t\t\tif ( ! isset( \\IPS\\Request::i()->noencode ) OR ! \\IPS\\Request::i()->noencode )\n\t\t\t{\n\t\t\t\t$templateBit['template_content'] = htmlentities( $templateBit['template_content'], ENT_DISALLOWED, 'UTF-8', TRUE );\n\t\t\t}\n\t\t\t\n\t\t\t$templateArray = array(\n\t\t\t\t'template_id' \t\t\t=> $templateBit['template_id'],\n\t\t\t\t'template_key' \t\t\t=> 'template_' . $templateBit['template_name'] . '.' . $templateBit['template_id'],\n\t\t\t\t'template_title'\t\t=> $templateBit['template_name'],\n\t\t\t\t'template_desc' \t\t=> null,\n\t\t\t\t'template_content' \t\t=> $templateBit['template_content'],\n\t\t\t\t'template_location' \t=> null,\n\t\t\t\t'template_group' \t\t=> null,\n\t\t\t\t'template_container' \t=> null,\n\t\t\t\t'template_rel_id' \t\t=> null,\n\t\t\t\t'template_user_created' => null,\n\t\t\t\t'template_user_edited' => null,\n\t\t\t\t'template_params' \t => $templateBit['template_data']\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif ( \\is_numeric( $t_key ) )\n\t\t\t\t{\n\t\t\t\t\t$template = \\IPS\\cms\\Templates::load( $t_key, 'template_id' );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$template = \\IPS\\cms\\Templates::load( $t_key );\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch( \\OutOfRangeException $ex )\n\t\t\t{\n\t\t\t\t\\IPS\\Output::i()->json( array( 'error' => true ) );\n\t\t\t}\n\n\t\t\tif ( $template !== null )\n\t\t\t{\n\t\t\t\t$templateArray = array(\n\t 'template_id' \t\t\t=> $template->id,\n\t 'template_key' \t\t\t=> $template->key,\n\t 'template_title'\t\t=> $template->title,\n\t 'template_desc' \t\t=> $template->desc,\n\t 'template_content' \t\t=> ( isset( \\IPS\\Request::i()->noencode ) AND \\IPS\\Request::i()->noencode ) ? $template->content : htmlentities( $template->content, ENT_DISALLOWED, 'UTF-8', TRUE ),\n\t 'template_location' \t=> $template->location,\n\t 'template_group' \t\t=> $template->group,\n\t 'template_container' \t=> $template->container,\n\t 'template_rel_id' \t\t=> $template->rel_id,\n\t 'template_user_created' => $template->user_created,\n\t 'template_user_edited' => $template->user_edited,\n\t 'template_params' \t => $template->params\n\t );\n\t\t\t}\n\t\t}\n\n\t\tif ( \\IPS\\Request::i()->show == 'json' )\n\t\t{\n\t\t\t\\IPS\\Output::i()->json( $templateArray );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\\IPS\\Output::i()->sendOutput( \\IPS\\Theme::i()->getTemplate( 'global', 'core' )->blankTemplate( \\IPS\\Theme::i()->getTemplate( 'templates', 'cms', 'admin' )->viewTemplate( $templateArray ) ), 200, 'text/html', \\IPS\\Output::i()->httpHeaders );\n\t\t}\n\t}", "function load_view($template){$this->hold_template = APPPATH . '/views/' . $template . EXT;}", "public static function loadTemplateData()\n {\n $templateId = 0;\n $app = Factory::getApplication();\n\n if ($app->isClient('site'))\n {\n $currentTemplate = $app->getTemplate(true);\n $templateId = $currentTemplate->id ?? 0;\n\n\t\t\t/**\n\t\t\t * If a page/menu is assigned to a specific template\n\t\t\t * then get the template ID.\n\t\t\t */\n\t\t\t$activeMenu = $app->getMenu()->getActive();\n\n\t\t\tif (!empty($activeMenu) && !empty($activeMenu->template_style_id))\n\t\t\t{\n\t\t\t\t$templateId = $activeMenu->template_style_id;\n\t\t\t}\n }\n else\n {\n if ($app->input->get('option') === 'com_ajax' && $app->input->get('helix') === 'ultimate')\n {\n $templateId = $app->input->get('id', 0, 'INT');\n }\n }\n\n\t\tif (empty($templateId))\n\t\t{\n\t\t\t$templateId = $app->input->get('helix_id', 0, 'INT');\n\t\t}\n\n if($templateId)\n {\n $template = [];\n\n $draftKeyOptions = [\n 'option' => 'com_ajax',\n 'helix' => 'ultimate',\n 'status' => 'draft',\n 'id' => $templateId\n ];\n\n $draftKey = self::generateKey($draftKeyOptions);\n $cache = new HelixCache($draftKey);\n\n /**\n * Check the fetch destination. If it is iframe then load the settings\n * from draft, otherwise if it is document that means this request\n * comes from the original site visit. So load from saved cache.\n */\n $requestFromIframe = $app->input->get('helixMode', '') === 'edit';\n \n if ($cache->contains() && $requestFromIframe)\n {\n $template = $cache->loadData();\n }\n else\n {\n $keyOptions = [\n 'option' => 'com_ajax',\n 'helix' => 'ultimate',\n 'status' => 'init',\n 'id' => $templateId\n ];\n \n $key = self::generateKey($keyOptions);\n $cache->setCacheKey($key);\n \n if ($cache->contains())\n {\n $template = $cache->loadData();\n }\n else\n {\n $template = self::getTemplateStyle($templateId); \n }\n }\n\n\t\t\tif (isset($template->template) && !empty($template->template))\n\t\t\t{\n\t\t\t\tif (!empty($template->params) && \\is_string($template->params))\n\t\t\t\t{\n\t\t\t\t\t$template->params = new Registry($template->params);\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * If params field is found empty in the database or cache then\n\t\t\t\t * read the default options.json file from the template and assign\n\t\t\t\t * the options as template params.\n\t\t\t\t */\n\t\t\t\telseif (empty($template->params))\n\t\t\t\t{\n\t\t\t\t\t$filePath = JPATH_ROOT . '/templates/' . $template->template . '/' . 'options.json';\n\n\t\t\t\t\tif (\\file_exists($filePath))\n\t\t\t\t\t{\n\t\t\t\t\t\t$defaultParams = \\file_get_contents($filePath);\n\t\t\t\t\t\t$template->params = new Registry($defaultParams);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$template->params = new Registry;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn $template;\n\t\t\t}\n }\n\n $template = new \\stdClass;\n $template->template = 'system';\n $template->params = new Registry;\n\n return $template;\n }", "static public function createPage() {\n $session = Application::getInstance(\"session\");\n $config = Application::getConfig();\n\n if (isset($config[\"system\"][\"customPageClass\"])) {\n require $config[\"system\"][\"pages-folder\"] . \"/\" . $config[\"system\"][\"customPageClass\"] . \".php\";\n }\n\n include_once $config[\"system\"][\"pages-folder\"] . \"/\" . $session->currentPage . \".page.php\";\n $pageClass = $config[\"system\"][\"namespace\"] . \"\\\\pages\\\\Page\" . ucfirst($session->currentPage);\n\n\n $page = new $pageClass();\n\n Application::setInstance(\"page\", $page);\n }", "public static function Load($Template) {\n self::$Template = (String) $Template;\n self::$Template = file_get_contents(self::$Template . '.tpl.html');\n var_dump(self::$Template);\n }", "public function __construct($page){\n $this->template = \"templates/template_\" . $page . \".php\";\n }", "protected function newPage()\n {\n $this->addPage();\n $this->variables['page'] = $this->pageNo();\n if ($this->templatePages > 0) {\n $templateIndex = $this->importPage(min($this->pageNo(), $this->templatePages));\n $this->useImportedPage($templateIndex);\n }\n\n $this->setXY($this->layout['pageNoX'], $this->layout['pageNoY']);\n $this->write(5, $this->t('page'));\n $this->setY($this->layout['contentMarginTopPX']);\n }", "public function loadTemplate($path);", "public function createPageAndCopyLiveParentPage() {}", "public function createContentAndCopyLivePage() {}", "function acp_load_template( $template )\n\t{\n\t\tif ( ! $this->skin_acp )\n\t\t{\n\t\t\t$this->skin_acp = 'IPB2_Standard';\n\t\t}\n\t\t\n\t\trequire_once( ROOT_PATH.\"skin_acp/\".$this->skin_acp.\"/acp_skin_html/\".$template.\".php\" );\n\t\t$tmp = new $template();\n\t\t$tmp->ipsclass =& $this;\n\t\treturn $tmp;\n\t}", "public function fromTemplatePage($pageNumber);", "protected function _setPageViewTemplate()\n {\n\n $fishpigWordpressModuleVersion = Mage::getConfig()->getNode('modules/Fishpig_Wordpress/version');\n\n if ($fishpigWordpressModuleVersion > 4) {\n parent::_setPageViewTemplate();\n } else {\n $page = $this->_initPage();\n\n $template = $page->getMetaValue('_wp_page_template');\n\n // This is the folder in Magento template\n $path = 'page/';\n\n //preg_match('/([^\\/]*)\\.php$/', $template, $match);\n //$filename = $path . $match[1] . '.phtml';\n // The extension is replaced with .phtml,\n // meaning that the directory structure is preserved.\n // (page-templates/templ.php will become $path . page-templates/templ.phtml)\n $filename = $path . str_replace('.php', '.phtml', $template);\n\n // This is to use Magento fallback system\n $params = array('_relative' => false);\n $area = $this->getLayout()->getBlock('root')->getArea();\n\n if ($area) {\n $params['_area'] = $area;\n }\n\n $templateName = Mage::getDesign()->getTemplateFilename($filename, $params);\n\n // If no other matches are found, Magento will eventually give a path in base/default, even if that template doesn't exist\n if (file_exists($templateName)) {\n $this->getLayout()->getBlock('root')->setTemplate($filename);\n }\n\n return $this;\n }\n }", "protected function setupTemplate() {\r\n \r\n }", "function load_template_class( $class_name ) {\n\tglobal $classes_path;\n\trequire_once $classes_path . $class_name . '.php';\n\treturn $$template_loader_instance_name;\n}", "public function initPage() {}", "public function initPage() {}", "protected function setPageTemplate(PageTemplate $template) {\n\t\t$container = $template->initialize($this);\n\t\tif ($container !== null) {\n\t\t\t$this->_body = $container;\n\t\t}\n\t}", "function Template()\r\n\t{\t\t\r\n\t\tglobal $_REQUEST;\t\t\r\n\t\t$theme = $this->theme;\r\n\t\t/*** Get Template By Page Id ***/\r\n\t\t$file = $this->get_template();\r\n\t\t\r\n\t\tif($_SETTINGS['debug'] == 1){\r\n\t\t\techo \"TEMPLATE: \".$file.\" <Br>\";\r\n\t\t}\r\n\t\t\r\n\t\t$websitepath = $this->website_path;\r\n\t\t//die(\"FILE: $file\");\r\n\t\t//exit();\r\n\t\tinclude''.$_SERVER['DOCUMENT_ROOT'].$websitepath.'themes/'.$theme.''.$file.'';\r\n\t}", "public function loadMenu()\n\t{\n\t\t$request = array(\n\t\t\t't_location' => ( isset( \\IPS\\Request::i()->t_location ) ) ? \\IPS\\Request::i()->t_location : null,\n\t\t\t't_group' => ( isset( \\IPS\\Request::i()->t_group ) ) ? \\IPS\\Request::i()->t_group : null,\n\t\t\t't_key' \t => ( isset( \\IPS\\Request::i()->t_key ) ) ? \\IPS\\Request::i()->t_key : null,\n\t\t\t't_type' => ( isset( \\IPS\\Request::i()->t_type ) ) ? \\IPS\\Request::i()->t_type : 'templates',\n\t\t);\n\n\t\tswitch( $request['t_type'] )\n\t\t{\n\t\t\tdefault:\n\t\t\tcase 'template':\n\t\t\t\t$flag = \\IPS\\cms\\Templates::RETURN_ONLY_TEMPLATE;\n\t\t\t\tbreak;\n\t\t\tcase 'js':\n\t\t\t\t$flag = \\IPS\\cms\\Templates::RETURN_ONLY_JS;\n\t\t\t\tbreak;\n\t\t\tcase 'css':\n\t\t\t\t$flag = \\IPS\\cms\\Templates::RETURN_ONLY_CSS;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$templates = \\IPS\\cms\\Templates::buildTree( \\IPS\\cms\\Templates::getTemplates( $flag + \\IPS\\cms\\Templates::RETURN_DATABASE_ONLY ) );\n\n\t\t$current = new \\IPS\\cms\\Templates;\n\t\t\n\t\tif ( ! empty( $request['t_key'] ) )\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$current = \\IPS\\cms\\Templates::load( $request['t_key'] );\n\t\t\t}\n\t\t\tcatch( \\OutOfRangeException $ex )\n\t\t\t{\n\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t\\IPS\\Output::i()->output = \\IPS\\Theme::i()->getTemplate( 'templates' )->menu( $templates, $current, $request );\n\t}", "function load_template()\n{\n $CI =& get_instance();\n $CI->load->library('sistema');\n $CI->parser->parse($CI->sistema->tema['template'],get_tema());\n}", "private function _load_template()\n\t\t{\n\t\t\t//check for a custom template\n\t\t\t$template_file = 'views/'.$this->template_file.'.tpl';\n\n\n\t\t\tif(file_exists($template_file) && is_readable($template_file))\n\t\t\t{\n\t\t\t\t$path = $template_file;\n\t\t\t}\n\t\t\telse if(file_exists($default_file = 'views/error/index.php') && is_readable($default_file))\n\t\t\t{\n\t\t\t\t$path = $default_file;\n\t\t\t}\n\n\t\t\t//If the default template is missing, throw an error\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Exception(\"No default template found\");\n\t\t\t}\n\n\n\t\t\t//Load the contents of the file and return them\n\t\t\t$this->_template = file_get_contents($path);\n\n\t\t}", "abstract public function getTemplate();", "public function getTemplate() {}", "private function prepareTemplate() {\r\n $template = $this->iTemplateFactory->createTemplate();\r\n $template->_control = $this->linkGenerator;\r\n $this->setTemplate($template);\r\n }", "function createPage();", "public static function switch_page_template() {\n\n global $post;\n\n $post_type = get_post_type($post->ID);\n\n if (is_page() or is_post_type_hierarchical($post_type)) {// Checks if current post type is a page, rather than a post\n $current_page_template = get_post_meta($post->ID, '_wp_page_template', true);\n $parent_page_template = get_post_meta($post->post_parent, '_wp_page_template', true);\n $parents = get_post_ancestors($post->ID);\n\n if ($parents) {\n update_post_meta($post->ID, '_wp_page_template', $parent_page_template, $current_page_template);\n }\n }// End check for page\n }", "public function LoadTemplate($sFilename) {\t\t\n\t}", "public function create()\n {\n //for the PAGE on which to create\n }", "protected function initDocumentTemplate() {}", "protected function initDocumentTemplate() {}", "protected function initDocumentTemplate() {}", "protected function initDocumentTemplate() {}", "public function loadTemplate($template)\n {\n $this->view = $this->twig->loadTemplate($template);\n \n return $this->view;\n }", "protected function loadPageObject()\n\t{\n\t\treturn $this->PoObj->run();\n\t}", "public function load($tpl)\n {}", "function oneviewer_page_template( $template ) {\n if ( is_page('viewer') ) {\n $newtemplate = dirname( __FILE__ ) . '/templates/page-one-viewer.php';\n return $newtemplate ;\n }\n return $template;\n\n}", "public function initTemplateSelectionForm()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$form = new ilPropertyFormGUI();\n\n\t\t// page name\n\t\t$hi = new ilHiddenInputGUI(\"page\");\n\t\t$hi->setValue($_GET[\"page\"]);\n\t\t$form->addItem($hi);\n\n\t\t// page template\n\t\t$radg = new ilRadioGroupInputGUI($lng->txt(\"wiki_page_template\"), \"page_templ\");\n\t\t$radg->setRequired(true);\n\n\t\tif ($this->object->getEmptyPageTemplate())\n\t\t{\n\t\t\t$op1 = new ilRadioOption($lng->txt(\"wiki_empty_page\"), 0);\n\t\t\t$radg->addOption($op1);\n\t\t}\n\n\t\tinclude_once(\"./Modules/Wiki/classes/class.ilWikiPageTemplate.php\");\n\t\t$wt = new ilWikiPageTemplate($this->object->getId());\n\t\t$ts = $wt->getAllInfo(ilWikiPageTemplate::TYPE_NEW_PAGES);\n\t\tforeach ($ts as $t)\n\t\t{\n\t\t\t$op = new ilRadioOption($t[\"title\"], $t[\"wpage_id\"]);\n\t\t\t$radg->addOption($op);\n\t\t}\n\n\t\t$form->addItem($radg);\n\n\t\t// save and cancel commands\n\t\t$form->addCommandButton(\"createPageUsingTemplate\", $lng->txt(\"wiki_create_page\"));\n\t\t$form->addCommandButton(\"cancelCreationPageUsingTemplate\", $lng->txt(\"cancel\"));\n\n\t\t$form->setTitle($lng->txt(\"wiki_new_page\").\": \".$_GET[\"page\"]);\n\t\t$form->setFormAction($ilCtrl->getFormAction($this));\n\n\t\treturn $form;\n\t}", "public function showTemplate(){\n\t\tinclude \"view/template.php\";\n\t}", "function get_template()\n {\n }", "public static function newPageInstance()\n {\n $model = new static();\n $model->setAttribute('type', static::PAGE);\n\n return $model;\n }", "function getTemplate();", "public function getPage()\n {\n if ($this->page) {\n return $this->page;\n }\n\n // Remove original page\n $this->app->page_object->destroy(false);\n\n $this->page = $this->app->add(\n $this->page_class,\n $this->name,\n null,\n $this->page_template\n );\n /** @type Page $this->page */\n $this->app->page_object = $this->page;\n $this->app->stickyGET($this->name);\n\n return $this->page;\n }", "public function new_template()\n\t{\n\t\tee()->load->library('table');\n\t\tee()->cp->add_to_head('<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css\">');\n\t\tee()->cp->add_to_head('<link rel=\"stylesheet\" href=\"'.$this->theme_url.'css/app.css\" type=\"text/css\" media=\"screen\">');\n\t\tee()->cp->add_to_foot('<script type=\"text/javascript\">var $token = 1;</script>');\n\t\tee()->cp->add_to_foot('<script src=\"'.$this->theme_url.'js/app.js\" type=\"text/javascript\" charset=\"utf-8\"></script>');\n\t\tee()->cp->add_to_foot('<script src=\"'.$this->theme_url.'js/draganddrop.js\" type=\"text/javascript\" charset=\"utf-8\"></script>');\n\n\t\t$this->_data['action_url'] = ee('CP/URL')->make('addons/settings/json_ld/savetemplate');\n\n\t\t$this->_data['templates'] = ee()->jsonld->templates();\n\n\t\t// Get types\n\t\t$this->_data['types'] = ee()->jsonld->types();\n\n\t\treturn ee('View')->make('json_ld:new')->render($this->_data);\n\n\t}", "public function loadTemplate()\n {\n return json_decode(file_get_contents(app_path(self::BASE_TEMPLATE_PATH)), true);\n }", "function loadTemplate($mainFile, $params = array()) {\n \n loadView(\"template/header\", $params);\n loadView('template/navigation', $params);\n \n loadView($mainFile, $params);\n \n loadView(\"template/footer\", $params);\n}", "public static function afficher() {\r\n $filevue = \"application/templates/\" . Page::getInstance()->template . \".template.php\";\r\n\r\n if (file_exists($filevue)) {\r\n require_once $filevue;\r\n } else {\r\n die(\"template non renseigne\");\r\n }\r\n }", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "protected function loadHTMLTemplates() {\n parent::loadHTMLTemplates();\n $this->template->appendFileById( \"menu_view_link.html\", \"li\", \"navBarUL\", true );\n $this->template->appendFileById( \"form_\" . $this->getForm( true ) . \".html\", \"tbody\", \"person_form\" );\n }", "protected function _load()\r\n {\r\n $page = new Model_Page();\r\n $children = $page->getChildren($this->_parentId);\r\n if ($children != null && $children->count() > 0) {\r\n foreach ($children as $child) {\r\n if ($child->show_on_menu == 1) {\r\n $this->items[] = new Digitalus_Menu_Item($child);\r\n }\r\n }\r\n }\r\n }", "private function configureTemplate(){\n\t\t$template = $this->getTemplate();\n\t\t$template->setPageSubtitle($this->getModule()->getDisplayedName());\n\t}", "public static function get_instance() {\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new PageTemplater();\n\t\t}\n\t\treturn self::$instance;\n\t}", "function templates_example()\n{\n /* Get post object by its template */\n $post = \\ActiTemplate\\Template::getTemplatePageObject('page-contact.php');\n\n /* Get post ID by its template */\n $postID = \\ActiTemplate\\Template::getTemplatePageId('page-contact.php');\n\n /* Get post url by its template */\n $url = \\ActiTemplate\\Template::getTemplatePageUrl('page-contact.php');\n}", "public function Page(){\n parent::__construct();\n $this->template_dir = DOCUMENT_ROOT.'/templates/';\n $this->compile_dir = DOCUMENT_ROOT.'/smarty/';\n //$this->caching = Smarty::CACHING_LIFETIME_CURRENT;\n $this->caching = Smarty::CACHING_OFF;\n $this->debugging = false;\n }", "public function loadMatchingTemplate()\n {\n $assignments = self::getAssignments();\n $hlp = $this;\n $matches = array_filter($assignments, function ($data) use ($hlp) {\n return $hlp::matchPagePattern($data['pattern']);\n });\n\n $template = array_pop($matches);\n return $template;\n }", "function gfd_setup_page_template() {\n\n\t// Post Type to attach a template to.\n\t$post_type_object = get_post_type_object( 'post' );\n\n\t// Assign blocks to page.\n\t$post_type_object->template = array(\n\t\tarray( 'core/heading',\n\t\t\tarray(\n\t\t\t\t'content' => 'Main Heading...', // https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/heading/index.js#L30\n\t\t\t\t'level' => '1' // https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/heading/index.js#L31\n\t\t\t)\n\t\t),\n\t\tarray( 'core/gallery', array(\n\t\t\t'placeholder' => 'Add Description...',\n\t\t\tarray(\n\t\t\t\t'columns' => 3,\n\t\t\t)\n\t\t) ),\n\t\tarray( 'core/paragraph', array(\n\t\t\t'placeholder' => 'Add Description...',\n\t\t) ),\n\t\tarray( 'core/block', array( 'ref' => [34], ) )\n\t);\n\n\t/**\n\t * Lock the template from being edited.\n\t *\n\t * @link Template Lockinghttps://developer.wordpress.org/block-editor/developers/block-api/block-templates/#locking\n\t * @param string 'all' or 'insert'.\n\t */\n\t$post_type_object->template_lock = 'all';\n}", "function Page( $tpl_engine = null ){\n\t\tparent::Control($tpl_engine) ;\n\n\t\t$this->trace(\"instanciation Page\") ;\n\t\t\n\t\t$this->title = \"New Page\" ;\n\t\t$this->smarty->assignByRef(\"title\",$this->title) ;\n\t\t\n\t\t$this->forms = array() ;\n\t\t\n\t\t// Browser configuration\n\t\t\n\t\t$this->browser = new Browser() ;\n\t\t\n\t\t$this->meta = array() ;\n\t\t$this->smarty->assignByRef(\"meta\",$this->meta) ;\n\n\t\tif( $this->browser->isIphone() ){\n\t\t\t$this->addMeta(\"viewport\",\"width=640\") ;\n\t\t\t$this->addMeta(\"apple-mobile-web-app-capable\",\"yes\") ;\n\t\t}\n\n\t\tif( $this->browser->isInternetExplorer() ){\n\t\t\t$this->addMeta(\"X-UA-Compatible\",\"IE=8\") ;\n\t\t}\n\n\t\t$this->css = array() ;\n\t\t$this->smarty->assignByRef(\"css\",$this->css) ;\n\n\t\t$this->addCss(\"reset.css\") ;\n\t\t$this->addCss(\"common.css\") ;\n\t\t\n\t\t$this->js = array() ;\n\t\t$this->smarty->assignByRef(\"js\",$this->js) ;\n\t\t\n\t\t$this->setPlugin();\n\t\t\n\t}", "public static function get_instance() {\n\n\t\tif( null == self::$instance ) {\n\t\t\t\tself::$instance = new PageTemplater();\n\t\t} \n\n\t\treturn self::$instance;\n\t}", "protected function setupPage() {}", "function loadPage($template, $data = null)\n {\n $data['template_name'] = $template;\n $data['data'] = $data;\n // $data \t\t\t\t\t\t= \thtml_escape($this->security->xss_clean($data));\n $this->load->view('user/user_master-template', $data);\n }", "public function loadTemplate() {\n if ( current_filter() !== 'template_redirect' ) {\n return FALSE;\n }\n if ( $this->preLoad() ) {\n return $this->loadFile( $this->getTemplate(), TRUE );\n }\n\n return FALSE;\n }", "function get_paged_template()\n {\n }", "protected function initTemplate()\n {\n /** @var WorldState $state */\n /** @var ExecHelper $exec */\n $tplPhp = <<<EOS\nWorld. From: <?=\\$state->name?>\n\nExec URL: <?=\\$exec->url( 'someExec', ['a'=>1] )?><?php \\$formBody = \"<input type=\\\"text\\\" name=\\\"someInput\\\" value=\\\"2\\\">\\n\"?>\n\nExec Form:\n<?=\\$exec->wrapForm( 'otherExec', 'POST', \\$formBody ) ?>\nEOS;\n $this->template = new PhpTemplate( $this, null, $tplPhp );\n }", "private function buildPage() {\n ob_clean();\n ob_start();\n\n //session_start();\n require_once $this->_template;\n\n $this->_page = ob_get_clean();\n }", "public function TemplateController($page){\n\t\t\n\t\t//Allow Plugins.\n\t\tObservable::Observable();\n\t\t\n\t\t//Setup basic variables\n\t\t$this->varSetup();\n\t\t\n\t\t//Sets the name of the other classes\n\t\t$this->setSystem(\"Template\");\n\t\t\n\t\t//Setup the page\n\t\t$this->setup(\"Change Your Template\");\n\t\t\n\t\t//Set to Administration template\n\t\t$this->getView()->setTemplate(\"admin\");\n\t\t\n\t\t//Check for Plugins\n\t\t$this->loadPlugins();\n\t\t\n\t\t//Set the requests accepted\n\t\t$this->putRequests();\n\t\t\n\t\t//Process Request\n\t\t$this->processRequest();\n\t\t\n\t\t//Render the page\n\t\t$this->displayPage();\n\t}", "public function __viewTemplate()\n {\n $this->_context[2] = 'single';\n $this->addStylesheetToHead(self::$assets_base_url . 'editor.css');\n $this->addStylesheetToHead(self::$assets_base_url . 'highlighters/highlight-xsl.css');\n $this->addScriptToHead(self::$assets_base_url . 'editor.js');\n $this->addScriptToHead(self::$assets_base_url . 'highlighters/highlight-xsl.js');\n $name = $this->_context[1];\n $filename = $name . '.xsl';\n $title = $filename;\n $this->setTitle(__(('%1$s &ndash; %2$s &ndash; %3$s'), array($title, __('Pages'), __('Symphony'))));\n //$this->setPageType('table');\n $this->Body->setAttribute('spellcheck', 'false');\n $this->appendSubheading($title);\n $breadcrumbs = array(\n Widget::Anchor(__('Pages'), SYMPHONY_URL . '/blueprints/pages/'),\n new XMLElement('span', __(Helpers::capitalizeWords($name)))\n );\n $this->insertBreadcrumbs($breadcrumbs);\n \n $this->insertAction(\n Widget::Anchor(\n __('Edit Page'), \n SYMPHONY_URL . '/blueprints/pages/edit/' . PageManager::fetchIDFromHandle($name) . '/',\n __('Edit Page Configuration'),\n 'button'\n )\n );\n\n $this->Form->setAttribute('class', 'columns');\n $this->Form->setAttribute('action', SYMPHONY_URL . '/blueprints/pages/' . $name . '/');\n\n $fieldset = new XMLElement('fieldset');\n $fieldset->appendChild(Widget::Input('fields[name]', $filename, 'hidden'));\n $fieldset->appendChild($label);\n //$fieldset->appendChild((isset($this->_errors['name']) ? Widget::Error($label, $this->_errors['name']) : $label));\n\n $label = Widget::Label(__('Body'));\n $label->appendChild(\n Widget::Textarea(\n 'fields[body]',\n 30,\n 100,\n $filename ? htmlentities(file_get_contents(WORKSPACE . '/pages/' . $filename), ENT_COMPAT, 'UTF-8') : '',\n array('id' => 'text-area', 'class' => 'code hidden')\n )\n );\n //$fieldset->appendChild((isset($this->_errors['body']) ? Widget::Error($label, $this->_errors['body']) : $label));\n\n $fieldset->appendChild($label);\n $this->Form->appendChild($fieldset);\n\n $this->Form->appendChild(\n new XMLElement(\n 'div',\n new XMLElement('p', __('Saving')),\n array('id' => 'saving-popup')\n )\n );\n //$this->_context = array('edit', 'pages', 'single');\n $this->Form->appendChild(\n new XMLElement(\n 'div',\n Widget::Input(\n 'action[save]',\n __('Save Changes'),\n 'submit',\n array('class' => 'button', 'accesskey' => 's')\n ),\n array('class' => 'actions')\n )\n );\n }", "function bethel_custom_template() {\n global $post;\n if (is_page() && isset($post) && is_object($post)) {\n $post->page_template = get_post_meta( $post->ID, '_wp_page_template', true );\n }\n}", "public function load() {\n\t\t$this->copyFromTemplateIfNeeded();\n\t\trequire $this->filePath;\n\t\t$this->vars = $vars;\n\t}", "public static function get_instance() {\n\n if (null == self::$instance) {\n self::$instance = new PageTemplater();\n }\n\n return self::$instance;\n }", "public function initializeBackendTemplate() {}", "public function pagina(){\n\t\t\tinclude \"views/template.php\";\n\t\t}", "public function get_template()\n {\n }", "public function get_template()\n {\n }", "private function load()\n\t{\n\t\tglobal $mediaWiki;\n\t\t\n\t\t$title = Title::newFromText( $this->title );\n\t\t \n\t\t// Can't load page if title is invalid.\n\t\tif ($title == null)\n\t\t\treturn;\n\t\t\n\t\t$article = $mediaWiki->articleFromTitle($title);\n\t\t\n\t\t// Also, if article can't be found, bail out.\n\t\tif ($article == null )\n\t\t\treturn;\n\t\t\n\t\t// Let's try fetching the page content.\n\t\t$article->loadContent();\n\t\t\n\t\t// V1.3 security feature.\n\t\t// At this point, the page's restriction\n\t\t// is loaded. Get 'edit' protection state.\n\t\t$state = $title->getRestrictions('edit');\n $this->protectState = false;\n $state = $title->getRestrictions('edit');\n foreach ($state as $index => $group )\n if ( $group == 'sysop' )\n $this->protectState = true;\n\t\t\n\t\tif (! $this->protectState)\n\t\t\treturn; \n\t\t\n\t\t# if no page or an empty one\n\t\tif (!$article->mDataLoaded)\n\t\t\treturn;\n\t\t \n\t\t$this->content = $article->mContent;\n\t\t$this->raw = $article->mContent;\n\t\t\n\t\t// Now, let's analyse the page\n\t\t// to determine things like page type.\n\t\t$this->analyse();\n\t}", "function load_template($_template_file, $load_once = \\true, $args = array())\n {\n }", "function load_page(string $page_name) {\n get_template_part( \"partials/$page_name\" );\n }", "public static function init() {\n\t\tif (self::$_initialized) {\n\t\t\treturn;\n\t\t}\n\t\tparent::setInstance(new Page());\n\t\tself::$_initialized = true;\n\t}", "public static function create()\n\t{\n\t\t$page = \"Main\";\n\n\t\t// check the requested page title for safety and sanity\n\t\t\n\t\t$pathinfo = explode('/', WebRequest::pathInfo());\n\t\t$pathinfo = array_values(array_filter($pathinfo));\n\t\tif(\n\t\t\tcount($pathinfo) >= 1 &&\n\t\t\t$pathinfo[0] != \"\" && // not empty\n\t\t\t(!ereg(\"[^a-zA-Z0-9]\", $pathinfo[0])) // contains only alphanumeric chars\n\t\t)\n\t\t{\n\t\t\t$page = $pathinfo[0];\n\t\t}\n\t\t\n\t\t// okay, the page title should be reasonably safe now, let's try and make the page\n\t\t\n\t\t$pagename = \"Page\" . $page;\n\t\t\n\t\tglobal $cIncludePath;\n\t\t$filepath = $cIncludePath . \"/Page/\" . $pagename . \".php\";\n\t\t\n\t\tif(file_exists($filepath))\n\t\t{\n\t\t\trequire_once($filepath);\n\t\t}\n\t\telse\n\t\t{\t// oops, couldn't find the requested page, let's fail gracefully.\n\t\t\t$pagename = \"Page404\";\n\t\t\t$filepath = $cIncludePath . \"/Page/\" . $pagename . \".php\";\n\t\t\trequire_once($filepath);\n\t\t}\t\n\n\t\tif(class_exists($pagename))\n\t\t{\n\t\t\t$pageobject = new $pagename;\n\t\t\t\n\t\t\tif(get_parent_class($pageobject) == \"PageBase\")\n\t\t\t{\n\t\t\t\tHooks::run(\"CreatePage\", array($pageobject));\n\t\t\t\t\n\t\t\t\treturn $pageobject;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// defined, but doesn't inherit properly, so we can't guarentee stuff will work.\n\t\t\t\tthrow new Exception();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// file exists, but the class \"within\" doesn't, this is a problem as stuff isn't where it should be.\n\t\t\tthrow new Exception();\n\t\t}\n\t}", "public function createNestedPagesAndCopyLiveParentPage() {}", "private function instantiateClass( $pageFilePath ) : Page\n {\n $isDebug = false;\n\n if($isDebug) {\n echo '<span style=\"color:blue;\">instantiateClass()</span> | pageFilePath = ' . $pageFilePath . '<br>';\n }\n // Strip the directories off the filename\n $filePathArray = explode(\n '/',\n $pageFilePath\n );\n\n $filename = $filePathArray[count($filePathArray) - 1];\n\n\n $page = $filePathArray[count($filePathArray) - 1];\n $topic = $this->allPages[$this->stripExtFromFile($filename)][0];\n $course = $this->allPages[$this->stripExtFromFile($filename)][1];\n\n if($isDebug) {\n echo '<span style=\"color:blue;\">Filename</span>: ' . $filename . '<br>';\n }\n\n $class = explode(\n \".\",\n $filename\n\n );\n\n if($this->isDebug) {\n echo 'Class: ' . $class[0] . '<br>';\n// echo $this->modulesAssoc[$_SESSION['page']] . '<br>';\n// echo 'J\\\\ClassNotes\\\\' . $this->stripClassNameFromFilePath($this->modulesAssoc[$_SESSION['module']], true) . '<br>';\n }\n // Instantiate the class with the filePath ( eg. )as param\n $className = 'J\\\\ClassNotes\\\\' . $class[0];\n\n if($isDebug) {\n echo '<span style=\"color:blue;\">ClassName</span>: ' . $className . '<br>';\n }\n // $filepath = $this->stripClassNameFromFilePath([ $_SESSION[ 'module' ]] );\n\n require_once $pageFilePath;\n\n $newPage = new $className( $filename, $topic, $course );\n\n\n return $newPage;\n\n }", "function setupTemplate($request, $subclass = false) {\n\t\tparent::setupTemplate();\n\n\t\t$templateMgr =& TemplateManager::getManager();\n\t\t$templateMgr->setCacheability(CACHEABILITY_PUBLIC);\n\t\t$templateMgr->assign('pageHierachy', array(array($request->url(null, null, 'announcements'), 'announcement.announcements')));\n\t}" ]
[ "0.74219584", "0.7358285", "0.7233875", "0.7233875", "0.7233875", "0.7075426", "0.6721464", "0.666853", "0.6639978", "0.65951186", "0.65692055", "0.6529613", "0.6493411", "0.6331098", "0.63269746", "0.63258773", "0.6315973", "0.6288139", "0.6265178", "0.62586373", "0.62527484", "0.62395984", "0.62166584", "0.62086624", "0.61825335", "0.61659366", "0.6165054", "0.6152979", "0.6140763", "0.60881287", "0.60881287", "0.6053799", "0.60394156", "0.603106", "0.6019283", "0.60138327", "0.5986046", "0.59677404", "0.59646064", "0.5960904", "0.5955878", "0.59513265", "0.5913163", "0.5912041", "0.5912041", "0.5912041", "0.5912041", "0.5909345", "0.5900591", "0.5894072", "0.5893333", "0.5891573", "0.588701", "0.5886089", "0.5876247", "0.58742976", "0.587351", "0.58682996", "0.58601654", "0.5853627", "0.5848218", "0.58268285", "0.58268285", "0.58268285", "0.58268285", "0.58268285", "0.58268285", "0.5825718", "0.5824403", "0.58243626", "0.58197534", "0.58186805", "0.5810765", "0.5802994", "0.57993764", "0.5789941", "0.57882833", "0.57840145", "0.57802576", "0.57741517", "0.5772907", "0.5771443", "0.57695925", "0.5768958", "0.5765187", "0.5763151", "0.57549953", "0.5754084", "0.57357895", "0.5732722", "0.57304364", "0.57300496", "0.5727547", "0.5727529", "0.5721425", "0.571596", "0.5714512", "0.57058257", "0.5693103", "0.56836253" ]
0.610224
29
Get a loaded page template by its key
public function getLoaded($type, $key) { foreach ($this->loaded as $identifier => $template) { if($identifier === $type . '.' . $key) return $template; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function load($type, $key, $throwOnMissing)\n {\n $name = $type . '.' . $key;\n\n if(!($template = $this->getPageTemplate($name))) {\n throw new TemplateNotFoundException($this->pages[$name] ?? null, $name);\n }\n\n if(!isset($this->loaded[$name])) {\n $this->loaded[$name] = $template->getNewTemplate($type, $key, $throwOnMissing);\n }\n else {\n $this->loaded[$name]->load($throwOnMissing);\n }\n\n return $this->loaded[$name];\n }", "public function getTemplateOf($key)\n {\n return $this->template[$this->mappedFields[$key]];\n }", "public static function getTplKit($key){ \r\n return self::$tpls[$key]; \r\n }", "public function loadMatchingTemplate()\n {\n $assignments = self::getAssignments();\n $hlp = $this;\n $matches = array_filter($assignments, function ($data) use ($hlp) {\n return $hlp::matchPagePattern($data['pattern']);\n });\n\n $template = array_pop($matches);\n return $template;\n }", "abstract public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public static function loadTemplateData()\n {\n $templateId = 0;\n $app = Factory::getApplication();\n\n if ($app->isClient('site'))\n {\n $currentTemplate = $app->getTemplate(true);\n $templateId = $currentTemplate->id ?? 0;\n\n\t\t\t/**\n\t\t\t * If a page/menu is assigned to a specific template\n\t\t\t * then get the template ID.\n\t\t\t */\n\t\t\t$activeMenu = $app->getMenu()->getActive();\n\n\t\t\tif (!empty($activeMenu) && !empty($activeMenu->template_style_id))\n\t\t\t{\n\t\t\t\t$templateId = $activeMenu->template_style_id;\n\t\t\t}\n }\n else\n {\n if ($app->input->get('option') === 'com_ajax' && $app->input->get('helix') === 'ultimate')\n {\n $templateId = $app->input->get('id', 0, 'INT');\n }\n }\n\n\t\tif (empty($templateId))\n\t\t{\n\t\t\t$templateId = $app->input->get('helix_id', 0, 'INT');\n\t\t}\n\n if($templateId)\n {\n $template = [];\n\n $draftKeyOptions = [\n 'option' => 'com_ajax',\n 'helix' => 'ultimate',\n 'status' => 'draft',\n 'id' => $templateId\n ];\n\n $draftKey = self::generateKey($draftKeyOptions);\n $cache = new HelixCache($draftKey);\n\n /**\n * Check the fetch destination. If it is iframe then load the settings\n * from draft, otherwise if it is document that means this request\n * comes from the original site visit. So load from saved cache.\n */\n $requestFromIframe = $app->input->get('helixMode', '') === 'edit';\n \n if ($cache->contains() && $requestFromIframe)\n {\n $template = $cache->loadData();\n }\n else\n {\n $keyOptions = [\n 'option' => 'com_ajax',\n 'helix' => 'ultimate',\n 'status' => 'init',\n 'id' => $templateId\n ];\n \n $key = self::generateKey($keyOptions);\n $cache->setCacheKey($key);\n \n if ($cache->contains())\n {\n $template = $cache->loadData();\n }\n else\n {\n $template = self::getTemplateStyle($templateId); \n }\n }\n\n\t\t\tif (isset($template->template) && !empty($template->template))\n\t\t\t{\n\t\t\t\tif (!empty($template->params) && \\is_string($template->params))\n\t\t\t\t{\n\t\t\t\t\t$template->params = new Registry($template->params);\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * If params field is found empty in the database or cache then\n\t\t\t\t * read the default options.json file from the template and assign\n\t\t\t\t * the options as template params.\n\t\t\t\t */\n\t\t\t\telseif (empty($template->params))\n\t\t\t\t{\n\t\t\t\t\t$filePath = JPATH_ROOT . '/templates/' . $template->template . '/' . 'options.json';\n\n\t\t\t\t\tif (\\file_exists($filePath))\n\t\t\t\t\t{\n\t\t\t\t\t\t$defaultParams = \\file_get_contents($filePath);\n\t\t\t\t\t\t$template->params = new Registry($defaultParams);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$template->params = new Registry;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn $template;\n\t\t\t}\n }\n\n $template = new \\stdClass;\n $template->template = 'system';\n $template->params = new Registry;\n\n return $template;\n }", "public function loadTemplate()\n {\n return json_decode(file_get_contents(app_path(self::BASE_TEMPLATE_PATH)), true);\n }", "public function loadTemplate()\n\t{\n\t\t$t_location = \\IPS\\Request::i()->t_location;\n\t\t$t_key = \\IPS\\Request::i()->t_key;\n\t\t\n\t\tif ( $t_location === 'block' and $t_key === '_default_' and isset( \\IPS\\Request::i()->block_key ) )\n\t\t{\n\t\t\t/* Find it from the normal template system */\n\t\t\tif ( isset( \\IPS\\Request::i()->block_app ) )\n\t\t\t{\n\t\t\t\t$plugin = \\IPS\\Widget::load( \\IPS\\Application::load( \\IPS\\Request::i()->block_app ), \\IPS\\Request::i()->block_key, mt_rand() );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$plugin = \\IPS\\Widget::load( \\IPS\\Plugin::load( \\IPS\\Request::i()->block_plugin ), \\IPS\\Request::i()->block_key, mt_rand() );\n\t\t\t}\n\t\t\t\n\t\t\t$location = $plugin->getTemplateLocation();\n\t\t\t\n\t\t\t$templateBits = \\IPS\\Theme::master()->getRawTemplates( $location['app'], $location['location'], $location['group'], \\IPS\\Theme::RETURN_ALL );\n\t\t\t$templateBit = $templateBits[ $location['app'] ][ $location['location'] ][ $location['group'] ][ $location['name'] ];\n\t\t\t\n\t\t\tif ( ! isset( \\IPS\\Request::i()->noencode ) OR ! \\IPS\\Request::i()->noencode )\n\t\t\t{\n\t\t\t\t$templateBit['template_content'] = htmlentities( $templateBit['template_content'], ENT_DISALLOWED, 'UTF-8', TRUE );\n\t\t\t}\n\t\t\t\n\t\t\t$templateArray = array(\n\t\t\t\t'template_id' \t\t\t=> $templateBit['template_id'],\n\t\t\t\t'template_key' \t\t\t=> 'template_' . $templateBit['template_name'] . '.' . $templateBit['template_id'],\n\t\t\t\t'template_title'\t\t=> $templateBit['template_name'],\n\t\t\t\t'template_desc' \t\t=> null,\n\t\t\t\t'template_content' \t\t=> $templateBit['template_content'],\n\t\t\t\t'template_location' \t=> null,\n\t\t\t\t'template_group' \t\t=> null,\n\t\t\t\t'template_container' \t=> null,\n\t\t\t\t'template_rel_id' \t\t=> null,\n\t\t\t\t'template_user_created' => null,\n\t\t\t\t'template_user_edited' => null,\n\t\t\t\t'template_params' \t => $templateBit['template_data']\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif ( \\is_numeric( $t_key ) )\n\t\t\t\t{\n\t\t\t\t\t$template = \\IPS\\cms\\Templates::load( $t_key, 'template_id' );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$template = \\IPS\\cms\\Templates::load( $t_key );\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch( \\OutOfRangeException $ex )\n\t\t\t{\n\t\t\t\t\\IPS\\Output::i()->json( array( 'error' => true ) );\n\t\t\t}\n\n\t\t\tif ( $template !== null )\n\t\t\t{\n\t\t\t\t$templateArray = array(\n\t 'template_id' \t\t\t=> $template->id,\n\t 'template_key' \t\t\t=> $template->key,\n\t 'template_title'\t\t=> $template->title,\n\t 'template_desc' \t\t=> $template->desc,\n\t 'template_content' \t\t=> ( isset( \\IPS\\Request::i()->noencode ) AND \\IPS\\Request::i()->noencode ) ? $template->content : htmlentities( $template->content, ENT_DISALLOWED, 'UTF-8', TRUE ),\n\t 'template_location' \t=> $template->location,\n\t 'template_group' \t\t=> $template->group,\n\t 'template_container' \t=> $template->container,\n\t 'template_rel_id' \t\t=> $template->rel_id,\n\t 'template_user_created' => $template->user_created,\n\t 'template_user_edited' => $template->user_edited,\n\t 'template_params' \t => $template->params\n\t );\n\t\t\t}\n\t\t}\n\n\t\tif ( \\IPS\\Request::i()->show == 'json' )\n\t\t{\n\t\t\t\\IPS\\Output::i()->json( $templateArray );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\\IPS\\Output::i()->sendOutput( \\IPS\\Theme::i()->getTemplate( 'global', 'core' )->blankTemplate( \\IPS\\Theme::i()->getTemplate( 'templates', 'cms', 'admin' )->viewTemplate( $templateArray ) ), 200, 'text/html', \\IPS\\Output::i()->httpHeaders );\n\t\t}\n\t}", "public function getTemplate() {}", "function getTemplate();", "function fetch($tpl, $key)\n\t {\n\t\t\treturn $this->data[$tpl]->data[$key];\t\n\t }", "public function findByKey($key)\n {\n return Page::where('key', $key)->first();\n }", "public function get_page_template($post_id){\n\t\t$value = 'page_template';\n\n\t\t$query = $this->db->prepare(\"SELECT * FROM `nw_postmeta` WHERE `post_id` = ? AND `meta_key`= ? \");\n\t\t$query-> bindValue(1, $post_id);\n\t\t$query-> bindValue(2, $value);\n\n\t\ttry{\n\t\t\t$query->execute();\n\t\t\t$data = $query->fetch();\n\n\t\t\treturn $data;\n\t\t}catch(PDOException $e){\n\t\t\tdie($e ->getMessage());\n\t\t}\n\t}", "public static function template_option($key) {\n $settings = self::get_page_settings('_mkb_page_template_settings');\n\n if (isset($settings) && isset($settings[$key])) {\n return $settings[$key];\n } else {\n return null;\n }\n }", "function get_template()\n {\n }", "function view($template,$getKey=''){\r\n\t\tif($getKey != '')\r\n\t\t\t$getStr = implode('=',$getKey);\r\n\t\trequire(dirname(__FILE__).'/template/'.$template.'.php');\r\n\t}", "function get_template_of_page($pageid=null)\n{\n\tif ($pageid===null)\n\t{\n\t\tglobal $post;\n\t\t$pageid = $post->ID;\n\t}\n\treturn get_post_meta($pageid, '_wp_page_template', true);\n}", "function kcsite_getPageByTempate($filename, $field = null, $path = 'page-templates/'){\n\t// page-templates/education_login.php\n\n\t$pages = get_pages(array(\n\t 'meta_key' => '_wp_page_template',\n\t 'meta_value' => $path . $filename,\n\t 'hierarchical' => 0\n\t));\n\tif($field != null){\n\t\t// print_r($pages[0]);exit;\n\t\t// print_r($pages[0]->$field);exit;\n\t\treturn $pages[0]->$field;\n\t} else {\n\t\treturn $pages[0];\n\t}\n\t// print_r($pages);exit;\n\n}", "public function getTemplate($name){\n if(isset($name)){\n return $this->template[$name]; // $this->envir->loadTemplate($template)\n }\n return $this->template[$this->templace_interator++]; // $this->envir->loadTemplate($template)\n }", "public function __get($key)\r\n {\r\n return $this->_smarty->getTemplateVars($key);\r\n }", "public function load(string $templateName): string;", "function LoadTemplate( $name )\n{\n if ( file_exists(\"$name.html\") ) return file_get_contents(\"$name.html\");\n if ( file_exists(\"templates/$name.html\") ) return file_get_contents(\"templates/$name.html\");\n if ( file_exists(\"../templates/$name.html\") ) return file_get_contents(\"../templates/$name.html\");\n}", "public function loadTemplate()\n\t\t{\n\t\t}", "function stage_get_fallback_template($chosen_key, $default_key = null, $data = array())\n{\n // Does the file exist -> return\n $path = Settings::getFallbackTemplatePath($chosen_key, $default_key);\n return stage_render_template($path, $data);\n}", "public function __get($key)\n {\n return $this->get_template_vars($key);\n }", "public function loadMenu()\n\t{\n\t\t$request = array(\n\t\t\t't_location' => ( isset( \\IPS\\Request::i()->t_location ) ) ? \\IPS\\Request::i()->t_location : null,\n\t\t\t't_group' => ( isset( \\IPS\\Request::i()->t_group ) ) ? \\IPS\\Request::i()->t_group : null,\n\t\t\t't_key' \t => ( isset( \\IPS\\Request::i()->t_key ) ) ? \\IPS\\Request::i()->t_key : null,\n\t\t\t't_type' => ( isset( \\IPS\\Request::i()->t_type ) ) ? \\IPS\\Request::i()->t_type : 'templates',\n\t\t);\n\n\t\tswitch( $request['t_type'] )\n\t\t{\n\t\t\tdefault:\n\t\t\tcase 'template':\n\t\t\t\t$flag = \\IPS\\cms\\Templates::RETURN_ONLY_TEMPLATE;\n\t\t\t\tbreak;\n\t\t\tcase 'js':\n\t\t\t\t$flag = \\IPS\\cms\\Templates::RETURN_ONLY_JS;\n\t\t\t\tbreak;\n\t\t\tcase 'css':\n\t\t\t\t$flag = \\IPS\\cms\\Templates::RETURN_ONLY_CSS;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$templates = \\IPS\\cms\\Templates::buildTree( \\IPS\\cms\\Templates::getTemplates( $flag + \\IPS\\cms\\Templates::RETURN_DATABASE_ONLY ) );\n\n\t\t$current = new \\IPS\\cms\\Templates;\n\t\t\n\t\tif ( ! empty( $request['t_key'] ) )\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$current = \\IPS\\cms\\Templates::load( $request['t_key'] );\n\t\t\t}\n\t\t\tcatch( \\OutOfRangeException $ex )\n\t\t\t{\n\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t\\IPS\\Output::i()->output = \\IPS\\Theme::i()->getTemplate( 'templates' )->menu( $templates, $current, $request );\n\t}", "public function template() {\n\n // check for a cached template name\n if(isset($this->cache['template'])) return $this->cache['template'];\n\n // get the template name\n $templateName = $this->intendedTemplate();\n\n if($this->kirby->registry->get('template', $templateName)) {\n return $this->cache['template'] = $templateName; \n } else {\n return $this->cache['template'] = 'default';\n }\n\n }", "abstract public function getTemplate($tpl);", "public function loadTemplate($path);", "function getPageTemplate($post_ID) { \n return get_post_meta( $post_ID, '_wp_page_template', true ); \n }", "public function getPageTemplate($name)\n {\n if(array_key_exists($name, $this->pages)) {\n return $this->templates[$this->pages[$name]];\n }\n }", "function f_get_template(){\n /// you need get info config in setting then insert here. the present it default\n $host = $this->host;\n $slugs = $this->slugs;\n $key = $this->key;\n $ajax_url = $this->ajax_url;\n $elementor = $this->elementor;\n/// get slug from url and remove element empty\n $slug = array_filter( explode('/', $_SERVER['REQUEST_URI']) );\n // check exist in slugs config\n if( isset( $slugs[$slug[1]] )){\n $template_api = $slugs[$slug[1]];\n $template_api['action'] = 'action_slug_api';\n $template_api['key'] = $key;\n $template_api['ajax_url'] = $ajax_url;\n $template_api['elementor'] = $elementor;\n $template_api['name'] = $slug[1];\n // check type template list or template single\n if($template_api['slug']){\n $template_api['url'] = $host.$template_api['url'].$slug[2];\n }else{\n $template_api['url'] = $host.$template_api['url'];\n }\n $this->do_template($template_api);\n\n }\n }", "public function get($key) {\n\t\tif (_DEBUG && !$this->has($key)) {\n\t\t\tDebug::getInstance()->addError('The content [dir:' . $this->_dir . ', key:' . $key . '] don\\'t exist');\n\t\t}\n\t\treturn file_get_contents($this->_dir . $key);\n\t}", "public function getPageKey();", "public function getMessageTemplate($key)\n {\n if (array_key_exists($key, $this->_messageTemplates)) {\n return $this->_messageTemplates[$key];\n }\n }", "public function get_template()\n {\n }", "public function get_template()\n {\n }", "function templates_example()\n{\n /* Get post object by its template */\n $post = \\ActiTemplate\\Template::getTemplatePageObject('page-contact.php');\n\n /* Get post ID by its template */\n $postID = \\ActiTemplate\\Template::getTemplatePageId('page-contact.php');\n\n /* Get post url by its template */\n $url = \\ActiTemplate\\Template::getTemplatePageUrl('page-contact.php');\n}", "protected function getPageTemplate()\n {\n return new Template();\n }", "function get_template($template){\n\n\t\t\t$login_arr = $this->action_parser($this->action,'template') ;\n\n\t\t\t$pos = array_search($template, $login_arr['template']['name']); \n\n\t\t\treturn $login_arr['template']['path'][$pos];\n\n\t\t}", "public static function getTemplatePage()\n {\n return self::$templatePage;\n }", "public function fetch($key) {\n\t\treturn include ($this->_getPath($key));\n\t}", "public function getTemplate($key, $language_id)\n {\n if ($template = EmailTemplateTranslation::findOne([\n 'template_id' => EmailTemplate::getIdByKey($key),\n 'language_id' => $language_id\n ])) {\n return Template::buildTemplate($template);\n }\n\n return null;\n }", "public function getItem($key);", "public function getItem($key);", "public function getItem($key);", "public function getItem($key);", "function getTemplate( $page ) \n {\n $contents = '';\n \n $fileName = $page->getBLTemplateName();\n \n $pathToTemplates = $this->values[ ModuleCreator::KEY_PATH_RAD_ROOT ];\n $pathToTemplates .= 'data/'.ModuleCreator::PATH_OBJECT_BL;\n \n $contents = file_get_contents( $pathToTemplates.$fileName );\n \n return $contents;\n }", "protected function _parseTemplate($key)\n {\n $data = array(\n '{:class}' => $this->_class,\n '{:extends}' => $this->_extends,\n '{:model_name}' => $this->_model_name,\n );\n \n return str_replace(\n array_keys($data),\n array_values($data),\n $this->_tpl[$key]\n );\n }", "public function getItem($key){}", "public function getPage($key)\n {\n $page = SitePage::where('key', $key)->where('is_visible', 1)->first();\n if(!$page) abort(404);\n return view('pages.page', ['page' => $page]);\n }", "public function getTemplate() \n {\n return $_SESSION['template'];\n \n }", "public function processaTemplate() {\n return $this->fetch('partita_'.$this->_layout.'.tpl');\n }", "public function fetch_builder_template()\n\t\t{\n\t\t $error = false;\n $name = isset($_POST['templateName']) ? $_POST['templateName'] : false;\n if(empty($name)) \n $error = true;\n \n $key = $this->generate_key($name);\n $template = $this->get_meta_values($key);\n \n if(empty($template)) $error = true;\n \n \n if($error)\n {\n echo \"avia_fetching_error\";\n }\n else\n {\n $text = str_replace('{{{'.$name.'}}}','',$template[0]);\n $return = $this->builder->text_to_interface($text);\n \n echo $return;\n }\n \n die();\n\t\t}", "public function load ($key) {\n return $this->cache->get($key);\n }", "public function getTemplate(): TemplateInterface;", "public function register($type, $key, $template)\n {\n if(!array_key_exists($template, $this->templates)) {\n $this->templates[$template] = new $template;\n }\n\n $this->pages[$type . '.' . $key] = $template;\n\n return $this->templates[$template];\n }", "private function getTemplate()\n {\n $key = $this->getTemplateKey();\n\n // find template for refused short notice\n if (\n $this->busReg->isShortNoticeRefused() === true\n && isset(self::$templatesRefusedShortNotice[$key])\n ) {\n return self::$templatesRefusedShortNotice[$key];\n }\n\n // find template by status\n if (isset(self::$templates[$key])) {\n return self::$templates[$key];\n }\n\n throw new BadRequestException('Template not found for bus registration');\n }", "abstract public function getTemplateFile();", "public function retrieve($key) {\n $result = null;\n if ($fileName = $this->cacheFileExists($key)) {\n $result = include_once($fileName);\n }\n\n return $result;\n }", "public function load($key);", "private function loadTemplate() {\n\t\t\tinclude('template.inc.php');\n\t\t\t$this->mainTemplate = new Template();\n\t\t\t$this->mainTemplate->readTpl('main');\n\t\t}", "public function getByKey($key);", "function getPagesByTemplate( $query ){\n global $pagenow; \n if ($this->isPageType() && is_admin() && $pagenow=='edit.php' && $this->isTeplateSet()) {\n $query->query_vars['meta_key'] = '_wp_page_template';\n $query->query_vars['meta_value'] = $_GET['template'];\n }\n }", "public function getByKeyWithTranslation($key, $language)\n {\n return EmailTemplate::find()\n ->byKey($key)\n ->withTranslation($language)\n ->one();\n }", "public function loadTemplate($name, $index = null)\n {\n $cls = $this->getTemplateClass($name, $index);\n if (isset($this->loadedTemplates[$cls])) {\n return $this->loadedTemplates[$cls];\n }\n if (!class_exists($cls, false)) {\n if (false === $cache = $this->getCacheFilename($name)) {\n eval('?>'.$this->compileSource($this->getLoader()->getSource($name), $name));\n } else {\n if (!is_file($cache) || ($this->isAutoReload() && !$this->isTemplateFresh($name, filemtime($cache)))) {\n $this->writeCacheFile($cache, $this->compileSource($this->getLoader()->getSource($name), $name));\n }\n require_once $cache;\n }\n }\n if (!$this->runtimeInitialized) {\n $this->initRuntime();\n }\n return $this->loadedTemplates[$cls] = new $cls($this);\n }", "function get_paged_template()\n {\n }", "public function getDeserializedVar($key)\n {\n if (!array_key_exists($key, $this->templateVars)) return null;\n \n $retval = $this->templateVars[$key];\n \n if (self::isSerializedVar($retval)) return unserialize(substr($retval), 2, strlen($retval) - 4);\n else return $retval;\n }", "public static function get($key);", "public static function get($key);", "function load_template($template_name='default', Page $p)\n{\n\t$template_path = TEMPLATES_DIR . \"/\" . $template_name . \"/template.php\";\n\n\tif(!file_exists($template_path)) throw new FrameworkException(\"$template_path: template doesn't exist\");\n\n\t$p->setTemplate($template_path);\n\t$p->display();\n}", "public function findTemplate() {\n\n\t\t$templatePath = $this->_template;\n\n\t\tif (empty($templatePath)) {\n\n\t\t\t$templateFolders = array();\n\n\t\t\tif (strlen($tmp = $this->_Model->templatePath)) {\n\t\t\t\t$templateFolders[] = \\Finder::joinPath(APP_ROOT, $tmp);\n\t\t\t}\n\t\t\t// bubble up for template path\n\t\t\telseif (strlen($tmp = $this->_Model->getBubbler()->templatePath)) {\n\t\t\t\t$templateFolders[] = \\Finder::joinPath(APP_ROOT, $tmp);\n\t\t\t}\n\t\t\t// I should add the root page model's template path if exists\n\t\t\t$templateFolders[] = NINJA_ROOT . '/src/ninja/Mod/' . $this->_Module->getModName() . '/template';\n\n\t\t\t$templateFolders = array_unique($templateFolders);\n\n\t\t\t$templateNames = array();\n\t\t\t// I respect what's set in the model, and it should not be invalid\n\t\t\tif (strlen($templateName = $this->_Model->template)) {\n\t\t\t\t$templateNames[]= $templateName;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$Module = $this->_Module;\n\t\t\t\t$modName = $Module->getModName();\n\n\t\t\t\t$a = $Module::moduleNameByClassname(get_class($this->_Model));\n\t\t\t\t$templateNames[] = \\Finder::joinPath($modName, \\Finder::classToPath($a));\n\t\t\t\t$b = $Module::moduleNameByClassname(get_class($this->_Module));\n\t\t\t\t$templateNames[] = \\Finder::joinPath($modName, \\Finder::classToPath($b));\n\t\t\t}\n\n\t\t\t$extension = '.html.mustache';\n\n\t\t\t// for debug\n\t\t\t//echop($templateFolders); echop($templateNames); die;\n\n\t\t\t$templatePath = \\Finder::fileByFolders($templateFolders, $templateNames, $extension);\n\n\t\t}\n\n\t\treturn $templatePath;\n\n\t}", "abstract protected function retrieve($key);", "protected function getTemplate($template) {\n\t\tif (!array_key_exists($template, $this->templates)) {\n\t\t\tif (is_file(D_LAYOUTS.$this->layout.'/templates/'.$template.'.tpl')) {\n\t\t\t\t$this->templates[$template] = file_get_contents(D_LAYOUTS.$this->layout.'/templates/'.$template.'.tpl');\n\t\t\t\treturn $this->templates[$template];\n\t\t\t} else {\n\t\t\t\ttrigger_error('Template '.$template.'.tpl does not exist in '.D_LAYOUTS.$this->layout.'/templates.', E_USER_ERROR);\n\t\t\t}\n\t\t} else {\n\t\t\treturn $this->templates[$template];\n\t\t}\n\t}", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);" ]
[ "0.67220134", "0.6696651", "0.65366435", "0.6526886", "0.6404133", "0.63628757", "0.63628757", "0.63628757", "0.63628757", "0.63628757", "0.63628757", "0.6288307", "0.6253221", "0.6249209", "0.62488705", "0.62415296", "0.61962825", "0.61831385", "0.6183106", "0.61828095", "0.6118061", "0.6111466", "0.6090594", "0.6090115", "0.6088177", "0.6087402", "0.6067284", "0.60485935", "0.6013593", "0.598091", "0.5932775", "0.5909957", "0.59059846", "0.5905257", "0.5905187", "0.59017265", "0.5898666", "0.5897799", "0.5878108", "0.58595943", "0.5800095", "0.5795663", "0.57954496", "0.5784285", "0.5766059", "0.5736081", "0.5729999", "0.57281005", "0.571946", "0.57180715", "0.57180715", "0.57180715", "0.57180715", "0.57038856", "0.57017237", "0.5697285", "0.5683615", "0.568071", "0.5677437", "0.5655673", "0.56506807", "0.56475186", "0.56474245", "0.56425655", "0.5633866", "0.5631568", "0.56314033", "0.5629335", "0.56176245", "0.56134576", "0.5611552", "0.5603251", "0.56013757", "0.5599516", "0.5590629", "0.5590629", "0.5590282", "0.5574555", "0.55742925", "0.557087", "0.5568708", "0.5568708", "0.5568708", "0.5568708", "0.5568708", "0.5568708", "0.5568708", "0.5568708", "0.5568708", "0.5568708", "0.5568708", "0.5568708", "0.5568708", "0.5568708", "0.5568708", "0.5568708", "0.5568708", "0.5568708", "0.5568708", "0.5568708" ]
0.7583623
0
Add a page template
public function register($type, $key, $template) { if(!array_key_exists($template, $this->templates)) { $this->templates[$template] = new $template; } $this->pages[$type . '.' . $key] = $template; return $this->templates[$template]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addTemplate( $template )\n {\n \n $this->templates[] = $template;\n \n }", "function gfd_setup_page_template() {\n\n\t// Post Type to attach a template to.\n\t$post_type_object = get_post_type_object( 'post' );\n\n\t// Assign blocks to page.\n\t$post_type_object->template = array(\n\t\tarray( 'core/heading',\n\t\t\tarray(\n\t\t\t\t'content' => 'Main Heading...', // https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/heading/index.js#L30\n\t\t\t\t'level' => '1' // https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/heading/index.js#L31\n\t\t\t)\n\t\t),\n\t\tarray( 'core/gallery', array(\n\t\t\t'placeholder' => 'Add Description...',\n\t\t\tarray(\n\t\t\t\t'columns' => 3,\n\t\t\t)\n\t\t) ),\n\t\tarray( 'core/paragraph', array(\n\t\t\t'placeholder' => 'Add Description...',\n\t\t) ),\n\t\tarray( 'core/block', array( 'ref' => [34], ) )\n\t);\n\n\t/**\n\t * Lock the template from being edited.\n\t *\n\t * @link Template Lockinghttps://developer.wordpress.org/block-editor/developers/block-api/block-templates/#locking\n\t * @param string 'all' or 'insert'.\n\t */\n\t$post_type_object->template_lock = 'all';\n}", "public function createPageUsingTemplateObject()\n\t{\n\t\tglobal $tpl, $lng, $ilCtrl;\n\n\t\t$form = $this->initTemplateSelectionForm();\n\t\tif ($form->checkInput())\n\t\t{\n\t\t\t$a_page = $_POST[\"page\"];\n\t\t\t$this->object->createWikiPage($a_page, (int) $_POST[\"page_templ\"]);\n\n\t\t\t// redirect to newly created page\n\t\t\t$ilCtrl->setParameterByClass(\"ilwikipagegui\", \"page\", ilWikiUtil::makeUrlTitle(($a_page)));\n\t\t\t$ilCtrl->redirectByClass(\"ilwikipagegui\", \"edit\");\n\n\t\t\tilUtil::sendSuccess($lng->txt(\"msg_obj_modified\"), true);\n\t\t\t$ilCtrl->redirect($this, \"\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form->setValuesByPost();\n\t\t\t$tpl->setContent($form->getHtml());\n\t\t}\n\t}", "function bethel_custom_template() {\n global $post;\n if (is_page() && isset($post) && is_object($post)) {\n $post->page_template = get_post_meta( $post->ID, '_wp_page_template', true );\n }\n}", "function gucci_register_template() {\n $page_type_object = get_post_type_object( 'page' );\n $page_type_object->template = array(\n array( 'acf/page-hero' ),\n );\n}", "function templatePage ($s_content, $s_title, $s_header='', $s_footer='') {\n\treturn template_tags (template_load ('base.html'), array (\n\t\t'TITLE' => $s_title, 'HEADER' => $s_header, 'FOOTER' => $s_footer, 'CONTENT' => $s_content\n\t));\n}", "function transferCustomTemplate( $page ) \n {\n\n /*\n * copy Custom Template to templates directory\n */\n // get original template contents...\n $pathToTemplates = $this->values[ ModuleCreator::KEY_PATH_RAD_ROOT ];\n $pathToTemplates .= 'data/templates/';\n $fileName = 'tmpl_page_Custom.php';\n $contents = file_get_contents( $pathToTemplates.$fileName );\n \n // replace page tags \n $pagePrefixName = $page->getPagePrefixName();\n $pageName = $page->getPageName();\n \n // Replace the Page Prefix Name\n $tag = ModuleCreator::TAG_PAGEINIT_PREFIXNAME;\n $data = $pagePrefixName;\n $contents = str_replace($tag, $data, $contents );\n \n // Replace the Page Prefix Name\n $tag = ModuleCreator::TAG_PAGEINIT_PAGENAME;\n $data = $pageName;\n $contents = str_replace($tag, $data, $contents );\n \n // save template file\n $templateFileName = $this->values[ ModuleCreator::KEY_PATH_MODULE_TEMPLATE ];\n $templateFileName .= $pagePrefixName.$pageName.'.php';\n file_put_contents( $templateFileName, $contents);\n\n }", "public function addTemplate()\n\t{\n\t\t/* Check permission */\n\t\t\\IPS\\Dispatcher::i()->checkAcpPermission( 'template_add_edit' );\n\t\t\n\t\t$type = \\IPS\\Request::i()->type;\n\t\t\n\t\t/* Build form */\n\t\t$form = new \\IPS\\Helpers\\Form();\n\t\t$form->hiddenValues['type'] = $type;\n\t\t\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Text( 'template_title', NULL, TRUE, array( 'regex' => '/^([A-Z_][A-Z0-9_]+?)$/i' ), function ( $val ) {\n\t\t\t/* PHP Keywords cannot be used as template names - so make sure the full template name is not in the list */\n\t\t\t$keywords = array( 'abstract', 'and', 'array', 'as', 'break', 'callable', 'case', 'catch', 'class', 'clone', 'const', 'continue', 'declare', 'default', 'die', 'do', 'echo', 'else', 'elseif', 'empty', 'enddeclare', 'endfor', 'endforeach', 'endif', 'endswitch', 'endwhile', 'eval', 'exit', 'extends', 'final', 'for', 'foreach', 'function', 'global', 'goto', 'if', 'implements', 'include', 'include_once', 'instanceof', 'insteadof', 'interface', 'isset', 'list', 'namespace', 'new', 'or', 'print', 'private', 'protected', 'public', 'require', 'require_once', 'return', 'static', 'switch', 'throw', 'trait', 'try', 'unset', 'use', 'var', 'while', 'xor' );\n\t\t\t\n\t\t\tif ( \\in_array( $val, $keywords ) )\n\t\t\t{\n\t\t\t\tthrow new \\DomainException( \\IPS\\Member::loggedIn()->language()->addToStack( 'template_reserved_word', FALSE, array( 'htmlsprintf' => array( \\IPS\\Member::loggedIn()->language()->formatList( $keywords ) ) ) ) );\n\t\t\t}\n\t\t} ) );\n\n\t\t/* Very specific */\n\t\tif ( $type === 'database' )\n\t\t{\n\t\t\t$groups = array(); /* I was sorely tempted to put 'Radiohead', 'Beatles' in there */\n\t\t\tforeach( \\IPS\\cms\\Databases::$templateGroups as $key => $group )\n\t\t\t{\n\t\t\t\t$groups[ $key ] = \\IPS\\Member::loggedIn()->language()->addToStack( 'cms_new_db_template_group_' . $key );\n\t\t\t}\n\n\t\t\t$form->add( new \\IPS\\Helpers\\Form\\Select( 'database_template_type', NULL, FALSE, array(\n\t\t\t\t'options' => $groups\n\t\t\t) ) );\n\n\t\t\t$databases = array( 0 => \\IPS\\Member::loggedIn()->language()->addToStack('cms_new_db_assign_to_db_none' ) );\n\t\t\tforeach( \\IPS\\cms\\Databases::databases() as $obj )\n\t\t\t{\n\t\t\t\t$databases[ $obj->id ] = $obj->_title;\n\t\t\t}\n\n\t\t\t$form->add( new \\IPS\\Helpers\\Form\\Select( 'database_assign_to', NULL, FALSE, array(\n\t\t\t\t'options' => $databases\n\t\t\t) ) );\n\t\t}\n\t\telse if ( $type === 'block' )\n\t\t{\n\t\t\t$plugins = array();\n\t\t\tforeach ( \\IPS\\Db::i()->select( \"*\", 'core_widgets', array( 'embeddable=1') ) as $widget )\n\t\t\t{\n\t\t\t\t/* Skip disabled applications */\n\t\t\t\tif ( !\\in_array( $widget['app'], array_keys( \\IPS\\Application::enabledApplications() ) ) )\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$plugins[ \\IPS\\Application::load( $widget['app'] )->_title ][ $widget['app'] . '__' . $widget['key'] ] = \\IPS\\Member::loggedIn()->language()->addToStack( 'block_' . $widget['key'] );\n\t\t\t\t}\n\t\t\t\tcatch ( \\OutOfRangeException $e ) { }\n\t\t\t}\n\t\t\t\n\t\t\t$form->add( new \\IPS\\Helpers\\Form\\Select( 'block_template_plugin_import', NULL, FALSE, array(\n\t\t\t\t\t'options' => $plugins\n\t\t\t) ) );\n\t\t\n\t\t\t$form->add( new \\IPS\\Helpers\\Form\\Node( 'block_template_theme_import', NULL, TRUE, array(\n\t\t\t\t'class' => '\\IPS\\Theme'\n\t\t\t) ) );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* Page, css, js */\n\t\t\tswitch( $type )\n\t\t\t{\n\t\t\t\tdefault:\n\t\t\t\t\t$flag = \\IPS\\cms\\Theme::RETURN_ONLY_TEMPLATE;\n\t\t\t\tbreak;\n\t\t\t\tcase 'page':\n\t\t\t\t\t$flag = \\IPS\\cms\\Theme::RETURN_PAGE;\n\t\t\t\tbreak;\n\t\t\t\tcase 'js':\n\t\t\t\t\t$flag = \\IPS\\cms\\Theme::RETURN_ONLY_JS;\n\t\t\t\tbreak;\n\t\t\t\tcase 'css':\n\t\t\t\t\t$flag = \\IPS\\cms\\Theme::RETURN_ONLY_CSS;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$templates = \\IPS\\cms\\Theme::i()->getRawTemplates( array(), array(), array(), $flag | \\IPS\\cms\\Theme::RETURN_ALL_NO_CONTENT );\n\n\t\t\t$groups = array();\n\n\t\t\tif ( isset( $templates['cms'][ $type ] ) )\n\t\t\t{\n\t\t\t\tforeach( $templates['cms'][ $type ] as $group => $data )\n\t\t\t\t{\n\t\t\t\t\t$groups[ $group ] = \\IPS\\cms\\Templates::readableGroupName( $group );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! \\count( $groups ) )\n\t\t\t{\n\t\t\t\t$groups[ $type ] = \\IPS\\cms\\Templates::readableGroupName( $type );\n\t\t\t}\n\n\t\t\t$form->add( new \\IPS\\Helpers\\Form\\Radio( 'theme_template_group_type', 'existing', FALSE, array(\n\t\t\t\t 'options' => array( 'existing' => 'theme_template_group_o_existing',\n\t\t\t\t 'new'\t => 'theme_template_group_o_new' ),\n\t\t\t\t 'toggles' => array( 'existing' => array( 'group_existing' ),\n\t\t\t\t 'new' => array( 'group_new' ) )\n\t\t\t ) ) );\n\n\t\t\t$form->add( new \\IPS\\Helpers\\Form\\Text( 'template_group_new', NULL, FALSE, array( 'regex' => '/^([a-z_][a-z0-9_]+?)?$/' ), NULL, NULL, NULL, 'group_new' ) );\n\t\t\t$form->add( new \\IPS\\Helpers\\Form\\Select( 'template_group_existing', NULL, FALSE, array( 'options' => $groups ), NULL, NULL, NULL, 'group_existing' ) );\n\t\t}\n\n\t\tif ( ! \\IPS\\Request::i()->isAjax() AND $type !== 'database' )\n\t\t{\n\t\t\t$form->add( new \\IPS\\Helpers\\Form\\TextArea( 'template_content', NULL ) );\n\t\t}\n\t\n\t\tif ( $values = $form->values() )\n\t\t{\n\t\t\t$type = \\IPS\\Request::i()->type;\n\n\t\t\tif ( $type == 'database' )\n\t\t\t{\n\t\t\t\t/* We need to copy templates */\n\t\t\t\t$group = \\IPS\\cms\\Databases::$templateGroups[ $values['database_template_type' ] ];\n\t\t\t\t$templates = iterator_to_array( \\IPS\\Db::i()->select( '*', 'cms_templates', array( 'template_location=? AND template_group=? AND template_user_edited=0 AND template_user_created=0', 'database', $group ) ) );\n\n\t\t\t\tforeach( $templates as $template )\n\t\t\t\t{\n\t\t\t\t\tunset( $template['template_id'] );\n\t\t\t\t\t$template['template_original_group'] = $template['template_group'];\n\t\t\t\t\t$template['template_group'] = str_replace( '-', '_', \\IPS\\Http\\Url\\Friendly::seoTitle( $values['template_title'] ) );\n\n\t\t\t\t\t$save = array();\n\t\t\t\t\tforeach( $template as $k => $v )\n\t\t\t\t\t{\n\t\t\t\t\t\t$k = \\mb_substr( $k, 9 );\n\t\t\t\t\t\t$save[ $k ] = $v;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Make sure template tags call the correct group */\n\t\t\t\t\tif ( mb_stristr( $save['content'], '{template' ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tpreg_match_all( '/\\{([a-z]+?=([\\'\"]).+?\\\\2 ?+)}/', $save['content'], $matches, PREG_SET_ORDER );\n\n\t\t\t\t\t\t/* Work out the plugin and the values to pass */\n\t\t\t\t\t\tforeach( $matches as $index => $array )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpreg_match_all( '/(.+?)=' . $array[ 2 ] . '(.+?)' . $array[ 2 ] . '\\s?/', $array[ 1 ], $submatches );\n\n\t\t\t\t\t\t\t$plugin = array_shift( $submatches[ 1 ] );\n\t\t\t\t\t\t\tif ( $plugin == 'template' )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$value = array_shift( $submatches[ 2 ] );\n\t\t\t\t\t\t\t\t$options = array();\n\n\t\t\t\t\t\t\t\tforeach ( $submatches[ 1 ] as $k => $v )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$options[ $v ] = $submatches[ 2 ][ $k ];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( isset( $options['app'] ) and $options['app'] == 'cms' and isset( $options['location'] ) and $options['location'] == 'database' and isset( $options['group'] ) and $options['group'] == $template['template_original_group'] )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$options['group'] = $template['template_group'];\n\n\t\t\t\t\t\t\t\t\t$replace = '{template=\"' . $value . '\" app=\"' . $options['app'] . '\" location=\"' . $options['location'] . '\" group=\"' . $options['group'] . '\" params=\"' . ( isset($options['params']) ? $options['params'] : NULL ) . '\"}';\n\n\t\t\t\t\t\t\t\t\t$save['content'] = str_replace( $matches[$index][0], $replace, $save['content'] );\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\n\t\t\t\t\t$newTemplate = \\IPS\\cms\\Templates::add( $save );\n\t\t\t\t}\n\n\t\t\t\tif ( $values['database_assign_to'] )\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t$db = \\IPS\\cms\\Databases::load( $values['database_assign_to'] );\n\t\t\t\t\t\t$key = 'template_' . $values['database_template_type'];\n\t\t\t\t\t\t$db->$key = $template['template_group'];\n\t\t\t\t\t\t$db->save();\n\t\t\t\t\t}\n\t\t\t\t\tcatch( \\OutOfRangeException $ex ) { }\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( $type === 'block' )\n\t\t\t{\n\t\t\t\t$save = array(\n\t\t\t\t\t'title'\t => str_replace( '-', '_', \\IPS\\Http\\Url\\Friendly::seoTitle( $values['template_title'] ) ),\n\t\t\t\t\t'params' => isset( $values['template_params'] ) ? $values['template_params'] : null,\n\t\t\t\t\t'location' => $type\n\t\t\t\t);\n\n\t\t\t\t/* Get template */\n\t\t\t\tlist( $widgetApp, $widgetKey ) = explode( '__', $values['block_template_plugin_import'] );\n\n\t\t\t\t/* Find it from the normal template system */\n\t\t\t\t$plugin = \\IPS\\Widget::load( \\IPS\\Application::load( $widgetApp ), $widgetKey, mt_rand(), array() );\n\n\t\t\t\t$location = $plugin->getTemplateLocation();\n\n\t\t\t\t$theme = ( \\IPS\\IN_DEV ) ? \\IPS\\Theme::master() : $values['block_template_theme_import'];\n\t\t\t\t$templateBits = $theme->getRawTemplates( $location['app'], $location['location'], $location['group'], \\IPS\\Theme::RETURN_ALL );\n\t\t\t\t$templateBit = $templateBits[ $location['app'] ][ $location['location'] ][ $location['group'] ][ $location['name'] ];\n\n\t\t\t\t$save['content'] = $templateBit['template_content'];\n\t\t\t\t$save['params'] = $templateBit['template_data'];\n\t\t\t\t$save['group'] = $widgetKey;\n\t\t\t\t$newTemplate = \\IPS\\cms\\Templates::add( $save );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$save = array( 'title' => $values['template_title'] );\n\n\t\t\t\t/* Page, css, js */\n\t\t\t\tif ( $type == 'js' or $type == 'css' )\n\t\t\t\t{\n\t\t\t\t\t$fileExt = ( $type == 'js' ) ? '.js' : ( $type == 'css' ? '.css' : NULL );\n\t\t\t\t\tif ( $fileExt AND ! preg_match( '#' . preg_quote( $fileExt, '#' ) . '$#', $values['template_title'] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$values['template_title'] .= $fileExt;\n\t\t\t\t\t}\n\n\t\t\t\t\t$save['title'] = $values['template_title'];\n\t\t\t\t\t$save['type'] = $type;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( $type === 'page' AND $values['theme_template_group_type'] == 'existing' AND $values['template_group_existing'] == 'custom_wrappers' )\n\t\t\t\t{\n\t\t\t\t\t$save['params'] = '$html=NULL, $title=NULL';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( $type === 'page' AND $values['theme_template_group_type'] == 'existing' AND $values['template_group_existing'] == 'page_builder' )\n\t\t\t\t{\n\t\t\t\t\t$save['params'] = '$page, $widgets';\n\t\t\t\t}\n\n\t\t\t\t$save['group'] = ( $values['theme_template_group_type'] == 'existing' ) ? $values['template_group_existing'] : $values['template_group_new'];\n\n\t\t\t\tif ( isset( $values['template_content'] ) )\n\t\t\t\t{\n\t\t\t\t\t$save['content'] = $values['template_content'];\n\t\t\t\t}\n\n\t\t\t\t$save['location'] = $type;\n\n\t\t\t\t$newTemplate = \\IPS\\cms\\Templates::add( $save );\n\t\t\t}\n\n\t\t\t/* Done */\n\t\t\tif( \\IPS\\Request::i()->isAjax() )\n\t\t\t{\n\t\t\t\t\\IPS\\Output::i()->json( array(\n\t\t\t\t\t'id'\t\t=> $newTemplate->id,\n\t\t\t\t\t'title'\t\t=> $newTemplate->title,\n\t\t\t\t\t'params'\t=> $newTemplate->params,\n\t\t\t\t\t'desc'\t\t=> $newTemplate->description,\n\t\t\t\t\t'container'\t=> $newTemplate->container,\n\t\t\t\t\t'location'\t=> $newTemplate->location\n\t\t\t\t)\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\\IPS\\Output::i()->redirect( \\IPS\\Http\\Url::internal( 'app=cms&module=pages&controller=templates' ), 'saved' );\n\t\t\t}\n\t\t}\n\t\n\t\t/* Display */\n\t\t$title = \\strip_tags( \\IPS\\Member::loggedIn()->language()->get( 'content_template_add_template_' . $type ) );\n\t\t\\IPS\\Output::i()->output = \\IPS\\Theme::i()->getTemplate( 'global', 'core' )->block( $title, $form, FALSE );\n\t\t\\IPS\\Output::i()->title = $title;\n\t}", "protected function newPage()\n {\n $this->addPage();\n $this->variables['page'] = $this->pageNo();\n if ($this->templatePages > 0) {\n $templateIndex = $this->importPage(min($this->pageNo(), $this->templatePages));\n $this->useImportedPage($templateIndex);\n }\n\n $this->setXY($this->layout['pageNoX'], $this->layout['pageNoY']);\n $this->write(5, $this->t('page'));\n $this->setY($this->layout['contentMarginTopPX']);\n }", "public function addTemplate() {\n\t\t\n\t\t$aArgs = func_get_args();\n\t\t\n\t\t$sTemplate = array_shift( $aArgs );\n\t\t\n\t\t$this->_aTemplates[ $sTemplate ] = $aArgs;\n\t\t\n\t\treturn $this;\n\t}", "public static function switch_page_template() {\n\n global $post;\n\n $post_type = get_post_type($post->ID);\n\n if (is_page() or is_post_type_hierarchical($post_type)) {// Checks if current post type is a page, rather than a post\n $current_page_template = get_post_meta($post->ID, '_wp_page_template', true);\n $parent_page_template = get_post_meta($post->post_parent, '_wp_page_template', true);\n $parents = get_post_ancestors($post->ID);\n\n if ($parents) {\n update_post_meta($post->ID, '_wp_page_template', $parent_page_template, $current_page_template);\n }\n }// End check for page\n }", "function _template ($page,$contents){\n\t\t\t$this->load->view(\"client_common_header\",$contents);\t\t\t\t\t\t\t\n\t\t\t$this->load->view('user/career_event/'.$page, $contents);\n\t\t\t$this->load->view(\"client_common_footer\",$contents);\n\t\t}", "public function AddTemplate($template, $name=NULL){\n if(!isset($name)){\n $name = 'Tid'.(sizeof($this->template)+1);\n }\n $this->template[$name] = $template; // $this->envir->loadTemplate($template);\n if(sizeof($this->template)==1){\n $this->mystart_template = $name;\n }\n return $name;\n }", "public function addPage() {\n\t\t\n\t\t$output = array();\n\t\t$url = Request::post('url');\n\n\t\t// Validation of $_POST. URL, title and template must exist and != false.\n\t\tif ($url && ($Page = $this->Automad->getPage($url))) {\n\t\n\t\t\t$subpage = Request::post('subpage');\n\n\t\t\tif (is_array($subpage) && !empty($subpage['title'])) {\n\t\t\n\t\t\t\t// Check if the current page's directory is writable.\n\t\t\t\tif (is_writable(dirname($this->getPageFilePath($Page)))) {\n\t\n\t\t\t\t\tCore\\Debug::log($Page->url, 'page');\n\t\t\t\t\tCore\\Debug::log($subpage, 'new subpage');\n\t\n\t\t\t\t\t// The new page's properties.\n\t\t\t\t\t$title = $subpage['title'];\n\t\t\t\t\t$themeTemplate = $this->getTemplateNameFromArray($subpage, 'theme_template');\n\t\t\t\t\t$theme = dirname($themeTemplate);\n\t\t\t\t\t$template = basename($themeTemplate);\n\t\t\t\t\t\n\t\t\t\t\t// Save new subpage below the current page's path.\t\t\n\t\t\t\t\t$subdir = Core\\Str::sanitize($title, true, AM_DIRNAME_MAX_LEN);\n\t\t\t\t\t\n\t\t\t\t\t// If $subdir is an empty string after sanitizing, set it to 'untitled'.\n\t\t\t\t\tif (!$subdir) {\n\t\t\t\t\t\t$subdir = 'untitled';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Add trailing slash.\n\t\t\t\t\t$subdir .= '/';\n\t\t\t\t\t\n\t\t\t\t\t// Build path.\n\t\t\t\t\t$newPagePath = $Page->path . $subdir;\n\t\t\t\t\t$suffix = FileSystem::uniquePathSuffix($newPagePath);\n\t\t\t\t\t$newPagePath = FileSystem::appendSuffixToPath($newPagePath, $suffix); \n\t\t\t\t\t\n\t\t\t\t\t// Data. Also directly append possibly existing suffix to title here.\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\tAM_KEY_TITLE => $title . ucwords(str_replace('-', ' ', $suffix)),\n\t\t\t\t\t\tAM_KEY_PRIVATE => (!empty($subpage['private']))\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\tif ($theme != '.') {\n\t\t\t\t\t\t$data[AM_KEY_THEME] = $theme;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set date.\n\t\t\t\t\t$data[AM_KEY_DATE] = date('Y-m-d H:i:s');\n\t\t\t\t\t\n\t\t\t\t\t// Build the file name and save the txt file. \n\t\t\t\t\t$file = FileSystem::fullPagePath($newPagePath) . str_replace('.php', '', $template) . '.' . AM_FILE_EXT_DATA;\n\t\t\t\t\tFileSystem::writeData($data, $file);\n\t\t\t\t\t\n\t\t\t\t\t$output['redirect'] = $this->contextUrlByPath($newPagePath);\n\t\t\t\t\t\n\t\t\t\t\t$this->clearCache();\n\t\t\n\t\t\t\t} else {\n\t\t\t\n\t\t\t\t\t$output['error'] = Text::get('error_permission') . '<p>' . dirname($this->getPageFilePath($Page)) . '</p>';\n\t\t\t\n\t\t\t\t}\n\t\t\n\t\t\t} else {\n\t\n\t\t\t\t$output['error'] = Text::get('error_page_title');\n\t\n\t\t\t}\t\n\t\n\t\t} else {\n\t\n\t\t\t$output['error'] = Text::get('error_no_destination');\n\t\n\t\t}\t\n\t\t\n\t\treturn $output;\n\t\t\n\t}", "public function Add($template)\n {\n $this->_Template[$template] = $template;\n }", "public static function use_parent_template() {\n add_action('save_post', array('core_admin', 'switch_page_template'));\n }", "function _add_template( $data=array() )\n\t{\n\t\t$template = array();\n\t\t\n\t\t$template['set_id'] = 1;\n\t\t$template['group_name'] = $data['group_name']['VALUE'];\n\t\t$template['section_content'] = $data['section_content']['VALUE'];\n\t\t$template['func_name'] = $data['func_name']['VALUE'];\n\t\t$template['func_data'] = $data['func_data']['VALUE'];\n\t\t$template['updated'] = time();\n\t\t$template['group_names_secondary'] = $data['group_names_secondary']['VALUE'];\n\t\t\n\t\tif ( !$this->ipsclass->DB->field_exists( 'group_names_secondary', 'skin_templates' ) )\n\t\t{\n\t\t\tunset( $template['group_names_secondary'] );\n\t\t}\n\t\t\n\t\t$this->ipsclass->DB->do_insert( 'skin_templates', $template );\n\t}", "public function addTemplate($value) {\n return $this->add('templates', func_get_args());\n }", "protected function getPageTemplate()\n {\n return new Template();\n }", "function portfolio_page_template( $template ) {\n $post_id = get_the_ID();\n if ( get_post_type( $post_id ) == 'actividad' && is_single() ) {\n $new_template = dirname( __FILE__ ) . '/includes/templates/single.php';\n if ( $new_template != '' ) {\n return $new_template ;\n }\n }\n return $template;\n}", "protected function setPageTemplate($template)\r\n {\r\n $this->pageTemplate = $template;\r\n }", "function _home_template ($page,$contents){\n\t\t\t$this->load->view(\"client_home_header_new\",$contents);\n\t\t\t$this->load->view('user/career_event/'.$page, $contents);\n\t\t\t$this->load->view(\"client_home_footer_new\",$contents);\n\t\t}", "function createSamplePage(){\n\tif(the_slug_exists('custom-page')==false)\n\t{\n\t\tglobal $user_ID;\n\t $new_post = array(\n 'post_title' => 'Custom Page',\n 'post_content' => 'Sample content here',\n 'post_status' => 'publish',\n 'post_date' => date('Y-m-d H:i:s'),\n 'post_author' => $user_ID,\n 'post_type' => 'page',\n );\n $post_id = wp_insert_post($new_post);\n\t}\n}", "public function __construct($page){\n $this->template = \"templates/template_\" . $page . \".php\";\n }", "protected function content_template() {}", "protected function content_template() {}", "private function postTemplate()\n\t{\n\t\t$custom_template = get_template_directory() . '/templates/social-curator-grid-post-template.php';\n\t\tif ( file_exists($custom_template) ) {\n\t\t\tinclude($custom_template);\n\t\t\treturn;\n\t\t}\n\t\tinclude(\\SocialCuratorGrid\\Helpers::view('grid/single-post-template'));\n\t}", "public function add()\n\t{\n\n\t\t$this->data['_pageview'] = $this->data[\"_directory\"] . \"edit\";\n\t\t$this->data['option'] \t\t= \"add\";\n\n\t\treturn view($this->constants[\"ADMINCMS_TEMPLATE_VIEW\"], $this->data);\n\t}", "function create_custom_pages() {\n $custom_pages = array(\n 'issues' => 'Issues',\n 'weeklies' => 'Weeklies',\n 'artists' => 'Artists',\n 'contributors' => 'Contributors',\n 'incubator' => 'Incubator',\n 'about' => 'About',\n 'shop' => 'Shop',\n 'contribute' => 'How to Contribute',\n 'contact' => 'Contact Us',\n 'faq' => 'FAQ',\n 'definitions' => 'Definitions',\n 'terms-and-conditions' => 'Terms & Conditions',\n 'bag' => 'Bag',\n );\n foreach($custom_pages as $page_name => $page_title) {\n $page = get_page_by_path($page_name);\n if( empty($page) ) {\n wp_insert_post( array(\n 'post_type' => 'page',\n 'post_title' => $page_title,\n 'post_name' => $page_name,\n 'post_status' => 'publish'\n ));\n }\n }\n}", "protected function _setPageViewTemplate()\n {\n\n $fishpigWordpressModuleVersion = Mage::getConfig()->getNode('modules/Fishpig_Wordpress/version');\n\n if ($fishpigWordpressModuleVersion > 4) {\n parent::_setPageViewTemplate();\n } else {\n $page = $this->_initPage();\n\n $template = $page->getMetaValue('_wp_page_template');\n\n // This is the folder in Magento template\n $path = 'page/';\n\n //preg_match('/([^\\/]*)\\.php$/', $template, $match);\n //$filename = $path . $match[1] . '.phtml';\n // The extension is replaced with .phtml,\n // meaning that the directory structure is preserved.\n // (page-templates/templ.php will become $path . page-templates/templ.phtml)\n $filename = $path . str_replace('.php', '.phtml', $template);\n\n // This is to use Magento fallback system\n $params = array('_relative' => false);\n $area = $this->getLayout()->getBlock('root')->getArea();\n\n if ($area) {\n $params['_area'] = $area;\n }\n\n $templateName = Mage::getDesign()->getTemplateFilename($filename, $params);\n\n // If no other matches are found, Magento will eventually give a path in base/default, even if that template doesn't exist\n if (file_exists($templateName)) {\n $this->getLayout()->getBlock('root')->setTemplate($filename);\n }\n\n return $this;\n }\n }", "function oneviewer_page_template( $template ) {\n if ( is_page('viewer') ) {\n $newtemplate = dirname( __FILE__ ) . '/templates/page-one-viewer.php';\n return $newtemplate ;\n }\n return $template;\n\n}", "function renderHtmlAdd($page = null)\n {\n $themeConfig = $this->getTheme()->getConfig($this->config('loader.base_dir'));\n if (!$page) {\n $page = new Contener_Node();\n }\n \n if ($template = $page->template) {\n if (isset($themeConfig['templates']) && isset($themeConfig['templates'][$template]) && isset($themeConfig['templates'][$template]['slots'])) {\n $slots = $themeConfig['templates'][$template]['slots'];\n if (isset($themeConfig['templates'][$template]['is_open']) && $themeConfig['templates'][$template]['is_open']) {\n $page->getSlotManager()->addSlots($slots);\n } else {\n $page->getSlotManager()->setSlots($slots);\n }\n }\n }\n \n $theme = $this->getTheme();\n \n $this->context->area('right')->addModule('', $this->getService('view')->render(\n 'page_edit_publish', \n array('context' => $page, 'theme' => $theme, 'show_template' => false))\n );\n \n return $this->getService('view')->render(\n 'page_add',\n array('context' => $this, 'page' => $page, 'list' => $this->repository->listAll('flat'), 'theme' => $theme)\n );\n }", "protected function setupTemplate() {\r\n \r\n }", "public function addTemplate(AlTemplate $template)\n {\n $key = $this->normalizeKey($template->getTemplateName());\n $this->templates[$key] = $template;\n }", "public function setTemplate($path)\n {\n $this->templatePages = $this->setSourceFile($path);\n }", "public static function register_templates() {\n if (version_compare(floatval(get_bloginfo('version')), '4.7', '<')) {\n // 4.6 and older\n add_filter('page_attributes_dropdown_pages_args', array(get_called_class(), 'register_project_templates'));\n } else {\n // Add a filter to the wp 4.7 version attributes metabox\n add_filter('theme_page_templates', array(get_called_class(), 'add_new_template'));\n }\n // Add a filter to the save post to inject out template into the page cache\n add_filter('wp_insert_post_data', array(get_called_class(), 'register_project_templates'));\n // Add a filter to the template include to determine if the page has our \n // template assigned and return it's path\n add_filter('template_include', array(get_called_class(), 'view_project_template'));\n }", "public function processTemplate($template = '') {\n\t\tif(is_object($this->registry->get('config')) && $this->registry->get('config')->get('embed_mode') == true ){\n\t\t \t//get template if it was set earlier\n\t\t\tif (empty($template)) {\n\t\t\t\t$template = $this->view->getTemplate();\n\t\t\t}\n\t\t\t//only substitute the template for page templates\n\t\t\tif(substr($template, 0, 6) == 'pages/' && substr($template, 0, 6) != 'embed/'){\n\t\t \t//load special headers for embed as no page/layout needed\n\t \t\t$this->addChild('responses/embed/head', 'head');\n\t \t$this->addChild('responses/embed/footer', 'footer');\n\t \t$template = preg_replace('/pages\\//', 'embed/', $template);\t\t\t\n\t\t\t}\n\t\t}\n\t\n\t\tif (!empty($template)) {\n\t\t\t$this->view->setTemplate($template);\n\t\t}\n\t\t$this->view->assign('block_details',$this->block_details);\n\t\t$this->view->assign(\"children_blocks\", $this->getChildrenBlocks());\n\t\t$this->view->enableOutput();\n\t}", "function Template()\r\n\t{\t\t\r\n\t\tglobal $_REQUEST;\t\t\r\n\t\t$theme = $this->theme;\r\n\t\t/*** Get Template By Page Id ***/\r\n\t\t$file = $this->get_template();\r\n\t\t\r\n\t\tif($_SETTINGS['debug'] == 1){\r\n\t\t\techo \"TEMPLATE: \".$file.\" <Br>\";\r\n\t\t}\r\n\t\t\r\n\t\t$websitepath = $this->website_path;\r\n\t\t//die(\"FILE: $file\");\r\n\t\t//exit();\r\n\t\tinclude''.$_SERVER['DOCUMENT_ROOT'].$websitepath.'themes/'.$theme.''.$file.'';\r\n\t}", "protected function content_template()\n\t{\n\t\t//\n\t}", "private function configureTemplate(){\n\t\t$template = $this->getTemplate();\n\t\t$template->setPageSubtitle($this->getModule()->getDisplayedName());\n\t}", "protected function content_template() {\n\t}", "protected function setPageTemplate(PageTemplate $template) {\n\t\t$container = $template->initialize($this);\n\t\tif ($container !== null) {\n\t\t\t$this->_body = $container;\n\t\t}\n\t}", "function template($template=\"simple\"){\n\n\t\t// THE PHYSICAL TEMPLATE SHOULD BE IN THE RESPECTIVE \n\t\t// TEMPLATE/TYPE/$template.php\n\t\t$this->template = $template;\n\t}", "protected function templates($page, $array = null){\n\t\tif($array){\n\t\t\textract($array);\n\t\t}\n\t\trequire('View/templates/'. $page . '.php');\n\t}", "function setTemplate($template);", "function fsnat_create_page() {\n\trequire_once( get_template_directory() . '/inc/templates/fsnat-admin.php');\n}", "function replaceTemplateTags( $page, &$templateData ) \n {\n /*\n * insert common tags here \n */\n $templateData = $this->replaceCommonTags( $templateData );\n \n // insert Page Prefix Name \n $tag = ModuleCreator::TAG_PAGE_PREFIXNAME;\n $data = $page->getPagePrefixName();\n $templateData = str_replace($tag, $data, $templateData );\n \n // insert Page Name \n $tag = ModuleCreator::TAG_PAGE_NAME;\n $data = $page->getPageName();\n $templateData = str_replace($tag, $data, $templateData );\n \n // insert Page Description \n $tag = ModuleCreator::TAG_PAGE_DESCRIPTION;\n $data = $page->getDescription();\n $templateData = str_replace($tag, $data, $templateData );\n \n /*\n * Process Form Portions of the Templates\n */\n // Gather Form Field entry data...\n $fieldList = '';\n $formEntryList = '';\n \n // $formDateFieldList is used to create the startYear and endYear data \n // to pass to the form templates (formEntrySingle, Adminbox, ...)\n $formDateFieldList = array(); \n \n // fieldListEntries is used to make sure we don't duplicate entries in \n // the field list when we add foreign key information to it.\n $fieldListEntries = array(); \n $formFieldList = $page->getFormFieldList();\n $formFieldList->setFirst();\n while ( $field = $formFieldList->getNextDataField() ) {\n \n if ($fieldList != '') {\n $fieldList .= ',';\n }\n $fieldList .= $field->getFieldTypeEntry();\n \n if ($formEntryList != '') {\n $formEntryList .= ',';\n }\n $formEntryList .= $field->getFormEntryType();\n \n // if this field is a date type\n if ($field->isDateType()) {\n \n $formDateFieldList[] = $field->getname();\n \n }\n \n // save the name of this entry in the fieldListEntries\n $name = $field->getName();\n $fieldListEntries[ $name ] = $name;\n }\n \n \n // step through each field of the formDAObj to see if it contains\n // any foreign keys\n $foreignKeyInfo = array();\n $foreignKeyInit = '// save the value of the Foriegn Key(s)';\n $formDAObj = $page->getFormDAObj();\n $formFields = $formDAObj->getFieldList();\n $formFields->setFirst();\n while( $field = $formFields->getNext() ) {\n\n // if current field is a foreign key\n if ( $field->isForeignKey() ) {\n \n // compile foreign Key init statements\n if ($foreignKeyInit != '') {\n $foreignKeyInit .= \"\\n\";\n }\n $name = $field->getName();\n $foreignKeyInit .= ' $this->formValues[ \\''.$name.'\\' ] = $this->'.$name.';';\n \n\n // Store additional foreign key param info\n $info['name'] = $name;\n $info['type'] = $field->getType();\n $foreignKeyInfo[] = $info;\n\n // if current field is NOT already in field list then add it\n if ( !array_key_exists( $name, $fieldListEntries) ) {\n \n // mark entry to be skipped for is data valid operations\n if ($fieldList != '') {\n $fieldList .= ',';\n }\n $fieldList .= $name.'|T|<skip>';\n \n // mark entry as not being displayed on a form\n if ($formEntryList != '') {\n $formEntryList .= ',';\n }\n $formEntryList .= '-';\n \n } // end if field NOT in field list\n \n } // end if foreign key\n\n } // next field\n \n \n // To find the Form's Data Manager's Init Variable we find the \n // primary key field for the form:\n $formInitVar = 'You Did not select a primary key for this DAObj';\n $formDAObj = $page->getFormDAObj();\n $formFields = $formDAObj->getFieldList();\n $formFields->setFirst();\n while( $field = $formFields->getNext() ) {\n \n if( $field->isPrimaryKey() ) {\n $formInitVar = $field->getName();\n }\n \n }\n \n // insert Field Type List\n $tag = ModuleCreator::TAG_PAGE_FORMFIELDTYPE;\n $data = $fieldList;\n $templateData = str_replace($tag, $data, $templateData );\n \n // insert Form Entry Type List\n $tag = ModuleCreator::TAG_PAGE_FORMENTRYTYPE;\n $data = $formEntryList;\n $templateData = str_replace($tag, $data, $templateData );\n \n // data Manager's Init Variable Name\n $tag = ModuleCreator::TAG_FORM_INIT_NAME;\n $data = $formInitVar;\n $templateData = str_replace($tag, $data, $templateData );\n \n // data Manager Object\n $dataManager = $page->getFormDAObj();\n $tag = ModuleCreator::TAG_PAGE_DATAMANAGER;\n $data = $dataManager->getManagerName();\n $templateData = str_replace($tag, $data, $templateData );\n \n // Foreign Key Initialization (for Admin Boxes)\n $tag = ModuleCreator::TAG_PAGE_FOREIGNKEY;\n $data = $foreignKeyInit.\"\\n \".$tag;\n $templateData = str_replace($tag, $data, $templateData );\n \n // Form button Text update\n $tag = '[RAD_BUTTONLABEL]';\n if ( $page->isAddType() ) {\n $data = '[Add]';\n } else {\n $data = '[Update]';\n }\n $templateData = str_replace($tag, $data, $templateData );\n \n \n // Insert the Date Field's startYear and endYear Values\n $data = '';\n for( $indx=0; $indx<count($formDateFieldList); $indx++) {\n $name = $formDateFieldList[ $indx ];\n $data .= ' $this->template->set( \\'startYear_'.$name.'\\', 2000);\n $this->template->set( \\'endYear_'.$name.'\\', 2010);'.\"\\n\\n\";\n }\n $tag = ModuleCreator::TAG_PAGE_DATE_PARAM;\n $templateData = str_replace($tag, $data, $templateData );\n \n \n /*\n * Form Grid Updates\n */\n \n $formGridListInitName = '';\n $formGridLabelFieldName = ''; \n $formDAObj = $page->getFormDAObj();\n $formFields = $formDAObj->getFieldList();\n $formFields->setFirst();\n while( $field = $formFields->getNext() ) {\n \n if( $field->isListInit() ) {\n $formGridListInitName = $field->getName();\n }\n \n if( $field->isLabelName() ) {\n $formGridLabelFieldName = $field->getName();\n }\n \n }\n \n // Insert the name of the ListIterator Object name\n $tag = ModuleCreator::TAG_FORMGRID_LIST_OBJ_NAME;\n $data = $formDAObj->getListIteratorName();\n $templateData = str_replace($tag, $data, $templateData );\n \n // Insert the name of the ListIterator's InitVar name\n $tag = ModuleCreator::TAG_FORMGRID_LIST_INIT_NAME;\n $data = $formGridListInitName;\n $templateData = str_replace($tag, $data, $templateData );\n \n // Insert the name of the ListIterator's InitVar name\n $tag = ModuleCreator::TAG_FORMGRID_LABEL_NAME;\n $data = $formGridLabelFieldName;\n $templateData = str_replace($tag, $data, $templateData );\n \n \n \n /*\n * Process Data List Information\n */\n $fieldList = '';\n $listFieldList = $page->getListFieldList();\n $listFieldList->setFirst();\n while ( $field = $listFieldList->getNextDataField() ) {\n \n if ($fieldList != '') {\n $fieldList .= ',';\n }\n $fieldList .= $field->getName();\n\n }\n \n // to find the listInitVarName we step through all the fields of the \n // list DAObj to find the listInit's\n $listInitVarName = array();\n $listDAObj = $page->getListDAObj();\n $listDAObjFields = $listDAObj->getFieldList();\n $listDAObjFields->setFirst();\n while( $field = $listDAObjFields->getNext() ) {\n \n if ( $field->isListInit() ) {\n $listInitVarName[] = $field->getName();\n }\n }\n \n \n // get primary Key info\n $primaryKeyName = 'You Did not select a primary key for this DAObj';\n $listDAObj = $page->getListDAObj();\n $listFields = $listDAObj->getFieldList();\n $listFields->setFirst();\n while( $field = $listFields->getNext() ) {\n \n if( $field->isPrimaryKey() ) {\n $primaryKeyName = $field->getName();\n }\n \n }\n \n // insert Display Field List\n $tag = ModuleCreator::TAG_PAGE_LIST_FIELDS;\n $data = $fieldList;\n $templateData = str_replace($tag, $data, $templateData );\n \n // data List Object's RowManager Name\n $tag = ModuleCreator::TAG_PAGE_LIST_ROWMANAGER;\n $data = $listDAObj->getManagerName();\n $templateData = str_replace($tag, $data, $templateData );\n \n // data List object Name\n $listManager = $page->getListDAObj();\n $tag = ModuleCreator::TAG_PAGE_LISTMANAGER;\n $data = $listManager->getListIteratorName();\n $templateData = str_replace($tag, $data, $templateData );\n \n /*\n * Update the Data List Initialization Data ...\n */\n // Data List Init Variable Name (define the variable)\n $tag = ModuleCreator::TAG_LIST_INIT_NAME;\n $data = '/* no List Init Variable defined for this DAObj */';\n if (count($listInitVarName) > 0) {\n $data = '';\n for( $indx=0; $indx<count($listInitVarName); $indx++) {\n if ($data != '') {\n $data .= \"\\n\\n\";\n }\n $data .= \" /** @var [STRING] The initialization variable for the dataList */\n protected $\".$listInitVarName[$indx].\";\";\n }\n }\n $templateData = str_replace($tag, $data, $templateData );\n \n // Documentation Header\n $tag = ModuleCreator::TAG_LIST_INIT_DOC;\n $data = '';\n for( $indx=0; $indx<count($listInitVarName); $indx++) {\n $data .= '\t * @param $'.$listInitVarName[$indx].' [STRING] The init data for the dataList obj'.\"\\n\";\n }\n $templateData = str_replace($tag, $data, $templateData );\n \n // Parameter Entry\n $tag = ModuleCreator::TAG_LIST_INIT_PARAM;\n $data = '';\n for( $indx=0; $indx<count($listInitVarName); $indx++) {\n $data .= ', $'.$listInitVarName[$indx].'=\"\"';\n }\n $templateData = str_replace($tag, $data, $templateData );\n \n // Module Variable Initilization \n $tag = ModuleCreator::TAG_LIST_INIT_VAR_INIT;\n $data = '';\n for( $indx=0; $indx<count($listInitVarName); $indx++) {\n $data .= ' $this->'.$listInitVarName[$indx].' = $'.$listInitVarName[$indx].';'.\"\\n\";\n }\n $templateData = str_replace($tag, $data, $templateData );\n \n // DAObj Parameter Initilization \n $tag = ModuleCreator::TAG_LIST_INIT_DAOBJ_PARAM;\n $data = '';\n for( $indx=0; $indx<count($listInitVarName); $indx++) {\n $data .= '$this->'.$listInitVarName[$indx].', ';\n }\n $templateData = str_replace($tag, $data, $templateData );\n \n // data List Object's primary key\n $tag = ModuleCreator::TAG_PAGE_LIST_PRIMARYKEY;\n $data = $primaryKeyName;\n $templateData = str_replace($tag, $data, $templateData );\n \n \n // now create the parameters for the foreign keys\n // make sure to not include the data list init value\n $paramVariables = '';\n $paramDocumentation = '';\n $paramList = '';\n $paramSave = '';\n for( $indx=0; $indx<count($foreignKeyInfo); $indx ++ ) {\n \n $name = $foreignKeyInfo[$indx]['name'];\n $type = $foreignKeyInfo[$indx]['type'];\n \n // current foriegn key != data list Init Variable\n if (!in_array($name, $listInitVarName) ) {\n \n // compile variable definition\n if ($paramVariables != '') {\n $paramVariables .= \"\\n\\n\";\n }\n $paramVariables .= '\t/** @var ['.$type.'] Foreign Key needed by Data Manager */\n\tprotected $'.$name.';';\n\t \n\t // compile parameter documentation\n\t $paramDocumentation .= '\t * @param $'.$name.' ['.$type.'] The foreign key data for the data Manager'.\"\\n\";\n\t \n\t // compile parameter list\n\t $paramList .= ', $'.$name.\"=''\";\n\t \n\t $paramSave .= ' $this->'.$name.' = $'.$name.\";\\n\";\n\t \n } // end if not data list init var\n \n } // next foreign key data item\n \n // now replace them in the document\n // insert parameter Variable definitions\n $tag = ModuleCreator::TAG_PAGE_FOREIGNKEY_VARIABLE;\n $data = $paramVariables;\n $templateData = str_replace($tag, $data, $templateData );\n \n // insert Foreign Key parameter Variable documentation\n $tag = ModuleCreator::TAG_PAGE_FOREIGNKEY_DOCUMENTATION;\n $data = $paramDocumentation;\n $templateData = str_replace($tag, $data, $templateData );\n \n // insert Foreign Key parameter parameter entry\n $tag = ModuleCreator::TAG_PAGE_FOREIGNKEY_PARAM;\n $data = $paramList . ')';\n $templateData = str_replace($tag, $data, $templateData );\n \n // insert Foreign Key parameter saving entry\n $tag = ModuleCreator::TAG_PAGE_FOREIGNKEY_SAVE;\n $data = $paramSave;\n $templateData = str_replace($tag, $data, $templateData );\n \n \n // Now finally replace the name of the Site Template to reference\n // by default\n $tag = ModuleCreator::TAG_PAGE_TEMPLATE_DEFAULT;\n $data = $page->getSiteTemplateName();\n $templateData = str_replace($tag, $data, $templateData );\n \n }", "function create_custom_page_templates() {\n $pages = array(\n array(\n 'page' => get_page_by_title('Home'),\n 'template' => 'page-home.php'\n ),\n // array(\n // 'page' => get_page_by_title('About'),\n // 'template' => 'page-about.php'\n // ),\n );\n\n foreach ($pages as $page) {\n if ($page) {\n update_post_meta( $page['page']->ID, '_wp_page_template', $page['template'] );\n\n if ($page['template'] === 'page-home.php') {\n update_option( 'page_on_front', $page['page']->ID );\n update_option( 'show_on_front', 'page' );\n }\n }\n }\n}", "public function __construct () {\n $this->template = new PageTemplate ();\n }", "public function __construct () {\n $this->template = new PageTemplate ();\n }", "public function __construct () {\n $this->template = new PageTemplate ();\n }", "public function addTemplate($templatePath) {\n $this->arrTemplates[] = $templatePath;\n }", "public static function add( $template )\n {\n\n if( is_singular( self::$_type ) && stripos( $template, 'single-' . self::$_type . '.php' ) === false )\n {\n $template = self::$_plugin_dir . 'templates/single-' . self::$_type . '.php';\n }\n \n if( is_archive() && is_post_type_archive( self::$_type ) && stripos( $template, 'archive-' . self::$_type . '.php' ) === false )\n {\n $template = self::$_plugin_dir . 'templates/archive-' . self::$_type . '.php';\n }\n\n return $template;\n }", "function kstHelpWordpressSitePages_customPageTemplates() {\n ?>\n <p>\n WordPress offers incredible flexibility as a CMS (Content Management System).\n Theme and plugin developers often include special layout templates that you\n can use on your site pages to present information in a different format or\n layout, as well as to add functionality to certain pages of your site.\n </p>\n <p>\n Examples include contact forms, multi-column layouts, magazine style\n index layouts, or even mini applications.\n </p>\n <p>\n Occasionally these templates can be so complex that you can't really\n even edit the content the page and the page that appears in your\n Pages Admin List is really only a place holder. It will be obvious\n if you come across one of these pages.\n </p>\n <p>\n You will know that the creator of your theme or plugins included custom\n layout templates for you to use if (when creating/editing a Site Page)\n you see \"Template\" with a dropdown box under it in the right hand sidebar.\n </p>\n <p>\n Choosing a template and publishing the page will use that template instead of\n the default \"pages\" template that your site pages use.\n </p>\n <?php\n}", "public function combineTemplate($templateName){\r\n\t\t$this -> _template -> assign_display($templateName, 'PAGE', false);\r\n\t}", "function setupTemplate() {\r\n\t\tparent::setupTemplate();\r\n\t\tLocale::requireComponents(array(LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_OJS_EDITOR, LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_OJS_AUTHOR, LOCALE_COMPONENT_OJS_MANAGER));\r\n\t\t$templateMgr =& TemplateManager::getManager();\r\n\t\t$isEditor = Validation::isEditor();\r\n\t\t\r\n\t\tif (Request::getRequestedPage() == 'editor') {\r\n\t\t\t$templateMgr->assign('helpTopicId', 'editorial.editorsRole');\r\n\t\t\r\n\t\t} else {\r\n\t\t\t$templateMgr->assign('helpTopicId', 'editorial.sectionEditorsRole');\r\n\t\t}\r\n\t\t\r\n\t\t$roleSymbolic = $isEditor ? 'editor' : 'sectionEditor';\r\n\t\t$roleKey = $isEditor ? 'user.role.coordinator' : 'user.role.sectionEditor';\r\n\t\t$pageHierarchy = array(array(Request::url(null, 'user'), 'navigation.user'), array(Request::url(null, 'user'), $roleKey), array(Request::url(null, $roleSymbolic, 'submissionsReport'), 'editor.reports.reportGenerator'));\r\n\t\t\r\n\t\t$templateMgr->assign('pageHierarchy', $pageHierarchy);\r\n\t}", "function get_paged_template()\n {\n }", "function aman_create_page() {\n\trequire_once(get_template_directory() . '/inc/templates/aman-admin.php');\n}", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "public function addTemplateDir($dir);", "protected function _content_template()\n {\n\n }", "public static function setTemplate(PageTemplate $template) {\n\t\tself::getInstance()->setPageTemplate($template);\n\t}", "public function add(WebPage $page);", "protected function _content_template() {\n \n }", "public function new_template()\n\t{\n\t\tee()->load->library('table');\n\t\tee()->cp->add_to_head('<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css\">');\n\t\tee()->cp->add_to_head('<link rel=\"stylesheet\" href=\"'.$this->theme_url.'css/app.css\" type=\"text/css\" media=\"screen\">');\n\t\tee()->cp->add_to_foot('<script type=\"text/javascript\">var $token = 1;</script>');\n\t\tee()->cp->add_to_foot('<script src=\"'.$this->theme_url.'js/app.js\" type=\"text/javascript\" charset=\"utf-8\"></script>');\n\t\tee()->cp->add_to_foot('<script src=\"'.$this->theme_url.'js/draganddrop.js\" type=\"text/javascript\" charset=\"utf-8\"></script>');\n\n\t\t$this->_data['action_url'] = ee('CP/URL')->make('addons/settings/json_ld/savetemplate');\n\n\t\t$this->_data['templates'] = ee()->jsonld->templates();\n\n\t\t// Get types\n\t\t$this->_data['types'] = ee()->jsonld->types();\n\n\t\treturn ee('View')->make('json_ld:new')->render($this->_data);\n\n\t}", "function load_template($template_name='default', Page $p)\n{\n\t$template_path = TEMPLATES_DIR . \"/\" . $template_name . \"/template.php\";\n\n\tif(!file_exists($template_path)) throw new FrameworkException(\"$template_path: template doesn't exist\");\n\n\t$p->setTemplate($template_path);\n\t$p->display();\n}", "public function addPage()\n {\n $placements = array(\n array('id' => 'ads.leftbar.banner', 'name' => $this->translate->translate('Left Side')),\n array('id' => 'ads.rightbar.banner', 'name' => $this->translate->translate('Right Side'))\n );\n $this->putitem(\"placements\", $placements);\n\n $view_types = array(\n array('id' => 'serial', 'name' => 'Serial'),\n array('id' => 'carrousel', 'name' => 'Carroussel')\n );\n $this->putitem(\"view_types\", $view_types);\n\n parent::addPage();\n }", "function custom_plugin_create_page() {\n\n $page = array();\n $page['post_type'] = 'page';\n $page['post_title'] = 'Custom Plugin Page';\n $page['post_content'] = 'custom plugin page';\n $page['post_status'] = 'publish';\n $page['post_slug'] = 'custom-plugin-page';\n\n wp_insert_post( $page );\n}", "protected function _content_template() {\n\t}", "function insert_template()\n {\n $parameter_array = $this->get_parameter_array();\n \n parent::insert('sssis', $parameter_array);\n }", "function tpl_item_page( $page ) {\n\ttpl('item', 'page', array(\n\t\t'page' => $page\n\t) );\n}", "function bbpress_add_content_location() {\n\t\tglobal $gantry;\n\n\t\t$template_locations = bbp_get_template_stack();\n\t\t$template_locations = array_reverse( $template_locations );\n\n\t\tif( ( $key = array_search( $gantry->templatePath, $template_locations ) ) !== false ) {\n\t\t\tunset( $template_locations[$key] );\n\t\t}\n\n\t\tforeach( $template_locations as $location ) {\n\t\t\t$gantry->addContentTypePath( $location );\n\t\t}\n\t}", "public function add() {\n\t\t\n\t\t$this->template->content = View::instance(\"v_posts_add\");\n\t\t\n\t\t$client_files_body = Array(\n\t\t\t'/js/jquery.form.js',\n\t\t\t'/js/posts_add.js'\n\t\t);\n\t\t\n\t\t$this->template->client_files_body = Utils::load_client_files($client_files_body);\n\n\t\techo $this->template;\n\t\t\n\t}", "public function template();", "function createPage();", "public function onLoadPostTemplateDefinition($event)\n {\n $templates = (array)$event->getResult(); //loads an array of already existing templates\n $templates[] = [\n \"name\" => \"posts/post-single-repo\",\n \"source\" => $this->getPackageDir() . \"layouts\" . DS\n ];\n\n $event->setResult($templates);\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "function templates_example()\n{\n /* Get post object by its template */\n $post = \\ActiTemplate\\Template::getTemplatePageObject('page-contact.php');\n\n /* Get post ID by its template */\n $postID = \\ActiTemplate\\Template::getTemplatePageId('page-contact.php');\n\n /* Get post url by its template */\n $url = \\ActiTemplate\\Template::getTemplatePageUrl('page-contact.php');\n}", "function AddPage($orientation = '', $format = '') {\n \tif (is_subclass_of($this, 'TCPDF')) {\n \t$args = func_get_args();\n \treturn call_user_func_array(array($this, 'TCPDF::AddPage'), $args);\n }\n \n if ($this->_intpl)\n $this->Error('Adding pages in templates isn\\'t possible!');\n \n parent::AddPage($orientation, $format);\n }", "public function createContentAndCopyLivePage() {}", "public function setTemplate($p);", "public function addPage()\n\t{\n\t\tglobal $cfg;\n\t\t$data = $cfg['data'];\n\n\t\t// Load the content model\n\t\t$content = $this->load_model('Content');\n\n\t\t// Get all the available pages from database\n\t\t$pages[0] = '- New Page -'; \n\t\tforeach ($content->get_pages() as $key) \n\t\t{\n\t\t\t$pages[$key['id']] = $key['name'];\n\t\t}\n\n\t\t// Get all the available regions from the database\n\t\tforeach ($content->get_regions() as $key) {\n\t\t\t$regions[$key['id']] .= $key;\n\t\t}\n\n\t\t$form = new Form();\n\n\t\t$form->set_validate_rules(\"page\", \"Page name\", \"required\");\n\n\t\tif($form->validate())\n\t\t{\n\t\t\t$content = $this->load_model(\"Content\");\n\n\t\t\tif($_POST['page_id'] == 0)\n\t\t\t\t$content->insertPage();\n\t\t\telse\n\t\t\t\t$content->updatePage();\n\n\t\t\tredirect(\"content\");\n\t\t}\n\n\t\t$data['content']['main'] = \"<fieldset class='clearfix inline-block'><legend>New page</legend>\";\n\t\t$data['content']['main'] .= $form->start();\n\t\t$data['content']['main'] .= \"<lable>Parent page</lable>\";\n\t\t$data['content']['main'] .= $form->select($pages, array('style' => 'width:100%', 'name' => 'page_id'));\n\t\t$data['content']['main'] .= \"<lable>Page name</lable>\";\n\t\t$data['content']['main'] .= $form->input('text', array('style' => 'width:100%', 'name' => 'page'));\n\t\t$data['content']['main'] .= $form->input('submit', array('value' => 'Save', 'style' => 'width:100%'));\n\t\t$data['content']['main'] .= \"</form></fieldset>\";\n\t\t$data['content']['main'] .= $form->validate_error();\n\n\t\t$this->load_view('default', $data);\n\t}", "public function initTemplate() {}", "function page_add_page($pagerec) {\n return page_edit_page($pagerec, 0, null, null);\n}", "public function actionCreateTemplate() {\n $searchService = $this->getProvider()->get('\\PM\\Search\\Service\\Template'); /* @var $searchService \\PM\\Search\\Service\\Template */\n\n $this->getExecutor()\n ->add(function(Database $database, Request $request) {\n $database->getTransaction()->begin();\n return array('templateData' => $request->getInput());\n })\n ->add('createTemplate', $searchService)\n ->add(function(Database $databasse) {\n $databasse->getTransaction()->commitAll();\n });\n }", "public function create()\n {\n return view('admin.page.addpage');\n }", "function sh_page_content() {\n\tglobal $post, $wp_query;\n\t\n\t// if there's a specific page template, then redirect to this\n\t$action = get_query_var ( 'sh_action' );\n\t$type = get_query_var ( 'sh_post_type' );\n\t\n\tif ($action == 'new') {\n\t\t$template = locate_template (array('edit/'.$type.'.php') );\n\t\tif ($template != '') {\n\t\t\tinclude ($template);\n\t\t}\n\t\treturn;\n\t} \n\telse if ($action == 'edit') {\n\t\t$template = locate_template ( array (\n\t\t\t\t'edit/' . $post->post_type . '-' . get_query_var ( 'sh_part' ) . '.php',\n\t\t\t\t'edit/' . $post->post_type . '.php' \n\t\t) );\n\t\tif ($template != '') {\n\t\t\tinclude ($template);\n\t\t}\n\t\treturn;\n\t} \n\telse if ($post) {\n\t\t$template = locate_template ( array (\n\t\t\t\t'content/page-' . $post->post_name . '.php',\n\t\t\t\t'content/' . $post->post_type . '.php' \n\t\t) );\n\t\t\n\t\tif ($template != '') {\n\t\t\tinclude ($template);\n\t\t\treturn;\n\t\t}\n\t}\n\t\n\t// otherwise, show the new post form and feed\n\tsh_post_form ();\n\tsh_topic_loop ();\n}" ]
[ "0.6876665", "0.6715176", "0.6695116", "0.6649986", "0.6545432", "0.64903384", "0.64685225", "0.64666253", "0.64147705", "0.6351862", "0.63496834", "0.6333934", "0.63307154", "0.6287345", "0.6248409", "0.62193114", "0.6218093", "0.6198959", "0.615997", "0.61590767", "0.6149651", "0.61423844", "0.613599", "0.61249", "0.61209327", "0.61209327", "0.61165327", "0.6108488", "0.6089224", "0.6080102", "0.606113", "0.60583484", "0.60500926", "0.6032063", "0.6027601", "0.6026512", "0.602066", "0.6018398", "0.6008636", "0.59965", "0.59902817", "0.5987919", "0.5984075", "0.5981301", "0.59751236", "0.597007", "0.59683037", "0.596746", "0.594677", "0.594677", "0.594677", "0.59461296", "0.5940705", "0.59399045", "0.5925431", "0.59155226", "0.59136194", "0.59117955", "0.59048915", "0.59048915", "0.59048915", "0.59048915", "0.59048915", "0.59048915", "0.5901417", "0.59010786", "0.5895463", "0.5890449", "0.58857864", "0.5876936", "0.5863951", "0.58607394", "0.5853607", "0.58464456", "0.5844121", "0.584022", "0.5838253", "0.58364516", "0.58232224", "0.58212125", "0.5817777", "0.58173865", "0.58173865", "0.58173865", "0.58173865", "0.58173865", "0.58173865", "0.58173865", "0.58173865", "0.58173865", "0.58173865", "0.58033913", "0.5799585", "0.579808", "0.5797294", "0.579725", "0.5795708", "0.57933366", "0.5778371", "0.5773744", "0.57713324" ]
0.0
-1
Substitui dados em uma string
public function replace($key,$value,$string){ return str_replace("::$key::",$value,$string); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function trataApostrofe($str){\n\t\t$result_subst = str_replace(\"\\'\", \"'\", $str);\n\t\t$result_subst = str_replace(\"'\", \"\\'\", $result_subst);\n\t\treturn $result_subst;\n\t}", "function trataApostrofeFromBD($str){\n\t\t$result_subst = str_replace(\"\\'\", \"'\", $str);\t\t\t\t\t\t\n\t\treturn $result_subst;\n\t}", "function trataApostrofeToBD($str){\n\t\t$result_subst = str_replace(\"\\'\", \"'\", $str);\t\t\t\t\t\t\n\t\t$result_subst = str_replace(\"'\", \"\\'\", $result_subst);\n\t\treturn $result_subst;\n\t}", "public function contentStrReplace() {}", "public static function sanearData($string){\n\n $string = trim($string);\n $string = self::unEspacio($string);\n $string = stripcslashes($string);\n $string = htmlspecialchars($string);\n\n $string = str_replace(\n array('á', 'à', 'ä', 'â', 'ª', 'Á', 'À', 'Â', 'Ä'),\n array('a', 'a', 'a', 'a', 'a', 'A', 'A', 'A', 'A'),\n $string\n );\n\n $string = str_replace(\n array('é', 'è', 'ë', 'ê', 'É', 'È', 'Ê', 'Ë'),\n array('e', 'e', 'e', 'e', 'E', 'E', 'E', 'E'),\n $string\n );\n\n $string = str_replace(\n array('í', 'ì', 'ï', 'î', 'Í', 'Ì', 'Ï', 'Î'),\n array('i', 'i', 'i', 'i', 'I', 'I', 'I', 'I'),\n $string\n );\n\n $string = str_replace(\n array('ó', 'ò', 'ö', 'ô', 'Ó', 'Ò', 'Ö', 'Ô'),\n array('o', 'o', 'o', 'o', 'O', 'O', 'O', 'O'),\n $string\n );\n\n $string = str_replace(\n array('ú', 'ù', 'ü', 'û', 'Ú', 'Ù', 'Û', 'Ü'),\n array('u', 'u', 'u', 'u', 'U', 'U', 'U', 'U'),\n $string\n );\n\n $string = str_replace(\n array('ñ', 'Ñ', 'ç', 'Ç'),\n array('n', 'N', 'c', 'C'),\n $string\n );\n\n //Esta parte se encarga de eliminar cualquier caracter extraño\n $string = str_replace(\n array(\"\\\\\", \"¨\", \"º\", \"~\",\"'\",\n \"#\", \"|\", \"!\", \"\\\"\",\n \"·\", \"$\", \"%\", \"&\",\n \"(\", \")\", \"?\", \"'\", \"¡\",\n \"¿\", \"[\", \"^\", \"`\", \"]\",\n \"+\", \"}\", \"{\", \"¨\", \"´\",\n \">\", \"< \", \";\", \",\", \":\",\"/\",\"*\"\n ),\n '',\n $string\n );\n return $string;\n }", "function reemplazar_comillas($string){\n\t$string = str_replace (\"'\", \"\\\"\", $string);\n\t$string = str_replace ('\"', '\\\"', $string);\n\t$string = str_replace (\"\\'\", \"\\\"\", $string);\n\t$string = str_replace ('\\\"', '\\\"', $string);\n\t\n\treturn $string;\n}", "function limpiar($cadena){\n\t\t$cadena=str_replace(\"_\",\" \",$cadena);//alt + 15\n\t\t$cadena=str_replace(\"|\",\"=\",$cadena);//alt + 10\n\t\treturn $cadena=str_replace(\"*\",\"'\",$cadena);//alt + 16\n\t}", "function replaceTargetedStrings($data){\r\n\tglobal $logfile;\r\n\r\n\t//$blort = \"\\nreplaceTargetedStrings( '\" . $data . \"') \\n\";\r\n\r\n\t$data = str_replace(\"\\t\", \"\", $data);\r\n\t$data = str_replace(\" \", \"\", $data);\r\n\t$data = str_replace(\" \", \"\", $data);\r\n\t$data = str_replace(\" \", \"\", $data);\r\n\r\n/*\r\n\t\t//MarcEdit will choke on the < and > so we'd just have to replace them again anyway\r\n\t$data = str_replace(\"&lt;\", \"<\", $data);\r\n\t$data = str_replace(\"&gt;\", \">\", $data);\r\n*/\r\n\r\n\t$data = str_replace('\" content=\"', ' = ', $data);\r\n\t/*\r\n\t\t$blort .= \"\\nnow data ='\" . $data . \"'\\t\";\r\n\t\t$junkRep = str_replace(\"&lt;\", \"<\", $data);\r\n\t\t$blort .= \"if we do a replace it looks like '\" . $junkRep . \"'\\n\";\r\n\t\tappendFile($logfile, $blort);\r\n\t*/\r\n\r\n\treturn $data;\r\n}", "public function compileInsertString( $data );", "public function quoteInto($text, $data){ $count = substr_count($text, '?');\n if (! $count) {\n // no replacements needed\n return $text;\n }\n \n // only one replacement?\n if ($count == 1) {\n $data = $this->quote($data);\n $text = str_replace('?', $data, $text);\n return $text;\n }\n \n // more than one replacement; force values to be an array, then make \n // sure we have enough values to replace all the placeholders.\n settype($data, 'array');\n if (count($data) < $count) {\n // more placeholders than values\n throw $this->_exception('ERR_NOT_ENOUGH_VALUES', array(\n 'text' => $text,\n 'data' => $data,\n ));\n }\n \n // replace each placeholder with a quoted value\n $offset = 0;\n foreach ($data as $val) {\n // find the next placeholder\n $pos = strpos($text, '?', $offset);\n if ($pos === false) {\n // no more placeholders, exit the data loop\n break;\n }\n \n // replace this question mark with a quoted value\n $val = $this->quote($val);\n $text = substr_replace($text, $val, $pos, 1);\n \n // update the offset to move us past the quoted value\n $offset = $pos + strlen($val);\n }\n \n return $text;\n }", "function cls_string($mensaje){\n\t/*$mensaje=str_replace(array(\"'\",\"\\\\\",\"\\\"\",\"'\",\"�\",\"�\",\"\\'\"),\"\",$mensaje);\n\t$mensaje=$mensaje;/**/\n\treturn $mensaje;\n}", "function cls_string($mensaje){\n\t/*$mensaje=str_replace(array(\"'\",\"\\\\\",\"\\\"\",\"'\",\"�\",\"�\",\"\\'\"),\"\",$mensaje);\n\t$mensaje=$mensaje;/**/\n\treturn $mensaje;\n}", "function replace($template,$_DICTIONARY){\n\t\tforeach ($_DICTIONARY as $clave=>$valor) {\n\t\t\t$template = str_replace('#'.$clave.'#', $valor, $template);\n\t\t}\t\t\n\t\treturn $template;\n\t}", "function escreverTexto($sText) {\n\n /**\n * Aplicando negrito\n */\n $sText = str_replace(\"<b>\", chr(27) . chr(69), $sText);\n $sText = str_replace(\"</b>\", chr(27) . chr(70), $sText);\n /**\n * Aplicando italico\n */\n $sText = str_replace(\"<i>\", chr(27) . chr(52), $sText);\n $sText = str_replace(\"</i>\", chr(27) . chr(53), $sText);\n /**\n * Aplicando sublinhado\n */\n $sText = str_replace(\"<s>\", chr(27) . chr(45) . \"1\", $sText);\n $sText = str_replace(\"</s>\", chr(27) . chr(45) . \"0\", $sText);\n \n // $sText = $this->truncarLinhas($sText,48);\n $sText = $this->strToAsc($sText);\n \n $sComando = chr(27) . str_replace(\"\\n\", chr(10), $sText);\n parent::addComando($sComando);\n \n }", "function formataData($data){\n\t$vdatahora = explode(\" \", $data);\n\t$vdatasemformato = $vdatahora[0];\n\t$vhora = $vdatahora[1];\n\t\n\t$vdata = explode(\"-\", $vdatasemformato);\n\t$data_formatada = $vdata[2] .\"/\". $vdata[1] .\"/\". $vdata[0];\n\treturn $data_formatada;\n}", "function virgule($nombre)\n{\n\t$nombre = preg_replace('#(.+),(.+)#','$1.$2',$nombre);\n\treturn $nombre;\n}", "function joinStr($str, $args){\n\t//$str = '將在%{level}級時解鎖%{name}';\n\tif(preg_match_all(\"/\\%{([\\d\\w\\_]+)}/\", $str, $match)){\n\t\t$r = [];\n\t\t$_args = [];\n\t\tforeach($match[1] as $_m){\n\t\t\t//$r[] = '\".@$args[\"'.$_m.'\"].\"';\n\t\t\t$r[] = \"%s\";\n\t\t\t$_args[] = $args[$_m];\n\t\t}\n\t\t$s = str_replace($match[0], $r, $str);\n\t\t$str = vsprintf($s, $_args);\n\t\t//var_dump(eval('$str = '.$s.';'));\n\t\t//var_dump($str);\n\t\treturn $str;\n\t}else{\n\t\treturn $str;\n\t}\n}", "function hydrate($text, $map = null) {\n if(!$map || !is_array($map)) {\n $map = array();\n }\n\n foreach($map as $from => $to) {\n $text = str_replace($from, $to, $text);\n }\n return $text;\n}", "private function resaltar($buscar, $texto, $clase='')\n {\n $class = ($clase) ? \"class=\\\"$clase\\\"\" : \"style=\\\"background-color: yellow; color: red;\\\"\";\n $clave = explode(\" \", $buscar);\n $num = count($clave);\n for($i=0; $i < $num; $i++)\n { \n $clave[$i] = preg_replace('/(a|A|á|Á|à|À|ä|Ä)/', '(a|A|á|Á|à|À|ä|Ä)', $clave[$i]);\n $clave[$i] = preg_replace('/(e|E|é|É|è|È|ë|Ë)/', '(e|E|é|É|è|È|ë|Ë)', $clave[$i]);\n $clave[$i] = preg_replace('/(i|I|í|Í|ì|Ì|ï|Ï)/', '(i|I|í|Í|ì|Ì|ï|Ï)', $clave[$i]);\n $clave[$i] = preg_replace('/(o|O|ó|Ó|ò|Ò|ö|Ö)/', '(o|O|ó|Ó|ò|Ò|ö|Ö)', $clave[$i]);\n $clave[$i] = preg_replace('/(u|U|ú|Ú|ù|Ù|ü|Ü)/', '(u|U|ú|Ú|ù|Ù|ü|Ü)', $clave[$i]);\n $clave[$i] = preg_replace('/(ñ|Ñ)/', '(ñ|Ñ)', $clave[$i]);\n $texto = preg_replace(\"/(\".trim($clave[$i]).\")/Ui\", \"<span $class>\\\\1</span>\" , $texto);\n }\n return $texto;\n }", "function cmfcString_replaceVariables($replacements,$text) {\n\t\tforeach ($replacements as $needle=>$replacement) {\n\t\t\t$text=str_replace($needle,$replacement,$text);\n\t\t}\n\t\treturn $text;\n\t}", "function filtrarSql($valor) {\n\n $valor = str_replace(\"'\", \"\\'\", $valor);\n $valor = str_replace('\"', '\\\"', $valor);\n return $valor;\n}", "function espacio_guion($dato) {\n $dato = str_replace(' ', '_', $dato);\n return $dato;\n}", "function dinheiroDeBr($valor) {\n\t$valor = str_ireplace(\".\",\"\",$valor);\n $valor = str_ireplace(\",\",\".\",$valor);\n return $valor;\n}", "function format($text, $data) {\n foreach ($data as $wildcard => $value) {\n $text = str_replace($wildcard, $value, $text);\n }\n \n // fix lost blanks in js (excluding blanks between html tags)\n $text = preg_replace('/(?!(?:[^<]+>|[^>]+<\\/(.*)>))( )/', '&nbsp;', $text);\n \n return $text;\n }", "function setMailContent($data, $content)\n{\n\t$result=$content;\n\tif($data['0']!='')\n\t\t$result = str_replace('{fname}', $data['0'], $result);\n\tif($data['1']!='')\n\t\t$result = str_replace('{username}', $data['1'], $result);\n\tif($data['2']!='')\n\t\t$result = str_replace('{password}', $data['2'], $result);\n\t//echo $result;\t\n\treturn $result;\n}", "function translate_replace($params){\n $string = array_shift($params);\n foreach ($params as $value){\n $replace[] = $value;\n }\n return XT::translate_replace($string, $replace);\n}", "static function Sustituto_Cadena($rb){\n $rb = str_replace(\"á\", \"&aacute;\", $rb);\n $rb = str_replace(\"é\", \"&eacute;\", $rb);\n $rb = str_replace(\"®\", \"&reg;\", $rb);\n $rb = str_replace(\"í\", \"&iacute;\", $rb);\n $rb = str_replace(\"�\", \"&iacute;\", $rb);\n $rb = str_replace(\"ó\", \"&oacute;\", $rb);\n $rb = str_replace(\"ú\", \"&uacute;\", $rb);\n $rb = str_replace(\"n~\", \"&ntilde;\", $rb);\n $rb = str_replace(\"º\", \"&ordm;\", $rb);\n $rb = str_replace(\"ª\", \"&ordf;\", $rb);\n $rb = str_replace(\"á\", \"&aacute;\", $rb);\n $rb = str_replace(\"ñ\", \"&ntilde;\", $rb);\n $rb = str_replace(\"Ñ\", \"&Ntilde;\", $rb);\n $rb = str_replace(\"ñ\", \"&ntilde;\", $rb);\n $rb = str_replace(\"n~\", \"&ntilde;\", $rb);\n $rb = str_replace(\"Ú\", \"&Uacute;\", $rb);\n return $rb;\n }", "function to_html($cadena){\n $busqueda = array(\"á\",\"é\",\"í\",\"ó\",\"ú\",\"Á\",\"É\",\"Í\",\"Ó\",\"Ú\",\"ñ\",\"Ñ\",\"¿\");\n $reemplazo= array(\"&aacute;\",\"&eacute;\",\"&iacute;\",\"&oacute;\",\"&uacute;\",\"&Aacute;\",\"&Eacute;\",\"&Iacute;\",\"&Oacute;\",\"&Uacute;\",\n \"&ntilde;\",\"&Ntilde;\",\"&#191;\");\n $resultado = str_replace($busqueda, $reemplazo, $cadena);\n return $resultado;\n}", "function quitar_tildes($cadena) {\r\n $no_permitidas = array (\"à\",\"á\",\"é\",\"í\",\"ó\",\"ú\",\"Á\",\"É\",\"Í\",\"Ó\",\"Ú\",\"À\",\"Ì\",\"Ò\",\"Ù\");\r\n $permitidas = array (\"a\",\"a\",\"e\",\"i\",\"o\",\"u\",\"A\",\"E\",\"I\",\"O\",\"U\",\"A\",\"I\",\"O\",\"U\");\r\n $texto = str_replace($no_permitidas, $permitidas ,$cadena);\r\n return $texto;\r\n }", "private function setToData()\n {\n if($this->getTos()){\n $toArray = [];\n foreach($this->getTos() as $to){\n $toArray[] = $this->setEmailNameString($to['email'], $to['name']);\n } \n\n return implode(',', $toArray); \n }\n \n return '';\n }", "function change_tags($str){\r\n\r\n\t\t\t$str=str_replace('#ID#',$this->id,$str);\r\n\t\t\t$str=str_replace('#PAGE#',$this->page,$str);\r\n\t\t\t$str=str_replace('#ITEMS_PER_PAGE#',$this->items_per_page,$str);\r\n\t\t\t$str=str_replace('#TOTAL_ITEMS#',$this->total_items,$str);\r\n\r\n\t\t\treturn $str;\r\n\r\n\t}", "function limpiar($value){\r\n\t\t$value=str_replace(\"'\",\"\",$value);\r\n\t\t$value=str_replace(\";\",\"\",$value);\r\n\t\t$value=str_replace(\"&\",\"\",$value);\r\n\t\t$value=str_replace(\"SELECT\",\"\",$value);\r\n\t\t$value=str_replace(\"DELETE\",\"\",$value);\r\n\t\t$value=str_replace(\"UPDATE\",\"\",$value);\r\n\t\t$value=str_replace(\"INSERT\",\"\",$value);\r\n\t\t$value=str_replace(\"DROP\",\"\",$value);\r\n\t\t\r\n\t\t\r\n\t\t$value = trim(htmlentities($value)); // Evita introducción código HTML\r\n\t\t\r\n\t\tif (get_magic_quotes_gpc()) {\t// quita los caracteres escapados\r\n\t\t\t$value = stripslashes($value);\r\n\t\t}\r\n\t\treturn $value;\r\n\t}", "public function getAsciiReplace();", "protected function _stringData(&$data) \n\t{\n\t\tforeach ($data as $key => $value) {\n\t\t\tif (gettype($value) == 'string') {\n\t\t\t\t$data[$key] = \"'\".$value.\"'\";\n\t\t\t}\n\t\t}\n\t}", "function fairecarte($latitude,$longitude){\n $content=file_get_contents(template_carte);\n $content = str_replace('###longitude###',$longitude,$content);\n $content = str_replace('###latitude###',$latitude,$content);\n return $content;\n}", "private function makeEscapedString() {\n\t\t# -- so, call this function after makeConnection() called -- #\n\t\t\n\t\ttry {\n\t\t\t$this->_code = $this->_mysqli->real_escape_string($this->_code);\n\t\t\t$this->_name = $this->_mysqli->real_escape_string($this->_name);\n\t\t\t$this->_description = $this->_mysqli->real_escape_string($this->_description);\n\t\t\t$this->_color = $this->_mysqli->real_escape_string($this->_color);\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t# do nothing\n\t\t}\n\t\t\n\t}", "function formatear_mes($parametro){\n\n\t\t/* Declaro variables personalizadas para que queden claros los datos */\n\t\t$mes = substr($parametro, 5, 2);\n\t\t$anno = substr($parametro, 0, 4);\n\t\t\n\t\t/* Generamos el formato */\n\t\t$temp = $mes.\"/\".$anno;\n\t\t\n\t\treturn $temp;\n\t}", "function formataDataBanco($data){\t\n\t$vdata = explode(\"/\", $data);\n\t$data_formatada = $vdata[2] .\"-\". $vdata[1] .\"-\". $vdata[0];\n\treturn $data_formatada;\n}", "function buscaData($data_agend){\n # ($calendario)\";\n # $data_agend = \"SELECT data_agend FROM Agendamento\";\n\n $dia = substr($data_agend, 0, 2);\n $mes = substr($data_agend, 3, 2);\n $ano = substr($data_agend, 6, 4);\n\n $result = $ano . \"-\" . $mes . \"-\" . $dia;\n return $result;\n}", "public function replaceParameter($data) {\n\t\t$data = trim($data);\n\n\t\t// apply stripslashes to pevent double escape if magic_quotes_gpc is enabled\n\t\tif(get_magic_quotes_gpc())\n\t\t{\n\t\t\t$data = stripslashes($data);\n\t\t}\n\t\treturn $data;\n\t}", "protected static function stringFormat($valor)\n {\n $alias = $valor;\n // return $alias;\n $table = array(\n 'Š'=>'S', 'š'=>'s', 'Đ'=>'Dj', 'đ'=>'dj', 'Ž'=>'Z', 'ž'=>'z', 'Č'=>'C', 'č'=>'c', 'Ć'=>'C', 'ć'=>'c',\n 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E',\n 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O',\n 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss',\n 'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e',\n 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o',\n 'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'ý'=>'y', 'þ'=>'b',\n 'ÿ'=>'y', 'Ŕ'=>'R', 'ŕ'=>'r', '/' => '-', 'º' => ''\n );\n\n $stripped = preg_replace(array('/\\s{2,}/', '/[\\t\\n]/'), ' ', $alias);\n $retorno = strtolower(strtr($alias, $table));\n return $retorno;\n }", "public function compileInsertString( $data )\n {\n \t$field_names\t= \"\";\n\t\t$field_values\t= \"\";\n\n\t\tforeach( $data as $k => $v )\n\t\t{\n\t\t\t$add_slashes = 1;\n\t\t\t\n\t\t\tif ( $this->manual_addslashes )\n\t\t\t{\n\t\t\t\t$add_slashes = 0;\n\t\t\t}\n\t\t\t\n\t\t\tif ( !empty($this->no_escape_fields[ $k ]) )\n\t\t\t{\n\t\t\t\t$add_slashes = 0;\n\t\t\t}\n\t\t\t\n\t\t\tif ( $add_slashes )\n\t\t\t{\n\t\t\t\t$v = $this->addSlashes( $v );\n\t\t\t}\n\t\t\t\n\t\t\t$field_names .= $this->fieldNameEncapsulate . \"$k\" . $this->fieldNameEncapsulate . ',';\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Forcing data type?\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif ( substr( $v, -1 ) == '\\\\' )\n\t\t\t{\n\t\t\t\t$v = preg_replace( '#\\\\\\{1}$#', '&#92;', $v );\n\t\t\t}\n\t\t\t\t\t\n\t\t\tif ( !empty($this->_dataTypes[ $k ]) )\n\t\t\t{\n\t\t\t\tif ( $this->_dataTypes[ $k ] == 'string' )\n\t\t\t\t{\n\t\t\t\t\t$field_values .= $this->fieldEncapsulate . $v . $this->fieldEncapsulate . ',';\n\t\t\t\t}\n\t\t\t\telse if ( $this->_dataTypes[ $k ] == 'int' )\n\t\t\t\t{\n\t\t\t\t\t$field_values .= intval($v).\",\";\n\t\t\t\t}\n\t\t\t\telse if ( $this->_dataTypes[ $k ] == 'float' )\n\t\t\t\t{\n\t\t\t\t\t$field_values .= floatval($v).\",\";\n\t\t\t\t}\n\t\t\t\tif ( $this->_dataTypes[ $k ] == 'null' )\n\t\t\t\t{\n\t\t\t\t\t$field_values .= \"NULL,\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// No? best guess it is then..\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( is_numeric( $v ) and strcmp( intval($v), $v ) === 0 )\n\t\t\t\t{\n\t\t\t\t\t$field_values .= $v.\",\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$field_values .= $this->fieldEncapsulate . $v . $this->fieldEncapsulate . ',';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$field_names = rtrim( $field_names, \",\" );\n\t\t$field_values = rtrim( $field_values, \",\" );\n\t\n\t\treturn array( 'FIELD_NAMES' => $field_names,\n\t\t\t\t\t 'FIELD_VALUES' => $field_values,\n\t\t\t\t\t);\n\t}", "function setSequrity($data){\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function replace_specialChar($vTitle) {\r\n $rs_catname = $vTitle;\r\n $spstr = \"�#�#�#�#�#�#�#�#�#�#�#�#�#�#�##�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�\";\r\n $spArr = @explode(\"#\", $spstr);\r\n $i = 0;\r\n foreach ($spArr as $arr) {\r\n $rs_catname = str_replace($arr, \"-\", $rs_catname);\r\n $i++;\r\n }\r\n //print_r($rs_catname);exit;\r\n $rs_catname = str_replace(\"#\", \"-\", $rs_catname);\r\n $rs_catname = str_replace(\" \", \"-\", str_replace(\"&\", \"and\", $rs_catname));\r\n return $rs_catname;\r\n}", "public function elaboraStringa( $stringa );", "function replace($x) {\n\t$k1=array(' - ','ß','ä','ö','ü','Ä','Ö','Ü',' ',':','&','?','!','\"',',','.',\"\\'\",\"/\");\n\t$k2=array('-','ss','ae','oe','ue','ae','oe','ue','-','-','und','','','','','',\"\",\"-\");\n\tfor ($i='0';$i<count($k1);$i++) {$x = str_replace($k1[$i],$k2[$i],$x);}\n\treturn $x;\n}", "function normalizarCodificacionPlaneServicios($cadenaBusqueda,$cadenaReemplazo) {\n\t\t// Busca y reemplaza ocurrencias en una tabla\n\t\t\t$cnx= conectar_postgres();\n\t\t\t$cons = \"UPDATE ContratacionSalud.PlaneServicios SET nombreplan = replace( nombreplan,'$cadenaBusqueda','$cadenaReemplazo')\";\n\t\t\t\n\t\t\t$res = pg_query($cnx , $cons);\n\t\t\t\tif (!$res) {\n\t\t\t\t\techo \"<p class='error1'> Error en la normalizacion de la codificacion </p>\".pg_last_error().\"<br>\";\n\t\t\t\t\techo \"<p class= 'subtitulo1'>Comando SQL </p> <br>\".$consUTF8.\"<br/> <br/> <br/>\"; \n\t\t\t\t}\n\n\t\t}", "function replaceVariables($replacements,$text) {\n\t\tforeach ($replacements as $needle=>$replacement) {\n\t\t\t$text=str_replace($needle,$replacement,$text);\n\t\t}\n\t\treturn $text;\n\t}", "function decortique($data) {\r\n\t\t$taille =\r\n\t\t$ptiBout = explode(' ', $data[0]);\r\n\t\t$appelation[0] = ''; $appelation[1] = '';\r\n\r\n\t\t//Séparation Nom Prenom\r\n\t\t$i=0;\r\n\t\tforeach ($ptiBout as $bout) {\r\n\t\t\tif (lcfirst($bout) != mb_strtolower($bout, 'UTF-8')) {\r\n\t\t\t\tif ($appelation[0] != '') {\r\n\t\t\t\t\t$appelation[0] = $appelation[0] . ' ' . $bout;\r\n\t\t\t\t}\r\n\t\t\t\telse { $appelation[0] = $bout; }\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif ($appelation[1] != '') {\r\n\t\t\t\t\t$appelation[1] = $appelation[1] . ' ' . $bout;\r\n\t\t\t\t}\r\n\t\t\t\telse { $appelation[1] = $bout; }\r\n\t\t\t}\r\n\r\n\t\t\t$i++;\r\n\t\t}\r\n\r\n\t\t$appelation[2] = $data[1];\r\n\r\n\t\treturn $appelation;\r\n\t}", "static function descodificarTexto($texto) {\n $buscar = array(\"Á\", \"É\", \"Í\", \"Ó\", \"Ú\", \"á\", \"é\", \"í\", \"ó\", \"ú\", \"ñ\", \"Ñ\", \"\\\"\");\n $reemplazar = array(\"&Aacute;\", \"&Eacute;\", \"&Iacute;\", \"&Oacute;\", \"&Uacute;\", \"&aacute;\", \"&eacute;\", \"&iacute;\", \"&oacute;\", \"&uacute;\", \"&Ntilde;\", \"&ntilde;\", \"&quot;\");\n return str_replace($buscar, $reemplazar, $texto);\n }", "public static function limpiarCadena($valor) {\r\n $valor=addslashes($valor);\r\n $valor = str_ireplace(\"<script>\", \"\", $valor);\r\n $valor = str_ireplace(\"</script>\", \"\", $valor);\r\n $valor = str_ireplace(\"SELECT * FROM\", \"\", $valor);\r\n $valor = str_ireplace(\"DELETE FROM\", \"\", $valor);\r\n $valor = str_ireplace(\"UPDATE\", \"\", $valor);\r\n $valor = str_ireplace(\"INSERT INTO\", \"\", $valor);\r\n $valor = str_ireplace(\"DROP TABLE\", \"\", $valor);\r\n $valor = str_ireplace(\"TRUNCATE TABLE\", \"\", $valor);\r\n $valor = str_ireplace(\"--\", \"\", $valor);\r\n $valor = str_ireplace(\"^\", \"\", $valor);\r\n $valor = str_ireplace(\"[\", \"\", $valor);\r\n $valor = str_ireplace(\"]\", \"\", $valor);\r\n $valor = str_ireplace(\"\\\\\", \"\", $valor);\r\n $valor = str_ireplace(\"=\", \"\", $valor);\r\n return $valor;\r\n }", "function converte_data_br($data) {\n\t\t\t$hora = '';\n\t\t\n\t\t\tif (strstr($data, ' ')) {\n\t\t\t\t$data = explode(' ', $data);\n\t\t\n\t\t\t\t$hora = $data[1];\n\t\t\t\t$data = $data[0];\n\t\t\t}\n\t\t\n\t\t\t/*\n\t\t\t * Reorganiza a data para ficar\n\t\t\t * no padrão americano.\n\t\t\t * yyyy-mm-dd hh:mm:ss\n\t\t\t */\n\t\t\t$data = explode('-', $data);\n\t\t\t$data = array_reverse($data);\n\t\t\t$data = implode('/',$data);\n\t\t\n\t\t\t/*\n\t\t\t * Se a data possui hora,\n\t\t\t * a função retorna a data e hora.\n\t\t\t * Caso não exista hora,\n\t\t\t * retorna apenas a data\n\t\t\t*/\n\t\t\tif ($hora != '') {\n\t\t\t\treturn $data . ' ' . $hora;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t\n\t\t}", "function replace($table, $data, $format = null){\n\t\treturn $this->_insert_replace_helper($table, $data, $format, 'REPLACE');\n\t}", "static function cleanString($cadena) {\n\n\t\t//$cade = utf8_decode($cadena);\n\n\t\t$no_permitidas= array (\"á\",\"é\",\"í\",\"ó\",\"ú\",\"Á\",\"É\",\"Í\",\"Ó\",\"Ú\",\"ñ\",\"À\",\"Ã\",\"Ì\",\"Ò\",\"Ù\",\"Ù\",\"à \",\"è\",\"ì\",\"ò\",\"ù\",\"ç\",\"Ç\",\"â\",\"ê\",\"î\",\"ô\",\"û\",\"Â\",\"Ê\",\"ÃŽ\",\"Ô\",\"Û\",\"ü\",\"ö\",\"Ö\",\"ï\",\"ä\",\"«\",\"Ò\",\"Ï\",\"Ä\",\"Ë\");\n\t\t$permitidas= array (\"a\",\"e\",\"i\",\"o\",\"u\",\"A\",\"E\",\"I\",\"O\",\"U\",\"n\",\"N\",\"A\",\"E\",\"I\",\"O\",\"U\",\"a\",\"e\",\"i\",\"o\",\"u\",\"c\",\"C\",\"a\",\"e\",\"i\",\"o\",\"u\",\"A\",\"E\",\"I\",\"O\",\"U\",\"u\",\"o\",\"O\",\"i\",\"a\",\"e\",\"U\",\"I\",\"A\",\"E\");\n\t\t\n\t\t$texto = str_replace($no_permitidas, $permitidas ,$cadena);\n\t\treturn $texto;\n\t}", "function formataDataHora($data){\n\t$vdatahora = explode(\" \", $data);\n\t$vdatasemformato = $vdatahora[0];\n\t$vhora = $vdatahora[1];\n\t\n\t$vdata = explode(\"-\", $vdatasemformato);\n\t$data_formatada = $vdata[2] .\"/\". $vdata[1] .\"/\". $vdata[0];\n\treturn $data_formatada .\" \". $vhora;\n}", "function subraya($text){\r\n return \"<u>$text</u>\";\r\n }", "public function compileUpdateString( $data );", "function escape_data($data) {\n\n\tif (ini_get('magic_quotes_gpc')) {\t# Controllo se è attivata la modaltà Magic Quotes (che immette dei caratteri \"|\" prima di eventuali apici\n\t\t$data=stripslashes($data);\t# Tolgo i caratteri \"|\" inseriti da Magic Quotes con la funzione stripslashes\n\t\t}\n\treturn $data; # Ritorno la stringa formattata correttamente\n\t}", "function format_data( $data ) {\n\tif ( ! is_array( $data ) ) {\n\t\t$data = explode( ',', $data );\n\t}\n\t$data_count = count( $data );\n\tfor ( $i = 0; $i < $data_count; $i++ ) {\n\t\t$text = remove_nonalphanum( $data[ $i ] );\n\t\t$data[ $i ] = $text;\n\t}\n\t$value = implode( '', $data );\n\tif ( count( $data ) > 1 ) {\n\t\t$value = implode( ',', $data );\n\t}\n\treturn $value;\n}", "private function _prepareUpdateString($data) {\n /**\n * @ Incoming $data looks like:\n * $data = array('field' => 'value', 'field2'=> 'value2');\n */\n $fieldDetails = NULL;\n foreach ($data as $key => $value) {\n $fieldDetails .= \"$key=:$key, \";/** Notice the space after the comma */\n }\n $fieldDetails = rtrim($fieldDetails, ', ');/** Notice the space after the comma */\n return $fieldDetails;\n }", "public function db_update_string()\n {\n $key = $this->key;\n $value = $this->value;\n $string = $key . \" = \\\"\" . addslashes($value) . \"\\\",\";\n return $string;\n }", "function zastita_podataka_u_nizu(&$data){\n global $con;\n $data = htmlentities(strip_tags(mysqli_real_escape_string($con, $data)));\n}", "protected function _setTextString($key, $value, $encoding) {}", "function js_string($mensaje,$comillas=0){\n\t$mensaje=str_replace(chr(13),' ',str_replace(chr(10),' ',$mensaje));\n\tif($comillas==1) $mensaje=str_replace(\"'\",\"\\'\",$mensaje);\n\tif($comillas==2) $mensaje=str_replace('\"','\\\"',$mensaje);\n\treturn $mensaje;\n}", "function js_string($mensaje,$comillas=0){\n\t$mensaje=str_replace(chr(13),' ',str_replace(chr(10),' ',$mensaje));\n\tif($comillas==1) $mensaje=str_replace(\"'\",\"\\'\",$mensaje);\n\tif($comillas==2) $mensaje=str_replace('\"','\\\"',$mensaje);\n\treturn $mensaje;\n}", "function zuiver($tekst)\r\n{\r\n\t$voor = '\"' ;\r\n\t$na = \"&quot;\";\r\n\t$tekst = str_replace($voor, $na, $tekst);\r\n\t$voor = \"'\" ;\r\n\t$na = \"`\";\r\n\t$tekst = str_replace($voor, $na, $tekst);\r\n\t$tekst = strip_tags($tekst);\r\n\t$tekst = stripslashes($tekst);\r\n\t$tekst = htmlentities($tekst);\r\n\treturn $tekst;\r\n}", "public function insertEscaped(...$field_values);", "public function reemplazar($antiguo, $nuevo, $donde)\n\t\t{\n\t\t\treturn str_replace($antiguo, $nuevo, $donde);\n\t\t}", "function cleanData(&$str)\n {\n // handling karakter tab\n $str = preg_replace(\"/\\t/\", \"\\\\t\", $str);\n\n // handling karakter enter\n $str = preg_replace(\"/\\r?\\n/\", \"\\\\n\", $str);\n\n // convert 't' and 'f' menjadi nilai boolean\n if($str == 't') $str = 'TRUE';\n if($str == 'f') $str = 'FALSE';\n\n // handle karakter doubel quotes\n if(strstr($str, '\"')) $str = '\"' . str_replace('\"', '\"\"', $str) . '\"';\n }", "function createFieldString($tablas, $campos, $valores){\n\t\tglobal $formatedFields, $formatedValueConstrains,$misCampos;\n\t\t$i = 0;\n\n\t\tforeach ($valores as $key => $value) {\n\t\t\tif(empty($value)){\n\t\t\t\t$formatedFields[] = $tablas[$i].\".\".$campos[$i];\n\t\t\t\t$misCampos[] = $campos[$i];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$formatedValueConstrains[] = $tablas[$i].\".\".$campos[$i].\"='\".$valores[$i].\"'\";\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\n\t}", "function createFieldString($tablas, $campos, $valores){\n\t\tglobal $formatedFields, $formatedValueConstrains,$misCampos;\n\t\t$i = 0;\n\n\t\tforeach ($valores as $key => $value) {\n\t\t\tif(empty($value)){\n\t\t\t\t$formatedFields[] = $tablas[$i].\".\".$campos[$i];\n\t\t\t\t$misCampos[] = $campos[$i];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$formatedValueConstrains[] = $tablas[$i].\".\".$campos[$i].\"='\".$valores[$i].\"'\";\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\n\t}", "function t($line, $aReplaceData = array()) {\n $CI = &get_instance();\n $language\t\t=\ts('current_language') ? s('current_language') : 'english';\n \n $sString = ($t = $CI->lang->line($line, $language)) ? $t : $line;\n \n \n //check if there is any data to insert into the string\n if($aReplaceData) {\n// \tp('HERE 1 ');\n// \tp($sString);\n// \tp($aReplaceData);\n//\t\tp(vsprintf($sString, $aReplaceData));\n\t\t\n\t\treturn vsprintf($sString, $aReplaceData);\n \t\n } else {\n \t\n \treturn $sString;\n }\n \n}", "public function prepare() {\n\t\t$args = func_get_args();\n\t\tfor ($i = 1; $i < func_num_args(); ++$i) {\n\t\t\t$args[$i] = $this->escape($args[$i]);\n\t\t}\n\t\t\n\t\treturn call_user_func_array('sprintf', $args);\n\t}", "function traducirHTML($cad){\n $cad=htmlspecialchars_decode($cad);\n $esp=array('&nbsp;','&Aacute;','&Auml;','&Ccaron;','&Dcaron;','&Eacute;','&Lacute;','&Lcaron;','&Ncaron;','&Oacute;','&Ocirc;','&Racute;','&Scaron;','&Tcaron;','&Uacute;','&Yacute;','&Zcaron;','&aacute;','&auml;','&ccaron;','&dcaron;','&eacute;','&lacute;','&lcaron;','&ncaron;','&oacute;','&ocirc;','&racute;','&scaron;','&tcaron;','&uacute;','&yacute;','&zcaron;','&Iacute;','&iacute;');\n $sust=array(' ','Á','Ä','Č','Ď','É','Ĺ','Ľ','Ň','Ó','Ô','Ŕ','Š','Ť','Ú','Ý','Ž','á','ä','č','ď','é','ĺ','ľ','ň','ó','ô','ŕ','š','ť','ú','ý','ž','Í','í');\n return str_replace($esp,$sust,$cad);\n}", "function traducirHTML($cad){\n $cad=htmlspecialchars_decode($cad);\n $esp=array('&nbsp;','&Aacute;','&Auml;','&Ccaron;','&Dcaron;','&Eacute;','&Lacute;','&Lcaron;','&Ncaron;','&Oacute;','&Ocirc;','&Racute;','&Scaron;','&Tcaron;','&Uacute;','&Yacute;','&Zcaron;','&aacute;','&auml;','&ccaron;','&dcaron;','&eacute;','&lacute;','&lcaron;','&ncaron;','&oacute;','&ocirc;','&racute;','&scaron;','&tcaron;','&uacute;','&yacute;','&zcaron;','&Iacute;','&iacute;');\n $sust=array(' ','Á','Ä','Č','Ď','É','Ĺ','Ľ','Ň','Ó','Ô','Ŕ','Š','Ť','Ú','Ý','Ž','á','ä','č','ď','é','ĺ','ľ','ň','ó','ô','ŕ','š','ť','ú','ý','ž','Í','í');\n return str_replace($esp,$sust,$cad);\n}", "protected function replaceVariable($matches) {\n\t\tif (preg_match(\"/^\\d+$/\", $matches[1])) {\n\t\t\t$id = (int)$matches[1];\n\t\t\t$data = $this->simu->getDataById($id);\n\t\t} else {\n\t\t\t$name = $matches[1];\n\t\t\t$data = $this->simu->getDataByName($name);\n\t\t}\n\t\tif ($data === null) {\n\t\t\treturn $matches[0];\n\t\t}\n\t\tif ($matches[2] == 'L') {\n\t\t\t$value = $data->getChoiceLabel();\n\t\t\tif ($data->getType() == 'multichoice') {\n\t\t\t\t$value = implode(',', $value);\n\t\t\t}\n\t\t\treturn $value;\n\t\t} else {\n\t\t\t$value = $data->getValue();\n\t\t\tswitch ($data->getType()) {\n\t\t\t\tcase 'money':\n\t\t\t\t\t$value = NumberFunction::formatNumber((float)$value, 2, $this->simu->getDecimalPoint(), $this->simu->getGroupingSeparator(), $this->simu->getGroupingSize());\n\t\t\t\tcase 'percent':\n\t\t\t\tcase 'number':\n\t\t\t\t\t$value = str_replace('.', $this->simu->getDecimalPoint(), $value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'array':\n\t\t\t\tcase 'multichoice':\n\t\t\t\t\t$value = implode(',', $value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'text':\n\t\t\t\t\tif (preg_match('/^https?\\:\\/\\//', $value)) {\n\t\t\t\t\t\tif (preg_match('/(jpg|jpeg|gif|png|svg)$/i', $value)) {\n\t\t\t\t\t\t\t$value = '<img src=\"'.$value.'\" alt=\"'.$value.'\">';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$value = '<a href=\"'.$value.'\">'.$value.'</a>';\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif (preg_match('/^data\\:image\\//', $value)) {\n\t\t\t\t\t\t$value = '<img src=\"'.$value.'\" alt=\"*\">';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn $value;\n\t\t}\n\t}", "function limpiarData($data) {\n\t\t$data = trim($data);\n\t\t$data = stripslashes($data);\n\t\t$data = htmlspecialchars($data);\n\t\treturn $data;\n\t}", "private function quote( )\n {\n if ( @ count( $this->data_buffer ) == 0 )\n return;\n foreach ( $this->data_buffer as $key => $val )\n {\n if ( in_array( $key, $this->string_fields ))\n $this->data_buffer[$key] = @\"'\".mysql_real_escape_string($val,underQL::$db_handle).\"'\";\n else\n $this->data_buffer[$key] = $val;\n }\n }", "function intoStr($x){\n\t\t$txt=\"\";\n\t\t\tfor($i=0;$i<strlen($x);$i++){\n\t\t\t\tif($x[$i]==\"1\"){\n\t\t\t\t\t$txt.=\"satu\";\n\t\t\t\t}else if($x[$i]==\"2\"){\n\t\t\t\t\t$txt.=\"dua\";\n\t\t\t\t}else if($x[$i]==\"3\"){\n\t\t\t\t\t$txt.=\"tiga\";\n\t\t\t\t}else if($x[$i]==\"4\"){\n\t\t\t\t\t$txt.=\"empat\";\n\t\t\t\t}else if($x[$i]==\"5\"){\n\t\t\t\t\t$txt.=\"lima\";\n\t\t\t\t}else if($x[$i]==\"6\"){\n\t\t\t\t\t$txt.=\"enam\";\n\t\t\t\t}else if($x[$i]==\"7\"){\n\t\t\t\t\t$txt.=\"tujuh\";\n\t\t\t\t}else if($x[$i]==\"8\"){\n\t\t\t\t\t$txt.=\"delapan\";\n\t\t\t\t}else if($x[$i]=\"9\"){\n\t\t\t\t\t$txt.=\"sembilan\";\n\t\t\t\t}else{\n\t\t\t\t\t$txt.=\"nol\";\n\t\t\t\t}\n\t\t\t}\n\t\treturn $txt;\n\t}", "function TildesHtml($cadena)\n{\n return str_replace(array(\"á\", \"é\", \"í\", \"ó\", \"ú\", \"ñ\", \"Á\", \"É\", \"Í\", \"Ó\", \"Ú\", \"Ñ\"), array(\"&aacute;\", \"&eacute;\", \"&iacute;\", \"&oacute;\", \"&uacute;\", \"&ntilde;\",\n \"&Aacute;\", \"&Eacute;\", \"&Iacute;\", \"&Oacute;\", \"&Uacute;\", \"&Ntilde;\"), $cadena);\n}", "public function formate($message, array $content) {\n foreach ($content as $placeholder => $value) {\n\n $replacement['{' . $placeholder . '}'] = (string) $value;\n }\n\n return \\strtr($message, $replacement);\n }", "function euroRemove($con) {\n $sql=\"UPDATE prodotti SET prd_note = REPLACE(prd_note, '&euro;', '€') WHERE prd_note LIKE '%&euro;%'\";\n mysqli_query($con,$sql);\n}", "public function compileUpdateString( $data )\n\t{\n\t\t$return_string = \"\";\n\t\t\n\t\tforeach( $data as $k => $v )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Adding slashes?\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$add_slashes = 1;\n\t\t\t\n\t\t\tif ( $this->manual_addslashes )\n\t\t\t{\n\t\t\t\t$add_slashes = 0;\n\t\t\t}\n\t\t\t\n\t\t\tif ( !empty($this->no_escape_fields[ $k ]) )\n\t\t\t{\n\t\t\t\t$add_slashes = 0;\n\t\t\t}\n\t\t\t\n\t\t\tif ( $add_slashes )\n\t\t\t{\n\t\t\t\t$v = $this->addSlashes( $v );\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Forcing data type?\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif ( !empty($this->_dataTypes[ $k ]) )\n\t\t\t{\n\t\t\t\tif ( $this->_dataTypes[ $k ] == 'string' )\n\t\t\t\t{\n\t\t\t\t\tif ( substr( $v, -1 ) == '\\\\' )\n\t\t\t\t\t{\n\t\t\t\t\t\t$v = preg_replace( '#\\\\\\{1}$#', '&#92;', $v );\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t$return_string .= $k . '=' . $this->fieldEncapsulate . $v . $this->fieldEncapsulate . ',';\n\t\t\t\t}\n\t\t\t\telse if ( $this->_dataTypes[ $k ] == 'int' )\n\t\t\t\t{\n\t\t\t\t\tif ( strstr( $v, 'plus:' ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$return_string .= $k . \"=\" . $k . '+' . intval( str_replace( 'plus:', '', $v ) ).\",\";\n\t\t\t\t\t}\n\t\t\t\t\telse if ( strstr( $v, 'minus:' ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$return_string .= $k . \"=\" . $k . '-' . intval( str_replace( 'minus:', '', $v ) ).\",\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$return_string .= $k . \"=\" . intval($v) . \",\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if ( $this->_dataTypes[ $k ] == 'float' )\n\t\t\t\t{\n\t\t\t\t\t$return_string .= $k . \"=\" . floatval($v) . \",\";\n\t\t\t\t}\n\t\t\t\telse if ( $this->_dataTypes[ $k ] == 'null' )\n\t\t\t\t{\n\t\t\t\t\t$return_string .= $k . \"=NULL,\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// No? best guess it is then..\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( is_numeric( $v ) and strcmp( intval($v), $v ) === 0 )\n\t\t\t\t{\n\t\t\t\t\t$return_string .= $k . \"=\" . $v . \",\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ( substr( $v, -1 ) == '\\\\' )\n\t\t\t\t\t{\n\t\t\t\t\t\t$v = preg_replace( '#\\\\\\{1}$#', '&#92;', $v );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$return_string .= $k . '=' . $this->fieldEncapsulate . $v . $this->fieldEncapsulate . ',';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$return_string = rtrim( $return_string, \",\" );\n\n\t\treturn $return_string;\n\t}", "function xml_special_char($t_data){\n\n if(preg_match(\"/\\\"/\", $t_data)) str_replace(\"\\\"\", \"&quot\", $t_data);\n elseif(preg_match(\"/'/\", $t_data)) str_replace(\"\\'\", \"&quot\", $t_data);\n elseif(preg_match(\"/&/\", $t_data)) str_replace(\"&\", \"&amp\", $t_data);\n elseif(preg_match(\"/</\", $t_data)) str_replace(\"<\", \"&lt\", $t_data);\n elseif(preg_match(\"/>/\", $t_data)) str_replace(\">\", \"&gt\", $t_data);\n\n return $t_data;\n }", "function prepare_code($text) {\n $replace = array( '\\\"' => '&#34;','\"' => '&#34;', '<' => '&lt;', '>' => '&gt;', \"\\'\" => '&#39;', \"'\" => '&#39;' );\n return str_replace(array_keys($replace), array_values($replace),$text);\n}", "function BuscarStr($s) {\n\n $str = \" (s_usuarios.nombre ILIKE '%$s%' \";\n $str.= \" OR s_usuarios.usuario ILIKE '%$s%' )\";\n\n return $str;\n\n }", "function insertData($strInput)//Use In inserting or updating data into database\n{\n\t$strInput = addslashes(unconvertHTML($strInput));\n\treturn $strInput;\n}", "function retorno($nombre,$apellido)\n {\n if( is_string($nombre) && is_string($apellido) )\n {\n //filter_vars()\n $dame = $nombre. \"<br>\". $apellido;\n return $dame;\n }\n else\n {\n return \"Ingresaste mal los datos. tienen que ser caractéres alfabéticos\";\n }\n\n }", "function str_a_replace($array, $string) {\n foreach ($array as $from => $to)\n $string = str_replace($from, $to, $string);\n \n return $string;\n}", "public function setTexto($txt) {\n $this->texto = Funciones::gCodificar($txt);\n }", "private function getInsertString($data, $table) {\n $attr = '';\n $values = '';\n\n foreach ($data as $key => $val) {\n if ($val instanceof \\DateTime) {\n $val = $val->format('Y-m-d H:i:s');\n }\n if ($attr == '' && $values == '') {\n $attr .= $key;\n $values .= \"'\" . trim(addslashes(htmlspecialchars($val))) . \"'\";\n } else {\n $attr .= \", \" . $key;\n $values .= \", '\" . trim(addslashes(htmlspecialchars($val))) . \"'\";\n }\n }\n return \"INSERT INTO \" . $table . \" (\" . $attr . \") VALUES (\" . $values . \");\";\n }", "function data2banco ($d2b) { \n\tif(!empty($d2b)){\n\t\t$d2b_ano=substr($d2b,6,4);\n\t\t$d2b_mes=substr($d2b,3,2);\n\t\t$d2b_dia=substr($d2b,0,2);\t\t\n\t\t$d2b=\"$d2b_ano-$d2b_mes-$d2b_dia\";\n\t}\n\treturn $d2b; \n}", "public function getReplacementText();", "function replace($begin,$end,$str)\n{\n\tforeach($end as $v) { \n\t $my[] = base64_decode($v);\t \n\t }\n\techo str_replace($begin,$my,$str);\n}", "function convertToSeo($text)\n{\n $turkce = array(\"ç\",\"Ç\",\"ğ\",\"Ğ\",\"ü\",\"Ü\",\"ö\",\"Ö\",\"ı\",\"İ\",\"ş\",\"Ş\",\".\",\",\",\"!\",\"\\\"\",\" \",\"?\",\"*\",\"_\",\"|\",\"=\",\"(\",\")\",\"[\",\"]\",\"{\",\"}\");\n $convert = array(\"c\",\"c\",\"g\",\"g\",\"u\",\"u\",\"o\",\"o\",\"i\",\"i\",\"s\",\"s\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\",\"-\");\n\n //$seo1 = str_replace($turkce,$convert,$title);\n return strtolower(str_replace($turkce,$convert,$text));\n}", "function ReplaceContent( $data, $template_html )\n{\n foreach ( $data as $row )\n {\n //replace fields with values in template\n $content = $template_html;\n foreach($row as $field => $value)\n {\n $content = str_replace(\"@@$field@@\", $value, $content);\n\n }\n\n print $content;\n }\n}", "function replace_curl($string){\n $string = str_replace(\"~\", \"'\", $string);\n return $string;\n}", "function funConverteData($data){\n\t//$data_americano = \"2009-04-29\";\n\t//$data_Brasileiro = \"29/04/2012\";\n\t//AGORA VAMOS EXPLODIR ELA PELOS HIFENS E SERÁ CRIADO UM ARRAY COM AS PARTES\n\t$partes_da_data = explode('/',$data);\n\n\t//AGORA REMONTAMOS A DATA NO FORMATO BRASILEIRO, OU SEJA,\n\t//INVERTENDO AS POSICOES E COLOCANDO AS BARRAS\n\t$data = $partes_da_data[2].'-'.$partes_da_data[1].'-'.$partes_da_data[0];\n\n\t//UFA! PRONTINHO, AGORA TEMOS A DATA NO BOM E VELHO FORMATO BRASILEIRO\n\treturn $data;\n}", "public function dataToUS($data) {\n\n $transformado = substr($data, 6, 4) . \"-\" . substr($data, 3, 2) . \"-\" . substr($data, 0, 2);\n $transformado = ($transformado == \"--\") ? \"\" : $transformado;\n\n return $transformado;\n }", "function str_values(){\n //\n //map the std objects inthe array to return an array of strings of this \n //format INSERT INTO Customers (CustomerName, ContactName, Address, City, PostalCode, Country)\n //VALUES ('Cardinal', 'Tom B. Erichsen', 'Skagen 21', 'Stavanger', '4006', 'Norway');\n\n $col_str= array_map(function($obj){\n //\n //Return the full description of the columns\n return \"`$obj->name`\"; \n }, $this->values);\n //\n //\n $values_str= array_map(function($obj){\n //\n //Trim the spaces\n $tvalue = trim($obj->value);\n //\n //Replace '' with null\n $value = $tvalue=='' ? 'null': \"'$tvalue'\";\n //\n return $value;\n \n }, $this->values);\n //\n //retun the imploded version of the array with a , separator\n $values= implode(\",\",$values_str);\n $cols= implode(\",\",$col_str);\n return \"($cols) VALUES ($values)\";\n }", "function render_data($vista, $data) {\n\t$html = '';\n\tif(($vista) && ($data)) {\n\t\t$diccionario = armar_diccionario($vista, $data);//vista es un get\n\t\tif($diccionario) {\n\t\t\t$html = file_get_contents('plantilla_' . $vista . '.html');\n\t\t\tforeach ($diccionario as $clave => $valor) {\n\t\t\t\t$html = str_replace('{' . $clave . '}', $valor, $html);\n\t\t\t}\n\t\t}\n\t}\n\tprint $html;//print $html es lo que hace imprime todo \n}" ]
[ "0.61887616", "0.6155386", "0.6034526", "0.59921974", "0.58017164", "0.56912965", "0.5582909", "0.5576549", "0.5555195", "0.5551065", "0.55453396", "0.55453396", "0.55422", "0.54853565", "0.54683524", "0.54663295", "0.54426837", "0.53914756", "0.53894365", "0.538178", "0.5377512", "0.53741425", "0.5372326", "0.53703266", "0.53528744", "0.5346717", "0.53376484", "0.53252554", "0.5317456", "0.5306302", "0.53058654", "0.5299035", "0.5296027", "0.5242666", "0.5233252", "0.5226629", "0.52225834", "0.520557", "0.5199642", "0.51985", "0.5172745", "0.51667565", "0.51436555", "0.51315045", "0.5124942", "0.51238906", "0.5121135", "0.51174104", "0.51171106", "0.51169074", "0.5115387", "0.5110043", "0.51094115", "0.51006556", "0.50941056", "0.5090806", "0.5089069", "0.50698304", "0.5069277", "0.5066479", "0.50647426", "0.50622165", "0.50611395", "0.5060707", "0.5060707", "0.5052183", "0.5051187", "0.5042177", "0.503802", "0.5030832", "0.5030832", "0.5029458", "0.5021975", "0.5020786", "0.5020786", "0.5020636", "0.5020125", "0.5018521", "0.50125355", "0.5007205", "0.50065726", "0.5002461", "0.49969837", "0.49934974", "0.49924332", "0.4992075", "0.49903908", "0.49869376", "0.49867514", "0.49804154", "0.49771667", "0.49743888", "0.49686077", "0.4968009", "0.4965031", "0.4963567", "0.4961984", "0.4961437", "0.4959987", "0.4957399", "0.4956982" ]
0.0
-1
Retorna todos os itens atrasados
public function getLate(){ $data = "`{$this->table['formulario']}`.`data_devolucao` < CURDATE() AND `{$this->table['formulario']}`.`devolvido` = 0 AND `{$this->table['formulario']}`.`retirado` = 1 AND `usuario`.`cpf` = `{$this->table['formulario']}`.`usuario_cpf`"; return $this->db->select("{$this->table['formulario']}.usuario_cpf as cpf, usuario.nome, usuario.email, {$this->table['formulario']}.data_devolucao, {$this->table['formulario']}.devolvido, {$this->table['formulario']}.retirado")->from($this->table['formulario'].',usuario')->where($data)->group_by('usuario.email')->get()->result(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_all ();", "function listaAll() {\n require ROOT . \"config/bootstrap.php\";\n return $em->getRepository('models\\Equipamentos')->findby(array(), array(\"id\" => \"DESC\"));\n $em->flush();\n }", "public function getAll()\n {\n return $this->indicacaoRepository->getAll();\n }", "public static function getAll() {}", "public function allAnnonce(){\n $annonces=$this->repAnnonce->findBy(['disponibilite' =>'1']);\n return $annonces;\n }", "public function getAll() {}", "public function getAll() {}", "public function getAll() {}", "public function getAll() {}", "public function getAll() {}", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "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 getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function all()\n {\n return $this->atividadeComercialRepository->all();\n }", "public static function getAll();", "public static function getAll();", "public static function getAvailableTitulos()\n {\n $titulos = self::find()->orderBy('titulo')->asArray()->all();\n $items = ArrayHelper::map($titulos, 'id', 'titulo');\n return $items;\n }", "public function lista() {\n $sql = \"SELECT * FROM cliente\";\n $qry = $this->db->query($sql); // query do pdo com acesso ao bd\n\n //return $qry->fetchAll(); // retorna todos os registros\n return $qry->fetchAll(\\PDO::FETCH_OBJ); // retorna todos os registros a nível de objeto\n }", "public function getAll()\n {\n $sql = \"SELECT * FROM Oto LIMIT15\";\n\n $stmt = $this->database->query($sql);\n return $stmt->fetchAll();\n\n }", "public function findAll() : array {\r\n\r\n // méthode query car pas besoin de préparation ( liée à une variable) \r\n\r\n $resultat = $this->pdo->query(\"SELECT * FROM {$this->table}\");\r\n \r\n // fetchAll pour fouiller le résultat et en extraire les données réelles\r\n\r\n $items = $resultat->fetchAll();\r\n\r\n return $items;\r\n}", "public function getAll(): array;", "public function getAll(): array;", "public function getAll(): array;", "public function recuperarTodos() {\n $query = \"select * from tb_atividade where id_evento = :id\";\n\n $stmt = $this->conexao->prepare($query);\n $stmt->bindValue(':id', $_GET['id']);\n // $stmt->bindValue(':id', 8);\n $stmt->execute();\n\n return $stmt->fetchAll(PDO::FETCH_OBJ);\n }", "public function all(){\r\n return $this->items;\r\n }", "public function getTamanios(){\n $items = TcTamanio::where('id_estado','=',1)->get();\n return $items;\n }", "public function listaAtividadesTodas() {\n $cachediaCLASS = new CacheDiaCLASS();\n $filename = 'AtividadeDAO-listaAtividadesTodas.csv';\n $verifica = $cachediaCLASS->VerificaCache($filename);\n\n if ($verifica == false) {\n $this->sql = \"SELECT id_atividade,id_status,atividade from vsites_atividades as a where status!='Cancelado' order by atividade\";\n $this->values = array();\n $ret = $this->fetch();\n $campos = \"id_atividade;id_status;atividade\";\n $geracsv = $cachediaCLASS->ConvertArrayToCsv($filename, $ret, $campos);\n } else {\n $ret = $cachediaCLASS->ConvertCsvToArray($filename, array(\"to_object\" => true));\n }\n return $ret;\n }", "public static function findAll(){\n \t$data = self::all();\n \treturn $data;\n }", "public static function findAll(){\n \t$data = self::all();\n \treturn $data;\n }", "public static function findAll(){\n \t$data = self::all();\n \treturn $data;\n }", "public function getItens() {\n\n if (count($this->aItens) == 0) {\n\n $oDaoMatOrdemItem = db_utils::getDao('matordemitem');\n $sSqlItens = $oDaoMatOrdemItem->sql_query_ordcons(null, 'm52_codlanc', null, \"m52_codordem = \".$this->getCodigoOrdem());\n $rsMatOrdemItem = $oDaoMatOrdemItem->sql_record($sSqlItens);\n\n if ($oDaoMatOrdemItem->erro_status == \"0\") {\n throw new BusinessException(_M(self::URL_MENSAGEM.\"itens_nao_encontrados\"));\n }\n\n for ($iRowItem = 0; $iRowItem < $oDaoMatOrdemItem->numrows; $iRowItem++){\n\n $iCodigoItemOrdemDeCompra = db_utils::fieldsMemory($rsMatOrdemItem, $iRowItem)->m52_codlanc;\n $this->aItens[] = new ItemOrdemDeCompra($iCodigoItemOrdemDeCompra);\n }\n }\n return $this->aItens;\n }", "public static function getAll(): array;", "public function getInstrucoes();", "public function listarTodos(){\n\t\t\n\t\t$sql = 'SELECT * FROM itempedido';\n\t\t$consulta = $this->conn->prepare($sql);\n\t\t$consulta->execute();\n\t\treturn ($consulta->fetchAll(PDO::FETCH_ASSOC));\n\t}", "public static function getAll() {\n $lesObjets = array();\n $requete = \"SELECT * FROM Offre\";\n $stmt = Bdd::getPdo()->prepare($requete);\n $ok = $stmt->execute();\n if ($ok) {\n while ($enreg = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $lesObjets[] = self::enregVersMetier($enreg);\n }\n }\n return $lesObjets;\n }", "public abstract function getAll();", "public function listAll() \n { \n $tipoEncargados = $this->tipoEncargadoDao->listAll();\n $tipoEncargadoArreglo = array();\n foreach ( $tipoEncargados as $indice => $tipoEncargado ){\n $arreglo = array(\n 'id' => $tipoEncargado->getId(),\n 'etiqueta' => $tipoEncargado->getEtiqueta()\n );\n $tipoEncargadoArreglo[] = $arreglo;\n } \n return response( $tipoEncargadoArreglo , 200)->header('Content-Type', 'application/json');\n }", "public function listarTodos(){\r\n\t\t$sql = 'SELECT * FROM oficina';\r\n\t\t$consulta = $conexao->prepare($sql);\r\n\t\t$resultado = $consulta->execute();\r\n\t\treturn ($resultado->fetchAll(PDO::FETCH_ASSOC));\r\n\t}", "public function getEntradas(){\n\n $oDaoMatOrdemItem = db_utils::getDao('matordemitem');\n $sWhereOrdemCompra = \"m81_codtipo in (19, 12) and m52_codordem = {$this->iCodigoOrdem}\";\n $sSqlMatOrdemItem = $oDaoMatOrdemItem->sql_query_entradas( null, \"*\", null, $sWhereOrdemCompra);\n $rsMatOrdemItem = $oDaoMatOrdemItem->sql_record($sSqlMatOrdemItem);\n\n $aItensEntrada = array();\n if ($oDaoMatOrdemItem->numrows > 0) {\n\n $iTotalItens = $oDaoMatOrdemItem->numrows;\n for ($iRowItem = 0; $iRowItem < $iTotalItens; $iRowItem++) {\n\n $oDadosMatOrdemItem = db_utils::fieldsMemory($rsMatOrdemItem, $iRowItem);\n $oItem = new Item($oDadosMatOrdemItem->m70_codmatmater);\n $oAlmoxarifado = new Almoxarifado($oDadosMatOrdemItem->m80_coddepto);\n $oTipoMovimentacao = TipoMovimentacaoEstoqueRepository::getTipoMovimentaoPorCodigo($oDadosMatOrdemItem->m81_codtipo);\n\n $oMovimentacaoItem = new MovimentacaoItem($oItem);\n $oMovimentacaoItem->setQuantidade($oDadosMatOrdemItem->m52_quant);\n $oMovimentacaoItem->setQuantidadeEntrada($oDadosMatOrdemItem->m71_quant);\n $oMovimentacaoItem->setValor($oDadosMatOrdemItem->m71_valor);\n $oMovimentacaoItem->setAlmoxarifado($oAlmoxarifado);\n $oMovimentacaoItem->setTipoMovimentacao($oTipoMovimentacao);\n\n $aItensEntrada[] = $oMovimentacaoItem;\n\n }\n }\n return $aItensEntrada;\n }", "public function getItens() {\n\n if (count($this->aItens) == 0) {\n \n $oDaoProcessoItemLote = new cl_processocompraloteitem; \n $sQueryItemLote = $oDaoProcessoItemLote->sql_query_file(null, \n \"pc69_sequencial\", \n null, \n \"pc69_processocompralote = {$this->getCodigo()}\"\n );\n \n $rsDadosItem = $oDaoProcessoItemLote->sql_record($sQueryItemLote); \n if ($oDaoProcessoItemLote->numrows > 0) {\n \n for ($iItem = 0; $iItem < $oDaoProcessoItemLote->numrows; $iItem++) {\n \n $iCodigoItem = db_utils::fieldsMemory($rsDadosItem, $iItem);\n $this->aItens[] = ItemProcessoCompraRepository::getItemByCodigo($iCodigoItem);\n }\n } \n }\n return $this->aItens;\n }", "public function getItems(): array;", "public function getItems(): array;", "function listaEstablecimientos() {\n\t\t$establecimiento = new Establecimiento();\n\t\treturn $establecimiento->listar();\n\t}", "public function buscarTodos() {\r\n global $conn;\r\n $qry = $conn->query(\"SELECT * FROM conta\");\r\n $items = array();\r\n while($linha = $qry->fetch()) {\r\n $items[] = new Conta($linha[\"saldo\"], $linha[\"numero\"], $linha[\"cpf\"],$linha[\"cnpj\"]);\r\n }\r\n return $items;\r\n }", "public static function getListado(){\n return Dispositivo::model()->findAll();\n }", "public final function get_all()\n {\n }", "public function pegaTodos(){\n\t\treturn $this->resultado->fetchAll();\n\t}", "protected function getAll() {}", "public function findAll() {\n\t\t$titulaires = array();\n\t\t$rs = $this->db->query(\"SELECT * FROM `titulaire`;\")->fetchAll();\n\t\tforeach ($rs as $titulaire) {\n\t\t\t$titulaires[] = new Titulaire($titulaire['ID'], $titulaire['LIBELLE']);\n\t\t}\n\t\treturn $titulaires;\n\t}", "public function findAll() {}", "public function findAll() {}", "public function findAll() {}", "public function getAll() : array;", "public function getAll () {\n $query = \"SELECT * FROM equipe\";\n $stmt = $this->_pdo->query($query);\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getItems()\n {\n // Perform query\n $this->connect();\n $result = $this->conn -> query(\"SELECT * FROM contatti JOIN telefoni ON contatti.id = telefoni.raccordo ORDER BY contatti.id DESC\");\n if($result==false){\n echo \"operazione fallita\";\n $this->disconnect();\n return false;\n }\n // echo \"<br>Returned rows are: \" . $result -> num_rows;\n // echo \"<br>\";\n $rows = array();\n while ($row = $result->fetch_assoc()) {\n $rows[] = $row;\n }\n $this->disconnect();\n return $rows;\n }", "private function getItensInformation()\n {\n $Itens = $this->order->getAllVisibleItems();\n $PagSeguroItens = array();\n\n //CarShop Items\n foreach ($Itens as $item) {\n $PagSeguroItem = new PagSeguroItem();\n $PagSeguroItem->setId($item->getId());\n $PagSeguroItem->setDescription(self::fixStringLength($item->getName(), 255));\n $PagSeguroItem->setQuantity(self::toFloat($item->getQtyOrdered()));\n $PagSeguroItem->setWeight(round($item->getWeight()));\n $PagSeguroItem->setAmount(self::toFloat($item->getPrice()));\n\n array_push($PagSeguroItens, $PagSeguroItem);\n }\n\n return $PagSeguroItens;\n }", "public function obtenerTodosLosAlergenos(){\n $respuesta = $this->realizarPeticion('GET', $this->urlBase.'GetAlergenos');\n\n $datos = json_decode($respuesta);\n\n $alergenos = $datos->objeto;\n\n return $alergenos;\n }", "public static function all(){\n return Materia::orderBy('cuatrimestre', 'ASC')->get(); \n }", "public function liste()\n {\n return $this->createQueryBuilder('a')\n ->orderBy('a.pseudonyme', 'ASC')\n ;\n }", "public function readAllVoto(){\n\n return self::read('voto','voto'); \n }", "public function get_many() {\n return $this->get_all();\n }", "public function getAll(){\n \n // 1. Establece la conexion con la base de datos y trae todos los generos\n $query = $this->getDb()->prepare(\" SELECT * FROM genero\");\n $query-> execute(); \n return $query->fetchAll(PDO::FETCH_OBJ);\n }", "public function getAll()\n {\n \tif(!$this->isEmpty()){\n \t\treturn $this->items;\n \t}\n }", "public static function traerTodas()\n {\n $query = \"SELECT * FROM nivel\";\n $stmt = DBConnection::getStatement($query);\n $stmt->execute();\n\n $salida = [];\n\n while($datosNiv = $stmt->fetch()) {\n $niv = new Nivel();\n $niv->cargarDatos($datosNiv);\n\n $salida[] = $niv;\n }\n\n return $salida;\n }", "public static function getAll2(){\n\t\t$sql = \"select * from prueba\";\n\t\t$query = Executor::doit($sql);\n\t\treturn Model::many($query[0],new TemparioData());\n\t}", "public function all(){\r\n\treturn $this->getRepository()->findAll();\r\n }", "public function obtenerViajesplusAbonados();", "public function encontrarTodos() {\n return $this->getEntityManager()->getRepository($this->getEntity())->findAll();\n }", "public function getItems() : array;" ]
[ "0.69074017", "0.6889141", "0.6865072", "0.68564266", "0.6843275", "0.6826441", "0.6826441", "0.6826441", "0.68263626", "0.68263626", "0.6811498", "0.6811498", "0.6811498", "0.6811498", "0.6811498", "0.6811498", "0.6811498", "0.6811498", "0.6811498", "0.6811498", "0.6811498", "0.6811498", "0.6811498", "0.6811498", "0.6811498", "0.6811498", "0.6811498", "0.6811498", "0.6811498", "0.6811498", "0.6811498", "0.6811498", "0.6754329", "0.6754329", "0.6754329", "0.6754329", "0.6754329", "0.6754329", "0.6754329", "0.6754329", "0.6754329", "0.6754329", "0.6754329", "0.6754329", "0.6754329", "0.6743721", "0.67323536", "0.67323536", "0.6720126", "0.67043495", "0.6696217", "0.66828555", "0.6681739", "0.6681739", "0.6681739", "0.668012", "0.66791064", "0.66787714", "0.6676409", "0.66760916", "0.66760916", "0.66760916", "0.6661044", "0.66559505", "0.66424406", "0.6640642", "0.6633122", "0.6627493", "0.66192067", "0.6617812", "0.66150004", "0.6613998", "0.66121227", "0.66121227", "0.6611048", "0.6600445", "0.65930927", "0.65852165", "0.6581316", "0.6575816", "0.6572806", "0.65669996", "0.65669996", "0.6566457", "0.65660053", "0.6557807", "0.65544957", "0.65513235", "0.65470725", "0.6540237", "0.6529975", "0.65288204", "0.65186554", "0.65175706", "0.6514193", "0.6512936", "0.65001655", "0.64976186", "0.6495623", "0.64954245", "0.64867616" ]
0.0
-1
Sets up the fixture, for example, opens a network connection. This method is called before a test is executed.
protected function setUp() { \SolubleTestFactories::startJavaBridgeServer(); $this->servlet_address = \SolubleTestFactories::getJavaBridgeServerAddress(); // Just launch the adapter $adapter = new Adapter([ 'driver' => 'Pjb62', 'servlet_address' => $this->servlet_address, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function fixture_setup() {\r\n $this->service = SQLConnectionService::get_instance($this->configuration);\r\n test_data_setup($this->service);\r\n }", "public function setUp() {\n\t\t$options = [\n\t\t\t'db' => [\n\t\t\t\t'adapter' => 'Connection',\n\t\t\t\t'connection' => $this->_connection,\n\t\t\t\t'fixtures' => $this->_fixtures\n\t\t\t]\n\t\t];\n\n\t\tFixtures::config($options);\n\t\tFixtures::save('db');\n\t}", "protected function setUp()\n {\n $this->fixture = new Record();\n }", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->load();\n }", "protected function setUp()\n {\n\t global $sys_datacite_username, $sys_datacite_password, $sys_datacite_url ;\n\n\t $this->client = new DataCiteClient($sys_datacite_username, $sys_datacite_password);\n $this->client->setDataciteUrl($sys_datacite_url);\n }", "protected function setUp()\n {\n $this->fixture = new Configuration();\n }", "public function setUp() {\r\n // and doing it every test slows the tests down to a crawl\r\n $this->sharedFixture = new MovieLensDataSet(DATA_DIR);\r\n }", "public function setUp()\n {\n parent::setUp();\n $this->prepareForTests();\n }", "protected function setUp() {\n\n $this->client = new Client(['base_uri' => getenv('API_ADDR')]);\n $this->locIDs = $this->insertTestLocations();\n reuse_generateXML();\n }", "protected function setUp(): void\n {\n $servername = '18.222.31.30';\n $username = 'phpclient';\n $password = 'leftoverkillerphp';\n $dbname = 'leftover_killer';\n self::$RecipeModel = new GetRecipeDetails($servername, $username, $password, $dbname);\n }", "public function setUp()\n {\n\n $this->db = Db::getActive();\n $this->response = Response::getActive();\n\n }", "protected function setUp() {\n parent::setUp ();\n $this->storage = new Storage();\r\n $this->connectDB();\r\n $this->cleanDB();\r\n $this->createUser();\n $this->storage->connect($this->dbh);\n }", "protected function setUp() {\r\n\t\tparent::setUp ();\r\n\t\t$this->storage = new Storage ( );\r\n\t\t$this->connectDB();\r\n\t\t$this->cleanDB ();\r\n\t\t$this->createUser ();\r\n\t\t$this->storage->connect ( $this->dbh );\n\t}", "public function setUp() {\n $this->fixture= new FreeTdsLookup($this->getClass()->getPackage()->getResourceAsStream('freetds.conf'));\n }", "public static function setUpBeforeClass(): void\r\n {\r\n self::$MemoryTestAsset = new MemoryTestAsset();\r\n\r\n self::$clients = self::$MemoryTestAsset->getClients();\r\n self::$ClientsStorage = self::$MemoryTestAsset->getClientsStorage();\r\n }", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "protected function setUp()\n {\n parent::setUp();\n $config = new LocalConfiguration();\n $this->local = new Local($config);\n }", "function setUp() {\n\t\t$this->originalIsRunningTest = self::$is_running_test;\n\t\tself::$is_running_test = true;\n\t\t\n\t\t// Remove password validation\n\t\t$this->originalMemberPasswordValidator = Member::password_validator();\n\t\t$this->originalRequirements = Requirements::backend();\n\t\tMember::set_password_validator(null);\n\t\tCookie::set_report_errors(false);\n\n\t\t$className = get_class($this);\n\t\t$fixtureFile = eval(\"return {$className}::\\$fixture_file;\");\n\t\t\n\t\t// Set up fixture\n\t\tif($fixtureFile) {\n\t\t\tif(substr(DB::getConn()->currentDatabase(),0,5) != 'tmpdb') {\n\t\t\t\t//echo \"Re-creating temp database... \";\n\t\t\t\tself::create_temp_db();\n\t\t\t\t//echo \"done.\\n\";\n\t\t\t}\n\n\t\t\t// This code is a bit misplaced; we want some way of the whole session being reinitialised...\n\t\t\tVersioned::reading_stage(null);\n\n\t\t\tsingleton('DataObject')->flushCache();\n\n\t\t\t$dbadmin = new DatabaseAdmin();\n\t\t\t$dbadmin->clearAllData();\n\t\t\t\n\t\t\t// We have to disable validation while we import the fixtures, as the order in\n\t\t\t// which they are imported doesnt guarantee valid relations until after the\n\t\t\t// import is complete.\n\t\t\t$validationenabled = DataObject::get_validation_enabled();\n\t\t\tDataObject::set_validation_enabled(false);\n\t\t\t$this->fixture = new YamlFixture($fixtureFile);\n\t\t\t$this->fixture->saveIntoDatabase();\n\t\t\tDataObject::set_validation_enabled($validationenabled);\n\t\t}\n\t\t\n\t\t// Set up email\n\t\t$this->originalMailer = Email::mailer();\n\t\t$this->mailer = new TestMailer();\n\t\tEmail::set_mailer($this->mailer);\n\t}", "protected function setUp() {\n\t\tparent::setUp();\n\n\t\t$this->object = new ControllerFixture([\n\t\t\t'module' => 'module',\n\t\t\t'controller' => 'controller',\n\t\t\t'action' => 'action',\n\t\t\t'args' => [100, 25]\n\t\t]);\n\n\t\t// Used by throwError()\n\t\tTiton::router()->initialize();\n\t}", "protected function setUp(): void\n {\n \tparent::setUp();\n\n \t$this->authorize();\n\n \t$this->loadFixtures([\n \t\t'product'=>ProductFixture::class\n \t]);\n }", "protected function setUp()\n {\n $this->fixture = new NamespaceDescriptor();\n }", "protected function setUp(): void\n {\n $this->fixture = new TestSubjectDescriptor();\n }", "public function setUp()\n {\n $this->fixture = new Finder();\n }", "function setUp() {\n\t\t$this->originalIsRunningTest = self::$is_running_test;\n\t\tself::$is_running_test = true;\n\t\t\n\t\t// i18n needs to be set to the defaults or tests fail\n\t\ti18n::set_locale(i18n::default_locale());\n\t\ti18n::set_date_format(null);\n\t\ti18n::set_time_format(null);\n\t\t\n\t\t// Remove password validation\n\t\t$this->originalMemberPasswordValidator = Member::password_validator();\n\t\t$this->originalRequirements = Requirements::backend();\n\t\tMember::set_password_validator(null);\n\t\tCookie::set_report_errors(false);\n\t\t\n\t\tif(class_exists('RootURLController')) RootURLController::reset();\n\t\tif(class_exists('Translatable')) Translatable::reset();\n\t\tVersioned::reset();\n\t\tDataObject::reset();\n\t\tif(class_exists('SiteTree')) SiteTree::reset();\n\t\tHierarchy::reset();\n\t\tif(Controller::has_curr()) Controller::curr()->setSession(new Session(array()));\n\t\t\n\t\t$this->originalTheme = SSViewer::current_theme();\n\t\t\n\t\tif(class_exists('SiteTree')) {\n\t\t\t// Save nested_urls state, so we can restore it later\n\t\t\t$this->originalNestedURLsState = SiteTree::nested_urls();\n\t\t}\n\n\t\t$className = get_class($this);\n\t\t$fixtureFile = eval(\"return {$className}::\\$fixture_file;\");\n\t\t$prefix = defined('SS_DATABASE_PREFIX') ? SS_DATABASE_PREFIX : 'ss_';\n\n\t\t// Set up fixture\n\t\tif($fixtureFile || $this->usesDatabase || !self::using_temp_db()) {\n\t\t\tif(substr(DB::getConn()->currentDatabase(), 0, strlen($prefix) + 5) != strtolower(sprintf('%stmpdb', $prefix))) {\n\t\t\t\t//echo \"Re-creating temp database... \";\n\t\t\t\tself::create_temp_db();\n\t\t\t\t//echo \"done.\\n\";\n\t\t\t}\n\n\t\t\tsingleton('DataObject')->flushCache();\n\t\t\t\n\t\t\tself::empty_temp_db();\n\t\t\t\n\t\t\tforeach($this->requireDefaultRecordsFrom as $className) {\n\t\t\t\t$instance = singleton($className);\n\t\t\t\tif (method_exists($instance, 'requireDefaultRecords')) $instance->requireDefaultRecords();\n\t\t\t\tif (method_exists($instance, 'augmentDefaultRecords')) $instance->augmentDefaultRecords();\n\t\t\t}\n\n\t\t\tif($fixtureFile) {\n\t\t\t\t$pathForClass = $this->getCurrentAbsolutePath();\n\t\t\t\t$fixtureFiles = (is_array($fixtureFile)) ? $fixtureFile : array($fixtureFile);\n\n\t\t\t\t$i = 0;\n\t\t\t\tforeach($fixtureFiles as $fixtureFilePath) {\n\t\t\t\t\t// Support fixture paths relative to the test class, rather than relative to webroot\n\t\t\t\t\t// String checking is faster than file_exists() calls.\n\t\t\t\t\t$isRelativeToFile = (strpos('/', $fixtureFilePath) === false || preg_match('/^\\.\\./', $fixtureFilePath));\n\t\t\t\t\tif($isRelativeToFile) {\n\t\t\t\t\t\t$resolvedPath = realpath($pathForClass . '/' . $fixtureFilePath);\n\t\t\t\t\t\tif($resolvedPath) $fixtureFilePath = $resolvedPath;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$fixture = new YamlFixture($fixtureFilePath);\n\t\t\t\t\t$fixture->saveIntoDatabase();\n\t\t\t\t\t$this->fixtures[] = $fixture;\n\n\t\t\t\t\t// backwards compatibility: Load first fixture into $this->fixture\n\t\t\t\t\tif($i == 0) $this->fixture = $fixture;\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->logInWithPermission(\"ADMIN\");\n\t\t}\n\t\t\n\t\t// Set up email\n\t\t$this->originalMailer = Email::mailer();\n\t\t$this->mailer = new TestMailer();\n\t\tEmail::set_mailer($this->mailer);\n\t\tEmail::send_all_emails_to(null);\n\t\t\n\t\t// Preserve memory settings\n\t\t$this->originalMemoryLimit = ini_get('memory_limit');\n\t}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}" ]
[ "0.75936085", "0.717084", "0.6926827", "0.69098216", "0.68924206", "0.6882811", "0.6815332", "0.6802555", "0.675381", "0.6753016", "0.6745859", "0.6732938", "0.6713749", "0.67078847", "0.67020863", "0.66829914", "0.66829914", "0.66829914", "0.66829914", "0.66829914", "0.6678807", "0.667741", "0.66720605", "0.6669591", "0.66474104", "0.6644965", "0.6644776", "0.6637013", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.6617927", "0.66175914", "0.66175914", "0.6617369", "0.6617369", "0.6617369", "0.6617369", "0.6617369", "0.6617369", "0.6617369", "0.6617369", "0.6617369", "0.6617369", "0.6617369", "0.6617369", "0.6617369" ]
0.0
-1
Tears down the fixture, for example, closes a network connection. This method is called after a test is executed.
protected function tearDown() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function tearDown(): void\n {\n parent::tearDown();\n\n Mockery::close();\n\n unset($this->faker, $this->waqi);\n }", "public function teardown()\n {\n //\n }", "protected function tearDown(): void\n\t{\n\t\tglobal $modSettings;\n\n\t\t// remove temporary test data\n\t\tunset($modSettings);\n\t}", "public function tearDown()\n {\n unset(\n $this->plugins,\n $this->events,\n $this->connection,\n $this->config\n );\n }", "public function teardown()\n {\n }", "public function _after(TestCase $test)\n {\n $this->unloadFixtures();\n }", "public function tearDown()\n {\n unset($this->app);\n unset($this->client);\n\n m::close();\n }", "protected function tearDown(): void\n {\n self::$driver->close();\n }", "public function tearDown()\n\t{\n\t\tm::close();\n\t}", "protected function tearDown()\n {\n if ($this->databaseTester !== null) {\n if (method_exists($this, 'getTearDownOperation')) {\n $this->getDatabaseTester()->setTearDownOperation($this->getTearDownOperation());\n }\n if (method_exists($this, 'getDataSet')) {\n $this->getDatabaseTester()->setDataSet($this->getDataSet());\n }\n $this->getDatabaseTester()->onTearDown();\n }\n\n $this->databaseTester = null;\n\n set_time_limit(0);\n }", "public function tearDown() {\n\t\tFixtures::clear('db');\n\t\tGalleries::reset();\n\t\tImages::reset();\n\t}", "function teardown() {\n // close database connection\n $this->conn = null;\n }", "protected function tearDown()\r\n {\r\n DirectoryManager::recursiveRemoveDir('data/tests');\r\n }", "protected function tearDown() {\r\n\t\t$this->dbh = null;\r\n\t\t$this->storage = null;\r\n\t\tparent::tearDown ();\r\n\t}", "protected function tearDown(): void\n {\n $this->closeDatabase();\n }", "protected function tearDown() {\n\t\tm::close();\n\t}", "public function tearDown()\n\t{\n\t\t$this->beforeApplicationDestroyed(function () {\n\t\t\tDB::disconnect();\n\t\t});\n\t\n\t\t\tparent::tearDown();\n\t\t\t// \t\tMockery::close();\n\t}", "public function tearDown()\n {\n unset($this->db);\n unset($this->statement);\n unset($this->mockData);\n }", "protected function tearDown() {\n\t\tparent::tearDown();\n\n\t\t$this->cleanupTestDirectory();\n\t}", "protected function tearDown()\n {\n $this->testData = null;\n parent::tearDown();\n }", "protected function tearDown(): void\n {\n $this->provider = null;\n $this->response = null;\n }", "protected function tearDown(): void\n {\n $client = $this->getProvidedData()[0] ?? null;\n if ($client instanceof Client) {\n $this->logout($client);\n }\n }", "public function teardown()\n {\n parent::teardown();\n }", "protected function doTearDown(): void\n {\n }", "protected function tearDown()\n\t{\n\t\tunset($GLOBALS['__DB__']);\n\n\t\tparent::tearDown();\n\t}", "public function teardown() {\n m::close();\n }", "public function tearDownFixtures()\n {\n if (is_array($this->_fixtures)) {\n /** @var ActiveRecordFixture $object */\n foreach ($this->_fixtures as $object) {\n $object->cleanup();\n }\n }\n }", "protected function tearDown()\n {\n // Make sure any test entities created are deleted\n foreach ($this->testEntities as $entity)\n {\n // Second param is a 'hard' delete which actually purges the data\n $this->entityLoader->delete($entity, true);\n }\n }", "public function teardown()\n {\n m::close();\n }", "public function tearDown()\n\t{\n\t\tunset($this->target);\n\t}", "protected function tearDown ()\n {\n $this->downTest();\n\n parent::tearDown();\n }", "public function tearDown()\n {\n $fs = new SymfonyFileSystem();\n $fs->remove($this->fakeTestFileDir);\n\n unset($this->builder);\n unset($this->builder);\n unset($this->fs);\n m::close();\n }", "protected function tearDown(): void\n {\n $this->tearDownTheTestEnvironment();\n }", "protected function tearDown() {\r\n\t\tunset ( $this->configReader );\r\n\t}", "protected function tearDown() {\n\t\t$this->sql->Disconnect(__FILE__, __LINE__);\n\t\tsqlsolution_unlink_sqlite($this->sql);\n\t\t$this->sql = null;\n\t}", "protected function tearDown()\n {\n parent::tearDown();\n\n $this->em->close();\n $this->em = null; // avoid memory leaks\n }", "protected function tearDown()\n {\n $this->testDBConnector->clearDataFromTables();\n }", "public function tearDown() {\n\n\t\tparent::tearDown();\n\t\tMockery::close();\n\t}", "public function tearDown()\n {\n $this->stop();\n }", "public function tearDown()\n {\n m::close();\n }", "public function tearDown()\n {\n m::close();\n }", "public function tearDown()\n {\n m::close();\n }", "protected function tearDown() {\n\n $this->client = null;\n $this->deleteTestLocations();\n $this->locIDs = null;\n reuse_generateXML();\n }", "public function tearDown()\n {\n unset($this->helper);\n }", "public function tearDown()\n\t{\n\t\tunset($this->stub);\n\t}", "protected function tearDown()\n\t {\n\t\tunset($this->object);\n\n\t\t$conn = $this->getConnection();\n\t\t$db = $conn->getConnection();\n\t\t$db->exec(\"DROP TABLE IF EXISTS `MySQLdatabase`;\");\n\n\t\tunset($GLOBALS[\"errstr\"]);\n\t\tunset($GLOBALS[\"stuckerror\"]);\n\t }", "protected function tearDown()\n {\n $this->local = null;\n parent::tearDown();\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tearDown() {\n $this->dbh = null;\n $this->storage = null;\n parent::tearDown ();\n }", "protected function tearDown()\n {\n $this->kernel->shutdown();\n $this->kernel = null;\n parent::tearDown();\n }", "public function tear_down()\n {\n }", "public function tear_down()\n {\n }", "public function tear_down()\n {\n }", "public function tearDown()\n\t{\n\t\t\\Orchestra\\Core::shutdown();\n\n\t\tunset($this->user);\n\t\tunset($this->stub);\n\n\t\tparent::tearDown();\n\t}", "public function tearDown()\n {\n unset($this->VenusFuelDepot);\n }", "protected function tearDown()\n\t{\n\t\tunset($this->_instance);\n\t\tparent::tearDown();\n\t}", "public function tearDown()\n {\n parent::tearDown();\n\n if ((bool) getenv('CLEANUP_TEST_DOCKER_SECRETS')) {\n DockerSecretFile::cleanup();\n }\n }", "protected function tearDown()\n\t{\n\t\t$this->restoreFactoryState();\n\t}", "protected function tearDown()\n {\n $this->dataCollector = null;\n parent::tearDown();\n }", "public function tearDown()\n {\n unset($this->app);\n unset($_SERVER['RouteManagerTest@callback']);\n m::close();\n }", "protected function tearDown(): void\n {\n $this->config = null;\n $this->container = null;\n $this->instance = null;\n }", "public function tearDown(){\n\t\t$this->container->get('doctrine')->getConnection()->close();\n\t\n\t\tparent::tearDown();\n\t}", "protected function tearDown()\n {\n unset($this->app);\n\n m::close();\n }", "public function tearDown()\n {\n if (null !== $this->ldap) {\n $this->ldap->unbind();\n }\n }", "protected function tearDown(): void\n {\n $this->_connection->dropTable($this->_tableName);\n $this->_connection->resetDdlCache($this->_tableName);\n $this->_connection = null;\n }", "public function tearDown()\n {\n $this->deleteAdminUserFixture();\n }", "public function tearDown()\n {\n $this->flushModelEventListeners();\n parent::tearDown();\n unset($this->app);\n\n /*\n * Restore environment\n */\n if (file_exists(base_path($this->envTestingFile())) && file_exists(base_path('.env.backup'))) {\n $this->restoreEnvironment();\n }\n }", "public function tearDown()\n {\n unset($this->commonDataClassRepository);\n }", "protected function tearDown()\n\t{\n\t\tparent::tearDown();\n\t\tEnUser::release();\n\t\tRPCContext::getInstance()->resetSession();\n\t\tRPCContext::getInstance()->unsetSession('global.uid');\n\t\tFragseizeObj::release( $this->uid );\n\t}", "protected function tearDown()\n {\n $this->client = null;\n }", "public function tearDown() \n {\n $this->flushSession();\n \n $this->inactiveUser->delete();\n $this->basicUser->delete();\n $this->contactManager->delete();\n $this->projectManager->delete();\n $this->administrator->delete();\n\n parent::tearDown();\n Mockery::close();\n }", "public function tearDown() {\n // tests using these functions.\n \\mod_forum\\subscriptions::reset_forum_cache();\n\n $this->messagesink->clear();\n $this->messagesink->close();\n unset($this->messagesink);\n\n $this->mailsink->clear();\n $this->mailsink->close();\n unset($this->mailsink);\n }", "public function tearDown()\n\t{\n\t\tparent::tearDown();\n\t\t$this->databaseTester = NULL;\n\t}", "public function tearDown(): void\n {\n self::$environ->cleanupTestUploadFiles();\n self::$environ->clean();\n }", "public function tearDown()\n {\n $this->client = null;\n }", "protected function tearDown()\n {\n $this->helper = null;\n parent::tearDown();\n }", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown()\n\t{\n\t\t$this->instance = null;\n\t}", "public static function tearDownAfterClass(): void\n {\n if (file_exists(static::$ou)) {\n unlink(static::$ou);\n }\n }", "protected function tearDown()\r\n {\r\n $application = new Application(self::$kernel);\r\n $application->setAutoExit(false);\r\n\r\n $options = array('command' => 'doctrine:database:drop', '--force' => true);\r\n $application->run(new ArrayInput($options));\r\n\r\n parent::tearDown();\r\n\r\n $this->em->close();\r\n $this->em = null;\r\n }", "protected function tearDown()\n {\n parent::tearDown();\n if (!is_null($this->em)) {\n $this->em->getConnection()->close();\n }\n }", "protected function tearDown()\n {\n $this->deleteTemporaryFiles();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "public function tearDown()\n {\n Resistance::reset();\n }", "protected function tearDown()\n {\n $this->clock = NULL;\n }", "public function tearDown()\n\t{\n\t\tMockery::close();\n\t}", "protected function tearDown()\n\t{\n\t\tparent::tearDown ();\n\t\tEnUser::release();\n\t\tRPCContext::getInstance()->resetSession();\n\t\tRPCContext::getInstance()->unsetSession('global.uid');\n\t}" ]
[ "0.73072726", "0.7237321", "0.72217464", "0.71872526", "0.71867776", "0.7147699", "0.71409667", "0.7134919", "0.71208453", "0.71037716", "0.70809", "0.7080529", "0.70772797", "0.70531696", "0.70494586", "0.7033791", "0.7023172", "0.70151085", "0.7001187", "0.7000601", "0.7000006", "0.69922775", "0.69908", "0.69809866", "0.69592714", "0.69573396", "0.69546217", "0.69461334", "0.6939171", "0.6934538", "0.69284236", "0.6926207", "0.69227314", "0.69191253", "0.69110066", "0.69101465", "0.6907039", "0.6900362", "0.6892746", "0.68905157", "0.68905157", "0.68905157", "0.6889636", "0.68886983", "0.6883813", "0.68633", "0.686228", "0.6858362", "0.6858362", "0.6858362", "0.6858362", "0.6858362", "0.68547356", "0.68524724", "0.6852218", "0.6852218", "0.6852218", "0.68518555", "0.6843811", "0.68398327", "0.68383294", "0.68337053", "0.68304104", "0.68302625", "0.6811571", "0.6811396", "0.6808579", "0.6807537", "0.68072414", "0.6802607", "0.68006325", "0.67929095", "0.67921007", "0.6789001", "0.6779637", "0.6775313", "0.6770295", "0.6768996", "0.6767989", "0.6767243", "0.6761395", "0.6761395", "0.6761395", "0.6761395", "0.6761395", "0.6761395", "0.6760004", "0.67598915", "0.6758231", "0.6755504", "0.67543006", "0.6753939", "0.6753939", "0.6753939", "0.6753939", "0.6753939", "0.6753939", "0.6751222", "0.67494583", "0.6749201", "0.6749013" ]
0.0
-1
Here are placed some tests found in the original phpjavabridge tests suite and converted in phpunit.
public function testOriginalCases() { // Found in test.php5/testClass.php $cls = java_class('java.lang.Class'); $arr = java_get_values($cls->getConstructors()); $this->assertEquals(0, count($arr)); // Found in test.php5/sendHash.php $h = ['k' => 'v', 'k2' => 'v2']; $m = new java('java.util.HashMap', $h); $this->assertEquals(2, $m->size()); $this->assertEquals('v', $m['k']); $this->assertEquals('v2', $m['k2']); // Found in test.php5/sendArray.php $ar = [1, 2, 3, 5, 7, 11, -13, -17.01, 19]; unset($ar[1]); $v = new java('java.util.Vector', $ar); $Arrays = new java_class('java.util.Arrays'); $l = $Arrays->asList($ar); $v->add(1, null); $l2 = $v->sublist(0, $v->size()); $this->assertEquals('[1, null, 3, 5, 7, 11, -13, -17.01, 19]', java_cast($l, 'S')); $this->assertEquals('[1, null, 3, 5, 7, 11, -13, -17.01, 19]', java_cast($l2, 'S')); $res1 = java_values($l); $res2 = java_values($l2); $res3 = []; $res4 = []; $i = 0; foreach ($v as $key => $val) { $res3[$i++] = java_values($val); } for ($i = 0; $i < java_values($l2->size()); ++$i) { $res4[$i] = java_values($l2[$i]); } $this->assertTrue($l->equals($l2)); $this->assertNull(java_values($l[1])); $this->assertEquals($res3, $res1); $this->assertEquals($res4, $res1); // foudn in test.php5/vector.php $v = new java('java.util.Vector'); $v->setSize(10); foreach ($v as $key => $val) { $v[$key] = $key; } foreach ($v as $key => $val) { $this->assertEquals($key, java_values($val)); } for ($i = 0; $i < 10; ++$i) { $this->assertEquals($i, java_values($v[$i])); } // Found in test.php5/toString.php $Object = new java_class('java.lang.Object'); $ObjectC = new JavaClass('java.lang.Object'); $object = $Object->newInstance(); $this->assertEquals('class java.lang.Object', (string) $Object); $this->assertEquals('class java.lang.Object', $Object->__toString()); $this->assertStringStartsWith('java.lang.Object@', $object->__toString()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testPingTreeGet()\n {\n }", "protected abstract function test();", "protected abstract function test();", "public function testConnection()\n {\n }", "protected function setUp(): void\n {\n $this->servlet_address = \\SolubleTestFactories::getJavaBridgeServerAddress();\n $this->adapter = new Adapter([\n 'driver' => 'Pjb62',\n 'servlet_address' => $this->servlet_address,\n ]);\n }", "public function testPingTreeGetReferences()\n {\n }", "public function testWebSearchPhp()\n {\n $webResultSet = $this->_yahoo->webSearch('php');\n\n $this->assertTrue($webResultSet instanceof Zend_Service_Yahoo_WebResultSet);\n\n $this->assertTrue($webResultSet->totalResultsAvailable > 10);\n $this->assertEquals(10, $webResultSet->totalResultsReturned);\n $this->assertEquals(10, $webResultSet->totalResults());\n $this->assertEquals(1, $webResultSet->firstResultPosition);\n\n foreach ($webResultSet as $webResult) {\n $this->assertTrue($webResult instanceof Zend_Service_Yahoo_WebResult);\n }\n }", "public function testGenerateBarcodeUPCE()\n {\n }", "public function testPingTreeCreatePingTree()\n {\n }", "public function native();", "protected function setUp()\n {\n \\SolubleTestFactories::startJavaBridgeServer();\n $this->servlet_address = \\SolubleTestFactories::getJavaBridgeServerAddress();\n // Just launch the adapter\n $adapter = new Adapter([\n 'driver' => 'Pjb62',\n 'servlet_address' => $this->servlet_address,\n ]);\n }", "public function testPingTreeGetItem()\n {\n }", "abstract public function testSniff(): void;", "public function testFindServiceSource()\n {\n\n }", "protected function setUp(): void\n {\n if (!$this->isJdbcTestsEnabled()) {\n $this->markTestSkipped(\n 'Skipping JDBC mysql driver tests, enable option in phpunit.xml'\n );\n }\n\n \\SolubleTestFactories::startJavaBridgeServer();\n $this->servlet_address = \\SolubleTestFactories::getJavaBridgeServerAddress();\n $this->adapter = new Adapter([\n 'driver' => 'Pjb62',\n 'servlet_address' => $this->servlet_address,\n ]);\n $this->driverManager = new DriverManager($this->adapter);\n }", "public function test_dotorg_communication()\n {\n }", "public function testGetPackingPlanTags()\n {\n }", "public function testConnection();", "public function testGenerateBarcodeUPCA()\n {\n }", "public function testFindSignatures()\n {\n\n }", "protected function setUp(): void\n {\n \\SolubleTestFactories::startJavaBridgeServer();\n\n $this->servlet_address = \\SolubleTestFactories::getJavaBridgeServerAddress();\n\n $this->adapter = new Adapter([\n 'driver' => 'Pjb62',\n 'servlet_address' => $this->servlet_address,\n ]);\n }", "protected function setUp(): void\n {\n \\SolubleTestFactories::startJavaBridgeServer();\n\n $this->servlet_address = \\SolubleTestFactories::getJavaBridgeServerAddress();\n\n $this->adapter = new Adapter([\n 'driver' => 'Pjb62',\n 'servlet_address' => $this->servlet_address,\n ]);\n }", "abstract protected function constructTestHelper();", "abstract public function testSniff();", "public function testPreprocessingBinarize()\n {\n }", "public function testGetPackingPlanFiles()\n {\n }", "public function testPingTreeGetTargets()\n {\n }", "public function testPingTreeAddTargets()\n {\n }", "public function testPHPWebUnitConfig(){\n $this->assertEquals('phpunit', $this->phpwebunit['bin']);\n $this->assertEquals('SCRIPT_FILENAME', $this->phpwebunit['script_name']);\n\n //Ok, lets make sure that offsets are working\n $newphpwebunit = new kcmerrill\\tdd\\phpwebunit;\n $newphpwebunit['bin'] = 'kcwazhere';\n $this->assertEquals('kcwazhere', $newphpwebunit['bin']);\n\n //Ok, now lets move on to make sure that our constructor is rocking\n $newphpwebunit = new kcmerrill\\tdd\\phpwebunit('something', array('bin'=>'kcwazhereagain'));\n $this->assertEquals('kcwazhereagain', $newphpwebunit['bin']);\n }", "public function testCoverAllMethods();", "private function j() {\n }", "public function testGetSharedLinkRendition()\n {\n }", "public function testListServiceClasses()\n {\n\n }", "public function testGenerateBarcodeEAN8()\n {\n }", "public function testGettersPHP56()\n {\n if (PHP_VERSION_ID < 50600) {\n $this->markTestSkipped(\"Can not test new features on old version of PHP\");\n }\n\n $fileName = stream_resolve_include_path(__DIR__ . self::STUB_FILE56);\n $fileNode = ReflectionEngine::parseFile($fileName);\n $reflectionFile = new ReflectionFile($fileName, $fileNode);\n\n include_once $fileName;\n\n $parsedFileNamespace = $reflectionFile->getFileNamespace('Go\\ParserReflection\\Stub');\n foreach ($parsedFileNamespace->getClasses() as $parsedRefClass) {\n $this->performGeneralMethodComparison($parsedRefClass);\n }\n }", "protected function _initTest(){\n }", "public function testGetSelfServiceBrowserRegistrationRequest()\n {\n }", "protected function setUp(): void\n {\n \\SolubleTestFactories::startJavaBridgeServer();\n $this->servlet_address = \\SolubleTestFactories::getJavaBridgeServerAddress();\n }", "public function testInstance() { }", "public function testNewsSearchPhp()\n {\n $newsResultSet = $this->_yahoo->newsSearch('php');\n\n $this->assertTrue($newsResultSet instanceof Zend_Service_Yahoo_NewsResultSet);\n\n $this->assertTrue($newsResultSet->totalResultsAvailable > 10);\n $this->assertEquals(10, $newsResultSet->totalResultsReturned);\n $this->assertEquals(10, $newsResultSet->totalResults());\n $this->assertEquals(1, $newsResultSet->firstResultPosition);\n\n foreach ($newsResultSet as $newsResult) {\n $this->assertTrue($newsResult instanceof Zend_Service_Yahoo_NewsResult);\n }\n }", "public function testPingTreeGetCurrentCounts()\n {\n }", "protected abstract function getTestedInstance() : string;", "public function testAddPackingPlan()\n {\n }", "public function testPreprocessingBinarizeAdvanced()\n {\n }", "public function testPingTreeUpdateTargets()\n {\n }", "function testAddingEngine()\n {\n //Figure it out!\n require_once 'Server/Registry/PackedFileDataStore.class.php';\n $engine = $this->getMock(\n '\\Seraphp\\Server\\Registry\\PackedFileDataStore'\n );\n $this->_reg = \\Seraphp\\Server\\Registry\\Registry::getInstance($engine);\n $this->assertThat(\n $this->_reg,\n $this->IsInstanceOf('\\Seraphp\\Server\\Registry\\Registry')\n );\n }", "protected function test9() {\n\n }", "#[@test]\n public function getPackages() {\n $base= 'net.xp_framework.unittest.reflection';\n $packages= \\lang\\reflect\\Package::forName($base)->getPackages();\n $this->assertEquals(sizeof(self::$testPackages), sizeof($packages), \\xp::stringOf($packages));\n foreach ($packages as $package) {\n $this->assertTrue(\n in_array(substr($package->getName(), strlen($base)+ 1), self::$testPackages), \n $package->getName()\n );\n }\n }", "public function testGetOrderPackData()\n {\n }", "public function testInboundDocumentSearch()\n {\n }", "public function testGenerateBarcodeQRCode()\n {\n }", "public function testXCsv()\n {\n\n\n }", "public function testWebinars()\n {\n }", "public function testInstantiation()\n {\n $curlAdapter = new CurlAdapter();\n }", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}" ]
[ "0.5685569", "0.5617881", "0.5617881", "0.5610745", "0.55965585", "0.5586309", "0.5584241", "0.5575555", "0.5564525", "0.55600727", "0.5550416", "0.5544248", "0.55327594", "0.5525166", "0.5523569", "0.5497315", "0.54844654", "0.5479636", "0.54735327", "0.54692125", "0.54667586", "0.54667586", "0.5461171", "0.5455574", "0.5451575", "0.5450989", "0.53762656", "0.53718966", "0.53581095", "0.53359944", "0.5328257", "0.5325754", "0.5302338", "0.53007215", "0.52969706", "0.52914035", "0.5288737", "0.5287786", "0.52818507", "0.52763706", "0.5275535", "0.5271121", "0.5263346", "0.5261867", "0.5260508", "0.52603006", "0.52593213", "0.52583086", "0.5250384", "0.5243518", "0.5238526", "0.52378434", "0.52317536", "0.52238023", "0.5223178", "0.5223178", "0.5223178", "0.5223178", "0.5223178", "0.5223178", "0.5223178", "0.5223178", "0.5223178", "0.5223178", "0.5223178", "0.5223178", "0.5223178", "0.5223178", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417", "0.52225417" ]
0.61963755
0
request_var Used to get passed variable
function request_var($var_name, $default, $multibyte = false, $cookie = false) { if (!$cookie && isset($_COOKIE[$var_name])) { if (!isset($_GET[$var_name]) && !isset($_POST[$var_name])) { return (is_array($default)) ? array() : $default; } $_REQUEST[$var_name] = isset($_POST[$var_name]) ? $_POST[$var_name] : $_GET[$var_name]; } $super_global = ($cookie) ? '_COOKIE' : '_REQUEST'; if (!isset($GLOBALS[$super_global][$var_name]) || is_array($GLOBALS[$super_global][$var_name]) != is_array($default)) { return (is_array($default)) ? array() : $default; } $var = $GLOBALS[$super_global][$var_name]; if (!is_array($default)) { $type = gettype($default); } else { list($key_type, $type) = each($default); $type = gettype($type); $key_type = gettype($key_type); if ($type == 'array') { reset($default); $default = current($default); list($sub_key_type, $sub_type) = each($default); $sub_type = gettype($sub_type); $sub_type = ($sub_type == 'array') ? 'NULL' : $sub_type; $sub_key_type = gettype($sub_key_type); } } if (is_array($var)) { $_var = $var; $var = array(); foreach ($_var as $k => $v) { set_var($k, $k, $key_type); if ($type == 'array' && is_array($v)) { foreach ($v as $_k => $_v) { if (is_array($_v)) { $_v = null; } set_var($_k, $_k, $sub_key_type); set_var($var[$k][$_k], $_v, $sub_type, $multibyte); } } else { if ($type == 'array' || is_array($v)) { $v = null; } set_var($var[$k], $v, $type, $multibyte); } } } else { set_var($var, $var, $type, $multibyte); } return $var; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function RequestGet($var) {\n\t\t$res = \"\";\n\t\tif(isset($_REQUEST[$var])){\n\t\t\t$res = $_REQUEST[$var];\n\t\t}\n\t\t\t\n\t\treturn $res;\n\t}", "public function getRequestVar()\n {\n return $this->_requestVar;\n }", "public static function request($var = '')\n {\n return self::getFilter($_REQUEST, $var);\n }", "function request($var, $default=NULL) {\n\tif(isset($_REQUEST[$var])) \n\t\treturn $_REQUEST[$var];\n\telse\n\t\treturn $default;\n}", "function RequestVar($name, $default_value = true) {\r\n if (!isset($_REQUEST))\r\n return false;\r\n if (isset($_REQUEST[$name])) {\r\n if (!get_magic_quotes_gpc())\r\n return InjectSlashes($_REQUEST[$name]);\r\n return $_REQUEST[$name];\r\n }\r\n return $default_value;\r\n}", "public function getVar() {\r\n return $this->_filter->getRequestVar();\r\n }", "public static function getRequestVar($key){\n $return = false;\n \n if(isset(self::$_request_vars[$key])){\n $return = self::$_request_vars[$key];\n }\n \n return $return;\n }", "public static function getVarRequest()\n {\n if (!isset(self::$_data[self::KEY_VAR_EXC_REQUEST]))\n {\n $_list = array();\n try\n {\n $_list = self::getConfig(\"app\", \"log\", \"exclusion\", \"request\");\n if (!is_array($_list))\n {\n $_list = strlen($_list) > 0 ? array($_list) : array();\n }\n }\n catch (Exception $ex)\n {\n $_list = FALSE;\n }\n self::$_data[self::KEY_VAR_EXC_REQUEST] = $_list;\n }\n if (self::$_data[self::KEY_VAR_EXC_REQUEST] === FALSE)\n {\n return $_REQUEST;\n }\n else\n {\n $_result = $_REQUEST;\n foreach ($_result as $_key => $_value)\n {\n foreach (self::$_data[self::KEY_VAR_EXC_REQUEST] as $_field)\n {\n if (stripos($_key, $_field) !== FALSE)\n {\n $_result[$_key] = str_repeat(\"*\", strlen($_value));\n }\n }\n }\n return $_result;\n }\n }", "function GetRequest (&$r, $var, $default = null) {\n\tif (isset($r[$var])) {\n\t\t$val = $r[$var];\n\n\t\t// Deal with special chars in parameters\n\t\t// magic_quotes_gpc is deprecated from php 5.4.0\n\t\tif (version_compare(PHP_VERSION, '5.4.0', '>=')\n\t\t\t|| !get_magic_quotes_gpc())\n\t\t\t$val = AddslashesRecursive($val);\n\t}\n\telse\n\t\t$val = $default;\n\treturn $val;\n}", "function reqvar($varname, $default=NULL, $callback=NULL, $scope=NULL)\n{\n $scope = ($scope === NULL) ? $_GET : $scope;\n\t\n\tif (isset($scope[$varname]) && strlen(trim($scope[$varname])) !== 0)\n\t\treturn ($callback !== NULL) ? $callback($scope[$varname]) : $scope[$varname];\n\telse\n\t\treturn $default;\n}", "function getVar($var='value'){\r\n\r\n\t$ci =& get_instance();\r\n\r\n\tif( isset($_POST[$var]) ) return $ci->input->post($var);\r\n\r\n\telseif \t( isset($_GET[$var]) ) return $ci->input->get($var);\r\n\r\n\telse return 0;\r\n}", "function LT_request($variable, $default) {\n\tglobal $LT_SQL;\n\tif (array_key_exists($variable, $_REQUEST))\n\t\treturn $LT_SQL->real_escape_string($_REQUEST[$variable]);\n\telse\n\t\treturn $LT_SQL->real_escape_string($default);\n}", "function request($key){\n if (array_key_exists($key, $_REQUEST)){\n return $_REQUEST[$key];\n }\n return null;\n}", "function atkGetPostVar($key=\"\")\n{\n\tif(empty($key) || $key==\"\")\n\t{\n\t\treturn $_REQUEST;\n\t}\n\telse\n\t{\n\t\tif (array_key_exists($key,$_REQUEST) && $_REQUEST[$key]!=\"\") return $_REQUEST[$key];\n\t\treturn \"\";\n\t}\n}", "public function get_request_var($name, $default = null) {\n return (!empty($this->requestVars[$name]) ? $this->requestVars[$name] : $default);\n }", "function get_get_var($var)\r\n{\r\n if (isset($_GET[$var])) {\r\n return sanitizeAny($_GET[$var]);\r\n } else {\r\n return null;\r\n }\r\n}", "function getVAR ($var)\n{\n if (isset($_POST[$var]) && strlen($_POST[$var]) > 0)\n {\n return $_POST[$var];\n }\n\n return (isset($_GET[$var]) && strlen($_GET[$var]) >0) ? $_GET[$var] : '';\n}", "function req($key) {\r\n\treturn val(Request::$data, $key);\r\n}", "public function get_variable($variable) {\n return \\Drupal::request()->get($variable);\n }", "function get_param($name) {\n \n if (isset($_REQUEST[$name])) return $_REQUEST[$name];\n else return \"\";\n}", "static public function request( $var, $default = NULL )\r\n\t\t{\r\n\t\t\treturn isset( $_REQUEST[ $var ] ) \r\n\t\t\t\t? ( is_array( $_REQUEST[ $var ] ) ? Generic::stripslashes_from_array( $_REQUEST[ $var ] ) : stripslashes( trim( $_REQUEST[ $var ] ) ) ) \r\n\t\t\t\t: $default;\r\n\t\t}", "function get_var($varname, $method=\"\", $default_value=\"\")\n{\n\tglobal $_POST;\n\tglobal $_GET;\n\n\tif( isset($_GET[$varname]) && ((strcasecmp($method, \"get\") == 0 || $method == null)) )\n\t{\n\t\treturn $_GET[$varname];\n\t}\n\telse if(isset($_POST[$varname]))\n\t{\n\t\treturn $_POST[$varname];\n\t}\n\telse return $default_value;\n}", "function getValue($fieldName) {\r\n $value = '';\r\n if (isset($_REQUEST[$fieldName])) { \r\n $value = $_REQUEST[$fieldName];\r\n }\r\n return $value;\r\n }", "public function getRequestValue($key)\n {\n return $this->_request() ? $this->_request()->getParam($key) : null;\n }", "function get_query_var($query_var, $default_value = '')\n {\n }", "function safe_retrieve_gp($varname, $default='', $null_is_default=false) {\n if ( is_array($_REQUEST) && \n array_key_exists($varname, $_REQUEST) &&\n ( ($_REQUEST[$varname] != null) || (!$null_is_default) ) ) \n return $_REQUEST[$varname];\n return $default;\n}", "static function get($key) {\n if(!isset($_REQUEST[$key])) return null;\n else return $_REQUEST[$key];\n }", "private function request($request=null){\r\n\r\n if(is_null($request)){\r\n\r\n $this->request = request_uri();\r\n\r\n }else{\r\n\r\n $this->request = $request;\r\n\r\n }\r\n\r\n\r\n }", "function get_request_p($key, $default=false, $stripslahes=false)\n{\n return Request::GetValueP($key, $default, $stripslahes);\n}", "private function getRequestUserName() {\n\t\t//RETURN REQUEST VARIABLE: USERNAME\n if(!empty($_POST[self::$userName])){\n\t\t\treturn $_POST[self::$userName];\n\t\t}\n else{\n return \"\";\n }\n\t}", "function safeGetVar($varName, $default=null)\n{\n if (isset($_GET[$varName]))\n return $_GET[$varName];\n else\n return $default;\n}", "function safePostGetVar($varName, $default=null)\n{\n if (isset($_POST[$varName]))\n return $_POST[$varName];\n elseif (isset($_GET[$varName]))\n return $_GET[$varName];\n else\n return $default;\n}", "function GetVal( $sVar, $sDef = '' )\n{\n\tif( isset( $_REQUEST[ $sVar ] ) )\n\t{\n\t\treturn $_REQUEST[ $sVar ];\n\t}\n\t\n\treturn $sDef;\n}", "function getVariable($variableName) {\r\n if (isset($_GET[$variableName])) {\r\n $return = $_GET[$variableName];\r\n } elseif (isset($_POST[$variableName])) {\r\n $return = $_POST[$variableName];\r\n } else {\r\n return NULL;\r\n }\r\n\r\n return $return;\r\n}", "function getVariable($variableName) {\r\n if (isset($_GET[$variableName])) {\r\n $return = $_GET[$variableName];\r\n } elseif (isset($_POST[$variableName])) {\r\n $return = $_POST[$variableName];\r\n } else {\r\n return NULL;\r\n }\r\n\r\n return $return;\r\n}", "function get($var) {\n\t\treturn $this->_viewVars[$var];\n\t}", "function rest_sanitize_request_arg($value, $request, $param)\n {\n }", "function getDataFromRequest( &$data ) {\n\n\t\t$requestVar = KRequest::getInt($this->propertyName, NULL);\n\n\t\tif (empty($requestVar)) {\n\t\t\t$data->{$this->propertyName} = NULL;\n\t\t}\n\t\telse {\n\t\t\t$data->{$this->propertyName} = $requestVar;\n\t\t}\n\n\t}", "function get_url_param( $variable, $default='' )\n {\n return !empty( $_GET[ $variable ] )?$_GET[ $variable ]:$default;\n }", "function pnc_requestFilter( $inRequestVariable, $inRegex, $inDefault = \"\" ) {\n if( ! isset( $_REQUEST[ $inRequestVariable ] ) ) {\n return $inDefault;\n }\n\n return pnc_filter( $_REQUEST[ $inRequestVariable ], $inRegex, $inDefault );\n }", "function rest_parse_request_arg($value, $request, $param)\n {\n }", "function GET($key)\n {\n if (isset($_GET[$key]))\n $value = $_GET[$key];\n elseif (isset($GLOBALS['HTTP_GET_VARS'][$key]))\n $value = $GLOBALS['HTTP_GET_VARS'][$key];\n elseif (isset($_POST[$key]))\n $value = $_POST[$key];\n elseif (isset($GLOBALS['HTTP_POST_VARS'][$key]))\n $value = $GLOBALS['HTTP_POST_VARS'][$key];\n else\n return \"\";\n if (get_magic_quotes_gpc())\n return stripslashes($value);\n return $value;\n }", "protected function getRequestValue($name) {\n $requestValues = $this->getLocalSessionValue(self::REQUEST_VAR);\n return isset($requestValues[$name]) ? $requestValues[$name] : null;\n }", "function get_http_var ($name, $sanitize=true, $default=null){\n\t\t//global $HTTP_GET_VARS, $HTTP_POST_VARS;\n\t\tif (array_key_exists($name, $_POST)) {\n\t\t\treturn mk_utf8(clean_var($_POST[$name], $sanitize));\n\t\t}\n\t\tif (array_key_exists($name, $_GET)) {\n\t\t\treturn mk_utf8(clean_var($_GET[$name], $sanitize));\n\t\t}\n\t\n\t\treturn $default;\n\t}", "private function getData($var) {\n return isset($_POST[$var]) ? $_POST[$var] : (isset($_GET[$var]) ? $_GET[$var] : null);\n }", "function GetPost ($var, $default='') {\n\treturn GetRequest($_POST, $var, $default);\n\t/*\n\tif (isset($_POST[$var]))\n\t\t$val = $_POST[$var];\n\telse\n\t\t$val = $default;\n\treturn $val;\n\t*/\n}", "function getVars() {\r\n return !empty($_POST) ? $_POST : (!empty($_GET) ? $_GET : NULL);\r\n }", "function param($key, $default = NULL)\n{\n\treturn isset($_REQUEST[$key]) ? $_REQUEST[$key] : $default;\n}", "function get_param($param_name)\n{\n $param_value = \"\";\n if(isset($_POST[$param_name]))\n $param_value = $_POST[$param_name];\n else if(isset($_GET[$param_name]))\n $param_value = $_GET[$param_name];\n\n return $param_value;\n}", "function app_contact_get_var($val = '', $default = '') {\n return !isset($_REQUEST[$val]) ? $default : trim($_REQUEST[$val], ' <>');\n}", "public static function post($variable='*'){\n \n self::load();\n \n if($variable!='*'){\n return self::$request->request->get($variable); \n }\n else{\n return self::$request->request->all();\n }\n }", "function getVal( $name, $default = '' ) {\r\n\t\t\r\n\t\tif( isset( $_REQUEST[$name] ) ) return $this->unquote( $_REQUEST[$name] );\r\n\t\telse return $this->unquote( $default );\r\n\t}", "protected function _request() {\n\t\treturn $this->_container->request;\n\t}", "function GetVar($name, $default_value = false) {\r\n if (!isset($_GET)) {\r\n return false;\r\n }\r\n if (isset($_GET[$name])) {\r\n if (!get_magic_quotes_gpc()) {\r\n return InjectSlashes($_GET[$name]);\r\n }\r\n return $_GET[$name];\r\n }\r\n return $default_value;\r\n}", "function get($key)\n{\n\treturn System::request()->get($key);\n}", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "function mapRequestVars($request) {\n\t$callstatus=$request->get('callstatus');\n\t$uuid=$request->get('uuid');\n\t$request->set(\"callUUID\",$uuid);\n\t$date = new DateTime();\n\t$date->setTimestamp($request->get('timestamp'));\n\t$request->set(\"StartTime\",$date->format('Y-m-d H:i:s'));\n\tif ($request->get('callstate')) \n\t $request->set('callstatus',$request->get('callstate'));\n\tswitch ($callstatus) {\n\t case \"call_start\" :\n\t\t$request->set(\"callstatus\",'CallStart');\n\t\t$src=$request->get('src');\n\t\t$request->set(\"callerIdNumber\",$src['number']);\n\t\t$request->set(\"callerIdName\",$src['name']); \n\t break;\n\t case \"call_ringing\" :\t \n\t\t$request->set(\"callstatus\",'StartApp');\t\t\t\n \t break;\n\t case \"call_answered\" :\t \n\t\t$request->set(\"callstatus\",'DialAnswer');\t\t\t\n \t break;\n\t case \"call_end\" :\n\t\tif ($request->get('src')) {\n\t\t $src=$request->get('src');\n\t\t $request->set(\"callerIdNumber\",$src['number']);\n\t\t $request->set(\"callerIdName\",$src['name']); \n\t\t}\t \n\t\t$request->set(\"callstatus\",'EndCall');\t\t\t\n \t break;\n\n\t}\n\t\n\treturn $request;\n }", "public static function Get($key)\n {\n return $_REQUEST[$key];\n }", "protected function getRequest() {}", "function getVariable($nombre, $default = '') {\r\n\tif (isset($_POST[$nombre])) {\r\n\t\treturn $_POST[$nombre];\r\n\t} elseif(isset($_GET[$nombre])) {\r\n\t\treturn $_GET[$nombre];\r\n\t} else {\r\n\t\treturn $default;\r\n\t}\r\n}", "function GetGet ($var, $default='') {\n\treturn GetRequest($_GET, $var, $default);\n\t/*\n\tif (isset($_GET[$var]))\n\t\t$val = $_GET[$var];\n\telse\n\t\t$val = $default;\n\treturn $val;\n\t*/\n}", "function getRequest();", "function input_request(string $key): ?string\n{\n return \\array_key_exists($key, $_REQUEST) ?\n \\wp_unslash($_REQUEST[$key]) : null;\n}", "function get_form_var($variable, $type = 'string')\n{\n // We use some functions from here\n require_once \"functions.inc\";\n \n global $cli_params, $allow_cli;\n \n // Set the default value, and make sure it's the right type\n if (func_num_args() > 2)\n {\n $value = func_get_arg(2);\n $value = ($type == 'array') ? (array)$value : $value;\n }\n else\n {\n $value = ($type == 'array') ? array() : NULL;\n }\n \n // Get the command line arguments if any (and we're allowed to),\n // otherwise get the POST variables\n if ($allow_cli && (!empty($cli_params) && isset($cli_params[$variable])))\n {\n $value = $cli_params[$variable];\n }\n else if (!empty($_POST) && isset($_POST[$variable]))\n {\n $value = $_POST[$variable];\n }\n else if (!empty($HTTP_POST_VARS) && isset($HTTP_POST_VARS[$variable]))\n {\n $value = $HTTP_POST_VARS[$variable];\n }\n \n // Then get the GET variables\n if (!empty($_GET) && isset($_GET[$variable]))\n {\n $value = $_GET[$variable];\n }\n else if (!empty($HTTP_GET_VARS) && isset($HTTP_GET_VARS[$variable]))\n {\n $value = $HTTP_GET_VARS[$variable];\n }\n \n // Cast to an array if necessary\n if ($type == 'array')\n {\n $value = (array)$value;\n }\n \n // Clean up the variable\n if ($value != NULL)\n {\n if ($type == 'int')\n {\n $value = intval(unslashes($value));\n }\n else if ($type == 'string')\n {\n $value = unslashes($value);\n }\n else if ($type == 'array')\n {\n foreach ($value as $arrkey => $arrvalue)\n {\n $value[$arrkey] = unslashes($arrvalue);\n }\n }\n }\n return $value;\n}", "function getallrequest(){\r\n\tglobal $_REQUEST;\r\n\tforeach($_REQUEST as $index => $value){\r\n\t\tglobal $$index;\r\n\t\t$$index = $value;\r\n\t}\r\n}", "function SM_getVar($varName) {\n global $SM_siteManager;\n return $SM_siteManager->inVarH->getVar($varName);\n}", "function check_single_incomming_var($var, $request = FALSE, $url_decode = FALSE) {\n if ((is_string($var) || is_numeric($var)) && !is_array($var)) {\n if (($request == TRUE) && isset($_REQUEST[$var])) {\n $value = $_REQUEST[$var];\n } elseif ($request == FALSE) {\n $value = $var;\n } else {\n $value = NULL;\n }\n if ($value === '') {\n return NULL;\n } elseif (($value === 0)) {\n return 0;\n } elseif (($value === '0')) {\n return '0';\n } else {\n// $value = htmlspecialchars($value);\n }\n if ($url_decode) {\n $value = urldecode($value);\n }\n if (\\json_decode($value) === NULL) {\n// $search = ['\\\\', \"\\0\", \"\\n\", \"\\r\", \"'\", '\"', \"\\x1a\"];\n// $replace = ['\\\\\\\\', '\\\\0', '\\\\n', '\\\\r', \"\\\\'\", '\\\\\"', '\\\\Z'];\n// $value = str_replace($search, $replace, $value);\n// $value = @mysql_real_escape_string($value);\n }\n return $value;\n } else {\n return NULL;\n }\n}", "public function getReqVars()\n\t{\n\t\treturn $this->_requestVars;\n\t}", "function get_param($param_name)\n{\n if($_POST[$param_name])\n\t\treturn $_POST[$param_name];\n\telse\n\t\treturn $_GET[$param_name];\n}", "function news_requestFilter( $inRequestVariable, $inRegex, $inDefault = \"\" ) {\n if( ! isset( $_REQUEST[ $inRequestVariable ] ) ) {\n return $inDefault;\n }\n \n $numMatches = preg_match( $inRegex,\n $_REQUEST[ $inRequestVariable ], $matches );\n\n if( $numMatches != 1 ) {\n return $inDefault;\n }\n \n return $matches[0];\n }", "function formReq( $var )\n{\n /**\n * $redirect stores page to redirect user to upon failure\n * This variable is declared in the page, just before the form fields are tested.\n *\n * @global string $redirect\n */\n global $redirect ;\n\n if ( empty( $var ) )\n { myRedirect( $redirect ) ; }\n else\n { return dbIn( $var ) ; }\n}", "static function get_http_post_val($post_variable) {\n if (isset($_POST[$post_variable])) {\n return $_POST[$post_variable];\n } else {\n return '';\n }\n }", "function set_query_var($query_var, $value)\n {\n }", "public function getVars()\n\t{\n\t\treturn $this->requestVars;\n\t}", "public function getRequestParameter($key) {\n $val = $this->getUriParameter($key);\n return str_replace('+',' ',$val);\n }", "public function getRequestParams();", "function get_req_vars( array $arr_input){\n\t\t\t$ret = array();\n\t\tforeach($arr_input as $k => $v){\n\t\t\tif(isset($_GET[$k])&&strlen($_GET[$k])){\n\n\t\t\t\t$ret[$k] = $k.'='.$_GET[$k];\n\t\t\t\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\t$ret[$k] = $k.'='.$v;\n\t\t\t\n\t\t\t}\n\n\t\t}\n\t\treturn implode('&',$ret);\n\t\t\n\t\t}", "public static function getRequestString(){\n return implode('/', self::getRequestVars());\n }", "function get_request_g($key, $default=false, $stripslahes=false)\n{\n return Request::GetValueG($key, $default, $stripslahes);\n}", "public static function request($variable='*', $filter_rules = NULL){\n \n self::load();\n \n if($variable != '*'){\n return self::$parameters->get($variable); \n }\n else{\n return self::$parameters->all(); \n }\n }", "private function check_request_variables()\n {\n $page_var = $this->prefix . 'page';\n $results_var = $this->prefix . 'results';\n if ( array_key_exists($page_var, $_REQUEST)\n && !empty($_REQUEST[$page_var]))\n {\n $this->current_page = $_REQUEST[$page_var];\n }\n if ( array_key_exists($results_var, $_REQUEST)\n && !empty($_REQUEST[$results_var]))\n {\n $this->results_per_page = $_REQUEST[$results_var];\n }\n $this->offset = ($this->current_page-1) * $this->results_per_page;\n if ($this->offset < 0)\n {\n $this->offset = 0;\n }\n return;\n }", "private function parseRequestParameter()\n {\n \t$paramIndentifier = $this->getSettingParameter('identifier');\n \t$paramFileName = $this->getSettingParameter('fileName');\n \t$paramChunkedNumber = $this->getSettingParameter('chunkedNumber');\n \t$paramChunkedSize = $this->getSettingParameter('chunkedSize');\n \t$paramTotalFileSize = $this->getSettingParameter('totalFileSize');\n \t$paramTotalChunkOfFile = $this->getSettingParameter('numberChunkedOfFile');\n\n \t$this->indentifier = (string) $this->request->getParam($paramIndentifier);\n \t$this->fileName = (string) $this->request->getParam($paramFileName);\n \t$this->chunkedNumber = (int) $this->request->getParam($paramChunkedNumber);\n \t$this->chunkedSize = $this->request->getParam($paramChunkedSize);\n \t$this->totalFileSize = $this->request->getParam($paramTotalFileSize);\n \t$this->numberChunkedOfFile = (int) $this->request->getParam($paramTotalChunkOfFile);\n }", "function iformReq( $var, &$myConn )\n{\n /**\n * $redirect stores page to redirect user to upon failure\n * These variables are declared in the page, just before the form fields are tested.\n *\n * @global string $redirect\n */\n global $redirect ;\n\n if ( empty( $var ) )\n { myRedirect( $redirect ) ; }\n else\n { return idbIn( $var, $myConn ) ; }\n}", "function param($p, $def=\"\") {\n\t//global $_SERVER, $_SESSION, $_COOKIE, $_REQUEST, $_POST, $_GET;\n\tif (!empty($_SESSION)&&isset($_SESSION[$p])) return $_SESSION[$p];\n\telse if (isset($_COOKIE[$p])) return $_COOKIE[$p];\n\telse if (isset($_REQUEST[$p])) return $_REQUEST[$p];\n\telse if (isset($_POST[$p])) return $_POST[$p];\n\telse if (isset($_GET[$p])) return $_GET[$p];\n\telse return $def;\n}", "function getParam($path, $variableName, $default=\"\", $remainingData=false) {\r\n\tif (isset($_GET[$variableName])) {\r\n\t\t$val = $_GET[$variableName];\r\n\t} else {\r\n\t\t$val = getParamFromPath($path, $variableName, $default, $remainingData);\r\n\t}\r\n\treturn $val!=\"\" ? $val : $default;\r\n}", "function init_request($request)\n {\n }", "function init_request($request)\n {\n }", "function safePostVar($varName, $default=null)\n{\n if (isset($_POST[$varName]))\n return $_POST[$varName];\n else\n return $default;\n}", "public function getParameter();", "public function getParameter();", "function Set_Getvar_val()\n {\n $this->getvar_val = (int)$_GET[$this->getvar];\n if($this->getvar_val<1)\n {\n $this->getvar_val = 1;\n }\n }", "private static final function getPage(\\phpbb\\request\\request $request) {\n\t\t$page = $request->variable(\"page\", ADispatcher::DEFAULT_CONTROLLER);\n\t\treturn str_replace(\"-\", \"_\", strtolower($page));\n\t}", "public function testManipulateGlobalVariables()\n {\n $this->request->setQuery('global_get_variable', 42);\n $this->request->setPost('global_post_variable', 42);\n }" ]
[ "0.7445338", "0.73322403", "0.7013142", "0.69943714", "0.6848574", "0.6809113", "0.67226964", "0.66490084", "0.6624137", "0.6596486", "0.64351976", "0.6433752", "0.6426492", "0.6324676", "0.62458605", "0.6240321", "0.6236416", "0.62137556", "0.62027913", "0.6182762", "0.6162456", "0.6150829", "0.6122526", "0.60988665", "0.6072107", "0.60400623", "0.60382867", "0.59844035", "0.5974954", "0.597005", "0.5966811", "0.5956332", "0.5905696", "0.5897445", "0.5897445", "0.58775914", "0.5868174", "0.58679575", "0.5867406", "0.58661634", "0.5843425", "0.58384866", "0.5827495", "0.5813229", "0.58021784", "0.58004194", "0.5792736", "0.57905596", "0.5766161", "0.57650197", "0.57595474", "0.5745738", "0.5740585", "0.5738113", "0.5733503", "0.57267845", "0.57267845", "0.57267845", "0.57267845", "0.57267845", "0.57267845", "0.57267845", "0.57267845", "0.57263726", "0.5724883", "0.57190114", "0.57030743", "0.5700708", "0.56964844", "0.5695393", "0.56856394", "0.5674369", "0.56716156", "0.56715673", "0.5669014", "0.5660765", "0.5641299", "0.5637852", "0.5636463", "0.5624924", "0.5622396", "0.56218725", "0.5616715", "0.5615812", "0.56155586", "0.5615193", "0.5606682", "0.5601958", "0.5592967", "0.55893236", "0.5587359", "0.557896", "0.55760413", "0.55760413", "0.5571652", "0.5569937", "0.5569937", "0.5559322", "0.5547535", "0.5540216" ]
0.5657411
76
Set config value. Creates missing config entry.
function set_config($config_name, $config_value, $is_dynamic = false) { global $db, $cache, $config; $sql = 'UPDATE ' . CONFIG_TABLE . " SET config_value = '" . $db->sql_escape($config_value) . "' WHERE config_name = '" . $db->sql_escape($config_name) . "'"; $db->sql_query($sql); if (!$db->sql_affectedrows() && !isset($config[$config_name])) { $sql = 'INSERT INTO ' . CONFIG_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'config_name' => $config_name, 'config_value' => $config_value, 'is_dynamic' => ($is_dynamic) ? 1 : 0)); $db->sql_query($sql); } $config[$config_name] = $config_value; if (!$is_dynamic) { $cache->destroy('config'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setValue($value) {\r\n $cfg = $this->config->get();\r\n $cfg['field_value'] = $value;\r\n $this->config = new \\codename\\core\\config($cfg);\r\n return;\r\n }", "function setIfNot($name, $value) {\n\t\tif ($this->_settings->exists($name)) {\n\t\t\treturn ;\n\t\t} # if\n\t\t\n\t\t$this->_settings->set($name,$value);\n\t}", "public function set($name, $value)\n {\n try {\n if (is_string($name) && is_string($value)) {\n \n if ($value == '') {\n if (array_key_exists($name, $this->_defaults)) {\n $value = $this->_defaults[$name];\n }\n }\n \n if ((new Query)->from('{{%podium_config}}')->where(['name' => $name])->exists()) {\n Yii::$app->db->createCommand()->update('{{%podium_config}}', ['value' => $value], 'name = :name', [':name' => $name])->execute();\n }\n else {\n Yii::$app->db->createCommand()->insert('{{%podium_config}}', ['name' => $name, 'value' => $value])->execute();\n }\n \n $this->cache->set('config', array_merge($this->_defaults, $this->getFromDb()));\n \n return true;\n } \n }\n catch (Exception $e) {\n Log::error($e->getMessage(), null, __METHOD__);\n }\n \n return false;\n }", "public function setConfig($key, $value);", "public function __set($name, $value)\n {\n if ($this->_allowModifications) {\n if (is_array($value)) {\n $this->_data[$name] = new self($value, true);\n } else {\n $this->_data[$name] = $value;\n }\n $this->_count = count($this->_data);\n } else {\n /** @see Zend_Config_Exception */\n require_once 'Zend/Config/Exception.php';\n throw new Zend_Config_Exception('Zend_Config is read only');\n }\n }", "public function setConfig($id, $value) {\n\t\t$config = $this->em->getRepository('SSNTherapassBundle:Config')->find($id);\n\t\tif (is_null($config)) {\n\t\t\t$config = new Config();\n\t\t}\n\t\t$config->setValue($value);\n\t\tif (is_null($config->getId())) {\n\t\t\t$config->setId($id);\n\t\t\t$this->em->persist($config);\n\t\t}\n\t}", "public function set( $name, $value )\n\t{\n\t\t$name = trim( $name, '/' );\n\n\t\tif( $value !== null )\n\t\t{\n\t\t\t$this->cache[ $name ] = $value;\n\n\t\t\tif( isset( $this->negCache[ $name ] ) ) {\n\t\t\t\tunset( $this->negCache[ $name ] );\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->negCache[ $name ] = true;\n\t\t}\n\n\t\t// don't store local configuration\n\t}", "public abstract function setConfig($key, $value);", "public function set(string $configPath, ?string $value, string $scope = null): self;", "function sloodle_set_config($name, $value)\n {\n // If in debug mode, ensure the name is prefixed appropriately for Sloodle\n if (defined('SLOODLE_DEBUG') && SLOODLE_DEBUG) {\n if (substr_count($name, 'sloodle_') < 1) {\n exit (\"ERROR: sloodle_set_config(..) called with invalid value name \\\"$name\\\". Expected \\\"sloodle_\\\" prefix.\");\n }\n }\n // Use the standard Moodle config function, ignoring the 3rd parameter (\"plugin\", which defaults to NULL)\n return set_config(strtolower($name), $value);\n\t}", "function set($name, $value, $site_guid = 0) {\n\n\n\t\t$name = trim($name);\n\n\t\t// cannot store anything longer than 255 characters in db, so catch before we set\n\t\tif (elgg_strlen($name) > 255) {\n\t\t\t_elgg_services()->logger->error(\"The name length for configuration variables cannot be greater than 255\");\n\t\t\treturn false;\n\t\t}\n\n\t\t$site_guid = (int) $site_guid;\n\t\tif ($site_guid == 0) {\n\t\t\t$site_guid = (int) $this->CONFIG->site_guid;\n\t\t}\n\n\t\tif ($site_guid == $this->CONFIG->site_guid) {\n\t\t\t$this->CONFIG->$name = $value;\n\t\t}\n\n\t\t$escaped_name = sanitize_string($name);\n\t\t$escaped_value = sanitize_string(serialize($value));\n\t\t$result = _elgg_services()->db->insertData(\"INSERT INTO {$this->CONFIG->dbprefix}config\n\t\t\tSET name = '$escaped_name', value = '$escaped_value', site_guid = $site_guid\n\t\t\tON DUPLICATE KEY UPDATE value = '$escaped_value'\");\n\n\t\treturn $result !== false;\n\t}", "public static function set($id, $value)\n {\n self::$config[$id] = $value;\n\n if (Configuration::where('id', $id)->exists()) {\n Configuration::where('id', $id)->update([\n 'value' => serialize($value)\n ]);\n\n return;\n }\n\n Configuration::insert([\n 'id' => $id,\n 'value' => serialize($value)\n ]);\n }", "public static function set(string $config, mixed $value) : void{\n self::$configurations[$config] = $value;\n }", "function set_external_config($key, $value)\n {\n $this->_external_config[$key] = $value;\n }", "public function setConfig($data, $value) {\n if (is_string($data)) {\n $this->_config[$data] = $value;\n } else {\n throw new ConfigException(\"Error while setting a config value\");\n }\n }", "function set($key, $val)\n {\n $config[$key] = $val;\n \n }", "function setConfigValue( $path, $value, $type = 'leave' )\n\t{\n\t\t$this->conf[$path]\t\t\t=\t$this->convertValue( $value, $type );\n\t\t$this->currentConf[$path]\t=\t$this->convertValue( $value, $type );\n\t}", "public function testInvalidValueForSet($value)\n {\n AbstractConfigurationInstance::$allowedKeys = ['FsgNGucN'];\n (new AbstractConfigurationInstance())->set('FsgNGucN', $value);\n }", "public function __set($key, $value)\n\t{\n\t\t$this->config(array($key => $value));\n\t}", "public function set($key, $value = null)\n {\n if (func_num_args() === 1 && is_array($key)) {\n foreach ($key as $name => $value) {\n $this->set($name, $value);\n }\n\n return;\n }\n\n if ($this->offsetExists($key)) {\n $this->config[ $key ] = $value;\n } else {\n throw new Exception(\"Config entry «{$key}» doesn't exists. \");\n }\n }", "public function set_config($name, $value) {\n $settingspluginname = 'assessmentsettings';\n $this->load_config();\n if ($value === null) {\n unset($this->config->$name);\n } else {\n $this->config->$name = $value;\n }\n set_config($name, $value, \"local_$settingspluginname\");\n }", "public function set ( $name, $value ) {\n\t\tif(!ctype_alpha(str_replace(' ', '', $name))) {\n\t\t\tthrow new \\InvalidArgumentException(sprintf('The name \"%s\" is invalid.', $name));\n\t\t}\n\t\t$this->config[$name] = $value;\n\t}", "protected function _set_parameter($key, $value)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $file = new File(self::FILE_CONFIG);\n\n if (! $file->exists())\n $file->create('root', 'root', '0644');\n\n $match = $file->replace_lines(\"/^$key\\s*=\\s*/\", \"$key = $value\\n\");\n\n if (!$match)\n $file->add_lines(\"$key = $value\\n\");\n\n $this->is_loaded = FALSE;\n }", "protected function setConfigValue($data){\t\n\t\tMage::getModel('core/config_data')->load($data['path'],'path')->setData($data)->save();\n\t}", "protected function _set_parameter($key, $value)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $this->is_loaded = FALSE;\n\n $file = new File(self::APP_CONFIG);\n\n if (! $file->exists())\n $file->create(\"root\", \"root\", \"0644\");\n\n $match = $file->replace_lines(\"/^$key\\s*=\\s*/\", \"$key = $value\\n\");\n\n if (!$match)\n $file->add_lines(\"$key = $value\\n\");\n }", "public function set_config($data, $value = null)\n\t{\n\t\tif (is_array($data) && $value === null) {\n\t\t\t$this->config = array_merge($this->config, $data);\n\t\t} else {\n\t\t\t$this->config[$data] = $value;\n\t\t}\n\t}", "public function set_config($name, $value) {\n $pluginname = $this->get_name();\n $this->load_config();\n if ($value === null) {\n unset($this->config->$name);\n } else {\n $this->config->$name = $value;\n }\n set_config($name, $value, \"local_$pluginname\");\n }", "function storeConfig( $pName, $pValue, $pPackage = NULL ) {\n\t\tglobal $gMultisites;\n\t\t//stop undefined offset error being thrown after packages are installed\n\t\tif( !empty( $this->mConfig )) {\n\t\t\t// store the pref if we have a value _AND_ it is different from the default\n\t\t\tif( ( empty( $this->mConfig[$pName] ) || ( $this->mConfig[$pName] != $pValue ))) {\n\t\t\t\t// make sure the value doesn't exceede database limitations\n\t\t\t\t$pValue = substr( $pValue, 0, 250 );\n\n\t\t\t\t// store the preference in multisites, if used\n\t\t\t\tif( $this->isPackageActive( 'multisites' ) && @BitBase::verifyId( $gMultisites->mMultisiteId ) && isset( $gMultisites->mConfig[$pName] )) {\n\t\t\t\t\t$query = \"UPDATE `\".BIT_DB_PREFIX.\"multisite_preferences` SET `config_value`=? WHERE `multisite_id`=? AND `config_name`=?\";\n\t\t\t\t\t$result = $this->mDb->query( $query, array( empty( $pValue ) ? '' : $pValue, $gMultisites->mMultisiteId, $pName ) );\n\t\t\t\t} else {\n\t\t\t\t\t$query = \"DELETE FROM `\".BIT_DB_PREFIX.\"kernel_config` WHERE `config_name`=?\";\n\t\t\t\t\t$result = $this->mDb->query( $query, array( $pName ) );\n\t\t\t\t\t// make sure only non-empty values get saved, including '0'\n\t\t\t\t\tif( isset( $pValue ) && ( !empty( $pValue ) || is_numeric( $pValue ))) {\n\t\t\t\t\t\t$query = \"INSERT INTO `\".BIT_DB_PREFIX.\"kernel_config`(`config_name`,`config_value`,`package`) VALUES (?,?,?)\";\n\t\t\t\t\t\t$result = $this->mDb->query( $query, array( $pName, $pValue, strtolower( $pPackage )));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Force the ADODB cache to flush\n\t\t\t\t$isCaching = $this->mDb->isCachingActive();\n\t\t\t\t$this->mDb->setCaching( FALSE );\n\t\t\t\t$this->loadConfig();\n\t\t\t\t$this->mDb->setCaching( $isCaching );\n\t\t\t}\n\t\t}\n\t\t$this->setConfig( $pName, $pValue );\n\t\treturn TRUE;\n\t}", "abstract protected function saveConfiguration($name, $value);", "public function set(string $key, $value) : void\n {\n if (isJson($this->configuration)) {\n $configuration = json_decode($this->configuration, true);\n $configuration[$key] = $value;\n $this->configuration = json_encode($configuration);\n } else {\n $this->configuration = json_encode([\n $key => $value\n ]);\n }\n\n $this->saveOrFail();\n }", "public function edit ( $name, $value ) {\n\t\tif( !$this->has ( $name ) ) {\n\t\t\tthrow new \\InvalidArgumentException(sprintf('The name \"%s\" does not exist and can not be edited.', $name));\n\t\t}\n\t\t$this->config[$name] = $value;\n\t}", "public function __set($name,$value)\n\t{\n\t\tif(in_array($name,$this->config_other_attributes))\n\t\t\t$this->list_other_attributes[$name]=$value;\n\t\telse \n\t\t\tparent::__set($name,$value);\n\t}", "function set($path, $value)\n\t\t{\n\t\t\t$this->Init();\n\t\t\t$path = explode(\"/\", $path);\n\t\t\t$pointer = end($path);\n\t\t\t$tmp = $value;\n\t\t\twhile($pointer){\n\t\t\t\tif (!empty($pointer)){\n\t\t\t\t\t$tmp = array($pointer=>$tmp);\n\t\t\t\t\t$pointer = prev($path);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->settings = array_merge_recursive_overwrite($this->settings, $tmp);\n\t\t\t$this->saveSettings();\n\t\t}", "public static function set(array $config): void;", "public static function set($name, $value)\n {\n self::$config[$name] = $value;\n }", "function __set($name,$value){\r\n try{\r\n return parent::__set($name,$value);\r\n }catch(exception $e){\r\n return $this->_options[$name]=$value;\r\n }\r\n }", "public static function set($name, $value)\n {\n $serialized = false;\n\n // Cache the setting in our static array\n self::$settings[$name] = $value;\n\n if (is_array($value) || is_object($value)) {\n $value = serialize($value);\n $serialized = true;\n }\n\n if (DB::table('settings')->where('name', $name)->count() == 0) {\n DB::table('settings')->insert(\n [\n 'name' => $name,\n 'value' => $value,\n 'serialized' => $serialized,\n ]\n );\n } else {\n DB::table('settings')->where('name', $name)->update(\n [\n 'value' => $value,\n 'serialized' => $serialized,\n ]\n );\n }\n }", "public function setConfig($key, $value)\n {\n Config::set($key, $value);\n }", "function __set($name,$value){\n try{\n return parent::__set($name,$value);\n }catch(exception $e){\n return $this->_options[$name]=$value;\n }\n }", "public function set($config){\n\t\t$this->configValues = $config;\n\t}", "public function set($config, $value = null) {\n if (!is_array($config)) {\n $config = array($config => $value);\n }\n\n foreach ($config as $names => $value) {\n $name = $this->__configVarNames($names);\n\n // Make sure to expand nested array keys too!\n // @todo: Refactor\n if (is_array($value)) {\n foreach ($value AS $k => $v) {\n $key = $name;\n $key[] = $k;\n $this->set(join('.', $key), $v);\n }\n continue;\n }\n\n switch (count($name)) {\n case 7:\n $this->data[$name[0]][$name[1]][$name[2]][$name[3]][$name[4]][$name[5]][$name[6]] = $value;\n break;\n case 6:\n $this->data[$name[0]][$name[1]][$name[2]][$name[3]][$name[4]][$name[5]] = $value;\n break;\n case 5:\n $this->data[$name[0]][$name[1]][$name[2]][$name[3]][$name[4]] = $value;\n break;\n case 4:\n $this->data[$name[0]][$name[1]][$name[2]][$name[3]] = $value;\n break;\n case 3:\n $this->data[$name[0]][$name[1]][$name[2]] = $value;\n break;\n case 2:\n $this->data[$name[0]][$name[1]] = $value;\n break;\n case 1:\n $this->data[$name[0]] = $value;\n break;\n default:\n $this->data = MOC_Array::insert($this->data, join('.', $name), $value);\n break;\n //throw new MOC_Configuration_Exception(sprintf('Unable to set the value. Depth is invalid (\"%s\")', count($name)));\n }\n }\n }", "public function testGetSetConfig()\n {\n $this->config->set('foo', 'baz');\n $this->assertEquals($this->config->get('foo'), 'baz');\n }", "public static function setup($name,$value = \"\") {\n if(!is_array($name)) {\n if($name == \"storage\") {\n self::$storage = $value;\n }\n\n self::$config[$name] = $value;\n } else {\n foreach($name as $n=>$value) {\n self::setup($n,$value);\n }\n }\n\n }", "public function set( $key, $value ) {\n\n $this->_getConfigVars();\n $this->_conf[$key] = $value;\n $this->_updateConfigFile();\n }", "public static function set($key, $value)\n {\n $config = static::load();\n\n Arr::set($config, self::buildKey($key), is_array($value) ? $value : trim($value));\n\n file_put_contents(static::path(), json_encode($config, JSON_PRETTY_PRINT));\n }", "public function set($key, $value)\n\t{\n\t\t$this->componentConfig->set($key, $value);\n\t}", "public function set($value = null);", "public function __set($name, $value)\n { \n if(in_array($name, $this->settings))\n return $this->setting($name, $value);\n \n if($this->_validVariableName($name))\n {\n // iz gud\n $this->_data[$name] = $value; \n }\n }", "function setConfig( $pName, $pValue ) {\n\t\t$this->mConfig[$pName] = $pValue;\n\t\treturn( TRUE );\n\t}", "private function setConfig($name, $value, $target = null)\n {\n switch($target){\n \n case self::HEADER:\n $this->config->header->{$name} = $value;\n break;\n \n case self::CONTENT:\n $this->config->content->{$name} = $value;\n break;\n \n default:\n $this->config->{$name} = $value;\n break;\n }\n }", "public static function set(string $key, mixed $value)\n {\n static::$config[$key] = $value;\n }", "public static function set($q = 'store/blind', $value = false)\n {\n $branch = &self::$config;\n $section = explode('/', trim($q, ' /'));\n\n if(count($section)>1)\n {\n $lastRound = count($section)-1;\n\n foreach($section as $k => $s)\n {\n if(is_object($branch))\n {\n $branch = &$branch->$s;\n }else{\n $branch = &$branch[$s];\n }\n\n if($lastRound == $k)\n {\n $branch = $value;\n }\n }\n unset($branch);\n }\n }", "public function set($name, $value) {\n\t\tif (array_key_exists($name, $this->attributes)) {\n\t\t\t// Check that we're not trying to change the guid!\n\t\t\tif ((array_key_exists('guid', $this->attributes)) && ($name == 'guid')) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$this->attributes[$name] = $value;\n\t\t} else {\n\t\t\treturn $this->setPrivateSetting($name, $value);\n\t\t}\n\n\t\treturn true;\n\t}", "public function setConfig( $config, $value = null )\n {\n if ( is_array( $config ) ) {\n foreach ( $config as $name => $value ) {\n $this->setConfig( $name, $value );\n }\n\n } else {\n if ( !array_key_exists( $config, $this->config ) ) {\n\t\t\t\t// We only trigger an error here as using an unknow config param isn't fatal\n\t\t\t\ttrigger_error( \"Unknown configuration parameter '{$config}'\", E_USER_WARNING );\n } else {\n\t\t\t\t$this->config[$config] = $value;\n\t\t\t}\n }\n return $this;\n }", "public function set(string $name, $value = null): self\n {\n // Load\n $this->loadConfigRepository();\n\n $this->configs[$name] = $value;\n\n return $this;\n }", "public static function setGlobalConfig($key = null, $value = null)\n {\n if (null == $key) {\n return false;\n }\n $db = Base_Database::getConnection();\n try {\n $sql = \"SELECT value FROM config WHERE key = ? LIMIT 0, 1\";\n $query = $db->prepare($sql);\n $query->execute(array($key));\n $finder = $query->fetchAll(PDO::FETCH_ASSOC);\n if ($finder == false) {\n $sql = \"INSERT INTO config (key, value) VALUES (?, ?)\";\n $query = $db->prepare($sql);\n $query->execute(array($key, $value));\n } else {\n if (null == $value) {\n $sql = \"DELETE FROM config WHERE key = ?\";\n $query = $db->prepare($sql);\n $query->execute(array($key));\n } else {\n $sql = \"UPDATE config SET value = ? WHERE key = ?\";\n $query = $db->prepare($sql);\n $query->execute(array($value, $key));\n }\n }\n } catch(Exception $e) {\n error_log($e);\n return false;\n }\n return true;\n }", "public function set( $name, $value = NULL );", "public function setValue($config_id, $value, $type, $project_id = 0, $user_id = 0, $access_reqd = 90) {\n\n $query = \"SELECT * FROM `mantis_config_table` WHERE config_id='$config_id' AND project_id='$project_id'\";\n $result = SqlWrapper::getInstance()->sql_query($query);\n\t if (!$result) {\n \t if (!self::$quiet) {\n echo \"<span style='color:red'>ERROR: Query FAILED</span>\";\n }\n \t exit;\n }\n if (0 == SqlWrapper::getInstance()->sql_num_rows($result)) {\n\n self::$logger->debug(\"setValue $config_id: $value (type=$type)\");\n\n // --- add to DB\n $query = \"INSERT INTO `mantis_config_table` (`config_id`, `project_id`, `user_id`, `access_reqd`, `type`, `value`) \".\n \"VALUES ('$config_id', '$project_id', '$user_id', '$access_reqd', '$type', '$value');\";\n $result = SqlWrapper::getInstance()->sql_query($query);\n\t if (!$result) {\n \t if (!self::$quiet) {\n echo \"<span style='color:red'>ERROR: Query FAILED</span>\";\n }\n \t exit;\n }\n\n\n // --- add/replace Cache\n $key = $config_id.\"_\".$project_id;\n self::$configVariables[\"$key\"] = new ConfigMantisItem($config_id, $project_id, $user_id, $access_reqd, $type, $value);\n } else {\n self::$logger->warn(\"setValue($config_id, $project_id): variable already exists and will NOT be modified.\");\n }\n\n }", "protected function _setValue($name, $value) {}", "public static function put($key, $value, $json = false)\n {\n if ($json) $value = json_encode($value);\n\n static::$cache[$key] = $value;\n\n $config = DBConfig::where('_key', '=', $key)->first();\n\n if (is_null($config)) { // new key, create the entry\n DBConfig::create(array(\n '_key' => $key,\n 'value' => $value\n ));\n } else { // update the entry\n $config->value = $value;\n $config->save();\n }\n }", "public static function config_set($key, $value)\n {\n // Do this to make sure that the config array is already loaded\n self::config($key);\n\n if (substr($key, 0, 7) === 'routes.') {\n // Routes cannot contain sub keys due to possible dots in regex\n $keys = explode('.', $key, 2);\n } else {\n // Convert dot-noted key string to an array\n $keys = explode('.', $key);\n }\n\n // Used for recursion\n $conf =& self::$configuration;\n $last = count($keys) - 1;\n\n foreach ($keys as $i => $k) {\n if ($i === $last) {\n $conf[$k] = $value;\n } else {\n $conf =& $conf[$k];\n }\n }\n\n if ($key === 'core.modules') {\n // Reprocess the include paths\n self::include_paths(true);\n }\n\n return true;\n }", "public function SetConfiguration($var, $value) {\n //-------------------------------------------------------------------------------------------------------\n $db_query = '\n INSERT INTO \n `'.$this->db_prefix.$this->db_orbitvu.'configuration`\n (`var`, `value`, `type`)\n\n VALUES (\n \\''.$var.'\\',\n \\''.$this->database->Escape($value).'\\',\n \\'main\\'\n )\n\n ON DUPLICATE KEY \n \n UPDATE\n `value` = \\''.($value).'\\'\n ';\n\n //---------------------------------------------------------------------\n /**/\t$this->return_sql_debug(__FUNCTION__, $db_query);\n //---------------------------------------------------------------------\n\n $query = $this->database->Query($db_query);\n \n //-------------------------------------------------------------------------------------------------------\n $this->Log(0, '_configuration', 'update', $var.'='.$value, 'auto');\n //-------------------------------------------------------------------------------------------------------\n return true;\n //-------------------------------------------------------------------------------------------------------\n }", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function addConfig($key, $value) {\n $this->config[\"key\"]=$value;\n return;\n }", "public static function config_save($key, $value, $create = true) {\n\t\t//get original value\n $original_value = Kohana::config($key);\n if (is_numeric($value)) {\n $value = $value . '';\n }\n\t\t// Get the group name from the key\n\t\t$keys = explode('.', $key, 2); // $keys[0] is the config filename, $keys[1] is the parameter name\n $config_file = APPPATH . 'config/' . $keys[0] . '.php';\n\n if (!file_exists($config_file) && $create) {\n $config_files = Kohana::find_file('config', $keys[0]);\n self::$config_data[$keys[0]] = file_get_contents(array_pop($config_files));\n $handle = fopen($config_file, 'w+b');\n fclose($handle);\n }\n\n if (empty(self::$config_data[$keys[0]])) {\n self::$config_data[$keys[0]] = file_get_contents($config_file);\n }\n\n /*\n check if is array to array or string to string\n */\n $value = var_export($value, true);\n self::$config_data[$keys[0]] = preg_replace('#(\\$config\\[\\'' . $keys[1] . '\\'\\] = )(.*?)([\\)\\']{1})(;\\s+)#s', '$1' . $value . '$4', self::$config_data[$keys[0]]);\n\n file_put_contents($config_file, self::$config_data[$keys[0]]);\n return true;\n }", "public function set_config( $config, $value = null )\n\t{\n\t\tif ( is_array( $config ) ) {\n\t\t\tforeach ( $config as $name => $value ) {\n\t\t\t\t$this->set_config( $name, $value );\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif ( is_array( $value ) ) {\n\t\t\t\t$this->config[ $config ] = array_merge( $this->config[ $config ], $value );\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->config[ $config ] = $value;\n\t\t\t}\n\t\t}\n\t}", "public function setValue($config, $value) {\n\t\t$this->dispatch('SystemConfigSetValue', array($config, $value));\n\t\t$this->config->setConfigValue($config, $value);\n\t}", "public function __set( $name, $value )\n {\n if ( $name === 'default' &&\n $this->checkValue( $value ) )\n {\n $this->defaultValue = $value;\n }\n }", "function set($setting, $value , $instance_id = null)\r\n\t{\r\n\t\treturn parent::set($setting, $value);\r\n\t}", "public function __set($name, $value)\r\n {\r\n if(array_key_exists($name, self::READ_WRITE)) {\r\n if(self::READ_WRITE[$name] === true) {\r\n $path = $this->getPath($name);\r\n if($path !== null) {\r\n $this->readPath($path, $value);\r\n }\r\n }\r\n } else {\r\n $path = $this->getPath($name);\r\n if($path !== false) {\r\n $this->readPath($path, $value);\r\n } else {\r\n $path = \"data.attributes.metadata.{$name}\";\r\n $this->_index[$name] = $path;\r\n $this->readPath($path, $value);\r\n }\r\n }\r\n }", "public function __set($name, $value) {\n\t\tswitch($name) {\n\t\t\tcase \"applicationDefinitionId\":\n\t\t\t\t$this->setApplicationDefinitionId($value); return;\n\t\t\tcase \"pageDefinitionId\": $this->setPageDefinitionId($value); return;\n\t\t\tcase \"title\": $this->setTitle($value); return;\n\t\t\tcase \"icon\": $this->setIcon($value); return;\n\t\t\tcase \"phpSelector\": $this->setPhpSelector($value); return;\n\t\t\tcase \"titleWidth\": $this->setTitleWidth($value); return;\n\t\t\tcase \"titleLabel\": $this->setTitleLabel($value); return;\n\t\t}\n\t\tthrow new \\Scrivo\\SystemException(\"No such set-property '$name'.\");\n\t}", "public function setWithConfig(string $id, $class, $config_file, $setter = false);", "public function persistConfig($key, $value)\n {\n $config = Config::getInstance();\n $config->persist($key, $value);\n $config->save();\n }", "public static function set(string $key, $value)\n {\n if (!self::$configLoaded) {\n self::loadConfig();\n }\n\n self::$config[$key] = $value;\n }", "public function set_config($key, $value) {\n $this->config[$key] = $value;\n }", "protected function setUserConfig($id, $key, $value) {\n $config = $this->getUserConfig($id);\n Dot::setValue($config, $key, $value);\n $this->registry[$id] = $config;\n $this->setConfig(\"config.names.$id\", $config);\n }", "public function set($path, $value){\n\t\t$keys = explode('/', trim($path, '\\/\\\\'));\n\t\t$settings = &$this->_settings;\n\t\t$last_key = end($keys);\n\t\tforeach($keys as $key){\n\t\t\tif(!isset($settings[(string)$key])) $settings = array((string)$key => []); //define it\n\n\t\t\tif($last_key == $key){\n\t\t\t\t$settings[(string)$key] = $value;\n\t\t\t\t//write to begining of setting file\n\t\t\t\t//fseek($this->_handle, 0); //seek to begining\n\t\t\t\t//fwrite($this->_handle, json_encode($this->_settings, JSON_PRETTY_PRINT));\n\t\t\t\tfile_put_contents($this->_file, str_replace('\\/', '/', json_encode($this->_settings, JSON_PRETTY_PRINT)));\n\t\t\t\treturn $this;\n\t\t\t}\n\n\t\t\t$settings = &$settings[(string)$key];\n\t\t}\n\t\treturn $this;\n\t}", "function _set_config_param($name,$value)\r\n\t{\r\n\t\t$this->db->query(\"update m_config_params set value = ? where name = ? limit 1\",array($value,$name));\r\n\t}", "public function setSettingIfNot(&$pref, $name, $value)\n {\n if (isset($pref[$name])) {\n return;\n } // if\n\n $pref[$name] = $value;\n }", "public function setConfig($a_configItem, $a_value)\n {\n $this->m_config[$a_configItem] = $a_value;\n }", "function confset($key, $value){\n\tglobal $FILEPATH;\n\t$lines = array();\n\t$found = False;\n\t$fp = fopen($FILEPATH.'config.php','r');\n\twhile($line = fgets($fp)){\n\t\tif (strpos($line,\"\\$$key \") === 0){\n\t\t\t$lines[] = \"\\$$key = $value;\\n\";\n\t\t\t$found = True;\n\t\t}\n\t\telseif (strpos($line,\"?>\") === 0 && $found == False){\n\t\t\t$lines[] = \"\\$$key = $value;\\n\";\n\t\t\t$lines[] = \"?>\\n\";\n\t\t}\n\t\telse\n\t\t\t$lines[] = $line;\n\t}\n\tfclose($fp);\n\n\t$fp = fopen($FILEPATH.'config.php','w');\n\tforeach($lines as $line)\n\t\tfwrite($fp,$line);\n\tfclose($fp);\n}", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);" ]
[ "0.649098", "0.64701796", "0.64698213", "0.6448833", "0.6437095", "0.6364099", "0.63493466", "0.63445896", "0.62942874", "0.6192027", "0.6163401", "0.6133507", "0.61061466", "0.6080813", "0.6055669", "0.60529345", "0.6052547", "0.6012025", "0.6012", "0.60089445", "0.59807116", "0.5976262", "0.59614503", "0.5960584", "0.59518063", "0.59350026", "0.5921294", "0.59034497", "0.5881119", "0.58708376", "0.586565", "0.5856607", "0.585152", "0.5831682", "0.58306366", "0.58264667", "0.5794153", "0.5791629", "0.5790185", "0.57799965", "0.5749569", "0.573896", "0.57235825", "0.57147115", "0.5685347", "0.56707114", "0.5659568", "0.5657769", "0.56465995", "0.5637275", "0.5614305", "0.56089145", "0.5608113", "0.56046015", "0.56020844", "0.5600109", "0.55849755", "0.55808735", "0.55793095", "0.55774176", "0.5576931", "0.5568085", "0.5560463", "0.5560463", "0.5560463", "0.5560463", "0.5560463", "0.5560463", "0.5560463", "0.5560463", "0.5560463", "0.5560463", "0.5560463", "0.5559956", "0.5559956", "0.55551183", "0.5554564", "0.55472195", "0.5538994", "0.55357075", "0.5520253", "0.55153984", "0.5514351", "0.54980505", "0.54942846", "0.54885125", "0.54851687", "0.5484876", "0.54784024", "0.5478177", "0.54776955", "0.5468617", "0.5467588", "0.5452453", "0.5452453", "0.5452453", "0.5452453", "0.5452453", "0.5452453", "0.5452453" ]
0.59076494
27
Set dynamic config value with arithmetic operation.
function set_config_count($config_name, $increment, $is_dynamic = false) { global $db, $cache; switch ($db->sql_layer) { case 'firebird': $sql_update = 'CAST(CAST(config_value as integer) + ' . (int) $increment . ' as VARCHAR(255))'; break; case 'postgres': $sql_update = 'int4(config_value) + ' . (int) $increment; break; // MySQL, SQlite, mssql, mssql_odbc, oracle default: $sql_update = 'config_value + ' . (int) $increment; break; } $db->sql_query('UPDATE ' . CONFIG_TABLE . ' SET config_value = ' . $sql_update . " WHERE config_name = '" . $db->sql_escape($config_name) . "'"); if (!$is_dynamic) { $cache->destroy('config'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set(string $value): CalcInterface;", "function set_config($config_name, $config_value, $is_dynamic = false)\n{\n\tglobal $db, $cache, $config;\n\n\t$sql = 'UPDATE ' . CONFIG_TABLE . \"\n\t\tSET config_value = '\" . $db->sql_escape($config_value) . \"'\n\t\tWHERE config_name = '\" . $db->sql_escape($config_name) . \"'\";\n\t$db->sql_query($sql);\n\n\tif (!$db->sql_affectedrows() && !isset($config[$config_name]))\n\t{\n\t\t$sql = 'INSERT INTO ' . CONFIG_TABLE . ' ' . $db->sql_build_array('INSERT', array(\n\t\t\t'config_name'\t=> $config_name,\n\t\t\t'config_value'\t=> $config_value,\n\t\t\t'is_dynamic'\t=> ($is_dynamic) ? 1 : 0));\n\t\t$db->sql_query($sql);\n\t}\n\n\t$config[$config_name] = $config_value;\n\n\tif (!$is_dynamic)\n\t{\n\t\t$cache->destroy('config');\n\t}\n}", "function ShippingCalculator($config) {\n\t\tif($config) {\n\t\t\tforeach($config as $k => $v) $this->$k = $v;\n\t\t}\n\t}", "public abstract function setConfig($key, $value);", "public function setCalculation($calculation);", "protected function _setNumeric($name, $value) {}", "public function setConfig($key, $value);", "public function testNumericConfig()\n {\n $this->specify(\n \"Access by numeric key does not return the expected result\",\n function () {\n $config = new Config(['abc']);\n expect($config->{0})->equals('abc');\n }\n );\n }", "protected function setConfigValue($data){\t\n\t\tMage::getModel('core/config_data')->load($data['path'],'path')->setData($data)->save();\n\t}", "function setConfigValue( $path, $value, $type = 'leave' )\n\t{\n\t\t$this->conf[$path]\t\t\t=\t$this->convertValue( $value, $type );\n\t\t$this->currentConf[$path]\t=\t$this->convertValue( $value, $type );\n\t}", "public function getValueInstance(array $config);", "public function SetConfig($func, $val)\r\n {\r\n $this->config[$func] = $val;\r\n }", "protected function setOperand () {\n $modelName = Str::camel($this->validation->master->data_model->name);\n $columnName = $this->validation->master->column_detail->name;\n\n $this->operand = $this->request[ $modelName ]->$columnName ?? 'INVALID';\n }", "public function applyValue($value);", "public function register_dynamic_settings()\n {\n }", "protected function evalConfig($config)\n {\n if (isset($config['width']))\n $this->width = $config['width'];\n\n if (isset($config['cssClass']))\n $this->cssClass = $config['cssClass'];\n\n if (isset($config['searchable']))\n $this->searchable = $config['searchable'];\n\n if (isset($config['sortable']))\n $this->sortable = $config['sortable'];\n\n if (isset($config['editable']))\n $this->editable = $config['editable'];\n\n if (isset($config['invisible']))\n $this->invisible = $config['invisible'];\n\n if (isset($config['valueFrom']))\n $this->valueFrom = $config['valueFrom'];\n\n if (isset($config['default']))\n $this->defaults = $config['default'];\n\n if (isset($config['select']))\n $this->sqlSelect = $config['select'];\n\n if (isset($config['relation']))\n $this->relation = $config['relation'];\n\n if (isset($config['attributes']))\n $this->attributes = $config['attributes'];\n\n if (isset($config['format']))\n $this->format = $config['format'];\n\n if (isset($config['path']))\n $this->path = $config['path'];\n\n if (isset($config['formatter']))\n $this->formatter = $config['formatter'];\n\n if (isset($config['iconCssClass']))\n $this->iconCssClass = $config['iconCssClass'];\n\n return $config;\n }", "public function set_reward_point_multiplier($value = FALSE)\r\n\t{\t\t\r\n\t\tif (empty($value) || $value < 0)\r\n\t\t{\r\n\t\t\t// Look-up database value.\r\n\t\t\tif ($config_data = $this->get_database_config_data('reward_point_multiplier'))\r\n\t\t\t{\r\n\t\t\t\t$value = $config_data[$this->flexi->cart_database['configuration']['columns']['reward_point_multiplier']];\r\n\t\t\t}\r\n\t\t\t// Look-up config file value.\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$value = $this->flexi->cart_defaults['configuration']['reward_point_multiplier'];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->flexi->cart_contents['settings']['configuration']['reward_point_multiplier'] = $this->format_calculation($value, 4, TRUE);\r\n\t\t\r\n\t\treturn TRUE;\r\n\t}", "public function set_value($value) {\n\t\t$this->_value = $value + 0;\n\t}", "public function register_scalar(string $type_name, array $config)\n {\n }", "public function testDynamicAllowedValues() {\n // Verify that validation passes against every value we had.\n foreach ($this->test as $key => $value) {\n $this->entity->test_options->value = $value;\n $violations = $this->entity->test_options->validate();\n $this->assertCount(0, $violations, \"$key is a valid value\");\n }\n\n // Now verify that validation does not pass against anything else.\n foreach ($this->test as $key => $value) {\n $this->entity->test_options->value = is_numeric($value) ? (100 - $value) : ('X' . $value);\n $violations = $this->entity->test_options->validate();\n $this->assertCount(1, $violations, \"$key is not a valid value\");\n }\n }", "abstract protected function calculateValue();", "public function set($config){\n\t\t$this->configValues = $config;\n\t}", "private function changeValueInConf($olt, $new, $path) {\n $output = shell_exec(\"sudo perl -pi -e 's/$olt/$new/g' $path/source/conf.py\");\n //dd($output);\n }", "public function updateValue(){\n\n\t\t$this->value += (int)max($this->left_parent_value,$this->right_parent_value);\n\t}", "public function setExpression($val)\n {\n $this->_propDict[\"expression\"] = $val;\n return $this;\n }", "protected function setDynamicUpdate($dynamicUpdate){\n\t\tCoreType::assertBool($dynamicUpdate);\n\t\tself::$_dynamicUpdate = $dynamicUpdate;\n\t}", "public function setValue($config_id, $value, $type, $project_id = 0, $user_id = 0, $access_reqd = 90) {\n\n $query = \"SELECT * FROM `mantis_config_table` WHERE config_id='$config_id' AND project_id='$project_id'\";\n $result = SqlWrapper::getInstance()->sql_query($query);\n\t if (!$result) {\n \t if (!self::$quiet) {\n echo \"<span style='color:red'>ERROR: Query FAILED</span>\";\n }\n \t exit;\n }\n if (0 == SqlWrapper::getInstance()->sql_num_rows($result)) {\n\n self::$logger->debug(\"setValue $config_id: $value (type=$type)\");\n\n // --- add to DB\n $query = \"INSERT INTO `mantis_config_table` (`config_id`, `project_id`, `user_id`, `access_reqd`, `type`, `value`) \".\n \"VALUES ('$config_id', '$project_id', '$user_id', '$access_reqd', '$type', '$value');\";\n $result = SqlWrapper::getInstance()->sql_query($query);\n\t if (!$result) {\n \t if (!self::$quiet) {\n echo \"<span style='color:red'>ERROR: Query FAILED</span>\";\n }\n \t exit;\n }\n\n\n // --- add/replace Cache\n $key = $config_id.\"_\".$project_id;\n self::$configVariables[\"$key\"] = new ConfigMantisItem($config_id, $project_id, $user_id, $access_reqd, $type, $value);\n } else {\n self::$logger->warn(\"setValue($config_id, $project_id): variable already exists and will NOT be modified.\");\n }\n\n }", "protected function _set( $operator, $value )\n {\n if( in_array( $operator, self::$operators ) )\n {\n $operator = '_'.$operator;\n\n if( is_array( $value ) )\n {\n $tmp_arr = $this->$operator;\n\n foreach( $value as $key => $val )\n {\n $tmp_arr[ $key ] = $val;\n }\n\n $this->$operator = $tmp_arr;\n }\n else // string or int\n {\n $this->$operator = $value;\n }\n }\n }", "function __set($name, $value) {\r\n if ($name == 'mr') {\r\n $this->max_rating = intval($value);\r\n } else if ($name == 'st') {\r\n $this->step = intval($value);\r\n } else if ($name == 'vis') {\r\n $this->visible = $value == '1';\r\n } else if ($name == 'seq') {\r\n $this->sequence = intval($value);\r\n } else if ($name == 'cr') {\r\n $this->created = DateTime::createFromFormat('Y-m-d H:i:s', $value);\r\n } else if ($name == 'upd') {\r\n $this->updated = DateTime::createFromFormat('Y-m-d H:i:s', $value);\r\n } else if ($name == 'num') {\r\n $this->num_ratings = intval($value);\r\n } else if ($name == 'total') {\r\n $this->tot_ratings = floatval($value);\r\n }\r\n\r\n }", "function set($key, $val)\n {\n $config[$key] = $val;\n \n }", "public function multiply($value);", "public function setEvalTinyint($key, $value)\n {\n $this->arrEvalTinyint[$key] = $value;\n }", "function add($add){\n if(is_array($add))\n {\n foreach($add as $p => $value){\n if(!isset($this->sections[$p])) $this->sections[$p] = new ConfigSection($p);\n $this->sections[$p]->register($value);\n }\n }\n }", "public function setConf ($pathInDotNotation, $value)\n {\n //breakdown dot notation\n $keys = explode(\".\", $pathInDotNotation);\n\n $destination = &$this->configs;\n\n foreach ($keys as $key) {\n $destination = &$destination [$key];\n }\n\n $destination = $value;\n }", "public function addValue($value);", "function configure($key, $value, $type='system', $unique_slug='unknow', $storage_type='database') { // 配置\n\tswitch ( $storage_type ) {\n\t\tcase 'database':\n\t\t\tif ( is_null($key) ) {\n\t\t\t\treturn Config::where([\n\t\t\t\t\t'type' => $type,\n\t\t\t\t\t'unique_slug' => $unique_slug,\n\t\t\t\t])->pluck('value', 'key');\n\t\t\t} else if ( is_null($value) ) {\n\t\t\t\treturn Config::where([\n\t\t\t\t\t'type' => $type,\n\t\t\t\t\t'unique_slug' => $unique_slug,\n\t\t\t\t\t'key' => $key,\n\t\t\t\t])->value('value');\n\t\t\t} else {\n\t\t\t\t$data = Config::where([\n\t\t\t\t\t'type' => $type,\n\t\t\t\t\t'unique_slug' => $unique_slug,\n\t\t\t\t\t'key' => $key,\n\t\t\t\t])->first();\n\n\t\t\t\tif ( $data ) {\n\t\t\t\t\treturn Config::where([\n\t\t\t\t\t\t'type' => $type,\n\t\t\t\t\t\t'unique_slug' => $unique_slug,\n\t\t\t\t\t\t'key' => $key,\n\t\t\t\t\t])->update(['value' => $value]);\n\t\t\t\t} else {\n\t\t\t\t\treturn Config::create([\n\t\t\t\t\t\t'type' => $type,\n\t\t\t\t\t\t'unique_slug' => $unique_slug,\n\t\t\t\t\t\t'key' => $key,\n\t\t\t\t\t\t'value' => $value,\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t\tcase 'redis':\n\t\tbreak;\n\t\tcase 'mongodb':\n\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new Exception(\"Error Config Type: \" . $storage_type, 1);\n\t\tbreak;\n\t}\n}", "public function setIncrementing($value);", "public function set(string $name, float $value, array $labels = []): void;", "public function addOperation($name , $operator , $value , $andSeparator = true);", "abstract public function setValue($value);", "public function setOperationNumber($value) {\n if(strlen($value) > 50 ){\n throw new ValueException(\"Value \".$value.\" is higher than 8\");\n }\n $this->Num_operacion = $value;\n }", "function _set_config_param($name,$value)\r\n\t{\r\n\t\t$this->db->query(\"update m_config_params set value = ? where name = ? limit 1\",array($value,$name));\r\n\t}", "function set_get_parameter($param, $value) {\n\n $get_value = \\M\\Config::get('GET');\n $get_value[$param] = $value;\n\n \\M\\Config::set('GET', $get_value);\n}", "public function createCustomDimension($name, $value) {\n $i = array_search($name, $this->custom_dimension_map);\n if($i) $this->payload['cd' . $i] = $value ;\n }", "public function set($config, $value = null) {\n if (!is_array($config)) {\n $config = array($config => $value);\n }\n\n foreach ($config as $names => $value) {\n $name = $this->__configVarNames($names);\n\n // Make sure to expand nested array keys too!\n // @todo: Refactor\n if (is_array($value)) {\n foreach ($value AS $k => $v) {\n $key = $name;\n $key[] = $k;\n $this->set(join('.', $key), $v);\n }\n continue;\n }\n\n switch (count($name)) {\n case 7:\n $this->data[$name[0]][$name[1]][$name[2]][$name[3]][$name[4]][$name[5]][$name[6]] = $value;\n break;\n case 6:\n $this->data[$name[0]][$name[1]][$name[2]][$name[3]][$name[4]][$name[5]] = $value;\n break;\n case 5:\n $this->data[$name[0]][$name[1]][$name[2]][$name[3]][$name[4]] = $value;\n break;\n case 4:\n $this->data[$name[0]][$name[1]][$name[2]][$name[3]] = $value;\n break;\n case 3:\n $this->data[$name[0]][$name[1]][$name[2]] = $value;\n break;\n case 2:\n $this->data[$name[0]][$name[1]] = $value;\n break;\n case 1:\n $this->data[$name[0]] = $value;\n break;\n default:\n $this->data = MOC_Array::insert($this->data, join('.', $name), $value);\n break;\n //throw new MOC_Configuration_Exception(sprintf('Unable to set the value. Depth is invalid (\"%s\")', count($name)));\n }\n }\n }", "public function calc($key);", "function set_post_parameter($param, $value) {\n\n $post_value = \\M\\Config::get('POST');\n $post_value[$param] = $value;\n\n \\M\\Config::set('POST', $post_value);\n}", "public static function set($q = 'store/blind', $value = false)\n {\n $branch = &self::$config;\n $section = explode('/', trim($q, ' /'));\n\n if(count($section)>1)\n {\n $lastRound = count($section)-1;\n\n foreach($section as $k => $s)\n {\n if(is_object($branch))\n {\n $branch = &$branch->$s;\n }else{\n $branch = &$branch[$s];\n }\n\n if($lastRound == $k)\n {\n $branch = $value;\n }\n }\n unset($branch);\n }\n }", "public function testConfigSetter(): void {\n $expected = new Config(\"$this->root/a\", \"$this->root/b\");\n $this->configUpdateManager->setConfig($expected);\n $actual = $this->configUpdateManager->getConfig();\n self::assertSame($expected, $actual);\n }", "public function setNValue($nVal) {}", "public function setAddition($value)\n {\n if (!isset($this->data->amount->subtotals)) {\n $this->data->amount->subtotals = new stdClass();\n }\n $this->data->amount->subtotals->addition = (float) $value;\n\n return $this;\n }", "public function operators($value) {\n return $this->setProperty('operators', $value);\n }", "function setProperty($name, $value) {\n include_once(PAPAYA_INCLUDE_PATH.'system/base_module_options.php');\n base_module_options::writeOption($this->moduleGuid, $name, $value);\n }", "public function addCustomValue($name, $value) {\n $this->customValues[$name] = $value;\n // $this->addHiddenField('custom',$value);\n }", "public function setAdditionalCostAttribute($value)\n {\n $this->attributes['additional_cost'] = Utils::numbersOnly($value);\n }", "public function addConfig($key, $value) {\n $this->config[\"key\"]=$value;\n return;\n }", "public function setConfig($data, $value) {\n if (is_string($data)) {\n $this->_config[$data] = $value;\n } else {\n throw new ConfigException(\"Error while setting a config value\");\n }\n }", "public function setTotalAdditionAttribute($input)\n {\n $this->attributes['total_addition'] = $input ? $input : null;\n }", "function set_external_config($key, $value)\n {\n $this->_external_config[$key] = $value;\n }", "public function getModuleConfig() {\n $this->data['config_value'] = array_merge($this->helper_setting->getSetting($this->module_code),$this->helper_setting->getSetting('module_'.$this->module_code));\n }", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setOperation($value)\n {\n return $this->set('Operation', $value);\n }", "public function setOperation($value)\n {\n return $this->set('Operation', $value);\n }", "public function setOperation($value)\n {\n return $this->set('Operation', $value);\n }", "public function setOperation($value)\n {\n return $this->set('Operation', $value);\n }", "public function setOperation($value)\n {\n return $this->set('Operation', $value);\n }", "function ods_cell_set_val($cell, $p, $val, $options = array()) {\n\n if (is_numeric($val)) {\n $string_val = (string) $val;\n $p->nodeValue = str_replace('.', ',', $string_val);\n $cell->setAttribute('office:value-type', 'float');\n $cell->setAttribute('calcext:value-type', 'float');\n $cell->setAttribute('office:value', $val);\n } else {\n $p->nodeValue = $val;\n }\n }", "public function setOperation($value)\n {\n return $this->set('Operation', $value);\n }", "public static function upValue($id) {\n try {\n $conexion = ConexionDB::conectar(\"cryptoMonedas\");\n\n $cursor = $conexion->Incidencias->updateOne(\n ['id' => intval($id)],\n ['$set' => [ 'valor_24h' * 0.1 ]\n ]\n );\n \n } catch(Exception $e) {\n $result = 'Error: ' . $e->getMessage();\n }\n $conexion = null; \n }", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function addDynamicValue ($key, $value) {\n $this->_email_dynamic[$key] = (string)$value;\n }", "private function setCalculate() {\n\n if($this->getType() == 2) {\n $det = new CalculateTwo($this->array);\n $this->result = $det->getResult();\n $this->rule = $det->getRule();\n $this->ruleExplanation = $det->getRuleExplanation();\n }\n elseif($this->getType() == 3) {\n\n $det = new CalculateThree($this->array);\n $this->result = $det->getResult();\n $this->rule = $det->getRule();\n $this->ruleExplanation = $det->getRuleExplanation();\n }\n else {\n $this->getPivot();\n $this->result = $this->setResult();\n $this->rule = $this->getPivotRule();\n $this->ruleExplanation = $this->process;\n }\n }", "public function setJSConfig($key, $val)\n {\n $this->jsConfig[$key] = $val;\n return $this;\n }", "public function convertNestedToValuedConfigurationDataProvider() {}", "function propc($val) {\r\n return kernel::prop_constant($val);\r\n}", "public function setDiscCalc($discCalc) {\n $this->_discCalc = $discCalc;\n }", "public function setCustom($name, $value);", "public function execute($otherRegister){\n if($otherRegister->incOrDec == 'inc')\n $this->value = $this->value + ($otherRegister->incOrDecAmount);\n else\n $this->value = $this->value - ($otherRegister->incOrDecAmount);\n }", "public function setVariableValue($name, $value) {\n\t\tif ($this->rows) {\n\t\t\tforeach ($this->rows as $row) {\n\t\t\t\tif ($row->matchesVariableName($name)) {\n\t\t\t\t\tif ($name == 'upload_maxsize') {\n\t\t\t\t\t\treturn $row->setVariableValue($value*1000000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn $row->setVariableValue($value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.5513437", "0.5272492", "0.5249295", "0.49934387", "0.49284846", "0.49259087", "0.49069515", "0.48981345", "0.48913416", "0.48712933", "0.4798676", "0.47852412", "0.4750484", "0.47082365", "0.46927264", "0.46816272", "0.46250483", "0.46244192", "0.46241984", "0.46197677", "0.46024752", "0.45933834", "0.45800388", "0.45563817", "0.45496628", "0.45403084", "0.45269057", "0.45197672", "0.45184597", "0.45151216", "0.45057702", "0.45008174", "0.44453415", "0.4443896", "0.44229794", "0.44215527", "0.44213864", "0.44124007", "0.4401104", "0.43931523", "0.43724015", "0.43692985", "0.43575704", "0.43168524", "0.43078357", "0.43004453", "0.4296437", "0.42898822", "0.42852652", "0.4276924", "0.4274006", "0.4270761", "0.426885", "0.4267655", "0.4255684", "0.42518386", "0.4246019", "0.4243402", "0.42425746", "0.42419267", "0.42376438", "0.42376438", "0.42376438", "0.42376438", "0.42376438", "0.42376438", "0.42376438", "0.42376438", "0.42376438", "0.42376438", "0.4236572", "0.4235377", "0.4235377", "0.4235377", "0.4235377", "0.42353597", "0.4234695", "0.4233109", "0.42327926", "0.42327926", "0.42327926", "0.42327926", "0.42327926", "0.42327926", "0.42327926", "0.42327926", "0.42327926", "0.42327926", "0.42327926", "0.42320287", "0.42320287", "0.42294806", "0.42278907", "0.42218488", "0.42156655", "0.42112413", "0.4209888", "0.42037803", "0.41891757", "0.41847607" ]
0.63103074
0
Generates an alphanumeric random string of given length
function gen_rand_string($num_chars = 8) { $rand_str = unique_id(); $rand_str = str_replace('0', 'Z', strtoupper(base_convert($rand_str, 16, 35))); return substr($rand_str, 0, $num_chars); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generateRandomString($length = 10) {\n \n $characters = ' 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $randomString = '';\n \n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, strlen($characters) - 1)];\n }\n \n return $randomString;\n \n}", "function str_random($length)\n {\n return str_generate($length, '0123456789ABCDEDFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz');\n }", "public static function string( $length ) {\n\t$chars = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\t\n $str = '';\n\t$size = strlen( $chars );\n\tfor( $i = 0; $i < $length; $i++ ) {\n\t\t$str .= $chars[ rand( 0, $size - 1 ) ];\n\t}\n\n\treturn $str;\n }", "function random_string_length($length)\n {\n $len = $length;\n $base = \"ABCDEFGHIJKLMNRSTUVWXYabcdefghijklmnopqrstuvwxyz123456789\";\n $max = strlen($base) - 1;\n $activatecode = '';\n mt_srand((double)microtime()*1000000);\n while(strlen($activatecode) < $len + 1)\n $activatecode .= $base{mt_rand(0,$max)};\n return $activatecode;\n }", "function str_generate($length, $chars)\n {\n return substr(str_shuffle(str_repeat($chars, $length)), 0, $length);\n }", "function generateRandomString($length) {\n return strtoupper(substr(str_shuffle(str_repeat($x = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', ceil($length / strlen($x)))), 1, $length));\n }", "function generateRandStr($length){\n \t\t$randstr = \"\";\n \t\tfor($i=0; $i<$length; $i++){\n \t\t$randnum = mt_rand(0,61);\n\t\t\t\tif($randnum < 10){\n \t\t$randstr .= chr($randnum+48);\n \t\t}else if($randnum < 36){\n \t\t$randstr .= chr($randnum+55);\n \t\t}else{\n \t\t$randstr .= chr($randnum+61);\n \t\t}\n \t\t}\n \t\treturn $randstr;\n \t\t}", "public static function getRandomString($length) \n{\n$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\nreturn substr(str_shuffle(str_repeat($pool, $length)), 0, $length);\n}", "function generateRandomString($length) {\n //$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $characters = '0123456789';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, $charactersLength - 1)];\n }\n return $randomString;\n}", "function random_str($length){\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, $charactersLength - 1)];\n }\n return $randomString;\n}", "function random_string($length) {\n $key = '';\n $keys = array_merge(range(0, 9), range('a', 'z'));\n\n for ($i = 0; $i < $length; $i++) {\n $key .= $keys[array_rand($keys)];\n }\n\n return $key;\n}", "function generateRandomString($length = 10) {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, $charactersLength - 1)];\n }\n return $randomString;\n }", "function generateRandomString($length = 10) {\r\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\r\n $charactersLength = strlen($characters);\r\n $randomString = '';\r\n for ($i = 0; $i < $length; $i++) {\r\n $randomString .= $characters[rand(0, $charactersLength - 1)];\r\n }\r\n return $randomString;\r\n }", "function wpbm_generate_random_string( $length ){\n $string = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $random_string = '';\n for ( $i = 1; $i <= $length; $i ++ ) {\n $random_string .= $string[ rand( 0, 61 ) ];\n }\n return $random_string;\n }", "function generate_random_string($length = 10) {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $charactersLength = strlen($characters);\n $randomString = '';\n\n for ($i = 0; $i < $length; $i++) :\n $randomString .= $characters[rand(0, $charactersLength - 1)];\n endfor;\n\n return $randomString;\n}", "public static function str_random($length = 16)\n\t{\n\t $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\n\t return substr(str_shuffle(str_repeat($pool, $length)), 0, $length);\n\t}", "function generateRandomString($length = 8) {\r\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\r\n $randomString = '';\r\n for ($i = 0; $i < $length; $i++) {\r\n $randomString .= $characters[rand(0, strlen($characters) - 1)];\r\n }\r\n return $randomString;\r\n}", "function generateRandomString($length = 10) {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, $charactersLength - 1)];\n }\n return $randomString;\n}", "function generateRandomString($length = 10) {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, $charactersLength - 1)];\n }\n return $randomString;\n}", "function generateRandomString($length = 10) {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, $charactersLength - 1)];\n }\n return $randomString;\n}", "function generateRandomString($length = 10) {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, $charactersLength - 1)];\n }\n return $randomString;\n}", "function generateRandomString($length = 10) {\n\t\t$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\t$characterLength = strlen($characters);\n\t\t$randomString = '';\n\n\t\tfor($i = 0; $i < $length; $i++) {\n\t\t\t$randomString .= $characters[rand(0, $characterLength - 1)];\n\t\t}\n\t\treturn $randomString;\n\t}", "function randomStringGen($length)\n {\n /* this are the letters who can be used randomly : */ \n $lettering = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $lengthMax = strlen($lettering);\n $randomString = '';\n /* A for loop to catch the letters from $lettering */\n for ($i = 0; $i < $length; $i++)\n {\n $randomString .= $lettering[rand(0, $lengthMax - 1)];\n }\n return $randomString;\n }", "function generateRandStr($length){\r\n \t\t$randstr = \"\";\r\n \t\tfor($i=0; $i<$length; $i++){\r\n \t\t$randnum = mt_rand(0,61);\r\n\t\t\t\tif($randnum < 10){\r\n \t\t$randstr .= chr($randnum+48);\r\n \t\t}else if($randnum < 36){\r\n \t\t$randstr .= chr($randnum+55);\r\n \t\t}else{\r\n \t\t$randstr .= chr($randnum+61);\r\n \t\t}\r\n \t\t}\r\n \t\treturn $randstr;\r\n \t\t}", "public function get_rand_str($length = '5') {\n\t\treturn substr(str_shuffle(\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"), 0, $length);\n\t}", "function randomString($length = 1) {\n $str = \"\";\n $characters = array_merge(range('A','Z'), range('a','z') );\n $max = count($characters) - 1;\n for ($i = 0; $i < $length; $i++) {\n $rand = mt_rand(0, $max);\n $str .= $characters[$rand];\n }\n return $str;\n }", "static function generateRandomString($length) {\n $characters = \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, strlen($characters) - 1)];\n }\n return $randomString;\n }", "function genRandomString($length) {\n $characters = '0123456789';\n for ($p = 0; $p < $length; $p++) {\n $string .= $characters[mt_rand(0, strlen($characters))];\n }\n return $string;\n}", "function string_random_string($length)\r\n\t{\r\n\t\t$string = \"\";\r\n\t\t$chaine = \"AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789\";\r\n\t\tsrand((double)microtime()*1000000);\r\n\t\tfor ($i=0; $i<$length; $i++)\r\n\t\t{\r\n\t\t\t$string .= $chaine[rand()%strlen($chaine)];\r\n\t\t}\r\n\t\treturn $string;\r\n\t}", "function genString($len) {\n global $alphabet;\n\n $finale = \"\";\n \n for ($curChar = 0; $curChar < $len; $curChar++)\n $finale .= $alphabet[rand(0, (strlen($alphabet) - 1))];\n\n return $finale;\n}", "function generateRandomString($length = 10)\n {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i ++) {\n $randomString .= $characters[rand(0, $charactersLength - 1)];\n }\n return $randomString;\n }", "function randstr($length = 10)\n{\n\t$chars = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n\t$string = \"\";\n\t\n\tfor ($i=0; $i < $length; $i++) {\n\t\tstr_shuffle($chars);\n\t\t$string .= $chars[mt_rand(0, strlen($chars))];\n\t}\n\t\t\n\treturn $string;\n}", "function generateRandomString($length = 8)\n{\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, $charactersLength - 1)];\n }\n return $randomString;\n}", "public static function generate($length) {\n $alphabet = \"abcdefghijklmnopqrstuwxyzABC0123456789\";\n for ($i = 0; $i < $length; $i++) {\n $random_password[$i] = $alphabet[rand(0, strlen($alphabet) - 1)];\n }\n return implode(\"\", $random_password);\n }", "function get_random_string($length = 10) {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, strlen($characters) - 1)];\n }\n return $randomString;\n }", "public static function generateRandomString($length = 6) {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, $charactersLength - 1)];\n }\n return $randomString;\n}", "function generateRandomString($len=32)\n{\nreturn substr(str_shuffle(str_repeat($x='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',$len)),0,$len);\n}", "public function generateRandStr($length) {\n $randstr = \"\";\n for ($i = 0; $i < $length; $i++) {\n $randnum = mt_rand(0, 61);\n if ($randnum < 10) {\n $randstr .= chr($randnum + 48);\n } else if ($randnum < 36) {\n $randstr .= chr($randnum + 55);\n } else {\n $randstr .= chr($randnum + 61);\n }\n }\n return $randstr;\n }", "public static function string ($length = 10) {\n\t\t$randstr = \"\";\n\n\t\tfor ($i = 0; $i < $length; $i++) {\n\t\t\t$randnum = mt_rand(0,61);\n\n\t\t\tif($randnum < 10) {\n\t\t\t\t$randstr .= chr($randnum+48);\n\n\t\t\t} else if($randnum < 36) {\n\t\t\t\t$randstr .= chr($randnum+55);\n\n\t\t\t} else {\n\t\t\t\t$randstr .= chr($randnum+61);\n\n\t\t\t}\n\t\t}\n\n\t\treturn $randstr;\n\t}", "function generateRandomString($length = 32) {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, $charactersLength - 1)];\n }\n return $randomString;\n }", "public static function generate($length = 8){\n\t\t\t$chars = \"abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?1234567890\";\n\t\t\treturn substr(str_shuffle($chars), 0, $length);\n\t\t}", "public static function generateRandomString($length=20) {\n $haystack = '012345678'\n . 'abcdefghijklmnopqrstuvwxyz'\n . 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $iLen = strlen($haystack);\n $result = '';\n\n mt_srand((double) microtime() * 1000000);\n for ( $i=0; $i<$length; $i++ ) {\n $result .= substr($haystack, (mt_rand() % ($iLen)), 1);\n }\n return($result);\n }", "function generateRandomString($length = 15) {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $randomString = '';\n \t for ($i = 0; $i < $length; $i++) {\n \t $randomString .= $characters[rand(0, strlen($characters) - 1)];\n \t }\n \t\t return $randomString;\n\t\t }", "public function genRandString($length = 0) {\n\n $charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\n $str = '';\n\n $count = strlen($charset);\n\n while ($length-- > 0) {\n\n $str .= $charset[mt_rand(0, $count - 1)];\n\n }\n\n return $str;\n\n }", "function generateRandomString($length = 6)\r\r\n{\r\r\n return substr(str_shuffle(\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\") , 0, $length);\r\r\n}", "public function generateRandom(int $length = 16): string {\n $letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $allChars = \"0123456789-$letters\";\n $first = Strings::randomize($letters, 1);\n $value = $first . Strings::randomize($allChars, $length - 1);\n while (!$this->store($value)) {\n $value = $first . Strings::randomize($allChars, $length - 1);\n }\n return $value;\n }", "function generate_random_string($name_length = 8) {\n $alpha_numeric = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n return substr(str_shuffle($alpha_numeric), 0, $name_length);\n }", "function random_string($length = 6) {\n\t$text = '';\n\t$characters = '0123456789abcdefghijkmnopqrstuvwxyz';\n\t$nro = 0;\n\twhile ($nro < $length) {\n\t\t$caracter = substr($characters, mt_rand(0, strlen($characters)-1), 1);\n\t\t$text .= $caracter;\n\t\t$nro++;\n\t}\n\treturn $text;\n}", "public static function randomString($length = 40)\n {\n assert('is_integer($length)');\n assert('$length > 0');\n $alphachars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX';\n $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n $string = $alphachars[mt_rand(0, strlen($alphachars) - 1)];\n $len = strlen($chars) - 1;\n for($i = 0; $i < ($length-1); $i++) $string .= $chars[mt_rand(0, $len)];\n return $string;\n }", "public function generateRandomString($length = 5) {\n return substr(\n str_shuffle(\n str_repeat(\n $x='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', \n ceil($length/strlen($x)) \n )\n ), 1 , $length);\n }", "function getRandomString($length = 8) {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $string = '';\n\n for ($i = 0; $i < $length; $i++) {\n $string .= $characters[mt_rand(0, strlen($characters) - 1)];\n }\n\n return $string;\n}", "private function generateRandomString(int $length = 10): string\n {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, $charactersLength - 1)];\n }\n return $randomString;\n }", "public static function rand_string($length) {\n\n $chars = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n return substr(str_shuffle($chars), 0, $length);\n\n }", "public function generateRandomString($length = 10) {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, strlen($characters) - 1)];\n }\n return $randomString;\n }", "function generate_random_string($name_length = 8) \n\t{\n\t\t$alpha_numeric = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\t\treturn substr(str_shuffle($alpha_numeric), 0, $name_length);\n\t}", "private function generateRandomString($length = 10) {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, $charactersLength - 1)];\n }\n return $randomString;\n }", "public function get_rand_str($length = 6) {\n\t\treturn substr(str_shuffle(\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"), 0, $length);\n\t}", "function generateRandomString($length) {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n //cuenta la cantidad de caracteres\n $charactersLength = strlen($characters);\n //inicial random string\n $randomString = '';\n //ciclo que arma el codigo random\n for ($i = 0; $i < $length; $i++) {\n //concatenando al azar un caracter de todas las opciones\n $randomString .= $characters[rand(0, $charactersLength - 1)];\n }\n //devolviendo el codigo random\n return $randomString;\n }", "function getRandomString($length) {\n\t$validCharacters = \"123456789abcdefghijklmnopqrstuxyvwzABCDEFGHIJKLMNOPQRSTUXYVWZ\";\n\t$validCharNumber = strlen($validCharacters);\n\t$result = \"\";\n\t\n\tfor ($i = 0; $i < $length; $i++) {\n\t\t$index = mt_rand(0, $validCharNumber - 1);\n\t\t$result .= $validCharacters[$index];\n\t}\n\t\n\treturn $result;\n}", "public static function getRandomString($_length)\n {\n $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n \n $randomString = '';;\n for ($i=0; $i<(int)$_length; $i++) {\n $randomString .= $chars[mt_rand(1, strlen($chars)) -1];\n }\n \n return $randomString;\n }", "public function gen_rand($length = 14) {\r\n\t\t$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\r\n\t\t$randomString = '';\r\n\t\tfor ($i = 0; $i < $length; $i++) {\r\n\t\t\t$randomString .= $characters[rand(0, strlen($characters) - 1)];\r\n\t\t}\r\n\t\treturn $randomString;\r\n\t}", "function generateRandomString(\n $length,\n $allowedCharacters = '123456789ABCDEFGHIJKLMNPQRSTUVWXYZ'//No 0's or O's\n )\n {\n $maxIndex = strlen($allowedCharacters) - 1;\n $string = '';\n for ($i = 1; $i <= $length; $i++) {\n $string .= $allowedCharacters[mt_rand(0, $maxIndex)];\n }\n return $string;\n }", "public function generate(int $length): string;", "private function random($length = 16)\n {\n $string = '';\n while (($len = strlen($string)) < $length) {\n $size = $length - $len;\n // $bytes = random_bytes($size);\n $bytes = bin2hex(openssl_random_pseudo_bytes(32));\n $string .= substr(str_replace(['/', '+', '='], '', base64_encode($bytes)), 0, $size);\n }\n return $string;\n }", "function generate_random_str($no_of_chars) \n{\n return substr(md5(microtime()),rand(0,26),$no_of_chars);\n}", "function getRandomString(int $length = 40): string\n{\n return bin2hex( random_bytes($length / 2) );\n}", "function RandomString($length)\n{\n $string = md5(microtime());\n $highest_startpoint = 32-$length;\n $randomString = substr($string,rand(0,$highest_startpoint),$length);\n return $randomString;\n\n}", "static function random(int $length = 16): string {\n $string = '';\n while (($len = \\strlen($string)) < $length) {\n /** @var positive-int $size */\n $size = $length - $len;\n $bytes = random_bytes($size);\n $string .= substr(str_replace(['/', '+', '='], '', base64_encode($bytes)), 0, $size);\n }\n\n return $string;\n }", "public static function generate($length=64)\n {\n if($length<self::$min_length) throw new \\Exception(sprintf(\"Error: the random string must be at least %s characters\", self::$min_length), 1);\n \n $characters_array = array_merge(range('A', 'Z'), range('a', 'z'),range(0, 9));\n $characters_length = count($characters_array);\n $random_string = '';\n for ($i = 0; $i < $length; $i++)\n {\n $random_string .= $characters_array[mt_rand(0, $characters_length-1)];\n }\n return $random_string;\n }", "function random_string($length, $base = 62) {\n\t$str = '';\n\twhile ($length--) {\n\t\t$x = mt_rand(1, min($base, 62));\n\t\t$str .= chr($x + ($x > 10 ? $x > 36 ? 28 : 86 : 47));\n\t}\n\treturn $str;\n}", "public static function RandomString($length = 10): string {\n\t\t$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\t$charactersLength = strlen($characters);\n\t\t$randomString = '';\n\t\tfor ($i = 0; $i < $length; $i++) {\n\t\t\t$randomString .= $characters[rand(0, $charactersLength - 1)];\n\t\t}\n\t\treturn $randomString;\n\t}", "function attendance_random_string($length=6) {\n $randombytes = random_bytes_emulate($length);\n $pool = 'abcdefghijklmnopqrstuvwxyz';\n $pool .= '0123456789';\n $poollen = strlen($pool);\n $string = '';\n for ($i = 0; $i < $length; $i++) {\n $rand = ord($randombytes[$i]);\n $string .= substr($pool, ($rand % ($poollen)), 1);\n }\n return $string;\n}", "function random_str($length) {\n\t\t$keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\t$str = '';\n\t\t$keyspaceLength = strlen($keyspace) - 1; //put the length -1 in cache\n\t\tfor ($i = 0; $i < $length; ++$i) {\n\t\t\t$str .= $keyspace[random_int(0, $keyspaceLength)];\n\t\t}\n\t\treturn $str;\n\t}", "function genRandomString() {\n //credits: http://bit.ly/a9rDYd\n $length = 50;\n $characters = \"0123456789abcdef\"; \n for ($p = 0; $p < $length ; $p++) {\n $string .= $characters[mt_rand(0, strlen($characters))];\n }\n\n return $string;\n }", "function generateRandomString($length = 32)\n {\n return Str::random($length);\n }", "public function generateRandomString($length = 10) {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, strlen($characters) - 1)];\n }\n return $randomString;\n }", "function randomString($length = 16) {\n\n \t// start with a blank password\n \t$password = \"\";\n\n \t// define possible characters\n \t$possible = \"0123456789babcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"; \n \n \t// set up a counter\n \t$i = 0; \n \n \t// add random characters to $password until $length is reached\n \twhile ($i < $length) { \n\n \t\t // pick a random character from the possible ones\n \t\t $char = substr($possible, mt_rand(0, strlen($possible)-1), 1);\n \n \t\t $password .= $char;\n \t\t $i++;\n \t}\n\n \t// done!\n \treturn $password;\n}", "private function generateRandomString($length = 10)\n {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, $charactersLength - 1)];\n }\n return $randomString;\n }", "function str_random($length = 16)\n {\n return Str::random($length);\n }", "function generateRandomString($length) {\n$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()-+=_';\n//$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n//$characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; //Random letters only.\n//$characters = 'abcdefghijklmnopqrstuvwxyz'; //Random lowercase letters only.\n//$characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; //Random uppercase letters only.\n//$characters = '0123456789'; //Random numbers only.\n$charactersLength = strlen($characters);\n$randomString = '';\nfor ($i = 0; $i < $length; $i++) {\n$randomString .= $characters[rand(0, $charactersLength - 1)];\n}\nreturn $randomString;\n}", "function generateRandomString($length = 4) \n{\n\t//function to generate random strings\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, $charactersLength - 1)];\n }\n return $randomString;\n}", "function gener_random($length){\r\n\r\n\tsrand((double)microtime()*1000000 );\r\n\t\r\n\t$random_id = \"\";\r\n\t\r\n\t$char_list = \"abcdefghijklmnopqrstuvwxyz\";\r\n\t\r\n\tfor($i = 0; $i < $length; $i++) {\r\n\t\t$random_id .= substr($char_list,(rand()%(strlen($char_list))), 1);\r\n\t}\r\n\t\r\n\treturn $random_id;\r\n}", "public function randomString($length = 12) {\r\n\t\t$str = \"\";\r\n\t\t$characters = array_merge(range('A','Z'), range('a','z'), range('0','9'));\r\n\t\t$max = count($characters) - 1;\r\n\t\tfor ($i = 0; $i < $length; $i++) {\r\n\t\t\t$rand = mt_rand(0, $max);\r\n\t\t\t$str .= $characters[$rand];\r\n\t\t}\r\n\t\treturn $str;\r\n\t}", "function randString($length = 5)\n{\n $str='';\n $cha = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n\n for($x=0; $x<$length; $x++)\n $str .= $cha[mt_rand(0,strlen($cha))];\n return $str;\n}", "function randString($length) {\n $validCharacters = \"ABCDEFGHIJKLMNPQRSTUXYVWZ123456789\";\n $validCharNumber = strlen($validCharacters);\n $result = \"\";\n\n for ($i = 0; $i < $length; $i++) {\n $index = mt_rand(0, $validCharNumber - 1);\n $result .= $validCharacters[$index];\n \t}\n\treturn $result;}", "protected function generateRandomString()\n {\n $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $length = strlen($chars);\n $result = '';\n\n for ($i = 0; $i < 10; $i++) {\n $result .= $chars[rand(0, $length - 1)];\n }\n return $result;\n }", "public static function randString($length=32) {\r\n\t\treturn substr(sha1(uniqid(rand(),true)), 0, $length);\r\n\t}", "function generatePassword($length) { \n $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; \n $count = mb_strlen($chars); \n for ($i = 0, $result = ''; $i < $length; $i++) \n { \n $index = rand(0, $count - 1); \n $result .= mb_substr($chars, $index, 1); \n } \n return $result; \n }", "private function get_random_string($length = 10)\n\t{\n\t\t$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\t$string = '';\n\n\t\tfor ($i = 0; $i < $length; $i++) {\n\t\t\t$string .= $characters[mt_rand(0, strlen($characters) - 1)];\n\t\t}\n\n\t\treturn $string;\n\t}", "private static function randomString($length = 12)\n {\n return substr(str_shuffle('23456789abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'), 0, $length);\n }", "function randStrGen($len)\n{\n $result = \"\";\n $chars = \"abcdefghijklmnopqrstuvwxyz0123456789$%&**@##)(!^***%%%%%%%%%%%####\";\n $charArray = str_split($chars);\n for($i = 0; $i < $len; $i++)\n {\n\t $randItem = array_rand($charArray);\n\t $result .= \"\".$charArray[$randItem];\n }\n return $result;\n}", "private function createRandomString() {\n\t\t$characters = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\t$res = '';\n\t\tfor ($i = 0; $i < 20; $i++) {\n\t\t\t$res .= $characters[mt_rand(0, strlen($characters) - 1)];\n\t\t}\n\t\treturn $res;\n\t}", "public static function random($length) {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, $charactersLength - 1)];\n }\n return $randomString;\n }", "function getRandStr($length) {\r\n $str = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';\r\n $randString = '';\r\n $len = strlen($str)-1;\r\n for($i = 0;$i < $length;$i ++){\r\n $num = mt_rand(0, $len);\r\n $randString .= $str[$num];\r\n }\r\n return $randString ;\r\n}", "function generateRandomString($length = 8) { \n\t$string = \"\";\n\t$possible = \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\tfor($i=0;$i < $length;$i++) {\n\t\t$char = substr($possible, rand(0, strlen($possible)-1), 1);\n\t\tif (!strstr($string, $char)) {\n\t\t\t$string .= $char;\n\t\t}\n\t}\n\treturn $string;\n}", "private function generateRandomString($length = 10)\n {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $charactersLength = strlen($characters);\n $randomString = '';\n\n for ($i = 0; $i < $length; $i++)\n {\n $randomString .= $characters[rand(0, $charactersLength - 1)];\n }\n\n return $randomString;\n }", "private function generateRandomString($length) {\n\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\n $randomString = '';\n\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, strlen($characters) - 1)];\n }\n\n return $randomString;\n }", "public static function generate_alphanumeric_password($length = 16)\n\t{\n\t\t// letters (including capital) and numbers\t\t\n\t\t$chars = 'abcdefghijklmnopqrstuwxyz';\n\t\t$chars .= 'ABCDEFGHIJKLMNOPQRSTUWXYZ';\n\t\t$chars .= '0123456789';\t\t\n\t\tfor ($i = 0, $pass = null; $i < $length; $i++)\n\t\t\t$pass .= $chars[mt_rand(0, strlen($chars) - 1)];\n\t\treturn $pass;\n\t}", "private function generateString($length)\r\n {\r\n\r\n $alphabet=\"qazxswedcvfrtgbnhyujmklpoi0987654321\";\r\n $ris='';\r\n\r\n for ($i=0; $i < $length; $i++) {\r\n srand($this->makeSeed());\r\n $ris .= $alphabet[rand(0,(strlen($alphabet)-1))];\r\n }\r\n\r\n return($ris);\r\n }", "function randomString($length = 6)\n{\n $str = '';\n $pattern = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLOMNOPQRSTUVWXYZ';\n for ($i = 0; $i < $length; $i++) {\n $str .= $pattern[mt_rand(0, strlen($pattern) - 1)];\n }\n return $str;\n}" ]
[ "0.8446605", "0.83857006", "0.8356444", "0.8347785", "0.83398813", "0.8334418", "0.83132255", "0.8304478", "0.8300735", "0.8299288", "0.8296448", "0.8292725", "0.8289241", "0.82861006", "0.8283137", "0.8243732", "0.8237494", "0.82345384", "0.82345384", "0.82345384", "0.82345384", "0.82327414", "0.8224014", "0.82084227", "0.82011014", "0.81975365", "0.8187583", "0.81842667", "0.81797725", "0.8177293", "0.81754255", "0.81695044", "0.81687355", "0.81624603", "0.81571203", "0.81525594", "0.81372887", "0.81346273", "0.8129298", "0.81166667", "0.8107741", "0.81069285", "0.81068426", "0.809933", "0.80975455", "0.8087899", "0.8083866", "0.8073147", "0.8072811", "0.80698264", "0.8069512", "0.8069289", "0.8065347", "0.806532", "0.80634415", "0.80608773", "0.8060008", "0.805205", "0.8037865", "0.80323935", "0.80240625", "0.8023905", "0.8023112", "0.8022845", "0.80220366", "0.8017104", "0.8012546", "0.8011625", "0.80082226", "0.79957193", "0.7988724", "0.7986316", "0.7985476", "0.798387", "0.79825026", "0.7982246", "0.7981476", "0.79733413", "0.7972947", "0.7969218", "0.7968794", "0.7966569", "0.796143", "0.7949534", "0.79487145", "0.7944259", "0.79436994", "0.7941799", "0.7940289", "0.7937622", "0.79368216", "0.7932434", "0.79324055", "0.7927856", "0.79254484", "0.79221", "0.7919921", "0.79184824", "0.79100287", "0.79063994" ]
0.80732167
47
Return formatted string for filesizes
function get_formatted_filesize($value, $string_only = true, $allowed_units = false) { global $user; $available_units = array( 'gb' => array( 'min' => 1073741824, // pow(2, 30) 'index' => 3, 'si_unit' => 'GB', 'iec_unit' => 'GIB', ), 'mb' => array( 'min' => 1048576, // pow(2, 20) 'index' => 2, 'si_unit' => 'MB', 'iec_unit' => 'MIB', ), 'kb' => array( 'min' => 1024, // pow(2, 10) 'index' => 1, 'si_unit' => 'KB', 'iec_unit' => 'KIB', ), 'b' => array( 'min' => 0, 'index' => 0, 'si_unit' => 'BYTES', // Language index 'iec_unit' => 'BYTES', // Language index ), ); foreach ($available_units as $si_identifier => $unit_info) { if (!empty($allowed_units) && $si_identifier != 'b' && !in_array($si_identifier, $allowed_units)) { continue; } if ($value >= $unit_info['min']) { $unit_info['si_identifier'] = $si_identifier; break; } } unset($available_units); for ($i = 0; $i < $unit_info['index']; $i++) { $value /= 1024; } $value = round($value, 2); // Lookup units in language dictionary $unit_info['si_unit'] = (isset($user->lang[$unit_info['si_unit']])) ? $user->lang[$unit_info['si_unit']] : $unit_info['si_unit']; $unit_info['iec_unit'] = (isset($user->lang[$unit_info['iec_unit']])) ? $user->lang[$unit_info['iec_unit']] : $unit_info['iec_unit']; // Default to IEC $unit_info['unit'] = $unit_info['iec_unit']; if (!$string_only) { $unit_info['value'] = $value; return $unit_info; } return $value . ' ' . $unit_info['unit']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _files_formatFileSize($size) {\n\t$suffix = '';\n\t\n\t## check if we got a number\n\tif(!is_numeric($size) || $size < 0) {\n\t\treturn 0;\n\t}\n\t\n\t## now determine the 'level'\n\tfor($level = 0; $size >= 1024; $level++) {\n\t\t$size /= 1024;\n\t}\n\t\n\t## now add the suffix\n\tswitch($level) {\n\t\tcase 0: $suffix = 'Bytes'; break;\n\t\tcase 1: $suffix = 'KB'; break;\n\t\tcase 2: $suffix = 'MB'; break;\n\t\tcase 3: $suffix = 'GB'; break;\n\t\tdefault: $suffix = '';\n\t}\n\t\n\treturn round($size,2) . ' '.$suffix;\n}", "function format_filesize($size)\r\n{\r\n\r\n // Measure & Number of decimals\r\n $measures = array (\r\n 0 => array ( \"B\", 0 ),\r\n 1 => array ( \"KB\", 0 ),\r\n 2 => array ( \"MB\", 0 ),\r\n 3 => array ( \"GB\", 2 ),\r\n 4 => array ( \"TB\", 3 )\r\n );\r\n\r\n $file_size = (double)$size;\r\n\r\n for ( $i = 0; $file_size >= 1024; $i++ )\r\n {\r\n $file_size = (double)$file_size / 1024;\r\n }\r\n\r\n $file_size = number_format ( $file_size, $measures[$i][1] );\r\n\r\n return $file_size.\" \".$measures[$i][0];\r\n}", "public function getSize(): string\n {\n $B = 1;\n $KB = $B * 1024;\n $MB = $KB * 1024;\n $GB = $MB * 1024;\n\n $bytes = filesize($this->filePath);\n\n $units = match (true)\n {\n $bytes >= $GB => ['suffix' => 'GiB', 'base' => $GB, 'css' => 'text-dark'],\n $bytes >= $MB => ['suffix' => 'MiB', 'base' => $MB, 'css' => 'text-light'],\n $bytes >= $KB => ['suffix' => 'KiB', 'base' => $KB, 'css' => 'text-muted'],\n default => ['suffix' => 'B', 'base' => $B, 'css' => 'text-danger']\n };\n\n return sprintf('%.3f', $bytes / $units['base']) . $units['suffix'];\n }", "function filesize_format($filesize) {\r\n\r\n\tif ($filesize >= 1073741824) $string = round($filesize / 1073741824).\" GB\";\r\n\telseif ($filesize >= 1048576) $string = round($filesize / 1048576).\" MB\";\r\n\telseif ($filesize >= 1024) $string = round($filesize / 1024).\" KB\";\r\n\telse $string = \"$filesize bytes\";\r\n\treturn $string;\r\n\t\r\n}", "function filesize_formatted($size)\n{\n\t$units = array( 'B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');\n\t$power = $size > 0 ? floor(log($size, 1024)) : 0;\n\treturn number_format($size / pow(1024, $power), 2, '.', ',') . ' ' . $units[$power];\n}", "function formatSize($filename)\n\t{\n\n\t\tif (is_string($filename) && !is_numeric($filename)) $size = filesize($filename);\n\n\t\t$mod = 1024;\n\t\t$units = explode(' ', 'B KB MB GB TB PB');\n\n\t\tfor ($i = 0; $size > $mod; $i++)\n\t\t{\n\t\t\t$size /= $mod;\n\t\t}\n\n\t\treturn round($size, 2).' '.$units[$i];\n\n\t}", "public static function getMaxFileSizeString()\n\t{\n\t\t$max_filesize = self::getMaxFileSize();\n\t\t\n\t\t// format for display in mega-bytes\n\t\treturn sprintf(\"%.1f MB\", $max_filesize / 1024 / 1024);\n\t}", "function size_format($bytes=\"\")\n\t{\n\t\t$retval = \"\";\n\t\t\n\t\tif ($bytes >= 1048576)\n\t\t{\n\t\t\t$retval = round($bytes / 1048576 * 100 ) / 100 . $this->lang['sf_mb'];\n\t\t}\n\t\telse if ($bytes >= 1024)\n\t\t{\n\t\t\t$retval = round($bytes / 1024 * 100 ) / 100 . $this->lang['sf_k'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$retval = $bytes . $this->lang['sf_bytes'];\n\t\t}\n\t\t\n\t\treturn $retval;\n\t}", "function sizeFormat($size) { \n if($size<1024) \n { \n return $size.\" bytes\"; \n } \n else if($size<(1024*1024)) \n { \n $size=round($size/1024,1); \n return $size.\" KB\"; \n } \n else if($size<(1024*1024*1024)) \n { \n $size=round($size/(1024*1024),1); \n return $size.\" MB\"; \n } \n else \n { \n $size=round($size/(1024*1024*1024),1); \n return $size.\" GB\"; \n } \n}", "function testFormatSize() {\n\t\t$this->assertEquals(\"1000 bytes\", File::format_size(1000));\n\t\t$this->assertEquals(\"1023 bytes\", File::format_size(1023));\n\t\t$this->assertEquals(\"1 KB\", File::format_size(1025));\n\t\t$this->assertEquals(\"9.8 KB\", File::format_size(10000));\n\t\t$this->assertEquals(\"49 KB\", File::format_size(50000));\n\t\t$this->assertEquals(\"977 KB\", File::format_size(1000000));\n\t\t$this->assertEquals(\"1 MB\", File::format_size(1024*1024));\n\t\t$this->assertEquals(\"954 MB\", File::format_size(1000000000));\n\t\t$this->assertEquals(\"1 GB\", File::format_size(1024*1024*1024));\n\t\t$this->assertEquals(\"9.3 GB\", File::format_size(10000000000));\n\t\t// It use any denomination higher than GB. It also doesn't overflow with >32 bit integers\n\t\t$this->assertEquals(\"93132.3 GB\", File::format_size(100000000000000));\n\t}", "public function getFormattedSize() {\r\n\t\r\n\t $bytes = $this->getSize();\r\n\t\r\n\t if ($bytes >= 1073741824)\r\n\t {\r\n\t\t$bytes = number_format($bytes / 1073741824, 2) . ' GB';\r\n\t }\r\n\t elseif ($bytes >= 1048576)\r\n\t {\r\n\t\t$bytes = number_format($bytes / 1048576, 2) . ' MB';\r\n\t }\r\n\t elseif ($bytes >= 1024)\r\n\t {\r\n\t\t$bytes = number_format($bytes / 1024, 2) . ' KB';\r\n\t }\r\n\t elseif ($bytes > 1)\r\n\t {\r\n\t\t$bytes = $bytes . ' bytes';\r\n\t }\r\n\t elseif ($bytes == 1)\r\n\t {\r\n\t\t$bytes = $bytes . ' byte';\r\n\t }\r\n\t else\r\n\t {\r\n\t\t$bytes = '0 bytes';\r\n\t }\r\n\r\n\t return $bytes;\r\n\t \r\n }", "function file_size_readable ($size, $retstring = null) {\n $sizes = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');\n if ($retstring === null) { $retstring = '%01.2f %s'; }\n $lastsizestring = end($sizes);\n foreach ($sizes as $sizestring) {\n if ($size < 1024) { break; }\n if ($sizestring != $lastsizestring) { $size /= 1024; }\n }\n if ($sizestring == $sizes[0]) { $retstring = '%01d %s'; } // Bytes aren't normally fractional\n return sprintf($retstring, $size, $sizestring);\n}", "function twe_format_filesize($size) {\n\t$a = array(\"B\",\"KB\",\"MB\",\"GB\",\"TB\",\"PB\");\n\t\n\t$pos = 0;\n\twhile ($size >= 1024) {\n\t\t$size /= 1024;\n\t\t$pos++;\n\t}\n\treturn round($size,2).\" \".$a[$pos];\n}", "public static function niceFilesize($file){\n\t\t$size = filesize($file);\n\t\t$ext = 'Bytes';\n\t\tif($size > 1024){\n\t\t\t$size = $size/1024;\n\t\t\t$ext = 'KB';\n\t\t}\n\t\tif($size > 1024){\n\t\t\t$size = $size/1024;\n\t\t\t$ext = 'MB';\n\t\t}\n\t\tif($size > 1024){\n\t\t\t$size = $size/1024;\n\t\t\t$ext = 'GB';\n\t\t}\n\t\treturn number_format($size, 2, '.', ' ').' '.$ext;\n\t}", "function acf_format_filesize($size = 1)\n{\n}", "private function get_filedir_Usage() {\n global $DB;\n $fileDir = $DB->get_field_sql('SELECT SUM(filesize) FROM {files}');\n return $fileDir . \" MB\";\n }", "public function formatFilesize($filesize) {\n\t\tif($filesize > 1073741824) {\n\t\t\treturn round($filesize / 1073741824, 2) . \" GB\";\n\t\t} elseif($filesize > 1048576) {\n\t\t\treturn round($filesize / 1048576, 2) . \" MB\";\n\t\t} elseif($filesize > 1024) {\n\t\t\treturn round($filesize / 1024, 2) . \" KB\";\n\t\t} else {\n\t\t\treturn $filesize . \" bytes\";\n\t\t}\n\t}", "function fileOfSize($size, $precision = 2)\n{\n if ($size >= 1099511627776) return round(($size / 1099511627776 * 100) / 100, $precision) . ' To';\n if ($size >= 1073741824) return round(($size / 1073741824 * 100) / 100, $precision) . ' Go';\n if ($size >= 1048576) return round(($size / 1048576 * 100) / 100, $precision) . ' Mo';\n if ($size >= 1024) return round(($size / 1024 * 100) / 100, $precision) . ' Ko';\n if ($size > 0) return $size . ' o';\n return '-';\n}", "function file_size($size)\r\n\r\n{\r\n\r\n\t$units = array('b', 'Kb', 'Mb', 'Gb', 'Tb', 'Pb', 'Eb');\r\n\r\n\r\n\r\n\tfor ($i = 0; $size > 1024; $i++)\r\n\r\n\t\t$size /= 1024;\r\n\r\n\r\n\r\n\treturn round($size, 2).' '.$units[$i];\r\n\r\n}", "function format_filesize($filesize = 0, $returnbytes = false)\n\t\t{\n\t\t\t// was squeezed into 2 lines. Imagine debugging that. No fun.\n\t\t\t\n\t\t\twhile (($filesize / 1024) >= 1) { \n\t\t\t\t$filesize_count++; \n\t\t\t\t$filesize = ($filesize / 1024); \n\t\t\t} \n\t\t\t\n\t\t\t$filesize_count = (($filesize_count < 0) ? 0 : $filesize_count);\n\t\t\t\n\t\t\tif ($returnbytes == true) {\n\t\t\t\treturn array(\"f\" => $filesize, \"c\" => $filesize_count);\n\t\t\t} else {\n\t\t\t\t$finalsize = substr($filesize, 0, (strpos($filesize, \".\") + 4));\n\t\t\t\t$finalname = (($filesize > 0.9 && $filesize < 2.0) ? $this->mmhclass->lang['3103'][$filesize_count] : $this->mmhclass->lang['4191'][$filesize_count]);\n\t\t\t\t\n\t\t\t\treturn (($filesize < 0 || $filesize_count > 9) ? $this->mmhclass->lang['5454'] : sprintf(\"%s %s\", $finalsize, $finalname));\n\t\t\t}\n\t\t}", "function format_size($file_size, $sizetype) {\n\t\tswitch(strtolower($sizetype)){\n\t\t\tcase \"kb\":\n\t\t\t\t$filesize = $file_size * .0009765625; // bytes to KB\n\t\t\tbreak;\n\t\t\tcase \"mb\":\n\t\t\t\t$filesize = $file_size * .0009765625 * .0009765625; // bytes to MB\n\t\t\tbreak;\n\t\t\tcase \"gb\":\n\t\t\t\t$filesize = $file_size * .0009765625 * .0009765625 * .0009765625; // bytes to GB\n\t\t\tbreak;\n\t\t}\n\t\tif($filesize <= 0){\n\t\t\t$filesize = 0;\n\t\t} else {\n\t\t\t$filesize = round($filesize, 2).' '.$sizetype;\n\t\t}\n\t\treturn $filesize;\n\t}", "function sizeFormat($b = 0){\r\n\t\tif($b < 1024){\r\n\t\t\treturn $b . 'bytes';\r\n\t\t}elseif($b < 1048576){\r\n\t\t\treturn round($b / 1024 * 100 ) / 100 . 'KB';\r\n\t\t}elseif($b < 130023424){\r\n\t\t\treturn round($b / 1048576 * 100 ) / 100 . 'MB';\r\n\t\t}elseif($b < 133143986176){\r\n\t\t\treturn round($b / 130023424 * 100) / 100 . 'GB';\r\n\t\t}else{\r\n\t\t\treturn round($b / 133143986176 * 100) / 100 . 'TB';\r\n\t\t}\r\n\t}", "public function getFormatSize() {}", "function human_filesize($size, $precision = 2) {\n $units = array('B','kB','MB','GB','TB','PB','EB','ZB','YB');\n $step = 1024;\n $i = 0;\n while (($size / $step) > 0.9) {\n $size = $size / $step;\n $i++;\n }\n return round($size, $precision).$units[$i];\n}", "function humanFileSize($size,$unit=\"\") \n {\n if( (!$unit && $size >= 1<<30) || $unit == \"GB\")\n return number_format($size/(1<<30),2).\"GB\";\n if( (!$unit && $size >= 1<<20) || $unit == \"MB\")\n return number_format($size/(1<<20),2).\"MB\";\n if( (!$unit && $size >= 1<<10) || $unit == \"KB\")\n return number_format($size/(1<<10),2).\"KB\";\n return number_format($size).\" bytes\";\n }", "function human_filesize($size,$unit=\"\") {\n if( (!$unit && $size >= 1<<30) || $unit == \"GB\")\n return number_format($size/(1<<30),2).\"GB\";\n if( (!$unit && $size >= 1<<20) || $unit == \"MB\")\n return number_format($size/(1<<20),2).\"MB\";\n if( (!$unit && $size >= 1<<10) || $unit == \"KB\")\n return number_format($size/(1<<10),2).\"KB\";\n return number_format($size).\" bytes\";\n}", "function size_format($bytes, $decimals = 0)\n {\n }", "public function getSize(string $name) : string {\n return $this->sizeFiles[$name] ?? '';\n }", "public function getSizeFormatted($si = false);", "public function getSize() {\r\n\t\treturn $this->app->filesystem->formatFilesize($this->get('size', 0));\r\n\t}", "public function getSizeForHuman()\n {\n return File::format_size($this->Size);\n }", "public function getFormattedStorageLimit() {\n return $this->getFormattedSize($this->getStorageLimit());\n }", "function getFilesizeString(float $size, int $decPoint = 2, bool $upperCase = false, string $separator = '')\n{\n\t$unitScale = ['byte', 'kb', 'mb', 'gb', 'tb', 'pb', 'eb', 'zb', 'yb'];\n\t$unit = 'byte';\n\t$scale = 0;\n\t$decPoint = ($decPoint < 1) ? 0 : $decPoint;\n\n\twhile ($size >= 1024 && isset($unitScale[$scale + 1])) {\n\t\t$size /= 1024;\n\t\t$unit = $unitScale[++$scale];\n\t}\n\n\t$size = ($decPoint) ? number_format($size, $decPoint) : (int) $size;\n\n\tif ($upperCase) {\n\t\t$unit = strtoupper($unit);\n\t}\n\n\treturn $size . $separator . $unit;\n}", "function pretty_filesize($dir,$file)\n{\n\t$size = filesize($dir.$file);\n\n\tif($size<1024)\n\t{\n\t\t$size = $size.\" Bytes\";\n\t}\n\telse if(($size<1048576)&&($size>1023))\n\t{\n\t\t$size=round($size/1024, 1).\" KB\";\n\t}\n\telse if(($size<1073741824)&&($size>1048575))\n\t{\n\t\t$size=round($size/1048576, 1).\" MB\";\n\t}\n\telse\n\t{\n\t\t$size=round($size/1073741824, 1).\" GB\";\n\t}\n\n\treturn $size;\n}", "public static function formatSize($size)\n {\n if ($size < DRUSH_KILOBYTE) {\n // format_plural() not always available.\n return dt('@count bytes', ['@count' => $size]);\n } else {\n $size /= DRUSH_KILOBYTE; // Convert bytes to kilobytes.\n $units = [\n dt('@size KB', []),\n dt('@size MB', []),\n dt('@size GB', []),\n dt('@size TB', []),\n dt('@size PB', []),\n dt('@size EB', []),\n dt('@size ZB', []),\n dt('@size YB', []),\n ];\n foreach ($units as $unit) {\n if (round($size, 2) >= DRUSH_KILOBYTE) {\n $size /= DRUSH_KILOBYTE;\n } else {\n break;\n }\n }\n return str_replace('@size', round($size, 2), $unit);\n }\n }", "function my_filesize($file) {\r\n if(!is_file(\"./\".$file)) return(\"\");\r\n // Setup some common file size measurements.\r\n $kb = 1024; // Kilobyte\r\n $mb = 1024 * $kb; // Megabyte\r\n $gb = 1024 * $mb; // Gigabyte\r\n $tb = 1024 * $gb; // Terabyte\r\n // Get the file size in bytes.\r\n $size = filesize($file);\r\n /* If it's less than a kb we just return the size, otherwise we keep\r\ngoing until\r\n the size is in the appropriate measurement range. */\r\n if($size < $kb) {\r\n return $size.\" Octets\";\r\n }\r\n else if($size < $mb) {\r\n return number_format($size/$kb,2,\",\",\"\").\" Ko\";\r\n }\r\n else if($size < $gb) {\r\n return number_format($size/$mb,2,\",\",\"\").\" Mo\";\r\n }\r\n else if($size < $tb) {\r\n return number_format($size/$gb,2,\",\",\"\").\" Go\";\r\n }\r\n else {\r\n return number_format($size/$tb,2,\",\",\"\").\" To\";\r\n }\r\n}", "function size_readable ($size, $retstring = null) {\n // adapted from code at http://aidanlister.com/repos/v/function.size_readable.php\n $sizes = array('B ', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');\n if ($retstring === null) { $retstring = '%01.2f %s'; }\n $lastsizestring = end($sizes);\n foreach ($sizes as $sizestring) {\n if ($size < 1024) { break; }\n if ($sizestring != $lastsizestring) { $size /= 1024; }\n }\n if ($sizestring == $sizes[0]) { $retstring = '%01d %s'; } // Bytes aren't normally fractional\n return sprintf($retstring, $size, $sizestring);\n }", "function humanize_filesize($bytes, $dec = 2)\n{\n $size = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n $factor = floor((strlen($bytes) - 1) / 3);\n\n return sprintf(\"%.{$dec}f\", $bytes / pow(1024, $factor)) . @$size[$factor];\n}", "public function filesizeStr() {\n\t\treturn wireBytesStr($this->filesize()); \n\t}", "public function formatSizeDataProvider() {}", "function prettySize($size)\n{\n $limit = 10 * 1024;\n $mult = 1;\n\n if ($size < ($limit * $mult)) {\n $retSize = $size . \" bytes\";\n } else {\n $mult *= 1024;\n if ($size < ($limit * $mult)) {\n $size = round($size / $mult);\n $retSize = $size . \" KiB\";\n } else {\n $mult *= 1024;\n if ($size < ($limit * $mult)) {\n $size = round($size / $mult);\n $retSize = $size . \" MiB\";\n } else {\n $mult *= 1024;\n if ($size < ($limit * $mult)) {\n $size = round($size / $mult);\n $retSize = $size . \" GiB\";\n } else {\n $mult *= 1024;\n $size = round($size / $mult);\n $retSize = $size . \" TiB\";\n }\n }\n }\n }\n return $retSize;\n}", "function human_filesize($bytes, $decimals = 2, $decimalSeparator = null, $thousandSeparator = null)\n{\n $decimalSeparator = $decimalSeparator ?? (localeconv()['decimal_point'] ?? '.');\n $thousandSeparator = $thousandSeparator ?? (localeconv()['thousands_sep'] ?? ',');\n $size = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');\n $factor = min(floor((strlen($bytes) - 1) / 3), count($size) - 1);\n return number_format($bytes / pow(1024, $factor), $decimals, $decimalSeparator, $thousandSeparator) . $size[$factor];\n}", "function human_filesize($bytes, $decimals = 0)\n{\n $size = ['B','KB','MB','GB','TB','PB','EB','ZB','YB'];\n $factor = floor((strlen($bytes) - 1) / 3);\n return sprintf(\"%.{$decimals}f\", $bytes / pow(1024, $factor)) . @$size[$factor];\n}", "function format_toSizeInBytes_shortForm($size_in_bytes) {\n\t\t//\n\t\t// Data sizes are normally specified in KB - powers of 1024, so return KB rather than kB\n\n\t\tif ($size_in_bytes < (1024 * 1024)) {\n\t\t\t$unit = \"K\";\n\t\t\t$unitSize = $size_in_bytes / 1024;\n\t\t} else if ($size_in_bytes < (1024 * 1024 * 1024)) {\n\t\t\t$unit = \"M\";\n\t\t\t$unitSize = $size_in_bytes / (1024 * 1024);\n\t\t} else {\n\t\t\t$unit = \"G\";\n\t\t\t$unitSize = $size_in_bytes / (1024 * 1024 * 1024);\n\t\t}\n\n\t\t$showDecimalPlace = $unitSize < 10 && round($unitSize, 1) != round($unitSize);\n\n\t\treturn sprintf($showDecimalPlace ? \"%1.1f\" : \"%1.0f\", $unitSize) . $unit;\n\t}", "function sloodle_get_size_description($size)\n {\n // Make sure we have a number of bytes\n $bytes = 0;\n if (is_int($size)) $bytes = $size;\n else $bytes = sloodle_convert_file_size_shorthand($size);\n $desc = '';\n\n // Keep the number small by going with the largest possible units\n if ($bytes >= 1073741824) $desc = ($bytes / 1073741824).\" GB\";\n else if ($bytes >= 1048576) $desc = ($bytes / 1048576). \" MB\";\n else if ($bytes >= 1024) $desc = ($bytes / 1024). \" KB\";\n else $desc = $bytes . \" bytes\";\n\n return $desc;\n }", "public function formatFilesize($bytes, $format = false, $precision = 2)\n\t{ \n\t\t$kilobyte = 1024;\n\t\t$megabyte = $kilobyte * 1024;\n\t\t$gigabyte = $megabyte * 1024;\n\t\t$terabyte = $gigabyte * 1024;\n\n\t\tif (($bytes >= 0) && ($bytes < $kilobyte) && !$format || $format == 'B') {\n\t\t\treturn $bytes . ' B';\n\n\t\t} elseif (($bytes >= $kilobyte) && ($bytes < $megabyte) && !$format || $format == 'KB') {\n\t\t\treturn round($bytes / $kilobyte, $precision) . ' KB';\n\n\t\t} elseif (($bytes >= $megabyte) && ($bytes < $gigabyte) && !$format || $format == 'MB') {\n\t\t\treturn round($bytes / $megabyte, $precision) . ' MB';\n\n\t\t} elseif (($bytes >= $gigabyte) && ($bytes < $terabyte) && !$format || $format == 'GB') {\n\t\t\treturn round($bytes / $gigabyte, $precision) . ' GB';\n\n\t\t} elseif ($bytes >= $terabyte && !$format || $format == 'TB') {\n\t\t\treturn round($bytes / $terabyte, $precision) . ' TB';\n\t\t} else {\n\t\t\treturn $bytes . ' B';\n\t\t}\n\t}", "public static function fsize($size){\n $unit = array('b','Kb','Mb','Gb','Tb','Pb');\n $prefix = $size < 0 ? '-' : ''; $size = abs($size);\n return $prefix.@round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];\n }", "function FormatSizeDisplay($fileSizeInfo, $precision = 2)\n\t{\n\t\t\t// $this->fileSizeDisplay .= $fileSizeInfo.\" (bytes)\" ;\n\t\t// elseif ($fileSizeInfo >= 1024 && $fileSizeInfo < 1<<20)\n\t\t\t// $this->fileSizeDisplay = number_format($fileSizeInfo/1024,2,\".\",\"\").\" (Kb)\";\n\t\t// elseif ($fileSizeInfo >= 1<<20)\n\t\t\t// $this->fileSizeDisplay = number_format($fileSizeInfo/(1<<20),2,\".\",\"\").\" (Mb)\";\n\t\t\t\n\t\tif ($fileSizeInfo < 1000000)\n\t\t\t$fileSizeDisplay = number_format($fileSizeInfo/1000, $precision,\".\",\"\").\" Kb\";\n\t\telse\n\t\t\t$fileSizeDisplay = number_format($fileSizeInfo/1000000, $precision,\".\",\"\").\" Mb\";\n\t\t\t\n\t\treturn $fileSizeDisplay;\n\t}", "function bsize($size) {\n foreach (array('', 'K', 'M', 'G') as $k) {\n if ($size < 1024) {\n break;\n }\n $size /= 1024;\n }\n return sprintf(\"%5.1f %sBytes\", $size, $k);\n}", "function file_size_nice($size) {\n\t// Adapted from: http://www.php.net/manual/en/function.filesize.php\n\n\t$mod = 1024;\n\n\t$units = explode(' ', 'B KB MB GB TB PB');\n\tfor ($i = 0; $size > $mod; $i++) {\n\t\t$size /= $mod;\n\t}\n\n\treturn round($size, 2) . ' ' . $units[$i];\n}", "function bwm_filesize_str($file_or_size, $nonexistent_return = 'temporarily unavailable'){ \r\n $b = 0;//Number of bytes\r\n if (is_string($file_or_size)) {\r\n \tif (!file_exists($file_or_size))\r\n \t\treturn $nonexistent_return; \r\n \t$b = (int)filesize($file_or_size);\r\n\t\t} else {\r\n\t\t\t$b = intval($file_or_size);\r\n\t\t} \r\n $s = array('B', 'kB', 'MB', 'GB', 'TB'); \r\n $con = 1024; \r\n $e = (int)(log($b,$con)); \r\n return number_format($b/pow($con,$e), $e > 0 ? 1 : 0).' '.$s[$e]; \r\n}", "function convertFileSize ($filesize){\n $count = 0;\n $newFileSize = '';\n $array = ['byte', 'kb', 'mb', 'gb', 'tb', 'pb'];\n while($filesize > 1024){\n $filesize /= 1024;\n $count++;\n }\n\n $newFileSize .= round($filesize, 2) . $array[$count]; \n\n \n return $newFileSize;\n }", "public function getUploadedAttribute($value): string\n {\n return SizeFormatter::getFormattedSize((int) $value);\n }", "function human_filesize($bytes, $decimals = 2)\n {\n $size = trans('file.size');\n $factor = floor((strlen($bytes) - 1) / 3);\n\n return sprintf(\"%.{$decimals}f\", $bytes / pow(1024, $factor)).@$size[$factor];\n }", "function format_size($row) {\n if (is_null($row['job_size'])) {\n return \"...\";\n }\n $size = sprintf(\"%.2f\", $row['job_size']/1024).\" kb\";\n if (identity_can('job-view-source', $row)) {\n return format_link(url_job_view_source($row['id']), $size);\n }\n return $size;\n }", "function PMA_displayMaximumUploadSize($max_upload_size) {\r\n list($max_size, $max_unit) = PMA_formatByteDown($max_upload_size);\r\n return '(' . sprintf(_AM_SELECTAFILE_DESC, $max_size, $max_unit) . ')';\r\n}", "public function getFormattedSize($kilobytes) {\n // load translated abbreviations\n global $html_kb, $html_mb, $html_gb;\n\n if ($kilobytes >= 1048576) { //If gigabytes...\n $size = round($kilobytes / 1024 / 1024);\n return $size . ' ' . $html_gb;\n }\n elseif (($kilobytes < 1048576) && ($kilobytes >= 1024)) { //If megabytes...\n $size = round($kilobytes / 1024);\n return $size . ' ' . $html_mb;\n }\n else { //If kilobytes...\n return $kilobytes . ' ' . $html_kb;\n }\n }", "function formatSize($b)\n\t{\n\t\t//1024\t\tk\n\t\t//1048576\tm\n\t\t//1073741824\tg\n\n\t\tif ($b >= 1073741824)\n\t\t\t$thesize = round($b / 1073741824 * 100) / 100 . \"G\"; \n\t\telseif ($b >= 1048576)\n\t\t\t$thesize = round($b / 1048576 * 100) / 100 . \"MB\";\n\t\telseif ($b >= 1024)\n\t\t\t$thesize = round($b / 1024 * 100) / 100 . \"K\"; \n\t\telse\n\t\t\t$thesize = $b . \"b\";\n\n\t\treturn $thesize;\n\t}", "function fm_readable_filesize($size) {\r\n\t$filesizename = array(\" Bytes\", \" KB\", \" MB\", \" GB\", \" TB\", \" PB\", \" EB\", \" ZB\", \" YB\");\r\n\tif ($size != 0) {\r\n\t\treturn round($size/pow(1024, ($i = floor(log($size, 1024)))), 2) . $filesizename[$i];\r\n\t} else {\r\n\t\treturn \"0\".$filesizename[0];\r\n\t}\r\n}", "public static function formatSize($bytes, $round=1)\n\t{\n\t\t$suffix = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');\n\t\tfor ($i=0; $bytes > 1024 && isset($suffix[$i+1]); $i++) {$bytes /= 1024;}\n\t\treturn round($bytes,$round).\" \".$suffix[$i];\n\t}", "public function getSize(): string;", "function format_bytes ( $size ) {\n\t\tswitch ( $size ) {\n\t\t\tcase $size > 1000000:\n\t\t\t\treturn number_format(ceil($size / 1000000)) . \"mb\";\n\t\t\t\tbreak;\n\t\t\tcase $size > 1000:\n\t\t\t\treturn number_format(ceil($size / 1000)) . \"k\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn number_format($size) . \"b\";\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function testFileSizeFormatter()\n {\n $formatter = function ($bytes, $precision = 2) {\n $units = array('B', 'KB', 'MB', 'GB', 'TB');\n\n $bytes = max($bytes, 0);\n $pow = floor(($bytes ? log($bytes) : 0) / log(1024));\n $pow = min($pow, count($units) - 1);\n\n // Uncomment one of the following alternatives\n // $bytes /= pow(1024, $pow);\n // $bytes /= (1 << (10 * $pow));\n return round($bytes, $precision) . ' ' . $units[$pow];\n };\n\n $valueSet = [[0], [1000], [500050], [323241234], [5000000]];\n\n $this->assertRecompilesCorrectly($formatter, $valueSet);\n }", "public function getFormattedStorageUsage() {\n return $this->getFormattedSize($this->getStorageUsage());\n }", "function sloodle_convert_file_size_shorthand($size)\n {\n $size = trim($size);\n $num = (int)$size;\n $char = strtolower($size{strlen($size)-1});\n switch ($char)\n {\n case 'g': $num *= 1024;\n case 'm': $num *= 1024;\n case 'k': $num *= 1024;\n }\n\n return $num;\n }", "public function getOriginalSize():string\n {\n }", "function large_images_human_filesize($bytes, $decimals = 2) {\n $sz = 'BKMGTP';\n $factor = floor((strlen($bytes) - 1) / 3);\n return sprintf(\"%.{$decimals}f\", $bytes / pow(1024, $factor)) . @$sz[$factor];\n}", "function virustotalscan_get_size($size)\r\n{\r\n $standard = floatval(1024);\r\n if (floatval($size) < $standard) {\r\n // atunci sunt biti\r\n return $size.\" bytes\";\r\n }\r\n else {\r\n // sunt mai mult de 1024 de biti\r\n if (floatval(floatval($size)/1024) > $standard) {\r\n // atunci este de ordinul MB-itilor si se iau doar doua zecimale semnificative\r\n return number_format(floatval($size)/1024/1024, 2). \" MB\";\r\n }\r\n else {\r\n // este de ordinul KB-itilor si se iau doar doua zecimale semnificative\r\n return number_format(floatval($size)/1024, 2). \" KB\";\r\n }\r\n // restul nu ne intereseaza pentru ca nu pot fi incarcate fisiere mai mari de 1 GB\r\n }\t\r\n}", "function formatRawSize($bytes) {\n if(!empty($bytes)) {\n\n $s = array('bytes', 'kb', 'MB', 'GB', 'TB', 'PB');\n $e = floor(log($bytes)/log(1024));\n\n $output = sprintf('%.2f '.$s[$e], ($bytes/pow(1024, floor($e))));\n\n return $output;\n }\n}", "private function getSizeFormattedSi(int $size): string\n {\n if ($size > 1000 * 1000) {\n return sprintf('%0.1f MB', ($size / 1000 / 1000));\n }\n if ($size > 1000) {\n return sprintf('%0.1f KB', ($size / 1000));\n }\n\n return $size . ' B';\n }", "function formatBytes($size) {\n $units = array(' B', ' KB', ' MB', ' GB', ' TB');\n for ($i = 0; $size >= 1024 && $i < 4; $i++) $size /= 1024;\n return round($size, 2).$units[$i];\n}", "public function file_filesize($params)\n {\n\n $size = max(0, (int)$params);\n $units = array( 'b', 'Kb', 'Mb', 'Gb', 'Tb', 'Pb', 'Eb', 'Zb', 'Yb');\n $power = $size > 0 ? floor(log($size, 1024)) : 0;\n return number_format($size / pow(1024, $power), 2, '.', ',') . $units[$power];\n\n }", "public function getReadableFileSize($retstring = null) {\n $sizes = array('bytes', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');\n\n if ($retstring === null) {\n $retstring = '%01.2f %s';\n }\n\n $lastsizestring = end($sizes);\n\n foreach ($sizes as $sizestring) {\n if ($this->size < 1024) {\n break;\n }\n if ($sizestring != $lastsizestring) {\n $this->size /= 1024;\n }\n }\n if ($sizestring == $sizes[0]) {\n $retstring = '%01d %s';\n } // Bytes aren't normally fractional\n return sprintf($retstring, $this->size, $sizestring);\n }", "function formatSizeUnits($bytes) {\n if ($bytes >= 1073741824) {\n $bytes = number_format($bytes / 1073741824, 2) . ' GB';\n } elseif ($bytes >= 1048576) {\n $bytes = number_format($bytes / 1048576, 2) . ' MB';\n } elseif ($bytes >= 1024) {\n $bytes = number_format($bytes / 1024, 2) . ' KB';\n } elseif ($bytes > 1) {\n $bytes = $bytes . ' bytes';\n } elseif ($bytes == 1) {\n $bytes = $bytes . ' byte';\n } else {\n $bytes = '0 bytes';\n }\n return $bytes;\n}", "function view_size($size) {\n\n\tif (!is_numeric($size))\n\t\treturn \"[Error]\";\n\telse {\n\t\tif ($size >= 1073741824)\n\t\t\t$size = round($size/1073741824*100)/100 .\" GB\";\n\t\telse\n\t\t\tif ($size >= 1048576)\n\t\t\t\t$size = round($size/1048576*100)/100 .\" MB\";\n\t\telse\n\t\t\tif ($size >= 1024)\n\t\t\t\t$size = round($size/1024*100)/100 .\" KB\";\n\t\telse \n\t\t\t$size = $size . \" B\";\n\t\t\t\n\t\treturn $size;\n\t}\n}", "private function formatFilename() {\n return $this->prefix . $this->name . \".\" . $this->extension;\n }", "protected static function humanReadableSize(float $sizeInBytes): string\n {\n return Format::humanReadableSize($sizeInBytes);\n }", "function formatSizeUnits($bytes)\n {\n if ($bytes >= 1073741824)\n\t {\n\t $bytes = number_format($bytes / 1073741824, 2) . ' GB';\n }\n elseif ($bytes >= 1048576)\n {\n $bytes = number_format($bytes / 1048576, 2) . ' MB';\n\t }\n elseif ($bytes >= 1024)\n {\n $bytes = number_format($bytes / 1024, 2) . ' KB';\n }\n elseif ($bytes > 1)\n {\n $bytes = $bytes . ' bytes';\n }\n\t elseif ($bytes == 1)\n {\n\t $bytes = $bytes . ' byte';\n }\n else\n {\n $bytes = '0 bytes';\n\t }\n\n return $bytes;\n}", "function cre_resize_bytes($size) {\n $count = 0;\n $format = array(\"B\",\"KB\",\"MB\",\"GB\",\"TB\",\"PB\",\"EB\",\"ZB\",\"YB\");\n while(($size/1024)>1 && $count<8) {\n $size=$size/1024;\n $count++;\n }\n $return = number_format($size,0,'','.').\" \".$format[$count];\n return $return;\n }", "public function getDimensionsString()\n {\n $size = $this->getImageSize();\n\n return $size[3];\n }", "function getFormatFilename()\n\n\t{\n\n\t\tglobal $config;\n\n\t\tglobal $config;\n\n\n\n\t\t$bitrate = $this->bitrate;\n\n\t\tfor ($i=0;$i<count($config['audioFormats']);$i++)\n\n\t\t\tif (abs($config['audioFormats'][$i]['bitrate'] - $this->bitrate) < $config['bitrateTolerance'])\n\n\t\t\t\t$bitrate = $config['audioFormats'][$i]['bitrate'];\n\n\t\treturn round($bitrate) . 'kbps_' . $this->channels . 'chn_' . $this->samplerate . 'Hz.' . $this->format;\n\n\t}", "public function formatSize($bytes, $precision = 2)\n {\n if ((int)$bytes < 1) {\n return '';\n }\n\n $units = ['B', \"KB\", \"MB\", \"GB\", \"TB\"];\n\n $bytes = (int)$bytes;\n $base = log($bytes) / log(1000); // 1024 would be for MiB KiB etc\n $pow = pow(1000, $base - floor($base)); // Same rule for 1000\n\n return round($pow, $precision) . ' ' . $units[(int)floor($base)];\n }", "private function getFilesize($filename, $precision=2) {\n $size = filesize($filename);\n if ($size < 1024) {\n $size = $size . \" bytes\";\n } else if ($size < 1048576) {\n $size = round($size / 1024, $precision) . \" KB\";\n } else if ($size < 1073741824) {\n $size = round($size / 1048576, $precision) . \" MB\";\n } else if ($size < 1099511627776) {\n $size = round($size / 1073741824, $precision) . \" GB\";\n } else {\n $size = round($size / 1099511627776, $precision) . \" TB\";\n }\n return $size;\n }", "public static function filesize($file) {\n\t\tif(self::has_file($file)) {\n\t\t\t\n\t\t\t// Get Filesize\n\t\t\t$size = filesize($file);\n\t\t\t$sizes = array(\" Bytes\", \" KB\", \" MB\", \" GB\", \" TB\", \" PB\", \" EB\", \" ZB\", \" YB\");\n\n\t\t\t// Calculate\n\t if ($size == 0) {\n\t\t\t\treturn('n/a');\n\t\t\t} else {\n\t \treturn (round($size/pow(1024, ($i = floor(log($size, 1024)))), 2) . $sizes[$i]);\n\t\t\t}\t\n\t\t} else {\n\t\t\tdie(\"Disk:: File '\".$file.\"' not found!\");\n\t\t}\n\t}", "function getFileSizeUnit($file_size){\nswitch (true) {\n case ($file_size/1024 < 1) :\n return intval($file_size ) .\" Bytes\" ;\n break;\n case ($file_size/1024 >= 1 && $file_size/(1024*1024) < 1) :\n return round(($file_size/1024) , 2) .\" KB\" ;\n break;\n default:\n return round($file_size/(1024*1024) , 2) .\" MB\" ;\n}\n}", "public function getCompressedSize():string\n {\n }", "function formatBytes($size, $precision = 2)\n {\n $base = log($size, 1024);\n $suffixes = array('', 'K', 'M', 'G', 'T'); \n\n return round(pow(1024, $base - floor($base)), $precision) .' '. $suffixes[floor($base)];\n }", "public function getReadableFileSize($size, $retstring = null) {\n\t $sizes = array('bytes', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');\n\n\t if ($retstring === null) { $retstring = '%01.2f %s'; }\n\n\t\t$lastsizestring = end($sizes);\n\n\t\tforeach ($sizes as $sizestring) {\n\t \tif ($size < 1024) { break; }\n\t if ($sizestring != $lastsizestring) { $size /= 1024; }\n\t }\n\t if ($sizestring == $sizes[0]) { $retstring = '%01d %s'; } // Bytes aren't normally fractional\n\t return sprintf($retstring, $size, $sizestring);\n\t}", "function human_filesize($bytes, $decimals = 2) {\n $sz = 'BKMGTP';\n $factor = floor((strlen($bytes) - 1) / 3);\n return sprintf(\"%.{$decimals}f\", $bytes / pow(1024, $factor)) . @$sz[$factor];\n}", "function dark_urban_custom_image_sizes_names( $sizes ) {\n /* Pinegrow generated Image Sizes Names Begin*/\n /* This code will be replaced by returning names of custom image sizes. */\n /* Pinegrow generated Image Sizes Names End */\n return $sizes;\n}", "function fileSize($filePath) { \n\t\t$units = array('B', 'KB', 'MB', 'GB', 'TB'); \n\n\t\t$size = Storage::size($filePath);\n\t \tfor ($i = 0; $size >= 1024 && $i < 4; $i++) $size /= 1024; \n\n\t \treturn round($size, 2).$units[$i]; \n\t}", "public function getReadableSize()\n {\n $units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];\n\n for ($i = 0; $this->size > 1024; $i++) {\n $this->size /= 1024;\n }\n\n return round($this->size, 2).' '.$units[$i];\n }", "private function buildSize() {\n return '&size=' . $this->mappingOptions->size;\n }", "function ccac_2020_new_custom_image_sizes_names( $sizes ) {\n /* Pinegrow generated Image Sizes Names Begin*/\n /* This code will be replaced by returning names of custom image sizes. */\n /* Pinegrow generated Image Sizes Names End */\n return $sizes;\n}", "function getHumanSize($precision=1)\n {\n $bytes = $this->getSize();\n if ($bytes>1048576) {\n return round($bytes/1048576,$precision).'MB';\n } elseif ($bytes>1024) {\n return round($bytes/1024,$precision).'KB';\n } else {\n return round($bytes,$precision).'B';\n }\n }", "function getMaxAttachmentSize()\n {\n $size = Misc::return_bytes(ini_get('upload_max_filesize'));\n return Misc::formatFileSize($size);\n }", "protected function filesToString()\n {\n $this->log(sprintf('%s', __METHOD__), 'debug');\n\n return implode(\"\\n\", $this->card->getFiles());\n }", "public function getFormatedFileSize($filesize) {\n\t\t$units = array('KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');\n\t\t$bytes = $filesize;\n\t\tif ($bytes <= 0) {\n\t\t\t$bytes = number_format($bytes, 2, '.', '') . \" bytes\";\n\t\t} else {\n\t\t\t$bytes = number_format($bytes / 1024, 2, '.', '');\n\t\t\tfor ($i = 0;$i < count($units);$i++) {\n\t\t\t\tif (number_format($bytes, 2, '.', '') >= 1024) {\n\t\t\t\t\t$bytes = number_format($bytes / 1024, 2, '.', '');\n\t\t\t\t} else {\n\t\t\t\t\t$bytes = number_format($bytes, 2, '.', '');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$bytes = $bytes . ' ' . $units[$i];\n\t\t}\n\t\t\n\t\treturn $bytes;\n\t}", "public function standardizationImageFormat($files) :string\n {\n switch ($files['image']['type']) {\n case 'image/jpg':\n case 'image/jpeg':\n case 'image/pjpeg':\n $extension = 'jpg';\n break;\n\n case 'image/png':\n $extension = 'png';\n break;\n\n case 'image/webp':\n $extension = 'webp';\n break;\n }\n return $extension;\n }", "protected function get_formatted_type()\n\t{\n\t\t$rc = '';\n\n\t\t$type = $this->type;\n\t\t$size = $this->size;\n\n\t\tif (!$size && $type == self::TYPE_VARCHAR)\n\t\t{\n\t\t\t$size = 255;\n\t\t}\n\n\t\tswitch ($type)\n\t\t{\n\t\t\tcase self::TYPE_INTEGER:\n\t\t\tcase self::TYPE_TEXT:\n\t\t\tcase self::TYPE_BLOB:\n\n\t\t\t\t$t = [\n\n\t\t\t\t\tself::TYPE_BLOB => 'BLOB',\n\t\t\t\t\tself::TYPE_INTEGER => 'INT',\n\t\t\t\t\tself::TYPE_TEXT => 'TEXT',\n\n\t\t\t\t][ $type ];\n\n\t\t\t\tif (\\is_numeric($size))\n\t\t\t\t{\n\t\t\t\t\t$rc .= \"$t( $size )\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$rc .= \\strtoupper($size) . $t;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tif ($size)\n\t\t\t\t{\n\t\t\t\t\t$rc .= \\strtoupper($type) . \"( $size )\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$rc .= \\strtoupper($type);\n\t\t\t\t}\n\t\t}\n\n\t\treturn $rc;\n\t}", "function number_to_human_size($bytes){\n\t$border = 1024 * 1.5;\n\tif ($bytes < $border)\n\t\treturn sprintf('%u Byte', $bytes);\n\t\n\t$bytes /= 1024;\n\tif ($bytes < $border)\n\t\treturn sprintf('%u KiByte', $bytes);\n\t\n\t$bytes /= 1024;\n\treturn sprintf('%.1f MiByte', $bytes);\n}" ]
[ "0.71914893", "0.7160512", "0.7044623", "0.6914634", "0.6913814", "0.68957895", "0.68708575", "0.6727317", "0.6709681", "0.6695827", "0.66767335", "0.65829206", "0.6580795", "0.65577877", "0.654197", "0.6506778", "0.6487925", "0.64367807", "0.6424072", "0.6421114", "0.64119184", "0.63535064", "0.63466203", "0.6343777", "0.63415855", "0.6334493", "0.6331524", "0.6325275", "0.6261733", "0.62051743", "0.61976326", "0.61789274", "0.61757845", "0.61625797", "0.61506015", "0.6143793", "0.61352986", "0.613468", "0.6131612", "0.6127491", "0.6122187", "0.61131096", "0.6102331", "0.60954136", "0.6086438", "0.6069898", "0.6058782", "0.6057461", "0.60431653", "0.6041973", "0.6036084", "0.6031152", "0.60229665", "0.60057646", "0.60056615", "0.5993776", "0.5979368", "0.5973915", "0.59684956", "0.59550583", "0.59515315", "0.59493667", "0.59384954", "0.5928405", "0.5922041", "0.59048045", "0.5900748", "0.5899496", "0.5889724", "0.5875882", "0.5855319", "0.5806981", "0.58031267", "0.57953185", "0.57926786", "0.5788313", "0.57807374", "0.5763891", "0.5762712", "0.5756198", "0.5752874", "0.5752065", "0.5749004", "0.5748223", "0.5737755", "0.5724529", "0.571557", "0.57129705", "0.5702271", "0.5701845", "0.56966513", "0.5671836", "0.56636095", "0.5655775", "0.5650706", "0.5645997", "0.56418884", "0.5639589", "0.56323445", "0.5632268", "0.5609263" ]
0.0
-1
Determine whether we are approaching the maximum execution time. Should be called once at the beginning of the script in which it's used.
function still_on_time($extra_time = 15) { static $max_execution_time, $start_time; $time = explode(' ', microtime()); $current_time = $time[0] + $time[1]; if (empty($max_execution_time)) { $max_execution_time = (function_exists('ini_get')) ? (int) @ini_get('max_execution_time') : (int) @get_cfg_var('max_execution_time'); // If zero, then set to something higher to not let the user catch the ten seconds barrier. if ($max_execution_time === 0) { $max_execution_time = 50 + $extra_time; } $max_execution_time = min(max(10, ($max_execution_time - $extra_time)), 50); // For debugging purposes // $max_execution_time = 10; global $starttime; $start_time = (empty($starttime)) ? $current_time : $starttime; } return (ceil($current_time - $start_time) < $max_execution_time) ? true : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function checkMaxExecutionTime() {}", "function isOverExecuted()\n {\n if ($this->start_time+$this->max_execution_time<time()) return true;\n else return false;\n }", "protected function exceededMaxRuntime(): bool\n {\n return (($this->maxRuntime > 0) && (time() - $this->startTime) > $this->maxRuntime);\n }", "private function isTimeLimitReached() \n {\n return $this->timeLimit < (microtime(true) - $this->startTime);\n }", "public function hasTimeLimitReached(): bool;", "public function getMaxExecutionTime()\n\t{\n\t\tif(!isset($this->_maxExecutionTime)){\n\t\t\t$this->_maxExecutionTime = $this->dontHardcodeService->searchDontHardcodeByParamNameAndFilterName(__CLASS__,'maxExecutionTime',true);\n\t\t}\n\n\t\tif(is_numeric($this->_maxExecutionTime) && $this->_maxExecutionTime > 44){\n\t\t\treturn $this->_maxExecutionTime;\n\t\t}\n\t\telse{\n\t\t\treturn 120;\n\t\t}\n\t}", "protected function isTimeLimit(): bool\n {\n return (microtime(true) - $this->startTime) > $this->options->timeLimit;\n }", "function rlip_get_maxruntime() {\n $maxruntime = (int)ini_get('max_execution_time');\n $maxruntime -= 2; // TBD: MUST STOP BEFORE time limit is reached!\n //echo \"\\nrlip_get_maxruntime(b):{$maxruntime}\\n\";\n if ($maxruntime < RLIP_MAXRUNTIME_MIN) {\n $maxruntime = RLIP_MAXRUNTIME_MIN;\n }\n return $maxruntime;\n}", "protected function timeExceeded() {\n if ($this->timeLimit == 0) {\n return FALSE;\n }\n $time_elapsed = time() - REQUEST_TIME;\n $pct_time = $time_elapsed / $this->timeLimit;\n if ($pct_time > $this->timeThreshold) {\n $this->showMessage(\n t('Time limit approaching, starting new batch',\n array('!pct' => round($pct_time*100),\n '!usage' => format_size($time_elapsed),\n '!limit' => format_size($this->timeLimit))),\n 'warning');\n return TRUE;\n }\n else {\n return FALSE;\n }\n }", "protected function hasTimeLimitReached()\n\t{\n\t\tif ($this->timeLimit > 0)\n\t\t{\n\t\t\tif ($this->timeLimitReached)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif ((time() - $this->hitStartTime) >= $this->timeLimit)\n\t\t\t{\n\t\t\t\t$this->timeLimitReached = true;\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function isIgnoreMinimumExecutionTime()\n\t{\n\t\treturn $this->ignoreMinimumExecutionTime;\n\t}", "public static function getMaxExecutionTime(): int\n {\n return static::getIniValue('max_execution_time');\n }", "public static function getMaxExecutionTime() {\n\t\t$maxExecutionTime = ini_get('max_execution_time');\n\n\t\t// Returns the default value, in case the ini_get fails.\n\t\tif ($maxExecutionTime === null || empty($maxExecutionTime) || $maxExecutionTime < 0) {\n\t\t\treturn 30;\n\t\t}\n\t\telse {\n\t\t\treturn intval($maxExecutionTime);\n\t\t}\n\t}", "function checkTimeoutLimit($crawlerId)\r\n {\r\n static $timeLimit;\r\n \r\n if (!$timeLimit) {\r\n $timeLimit = ini_get('max_execution_time');\r\n }\r\n\r\n if (!empty($timeLimit)) {\r\n $timeoutTime = PROCESS_TIME + $timeLimit;\r\n }\r\n\r\n if ($timeoutTime > time()) {\r\n return true;\r\n } else {\r\n $this->updateCrawlerStatus($crawlerId, self::RUN_STATUS_INCOMPLETE);\r\n die('The link spider script was interrupted because the maximum allowable script execution time has been reached.');\r\n }\r\n \r\n }", "function _checkMaxLimt()\r\n {\r\n if ($this->data[$this->name]['max_limit'] >= $this->data[$this->name]['min_limit']) {\r\n return true;\r\n }\r\n return false;\r\n }", "protected function get_maximum_execution_time() {\n\t\t_deprecated_function( __METHOD__, '2.1.1', 'ActionScheduler_Abstract_QueueRunner::get_time_limit()' );\n\n\t\t$maximum_execution_time = 30;\n\n\t\t// Apply deprecated filter\n\t\tif ( has_filter( 'action_scheduler_maximum_execution_time' ) ) {\n\t\t\t_deprecated_function( 'action_scheduler_maximum_execution_time', '2.1.1', 'action_scheduler_queue_runner_time_limit' );\n\t\t\t$maximum_execution_time = apply_filters( 'action_scheduler_maximum_execution_time', $maximum_execution_time );\n\t\t}\n\n\t\treturn absint( $maximum_execution_time );\n\t}", "public function reached()\r\n {\r\n $max = (int) $this->config->get('image_optimizer::settings.tiny_png.max_optimizations_per_month');\r\n\r\n if (empty($max)) {\r\n return false;\r\n }\r\n\r\n if ((bool) $this->config->get('image_optimizer::settings.tiny_png.enabled')\r\n && $this->config->get('image_optimizer::settings.tiny_png.api_key')\r\n ) {\r\n $tinyPngCount = $this->getTinyPngNumberOfCompressions();\r\n\r\n return $tinyPngCount >= $max;\r\n }\r\n\r\n return false;\r\n }", "private function check_media_meta_process_time(){\n\n\t $current_process_time = microtime(1) - $this->sl_time_ini_media_meta_process;\n\n\t if ($current_process_time >= $this->max_media_meta_execution_time){\n\n\t $this->end_media_meta_process = true;\n\n\t }\n\n\t}", "public function isElapsed()\n {\n return ($this->isTimeout() || $this->isLimitExceeded());\n }", "public static function getTimeLeft() {\n\t\treturn (ini_get(\"max_execution_time\") - self::getExecutionTime());\n\t}", "public function should_run()\n\t{\n\t\treturn $this->config['delete_pms_last_gc'] < time() - $this->config['delete_pms_gc'];\n\t}", "public function should_run()\n\t{\n\t\treturn (time() - (int) $this->config['titania_last_cleanup']) > (3600 * 6);\n\t}", "protected function isJobLimit(): bool\n {\n return $this->jobCount >= $this->options->jobLimit;\n }", "protected function time_exceeded( $start_time = '' ) {\n\n\t\t\tif ( ! empty( $start_time ) ) {\n\t\t\t\t$this->start_time = $start_time;\n\t\t\t}\n\n\t\t\t$finish = $this->start_time + apply_filters( $this->identifier . '_default_time_limit', 20 ); // 20 seconds\n\t\t\t$return = false;\n\n\t\t\tif ( time() >= $finish ) {\n\t\t\t\t$return = true;\n\t\t\t}\n\n\t\t\treturn apply_filters( $this->identifier . '_time_exceeded', $return );\n\t\t}", "public static function setMaxExecutionTime($seconds){\n\t\t$max = ini_get(\"max_execution_time\");\n\t\tif($max != 0 && ($seconds==0 || $seconds>$max)){\n\t\t\treturn ini_set(\"max_execution_time\", $seconds);\n\t\t}else\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}", "public function hasMaxCache(){\n return $this->_has(2);\n }", "static public function IsRequestMemoryLimitReached() {\n if (self::$memoryLimit === false) {\n return false;\n }\n return memory_get_peak_usage(true) >= self::$memoryLimit;\n }", "function _checkMaxQuantityLimt()\r\n {\r\n if ($this->data[$this->name]['buy_max_quantity_per_user'] >= $this->data[$this->name]['buy_min_quantity_per_user']) {\r\n return true;\r\n }\r\n return false;\r\n }", "protected function reachedMaxMoves(){\r\n if($this->totalMoves == $this->board->getMaxMoves()){\r\n return true;\r\n }\r\n return false;\r\n }", "public function checkTimeEnd(): bool;", "function apc_cache_load_too_high() {\n\tif(APC_CACHE_MAX_LOAD == 0)\n\t\t// APC_CACHE_MAX_LOAD of 0 means don't do load check\n\t\treturn false;\n\tif (stristr(PHP_OS, 'win'))\n\t\t// can't get load on Windows, so just assume it's OK\n\t\treturn false;\n\t$load = sys_getloadavg();\n\tif ($load[0] < APC_CACHE_MAX_LOAD) \n\t\treturn false;\n\treturn true;\n}", "public function hasMpMax(){\r\n return $this->_has(4);\r\n }", "public function hasMaxMp(){\r\n return $this->_has(4);\r\n }", "private static function get_timeout() {\n\t\t$timeout = absint( ini_get( 'max_execution_time' ) );\n\t\tif ( $timeout <= 1 ) {\n\t\t\t// allow for -1 or 0 for unlimited\n\t\t\t$timeout = 5000 * 1000;\n\t\t} elseif ( $timeout > 30 ) {\n\t\t\t$timeout = $timeout * 1000;\n\t\t} else {\n\t\t\t$timeout = 30000;\n\t\t}\n\t\treturn $timeout;\n\t}", "public function request_execution_time()\n\t{\n\t\tif ($this->_request_time === NULL OR $this->_response_time === NULL)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn $this->_response_time - $this->_request_time;\n\t}", "public function setMaxExecuting($max_execing)\n {\n $this->max_execing = max(1, $max_execing + 0);\n }", "public function hasMaxPokemonActionFrequencyS()\n {\n return $this->max_pokemon_action_frequency_s !== null;\n }", "protected function checkLimits()\n {\n if ($this->isTimeLimit() || $this->isJobLimit()) {\n $this->stop();\n }\n }", "public function needs_run() {\n $today = time();\n $lastrun = $this->info[\"last_run\"];\n $interval = (int)$this->freq * 86400;\n\n return($today > ($lastrun + $interval));\n }", "public function isLimited()\n {\n return ($this->limit > 0);\n }", "public function haveTime(){\n\t\tif($this->mCallbackHaveTime){\n\t\t\treturn call_user_func_array($this->mCallbackHaveTime, [$this]);\n\t\t}\n\t\treturn microtime(true) - $this->fStartTime < $this->fStepTime;\n\t}", "public function isSetMax()\n {\n return !is_null($this->_fields['Max']['FieldValue']);\n }", "public function isPastBidTime()\n\t{\n\t\t//light check if task is active\n\t\tif (!$this->active)\n\t\t\treturn true;\n\t\t\n\t\t//heavier time check in case time is passed but the sentinel has not caught the task yet\n\t\tif ($this->enddatetime <= time())\n\t\t{\n\t\t\t$this->endTask();\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "private function chooseWaitTimeout(): int\n {\n if ($this->gracefulMaxExecutionDateTime) {\n $allowedExecutionDateInterval = $this->gracefulMaxExecutionDateTime->diff(new \\DateTime());\n $allowedExecutionSeconds = $allowedExecutionDateInterval->days * 86400\n + $allowedExecutionDateInterval->h * 3600\n + $allowedExecutionDateInterval->i * 60\n + $allowedExecutionDateInterval->s;\n\n if (!$allowedExecutionDateInterval->invert) {\n $allowedExecutionSeconds *= -1;\n }\n\n /*\n * Respect the idle timeout if it's set and if it's less than\n * the remaining allowed execution.\n */\n if ($this->getIdleTimeout()\n && $this->getIdleTimeout() < $allowedExecutionSeconds\n ) {\n $waitTimeout = $this->getIdleTimeout();\n } else {\n $waitTimeout = $allowedExecutionSeconds;\n }\n } else {\n $waitTimeout = $this->getIdleTimeout();\n }\n\n if (!is_null($this->getTimeoutWait()) && $this->getTimeoutWait() > 0) {\n $waitTimeout = min($waitTimeout, $this->getTimeoutWait());\n }\n return $waitTimeout;\n }", "protected function _canRun()\r\n\t{\r\n\t\t$start\t= strtotime($this->_scheduleStart);\r\n\t\t$stop\t= strtotime($this->_scheduleStop);\r\n\t\t$now\t= time();\r\n\t\t\r\n\t\tif($now > $start && $now < $stop) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "protected function exceededRateLimit()\n {\n return $this->cache->get($this->config['keys']['requests']) > $this->config['limit'];\n }", "public function ableToExecute()\n {\n $log = $this->getCommandLog();\n if ($log) {\n return $log->last_succeed_time >= $log->started_at || $log->ended_at >= $log->started_at;\n }\n return true;\n }", "public function hasHpMax(){\r\n return $this->_has(2);\r\n }", "public function hasMaxTeam(){\n return $this->_has(7);\n }", "protected static function isCloseToMemoryLimit()\n {\n // requesting php.ini value\n $memoryLimit = ini_get('memory_limit');\n\n // extracting it into bytes\n $memoryLimit = trim($memoryLimit);\n $units = strtolower($memoryLimit[strlen($memoryLimit) - 1]);\n switch ($units) {\n case 'g':\n $memoryLimit *= 1024;\n case 'm':\n $memoryLimit *= 1024;\n case 'k':\n $memoryLimit *= 1024;\n }\n\n // decreasing it by already allocated size\n $memoryOccupied = memory_get_usage(true);\n\n if (($memoryOccupied / $memoryLimit) >= 0.8) {\n return true;\n }\n\n return false;\n }", "public function is_endless() {\r\n\t\treturn 0 == $this->end_date;\r\n\t}", "public function hasMaxWheel(){\n return $this->_has(9);\n }", "public function hasMaxSave(){\n return $this->_has(16);\n }", "public function hasLimit()\n {\n //check is little different than other stuff\n return ($this->_count > 0 || $this->_offset > 0);\n }", "static public function IsRequestTimeoutReached() {\n return (time() - $_SERVER[\"REQUEST_TIME\"]) >= self::GetExpectedConnectionTimeout();\n }", "public function isLimitExceeded();", "private function calculateVisibilityTimeout(): int\n {\n return max($this->workTimeout * 4, self::TIMEOUT_VISIBILITY_MIN);\n }", "public function isExceededAttempts()\n { \n $attempts = $this->con->prepare(\"SELECT attempts, last_attempts FROM login_attempts WHERE user_id = ? AND ip = ? \");\n $attempts->bind_param('is', $this->user_id, $this->ip);\n $attempts->execute();\n $attempts->store_result();\n $attempts->bind_result( $number_attempts, $last_attempts);\n $attempts->fetch();\n $rows_attempts = $attempts->num_rows;\n $attempts->free_result();\n $attempts->close();\n \n if( $attempts and $rows_attempts > 0)\n {\n $last_attempts = $this->calcIntervalAttempts($last_attempts);\n if($number_attempts >= self::$max_attempts and $last_attempts <= self::$time_bloq)\n {\n return self::$time_bloq - $last_attempts;\n } \n else\n {\n return false;\n }\n }\n else\n {\n return false;\n }\n }", "public function hasEndtime(){\n return $this->_has(8);\n }", "public function hasMaxexp(){\r\n return $this->_has(4);\r\n }", "public static function isTimeExceeds($value)\n {\n return microtime(true) - static::$stepStart > $value;\n }", "public function hasMaxAnger(){\r\n return $this->_has(6);\r\n }", "public function getLimitReached() {\n return $this->_limitReached = (((int) self::model()->countByAttributes(array('ip'=>$this->ipAddr))) >= self::MAX_REQUESTS);\n }", "public function isRequestLimitReached(): bool\n {\n if ($this->requestLimit === 0) {\n return true;\n }\n return app(RateLimiter::class)->tooManyAttempts($this->rateLimiterKey, $this->requestLimit, $this->decayTime);\n }", "protected function isRecursionLimit()\n {\n return ($this->maxRecursionLimit > 0 && $this->totalRecursion >= $this->maxRecursionLimit);\n }", "public function notifCountHasReachedMax() {\n\t\tif ( $this->getLocalNotificationCount() >= self::MAX_BADGE_COUNT ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function hasMaxHp(){\r\n return $this->_has(2);\r\n }", "public function getExecutionTime()/*# : float */;", "protected function shouldStartMaximized()\n {\n return isset($_SERVER['DUSK_START_MAXIMIZED']) ||\n isset($_ENV['DUSK_START_MAXIMIZED']);\n }", "function is_max_login_attempts_exceeded()\n\t{\n\t\t$this->ci->load->model('dx_auth/login_attempts', 'login_attempts');\n\t\t\n\t\treturn ($this->ci->login_attempts->check_attempts($this->ci->input->ip_address())->num_rows() >= $this->ci->config->item('DX_max_login_attempts'));\n\t}", "public function getTimeLeft()\n\t{\n\t\treturn $this->max_exec_time - $this->getRunningTime();\n\t}", "function hasRecentlyAction() {\n\n\t\t$limit = date('U') + (60 * 60 * $system[\"config\"][\"system\"][\"parameters\"][\"applicationTimeZoneGMT\"][\"value\"]) - (2 * 60 * 60);\n\n\t\tif ($this->isLoged() && $this->getLastAction('U') < $limit)\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "public function hasMax() {\n return $this->_has(3);\n }", "public function limit()\n {\n return self::get() >= Config::get('krisawzm.demomanager::limit', 500);\n }", "public function hasLastTime(){\n return $this->_has(18);\n }", "public function isInTimeout();", "protected function isLastLoop(): bool\n {\n // Count loop\n if (null !== $this->getLoopMax() && ($this->getLoopCount() >= $this->getLoopMax())) {\n $this->requestShutdown();\n }\n\n // Memory\n if ($this->memoryMax > 0 && memory_get_peak_usage(true) >= $this->memoryMax) {\n $this->dispatchEvent(DaemonLoopMaxMemoryReachedEvent::class);\n $this->requestShutdown();\n }\n\n return $this->isShutdownRequested();\n }", "public function isAPICallLimitErr() {\n // create implementation of this function inside gogoLib for trademe\n // it's easier to hook it there for api call limit checks\n // also if call limit occurs. create log at /var/tragento/apicalllimit.log\n // with dates. than when running new cron process check if date in call is less than 1 hour.\n // actually check if it is in current hour. if current hour than don't execute tragento cron\n // it's nice but requires coding time. don't overcomplicate error handling\n\n // $response->is_ok()\n // $response->error_message()\n // You have exceeded your API call quota for the current hour\n // it's a state for the life of trademe model. when api limit reached it can't be changed to ok later.\n // hovewer in next 5 minutes there will be another call from cron with clear state\n return $this->trademe->isAPICallLimitErr();\n }", "private function check_meet_creation_limit()\n {\n $recent_shackmeet_count = count($this->load_recent_shackmeet_count());\n \n return $recent_shackmeet_count < 2;\n }", "public function isHighestPriority(): bool;", "public function isHighScore()\n {\n return ($this->getScore() >= $this->pxConfig['blocking_score']);\n }", "function allowAction() {\r\n $now = time();\r\n if ($this->check)\r\n $FT = $this->getFileCreationTime($this->controlFile);\r\n if ($FT) {\r\n $nextExec = $FT + ($this->minDelay * 60) - $now;\r\n if ($nextExec < 0) {\r\n $handle = fopen($this->controlFile, \"w\");\r\n if (!$handle)\r\n return false;\r\n else {\r\n if (!fwrite($handle, $now))\r\n return false;\r\n else {\r\n fclose($handle);\r\n $this->lastExec = $now;\r\n $this->nextExec = $now + ($this->minDelay * 60);\r\n $this->secToExec = $this->minDelay * 60;\r\n return true;\r\n }\r\n }\r\n } else {\r\n $this->lastExec = $FT;\r\n $this->nextExec = $FT + $nextExec;\r\n $this->secToExec = $nextExec;\r\n return false;\r\n }\r\n } else\r\n return false;\r\n }", "protected function memory_exceeded() {\n\t\t\t$memory_limit = $this->get_memory_limit() * 0.9; // 90% of max memory\n\t\t\t$current_memory = memory_get_usage( true );\n\n\t\t\tif ( $current_memory >= $memory_limit ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "public function shouldGoToPenalty()\n {\n if( $this -> charger_connector_type -> isChargerFast() )\n {\n return false;\n }\n\n if( ! $this -> carHasAlreadyStoppedCharging() )\n {\n return false;\n }\n\n if( ! $this -> getCharger() -> penalty_enabled ) \n {\n return false;\n }\n\n $config = Config :: first();\n $penaltyReliefMinutes = $config -> penalty_relief_minutes;\n\n $chargedTime = Timestamp :: build( $this ) -> getStopChargingTimestamp();\n\n if( ! $chargedTime )\n {\n return false;\n }\n\n $elapsedTime = $chargedTime -> diffInMinutes( now() );\n\n return $elapsedTime >= $penaltyReliefMinutes;\n }", "function get_execution_time() {\n\treturn microtime(true) - __CHV_TIME_EXECUTION_STARTS__;\n}", "public function setMax($max): bool {\n\t\tif($max instanceof DateTime) {\n\t\t\t$max = $max->format(self::OutputFormat);\n\t\t}\n\n\t\tif(is_string($max) || is_null($max)) {\n\t\t\t$this->setAttribute(\"max\", $max);\n\t\t\treturn true;\n\t\t}\n\n\t\tAppLog::error(\"invalid maximum time\", __FILE__, __LINE__, __FUNCTION__);\n\t\treturn false;\n\t}", "public function allowedForOvertime()\n { return (($this->esgrp == 'ES') || ($this->esgrp == 'EF') || ($this->esgrp == 'F')) ? true : false;\n }", "public function isSetMaxBatchSize()\n {\n return !is_null($this->_fields['MaxBatchSize']['FieldValue']);\n }", "function currentlyBeforeSomeTime($date, $timezone, $maxTime = \"17:00:00\") {\n// $this->log(__CLASS__ . \".\" . __FUNCTION__ . \"(args) where args= \" . print_r(func_get_args(), true), LOG_DEBUG);\n\n $returnVal;\n\n if (empty($date)) {\n// $this->log(__CLASS__ . \".\" . __FUNCTION__ . \"(...); date empty, returning null\", LOG_DEBUG);\n return null;\n }\n\n $components = date_parse($date);\n $referenceDateTime = $components['year'] . \"-\" . \n $components['month'] . \"-\" .\n $components['day'] . \" \" . $maxTime;\n\n if ($this->secondsAfterNow($referenceDateTime, $timezone) >= 0) {\n $returnVal = true;\n } else {\n $returnVal = false;\n }\n\n// $this->log(__CLASS__ . \".\" . __FUNCTION__ . \"(...) returning \" . $returnVal, LOG_DEBUG);\n return $returnVal;\n }", "public function hasMaxBesave(){\n return $this->_has(17);\n }", "private function check_Max($word){\r\n return (strlen($word) > $this->_max) ? true : false;\r\n }", "public function min_limit(){ \n\t\t$total_hrs = $this->data['HrPermission']['no_hrs'];\n\t\t$total_hrs = explode(':', $total_hrs);\t\t\t\n\t\tif($total_hrs[0] == '00' && $total_hrs[1] < 30){\n\t\t\treturn false;\t\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t}", "protected static function checkIfSpecifiedTimePassed()\n {\n $passed = false;\n $specified_time = env('APIMO_TIME_SYNC');\n $now = time();\n $last_sync_time = self::queryLastSyncTimeOnDb();\n if (($now - $specified_time) > $last_sync_time) {\n $passed = true;\n }\n\n return $passed;\n }", "public function hasMaxVigor(){\r\n return $this->_has(25);\r\n }", "public function maxIterations() {\n\t\treturn 1;\n\t}", "public function isDownloadLimitReached() {\r\n\t\treturn ($limit = $this->get('download_limit')) && $this->get('hits', 0) >= $limit;\r\n\t}", "public function hasLastrewardtime(){\n return $this->_has(7);\n }", "public function hasMaxcount(){\n return $this->_has(10);\n }", "protected function time_limit_exceeded() {\n\t\tdo_action( 'searchwp\\debug\\log', 'Process time limit exceeded!', 'indexer' );\n\n\t\t// Retrieve the last Entry we tried to index and mark it as omitted.\n\t\t$failed_entry = get_option( $this->identifier . '_indexing' );\n\n\t\tif ( empty( $failed_entry ) || ! is_array( $failed_entry ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->index->mark_entry_as( new Entry( $failed_entry['source'], $failed_entry['id'] ), 'omitted' );\n\t}", "protected function shouldRun()\n {\n return false === (bool) $this->configurationManager->getConfigurationValueByPath('FE/pageUnavailable_force');\n }" ]
[ "0.8333247", "0.79178315", "0.789604", "0.73023546", "0.70957416", "0.6945821", "0.6941527", "0.6805644", "0.66827804", "0.6678156", "0.6589071", "0.6581285", "0.65065014", "0.6471752", "0.640794", "0.6276209", "0.6212105", "0.6167251", "0.6161401", "0.61581534", "0.6053271", "0.598286", "0.5975387", "0.5968094", "0.593405", "0.5905014", "0.58952105", "0.5878086", "0.58753115", "0.58370554", "0.5821399", "0.5798169", "0.5790471", "0.5781973", "0.57765037", "0.57604134", "0.5756723", "0.5747793", "0.5704114", "0.5703629", "0.57032365", "0.5682326", "0.56791127", "0.56548727", "0.56483644", "0.564506", "0.56293315", "0.56282145", "0.5620333", "0.561472", "0.5603245", "0.5600583", "0.5579088", "0.5570707", "0.5569021", "0.5558631", "0.5556171", "0.5554859", "0.5549458", "0.55491453", "0.5537455", "0.55326813", "0.5530658", "0.5521526", "0.5516899", "0.5516621", "0.55143845", "0.5512601", "0.5510496", "0.55031496", "0.54826945", "0.548127", "0.54726833", "0.5470581", "0.5458611", "0.545685", "0.54410857", "0.54407126", "0.5430352", "0.54127276", "0.54093534", "0.54058623", "0.53991306", "0.5379518", "0.5377", "0.5376113", "0.537153", "0.53687596", "0.5349999", "0.5349776", "0.53477687", "0.53450435", "0.5338109", "0.533589", "0.53233814", "0.53052366", "0.5303583", "0.5295973", "0.52953786", "0.5291173" ]
0.649914
13
Check for correct password
function phpbb_check_hash($password, $hash) { $itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; if (strlen($hash) == 34) { return (_hash_crypt_private($password, $hash, $itoa64) === $hash) ? true : false; } return (md5($password) === $hash) ? true : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function valid_password() {\n return (strlen($this->password) == 6);\n }", "public function password_verifies() {\n\t\treturn AuthComponent::password($this->data[$this->alias]['old_password']) === $this->data[$this->alias]['password'];\n\t}", "function checkPassword(): bool\n {\n $user = FPersistantManager::getInstance()->search(\"utente\", \"UserName\", $this->getUsername());\n if($this->getPassword() == $user[0]->getPassword())\n return true;\n else\n return false;\n }", "function passwordValid($password) {\n\treturn true;\n}", "public function isPassword($password);", "public function checkPassword($value);", "public function check_password($password)\n {\n }", "public function hasPassword() : bool;", "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}", "function is_password_valid ($password, $user_data) {\n // the one in the user records.\n $is_valid = $password == $user_data['password'];\n return $is_valid;\n}", "public function comparePassword() {\r\n if ($this->data[$this->name]['Password'] !== $this->data[$this->name]['RetypePass']) {\r\n return FALSE;\r\n } else {\r\n return TRUE;\r\n }\r\n }", "public function testCheckPassword()\n {\n $hasher = new PasswordHash(8, true);\n\n $testHash = '$P$BbD1flG/hKEkXd/LLBY.dp3xuD02MQ/';\n $testCorrectPassword = 'test123456!@#';\n $testIncorrectPassword = 'test123456!#$';\n\n $this->assertTrue($hasher->CheckPassword($testCorrectPassword, $testHash));\n $this->assertFalse($hasher->CheckPassword($testIncorrectPassword, $testHash));\n }", "function checkPassword($password) {\n\t\treturn ($this->_password === $password);\n\t}", "public function isValidPassword($uid, $password);", "public function testInvalidConfirmPassword()\n\t{\n\t\t$this->validator->isPassword(self::USER1_PASSWORD, self::INVALID_PASSWORD);\n\t}", "function m_verifyEditPass()\n\t{\n\t\t$this->errMsg=MSG_HEAD.\"<br>\";\n\t\tif(empty($this->request['password']))\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_PASS_EMPTY.\"<br>\";\n\t\t}\n\t\tif(empty($this->request['verify_pw']))\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_VERIFYPASS_EMPTY.\"<br>\";\n\t\t}\n\t\tif($this->request['password']!=$this->request['verify_pw'])\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_PASS_NOTMATCHED.\"<br>\";\n\t\t}\n\t\treturn $this->err;\n\t}", "function password($pass)\n\t{\n\t\tif (strcmp($pass, AUCTION_PASSWORD))\n\t\t\texit(\"Wrong password\");\n\t}", "public function validatePassword()\n {\n $result = false;\n if (strlen($this->password) >= 5) {\n $result = true;\n }\n return $result;\n }", "public function verifyPassword (string $hash, string $password): bool;", "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 }", "function validPassword($password){\t\r\n \tglobal $API;\r\n return $API->userValidatePassword($this->username,$password); \r\n }", "public function check_password($password)\n {\n return FALSE;\n }", "function passwordExists() {\n //DOES NOT CHECK IF IT'S A VALID PASSWORD\n global $PHP_AUTH_PW;\n global $sessionId;\n global $serverScriptHelper;\n global $isMonterey;\n if ((!$isMonterey) && $serverScriptHelper->hasCCE()) {\n if ($sessionId) {\n return true;\n } else {\n return false;\n }\n } else {\n if ($PHP_AUTH_PW) {\n return true;\n } else {\n return false;\n }\n }\n}", "public function validatePassword($password)\t{\n\t\treturn crypt($password,$this->password) === $this->password;\n\t}", "function check_password($password)\n{\n return ($password == 'qwerty');\n}", "public function validatePassword($password) {\r\n return $this->password===$password;\r\n\r\n }", "public function validatePassword($password)\n {\n return $this->hashPassword($password)===$this->password;\n }", "public function checkPass()\n {\n $pass = sha1($_POST['pass']);\n $pass2 = sha1($_POST['confirmation_pass']);\n if (!empty($_POST['pass']) &&\n !empty($_POST['confirmation_pass'])) {\n if ($pass == $pass2) {\n return true;\n } else {\n return $message = 'Vos mots de passes ne correspondent pas';\n }\n } else {\n return $message = 'Tous les champs ne sont pas complétés';\n }\n }", "public function verify($password): bool;", "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 }", "private function validate_password($password){\n\t\treturn TRUE;\n\t}", "function confirmPassword() {\n\t\t$fields = $this->_settings['fields'];\n\t\tif (\n\t\t\tSecurity::hash($this->model->data[$this->model->name][$fields['confirm_password']], null, true) \n\t\t\t== $this->model->data[$this->model->name][$fields['password']]\n\t\t) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function password_check($old_password)\n\t\t{\n\t\t\tif ($this->ion_auth->hash_password_db($this->data['user']->id, $old_password))\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->form_validation->set_message('password_check', 'Sorry, the password did not match');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}", "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}", "function validateUserPass($username, $password) {\n\n return ($username == 'username' && $password == 'password');\n\n }", "function password_check($password) {\n\t\treturn password_check_user($this->userid, $password);\n\t}", "public function testValidLengthPassword()\n {\n $password = \"accepted\";\n\n $response = $this->user->isValidPassword($password);\n\n $this->assertTrue($response);\n }", "function check() {\r\n static $pass = NULL;\r\n if (is_null($pass)) {\r\n if (function_exists('crypt')) {\r\n $hash = '$2y$04$usesomesillystringfore7hnbRJHxXVLeakoG8K30oukPsA.ztMG';\r\n $test = crypt(\"password\", $hash);\r\n $pass = $test == $hash;\r\n } else {\r\n $pass = false;\r\n }\r\n }\r\n return $pass;\r\n }", "public function isPassword() {\n\t\t$pwArray = array(\n\t\t\t'password',\n\t\t\t'senha',\n\t\t\t'lozinka',\n\t\t\t'heslotajne',\n\t\t\t'helslo_tajne',\n\t\t\t'wachtwoord',\n\t\t\t'contrasena',\n\t\t\t'salasana',\n\t\t\t'motdepasse',\n\t\t\t'mot_de_passe',\n\t\t\t'passwort',\n\t\t\t'passord',\n\t\t\t'haslo',\n\t\t\t'senha',\n\t\t\t'parola',\n\t\t\t'naponb',\n\t\t\t'contrasena',\n\t\t\t'loesenord',\n\t\t\t'losenord',\n\t\t\t'sifre',\n\t\t\t'naponb',\n\t\t\t'matkhau',\n\t\t\t'mat_khau'\n\t\t);\n\t\treturn \\in_array($this->name, $pwArray);\n\t}", "public function passwordCheck($password) {\n return $password == $this->password ? TRUE : FALSE;\n }", "function validatePassword($pwd) {\r\n\t\treturn (strlen($pwd) >= 6 && preg_match_all(\"/[0-9]/\", $pwd) >= 2);\r\n\t}", "function valid_password($pwd) {\n\t\tif (!$pwd)\n\t\t\treturn FALSE;\n\t\tif (strlen($pwd) < 6)\n\t\t\treturn FALSE;\n\t\tif (!preg_match('/[a-zA-Z]+/', $pwd) || !preg_match('/[0-9]+/', $pwd))\n\t\t\treturn FALSE;\n\t\treturn TRUE;\n\t}", "function verifyPassword($password)\n {\n $this->getById();\n $date = $this->created_date;\n $date = strtotime($date);\n $year = date('Y', $date);\n $salt = 'ISM';\n $tempHash = $password . (string) $date . (string) $salt;\n for ($i = 0; $i < $year; $i++) $tempHash = md5($tempHash);\n return $tempHash === $this->password;\n }", "public function validatePassword($password) {\t \r\n\t\treturn self::hashPassword($password, $this->salt) === $this->password;\r\n\t}", "function isValidPass($p) {\r\n global $passes;\r\n $i = 0;\r\n foreach ($passes as $password) {\r\n if($passes[$i]==$p) {\r\n return true;\r\n }\r\n $i++;\r\n }\r\n }", "public function verify($password, $securePass);", "public function checkPassword($password){\n\n/*\n* verify the password\n* if correct ,return true else return false\n* verify the password\n*/\n\n if (password_verify($password,$this->getHashedPassword())){\n return true;\n }else{\n return false;\n }\n\n }", "public function testInvalidLengthPassword()\n {\n $password = \"23d3\";\n $response = $this->user->isValidPassword($password);\n\n $this->assertFalse($response);\n }", "public function passwordEqual() {\n if($this->getPassword() == $this->getPasswordRepeat()) return TRUE;\n else return FALSE;\n }", "public function hasPassword()\n {\n return $this->get(self::PASSWORD) !== null;\n }", "static function checkPassword($password, $answer){\n require INCLUDE_DIR.'password.inc.php';\n return password_verify($password, $answer);\n }", "private function checkPassword($posts){\n if($posts['plainPassword'] !== $posts['confirm']){\n $this->addFlash('danger', 'les mots de passes saisis ne correspondent pas');\n return false;\n }\n\n if(strlen($posts['plainPassword']) < 4){\n $this->addFlash('danger', 'Le mot de passe doit contenir au moins 4 caracteres');\n return false;\n }\n\n /* on verifie que le mot de passe est correct */\n// $uppercase = preg_match('@[A-Z]@', $posts['plainPassword']);\n// $lowercase = preg_match('@[a-z]@', $posts['plainPassword']);\n// $number = preg_match('@[0-9]@', $posts['plainPassword']);\n//\n// if(!$uppercase || !$lowercase || !$number || strlen($posts['plainPassword']) < 8) {\n// $this->addFlash('danger', 'Le mot de passe doit contenir: au moins une lettre majuscule, une lettre minuscule, un chiffre et doit faire au moins 8 caracteres');\n// return false;\n// }\n\n return true;\n }", "function isValidPassword($password)\n{\n $len = strlen($password);\n if ($len < MIN_PASSWORD) {\n return false;\n }\n return true;\n}", "function verify_password($username,$password) {\r\n\r\n\t/* MODIFY THIS FOR YOUR INSTITUTION! */\r\n\tif ($username == 'dssadmin' && password == 'dssadmin') return 1;\r\n\telse return 0;\r\n\r\n}", "public function check_password(){\n\t\t$query = $this->check_username();\n\t\tif($query > 0){\n\t\t\tif(isset($_POST[\"submit\"])){\n\t\t\t\t$user = $_POST[\"uname\"];\n\t\t\t\t$pass = sha1($_POST[\"pword\"]);\n\n\t\t\t\t$query1 = $this->db->query(\"SELECT * \n\t\t\t\t\t\t\t\t\t\t\tFROM administrator \n\t\t\t\t\t\t\t\t\t\t\tWHERE username LIKE '${user}' and password LIKE '${pass}'\");\n\t\t\t\tif($query1->num_rows() > 0){\n\t\t\t\t\treturn $query1->num_rows();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\techo \"Invalid username/password combination.<br/>\";\n\t\t\t\t\techo \"<a href='login'>Back</a><br/>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\techo \"Username does not exist<br/>\";\n\t\t\techo \"<a href='login'>Back</a><br/>\";\n\t\t}\n\t}", "public function password_check($str){\n \n if($this->user_model->exist_row_check('username', $this->username_temp) > 0){\n $user_detail = $this->user_model->getUserDetailByUsername($this->username_temp);\n if($user_detail->password == crypt($str,$user_detail->password)){\n return TRUE;\n }\n else{\n $this->form_validation->set_message('password_check','Password yang dimasukkan tidak sesuai');\n return FALSE;\n }\n }else{\n $this->form_validation->set_message('password_check','Username yang dimasukkan tidak sesuai');\n return FALSE;\n }\n \n }", "public function password(){\n $_error = \"enter the password\";\n\t\treturn $_error;\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 validate_pw($password, $hash){\n /* Regenerating the with an available hash as the options parameter should\n * produce the same hash if the same password is passed.\n */\n return crypt($password, $hash)==$hash;\n }", "function checkUserPassword($username, $password)\n{\n\n $user = getuser($username);\n\n return $user !== false && password_verify($password, $user['password']);\n}", "public function test($password) {\n $error = array();\n if($password == trim($password) && strpos($password, ' ') !== false) {\n $error[] = \"Password can not contain spaces!\";\n }\n \n if(($this->password_lenghtMin!=null) && (strlen($password) < $this->password_lenghtMin)) {\n $error[] = \"Password too short! Minimum \".$this->password_lenghtMin.\" characters.\";\n }\n if(($this->password_lenghtMax!=null) && (strlen($password) > $this->password_lenghtMax)) {\n $error[] = \"Password too long! Maximum \".$this->password_lenghtMax.\" characters.\";\n }\n \n if(($this->password_number!=null) && (!preg_match(\"#[0-9]+#\", $password, $output))) {\n $error[] = \"Password must include at least \".$this->password_number.\" number(s)!\";\n } elseif($this->password_number>1) {\n preg_match_all(\"/\\W+/\", $password, $output);\n $output = $output[0];\n $c = 0;\n foreach($output as $out) {\n $c = $c + strlen($out);\n }\n if($c<$this->password_number) {\n $error[] = \"Password must include at least \".$this->password_number.\" number(s)!\";\n }\n }\n\n if(($this->password_letter!=null) && (!preg_match(\"#[a-z]+#\", $password, $output))) {\n $error[] = \"Password must include at least \".$this->password_letter.\" letter(s)! \";\n } elseif($this->password_letter>1) {\n preg_match_all(\"/\\W+/\", $password, $output);\n $output = $output[0];\n $c = 0;\n foreach($output as $out) {\n $c = $c + strlen($out);\n }\n if($c<$this->password_letter) {\n $error[] = \"Password must include at least \".$this->password_letter.\" letter(s)! \";\n }\n }\n\n if(($this->password_capital!=null) && (!preg_match(\"#[A-Z]+#\", $password, $output))) {\n $error[] = \"Password must include at least \".$this->password_capital.\" capital letter(s)! \";\n } elseif($this->password_capital>1) {\n preg_match_all(\"/\\W+/\", $password, $output);\n $output = $output[0];\n $c = 0;\n foreach($output as $out) {\n $c = $c + strlen($out);\n }\n if($c<$this->password_capital) {\n $error[] = \"Password must include at least \".$this->password_capital.\" capital letter(s)! \";\n }\n }\n \n \n if(($this->password_symbol!=null) && (!preg_match(\"/\\W+/\", $password))) {\n $error[] = \"Password must include at least \".$this->password_symbol.\" symbol(s)!\";\n } elseif($this->password_symbol>1) {\n preg_match_all(\"/\\W+/\", $password, $output);\n $output = $output[0];\n $c = 0;\n foreach($output as $out) {\n $c = $c + strlen($out);\n }\n if($c<$this->password_symbol) {\n $error[] = \"Password must include at least \".$this->password_symbol.\" symbol(s)!\";\n }\n }\n \n if(($this->password_strength!=null) && (($this->strength($password)!==false) && ($this->strength($password)['score']<$this->password_strength))) {\n $error[] = \"Password too weak! \".$this->strength($password)['score'].'/4 minimum '.$this->password_strength;\n }\n\n if(!empty($error)){\n return $error;\n } else {\n return true;\n }\n }", "public function testIsValidLogIn_InCorrectPassword_ReturnsErrorMessage()\n {\n $user = new User();\n\n $user -> email = \"admin@localhost.com\";\n $user -> password = \"secret\";\n\n $this->browse(function ($browser) use ($user) {\n $browser->visit('/login')\n ->pause(1000)\n ->type('@login-email-input', $user->email)\n ->type('@login-password-input', 'test')\n ->click('@login-button')\n ->assertSee('These credentials do not match our records.');\n });\n }", "function checkPassword($password, $username = false) {\n $length = strlen($password);\n\n if ($length < 8) {\n return FALSE;\n } elseif ($length > 32) {\n return FALSE;\n } else {\n\n//check for a couple of bad passwords:\n if ($username && strtolower($password) == strtolower($username)) {\n return FALSE;\n } elseif (strtolower($password) == 'password') {\n return FALSE;\n } else {\n\n preg_match_all(\"/(.)\\1{2}/\", $password, $matches);\n $consecutives = count($matches[0]);\n\n preg_match_all(\"/\\d/i\", $password, $matches);\n $numbers = count($matches[0]);\n\n preg_match_all(\"/[A-Z]/\", $password, $matches);\n $uppers = count($matches[0]);\n\n preg_match_all(\"/[^A-z0-9]/\", $password, $matches);\n $others = count($matches[0]);\n\n//see if there are 3 consecutive chars (or more) and fail!\n if ($consecutives > 0) {\n return FALSE;\n } elseif ($others > 1 || ($uppers > 1 && $numbers > 1)) {\n//bulletproof\n return TRUE;\n } elseif (($uppers > 0 && $numbers > 0) || $length > 14) {\n//very strong\n return TRUE;\n } else if ($uppers > 0 || $numbers > 2 || $length > 9) {\n//strong\n return TRUE;\n } else if ($numbers > 1) {\n//fair\n return FALSE;\n } else {\n//weak\n return FALSE;\n }\n }\n }\n return $returns;\n}", "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}", "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 }", "function confirmPassword($password, $confirmPassword){\n return $password == $confirmPassword;\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 function passwordValide () {\n $password = $this->donnees[self::PASSWORD_REF];\n // Le champ password ne doit pas ?tre vide\n if ($password == null) {\n $this->erreur[self::PASSWORD_REF] = \"Veuillez remplir le champ password\";\n return false;\n }\n // Si le password entr? correspond au password contenu dans la base de donn?es on retourne true\n if ($this->utilisateurs->identificationUser($this->donnees[self::LOGIN_REF], $this->donnees[self::PASSWORD_REF])) {\n return true;\n // Sinon on cr?e une erreur et on renvoie false\n } else {\n $this->erreur[self::PASSWORD_REF] .= \"Mot de passe erron?\";\n return false;\n }\n }", "function checkPassword($pwd, $pwd2, $X_langArray) {\n\tglobal $errorField;\n\n\t//le due password devono coincidere\n\tif ($pwd != $pwd2){\n\t\t$errorField .= \"&pwd2ErrMsg=\".urlencode($X_langArray['SETTING_PWD_REPET_ERROR']);\n\t}\n\telse{\n\t\t//password vuota\n\t\tif (!isset($pwd2) || $pwd2 == ''){\n\t\t\t$errorField .= \"&pwd2ErrMsg=\".urlencode($X_langArray['RECOVER_PWD_EMPTY_PWD_ERR']);\n\t\t}\n\t\telse{\n\t\t\t//la password deve contenere almeno una maiuscola, una minuscola ed un nuemro tra 7 e 21 caratteri)\n\t\t\tif (!preg_match('/(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])/', $pwd2) ) {\n\t\t\t\t$errorField .= \"&pwd2ErrMsg=\".urlencode($X_langArray['GEN_IS_NOT_PWD_REG']);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif (strlen($pwd2) < 6 || strlen($pwd2) > 20 ) {\n\t\t\t\t\t$errorField .= \"&pwd2ErrMsg=\".urlencode($X_langArray['OVERLAY_LOG_SIGN_PWD_LENGTH_ERR']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "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 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 }", "public function checkCredentials(string $email, string $password):bool;", "function checkPassword($clientPassword){\r\n $pattern = '/^(?=.*[[:digit:]])(?=.*[[:punct:]])(?=.*[A-Z])(?=.*[a-z])([^\\s]){8,}$/';\r\n return preg_match($pattern, $clientPassword);\r\n }", "function isValidPassword2($password)\n{\n return checkLength($password) && specialChar($password) && containsUpperAndLower($password);\n}", "public function isPasswordValid(string $encoded, string $raw);", "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}", "function validarPasswordRepetido($password){\r\n\t\t\r\n\t\treturn $this->clave != md5($password);\r\n\t}", "function pwdMatch($password, $passwordRepeat){\n $result = true;\n if ($password !== $passwordRepeat){\n $result = true;\n }\n else{\n $result = false;\n }\n return $result;\n}", "function nrua_check_password($pwd) {\n\t$errors = [];\n\t\n\tif (strlen($pwd) < 8) {\n\t$errors[] = \"Password too short!\";\n\t}\n\t\n\tif (!preg_match(\"#[0-9]+#\", $pwd)) {\n\t$errors[] = \"Password must include at least one number!\";\n\t}\n\t\n\tif (!preg_match(\"#[a-zA-Z]+#\", $pwd)) {\n\t$errors[] = \"Password must include at least one letter!\";\n\t}\n\t\n\treturn $errors;\n}", "function passwordGood($pass) {\n\t// default encoding/encoding specified in php.ini for nginx's php fpm module\n\t// is 'UTF-8'\n\t$len = mb_strlen($pass);\n\t//$len = strlen($pass);\n\t// original code of ($len >= 8 && $len <= 24) doesn't seem to work since I think\n\t// when true these return 1, when false they seem to return nothing, when printed empty string\n\t// be careful, these seem to return nothing or they don't print properly\n\t// this does work though :P\n\tif ( ( $len < 8 ) || ( $len > 24 ) ) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "public function checkPassword( $password ) {\n\t\treturn (isset($this->password) && $password == $this->password);\n\t}", "function testPasswordsAreEqual($password, $password_one) {\n if (empty($password_one)) {\n $passwordErr = 'Password required';\n } elseif (strlen($password) > 0 && strlen($password_one) > 0 && $password == $password_one) {\n //QUERY FOR DATABASE CONNECTION HERE\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 }else {\n $passwordErr = 'Passwords do not match!';\n }\n return $passwordErr;\n }", "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 }", "private function hasValidPassword($input) {\n\t\t$this->person = get_user_by('login', $input->user);\n\n\t\tif ($this->person && wp_check_password($input->key, $this->person->data->user_pass, $this->person->ID)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "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 }", "function checkLength($password)\n{\n return strlen($password) >= MIN_PASSWORD;\n}", "public function hasPassword()\n {\n return $this->definition->hasPassword($this);\n }", "public function validatePassword(User $user, $password);", "function password_security($tested_password){\r\n $isSecured = false;\r\n $contains_letter = preg_match('/[a-zA-Z]/', $tested_password);\r\n $contains_capital = preg_match('/[A-Z]/', $tested_password);\r\n $contains_digit = preg_match('/\\d/', $tested_password);\r\n $contains_special = preg_match('/[^a-zA-Z\\d]/', $tested_password);\r\n\r\n $contains_all = $contains_letter && $contains_capital && $contains_digit && $contains_special;\r\n\r\n if (strlen($tested_password) >= 8 && $contains_all == \"1\") {\r\n $isSecured = true;\r\n }\r\n return $isSecured;\r\n}", "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 }", "function isPassCorrect($psw, $psw_repeat){\r\n\t$regex = '/(?:[^`!@#$%^&*\\-_=+\\'\\/.,]*[`!@#$%^&*\\-_=+\\'\\/.,]){2}/';\r\n\tif (strlen($psw) >= 2 && strlen($psw_repeat) <= 255 && $psw == $psw_repeat) {\r\n\t\tif (preg_match($regex, $psw)) {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t}\r\n\treturn 0;\r\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}", "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 }", "public function checkUserPassword()\n\t{\n\t\tself::authenticate();\n\n\t\t$uname = FormUtil::getPassedValue('user', null);\n\t\t$pass = FormUtil::getPassedValue('up', null);\n\n\t\tif($uname == null) {\n\t\t\treturn self::retError('ERROR: No user name passed!');\n\t\t}\n\t\tif($pass == null) {\n\t\t\treturn self::retError('ERROR: No up passed!');\n\t\t}\n\n\t\t$users = self::getRawUsers('uname = \\'' . mysql_escape_string($uname) . '\\'');\n\n\t\tif(count($users) == 1) {\n\t\t\tforeach($users as $user) {\n\t\t\t\tif($user['uname'] == $uname) {\n\t\t\t\t\tif(FormUtil::getPassedValue('viaauthcode', null, 'POST') != null) {\n\t\t\t\t\t\t$authcode = unserialize(UserUtil::getVar('owncloud_authcode', $user['uid']));\n\t\t\t\t\t\tif($authcode['usebefore'] >= new DateTime('NOW') &&\n\t\t\t\t\t\t\t$authcode['authcode'] == $pass) {\n\t\t\t\t\t\t\t\t$return = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$return = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$authenticationMethod = array(\n\t\t\t\t\t\t\t'modname' => 'Users' ///TODO\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (ModUtil::getVar(Users_Constant::MODNAME, Users_Constant::MODVAR_LOGIN_METHOD, Users_Constant::DEFAULT_LOGIN_METHOD) == Users_Constant::LOGIN_METHOD_EMAIL) {\n\t\t\t\t\t\t\t$authenticationMethod['method'] = 'email';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$authenticationMethod['method'] = 'uname';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$authenticationInfo = array(\n\t\t\t\t\t\t\t'login_id' => $uname,\n\t\t\t\t\t\t\t'pass' => $pass\n\t\t\t\t\t\t);\n\t\t\t\t\t\t//try to login (also for the right output)\n\t\t\t\t\t\tif(UserUtil::loginUsing($authenticationMethod, $authenticationInfo, false, null, true) == true) {\n\t\t\t\t\t\t\t$return = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$return = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$return = false;\n\t\t}\n\t\treturn self::ret($return);\n\t}", "public function testverifyIfPasswordIsNotSet()\n {\n $state=Database::findAdmin($this->db->getPdo(),\"\",\"cool\");\n $this->assertFalse($state);\n }", "function isPassOk($pass){\n\treturn true;\n}", "public function passwordCheck(HTTPRequest $request) {\n\n\t\tif($request->postExists('password')) {\n\t\t\t$manager = $this->managers->getManagerOf('Connexion');\n\t\t\t$admin = $manager->getAdmin();\n\t\n\t\t\t$password = $request->postData('password');\n\t\n\t\t\tif(password_verify($password, $admin['user_password'])) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "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 }", "function isEnteredCorrectPassword($email, $password, $db) {\r\n\t$customerResult = $db->findCustomer($email);\r\n\tif ($customerResult->getRowCount() < 1) {\r\n\t\tdie (\"Couldn't find customer when checking password.\");\r\n\t} else if ($customerResult->getRowCount() > 1) {\r\n\t\tdie(\"More than one customer when checking password\");\r\n\t} else {\r\n\t\t$customer = $customerResult->getFirstRow();\r\n\t\t$correctPassword=$customer['password'];\r\n\t\tif ($correctPassword === $password) {\r\n\t\t\t$factory = new CustomerFactory($db);\r\n\t\t\t$customerObject = $factory->getCustomer($email);\r\n\t\t\t$_SESSION['customer'] = $customerObject;\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tdie(\"Wrong password entered!\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n}", "function validate_pass($pass) {\n\t\t$user = $_SESSION['login_user'];\n\t\t$sql = \"SELECT id FROM users WHERE user = '$user'\";\n\t\t$conn = database_connect();\n\t\t$stmt = $conn->prepare($sql);\n\t\t$stmt->bindParam(1, $_GET['id'], PDO::PARAM_INT);\n\t\t$stmt->execute();\n\t\tif ($stmt->fetchColumn()) {\n\t\t\t$sth = $conn->prepare(\"SELECT pass FROM users WHERE user = '$user'\");\n\t\t\t$sth->execute();\n\t\t\t$result = $sth->fetch(PDO::FETCH_ASSOC);\n\t\t\tif (password_verify($pass, $result['pass'])) {\n\t\t\t\treturn (1);\n\t\t\t}\n\t\t}\n\t\treturn (0);\n\t}", "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 }" ]
[ "0.77899456", "0.7729898", "0.76724595", "0.763922", "0.7603091", "0.75989896", "0.7556406", "0.7541278", "0.74875206", "0.74863905", "0.7483462", "0.74816436", "0.74685794", "0.7463284", "0.74527127", "0.7436546", "0.739046", "0.7375175", "0.7370546", "0.73700225", "0.7362304", "0.73460245", "0.7312363", "0.7288783", "0.72859806", "0.72829837", "0.7275849", "0.72512054", "0.72462225", "0.7217007", "0.721457", "0.71723604", "0.71567416", "0.71530324", "0.71520996", "0.7146602", "0.7136848", "0.7136549", "0.7135343", "0.7129849", "0.7126556", "0.71252537", "0.7124281", "0.7121211", "0.71189123", "0.71130145", "0.7105674", "0.710479", "0.7097221", "0.709437", "0.7083849", "0.7081632", "0.7075704", "0.7075101", "0.7071612", "0.70654213", "0.70639694", "0.70619345", "0.7061258", "0.70259875", "0.70216906", "0.70215356", "0.7011825", "0.700133", "0.6999191", "0.69951385", "0.699342", "0.6978555", "0.6976488", "0.69681793", "0.69640034", "0.69607186", "0.69605935", "0.695829", "0.69569045", "0.69565994", "0.69528365", "0.69488", "0.6945416", "0.69413143", "0.6938605", "0.6936648", "0.693559", "0.6935526", "0.6932078", "0.6929826", "0.6927245", "0.69242036", "0.6905874", "0.6899285", "0.6884554", "0.6884334", "0.6877887", "0.68778807", "0.6875898", "0.68744904", "0.6871545", "0.6870859", "0.68644804", "0.68642515", "0.6863181" ]
0.0
-1
Generate salt for hash generation
function _hash_gensalt_private($input, &$itoa64, $iteration_count_log2 = 6) { if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31) { $iteration_count_log2 = 8; } $output = '$H$'; $output .= $itoa64[min($iteration_count_log2 + ((PHP_VERSION >= 5) ? 5 : 3), 30)]; $output .= _hash_encode64($input, 6, $itoa64); return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function generateSalt() {\n $salt = base64_encode(pack(\"H*\", md5(microtime())));\n \n return substr($salt, 0, $this->saltLng);\n }", "private function genSalt() {\r\n $random = 0;\r\n $rand64 = \"\";\r\n $salt = \"\";\r\n $random = rand(); // Seeded via initialize()\r\n // Crypt(3) can only handle A-Z a-z ./\r\n $rand64 = \"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\r\n $salt = substr( $rand64, $random % 64, 1 ) . substr( $rand64, ($random / 64) % 64, 1 );\r\n $salt = substr( $salt, 0, 2 ); // Just in case\r\n return($salt);\r\n }", "public static function generateSalt() {\n $salt = '$2a$13$';\n $salt = $salt . md5(mt_rand());\n return $salt;\n }", "public static function make_salt()\n {\n\n \t$chars = str_split('0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz');\n \n \t\t$newSalt = '';\n \t\tfor ($i = 0; $i < 16; $i++) \n \t\t{\n \t\t\t$newSalt .= $chars[rand(0, count($chars) - 1)];\n \t\t}\n\n \t\treturn $newSalt;\n }", "protected function salt() {\n\t\treturn substr(md5(uniqid(rand(), true)), 0, $this->config->item('salt_length'));\n\t}", "private function generateSalt()\n {\n return str_random(16);\n }", "protected function _create_salt()\n\t{\n\t\t$this->CI->load->helper('string');\n\t\treturn sha1(random_string('alnum', 32));\n\t}", "static function generateSalt($strength=10) {\n return self::saltStart($strength) . random_string(22, './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz');\n }", "public function salt() {\r\n return substr(md5(uniqid(rand(), true)), 0, 10);\r\n }", "public function createSalt()\n{\n\t$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\n\treturn substr(str_shuffle(str_repeat($pool, 5)), 0, $this->saltLength);\n}", "public function generateSalt() {\n // A salt is randomly generated here to protect again brute force attacks\n // and rainbow table attacks. The following statement generates a hex\n // representation of an 8 byte salt. Representing this in hex provides\n // no additional security, but makes it easier for humans to read.\n // For more information:\n // http://en.wikipedia.org/wiki/Salt_%28cryptography%29\n // http://en.wikipedia.org/wiki/Brute-force_attack\n // http://en.wikipedia.org/wiki/Rainbow_table\n $this->salt = dechex(mt_rand(0, 2147483647)) . dechex(mt_rand(0, 2147483647));\n return $this->salt;\n }", "private function generateSalt() {\r\n\t\t$possibleValues = '0123456789abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVXYZ';\r\n\t\t$salt = '';\t\t\r\n\t\tfor($i = 0; $i < 10; $i++) {\r\n\t\t\t$salt .= $possibleValues[mt_rand(0, strlen($possibleValues)-1)];\t\r\n\t\t}\t\t\r\n\t\treturn $salt;\r\n\t}", "public static function generateSalt() {\r\n\t\treturn uniqid('', true);\r\n\t}", "protected function generateSalt()\n\t{\n\t\treturn uniqid('',true);\n\t}", "private function genSalt()\n {\n \treturn md5(time() + rand());\n }", "private function generateSalt(){\n return substr(md5(rand(0, 999)), 0, 5);\n }", "private function GenSalt()\n {\n $chars = array_merge(range('a','z'), range('A','Z'), range(0, 9));\n $max = count($chars) - 1;\n $str = \"\";\n $length = 22;\n \n while($length--) {\n shuffle($chars);\n $rand = mt_rand(0, $max);\n $str .= $chars[$rand];\n }\n return $str . '$';\n }", "protected function generateSalt() {\n return uniqid('', true);\n }", "private function generateSalt(): string\n {\n return base64_encode(random_bytes(16));\n }", "private function generateSalt(): string\n {\n return base64_encode(random_bytes(16));\n }", "public function genSalt(){\n return mcrypt_create_iv(16, MCRYPT_DEV_URANDOM);\n }", "function generateSalt() {\n\t$numberOfDesiredBytes = 16;\n\t$salt = random_bytes($numberOfDesiredBytes);\n\treturn $salt;\n}", "public static function unique_salt() {\r\n\t\treturn substr(sha1(mt_rand()),0,22);\r\n\t}", "function makeSalt() {\r\n static $seed = \"./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\r\n $algo = (PHP_VERSION_ID >= 50307) ? '$2y' : '$2a'; //DON'T CHANGE THIS!!\r\n $strength = '$12'; //too high will time out script.\r\n $salt = '$';\r\n for ($i = 0; $i < 22; $i++) {\r\n $salt .= substr($seed, mt_rand(0, 63), 1);\r\n }\r\n return $algo . $strength . $salt;\r\n}", "public static function makeSalt()\n\t\t{\n\n\t\t\treturn uniqid(mt_rand(), true);\n\t\t}", "public function createSalt () {\n srand(time());\t\t\t\t\n $pool = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n for($index = 0; $index < 2; $index++) {\n $sid .= substr($pool,(rand()%(strlen($pool))), 1);\n }\n return $sid; \n }", "function createSalt()\n {\n $string = md5(uniqid(rand(), true));\n return substr($string, 0, 3);\n }", "function generateSalt()\n\t{\n\t\t$lets = range('a', 'z');\n\t\t$ups = range('A', 'Z');\n\t\t$nums = range('0', '9');\n\t\t\n\t\t$special = array('*', '%', '#');\n\t\t\n\t\t$union = $lets + $nums + $ups + $special; //Generate an array with numbers, letters, and special characters\n\t\t\n\t\t$salt = '';\n\t\t\n\t\tfor($i = 0; $i < 5; $i++) //Create a salt of length 5, supplying random values\n\t\t{\n\t\t\t$r = rand(0, count($union)-1);\n\t\t\t$salt .= $union[$r];\n\t\t}\n\t\t\n\t\treturn $salt;\n\t}", "public static function generateRandomSalt() {\n\t\t// Salt seed\n\t\t$seed = uniqid(mt_rand(), true);\n \n\t\t// Generate salt\n\t\t$salt = base64_encode($seed);\n\t\t$salt = str_replace('+', '.', $salt);\n \n\t\treturn substr($salt, 0, self::$_saltLength);\n\t}", "function getSalt(){\n $inside = time() . \"az51\" . time(); \n $salt = '$2a$07$' . $inside . '$';\n return $salt;\n }", "public function getSalt()\n {\n return md5(random_bytes(50));\n }", "private function getSalt() \n {\n /**\n * the base64 function uses +'s and ending ='s; translate the first, and cut out the latter\n */\n return sprintf('$2a$%02d$%s', $this->rounds, substr(strtr(base64_encode($this->getBytes()), '+', '.'), 0, 22));\n }", "function generateSalt() {\n return str_shuffle(sha1(uniqid(mt_rand(), true)).md5(uniqid(mt_rand(), true)));\n}", "public static function salt()\r\n {\r\n return hash('sha512', time() . $_SERVER['REMOTE_ADDR']);\r\n }", "private function getUniqueSalt() {\n /* To generate the salt, first generate enough random bytes. Because\n * base64 returns one character for each 6 bits, so we should generate\n * at least 22*6/8 = 16.5 bytes, so we generate 17 bytes. Then we get the first\n * 22 base64 characters\n */\n\n /* As blowfish takes a salt with the alphabet ./A-Za-z0-9 we have to\n * replace any '+', '=' in the base64 string with '..'.\n */\n $random = base64_encode(openssl_random_pseudo_bytes(17));\n //take only the first 22 caracters\n $random = substr($random, 0, 22);\n\n //replace +,= by .\n return strtr($random, '+=', '..');\n }", "function createNewSalt(){\n\t$characters = 'abcdefghijklmnopqrstuvwxyz-:;><*#%&()ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';\n\n\t$salt = \"\";\n\n\tfor ($i = 0; $i<32; $i++){\n $salt = $salt.$characters[rand(0,strlen($characters)-1)];\n\t}\n\t\n\treturn $salt;\n}", "public static function regenerateSalt()\n\t{\n\t\treturn PzPHP_Helper_String::createCode(mt_rand(40,45), PzPHP_Helper_String::ALPHANUMERIC_PLUS);\n\t}", "abstract protected function getGeneratedSalt() ;", "public static function generateRandomSalt()\n {\n $seed = uniqid(mt_rand(), true);\n $salt = base64_encode($seed);\n $salt = str_replace('+', '.', $salt);\n return substr($salt, 0, self::$saltLength);\n }", "function createSalt(){\r\n \t\t\t$string = md5(uniqid(rand(), true));\r\n \t\treturn substr($string, 0, 3);\r\n\t\t}", "public static function uniqueSalt() {\n return substr(sha1(mt_rand()), 0, 22);\n }", "public function getSalt() {\n\t\t$salt = mcrypt_create_iv(22, MCRYPT_DEV_URANDOM);\t\t\t\t\t\t\t\t\t// creates an initialization vector from a 22 characters and /dev/random\n\t\t$salt = base64_encode($salt);\n\t\t$salt = str_replace('+', '.', $salt);\n\t\treturn $salt;\n\t}", "function generate_salt($length = 16)\n {\n $possible_chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678';\n $rand_string = '';\n for($i = 0; $i < $length; ++$i)\n {\n $rand_string .= $possible_chars[random_int(0, strlen($possible_chars) - 1)];\n }\n return utf8_encode($rand_string);\n }", "function salt($len=16) {\n $pool = range('!', '~');\n $high = count($pool) - 1;\n $tmp = '';\n for ($c = 0; $c < $len; $c++) {\n $tmp .= $pool[rand(0, $high)];\n }\n return $tmp;\n}", "public function generateRandomSalt()\n {\n $salt = null;\n\n if (function_exists('openssl_random_pseudo_bytes')) {\n $salt = openssl_random_pseudo_bytes(16);\n }\n\n if (is_null($salt)) {\n $salt = sha1(microtime(), true);\n }\n\n $salt = base64_encode($salt);\n $salt = strtr($salt, '+', '.');\n\n return substr($salt, 0, 22);\n }", "function generateSaltPassword () {\n\treturn base64_encode(random_bytes(12));\n}", "function createSalt()\r\n\r\n{\r\n\r\n $string = md5(uniqid(rand(), true));\r\n\r\n return substr($string, 0, 5);\r\n\r\n}", "public function genSalt($input = null)\n {\n if (!$input) {\n $input = $this->_getRandomBytes(6);\n }\n\n $identifier = 'sha1';\n $salt = $this->_encode64($input, 6);\n\n return '$' . $identifier . '$' . $this->_iterationCount . '$' . $salt . '$';\n }", "function generate_salt($length){\n\t\t$unique_random_string = md5(uniqid(mt_rand(), true));\n\n\t\t// Vaild charcter for a salt are (a-zA-z0-9./)\n\t\t$base64_string = base64_encode($unique_random_string);\n\n\t\t// But not '+' which is vaild in base64 encoding\n\t\t$modified_base64_string = str_replace('+', '.', $base64_string);\n\n\t\t// Truncate string to the correct length\n\t\t$salt = substr($modified_base64_string, 0, $length);\n\t\treturn $salt;\n\t}", "function getPasswordSalt(){\n\t\treturn substr( str_pad( dechex( mt_rand() ), 8, '0', STR_PAD_LEFT ), -8 );\n\t}", "function generate_salt($length){\n //Unique random string from mt_random and md5 hashing\n //returns 32 characters\n $unique_random_string=md5(uniqid(mt_rand(),true));\n //Valid characters only [a-zA-Z0-9./]\n $base64_string=base64_encode($unique_random_string);\n //Replace '+' with '.'\n $modified_base64_string=str_replace('+','.',$base64_string);\n //first 22 characters\n $salt=substr($modified_base64_string,0,$length);\n return $salt;\n }", "function generate_salt($length) {\n\t # MD5 returns 32 characters\n\t $unique_random_string = md5(uniqid(mt_rand(), true));\n\t \n\t # Valid characters for a salt are [a-zA-Z0-9./]\n\t $base64_string = base64_encode($unique_random_string);\n\t \n\t # Replace '+' with '.' from the base64 encoding\n\t $modified_base64_string = str_replace('+', '.', $base64_string);\n\t \n\t # Truncate string to the correct length\n\t $salt = substr($modified_base64_string, 0, $length);\n\t \n\t\treturn $salt;\n\t}", "function createSalt()\n{\n $text = uniqid(Rand(), TRUE);\n return substr($text, 0, 5);\n\n}", "function generateSalt() {\n $length = 10;\n $characters = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n $charsLength = strlen($characters) - 1;\n $string = \"\";\n for($i=0; $i<$length; $i++) {\n $randNum = mt_rand(0, $charsLength);\n $string .= $characters[$randNum];\n }\n return $string;\n}", "protected function getGeneratedSalt() {}", "protected function getGeneratedSalt() {}", "public function genSalt($length = 5)\n {\n if ($length < 1) { return; }\n $slt = '';\n $min = sfConfig::get('app_min_salt_char');\n $max = sfConfig::get('app_max_salt_char');\n for ($i = 0; $i < $length; $i++)\n {\n $slt .= chr(rand($min, $max));\n }\n return $slt;\n }", "public function getSalt()\n {\n //i might implement salt\n }", "function generate_salt($length) {\n // MD5 returns 32 characters\n $unique_random_string = md5(uniqid(mt_rand(), true));\n \n\t// Valid characters for a salt are [a-zA-Z0-9./]\n $base64_string = base64_encode($unique_random_string);\n \n\t// But not '+' which is valid in base64 encoding\n $modified_base64_string = str_replace('+', '.', $base64_string);\n \n\t// Truncate string to the correct length\n $salt = substr($modified_base64_string, 0, $length);\n \n\treturn $salt;\n}", "function generateSalt($bytes = '16'){\n\treturn mcrypt_create_iv($bytes, MCRYPT_RAND);\n}", "function generate_salt($length) {\n\t // MD5 returns 32 characters\n $unique_random_string = md5(uniqid(mt_rand(), true));\n\t \n\t\t// Valid characters for a salt are [a-zA-Z0-9./]\n\t$base64_string = base64_encode($unique_random_string);\n\t \n\t\t// But not '+' which is valid in base64 encoding\n\t$modified_base64_string = str_replace('+', '.', $base64_string);\n\t \n\t\t// Truncate string to the correct length\n\t$salt = substr($modified_base64_string, 0, $length);\n\t \n\treturn $salt;\n }", "function gen_salt($salt_length=22)\n\t{\n\t\t$raw_salt_len = 16;\n \t\t$buffer = '';\n $buffer_valid = false;\n\n\t\tif (function_exists('mcrypt_create_iv') && !defined('PHALANGER')) {\n\t\t\t$buffer = mcrypt_create_iv($raw_salt_len, MCRYPT_DEV_URANDOM);\n\t\t\tif ($buffer) {\n\t\t\t\t$buffer_valid = true;\n\t\t\t}\n\t\t}\n\n\t\tif (!$buffer_valid && function_exists('openssl_random_pseudo_bytes')) {\n\t\t\t$buffer = openssl_random_pseudo_bytes($raw_salt_len);\n\t\t\tif ($buffer) {\n\t\t\t\t$buffer_valid = true;\n\t\t\t}\n\t\t}\n\n\t\tif (!$buffer_valid && @is_readable('/dev/urandom')) {\n\t\t\t$f = fopen('/dev/urandom', 'r');\n\t\t\t$read = strlen($buffer);\n\t\t\twhile ($read < $raw_salt_len) {\n\t\t\t\t$buffer .= fread($f, $raw_salt_len - $read);\n\t\t\t\t$read = strlen($buffer);\n\t\t\t}\n\t\t\tfclose($f);\n\t\t\tif ($read >= $raw_salt_len) {\n\t\t\t\t$buffer_valid = true;\n\t\t\t}\n\t\t}\n\n\t\tif (!$buffer_valid || strlen($buffer) < $raw_salt_len) {\n\t\t\t$bl = strlen($buffer);\n\t\t\tfor ($i = 0; $i < $raw_salt_len; $i++) {\n\t\t\t\tif ($i < $bl) {\n\t\t\t\t\t$buffer[$i] = $buffer[$i] ^ chr(mt_rand(0, 255));\n\t\t\t\t} else {\n\t\t\t\t\t$buffer .= chr(mt_rand(0, 255));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$salt = $buffer;\n\n\t\t// encode string with the Base64 variant used by crypt\n\t\t$base64_digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\t\t$bcrypt64_digits = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\t\t$base64_string = base64_encode($salt);\n\t\t$salt = strtr(rtrim($base64_string, '='), $base64_digits, $bcrypt64_digits);\n\n\t\t$salt = substr($salt, 0, $salt_length);\n\n\t\treturn $salt;\n\t}", "function makeSalt() {\n $string = md5(uniqid(rand(), true));\n return substr($string, 0, 3);\n}", "function generate_salt($length) {\n\t // MD5 returns 32 characters\n\t $unique_random_string = md5(uniqid(mt_rand(), true));\n\t \n\t\t// Valid characters for a salt are [a-zA-Z0-9./]\n\t $base64_string = base64_encode($unique_random_string);\n\t \n\t\t// But not '+' which is valid in base64 encoding\n\t $modified_base64_string = str_replace('+', '.', $base64_string);\n\t \n\t\t// Truncate string to the correct length\n\t $salt = substr($modified_base64_string, 0, $length);\n\t \n\t\treturn $salt;\n\t}", "function generate_salt($length) {\n\t // MD5 returns 32 characters\n\t $unique_random_string = md5(uniqid(mt_rand(), true));\n\t \n\t\t// Valid characters for a salt are [a-zA-Z0-9./]\n\t $base64_string = base64_encode($unique_random_string);\n\t \n\t\t// But not '+' which is valid in base64 encoding\n\t $modified_base64_string = str_replace('+', '.', $base64_string);\n\t \n\t\t// Truncate string to the correct length\n\t $salt = substr($modified_base64_string, 0, $length);\n\t \n\t\treturn $salt;\n\t}", "function gen_mix_salt($pass) {\n $salt = generate_salt();\n return mix_salt($salt, $pass);\n}", "function get_salt($length) {\n \n $options = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789./';\n $salt = '';\n for ($i = 0; $i <= $length; $i ++) {\n $options = str_shuffle ( $options );\n $salt .= $options [rand ( 0, 63 )];\n }\n return $salt;\n }", "function generate_salt($length) {\n\t// MD5 returns 32 characters\n\t$unique_random_string = md5(uniqid(mt_rand(), true));\n\n\t// Valid characters for a salt are [a-zA-Z0-9./]\n\t$base64_string = base64_encode($unique_random_string);\n\n\t// But not '+' which is valid in base64 encoding\n\t$modified_base64_string = str_replace('+', '.', $base64_string);\n\n\t// Truncate string to the correct length\n\t$salt = substr($modified_base64_string, 0, $length);\n\n\treturn $salt;\n}", "function SecureSalt() \t{\n\treturn substr(sha1(uniqid(rand(),true)),0,40);\n}", "function get_salt($length) {\r\n\r\n\t\t\t\t$options = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789./';\r\n\t\t\t\t$salt = '';\r\n\r\n\t\t\t\tfor ($i = 0; $i <= $length; $i++) {\r\n\t\t\t\t\t$options = str_shuffle($options);\r\n\t\t\t\t\t$salt .= $options[rand(0, 63)];\r\n\t\t\t\t}\r\n\t\t\t\treturn $salt;\r\n\t\t\t}", "function salt()\r\n{\r\n\t//return mcrypt_create_iv( 32 );\r\n\r\n\t$string = md5(uniqid(rand(), true));\r\n\treturn substr( $string, 0, 3 );\r\n}", "public static function gen_salt($length = 32)\n {\n $alpha_digits = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $alpha_digits_len = strlen($alpha_digits) - 1;\n\n $salt = '';\n for ($i = 0; $i < $length; $i++) {\n $salt .= $alpha_digits[mt_rand(0, $alpha_digits_len)];\n }\n\n return $salt;\n }", "public function salt($name, $value): string {}", "public static function generateSalt($length=20) {\n $haystack = '012345678'\n . 'abcdefghijklmnopqrstuvwxyz'\n . 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'\n . '~,./<>?!@#%^&*_+-=;: ';\n $iLen = strlen($haystack);\n $result = '';\n\n mt_srand((double) microtime() * 1000000);\n for ( $i=0; $i<$length; $i++ ) {\n $result .= substr($haystack, (mt_rand() % ($iLen)), 1);\n }\n return($result);\n }", "public static function passTheSalt(): string\n {\n return (string) bin2hex(openssl_random_pseudo_bytes(16));\n }", "function createPasswordSalt() {\n\t\t$userSystem = new SpotUserSystem($this->_db, $this->_settings);\n\t\t$salt = $userSystem->generateUniqueId() . $userSystem->generateUniqueId();\n\t\t\n\t\t$this->setIfNot('pass_salt', $salt);\n\t}", "protected function _createSalt()\n {\n return (\\function_exists('random_bytes')) ? random_bytes(16) : mcrypt_create_iv(16, \\MCRYPT_DEV_URANDOM);\n }", "static public function generateVbPasswordSalt()\n {\n\t\t$hashSalt = '';\n\t\tfor ($i = 0; $i < 3; $i++)\n\t\t{\n\t\t\t$hashSalt .= chr(rand(0x41, 0x5A)); // A..Z\n\t\t}\n\t\t\n\t\treturn $hashSalt;\n }", "function gen_salt($algo) {\n switch($algo) {\n case 'sha256':\n return base64_encode(mcrypt_create_iv (192, MCRYPT_DEV_RANDOM));\n // per man 3 crypt the salt is a maximum of 16 characters\n // and the salt character set is [a–zA–Z0–9./]\n // this is less than the rule of thumb for larger hash sizes\n // handle it as a separate case\n case 'crypt-sha256':\n $iv = mcrypt_create_iv (96, MCRYPT_DEV_RANDOM);\n return str_replace('+', '.', base64_encode($iv));\n }\n return false;\n}", "public function generateSalt($length = 5) {\n return $this->helper->generateSalt($length);\n }", "function generate_salt($length){\n\t//MD5 returns 32 characters\n\t$unique_random_string=md5(uniqid(mt_rand(),true));\n\t\n\t//valid characters for a salt are [a-zA-Z0-9./]\n\t//base64 code returns + instead of .\n\t$base64_string=base64_encode($unique_random_string);\n\t\n\t//But not '+' which is valid in base64 encoding\n\t$modified_base64_string=str_replace('+', '.' ,$base64_string);\n\t\n\t//Truncate string to the correct length\n\t$salt=substr($modified_base64_string,0,$length);\n\t\n\treturn $salt;\n}", "public function generate_salt($length) {\n\t\t//MD5 returns 32 characters\n\t\t$unique_random_string = md5(uniqid(mt_rand(), true));\n\t\t\n\t\t//valid characters for a salt are [a-z A-Z 0-9 ./]\n\t\t$base64_string = base64_encode($unique_random_string);\n\t\t\n\t\t//but not '+' which is in base64 encoding\n\t\t$modified_base64_string = str_replace('+', '.', $base64_string);\n\t\t\n\t\t//Truncate string to the correct length\n\t\t$salt = substr($modified_base64_string, 0, $length);\n\t\t\n\t\treturn $salt;\n\t}", "public static function generateHash($salt, $password) {\n $hash = crypt($password, $salt);\n return substr($hash, 29);\n }", "function generate_salt($length) {\r\n\t\t// Not 100% unique, not 100% random, but good enough for a salt\r\n\t\t// MD5 returns 32 characters (more than the 22 we will need for our Blowfish hashing in our password encryption\r\n\t\t$unique_random_string = md5(uniqid(mt_rand(), true));\r\n\t\t\r\n\t\t// Valid characters for a salt are [a-zA-Z0-9./]\r\n\t\t// Base64 will transform our string into these characters, but also '+'s\r\n\t\t$base64_string = base64_encode($unique_random_string);\r\n\t\t\r\n\t\t// But not '+' which is valid in base 64 encoding, so to change those:\r\n\t\t$modified_base64_string = str_replace('+', '.', $base64_string);\r\n\t\t\r\n\t\t// Truncate string to the correct length\r\n\t\t$salt = substr($modified_base64_string, 0, $length);\r\n\t\t\r\n\t\treturn $salt;\r\n\t}", "function generate_salt($len = 5) {\n $valid_characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890@#$%^*()_-!';\n $valid_len = strlen($valid_characters) - 1;\n $salt = \"\";\n\n for ($i = 0; $i < $len; $i++) {\n $salt .= $valid_characters[rand(0, $valid_len)];\n }\n\n return $salt;\n}", "protected static function _generateSaltMd5() {\n\t\treturn '$1$' . Random::generate(6, ['encode' => Random::ENCODE_BASE_64]);\n\t}", "public static function generateSaltedHashFromPassword($password) {\r\n return hash(self::HASH_ALGORITHM, $password.self::SALT);\r\n }", "public static function salt($type = null, $count = null) {\n\t\tswitch (true) {\n\t\t\tcase CRYPT_BLOWFISH === 1 && (!$type || $type === 'bf'):\n\t\t\t\treturn static::_generateSaltBf($count);\n\t\t\tcase CRYPT_EXT_DES === 1 && (!$type || $type === 'xdes'):\n\t\t\t\treturn static::_generateSaltXdes($count);\n\t\t\tdefault:\n\t\t\t\treturn static::_generateSaltMd5();\n\t\t}\n\t}", "public function getRandomSalt() {\n return $this->createSha3Salt();\n }", "public static function salt($type = null, $count = null) {\n switch (true) {\n case CRYPT_BLOWFISH == 1 && (!$type || $type === 'bf'):\n return static::_genSaltBf($count);\n case CRYPT_EXT_DES == 1 && (!$type || $type === 'xdes'):\n return static::_genSaltXDES($count);\n default:\n return static::_genSaltMD5();\n }\n }", "private function create_hash($password, $salt) {\n $hash = '';\n for ($i = 0; $i < 20000; $i++) {\n $hash = hash('sha512', $hash . $salt . $password);\n }\n return $hash;\n }", "public function getSalt()\n {\n }", "public function getSalt()\n {\n }", "public function getSalt()\n {\n }", "public function getSalt()\n {\n }", "public function getSalt()\n {\n }", "public function getSalt()\n {\n }", "public function getSalt()\n {\n }", "public function getSalt()\n {\n }", "public function getSalt()\n {\n }", "public function getSalt()\n {\n }" ]
[ "0.84269124", "0.8097994", "0.80883604", "0.8008567", "0.80071366", "0.79909515", "0.798997", "0.7927116", "0.7909329", "0.7900937", "0.78988767", "0.7845665", "0.7803374", "0.7788299", "0.7773393", "0.77448624", "0.7723396", "0.76938415", "0.76876587", "0.76876587", "0.76856935", "0.7682839", "0.76399606", "0.7617578", "0.76142025", "0.7607625", "0.75975704", "0.75806457", "0.7544132", "0.75403947", "0.75282484", "0.752493", "0.7513133", "0.7510618", "0.74937314", "0.7472073", "0.74699265", "0.74535465", "0.7432932", "0.7407148", "0.7403043", "0.7400637", "0.7392498", "0.7386441", "0.7378677", "0.7372579", "0.73651236", "0.73457766", "0.7329016", "0.7317793", "0.73145485", "0.7311163", "0.7311096", "0.7292477", "0.7292078", "0.7292078", "0.7290876", "0.72841007", "0.7280385", "0.72783285", "0.7278184", "0.7273081", "0.7267661", "0.7262415", "0.7262415", "0.7260569", "0.7258196", "0.7246446", "0.7231088", "0.72276443", "0.71976763", "0.7194499", "0.7192622", "0.71918", "0.7191119", "0.7184858", "0.71830845", "0.7176395", "0.71674424", "0.71545213", "0.71469975", "0.71455365", "0.709973", "0.70595837", "0.7058727", "0.70361614", "0.7023668", "0.70227927", "0.70146304", "0.7005558", "0.69979477", "0.6973798", "0.6973798", "0.6973798", "0.6973798", "0.6973798", "0.6973798", "0.6973798", "0.6973798", "0.6973798", "0.6973798" ]
0.0
-1
Hashes an email address to a big integer
function phpbb_email_hash($email) { return sprintf('%u', crc32(strtolower($email))) . strlen($email); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _hashEmail($email)\n\t{\n\t\treturn Security::hash(strtolower($email), $this->_hashType);\n\t}", "function microid_hash($email, $url)\n{\n\treturn sha1(sha1(\"mailto:\" . trim($email)) . sha1(trim($url)));\n}", "public function hash(): string;", "public static function hash(string $email) : string\n {\n return md5(strtolower($email));\n }", "public function hash();", "public static function getEmailAddressHash($emailAddress)\n {\n return md5($emailAddress);\n }", "public function get_email_hash( $email = '' ) {\n $email = sanitize_email( $email );\n return md5( strtolower( $email ) );\n }", "public function getUidFromEmail($email);", "public function generateHash($email)\n {\n return md5(strtolower(trim($email)));\n }", "public static function _awesomeHash($a) {\n $b = 16909125; for ($c=0; $c<strlen($a); $c++) {\n $b ^= (GTB_Helper::charCodeAt(self::HASH_SEED, ($c%87))) ^ (GTB_Helper::charCodeAt($a, $c));\n $b = GTB_Helper::unsignedRightShift($b, 23) | $b << 9;\n }\n return '8'. GTB_Helper::hexEncodeU32($b);\n }", "public function getUserReferralHash($email, $customerId)\n {\n return hash('crc32', ($email . $customerId), FALSE);\n }", "public static function genhash ($url)\r\n\t{\r\n\t\t$hash = 'Mining PageRank is AGAINST GOOGLE\\'S TERMS OF SERVICE. Yes, I\\'m talking to you, scammer.';\r\n\t\t$c = 16909125;\r\n\t\t$length = strlen($url);\r\n\t\t$hashpieces = str_split($hash);\r\n\t\t$urlpieces = str_split($url);\r\n\t\tfor ($d = 0; $d < $length; $d++)\r\n\t\t{\r\n\t\t\t$c = $c ^ (ord($hashpieces[$d]) ^ ord($urlpieces[$d]));\r\n\t\t\t$c = self::zerofill($c, 23) | $c << 9;\r\n\t\t}\r\n\t\treturn '8' . self::hexencode($c);\r\n\t}", "public function getHash($email){\n $sql = \"SELECT * FROM users WHERE email='\".$email.\"'\";\n \n $this->DB->query($sql);\n $row = $this->DB->singleRecord();\n return $row['password'];\n \n }", "function hashing($s){\r\n $letters = \"acdegilmnoprstuw\";\r\n $h = 7;\r\n if(!empty($s)){\r\n $chars = str_split($s);\r\n foreach($chars as $char){\r\n $h = bcadd(bcmul($h,37), stripos($letters,$char));\r\n }\r\n return $h;\r\n }\r\n }", "public function hash($value);", "private function hashing() {\n\t\t$data = md5($this->name.$this->date);\n\t\t$data = md5($data);\n\t\t$data = strrev($data);\n\t\t//$data = md5($data);\n\t\t$data = strtoupper($data);\n\t\t//$data = strrev($data);\n\n\t\t$datatemp = NULL;\n\t\tfor($i=0; $i<=strlen($data); $i++) {\n\t\t\t$arr = substr($data, $i, 1);\n\t\t\tif($i == '4' || $i == '8' || $i == '12' || $i == '16' || $i == '20' || $i == '24' || $i == '28' || $i == '32') {\n\t\t\t\t$datatemp .= substr($this->strfinger, ($i/4)-1, 1);\t\n\t\t\t}\n\t\t\t$datatemp .= \"/%\".$this->combine[$arr];\n\t\t}\n\n\t\t$this->resulthashcode = substr($datatemp, 1, strlen($datatemp)-6);\n\t\t$this->result = true;\n\t}", "function RSHash($string) {\n $a = 63689;\n $b = 378551;\n $hash = 0;\n\n for ($i = 0, $x = strlen($string); $i < $x; $i++) {\n $hash = $hash * $a + (int) ord($string[$i]);\n $hash = fmod($hash, 65535);\n $a = $a * $b;\n $a = fmod($a, 65535);\n }\n\n return $hash;\n }", "public static function _ieHash ($a) {\n $NumHashString = sprintf('%u', self::hashmixIE($a));\n $NumHashLength = strlen($NumHashString);\n $CheckByte = 0;\n for ($i=($NumHashLength-1); $i>=0; $i--) {\n $Num = $NumHashString{$i};\n $CheckByte += (1===($i % 2)) ? (int)((($Num*2)/10)+(($Num*2)%10)) : $Num;\n } $CheckByte %= 10;\n if ($CheckByte !== 0) {\n $CheckByte = 10-$CheckByte;\n if (($NumHashLength % 2) === 1) {\n if (($CheckByte % 2) === 1) {\n $CheckByte += 9; }\n $CheckByte >>= 1; }\n }\n return '7'.$CheckByte.$NumHashString;\n }", "function antispambot($email_address, $hex_encoding = 0)\n {\n }", "public function hashCode() : string;", "public function getHashIdentifier() : string;", "public function getHash(): string;", "public function getHash(): string;", "public function getHash(): string;", "public function getHash(): string;", "protected function _getEmailHash()\n {\n if (isset($this->_properties['email_hash'])) {\n return md5($this->_properties['email_hash']);\n }\n\n throw new \\Cake\\Error\\FatalErrorException(__d('elabs', 'You should have selected the email_hash field as email alias.'));\n }", "public function hashCode(): string;", "function getHashCode($id) {\n\t\treturn \"x\" . base_convert($id, 10, 36);\n\t}", "public function myHash($str) {\n $hash = 0;\n $s = md5($str);\n $seed = 5;\n $len = 32;\n for ($i = 0; $i < $len; $i++) {\n // (hash << 5) + hash 相当于 hash * 33\n //$hash = sprintf(\"%u\", $hash * 33) + ord($s{$i});\n //$hash = ($hash * 33 + ord($s{$i})) & 0x7FFFFFFF;\n $hash = ($hash << $seed) + $hash + ord($s{$i});\n }\n\n return $hash & 0x7FFFFFFF;\n }", "static function email2id($email) {\n // converts a user email to the id of the user\n // both id and email are indivitual to every user\n \n global $con;\n\n $sql = \"SELECT `id` FROM `user` WHERE `email` LIKE '\".$email.\"';\";\n $query = mysqli_query($con, $sql);\n while ($row = mysqli_fetch_assoc($query)) {\n return intval($row['id']);\n }\n return NULL;\n }", "function getHash($str, $hashSize) {\n // Sum the ascii of every char of the string\n // and return the modulus of $hashsize\n $str_arr = str_split($str);\n $sum = 0;\n foreach ($str_arr as $char) {\n $sum += ord($char);\n }\n return $sum % $hashSize;\n}", "public function getHash();", "public function hashID()\n {\n return $this->getCleanString(self::$_hash_id_clean);\n }", "function recordNumberToHashID($newRecordNum) {\n\t// http://www.hashids.org/ \n\t$hashids = new Hashids\\Hashids(theSalt());\n\treturn $hashids->encrypt($newRecordNum);\n}", "function hash_ligne($ligne) {\n\treturn urldecode ( $ligne );\n}", "final public function getHash() {}", "public static function awesomeHash($a) {\n return self::_awesomeHash($a);\n }", "function getId($hash) {\n\t\treturn base_convert($hash, 36, 10);\n\t}", "public function getEmailHash()\n {\n return $this->getValue('nb_icontact_prospect_email_hash');\n }", "protected function hashLockClause_getHashInt() {}", "function external_hash_password($password)\n{\n $external_hasher = new PasswordHash(8, FALSE);\n\n return $external_hasher->HashPassword($password);\n}", "private static function hashCode(string $s) {\n $len = strlen($s);\n $h = 0;\n for ($i=0; $i<$len; ++$i)\n $h = ($h*31 + ord($s[$i])) & 0xffffffff;\n\n if ($h<=0x7fffffff)\n return $h; // A positive value is returned as-is\n else\n return $h|self::$sign_extend; // A negative value is sign-extended\n }", "function f2($a){\n\n $b=hash('sha256',$a);\n\n return $b;\n\n\n\n }", "public function hash() {\n if(isset($this->cache['hash'])) return $this->cache['hash'];\n\n // add a unique hash\n $checksum = sprintf('%u', crc32($this->uri()));\n return $this->cache['hash'] = base_convert($checksum, 10, 36);\n }", "function emailHashPrefix30ForUser($pSql, $pUser) {\n if (checkUsernameExists($pSql, $pUser)) {\n // Look up in db\n $stmt = $pSql->prepare(\"SELECT * FROM user WHERE user = ?\");\n $stmt->bind_param('s', $pUser);\n $stmt->execute();\n $results = $stmt->get_result();\n $stmt->close();\n\n if ($results->num_rows != 0) {\n $row = $results->fetch_assoc();\n return $row['email'];\n }\n } else {\n return \"\";\n }\n}", "function get_hash($string) {\r\n return hash('sha1', $string);\r\n}", "function _hash($string) {\n\t\t\t// Use sha1() if possible, php versions >= 4.3.0 and 5\n\t\t\tif(function_exists('sha1')) {\n\t\t\t\t$hash = sha1($string);\n\t\t\t} else {\n\t\t\t\t// Fall back to md5(), php versions 3, 4, 5\n\t\t\t\t$hash = md5($string);\n\t\t\t}\n\t\t\t$out ='';\n\t\t\t// Convert hexadecimal hash value to binary string\n\t\t\tfor($c=0;$c<strlen($hash);$c+=2) {\n\t\t\t\t$out .= $this->_hex2chr($hash[$c] . $hash[$c+1]);\n\t\t\t}\n\t\t\treturn $out;\n\t\t}", "public function getHash() {}", "function _hash_gensalt_private($input, &$itoa64, $iteration_count_log2 = 6)\n{\n\tif ($iteration_count_log2 < 4 || $iteration_count_log2 > 31)\n\t{\n\t\t$iteration_count_log2 = 8;\n\t}\n\n\t$output = '$H$';\n\t$output .= $itoa64[min($iteration_count_log2 + ((PHP_VERSION >= 5) ? 5 : 3), 30)];\n\t$output .= _hash_encode64($input, 6, $itoa64);\n\n\treturn $output;\n}", "public static function jenkinsHash2($a) {\n $ch = sprintf(\"%u\", self::_jenkinsHash($a, FALSE));\n $ch = ((GTB_Helper::leftShift32(($ch/7), 2)) | ((GTB_Helper::_fmod($ch, 13)) & 7));\n $buf = array($ch);\n for($i=1; $i<20; $i++) { $buf[$i] = $buf[$i-1]-9; }\n return sprintf(\"6%u\", self::_jenkinsHash(GTB_Helper::c32to8bit($buf), FALSE));\n }", "function mcsha1($str)\n{\n\t$gmp = gmp_import(sha1($str, true));\n\tif(gmp_cmp($gmp, gmp_init(\"0x8000000000000000000000000000000000000000\")) >= 0)\n\t{\n\t\t$gmp = gmp_mul(gmp_add(gmp_xor($gmp, gmp_init(\"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\")), gmp_init(1)), gmp_init(-1));\n\t}\n\treturn gmp_strval($gmp, 16);\n}", "function hash_value($text) {\n $saltText = \"AZXCV740884 xs27%^#56635234 ghhtt=-./;'23qAAQWNMM2333\\=4--4005KKGM,,.@##@\";\n return md5($text . $saltText);\n}", "public function makeHash(\\codename\\core\\credential $credential) : string;", "public function ForgotPassword($email)\n\t{\n\t\t$hash=null;\n\t\tif (strlen($email) >2)\n\t\t{\n\t\t\t$hash= self::GetUserID($email);\n\t\t\t//print_r($hash);\n\t\t\tif ($hash=='0')\n\t\t\t{$hash=1; }\n\t\t\telse\n\t\t\t{ self::LockUser($email); }\n\t \t}\n\t\telse\n\t\t{$hash=0;}\n\t\t\n\t\treturn $hash;\n\t}", "protected function generateHash() {\r\n\t\t$relevantData = array('company','country','firstname','lastname','jobstatus');\r\n\t\tforeach($relevantData as $relevantField) {\r\n\t\t\t$getterMethod = 'get_'. ucfirst($relevantField);\r\n\t\t\t$badgeDataString = '';\r\n\t\t\t\r\n\t\t\tif(method_exists($this, $getterMethod)) {\r\n\t\t\t\t$badgeDataString .= $this->$getterMethod();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn md5($badgeDataString);\r\n\t}", "public function hash(string $message): string {\n\t\t$alg = $this->getPrefferedAlgorithm();\n\n\t\tif (\\defined('PASSWORD_ARGON2ID') && $alg === PASSWORD_ARGON2ID) {\n\t\t\treturn 3 . '|' . password_hash($message, PASSWORD_ARGON2ID, $this->options);\n\t\t}\n\n\t\tif (\\defined('PASSWORD_ARGON2I') && $alg === PASSWORD_ARGON2I) {\n\t\t\treturn 2 . '|' . password_hash($message, PASSWORD_ARGON2I, $this->options);\n\t\t}\n\n\t\treturn 1 . '|' . password_hash($message, PASSWORD_BCRYPT, $this->options);\n\t}", "function calcHash($num, $time)\n{\n $date = date(\"Y-m-d\");\n return md5($num . md5($time . md5($date)));\n}", "function kernel_hash_handle($value) {\r\n\r\n return sprintf(\"%u\", crc32($value . HEX));\r\n\r\n}", "public function createHash($email, $hash)\n {\n return $this->user->where('email' , '=' , $email)->update(['hash' => $hash]);\n }", "public function computeHash()\n {\n $this->setLastnamecanonical($this->lastname);\n $this->setFirstnamecanonical($this->firstname);\n\n $this->hash = sha1(\n $this->firstnameCanonical.\n $this->lastnameCanonical.\n (($this->birthdate instanceof \\DateTime) ? $this->birthdate->format('Y-m-d') : '')\n );\n\n return $this->hash;\n }", "function CreateUserHash() {\n// if (isset($_SERVER['REMOTE_ADDR'])) $remAd = $_SERVER['REMOTE_ADDR'];\n// else $remAd = NULL;\n// if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) $forvFor = $_SERVER['HTTP_X_FORWARDED_FOR'];\n// else $forvFor = NULL;\n if (isset($_SERVER['HTTP_USER_AGENT']))\n $userAgent = $_SERVER['HTTP_USER_AGENT'];\n else\n $userAgent = NULL;\n if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))\n $accLang = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);\n else\n $accLang = NULL;\n// if (isset($_SESSION['session_id'])) $sesId = $_SESSION['session_id'];\n// else $sesId = NULL;\n // обработка локали\n if ($accLang) {\n if (is_array($accLang))\n $accLang = $accLang[0];\n $pattern = '/^(?P<primarytag>[a-zA-Z]{2,8})' .\n '(?:-(?P<subtag>[a-zA-Z]{2,8}))?(?:(?:;q=)' .\n '(?P<quantifier>\\d\\.\\d))?$/';\n $splits = array();\n preg_match($pattern, $accLang, $splits);\n $accLang = $splits['primarytag'];\n }\n\n //echo '<br>$remAd='.$remAd.' $forvFor='.$forvFor.' $userAgent='.$userAgent.' $accLang='.$accLang;\n return md5($userAgent . $accLang);\n //return md5($remAd.$forvFor.$userAgent.$accLang.$sesId);\n }", "function _leonardo_hash_gensalt_private($input, &$itoa64, $iteration_count_log2 = 6)\n{\n if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31)\n {\n $iteration_count_log2 = 8;\n }\n\n $output = '$H$';\n $output .= $itoa64[min($iteration_count_log2 + ((PHP_VERSION >= 5) ? 5 : 3), 30)];\n $output .= _leonardo_hash_encode64($input, 6, $itoa64);\n\n return $output;\n}", "function make_hash($str)\n{\n return sha1(md5($str));\n}", "function make_hash($str)\n{\n return sha1(md5($str));\n}", "function urlHash($url) {\n $urlEncode = new UrlEncode();\n $url = $urlEncode->returnUrl($url);\n $result = array();\n global $HOST;\n\n if (!$url) {\n $result[\"error\"] = \"No input given\";\n } else {\n //Database stuff\n global $dbConnStr; //This comes from dbConfig.php\n $dbConnection = pg_connect($dbConnStr);\n\n //First try get the id\n $query = sprintf(\"SELECT id FROM urls WHERE url = '%s'\",$url); //sprintf to reduce SQL injection attack\n $dbResult = pg_query($dbConnection, $query);\n $row = pg_fetch_assoc($dbResult);\n \n //The URL does not exist in the DB, so insert it \n if (!$row) {\n $query = sprintf(\"INSERT INTO urls(url) VALUES('%s') RETURNING id\",$url); \n $dbResult = pg_query($dbConnection, $query);\n $row = pg_fetch_assoc($dbResult);\n }\n\n if ($row) {\n $shortenedUrl = $urlEncode->encodeToShortenedUrl($row[\"id\"]);\n $result[\"hashedUrl\"] = \"http://{$HOST}/{$shortenedUrl}\";\n } else {\n $result[\"error\"] = \"Unspecified error: Please email barry.steyn@gmail.com with details\";\n }\n }\n\n return json_encode($result);\n}", "static function setHashedValue($value) {\n $length = strlen($value);\n $middle = ($length / 2);\n if ($middle > 0) {\n $value1 = substr($value, 0, $middle - 1);\n $value2 = substr($value, $middle, $length - 1);\n $hashedvalue = sha1('2@!' . md5($value1) . $value2 . 'o&#');\n } else {\n $hashedvalue = sha1('2@!' . md5($value . 'o&#'));\n }\n return $hashedvalue;\n }", "function wp_hash($data, $scheme = 'auth')\n {\n }", "function my_hash($string, $username = null) {\r\n\t\t$salt = getStoredSalt($username);\r\n\t\tif (!$salt) {\r\n\t\t\t// generate the salt and store it in the database\r\n\t\t\t$salt = substr(md5(uniqid(rand(),true)),0,24);\r\n\t\t\tstoreSalt($username, $salt);\r\n\t\t}\r\n\t\treturn sha1($salt . $string);\r\n\t}", "public static function quickHash(string $text): int\n\t{\n\t\tif (preg_match_all('(.)us', $text, $matches) === false)\n\t\t{\n\t\t\tthrow new ValueError('Invalid UTF-8 string');\n\t\t}\n\n\t\t$codepoints = self::charsToCodepointsWithSurrogates($matches[0]);\n\n\t\t$pos = count($codepoints);\n\t\t$s1 = 0;\n\t\t$s2 = 0;\n\t\twhile (--$pos >= 0)\n\t\t{\n\t\t\t$s1 = ($s1 + $codepoints[$pos]) % 0xFFFF;\n\t\t\t$s2 = ($s1 + $s2) % 0xFFFF;\n\t\t}\n\t\t$hash = ($s2 << 16) | $s1;\n\n\t\t// Convert to signed long\n\t\tif ($hash > 0x7FFFFFFF)\n\t\t{\n\t\t\t$hash -= 0x100000000;\n\t\t}\n\n\t\treturn $hash;\n\t}", "public static function ieHash ($a) {\n return self::_ieHash($a);\n }", "public function hashValidation(){\n\t\t$this->hash_validation = md5(uniqid(rand(), true).$this->email); \n\t\treturn $this->hash_validation;\n\t}", "function generatePW($email){\n $pw = password_hash($email,PASSWORD_DEFAULT);\n return $pw;\n }", "public function getResetPasswordHash($userId, $email)\n {\n $salt = Configure::read('password_reset_salt');\n $month = date('my');\n\n return md5($userId . $email . $salt . $month);\n }", "function generate_link_hash($link_name)\n{\n\tglobal $user;\n\n\tif (!isset($user->data[\"hash_$link_name\"]))\n\t{\n\t\t$user->data[\"hash_$link_name\"] = substr(sha1($user->data['user_form_salt'] . $link_name), 0, 8);\n\t}\n\n\treturn $user->data[\"hash_$link_name\"];\n}", "private function newHash()\n {\n $salt = hash('sha256', uniqid(mt_rand(), true) . 't33nh4sh' . strtolower($this->email));\n\n // Prefix the password with the salt\n $hash = $salt . $this->password;\n \n // Hash the salted password a bunch of times\n for ( $i = 0; $i < 100000; $i ++ ) {\n $hash = hash('sha256', $hash);\n }\n \n // Prefix the hash with the salt so we can find it back later\n $hash = $salt . $hash;\n \n return $hash;\n }", "function nthash($password = \"\") {\n return strtoupper(bin2hex(mhash(MHASH_MD4, iconv(\"UTF-8\", \"UTF-16LE\", $password))));\n }", "public function generateHash()\n {\n do {\n $hash = Security::randomString(8);\n } while ($this->exists(['hash' => $hash]));\n\n return $hash;\n }", "public function generateAddressHash(Mage_Customer_Model_Address_Abstract $address)\n {\n $addressString = $address->getFirstname();\n $addressString .= $address->getMiddlename();\n $addressString .= $address->getLastname();\n $addressString .= $address->getCompany();\n $street = $address->getStreetFull();\n if (is_array($street)) {\n $street = implode('', $street);\n }\n $addressString .= $street;\n $addressString .= $address->getPostcode();\n $addressString .= $address->getCity();\n $addressString .= $address->getCountryId();\n\n return sha1($addressString);\n }", "public function hash($str)\n\t{\n\t\treturn hash($this->_config['hash_method'], $str);\n\t}", "public static function hashCode($_str) {\n\t\treturn str_pad(\n\t\t\tbase_convert(sprintf('%u',crc32($_str)),10,36),7,'0',\n\t\t\t\tSTR_PAD_LEFT\n\t\t);\n\t}", "public function getCodeHash() {\n $date = new \\DateTime();\n return hexdec($date->format('d-m-y his'));\n }", "function get_url_hash( $url ) {\n\treturn md5( strtolower( $url ) );\n}", "function getUniqueEmail($email_id)\n\t\t{\n\t\t\t//getting all email id from database\n\t\t\t$allEmail = $this->manageContent->getValue('user_credentials','email_id');\n\t\t\t//initializing a parameter\n\t\t\t$emailCounter = 0;\n\t\t\tforeach($allEmail as $allEmails)\n\t\t\t{\n\t\t\t\tif($allEmails['email_id'] == $email_id)\n\t\t\t\t{\n\t\t\t\t\t$emailCounter = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\techo $emailCounter;\n\t\t}", "public function hash() {\r\n\t\t$cacheParams = explode(',',$this->cacheParams);\r\n\t\t$hash ='';\r\n\t\tforeach($cacheParams as $param) {\r\n\t\t\t$param = trim($param);\r\n\t\t\t$hash .= @$this->$param;\r\n\t\t}\r\n\t\treturn md5($hash);\r\n\t}", "function get_user_id_from_string($email_or_login)\n {\n }", "public static function hashmixIE ($url) {\n $c1 = GTB_Helper::strToNum($url, 0x1505, 0x21);\n $c2 = GTB_Helper::strToNum($url, 0, 0x1003f);\n $c1 = GTB_Helper::unsignedRightShift($c1, 2);\n $c1 = (GTB_Helper::unsignedRightShift($c1, 4) & 0x3ffffc0) | ($c1 & 0x3f);\n $c1 = (GTB_Helper::unsignedRightShift($c1, 4) & 0x3ffc00) | ($c1 & 0x3ff);\n $c1 = (GTB_Helper::unsignedRightShift($c1, 4) & 0x3c000) | ($c1 & 0x3fff);\n $t1 = (GTB_Helper::leftShift32( ( GTB_Helper::leftShift32( ($c1 & 0x3c0), 4) | ($c1 & 0x3c)), 2)) | ($c2 & 0xf0f);\n $t2 = (GTB_Helper::leftShift32( ( GTB_Helper::leftShift32( ($c1 & 0xffffc000), 4) | ($c1 & 0x3c00)), 0xa)) | ($c2 & 0xf0f0000);\n return GTB_Helper::mask32(($t1 | $t2));\n }", "function makeKey($masterID){\n\n\t$key = \"I want to see you so bad :/\";\n\t$keyElement1 = \"\";\n\t$keyElement2 = \"\";\n\t$keyElement3 = \"\";\n\t$hash = \"\";\n\n\t$strSQL = \"SELECT * FROM masteraccount WHERE 1 \n\t\tAND masterID = '\".$masterID.\"' \n\t\t\";\n\t\n\t$objQuery = mysql_query($strSQL);\n\t$objResult = mysql_fetch_array($objQuery);\n\tif($objResult) {\n\t\t$keyElement1 = $objResult[\"masterTextPassword\"];\n\t\t$keyElement2 = $objResult[\"masterGraphicalPassword\"];\n\n\t\t//echo \"element2 : \".$keyElement2.\"<br>\";\n\n\t\t$keyElement3 = $objResult[\"email\"];\n\t\t$cost = 11;\n\t\t$salt = mcrypt_create_iv(22, MCRYPT_DEV_URANDOM);\n\t\t\n\t\t//make key -> Hash(Hash(text)+Hash(graphical))+Hash(email)\n\t\t$keyElement1 = hash(\"sha256\",$keyElement1, false);\n\t\t$keyElement2 = hash(\"sha256\",$keyElement2, false);\n\t\t$key = $keyElement1.$keyElement2 ;\n\n\t\t//echo \"key ele1+2 : \".$key.\"<br>\";\n\n\t\t$key = hash(\"sha256\",$key, false);\n\n\t\t//echo \"hashed key ele1+2 : \".$key.\"<br>\";\n\n\t\t$keyElement3 = hash(\"sha256\",$keyElement3, false);\n\t\t$key = $key.$keyElement3 ;\n\t\t$key = hash(\"sha256\",$key, false);\n\n\t\t//echo \"FinalKey : \".$key.\"<br><br>\";\n\t}\n\treturn $key;\n}", "public function GetPasswordHash ();", "protected static function create_hash($string)\n\t{\n\t\t$check1 = static::string_to_number($string, 0x1505, 0x21);\n\t\t$check2 = static::string_to_number($string, 0, 0x1003F);\n\n\t\t$factor = 4;\n\t\t$halfFactor = $factor/2;\n\n\t\t$check1 >>= $halfFactor;\n\t\t$check1 = (($check1 >> $factor) & 0x3FFFFC0 ) | ($check1 & 0x3F);\n\t\t$check1 = (($check1 >> $factor) & 0x3FFC00 ) | ($check1 & 0x3FF);\n\t\t$check1 = (($check1 >> $factor) & 0x3C000 ) | ($check1 & 0x3FFF); \n\n\t\t$calc1 = (((($check1 & 0x3C0) << $factor) | ($check1 & 0x3C)) << $halfFactor ) | ($check2 & 0xF0F );\n\t\t$calc2 = (((($check1 & 0xFFFFC000) << $factor) | ($check1 & 0x3C00)) << 0xA) | ($check2 & 0xF0F0000 );\n\n\t\treturn ($calc1 | $calc2);\n\t}", "public function hashString(){ return $this->ulA->db->ID . \"_\" . $this->ulA->ID . \"_\" . $this->ulB->db->ID . \"_\" . $this->ulB->ID; }", "function getHash($str)\n{\n\treturn hash('sha256', $str);\n}", "public static function hash($data)\r\n {\r\n return Hash::make($data, ['rounds' => 12]);\r\n }", "public function hash($user_id = false)\r\n {\r\n // User Client HASH\r\n $user_ip = $_SERVER['REMOTE_ADDR'];\r\n if (!$user_id) {\r\n if (isset($_SESSION['uid'])) {\r\n $user_id = $_SESSION['uid'];\r\n }\r\n }\r\n $hash = md5($user_ip . $user_id); // Simple hash!\r\n return $hash;\r\n }", "protected function fetchIdHash()\n {\n return md5($this->request->server('HTTP_USER_AGENT') . $this->fetchIp());\n }", "public static function hash($string)\n {\n // The hash is a string of hex digits (with a length of 32 bytes for md5).\n return md5($string);\n }", "function bd_usuarios_hash($id){\n return sql2value(\"\n SELECT clave\n FROM usuarios\n WHERE id LIKE '{$id}'or email LIKE '{$id}'\n LIMIT 1;\n \");\n}", "private function hash($string)\n {\n if (!function_exists('hash')) {\n return sha1($string);\n }\n return hash('sha256', $string);\n }", "function hash_password($password){\n\t// Hashing options\n\t$options = [\n 'cost' => 12,\t// Cost determines the work required to brute-force\n //'salt' => mcrypt_create_iv(22, MCRYPT_DEV_URANDOM),\n\t];\n\n\treturn password_hash($password, PASSWORD_BCRYPT, $options);\n}", "abstract protected static function getHashAlgorithm() : string;", "public static function jenkinsHash($a) {\n $b = GTB_Helper::strOrds(\"info:\".$a);\n return self::_jenkinsHash ($b);\n }" ]
[ "0.72488767", "0.69323874", "0.6409589", "0.64029896", "0.63674927", "0.62949526", "0.62573165", "0.62332374", "0.6211042", "0.6120185", "0.60853183", "0.60845506", "0.60464233", "0.59475744", "0.5930406", "0.59203345", "0.5908156", "0.5896374", "0.5891508", "0.58563304", "0.5820144", "0.58181095", "0.58181095", "0.58181095", "0.58181095", "0.581653", "0.5805217", "0.5799266", "0.578567", "0.5743987", "0.57428044", "0.57421577", "0.57373667", "0.5727936", "0.56858677", "0.5683429", "0.566916", "0.5657225", "0.5645433", "0.5635185", "0.5626019", "0.56200093", "0.5617125", "0.561466", "0.56065005", "0.56039", "0.56024784", "0.5602216", "0.55943716", "0.55942065", "0.559331", "0.55708766", "0.5553617", "0.55456454", "0.55258995", "0.55140793", "0.5506427", "0.5497397", "0.54871994", "0.54869735", "0.5474413", "0.5453279", "0.54458946", "0.54458946", "0.54450816", "0.5422282", "0.5415425", "0.54046404", "0.5403535", "0.5397142", "0.5394421", "0.53905356", "0.5379713", "0.5363714", "0.5362312", "0.5360267", "0.53545225", "0.5352732", "0.5349006", "0.5329737", "0.53279984", "0.53250104", "0.5318122", "0.53160906", "0.53131044", "0.5301538", "0.5291101", "0.5290642", "0.52871203", "0.5276251", "0.5275308", "0.5273476", "0.5271148", "0.5267578", "0.52673674", "0.52612144", "0.52586985", "0.5255375", "0.5255051", "0.5254647" ]
0.75102603
0
Global function for chmodding directories and files for internal use This function determines owner and group whom the file belongs to and user and group of PHP and then set safest possible file permissions. The function determines owner and group from common.php file and sets the same to the provided file. The function uses bit fields to build the permissions. The function sets the appropiate execute bit on directories. Supported constants representing bit fields are: CHMOD_ALL all permissions (7) CHMOD_READ read permission (4) CHMOD_WRITE write permission (2) CHMOD_EXECUTE execute permission (1) NOTE: The function uses POSIX extension and fileowner()/filegroup() functions. If any of them is disabled, this function tries to build proper permissions, by calling is_readable() and is_writable() functions.
function phpbb_chmod($filename, $perms = CHMOD_READ) { static $_chmod_info; // Return if the file no longer exists. if (!file_exists($filename)) { return false; } // Determine some common vars if (empty($_chmod_info)) { if (!function_exists('fileowner') || !function_exists('filegroup')) { // No need to further determine owner/group - it is unknown $_chmod_info['process'] = false; } else { global $phpbb_root_path, $phpEx; // Determine owner/group of common.php file and the filename we want to change here $common_php_owner = @fileowner($phpbb_root_path . 'common.' . $phpEx); $common_php_group = @filegroup($phpbb_root_path . 'common.' . $phpEx); // And the owner and the groups PHP is running under. $php_uid = (function_exists('posix_getuid')) ? @posix_getuid() : false; $php_gids = (function_exists('posix_getgroups')) ? @posix_getgroups() : false; // If we are unable to get owner/group, then do not try to set them by guessing if (!$php_uid || empty($php_gids) || !$common_php_owner || !$common_php_group) { $_chmod_info['process'] = false; } else { $_chmod_info = array( 'process' => true, 'common_owner' => $common_php_owner, 'common_group' => $common_php_group, 'php_uid' => $php_uid, 'php_gids' => $php_gids, ); } } } if ($_chmod_info['process']) { $file_uid = @fileowner($filename); $file_gid = @filegroup($filename); // Change owner if (@chown($filename, $_chmod_info['common_owner'])) { clearstatcache(); $file_uid = @fileowner($filename); } // Change group if (@chgrp($filename, $_chmod_info['common_group'])) { clearstatcache(); $file_gid = @filegroup($filename); } // If the file_uid/gid now match the one from common.php we can process further, else we are not able to change something if ($file_uid != $_chmod_info['common_owner'] || $file_gid != $_chmod_info['common_group']) { $_chmod_info['process'] = false; } } // Still able to process? if ($_chmod_info['process']) { if ($file_uid == $_chmod_info['php_uid']) { $php = 'owner'; } else if (in_array($file_gid, $_chmod_info['php_gids'])) { $php = 'group'; } else { // Since we are setting the everyone bit anyway, no need to do expensive operations $_chmod_info['process'] = false; } } // We are not able to determine or change something if (!$_chmod_info['process']) { $php = 'other'; } // Owner always has read/write permission $owner = CHMOD_READ | CHMOD_WRITE; if (is_dir($filename)) { $owner |= CHMOD_EXECUTE; // Only add execute bit to the permission if the dir needs to be readable if ($perms & CHMOD_READ) { $perms |= CHMOD_EXECUTE; } } switch ($php) { case 'owner': $result = @chmod($filename, ($owner << 6) + (0 << 3) + (0 << 0)); clearstatcache(); if (is_readable($filename) && is_writable($filename)) { break; } case 'group': $result = @chmod($filename, ($owner << 6) + ($perms << 3) + (0 << 0)); clearstatcache(); if ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename))) { break; } case 'other': $result = @chmod($filename, ($owner << 6) + ($perms << 3) + ($perms << 0)); clearstatcache(); if ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename))) { break; } default: return false; break; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function phpbb_chmod($filename, $perms = CHMOD_READ)\n{\n\tstatic $_chmod_info;\n\n\t// Return if the file no longer exists.\n\tif (!file_exists($filename))\n\t{\n\t\treturn false;\n\t}\n\n\t// Determine some common vars\n\tif (empty($_chmod_info))\n\t{\n\t\tif (!function_exists('fileowner') || !function_exists('filegroup'))\n\t\t{\n\t\t\t// No need to further determine owner/group - it is unknown\n\t\t\t$_chmod_info['process'] = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tglobal $root_path, $phpEx;\n\n\t\t\t// Determine owner/group of common.php file and the filename we want to change here\n\t\t\t$common_php_owner = @fileowner($phpbb_root_path . 'index.' . $phpEx);\n\t\t\t$common_php_group = @filegroup($phpbb_root_path . 'index.' . $phpEx);\n\n\t\t\t// And the owner and the groups PHP is running under.\n\t\t\t$php_uid = (function_exists('posix_getuid')) ? @posix_getuid() : false;\n\t\t\t$php_gids = (function_exists('posix_getgroups')) ? @posix_getgroups() : false;\n\n\t\t\t// If we are unable to get owner/group, then do not try to set them by guessing\n\t\t\tif (!$php_uid || empty($php_gids) || !$common_php_owner || !$common_php_group)\n\t\t\t{\n\t\t\t\t$_chmod_info['process'] = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_chmod_info = array(\n\t\t\t\t\t'process'\t\t=> true,\n\t\t\t\t\t'common_owner'\t=> $common_php_owner,\n\t\t\t\t\t'common_group'\t=> $common_php_group,\n\t\t\t\t\t'php_uid'\t\t=> $php_uid,\n\t\t\t\t\t'php_gids'\t\t=> $php_gids,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ($_chmod_info['process'])\n\t{\n\t\t$file_uid = @fileowner($filename);\n\t\t$file_gid = @filegroup($filename);\n\n\t\t// Change owner\n\t\tif (@chown($filename, $_chmod_info['common_owner']))\n\t\t{\n\t\t\tclearstatcache();\n\t\t\t$file_uid = @fileowner($filename);\n\t\t}\n\n\t\t// Change group\n\t\tif (@chgrp($filename, $_chmod_info['common_group']))\n\t\t{\n\t\t\tclearstatcache();\n\t\t\t$file_gid = @filegroup($filename);\n\t\t}\n\n\t\t// If the file_uid/gid now match the one from common.php we can process further, else we are not able to change something\n\t\tif ($file_uid != $_chmod_info['common_owner'] || $file_gid != $_chmod_info['common_group'])\n\t\t{\n\t\t\t$_chmod_info['process'] = false;\n\t\t}\n\t}\n\n\t// Still able to process?\n\tif ($_chmod_info['process'])\n\t{\n\t\tif ($file_uid == $_chmod_info['php_uid'])\n\t\t{\n\t\t\t$php = 'owner';\n\t\t}\n\t\telse if (in_array($file_gid, $_chmod_info['php_gids']))\n\t\t{\n\t\t\t$php = 'group';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Since we are setting the everyone bit anyway, no need to do expensive operations\n\t\t\t$_chmod_info['process'] = false;\n\t\t}\n\t}\n\n\t// We are not able to determine or change something\n\tif (!$_chmod_info['process'])\n\t{\n\t\t$php = 'other';\n\t}\n\n\t// Owner always has read/write permission\n\t$owner = CHMOD_READ | CHMOD_WRITE;\n\tif (is_dir($filename))\n\t{\n\t\t$owner |= CHMOD_EXECUTE;\n\n\t\t// Only add execute bit to the permission if the dir needs to be readable\n\t\tif ($perms & CHMOD_READ)\n\t\t{\n\t\t\t$perms |= CHMOD_EXECUTE;\n\t\t}\n\t}\n\n\tswitch ($php)\n\t{\n\t\tcase 'owner':\n\t\t\t$result = @chmod($filename, ($owner << 6) + (0 << 3) + (0 << 0));\n\n\t\t\tclearstatcache();\n\n\t\t\tif (is_readable($filename) && is_writable($filename))\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tcase 'group':\n\t\t\t$result = @chmod($filename, ($owner << 6) + ($perms << 3) + (0 << 0));\n\n\t\t\tclearstatcache();\n\n\t\t\tif ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tcase 'other':\n\t\t\t$result = @chmod($filename, ($owner << 6) + ($perms << 3) + ($perms << 0));\n\n\t\t\tclearstatcache();\n\n\t\t\tif ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tdefault:\n\t\t\treturn false;\n\t\tbreak;\n\t}\n\n\treturn $result;\n}", "function havp_set_file_access($dir, $owner, $mod) {\n\tif (file_exists($dir)) {\n\t\tmwexec(\"/usr/bin/chgrp -R -v $owner $dir\");\n\t\tmwexec(\"/usr/sbin/chown -R -v $owner $dir\");\n\t\tif (!empty($mod)) {\n\t\t\tmwexec( \"/bin/chmod -R -v $mod $dir\");\n\t\t}\n\t}\n}", "function setFilePermission (string $path) : void {\n\n\tif (PHP_OS_FAMILY === \"Windows\") return;\n\t$iterator = null;\n\tif (!is_dir($path)) {\n\t\t$iterator = [$path];\n\t} else {\n\t\t$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));\n\t}\n\n\tforeach ($iterator as $item) {\n\t\t@chmod($item, octdec(getConfig(\"UNIX_FILE_PERMISSIONS\")));\n\t\t@chgrp($item, getConfig(\"UNIX_FILE_GROUP\"));\n\t}\n}", "function FileChmod()\n{\t\n\t$sFileUrl = '';\n\t\n\tif(isset($_REQUEST['file-path']) === false)\n\t{\n\t\techo '<fail>no file path</fail>';\n\t\treturn;\n\t}\n\t$sFileUrl = trim($_REQUEST['file-path']);\n\t\n\t\n\t$nChmodParam = 0755;\n\t\n\tif(isset($_REQUEST['chmod']) === false)\n\t{\n\t\techo '<fail>no chmodparametr</fail>';\n\t\treturn;\n\t}\n\t$nChmodParam = trim($_REQUEST['chmod']);\n\t\n\tif($nChmodParam[0] === '0')\n\t{\n\t\t$nChmodParam[0] = ' ';\n\t\t$nChmodParam = trim($nChmodParam);\n\t}\n\t\n\t$nChmodParam = (int) $nChmodParam;\n\t$nChmodParam = octdec($nChmodParam);\n\n\t\n\t\n\t\n\t$bIsChmodCreate = true;\n\t$bIsChmodCreate = chmod($sFileUrl, $nChmodParam);\n\t\n\tif($bIsChmodCreate === true)\n\t{\n\t\techo '<correct>update chmod correct</correct>';\n\t} else\n\t{\n\t\techo '<fail>cant create chmod</fail>';\n\t}\n}", "function setCHMOD($params='')\n {\n global $iConfig;\n $aReturn = array();\n\n if (empty($params))\n {\n $params = $iConfig['chmod_paths'];\n }\n\n foreach ($params as $path => $mode)\n {\n $aReturn[$path]['status'] = '';\n $real_path = realpath(dirname($_SERVER['SCRIPT_FILENAME']) .'/../'. $path); // Get real path\n\n if (file_exists($real_path))\n {\n if (!fileperms($real_path))\n {\n $aReturn[$path]['status'] = sprintf($this->t('e_permition_fail'), $path);\n }else{\n// if (!@chmod($real_path, $mode)) $aReturn[$path]['status'] = sprintf($this->t('e_chmod_fail'), $path); // Need to test\n\n $aReturn[$path]['mode'] = '0'.decoct(0777 & fileperms($real_path));\n //echo $path.\": (\".fileperms($real_path).\")\".($aReturn[$path]['mode']).\" - \".($mode).\"<br/>\";\n $s1=strrev(\"\".$aReturn[$path]['mode']);\n $s2=strrev(\"\".$mode);\n $aReturn[$path]['status'] = '';\n for($i=0;$i<strlen($s2);$i++)\n {\n if(intval($s1[$i])<intval($s2[$i]))\n {\n $aReturn[$path]['status'] = sprintf($this->t('e_chmod_fail'), $path);\n break;\n }\n }\n /* if(intval($aReturn[$path]['mode']) != intval($mode)) $aReturn[$path]['status'] = sprintf($this->t('e_chmod_fail'), $path);\n else $aReturn[$path]['status'] = ''; */\n }\n }else{\n $aReturn[$path]['status'] = sprintf($this->t('e_missing_file'), $path);\n }\n }\n return $aReturn;\n }", "function perms($file) {\n$perms = fileperms($file);\n\nif (($perms & 0xC000) == 0xC000) {\n // Socket\n $info = 's';\n} elseif (($perms & 0xA000) == 0xA000) {\n // Symbolic Link\n $info = 'l';\n} elseif (($perms & 0x8000) == 0x8000) {\n // Regular\n $info = '-';\n} elseif (($perms & 0x6000) == 0x6000) {\n // Block special\n $info = 'b';\n} elseif (($perms & 0x4000) == 0x4000) {\n // Directory\n $info = 'd';\n} elseif (($perms & 0x2000) == 0x2000) {\n // Character special\n $info = 'c';\n} elseif (($perms & 0x1000) == 0x1000) {\n // FIFO pipe\n $info = 'p';\n} else {\n // Unknown\n $info = 'u';\n}\n\n// Owner\n$info .= (($perms & 0x0100) ? 'r' : '-');\n$info .= (($perms & 0x0080) ? 'w' : '-');\n$info .= (($perms & 0x0040) ?\n (($perms & 0x0800) ? 's' : 'x' ) :\n (($perms & 0x0800) ? 'S' : '-'));\n\n// Group\n$info .= (($perms & 0x0020) ? 'r' : '-');\n$info .= (($perms & 0x0010) ? 'w' : '-');\n$info .= (($perms & 0x0008) ?\n (($perms & 0x0400) ? 's' : 'x' ) :\n (($perms & 0x0400) ? 'S' : '-'));\n\n// World\n$info .= (($perms & 0x0004) ? 'r' : '-');\n$info .= (($perms & 0x0002) ? 'w' : '-');\n$info .= (($perms & 0x0001) ?\n (($perms & 0x0200) ? 't' : 'x' ) :\n (($perms & 0x0200) ? 'T' : '-'));\n return $info;\n}", "function cli_chmod($path, $mode = 0755, $recursive = true, $exceptions = array()) {\n global $_messages, $_errors;\n\n if ($recursive === false && is_dir($path)) {\n if (@chmod($path, intval($mode, 8))) {\n $_messages[] = sprintf('<success>%s changed to %s<success>', $path, $mode);\n return true;\n }\n\n $_errors[] = sprintf('<error>%s NOT changed to %s', $path, $mode);\n return false;\n }\n\n if (is_dir($path)) {\n $paths = cli_tree($path);\n\n foreach ($paths as $type) {\n foreach ($type as $key => $fullpath) {\n $check = explode(DS, $fullpath);\n $count = count($check);\n\n if (in_array($check[$count - 1], $exceptions)) {\n continue;\n }\n\n if (@chmod($fullpath, intval($mode, 8))) {\n $_messages[] = sprintf('<success>%s changed to %s</success>', $fullpath, $mode);\n } else {\n $_errors[] = sprintf('<error>%s NOT changed to %s</error>', $fullpath, $mode);\n }\n }\n }\n\n if (empty($_errors)) {\n return true;\n }\n }\n return false;\n}", "public function chown($file, $owner, $recursive = \\false)\n {\n }", "public function chown($file, $owner, $recursive = \\false)\n {\n }", "public function chown($file, $owner, $recursive = \\false)\n {\n }", "function Pico_IsWritable($file, $update_perms = false)\n{\n\tif ( (!file_exists($file)) or (is_file($file)) )\n\t{\n\t\t// check to see if parent folder is writable\n\t\t$parent_dir = dirname($file);\n\t\t\n\t\tif (is_writable($parent_dir))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telseif ($update_perms == TRUE)\n\t\t{\n\t\t\t// atempt to make writable\n\t\t\tif (is_dir($parent_dir))\n\t\t\t{\n\t\t\t\t$folder_is_writable = Pico_IsWritable($parent_dir, TRUE);\n\t\t\t\treturn $folder_is_writable;\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\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\t$is_writable = is_writable($file);\n\t\n\tif (!$is_writable)\n\t{\n\t\tif ($update_perms == TRUE)\n\t\t{\n\t\t\t// try to connect via FTP and make this file writable\n\t\t\t$ftp = @Pico_ConnectFTP();\n\t\t\tif (!is_object($ftp))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (is_file($file))\n\t\t\t\t{\n\t\t\t\t\t@$ftp->chmod($file, 0666);\n\t\t\t\t}\n\t\t\t\telseif (is_dir($file))\n\t\t\t\t{\n\t\t\t\t\t@$ftp->chmod($file, 0777);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (is_writable($file))\n\t\t\t\t{\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\telse\n\t{\n\t\treturn TRUE;\n\t}\n}", "public function setChmod($mode = self::DEFAULT_MODE, bool $recursive = true, array $exceptions = [])\n {\n if (!self::exists($this->path)){\n\t\t\t$this->errors[] = \"[{$this->path}] - Não existe.\";\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (!self::isValidChmod($mode)){\n\t\t\t$this->messages[] = sprintf('O valor %s, é inválido para chmod. O valor padrão %s, foi aplicado para o diretório %s.', $mode, self::DEFAULT_MODE, $this->path);\n\t\t}\n\n if ($recursive === false && is_dir($this->path)) {\n //@codingStandardsIgnoreStart\n if (@chmod($this->path, intval($mode, 8))) {\n //@codingStandardsIgnoreEnd\n $this->messages[] = sprintf('%s alterado para %s', $this->path, $mode);\n\n return true;\n }\n $this->errors[] = sprintf('%s não alterado para %s', $this->path, $mode);\n return false;\n }\n\n if (is_dir($this->path)) {\n $paths = self::tree($this->path);\n\n foreach ($paths as $type) {\n foreach ($type as $fullpath) {\n $check = explode(DIRECTORY_SEPARATOR, $fullpath);\n $count = count($check);\n\n if (in_array($check[$count - 1], $exceptions)) \n continue;\n //@codingStandardsIgnoreStart\n if (@chmod($fullpath, intval($mode, 8))) \n //@codingStandardsIgnoreEnd\n $this->messages[] = sprintf('%s alterado para %s', $fullpath, $mode);\n else \n $this->errors[] = sprintf('%s não alterado para %s', $fullpath, $mode);\n }\n }\n\n if (empty(self::$errors)) \n return true; \n }\n\n return false;\n }", "function ftp_chmod_son($filename,$chmod = 0777){\r\n\t\t//$chmod = (int) $chmod;\r\n\t\t\r\n\t\t$filename = dzz_ftp::clear($filename);\r\n\t\t//检查子目录\r\n\t\tif($list=self::ftp_list($filename,0)){\r\n\t\t\tforeach($list as $value){\r\n\t\t\t\tif($value['type']=='folder'){\r\n\t\t\t\t\tself::ftp_chmod_son($value['path'],$chmod);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself::ftp_chmod($value['path'],$chmod);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn self::ftp_chmod($filename,$chmod);\r\n\t}", "function fn_te_get_permissions($path)\n{\n if (defined('IS_WINDOWS')) {\n return '';\n }\n\n $mode = fileperms($path);\n\n $owner = array();\n $group = array();\n $world = array();\n $owner['read'] = ($mode & 00400) ? 'r' : '-';\n $owner['write'] = ($mode & 00200) ? 'w' : '-';\n $owner['execute'] = ($mode & 00100) ? 'x' : '-';\n $group['read'] = ($mode & 00040) ? 'r' : '-';\n $group['write'] = ($mode & 00020) ? 'w' : '-';\n $group['execute'] = ($mode & 00010) ? 'x' : '-';\n $world['read'] = ($mode & 00004) ? 'r' : '-';\n $world['write'] = ($mode & 00002) ? 'w' : '-';\n $world['execute'] = ($mode & 00001) ? 'x' : '-';\n\n if ($mode & 0x800) {\n $owner['execute'] = ($owner['execute']=='x') ? 's' : 'S';\n }\n\n if ($mode & 0x400) {\n $group['execute'] = ($group['execute']=='x') ? 's' : 'S';\n }\n\n if ($mode & 0x200) {\n $world['execute'] = ($world['execute']=='x') ? 't' : 'T';\n }\n\n $s = sprintf('%1s%1s%1s', $owner['read'], $owner['write'], $owner['execute']);\n $s .= sprintf('%1s%1s%1s', $group['read'], $group['write'], $group['execute']);\n $s .= sprintf('%1s%1s%1s', $world['read'], $world['write'], $world['execute']);\n\n return trim($s);\n}", "public function testChown_Chgrp()\n {\n if (!function_exists('posix_getuid')) $this->markTestSkipped(\"Posix functions not available: I don't know if I'm root.\");\n \tif (posix_getuid() !== 0) $this->markTestSkipped(\"Can only chown as root.\");\n\n \t$sysusr = posix_getpwuid(3);\n \tif (!$sysusr) $this->markTestSkipped(\"The system has no user with uid 3, which is used in the test.\");\n\n \t$sysgrp = posix_getgrgid(2);\n \tif (!$sysgrp) $this->markTestSkipped(\"The system has no group with gid 2, which is used in the test.\");\n\n clearstatcache(false, $this->file);\n $this->Fs_Node->chown(array($sysusr['name'], $sysgrp['name']));\n $this->assertEquals(3, fileowner($this->file));\n $this->assertEquals(2, filegroup($this->file));\n\n clearstatcache(false, $this->file);\n $this->Fs_Node->chown(array(0, 0));\n $this->assertEquals(0, fileowner($this->file));\n $this->assertEquals(0, filegroup($this->file));\n }", "function fn_te_chmod($source, $perms = DEFAULT_DIR_PERMISSIONS, $recursive = false)\n{\n // Simple copy for a file\n if (is_file($source) || $recursive == false) {\n $res = @chmod($source, $perms);\n\n return $res;\n }\n\n // Loop through the folder\n if (is_dir($source)) {\n $dir = dir($source);\n while (false !== $entry = $dir->read()) {\n // Skip pointers\n if ($entry == '.' || $entry == '..') {\n continue;\n }\n if (fn_te_chmod($source . '/' . $entry, $perms, true) == false) {\n return false;\n }\n }\n // Clean up\n $dir->close();\n\n return @chmod($source, $perms);\n } else {\n return false;\n }\n}", "function chmod($file,$permission) \n {\n \t $cmd = \"CHMOD \" . decoct($permission) . \" \" . $file;\n return $this->sendCommand($cmd); \n }", "function permissions_global ($dir, $file, $action)\n{\n\t// check if login is required\n\tif ($GLOBALS['require_login'] == true)\n\t\treturn false;\n\n\t// if no login is required, get the global permissions\n\t$permissions = $GLOBALS['global_permissions'];\n\n\t// if the global permissions are undefined, nothing\n\t// is allowed\n\tif (! isset($permissions))\n\t\treturn false;\n\n\t$permdefs = permissions_get();\n\n\t// check if this action is allowed by the global permissions\n\treturn $permissions & $permdefs[$action];\n}", "public function gethchmod($file)\n {\n }", "function is_really_writable($file) {\n // If we're on a Unix server with safe_mode off we call is_writable\n if (DIRECTORY_SEPARATOR == '/' AND @ini_get(\"safe_mode\") == FALSE) {\n return is_writable($file);\n }\n\n // For windows servers and safe_mode \"on\" installations we'll actually\n // write a file then read it. Bah...\n if (is_dir($file)) {\n $file = rtrim($file, '/') . '/' . md5(mt_rand(1, 100) . mt_rand(1, 100));\n\n if (($fp = @fopen($file, FOPEN_WRITE_CREATE)) === FALSE) {\n return FALSE;\n }\n\n fclose($fp);\n @chmod($file, DIR_WRITE_MODE);\n @unlink($file);\n return TRUE;\n }\n elseif (!is_file($file) OR ($fp = @fopen($file, FOPEN_WRITE_CREATE)) === FALSE) {\n return FALSE;\n }\n\n fclose($fp);\n return TRUE;\n}", "public function testChown()\n {\n if (!function_exists('posix_getuid')) $this->markTestSkipped(\"Posix functions not available; I don't know if I'm root.\");\n \tif (posix_getuid() !== 0) $this->markTestSkipped(\"Can only chown as root.\");\n\n \t$sysusr = posix_getpwuid(3);\n \tif (!$sysusr) $this->markTestSkipped(\"The system has no user with uid 3, which is used in the test.\");\n\n clearstatcache(false, $this->file);\n $this->Fs_Node->chown($sysusr['name']);\n $this->assertEquals(3, fileowner($this->file));\n\n clearstatcache(false, $this->file);\n $this->Fs_Node->chown(0);\n $this->assertEquals(0, fileowner($this->file));\n }", "public function fixPerms($group = 'www-data')\n {\n $this->taskExecStack()\n ->dir(\"web\")\n ->exec(\"chown -R $(whoami):{$group} .\")\n ->exec(\"find . -type d -exec chmod u=rwx,g=rx,o= '{}' \\;\")\n ->exec(\"find . -type f -exec chmod u=rw,g=r,o= '{}' \\;\")\n ->run();\n\n $this->taskExecStack()\n ->dir(\"web/sites\")\n ->exec(\"find . -type d -name files -exec chmod ug=rwx,o= '{}' \\;\")\n ->exec(\"for d in ./*/files; do find \\$d -type d -exec chmod ug=rwx,o= '{}' \\;; find \\$d -type f -exec chmod ug=rw,o= '{}' \\;; done\")\n ->run();\n\n }", "public function testSetChmod()\n {\n file_put_contents(self::$temp.DS.'file.txt', 'Hello World');\n\n Storage::chmod(self::$temp.DS.'file.txt', 0755);\n\n $actual = substr(sprintf('%o', fileperms(self::$temp.DS.'file.txt')), -4);\n $expected = ('\\\\' === DS) ? '0666' : '0755';\n\n $this->assertTrue($expected === $actual);\n }", "function N_writable($pathfile) {\r\n\t//fix windows acls bug\r\n\t$isDir = substr($pathfile,-1)=='/' ? true : false;\r\n\tif ($isDir) {\r\n\t\tif (is_dir($pathfile)) {\r\n\t\t\tmt_srand((double)microtime()*1000000);\r\n\t\t\t$pathfile = $pathfile.'pw_'.uniqid(mt_rand()).'.tmp';\r\n\t\t} elseif (@mkdir($pathfile)) {\r\n\t\t\treturn N_writable($pathfile);\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t@chmod($pathfile,0777);\r\n\t$fp = @fopen($pathfile,'ab');\r\n\tif ($fp===false) return false;\r\n\tfclose($fp);\r\n\t$isDir && @unlink($pathfile);\r\n\treturn true;\r\n}", "function apply_chmod($install_mode = true)\n\t{\n\t\tglobal $chmod_777, $chmod_666;\n\t\tglobal $lang, $language;\n\n\t\t$img_ok = str_replace('alt=\"\" title=\"\"', 'alt=\"' . $lang['CHMOD_OK'] . '\" title=\"' . $lang['CHMOD_OK'] . '\"', $this->img_ok);\n\t\t$img_error = str_replace('alt=\"\" title=\"\"', 'alt=\"' . $lang['CHMOD_Error'] . '\" title=\"' . $lang['CHMOD_Error'] . '\"', $this->img_error);\n\n\t\t$chmod_errors = false;\n\t\t$file_exists_errors = false;\n\t\t$read_only_errors = false;\n\t\t$report_string_append = '';\n\n\t\t$chmod_items_array = array($chmod_777, $chmod_666);\n\t\t$chmod_values_array = array(0777, 0666);\n\t\t$chmod_langs_array = array($lang['CHMOD_777'], $lang['CHMOD_666']);\n\t\t$chmod_images_array = array('./style/folder_blue.png', './style/folder_red.png');\n\n\t\t$table_output = '';\n\t\tif ($install_mode)\n\t\t{\n\t\t\t$this->output_lang_select(THIS_FILE);\n\t\t\t$table_output .= '<form action=\"install.' . PHP_EXT . '\" name=\"lang\" method=\"post\">' . \"\\n\";\n\t\t}\n\t\t$table_output .= '<table class=\"forumline\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">' . \"\\n\";\n\t\t$table_output .= '<tr><td class=\"row-header\" colspan=\"3\"><span>' . $lang['CHMOD_Files'] . '</span></td></tr>' . \"\\n\";\n\n\t\tfor ($i = 0; $i < sizeof($chmod_items_array); $i++)\n\t\t{\n\t\t\tif (!empty($chmod_items_array[$i]))\n\t\t\t{\n\t\t\t\t$table_output .= '<tr><th colspan=\"3\"><span class=\"gen\"><b>' . $chmod_langs_array[$i] . '</b></span></th></tr>' . \"\\n\";\n\t\t\t\t$table_output .= '<tr><td class=\"row1 row-center\" rowspan=\"' . (sizeof($chmod_items_array[$i]) + 1) . '\" width=\"90\"><img src=\"' . $chmod_images_array[$i] . '\" alt=\"' . $chmod_langs_array[$i] . '\" title=\"' . $chmod_langs_array[$i] . '\" /></td></tr>' . \"\\n\";\n\t\t\t\tfor ($j = 0; $j < sizeof($chmod_items_array[$i]); $j++ )\n\t\t\t\t{\n\t\t\t\t\t$report_string = '';\n\t\t\t\t\t$errored = false;\n\t\t\t\t\tif (!file_exists($chmod_items_array[$i][$j]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$errored = true;\n\t\t\t\t\t\t$report_string = $lang['CHMOD_File_NotExists'];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t@chmod($chmod_items_array[$i][$j], $chmod_values_array[$i]);\n\t\t\t\t\t\tif (!is_writable($chmod_items_array[$i][$j]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$errored = true;\n\t\t\t\t\t\t\t$report_string = $lang['CHMOD_File_Exists_Read_Only'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$report_string = $lang['CHMOD_File_Exists'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($errored)\n\t\t\t\t\t{\n\t\t\t\t\t\t$report_string_append = '&nbsp;<span class=\"genmed\" style=\"color: ' . $this->color_error . ';\"><b>' . $report_string . '</b></span>';\n\t\t\t\t\t\t$table_output .= '<tr><td class=\"row1\" width=\"40%\"><span class=\"gen\" style=\"color: ' . $this->color_error . ';\"><b>' . $chmod_items_array[$i][$j] . '</b></span></td><td class=\"row2\">' . $img_error . $report_string_append . '</td></tr>' . \"\\n\";\n\t\t\t\t\t\t$chmod_errors = true;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$report_string_append = '&nbsp;<span class=\"genmed\" style=\"color: ' . $this->color_ok . ';\">' . $report_string . '</span>';\n\t\t\t\t\t\t$table_output .= '<tr><td class=\"row1\" width=\"40%\"><span class=\"gen\" style=\"color: ' . $this->color_ok . ';\"><b>' . $chmod_items_array[$i][$j] . '</b></span></td><td class=\"row2\">' . $img_ok . $report_string_append . '</td></tr>' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($install_mode)\n\t\t{\n\t\t\t$table_output .= '<tr><th colspan=\"3\"><span class=\"gen\"><b>&nbsp;</b></span></th></tr>' . \"\\n\";\n\t\t\t$s_hidden_fields = '';\n\t\t\t$s_hidden_fields .= '<input type=\"hidden\" name=\"install_step\" value=\"1\" />' . \"\\n\";\n\t\t\t$s_hidden_fields .= '<input type=\"hidden\" name=\"lang\" value=\"' . $language . '\" />' . \"\\n\";\n\t\t\t$table_output .= '<tr><td class=\"row2 row-center\" colspan=\"3\"><span style=\"color:' . ($chmod_errors ? $this->color_error : $this->color_ok) . ';\"><b>' . ($chmod_errors ? ($lang['CHMOD_Files_Explain_Error'] . ' ' . $lang['Confirm_Install_anyway']) : ($lang['CHMOD_Files_Explain_Ok'] . ' ' . $lang['Can_Install'])) . '</b></span></td></tr>' . \"\\n\";\n\t\t\t$table_output .= '<tr><td class=\"cat\" colspan=\"3\" align=\"center\" style=\"border-width: 0px;\">' . $s_hidden_fields . '<input class=\"mainoption\" type=\"submit\" value=\"' . ($chmod_errors ? $lang['Start_Install_Anyway'] : $lang['Start_Install']) . '\" /></td></tr>' . \"\\n\";\n\n\t\t\t$table_output .= '</table>' . \"\\n\";\n\t\t\t$table_output .= '</form>' . \"\\n\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$table_output .= '<tr><td class=\"cat\" colspan=\"3\"><span class=\"gen\"><b>&nbsp;</b></span></td></tr>' . \"\\n\";\n\t\t\t$table_output .= '</table>' . \"\\n\";\n\t\t}\n\n\t\techo($table_output);\n\t\treturn $chmod_errors;\n\t}", "public function testChmod_string()\n {\n \tfileperms($this->file); // Stat cache\n \t\n $this->Fs_Node->chmod('u=rwx,go+rw-x');\n $this->assertEquals('0766', sprintf('%04o', fileperms($this->file) & 07777));\n \n $this->Fs_Node->chmod('g-w,o-rwx');\n $this->assertEquals('0740', sprintf('%04o', fileperms($this->file) & 07777), '2nd time');\n }", "function makeWritable($filepath) {\r\n\r\n // windows\r\n if (isWindows()) {\r\n return isPathWritable($filepath);\r\n }\r\n\r\n // linux, etc\r\n else {\r\n if (is_writable($filepath)) { return true; }\r\n\r\n foreach (array('0755','0775','0777') as $mode) {\r\n @chmod($filepath, $mode);\r\n if (is_writable($filepath)) { return true; }\r\n }\r\n\r\n return false;\r\n }\r\n}", "private function setPerms($file, $isDir)\n {\n $perm = substr(sprintf(\"%o\", fileperms($file)), -4);\n $dirPermissions = \"0777\";\n $filePermissions = \"0777\";\n\n if ($isDir && $perm != $dirPermissions) {\n chmod($file, octdec($dirPermissions));\n } else if (!$isDir && $perm != $filePermissions) {\n chmod($file, octdec($filePermissions));\n }\n\n flush();\n }", "function permissions_grant ($dir, $file, $action)\n{\n\t// determine if a user has logged in\n\t$user = session_get(\"s_user\");\n\n\t// if no user is logged in, use the global permissions\n\tif (!isset($user))\n\t\treturn permissions_global($dir, $file, $action);\n\n\t// check if the user currently logged in has the given rights\n\treturn permissions_grant_user($user, $dir, $file, $action);\n}", "private function action_checkFilesWritable()\n\t{\n\t\tglobal $txt, $incontext;\n\n\t\t$incontext['page_title'] = $txt['ftp_checking_writable'];\n\t\t$incontext['sub_template'] = 'chmod_files';\n\n\t\t$extra_files= [];\n\n\t\t$writable_files = array(\n\t\t\t'attachments',\n\t\t\t'avatars',\n\t\t\t'cache',\n\t\t\t'packages',\n\t\t\t'packages/installed.list',\n\t\t\t'smileys',\n\t\t\t'themes',\n\t\t\t'db_last_error.txt',\n\t\t\t'Settings.php',\n\t\t\t'Settings_bak.php'\n\t\t);\n\t\tforeach ($incontext['detected_languages'] as $lang => $temp)\n\t\t{\n\t\t\t$extra_files[] = 'sources/ElkArte/Languages/Install/' . $lang;\n\t\t}\n\n\t\t// With mod_security installed, we could attempt to fix it with .htaccess.\n\t\tif (function_exists('apache_get_modules') && in_array('mod_security', apache_get_modules()))\n\t\t{\n\t\t\t$writable_files[] = file_exists(TMP_BOARDDIR . '/.htaccess') ? '.htaccess' : '.';\n\t\t}\n\n\t\t$failed_files = array();\n\n\t\t// On linux, it's easy - just use is_writable!\n\t\tif (substr(__FILE__, 1, 2) != ':\\\\')\n\t\t{\n\t\t\tforeach ($writable_files as $file)\n\t\t\t{\n\t\t\t\tif (!is_writable(TMP_BOARDDIR . '/' . $file))\n\t\t\t\t{\n\t\t\t\t\t@chmod(TMP_BOARDDIR . '/' . $file, 0755);\n\n\t\t\t\t\t// Well, 755 hopefully worked... if not, try 777.\n\t\t\t\t\tif (!is_writable(TMP_BOARDDIR . '/' . $file) && !@chmod(TMP_BOARDDIR . '/' . $file, 0777))\n\t\t\t\t\t{\n\t\t\t\t\t\t$failed_files[] = $file;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach ($extra_files as $file)\n\t\t\t{\n\t\t\t\t@chmod(TMP_BOARDDIR . (empty($file) ? '' : '/' . $file), 0777);\n\t\t\t}\n\t\t}\n\t\t// Windows is trickier. Let's try opening for r+...\n\t\telse\n\t\t{\n\t\t\tforeach ($writable_files as $file)\n\t\t\t{\n\t\t\t\t// Folders can't be opened for write... but the index.php in them can ;)\n\t\t\t\tif (is_dir(TMP_BOARDDIR . '/' . $file))\n\t\t\t\t{\n\t\t\t\t\t$file .= '/index.php';\n\t\t\t\t}\n\n\t\t\t\t// Funny enough, chmod actually does do something on windows - it removes the read only attribute.\n\t\t\t\t@chmod(TMP_BOARDDIR . '/' . $file, 0777);\n\t\t\t\t$fp = @fopen(TMP_BOARDDIR . '/' . $file, 'r+');\n\n\t\t\t\t// Hmm, okay, try just for write in that case...\n\t\t\t\tif (!is_resource($fp))\n\t\t\t\t{\n\t\t\t\t\t$fp = @fopen(TMP_BOARDDIR . '/' . $file, 'w');\n\t\t\t\t}\n\n\t\t\t\tif (!is_resource($fp))\n\t\t\t\t{\n\t\t\t\t\t$failed_files[] = $file;\n\t\t\t\t}\n\n\t\t\t\t@fclose($fp);\n\t\t\t}\n\t\t\tforeach ($extra_files as $file)\n\t\t\t{\n\t\t\t\t@chmod(TMP_BOARDDIR . (empty($file) ? '' : '/' . $file), 0777);\n\t\t\t}\n\t\t}\n\n\t\t$failure = count($failed_files) >= 1;\n\n\t\tif (!isset($_SERVER))\n\t\t{\n\t\t\treturn !$failure;\n\t\t}\n\n\t\t// Put the list into context.\n\t\t$incontext['failed_files'] = $failed_files;\n\n\t\t// It's not going to be possible to use FTP on windows to solve the problem...\n\t\tif ($failure && substr(__FILE__, 1, 2) == ':\\\\')\n\t\t{\n\t\t\t$incontext['error'] = $txt['error_windows_chmod'] . '\n\t\t\t\t\t\t<ul style=\"margin: 2.5ex; font-family: monospace;\">\n\t\t\t\t\t\t\t<li>' . implode('</li>\n\t\t\t\t\t\t\t<li>', $failed_files) . '</li>\n\t\t\t\t\t\t</ul>';\n\n\t\t\treturn false;\n\t\t}\n\t\t// We're going to have to use... FTP!\n\t\telseif ($failure)\n\t\t{\n\t\t\t// Load any session data we might have...\n\t\t\tif (!isset($_POST['ftp_username']) && isset($_SESSION['installer_temp_ftp']))\n\t\t\t{\n\t\t\t\t$_POST['ftp_server'] = $_SESSION['installer_temp_ftp']['server'];\n\t\t\t\t$_POST['ftp_port'] = $_SESSION['installer_temp_ftp']['port'];\n\t\t\t\t$_POST['ftp_username'] = $_SESSION['installer_temp_ftp']['username'];\n\t\t\t\t$_POST['ftp_password'] = $_SESSION['installer_temp_ftp']['password'];\n\t\t\t\t$_POST['ftp_path'] = $_SESSION['installer_temp_ftp']['path'];\n\t\t\t}\n\n\t\t\t$incontext['ftp_errors'] = array();\n\n\t\t\tif (isset($_POST['ftp_username']))\n\t\t\t{\n\t\t\t\t$ftp = new Ftp_Connection($_POST['ftp_server'], $_POST['ftp_port'], $_POST['ftp_username'], $_POST['ftp_password']);\n\n\t\t\t\tif ($ftp->error === false)\n\t\t\t\t{\n\t\t\t\t\t// Try it without /home/abc just in case they messed up.\n\t\t\t\t\tif (!$ftp->chdir($_POST['ftp_path']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$incontext['ftp_errors'][] = $ftp->last_message;\n\t\t\t\t\t\t$ftp->chdir(preg_replace('~^/home[2]?/[^/]+?~', '', $_POST['ftp_path']));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!isset($ftp) || $ftp->error !== false)\n\t\t\t{\n\t\t\t\tif (!isset($ftp))\n\t\t\t\t{\n\t\t\t\t\t$ftp = new Ftp_Connection(null);\n\t\t\t\t}\n\t\t\t\t// Save the error so we can mess with listing...\n\t\t\t\telseif ($ftp->error !== false && empty($incontext['ftp_errors']) && !empty($ftp->last_message))\n\t\t\t\t{\n\t\t\t\t\t$incontext['ftp_errors'][] = $ftp->last_message;\n\t\t\t\t}\n\n\t\t\t\tlist ($username, $detect_path, $found_path) = $ftp->detect_path(TMP_BOARDDIR);\n\n\t\t\t\tif (empty($_POST['ftp_path']) && $found_path)\n\t\t\t\t{\n\t\t\t\t\t$_POST['ftp_path'] = $detect_path;\n\t\t\t\t}\n\n\t\t\t\tif (!isset($_POST['ftp_username']))\n\t\t\t\t{\n\t\t\t\t\t$_POST['ftp_username'] = $username;\n\t\t\t\t}\n\n\t\t\t\t// Set the username etc, into context.\n\t\t\t\t$incontext['ftp'] = array(\n\t\t\t\t\t'server' => $_POST['ftp_server'] ?? 'localhost',\n\t\t\t\t\t'port' => $_POST['ftp_port'] ?? '21',\n\t\t\t\t\t'username' => $_POST['ftp_username'] ?? '',\n\t\t\t\t\t'path' => $_POST['ftp_path'] ?? '/',\n\t\t\t\t\t'path_msg' => !empty($found_path) ? $txt['ftp_path_found_info'] : $txt['ftp_path_info'],\n\t\t\t\t);\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_SESSION['installer_temp_ftp'] = array(\n\t\t\t\t\t'server' => $_POST['ftp_server'],\n\t\t\t\t\t'port' => $_POST['ftp_port'],\n\t\t\t\t\t'username' => $_POST['ftp_username'],\n\t\t\t\t\t'password' => $_POST['ftp_password'],\n\t\t\t\t\t'path' => $_POST['ftp_path']\n\t\t\t\t);\n\n\t\t\t\t$failed_files_updated = array();\n\n\t\t\t\tforeach ($failed_files as $file)\n\t\t\t\t{\n\t\t\t\t\tif (!is_writable(TMP_BOARDDIR . '/' . $file))\n\t\t\t\t\t{\n\t\t\t\t\t\t$ftp->chmod($file, 0755);\n\t\t\t\t\t}\n\t\t\t\t\tif (!is_writable(TMP_BOARDDIR . '/' . $file))\n\t\t\t\t\t{\n\t\t\t\t\t\t$ftp->chmod($file, 0777);\n\t\t\t\t\t}\n\t\t\t\t\tif (!is_writable(TMP_BOARDDIR . '/' . $file))\n\t\t\t\t\t{\n\t\t\t\t\t\t$failed_files_updated[] = $file;\n\t\t\t\t\t\t$incontext['ftp_errors'][] = rtrim($ftp->last_message) . ' -> ' . $file . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$ftp->close();\n\n\t\t\t\t// Are there any errors left?\n\t\t\t\tif (count($failed_files_updated) >= 1)\n\t\t\t\t{\n\t\t\t\t\t// Guess there are...\n\t\t\t\t\t$incontext['failed_files'] = $failed_files_updated;\n\n\t\t\t\t\t// Set the username etc, into context.\n\t\t\t\t\t$incontext['ftp'] = $_SESSION['installer_temp_ftp'] += array(\n\t\t\t\t\t\t'path_msg' => $txt['ftp_path_info'],\n\t\t\t\t\t);\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function changeMode($files, $mode, $umask = 0000, $recursive = false);", "public static function unix_file_permissions($file)\n\t{\n\t\tif(!file_exists($file)) {\n\t\t\treturn false;\n\t\t}\n\t\t$perms = sprintf('%o', fileperms($file));\n\t\tif ( substr($perms, 0, 2) == '40' ) {\n\t\t\t$perms = substr($perms, 1, 4);\n\t\t} elseif ( substr($perms, 0, 2) == '10' ) {\n\t\t\t$perms = substr($perms, 2, 4);\n\t\t}\n\t\treturn $perms;\n\t}", "public function getExpectedFilePermission($file = '')\n {\n global $options;\n\n switch ($file) {\n default:\n if ($this->getComplex('xlite.suMode') == 0) {\n $mode = isset($options['filesystem_permissions']['nonprivileged_permission_file'])\n ? base_convert($options['filesystem_permissions']['nonprivileged_permission_file'], 8, 10)\n : 0644;\n\n } else {\n $mode = isset($options['filesystem_permissions']['privileged_permission_file'])\n ? base_convert($options['filesystem_permissions']['privileged_permission_file'], 8, 10)\n : 0600;\n }\n break;\n }\n\n return $mode;\n }", "public static function permissions($mixed)\n {\n // Detect input type\n if (is_string($mixed)) {\n\n // Get the file permissions\n $octal = self::octal($mixed);\n } else {\n // Already in octal format (hopefully)\n $octal = $mixed;\n }\n\n // Begin symbolic processing\n if (($octal & 0xC000) === 0xC000) {\n\n // Socket\n $permissions = 's';\n } elseif (($octal & 0xA000) === 0xA000) {\n\n // Symbolic Link\n $permissions = 'l';\n } elseif (($octal & 0x8000) === 0x8000) {\n\n // Regular\n $permissions = '-';\n } elseif (($octal & 0x6000) === 0x6000) {\n\n // Block special\n $permissions = 'b';\n } elseif (($octal & 0x4000) === 0x4000) {\n\n // Directory\n $permissions = 'd';\n } elseif (($octal & 0x2000) === 0x2000) {\n\n // Character special\n $permissions = 'c';\n } elseif (($octal & 0x1000) === 0x1000) {\n\n // FIFO pipe\n $permissions = 'p';\n } else {\n // Unknown\n $permissions = 'u';\n }\n\n // Get the Owner Permissions\n $permissions .=\n\n // Readable\n (($octal & 0x0100) ? 'r' : '-')\n\n // Writeable\n .(($octal & 0x0080) ? 'w' : '-')\n\n // Other\n .(($octal & 0x0040) ?\n\n // Executable\n (($octal & 0x0800) ? 's' : 'x') :\n\n // Special\n (($octal & 0x0800) ? 'S' : '-'));\n\n // Get the Group Permissions\n $permissions .=\n\n // Readable\n (($octal & 0x0020) ? 'r' : '-')\n\n // Writeable\n .(($octal & 0x0010) ? 'w' : '-')\n\n // Other\n .(($octal & 0x0008) ?\n\n // Executable\n (($octal & 0x0400) ? 's' : 'x') :\n\n // Special\n (($octal & 0x0400) ? 'S' : '-'));\n\n // Get the World Permissions\n $permissions .=\n\n // Readable\n (($octal & 0x0004) ? 'r' : '-')\n\n // Writeable\n .(($octal & 0x0002) ? 'w' : '-')\n\n // Other\n .(($octal & 0x0001) ?\n\n // Executable\n (($octal & 0x0200) ? 't' : 'x') :\n\n // Sticky\n (($octal & 0x0200) ? 'T' : '-'));\n\n // Return full (linux style) permissions\n return $permissions;\n }", "function _chmod($file, $perms)\n\t{\n\t\t// Unfortunatly CHMOD is not expecting an octal value...\n\t\t// We need to transform the integer (which was an octal) to an octal representation (to get the int) and then pass as is. ;)\n\t\treturn $this->_send_command('SITE CHMOD', base_convert($perms, 10, 8) . ' ' . $file);\n\t}", "private function _makeDirPermissions($permissions) {\r\n\t\t$permissions = (string) $permissions;\r\n\t\t\r\n\t\t// going through (user, group, world)\r\n\t\tfor ( $i = 0; $i < strlen($permissions); $i++ ) {\r\n\t\t\t// Read permission is set but execute not yet\r\n\t\t\tif ( (int) $permissions{$i} & 4 and !((int) $permissions{$i} & 1) ) {\r\n\t\t\t\t// Adding execute flag\r\n\t\t\t\t(int) $permissions{$i} = (int) $permissions{$i} + 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn (string) $permissions;\r\n\t}\r\n\r\n\t/**\r\n\t * This will return the last modification-time of a file. You can either give\r\n\t * this function a relative or an absolute path to the file to check.\r\n\t * NOTE: Some servers will not support this feature and the function works\r\n\t * only on files, not directories! When successful,\r\n\t * it will return the last modification-time as a unix-timestamp or, when\r\n\t * $format is specified, a preformated timestring.\r\n\t *\r\n\t * @param string $file The file to check\r\n\t * @param string $format (optional) The format to give the date back \r\n\t * if not set, it will return a Unix timestamp\r\n\t *\r\n\t * @access public\r\n\t * @return mixed Unix timestamp, a preformated date-string\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction mdtm($file, $format = null) {\r\n\t\t$file = $this->_constructPath($file);\r\n\t\tif ( $this->_checkRemoteDir($file) !== false ) {\r\n\t\t\tthrow new ftpMdtmException(\"Filename '$file' seems to be a directory.\");\r\n\t\t}\r\n\t\t$res = @ftp_mdtm($this->_handle, $file);\r\n\t\tif ( $res == -1 ) {\r\n\t\t\tthrow new ftpMdtmException(\"Could not get last-modification-date of '\" . $file . \"'.\");\r\n\t\t}\r\n\t\tif ( $format !== null ) {\r\n\t\t\t$res = date($format, $res);\r\n\t\t\tif ( !$res ) {\r\n\t\t\t\tthrow new ftpMdtmException(\"Date-format failed on timestamp '\" . $res . \"'.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $res;\r\n\t}\r\n\r\n\t/**\r\n\t * This will return the size of a given file in bytes. You can either give this\r\n\t * function a relative or an absolute file-path. NOTE: Some servers do not\r\n\t * support this feature!\r\n\t *\r\n\t * @param string $file The file to check\r\n\t *\r\n\t * @access public\r\n\t * @return mixed Size in bytes\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction size($file) {\r\n\t\t$file = $this->_constructPath($file);\r\n\t\t$res = @ftp_size($this->_handle, $file);\r\n\t\tif ( $res == -1 ) {\r\n\t\t\tthrow new ftpSizeException($file);\r\n\t\t} else {\r\n\t\t\treturn $res;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This method returns a directory-list of the current directory or given one.\r\n\t * To display the current selected directory, simply set the first parameter to\r\n\t * null\r\n\t * or leave it blank, if you do not want to use any other parameters.\r\n\t * <br><br>\r\n\t * There are 4 different modes of listing directories. Either to list only\r\n\t * the files (using ftpClient::LS_MODE_FILES_ONLY), to list only directories\r\n\t * (using ftpClient::LS_MODE_DIRS_ONLY) or to show both (using\r\n\t * ftpClient::LS_MODE_DIRS_FILES, which is default).\r\n\t * <br><br>\r\n\t * The 4th one is the ftpClient::LS_MODE_RAW_LIST, which returns just the array\r\n\t * created by the ftp_rawlist() - function built into PHP.\r\n\t * <br><br>\r\n\t * The other function-modes will return an array containing the requested data.\r\n\t * The files and dirs are listed in human-sorted order, but if you select\r\n\t * ftpClient::LS_MODE_DIRS_FILES the directories will be added above the files,\r\n\t * although both sorted.\r\n\t * <br><br>\r\n\t * All elements in the arrays are associative arrays themselves. They have the\r\n\t * following structure:\r\n\t * <br><br>\r\n\t * Dirs:<br>\r\n\t * [\"name\"] => string The name of the directory<br>\r\n\t * [\"rights\"] => string The rights of the directory (in style\r\n\t * \"rwxr-xr-x\")<br>\r\n\t * [\"user\"] => string The owner of the directory<br>\r\n\t * [\"group\"] => string The group-owner of the directory<br>\r\n\t * [\"files_inside\"]=> string The number of files/dirs inside the\r\n\t * directory excluding \".\" and \"..\"<br>\r\n\t * [\"date\"] => int The creation-date as Unix timestamp<br>\r\n\t * [\"is_dir\"] => bool true, cause this is a dir<br>\r\n\t * <br><br>\r\n\t * Files:<br>\r\n\t * [\"name\"] => string The name of the file<br>\r\n\t * [\"size\"] => int Size in bytes<br>\r\n\t * [\"rights\"] => string The rights of the file (in style \r\n\t * \"rwxr-xr-x\")<br>\r\n\t * [\"user\"] => string The owner of the file<br>\r\n\t * [\"group\"] => string The group-owner of the file<br>\r\n\t * [\"date\"] => int The creation-date as Unix timestamp<br>\r\n\t * [\"is_dir\"] => bool false, cause this is a file<br>\r\n\t *\r\n\t * @param string $dir (optional) The directory to list or null for current\r\n\t * @param int $mode (optional) List files, dirs or both.\r\n\t *\r\n\t * @access public\r\n\t * @return mixed The directory list as described above\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction ls($dir = null, $mode = self::LS_MODE_DIRS_FILES) {\r\n\t\tif ( $dir === null ) {\r\n\t\t\t$dir = $this->pwd();\r\n\t\t}\r\n\t\tif ( ($mode != self::LS_MODE_FILES_ONLY) && ($mode != self::LS_MODE_DIR_ONLY) && ($mode != self::LS_MODE_RAWLIST) ) {\r\n\t\t\t$mode = self::LS_MODE_DIRS_FILES;\r\n\t\t}\r\n\t\t\r\n\t\tswitch ( $mode ) {\r\n\t\t\tcase self::LS_MODE_DIRS_FILES :\r\n\t\t\t\t$res = $this->_lsBoth($dir);\r\n\t\t\t\tbreak;\r\n\t\t\tcase self::LS_MODE_DIR_ONLY :\r\n\t\t\t\t$res = $this->_lsDirs($dir);\r\n\t\t\t\tbreak;\r\n\t\t\tcase self::LS_MODE_FILES_ONLY :\r\n\t\t\t\t$res = $this->_lsFiles($dir);\r\n\t\t\t\tbreak;\r\n\t\t\tcase self::LS_MODE_RAWLIST :\r\n\t\t\t\t$res = @ftp_rawlist($this->_handle, $dir);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn $res;\r\n\t}\r\n\r\n\t/**\r\n\t * This method will delete the given file or directory ($path) from the server\r\n\t * (maybe recursive).\r\n\t *\r\n\t * Whether the given string is a file or directory is only determined by the\r\n\t * last sign inside the string (\"/\" or not).\r\n\t *\r\n\t * If you specify a directory, you can optionally specify $recursive as true,\r\n\t * to let the directory be deleted recursive (with all sub-directories and files\r\n\t * inherited).\r\n\t *\r\n\t * You can either give a absolute or relative path for the file / dir. If you\r\n\t * choose to use the relative path, it will be automatically completed with the\r\n\t * actual selected directory.\r\n\t *\r\n\t * @param string $path The absolute or relative path to the file/directory.\r\n\t * @param bool $recursive Recursively delete everything in $path\r\n\t * @param bool $filesonly Only delete the files, leaving directories\r\n\t *\r\n\t * @access public\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction rm($path, $recursive = false, $filesonly = false) {\r\n\t\t$path = $this->_constructPath($path);\r\n\t\tif ( $this->_checkRemoteDir($path) === true ) {\r\n\t\t\tif ( $recursive ) {\r\n\t\t\t\treturn $this->_rmDirRecursive($path, $filesonly);\r\n\t\t\t} else {\r\n\t\t\t\treturn $this->_rmDir($path);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn $this->_rmFile($path);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This function will download a file from the ftp-server.\r\n\t * \r\n\t * You can either specify an absolute path to the file (beginning with \"/\") or\r\n\t * a relative one, which will be completed with the actual directory you\r\n\t * selected on the server. You can specify the path to which the file will be\r\n\t * downloaded on the local machine, if the file should be overwritten if it\r\n\t * exists (optionally, default is no overwriting) and in which mode (FTP_ASCII\r\n\t * or FTP_BINARY) the file should be downloaded (if you do not specify this,\r\n\t * the method tries to determine it automatically from the mode-directory or\r\n\t * uses the default-mode, set by you).\r\n\t * \r\n\t * If you give a relative path to the local-file, the script-path is used as\r\n\t * basepath.\r\n\t *\r\n\t * @param string $remote_file The absolute or relative path to the file\r\n\t * @param string $local_file The local file to put the downloaded in\r\n\t * @param bool $overwrite (optional) Whether to overwrite existing file\r\n\t * @param int $mode (optional) Either FTP_ASCII or FTP_BINARY\r\n\t *\r\n\t * @access public\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction get($remote_file, $local_file, $overwrite = false, $mode = null) {\r\n\t\tif ( $mode === null ) {\r\n\t\t\t$mode = $this->checkFileExtension($remote_file);\r\n\t\t}\r\n\t\t\r\n\t\t$remote_file = $this->_constructPath($remote_file);\r\n\t\t\r\n\t\tif ( @file_exists($local_file) && !$overwrite ) {\r\n\t\t\tthrow new ftpGetLocalFileExistsException($local_file);\r\n\t\t}\r\n\t\tif ( @file_exists($local_file) && !@is_writeable($local_file) && $overwrite ) {\r\n\t\t\tthrow new ftpGetLocalFileNotWritableException($local_file);\r\n\t\t}\r\n\t\t\r\n\t\tif ( @function_exists('ftp_nb_get') ) {\r\n\t\t\t$res = @ftp_nb_get($this->_handle, $local_file, $remote_file, $mode);\r\n\t\t\twhile ( $res == FTP_MOREDATA ) {\r\n\t\t\t\t$this->notify('nb_get');\r\n\t\t\t\t$res = @ftp_nb_continue($this->_handle);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$res = @ftp_get($this->_handle, $local_file, $remote_file, $mode);\r\n\t\t}\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpGetException(\"File '\" . $remote_file . \"' could not be downloaded to '$local_file'.\");\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This function will upload a file to the ftp-server.\r\n\t * \r\n\t * You can either specify a absolute path to the remote-file (beginning with \"/\")\r\n\t * or a relative one, which will be completed with the actual directory you\r\n\t * selected on the server. You can specify the path from which the file will be\r\n\t * uploaded on the local maschine, if the file should be overwritten if it exists\r\n\t * (optionally, default is no overwriting) and in which mode (FTP_ASCII or\r\n\t * FTP_BINARY) the file should be downloaded (if you do not specify this, the\r\n\t * method tries to determine it automatically from the mode-directory or uses the\r\n\t * default-mode, set by you).\r\n\t * \r\n\t * If you give a relative path to the local-file, the script-path is used as\r\n\t * basepath.\r\n\t *\r\n\t * @param string $local_file The local file to upload\r\n\t * @param string $remote_file The absolute or relative path to the file to upload to\r\n\t * @param bool $overwrite (optional) Whether to overwrite existing file\r\n\t * @param int $mode (optional) Either FTP_ASCII or FTP_BINARY\r\n\t * @param int $options (optional) ftpClient::(PUT_BLOCKING | PUT_NONBLOCKING)\r\n\t *\r\n\t * @access public\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction put($local_file, $remote_file, $overwrite = false, $mode = null, $options = 0) {\r\n\t\tif ( $options & (self::PUT_BLOCKING | self::PUT_NONBLOCKING) === (self::PUT_BLOCKING | self::PUT_NONBLOCKING) ) {\r\n\t\t\tthrow new ftpPutOptionsException();\r\n\t\t}\r\n\t\t\r\n\t\t$usenb = !($options & (self::PUT_BLOCKING == self::PUT_BLOCKING));\r\n\t\t\r\n\t\tif ( !isset($mode) ) {\r\n\t\t\t$mode = $this->checkFileExtension($local_file);\r\n\t\t}\r\n\t\t$remote_file = $this->_constructPath($remote_file);\r\n\t\t\r\n\t\tif ( !@file_exists($local_file) ) {\r\n\t\t\tthrow new ftpPutLocalFileDoesNotExistException($local_file);\r\n\t\t}\r\n\t\tif ( (@ftp_size($this->_handle, $remote_file) != -1) && !$overwrite ) {\r\n\t\t\tthrow new ftpPutRemoteFileExistsNoOverwriteException($remote_file);\r\n\t\t}\r\n\t\t\r\n\t\tif ( function_exists('ftp_alloc') ) {\r\n\t\t\tftp_alloc($this->_handle, filesize($local_file));\r\n\t\t}\r\n\t\tif ( $usenb && function_exists('ftp_nb_put') ) {\r\n\t\t\t$res = @ftp_nb_put($this->_handle, $remote_file, $local_file, $mode);\r\n\t\t\twhile ( $res == FTP_MOREDATA ) {\r\n\t\t\t\t$this->notify('nb_put');\r\n\t\t\t\t$res = @ftp_nb_continue($this->_handle);\r\n\t\t\t}\r\n\t\t\r\n\t\t} else {\r\n\t\t\t$res = @ftp_put($this->_handle, $remote_file, $local_file, $mode);\r\n\t\t}\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpPutException(\"File '$local_file' could not be uploaded to '\" . $remote_file . \"'.\");\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This functionality allows you to transfer a whole directory-structure from\r\n\t * the remote-ftp to your local host. You have to give a remote-directory\r\n\t * (ending with '/') and the local directory (ending with '/') where to put the\r\n\t * files you download.\r\n\t * The remote path is automatically completed with the current-remote-dir, if\r\n\t * you give a relative path to this function. You can give a relative path for\r\n\t * the $local_path, too. Then the script-basedir will be used for comletion of\r\n\t * the path.\r\n\t * The parameter $overwrite will determine, whether to overwrite existing files\r\n\t * or not. Standard for this is false. Fourth you can explicitly set a mode for\r\n\t * all transfer actions done. If you do not set this, the method tries to\r\n\t * determine the transfer mode by checking your mode-directory for the file\r\n\t * extension. If the extension is not inside the mode-directory, it will get\r\n\t * your default mode.\r\n\t * \r\n\t * Since 1.4 no error will be returned when a file exists while $overwrite is \r\n\t * set to false. \r\n\t *\r\n\t * @param string $remote_path The path to download\r\n\t * @param string $local_path The path to download to\r\n\t * @param bool $overwrite (optional) Whether to overwrite existing files\r\n\t * (true) or not (false, standard).\r\n\t * @param int $mode (optional) The transfermode (either FTP_ASCII or\r\n\t * FTP_BINARY).\r\n\t *\r\n\t * @access public\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction getRecursive($remote_path, $local_path, $overwrite = false, $mode = null) {\r\n\t\t$remote_path = $this->_constructPath($remote_path);\r\n\t\tif ( $this->_checkRemoteDir($remote_path) !== true ) {\r\n\t\t\tthrow new ftpGetRecursiveException(\"Given remote-path '$remote_path' seems not to be a directory.\");\r\n\t\t}\r\n\t\t\r\n\t\tif ( !@file_exists($local_path) ) {\r\n\t\t\t$res = @mkdir($local_path);\r\n\t\t\tif ( !$res ) {\r\n\t\t\t\tthrow new ftpGetRecursiveException(\"Could not create dir '$local_path'\");\r\n\t\t\t}\r\n\t\t} elseif ( !@is_dir($local_path) ) {\r\n\t\t\tthrow new ftpGetRecursiveException(\"Given local-path '$local_path' seems not to be a directory.\");\r\n\t\t}\r\n\t\t\r\n\t\t$dir_list = array();\r\n\t\t$dir_list = $this->ls($remote_path, self::LS_MODE_DIR_ONLY);\r\n\t\t\r\n\t\tforeach ( $dir_list as $dir_entry ) {\r\n\t\t\tif ( $dir_entry['name'] != '.' && $dir_entry['name'] != '..' ) {\r\n\t\t\t\t$remote_path_new = $remote_path . $dir_entry[\"name\"] . \"/\";\r\n\t\t\t\t$local_path_new = $local_path . $dir_entry[\"name\"] . \"/\";\r\n\t\t\t\t$result = $this->getRecursive($remote_path_new, $local_path_new, $overwrite, $mode);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$file_list = array();\r\n\t\t$file_list = $this->ls($remote_path, self::LS_MODE_FILES_ONLY);\r\n\t\t\r\n\t\tforeach ( $file_list as $file_entry ) {\r\n\t\t\t$remote_file = $remote_path . $file_entry[\"name\"];\r\n\t\t\t$local_file = $local_path . $file_entry[\"name\"];\r\n\t\t\t$result = $this->get($remote_file, $local_file, $overwrite, $mode);\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * This functionality allows you to transfer a whole directory-structure from\r\n\t * your local host to the remote-ftp. You have to give a remote-directory\r\n\t * (ending with '/') and the local directory (ending with '/') where to put the\r\n\t * files you download. The remote path is automatically completed with the\r\n\t * current-remote-dir, if you give a relative path to this function. You can\r\n\t * give a relative path for the $local_path, too. Then the script-basedir will\r\n\t * be used for comletion of the path.\r\n\t * The parameter $overwrite will determine, whether to overwrite existing files\r\n\t * or not.\r\n\t * Standard for this is false. Fourth you can explicitly set a mode for all\r\n\t * transfer actions done. If you do not set this, the method tries to determine\r\n\t * the transfer mode by checking your mode-directory for the file-extension. If\r\n\t * the extension is not inside the mode-directory, it will get your default\r\n\t * mode.\r\n\t *\r\n\t * @param string $local_path The path to download to\r\n\t * @param string $remote_path The path to download\r\n\t * @param bool $overwrite (optional) Whether to overwrite existing files\r\n\t * (true) or not (false, standard).\r\n\t * @param int $mode (optional) The transfermode (either FTP_ASCII or\r\n\t * FTP_BINARY).\r\n\t *\r\n\t * @access public\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction putRecursive($local_path, $remote_path, $overwrite = false, $mode = null) {\r\n\t\t$remote_path = $this->_constructPath($remote_path);\r\n\t\tif ( !file_exists($local_path) || !is_dir($local_path) ) {\r\n\t\t\tthrow new ftpPutRecursiveException(\"Given local-path '$local_path' seems not to be a directory.\");\r\n\t\t}\r\n\t\t// try to create directory if it doesn't exist\r\n\t\t$old_path = $this->pwd();\r\n\t\ttry {\r\n\t\t\t$this->cd($remote_path);\r\n\t\t} catch ( ftpException $e ) {\r\n\t\t\t$res = $this->mkdir($remote_path);\r\n\t\t}\r\n\t\t\r\n\t\t$this->cd($old_path);\r\n\t\tif ( $this->_checkRemoteDir($remote_path) !== true ) {\r\n\t\t\tthrow new ftpPutRecursiveException(\"Given remote-path '$remote_path' seems not to be a directory.\");\r\n\t\t}\r\n\t\t$dir_list = $this->_lsLocal($local_path);\r\n\t\tforeach ( $dir_list[\"dirs\"] as $dir_entry ) {\r\n\t\t\t// local directories do not have arrays as entry\r\n\t\t\t$remote_path_new = $remote_path . $dir_entry . \"/\";\r\n\t\t\t$local_path_new = $local_path . $dir_entry . \"/\";\r\n\t\t\t$result = $this->putRecursive($local_path_new, $remote_path_new, $overwrite, $mode);\r\n\t\t}\r\n\t\t\r\n\t\tforeach ( $dir_list[\"files\"] as $file_entry ) {\r\n\t\t\t$remote_file = $remote_path . $file_entry;\r\n\t\t\t$local_file = $local_path . $file_entry;\r\n\t\t\t$result = $this->put($local_file, $remote_file, $overwrite, $mode);\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * This checks, whether a file should be transfered in ascii- or binary-mode\r\n\t * by it's file-extension. If the file-extension is not set or\r\n\t * the extension is not inside one of the extension-dirs, the actual set\r\n\t * transfer-mode is returned.\r\n\t *\r\n\t * @param string $filename The filename to be checked\r\n\t *\r\n\t * @access public\r\n\t * @return int Either FTP_ASCII or FTP_BINARY\r\n\t */\r\n\tfunction checkFileExtension($filename) {\r\n\t\tif ( ($pos = strrpos($filename, '.')) === false ) {\r\n\t\t\treturn $this->getMode();\r\n\t\t} else {\r\n\t\t\t$ext = substr($filename, $pos + 1);\r\n\t\t}\r\n\t\t\r\n\t\tif ( isset($this->_file_extensions[$ext]) ) {\r\n\t\t\treturn $this->_file_extensions[$ext];\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->getMode();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the baseOptionsSet object\r\n\t *\r\n\t * @return baseOptionsSet\r\n\t */\r\n\tfunction getOptionsSet() {\r\n\t\tif ( !$this->_OptionsSet instanceof baseOptionsSet ) {\r\n\t\t\t$this->_OptionsSet = new baseOptionsSet();\r\n\t\t}\r\n\t\treturn $this->_OptionsSet;\r\n\t}\r\n\r\n\t/**\r\n\t * Set a new options set object over the current one\r\n\t *\r\n\t * @param baseOptionsSet $inOptionsSet\r\n\t * @return ftpClient\r\n\t */\r\n\tfunction setOptionsSet($inOptionsSet) {\r\n\t\tif ( $inOptionsSet !== $this->_OptionsSet ) {\r\n\t\t\t$this->_OptionsSet = $inOptionsSet;\r\n\t\t}\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the hostname\r\n\t *\r\n\t * @param string $host The hostname to set\r\n\t * @return ftpClient\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction setHostname($host) {\r\n\t\tif ( !is_string($host) ) {\r\n\t\t\tthrow new ftpException(\"Hostname must be a string\");\r\n\t\t}\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_HOSTNAME => $host));\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the Port\r\n\t *\r\n\t * @param int $port The port to set\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction setPort($port) {\r\n\t\tif ( !is_int($port) || ($port < 0) || ($port > 65535) ) {\r\n\t\t\tthrow new ftpException(\"Invalid port. Has to be integer > 0\");\r\n\t\t}\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_PORT => $port));\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the Username\r\n\t *\r\n\t * @param string $user The username to set\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction setUsername($user) {\r\n\t\tif ( empty($user) || !is_string($user) ) {\r\n\t\t\tthrow new ftpException(\"Username $user invalid\");\r\n\t\t}\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_USERNAME => $user));\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the password\r\n\t *\r\n\t * @param string $password The password to set\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction setPassword($password) {\r\n\t\tif ( empty($password) || !is_string($password) ) {\r\n\t\t\tthrow new ftpException(\"Password cannot be empty\");\r\n\t\t}\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_PASSWORD => $password));\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the transfer-mode. You can use the predefined constants\r\n\t * FTP_ASCII or FTP_BINARY. The mode will be stored for any further transfers.\r\n\t *\r\n\t * @param int $mode The mode to set\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction setMode($mode) {\r\n\t\tif ( ($mode == FTP_ASCII) || ($mode == FTP_BINARY) ) {\r\n\t\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_TRANSFER_MODE => $mode));\r\n\t\t\treturn $this;\r\n\t\t} else {\r\n\t\t\tthrow new ftpException('FTP-Mode has either to be FTP_ASCII or FTP_BINARY');\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Set the transfer-method to passive mode\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t */\r\n\tfunction setPassive() {\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_TRANSFER_METHOD => self::TRANSFER_METHOD_PASSIVE));\r\n\t\t@ftp_pasv($this->_handle, true);\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the transfer-method to active mode\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t */\r\n\tfunction setActive() {\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_TRANSFER_METHOD => self::TRANSFER_METHOD_ACTIVE));\r\n\t\t@ftp_pasv($this->_handle, false);\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the timeout for FTP operations\r\n\t *\r\n\t * Use this method to set a timeout for FTP operation. Timeout has to be an\r\n\t * integer.\r\n\t *\r\n\t * @param int $timeout the timeout to use\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction setTimeout($timeout = 0) {\r\n\t\tif ( !is_int($timeout) || ($timeout < 0) ) {\r\n\t\t\tthrow new ftpException('Timeout '.$timeout.' is invalid, has to be an integer >= 0');\r\n\t\t}\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_TIMEOUT => $timeout));\r\n\t\tif ( isset($this->_handle) && is_resource($this->_handle) ) {\r\n\t\t\t$res = @ftp_set_option($this->_handle, FTP_TIMEOUT_SEC, $timeout);\r\n\t\t} else {\r\n\t\t\t$res = true;\r\n\t\t}\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpException(\"Set timeout failed.\");\r\n\t\t}\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Adds an extension to a mode-directory\r\n\t *\r\n\t * The mode-directory saves file-extensions coresponding to filetypes\r\n\t * (ascii e.g.: 'php', 'txt', 'htm',...; binary e.g.: 'jpg', 'gif', 'exe',...).\r\n\t * The extensions have to be saved without the '.'. And\r\n\t * can be predefined in an external file (see: getExtensionsFile()).\r\n\t *\r\n\t * The array is build like this: 'php' => FTP_ASCII, 'png' => FTP_BINARY\r\n\t *\r\n\t * To change the mode of an extension, just add it again with the new mode!\r\n\t *\r\n\t * @param int $mode Either FTP_ASCII or FTP_BINARY\r\n\t * @param string $ext Extension\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t */\r\n\tfunction addExtension($mode, $ext) {\r\n\t\t$this->_file_extensions[$ext] = $mode;\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * This function removes an extension from the mode-directories \r\n\t * (described above).\r\n\t *\r\n\t * @param string $ext The extension to remove\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t */\r\n\tfunction removeExtension($ext) {\r\n\t\tif ( isset($this->_file_extensions[$ext]) ) {\r\n\t\t\tunset($this->_file_extensions[$ext]);\r\n\t\t}\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * This get's both (ascii- and binary-mode-directories) from the given file.\r\n\t * Beware, if you read a file into the mode-directory, all former set values \r\n\t * will be unset!\r\n\t * \r\n\t * Example file contents:\r\n\t * [ASCII]\r\n\t * asc = 0\r\n\t * txt = 0\r\n\t * [BINARY]\r\n\t * bin = 1\r\n\t * jpg = 1\r\n\t *\r\n\t * @param string $filename The file to get from\r\n\t *\r\n\t * @access public\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction getExtensionsFile($filename) {\r\n\t\tif ( !file_exists($filename) ) {\r\n\t\t\tthrow new ftpException(\"Extensions-file '$filename' does not exist\");\r\n\t\t}\r\n\t\tif ( !is_readable($filename) ) {\r\n\t\t\tthrow new ftpException(\"Extensions-file '$filename' is not readable\");\r\n\t\t}\r\n\t\t\r\n\t\t$exts = @parse_ini_file($filename, true);\r\n\t\tif ( !is_array($exts) ) {\r\n\t\t\tthrow new ftpException(\"Extensions-file '$filename' could not be loaded\");\r\n\t\t}\r\n\t\t\r\n\t\t$this->_file_extensions = array();\r\n\t\t\r\n\t\tif ( isset($exts['ASCII']) ) {\r\n\t\t\tforeach ( $exts['ASCII'] as $ext => $bogus ) {\r\n\t\t\t\t$this->_file_extensions[$ext] = FTP_ASCII;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ( isset($exts['BINARY']) ) {\r\n\t\t\tforeach ( $exts['BINARY'] as $ext => $bogus ) {\r\n\t\t\t\t$this->_file_extensions[$ext] = FTP_BINARY;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the hostname\r\n\t *\r\n\t * @access public\r\n\t * @return string The hostname\r\n\t */\r\n\tfunction getHostname() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_HOSTNAME);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the port\r\n\t *\r\n\t * @access public\r\n\t * @return int The port\r\n\t */\r\n\tfunction getPort() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_PORT, 21);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the username\r\n\t *\r\n\t * @access public\r\n\t * @return string The username\r\n\t */\r\n\tfunction getUsername() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_USERNAME);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the password\r\n\t *\r\n\t * @access public\r\n\t * @return string The password\r\n\t */\r\n\tfunction getPassword() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_PASSWORD);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the transfermode, default FTP_ASCII\r\n\t *\r\n\t * @access public\r\n\t * @return int The transfermode, either FTP_ASCII or FTP_BINARY.\r\n\t */\r\n\tfunction getMode() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_TRANSFER_MODE, FTP_ASCII);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns, whether the connection is set to passive mode or not\r\n\t *\r\n\t * @access public\r\n\t * @return bool True if passive, false if active mode\r\n\t */\r\n\tfunction isPassive() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_TRANSFER_METHOD, self::TRANSFER_METHOD_PASSIVE);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the mode set for a file-extension\r\n\t *\r\n\t * @param string $ext The extension you wanna ask for\r\n\t *\r\n\t * @return int Either FTP_ASCII, FTP_BINARY or NULL (if not set a mode for it)\r\n\t * @access public\r\n\t */\r\n\tfunction getExtensionMode($ext) {\r\n\t\tif ( array_key_exists($ext, $this->_file_extensions) ) {\r\n\t\t\treturn $this->_file_extensions[$ext];\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the current timeout value, defaulting to 20 seconds\r\n\t *\r\n\t * @return integer\r\n\t */\r\n\tfunction getTimeoutOption() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_TIMEOUT, 20);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the actual timeout set on the current connection.\r\n\t *\r\n\t * @access public\r\n\t * @return int The actual timeout\r\n\t */\r\n\tfunction getTimeout() {\r\n\t\treturn ftp_get_option($this->_handle, FTP_TIMEOUT_SEC);\r\n\t}\r\n\r\n\t/**\r\n\t * Adds a ftpClientObserver instance to the list of observers \r\n\t * that are listening for messages emitted by this Net_FTP instance.\r\n\t *\r\n\t * @param ftpClientObserver $observer\r\n\t * @return boolean True if the observer is successfully attached.\r\n\t * @access public\r\n\t */\r\n\tfunction attach(ftpClientObserver $observer) {\r\n\t\t$this->_listeners[$observer->getId()] = $observer;\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Removes a ftpClientObserver instance from the list of observers.\r\n\t *\r\n\t * @param ftpClientObserver $observer\r\n\t * @return boolean True if the observer is successfully detached.\r\n\t * @access public\r\n\t */\r\n\tfunction detach(ftpClientObserver $observer) {\r\n\t\tif ( !isset($this->_listeners[$observer->getId()]) ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tunset($this->_listeners[$observer->getId()]);\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\t/**\r\n\t * Returns true if $observer is a currently attached listener \r\n\t *\r\n\t * @param ftpClientObserver $observer\r\n\t * @return boolean\r\n\t */\r\n\tfunction isAttached(ftpClientObserver $observer) {\r\n\t\tif ( isset($this->_listeners[$observer->getId()]) ) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t/**\r\n\t * Informs each registered observer instance that a new message has been\r\n\t * sent. \r\n\t * \r\n\t * @param mixed $event A hash describing the net event.\r\n\t * @return void\r\n\t */\r\n\tfunction notify($event) {\r\n\t\tif ( count($this->_listeners) > 0 ) {\r\n\t\t\tif ( false ) $listener = new ftpClientObserver();\r\n\t\t\tforeach ( $this->_listeners as $id => $listener ) {\r\n\t\t\t\t$listener->notify($event);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t/**\r\n\t * Sets the directory listing matcher\r\n\t *\r\n\t * Use this method to set the directory listing matcher to a specific pattern.\r\n\t * Indicate the pattern as a perl regular expression and give an array\r\n\t * containing as keys the fields selected in the regular expression and as\r\n\t * values the offset of the subpattern in the pattern.\r\n\t *\r\n\t * Example:\r\n\t * $pattern = '/(?:(d)|.)([rwxt-]+)\\s+(\\w+)\\s+([\\w\\d-]+)\\s+([\\w\\d-]+)\\s+(\\w+)\r\n\t * \\s+(\\S+\\s+\\S+\\s+\\S+)\\s+(.+)/',\r\n\t * $matchmap = array(\r\n\t * 'is_dir' => 1,\r\n\t * 'rights' => 2,\r\n\t * 'files_inside' => 3,\r\n\t * 'user' => 4,\r\n\t * 'group' => 5,\r\n\t * 'size' => 6,\r\n\t * 'date' => 7,\r\n\t * 'name' => 8,\r\n\t * )\r\n\t *\r\n\t * Make sure at least the is_dir and name keys are set. The is_dir key should\r\n\t * point to a subpattern that is empty for non-directories and non-empty\r\n\t * for directories.\r\n\t *\r\n\t * @param string $pattern The new matcher pattern to use\r\n\t * @param array $matchmap An mapping from key to subpattern offset\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction setDirMatcher($pattern, $matchmap) {\r\n\t\tif ( !is_string($pattern) ) {\r\n\t\t\tthrow new ftpException('The supplied pattern is not a string');\r\n\t\t}\r\n\t\tif ( !is_array($matchmap) ) {\r\n\t\t\tthrow new ftpException('The supplied matchmap pattern is not an array');\r\n\t\t} else {\r\n\t\t\tforeach ( $matchmap as $val ) {\r\n\t\t\t\tif ( !is_numeric($val) ) {\r\n\t\t\t\t\tthrow new ftpException('The supplied pattern contains invalid value ' . $val);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$this->_matcher = array('pattern' => $pattern, 'map' => $matchmap);\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Rebuild the path, if given relative\r\n\t *\r\n\t * This method will make a relative path absolute by prepending the current\r\n\t * remote directory in front of it.\r\n\t *\r\n\t * @param string $path The path to check and construct\r\n\t *\r\n\t * @access private\r\n\t * @return string The build path\r\n\t */\r\n\tprivate function _constructPath($path) {\r\n\t\tif ( (substr($path, 0, 1) != '/') && (substr($path, 0, 2) != './') ) {\r\n\t\t\t$actual_dir = @ftp_pwd($this->_handle);\r\n\t\t\tif ( substr($actual_dir, -1) != '/' ) {\r\n\t\t\t\t$actual_dir .= '/';\r\n\t\t\t}\r\n\t\t\t$path = $actual_dir . $path;\r\n\t\t}\r\n\t\treturn $path;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks whether the given path is a remote directory by trying to\r\n\t * chdir() into it (and back out)\r\n\t *\r\n\t * @param string $path Path to check\r\n\t *\r\n\t * @access private\r\n\t * @return mixed True if $path is a directory\r\n\t * @throws ftpException\r\n\t */\r\n\tprivate function _checkRemoteDir($path) {\r\n\t\t$pwd = $this->pwd();\r\n\t\t$res = $this->cd($path);\r\n\t\t$this->cd($pwd);\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * This will remove a file\r\n\t *\r\n\t * @param string $file The file to delete\r\n\t *\r\n\t * @access private\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tprivate function _rmFile($file) {\r\n\t\tif ( substr($file, 0, 1) != \"/\" ) {\r\n\t\t\t$actual_dir = @ftp_pwd($this->_handle);\r\n\t\t\tif ( substr($actual_dir, (strlen($actual_dir) - 2), 1) != \"/\" ) {\r\n\t\t\t\t$actual_dir .= \"/\";\r\n\t\t\t}\r\n\t\t\t$file = $actual_dir . $file;\r\n\t\t}\r\n\t\t$res = @ftp_delete($this->_handle, $file);\r\n\t\t\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpException(\"Could not delete file '$file'.\");\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This will remove a dir\r\n\t *\r\n\t * @param string $dir The dir to delete\r\n\t *\r\n\t * @access private\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tprivate function _rmDir($dir) {\r\n\t\tif ( substr($dir, (strlen($dir) - 1), 1) != \"/\" ) {\r\n\t\t\tthrow new ftpException(\"Directory name '\" . $dir . \"' is invalid, has to end with '/'\");\r\n\t\t}\r\n\t\t$res = @ftp_rmdir($this->_handle, $dir);\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpException(\"Could not delete directory '$dir'.\");\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This will remove a dir and all subdirs and -files\r\n\t *\r\n\t * @param string $dir The dir to delete recursively\r\n\t * @param bool $filesonly Only delete files so the directory structure is\r\n\t * preserved \r\n\t *\r\n\t * @access private\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tprivate function _rmDirRecursive($dir, $filesonly = false) {\r\n\t\tif ( substr($dir, (strlen($dir) - 1), 1) != \"/\" ) {\r\n\t\t\tthrow new ftpException(\"Directory name '\" . $dir . \"' is invalid, has to end with '/'\");\r\n\t\t}\r\n\t\t$file_list = $this->_lsFiles($dir);\r\n\t\tforeach ( $file_list as $file ) {\r\n\t\t\t$file = $dir . $file[\"name\"];\r\n\t\t\t$res = $this->rm($file);\r\n\t\t}\r\n\t\t\r\n\t\t$dir_list = $this->_lsDirs($dir);\r\n\t\tforeach ( $dir_list as $new_dir ) {\r\n\t\t\tif ( $new_dir[\"name\"] == '.' || $new_dir[\"name\"] == '..' ) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t$new_dir = $dir . $new_dir[\"name\"] . \"/\";\r\n\t\t\t$res = $this->_rmDirRecursive($new_dir, $filesonly);\r\n\t\t}\r\n\t\t\r\n\t\tif ( !$filesonly ) {\r\n\t\t\t$res = $this->_rmDir($dir);\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Lists up files and directories\r\n\t *\r\n\t * @param string $dir The directory to list up\r\n\t *\r\n\t * @access private\r\n\t * @return array An array of dirs and files\r\n\t */\r\n\tprivate function _lsBoth($dir) {\r\n\t\t$list_splitted = $this->_listAndParse($dir);\r\n\t\t\r\n\t\tif ( !is_array($list_splitted[\"files\"]) ) {\r\n\t\t\t$list_splitted[\"files\"] = array();\r\n\t\t}\r\n\t\tif ( !is_array($list_splitted[\"dirs\"]) ) {\r\n\t\t\t$list_splitted[\"dirs\"] = array();\r\n\t\t}\r\n\t\t$res = array();\r\n\t\t@array_splice($res, 0, 0, $list_splitted[\"files\"]);\r\n\t\t@array_splice($res, 0, 0, $list_splitted[\"dirs\"]);\r\n\t\treturn $res;\r\n\t}\r\n\r\n\t/**\r\n\t * Lists up directories\r\n\t *\r\n\t * @param string $dir The directory to list up\r\n\t *\r\n\t * @access private\r\n\t * @return array An array of dirs\r\n\t */\r\n\tprivate function _lsDirs($dir) {\r\n\t\t$list = $this->_listAndParse($dir);\r\n\t\treturn $list[\"dirs\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Lists up files\r\n\t *\r\n\t * @param string $dir The directory to list up\r\n\t *\r\n\t * @access private\r\n\t * @return array An array of files\r\n\t */\r\n\tprivate function _lsFiles($dir) {\r\n\t\t$list = $this->_listAndParse($dir);\r\n\t\treturn $list[\"files\"];\r\n\t}\r\n\r\n\t/**\r\n\t * This lists up the directory-content and parses the items into well-formated\r\n\t * arrays.\r\n\t * The results of this array are sorted (dirs on top, sorted by name;\r\n\t * files below, sorted by name).\r\n\t *\r\n\t * @param string $dir The directory to parse\r\n\t *\r\n\t * @access private\r\n\t * @return array Lists of dirs and files\r\n\t * @throws ftpException\r\n\t */\r\n\tprivate function _listAndParse($dir) {\r\n\t\t$dirs_list = array();\r\n\t\t$files_list = array();\r\n\t\t$dir_list = @ftp_rawlist($this->_handle, $dir);\r\n\t\tif ( !is_array($dir_list) ) {\r\n\t\t\tthrow new ftpLsException('Could not get raw directory listing of '.$dir);\r\n\t\t}\r\n\t\t\r\n\t\tforeach ( $dir_list as $k => $v ) {\r\n\t\t\tif ( strncmp($v, 'total: ', 7) == 0 && preg_match('/total: \\d+/', $v) ) {\r\n\t\t\t\tunset($dir_list[$k]);\r\n\t\t\t\tbreak; // usually there is just one line like this\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Handle empty directories\r\n\t\tif ( count($dir_list) == 0 ) {\r\n\t\t\treturn array('dirs' => $dirs_list, 'files' => $files_list);\r\n\t\t}\r\n\t\t\r\n\t\t// Exception for some FTP servers seem to return this weird result instead\r\n\t\t// of an empty list\r\n\t\tif ( count($dirs_list) == 1 && $dirs_list[0] == 'total 0' ) {\r\n\t\t\treturn array('dirs' => array(), 'files' => $files_list);\r\n\t\t}\r\n\t\t\r\n\t\tif ( !isset($this->_matcher) ) {\r\n\t\t\t$this->_matcher = $this->_determineOSMatch($dir_list);\r\n\t\t}\r\n\t\t\r\n\t\tforeach ( $dir_list as $entry ) {\r\n\t\t\tif ( !preg_match($this->_matcher['pattern'], $entry, $m) ) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t$entry = array();\r\n\t\t\tforeach ( $this->_matcher['map'] as $key => $val ) {\r\n\t\t\t\t$entry[$key] = $m[$val];\r\n\t\t\t}\r\n\t\t\t$entry['stamp'] = $this->_parseDate($entry['date']);\r\n\t\t\t\r\n\t\t\tif ( $entry['is_dir'] ) {\r\n\t\t\t\t$dirs_list[] = $entry;\r\n\t\t\t} else {\r\n\t\t\t\t$files_list[] = $entry;\r\n\t\t\t}\r\n\t\t}\r\n\t\t@usort($dirs_list, array(\"Net_FTP\", \"_natSort\"));\r\n\t\t@usort($files_list, array(\"Net_FTP\", \"_natSort\"));\r\n\t\t$res[\"dirs\"] = (is_array($dirs_list)) ? $dirs_list : array();\r\n\t\t$res[\"files\"] = (is_array($files_list)) ? $files_list : array();\r\n\t\treturn $res;\r\n\t}\r\n\r\n\t/**\r\n\t * Determine server OS\r\n\t * This determines the server OS and returns a valid regex to parse\r\n\t * ls() output.\r\n\t *\r\n\t * @param array &$dir_list The raw dir list to parse\r\n\t *\r\n\t * @access private\r\n\t * @return mixed An array of 'pattern' and 'map' on success\r\n\t * @throws ftpException\r\n\t */\r\n\tprivate function _determineOSMatch(&$dir_list) {\r\n\t\tforeach ( $dir_list as $entry ) {\r\n\t\t\tforeach ( $this->_ls_match as $os => $match ) {\r\n\t\t\t\tif ( preg_match($match['pattern'], $entry) ) {\r\n\t\t\t\t\treturn $match;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$error =\r\n\t\t\t'The list style of your server seems not to be supported. Please'.\r\n\t\t\t'email a \"$ftp->ls(ftpClient::LS_MODE_RAWLIST);\" output plus info on the'.\r\n\t\t\t'server to the maintainer of this package to get it supported!'.\r\n\t\t\t'Thanks for your help!';\r\n\t\t\r\n\t\tthrow new ftpException($error);\r\n\t}\r\n\r\n\t/**\r\n\t * Lists a local directory\r\n\t *\r\n\t * @param string $dir_path The dir to list\r\n\t *\r\n\t * @access private\r\n\t * @return array The list of dirs and files\r\n\t */\r\n\tprivate function _lsLocal($dir_path) {\r\n\t\t$dir = dir($dir_path);\r\n\t\t$dir_list = array();\r\n\t\t$file_list = array();\r\n\t\twhile ( false !== ($entry = $dir->read()) ) {\r\n\t\t\tif ( ($entry != '.') && ($entry != '..') ) {\r\n\t\t\t\tif ( is_dir($dir_path . $entry) ) {\r\n\t\t\t\t\t$dir_list[] = $entry;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$file_list[] = $entry;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$dir->close();\r\n\t\t$res['dirs'] = $dir_list;\r\n\t\t$res['files'] = $file_list;\r\n\t\treturn $res;\r\n\t}\r\n\r\n\t/**\r\n\t * Function for use with usort().\r\n\t * Compares the list-array-elements by name.\r\n\t *\r\n\t * @param string $item_1 first item to be compared\r\n\t * @param string $item_2 second item to be compared\r\n\t *\r\n\t * @access private\r\n\t * @return int < 0 if $item_1 is less than $item_2, 0 if equal and > 0 otherwise\r\n\t */\r\n\tprivate function _natSort($item_1, $item_2) {\r\n\t\treturn strnatcmp($item_1['name'], $item_2['name']);\r\n\t}\r\n\r\n\t/**\r\n\t * Parse dates to timestamps\r\n\t *\r\n\t * @param string $date Date\r\n\t *\r\n\t * @access private\r\n\t * @return int Timestamp\r\n\t * @throws ftpException\r\n\t */\r\n\tprivate function _parseDate($date) {\r\n\t\t// Sep 10 22:06 => Sep 10, <year> 22:06\r\n\t\tif ( preg_match('/([A-Za-z]+)[ ]+([0-9]+)[ ]+([0-9]+):([0-9]+)/', $date, $res) ) {\r\n\t\t\t$year = date('Y');\r\n\t\t\t$month = $res[1];\r\n\t\t\t$day = $res[2];\r\n\t\t\t$hour = $res[3];\r\n\t\t\t$minute = $res[4];\r\n\t\t\t$date = \"$month $day, $year $hour:$minute\";\r\n\t\t\t$tmpDate = strtotime($date);\r\n\t\t\tif ( $tmpDate > time() ) {\r\n\t\t\t\t$year--;\r\n\t\t\t\t$date = \"$month $day, $year $hour:$minute\";\r\n\t\t\t}\r\n\t\t} elseif ( preg_match('/^\\d\\d-\\d\\d-\\d\\d/', $date) ) {\r\n\t\t\t// 09-10-04 => 09/10/04\r\n\t\t\t$date = str_replace('-', '/', $date);\r\n\t\t}\r\n\t\t$res = strtotime($date);\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpException('Date conversion failed for '.$date);\r\n\t\t}\r\n\t\treturn $res;\r\n\t}\r\n}", "function CheckFilePermission($filename) {\n\t//can we write?\n\tif(!is_writable($filename)) {\n\t\t//no we can't.\n\t\tif(!@chmod($filename, 0666)) {\n\t\t\t$pathtofilename = dirname($filename);\n\t\t\t//Lets check if parent directory is writable.\n\t\t\tif(!is_writable($pathtofilename)) {\n\t\t\t\t//it's not writeable too.\n\t\t\t\tif(!@chmod($pathtoffilename, 0666)) {\n\t\t\t\t\t//darn couldn't fix up parrent directory this hosting is foobar.\n\t\t\t\t\t//Lets error because of the permissions problems.\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t//we can write, return 1/true/happy dance.\n\treturn true;\n}", "public static function makeWritable($filename) {\r\n\t\tif (!file_exists($filename)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t// determine mode\r\n\t\tif (self::$mode === null) {\r\n\t\t\t// do not use PHP_OS here, as this represents the system it was built on != running on\r\n\t\t\t// php_uname() is forbidden on some strange hosts; PHP_EOL is reliable \r\n\t\t\tif (PHP_EOL == \"\\r\\n\") {\r\n\t\t\t\t// Windows\r\n\t\t\t\tself::$mode = 0777;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// anything but Windows\r\n\t\t\t\tclearstatcache();\r\n\t\t\t\t\r\n\t\t\t\tself::$mode = 0666;\r\n\t\t\t\t\r\n\t\t\t\t$tmpFilename = '__permissions_'.sha1(time()).'.txt';\r\n\t\t\t\t@touch($tmpFilename);\r\n\t\t\t\t\r\n\t\t\t\t// create a new file and check the file owner, if it is the same\r\n\t\t\t\t// as this file (uploaded through FTP), we can safely grant write\r\n\t\t\t\t// permissions exclusively to the owner rather than everyone\r\n\t\t\t\tif (file_exists($tmpFilename)) {\r\n\t\t\t\t\t$scriptOwner = fileowner(__FILE__);\r\n\t\t\t\t\t$fileOwner = fileowner($tmpFilename);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($scriptOwner === $fileOwner) {\r\n\t\t\t\t\t\tself::$mode = 0644;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t@unlink($tmpFilename);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (is_dir($filename)) {\r\n\t\t\tif (self::$mode == 0644) {\r\n\t\t\t\t@chmod($filename, 0755);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t@chmod($filename, 0777);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t@chmod($filename, self::$mode);\r\n\t\t}\r\n\t\t\r\n\t\tif (!is_writable($filename)) {\r\n\t\t\tthrow new SystemException(\"Unable to make '\".$filename.\"' writable. This is a misconfiguration of your server, please contact your system administrator or hosting provider.\");\r\n\t\t}\r\n\t}", "function fn_get_readable_file_perms($perms)\n{\n if (($perms & 0xC000) == 0xC000) {\n // Socket\n $info = 's';\n } elseif (($perms & 0xA000) == 0xA000) {\n // Symbolic link\n $info = 'l';\n } elseif (($perms & 0x8000) == 0x8000) {\n // Usual\n $info = '-';\n } elseif (($perms & 0x6000) == 0x6000) {\n // Special block\n $info = 'b';\n } elseif (($perms & 0x4000) == 0x4000) {\n // Dir\n $info = 'd';\n } elseif (($perms & 0x2000) == 0x2000) {\n // Special symbol\n $info = 'c';\n } elseif (($perms & 0x1000) == 0x1000) {\n // FIFO stream\n $info = 'p';\n } else {\n // Unknown\n $info = 'u';\n }\n\n // Owner\n $info .= (($perms & 0x0100) ? 'r' : '-');\n $info .= (($perms & 0x0080) ? 'w' : '-');\n $info .= (($perms & 0x0040)\n ? (($perms & 0x0800) ? 's' : 'x')\n : (($perms & 0x0800) ? 'S' : '-'));\n\n // Group\n $info .= (($perms & 0x0020) ? 'r' : '-');\n $info .= (($perms & 0x0010) ? 'w' : '-');\n $info .= (($perms & 0x0008)\n ? (($perms & 0x0400) ? 's' : 'x')\n : (($perms & 0x0400) ? 'S' : '-'));\n\n // World\n $info .= (($perms & 0x0004) ? 'r' : '-');\n $info .= (($perms & 0x0002) ? 'w' : '-');\n $info .= (($perms & 0x0001)\n ? (($perms & 0x0200) ? 't' : 'x')\n : (($perms & 0x0200) ? 'T' : '-'));\n\n return $info;\n}", "public static function checkFileAccess($file, $type = self::READABLE, $correct_permissions = false)\n {\n $app = App::instance();\n $checking_result = false;\n\n if (file_exists($file)) {\n $filetype = is_dir($file) ? 'dir' : 'file';\n if ($type == self::READABLE) {\n if (!is_readable($file) && $correct_permissions) {\n @chmod($file, self::READABLE_PERMISSIONS);\n }\n\n if (!is_readable($file)) {\n if ($correct_permissions) {\n $app->setNotification('E', $app->t('error'), $app->t($filetype . '_unable_correct_permissions', array($filetype => $file)), true, 'file_permissions_section');\n } else {\n $app->setNotification('E', $app->t('error'), $app->t($filetype . '_not_readable', array($filetype => $file)), true, 'file_permissions');\n }\n } else {\n $checking_result = true;\n }\n } elseif ($type == self::WRITABLE) {\n if (!is_writable($file) && $correct_permissions) {\n @chmod($file, self::WRITABLE_PERMISSIONS);\n }\n\n if (!is_writable($file)) {\n if ($correct_permissions) {\n $app->setNotification('E', $app->t('error'), $app->t($filetype . '_unable_correct_permissions', array($filetype => $file)), true, 'file_permissions_section');\n } else {\n $app->setNotification('E', $app->t('error'), $app->t($filetype . '_not_writable', array($filetype => $file)), true, 'file_permissions');\n }\n\n } else {\n $checking_result = true;\n }\n }\n } else {\n $app->setNotification('E', $app->t('error'), $app->t('file_not_exists', array('file' => $file)), true, 'file_permissions');\n }\n\n if ($checking_result && $filetype == 'dir') {\n foreach (scandir($file) as $subfile) {\n $skip_files = array('.', '..', '.htaccess', 'index.php');\n if (!in_array($subfile, $skip_files)) {\n if (!self::checkFileAccess($file . '/' . $subfile, $type, $correct_permissions)) {\n $checking_result = false;\n\n break;\n }\n }\n }\n }\n\n return $checking_result;\n }", "public function chmod($path, $umask);", "private function setSpecialBits() {\n if (Request::has(\"include-setuid\") && Request::input(\"include-setuid\") === \"true\") { $permissionSetuid = 4; } else { $permissionSetuid = 0; }\n if (Request::has(\"include-setgid\") && Request::input(\"include-setgid\") === \"true\") { $permissionSetgid = 2; } else { $permissionSetgid = 0; }\n if (Request::has(\"include-sticky\") && Request::input(\"include-sticky\") === \"true\") { $permissionSticky = 1; } else { $permissionSticky = 0; }\n return $permissionSetuid + $permissionSetgid + $permissionSticky;\n }", "public static function userHasFileWriteAccess($user, $file, $arguments = null)\n {\n $rootFolder = $arguments['$folderRoot'] ? $arguments['$folderRoot'] : null;\n // Hooks to forbid write permission to a file if necessary\n $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][AccessUtility::class]['userHasFileWriteAccess'] = array_merge( // retro-compatibility\n (array)$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][AccessUtility::class]['userHasFileWriteAccess'],\n (array)$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Tx_AmeosFilemanager_Tools_Tools']['userHasFileWriteAccess']\n );\n if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][AccessUtility::class]['userHasFileWriteAccess'])) {\n foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][AccessUtility::class]['userHasFileWriteAccess'] as $classData) {\n $hookObject = GeneralUtility::getUserObj($classData);\n // Don't forget to test $user in your hook\n if(method_exists($hookObject, 'userHasNotFileWriteAccess') && $hookObject->userHasNotFileWriteAccess($user, $file, $arguments)) {\n return false;\n }\n }\n }\n if($file->getNoWriteAccess() && // write only for owner\n (\n !isset($user['uid']) // no user authenficated\n || !is_object($file->getFeUser()) // no owner\n || $file->getFeUser()->getUid() != $user['uid'] // user is not the owner\n )\n ) {\n return false;\n }\n if($user && $user['uid'] > 0\n && $file->getOwnerHasWriteAccess()\n && is_object($file->getFeUser())\n && $file->getFeUser()->getUid() == $user['uid']\n ) {\n return true;\n }\n if ($file->getArrayFeGroupWrite()) {\n $fileRepository = GeneralUtility::makeInstance(\\Ameos\\AmeosFilemanager\\Domain\\Repository\\FileRepository::class);\n if ($exist = $fileRepository->findByUid($file->getUid(),$writeMode = true)) {\n return true;\n }\n } else {\n return self::userHasFolderWriteAccess($user,$file->getParentFolder(),$arguments);\n }\n return false;\n }", "protected function setPermissions($filePath, $overrideFilePermissions)\n\t{\n\t\tif ($overrideFilePermissions) {\n\t\t\tchmod($filePath, $overrideFilePermissions & ~umask());\n\t\t}\n\t\telseif (is_null($overrideFilePermissions)) {\n\t\t\tchmod($filePath, 0666 & ~umask());\n\t\t}\n\t}", "function check_writable_perms($list = 'must_write')\n\t{\n\t\t$bad_files = array();\n\t\t\n\t\t$system_dirs = $this->e107->e107_dirs;\n\t\t$system_dirs['MEDIA_DIRECTORY'] = str_replace(\"[hash]/\",\"\", $system_dirs['MEDIA_DIRECTORY']);\n\t\t$system_dirs['SYSTEM_DIRECTORY'] = str_replace(\"[hash]/\",\"\", $system_dirs['SYSTEM_DIRECTORY']);\n\t\t\n\t\t$data['must_write'] = 'e107_config.php|{$MEDIA_DIRECTORY}|{$SYSTEM_DIRECTORY}'; // all-sub folders are created on-the-fly\n\t\t\n\t\t$data['can_write'] = '{$PLUGINS_DIRECTORY}|{$THEMES_DIRECTORY}|{$WEB_DIRECTORY}cache|{$WEB_DIRECTORY}lib';\n\t\tif (!isset($data[$list])) return $bad_files;\n\t\tforeach ($system_dirs as $dir_name => $value)\n\t\t{\n\t\t\t$find[] = \"{\\${$dir_name}}\";\n\t\t\t$replace[] = \"./$value\";\n\t\t}\n\t\t$data[$list] = str_replace($find, $replace, $data[$list]);\n\t\t$files = explode(\"|\", trim($data[$list]));\n\t\tforeach ($files as $file)\n\t\t{\n\t\t\tif(!is_writable($file))\n\t\t\t{\n\t\t\t\t$bad_files[] = str_replace(\"./\", \"\", $file);\n\t\t\t}\n\t\t}\n\t\treturn $bad_files;\n\t}", "private function chmod_if_needed($dir, $chmod, $recursive = false, $wpfs = false, $suppress = true) {\n\n\t\t// Do nothing on Windows\n\t\tif ('WIN' === strtoupper(substr(PHP_OS, 0, 3))) return true;\n\n\t\tif (false == $wpfs) {\n\t\t\tglobal $wp_filesystem;\n\t\t\t$wpfs = $wp_filesystem;\n\t\t}\n\n\t\t$old_chmod = $this->get_current_chmod($dir, $wpfs);\n\n\t\t// Sanity check\n\t\tif (strlen($old_chmod) < 3) return false;\n\n\t\t$new_chmod = $this->calculate_additive_chmod_oct($old_chmod, $chmod);\n\n\t\t// Don't fix what isn't broken\n\t\tif (!$recursive && $new_chmod == $old_chmod) return true;\n\n\t\t$new_chmod = octdec($new_chmod);\n\n\t\tif ($suppress) {\n\t\t\treturn @$wpfs->chmod($dir, $new_chmod, $recursive);// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged\n\t\t} else {\n\t\t\treturn $wpfs->chmod($dir, $new_chmod, $recursive);\n\t\t}\n\t}", "function read_chmod()\n\t{\n\t\tglobal $chmod_777, $chmod_666;\n\t\tglobal $lang, $language;\n\n\t\t$img_ok = str_replace('alt=\"\" title=\"\"', 'alt=\"' . $lang['CHMOD_OK'] . '\" title=\"' . $lang['CHMOD_File_Exists'] . '\"', $this->img_ok);\n\t\t$img_error = str_replace('alt=\"\" title=\"\"', 'alt=\"' . $lang['CHMOD_Error'] . '\" title=\"' . $lang['CHMOD_Error'] . '\"', $this->img_error);\n\n\t\t$report_string_append = '';\n\n\t\t$chmod_items_array = array($chmod_777, $chmod_666);\n\t\t$chmod_values_array = array(0777, 0666);\n\t\t$chmod_langs_array = array($lang['CHMOD_777'], $lang['CHMOD_666']);\n\n\t\t$table_output = '';\n\n\t\tfor ($i = 0; $i < sizeof($chmod_items_array); $i++)\n\t\t{\n\t\t\tif (!empty($chmod_items_array[$i]))\n\t\t\t{\n\t\t\t\t$table_output .= '<b>' . $chmod_langs_array[$i] . '</b><br />' . '<ul>';\n\t\t\t\tfor ($j = 0; $j < sizeof($chmod_items_array[$i]); $j++ )\n\t\t\t\t{\n\t\t\t\t\t$report_string = '';\n\t\t\t\t\t$errored = false;\n\t\t\t\t\tif (!file_exists($chmod_items_array[$i][$j]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$errored = true;\n\t\t\t\t\t\t$report_string = $lang['CHMOD_File_NotExists'];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!is_writable($chmod_items_array[$i][$j]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$errored = true;\n\t\t\t\t\t\t\t$report_string = $lang['CHMOD_File_Exists_Read_Only'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$report_string = $lang['CHMOD_File_Exists'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($errored)\n\t\t\t\t\t{\n\t\t\t\t\t\t$report_string_append = '&nbsp;<span class=\"genmed\" style=\"color: ' . $this->color_error . ';\"><b>' . $report_string . '</b></span>';\n\t\t\t\t\t\t$table_output .= '<li><span class=\"gensmall\" style=\"color: ' . $this->color_error . ';\"><b>' . $chmod_items_array[$i][$j] . '</b></span>&nbsp;' . $img_error . '</li>' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$report_string_append = '&nbsp;<span class=\"genmed\" style=\"color: ' . $this->color_ok . ';\">' . $report_string . '</span>';\n\t\t\t\t\t\t$table_output .= '<li><span class=\"gensmall\" style=\"color: ' . $this->color_ok . ';\"><b>' . $chmod_items_array[$i][$j] . '</b></span>&nbsp;' . $img_ok . '</li>' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$table_output .= '</ul>' . '<br />';\n\t\t\t}\n\t\t}\n\n\t\treturn $table_output;\n\t}", "function correct_perms()\n\t{\n\t\t$mes = e107::getMessage();\n\t\t$fl = e107::getFile();\n\t\tob_start();\n\t\t$fl->chmod(e_BASE);\n\t\t$fl->chmod(e_BASE.\"cron.php\",0755);\n\t\t$errors = ob_get_clean();\n\t\t\n\t\tif($errors !='')\n\t\t{\n\t\t\t$mes->addError($errors);\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$mes->addSuccess(DBLAN_72);\n\t\t}\n\t\t\n\t\te107::getRender()->tablerender(DBLAN_10.SEP.DBLAN_73, $mes->render());\n\t\t\n\t}", "private function getPermissions(File $file): int\n {\n if ($file->isDir()) {\n return Permissions::DIRECTORY->get();\n }\n\n // Check if file is inside .git/objects directory\n if ($this->isGitObject($file->getPathname())) {\n return Permissions::FILE_PROTECTED->get();\n }\n\n // Check if file is inside .git/hooks directory\n if ($this->isGitHook($file->getPathname())) {\n return Permissions::EXECUTABLE->get();\n }\n\n // If file is special in the gitweb directory.\n if ($this->isGitWebConfigFile($file->getPathname())) {\n return Permissions::FILE->get();\n }\n\n // Check if file is executable shell script.\n if ($this->isExecutableScript($file)) {\n return Permissions::EXECUTABLE->get();\n }\n\n return Permissions::FILE->get();\n }", "public static function setPermission($event)\n\t{\n\t\t$options = array_merge([\n\t\t\tself::EXTRA_WRITABLE => [],\n\t\t\tself::EXTRA_EXECUTABLE => [],\n\t\t], $event->getComposer()->getPackage()->getExtra());\n\n\t\tforeach ((array)$options[self::EXTRA_WRITABLE] as $path) {\n\t\t\techo \"Setting writable: $path ...\";\n\t\t\tif (is_dir($path)) {\n\t\t\t\tchmod($path, 0777);\n\t\t\t\techo \"done\\n\";\n\t\t\t} else {\n\t\t\t\techo \"The directory was not found: \" . getcwd() . DIRECTORY_SEPARATOR . $path;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tforeach ((array)$options[self::EXTRA_EXECUTABLE] as $path) {\n\t\t\techo \"Setting executable: $path ...\";\n\t\t\tif (is_file($path)) {\n\t\t\t\tchmod($path, 0755);\n\t\t\t\techo \"done\\n\";\n\t\t\t} else {\n\t\t\t\techo \"\\n\\tThe file was not found: \" . getcwd() . DIRECTORY_SEPARATOR . $path . \"\\n\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "function get_perms($file,$type) {\n\tswitch($type) {\n\t\tcase 1;\n\t\t\t$mode = fileperms($file);\n\t\t\t$perms = NULL;\n\t\t\t$perms .= ($mode & 00400) ? 'r' : '-';\n\t\t\t$perms .= ($mode & 00200) ? 'w' : '-';\n\t\t\t$perms .= ($mode & 00100) ? 'x' : '-';\n\t\t\t$perms .= ($mode & 00040) ? 'r' : '-';\n\t\t\t$perms .= ($mode & 00020) ? 'w' : '-';\n\t\t\t$perms .= ($mode & 00010) ? 'x' : '-';\n\t\t\t$perms .= ($mode & 00004) ? 'r' : '-';\n\t\t\t$perms .= ($mode & 00002) ? 'w' : '-';\n\t\t\t$perms .= ($mode & 00001) ? 'x' : '-';\n\t\tbreak;\n\t\t\n\t\tcase 2;\n\t\t\t$perms = substr(sprintf('%o', fileperms($file)), -4);\n\t\tbreak;\n\t}\n\t\nreturn $perms;\n}", "function ftp_chmod($filename, $chmod = 0777) {\r\n\t\t//$chmod = (int) $chmod;\r\n\t\t\r\n\t\t$filename = dzz_ftp::clear($filename);\r\n\t\tif(function_exists('ftp_chmod')) {\r\n\t\t\treturn @ftp_chmod($this->connectid, $chmod, $filename);\r\n\t\t} else {\r\n\t\t\treturn @ftp_site($this->connectid, 'CHMOD '.$chmod.' '.$filename);\r\n\t\t}\r\n\t}", "public function getchmod($file) {\n\t\tif( $this->authorized() ) {\n\t\t\treturn parent::getchmod( $file );\n\t\t} else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getchmod($file)\n {\n }", "public function getchmod($file)\n {\n }", "public function getchmod($file)\n {\n }", "public function getchmod($file)\n {\n }", "public function getchmod($file)\n {\n }", "public function getFileOperationPermissions() {}", "function _chmod($file, $perms)\n\t{\n\t\tif (function_exists('ftp_chmod'))\n\t\t{\n\t\t\t$err = @ftp_chmod($this->connection, $perms, $file);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Unfortunatly CHMOD is not expecting an octal value...\n\t\t\t// We need to transform the integer (which was an octal) to an octal representation (to get the int) and then pass as is. ;)\n\t\t\t$chmod_cmd = 'CHMOD ' . base_convert($perms, 10, 8) . ' ' . $file;\n\t\t\t$err = $this->_site($chmod_cmd);\n\t\t}\n\n\t\treturn $err;\n\t}", "public function getPerms($file){\n $permisos = fileperms($file);\n\n if (($permisos & 0xC000) == 0xC000) {\n // Socket\n $type = 's';\n } elseif (($permisos & 0xA000) == 0xA000) {\n // Symbolic link\n $type = 'l';\n } elseif (($permisos & 0x8000) == 0x8000) {\n // Regular\n $type = '-';\n } elseif (($permisos & 0x6000) == 0x6000) {\n // Special block\n $type = 'b';\n } elseif (($permisos & 0x4000) == 0x4000) {\n // Directory\n $type = 'd';\n } elseif (($permisos & 0x2000) == 0x2000) {\n // Especial Carácter\n $type = 'c';\n } elseif (($permisos & 0x1000) == 0x1000) {\n // FIFO Pipe\n $type = 'p';\n } else {\n // Unknown\n $type = 'u';\n }\n\n $owner = (($permisos & 0x0100) ? 'r' : '-');\n $owner .= (($permisos & 0x0080) ? 'w' : '-');\n $owner .= (($permisos & 0x0040) ?\n (($permisos & 0x0800) ? 's' : 'x' ) :\n (($permisos & 0x0800) ? 'S' : '-'));\n\n $group = (($permisos & 0x0020) ? 'r' : '-');\n $group .= (($permisos & 0x0010) ? 'w' : '-');\n $group .= (($permisos & 0x0008) ?\n (($permisos & 0x0400) ? 's' : 'x' ) :\n (($permisos & 0x0400) ? 'S' : '-'));\n\n $other = (($permisos & 0x0004) ? 'r' : '-');\n $other .= (($permisos & 0x0002) ? 'w' : '-');\n $other .= (($permisos & 0x0001) ? \n (($permisos & 0x0200) ? 't' : 'x' ) : \n (($permisos & 0x0200) ? 'T' : '-'));\n \n return array(\n 'name' => $file, \n 'type' => $type,\n 'owner' => $owner,\n 'group' => $group,\n 'other' => $other,\n );\n }", "public function testChangeOwner() {\n\t\tif (!function_exists('posix_getpwuid') || false === posix_getpwuid(1)) {\n\t\t\t$this->markTestSkipped(\n\t\t\t\t'Either the posix_getpwuid() function is not available, or there is no user with UID of 1');\n\t\t}\n\n\t\t$file = 'test.txt';\n\t\t$fullPath = $this->testBasePath . $file;\n\n\t\ttouch($fullPath);\n\n\t\t$this->assertTrue(file_exists($fullPath), 'Precondition failed. Unable to create test file: ' . $fullPath);\n\t\t$this->assertEquals(0, fileowner($fullPath), 'Precondition failed. Invalid owner for new file.');\n\t\tclearstatcache();\n\t\t$this->assertTrue(file_exists($fullPath), 'Precondition failed. Unable to create test file: ' . $fullPath);\n\t\t$this->assertEquals(0, fileowner($fullPath), 'Precondition failed. Invalid owner for new file.');\n\n\t\tclearstatcache();\n\n\t\t$this->fileHandler->changeOwner($fullPath, null, 1);\n\t\t$this->assertEquals(1, fileowner($fullPath), 'Failed to change owner of the test file');\n\n\t\tclearstatcache();\n\n\t\t$this->fileHandler->changeOwner($fullPath, 1, 1);\n\t\t$this->assertEquals(1, filegroup($fullPath), 'Failed to change group of the test file');\n\t\t$this->assertEquals(1, fileowner($fullPath), 'Invalid user set for file when changing both group and user');\n\n\t\tclearstatcache();\n\n\t\t$this->fileHandler->changeOwner($fullPath, 0);\n\t\t$this->assertEquals(0, filegroup($fullPath), 'Failed to change group of the test file');\n\t\t$this->assertEquals(1, fileowner($fullPath), 'Changing only the group should not change the owner of a file');\n\t}", "function fn_check_writable_path_permissions($path)\n{\n if (is_writable($path)) {\n $result = true;\n\n } elseif (is_dir($path)) {\n $result = $path;\n\n } else {\n $result = call_user_func(__FUNCTION__, dirname($path));\n }\n\n return $result;\n}", "function chmodRecursive($target, $permissions) {\r\n\t\tif ( !self::$_dir_permissions ) {\r\n\t\t\tself::$_dir_permissions = $this->_makeDirPermissions($permissions);\r\n\t\t}\r\n\t\t\r\n\t\tif ( is_array($target) ) {\r\n\t\t\tfor ( $i = 0; $i < count($target); $i++ ) {\r\n\t\t\t\t$res = $this->chmodRecursive($target[$i], $permissions);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$remote_path = $this->_constructPath($target);\r\n\t\t\t\r\n\t\t\t// Chmod the directory itself\r\n\t\t\t$result = $this->chmod($remote_path, self::$_dir_permissions);\r\n\t\t\t\r\n\t\t\t// If $remote_path last character is not a slash, add one\r\n\t\t\tif ( substr($remote_path, strlen($remote_path) - 1) != \"/\" ) {\r\n\t\t\t\t$remote_path .= \"/\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$dir_list = array();\r\n\t\t\t$mode = self::LS_MODE_DIR_ONLY;\r\n\t\t\t$dir_list = $this->ls($remote_path, $mode);\r\n\t\t\tforeach ( $dir_list as $dir_entry ) {\r\n\t\t\t\tif ( $dir_entry['name'] == '.' || $dir_entry['name'] == '..' ) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$remote_path_new = $remote_path . $dir_entry[\"name\"] . \"/\";\r\n\t\t\t\t\r\n\t\t\t\t// Chmod the directory we're about to enter\r\n\t\t\t\t$result = $this->chmod($remote_path_new, self::$_dir_permissions);\r\n\t\t\t\t$result = $this->chmodRecursive($remote_path_new, $permissions);\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$file_list = array();\r\n\t\t\t$mode = self::LS_MODE_FILES_ONLY;\r\n\t\t\t$file_list = $this->ls($remote_path, $mode);\r\n\t\t\t\r\n\t\t\tforeach ( $file_list as $file_entry ) {\r\n\t\t\t\t$remote_file = $remote_path . $file_entry[\"name\"];\r\n\t\t\t\t$result = $this->chmod($remote_file, $permissions);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function permissions_grant_user ($user, $dir, $file, $action)\n{\n\t$permissions = user_get_permissions($user);\n\n\t// determine the permission definitions\n\t$permdefs = permissions_get();\n\n\t// the user with the name \"admin\" always has admin rights\n\tif ($action == \"admin\" && $user == \"admin\")\n\t\treturn true;\n\n\t// check if the action is allowed\n\treturn ($permdefs[$action] & $permissions) != 0;\n}", "public function getFilePermissionsReturnsCorrectPermissionsForFilesNotOwnedByCurrentUser_dataProvider() {}", "public function setUserRights(\\SplFileInfo $targetDir)\n {\n // we don't do anything under Windows\n if ($this->getOsIdentifier() === 'WIN') {\n return;\n }\n\n // we don't have a directory to change the user/group permissions for\n if ($targetDir->isDir() === false) {\n return;\n }\n\n // Get our system configuration as it contains the user and group to set\n $systemConfiguration = $this->getInitialContext()->getSystemConfiguration();\n\n // get all the files recursively\n $files = $this->globDir($targetDir . '/*');\n\n // Check for the existence of a user\n $user = $systemConfiguration->getParam('user');\n if (!empty($user)) {\n // Change the rights of everything within the defined dirs\n foreach ($files as $file) {\n chown($file, $user);\n }\n chown($targetDir, $user);\n }\n\n // Check for the existence of a group\n $group = $systemConfiguration->getParam('group');\n if (!empty($group)) {\n // Change the rights of everything within the defined dirs\n foreach ($files as $file) {\n chgrp($file, $group);\n }\n chgrp($targetDir, $group);\n }\n }", "public function isFilesystemWritable($correct_permissions = false)\n {\n $dir_root = Registry::get('config.dir.root');\n $checking_result = self::checkFileAccess($dir_root . '/config.local.php', self::WRITABLE, $correct_permissions);\n $checking_result = $checking_result & self::checkFileAccess($dir_root . '/images', self::WRITABLE, $correct_permissions);\n $checking_result = $checking_result & self::checkFileAccess($dir_root . '/design', self::WRITABLE, $correct_permissions);\n $checking_result = $checking_result & self::checkFileAccess($dir_root . '/var', self::WRITABLE, $correct_permissions);\n\n return $checking_result;\n }", "public function setFileOwnership ($modeAccess, $whatKindOfAccess) {\n switch ($whatKindOfAccess) {\n case 'group':\n if ($this->pathExists->toBoolean () == TRUE) {\n return new B (chgrp ($this->varContainer, $modeAccess));\n } else { return $this->pathExists; }\n break;\n case 'chmod':\n if ($this->pathExists->toBoolean () == TRUE) {\n return new B (chmod ($this->varContainer, $modeAccess));\n } else { return $this->pathExists; }\n break;\n }\n }", "public function testGetChmod()\n {\n file_put_contents(self::$temp.DS.'file.txt', 'Hello World');\n chmod(self::$temp.DS.'file.txt', 0755);\n\n $actual = Storage::chmod(self::$temp.DS.'file.txt');\n $expected = ('\\\\' === DS) ? '0666' : '0755';\n\n $this->assertTrue($expected === $actual);\n }", "function is_writable($orgdest)\n {\n if ($orgdest{0} == '/')\n {\n if (count($orgdest) == 1)\n $testdest = $orgdest;\n else\n $testdest= substr($orgdest, 0, strpos($orgdest, '/', 1));\n }\n else\n {\n if ($orgdest{strlen($orgdest)-1} != '/' && !is_file($orgdest))\n $orgdest .= '/';\n\n $testdest = $orgdest;\n\n if (!is_dir($orgdest))\n {\n $orgdestArray = explode('/', $orgdest);\n\n $testdest = $orgdestArray[0].'/';\n }\n }\n\n atkdebug(\"Checking with: \".$testdest);\n\n return is_writable($testdest);\n }\n\n /**\n * This function creates recursively a destination. This fuction accepts\n * a full path ../dir/subdir/subdir2/subdir3 etc. It checks if the path is writeable\n * and replace mis typed slashes with forward slashes.\n *\n * @static\n * @param string $dir the fullpath\n * @param octal $privileges octal number for the rights of the written\n * @param bool $recursive \n * @return bool returns true if the destination is written.\n */\n function mkdirRecursive($dir, $privileges=0777, $recursive=true)\n {\n $dir = preg_replace('/(\\/){2,}|(\\\\\\){1,}/','/',$dir); //only forward-slash\n\n if (!atkFileUtils::is_writable($dir))\n {\n atkdebug(\"Error no write permission!\");\n return false;\n }\n\n atkdebug(\"Permission granted to write.\");\n\n if( is_null($dir) || $dir === \"\" ){\n return FALSE;\n }\n if( is_dir($dir) || $dir === \"/\" ){\n return TRUE;\n }\n if( atkFileUtils::mkdirRecursive(dirname($dir), $privileges, $recursive) ){\n return mkdir($dir, $privileges);\n }\n return FALSE;\n }\n\n /**\n * This function parse a templatestring with the data and returns\n * a string with the data parsed in the template.\n *\n * @static\n * @param string $template the template to parse\n * @param array $data array which contains the data for the template\n * @return string returns the parsed string\n */\n function parseDirectoryName($template, $data)\n {\n atkimport(\"atk.utils.atkstringparser\");\n $stringparser = new atkStringParser($template);\n return $stringparser->parse($data);\n }\n\n\n /**\n * Returns mimetype for the given filename, based on fileextension.\n * This function is different from mime_content_type because it\n * does not access the file but just looks at the fileextension and\n * returns the right mimetype.\n *\n * @static\n * @param string $filename Filename (or just the extention) we want\n * to know the mime type for.\n * @return string The mimetype for this file extension.\n */\n function atkGetMimeTypeFromFileExtension($filename)\n {\n $ext = strtolower(end(explode('.',$filename )));\n\n $mimetypes = array(\n 'ai' =>'application/postscript',\n 'aif' =>'audio/x-aiff',\n 'aifc' =>'audio/x-aiff',\n 'aiff' =>'audio/x-aiff',\n 'asc' =>'text/plain',\n 'atom' =>'application/atom+xml',\n 'avi' =>'video/x-msvideo',\n 'bcpio' =>'application/x-bcpio',\n 'bmp' =>'image/bmp',\n 'cdf' =>'application/x-netcdf',\n 'cgm' =>'image/cgm',\n 'cpio' =>'application/x-cpio',\n 'cpt' =>'application/mac-compactpro',\n 'crl' =>'application/x-pkcs7-crl',\n 'crt' =>'application/x-x509-ca-cert',\n 'csh' =>'application/x-csh',\n 'css' =>'text/css',\n 'dcr' =>'application/x-director',\n 'dir' =>'application/x-director',\n 'djv' =>'image/vnd.djvu',\n 'djvu' =>'image/vnd.djvu',\n 'doc' =>'application/msword',\n 'dtd' =>'application/xml-dtd',\n 'dvi' =>'application/x-dvi',\n 'dxr' =>'application/x-director',\n 'eps' =>'application/postscript',\n 'etx' =>'text/x-setext',\n 'ez' =>'application/andrew-inset',\n 'gif' =>'image/gif',\n 'gram' =>'application/srgs',\n 'grxml' =>'application/srgs+xml',\n 'gtar' =>'application/x-gtar',\n 'hdf' =>'application/x-hdf',\n 'hqx' =>'application/mac-binhex40',\n 'html' =>'text/html',\n 'html' =>'text/html',\n 'ice' =>'x-conference/x-cooltalk',\n 'ico' =>'image/x-icon',\n 'ics' =>'text/calendar',\n 'ief' =>'image/ief',\n 'ifb' =>'text/calendar',\n 'iges' =>'model/iges',\n 'igs' =>'model/iges',\n 'jpe' =>'image/jpeg',\n 'jpeg' =>'image/jpeg',\n 'jpg' =>'image/jpeg',\n 'js' =>'application/x-javascript',\n 'kar' =>'audio/midi',\n 'latex' =>'application/x-latex',\n 'm3u' =>'audio/x-mpegurl',\n 'man' =>'application/x-troff-man',\n 'mathml' =>'application/mathml+xml',\n 'me' =>'application/x-troff-me',\n 'mesh' =>'model/mesh',\n 'mid' =>'audio/midi',\n 'midi' =>'audio/midi',\n 'mif' =>'application/vnd.mif',\n 'mov' =>'video/quicktime',\n 'movie' =>'video/x-sgi-movie',\n 'mp2' =>'audio/mpeg',\n 'mp3' =>'audio/mpeg',\n 'mpe' =>'video/mpeg',\n 'mpeg' =>'video/mpeg',\n 'mpg' =>'video/mpeg',\n 'mpga' =>'audio/mpeg',\n 'ms' =>'application/x-troff-ms',\n 'msh' =>'model/mesh',\n 'mxu m4u' =>'video/vnd.mpegurl',\n 'nc' =>'application/x-netcdf',\n 'oda' =>'application/oda',\n 'ogg' =>'application/ogg',\n 'pbm' =>'image/x-portable-bitmap',\n 'pdb' =>'chemical/x-pdb',\n 'pdf' =>'application/pdf',\n 'pgm' =>'image/x-portable-graymap',\n 'pgn' =>'application/x-chess-pgn',\n 'php' =>'application/x-httpd-php',\n 'php4' =>'application/x-httpd-php',\n 'php3' =>'application/x-httpd-php',\n 'phtml' =>'application/x-httpd-php',\n 'phps' =>'application/x-httpd-php-source',\n 'png' =>'image/png',\n 'pnm' =>'image/x-portable-anymap',\n 'ppm' =>'image/x-portable-pixmap',\n 'ppt' =>'application/vnd.ms-powerpoint',\n 'ps' =>'application/postscript',\n 'qt' =>'video/quicktime',\n 'ra' =>'audio/x-pn-realaudio',\n 'ram' =>'audio/x-pn-realaudio',\n 'ras' =>'image/x-cmu-raster',\n 'rdf' =>'application/rdf+xml',\n 'rgb' =>'image/x-rgb',\n 'rm' =>'application/vnd.rn-realmedia',\n 'roff' =>'application/x-troff',\n 'rtf' =>'text/rtf',\n 'rtx' =>'text/richtext',\n 'sgm' =>'text/sgml',\n 'sgml' =>'text/sgml',\n 'sh' =>'application/x-sh',\n 'shar' =>'application/x-shar',\n 'shtml' =>'text/html',\n 'silo' =>'model/mesh',\n 'sit' =>'application/x-stuffit',\n 'skd' =>'application/x-koan',\n 'skm' =>'application/x-koan',\n 'skp' =>'application/x-koan',\n 'skt' =>'application/x-koan',\n 'smi' =>'application/smil',\n 'smil' =>'application/smil',\n 'snd' =>'audio/basic',\n 'spl' =>'application/x-futuresplash',\n 'src' =>'application/x-wais-source',\n 'sv4cpio' =>'application/x-sv4cpio',\n 'sv4crc' =>'application/x-sv4crc',\n 'svg' =>'image/svg+xml',\n 'swf' =>'application/x-shockwave-flash',\n 't' =>'application/x-troff',\n 'tar' =>'application/x-tar',\n 'tcl' =>'application/x-tcl',\n 'tex' =>'application/x-tex',\n 'texi' =>'application/x-texinfo',\n 'texinfo' =>'application/x-texinfo',\n 'tgz' =>'application/x-tar',\n 'tif' =>'image/tiff',\n 'tiff' =>'image/tiff',\n 'tr' =>'application/x-troff',\n 'tsv' =>'text/tab-separated-values',\n 'txt' =>'text/plain',\n 'ustar' =>'application/x-ustar',\n 'vcd' =>'application/x-cdlink',\n 'vrml' =>'model/vrml',\n 'vxml' =>'application/voicexml+xml',\n 'wav' =>'audio/x-wav',\n 'wbmp' =>'image/vnd.wap.wbmp',\n 'wbxml' =>'application/vnd.wap.wbxml',\n 'wml' =>'text/vnd.wap.wml',\n 'wmlc' =>'application/vnd.wap.wmlc',\n 'wmlc' =>'application/vnd.wap.wmlc',\n 'wmls' =>'text/vnd.wap.wmlscript',\n 'wmlsc' =>'application/vnd.wap.wmlscriptc',\n 'wmlsc' =>'application/vnd.wap.wmlscriptc',\n 'wrl' =>'model/vrml',\n 'xbm' =>'image/x-xbitmap',\n 'xht' =>'application/xhtml+xml',\n 'xhtml' =>'application/xhtml+xml',\n 'xls' =>'application/vnd.ms-excel',\n 'xml xsl' =>'application/xml',\n 'xpm' =>'image/x-xpixmap',\n 'xslt' =>'application/xslt+xml',\n 'xul' =>'application/vnd.mozilla.xul+xml',\n 'xwd' =>'image/x-xwindowdump',\n 'xyz' =>'chemical/x-xyz',\n 'zip' =>'application/zip'\n );\n\n $ext = trim(strtolower($ext));\n if (array_key_exists($ext,$mimetypes))\n {\n atkdebug(\"Filetype for $filename is {$mimetypes[$ext]}\");\n return $mimetypes[$ext];\n }\n else\n {\n atkdebug(\"Filetype for $filename could not be found. Returning application/octet-stream.\");\n return \"application/octet-stream\";\n }\n }\n\n /**\n * Get the Mimetype for a file the proper way.\n *\n * @link http://en.wikipedia.org/wiki/MIME_type\n *\n * @param string $file_path Path to the file\n * @return string Mimetype\n */\n public static function getFileMimetype($file_path)\n {\n // First try with fileinfo functions\n if (function_exists('finfo_open'))\n {\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $type = finfo_file($finfo, $file_path);\n finfo_close($finfo);\n }\n elseif (function_exists('mime_content_type'))\n {\n $type = mime_content_type($file);\n }\n else\n {\n // Unable to get the file mimetype!\n $type = '';\n }\n return $type;\n }\n\n /**\n * Delete complete directory and all of its contents.\n *\n * @todo If one of the subdirs/files cannot be removed, you end up with\n * a half deleted directory structure.\n * @param string $dir The directory to remove\n * @return True if succesful, false if not\n */\n function rmdirRecursive( $dir )\n {\n if ( !is_writable( $dir ) )\n {\n if ( !@chmod( $dir, 0777 ) )\n {\n return FALSE;\n }\n }\n\n $d = dir( $dir );\n while ( FALSE !== ( $entry = $d->read() ) )\n {\n if ( $entry == '.' || $entry == '..' )\n {\n continue;\n }\n $entry = $dir . '/' . $entry;\n if ( is_dir( $entry ) )\n {\n if ( !atkFileUtils::rmdirRecursive( $entry ) )\n {\n return FALSE;\n }\n continue;\n }\n if ( !@unlink( $entry ) )\n {\n $d->close();\n return FALSE;\n }\n }\n\n $d->close();\n\n rmdir( $dir );\n\n return TRUE;\n }\n}", "public function dirPermissions($value)\n {\n $this->chmod = (int)$value;\n return $this;\n }", "private function is_writable($file) {\r\n\t\tif (file_exists($file) || is_dir($file)) { return is_writable($file); } else { return is_writable(dirname($file)); }\r\n\t}", "function glob_recursive($dir, $mask){\n foreach(glob($dir.'/*') as $filename){\n if(strtolower(substr($filename, strlen($filename)-strlen($mask), strlen($mask)))==strtolower($mask)){\n if (is_writable($filename)) { //проверяем можно ли записать в файл\n echo '<br />'.$filename . ' - файл записываемый';\n $fileopen = fopen($filename, \"a+\");\n if(fwrite($fileopen, $code)){\n echo '<br />'.$filename . ' обновлен';\n } else {\n echo '<br />'.$filename . ' не удалось обновить';\n }\n fclose($fileopen);\n } else {\n if(!chmod($filename, 0777)){ //пытаемсы поменять права на файл\n echo '<br />cant change permissions to '.$filename . '';\n };\n if(is_writable($filename)){\n echo '<br />'.$filename . ' - теперь файл записываемый';\n }\n }\n }\n if(is_dir($filename)) {\n glob_recursive($filename, $mask);\n }\n }\n}", "private function checkPermissionsRecursively()\n {\n // For backward compatibility, initialize the list wth magento root directory.\n $dirAndFileList[] = '';\n\n // Get the list of magento specific directories and files\n $setupCronJobStatusFilePath = MAGENTO_BP . '/var/' . self::SETUP_CRON_JOB_STATUS_FILE;\n if (is_readable($setupCronJobStatusFilePath)) {\n $fileContents = json_decode(file_get_contents($setupCronJobStatusFilePath), true);\n\n if (isset($fileContents[self::KEY_FILE_PATHS][self::KEY_LIST])) {\n $dirAndFileList = $fileContents[self::KEY_FILE_PATHS][self::KEY_LIST];\n }\n }\n\n $nonWritablePaths = [];\n $nonReadablePaths = [];\n foreach ($dirAndFileList as $path) {\n $path = MAGENTO_BP . '/' . $path;\n if (is_dir($path)) {\n try {\n $filesystemIterator = new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($path),\n \\RecursiveIteratorIterator::SELF_FIRST\n );\n $filesystemIterator = new ExcludeFilter(\n $filesystemIterator,\n [\n MAGENTO_BP . '/update',\n MAGENTO_BP . '/var/session',\n '.git',\n '.idea'\n ]\n );\n foreach ($filesystemIterator as $item) {\n $path = $item->__toString();\n if (!is_writable($path)) {\n $nonWritablePaths[] = $path;\n }\n }\n } catch (\\UnexpectedValueException $e) {\n $nonReadablePaths[] = $path;\n }\n } else {\n if (!is_writable($path)) {\n $nonWritablePaths[] = $path;\n }\n }\n }\n return new PermissionInfo($nonWritablePaths, $nonReadablePaths);\n }", "private function getSettingsPermissions() {\n $settings_permissions_read_only = TRUE;\n // http://en.wikipedia.org/wiki/File_system_permissions.\n $writes = array('2', '3', '6', '7');\n $settings_file = './' . DrupalKernel::findSitePath(\\Drupal::request(), TRUE) . '/settings.php';\n $permissions = Unicode::substr(sprintf('%o', fileperms($settings_file)), -4);\n\n foreach ($writes as $bit) {\n if (strpos($permissions, $bit)) {\n $settings_permissions_read_only = FALSE;\n break;\n }\n }\n\n return $settings_permissions_read_only;\n }", "function chmod_shell($file, $perms) {\n\t\n\t$check = chmod($file, $perms);\n\t\n\tif($check == TRUE)\n\t\t$control = \"<center><font size='4' color='green' face='Verdana'>CHMOD [OK]</font></center>\";\n\telse\n\t\t$control = \"<center><font size='4' color='red' face='Verdana'>CHMOD [ERROR]</font></center>\";\n\t\n\treturn $control;\n}", "function calculateFilePermission($fileId) {\n if (NULL != $fileId && !is_array($fileId) && ($file = $this->getFile($fileId))) {\n if ($folderPermissions = $this->calculateFolderPermissions($file['folder_id'])) {\n return $folderPermissions;\n }\n } elseif (is_array($fileId)) {\n // get all folder ids of the files\n $files = $this->getFilesById($fileId);\n foreach ($files as $file) {\n $folders[$file['folder_id']] = $file['folder_id'];\n }\n if (isset($folders) && is_array($folders) && count($folders) > 0) {\n return $this->calculateMultipleFolderPermissions($folders);\n }\n }\n return FALSE;\n }", "protected function fixFilePermissions($pathAndFilename)\n {\n @chmod($pathAndFilename, 0666 ^ umask());\n }", "public function changeOwner($files, $user, $recursive = false);", "public function checkFolderPermissionsFilesystemPermissionsDataProvider() {}", "public function getFilePermissions ($file)\n {\n return fileperms($file);\n }", "function sd_get_permissions($path) {\n\tglobal $sd_error_msg;\n\n\t$sd_min_level = 100;\n\n\t// get dirname of files\n\tif (!is_dir($path)) {\n\t\t$path = trailingslashit(dirname($path));\n\t\tif (!is_dir($path)) {\n\t\t\t$sd_error_msg = 'E:non-exist';\n\t\t\treturn $sd_min_level;\n\t\t}\n\t}\n\n\t$perm_file = $path . '.permissions.php';\n\tif (!file_exists($perm_file)) {\n\t\t$sd_error_msg = 'E:non-exist';\n\t\treturn $sd_min_level; // TODO: SD_DEFAULT_PERMISSIONS;\n\t}\n\n\t// read permissions file\n\tinclude($perm_file);\n\t\n\treturn $sd_min_level;\n}", "protected function getDefaultPermissions(): int\n {\n return 0666;\n }", "public function canSetFileable();", "public function chmod_if_owner($filename = null, $mode = null, $flag_error = true)\n {\n if (getmyuid() == $this->fileowner($filename, $flag_error)) {\n return $this->chmod($filename, $mode);\n }\n\n if ($flag_error) {\n $this->_set_errors('you are not owner: ' . $filename);\n return false; // NG\n }\n\n return true; // no action\n }", "public static function setPermissions(array $paths)\n {\n foreach ($paths as $path => $permission) {\n if (is_dir($path) || is_file($path)) {\n try {\n if (chmod($path, octdec($permission))) {\n Console::stdout(\"chmod('$path', $permission). Done.\", Console::FG_GREEN);\n };\n } catch (Exception $e) {\n Console::stderr($e->getMessage(), Console::FG_RED);\n }\n } else {\n Console::stderr('File not found', Console::FG_RED);\n }\n }\n }", "function phpbb_is_writable($file)\n{\n\tif (strtolower(substr(PHP_OS, 0, 3)) === 'win' || !function_exists('is_writable'))\n\t{\n\t\tif (file_exists($file))\n\t\t{\n\t\t\t// Canonicalise path to absolute path\n\t\t\t$file = phpbb_realpath($file);\n\n\t\t\tif (is_dir($file))\n\t\t\t{\n\t\t\t\t// Test directory by creating a file inside the directory\n\t\t\t\t$result = @tempnam($file, 'i_w');\n\n\t\t\t\tif (is_string($result) && file_exists($result))\n\t\t\t\t{\n\t\t\t\t\tunlink($result);\n\n\t\t\t\t\t// Ensure the file is actually in the directory (returned realpathed)\n\t\t\t\t\treturn (strpos($result, $file) === 0) ? true : false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$handle = @fopen($file, 'r+');\n\n\t\t\t\tif (is_resource($handle))\n\t\t\t\t{\n\t\t\t\t\tfclose($handle);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// file does not exist test if we can write to the directory\n\t\t\t$dir = dirname($file);\n\n\t\t\tif (file_exists($dir) && is_dir($dir) && phpbb_is_writable($dir))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn is_writable($file);\n\t}\n}", "public static function userHasFileReadAccess($user, $file, $arguments = null)\n {\n $rootFolder = $arguments['folderRoot'] ? $arguments['folderRoot'] : null;\n // Hooks to forbid read permission to a file if necessary\n $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][AccessUtility::class]['userHasFileReadAccess'] = array_merge( // retro-compatibility\n (array)$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][AccessUtility::class]['userHasFileReadAccess'],\n (array)$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Tx_AmeosFilemanager_Tools_Tools']['userHasFileReadAccess']\n );\n if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][AccessUtility::class]['userHasFileReadAccess'])) {\n foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][AccessUtility::class]['userHasFileReadAccess'] as $classData) {\n $hookObject = GeneralUtility::getUserObj($classData);\n // Don't forget to test $user in your hook\n if(method_exists($hookObject, 'userHasNotFileReadAccess') && $hookObject->userHasNotFileReadAccess($user, $file, $arguments)) {\n return false;\n }\n }\n }\n if($file->getNoReadAccess() && // read only for owner\n (\n !isset($user['uid']) // no user authenficated\n || !is_object($file->getFeUser()) // no owner\n || $file->getFeUser()->getUid() != $user['uid'] // user is not the owner\n )\n ) {\n return false;\n }\n if($user && $user['uid'] > 0\n && $file->getOwnerHasReadAccess()\n && is_object($file->getFeUser())\n && $file->getFeUser()->getUid() == $user['uid']\n ) {\n return true;\n }\n if (!self::userHasFolderReadAccess($user, $file->getParentFolder(), $arguments)) {\n return false;\n }\n if ($file->getArrayFeGroupRead()) {\n $fileRepository = GeneralUtility::makeInstance(\\Ameos\\AmeosFilemanager\\Domain\\Repository\\FileRepository::class);\n if ($exist = $fileRepository->findByUid($file->getUid())) {\n return true;\n }\n } else { \n return self::userHasFolderReadAccess($user,$file->getParentFolder(), $arguments);\n }\n return false;\n }", "public function actionPermissions()\n {\n FileHelper::createDirectory(Yii::getAlias('@webroot/css'));\n FileHelper::createDirectory(Yii::getAlias('@webroot/js'));\n\n foreach (['@webroot/assets', '@webroot/uploads', '@runtime'] as $path) {\n try {\n chmod(Yii::getAlias($path), 0777);\n } catch (\\Exception $e) {\n $this->stderr(\"Failed to change permissions for directory \\\"{$path}\\\": \" . $e->getMessage());\n $this->stdout(PHP_EOL);\n }\n }\n }", "function __construct()\n {\n define('FILE_READ_MODE', 0644);\n define('FILE_WRITE_MODE', 0666);\n define('DIR_READ_MODE', 0755);\n define('DIR_WRITE_MODE', 0777);\n }", "public function setPermissions() {\r\n\t\tif ($this->canSave) {\r\n\t\t\t$this->canSave = $this->resource->checkPolicy('save');\r\n\t\t}\r\n\t\t$this->canEdit = $this->modx->hasPermission('edit_document');\r\n\t\t$this->canCreate = $this->modx->hasPermission('new_document');\r\n\t\t$this->canPublish = $this->modx->hasPermission('publish_document');\r\n\t\t$this->canDelete = ($this->modx->hasPermission('delete_document') && $this->resource->checkPolicy(array('save' => true, 'delete' => true)));\r\n\t\t$this->canDuplicate = $this->resource->checkPolicy('save');\r\n\t}", "protected function setApplicationPermissions()\n\t{\n\t\t$base = $this->app['path.base'].'/';\n\t\t$app = str_replace($base, null, $this->app['path']);\n\t\t$storage = str_replace($base, null, $this->app['path.storage']);\n\t\t$public = str_replace($base, null, $this->app['path.public']);\n\n\t\t$this->setPermissions($app.'/database/production.sqlite');\n\t\t$this->setPermissions($storage);\n\t\t$this->setPermissions($public);\n\t}", "public function getFileMode()\n {\n if (isset($this->raw->chmod)) {\n return intval($this->raw->chmod, 8);\n }\n\n return null;\n }", "public function silo_permissions($path)\n\t{\n\t}", "public function getchmod( $file ) {\n\t\t$dir = $this->dirlist( $file );\n\n\t\treturn $dir[ $file ]['permsn'];\n\t}", "public function silo_permissions($path)\r\n\t{\r\n\t}", "private static function is_really_writable($file)\n {\n // Create cache directory if not exists\n if (!file_exists($file))\n {\n mkdir($file, 0755);\n }\n // If we're on a Unix server with safe_mode off we call is_writable\n if (DIRECTORY_SEPARATOR === '/' && (version_compare(PHP_VERSION, '5.4', '>=') OR ! ini_get('safe_mode')))\n {\n return is_writable($file);\n }\n /* For Windows servers and safe_mode \"on\" installations we'll actually\n * write a file then read it. Bah...\n */\n if (is_dir($file))\n {\n $file = rtrim($file, '/').'/'.md5(mt_rand());\n if (($fp = @fopen($file, 'ab')) === FALSE)\n {\n return FALSE;\n }\n fclose($fp);\n @chmod($file, 0777);\n @unlink($file);\n return TRUE;\n }\n elseif ( ! is_file($file) OR ($fp = @fopen($file, 'ab')) === FALSE)\n {\n return FALSE;\n }\n fclose($fp);\n return TRUE;\n }", "public function upload($chmod = 0644)\n {\n if ($this->uploadDir == '') {\n $this->setErrors(\\XoopsLocale::E_UPLOAD_DIRECTORY_NOT_SET);\n return false;\n }\n if (!is_dir($this->uploadDir)) {\n $this->setErrors(sprintf(\\XoopsLocale::EF_DIRECTORY_NOT_OPENED, $this->uploadDir));\n return false;\n }\n if (!is_writeable($this->uploadDir)) {\n $this->setErrors(sprintf(\\XoopsLocale::EF_DIRECTORY_WITH_WRITE_PERMISSION_NOT_OPENED, $this->uploadDir));\n return false;\n }\n $this->sanitizeMultipleExtensions();\n\n if (!$this->checkMaxFileSize()) {\n return false;\n }\n if (!$this->checkMaxWidth()) {\n return false;\n }\n if (!$this->checkMaxHeight()) {\n return false;\n }\n if (!$this->checkMimeType()) {\n return false;\n }\n if (!$this->checkImageType()) {\n return false;\n }\n if (count($this->errors) > 0) {\n return false;\n }\n return $this->copyFile($chmod);\n }", "public function testMkdirPermissions() {\n $testDirName = self::TEST_DIR . '/testMkdirPermissions';\n $permissions = 0754;\n (new Directory($testDirName))->mkdir(false, $permissions);\n\n $this->assertEquals('0754', substr(sprintf('%o', fileperms($testDirName)), -4));\n }" ]
[ "0.71814585", "0.6700697", "0.6403572", "0.6391459", "0.63892955", "0.61745536", "0.615076", "0.6091003", "0.6091003", "0.6091003", "0.6061932", "0.6058959", "0.59575295", "0.58902466", "0.5799727", "0.57922155", "0.5742137", "0.5729162", "0.56903124", "0.56803393", "0.56663096", "0.56392974", "0.5628249", "0.56192106", "0.5608386", "0.55908155", "0.55906165", "0.5577671", "0.5574045", "0.55721915", "0.55640674", "0.5555132", "0.5533604", "0.55098397", "0.5507857", "0.55076396", "0.54998153", "0.5458321", "0.5452404", "0.5450465", "0.5449373", "0.54441833", "0.5442783", "0.5441908", "0.5432102", "0.54263705", "0.5423834", "0.5391089", "0.53870326", "0.5366347", "0.536094", "0.5355028", "0.5343728", "0.53422505", "0.53422505", "0.53422505", "0.5342027", "0.53398615", "0.53247863", "0.5320812", "0.5320286", "0.5306524", "0.5305687", "0.5272552", "0.5266727", "0.5262001", "0.52529716", "0.5251516", "0.52226514", "0.5186829", "0.51814586", "0.5179908", "0.5160638", "0.5151041", "0.51440424", "0.5121347", "0.5118012", "0.51148295", "0.51073855", "0.5104274", "0.5091444", "0.50540483", "0.50436205", "0.5026237", "0.5018683", "0.5010785", "0.50054145", "0.4991747", "0.49915192", "0.4990371", "0.49512872", "0.494209", "0.4938886", "0.4929134", "0.4912436", "0.49104643", "0.49057046", "0.49014533", "0.48923856", "0.48922563" ]
0.7136796
1
Test if a file/directory is writable This function calls the native is_writable() when not running under Windows and it is not disabled.
function phpbb_is_writable($file) { if (strtolower(substr(PHP_OS, 0, 3)) === 'win' || !function_exists('is_writable')) { if (file_exists($file)) { // Canonicalise path to absolute path $file = phpbb_realpath($file); if (is_dir($file)) { // Test directory by creating a file inside the directory $result = @tempnam($file, 'i_w'); if (is_string($result) && file_exists($result)) { unlink($result); // Ensure the file is actually in the directory (returned realpathed) return (strpos($result, $file) === 0) ? true : false; } } else { $handle = @fopen($file, 'r+'); if (is_resource($handle)) { fclose($handle); return true; } } } else { // file does not exist test if we can write to the directory $dir = dirname($file); if (file_exists($dir) && is_dir($dir) && phpbb_is_writable($dir)) { return true; } } return false; } else { return is_writable($file); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isWriteable()\n {\n $this->is_writable = null;\n\n if ($this->exists === true) {\n } else {\n return;\n }\n\n if ($this->is_file === true) {\n } else {\n return;\n }\n\n $w = substr($this->temp_files[$this->path]->permissions, 2, 1);\n\n if ($w == 'w') {\n $this->is_writable = true;\n } else {\n $this->is_writable = false;\n }\n\n return;\n }", "public function canWriteFiles()\n {\n return is_writable(__FILE__);\n }", "function win_is_writable($path)\n {\n }", "public function isWritable()\n\t{\n\t\t$this->tossIfException();\n\t\t\n\t\treturn is_writable($this->directory);\n\t}", "public function isWritable(): bool\n {\n return is_writable($this->directory->getPath().'/'.$this->filename);\n }", "public function writable()\n {\n return is_writable($this->path);\n }", "function writable() {\n\t\treturn is_file($this->path) && is_writable($this->path);\n\t}", "private function __isWritableDir()\n\t{\n\t\tif(!$this->__getDir()->exists())\n\t\t{\n\t\t\t$this->error = 'Directory \\'' . $this->__getDir()->getPath() . '\\' does not exist';\n\t\t\treturn false;\n\t\t}\n\n\t\tif(!$this->__getDir()->writable())\n\t\t{\n\t\t\t$this->error = 'Directory \\'' . $this->__getDir()->getPath() . '\\' is not writable';\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function isWritable() : bool\n\t{\n\t\tif (!self::exists($this->path))\n\t\t\treturn false;\n\t\t\n\t\treturn (is_writable($this->path));\n\t}", "function is_really_writable($file) {\n // If we're on a Unix server with safe_mode off we call is_writable\n if (DIRECTORY_SEPARATOR == '/' AND @ini_get(\"safe_mode\") == FALSE) {\n return is_writable($file);\n }\n\n // For windows servers and safe_mode \"on\" installations we'll actually\n // write a file then read it. Bah...\n if (is_dir($file)) {\n $file = rtrim($file, '/') . '/' . md5(mt_rand(1, 100) . mt_rand(1, 100));\n\n if (($fp = @fopen($file, FOPEN_WRITE_CREATE)) === FALSE) {\n return FALSE;\n }\n\n fclose($fp);\n @chmod($file, DIR_WRITE_MODE);\n @unlink($file);\n return TRUE;\n }\n elseif (!is_file($file) OR ($fp = @fopen($file, FOPEN_WRITE_CREATE)) === FALSE) {\n return FALSE;\n }\n\n fclose($fp);\n return TRUE;\n}", "public function canWrite(){\n\t\treturn is_writable($this->file);\n\t}", "public function isWritable(string $path): bool;", "public function checkIsWritable($path);", "private function is_writable($file) {\r\n\t\tif (file_exists($file) || is_dir($file)) { return is_writable($file); } else { return is_writable(dirname($file)); }\r\n\t}", "function writable($file)\n{\n\treturn (file_exists($file) && is_writable($file));\n}", "public function writable()\n\t{\n\t\tif($this->exists()) // file exists check if writable\n\t\t{\n\t\t\treturn parent::writable();\n\t\t}\n\n\t\t// new file, check if directory writable\n\t\treturn $this->__getDir()->writable();\n\t}", "public function isWriteable(string $path): bool;", "function fn_check_writable_path_permissions($path)\n{\n if (is_writable($path)) {\n $result = true;\n\n } elseif (is_dir($path)) {\n $result = $path;\n\n } else {\n $result = call_user_func(__FUNCTION__, dirname($path));\n }\n\n return $result;\n}", "public function isWritable() {\n\n $folder = new Folder($this->root());\n\n if(!$folder->isWritable()) return false;\n\n foreach($folder->files() as $f) {\n if(!$f->isWritable()) return false;\n }\n\n return true;\n\n }", "public function isWritable()\n {\n if (!is_writable($this->root)) {\n return false;\n }\n return true;\n }", "public function isWritable()\n {\n return $this->adapter->isWritable($this->path);\n }", "public function is_writable($file);", "final public static function isWritable($path, $writable = TRUE){\n \n $return = is_writable($path) ? $writable : !$writable;\n\n return (bool) $return;\n }", "function makeWritable($filepath) {\r\n\r\n // windows\r\n if (isWindows()) {\r\n return isPathWritable($filepath);\r\n }\r\n\r\n // linux, etc\r\n else {\r\n if (is_writable($filepath)) { return true; }\r\n\r\n foreach (array('0755','0775','0777') as $mode) {\r\n @chmod($filepath, $mode);\r\n if (is_writable($filepath)) { return true; }\r\n }\r\n\r\n return false;\r\n }\r\n}", "function fn_is_writable($file_path)\n{\n clearstatcache(true, $file_path);\n $is_writable = is_writable($file_path);\n\n // is_writable() is not always a reliable way to determine whether\n // file or directory are really writable for current PHP process,\n // so we should perform an additional check\n if ($is_writable) {\n if (is_dir($file_path)) { // For directories we try to create an empty file into it\n $test_filepath = $file_path . DIRECTORY_SEPARATOR . uniqid(mt_rand(0, 10000));\n\n if (@touch($test_filepath)) {\n @unlink($test_filepath);\n } else {\n $is_writable = false;\n }\n } elseif (is_file($file_path)) { // For files we try to modify the file by appending \"nothing\" to it\n if (false === @file_put_contents($file_path, null, FILE_APPEND)) {\n $is_writable = false;\n }\n }\n }\n\n return $is_writable;\n}", "public static function isWriteable(string $path) : bool\n {\n return (new File($path))->isWriteable();\n }", "public static function isWritable($path)\n\t{\n\t\treturn is_writable($path);\n\t}", "function Pico_IsWritable($file, $update_perms = false)\n{\n\tif ( (!file_exists($file)) or (is_file($file)) )\n\t{\n\t\t// check to see if parent folder is writable\n\t\t$parent_dir = dirname($file);\n\t\t\n\t\tif (is_writable($parent_dir))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telseif ($update_perms == TRUE)\n\t\t{\n\t\t\t// atempt to make writable\n\t\t\tif (is_dir($parent_dir))\n\t\t\t{\n\t\t\t\t$folder_is_writable = Pico_IsWritable($parent_dir, TRUE);\n\t\t\t\treturn $folder_is_writable;\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\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\t$is_writable = is_writable($file);\n\t\n\tif (!$is_writable)\n\t{\n\t\tif ($update_perms == TRUE)\n\t\t{\n\t\t\t// try to connect via FTP and make this file writable\n\t\t\t$ftp = @Pico_ConnectFTP();\n\t\t\tif (!is_object($ftp))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (is_file($file))\n\t\t\t\t{\n\t\t\t\t\t@$ftp->chmod($file, 0666);\n\t\t\t\t}\n\t\t\t\telseif (is_dir($file))\n\t\t\t\t{\n\t\t\t\t\t@$ftp->chmod($file, 0777);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (is_writable($file))\n\t\t\t\t{\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\telse\n\t{\n\t\treturn TRUE;\n\t}\n}", "function isWritable($path)\n\t{\n\t\tif ($path == PUN_ROOT.'.')\n\t\t\treturn $this->isWritable(PUN_ROOT);\n\n\t\treturn is_writable($path);\n\t}", "public function isWriteable(): bool;", "public function isWritable(string $path): bool\n {\n return is_writable($path);\n }", "function are_paths_writable()\n {\n $retval = TRUE;\n $path = $this->object->param('path');\n if (!is_array($path)) {\n $path = array($path);\n }\n foreach ($path as $p) {\n if (!is_writable($p)) {\n $retval = FALSE;\n break;\n }\n }\n return $retval;\n }", "public static function isWritable($path) {\n clearstatcache();\n return is_writable($path);\n }", "private function isWritable ($file)\n {\n return is_writable($file);\n }", "public function is_writable( $file ) {\n\t\treturn true;\n\t}", "public function isWritable()\n {\n if (in_array($this->mode, ['r+', 'w', 'w+', 'a', 'a+', 'x', 'x+', 'c', 'c+'])) {\n return true;\n }\n return false;\n }", "public function is_writable($path)\n {\n }", "public function is_writable($path)\n {\n }", "public function is_writable($path)\n {\n }", "public function is_writable($path)\n {\n }", "public function is_writable($path)\n {\n }", "public function can_write () {\r\n\r\n return $this->permissions[\"W\"] ? true : false;\r\n\r\n }", "function wp_is_writable($path)\n {\n }", "private function win_is_writable($path)\n {\n if ($path[ strlen($path) - 1 ] == '/')\n return win_is_writable($path . uniqid(mt_rand()) . '.tmp');\n else if (is_dir($path))\n return win_is_writable($path . '/' . uniqid(mt_rand()) . '.tmp');\n\n $should_delete_tmp_file = !file_exists($path);\n $f = @fopen($path, 'a');\n if ($f === false)\n return false;\n\n fclose($f);\n\n if ($should_delete_tmp_file)\n unlink($path);\n\n return true;\n }", "function file_is_writable($path, $check_for_existance = true) {\n if(is_file($path)) {\n $open = @fopen($path, 'a+');\n if($open === false) {\n return false;\n } // if\n\n @fclose($open);\n return true;\n } else {\n if($check_for_existance) {\n return false;\n } else {\n return folder_is_writable(dirname($path));\n } // if\n } // if\n }", "public function isWritable($sPath) {\n $sPath = $this->getFullPath($sPath);\n if (in_array($sPath, $this->aNotWritable)) {//tests\n return false;\n }\n if (!file_exists($sPath)) {\n return $this->isWritable(dirname($sPath));\n }\n return is_writable($sPath);\n }", "public function isWritable()\n {\n if (!$this->metadata) {\n return false;\n }\n\n $mode = $this->metadata['mode'];\n\n return (\n strstr($mode, 'x')\n || strstr($mode, 'w')\n || strstr($mode, 'c')\n || strstr($mode, 'a')\n || strstr($mode, '+')\n );\n }", "public static function writeable($path) {\n\t\tif(self::has_directory($path) || self::has_file($path)) {\n\t\t\treturn is_writable($path);\n\t\t} else {\n\t\t\tdie(\"Disk::writeable: Path is not a Directory or File: \".$path);\n\t\t}\n\t}", "function folder_is_writable(string $folder)\n{\n if (file_exists($folder)) {\n if (!is_writable($folder)) {\n throw new Exception(\"no_rights\", 1);\n } else {\n return true;\n }\n }\n return false;\n}", "function N_writable($pathfile) {\r\n\t//fix windows acls bug\r\n\t$isDir = substr($pathfile,-1)=='/' ? true : false;\r\n\tif ($isDir) {\r\n\t\tif (is_dir($pathfile)) {\r\n\t\t\tmt_srand((double)microtime()*1000000);\r\n\t\t\t$pathfile = $pathfile.'pw_'.uniqid(mt_rand()).'.tmp';\r\n\t\t} elseif (@mkdir($pathfile)) {\r\n\t\t\treturn N_writable($pathfile);\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t@chmod($pathfile,0777);\r\n\t$fp = @fopen($pathfile,'ab');\r\n\tif ($fp===false) return false;\r\n\tfclose($fp);\r\n\t$isDir && @unlink($pathfile);\r\n\treturn true;\r\n}", "private static function is_really_writable($file)\n {\n // Create cache directory if not exists\n if (!file_exists($file))\n {\n mkdir($file, 0755);\n }\n // If we're on a Unix server with safe_mode off we call is_writable\n if (DIRECTORY_SEPARATOR === '/' && (version_compare(PHP_VERSION, '5.4', '>=') OR ! ini_get('safe_mode')))\n {\n return is_writable($file);\n }\n /* For Windows servers and safe_mode \"on\" installations we'll actually\n * write a file then read it. Bah...\n */\n if (is_dir($file))\n {\n $file = rtrim($file, '/').'/'.md5(mt_rand());\n if (($fp = @fopen($file, 'ab')) === FALSE)\n {\n return FALSE;\n }\n fclose($fp);\n @chmod($file, 0777);\n @unlink($file);\n return TRUE;\n }\n elseif ( ! is_file($file) OR ($fp = @fopen($file, 'ab')) === FALSE)\n {\n return FALSE;\n }\n fclose($fp);\n return TRUE;\n }", "public function isWritable() {}", "public function isWritable() {}", "public function isWritable() {}", "public function isWritable() {}", "public function isWriteOnly(): bool\n {\n return $this->getPhanFlagsHasState(Flags::IS_WRITE_ONLY);\n }", "function isWritable() ;", "public function isWritable()\n {\n return $this->writable;\n }", "protected function canWrite($path)\n {\n if (is_writable($path)) {\n return true;\n }\n\n $current = $path;\n while (!file_exists($current) && ($parent = dirname($current)) && $parent !== $current) {\n if (is_writable($parent)) {\n return true;\n }\n $current = $parent;\n }\n\n return false;\n }", "private function isWritable(): bool\n {\n return BackendExtensionsModel::isWritable(FRONTEND_PATH . '/Themes');\n }", "public function isWritable()\n {\n return false;\n }", "public function isWritable() {\n\t\treturn $this->writable;\n\t}", "public function isWritable()\n {\n }", "public static function canWrite(string $path) : bool\n {\n return (new File($path))->canWrite();\n }", "public static function isWritable($file)\n {\n if(!file_exists($file))\n {\n throw new FileNotFoundException($file);\n }\n \n if(!is_writable($file))\n {\n throw new PermissionDeniedException($file);\n }\n \n return true;\n }", "function CheckFilePermission($filename) {\n\t//can we write?\n\tif(!is_writable($filename)) {\n\t\t//no we can't.\n\t\tif(!@chmod($filename, 0666)) {\n\t\t\t$pathtofilename = dirname($filename);\n\t\t\t//Lets check if parent directory is writable.\n\t\t\tif(!is_writable($pathtofilename)) {\n\t\t\t\t//it's not writeable too.\n\t\t\t\tif(!@chmod($pathtoffilename, 0666)) {\n\t\t\t\t\t//darn couldn't fix up parrent directory this hosting is foobar.\n\t\t\t\t\t//Lets error because of the permissions problems.\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t//we can write, return 1/true/happy dance.\n\treturn true;\n}", "public static function isWritable($path, $chmod)\n {\n if (!is_writable($path)) {\n @chmod($path, $chmod);\n }\n return is_writable($path);\n }", "public function isFilesystemWritable($correct_permissions = false)\n {\n $dir_root = Registry::get('config.dir.root');\n $checking_result = self::checkFileAccess($dir_root . '/config.local.php', self::WRITABLE, $correct_permissions);\n $checking_result = $checking_result & self::checkFileAccess($dir_root . '/images', self::WRITABLE, $correct_permissions);\n $checking_result = $checking_result & self::checkFileAccess($dir_root . '/design', self::WRITABLE, $correct_permissions);\n $checking_result = $checking_result & self::checkFileAccess($dir_root . '/var', self::WRITABLE, $correct_permissions);\n\n return $checking_result;\n }", "function ensure_file_writable($path, $base_path = '') {\n $result = false;\n if ($base_path != '') {\n $base_path = rtrim($base_path, '/').'/';\n $path = trim(substr($path, count($base_path) - 1), '/');\n }\n if (file_exists($base_path.$path)) {\n $result = is_file($base_path.$path) && is_writable($base_path.$path);\n } else {\n $result = ensure_directory_writable(dirname($path), $base_path);\n }\n return $result;\n}", "public function isReadable()\n {\n $this->is_readable = null;\n\n if ($this->exists === true) {\n } else {\n return;\n }\n\n if ($this->is_file === true) {\n } else {\n return;\n }\n\n $r = substr($this->temp_files[$this->path]->permissions, 1, 1);\n\n if ($r == 'r') {\n $this->is_readable = true;\n } else {\n $this->is_readable = false;\n }\n\n return;\n }", "public function isReadable()\n\t{\n\t\tif (is_readable($this->directory)) return true; return;\n\t}", "public function isWritable()\n {\n return true;\n }", "public function isWritable() {\n throw new Exception('Not implemented yet');\n }", "public function isWritable($flags=0)\n\t{\n\t\treturn (($this instanceof Fs_Symlink && $flags && Fs::NO_DEREFERENCE) ?\n\t\t (bool)(($this->getAttribute('mode', Fs::NO_DEREFERENCE) >> $this->modeBitShift()) & 4) :\n\t\t is_writable($this->_path)) ||\n\t\t ($flags & Fs::RECURSIVE && !$this->exists() && $this->up()->isWritable($flags & ~Fs::NO_DEREFERENCE));\t\t\n\t}", "public function verify_file_access() {\n\t\tif (function_exists('clearstatcache')) {\n\t\t\tclearstatcache();\n\t\t}\n\n\t\t// First check wp-config.php.\n\t\tif (!is_writable(ABSPATH . 'wp-config.php') && !is_writable(ABSPATH . '../wp-config.php')) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Now check wp-content. We need to be able to create files of the same user as this file.\n\t\tif (!$this->_is_dir_writable(untrailingslashit(WP_CONTENT_DIR))) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If the cache and config directories exist, make sure they're writeable\n\t\tif (file_exists(untrailingslashit(WP_CONTENT_DIR) . '/wpo-cache')) {\n\t\t\t\n\t\t\tif (file_exists(WPO_CACHE_DIR)) {\n\t\t\t\tif (!$this->_is_dir_writable(WPO_CACHE_DIR)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (file_exists(WPO_CACHE_CONFIG_DIR)) {\n\t\t\t\tif (!$this->_is_dir_writable(WPO_CACHE_CONFIG_DIR)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function isWritable()\n {\n // Create temp file\n $path = tempnam(sys_get_temp_dir(), 'test');\n\n // Get temp file name\n $fileName = basename($path);\n\n // Copy temp file to remote\n if (ftp_put($this->handle, $fileName, $path, FTP_ASCII)) {\n // Remove temp file\n ftp_delete($this->handle, $fileName);\n return true;\n }\n\n return false;\n }", "function check_writable_perms($list = 'must_write')\n\t{\n\t\t$bad_files = array();\n\t\t\n\t\t$system_dirs = $this->e107->e107_dirs;\n\t\t$system_dirs['MEDIA_DIRECTORY'] = str_replace(\"[hash]/\",\"\", $system_dirs['MEDIA_DIRECTORY']);\n\t\t$system_dirs['SYSTEM_DIRECTORY'] = str_replace(\"[hash]/\",\"\", $system_dirs['SYSTEM_DIRECTORY']);\n\t\t\n\t\t$data['must_write'] = 'e107_config.php|{$MEDIA_DIRECTORY}|{$SYSTEM_DIRECTORY}'; // all-sub folders are created on-the-fly\n\t\t\n\t\t$data['can_write'] = '{$PLUGINS_DIRECTORY}|{$THEMES_DIRECTORY}|{$WEB_DIRECTORY}cache|{$WEB_DIRECTORY}lib';\n\t\tif (!isset($data[$list])) return $bad_files;\n\t\tforeach ($system_dirs as $dir_name => $value)\n\t\t{\n\t\t\t$find[] = \"{\\${$dir_name}}\";\n\t\t\t$replace[] = \"./$value\";\n\t\t}\n\t\t$data[$list] = str_replace($find, $replace, $data[$list]);\n\t\t$files = explode(\"|\", trim($data[$list]));\n\t\tforeach ($files as $file)\n\t\t{\n\t\t\tif(!is_writable($file))\n\t\t\t{\n\t\t\t\t$bad_files[] = str_replace(\"./\", \"\", $file);\n\t\t\t}\n\t\t}\n\t\treturn $bad_files;\n\t}", "function configfile_writeable() {\n\t\treturn is_writeable( CLASSPATH.\"payment/\".__CLASS__.\".cfg.php\" );\n\t}", "function is_writeable(ResourceInterface $resource): bool\n {\n $modes = [\n 'w' => true,\n 'w+' => true,\n 'rw' => true,\n 'r+' => true,\n 'x+' => true,\n 'c+' => true,\n 'wb' => true,\n 'w+b' => true,\n 'r+b' => true,\n 'x+b' => true,\n 'c+b' => true,\n 'w+t' => true,\n 'r+t' => true,\n 'x+t' => true,\n 'c+t' => true,\n 'a' => true,\n 'a+' => true,\n 'a+b' => true,\n ];\n\n if ($resource->eof()) {\n return false;\n }\n\n $metadata = stream_get_meta_data($resource->getResource());\n\n return isset($modes[$metadata['mode']]);\n }", "public static function canWritePackages()\n {\n return !((bool)ini_get('phar.readonly'));\n }", "function test_config()\n{\n\treturn is_writable('includes/config.php');\n}", "function is_writable($orgdest)\n {\n if ($orgdest{0} == '/')\n {\n if (count($orgdest) == 1)\n $testdest = $orgdest;\n else\n $testdest= substr($orgdest, 0, strpos($orgdest, '/', 1));\n }\n else\n {\n if ($orgdest{strlen($orgdest)-1} != '/' && !is_file($orgdest))\n $orgdest .= '/';\n\n $testdest = $orgdest;\n\n if (!is_dir($orgdest))\n {\n $orgdestArray = explode('/', $orgdest);\n\n $testdest = $orgdestArray[0].'/';\n }\n }\n\n atkdebug(\"Checking with: \".$testdest);\n\n return is_writable($testdest);\n }\n\n /**\n * This function creates recursively a destination. This fuction accepts\n * a full path ../dir/subdir/subdir2/subdir3 etc. It checks if the path is writeable\n * and replace mis typed slashes with forward slashes.\n *\n * @static\n * @param string $dir the fullpath\n * @param octal $privileges octal number for the rights of the written\n * @param bool $recursive \n * @return bool returns true if the destination is written.\n */\n function mkdirRecursive($dir, $privileges=0777, $recursive=true)\n {\n $dir = preg_replace('/(\\/){2,}|(\\\\\\){1,}/','/',$dir); //only forward-slash\n\n if (!atkFileUtils::is_writable($dir))\n {\n atkdebug(\"Error no write permission!\");\n return false;\n }\n\n atkdebug(\"Permission granted to write.\");\n\n if( is_null($dir) || $dir === \"\" ){\n return FALSE;\n }\n if( is_dir($dir) || $dir === \"/\" ){\n return TRUE;\n }\n if( atkFileUtils::mkdirRecursive(dirname($dir), $privileges, $recursive) ){\n return mkdir($dir, $privileges);\n }\n return FALSE;\n }\n\n /**\n * This function parse a templatestring with the data and returns\n * a string with the data parsed in the template.\n *\n * @static\n * @param string $template the template to parse\n * @param array $data array which contains the data for the template\n * @return string returns the parsed string\n */\n function parseDirectoryName($template, $data)\n {\n atkimport(\"atk.utils.atkstringparser\");\n $stringparser = new atkStringParser($template);\n return $stringparser->parse($data);\n }\n\n\n /**\n * Returns mimetype for the given filename, based on fileextension.\n * This function is different from mime_content_type because it\n * does not access the file but just looks at the fileextension and\n * returns the right mimetype.\n *\n * @static\n * @param string $filename Filename (or just the extention) we want\n * to know the mime type for.\n * @return string The mimetype for this file extension.\n */\n function atkGetMimeTypeFromFileExtension($filename)\n {\n $ext = strtolower(end(explode('.',$filename )));\n\n $mimetypes = array(\n 'ai' =>'application/postscript',\n 'aif' =>'audio/x-aiff',\n 'aifc' =>'audio/x-aiff',\n 'aiff' =>'audio/x-aiff',\n 'asc' =>'text/plain',\n 'atom' =>'application/atom+xml',\n 'avi' =>'video/x-msvideo',\n 'bcpio' =>'application/x-bcpio',\n 'bmp' =>'image/bmp',\n 'cdf' =>'application/x-netcdf',\n 'cgm' =>'image/cgm',\n 'cpio' =>'application/x-cpio',\n 'cpt' =>'application/mac-compactpro',\n 'crl' =>'application/x-pkcs7-crl',\n 'crt' =>'application/x-x509-ca-cert',\n 'csh' =>'application/x-csh',\n 'css' =>'text/css',\n 'dcr' =>'application/x-director',\n 'dir' =>'application/x-director',\n 'djv' =>'image/vnd.djvu',\n 'djvu' =>'image/vnd.djvu',\n 'doc' =>'application/msword',\n 'dtd' =>'application/xml-dtd',\n 'dvi' =>'application/x-dvi',\n 'dxr' =>'application/x-director',\n 'eps' =>'application/postscript',\n 'etx' =>'text/x-setext',\n 'ez' =>'application/andrew-inset',\n 'gif' =>'image/gif',\n 'gram' =>'application/srgs',\n 'grxml' =>'application/srgs+xml',\n 'gtar' =>'application/x-gtar',\n 'hdf' =>'application/x-hdf',\n 'hqx' =>'application/mac-binhex40',\n 'html' =>'text/html',\n 'html' =>'text/html',\n 'ice' =>'x-conference/x-cooltalk',\n 'ico' =>'image/x-icon',\n 'ics' =>'text/calendar',\n 'ief' =>'image/ief',\n 'ifb' =>'text/calendar',\n 'iges' =>'model/iges',\n 'igs' =>'model/iges',\n 'jpe' =>'image/jpeg',\n 'jpeg' =>'image/jpeg',\n 'jpg' =>'image/jpeg',\n 'js' =>'application/x-javascript',\n 'kar' =>'audio/midi',\n 'latex' =>'application/x-latex',\n 'm3u' =>'audio/x-mpegurl',\n 'man' =>'application/x-troff-man',\n 'mathml' =>'application/mathml+xml',\n 'me' =>'application/x-troff-me',\n 'mesh' =>'model/mesh',\n 'mid' =>'audio/midi',\n 'midi' =>'audio/midi',\n 'mif' =>'application/vnd.mif',\n 'mov' =>'video/quicktime',\n 'movie' =>'video/x-sgi-movie',\n 'mp2' =>'audio/mpeg',\n 'mp3' =>'audio/mpeg',\n 'mpe' =>'video/mpeg',\n 'mpeg' =>'video/mpeg',\n 'mpg' =>'video/mpeg',\n 'mpga' =>'audio/mpeg',\n 'ms' =>'application/x-troff-ms',\n 'msh' =>'model/mesh',\n 'mxu m4u' =>'video/vnd.mpegurl',\n 'nc' =>'application/x-netcdf',\n 'oda' =>'application/oda',\n 'ogg' =>'application/ogg',\n 'pbm' =>'image/x-portable-bitmap',\n 'pdb' =>'chemical/x-pdb',\n 'pdf' =>'application/pdf',\n 'pgm' =>'image/x-portable-graymap',\n 'pgn' =>'application/x-chess-pgn',\n 'php' =>'application/x-httpd-php',\n 'php4' =>'application/x-httpd-php',\n 'php3' =>'application/x-httpd-php',\n 'phtml' =>'application/x-httpd-php',\n 'phps' =>'application/x-httpd-php-source',\n 'png' =>'image/png',\n 'pnm' =>'image/x-portable-anymap',\n 'ppm' =>'image/x-portable-pixmap',\n 'ppt' =>'application/vnd.ms-powerpoint',\n 'ps' =>'application/postscript',\n 'qt' =>'video/quicktime',\n 'ra' =>'audio/x-pn-realaudio',\n 'ram' =>'audio/x-pn-realaudio',\n 'ras' =>'image/x-cmu-raster',\n 'rdf' =>'application/rdf+xml',\n 'rgb' =>'image/x-rgb',\n 'rm' =>'application/vnd.rn-realmedia',\n 'roff' =>'application/x-troff',\n 'rtf' =>'text/rtf',\n 'rtx' =>'text/richtext',\n 'sgm' =>'text/sgml',\n 'sgml' =>'text/sgml',\n 'sh' =>'application/x-sh',\n 'shar' =>'application/x-shar',\n 'shtml' =>'text/html',\n 'silo' =>'model/mesh',\n 'sit' =>'application/x-stuffit',\n 'skd' =>'application/x-koan',\n 'skm' =>'application/x-koan',\n 'skp' =>'application/x-koan',\n 'skt' =>'application/x-koan',\n 'smi' =>'application/smil',\n 'smil' =>'application/smil',\n 'snd' =>'audio/basic',\n 'spl' =>'application/x-futuresplash',\n 'src' =>'application/x-wais-source',\n 'sv4cpio' =>'application/x-sv4cpio',\n 'sv4crc' =>'application/x-sv4crc',\n 'svg' =>'image/svg+xml',\n 'swf' =>'application/x-shockwave-flash',\n 't' =>'application/x-troff',\n 'tar' =>'application/x-tar',\n 'tcl' =>'application/x-tcl',\n 'tex' =>'application/x-tex',\n 'texi' =>'application/x-texinfo',\n 'texinfo' =>'application/x-texinfo',\n 'tgz' =>'application/x-tar',\n 'tif' =>'image/tiff',\n 'tiff' =>'image/tiff',\n 'tr' =>'application/x-troff',\n 'tsv' =>'text/tab-separated-values',\n 'txt' =>'text/plain',\n 'ustar' =>'application/x-ustar',\n 'vcd' =>'application/x-cdlink',\n 'vrml' =>'model/vrml',\n 'vxml' =>'application/voicexml+xml',\n 'wav' =>'audio/x-wav',\n 'wbmp' =>'image/vnd.wap.wbmp',\n 'wbxml' =>'application/vnd.wap.wbxml',\n 'wml' =>'text/vnd.wap.wml',\n 'wmlc' =>'application/vnd.wap.wmlc',\n 'wmlc' =>'application/vnd.wap.wmlc',\n 'wmls' =>'text/vnd.wap.wmlscript',\n 'wmlsc' =>'application/vnd.wap.wmlscriptc',\n 'wmlsc' =>'application/vnd.wap.wmlscriptc',\n 'wrl' =>'model/vrml',\n 'xbm' =>'image/x-xbitmap',\n 'xht' =>'application/xhtml+xml',\n 'xhtml' =>'application/xhtml+xml',\n 'xls' =>'application/vnd.ms-excel',\n 'xml xsl' =>'application/xml',\n 'xpm' =>'image/x-xpixmap',\n 'xslt' =>'application/xslt+xml',\n 'xul' =>'application/vnd.mozilla.xul+xml',\n 'xwd' =>'image/x-xwindowdump',\n 'xyz' =>'chemical/x-xyz',\n 'zip' =>'application/zip'\n );\n\n $ext = trim(strtolower($ext));\n if (array_key_exists($ext,$mimetypes))\n {\n atkdebug(\"Filetype for $filename is {$mimetypes[$ext]}\");\n return $mimetypes[$ext];\n }\n else\n {\n atkdebug(\"Filetype for $filename could not be found. Returning application/octet-stream.\");\n return \"application/octet-stream\";\n }\n }\n\n /**\n * Get the Mimetype for a file the proper way.\n *\n * @link http://en.wikipedia.org/wiki/MIME_type\n *\n * @param string $file_path Path to the file\n * @return string Mimetype\n */\n public static function getFileMimetype($file_path)\n {\n // First try with fileinfo functions\n if (function_exists('finfo_open'))\n {\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $type = finfo_file($finfo, $file_path);\n finfo_close($finfo);\n }\n elseif (function_exists('mime_content_type'))\n {\n $type = mime_content_type($file);\n }\n else\n {\n // Unable to get the file mimetype!\n $type = '';\n }\n return $type;\n }\n\n /**\n * Delete complete directory and all of its contents.\n *\n * @todo If one of the subdirs/files cannot be removed, you end up with\n * a half deleted directory structure.\n * @param string $dir The directory to remove\n * @return True if succesful, false if not\n */\n function rmdirRecursive( $dir )\n {\n if ( !is_writable( $dir ) )\n {\n if ( !@chmod( $dir, 0777 ) )\n {\n return FALSE;\n }\n }\n\n $d = dir( $dir );\n while ( FALSE !== ( $entry = $d->read() ) )\n {\n if ( $entry == '.' || $entry == '..' )\n {\n continue;\n }\n $entry = $dir . '/' . $entry;\n if ( is_dir( $entry ) )\n {\n if ( !atkFileUtils::rmdirRecursive( $entry ) )\n {\n return FALSE;\n }\n continue;\n }\n if ( !@unlink( $entry ) )\n {\n $d->close();\n return FALSE;\n }\n }\n\n $d->close();\n\n rmdir( $dir );\n\n return TRUE;\n }\n}", "public function isReadable(): bool\n {\n return is_readable($this->directory->getPath().'/'.$this->filename);\n }", "public function checkIsReadable($path);", "private function checkDestinationWritable()\n {\n $destination = $this->getDestination();\n $dirName = dirname($destination);\n\n if (@is_writable($dirName) && @is_executable($dirName)) {\n // all is well\n return;\n }\n\n // The above might fail on Windows, even though dir is writable\n // So, to be absolute sure that we cannot write, we make an actual write test (writing a dummy file)\n // No harm in doing that for non-Windows systems either.\n if (file_put_contents($destination, 'dummy') !== false) {\n // all is well, after all\n unlink($destination);\n return;\n }\n\n throw new CreateDestinationFileException(\n 'Cannot create file: ' . basename($destination) . ' in dir:' . dirname($destination)\n );\n }", "function folder_is_writable($path) {\n if(!is_dir($path)) {\n return false;\n } // if\n \n do {\n $test_file = with_slash($path) . sha1(uniqid(rand(), true));\n } while(is_file($test_file));\n \n $put = @file_put_contents($test_file, 'test');\n if($put === false) {\n return false;\n } // if\n \n @unlink($test_file);\n return true;\n }", "public function isWriteProtected() {\n\t\treturn $this->getWriteProtected();\n\t}", "function is__writable($path) {\n\t\t//will work in despite of Windows ACLs bug\n\t\t//NOTE: use a trailing slash for folders!!!\n\t\t//see http://bugs.php.net/bug.php?id=27609\n\t\t//see http://bugs.php.net/bug.php?id=30931\n\t\t\n\t\t\tif ($path{strlen($path)-1}=='/') // recursively return a temporary file path\n\t\t\t\treturn is__writable($path.uniqid(mt_rand()).'.tmp');\n\t\t\telse if (is_dir($path))\n\t\t\t\treturn is__writable($path.'/'.uniqid(mt_rand()).'.tmp');\n\t\t\t// check tmp file for read/write capabilities\n\t\t\t$rm = file_exists($path);\n\t\t\t$f = @fopen($path, 'a');\n\t\t\tif ($f===false)\n\t\t\t\treturn false;\n\t\t\tfclose($f);\n\t\t\tif (!$rm)\n\t\t\t\tunlink($path);\n\t\t\treturn true;\n\t\t}\n\n /**\n * Adds the options subpanel\n */\n function admin_menu_link() {\n //If you change this from add_options_page, MAKE SURE you change the filter_plugin_actions function (below) to\n //reflect the page filename (ie - options-general.php) of the page your plugin is under!\n add_options_page('HITS- IE6 PNG Fix', 'HITS- IE6 PNG Fix', 'edit_pages', basename(__FILE__), array(&$this,'admin_options_page'));\n add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array(&$this, 'filter_plugin_actions'), 10, 2 );\n }\n \n /**\n * Adds the Settings link to the plugin activate/deactivate page\n */\n function filter_plugin_actions($links, $file) {\n //If your plugin is under a different top-level menu than Settiongs (IE - you changed the function above to something other than add_options_page)\n //Then you're going to want to change options-general.php below to the name of your top-level page\n $settings_link = '<a href=\"options-general.php?page=' . basename(__FILE__) . '\">' . __('Settings') . '</a>';\n array_unshift( $links, $settings_link ); // before other links\n\n return $links;\n }\n \n /**\n * Adds settings/options page\n */\n function admin_options_page() { \n require_once($this->pluginDIR .'adminPage.php');\n }\n }", "public function checkWritable($directory)\n {\n $writable = is_writable($directory);\n\n if (!$writable) {\n $this->issues['critical'][] = sprintf(\"Directory not writable: %s.\", $this->relativePath($directory));\n }\n\n return $writable;\n }", "public function isReadable(string $path): bool;", "function test_temp_dir() \n{\n\tglobal $config;\n\n\treturn is_writable($config['temp_dir']);\n}", "private function isDirWritable($cacheDir) {\n\t\ttry {\n\t\t\tif (!is_writable(BASEPATH . $cacheDir)) {\n\t\t\t\tthrow new Fari_Exception('Cache directory ' . $cacheDir . ' is not writable.');\n\t\t\t}\n\t\t} catch (Fari_Exception $exception) { $exception->fire(); }\n\t}", "public function check()\n {\n foreach(config('installer.permissions') as $folder => $permission)\n {\n if(!($this->getPermission($folder) >= $permission))\n {\n chmod($folder, 0775);\n }\n }\n\n return true;\n }", "function fn_check_copy_ability($source, $destination)\n{\n $struct_files = fn_get_dir_contents($source, true, true, '', '', true);\n\n $non_writable = array();\n\n foreach ($struct_files as $file) {\n if (is_file($source . $file)) {\n $res = fn_check_writable_path_permissions(dirname($destination . '/' . $file));\n\n if ($res !== true) {\n $non_writable[$res] = true;\n }\n }\n }\n\n return $non_writable;\n}", "function ensure_directory_writable($path, $base_path = '') {\n $result = false;\n if ($base_path != '') {\n $base_path = rtrim($base_path, '/').'/';\n $path = trim(substr($path, count($base_path) -1), '/');\n }\n if (file_exists($base_path.$path)) {\n $result = is_dir($base_path.$path) && is_writable($base_path.$path);\n } else {\n $result = true;\n $path_item = $base_path;\n foreach (explode('/', $path) as $item) {\n $path_item .= $item.'/';\n if (!file_exists($path_item)) {\n $result = mkdir($path_item);\n // if (!$result) debug('path_item', $path_item);\n } else {\n $result = is_dir($path_item);\n }\n if (!$result) {\n break;\n }\n }\n $result &= is_writable($base_path.$path);\n }\n return $result;\n}", "public function allowsWrite()\n {\n if ($this->plus) {\n return true;\n }\n\n return $this->base != 'r';\n }", "public static function directoryIsWritable ($location, $root = '/')\r\n\t{\r\n\t\t# If there is a trailing slash, remove it\r\n\t\tif (substr ($location, -1) == '/') {$location = substr ($location, 0, -1);}\r\n\t\t\r\n\t\t# If not starting with a slash or a dot, prepend the location\r\n\t\tif ((substr ($location, 0, 1) != '/') && (substr ($location, 0, 1) != '.')) {\r\n\t\t\t$location = dirname ($_SERVER['SCRIPT_FILENAME']) . '/' . $location;\r\n\t\t}\r\n\t\t\r\n\t\t# Split the directories up, removing the opening slash\r\n\t\tif (substr ($location, 0, 1) == '/') {$location = substr ($location, 1);}\r\n\t\t$directories = explode ('/', $location);\r\n\t\t\r\n\t\t# Loop through the directories in the list\r\n\t\twhile ($directories) {\r\n\t\t\t\r\n\t\t\t# Re-compile the location\r\n\t\t\t$directory = $root . implode ('/', $directories);\r\n\t\t\t\r\n\t\t\t# If the directory exists, test for its writability; this will get called at least once because the root location will get tested at some point\r\n\t\t\tif (is_dir ($directory)) {\r\n\t\t\t\treturn (is_writable ($directory));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t# Remove the last directory in the list\r\n\t\t\tarray_pop ($directories);\r\n\t\t}\r\n\t\t\r\n\t\t# Otherwise return true as nothing has been found\r\n\t\treturn true;\r\n\t}", "public function getWriteProtected() {\n\t\t$writeProtected = FALSE;\n\t\tif ($this->getUsersWithWriteAccess()->count() > 0) {\n\t\t\t$writeProtected = TRUE;\n\t\t}\n\t\tif ($this->getGroupsWithWriteAccess()->count() > 0) {\n\t\t\t$writeProtected = TRUE;\n\t\t}\n\n\t\treturn $writeProtected;\n\t}", "protected function isRepositoryWritable()\n {\n return $this->getRepository() instanceof WritableInterface;\n }", "public function test_cache_filesystem()\n\t{\n\t\treturn is_writable(Kohana::$cache_dir);\n\t}" ]
[ "0.8002037", "0.7901903", "0.78417856", "0.7755922", "0.7598078", "0.7502965", "0.74671483", "0.7417908", "0.73873764", "0.7381842", "0.73343885", "0.73253804", "0.7319954", "0.7316227", "0.7307816", "0.73057884", "0.73041284", "0.72697717", "0.72686124", "0.72337836", "0.7210316", "0.7166557", "0.7162031", "0.7073389", "0.70559144", "0.7021859", "0.6985769", "0.69642967", "0.69514847", "0.69307745", "0.690625", "0.6893923", "0.68573165", "0.68545085", "0.6848857", "0.6846104", "0.68412083", "0.68394274", "0.68394274", "0.68394274", "0.68393546", "0.68277", "0.68227655", "0.6822615", "0.6818144", "0.6808114", "0.6796891", "0.6783297", "0.6754522", "0.67436904", "0.6727894", "0.6722295", "0.6722295", "0.67217904", "0.67217904", "0.6698047", "0.66976064", "0.6689361", "0.6680828", "0.66640985", "0.6639135", "0.6630208", "0.6627015", "0.6607252", "0.6580993", "0.65469974", "0.654286", "0.65133744", "0.64696735", "0.6436749", "0.6416774", "0.63791984", "0.63720745", "0.63636833", "0.6358524", "0.6356909", "0.63345116", "0.63305396", "0.6306462", "0.6284844", "0.62558895", "0.61969256", "0.61422086", "0.6122221", "0.61041206", "0.6092761", "0.6079156", "0.60590327", "0.60571045", "0.6055972", "0.6043359", "0.6026437", "0.5955481", "0.5949511", "0.59315807", "0.58975345", "0.5875754", "0.58656466", "0.58619326", "0.58563596" ]
0.7361262
10
A wrapper for the PHP5 function array_combine()
function array_combine($keys, $values) { $keys = array_values($keys); $values = array_values($values); $n = sizeof($keys); $m = sizeof($values); if (!$n || !$m || ($n != $m)) { return false; } $combined = array(); for ($i = 0; $i < $n; $i++) { $combined[$keys[$i]] = $values[$i]; } return $combined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function array_combine($keys, $values){\r\n\t$result = array();\r\n\tfor($i=0; $i<sizeof($keys); $i++){\r\n\t\t$key=$keys[$i];\r\n\t\t$value=$values[$i];\r\n\t\t$temp = array($key => $value);\r\n\t\t$result=array_merge($result, $temp);\r\n\t}\r\n\treturn $result;\r\n}", "function _combine_array(&$row, $key, $header) {\n $row = array_combine($header, $row);\n}", "function array_combine_safe(array $keys = [], array $values = [], $default = null): array\n {\n if (empty($keys)) {\n return [];\n }\n\n $out = [];\n\n foreach ($keys as $index => $key) {\n $out[$key] = (isset($values[$index])) ? $values[$index] : $default;\n }\n\n return $out;\n }", "abstract public function combineTo(array $array);", "abstract public function combineWith(array $array);", "static public function array_merge()\r\n\t{\r\n\t\t$args \t\t= func_get_args();\r\n\t\t$results\t= array();\r\n\t\tforeach($args as $array) {\r\n\t\t\tforeach($array as $key => $value) {\r\n\t\t\t\t$results[$key] = $value;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $results;\r\n\t}", "public static function arrayMergeAssoc() {\n\t$result = array();\n\t$arrays = func_get_args();\n\tforeach($arrays as $array) {\n\t\tif ($array == null) {\n\t\t\tcontinue;\n\t\t}\n\t\tforeach($array as $key => $value) {\n\t\t\t$result[$key] = $value;\n\t\t}\n\t}\n\treturn $result;\n}", "public static function mergeConfig(): array\n {\n $args = \\func_get_args();\n $res = array_shift($args) ?: [];\n foreach ($args as $items) {\n if (!\\is_array($items)) {\n continue;\n }\n foreach ($items as $k => $v) {\n if ($v instanceof \\yii\\helpers\\UnsetArrayValue || $v instanceof \\Yiisoft\\Arrays\\UnsetArrayValue) {\n unset($res[$k]);\n } elseif ($v instanceof \\yii\\helpers\\ReplaceArrayValue || $v instanceof \\Yiisoft\\Arrays\\ReplaceArrayValue) {\n $res[$k] = $v->value;\n } elseif (\\is_int($k)) {\n /// XXX skip repeated values\n if (\\in_array($v, $res, true)) {\n continue;\n }\n if (isset($res[$k])) {\n $res[] = $v;\n } else {\n $res[$k] = $v;\n }\n } elseif (\\is_array($v) && isset($res[$k]) && \\is_array($res[$k])) {\n $res[$k] = self::mergeConfig($res[$k], $v);\n } else {\n $res[$k] = $v;\n }\n }\n }\n\n return $res;\n }", "function array_merge() {\n\t\t$args = func_get_args();\n\t\tforeach ($args as $k=>$value) {\n\t\t\tif (!is_array($value)) $value=array();\n\t\t\t$args[$k]=$value;\n\t\t}\n\t\treturn call_user_func_array(\"array_merge\", $args);\n\t}", "public function array_merge_recursive_overwrite()\n {\n $arrays = func_get_args();\n $base = array_shift($arrays);\n\n foreach ($arrays as $array) {\n reset($base); //important\n //while (list($key, $value) = @each($array)) { // Deprecated php 7.2\n foreach ($array as $key => $value) {\n if (is_array($value) && @is_array($base[$key])) {\n $base[$key] = $this->array_merge_recursive_overwrite($base[$key], $value);\n } else {\n $base[$key] = $value;\n } // else\n } // while / for each\n } // foreach\n\n return $base;\n }", "public function merge() {\n\t\t// Holds all the arrays passed\n\t\t$params = &func_get_args();\n\t\t\n\t\t// First array is used as the base, everything else overwrites on it\n\t\t$return = array_shift ( $params );\n\t\t\n\t\t// Merge all arrays on the first array\n\t\tforeach ( $params as $array ) {\n\t\t\tforeach ( $array as $key => $value ) {\n\t\t\t\t// Numeric keyed values are added (unless already there)\n\t\t\t\tif (is_numeric ( $key ) && (! in_array ( $value, $return ))) {\n\t\t\t\t\tif (is_array ( $value )) {\n\t\t\t\t\t\t$return [] = $this->merge ( $return [$key], $value );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$return [] = $value;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t// String keyed values are replaced\n\t\t\t\t} else {\n\t\t\t\t\tif (isset ( $return [$key] ) && is_array ( $value ) && is_array ( $return [$key] )) {\n\t\t\t\t\t\t$return [$key] = $this->merge ( $return[$key], $value );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$return [$key] = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $return;\n\t}", "function atk_array_merge_keys()\n{\n\t$args = func_get_args();\n\t$result = array();\n\tforeach($args as $array)\n\t{\n\t\tforeach($array as $key=>$value)\n\t\t{\n\t\t\t$result[$key] = $value;\n\t\t}\n\t}\n\treturn $result;\n}", "public function safeArrayCombine($keys, $values) { \n\t\ttry {\n\t\t\t$combinedArray = array(); \n\t\t\t$keyCount = count($keys);\n\t\t\t$valueCount = count($values);\n\t\t\t$difference = $keyCount - $valueCount;\n\t\t\t\n\t\t\tif ($difference > 0) {\n\t\t\t\tfor ($i = 0; $i < $difference; $i++) {\n\t\t\t\t\t$values[] = $values[$valueCount - 1];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor ($i=0, $keyCount; $i < $keyCount; $i++) {\n\t\t\t\t$combinedArray[$keys[$i]] = $values[$i];\n\t\t\t} \n\t\t\t\t\n\t\t\treturn $combinedArray;\n\t\t} catch (Exception $e) { \n\t\t\tthrow new Exception($e->getMessage().' from '.$this->className.'->'.\n\t\t\t\t__FUNCTION__.'() line '.__LINE__\n\t\t\t);\n\t\t} //<-- end try -->\n\t}", "function util_array_union($array1, $array2)\n{\n\t$result = $array1;\n\tforeach ($array2 as $key => $value)\n\t{\n\t\t$result[$key] = $value ;\n\t}\n\t\n\treturn $result ;\n}", "static function merge() {\n\t\t$base = array();\n\t\t$args = func_get_args();\n\n\t\tforeach ( $args as $arg ) {\n\t\t\tself::array_merge( $base, $arg );\n\t\t}\n\n\t\treturn $base;\n\t}", "function array_parallel(){\n\t$r = array();\n\t$args = func_get_args();\n\t$keys = array();\n\tforeach ($args as $a)\n\t\t$keys = array_merge($keys, array_keys($a));\n\t$keys = array_unique($keys);\n\n\tforeach ($keys as $k){\n\t\t$i = array();\n\t\tforeach ($args as $a)\n\t\t\t$i[] = nu($a[$k]);\n\t\t$r[$k] = $i;\n\t}\n\treturn $r;\n}", "function combineArrays($arrAlph,$arrNums)\r\n\t{\r\n\t $result = []; //declare an empty array\r\n\t for($i = 0; $i < count($arrNums); $i++)\r\n\t {\r\n\t\tarray_push($result,$arrAlph[$i]);\r\n\t\tarray_push($result,$arrNums[$i]);\r\n\t }\r\n\t return $result;\r\n\t}", "public static function combineIntoSetsOfTwo(array $values, array $carry = []): array {\n\t\tif (count($values) === 0) {\n\t\t\treturn $carry;\n\t\t}\n\t\t$value = array_shift($values);\n\t\t$combiner = function($value2) use ($value) {\n\t\t\treturn [$value, $value2];\n\t\t};\n\t\treturn self::combineIntoSetsOfTwo($values, array_merge($carry, array_map($combiner, $values)));\n\t}", "public function customArrayMerge($source, & $destination) {\n if (is_array($source) && (is_array($destination) || is_object($destination))) {\n foreach ($source as $key => $item) {\n $destination[\"{$key}\"] = $item;\n }\n }\n }", "function util_array_merge_overwrite($array1, $array2)\n{\n\tforeach ($array2 as $key => $value)\n\t{\n\t\t$array1[$key] = $value ;\n\t}\n\treturn $array1 ;\n}", "function ju_map($a1, $a2, $pAppend = [], $pPrepend = [], int $keyPosition = 0, bool $returnKey = false):array {\n\t# 2020-03-02, 2022-10-31\n\t# 1) Symmetric array destructuring requires PHP ≥ 7.1:\n\t#\t\t[$a, $b] = [1, 2];\n\t# https://github.com/mage2pro/core/issues/96#issuecomment-593392100\n\t# We should support PHP 7.0.\n\t# https://3v4l.org/3O92j\n\t# https://php.net/manual/migration71.new-features.php#migration71.new-features.symmetric-array-destructuring\n\t# https://stackoverflow.com/a/28233499\n\tlist($a, $f) = juaf($a1, $a2); /** @var array|Traversable $a */ /** @var callable $f */\n\t/** @var array(int|string => mixed) $r */\n\tif (!$pAppend && !$pPrepend && 0 === $keyPosition && !$returnKey) {\n\t\t$r = array_map($f, ju_ita($a));\n\t}\n\telse {\n\t\t$pAppend = ju_array($pAppend); $pPrepend = ju_array($pPrepend);\n\t\t$r = [];\n\t\tforeach ($a as $k => $v) {/** @var int|string $k */ /** @var mixed $v */ /** @var mixed[] $primaryArgument */\n\t\t\tswitch ($keyPosition) {\n\t\t\t\tcase JU_BEFORE:\n\t\t\t\t\t$primaryArgument = [$k, $v];\n\t\t\t\t\tbreak;\n\t\t\t\tcase JU_AFTER:\n\t\t\t\t\t$primaryArgument = [$v, $k];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$primaryArgument = [$v];\n\t\t\t}\n\t\t\t$fr = call_user_func_array($f, array_merge($pPrepend, $primaryArgument, $pAppend)); /** @var mixed $fr */\n\t\t\tif (!$returnKey) {\n\t\t\t\t$r[$k] = $fr;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$r[$fr[0]] = $fr[1]; # 2016-10-25 It allows to return custom keys.\n\t\t\t}\n\t\t}\n\t}\n\treturn $r;\n}", "function array_mash($primary, $secondary) {\n\t$primary = (array)$primary;\n\t$secondary = (array)$secondary;\n\t$out = array();\n\tforeach($primary as $name => $value) {\n\t\tif ( array_key_exists($name, $secondary) && !empty($secondary[$name]) && empty($value)) {\n\t\t\t$out[$name] = $secondary[$name];\n\t\t}\n\t\telse {\n\t\t\t$out[$name] = $value;\n\t\t}\n\t}\n\treturn $out;\n}", "function combine($array) {\n\t\tif (empty($array)) {\n\t\t\treturn array();\n\t\t}\n\t\t$res = array();\n\t\t$first = current($array);\n\t\tarray_shift($array);\n\t\t$tail = $array;\n\t\tif (empty($tail)) {\n\t\t\tforeach ($first as $item) {\n\t\t\t\t$res[] = array($item);\n\t\t\t}\n\t\t} else {\n\t\t\tforeach ($first as $item) {\n\t\t\t\tforeach ($this->combine($tail) as $j) {\n\t\t\t\t\t$res[] = array_merge(array($item), $j);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}", "public static function mergeArray($a,$b)\n\t{\n\t\t$args=func_get_args();\n\t\t$res=array_shift($args);\n\t\twhile(!empty($args))\n\t\t{\n\t\t\t$next=array_shift($args);\n\t\t\tforeach($next as $k => $v)\n\t\t\t{\n\t\t\t\tif(is_integer($k))\n\t\t\t\t\tisset($res[$k]) ? $res[]=$v : $res[$k]=$v;\n\t\t\t\telse if(is_array($v) && isset($res[$k]) && is_array($res[$k]))\n\t\t\t\t\t$res[$k]=self::mergeArray($res[$k],$v);\n\t\t\t\telse\n\t\t\t\t\t$res[$k]=$v;\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}", "static function merge($x,$y){\n\t\t$arrays = func_get_args();\n\t\t$result = [];\n\t\tforeach($arrays as $array){\n\t\t\tif(is_object($array)){\n\t\t\t\t$array = self::from($array);\n\t\t\t}\n\t\t\tif(is_array($array)){\n\t\t\t\t$result = array_merge($result,$array);\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public static function combine($keys, $values)\n {\n return new static(array_combine(static::getAsArray($keys), static::getAsArray($values)));\n }", "function extend_array()\n\t{\n\t\t$args = func_get_args();\n\t\t$extended = array();\n\n\t\tif ( is_array( $args ) && count( $args ) )\n\t\t{\n\t\t\tforeach ( $args as $array )\n\t\t\t{\n\t\t\t\tif ( ! is_array( $array ) )\tcontinue;\n\t\t\t\t$extended = array_merge( $extended, $array );\n\t\t\t}\n\t\t}\n\n\t\treturn $extended;\n\t}", "private function getCombinations(array ...$arrays): array\n {\n $result = [[]];\n foreach ($arrays as $property => $property_values) {\n $tmp = [];\n foreach ($result as $result_item) {\n foreach ($property_values as $property_value) {\n $tmp[] = array_merge($result_item, [$property => $property_value]);\n }\n }\n $result = $tmp;\n }\n return $result;\n }", "function array_dot_merge(array $array, array $patch) {\n\t$final = $array;\n\tforeach($patch as $k => $v) {\n\t\t$final = array_dot_set($final, $k, $v);\n\t}\n\treturn $final;\n}", "function mergeArray($a,$b)\n{\n\tforeach($b as $k=>$v)\n\t\t$a[$k]=$v;\n\treturn $a;\n}", "function config_merge(array $array1) {\n\t$result = array();\n\tforeach (func_get_args() as $param) {\n\t\tforeach ($param as $key=>$value) {\n\t\t\tif (is_array($value) && array_key_exists($key, $result) && is_array($result[$key])) {\n\t\t\t\t$result[$key] = config_merge($result[$key], $value);\n\t\t\t} else {\n\t\t\t\t$result[$key] = $value;\n\t\t\t}\n\t\t}\n\t}\n\treturn $result;\n}", "static function buildAssociative($names, $values)\n\t{\n\t\t$new = Array();\n\n\t\tforeach ($names as $i => $key)\n\t\t\t$new[$key] = $values[$i];\n\n\t\treturn $new;\n\t}", "function array_extend(array $arrays) {\n $merged = array();\n\n foreach (func_get_args() as $array) {\n foreach ($array as $key => $value) {\n if (is_array($value) && array_has($merged, $key) && is_array($merged[$key])) {\n $merged[$key] = array_extend($merged[$key], $value);\n } else {\n $merged[$key] = $value;\n }\n }\n }\n\n return $merged;\n }", "public function toMergedArray(): array;", "private function generateAttributeCombinations($arrays) // .. 4\n {\n $result = [[]];\n\n foreach ($arrays as $property => $property_values) {\n $tmp = [];\n foreach ($result as $result_item) {\n foreach ($property_values as $property_value) {\n $tmp[] = array_merge($result_item, array($property => $property_value));\n }\n }\n $result = $tmp;\n }\n\n return $result;\n }", "public function combineWith(array $array)\n {\n return new static(array_combine($this->elements, $array));\n }", "function am() {\n\t\t$r = array();\n\t\tforeach(func_get_args()as $a) {\n\t\t\tif (!is_array($a)) {\n\t\t\t\t$a = array($a);\n\t\t\t}\n\t\t\t$r = array_merge($r, $a);\n\t\t}\n\t\treturn $r;\n\t}", "function arrayIntoArray ($array1,$array2) {\nwhile(list($key,$val)=@each($array2)) {\n $array1[$key] = $val;\n}\nreturn $array1;\n}", "public function combine($values)\n {\n return new static(array_combine($this->all(), $values));\n }", "function arrayReplace()\n {\n $a = func_get_args();\n // Do not make this reference,\n // it helpful if you just pass pure array without assign.\n $new = $a[0];\n if (!isArray($new)) {\n return triggerJson(\n '\\PMVC\\arrayReplace Param1 should be array type.',\n ['Array' => $new]\n );\n }\n for ($i = 1, $j = count($a); $i < $j; $i++) {\n // This is for handle empty array not empty value\n if (is_null($a[$i])) {\n continue;\n }\n if (!isArray($a[$i])) {\n $new[] = $a[$i];\n } else {\n foreach ($a[$i] as $k => $v) {\n $new[$k] = $v;\n }\n }\n }\n\n return $new;\n }", "private function merge(array $a, array $b): array\n\t{\n\t\tforeach ($b as $key => $value)\n\t\t{\n\t\t\t$a[$key] = $value;\n\t\t}\n\n\t\treturn $a;\n\t}", "public function combineTo(array $array)\n {\n return new static(array_combine($array, $this->elements));\n }", "protected static function array_merge( array &$base, array $overwrite ) {\n\t\tforeach ( $overwrite as $key => &$value ) {\n\t\t\tif ( is_int( $key ) ) {\n\t\t\t\t// add only if it doesn't exist\n\t\t\t\tif ( ! in_array( $overwrite[ $key ], $base ) ) {\n\t\t\t\t\t$base[] = $overwrite[ $key ];\n\t\t\t\t}\n\t\t\t} else if ( is_array( $value ) ) {\n\t\t\t\tif ( isset( $base[ $key ] ) && is_array( $base[ $key ] ) ) {\n\t\t\t\t\tself::array_merge( $base[ $key ], $value );\n\t\t\t\t} else { // does not exist or it's a non-array\n\t\t\t\t\t$base[ $key ] = $value;\n\t\t\t\t}\n\t\t\t} else { // not an array and not numeric key\n\t\t\t\t$base[ $key ] = $value;\n\t\t\t}\n\t\t}\n\t}", "public function testArraysOperations()\n {\n // Union\n $arr1 = ['a', 'b'];\n $arr2 = ['c', 'd', 'e', 'key' => 'value'];\n //$this->assertEquals(?, $arr1 + $arr2);\n\n // array_merge — Merge one or more arrays\n $arr1 = ['a', 'b', 'key1' => 'value1', 'key2' => 'value2'];\n $arr2 = [1, 'key1' => 'value3', 'key3' => 'value4'];\n //$this->assertEquals(?, array_merge($arr1, $arr2));\n\n // array_replace — Replaces elements from passed arrays into the first array\n $arr1 = ['a', 'b', 'key1' => 'value1', 'key2' => 'value2'];\n $arr2 = [1, 'key1' => 'value3', 'key3' => 'value4'];\n //$this->assertEquals(?, array_replace($arr1, $arr2));\n }", "static public function MERGE_ASSOC_ARRAY($to, $from, $clobber = true)\n {\n return SculpinUtil::MERGE_ASSOC_ARRAY($to, $from, $clobber);\n }", "function alist($args){\n return array_fill_keys(array_keys($args), array());\n}", "static function replace_recursive($x,$y){\n\t\t$arrays = func_get_args();\n\t\t$result = [];\n\t\tforeach($arrays as $array){\n\t\t\tif(is_object($array)){\n\t\t\t\t$array = self::from($array);\n\t\t\t}\n\t\t\tif(is_array($array)){\n\t\t\t\t$result = array_replace_recursive($result,$array);\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "private function get_combinations($arrays) {\n $result = array(array());\n foreach ($arrays as $property => $property_values) {\n $tmp = array();\n foreach ($result as $result_item) {\n foreach ($property_values as $property_value) {\n $tmp[] = array_merge($result_item, array($property => $property_value));\n }\n }\n $result = $tmp;\n }\n return $result;\n }", "function aa() {\n\t\t$args = func_get_args();\n\t\tfor($l = 0, $c = count($args); $l < $c; $l++) {\n\t\t\tif ($l + 1 < count($args)) {\n\t\t\t\t$a[$args[$l]] = $args[$l + 1];\n\t\t\t} else {\n\t\t\t\t$a[$args[$l]] = null;\n\t\t\t}\n\t\t\t$l++;\n\t\t}\n\t\treturn $a;\n\t}", "public static function arrayMergeRecursiveDistinct()\n {\n $arrays = func_get_args();\n $base = array_shift($arrays);\n if(!is_array($base)) $base = empty($base) ? array() : array($base);\n foreach($arrays as $append)\n {\n if(!is_array($append)) $append = array($append);\n foreach($append as $key => $value) {\n if(!array_key_exists($key, $base) and !is_numeric($key))\n {\n $base[$key] = $append[$key];\n continue;\n }\n if(is_array($value) or is_array($base[$key]))\n {\n $base[$key] = self::arrayMergeRecursiveDistinct($base[$key], $append[$key]);\n } else if(is_numeric($key))\n {\n if(!in_array($value, $base)) $base[] = $value;\n } else\n {\n $base[$key] = $value;\n }\n }\n }\n return $base;\n }", "function array_extend($array1, $array2){\n $array1 = (is_array($array1)) ? $array1 : array();\n $array2 = (is_array($array2)) ? $array2 : array();\n foreach($array2 as $k=>$v){\n if (is_array($v) && is_associative_array($v)){\n if(!isset($array1[$k])) $array1[$k] = $v;\n else $array1[$k] = array_extend($array1[$k], $v);\n } else {\n if(is_array($v)){\n if (isset($array1[$k]) && is_array($array1[$k])) $array1[$k] = array_merge($array1[$k], $v);\n else $array1[$k] = $v;\n } else $array1[$k] = $v;\n }\n }\n return $array1;\n}", "function &assign($keys, $arr, $spreadKey = null)\n {\n if (!is_array($arr)) {\n return triggerJson(\n 'Assign not pass array',\n compact('arr')\n );\n }\n $isSeqArray = array_values($arr) === $arr;\n $result = [];\n $tarKeys = [];\n foreach ($keys as $k => $v) {\n $defV = null;\n if (is_array($v)) {\n $vKey = $v[0];\n $newKey = get($v, 1, $vKey);\n if (isset($v[2])) {\n $defV = $v[2];\n }\n } else {\n $vKey = $v;\n $newKey = $v;\n }\n $tarKey = $isSeqArray ? $k : $vKey;\n $tarKeys[$tarKey] = '';\n $result[$newKey] = &get($arr, $tarKey, $defV);\n }\n if (!is_null($spreadKey)) {\n $result[$spreadKey] = [];\n foreach ($arr as $k=>$v) {\n if (!isset($tarKeys[$k])) {\n $result[$spreadKey][$k] = &get($arr, $k);\n }\n }\n }\n\n return $result;\n }", "function array_extend_distinct(array $arrays) {\n $merged = array();\n\n foreach (func_get_args() as $array) {\n foreach ($array as $key => $value) {\n if (is_array($value) &&\n array_has($merged, $key) &&\n is_array($merged[$key])\n ) {\n if (array_is_associative($value) && array_is_associative($merged[$key])) {\n $merged[$key] = array_extend_distinct($merged[$key], $value);\n\n continue;\n }\n }\n\n $merged[$key] = $value;\n }\n }\n\n return $merged;\n }", "function mergeCombos($gk, $df, $md, $fw) {\n $results = array();\n foreach ($gk as $g) {\n foreach ($df as $d) {\n foreach ($md as $m) {\n foreach ($fw as $f) {\n $results[] = array_merge($g, $d, $m, $f);\n }\n }\n }\n }\n}", "function &set(array $value, string $namespace = 'default'): array\n{\n return arr(array_unique($value), $namespace);\n}", "function array_merge_recursive_distinct ()\n\t{\n\t\t$arrays = func_get_args();\n\t\t$base = array_shift($arrays);\n\t\tif(!is_array($base)) $base = empty($base) ? array() : array($base);\n\t\tforeach($arrays as $append)\n\t\t{\n\t\t\tif(!is_array($append)) $append = array($append);\n\t\t\tforeach($append as $key => $value)\n\t\t\t{\n\t\t\t\tif(!array_key_exists($key, $base) and !is_numeric($key))\n\t\t\t\t{\n\t\t\t\t\t$base[$key] = $append[$key];\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(is_array($value) or is_array($base[$key]))\n\t\t\t\t{\n\t\t\t\t\t$base[$key] = array_merge_recursive_distinct($base[$key], $append[$key]);\n\t\t\t\t}\n\t\t\t\telse if(is_numeric($key))\n\t\t\t\t{\n\t\t\t\t\tif(!in_array($value, $base)) $base[] = $value;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$base[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $base;\n\t}", "static function _mixin($keys,$item,$chld){\n $res = array();\n $nc = count($keys);\n for($ii=0;$ii<$nc-1;$ii++) array_push($res,$keys[$ii],$chld);\n $res[] = $keys[$nc-1];\n if(!is_null($item)) $res[] = $item;\n return($res);\n }", "static function remap($src, $remap){\n\t\tforeach($remap as $k=>$v){\n\t\t\t$dest[$v] = $src[$k];\n\t\t\tunset($src[$k]);\n\t\t}\n\t\treturn array_merge($src,$dest);\n\t}", "public function mergeFrom(array $data);", "function cartesian_product($input) {\r\n \t$result = array();\r\n\r\n\t\tforeach ($input as $key => $values) {\r\n\t\t\t// If a sub-array is empty, it doesn't affect the cartesian product\r\n\t\t\tif (empty($values)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\r\n\t\t\t// Seeding the product array with the values from the first sub-array\r\n\t\t\tif (empty($result)) {\r\n\t\t\t\tforeach($values as $value) {\r\n\t\t\t\t\t$result[] = array($key => $value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Second and subsequent input sub-arrays work like this:\r\n\t\t\t\t// 1. In each existing array inside $product, add an item with\r\n\t\t\t\t// key == $key and value == first item in input sub-array\r\n\t\t\t\t// 2. Then, for each remaining item in current input sub-array,\r\n\t\t\t\t// add a copy of each existing array inside $product with\r\n\t\t\t\t// key == $key and value == first item of input sub-array\r\n\t\r\n\t\t\t\t// Store all items to be added to $product here; adding them\r\n\t\t\t\t// inside the foreach will result in an infinite loop\r\n\t\t\t\t$append = array();\r\n\t\r\n\t\t\t\tforeach($result as &$product) {\r\n\t\t\t\t\t// Do step 1 above. array_shift is not the most efficient, but\r\n\t\t\t\t\t// it allows us to iterate over the rest of the items with a\r\n\t\t\t\t\t// simple foreach, making the code short and easy to read.\r\n\t\t\t\t\t$product[$key] = array_shift($values);\r\n\t\r\n\t\t\t\t\t// $product is by reference (that's why the key we added above\r\n\t\t\t\t\t// will appear in the end result), so make a copy of it here\r\n\t\t\t\t\t$copy = $product;\r\n\t\r\n\t\t\t\t\t// Do step 2 above.\r\n\t\t\t\t\tforeach($values as $pos_key=>$item) {\r\n\t\t\t\t\t\t$copy[$key] = $item;\r\n\t\t\t\t\t\t$append[] = $copy;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Undo the side effecst of array_shift\r\n\t\t\t\t\tarray_unshift($values, $product[$key]);\t\t\t\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\t// Out of the foreach, we can add to $results now\r\n\t\t\t\t$result = array_merge($result, $append);\r\n\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "function unite_arrays($a, $b) {\n if(!$a || !is_array($a)) {\n $a = array();\n }\n\n if($b && is_array($b)) {\n $a = array_merge($a, $b);\n }\n\n return $a;\n}", "function array_merge(/* $array, ... */): array\n{\n $merged = [];\n $arrays = array_reverse(func_get_args());\n while (!empty($arrays)) {\n $current = array_shift($arrays);\n if (!is_array($current)) {\n $current = [$current];\n }\n foreach (array_reverse($current) as $key => $value) {\n if (array_key_exists($key, $merged)) {\n if (is_array($value) && is_array($merged[$key])) {\n $merged[$key] = array_merge($value, $merged[$key]);\n }\n if (is_numeric($key)) {\n $merged[] = $value;\n }\n } else {\n $merged[$key] = $value;\n }\n }\n }\n\n return array_reverse($merged);\n}", "public static function arrayGlue($destination, $addition) {\n foreach($destination as $key => $value) {\n if(!isset($addition[$key]) || is_numeric($key)) {\n continue;\n }\n\n if(is_array($value) && !is_array($addition[$key])\n && !in_array($addition[$key], $destination[$key])) {\n $destination[$key][] = $addition[$key];\n } else if(is_array($value)) {\n $destination[$key] = self::arrayGlue($value, $addition[$key]);\n } else if ($value != $addition[$key]) {\n $destination[$key] = [$value, $addition[$key]];\n }\n }\n\n return $destination;\n }", "function ju_map_kr($a1, $a2):array {return ju_map($a1, $a2, [], [], JU_BEFORE, true);}", "function combineLatLng($lat, $lng) {\n return array_map(null, $lat, $lng);\n}", "public static function combine($destination, $source) {\n\n\t\tif ( ! is_string(key($source))) {\n\n\t\t\treturn $destination;\n\t\t}\n\n\t\tif ($destination instanceof \\ArrayAccess || is_array($destination)) {\n\n\t\t\treturn array_merge($destination, (array) $source);\n\t\t}\n\n\t\tforeach($source as $field => &$value) {\n\n\t\t\t$accessor = 'set' . $field;\n\n\t\t\tif (method_exists($destination, $accessor)) {\n\n\t\t\t\t$destination->$accessor($value);\n\t\t\t}\n\t\t\tif (method_exists($destination, '__call')) {\n\n\t\t\t\t$destination->$accessor($value);\n\t\t\t}\n\t\t\telse if (isset($destination->$field)) {\n\n\t\t\t\t$destination->$field = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $destination;\n\t}", "public static function am() {\n\t\t$r = array();\n\t\tforeach (func_get_args()as $a) {\n\t\t\tif (!is_array($a)) {\n\t\t\t\t$a = array($a);\n\t\t\t}\n\t\t\t$r = array_merge($r, $a);\n\t\t}\n\t\treturn $r;\n\t}", "function ju_map_k($a1, $a2):array {return ju_map($a1, $a2, [], [], JU_BEFORE);}", "public function combine($array, $what = 'keys')\n {\n switch($what)\n {\n case 'keys':\n $result = array_combine($array, $this->values()->all());\n break;\n case 'values':\n $result = array_combine($this->keys()->all(), $array);\n break;\n default:\n throw new BadContainerMethodArgumentException('Second argument must be string (keys or values)');\n }\n\n if (isset($result) and ! empty($result))\n {\n $this->items = $result;\n\n }\n\n unset($result);\n\n return $this;\n }", "function kernel_array_concat($array, $prefix, $suffix) {\n $newArray = array();\n foreach( $array as $value ) {\n $newArray[] = $prefix . $value . $suffix;\n }\n return $newArray;\n}", "function array_funnel_keys($array, $keys, $default = NULL) {\n $defaults = array_fill_keys($keys, $default);\n return array_merge($defaults, array_intersect_key($array, $defaults));\n}", "public function exchangeArray(array $data, $mapping = false);", "function implode_assoc($array, array $overrideOptions = array())\n {\n\n // These default options set the defaults but are over-written by matching values from $overrideOptions\n $options = array(\n 'inner_glue' => '=',\n 'outer_glue' => '&',\n 'prepend' => '',\n 'append' => '',\n 'skip_empty' => false,\n 'prepend_inner_glue' => false,\n 'append_inner_glue' => false,\n 'prepend_outer_glue' => false,\n 'append_outer_glue' => false,\n 'urlencode' => false,\n 'part' => 'both' //'both', 'key', or 'value'\n );\n\n // Use values from $overrideOptions that match keys in $options and then extract those values into\n // the current workspace.\n foreach ($overrideOptions as $key=>$val) {\n if (isset($options[$key])) {\n $options[$key] = $val;\n }\n }\n extract($options);\n\n // $output holds the imploded results of the key-value pairs\n $output = array();\n\n // Create a collection of the inner key-value pairs and glue them as indicated by the $options\n foreach ($array as $key=>$item) {\n\n // If not skipping empty values OR if the item evaluates to true.\n // i.e. If $skip_empty is true then check to see if the array item's value evaluates to true.\n if (!$skip_empty || $item) {\n\n $output[] =\n ($prepend_inner_glue ? $inner_glue : '').\n ($part != 'value' ? $key : ''). // i.e. show the $key if $part is 'both' or 'key'\n ($part == 'both' ? $inner_glue : '').\n // i.e. show the $item if $part is 'both' or 'value' and optionally urlencode $item\n ($part != 'key' ? ($urlencode ? urlencode($item) : $item) : '').\n ($append_inner_glue ? $inner_glue : '');\n }\n }\n\n return $prepend. ($prepend_outer_glue ? $outer_glue : '') . implode($outer_glue, $output) . ($append_outer_glue ? $outer_glue : '') . $append;\n }", "function combinevalues($arr)\n{\n\t$ret=\"\";\n\tforeach($arr as $item)\n\t{\n\t\t$val = $item;\n\t\tif(strlen($ret))\n\t\t\t$ret.=\",\";\n\t\tif(strpos($val,\",\")===false && strpos($val,'\"')===false)\n\t\t\t$ret.=$val;\n\t\telse\n\t\t{\n\t\t\t$val=str_replace('\"','\"\"',$val);\n\t\t\t$ret.='\"'.$val.'\"';\n\t\t}\n\t}\n\treturn $ret;\n}", "function getCombination($values, $count, $index) {\n\n\t$result = \"\";\n\tfor($i = 0; $i < $count; $i++) {\n\t\t// Figure out where in the array to start from, given the external state and the internal loop state\n\t\t$pos = $index % count($values);\n\n\t\t// Append and continue\n\t\t$result .= $values[$pos];\n\t\t$index = ($index-$pos)/count($values);\n\t}\n\n\treturn $result;\n}", "function decomposeAssocArray(){\n\t$args = func_get_args();\n\t$array = array_shift($args);\n\n\t$r = array();\n\tforeach ($args as $key)\n\t\t$r[] = $array[$key];\n\n\treturn $r;\n}", "function arrayEntriesToObject($sourceArray,$defaultFlag=true) {\n\treturn is_array($sourceArray) ? array_fill_keys($sourceArray,$defaultFlag) : array();\n}", "public static function merge( array $a1, array $a2 )\n\t{\n\t\t$result = array();\n\t\tfor ( $i = 0, $total = func_num_args(); $i < $total; $i++ ) {\n\t\t\t// Get the next array\n\t\t\t$arr = func_get_arg( $i );\n\n\t\t\t// Is the array associative?\n\t\t\t$assoc = Arr::isAssoc( $arr );\n\n\t\t\tforeach ( $arr as $key => $val ) {\n\t\t\t\tif ( isset( $result[$key] ) ) {\n\t\t\t\t\tif ( is_array( $val ) AND is_array( $result[$key] ) ) {\n\t\t\t\t\t\tif ( Arr::isAssoc( $val ) ) {\n\t\t\t\t\t\t\t// Associative arrays are merged recursively\n\t\t\t\t\t\t\t$result[$key] = Arr::merge( $result[$key], $val );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// Find the values that are not already present\n\t\t\t\t\t\t\t$diff = array_diff( $val, $result[$key] );\n\n\t\t\t\t\t\t\t// Indexed arrays are merged to prevent duplicates\n\t\t\t\t\t\t\t$result[$key] = array_merge( $result[$key], $diff );\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\tif ( $assoc ) {\n\t\t\t\t\t\t\t// Associative values are replaced\n\t\t\t\t\t\t\t$result[$key] = $val;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ( !in_array( $val, $result, TRUE ) ) {\n\t\t\t\t\t\t\t// Indexed values are added only if they do not yet exist\n\t\t\t\t\t\t\t$result[] = $val;\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// New values are added\n\t\t\t\t\t$result[$key] = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "function array_pass($array)\r\n{\r\n $array[0] *= 2;\r\n $array[1] *= 2;\r\n}", "private function getCombinations(array $source): array\n {\n $result = [[]];\n foreach ($source as $property => $property_values) {\n $tmp = [];\n foreach ($result as $result_item) {\n foreach ($property_values as $property_value) {\n $tmp[] = array_merge($result_item, [$property => $property_value]);\n }\n }\n $result = $tmp;\n }\n return $result == [[]] ? [] : $result;\n }", "public static function robots_combine( $robots, $default = false ) {\n\t\tif ( empty( $robots ) || ! is_array( $robots ) ) {\n\t\t\treturn ! $default ? [] : [\n\t\t\t\t'index' => 'index',\n\t\t\t\t'follow' => 'follow',\n\t\t\t];\n\t\t}\n\n\t\t$robots = array_combine( $robots, $robots );\n\n\t\t// Fix noindex key to index.\n\t\tif ( isset( $robots['noindex'] ) ) {\n\t\t\t$robots = [ 'index' => $robots['noindex'] ] + $robots;\n\t\t\tunset( $robots['noindex'] );\n\t\t}\n\n\t\t// Fix nofollow key to follow.\n\t\tif ( isset( $robots['nofollow'] ) ) {\n\t\t\t$robots = [ 'follow' => $robots['nofollow'] ] + $robots;\n\t\t\tunset( $robots['nofollow'] );\n\t\t}\n\n\t\treturn $robots;\n\t}", "function &keyset(array $value, string $namespace = 'default'): array\n{\n return arr(array_keys($value), $namespace);\n}", "protected static function combine_array(&$row, $key, $header) {\n\t\tif(is_array($row) && is_array($header) && count($row) == count($header)) {\n\t\t\t$row = array_combine($header, $row);\n\t\t} else {\n\t\t\techo \"ERROR while trying to combine_array: \";\n\t\t\techo 'key: '. print_r($key, true) . \"\\n\";\n\t\t\techo 'row: '. print_r($row, true) . \"\\n\";\n\t\t\techo 'header: '. print_r($header, true) . \"\\n\";\n\t\t}\n\t}", "public abstract function list_pairwise(): array;", "protected function _safeAssociativeArrayMerge(array $in_associative_array_1, array $in_associative_array_2) {\r\n $result = $in_associative_array_1;\r\n foreach ($in_associative_array_2 as $_key => $_value) {\r\n if (array_key_exists($_key, $result)) {\r\n if ($result[$_key] !== $_value) {\r\n trigger_error(\r\n sprintf('Merging two associative arrays with identical key \"%s\" (with different values).', $_key),\r\n E_USER_WARNING\r\n );\r\n } else {\r\n trigger_error(\r\n sprintf('Merging two associative arrays with identical key \"%s\" (with same values).', $_key),\r\n E_USER_WARNING\r\n );\r\n }\r\n }\r\n\r\n $result[$_key] = $_value;\r\n }\r\n return $result;\r\n }", "function array_pass($array)\n{\n $array[0] *= 2;\n $array[1] *= 2;\n}", "function atk_array_merge($array1, $array2)\n{\n\t$res = Array();\n\n\t$arrays = func_get_args();\n\tfor ($i = 0, $_i = count($arrays); $i < $_i; $i++)\n\t{\n\t\tfor ($j = 0, $_j = count($arrays[$i]); $j < $_j; $j++)\n\t\t{\n\t\t\tif (!in_array($arrays[$i][$j], $res))\n\t\t\t{\n\t\t\t\t$res[] = $arrays[$i][$j];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $res;\n}", "public static function combine(array $data, Closure $generator) {\n\t\t$indexed = [];\n\n\t\tforeach ($data as $key => $value) {\n\t\t\t$Indexer = $generator($value, $key);\n\t\t\t$indexed[$Indexer->key()] = $Indexer->current();\n\t\t}\n\n\t\treturn $indexed;\n\t}", "function atk_array_merge_recursive($array1, $array2)\n{\n\t$arrays = func_get_args();\n\n\t$result = array();\n\n\tforeach ($arrays as $array)\n\t{\n\t\tforeach ($array as $key => $value)\n\t\t{\n\t\t\tif (isset($result[$key]) && is_array($result[$key]) && is_array($value))\n\t\t\t{\n\t\t\t\t$result[$key] = atk_array_merge_recursive($result[$key], $value);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$result[$key] = $value;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $result;\n}", "function concat(array $first, iterable ...$rest): array\n{\n $first = values($first);\n foreach ($rest as $arr) {\n foreach ($arr as $value) {\n $first[] = $value;\n }\n }\n\n return $first;\n}", "private function _valueToKeyCombiner($records)\r\n {\r\n foreach ($records as $idx => $record) {\r\n $records[ $record ] = $record;\r\n unset( $records[ $idx ] );\r\n }\r\n\r\n return $records;\r\n }", "private static function mergeArrayResult($a, $b)\r\n {\r\n // merge arrays if both variables are arrays\r\n if (is_array($a) && is_array($b)) {\r\n // loop through each right array's entry and merge it into $a\r\n foreach ($b as $key => $value) {\r\n if (isset($a[$key])) {\r\n $a[$key] = self::mergeArrayResult($a[$key], $value);\r\n } else {\r\n if($key === 0) {\r\n $a= array(0 => self::mergeArrayResult($a, $value));\r\n } else {\r\n $a[$key] = $value;\r\n }\r\n }\r\n }\r\n } else {\r\n // one of values is not an array\r\n $a = $b;\r\n }\r\n \r\n return $a;\r\n }", "public function exchangeArray(array $array);", "function util_array_values_prepend(&$item, $key, $prefix)\n{\n $item = $prefix.$item;\n}", "function array_merge_recursive_distinct() {\n $arrays = func_get_args();\n $base = array_shift($arrays);\n if (!is_array($base))\n $base = empty($base)? array(): array($base);\n foreach ($arrays as $append) {\n if (!is_array($append)) $append = array($append);\n foreach ($append as $key => $value) {\n if(!array_key_exists($key, $base) and !is_numeric($key)) {\n $base[$key] = $append[$key];\n continue;\n }\n if (is_array($value) or is_array($base[$key]))\n $base[$key] = array_merge_recursive_distinct($base[$key], $append[$key]);\n else if (is_numeric($key))\n if(!in_array($value, $base)) $base[] = $value;\n else\n $base[$key] = $value;\n }\n }\n return $base;\n}", "function C() {\n $arr = func_get_args();\n return Carr($arr);\n }", "public function concat(array $array) {\n\t\treturn new Map(Hash::merge($this->_value, $array));\n\t}", "public static function overwrite(array $array1, array $array2): array\n {\n foreach (array_intersect_key($array2, $array1) as $key => $value) {\n $array1[$key] = $value;\n }\n\n if (func_num_args() > 2) {\n foreach (array_slice(func_get_args(), 2) as $array3) {\n foreach (array_intersect_key($array3, $array1) as $key => $value) {\n $array1[$key] = $value;\n }\n }\n }\n\n return $array1;\n }", "function &vector(array $value, string $namespace = 'default'): array\n{\n return arr(array_values($value), $namespace);\n}", "static function merge(/*...*/){\n $ar = array_filter(func_get_args(),'is_array'); // remove non-arrays\n $nc = count($ar);\n if($nc==0) return(NULL);\n if($nc==1) return($ar[0]);\n $res = call_user_func_array('array_merge_recursive',$ar);\n $res = ops_narray::_merge_reduce($res);\n return($res);\n }" ]
[ "0.75354576", "0.6728617", "0.65865666", "0.644075", "0.64084566", "0.6339594", "0.6114796", "0.5902007", "0.585423", "0.57159805", "0.57068413", "0.5698996", "0.5683259", "0.56699413", "0.56306356", "0.54406047", "0.54101145", "0.5388112", "0.5342983", "0.5291302", "0.5274488", "0.5274316", "0.52541417", "0.5251557", "0.5217483", "0.52140135", "0.5202484", "0.5152082", "0.5092172", "0.50889665", "0.5087981", "0.5082099", "0.50462365", "0.50459254", "0.5034368", "0.5005984", "0.49983788", "0.49971727", "0.4990622", "0.49802834", "0.49792537", "0.49784723", "0.49767098", "0.49693134", "0.4948756", "0.49455655", "0.49197674", "0.49156412", "0.49054548", "0.49024776", "0.48995972", "0.48968038", "0.48764345", "0.4875823", "0.48719952", "0.48695448", "0.48522642", "0.4847796", "0.4837818", "0.48351574", "0.48268846", "0.48034066", "0.48016763", "0.47955778", "0.4788199", "0.47826433", "0.47807443", "0.47782686", "0.4774302", "0.47657347", "0.47653988", "0.47640565", "0.47392544", "0.47318295", "0.47228298", "0.4716565", "0.47153923", "0.47007427", "0.46865723", "0.46862334", "0.46821678", "0.46799687", "0.46756515", "0.46756265", "0.46693587", "0.46689633", "0.46586823", "0.46536317", "0.46444106", "0.46329513", "0.46176523", "0.4610607", "0.46076173", "0.46070042", "0.46013528", "0.45945933", "0.45933285", "0.45809183", "0.4580466", "0.45769548" ]
0.68665147
1
A wrapper for the PHP5 function str_split()
function str_split($string, $split_length = 1) { if ($split_length < 1) { return false; } else if ($split_length >= strlen($string)) { return array($string); } else { preg_match_all('#.{1,' . $split_length . '}#s', $string, $matches); return $matches[0]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mb_str_split($str){\n return preg_split('/(?<!^)(?!$)/u', $str );\n }", "public static function mb_str_split($str,$split_length=1,$charset=\"UTF-8\"){\n if(func_num_args()==1){\n return preg_split('/(?<!^)(?!$)/u', $str);\n }\n if($split_length<1)return false;\n $len = mb_strlen($str, $charset);\n $arr = array();\n for($i=0;$i<$len;$i+=$split_length){\n $s = mb_substr($str, $i, $split_length, $charset);\n $arr[] = $s;\n }\n return $arr;\n }", "public static function strSplit($string, $encoding = 'UTF-8') {}", "public function testSplit2()\n {\n $this->assertEquals(Str::split('', '1,2,3,4,5'), '1,2,3,4,5');\n }", "function text_split($in) {\r\n\t$len = count($in);\r\n\t$a = substr($in,0,$len/2);\r\n\t$b = substr($in,0,(0-($len/2)));\r\n\treturn array($a,$b);\r\n}", "protected static function __split(string $on, string $str): array\n\t{\n\t\tif ($on === '') {\n\t\t\treturn str_split($str);\n\t\t}\n\t\treturn array_filter(explode($on, $str));\n\t}", "protected function split($str)\n {\n return explode(' ', $str);\n }", "public static function split($str)\r\n {\r\n return array_map('trim', preg_split('/[,;|]/',$str,0,PREG_SPLIT_NO_EMPTY));\r\n }", "function split( $delimiter, $string, $limit )\n\t\t{\n\t\t\treturn explode( $delimiter, $string, $limit );\n\t\t}", "function mb_str_split($string) {\n // and not before the end: $\n return preg_split('/(?<!^)(?!$)/u', $string);\n}", "function mb_str_split( $string ) {\n # and not before the end: $\n return preg_split('/(?<!^)(?!$)/u', $string );\n}", "function mb_str_split( $string ) {\n # and not before the end: $\n return preg_split('/(?<!^)(?!$)/u', $string );\n }", "public static function split(string $text): array {\n return str_split($text);\n }", "function superExplode($s, $sep)\n\t{\t$i = 0;\n\t\t$arr[$i++] = strtok($s, $sep);\n\t\twhile (($token = strtok($sep)) !== FALSE)\n\t\t\t$arr[$i++] = $token;\n\t\treturn $arr;\n\t}", "public function splitString(string $input = \"\")\n {\n /**\n * array_map to trim each item\n * array_filter to always return an array, even if empty\n */\n return array_filter(array_map('trim', explode(',', $input)));\n }", "private function mb_str_split( $string )\n {\n # and not before the end: $\n return preg_split('/(?<!^)(?!$)/u', $string );\n }", "function splitString($str, $partition)\n{\n /**\n * This would look better with simple foreach\n **/\n return array_reduce($partition, function($c, $p)\n {\n return [\n 'l' => array_merge($c['l'], [substr($c['s'], 0, $p)]),\n 's' => substr($c['s'], $p)\n ];\n },\n [\n 'l' => [],\n 's' => $str\n ]\n )['l'];\n}", "function explodeCaps(string $string):string\n{\n $pieces = preg_split('/(?=[A-Z])/',$string);\n return $pieces;\n}", "public static function _split($input)\n {\n $plit = preg_split('#\\\\e[[][A-Za-z0-9];?[0-9]*m(*SKIP)(*F)|#u', $input, -1, PREG_SPLIT_NO_EMPTY);\n\n if (false === $plit) {\n return mb_str_split($input);\n }\n\n return $plit;\n }", "function str_split_unicode($str, $l = 0) {\r\n if ($l > 0) {\r\n $ret = array();\r\n $len = mb_strlen($str, \"UTF-8\");\r\n for ($i = 0; $i < $len; $i += $l) {\r\n $ret[] = mb_substr($str, $i, $l, \"UTF-8\");\r\n }\r\n return $ret;\r\n }\r\n return preg_split(\"//u\", $str, -1, PREG_SPLIT_NO_EMPTY);\r\n }", "public static function mbStrSplit(string $string)\n {\n return \\preg_split('/(?<!^)(?!$)/u', $string);\n }", "public static function split(string $input, string $delimiter, int $limit = PHP_INT_MAX)\n {\n return explode($delimiter, $input, $limit);\n }", "protected function split(string $string)\n {\n //ClassName/Service::method\n if (strpos($string, '::') === false) {\n return $string;\n }\n\n return explode('::', $string, 2);\n }", "public static function splitStrUtf8($str,$l = 0) \r\n {\r\n if($l > 0) {\r\n $ret = array();\r\n $len = mb_strlen($str, \"UTF-8\");\r\n for ($i = 0; $i < $len; $i += $l) {\r\n $ret[] = mb_substr($str, $i, $l, \"UTF-8\");\r\n }\r\n return $ret;\r\n }\r\n return preg_split(\"//u\", $str, -1, PREG_SPLIT_NO_EMPTY);\r\n }", "public function testSplit1()\n {\n $this->assertNotEmpty(Str::split(',', '1,2,3,4,5'));\n }", "function multiexplode ($delimiters,$string) {\n\n $ready = str_replace($delimiters, $delimiters[0], $string);\n $launch = explode($delimiters[0], $ready);\n return $launch;\n }", "function l10n_feedback_unpack_string($string) {\n return explode(\"\\0\", $string);\n}", "public function split( $split=',', $limit=1 ) {\n $i = &$this->getInstance();\n if(is_array($i)) {\n return $this;\n }\n $this->trim();\n $parts = explode($split, $i);\n $out = array();\n foreach( $parts as $p ) {\n $p = trim($p);\n if(mb_strlen($p, 'UTF-8') > 0 && mb_strlen($p, 'UTF-8') >= $limit) {\n $out[] = $p;\n }\n }\n $i = (array) $out;\n return $i;\n }", "function splitDir($s)\n {\n return split(';:', $s);\n }", "public function split($delimiter, $limit = null) {\n if ($limit === null) {\n $limit = PHP_INT_MAX;\n }\n\n return self::fromArray(explode($delimiter, $this->rawString, $limit));\n }", "public function split()\n {\n return preg_split('/(?=[A-Z])/', $this->className);\n }", "public static function split($input, $pattern)\n {\n if (!$input) {\n return [];\n }\n if (!is_string($input)) {\n throw new ParseException('The split filter can only operate on strings, ' . gettype($input) . ' given');\n }\n if ($pattern) {\n return explode($pattern, $input);\n }\n return str_split($input);\n }", "private function splitFields(string $fields) : array\r\n {\r\n $dotPos = strpos($fields, '.');\r\n if ($dotPos === false) {\r\n return [ $fields ];\r\n }\r\n\r\n return [\r\n substr($fields, 0, $dotPos),\r\n substr($fields, $dotPos + 1)\r\n ];\r\n }", "public function splitText($text)\n\t{\n\t\treturn preg_split('@([<\\[]\\/?[a-zA-Z0-9]+[\\]>])@i', $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE);\n\t}", "function strToArray(&$string, &$array){\r\n $array = explode(\"\\n\", $string);\r\n }", "function _split_str_by_whitespace($text, $goal)\n {\n }", "function _split($lines) {\r\n if (!preg_match_all('/ ( [^\\S\\n]+ | [[:alnum:]]+ | . ) (?: (?!< \\n) [^\\S\\n])? /xs',\r\n implode(\"\\n\", $lines),\r\n $m)) {\r\n return array(array(''), array(''));\r\n }\r\n return array($m[0], $m[1]);\r\n }", "public static function split_str($input, $delimiter = ',', $enclosure = '\"', $escape = '\\\\', $eol = '\\n') {\n\t\tif (function_exists('str_getcsv')) {\n\t\t\treturn str_getcsv($input, $delimiter, $enclosure, $escape);\n\t\t}\n\t\t$output = array();\n\t\t$tmp = preg_split(\"/\".$eol.\"/\", $input);\n\t\tif (is_array($tmp) && !empty($tmp)) {\n\t\t\twhile (list($line_num, $line) = each($tmp)) {\n\t\t\t\tif (preg_match(\"/\".$escape.$enclosure.\"/\", $line)) {\n\t\t\t\t\twhile ($strlen = strlen($line)) {\n\t\t\t\t\t\t$pos_delimiter = strpos($line, $delimiter);\n\t\t\t\t\t\t$pos_enclosure_start = strpos($line, $enclosure);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tis_int($pos_delimiter) && is_int($pos_enclosure_start)\n\t\t\t\t\t\t\t\t&& ($pos_enclosure_start < $pos_delimiter)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t$enclosed_str = substr($line,1);\n\t\t\t\t\t\t\t$pos_enclosure_end = strpos($enclosed_str, $enclosure);\n\t\t\t\t\t\t\t$enclosed_str = substr($enclosed_str, 0, $pos_enclosure_end);\n\t\t\t\t\t\t\t$output[$line_num][] = $enclosed_str;\n\t\t\t\t\t\t\t$offset = $pos_enclosure_end + 3;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif (empty($pos_delimiter) && empty($pos_enclosure_start)) {\n\t\t\t\t\t\t\t\t$output[$line_num][] = substr($line, 0);\n\t\t\t\t\t\t\t\t$offset = strlen($line);\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$output[$line_num][] = substr($line, 0, $pos_delimiter);\n\t\t\t\t\t\t\t\t$offset = (\n\t\t\t\t\t\t\t\t\t\t!empty($pos_enclosure_start)\n\t\t\t\t\t\t\t\t\t\t&& ($pos_enclosure_start < $pos_delimiter)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t? $pos_enclosure_start\n\t\t\t\t\t\t\t\t: $pos_delimiter + 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$line = substr($line, $offset);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$line = preg_split(\"/\".$delimiter.\"/\", $line);\n\t\t\t\t\t// Validating against pesky extra line breaks creating false rows.\n\t\t\t\t\tif (is_array($line) && !empty($line[0])) {\n\t\t\t\t\t\t$output[$line_num] = $line;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $output;\n\t\t}\n\t\treturn false;\n\t}", "public static function explode(string $haysack, string $delimeter)\n\t{\n\t\treturn array_map(\"stripslashes\", preg_split('~(?<!\\\\\\)' . preg_quote($delimeter, '~') . '~', $constraint));\n\t}", "public function testSplit3()\n {\n $this->assertEquals(count(Str::split(',', '1,2,3,4,5', 2)), 2);\n }", "function save_explode($del, $str)\n\t{\n\n\t\treturn strpos($str, $del) !== false\n\t\t\t? explode($del, $str)\n\t\t\t: array((string)$str);\n\n\t}", "private static function goodSplit($str, $split) {\n $arr = array_map('trim', explode($split, $str));\n $retVal = array();\n\n $opened_brackets = 0;\n $total = '';\n foreach( $arr as $el ) {\n $total .= $el . $split;\n $opened_brackets += substr_count($el, '<');\n $opened_brackets -= substr_count($el, '>');\n if ( $opened_brackets == 0 ) {\n $retVal[] = rtrim($total, $split);\n $total = '';\n }\n }\n\n return $retVal;\n }", "public function splitCharCodes($charCodes) {}", "public function splitCharCodes($charCodes) {}", "function splitByWords($text, $splitLength = 200) {\r\n $wordArray = explode(' ', $text);\r\n\r\n // Too many words\r\n if (sizeof($wordArray) > $splitLength) {\r\n // Split words into two arrays\r\n $firstWordArray = array_slice($wordArray, 0, $splitLength);\r\n $lastWordArray = array_slice($wordArray, $splitLength + 1, sizeof($wordArray));\r\n\r\n // Turn array back into two split strings \r\n $firstString = implode(' ', $firstWordArray);\r\n $lastString = implode(' ', $lastWordArray);\r\n return array($firstString, $lastString);\r\n }\r\n // if our array is under the limit, just send it straight back\r\n return array($text);\r\n }", "public function str_split_unicode($str, $length = 1) {\n\n $tmp = preg_split('~~u', $str, -1, PREG_SPLIT_NO_EMPTY);\n\n if ($length > 1) {\n $chunks = array_chunk($tmp, $length);\n foreach ($chunks as $i => $chunk) {\n $chunks[$i] = join('', (array) $chunk);\n }\n $tmp = $chunks;\n }\n\n return $tmp;\n\n }", "public function asArray() : array\n {\n return str_split($this->string);\n }", "function multiexplode($delimiters, $string)\n{\n // * 1. replace first array of delimiters to all element array in text\n $ready = str_replace($delimiters, $delimiters[0], $string);\n // * 2. then explode with first element before\n $launch = explode($delimiters[0], $ready);\n return $launch;\n}", "public static function quote_safe_explode($delimeter, $string) {\n\t\t\n\t\t$result = array();\n\t\t\n\t\t$quote = false;\n\t\t$escape = false;\n\t\t\n\t\tfor($i = 0; $i < strlen($string); $i ++) {\n\t\t\tif($string[$i] == '\"' or $string[$i] == '\\'') {\n\t\t\t\tif($escape)\n\t\t\t\t\t$escape == false;\n\t\t\t\telseif(!$quote)\n\t\t\t\t\t$quote = $string[$i];\n\t\t\t\telseif($quote == $string[$i])\n\t\t\t\t\t$quote = false;\n\t\t\t\t\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif(!$quote and strpos($string, $delimeter, $i) === $i) {\n\t\t\t\t$result[] = substr($string, 0, $i);\n\t\t\t\t$string = substr($string, $i + strlen($delimeter));\n\t\t\t\t$i = -1;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$result[] = $string;\n\t\treturn $result;\n\t\t\n\t}", "public static function separate($part1, $part2 = null)\n\t{\n if ($part2 === null && strpos($part1, self::PARTS_SEPARATOR))\n {\n list($part1, $part2) = explode(self::PARTS_SEPARATOR, $part1);\n }\n return array($part1, $part2);\n\t}", "function split_number_str($string)\n{\n return (array) preg_split('/(?<=\\d)(?=[a-z])|(?<=[a-z])(?=\\d)/i', $string);\n}", "function arrayLetras($texto){\n $texto = strtolower($texto); \n return str_split($texto);\n}", "public function splitCharCodes($charCodes);", "public function split($raw)\n {\n // real dirty, hrhr but works\n $raw = ' '.$raw;\n\n // clean old tokens\n $this->tokens = [];\n $this->tokens[] = array(1,'');\n\n $regex = '/(' .\n implode(')|(', $this->catchablePatterns) . ')|'.\n implode('|', $this->nonCatchablePatterns) . '/i';\n\n $flags = PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE;\n // PREG_SPLIT_NO_EMPTY|PREG_SPLIT_DELIM_CAPTURE\n\n $this->rawMatches = preg_split($regex, $raw, -1, $flags);\n\n $this->createTokens();\n\n //if (DEBUG)\n // Debug::console('raw input: ' , $raw);\n\n //if (DEBUG)\n // Debug::console('created tokens: ' , $this->tokens);\n\n }", "protected function wp_html_split($input) { //+\n\treturn preg_split($this->get_html_split_regex(), $input, -1, PREG_SPLIT_DELIM_CAPTURE);\n}", "public function testWordsSplitByLetter()\n {\n $str = new Str($this->testString);\n $result = $str->words('/o/');\n $this->assertTrue(is_array($result));\n $this->assertTrue($result[0] === 'The quick br');\n }", "public function split($char)\n {\n return self::create('',$this->provider->split($char));\n }", "function splitcomma($x){\n $x = substr($x,1,strlen($x)-2);\n\t$x = explode(',',$x);\n\treturn $x;\n}", "protected function explodeString($string, $delimeter)\r\n {\r\n return str_getcsv($string, $delimeter);\r\n }", "abstract protected function getTokenSeparators() : array;", "private static function stringToArray( $inarray, $sep ) {\n\t\tif ( $sep === \"\" ) {\n\t\t\t$outarray = str_split( preg_replace( \"/[\\s]+/\", \"\", $inarray ) );\n\t\t} else {\n\t\t\t$outarray = preg_split( \"/[\\s]*\" . preg_quote( $sep ) . \"[\\s]*/\", $inarray );\n\t\t}\n\t\treturn $outarray;\n\t}", "public function getSplit()\n {\n return $this->__split__;\n }", "function & _split_words( & $string )\n {\n $string = preg_replace($this->_pattern, \"\", $string);\n $string = str_replace($this->_convert_str,\" \",$string);\n $content_array = explode(\" \",$string); \n $array_content = array_count_values($content_array);\n $_tmp = array();\n\n while ($word = each ($array_content))\n { \n if(strlen($word[0])>$this->_word_length)\n {\n $word[0] = strtolower($word[0]);\n if(!isset($this->bad_word_array[$word[0]]))\n { \n $_tmp[] = $word[0];\n }\n }\n }\n return $_tmp;\n }", "private static function multiexplode($string, $delimiters = [',', '|', ':'])\n {\n $replace = str_replace($delimiters, $delimiters[0], $string);\n\n return explode($delimiters[0], $replace);\n }", "function tuti_fexplode($args)\n{\n\t$str=$args[\"str\"];\t\t//строка\n\t$sep=$args[\"sep\"];\t\t//разделитель\n\t$lim=$args[\"lim\"];\t\t//ограничитель в рамках которого не действует разделитель\n\t\n\t$state_1=true;\n\t$state_2=false;\n\t$state_1_new=true;\n\t$state_2_new=false;\n\t\n\t$i=0;\n\t$str_len=strlen($str);\n\t$ch='';\n\t$ch_prev='';\n\t$ch_prev_prev='';\n\t$ch_next='';\n\t$ch_next_next='';\n\t\n\t$str_part_arr=Array();\n\t$str_part=\"\";\n\t\n\t//pj_deb_flog3(__LINE__, __FILE__, $str_len, \"tkvl3_explode\");\n\t\n\twhile($i<$str_len)\n\t{\n\t\t\n\t\t$ch=$str[$i];\n\t\t$ch_prev=$i>0?$str[$i-1]:'';\n\t\t$ch_prev_prev=$i>1?$str[$i-2]:'';\n\t\t$ch_next=$i<$str_len?$str[$i+1]:'';\n\t\t$ch_next_next=$i+1<$str_len?$str[$i+2]:'';\n\t\t\n\t\t//pj_deb_flog3(__LINE__, __FILE__, $ch, \"tkvl3_explode\");\n\t\t//pj_deb_flog3(__LINE__, __FILE__, $str_part, \"tkvl3_explode\");\n\t\t//pj_deb_flog3(__LINE__, __FILE__, $str_part_arr, \"tkvl3_explode\");\n\t\t\n\t\t\n\t\tif ($state_1&&$ch==$sep)\n\t\t{\n\t\t\t//pj_deb_flog3(__LINE__, __FILE__, $sep, \"tkvl3_explode\");\n\t\t\tif (strlen($str_part)>0)\n\t\t\t{\n\t\t\t\tarray_push($str_part_arr, $str_part);\n\t\t\t\t$str_part=\"\";\n\t\t\t}\n\t\t}\n\t\tif ($ch==$lim&&$state_1)//&&!$state_2)\n\t\t{\n\t\t\t//pj_deb_flog3(__LINE__, __FILE__, $str_part, \"tkvl3_explode\");\n\t\t\t$state_1_new=false;\n\t\t\t//$state_2_new=true;\n\t\t}\n\t\tif (!$state_1&&$ch==$lim)//&&!$state_2)\n\t\t{\n\t\t\t//pj_deb_flog3(__LINE__, __FILE__, $str_part, \"tkvl3_explode\");\n\t\t\t$state_1_new=true;\n\t\t}\n\t\t//if ($ch==\"\\\\\"&&!$state_1)\n\t\t//{\n\t\t//\t$state_2_new=true;\n\t\t//}\n\t\t//if ($state_2)\n\t\t//{\n\t\t//\t$state_2_new=false;\n\t\t//}\n\t\t\n\t\tif ($ch!=$sep)//&&!$state_2_new)\n\t\t{\n\t\t\t//pj_deb_flog3(__LINE__, __FILE__, \"df\".$str_part, \"tkvl3_explode\");\n\t\t\t$str_part.=$ch;\n\t\t}\n\t\tif (!$state_1&&$ch==$sep)//&&!$state_2_new)\n\t\t{\n\t\t\t//pj_deb_flog3(__LINE__, __FILE__, \"123\".$str_part, \"tkvl3_explode\");\n\t\t\t$str_part.=$ch;\n\t\t}\n\t\t\n\t\t$state_1=$state_1_new;\n\t\t$state_2=$state_2_new;\n\t\t\n\t\t$i++;\n\t}\n\t\n\t//pj_deb_flog3(__LINE__, __FILE__, $str_part, \"tkvl3_explode\");\n\t//pj_deb_flog3(__LINE__, __FILE__, $str_part_arr, \"tkvl3_explode\");\n\t\n\tif (strlen($str_part)>0)\n\t{\n\t\tarray_push($str_part_arr, $str_part);\n\t}\n\t//pj_deb_flog3(__LINE__, __FILE__, $str_part_arr, \"tkvl3_explode\");\n\t\n\treturn $str_part_arr;\n\t\n}", "public static function convertStringToArray($string, $delimiter)\n {\n if(empty($string) && empty($delimiter)){\n return array();\n }\n return explode($delimiter, $string);\n }", "public static function split($url, $base = BASE_URL)\n {\n $url = self::stripBase($url, $base);\n if($url != '/') {\n $url = StringHelper::stripEnd($url, '/');\n }\n return empty($url) ? [] : explode('/', $url);\n }", "function split($sql)\n{\n\t$sqlIQuery = (explode(\" \",$sql));\n\t$sqlIQuery = count($sqlIQuery);\n\treturn $sqlIQuery;\n}", "public function stringtoarray($stringa,$delimitatore=','){\n\t\treturn explode($delimitatore,$stringa);\n\t}", "function w($elements)\n{\n return preg_split('~\\s+~', $elements, -1, PREG_SPLIT_NO_EMPTY);\n}", "function str_to_array($str,$key){\n\t\t//remove the . from last line\n\t\t$str = trim($str,'.');\n\t\treturn explode($key,$str);\n\t}", "public function split($keyWords)\n {\n $keyWordsArray = explode(\" \", $keyWords);\n\n return $keyWordsArray;\n }", "function wp_html_split($input)\n {\n }", "public static function fetchParams($string, $split = '|', $pairSplit = ':')\r\n {\r\n $params = array();\r\n if (!empty($string))\r\n {\r\n $tmp = explode($split, $string);\r\n foreach ($tmp as $value)\r\n {\r\n $split = explode($pairSplit, $value);\r\n $params[$split[0]] = $split[1];\r\n }\r\n }\r\n return $params;\r\n }", "public static function multiExplode($standardDelimeter, $string, $delimeters = array()) {\n foreach($delimeters as $delimeter) {\n $string = str_replace($delimeter, $standardDelimeter, $string);\n }\n \n $array = explode($standardDelimeter, $string);\n return $array;\n }", "public static function splitName(string $name): array\n\t{\n\t\t$pos = strrpos($name, ':');\n\t\treturn $pos === false\n\t\t\t? ['', $name, '']\n\t\t\t: [substr($name, 0, $pos), substr($name, $pos + 1), ':'];\n\t}", "public function splitLine() {\n $this->words = preg_split('/[\\' \\',\\t]+/', $this->line);\n }", "function splitclm($string, $default)\n{\n\t$segments = explode(':', $string);\n\t$class = $segments[0];\n\t$method = isset($segments[1]) ? $segments[1] : $default;\n\n\treturn [$class, $method];\n}", "function splitonspace($data)\n{\n\t$u_data=preg_split(\"/ +/\",$data);\n\t$lname=array_pop($u_data);\n\n\t$fn=\"\";\n\tforeach ($u_data as $n => $v)\n\t{\n\t\t$fn=$v.\" \";\n\t}\n\n\t$dout=array(0=>$fn,1=>$lname);\n\treturn $dout;\n}", "public function exploder($delimiter,$value){\n\n\t return explode($delimiter, $value);\n\n }", "public function getArrSplit(){ //true\r\n\r\n\t\t$arrSplit = array(\r\n\t\t\t\"none\" => \"No Split\",\r\n\t\t\t\"chars\" => \"Char Based\",\r\n\t\t\t\"words\" => \"Word Based\",\r\n\t\t\t\"lines\" => \"Line Based\"\r\n\t\t);\r\n\r\n\t\treturn($arrSplit);\r\n\t}", "protected function _splitFieldname($field)\n\t{\n\t\tif (is_string($field)) {\n\t\t\tif (preg_match('/^[a-z0-9_-]+\\.([a-z 0-9_-]+|\\*)$/i', $field)) {\n\t\t\t\treturn explode('.', $field, 2);\n\t\t\t}\n\t\t}\n\t\treturn [null, $field];\n\t}", "function splitQuestions($a) {\r\n\r\n\tif(strpos($a, \",\")) {\r\n\t\t$t = preg_split(\"/,/\", $a);\r\n\t\treturn $t;\r\n\t}\r\n\telse {\r\n\t\t$t = array($a);\r\n\t\treturn $a;\r\n\t}\r\n}", "public static function explode2 ( $p_delim1, $p_delim2, $p_string, $p_limit=2 ) {\n\t// returns empty array if $p_string is null \n\t\t$l_result = array();\n\t\tif (!empty( $p_string )) {\n\t\t\t$l_temparray = explode( $p_delim1, $p_string );\n\t\t\tif ( $l_temparray !== FALSE ) {\n\t\t\t\tforeach ( $l_temparray as $l_string ) {\n\t\t\t\t\tlist ($key,$value) = explode( $p_delim2, $l_string, $p_limit );//only use 1st instance of delimiter\n\t\t\t\t\t$l_result[$key] = $value;\n\t\t\t\t} // foreach\n\t\t\t}//if\n\t\t}//if !empty\n\t\treturn $l_result;\n\t}", "function preg_split(string $pattern, string $subject, ?int $limit = -1, int $flags = 0): array\n{\n error_clear_last();\n $safeResult = \\preg_split($pattern, $subject, $limit, $flags);\n if ($safeResult === false) {\n throw PcreException::createFromPhpError();\n }\n return $safeResult;\n}", "public static function split($string, $pattern, $limit = null) : array\n {\n $flags = PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE;\n return preg_split(self::_normalize($pattern), $string, $limit, $flags);\n }", "function splitvalues($str)\n{\n\t$arr=array();\n\tif($str==\"\")\n\t{\n\t\t$arr[] = \"\";\n\t\treturn $arr;\n\t}\n\t$start=0;\n\t$i=0;\n\t$inquot=false;\n\twhile($i<=strlen($str))\n\t{\n\t\tif($i<strlen($str) && substr($str,$i,1)=='\"')\n\t\t\t$inquot=!$inquot;\n\t\telse if($i==strlen($str) || !$inquot && substr($str,$i,1)==',')\n\t\t{\n\t\t\t$val=substr($str,$start,$i-$start);\n\t\t\t$start=$i+1;\n\t\t\tif(strlen($val) && substr($val,0,1)=='\"')\n\t\t\t{\n\t\t\t\t$val=substr($val,1,strlen($val)-2);\n\t\t\t\t$val=str_replace('\"\"','\"',$val);\n\t\t\t}\n\t\t\t\n\t\t\tif( $val !== FALSE )\n\t\t\t$arr[]=$val;\n\t\t}\n\t\t$i++;\n\t}\n\treturn $arr;\n}", "protected function boundrySplit($input, $boundary) {\n $parts = [];\n $bs_possible = Unicode::substr($boundary, 2, -2);\n $bs_check = '\\\"' . $bs_possible . '\\\"';\n\n if ($boundary == $bs_check) {\n $boundary = $bs_possible;\n }\n\n $tmp = explode('--' . $boundary, $input);\n\n for ($i = 1; $i < count($tmp); $i++) {\n if (trim($tmp[$i])) {\n $parts[] = $tmp[$i];\n }\n }\n\n return $parts;\n }", "protected function splitColors($str)\n {\n return explode('/', $str);\n }", "function processReqString ($req) {\r\n\r\n\t$question = explode(\"|\", $req);\r\n\tif(sizeof($req) ==0 ) {\r\n\t\techo 'error: The provided string is incorrect';\r\n\t\treturn null;\r\n\t}\r\n\t$arr = array_map(\"splitQuestions\", $question);\r\n\treturn $arr;\r\n\r\n\r\n}", "public function split($pattern, $limit = null)\n {\n if ($limit === 0) {\n return array();\n }\n\n // UTF8::split errors when supplied an empty pattern in < PHP 5.4.13\n // and current versions of HHVM (3.8 and below)\n if ($pattern === '') {\n return array(static::create($this->str, $this->encoding));\n }\n\n // UTF8::split returns the remaining unsplit string in the last index when\n // supplying a limit\n if ($limit > 0) {\n $limit += 1;\n } else {\n $limit = -1;\n }\n\n $array = preg_split('/' . preg_quote($pattern, '/') . '/u', $this->str, $limit);\n\n if ($limit > 0 && count($array) === $limit) {\n array_pop($array);\n }\n\n /** @noinspection CallableInLoopTerminationConditionInspection */\n for ($i = 0; $i < count($array); $i++) {\n $array[$i] = static::create($array[$i], $this->encoding);\n }\n\n return $array;\n }", "public static function split_commandline($str, $trim = true) {\n\t\t// Tokens are separated with white characters, they gather by standardizing\n\t\t// the separation of tokens with a single space, then we use a function that will\n\t\t// explode string taking into account the chains.\n\t\treturn self::split_str(implode(' ', preg_split('/\\s+/', $trim ? trim(\"$str\") : \"$str\")), ' ');\n\t}", "public static function to_arr( $str, $sep = ',' ) {\n\t\t$parts = explode( $sep, trim( $str ) );\n\n\t\treturn empty( $parts ) ? false : $parts;\n\t}", "public static function convertStringToArray($str, $seperator = ',')\n {\n return self::removeEmptyItems(explode($seperator, $str), function ($param) {\n return self::trimQuots($param);\n });\n }", "function separate($str)\n\t{\n\t\t$arr = array();\n\t\t$flag = 0;\n\t\tfor($i = 0; $i < strlen($str)-3; ++$i)\n\t\t{\n\t\t\tif(substr($str, $i, 5) == \"<br/>\")\n\t\t\t{\n\t\t\t\t//echo \"fuck\";\n\t\t\t\t$arrData1 = substr($str, 0, $i);\n\t\t\t\t$arrData2 = substr($str, $i + 5, strlen($str) - $i - 4);\n\t\t\t\tif($arrData2 == null)continue;\n\t\t\t\tarray_push($arr, $arrData1);\n\t\t\t\tarray_push($arr, $arrData2);\n\t\t\t\t$flag = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn ($flag ? $arr : $str);\n\t}", "public function testSplitWords()\n {\n $words = '123 123 45 789';\n $filter = new \\Magento\\Framework\\Filter\\SplitWords(false, 3);\n $this->assertEquals(['123', '123', '45'], $filter->filter($words));\n $filter = new \\Magento\\Framework\\Filter\\SplitWords(true, 2);\n $this->assertEquals(['123', '45'], $filter->filter($words));\n }", "public function tokenize($string) {\n $tokens = array();\n\n $parentTokens = parent::tokenize($string);\n\n $currentToken = '';\n foreach ($parentTokens as $token) {\n if ($token === self::FIELD_SEPARATOR) {\n $tokens[] = $currentToken;\n $currentToken = '';\n continue;\n }\n\n $currentToken .= ($currentToken ? ' ' : '') . $token;\n }\n\n if ($currentToken) {\n $tokens[] = $currentToken;\n }\n\n return $tokens;\n }", "static public function fromString(\n string $using,\n string $divisor = \"\",\n bool $includeEmpties = true,\n int $limit = PHP_INT_MAX\n ): array\n {\n if (IsIdenticalTo::fromString($divisor, \"\")) {\n return mb_str_split($using);\n }\n\n $base = explode($divisor, $using, $limit);\n if ($includeEmpties) {\n return $base;\n }\n return DropUsing::fromList($base, function($v) { return empty($v); });\n }", "function get_html_split_regex()\n {\n }", "public function string2array($string, $delimiter = \",\"){\n\n\t\t$array = explode($delimiter, $string);\n\n\t\tforeach($array AS $key => &$value){\n\t\t\t$value = $this->clean($value);\n\t\t}\n\n\t\treturn $array;\n\t}" ]
[ "0.7308347", "0.7109188", "0.70803404", "0.70198214", "0.6973693", "0.69686264", "0.69671124", "0.68634045", "0.6856999", "0.6713238", "0.669301", "0.6650854", "0.6566528", "0.65630287", "0.65587217", "0.6532127", "0.6457514", "0.6381235", "0.6371659", "0.6261414", "0.61606944", "0.61426127", "0.6095227", "0.6057293", "0.6057277", "0.59903634", "0.59838074", "0.59546757", "0.5925248", "0.5925158", "0.5908301", "0.59053034", "0.589203", "0.58841646", "0.588303", "0.5873075", "0.5872192", "0.5867178", "0.58614445", "0.58571935", "0.5841223", "0.5837498", "0.5810626", "0.58102083", "0.57823604", "0.5779936", "0.5759119", "0.5753939", "0.5751019", "0.57451993", "0.5744259", "0.5736656", "0.5731791", "0.5727678", "0.5718178", "0.57133114", "0.57114017", "0.57080805", "0.5696141", "0.56825", "0.56638974", "0.5631499", "0.5628296", "0.56101817", "0.5603997", "0.5603352", "0.5603119", "0.5597613", "0.55939555", "0.5586492", "0.555736", "0.5555629", "0.5523692", "0.55216926", "0.55159706", "0.55140924", "0.5496107", "0.5475054", "0.546805", "0.545758", "0.54329735", "0.5407647", "0.54066473", "0.5402145", "0.5378718", "0.53760386", "0.5370887", "0.53510433", "0.5347511", "0.53066385", "0.53056353", "0.53051454", "0.53033274", "0.5301257", "0.5299478", "0.5283107", "0.52753484", "0.527347", "0.5269722", "0.526301" ]
0.71798056
1
A wrapper for the PHP5 function stripos Find position of first occurrence of a caseinsensitive string
function stripos($haystack, $needle) { if (preg_match('#' . preg_quote($needle, '#') . '#i', $haystack, $m)) { return strpos($haystack, $m[0]); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function my_stripos($haystack,$needle,$offset = 0)\r\n{\r\n return(strpos(strtolower($haystack),strtolower($needle),$offset));\r\n}", "function stristrr($haystack, $needle, $before_needle=false) {\n if(!$before_needle) return stristr($haystack, $needle);\n\n $pos = stripos($haystack, $needle);\n if($pos === false) return false;\n return substr($haystack, 0, $pos);\n}", "function strstr2($haystack, $needle, $before_needle = false){\n\t$pos = strpos(strtolower($haystack), strtolower($needle));\n\tif($pos === false)\n\t\treturn '';\n\tif($before_needle){\n\t\treturn substr($haystack, 0, $pos);\n\t} else {\n\t\treturn substr($haystack, $pos + strlen($needle));\n\t}\n}", "public function replaceFirstIgnoreCase($searchFor, $replaceWith = null) {\n return $this->replaceOneInternal('mb_stripos', $searchFor, $replaceWith);\n }", "function my_strstr($haystack, $needle, $before_needle=FALSE) \n{\n \tif(($pos=strpos($haystack,$needle))===FALSE) return $haystack;\n\n \tif($before_needle) return substr($haystack,0,$pos+strlen($needle));\n\t else return substr($haystack,$pos);\n}", "static function before(string $s, string $search): string {\n $p = mb_strpos($s, $search);\n\n return $p ? mb_substr($s, 0, $p) : '';\n }", "static function starts_with($string, $find, $case_sensitive=true){\r\n if ($case_sensitive)\r\n return strpos($string, $find) === 0 ;\r\n return stripos($string, $find) === 0;\r\n }", "function first_str_replace($haystack, $needle, $replace) {\n\t$pos = strpos($haystack, $needle);\n\tif ($pos !== false) return substr_replace($haystack, $replace, $pos, strlen($needle));\n\treturn $haystack;\n}", "function strStartsWith($haystack,$needle){\n\n if(strlen($haystack)<strlen($needle)){\n return false;\n }\n $pos=stripos($haystack,$needle);\n if(!$pos||$post>0){\n return false;\n }\n return true;\n}", "function str_istarts_with($needle, $haystack)\n {\n return str::startsWithIgnoreCase($needle, $haystack);\n }", "function strripos($haystack, $needle, $offset=0) {\n if($offset<0){\n $temp_cut = strrev( substr( $haystack, 0, abs($offset) ) );\n }\n else{\n $temp_cut = strrev( substr( $haystack, $offset ) );\n }\n $pos = strlen($haystack) - (strpos($temp_cut, strrev($needle)) + $offset + strlen($needle));\n if ($pos == strlen($haystack)) { $pos = 0; }\n \n if(strpos($temp_cut, strrev($needle))===false){\n return false;\n }\n else return $pos;\n }", "function my_strrpos($haystack, $needle)\n{\n\t$index = strpos(strrev($haystack), strrev($needle));\n\tif($index === false)\n\t\treturn false;\n\t$index = strlen($haystack) - strlen($needle) - $index;\n\treturn $index;\n}", "public function testStringIsFoundIfCaseInsensitive()\n {\n $needle = \"foo\";\n $haystack = ucfirst($needle) . \" Bar\";\n $this->assertTrue(Strings::contains($haystack, $needle, false));\n }", "static function str_contains($string, $find, $case_sensitive=true) {\r\n if (empty($string) || empty($find))\r\n return false;\r\n\r\n if ($case_sensitive)\r\n $pos = strpos($string, $find);\r\n else\r\n $pos = stripos($string, $find);\r\n\r\n if ($pos === false)\r\n return false;\r\n else\r\n return true;\r\n }", "function strapos($haystack,$needles,$offset=0) {\n $results = array();\n foreach($needles as $n) {\n $results[] = strpos($haystack, $n);\n }\n $results = array_filter($results);\n sort($results);\n if(isset($results[$offset])) return $results[$offset];\n else return false;\n}", "function startsWithIgnoreCase($Haystack, $Needle){\n if(strlen($Needle)==0){return false;}\n // Recommended version, using strpos\n return strpos(strtolower($Haystack), strtolower($Needle)) === 0;\n }", "function strbefore($string, $substring)\r\n{\r\n $pos = strpos($string, $substring);\r\n if ($pos === false)\r\n return $string;\r\n else\r\n return (substr($string, 0, $pos));\r\n}", "function str_removeFromStart (string $str, string $needle) : string {\n\t$strLen = strlen($str);\n\t$needleLen = strlen($needle);\n\n\tif($strLen >= $needleLen and str_startsWith($str, $needle)){\n\t\treturn substr($str, $needleLen);\n\t}\n\treturn $str;\n}", "function str_before($search, $string)\n {\n return str::before($search, $string);\n }", "function str_replace_first($search, $replace, $subject) {\n\t$pos = strpos($subject, $search);\n\tif ($pos !== false) {\n\t\treturn substr_replace($subject, $replace, $pos, strlen($search));\n\t}\n\t\n\treturn $subject;\n}", "function uv_first_capital($string){\n //Patron para reconocer y no modificar numeros romanos\n $pattern = '/\\b(?![LXIVCDM]+\\b)([A-Z_-ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝ]+)\\b/';\n $output = preg_replace_callback($pattern, function($matches) {\n return mb_strtolower($matches[0], 'UTF-8');\n }, $string);\n $output = ucfirst($output);\n return $output;\n }", "function starts_with($text = '', $substring = '') {\n return (strpos(mb_strtolower($text), mb_strtolower($substring)) === 0);\n}", "function str_replace_first($search, $replace, $subject) {\n $pos = strpos($subject, $search);\n if ($pos !== false) {\n return substr_replace($subject, $replace, $pos, strlen($search));\n }\n return $subject;\n }", "function before ($inthat,$str )\n {\n return substr($inthat, 0, strpos($inthat, $str));\n }", "public function beforeFirst($search) {\n return $this->sideInternal('mb_strpos', $search, -1);\n }", "public function lowerCaseFirst()\n {\n $first = UTF8::substr($this->str, 0, 1, $this->encoding);\n $rest = UTF8::substr(\n $this->str, 1, $this->length() - 1,\n $this->encoding\n );\n\n $str = UTF8::strtolower($first, $this->encoding) . $rest;\n\n return static::create($str, $this->encoding);\n }", "function str_before($subject, $search)\n {\n return Str::before($subject, $search);\n }", "function wsod_strposall($haystack,$needle){ \n $s=0; $i=0; \n while (is_integer($i)){ \n $i = strpos($haystack,$needle,$s); \n if (is_integer($i)) { \n $aStrPos[] = $i; \n $s = $i+strlen($needle); \n } \n } \n if (isset($aStrPos)) { \n return $aStrPos; \n } else { \n return false; \n } \n}", "function uncapitalize(){\n\t\t$first = $this->substr(0,1)->downcase();\n\t\treturn $first->append($this->substr(1));\n\t}", "function substrBefore($string,$char) {\n $pos = strpos($string, $char);\n if($pos===false) {return $string;}\n else {return substr($string, 0, $pos);}\n}", "function detect_any_lowercase($string){\r\n\treturn strtoupper($string) != $string;\r\n}", "function findPositionOfChar($search_string, $search) {\n if( strpos($search, $search_string) !== false ) {\n return 1;\n }\n return 0;\n }", "static function beforeLast(string $s, string $search): string {\n $p = mb_strrpos($s, $search);\n\n return $p ? mb_substr($s, 0, $p) : '';\n }", "function removeFirstChar($string)\n{\n $i = 0;\n $string = substr_replace($string, '', $i, 1);\n return $string;\n}", "public static function replaceStart($str, $needle, $replace, $caseInvariant = true)\n {\n $match = substr($str, 0, strlen($needle));\n if (self::strContains($match, $needle, $caseInvariant))\n {\n return $replace . substr($str, strlen($needle));\n }\n return $str;\n }", "public function testStringIsNotFoundIfCaseSensitive()\n {\n $needle = \"Foo\";\n $haystack = \"Bar Baz\";\n $this->assertFalse(Strings::contains($haystack, $needle, true));\n }", "public static function snakeCase($str) {}", "public static function startsWith($haystack,$needle,$case=true) {\n\t\tif($case){\n\t\t\treturn (strcmp(substr($haystack, 0, strlen($needle)),$needle)===0);\n\t\t}\n\t\treturn (strcasecmp(substr($haystack, 0, strlen($needle)),$needle)===0);\n\t}", "public function testStringIsFoundIfCaseSensitive()\n {\n $needle = \"Foo\";\n $haystack = $needle . \" Bar\";\n $this->assertTrue(Strings::contains($haystack, $needle, true));\n }", "public function snake($word);", "function stripos_clone($haystack, $needle, $offset=0) {\r\t\t$return = stripos($haystack, $needle, $offset=0);\r\t\tif ($return === false) {\r\t\t\treturn false;\r\t\t} else {\r\t\t\treturn true;\r\t\t}\r\t}", "function reverse_strrchr($haystack, $needle) {\n\tif (!is_string($haystack)) {\n\t\treturn;\n\t}\n\treturn strrpos($haystack, $needle) ? substr($haystack, 0, strrpos($haystack, $needle) +1) : false;\n}", "private function _firstUC($word)\n\t{\n\t\t# code...\n\t\t// $n = preg_match( '/[A-Z]/', $word, $matches, PREG_OFFSET_CAPTURE );\n\t\t// return $n ? strlen($matches[0]) : false;\n\n\t\t# find position of the first Capital leter in the word\n\t\t$l = strlen(preg_replace(\"/^([a-z]*)[A-Z].*$/\", \"$1\", $word));\n\n\t\t// return false if the result above is equal to the lenght of the sword...i.e no capital letter found\n\t\treturn strlen($word) == $l ? false : $l;\n\t}", "function str_replace_first($search, $replace, $subject)\n {\n return Str::replaceFirst($search, $replace, $subject);\n }", "function str_starts_with($needle, $haystack)\n {\n return str::startsWith($needle, $haystack);\n }", "function strposa( $haystack, $needles = array( ), $offset = 0 ) {\n$chr = array( );\nforeach ( $needles as $needle )\n {\n $res = strpos( $haystack, $needle, $offset );\n if ( $res !== false )\n return $needle;\n }\nreturn 'no';\n}", "function seachString($name,$str)\n\t{\n\t\t$result='';\n\t\t$result = strpos($name,$str);\n\t\tif ($result != '') {\n\t\t\techo \"True\";\n\t\t}\n\t\telse{\n\t\t\techo\"Flase\";\n\t\t}\n\n\t}", "function str_replace_first($search, $replace, $subject)\n {\n return Str::replaceFirst($search, $replace, $subject);\n }", "function low($str) {\n\t\treturn strtolower($str);\n\t}", "function startsWith2bm($haystack, $needle) {\r\n return $needle === \"\" || strrpos($haystack, $needle, -strlen($haystack)) !== false;\r\n}", "function str_remove_first(string $needle, string $object)\n {\n return Str::removeFirst($needle, $object);\n }", "private static function strReplaceFirst($needle, $replace, $haystack) {\n\t\t$pos = strpos($haystack, $needle);\n\t\t\n\t\tif ($pos !== false) {\n\t\t\treturn substr_replace($haystack, $replace, $pos, strlen($needle));\n\t\t}\n\t\t\n\t\treturn $haystack;\n\t}", "function startsWith($haystack, $needle) {\n // search backwards starting from haystack length characters from the end\n return $needle === \"\" || strrpos($haystack, $needle, -strlen($haystack)) !== false;\n}", "function lower( $str ) {\r\nreturn preg_match( \"/[a-z]/\", $str );\r\n}", "function atk_strpos($haystack,$needle,$offset=0)\n{\n\treturn atkString::strpos($haystack,$needle,$offset);\n}", "function strContains($haystack, $needle)\n{\n return strpos($haystack, $needle) > -1 ? true : false;\n}", "function startsWith($haystack, $needle){\n $length = mb_strlen($needle);\n return (mb_substr($haystack, 0, $length) === $needle);\n}", "function strrevpos($instr, $needle)\n{\n $rev_pos = strpos (strrev($instr), strrev($needle));\n if ($rev_pos===false) return false;\n else return strlen($instr) - $rev_pos - strlen($needle);\n}", "public static function ipos($haystack, $needle, $offset = 0)\n {\n if (self::isMBString()) {\n return mb_stripos($haystack, $needle, $offset, self::$encoding);\n } else {\n\n // @codeCoverageIgnoreStart\n return stripos($haystack, $needle, $offset);\n // @codeCoverageIgnoreEnd\n }\n }", "function strpos($haystack, $needle, $offset = 0, $encoding = 'UTF-8') {\n if (function_exists('mb_strpos'))\n return mb_strpos($haystack, $needle, $offset, $encoding);\n else\n return strpos($haystack, $needle, $offset);\n}", "private function starts_with_upper($str) {\n $chr = mb_substr($str, 0, 1, \"UTF-8\");\n return mb_strtolower($chr, \"UTF-8\") != $chr;\n }", "function strip($string) {\n\n\n\t\t}", "function mixStart($str) {\n\treturn substr($str,1, 2) == \"ix\";\n}", "public static function pearCase($str) {}", "function titleCase($string) {\r\n // Remove no_parse content.\r\n $string_array = preg_split(\"/(<no_parse>|<\\/no_parse>)+/i\",$string);\r\n $newString = '';\r\n for ($k=0; $k<count($string_array); $k=$k+2) {\r\n $string = $string_array[$k];\r\n // If the entire string is upper case, don't perform any title case on it.\r\n if ($string != strtoupper($string)) {\r\n // TITLE CASE RULES:\r\n // 1.) Uppercase the first char in every word.\r\n $new = preg_replace(\"/(^|\\s|\\'|'|\\\"|-){1}([a-z]){1}/ie\",\"''.stripslashes('\\\\1').''.stripslashes(strtoupper('\\\\2')).''\", $string);\r\n // 2.) Lower case words exempt from title case.\r\n // Lowercase all articles, coordinate conjunctions (\"and\", \"or\", \"nor\"), and prepositions regardless of length, when they are other than the first or last word.\r\n // Lowercase the \"to\" in an infinitive.\" - this rule is of course approximated since it is context sensitive.\r\n $matches = array();\r\n // Perform recursive matching on the following words.\r\n preg_match_all(\"/(\\sof|\\sa|\\san|\\sthe|\\sbut|\\sor|\\snot|\\syet|\\sat|\\son|\\sin|\\sover|\\sabove|\\sunder|\\sbelow|\\sbehind|\\snext\\sto|\\sbeside|\\sby|\\samoung|\\sbetween|\\sby|\\still|\\ssince|\\sdurring|\\sfor|\\sthroughout|\\sto|\\sand){2}/i\",$new ,$matches);\r\n for ($i=0; $i<count($matches); $i++) {\r\n for ($j=0; $j<count($matches[$i]); $j++) {\r\n $new = preg_replace(\"/(\".$matches[$i][$j].\"\\s)/ise\",\"''.strtolower('\\\\1').''\",$new);\r\n }\r\n }\r\n // 3.) Do not allow upper case apostrophes.\r\n $new = preg_replace(\"/(\\w'S)/ie\",\"''.strtolower('\\\\1').''\",$new);\r\n $new = preg_replace(\"/(\\w'\\w)/ie\",\"''.strtolower('\\\\1').''\",$new);\r\n $new = preg_replace(\"/(\\W)(of|a|an|the|but|or|not|yet|at|on|in|over|above|under|below|behind|next to| beside|by|amoung|between|by|till|since|durring|for|throughout|to|and)(\\W)/ise\",\"'\\\\1'.strtolower('\\\\2').'\\\\3'\",$new);\r\n // 4.) Capitalize first letter in the string always.\r\n $new = preg_replace(\"/(^[a-z]){1}/ie\",\"''.strtoupper('\\\\1').''\", $new);\r\n // 5.) Replace special cases.\r\n // You will add to this as you find case specific problems.\r\n $new = preg_replace(\"/\\sin-/i\",\" In-\",$new);\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(ph){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*|$){1}/ie\",\"'\\\\1pH\\\\3'\",$new);\r\n $new = preg_replace(\"/^ph(\\s|$)/i\",\"pH \",$new);\r\n $new = preg_replace(\"/(\\s)ph($)/i\",\" pH\",$new);\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(&){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*){1}/ie\",\"'\\\\1and\\\\3'\",$new);\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(groundwater){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*){1}/e\",\"'\\\\1Ground Water\\\\3'\",$new);\r\n $new = preg_replace(\"/(\\W|^){1}(cross){1}(\\s){1}(connection){1}(\\W|$){1}/ie\",\"'\\\\1\\\\2-\\\\4\\\\5'\",$new); // Always hyphenate cross-connections.\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(vs\\.){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*){1}/ie\",\"'\\\\1Vs.\\\\3'\",$new);\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(on-off){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*){1}/ie\",\"'\\\\1On-Off\\\\3'\",$new);\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(on-site){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*){1}/ie\",\"'\\\\1On-Site\\\\3'\",$new);\r\n // Special cases like Class A Fires.\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(class\\s){1}(\\w){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*|$){1}/ie\",\"'\\\\1\\\\2'.strtoupper('\\\\3').'\\\\4'\",$new);\r\n $new = stripslashes($new);\r\n $string_array[$k] = $new;\r\n }\r\n }\r\n for ($k=0; $k<count($string_array); $k++) {\r\n $newString .= $string_array[$k];\r\n }\r\n return($newString);\r\n }", "function lcfirst($str) {\n return (string)(strtolower(substr($str, 0, 1)).substr($str, 1));\n }", "function str_icontains($needle, $haystack)\n {\n return str::containsIgnoreCase($needle, $haystack);\n }", "public function startsWithIgnoreCase($string, $needle)\n {\n $hs = strtolower($string);\n\n foreach ((array)$needle as $ndl) {\n $n = strtolower($ndl);\n if ($n !== '' && substr($hs, 0, strlen($n)) === (string)$n) {\n return true;\n }\n }\n\n return false;\n }", "function detect_any_uppercase($string){\r\n\treturn strtolower($string) != $string;\r\n}", "function cpay_ispos($string,$search) {\r\n if (strpos($string,$search)===false) {\r\n return(false);\r\n } else {\r\n return(true);\r\n }\r\n }", "function descobrePosicaoCaracter($texto){\n\t$listaCaracteres = array(' ');\n\n\tforeach ($listaCaracteres as $item) {\n\n\t\t$posicao = strrpos($texto, $item);\n\n\t\tif($posicao != false){ //false = nome simples , true = nome composto\n\t\t\treturn $posicao+1;\n\t\t}\n\t}\n}", "function startsWith($haystack, $needle) {\r\n return $needle === \"\" || strrpos($haystack, $needle, -strlen($haystack)) !== false;\r\n}", "public static function before(string $haystack, string $needle): string\n {\n if ($needle === '') {\n return $haystack;\n }\n $position = strpos($haystack, $needle);\n return $position !== false ? substr($haystack, 0, $position) : $haystack;\n }", "function firstCharOf($s1, $chars){\n\t\t$array = preg_split('//u', $s1, -1, PREG_SPLIT_NO_EMPTY);\n\t\tforeach($array as $ch){\n\t\t\tif(in_array($ch, $chars)){\n\t\t\t\treturn $ch;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "function camelcase($s) {\n \n $count=1;\n\n for($i=0; $i<strlen($s); $i++){\n if(preg_match('/[A-Z]$/',$s[$i])==true)\n {\n $count++;\n }\n }\n\n return $count;\n\n}", "function strReplaceFirst($from, $to, $subject) {\n\t\t$from = '/'.preg_quote($from, '/').'/';\n\t\treturn preg_replace($from, $to, $subject, 1);\n\t}", "function startsWith($haystack, $needle)\n{\n return $needle === \"\" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;\n}", "function startsWith($haystack, $needle)\n{\n return $needle === \"\" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;\n}", "function startsWith($haystack, $needle)\n{\n return $needle === \"\" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;\n}", "function startsWith($haystack, $needle)\n{\n return $needle === \"\" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;\n}", "public static function removeStart(string $haystack, string $needle): string\n {\n return static::startsWith($haystack, $needle) ? substr($haystack, strlen($needle)) : $haystack;\n }", "public static function str_isubstr_first(\n string $str,\n string $needle,\n bool $before_needle = false,\n string $encoding = 'UTF-8'\n ): string {\n if (\n $needle === ''\n ||\n $str === ''\n ) {\n return '';\n }\n\n $part = self::stristr(\n $str,\n $needle,\n $before_needle,\n $encoding\n );\n if ($part === false) {\n return '';\n }\n\n return $part;\n }", "public static function str_substr_first(\n string $str,\n string $needle,\n bool $before_needle = false,\n string $encoding = 'UTF-8'\n ): string {\n if ($str === '' || $needle === '') {\n return '';\n }\n\n if ($encoding === 'UTF-8') {\n if ($before_needle) {\n $part = \\mb_strstr(\n $str,\n $needle,\n $before_needle\n );\n } else {\n $part = \\mb_strstr(\n $str,\n $needle\n );\n }\n } else {\n $part = self::strstr(\n $str,\n $needle,\n $before_needle,\n $encoding\n );\n }\n\n return $part === false ? '' : $part;\n }", "public function before($string, $search)\n {\n return $search === '' ? $string : rtrim(explode($search, $string)[0]);\n }", "function singularize($x) {\n\n if (substr($x, -1) != 's') {\n return $x;\n }\n\n $x = preg_replace('/ies$/i', 'y', $x, 1, $count);\n if ($count) return $x;\n\n return substr($x, 0, strlen($x) - 1);\n }", "function testStartsWith2 ()\n\t{\n\t\t\t$input1 = \"Genevieve\";\n\t\t\t$input2 = \"Barry is a programmer\";\n\t\t\t$this->assertFalse (\n\t\t\t\t\t$this->stringUtils->startsWith ($input2, $input1));\n\t}", "function starts_with($haystack, $needle)\n\t{\n\t\treturn Illuminate\\Support\\Str::startsWith($haystack, $needle);\n\t}", "public function hasLowerCase()\n {\n return $this->matchesPattern('.*[[:lower:]]');\n }", "public static function noFirstCamelCase($str)\n {\n $str = self::camelCase($str);\n $str = lcfirst($str);\n\n return $str;\n }", "public function containsLowerCase($str)\n {\n if (!$this->notempty($str)) {\n return 0;\n }\n\n return strlen(preg_replace('/([^a-z]*)/', '', $str));\n }", "public function testStringIsNotFoundIfCaseInsensitive()\n {\n $needle = \"foo\";\n $haystack = \"Bar Baz\";\n $this->assertFalse(Strings::contains($haystack, $needle, false));\n }", "public function testStartsWith3()\n {\n $this->assertFalse(Str::startsWith('foo', ''));\n }", "static function replaceFirst(string $s, string $search, string $replace): string {\n if ('' === $search) {\n return $s;\n }\n $position = mb_strpos($s, $search);\n if (false !== $position) {\n return mb_substr($s, 0, $position).$replace.mb_substr($s, $position + mb_strlen($search));\n }\n\n return $s;\n }", "public function afterFirst($search) {\n return $this->sideInternal('mb_strpos', $search, 1);\n }", "function rstrpos ($haystack, $needle, $offset)\n\t{\n\t\t$size = strlen ($haystack);\n\t\t$pos = strpos (strrev($haystack), $needle, $offset);\n \tif ($pos === false) return false;\n return $size - $pos;\n\t}", "function startsWith($haystack, $needle) {\n return $needle === \"\" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;\n}", "function startsWith($haystack, $needle) {\n return $needle === \"\" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;\n}", "function startsWith($haystack, $needle) {\n return $needle === \"\" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;\n}", "function startsWith($haystack, $needle) {\n return $needle === \"\" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;\n}", "function startsWith($haystack, $needle) {\n return $needle === \"\" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;\n}" ]
[ "0.7560286", "0.65668446", "0.646055", "0.63376516", "0.6199239", "0.61767375", "0.6172869", "0.6043391", "0.60230494", "0.5996015", "0.5914587", "0.5858952", "0.58245784", "0.5796306", "0.57930064", "0.57418627", "0.57379085", "0.57360965", "0.5734808", "0.57222843", "0.5669036", "0.5662248", "0.5648881", "0.5639723", "0.56397146", "0.5596665", "0.5592945", "0.559093", "0.5577239", "0.5518913", "0.5518053", "0.5511686", "0.54936725", "0.5493292", "0.54859704", "0.5485426", "0.5484616", "0.5480867", "0.5477666", "0.5473416", "0.54661924", "0.54614085", "0.54555213", "0.5436355", "0.5434467", "0.54192644", "0.5418438", "0.5411292", "0.54108435", "0.5409748", "0.53943855", "0.53890425", "0.5385499", "0.5377649", "0.5375336", "0.5373359", "0.53430426", "0.53313625", "0.5326872", "0.5326724", "0.531627", "0.5310967", "0.5300106", "0.5297091", "0.5291617", "0.52891177", "0.52836156", "0.52808714", "0.52795273", "0.52724844", "0.52701193", "0.52695304", "0.5269307", "0.5269233", "0.52652144", "0.52530813", "0.52503675", "0.52503675", "0.52503675", "0.52503675", "0.52340186", "0.523352", "0.5229484", "0.5225545", "0.52158755", "0.5215603", "0.5214063", "0.52080524", "0.5205947", "0.518818", "0.5179974", "0.517951", "0.51764196", "0.51703024", "0.5170229", "0.5169678", "0.5169678", "0.5169678", "0.5169678", "0.5169678" ]
0.625108
4
Checks if a path ($path) is absolute or relative
function is_absolute($path) { return ($path[0] == '/' || (DIRECTORY_SEPARATOR == '\\' && preg_match('#^[a-z]:[/\\\]#i', $path))) ? true : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function path_is_absolute($path)\n {\n }", "protected function _isAbsolute($path)\n\t{\n\t\treturn preg_match('~^([A-Z]\\:[/\\\\\\]|/)~i', $path);\n\t}", "public static function isAbsolute($path) {\n\t\t$pattern = '@^\n ( # Either..\n [/\\\\\\\\] # absolute start\n | [a-z]:[/\\\\\\\\] # or Windows drive path\n | [a-z][a-z0-9\\.+-]+:// # or URI scheme:// - see http://tools.ietf.org/html/rfc3986#section-3.1\n )@ix';\n\t\treturn preg_match($pattern, $path) === 1;\n\t}", "public static function isRelative($path) {\n return !static::isAbsolute($path);\n }", "protected function is_absolute_path( $path )\n\t{\n\t\treturn substr( $path, 0, 1 ) === '/';\n\t}", "function is_absolute_path($path)\n {\n // Optional wrapper(s).\n $regExp =\n // Optional root prefix.\n '%^(?<wrappers>(?:[[:print:]]{2,}://)*)'.\n '(?<root>(?:[[:alpha:]]:/|/)?)'.\n // Actual path.\n '(?<path>(?:[[:print:]]*))$%';\n\n $parts = [];\n\n preg_match($regExp, $path, $parts);\n\n if ('' !== $parts['root']) {\n return true;\n }\n\n return false;\n }", "protected function _isAbsolute($path)\n {\n // if there isn't enough characters to begin with http://\n if (!isset($path[7])) {\n return false;\n }\n return $path[0] . $path[1] . $path[2] . $path[3] . $path[4] == 'http:';\n }", "protected static function pathIsRelative($path) {\n\t\treturn !preg_match(\"|^\".DIRECTORY_SEPARATOR.\"|\", $path);\n\t}", "public static function isAbsolute($path) {\n return ($path[0] === '/' || $path[0] === '\\\\' || preg_match('/^[a-zA-Z0-9]+:/', $path));\n }", "public static function pathIsAbsolute($path)\n {\n if (self::isStream($path) && (is_dir($path) || is_file($path))) {\n return true;\n }\n\n /*\n * This is definitive if true but fails if $path does not exist or contains\n * a symbolic link.\n */\n if (realpath($path) == $path) {\n return true;\n }\n\n if (strlen($path) == 0 || $path[0] == '.') {\n return false;\n }\n\n // Windows allows absolute paths like this.\n if (preg_match('#^[a-zA-Z]:\\\\\\\\#', $path)) {\n return true;\n }\n\n // A path starting with / or \\ is absolute; anything else is relative.\n return ($path[0] == '/' || $path[0] == '\\\\');\n }", "protected function is_path_absolute($path)\n {\n if (defined('STRICT_TYPES') && CAMEL_CASE == '1')\n {\n return (bool) self::parameters(\n [\n 'path' => DT::STRING\n ])\n ->call(__FUNCTION__)\n ->with($path)\n ->returning(DT::BOOL);\n }\n else\n {\n return (bool) is_path_absolute($path);\n }\n }", "public static function isAbsolutePath($path)\n {\n if (isset($path[0]) and ($path[0] == '/' or $path[0] == '\\\\')) {\n return true;\n }\n if (preg_match('/^[A-Za-z0-9]+:/', $path) === 1) {\n return true;\n }\n return false;\n }", "function isAbsPath($path) {\r\n if (preg_match('|^[\\\\\\/]|', $path)) { return true; } // leading slash or backslash (for windows)\r\n if (preg_match('|^[a-zA-Z]:[\\\\\\/]|', $path)) { return true; } // windows drive\r\n if (preg_match('|^\\\\\\\\[a-zA-Z]|', $path)) { return true; } // unc path\r\n return false;\r\n}", "public static function isAbsolutePath($path) {\n if (phutil_is_windows()) {\n return (bool)preg_match('/^[A-Za-z]+:/', $path);\n } else {\n return !strncmp($path, DIRECTORY_SEPARATOR, 1);\n }\n }", "public static function isAbsolutePath($path) {\n if (self::isWindows()) {\n return (bool)preg_match('/^[A-Za-z]+:/', $path);\n } else {\n return !strncmp($path, DIRECTORY_SEPARATOR, 1);\n }\n }", "protected function validatePath($path) {\n // Absolute local file paths are invalid.\n if ($this->fileSystem->realpath($path) == $path) {\n return FALSE;\n }\n // A path relative to the Drupal root or a fully qualified URI is valid.\n if (is_file($path)) {\n return $path;\n }\n // Prepend 'public://' for relative file paths within public filesystem.\n if (StreamWrapperManager::getScheme($path) === FALSE) {\n $path = 'public://' . $path;\n }\n if (is_file($path)) {\n return $path;\n }\n return FALSE;\n }", "static function isAbsolutePath($path) {\n\t\tif (0 === strpos ( PHP_OS, 'Linux' )) {\n\t\t\treturn 0 === strpos ( $path, '/' );\n\t\t} elseif (0 === strpos ( PHP_OS, 'WIN' )) {\n\t\t\t$path = strtolower ( $path );\n\t\t\treturn ( bool ) preg_match ( '/[a-z]:(\\/|\\\\)/i', $path );\n\t\t} else {\n\t\t\tuser_error ( 'Unknown OS', E_USER_ERROR );\n\t\t}\n\t}", "protected function isAbsolutePath(string $path) : bool {\n return Str::startsWith($path, DIRECTORY_SEPARATOR . $this->absolutePathPrefix());\n }", "protected function validatePath($path) {\n // Absolute local file paths are invalid.\n if (\\Drupal::service('file_system')->realpath($path) == $path) {\n return FALSE;\n }\n // A path relative to the Drupal root or a fully qualified URI is valid.\n if (is_file($path)) {\n return $path;\n }\n // Prepend 'public://' for relative file paths within public filesystem.\n if (\\Drupal::service('file_system')->uriScheme($path) === FALSE) {\n $path = 'public://' . $path;\n }\n if (is_file($path)) {\n return $path;\n }\n return FALSE;\n }", "function isPathAbsolute($path) {\n $is_root = (isset($path[1]) && ($path[1] == ':') || ($path[0] == '/'));\n return $is_root;\n}", "public static function isAbsolutePath(string $path): bool\n {\n return StringType::startsWith($path, [self::UNIX_DIRECTORY_SEPARATOR, self::WINDOWS_DIRECTORY_SEPARATOR]);\n }", "public static function isAbsoluteUrl($_path)\n {\n $url = parse_url($_path);\n\n return $url !== false && isset($url['scheme']) && $url['scheme'] != '';\n }", "protected function isRelativePath(string $path) : bool {\n return !$this->isAbsolutePath($path);\n }", "function fn_check_path($path)\n{\n $real_path = realpath($path);\n\n return str_replace('\\\\', '/', $real_path) == $path ? true : false;\n}", "public function getIsAbsolutePath() {}", "public function isFullPath( string $path ): bool {\n\t\t\treturn (bool) @preg_match(\n\t\t\t\t'/((\\/|\\\\|\\/\\/|https?:\\\\\\\\|https?:\\/\\/)[a-z0-9 _@\\-^!#$%&+={}.\\/\\\\\\[\\]]+)+\\.[a-z]+$/',\n\t\t\t\t$path\n\t\t\t);\n\t\t}", "public function isAbsolute();", "public static function isAbsolutePath(string $file): bool\n {\n return strspn($file, '/\\\\', 0, 1)\n || (\n \\strlen($file) > 3 && ctype_alpha($file[0])\n && $file[1] === ':'\n && strspn($file, '/\\\\', 2, 1)\n )\n || parse_url($file, \\PHP_URL_SCHEME) !== null;\n }", "public function isAbsolutePath()\n {\n if ($this->exists === false) {\n $this->is_absolute_path = null;\n return;\n }\n\n if (substr($this->path, 0, 1) == '/') {\n $this->is_absolute_path = true;\n $this->absolute_path = $this->path;\n } else {\n $this->is_absolute_path = false;\n }\n\n return;\n }", "public static function isAbsolute($file): bool\n {\n return strspn($file, '/\\\\', 0, 1)\n || (\\strlen($file) > 3 && ctype_alpha($file[0])\n && ':' === $file[1]\n && strspn($file, '/\\\\', 2, 1))\n || null !== parse_url($file, PHP_URL_SCHEME);\n }", "function fn_is_valid_path($base_dir, $path)\n{\n $base_dir = rtrim($base_dir, '/') . '/';\n\n if (strpos($path, $base_dir) !== 0) {\n // relative path\n $path = fn_normalize_path($base_dir . $path);\n }\n\n if (strpos($path, $base_dir) !== 0) {\n return false;\n }\n\n return true;\n}", "static function isAbsolute($filename) {\n\t\tif($_ENV['OS'] == \"Windows_NT\" || $_SERVER['WINDIR']) return $filename[1] == ':' && $filename[2] == '/';\n\t\telse return $filename[0] == '/';\n\t}", "public function isRelative()\n {\n if (preg_match('~^https?:\\/\\/~i', $this->url) OR preg_match('~^\\/\\/~i', $this->url)) {\n return false;\n } else {\n return true;\n }\n }", "private function isValidFullPath($path)\n {\n $valid = false;\n\n // TODO: Handle network shares?\n if (1 === preg_match('/^[a-z]+:\\\\\\\\/i', $path) && is_file($path)) {\n $valid = true;\n }\n\n return $valid;\n }", "public function checkIsSymlink($path);", "public function isAbsolute(): bool\n\t{\n\t\treturn empty($this->host) === false;\n\t}", "static public function isValidPath($path) {\n\t\t$path = self::normalizePath($path);\n\t\tif (!$path || $path[0] !== '/') {\n\t\t\t$path = '/' . $path;\n\t\t}\n\t\tif (strstr($path, '/../') || strrchr($path, '/') === '/..') {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function isValidRelative()\n {\n if ($this->scheme || $this->host || $this->userInfo || $this->port) {\n return false;\n }\n\n if ($this->path) {\n // Check path-only (no host) URI\n if (0 === strpos($this->path, '//')) {\n return false;\n }\n return true;\n }\n\n if (! ($this->query || $this->fragment)) {\n // No host, path, query or fragment - this is not a valid URI\n return false;\n }\n\n return true;\n }", "public function isValidPath($path)\n\t{\n\t\treturn $this->getPath() == rtrim($path,'/').'/';\n\t}", "static function rel2abs_url( $path )\n {\n if( substr( $path, 0, 1 ) == \"/\" ) return $path;\n $dir = @getcwd();\n\n if( !isset( $_SERVER[ 'DOCUMENT_ROOT' ] ) || ( $dir === false ) )\n return false;\n\n $dir = self::normalize( $dir );\n $doc_root = self::normalize( $_SERVER[ 'DOCUMENT_ROOT' ] );\n\n if( substr( $dir, 0, strlen( $doc_root ) ) != $doc_root )\n return false;\n\n $return = self::normalize( substr( $dir, strlen( $doc_root ) ) . \"/$path\" );\n if( substr( $return, 0, 1 ) !== \"/\" )\n $return = \"/$return\";\n\n return $return;\n }", "public function check_path( $file ) {\n\t\t$relative = parse_url( $file, PHP_URL_PATH );\n\t\t\n\t\tif ( 0 !== strpos( $relative, '/wp-' ) )\n\t\t\t$relative = substr( $relative, strpos( $relative, '/wp-' ) );\n\t\t\n\t\t$full = $_SERVER[ 'DOCUMENT_ROOT' ] . $relative;\n\t\tif ( is_file( $full ) )\n\t\t\treturn $full;\n\n\t\t$wp = rtrim( ABSPATH, '/' ) . $relative;\n\t\tif ( is_file( $wp ) )\n\t\t\treturn $wp;\n\n\t\treturn false;\n\t}", "public function isValidPathReturnsTrueIfPathExists() {}", "protected function is_valid_path($path) {\n $rp_substr = substr(realpath($path) . DIRECTORY_SEPARATOR, 0, strlen(realpath($this->path_to_files))) . DIRECTORY_SEPARATOR;\n $rp_files = realpath($this->path_to_files) . DIRECTORY_SEPARATOR;\n\n // handle better symlinks & network path - issue #448\n $pattern = ['/\\\\\\\\+/', '/\\/+/'];\n $replacement = ['\\\\\\\\', '/'];\n $rp_substr = preg_replace($pattern, $replacement, $rp_substr);\n $rp_files = preg_replace($pattern, $replacement, $rp_files);\n $match = ($rp_substr === $rp_files);\n\n if (!$match) {\n Log::info('Invalid path \"' . $path . '\"');\n Log::info('real path: \"' . $rp_substr . '\"');\n Log::info('path to files: \"' . $rp_files . '\"');\n }\n return $match;\n }", "public static function isRelativeUrl(string $url) {\n $url_parts = parse_url($url);\n if ((!empty($url_parts['scheme'])) && (!empty($url_parts['host']))) {\n // It is an absolute url.\n return FALSE;\n }\n return TRUE;\n }", "public function isRelativeUri() {\n return !$this->isAbsoluteUri();\n }", "public function isAbsolute()\n {\n return !$this->isRelative($this->url);\n }", "public function path_valid() {\n\t\tif (!file_exists($this->path)) return false;\n\t\treturn true;\n\t}", "public function path_valid() {\n\t\tif (!file_exists($this->path)) return false;\n\t\treturn true;\n\t}", "public function absPath(string $path): string;", "public function validatePath()\n {\n $path = $this->getFullPath();\n\n return\n strpos($path, $this->chrootDir) === 0\n && (strpos($path, '..') === false || !empty($this->path));\n }", "public static function pathExists($path) {\n return file_exists($path) || is_link($path);\n }", "public function isPath( string $path ): bool {\n\t\t\treturn (bool) @preg_match(\n\t\t\t\t'/^(.+)/([^/]+)$/',\n\t\t\t\t$path\n\t\t\t);\n\t\t}", "private function check_path()\n\t{\n\t\t$ar = func_get_args();\n\t\tforeach ( $ar as $a ){\n\t\t\tif ( !is_string($a) ||\n (strpos($a,'./') !== false) ||\n (strpos($a,'/') === 0) ){\n\t\t\t\tdie(\"The path $a is not an acceptable value\");\n\t\t\t}\n\t\t}\n\t\treturn 1;\n\t}", "public static function isSaveRelativePath($path)\n {\n if (false === self::isRelativePath($path)) {\n return false;\n }\n\n $parts = explode('/', $path);\n $level = 0;\n foreach ($parts as $part) {\n if ('..' === $part) {\n --$level;\n if ($level < 0) {\n return false;\n }\n } elseif ('' !== $part) {\n ++$level;\n }\n }\n\n return true;\n }", "public function check_added_path($path){\n\t\t$path = Url::resolve_relative($path);\n\t\tif(isset($this->added_paths[$path])){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isRelative()\n {\n if($this->_address == $this->_request)\n return true;\n return false;\n }", "public function checkPathExists($path);", "protected function absolutePath($path)\n\t{\n\t return realpath(dirname(__FILE__) . '/../../../../' . $path);\n\t}", "public function hasRelativePath()\n {\n return false;\n }", "public function isAbsolute()\n {\n return ($this->scheme !== null);\n }", "public function checkIsPathExists($path);", "function pathExists($path);", "public function checkIsFile($path);", "function ju_is_url_absolute(string $u):bool {return ju_starts_with($u, ['http', '//']);}", "public function pathExists($path);", "public function supportsAbsolutePaths()\n {\n return $this->disk->getDriver() instanceof AbsolutePathInterface;\n }", "public static function isLocal(string $path): bool\n {\n return '' !== $path && !str_contains($path, '://');\n }", "public function isUrlLike($path)\n {\n $path = trim($path);\n return substr($path, 0, 4) === 'http' || substr($path, 0, 2) === '//';\n }", "private function isValidFile($path)\n {\n return $path && $path != 'none' && is_readable($path);\n }", "public static function relativePath( $path )\n {\n if( !empty( $path ) && is_string( $path ) )\n {\n $path = Sanitize::toPath( $path );\n $root = Server::getScriptPath();\n $levels = array(\n $root,\n dirname( $root ),\n dirname( dirname( $root ) ),\n dirname( dirname( dirname( $root ) ) )\n );\n foreach( $levels as $level )\n {\n if( empty( $level ) || $levels === \"/\" ) continue;\n $path = str_replace( $level, \"\", $path );\n }\n }\n return $path;\n }", "function isFileExists($relativePath): bool;", "public function isPathDefined()\n {\n if (isset($this->path)) {\n // Make sure there's no forward slashes in the front (beginning) of the path string\n return ltrim($this->path, \"/\");\n }\n return false;\n }", "function sd_is_path_sane($path) {\n\tglobal $sd_error_msg;\n\n\tif (!$path) {\n\t\t$sd_error_msg = 'E:empty';\n\t\treturn $sd_error_msg;\n\t}\n\tif (false !== strpos('..', $path)) {\n\t\t$sd_error_msg = 'E:.. forbidden';\n\t\treturn $sd_error_msg;\n\t}\n\tif (!file_exists(SD_DL_ROOT . $path)) {\n\t\t$sd_error_msg = 'E:non-exist';\n\t\treturn $sd_error_msg;\n\t}\n\treturn true;\n}", "public function isFile(string $path): bool;", "public function isFile(string $path): bool;", "public function checkIsReadable($path);", "public function isValidPath( string $path ) : bool {\n\t\treturn ( preg_match( ((object) self::$REGEX)->path, $path ) ) ? true : false ;\n\t}", "public function is_local( $path ){\r\n\r\n\t\tif ( count( explode( root, $path ) ) > 1 )\r\n\t\t\treturn true;\r\n\r\n\t\treturn false;\r\n\r\n\t}", "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}", "public function has($path) {\n $return = parent::has($path);\n // Appease file.inc's calls to is_dir()\n return ($return !== FALSE) ? $return : parent::has($path . '/');\n }", "function fn_te_check_path($path)\n{\n $path = fn_normalize_path($path);\n $dir_themes = fn_get_theme_path('[themes]/', 'C');\n\n return strpos($path, $dir_themes) === 0;\n}", "function truepath($path){\n $unipath=strlen($path)==0 || $path[0]!='/';\n // attempts to detect if path is relative in which case, add cwd\n if(strpos($path,':')===false && $unipath)\n $path=getcwd().DIRECTORY_SEPARATOR.$path;\n // resolve path parts (single dot, double dot and double delimiters)\n $path = str_replace(array('/', '\\\\'), DIRECTORY_SEPARATOR, $path);\n $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');\n $absolutes = array();\n foreach ($parts as $part) {\n if ('.' == $part) continue;\n if ('..' == $part) {\n array_pop($absolutes);\n } else {\n $absolutes[] = $part;\n }\n }\n $path=implode(DIRECTORY_SEPARATOR, $absolutes);\n // resolve any symlinks\n if(file_exists($path) && linkinfo($path)>0)$path=readlink($path);\n // put initial separator that could have been lost\n $path=!$unipath ? '/'.$path : $path;\n return $path;\n}", "public static function isRelativePath($string)\n {\n if ('' === $string) {\n return true;\n }\n\n return DIRECTORY_SEPARATOR !== substr($string, 0, 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}", "public static function isSafe($path) {\n\t\treturn preg_match(\"|\".DIRECTORY_SEPARATOR.\"\\\\.\\\\.\".DIRECTORY_SEPARATOR.\"|\", $path);\n\t}", "function checkAndCleanPath($path,$origPath) {\n\t\t//echo \"|\".$path.\"|\".$origPath.\"|\".strpos($path,$origPath).\"|\";\n\t\t$path = str_replace(\"..\",\"\",$path);\n\t\t$path = str_replace(\".\",\"\",$path);\n\t\t$path = str_replace(\"%2E\",\"\",$path);\n\t\t$path = str_replace(\"'\",\"\",$path);\n\t\t$path = str_replace('\"',\"\",$path);\n\t\t$path = str_replace(\"\\\\\",\"\",$path);\n\t\tif (strpos($path,$origPath) === 0) {\n\t\t\treturn $path;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private function _relativeUrlBypass($originalPath)\n\t{\n\t\t$method = JFactory::getApplication()->input->getMethod();\n\t\tif ($method != 'POST')\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t$bits = explode('/', $originalPath);\n\t\tif (empty($bits))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t$lastBit = array_pop($bits);\n\t\tif ($lastBit != 'index.php')\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function isAbsoluteUri() {\n return isset($this->parts['scheme']);\n }", "public function isReadable(string $path): bool;", "function isFile($path);", "public function addAbsolutePath($path) {\n if ($path instanceof File) {\n $path = $path->getAbsolutePath();\n }\n\n $this->absolutePaths[$path] = true;\n }", "public static function isRelativeUrl(string $url): bool\r\n {\r\n $pattern = \"/^(?:ftp|https?|feed)?:?\\/\\/(?:(?:(?:[\\w\\.\\-\\+!$&'\\(\\)*\\+,;=]|%[0-9a-f]{2})+:)*\r\n (?:[\\w\\.\\-\\+%!$&'\\(\\)*\\+,;=]|%[0-9a-f]{2})+@)?(?:\r\n (?:[a-z0-9\\-\\.]|%[0-9a-f]{2})+|(?:\\[(?:[0-9a-f]{0,4}:)*(?:[0-9a-f]{0,4})\\]))(?::[0-9]+)?(?:[\\/|\\?]\r\n (?:[\\w#!:\\.\\?\\+\\|=&@$'~*,;\\/\\(\\)\\[\\]\\-]|%[0-9a-f]{2})*)?$/xi\";\r\n\r\n return !preg_match($pattern, $url);\r\n }", "private function validatePath()\n {\n $locator = new FileLocator();\n $locator->locate($this->path); // throws exception on failure\n }", "public function isUserAliasesPathValid($path)\n {\n return (is_string($path) && !empty($path))?:false;\n }", "public function exists($path);", "public function realpath($path, $relative = FileSystem::NONE);", "static function inPath () {\n return strrpos(\n self::instance()->current_uri, \n self::instance()->path, \n -strlen(self::instance()->current_uri)\n ) !== false;\n }", "public function checkIsDirectory($path);", "function readlink(string $path): string|false {}", "public static function isFile($path)\n {\n if (is_file($path)) {\n if (strstr(PHP_OS, 'WIN')) {\n if (basename(realpath($path)) != basename($path)) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n }" ]
[ "0.83476853", "0.8031023", "0.79957706", "0.79403895", "0.7918441", "0.7824961", "0.77513033", "0.77410924", "0.7737385", "0.76626843", "0.7660026", "0.76218235", "0.7615613", "0.76152116", "0.7593476", "0.75792086", "0.7578291", "0.7551711", "0.7544857", "0.75402516", "0.74577755", "0.73046845", "0.7221934", "0.7213091", "0.707801", "0.70301026", "0.7011736", "0.69819146", "0.69146776", "0.6847883", "0.6839779", "0.6833324", "0.68215907", "0.6772762", "0.6698575", "0.66682357", "0.66600806", "0.66424966", "0.66298467", "0.6626705", "0.6624402", "0.66206056", "0.65813315", "0.6575054", "0.6572348", "0.6546984", "0.6517288", "0.6517288", "0.6479882", "0.6474453", "0.64662385", "0.64387745", "0.64278615", "0.642027", "0.6411128", "0.64084363", "0.6401102", "0.63989925", "0.63957185", "0.6368624", "0.6361871", "0.6355702", "0.63328767", "0.6306853", "0.6231748", "0.6201202", "0.619083", "0.6170548", "0.6130799", "0.6129318", "0.61244756", "0.6110871", "0.6105017", "0.6091558", "0.6091558", "0.6061902", "0.60557884", "0.60203856", "0.6019103", "0.6012682", "0.60048544", "0.59878933", "0.5971079", "0.5941443", "0.5932595", "0.59287786", "0.5923295", "0.588889", "0.5849219", "0.5848495", "0.5843081", "0.5842841", "0.58387464", "0.58348465", "0.5825431", "0.58122265", "0.5806769", "0.579162", "0.5780145", "0.575866" ]
0.79878867
3
A wrapper for realpath
function phpbb_realpath($path) { return phpbb_own_realpath($path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function realpath($path)\n{\n return $path;\n}", "public function realpath($file);", "public function realpath($path, $relative = FileSystem::NONE);", "function phpbb_realpath($path)\n\t{\n\t\t$realpath = realpath($path);\n\n\t\t// Strangely there are provider not disabling realpath but returning strange values. :o\n\t\t// We at least try to cope with them.\n\t\tif ($realpath === $path || $realpath === false)\n\t\t{\n\t\t\treturn phpbb_own_realpath($path);\n\t\t}\n\n\t\t// Check for DIRECTORY_SEPARATOR at the end (and remove it!)\n\t\tif (substr($realpath, -1) == DIRECTORY_SEPARATOR)\n\t\t{\n\t\t\t$realpath = substr($realpath, 0, -1);\n\t\t}\n\n\t\treturn $realpath;\n\t}", "function phpbb_realpath($path)\n\t{\n\t\t$realpath = realpath($path);\n\n\t\t// Strangely there are provider not disabling realpath but returning strange values. :o\n\t\t// We at least try to cope with them.\n\t\tif ($realpath === $path || $realpath === false)\n\t\t{\n\t\t\treturn phpbb_own_realpath($path);\n\t\t}\n\n\t\t// Check for DIRECTORY_SEPARATOR at the end (and remove it!)\n\t\tif (substr($realpath, -1) == DIRECTORY_SEPARATOR)\n\t\t{\n\t\t\t$realpath = substr($realpath, 0, -1);\n\t\t}\n\n\t\treturn $realpath;\n\t}", "function realPath($path, $relative_to = NULL, $resolve_symlink = TRUE);", "public function realpath($path)\n\t{\n\t\treturn realpath($path);\n\t}", "private function realpath(string $path): string\n {\n $last_char = substr($path, -1);\n $path = realpath($path);\n if (DIRECTORY_SEPARATOR === $last_char) {\n $path .= DIRECTORY_SEPARATOR;\n }\n return $path;\n }", "function __realpath($path) {\n\t$path = str_replace('\\\\','/',realpath($path));\n\tif ($path{1} == ':') {\n\t\t// We can't just check for C:/, because windows users may have the IIS webroot on X: or F:, etc.\n\t\t$path = substr($path,2);\n\t}\n\treturn $path;\n}", "public function realpath($path): string\n {\n return $this->_realpath($this->_getPath($path));\n }", "function phpbb_realpath($path)\n{\n\tglobal $phpbb_root_path, $phpEx;\n\n\treturn (!@function_exists('realpath') || !@realpath($phpbb_root_path . 'includes/functions.'.$phpEx)) ? $path : @realpath($path);\n}", "function phpbb_realpath($path)\n{\n\tglobal $phpbb_root_path, $phpEx;\n\n\treturn (!@function_exists('realpath') || !@realpath($phpbb_root_path . 'includes/functions.'.$phpEx)) ? $path : @realpath($path);\n}", "protected function getRealPath($path)\n {\n return realpath($path);\n }", "function getAbsolutePath() ;", "function get_real_path(string $path, string|bool $check = null): string|null\n{\n if (trim($path) == '') {\n return null;\n }\n\n // NULL-bytes issue.\n if (str_contains($path, \"\\0\")) {\n $path = str_replace(\"\\0\", \"\\\\0\", $path);\n }\n\n // Validate existence of file/directory or file only.\n static $check_path; $check_path ??= fn($c, $p) => (\n $c === true ? file_exists($p) : ($c === 'file' ? is_file($p) : is_dir($p))\n );\n\n if ($ret = realpath($path)) {\n if ($check && !$check_path($check, $ret)) {\n return null;\n }\n return $ret;\n }\n\n $ret = '';\n $sep = DIRECTORY_SEPARATOR;\n $win = DIRECTORY_SEPARATOR == '\\\\';\n\n // Make path \"foo\" => \"./foo\" so prevent invalid returns.\n if (!str_contains($path, $sep) || ($win && substr($path, 1, 2) != ':\\\\')) {\n $path = '.' . $sep . $path;\n }\n\n foreach (explode($sep, $path) as $i => $cur) {\n if ($i == 0) {\n if ($cur == '~') { // Home path (eg: ~/Desktop).\n $ret = getenv('HOME') ?: '';\n continue;\n } elseif ($cur == '.' || $cur == '..') {\n if ($ret == '') {\n // @cancel\n // $file = getcwd(); // Fallback.\n // foreach (debug_backtrace(0) as $trace) {\n // // Search until finding the right path argument (sadly seems no way else\n // // for that when call stack is chaining from a function to another function).\n // if (empty($trace['args'][0]) || $trace['args'][0] != $path) {\n // break;\n // }\n // $file = $trace['file'];\n // }\n\n $tmp = getcwd() . $sep . basename($path);\n $ret = ($cur == '.') ? dirname($tmp) : dirname(dirname($tmp));\n }\n continue;\n }\n }\n\n if ($cur == '' || $cur == '.') {\n continue;\n } elseif ($cur == '..') {\n $ret = dirname($ret); // Up.\n continue;\n }\n\n // Prepend separator current.\n $ret .= $sep . $cur;\n }\n\n if ($check && !$check_path($check, $ret)) {\n return null;\n }\n\n // Normalize.\n if ($ret) {\n // Drop repeating separators.\n $ret = preg_replace(\n '~(['. preg_quote(PATH_SEPARATOR . DIRECTORY_SEPARATOR) .'])\\1+~',\n '\\1', $ret\n );\n\n // Drop ending slashes.\n if ($ret != PATH_SEPARATOR && $ret != DIRECTORY_SEPARATOR) {\n $ret = chop($ret, PATH_SEPARATOR . DIRECTORY_SEPARATOR);\n }\n\n // Fix leading slash for win.\n if ($win && $ret[0] == $sep) {\n $ret = substr($ret, 1);\n }\n }\n\n return $ret;\n}", "function absPath($value){\r\n\treturn realpath(dirname(__dir__, $value));\r\n}", "function absPath($value){\r\n\treturn realpath(dirname(__dir__, $value));\r\n}", "protected abstract function getAbsolutePath(): string;", "function getRealpath( $_path )\n{\n $__path = $_path;\n if ( isRelative( $_path ) ) {\n $__curdir = unifyPath( realpath( \".\" ) . _PL_OS_SEP );\n $__path = $__curdir . $__path;\n }\n $__startPoint = \"\";\n if ( checkCurrentOS( \"Win\" ) ) {\n list( $__startPoint, $__path ) = explode( \":\", $__path, 2 );\n $__startPoint .= \":\";\n }\n # From now processing is the same for WIndows and Unix, and hopefully for others.\n $__realparts = array( );\n $__parts = explode( _PL_OS_SEP, $__path );\n for ( $i = 0; $i < count( $__parts ); $i++ ) {\n if ( strlen( $__parts[ $i ] ) == 0 || $__parts[ $i ] == \".\" ) {\n continue;\n }\n if ( $__parts[ $i ] == \"..\" ) {\n if ( count( $__realparts ) > 0 ) {\n array_pop( $__realparts );\n }\n }\n else {\n array_push( $__realparts, $__parts[ $i ] );\n }\n }\n return $__startPoint . _PL_OS_SEP . implode( _PL_OS_SEP, $__realparts );\n}", "public function getFullPath();", "public function getFullPath(): string;", "public function getAbsolutePath();", "public function getAbsolutePath() {}", "public function getAbsolutePath() {}", "public static function resolvePath($path, $relative_to = null) {\n $is_absolute = self::isAbsolutePath($path);\n\n if (!$is_absolute) {\n if (!$relative_to) {\n $relative_to = getcwd();\n }\n $path = $relative_to.DIRECTORY_SEPARATOR.$path;\n }\n\n if (is_link($path)) {\n $parent_realpath = realpath(dirname($path));\n if ($parent_realpath !== false) {\n return $parent_realpath.DIRECTORY_SEPARATOR.basename($path);\n }\n }\n\n $realpath = realpath($path);\n if ($realpath !== false) {\n return $realpath;\n }\n\n\n // This won't work if the file doesn't exist or is on an unreadable mount\n // or something crazy like that. Try to resolve a parent so we at least\n // cover the nonexistent file case.\n\n // We're also normalizing path separators to whatever is normal for the\n // environment.\n\n if (phutil_is_windows()) {\n $parts = trim($path, '/\\\\');\n $parts = preg_split('([/\\\\\\\\])', $parts);\n\n // Normalize the directory separators in the path. If we find a parent\n // below, we'll overwrite this with a better resolved path.\n $path = str_replace('/', '\\\\', $path);\n } else {\n $parts = trim($path, '/');\n $parts = explode('/', $parts);\n }\n\n while ($parts) {\n array_pop($parts);\n if (phutil_is_windows()) {\n $attempt = implode(DIRECTORY_SEPARATOR, $parts);\n } else {\n $attempt = DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR, $parts);\n }\n $realpath = realpath($attempt);\n if ($realpath !== false) {\n $path = $realpath.substr($path, strlen($attempt));\n break;\n }\n }\n\n return $path;\n }", "protected function usingRealPath()\n {\n return CommandManager::getInstance()->getOpt('realpath', false);\n }", "public static function fullPath ($relPath) {\n\t\treturn (\\realpath($relPath) ?: null);\n\t}", "public function getFileAbsolutePath($file);", "private function getRealPath(string $relativePath): string\n {\n return str_replace(\" \", \"\\ \", realpath($relativePath));\n }", "private function getRealPath(string $path): string\n {\n if (false === ($ret = realpath($path))) {\n $this->error(\"File does not exist: \\\"$path\\\".\");\n }\n return $ret;\n }", "protected function usingRealPath()\n {\n return $this->hasOption('realpath') && $this->option('realpath');\n }", "public static function realpath($path, $cwd = '')\n {\n if(empty($cwd)) {\n $cwd = getcwd();\n }\n if($path[0] == '/') {\n return $path;\n }\n\n if(preg_match('/^[a-z]:\\\\\\//i', $path)) {\n return $path;\n }\n\n $relative = rtrim($cwd, DIRECTORY_SEPARATOR);\n return $relative . DIRECTORY_SEPARATOR . $path;\n }", "public static function resolvePath($path, $relative_to = null) {\n $is_absolute = self::isAbsolutePath($path);\n\n if (!$is_absolute) {\n if (!$relative_to) {\n $relative_to = getcwd();\n }\n $path = $relative_to.DIRECTORY_SEPARATOR.$path;\n }\n\n if (is_link($path)) {\n $parent_realpath = realpath(dirname($path));\n if ($parent_realpath !== false) {\n return $parent_realpath.DIRECTORY_SEPARATOR.basename($path);\n }\n }\n\n $realpath = realpath($path);\n if ($realpath !== false) {\n return $realpath;\n }\n\n\n // This won't work if the file doesn't exist or is on an unreadable mount\n // or something crazy like that. Try to resolve a parent so we at least\n // cover the nonexistent file case.\n $parts = explode(DIRECTORY_SEPARATOR, trim($path, DIRECTORY_SEPARATOR));\n while (end($parts) !== false) {\n array_pop($parts);\n if (phutil_is_windows()) {\n $attempt = implode(DIRECTORY_SEPARATOR, $parts);\n } else {\n $attempt = DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR, $parts);\n }\n $realpath = realpath($attempt);\n if ($realpath !== false) {\n $path = $realpath.substr($path, strlen($attempt));\n break;\n }\n }\n\n return $path;\n }", "function relative_to_absolute($filepath) {\n\treturn str_replace(__CHV_RELATIVE_ROOT__, __CHV_ROOT_DIR__, str_replace('\\\\', '/', $filepath));\n}", "public function getIsAbsolutePath() {}", "public function getAbsolutePathOfRelativeReferencedFileOrPathResolvesFileCorrectlyDataProvider() {}", "protected function getFileRealPath($filePath)\n {\n if ($this->isSupportedStreamWrapper($filePath)) {\n return $filePath;\n }\n\n // Need to use realpath to fix \"Can't open file\" on some Windows setup\n return \\realpath($filePath);\n }", "function urlfor($path) {\n return basepath() . $path;\n}", "function truepath($path){\n $unipath=strlen($path)==0 || $path[0]!='/';\n // attempts to detect if path is relative in which case, add cwd\n if(strpos($path,':')===false && $unipath)\n $path=getcwd().DIRECTORY_SEPARATOR.$path;\n // resolve path parts (single dot, double dot and double delimiters)\n $path = str_replace(array('/', '\\\\'), DIRECTORY_SEPARATOR, $path);\n $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');\n $absolutes = array();\n foreach ($parts as $part) {\n if ('.' == $part) continue;\n if ('..' == $part) {\n array_pop($absolutes);\n } else {\n $absolutes[] = $part;\n }\n }\n $path=implode(DIRECTORY_SEPARATOR, $absolutes);\n // resolve any symlinks\n if(file_exists($path) && linkinfo($path)>0)$path=readlink($path);\n // put initial separator that could have been lost\n $path=!$unipath ? '/'.$path : $path;\n return $path;\n}", "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 }", "function absolute_to_relative($filepath) {\n\treturn str_replace(__CHV_ROOT_DIR__, __CHV_RELATIVE_ROOT__, str_replace('\\\\', '/', $filepath));\n}", "protected function usingRealPath()\n {\n return $this->input->hasOption('realpath') && $this->option('realpath');\n }", "private function pathify(&$path) {\n\t\t$path = realpath($path).'/';\n\t}", "public function path(): string\n {\n return realpath($this->file);\n }", "private function getCleanPath($path)\n {\n return realpath($path);\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 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 }", "public static function normalize($path) {\n return realpath($path);\n }", "public function testGetRealPath()\n {\n $directory = sys_get_temp_dir();\n $fileResource = $this->getFileResource($directory);\n $resource = new MaterializedResource($fileResource, $directory);\n $realpath = realpath($directory.'/'.$fileResource->getPath());\n $this->assertEquals($realpath, $resource->getRealPath());\n }", "public function absPath(string $path): string;", "public function getFullPath($name);", "public function getAbsolutePath(): string\n {\n return sprintf('%s/%s', $this->baseDirectory, $this->relativePath);\n }", "abstract public function getLocalPathByFileHandle($handle);", "function wp_register_plugin_realpath($file)\n {\n }", "public function getRealPath($vid) { \n return drupal_realpath(TEMP_DIR.'/'.$vid); \n }", "public static function make(string ...$parts)\n {\n return realpath(join(DIRECTORY_SEPARATOR, $parts));\n }", "public function getAbsolutePath()\n {\n }", "abstract function mirror($locpath, $rempath);", "function relative_path() {\n $rel = str_replace($_SERVER['DOCUMENT_ROOT'], null, str_replace(basename(dirname(__FILE__)), null, dirname(__FILE__)));\n return (preg_match('/^\\//', $rel)) ? substr($rel, 1, strlen($rel)) : $rel;\n}", "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}", "protected function getAbsoluteBasePath() {}", "protected function absolutePath($path)\n\t{\n\t return realpath(dirname(__FILE__) . '/../../../../' . $path);\n\t}", "public function getAbsolutePath()\n {\n return null === $this->avatar ? null : $this->getUploadRootDir().'/'.$this->avatar;\n }", "public function getAbsolutePath()\r\n {\r\n return null === $this->getPath() ? null : $this->getUploadRootDir().'/'.$this->getPath();\r\n }", "public function getAbsolutePath()\n {\n return null === $this->path ? null : $this->getUploadRootDir() . '/' . $this->path;\n }", "public function getRealSourcePath(string $basePath = null): string\n {\n }", "function fn_unified_path($path)\n{\n if (defined('IS_WINDOWS')) {\n $path = str_replace('\\\\', '/', $path);\n }\n\n return $path;\n}", "public function resolvePath($path, $relative_to = null);", "public function getAbsolutePath() {\n return null === $this->path ? null : $this->getUploadRootDir() . '/' . $this->path;\n }", "function __compatFile($path) {\n\t\t$path = array();\n\n\t\tforeach (func_get_args() as $arg) {\n\t\t\tif (is_array($arg)) {\n\t\t\t\tif (isset($arg['dirname'])) {\n\t\t\t\t\t$path[] = rtrim($arg['dirname'], '/\\\\');\n\t\t\t\t}\n\t\t\t\tif (isset($arg['basename'])) {\n\t\t\t\t\t$path[] = $arg['basename'];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$path[] = rtrim($arg, '/\\\\');\n\t\t\t}\n\t\t}\n\t\t$path = implode(DS, $path);\n\t\t$path = str_replace(array('/', '\\\\'), DS, $path);\n\n\t\tif (isset($this->__cached[$path])) {\n\t\t\treturn $this->__cached[$path];\n\t\t}\n\t\tif (Folder::isAbsolute($path)) {\n\t\t\treturn file_exists($path) ? $path : false;\n\t\t}\n\n\t\t$parts = explode(DS, $path);\n\n\t\tif (in_array($parts[0], $this->_versions)) {\n\t\t\tarray_unshift($parts, basename(key($this->_map['filter'])));\n\t\t}\n\t\tif (!in_array($parts[0], array_keys($this->_directories))) {\n\t\t\tarray_unshift($parts, basename(key($this->_map['static'])));\n\t\t}\n\t\tif (in_array($parts[1], $this->_versions)\n\t\t&& !in_array($parts[2], array_keys($this->_directories))) {\n\t\t\tarray_splice($parts, 2, 0, basename(key($this->_map['static'])));\n\t\t}\n\n\t\t$path = implode(DS, $parts);\n\n\t\tif (isset($this->__cached[$path])) {\n\t\t\treturn $this->__cached[$path];\n\t\t}\n\n\t\t$file = $this->_directories[array_shift($parts)] . implode(DS, $parts);\n\n\t\tif (file_exists($file)) {\n\t\t\treturn $this->__cached[$path] = $file;\n\t\t}\n\n\t\t$short = current(array_intersect(Media::short(), $parts));\n\n\t\tif (!$short) {\n\t\t\t$message = \"MediaHelper::file - \";\n\t\t\t$message .= \"You've provided a partial path without a media directory (e.g. img) \";\n\t\t\t$message .= \"which is required to resolve the path.\";\n\t\t\ttrigger_error($message, E_USER_NOTICE);\n\t\t\treturn false;\n\t\t}\n\n\t\t$extension = null;\n\t\textract(pathinfo($file), EXTR_OVERWRITE);\n\n\t\tif (!isset($filename)) { /* PHP < 5.2.0 */\n\t\t\t$filename = substr($basename, 0, isset($extension) ? - (strlen($extension) + 1) : 0);\n\t\t}\n\n\t\tfor ($i = 0; $i < 2; $i++) {\n\t\t\t$file = $i ? $dirname . DS . $filename : $dirname . DS . $basename;\n\n\t\t\tforeach ($this->_extensions[$short] as $extension) {\n\t\t\t\t$try = $file . '.' . $extension;\n\t\t\t\tif (file_exists($try)) {\n\t\t\t\t\treturn $this->__cached[$path] = $try;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function getCaminhoReal()\n {\n return $this->arquivo->getRealPath();\n }", "public function getAbsolutePath()\n {\n return null === $this->photoId\n ? null\n : $this->getUploadRootDir().'/'.$this->photoId;\n }", "public function relativePath($fullPath, $fileName, $basePath = null);", "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}", "static function rel2abs_url( $path )\n {\n if( substr( $path, 0, 1 ) == \"/\" ) return $path;\n $dir = @getcwd();\n\n if( !isset( $_SERVER[ 'DOCUMENT_ROOT' ] ) || ( $dir === false ) )\n return false;\n\n $dir = self::normalize( $dir );\n $doc_root = self::normalize( $_SERVER[ 'DOCUMENT_ROOT' ] );\n\n if( substr( $dir, 0, strlen( $doc_root ) ) != $doc_root )\n return false;\n\n $return = self::normalize( substr( $dir, strlen( $doc_root ) ) . \"/$path\" );\n if( substr( $return, 0, 1 ) !== \"/\" )\n $return = \"/$return\";\n\n return $return;\n }", "function getPath() {\n $ruta = realpath(dirname(__FILE__));\n if ( strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' )\n $separator = '\\\\';\n else\n $separator = '/';\n $aRuta = explode($separator,$ruta);\n $ruta = '';\n foreach($aRuta as $index => $value)\n if ( $index < count($aRuta) - 1 ) $ruta .= $value.$separator;\n return $ruta;\n}", "function getAbsolutePath(): string\n {\n $path = $this->folder()->getAbsolutePath();\n return \"$path\";\n }", "function system_ensure_path_ending(&$path, $make_realpath=false)\n{\n\tif( $make_realpath )\n\t{\n\t\t$p = realpath($path);\n\t\tif( $p ) $path = $p;\n\t}\n if( !ends_with($path, '/') )\n $path .= '/';\n}", "public function resolvePath(string $relativePath): string;", "function path_is_absolute($path)\n {\n }", "public static function relpath($abs_path, $root = NULL) {\n $abs_path = self::abspath($abs_path);\n// self::logmsg('Source path: \"' . $abs_path . '\"');\n if (!isset($root)) {\n $root = $_SERVER['DOCUMENT_ROOT'];\n }\n// self::logmsg('root: \"' . $root . '\"');\n $source_rel = self::get_rel_dir($root, $abs_path);\n // self::logmsg('Relative path of source (calculated): \"' . $source_rel . '\"');\n if (preg_match('/\\.\\.\\//', $source_rel)) {\n // self::logmsg('<b>Note</b>: path is outside document root. You are allowed to, but its unusual setup. When used to calculate destination folder, the \"../\"s will be removed');\n }\n return $source_rel;\n }", "function relativePath($path, $rel=false) {\n $relpath = '';\n\n if(!$rel) $rel = getcwd();\n $apath = explode(DIRECTORY_SEPARATOR, realpath($path));\n $arel = explode(DIRECTORY_SEPARATOR, realpath($rel));\n while(isset($apath[0]) && isset($arel[0]) && $apath[0] == $arel[0]) {\n array_shift($apath);\n array_shift($arel);\n }\n\n return str_repeat('..'.DIRECTORY_SEPARATOR, count($arel)).join(DIRECTORY_SEPARATOR, $apath);\n}", "abstract protected function getPath();", "function abp01_wrapper_locate_file_from_uri($requestUriPath) {\n if (!empty($requestUriPath)) {\n return ABSPATH . $requestUriPath;\n } else {\n return null;\n }\n}", "function relative_to_url($filepath) {\n\treturn str_replace(__CHV_RELATIVE_ROOT__, __CHV_BASE_URL__, str_replace('\\\\', '/', $filepath));\n}", "abstract protected function getFileWithPath();", "function serverRealPath($path){\n\treturn '/'.implode(array_slice(explode('/', realpath($path)), 3));\n}", "function fa_get_path( $rel_path ){\n\t$path = path_join( FA_PATH, $rel_path );\n\treturn wp_normalize_path( $path );\n}", "function normalize_path($path, $slash_it = true) {\n\n\t$parser_mem_crc = 'normalize_path' . crc32($path.$slash_it);\n\n\t$ch = mw_var($parser_mem_crc);\n\tif ($ch != false) {\n\n\t\t$path = $ch;\n\t} else {\n\n\n\n\n\n\t\t$path_original = $path;\n\t\t$s = DIRECTORY_SEPARATOR;\n\t\t$path = preg_replace('/[\\/\\\\\\]/', $s, $path);\n\t// $path = preg_replace ( '/' . $s . '$/', '', $path ) . $s;\n\t\t$path = str_replace($s . $s, $s, $path);\n\t\tif (strval($path) == '') {\n\t\t\t$path = $path_original;\n\t\t}\n\t\tif ($slash_it == false) {\n\t\t\t$path = rtrim($path, DIRECTORY_SEPARATOR);\n\t\t} else {\n\t\t\t$path .= DIRECTORY_SEPARATOR;\n\t\t\t$path = rtrim($path, DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR);\n\t\t}\n\t\tif (strval(trim($path)) == '' or strval(trim($path)) == '/') {\n\t\t\t$path = $path_original;\n\t\t}\n\t\tif ($slash_it == false) {\n\t\t} else {\n\t\t\t$path = $path . DIRECTORY_SEPARATOR;\n\t\t\t$path = reduce_double_slashes($path);\n\t\t// $path = rtrim ( $path, DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR );\n\t\t}\n\n\t\tmw_var($parser_mem_crc, $path);\n\n\t}\n\n\treturn $path;\n}", "public function getAbsolutePath()\n {\n return null === $this->image\n ? null\n : $this->getUploadRootDir() . '/' . $this->image;\n }", "function absPath($inputPath, $baseDir = '.') {\r\n\r\n // add basedir to inputPath if it's not absolute\r\n if (!isAbsPath($inputPath)) {\r\n if (!isAbsPath($baseDir)) { // make basedir absolute if it's not already\r\n $cwd = getcwd();\r\n if (!isAbsPath($cwd)) { die(\"getcwd() didn't return an absulte path '\" .htmlencode($cwd). \"'!\"); }\r\n $baseDir = absPath($baseDir, $cwd);\r\n }\r\n $inputPath = \"$baseDir/$inputPath\";\r\n }\r\n\r\n // remove path prefixes: \\\\UNC-SERVER or C:\r\n $uncServerPrefix = '';\r\n $driveLetterPrefix = '';\r\n $uncServerRegexp = \"|^\\\\\\\\\\\\\\\\[^\\\\\\/]+|\"; // matches \\\\SERVER-NAME UNC style prefixs\r\n $driveLetterRegexp = \"|^[a-z]:(?=[\\\\\\/])|i\"; // matches W: windows drive letter prefixs\r\n if (preg_match($uncServerRegexp, $inputPath, $matches)) { // match prefix\r\n $uncServerPrefix = $matches[0];\r\n $inputPath = preg_replace($uncServerRegexp, '', $inputPath, 1); // remove prefix\r\n }\r\n elseif (preg_match($driveLetterRegexp, $inputPath, $matches)) { // match prefix\r\n $driveLetterPrefix = $matches[0];\r\n $inputPath = preg_replace($driveLetterRegexp, '', $inputPath, 1); // remove prefix\r\n }\r\n\r\n // normalize path components (replace backslashes, remove double-slashes, resolve . and ..)\r\n $inputPathComponents = preg_split(\"|[\\\\\\/]|\" , $inputPath, null, PREG_SPLIT_NO_EMPTY);\r\n $outputPathComponents = [];\r\n foreach ($inputPathComponents as $component) {\r\n if ($component == '.') { /* do nothing */ } // skip current dir references\r\n elseif ($component == '..') { array_pop($outputPathComponents); } // remove last path component for .. parent dir references\r\n else { array_push($outputPathComponents, $component); }\r\n }\r\n $outputPath = implode('/', $outputPathComponents);\r\n\r\n // re-add path prefixes and root slash\r\n $absPath = $uncServerPrefix . $driveLetterPrefix . '/' . $outputPath;\r\n\r\n //\r\n return $absPath;\r\n}", "protected function determinedFullPath()\n {\n // TODO: See why windows cannot use the the full path\n /*return dirname((new ReflectionClass($this))->getFileName()) .\n DIRECTORY_SEPARATOR .\n '..' .\n DIRECTORY_SEPARATOR .*/\n return $this->getWebRoot() .\n DIRECTORY_SEPARATOR .\n $this->path;\n }", "function getAbsolutePath() {\n return 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' . \"{$_SERVER['HTTP_HOST']}/\";\n}", "public function getBasePath()\n {\n if (isset($this->raw->{'base-path'})) {\n if (false === is_dir($this->raw->{'base-path'})) {\n throw new InvalidArgumentException(\n sprintf(\n 'The base path \"%s\" is not a directory or does not exist.',\n $this->raw->{'base-path'}\n )\n );\n }\n\n return realpath($this->raw->{'base-path'});\n }\n\n return realpath(dirname($this->file));\n }", "function fa_get_uri( $rel_path ){\n\t$uri = is_ssl() ? str_replace('http://', 'https://', FA_URL) : FA_URL;\t\n\t$path = path_join( $uri, $rel_path );\n\treturn $path;\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}", "public function getFullPath()\n {\n return sfAssetsLibraryTools::getMediaDir(true) . $this->getRelativePath();\n }", "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 isAbsolutePath()\n {\n if ($this->exists === false) {\n $this->is_absolute_path = null;\n return;\n }\n\n if (substr($this->path, 0, 1) == '/') {\n $this->is_absolute_path = true;\n $this->absolute_path = $this->path;\n } else {\n $this->is_absolute_path = false;\n }\n\n return;\n }" ]
[ "0.8334988", "0.8295165", "0.759019", "0.7415365", "0.7415365", "0.73463607", "0.7192222", "0.6927927", "0.68221", "0.661081", "0.65428185", "0.65428185", "0.6392258", "0.6293817", "0.6284195", "0.6276101", "0.6276101", "0.6221369", "0.6220459", "0.61635834", "0.6127169", "0.6088395", "0.6063705", "0.6063705", "0.6045389", "0.60344476", "0.60270274", "0.6012921", "0.5958894", "0.5943401", "0.59245634", "0.59212375", "0.5914663", "0.5906164", "0.5877422", "0.58544016", "0.58430654", "0.5836198", "0.58338517", "0.5833099", "0.5803509", "0.57822233", "0.577654", "0.5774191", "0.5770063", "0.57442933", "0.5744109", "0.57278407", "0.570635", "0.5700575", "0.5638931", "0.56238127", "0.5605824", "0.5593293", "0.55890834", "0.55848604", "0.558433", "0.55838716", "0.55740994", "0.55626464", "0.5561779", "0.5540051", "0.5535582", "0.5532609", "0.5526143", "0.5503228", "0.5494115", "0.54830766", "0.547913", "0.5455377", "0.54423296", "0.542991", "0.5427265", "0.5394764", "0.539401", "0.53929156", "0.5389779", "0.53629744", "0.5362958", "0.53605103", "0.53555447", "0.53411025", "0.5338725", "0.5338144", "0.5337429", "0.532972", "0.5315853", "0.53045756", "0.53018945", "0.5297651", "0.52953184", "0.529196", "0.52849406", "0.5275861", "0.52753067", "0.5275194", "0.52638924", "0.52633613", "0.52582943" ]
0.73394895
7
A wrapper for realpath
function phpbb_realpath($path) { $realpath = realpath($path); // Strangely there are provider not disabling realpath but returning strange values. :o // We at least try to cope with them. if ($realpath === $path || $realpath === false) { return phpbb_own_realpath($path); } // Check for DIRECTORY_SEPARATOR at the end (and remove it!) if (substr($realpath, -1) == DIRECTORY_SEPARATOR) { $realpath = substr($realpath, 0, -1); } return $realpath; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function realpath($path)\n{\n return $path;\n}", "public function realpath($file);", "public function realpath($path, $relative = FileSystem::NONE);", "function realPath($path, $relative_to = NULL, $resolve_symlink = TRUE);", "function phpbb_realpath($path)\n\t{\n\t\treturn phpbb_own_realpath($path);\n\t}", "function phpbb_realpath($path)\n\t{\n\t\treturn phpbb_own_realpath($path);\n\t}", "public function realpath($path)\n\t{\n\t\treturn realpath($path);\n\t}", "private function realpath(string $path): string\n {\n $last_char = substr($path, -1);\n $path = realpath($path);\n if (DIRECTORY_SEPARATOR === $last_char) {\n $path .= DIRECTORY_SEPARATOR;\n }\n return $path;\n }", "function __realpath($path) {\n\t$path = str_replace('\\\\','/',realpath($path));\n\tif ($path{1} == ':') {\n\t\t// We can't just check for C:/, because windows users may have the IIS webroot on X: or F:, etc.\n\t\t$path = substr($path,2);\n\t}\n\treturn $path;\n}", "public function realpath($path): string\n {\n return $this->_realpath($this->_getPath($path));\n }", "function phpbb_realpath($path)\n{\n\tglobal $phpbb_root_path, $phpEx;\n\n\treturn (!@function_exists('realpath') || !@realpath($phpbb_root_path . 'includes/functions.'.$phpEx)) ? $path : @realpath($path);\n}", "function phpbb_realpath($path)\n{\n\tglobal $phpbb_root_path, $phpEx;\n\n\treturn (!@function_exists('realpath') || !@realpath($phpbb_root_path . 'includes/functions.'.$phpEx)) ? $path : @realpath($path);\n}", "protected function getRealPath($path)\n {\n return realpath($path);\n }", "function getAbsolutePath() ;", "function get_real_path(string $path, string|bool $check = null): string|null\n{\n if (trim($path) == '') {\n return null;\n }\n\n // NULL-bytes issue.\n if (str_contains($path, \"\\0\")) {\n $path = str_replace(\"\\0\", \"\\\\0\", $path);\n }\n\n // Validate existence of file/directory or file only.\n static $check_path; $check_path ??= fn($c, $p) => (\n $c === true ? file_exists($p) : ($c === 'file' ? is_file($p) : is_dir($p))\n );\n\n if ($ret = realpath($path)) {\n if ($check && !$check_path($check, $ret)) {\n return null;\n }\n return $ret;\n }\n\n $ret = '';\n $sep = DIRECTORY_SEPARATOR;\n $win = DIRECTORY_SEPARATOR == '\\\\';\n\n // Make path \"foo\" => \"./foo\" so prevent invalid returns.\n if (!str_contains($path, $sep) || ($win && substr($path, 1, 2) != ':\\\\')) {\n $path = '.' . $sep . $path;\n }\n\n foreach (explode($sep, $path) as $i => $cur) {\n if ($i == 0) {\n if ($cur == '~') { // Home path (eg: ~/Desktop).\n $ret = getenv('HOME') ?: '';\n continue;\n } elseif ($cur == '.' || $cur == '..') {\n if ($ret == '') {\n // @cancel\n // $file = getcwd(); // Fallback.\n // foreach (debug_backtrace(0) as $trace) {\n // // Search until finding the right path argument (sadly seems no way else\n // // for that when call stack is chaining from a function to another function).\n // if (empty($trace['args'][0]) || $trace['args'][0] != $path) {\n // break;\n // }\n // $file = $trace['file'];\n // }\n\n $tmp = getcwd() . $sep . basename($path);\n $ret = ($cur == '.') ? dirname($tmp) : dirname(dirname($tmp));\n }\n continue;\n }\n }\n\n if ($cur == '' || $cur == '.') {\n continue;\n } elseif ($cur == '..') {\n $ret = dirname($ret); // Up.\n continue;\n }\n\n // Prepend separator current.\n $ret .= $sep . $cur;\n }\n\n if ($check && !$check_path($check, $ret)) {\n return null;\n }\n\n // Normalize.\n if ($ret) {\n // Drop repeating separators.\n $ret = preg_replace(\n '~(['. preg_quote(PATH_SEPARATOR . DIRECTORY_SEPARATOR) .'])\\1+~',\n '\\1', $ret\n );\n\n // Drop ending slashes.\n if ($ret != PATH_SEPARATOR && $ret != DIRECTORY_SEPARATOR) {\n $ret = chop($ret, PATH_SEPARATOR . DIRECTORY_SEPARATOR);\n }\n\n // Fix leading slash for win.\n if ($win && $ret[0] == $sep) {\n $ret = substr($ret, 1);\n }\n }\n\n return $ret;\n}", "function absPath($value){\r\n\treturn realpath(dirname(__dir__, $value));\r\n}", "function absPath($value){\r\n\treturn realpath(dirname(__dir__, $value));\r\n}", "protected abstract function getAbsolutePath(): string;", "function getRealpath( $_path )\n{\n $__path = $_path;\n if ( isRelative( $_path ) ) {\n $__curdir = unifyPath( realpath( \".\" ) . _PL_OS_SEP );\n $__path = $__curdir . $__path;\n }\n $__startPoint = \"\";\n if ( checkCurrentOS( \"Win\" ) ) {\n list( $__startPoint, $__path ) = explode( \":\", $__path, 2 );\n $__startPoint .= \":\";\n }\n # From now processing is the same for WIndows and Unix, and hopefully for others.\n $__realparts = array( );\n $__parts = explode( _PL_OS_SEP, $__path );\n for ( $i = 0; $i < count( $__parts ); $i++ ) {\n if ( strlen( $__parts[ $i ] ) == 0 || $__parts[ $i ] == \".\" ) {\n continue;\n }\n if ( $__parts[ $i ] == \"..\" ) {\n if ( count( $__realparts ) > 0 ) {\n array_pop( $__realparts );\n }\n }\n else {\n array_push( $__realparts, $__parts[ $i ] );\n }\n }\n return $__startPoint . _PL_OS_SEP . implode( _PL_OS_SEP, $__realparts );\n}", "public function getFullPath();", "public function getFullPath(): string;", "public function getAbsolutePath();", "public function getAbsolutePath() {}", "public function getAbsolutePath() {}", "public static function resolvePath($path, $relative_to = null) {\n $is_absolute = self::isAbsolutePath($path);\n\n if (!$is_absolute) {\n if (!$relative_to) {\n $relative_to = getcwd();\n }\n $path = $relative_to.DIRECTORY_SEPARATOR.$path;\n }\n\n if (is_link($path)) {\n $parent_realpath = realpath(dirname($path));\n if ($parent_realpath !== false) {\n return $parent_realpath.DIRECTORY_SEPARATOR.basename($path);\n }\n }\n\n $realpath = realpath($path);\n if ($realpath !== false) {\n return $realpath;\n }\n\n\n // This won't work if the file doesn't exist or is on an unreadable mount\n // or something crazy like that. Try to resolve a parent so we at least\n // cover the nonexistent file case.\n\n // We're also normalizing path separators to whatever is normal for the\n // environment.\n\n if (phutil_is_windows()) {\n $parts = trim($path, '/\\\\');\n $parts = preg_split('([/\\\\\\\\])', $parts);\n\n // Normalize the directory separators in the path. If we find a parent\n // below, we'll overwrite this with a better resolved path.\n $path = str_replace('/', '\\\\', $path);\n } else {\n $parts = trim($path, '/');\n $parts = explode('/', $parts);\n }\n\n while ($parts) {\n array_pop($parts);\n if (phutil_is_windows()) {\n $attempt = implode(DIRECTORY_SEPARATOR, $parts);\n } else {\n $attempt = DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR, $parts);\n }\n $realpath = realpath($attempt);\n if ($realpath !== false) {\n $path = $realpath.substr($path, strlen($attempt));\n break;\n }\n }\n\n return $path;\n }", "protected function usingRealPath()\n {\n return CommandManager::getInstance()->getOpt('realpath', false);\n }", "public static function fullPath ($relPath) {\n\t\treturn (\\realpath($relPath) ?: null);\n\t}", "public function getFileAbsolutePath($file);", "private function getRealPath(string $relativePath): string\n {\n return str_replace(\" \", \"\\ \", realpath($relativePath));\n }", "private function getRealPath(string $path): string\n {\n if (false === ($ret = realpath($path))) {\n $this->error(\"File does not exist: \\\"$path\\\".\");\n }\n return $ret;\n }", "protected function usingRealPath()\n {\n return $this->hasOption('realpath') && $this->option('realpath');\n }", "public static function realpath($path, $cwd = '')\n {\n if(empty($cwd)) {\n $cwd = getcwd();\n }\n if($path[0] == '/') {\n return $path;\n }\n\n if(preg_match('/^[a-z]:\\\\\\//i', $path)) {\n return $path;\n }\n\n $relative = rtrim($cwd, DIRECTORY_SEPARATOR);\n return $relative . DIRECTORY_SEPARATOR . $path;\n }", "public static function resolvePath($path, $relative_to = null) {\n $is_absolute = self::isAbsolutePath($path);\n\n if (!$is_absolute) {\n if (!$relative_to) {\n $relative_to = getcwd();\n }\n $path = $relative_to.DIRECTORY_SEPARATOR.$path;\n }\n\n if (is_link($path)) {\n $parent_realpath = realpath(dirname($path));\n if ($parent_realpath !== false) {\n return $parent_realpath.DIRECTORY_SEPARATOR.basename($path);\n }\n }\n\n $realpath = realpath($path);\n if ($realpath !== false) {\n return $realpath;\n }\n\n\n // This won't work if the file doesn't exist or is on an unreadable mount\n // or something crazy like that. Try to resolve a parent so we at least\n // cover the nonexistent file case.\n $parts = explode(DIRECTORY_SEPARATOR, trim($path, DIRECTORY_SEPARATOR));\n while (end($parts) !== false) {\n array_pop($parts);\n if (phutil_is_windows()) {\n $attempt = implode(DIRECTORY_SEPARATOR, $parts);\n } else {\n $attempt = DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR, $parts);\n }\n $realpath = realpath($attempt);\n if ($realpath !== false) {\n $path = $realpath.substr($path, strlen($attempt));\n break;\n }\n }\n\n return $path;\n }", "function relative_to_absolute($filepath) {\n\treturn str_replace(__CHV_RELATIVE_ROOT__, __CHV_ROOT_DIR__, str_replace('\\\\', '/', $filepath));\n}", "public function getIsAbsolutePath() {}", "public function getAbsolutePathOfRelativeReferencedFileOrPathResolvesFileCorrectlyDataProvider() {}", "protected function getFileRealPath($filePath)\n {\n if ($this->isSupportedStreamWrapper($filePath)) {\n return $filePath;\n }\n\n // Need to use realpath to fix \"Can't open file\" on some Windows setup\n return \\realpath($filePath);\n }", "function urlfor($path) {\n return basepath() . $path;\n}", "function truepath($path){\n $unipath=strlen($path)==0 || $path[0]!='/';\n // attempts to detect if path is relative in which case, add cwd\n if(strpos($path,':')===false && $unipath)\n $path=getcwd().DIRECTORY_SEPARATOR.$path;\n // resolve path parts (single dot, double dot and double delimiters)\n $path = str_replace(array('/', '\\\\'), DIRECTORY_SEPARATOR, $path);\n $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');\n $absolutes = array();\n foreach ($parts as $part) {\n if ('.' == $part) continue;\n if ('..' == $part) {\n array_pop($absolutes);\n } else {\n $absolutes[] = $part;\n }\n }\n $path=implode(DIRECTORY_SEPARATOR, $absolutes);\n // resolve any symlinks\n if(file_exists($path) && linkinfo($path)>0)$path=readlink($path);\n // put initial separator that could have been lost\n $path=!$unipath ? '/'.$path : $path;\n return $path;\n}", "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 }", "function absolute_to_relative($filepath) {\n\treturn str_replace(__CHV_ROOT_DIR__, __CHV_RELATIVE_ROOT__, str_replace('\\\\', '/', $filepath));\n}", "protected function usingRealPath()\n {\n return $this->input->hasOption('realpath') && $this->option('realpath');\n }", "private function pathify(&$path) {\n\t\t$path = realpath($path).'/';\n\t}", "public function path(): string\n {\n return realpath($this->file);\n }", "private function getCleanPath($path)\n {\n return realpath($path);\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 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 }", "public static function normalize($path) {\n return realpath($path);\n }", "public function testGetRealPath()\n {\n $directory = sys_get_temp_dir();\n $fileResource = $this->getFileResource($directory);\n $resource = new MaterializedResource($fileResource, $directory);\n $realpath = realpath($directory.'/'.$fileResource->getPath());\n $this->assertEquals($realpath, $resource->getRealPath());\n }", "public function absPath(string $path): string;", "public function getFullPath($name);", "public function getAbsolutePath(): string\n {\n return sprintf('%s/%s', $this->baseDirectory, $this->relativePath);\n }", "abstract public function getLocalPathByFileHandle($handle);", "function wp_register_plugin_realpath($file)\n {\n }", "public function getRealPath($vid) { \n return drupal_realpath(TEMP_DIR.'/'.$vid); \n }", "public static function make(string ...$parts)\n {\n return realpath(join(DIRECTORY_SEPARATOR, $parts));\n }", "public function getAbsolutePath()\n {\n }", "abstract function mirror($locpath, $rempath);", "function relative_path() {\n $rel = str_replace($_SERVER['DOCUMENT_ROOT'], null, str_replace(basename(dirname(__FILE__)), null, dirname(__FILE__)));\n return (preg_match('/^\\//', $rel)) ? substr($rel, 1, strlen($rel)) : $rel;\n}", "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}", "protected function getAbsoluteBasePath() {}", "protected function absolutePath($path)\n\t{\n\t return realpath(dirname(__FILE__) . '/../../../../' . $path);\n\t}", "public function getAbsolutePath()\n {\n return null === $this->avatar ? null : $this->getUploadRootDir().'/'.$this->avatar;\n }", "public function getAbsolutePath()\r\n {\r\n return null === $this->getPath() ? null : $this->getUploadRootDir().'/'.$this->getPath();\r\n }", "public function getAbsolutePath()\n {\n return null === $this->path ? null : $this->getUploadRootDir() . '/' . $this->path;\n }", "public function getRealSourcePath(string $basePath = null): string\n {\n }", "function fn_unified_path($path)\n{\n if (defined('IS_WINDOWS')) {\n $path = str_replace('\\\\', '/', $path);\n }\n\n return $path;\n}", "public function resolvePath($path, $relative_to = null);", "public function getAbsolutePath() {\n return null === $this->path ? null : $this->getUploadRootDir() . '/' . $this->path;\n }", "function __compatFile($path) {\n\t\t$path = array();\n\n\t\tforeach (func_get_args() as $arg) {\n\t\t\tif (is_array($arg)) {\n\t\t\t\tif (isset($arg['dirname'])) {\n\t\t\t\t\t$path[] = rtrim($arg['dirname'], '/\\\\');\n\t\t\t\t}\n\t\t\t\tif (isset($arg['basename'])) {\n\t\t\t\t\t$path[] = $arg['basename'];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$path[] = rtrim($arg, '/\\\\');\n\t\t\t}\n\t\t}\n\t\t$path = implode(DS, $path);\n\t\t$path = str_replace(array('/', '\\\\'), DS, $path);\n\n\t\tif (isset($this->__cached[$path])) {\n\t\t\treturn $this->__cached[$path];\n\t\t}\n\t\tif (Folder::isAbsolute($path)) {\n\t\t\treturn file_exists($path) ? $path : false;\n\t\t}\n\n\t\t$parts = explode(DS, $path);\n\n\t\tif (in_array($parts[0], $this->_versions)) {\n\t\t\tarray_unshift($parts, basename(key($this->_map['filter'])));\n\t\t}\n\t\tif (!in_array($parts[0], array_keys($this->_directories))) {\n\t\t\tarray_unshift($parts, basename(key($this->_map['static'])));\n\t\t}\n\t\tif (in_array($parts[1], $this->_versions)\n\t\t&& !in_array($parts[2], array_keys($this->_directories))) {\n\t\t\tarray_splice($parts, 2, 0, basename(key($this->_map['static'])));\n\t\t}\n\n\t\t$path = implode(DS, $parts);\n\n\t\tif (isset($this->__cached[$path])) {\n\t\t\treturn $this->__cached[$path];\n\t\t}\n\n\t\t$file = $this->_directories[array_shift($parts)] . implode(DS, $parts);\n\n\t\tif (file_exists($file)) {\n\t\t\treturn $this->__cached[$path] = $file;\n\t\t}\n\n\t\t$short = current(array_intersect(Media::short(), $parts));\n\n\t\tif (!$short) {\n\t\t\t$message = \"MediaHelper::file - \";\n\t\t\t$message .= \"You've provided a partial path without a media directory (e.g. img) \";\n\t\t\t$message .= \"which is required to resolve the path.\";\n\t\t\ttrigger_error($message, E_USER_NOTICE);\n\t\t\treturn false;\n\t\t}\n\n\t\t$extension = null;\n\t\textract(pathinfo($file), EXTR_OVERWRITE);\n\n\t\tif (!isset($filename)) { /* PHP < 5.2.0 */\n\t\t\t$filename = substr($basename, 0, isset($extension) ? - (strlen($extension) + 1) : 0);\n\t\t}\n\n\t\tfor ($i = 0; $i < 2; $i++) {\n\t\t\t$file = $i ? $dirname . DS . $filename : $dirname . DS . $basename;\n\n\t\t\tforeach ($this->_extensions[$short] as $extension) {\n\t\t\t\t$try = $file . '.' . $extension;\n\t\t\t\tif (file_exists($try)) {\n\t\t\t\t\treturn $this->__cached[$path] = $try;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function getCaminhoReal()\n {\n return $this->arquivo->getRealPath();\n }", "public function getAbsolutePath()\n {\n return null === $this->photoId\n ? null\n : $this->getUploadRootDir().'/'.$this->photoId;\n }", "public function relativePath($fullPath, $fileName, $basePath = null);", "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}", "static function rel2abs_url( $path )\n {\n if( substr( $path, 0, 1 ) == \"/\" ) return $path;\n $dir = @getcwd();\n\n if( !isset( $_SERVER[ 'DOCUMENT_ROOT' ] ) || ( $dir === false ) )\n return false;\n\n $dir = self::normalize( $dir );\n $doc_root = self::normalize( $_SERVER[ 'DOCUMENT_ROOT' ] );\n\n if( substr( $dir, 0, strlen( $doc_root ) ) != $doc_root )\n return false;\n\n $return = self::normalize( substr( $dir, strlen( $doc_root ) ) . \"/$path\" );\n if( substr( $return, 0, 1 ) !== \"/\" )\n $return = \"/$return\";\n\n return $return;\n }", "function getPath() {\n $ruta = realpath(dirname(__FILE__));\n if ( strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' )\n $separator = '\\\\';\n else\n $separator = '/';\n $aRuta = explode($separator,$ruta);\n $ruta = '';\n foreach($aRuta as $index => $value)\n if ( $index < count($aRuta) - 1 ) $ruta .= $value.$separator;\n return $ruta;\n}", "function getAbsolutePath(): string\n {\n $path = $this->folder()->getAbsolutePath();\n return \"$path\";\n }", "function system_ensure_path_ending(&$path, $make_realpath=false)\n{\n\tif( $make_realpath )\n\t{\n\t\t$p = realpath($path);\n\t\tif( $p ) $path = $p;\n\t}\n if( !ends_with($path, '/') )\n $path .= '/';\n}", "public function resolvePath(string $relativePath): string;", "function path_is_absolute($path)\n {\n }", "public static function relpath($abs_path, $root = NULL) {\n $abs_path = self::abspath($abs_path);\n// self::logmsg('Source path: \"' . $abs_path . '\"');\n if (!isset($root)) {\n $root = $_SERVER['DOCUMENT_ROOT'];\n }\n// self::logmsg('root: \"' . $root . '\"');\n $source_rel = self::get_rel_dir($root, $abs_path);\n // self::logmsg('Relative path of source (calculated): \"' . $source_rel . '\"');\n if (preg_match('/\\.\\.\\//', $source_rel)) {\n // self::logmsg('<b>Note</b>: path is outside document root. You are allowed to, but its unusual setup. When used to calculate destination folder, the \"../\"s will be removed');\n }\n return $source_rel;\n }", "function relativePath($path, $rel=false) {\n $relpath = '';\n\n if(!$rel) $rel = getcwd();\n $apath = explode(DIRECTORY_SEPARATOR, realpath($path));\n $arel = explode(DIRECTORY_SEPARATOR, realpath($rel));\n while(isset($apath[0]) && isset($arel[0]) && $apath[0] == $arel[0]) {\n array_shift($apath);\n array_shift($arel);\n }\n\n return str_repeat('..'.DIRECTORY_SEPARATOR, count($arel)).join(DIRECTORY_SEPARATOR, $apath);\n}", "abstract protected function getPath();", "function abp01_wrapper_locate_file_from_uri($requestUriPath) {\n if (!empty($requestUriPath)) {\n return ABSPATH . $requestUriPath;\n } else {\n return null;\n }\n}", "function relative_to_url($filepath) {\n\treturn str_replace(__CHV_RELATIVE_ROOT__, __CHV_BASE_URL__, str_replace('\\\\', '/', $filepath));\n}", "abstract protected function getFileWithPath();", "function serverRealPath($path){\n\treturn '/'.implode(array_slice(explode('/', realpath($path)), 3));\n}", "function fa_get_path( $rel_path ){\n\t$path = path_join( FA_PATH, $rel_path );\n\treturn wp_normalize_path( $path );\n}", "function normalize_path($path, $slash_it = true) {\n\n\t$parser_mem_crc = 'normalize_path' . crc32($path.$slash_it);\n\n\t$ch = mw_var($parser_mem_crc);\n\tif ($ch != false) {\n\n\t\t$path = $ch;\n\t} else {\n\n\n\n\n\n\t\t$path_original = $path;\n\t\t$s = DIRECTORY_SEPARATOR;\n\t\t$path = preg_replace('/[\\/\\\\\\]/', $s, $path);\n\t// $path = preg_replace ( '/' . $s . '$/', '', $path ) . $s;\n\t\t$path = str_replace($s . $s, $s, $path);\n\t\tif (strval($path) == '') {\n\t\t\t$path = $path_original;\n\t\t}\n\t\tif ($slash_it == false) {\n\t\t\t$path = rtrim($path, DIRECTORY_SEPARATOR);\n\t\t} else {\n\t\t\t$path .= DIRECTORY_SEPARATOR;\n\t\t\t$path = rtrim($path, DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR);\n\t\t}\n\t\tif (strval(trim($path)) == '' or strval(trim($path)) == '/') {\n\t\t\t$path = $path_original;\n\t\t}\n\t\tif ($slash_it == false) {\n\t\t} else {\n\t\t\t$path = $path . DIRECTORY_SEPARATOR;\n\t\t\t$path = reduce_double_slashes($path);\n\t\t// $path = rtrim ( $path, DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR );\n\t\t}\n\n\t\tmw_var($parser_mem_crc, $path);\n\n\t}\n\n\treturn $path;\n}", "public function getAbsolutePath()\n {\n return null === $this->image\n ? null\n : $this->getUploadRootDir() . '/' . $this->image;\n }", "function absPath($inputPath, $baseDir = '.') {\r\n\r\n // add basedir to inputPath if it's not absolute\r\n if (!isAbsPath($inputPath)) {\r\n if (!isAbsPath($baseDir)) { // make basedir absolute if it's not already\r\n $cwd = getcwd();\r\n if (!isAbsPath($cwd)) { die(\"getcwd() didn't return an absulte path '\" .htmlencode($cwd). \"'!\"); }\r\n $baseDir = absPath($baseDir, $cwd);\r\n }\r\n $inputPath = \"$baseDir/$inputPath\";\r\n }\r\n\r\n // remove path prefixes: \\\\UNC-SERVER or C:\r\n $uncServerPrefix = '';\r\n $driveLetterPrefix = '';\r\n $uncServerRegexp = \"|^\\\\\\\\\\\\\\\\[^\\\\\\/]+|\"; // matches \\\\SERVER-NAME UNC style prefixs\r\n $driveLetterRegexp = \"|^[a-z]:(?=[\\\\\\/])|i\"; // matches W: windows drive letter prefixs\r\n if (preg_match($uncServerRegexp, $inputPath, $matches)) { // match prefix\r\n $uncServerPrefix = $matches[0];\r\n $inputPath = preg_replace($uncServerRegexp, '', $inputPath, 1); // remove prefix\r\n }\r\n elseif (preg_match($driveLetterRegexp, $inputPath, $matches)) { // match prefix\r\n $driveLetterPrefix = $matches[0];\r\n $inputPath = preg_replace($driveLetterRegexp, '', $inputPath, 1); // remove prefix\r\n }\r\n\r\n // normalize path components (replace backslashes, remove double-slashes, resolve . and ..)\r\n $inputPathComponents = preg_split(\"|[\\\\\\/]|\" , $inputPath, null, PREG_SPLIT_NO_EMPTY);\r\n $outputPathComponents = [];\r\n foreach ($inputPathComponents as $component) {\r\n if ($component == '.') { /* do nothing */ } // skip current dir references\r\n elseif ($component == '..') { array_pop($outputPathComponents); } // remove last path component for .. parent dir references\r\n else { array_push($outputPathComponents, $component); }\r\n }\r\n $outputPath = implode('/', $outputPathComponents);\r\n\r\n // re-add path prefixes and root slash\r\n $absPath = $uncServerPrefix . $driveLetterPrefix . '/' . $outputPath;\r\n\r\n //\r\n return $absPath;\r\n}", "protected function determinedFullPath()\n {\n // TODO: See why windows cannot use the the full path\n /*return dirname((new ReflectionClass($this))->getFileName()) .\n DIRECTORY_SEPARATOR .\n '..' .\n DIRECTORY_SEPARATOR .*/\n return $this->getWebRoot() .\n DIRECTORY_SEPARATOR .\n $this->path;\n }", "function getAbsolutePath() {\n return 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' . \"{$_SERVER['HTTP_HOST']}/\";\n}", "public function getBasePath()\n {\n if (isset($this->raw->{'base-path'})) {\n if (false === is_dir($this->raw->{'base-path'})) {\n throw new InvalidArgumentException(\n sprintf(\n 'The base path \"%s\" is not a directory or does not exist.',\n $this->raw->{'base-path'}\n )\n );\n }\n\n return realpath($this->raw->{'base-path'});\n }\n\n return realpath(dirname($this->file));\n }", "function fa_get_uri( $rel_path ){\n\t$uri = is_ssl() ? str_replace('http://', 'https://', FA_URL) : FA_URL;\t\n\t$path = path_join( $uri, $rel_path );\n\treturn $path;\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}", "public function getFullPath()\n {\n return sfAssetsLibraryTools::getMediaDir(true) . $this->getRelativePath();\n }", "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 isAbsolutePath()\n {\n if ($this->exists === false) {\n $this->is_absolute_path = null;\n return;\n }\n\n if (substr($this->path, 0, 1) == '/') {\n $this->is_absolute_path = true;\n $this->absolute_path = $this->path;\n } else {\n $this->is_absolute_path = false;\n }\n\n return;\n }" ]
[ "0.8334988", "0.8295165", "0.759019", "0.73463607", "0.73394895", "0.73394895", "0.7192222", "0.6927927", "0.68221", "0.661081", "0.65428185", "0.65428185", "0.6392258", "0.6293817", "0.6284195", "0.6276101", "0.6276101", "0.6221369", "0.6220459", "0.61635834", "0.6127169", "0.6088395", "0.6063705", "0.6063705", "0.6045389", "0.60344476", "0.60270274", "0.6012921", "0.5958894", "0.5943401", "0.59245634", "0.59212375", "0.5914663", "0.5906164", "0.5877422", "0.58544016", "0.58430654", "0.5836198", "0.58338517", "0.5833099", "0.5803509", "0.57822233", "0.577654", "0.5774191", "0.5770063", "0.57442933", "0.5744109", "0.57278407", "0.570635", "0.5700575", "0.5638931", "0.56238127", "0.5605824", "0.5593293", "0.55890834", "0.55848604", "0.558433", "0.55838716", "0.55740994", "0.55626464", "0.5561779", "0.5540051", "0.5535582", "0.5532609", "0.5526143", "0.5503228", "0.5494115", "0.54830766", "0.547913", "0.5455377", "0.54423296", "0.542991", "0.5427265", "0.5394764", "0.539401", "0.53929156", "0.5389779", "0.53629744", "0.5362958", "0.53605103", "0.53555447", "0.53411025", "0.5338725", "0.5338144", "0.5337429", "0.532972", "0.5315853", "0.53045756", "0.53018945", "0.5297651", "0.52953184", "0.529196", "0.52849406", "0.5275861", "0.52753067", "0.5275194", "0.52638924", "0.52633613", "0.52582943" ]
0.7415365
4
A wrapper for htmlspecialchars_decode
function htmlspecialchars_decode($string, $quote_style = ENT_COMPAT) { return strtr($string, array_flip(get_html_translation_table(HTML_SPECIALCHARS, $quote_style))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decode($string) {\n return htmlspecialchars_decode($string, ENT_HTML5 | ENT_QUOTES);\n}", "static public function decode($html) {\r\n\t\t\treturn htmlspecialchars_decode($html);\r\n\t\t}", "function tep_decode_specialchars($string){\n $string=str_replace('&gt;', '>', $string);\n $string=str_replace('&lt;', '<', $string);\n $string=str_replace('&#039;', \"'\", $string);\n $string=str_replace('&quot;', \"\\\"\", $string);\n $string=str_replace('&amp;', '&', $string);\n\n return $string;\n }", "function _un_htmlspecialchars($str)\n{\n\tstatic $rev_html_translation_table;\n\n\tif ( empty($rev_html_translation_table) )\n\t{\n\t\t$rev_html_translation_table = function_exists('get_html_translation_table') ? array_flip(get_html_translation_table(HTML_ENTITIES)) : array('&amp;' => '&', '&#039;' => '\\'', '&quot;' => '\"', '&lt;' => '<', '&gt;' => '>');\n\t}\n\treturn strtr(str_replace('<br />', \"\\n\", $str), $rev_html_translation_table);\n}", "function wp_specialchars_decode($text, $quote_style = \\ENT_NOQUOTES)\n {\n }", "public static function decode(string $content): string\n {\n return htmlspecialchars_decode($content, ENT_QUOTES);\n }", "function s2_htmlencode($str)\n{\n return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');\n}", "function hte($str) {\n return htmlspecialchars($str);\n}", "function txt_UNhtmlspecialchars($t=\"\")\n\t{\n\t\t$t = str_replace( \"&amp;\" , \"&\", $t );\n\t\t$t = str_replace( \"&lt;\" , \"<\", $t );\n\t\t$t = str_replace( \"&gt;\" , \">\", $t );\n\t\t$t = str_replace( \"&quot;\", '\"', $t );\n\t\t$t = str_replace( \"&#039;\", \"'\", $t );\n\t\t\n\t\treturn $t;\n\t}", "function escape($html) { return htmlspecialchars($html, ENT_QUOTES | ENT_SUBSTITUTE, \"UTF-8\"); }", "function pun_htmlspecialchars($str)\r\n{\r\n\t$str = preg_replace('/&(?!#[0-9]+;)/s', '&amp;', $str);\r\n\t$str = str_replace(array('<', '>', '\"'), array('&lt;', '&gt;', '&quot;'), $str);\r\n\r\n\treturn $str;\r\n}", "function unconvertHTML($strInput)//Convert html special code to standart form\n{\n\t//$strInput = html_entity_decode($strInput);\n\t$strInput = str_replace('&quot;', '\"', $strInput);\n\t$strInput = str_replace(\"&#039;\", \"'\", $strInput);\n\treturn $strInput;\n}", "function secur($string){return htmlspecialchars($string, ENT_QUOTES|ENT_SUBSTITUTE);}", "function safehtml($in) {\n return htmlentities($in,ENT_COMPAT,'UTF-8');\n}", "function escape($html) {\n return htmlspecialchars($html, ENT_QUOTES | ENT_SUBSTITUTE, \"UTF-8\");\n}", "function e($str) {\n return htmlspecialchars($str);\n}", "function encoding_conv($var, $enc_out, $enc_in='utf-8')\r\n{\r\n$var = htmlentities($var, ENT_QUOTES, $enc_in);\r\nreturn html_entity_decode($var, ENT_QUOTES, $enc_out);\r\n}", "function convertHTML($strInput) //Convert to html special code\n{\n\t//$strInput = htmlspecialchars($strInput, ENT_QUOTES);\n\t$strInput = str_replace('\"', '&quot;', $strInput);\n\t$strInput = str_replace(\"'\", \"&#039;\", $strInput);\n\treturn $strInput;\n}", "function txt_htmlspecialchars($t=\"\")\n\t{\n\t\t// Use forward look up to only convert & not &#123;\n\t\t$t = preg_replace(\"/&(?!#[0-9]+;)/s\", '&amp;', $t );\n\t\t$t = str_replace( \"<\", \"&lt;\" , $t );\n\t\t$t = str_replace( \">\", \"&gt;\" , $t );\n\t\t$t = str_replace( '\"', \"&quot;\", $t );\n\t\t$t = str_replace( \"'\", '&#039;', $t );\n\t\t\n\t\treturn $t; // A nice cup of?\n\t}", "function htmlspecialchars_uni($message)\r\n{\r\n\t$message = preg_replace(\"#&(?!\\#[0-9]+;)#si\", \"&amp;\", $message); // Fix & but allow unicode\r\n\t$message = str_replace(\"<\", \"&lt;\", $message);\r\n\t$message = str_replace(\">\", \"&gt;\", $message);\r\n\t$message = str_replace(\"\\\"\", \"&quot;\", $message);\r\n\treturn $message;\r\n}", "function escape_html($string) {\n $text = htmlspecialchars($string);\n // $text = strip_tags($string);\n\n return $text;\n}", "function sterilize($input){\r\n return htmlspecialchars($input);\r\n }", "public function getValueEncoded($field) {\n return htmlspecialchars($this->getValue($field));\n}", "function html_xss_clean($text) {\n return htmlspecialchars($text);\n}", "function html($text)\n{\n\treturn htmlspecialchars($text, ENT_QUOTES, 'UTF-8');\n}", "function wp_kses_decode_entities($content)\n {\n }", "function wp_specialchars_decode( $string, $quote_style = ENT_NOQUOTES ) {\n\t$string = (string) $string;\n\n\tif ( 0 === strlen( $string ) ) {\n\t\treturn '';\n\t}\n\n\t// Don't bother if there are no entities - saves a lot of processing\n\tif ( strpos( $string, '&' ) === false ) {\n\t\treturn $string;\n\t}\n\n\t// Match the previous behaviour of _wp_specialchars() when the $quote_style is not an accepted value\n\tif ( empty( $quote_style ) ) {\n\t\t$quote_style = ENT_NOQUOTES;\n\t} elseif ( !in_array( $quote_style, array( 0, 2, 3, 'single', 'double' ), true ) ) {\n\t\t$quote_style = ENT_QUOTES;\n\t}\n\n\t// More complete than get_html_translation_table( HTML_SPECIALCHARS )\n\t$single = array( '&#039;' => '\\'', '&#x27;' => '\\'' );\n\t$single_preg = array( '/&#0*39;/' => '&#039;', '/&#x0*27;/i' => '&#x27;' );\n\t$double = array( '&quot;' => '\"', '&#034;' => '\"', '&#x22;' => '\"' );\n\t$double_preg = array( '/&#0*34;/' => '&#034;', '/&#x0*22;/i' => '&#x22;' );\n\t$others = array( '&lt;' => '<', '&#060;' => '<', '&gt;' => '>', '&#062;' => '>', '&amp;' => '&', '&#038;' => '&', '&#x26;' => '&' );\n\t$others_preg = array( '/&#0*60;/' => '&#060;', '/&#0*62;/' => '&#062;', '/&#0*38;/' => '&#038;', '/&#x0*26;/i' => '&#x26;' );\n\n\tif ( $quote_style === ENT_QUOTES ) {\n\t\t$translation = array_merge( $single, $double, $others );\n\t\t$translation_preg = array_merge( $single_preg, $double_preg, $others_preg );\n\t} elseif ( $quote_style === ENT_COMPAT || $quote_style === 'double' ) {\n\t\t$translation = array_merge( $double, $others );\n\t\t$translation_preg = array_merge( $double_preg, $others_preg );\n\t} elseif ( $quote_style === 'single' ) {\n\t\t$translation = array_merge( $single, $others );\n\t\t$translation_preg = array_merge( $single_preg, $others_preg );\n\t} elseif ( $quote_style === ENT_NOQUOTES ) {\n\t\t$translation = $others;\n\t\t$translation_preg = $others_preg;\n\t}\n\n\t// Remove zero padding on numeric entities\n\t$string = preg_replace( array_keys( $translation_preg ), array_values( $translation_preg ), $string );\n\n\t// Replace characters according to translation table\n\treturn strtr( $string, $translation );\n}", "public function decode($value)\n\t{\n\t\treturn html_entity_decode($value, ENT_QUOTES, 'UTF-8');\n\t}", "public static function sql_htmldecode($s) {\r\n return str_replace(\"'\", \"''\", html_entity_decode($s, ENT_QUOTES));\r\n }", "public static function decode($value) {\n\t\treturn html_entity_decode($value, ENT_QUOTES, Config::get('application.encoding'));\n\t}", "function html($data) {\n $data = htmlspecialchars($data, ENT_QUOTES); // <>\n return $data;\n }", "function escape($str) {\n return htmlspecialchars($str, ENT_QUOTES);\n}", "function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {\n if ( $double_encode ) {\n $string = @htmlspecialchars( $string, $quote_style, $charset );\n } else {\n // Decode &amp; into &\n $string = wp_specialchars_decode( $string, $quote_style );\n\n // Guarantee every &entity; is valid or re-encode the &\n $string = kses_normalize_entities( $string );\n\n // Now re-encode everything except &entity;\n $string = preg_split( '/(&#?x?[0-9a-z]+;)/i', $string, -1, PREG_SPLIT_DELIM_CAPTURE );\n\n for ( $i = 0; $i < count( $string ); $i += 2 )\n $string[$i ] = @htmlspecialchars( $string[$i], $quote_style, 'UTF-8' );\n\n $string = implode( '', $string );\n }\n\n return $string;\n\n}", "protected function getHtmlEntitiesDecodeFunction()\n {\n $name = 'html_decode';\n\n return new TwigFunction($name, function ($text) {\n return strip_tags(html_entity_decode($text));\n });\n }", "function decode_entities($text) {\n $text= html_entity_decode($text,ENT_QUOTES,\"ISO-8859-1\"); #NOTE: UTF-8 does not work!\n //$text= preg_replace_callback('/&#(\\d+);/',\"chr(\\\\1)\",$text); #decimal notation\n //$text= preg_replace_callback('/&#x([a-f0-9]+);/mei',\"chr(0x\\\\1)\",matches); #hex notation\n return $text;\n}", "function tohtml($strValue)\n{\n return htmlspecialchars($strValue);\n}", "static function xmlDecode($v)\n {\n // Ignore empty string and object\n if ($v == null || is_object($v))\n return \"\";\n\n // Decode all entities\n $v = htmlentities($v, ENT_COMPAT, 'UTF-8');\n\n return htmlspecialchars_decode($v, ENT_COMPAT);\n }", "function sql_encode_decode($input, $do_encode = true)\n {\n\n if ($do_encode === true)\n {\n $input = stripslashes($input);\n $input = htmlspecialchars($input);\n //$input = decode_htmlentities($input);\n //$input = $sql_code->encode($input);\n }\n else\n {\n //$input = $sql_code->decode($input);\n //$input = htmlentities($input);\n }\n\n return $input;\n }", "function decodespecialchars($str){\n\t$str = ereg_replace(\"\\n\",\"\\\\n\",$str);\n\t$str = ereg_replace(\"\\r\",\"\\\\r\",$str);\n\t$str=ereg_replace(\"&#039;\",\"'\",$str);\n\t$str=ereg_replace(\"&amp;\",\"&\",$str);\n\t$str=ereg_replace(\"&#59;\",\"\\;\",$str);\n\t$str=ereg_replace(\"&#35;\",\"#\",$str);\n\t$str=ereg_replace(\"&#34;\",'\"',$str);\n\t$str=ereg_replace(\"&#39;\",\"'\",$str);\n\t$str=ereg_replace(\"&#58;\",\":\",$str);\n\t$str=ereg_replace(\"&#47;\",\"\\/\",$str);\n\t$str=ereg_replace(\"&#33;\",\"!\",$str);\n\t$str=ereg_replace(\"&#63;\",\"\\?\",$str);\n\t//special character\n\t$str=ereg_replace(\"&#8218;\",\"�\",$str);\n\t$str=ereg_replace(\"&#402;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8222;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8230;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8224;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8225;\",\"�\",$str);\n\t$str=ereg_replace(\"&#710;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8240;\",\"�\",$str);\n\t$str=ereg_replace(\"&#352;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8249;\",\"�\",$str);\n\t$str=ereg_replace(\"&#338;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8216;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8217;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8220;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8221;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8226;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8211;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8212;\",\"�\",$str);\n\t$str=ereg_replace(\"&#732;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8482;\",\"�\",$str);\n\t$str=ereg_replace(\"&#353;\",\"�\",$str);\n\t$str=ereg_replace(\"&#8250;\",\"�\",$str);\n\t$str=ereg_replace(\"&#339;\",\"�\",$str);\n\t$str=ereg_replace(\"&#376;\",\"�\",$str);\n\t$str=htmlspecialchars_decode($str);\n\treturn $str;\n}", "function e(string $s): string\n{\n return htmlspecialchars($s, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');\n}", "public static function decodeHtml($string)\n\t{\n\t\treturn html_entity_decode($string, ENT_QUOTES, static::$defaultCharset);\n\t}", "function xssafe($data, $encoding = 'UTF-8')\n{\n //return htmlspecialchars($data,ENT_QUOTES | ENT_HTML401,$encoding);\n return htmlspecialchars($data);\n}", "public static function decode($value)\n {\n return html_entity_decode($value, ENT_QUOTES, 'UTF-8');\n }", "function e($str) {\n echo htmlspecialchars($str, ENT_QUOTES);\n}", "function h($str)\n{\n return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');\n}", "public function xml_entity_decode($s) {\n // about how the hypothetical PHP-build-in-function MUST work\n static $XENTITIES = array('&amp;','&gt;','&lt;');\n static $XSAFENTITIES = array('#_x_amp#;','#_x_gt#;','#_x_lt#;');\n $s = str_replace($XENTITIES,$XSAFENTITIES,$s); \n\n //$s = html_entity_decode($s, ENT_NOQUOTES, 'UTF-8'); // any php version\n $s = html_entity_decode($s, ENT_HTML5|ENT_NOQUOTES, 'UTF-8'); // PHP 5.3+\n\n $s = str_replace($XSAFENTITIES,$XENTITIES,$s);\n return $s;\n }", "function ___($text) {\n return htmlspecialchars($text);\n}", "function prepare2eval($evalStr)\n// ****************************\n{\n return html_entity_decode($evalStr);\n}", "function clean($string) {\n return html_entity_decode($string);\n \n}", "function decode($val) {\n\t\t$val = str_replace('&quot;','\"',$val);\n\t\t$val = str_replace('&#39;',\"'\",$val);\n\t\t$val = str_replace(\"&apos;\",\"'\",$val);\n\t\treturn $val;\n\t}", "function escape($value) {\n return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false);\n}", "function atk_html_entity_decode($string, $quote_style=ENT_COMPAT, $charset=null)\n{\n\treturn atkString::html_entity_decode($string, $quote_style, $charset);\n}", "function protection($string)\n{\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}", "function escape($value){//XSS attacks protection\n return htmlspecialchars($value , ENT_QUOTES,'UTF-8');\n }", "public function decodeHTML($str)\n {\n return html_entity_decode($str, ENT_QUOTES, 'UTF-8');\n }", "function ailyak_facebook_group_feed_html_escape(&$text) {\n $text = htmlspecialchars($text);\n}", "public function encodeOnly($string){\n $final = html_entity_decode($string);\n return $final;\n }", "function encode_html($str)\r\n\t{\r\n\t\t$_POST[$this->_current_field] = htmlspecialchars($str, ENT_COMPAT, \"UTF-8\");\r\n\t}", "function filter_xss($string, $allowed_tags = array('a', 'em', 'strong', 'cite', 'blockquote', 'code', 'ul', 'ol', 'li', 'dl', 'dt', 'dd')) {\n // Only operate on valid UTF-8 strings. This is necessary to prevent cross\n // site scripting issues on Internet Explorer 6.\n if (!kc_validate_utf8($string)) {\n return '';\n }\n // Store the text format.\n _filter_xss_split($allowed_tags, TRUE);\n // Remove NULL characters (ignored by some browsers).\n $string = str_replace(chr(0), '', $string);\n // Remove Netscape 4 JS entities.\n $string = preg_replace('%&\\s*\\{[^}]*(\\}\\s*;?|$)%', '', $string);\n\n // Defuse all HTML entities.\n $string = str_replace('&', '&amp;', $string);\n // Change back only well-formed entities in our whitelist:\n // Decimal numeric entities.\n $string = preg_replace('/&amp;#([0-9]+;)/', '&#\\1', $string);\n // Hexadecimal numeric entities.\n $string = preg_replace('/&amp;#[Xx]0*((?:[0-9A-Fa-f]{2})+;)/', '&#x\\1', $string);\n // Named entities.\n $string = preg_replace('/&amp;([A-Za-z][A-Za-z0-9]*;)/', '&\\1', $string);\n\n return preg_replace_callback('%\n (\n <(?=[^a-zA-Z!/]) # a lone <\n | # or\n <!--.*?--> # a comment\n | # or\n <[^>]*(>|$) # a string that starts with a <, up until the > or the end of the string\n | # or\n > # just a >\n )%x', '_filter_xss_split', $string);\n}", "function h( $s ) {\n return htmlspecialchars($s, ENT_QUOTES, 'utf-8');\n}", "function safeEcho(string $text)\n{\n echo htmlspecialchars($text);\n}", "function ha($text_to_escape){\n\treturn htmlspecialchars($text_to_escape, ENT_QUOTES | ENT_IGNORE, 'UTF-8');\n}", "public function html_entity_decode($string, $field_name, $enabled = false)\n {\n }", "function e($value, $doubleEncode = true)\n {\n if ($value instanceof Htmlable) {\n return $value->toHtml();\n }\n\n return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', $doubleEncode);\n }", "function h($text_to_escape){\n\treturn htmlspecialchars($text_to_escape, ENT_NOQUOTES | ENT_IGNORE, 'UTF-8');\n}", "function htmlspecialchars(&$value)\n\t{\n\t\t$value = htmlspecialchars($value);\n\t}", "public function testUnescape() {\n\t\t$string = 'Tom &quot;&amp;&#x2F;Or&quot; &#x27;Jerry&#x27; &lt;tnj@site.tld&gt;';\n\t\t$expected = 'Tom \"&/Or\" \\'Jerry\\' <tnj@site.tld>';\n\t\t$result = _::unescape($string);\n\t\t$this->assertEquals($expected, $result);\n\t}", "function sanitize($dirty){\n return htmlentities($dirty,ENT_QUOTES,\"UTF-8\");\n}", "function decode_entities($text)\n {\n $text = html_entity_decode($text, ENT_QUOTES, 'ISO-8859-1'); //UTF-8 does not work!\n $text = preg_replace('/&#(\\d+);/me', 'chr($1)', $text); //decimal notation\n $text = preg_replace('/&#x([a-f0-9]+);/mei', 'chr(0x$1)', $text); //hex notation\n $text = urldecode($text);\n return $text;\n }", "function encode($string){\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}", "function testinput($data) {\r\n $data = htmlspecialchars($data);\r\n return $data;\r\n }", "function testinput($data) {\r\n $data = htmlspecialchars($data);\r\n return $data;\r\n }", "public function escapeForHtml() {\n $rawString = htmlspecialchars($this->rawString, ENT_QUOTES, $this->charset);\n\n return new static($rawString, $this->charset);\n }", "static public function encode($html) {\r\n\t\t\treturn htmlspecialchars($html);\r\n\t\t}", "function filterSpecials($data){\n\n if(!$this->isUTF8($data))\n $data = utf8_encode($data);\n $data = htmlspecialchars($data, ENT_QUOTES);\n\n return $data;\n }", "function encode_desc(&$data)\n{\n $to_entities = get_html_translation_table(HTML_ENTITIES);\n\n $from_entities = array_flip($to_entities);\n\n $data = strtr($data,$from_entities);\n $data = strtr($data,$to_entities);\n\n return $data;\n}", "function decode_entities( $matches ) {\n\t\t\tif ( function_exists( 'mb_convert_encoding' ) ) {\n\t\t\t\t$content = mb_convert_encoding( $matches[1], 'UTF-8', 'HTML-ENTITIES' );\n\t\t\t} else {\n\t\t\t\t$content = htmlspecialchars_decode( html_entity_decode( html_entity_decode( $matches[1], ENT_QUOTES | ENT_XML1, 'UTF-8' ) ) );\n\t\t\t}\n\t\t\treturn $content;\n\t\t}", "function escape($input)\n{\n\tif(!is_string($input)) {\n\t\treturn false;\n\t}\n\n\treturn htmlspecialchars(strip_tags($input));\n}", "function htmlentities2($text)\n {\n }", "function encode_special_characters(string $html, bool $double_encoding = true, ?string $encoding = null): string\n{\n $encoding = Internal\\internal_encoding($encoding);\n\n return htmlspecialchars($html, ENT_QUOTES | ENT_HTML5 | ENT_SUBSTITUTE, $encoding, $double_encoding);\n}", "public static function safeDecode($data) {\n if (is_array($data)) {\n return array_map(array('self', 'safeDecode'), $data);\n } else if (is_scalar($data)) {\n return rawurldecode($data);\n } else {\n return '';\n }\n }", "function htmlchars($string = \"\")\n{\n return htmlspecialchars($string, ENT_QUOTES, \"UTF-8\");\n}", "function sanitxt($sanitxt) {\r\n\t$sanitxt = str_replace('><','> <',$sanitxt);\r\n\r\n\t// remove HTML tags\r\n\t$sanitxt = strip_tags($sanitxt);\r\n\r\n\t// remove multiple spaces\r\n\t$sanitxt = preg_replace('/\\s+/', ' ', $sanitxt);\r\n\r\n\t// convert smart quotes into normal\r\n\tconvert_smart_quotes($sanitxt);\r\n\r\n\t// replace quotes and ampersands with HTML chars (recommended)\r\n\t// and encode string to UTF-8. UTF-8 is default from PHP 5.4.0 only\r\n\r\n\t$sanitxt = htmlspecialchars($sanitxt,ENT_QUOTES,\"UTF-8\",FALSE);\r\n\r\nreturn($sanitxt);\r\n}", "public function unescape($html) {\n return html_entity_decode($html);\n }", "function string_html_specialchars( $p_string ) {\r\n\t# achumakov: @ added to avoid warning output in unsupported codepages\r\n\t# e.g. 8859-2, windows-1257, Korean, which are treated as 8859-1.\r\n\t# This is VERY important for Eastern European, Baltic and Korean languages\r\n\treturn preg_replace(\"/&amp;(#[0-9]+|[a-z]+);/i\", \"&$1;\", @htmlspecialchars( $p_string, ENT_COMPAT, config_get('charset') ) );\r\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}", "function rehtmlspecialchars($arg){\n\t//$arg = str_replace(\"\", \"<\", $arg);\n\t//$arg = str_replace(\" \", \"_\", $arg);\n\t$arg = str_replace(\"/\", \"\", $arg);\n\t$arg = str_replace(\"&\", \"\", $arg);\n\t$arg = str_replace(\"'\", \"\", $arg);\n\t$arg = str_replace(\"#\", \"\", $arg);\n\t$arg = str_replace(\"(\", \"\", $arg);\n\t$arg = str_replace(\")\", \"-\", $arg);\n\t$arg = str_replace(\".\", \"\", $arg);\n\t\n\treturn $arg;\n\t}", "function htmlSafe($input) {\n\t//Only for HTML output, to prevent XSS and accidental breakage- not really needed here.\n\treturn htmlspecialchars($input);\n}", "function e($string)\r\n{\r\n if ($string) {\r\n return htmlspecialchars($string);\r\n }\r\n}", "function escape($string){\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}", "function modifiercompiler_unescape($params)\n{\n if (!isset($params[ 1 ])) {\n $params[ 1 ] = 'html';\n }\n if (!isset($params[ 2 ])) {\n $params[ 2 ] = '\\'' . addslashes($_CHARSET) . '\\'';\n } else {\n $params[ 2 ] = \"'{$params[ 2 ]}'\";\n }\n switch (trim($params[ 1 ], '\"\\'')) {\n case 'entity':\n case 'htmlall':\n if ($_MBSTRING) {\n return 'mb_convert_encoding(' . $params[ 0 ] . ', ' . $params[ 2 ] . ', \\'HTML-ENTITIES\\')';\n }\n return 'html_entity_decode(' . $params[ 0 ] . ', ENT_NOQUOTES, ' . $params[ 2 ] . ')';\n case 'html':\n return 'htmlspecialchars_decode(' . $params[ 0 ] . ', ENT_QUOTES)';\n case 'url':\n return 'rawurldecode(' . $params[ 0 ] . ')';\n default:\n return $params[ 0 ];\n }\n\n }", "function e($value, $doubleEncode = false)\n {\n if ($value instanceof \\Illuminate\\Contracts\\Support\\Htmlable) {\n return $value->toHtml();\n }\n\n return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', $doubleEncode);\n }", "function anti_injection($data){\n\t$filter = stripslashes(strip_tags(htmlspecialchars($data, ENT_QUOTES)));\n\treturn $filter;\n}", "function decode($output)\n{\n\treturn urldecode($output);\n}", "function escp($text) {\r\n return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');\r\n}", "function encode(string $html, bool $double_encoding = true, ?string $encoding = null): string\n{\n $encoding = Internal\\internal_encoding($encoding);\n\n return htmlentities($html, ENT_QUOTES, $encoding, $double_encoding);\n}", "function _make_safe_for_xml( $t )\n \t{\n \t\treturn str_replace( '&amp;#39;', '&#39;', htmlspecialchars( $t ) );\n \t}", "function decode_entities($text, $exclude = array()) {\n static $table;\n // We store named entities in a table for quick processing.\n if (!isset($table)) {\n // Get all named HTML entities.\n $table = array_flip(get_html_translation_table(HTML_ENTITIES));\n // PHP gives us ISO-8859-1 data, we need UTF-8.\n $table = array_map('utf8_encode', $table);\n // Add apostrophe (XML)\n $table['&apos;'] = \"'\";\n }\n $newtable = array_diff($table, $exclude);\n\n // Use a regexp to select all entities in one pass, to avoid decoding\n // double-escaped entities twice.\n return preg_replace('/&(#x?)?([A-Za-z0-9]+);/e', '_decode_entities(\"$1\", \"$2\", \"$0\", $newtable, $exclude)', $text);\n}", "function xmldec($str)\n{\n if ( !is_string($str) )\n return \"\";\n\n return html_entity_decode($str,ENT_QUOTES,\"ISO-8859-1\");\n\n /*\n $str = str_replace ( \"&gt;\", \">\", $str );\n $str = str_replace ( \"&lt;\", \"<\", $str );\n $str = str_replace ( \"&amp;\", \"&\", $str );\n return $str;\n */\n\n}", "public function fn_htmlspecialchars($str, $arField = array(), $arItem = array(), $profile = array())\n\t{\n\t\t$str = trim($str);\n\n\t\t//static $search = array(\"&\", \"\\\"\", \"&#171;\", \"&#187;\", \">\", \"<\", \"'\");\n\t\t//static $replace = array(\"&amp;\", \"&quot;\", \"&quot;\", \"&quot;\", \"&gt;\", \"&lt;\", \"&apos;\");\n\t\t//return str_replace($search, $replace, $str);\n\n\t\t$str = htmlspecialcharsbx($str);\n\n\t\treturn $str;\n\t}" ]
[ "0.7764036", "0.7404041", "0.6831687", "0.67088", "0.6673168", "0.6669039", "0.6652847", "0.65946376", "0.6539283", "0.6531213", "0.6524976", "0.6498297", "0.64813197", "0.63959163", "0.63800955", "0.6366698", "0.6338252", "0.63337314", "0.6325605", "0.62889683", "0.6276852", "0.62486947", "0.623135", "0.62179744", "0.621596", "0.6207015", "0.6194438", "0.61851037", "0.6170129", "0.6163777", "0.6140658", "0.61347806", "0.6134629", "0.61299855", "0.61292905", "0.611265", "0.6098235", "0.60740435", "0.6073145", "0.6046373", "0.60391706", "0.60375726", "0.60263443", "0.6021875", "0.6009644", "0.6009405", "0.6009403", "0.6006605", "0.5997893", "0.59959346", "0.5985957", "0.5984006", "0.5983314", "0.5952548", "0.5948975", "0.59489495", "0.5940764", "0.5934861", "0.5932561", "0.59232974", "0.59158623", "0.5905566", "0.5905338", "0.59030867", "0.58985543", "0.5891835", "0.58904046", "0.5887363", "0.5882743", "0.58827364", "0.5881985", "0.5881985", "0.5879999", "0.5876131", "0.5870238", "0.58671695", "0.58645123", "0.58546305", "0.5850753", "0.584663", "0.58412623", "0.5840653", "0.58358073", "0.5835597", "0.5832554", "0.58225375", "0.58154225", "0.5813096", "0.58022374", "0.5794147", "0.57936937", "0.57934856", "0.57910544", "0.57797176", "0.5779546", "0.57689714", "0.5765074", "0.5747986", "0.5741565", "0.57410705" ]
0.71630037
2
functions used for building option fields Pick a language, any language ...
function language_select($default = '') { global $db; $sql = 'SELECT lang_iso, lang_local_name FROM ' . LANG_TABLE . ' ORDER BY lang_english_name'; $result = $db->sql_query($sql); $lang_options = ''; while ($row = $db->sql_fetchrow($result)) { $selected = ($row['lang_iso'] == $default) ? ' selected="selected"' : ''; $lang_options .= '<option value="' . $row['lang_iso'] . '"' . $selected . '>' . $row['lang_local_name'] . '</option>'; } $db->sql_freeresult($result); return $lang_options; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract function fields_options();", "function buildLanguageMenu($inheritselection, $alanguage)\n{\n if (pnConfigGetVar('multilingual')) {\n if($inheritselection==true) { // && !empty($alanguage)){ Fix preventing alanguage staying chosen after preview.\n $lang = languagelist();\n if (!$alanguage) {\n $sel_lang[0] = ' selected=\"selected\"';\n } else {\n $sel_lang[0] = '';\n $sel_lang[$alanguage] = ' selected=\"selected\"';\n }\n print '<br /><strong>'._LANGUAGE.': </strong>' /* ML Dropdown with available languages to update */\n .'<select name=\"alanguage\">'\n .'<option value=\"\" '.$sel_lang[0].'>'._ALL.'</option>' ;\n $handle = opendir('language');\n while ($f = readdir($handle)) {\n if (is_dir(\"language/$f\") && (!empty($lang[$f]))) {\n $langlist[$f] = $lang[$f];\n }\n }\n asort($langlist);\n // a bit ugly, but it works in E_ALL conditions (Andy Varganov)\n foreach ($langlist as $k=>$v) {\n echo '<option value=\"'.$k.'\"';\n if (isset($sel_lang[$k])) {\n echo ' selected=\"selected\"';\n }\n echo '>'. $v . '</option>';\n }\n echo '</select>';\n } else {\n print '<br /><strong>'._LANGUAGE.': </strong>&nbsp;';\n lang_dropdown();\n }\n } else {\n echo '<input type=\"hidden\" name=\"alanguage\" value=\"\" />';\n }\n\n}", "function langChoice()\n{\n\tglobal $supported;\n\n\tglobal $detailp; //is usefull when on the detail page\n\n\t$rep = '';\n\n\t$rep .= '<form method=\"get\" id=\"langForm\" action=\"' . $_SERVER[\"PHP_SELF\"] . '\">\n\t\t<select onchange=\"submitForm(\\'langForm\\')\" name=\"lang\">';\n\n\tforeach($supported as $elem)\n\t{\n\t\t$rep .= '<option value=\"' . $elem . '\"';\n\n\t\tif ($_SESSION['lang']===$elem)\n\t\t{\n\t\t\t$rep .= ' selected';\n\t\t}\n\t\t$rep .= '>';\n\n\t\t//we usually want 'Français' instead of 'fr' don't we\n\t\t$rep .= (isset(ABR_LANG[$elem])?ABR_LANG[$elem]:$elem);\n\t\t$rep .= '</option>' . PHP_EOL;\n\t}\n\n\t$rep .= '\t</select> ';\n\n\t\t//so that we keep the current IT (and don't redirect afterwards)\n\t\tif (isset($detailp))\n\t\t{\n\t\t\t$rep .= '<input type=\"hidden\" name=\"choix\" value=\"' . $_GET['choix'] . '\"/>';\n\t\t}\n$rep .= '\t</form>';\n\n\treturn $rep;\n}", "public static function getLanguageOptions()\n\t{\n\t\t$lrOptions = array(\n\t\t\tJHtml::_('select.option', 'lang_ar', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_AR')),\n\t\t\tJHtml::_('select.option', 'lang_zh-CN', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_ZH_CN')),\n\t\t\tJHtml::_('select.option', 'lang_zh-TW', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_ZH_TW')),\n\t\t\tJHtml::_('select.option', 'lang_cs', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_CS')),\n\t\t\tJHtml::_('select.option', 'lang_da', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_DA')),\n\t\t\tJHtml::_('select.option', 'lang_nl', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_NL')),\n\t\t\tJHtml::_('select.option', 'lang_en', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_EN')),\n\t\t\tJHtml::_('select.option', 'lang_et', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_ET')),\n\t\t\tJHtml::_('select.option', 'lang_fi', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_FI')),\n\t\t\tJHtml::_('select.option', 'lang_fr', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_FR')),\n\t\t\tJHtml::_('select.option', 'lang_de', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_DE')),\n\t\t\tJHtml::_('select.option', 'lang_el', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_EL')),\n\t\t\tJHtml::_('select.option', 'lang_iw', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_IW')),\n\t\t\tJHtml::_('select.option', 'lang_hu', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_HU')),\n\t\t\tJHtml::_('select.option', 'lang_is', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_IS')),\n\t\t\tJHtml::_('select.option', 'lang_it', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_IT')),\n\t\t\tJHtml::_('select.option', 'lang_ja', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_JA')),\n\t\t\tJHtml::_('select.option', 'lang_ko', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_KO')),\n\t\t\tJHtml::_('select.option', 'lang_lv', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_LV')),\n\t\t\tJHtml::_('select.option', 'lang_lt', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_LT')),\n\t\t\tJHtml::_('select.option', 'lang_no', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_NO')),\n\t\t\tJHtml::_('select.option', 'lang_pl', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_PL')),\n\t\t\tJHtml::_('select.option', 'lang_pt', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_PT')),\n\t\t\tJHtml::_('select.option', 'lang_ro', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_RO')),\n\t\t\tJHtml::_('select.option', 'lang_ru', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_RU')),\n\t\t\tJHtml::_('select.option', 'lang_es', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_ES')),\n\t\t\tJHtml::_('select.option', 'lang_sv', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_SV')),\n\t\t);\n\n\t\treturn $lrOptions;\n\t}", "function wp_install_language_form($languages)\n {\n }", "function getFieldMainLanguageID($val = null){\n\t\tinclude('axcelerate_link_array_list.php');\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_MainLanguageID');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_MainLanguageID');\n\t\t$tooltip = setToolTipNotification(\"MainLanguageID\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('mlanguage') === 'mlanguage' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label><br><select name='MainLanguageID' id='MainLanguageID' class='srms-field \".(get_axl_req_fields('mlanguage') === 'mlanguage' ? 'input-select-required' : '').\"'><option value=''> -- Select Language -- </option>\";\n\t\t\tasort($sacc_languages);\n\t\t\tforeach ($sacc_languages as $key => $value) {\n\t\t\t\tif(isLanguageDisabled($key)){\n\t\t\t\t\t$form_ret .= \"<option value='\".$key.\"' \".($val == $key ? 'selected' : '').\">\".$value.\"</option>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$form_ret .= \"</select></br>\";\n\t\t}\n\t\treturn $form_ret;\n\t}", "function initlab_field_mailman_version_cb($args) {\n // Get the value of the setting we've registered with register_setting()\n $options = get_option('initlab_options', []);\n ?>\n <select id=\"<?php echo esc_attr($args['label_for']); ?>\" name=\"initlab_options[<?php echo esc_attr($args['label_for']); ?>]\">\n <?php\n foreach ($args['options'] as $value => $label) {\n ?>\n <option value=\"<?php echo esc_attr($value)?>\" <?php echo array_key_exists($args['label_for'], $options) ? selected($options[$args['label_for']], $value, false) : ''; ?>>\n <?php esc_html_e($label, 'initlab-addons'); ?>\n </option>\n <?php\n }\n ?>\n </select>\n <?php\n}", "function create_options($key, $field)\n\t{\n\t\t\n\t}", "private function build_select_field($_meta, $_ptype = \"wccpf\", $_class = \"\", $_index, $_show_as_value = \"no\", $_readonly = \"\", $_cloneable = \"\", $_wrapper = true, $_has_pricing_rules = \"no\") {\r\n $html = ''; \r\n $has_field_rules = isset( $_meta[\"field_rules\"] ) && is_array( $_meta[\"field_rules\"] ) && count( $_meta[\"field_rules\"] ) != 0 ? \"yes\" : \"no\";\r\n if ($_show_as_value == \"no\") {\r\n $html = '<select data-has_field_rules=\"'.$has_field_rules.'\" data-has_pricing_rules=\"'.$_has_pricing_rules.'\" data-fkey=\"'. $_meta[\"key\"] .'\" class=\"' . $_ptype . '-field ' . $_class . '\" name=\"' . esc_attr($_meta[\"key\"] . $_index) . '\" data-field-type=\"'. $_meta[\"type\"] .'\" ' . $_ptype . '-pattern=\"mandatory\" ' . $_ptype . '-mandatory=\"' . $_meta[\"required\"] . '\" ' . $_cloneable . ' ' . $_readonly . ' >';\r\n \r\n $choices = explode(\";\", ((isset($_meta[\"choices\"]) && ! empty($_meta[\"choices\"])) ? $_meta[\"choices\"] : \"\"));\r\n $_meta[\"default_value\"] = (isset($_meta[\"default_value\"]) && ! empty($_meta[\"default_value\"])) ? trim($_meta[\"default_value\"]) : \"\";\r\n \r\n /* Placeholder option */\r\n if (isset($_meta[\"placeholder\"]) && !empty($_meta[\"placeholder\"])) {\r\n $html .= '<option value=\"wccpf_none\">' . esc_html($_meta[\"placeholder\"]) . '</option>';\r\n }\r\n $choices = apply_filters( \"wcff_select_option_before_rendering\", $choices, $_meta[\"key\"] );\r\n foreach ($choices as $choice) {\r\n $attr = '';\r\n $key_val = explode(\"|\", $choice);\r\n /* It has to be two items ( Value => Label ), otherwise don't proceed */\r\n if (count($key_val) == 2) {\r\n if ($_ptype != \"wccaf\") {\r\n /* Since version 2.0.0 - Default value will be absolute value, not as key|val pair */\r\n if (strpos($_meta[\"default_value\"], \"|\") !== false) {\r\n /* Compatibility for <= V 1.4.0 */\r\n if ($choice == $_meta[\"default_value\"]) {\r\n $attr = 'selected';\r\n }\r\n } else {\r\n /*\r\n * For product fields from V 2.0.0\r\n * For admin fields, which will be displyed as Product Fields\r\n */\r\n if (trim($key_val[0]) == $_meta[\"default_value\"]) {\r\n $attr = 'selected';\r\n }\r\n }\r\n } else {\r\n if ($key_val[0] == $_meta[\"value\"]) {\r\n $attr = 'selected';\r\n }\r\n }\r\n $html .= '<option value=\"' . esc_attr(trim($key_val[0])) . '\" ' . $attr . '>' . esc_html(trim($key_val[1])) . '</option>';\r\n }\r\n }\r\n $html .= '</select>';\r\n } else {\r\n /*\r\n * Show the raw value instead of as a field\r\n * Used for the Admin Field showing on product page\r\n */\r\n $html = '<p class=\"wcff-wccaf-value-para-tag\">' . $_meta[\"default_value\"] . '</p>';\r\n }\r\n /* Add wrapper around the field, based on the user options */\r\n if ($_wrapper) {\r\n $html = $this->built_field_wrapper($html, $_meta, $_ptype, $_index);\r\n }\r\n return $html;\r\n }", "function createFieldForm($arrLang)\n{\n\n $arrFields = array(\"conference_name\" => array(\"LABEL\" => $arrLang['Conference Name'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => array(\"style\" => \"width:300px;\"),\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"conference_owner\" => array(\"LABEL\" => $arrLang['Conference Owner'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"conference_number\" => array(\"LABEL\" => $arrLang['Conference Number'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"moderator_pin\" => array(\"LABEL\" => $arrLang['Moderator PIN'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"moderator_options_1\" => array(\"LABEL\" => $arrLang['Moderator Options'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"moderator_options_2\" => array(\"LABEL\" => \"\",\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"user_pin\" => array(\"LABEL\" => $arrLang['User PIN'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"user_options_1\" => array(\"LABEL\" => $arrLang['User Options'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"user_options_2\" => array(\"LABEL\" => \"\",\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"user_options_3\" => array(\"LABEL\" => \"\",\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"start_time\" => array(\"LABEL\" => $arrLang['Start Time (PST/PDT)'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"DATE\",\n \"INPUT_EXTRA_PARAM\" => array(\"TIME\" => true, \"FORMAT\" => \"%Y-%m-%d %H:%M\",\"TIMEFORMAT\" => \"12\"),\n \"VALIDATION_TYPE\" => \"ereg\",\n \"VALIDATION_EXTRA_PARAM\" => \"^(([1-2][0,9][0-9][0-9])-((0[1-9])|(1[0-2]))-((0[1-9])|([1-2][0-9])|(3[0-1]))) (([0-1][0-9]|2[0-3]):[0-5][0-9])$\"),\n \"duration\" => array(\"LABEL\" => $arrLang['Duration (HH:MM)'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => array(\"style\" => \"width:20px;text-align:center\",\"maxlength\" =>\"2\"),\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"duration_min\" => array(\"LABEL\" => $arrLang['Duration (HH:MM)'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => array(\"style\" => \"width:20px;text-align:center\",\"maxlength\" =>\"2\"),\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n/*\n \"recurs\" => array(\"LABEL\" => $arrLang['Recurs'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"reoccurs_period\" => array(\"LABEL\" => $arrLang[\"Reoccurs\"],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"SELECT\",\n \"INPUT_EXTRA_PARAM\" => $arrReoccurs_period,\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\",\n \"EDITABLE\" => \"no\",\n \"SIZE\" => \"1\"),\n \"reoccurs_days\" => array(\"LABEL\" => $arrLang[\"for\"],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"SELECT\",\n \"INPUT_EXTRA_PARAM\" => $arrReoccurs_days,\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\",\n \"EDITABLE\" => \"no\",\n \"SIZE\" => \"1\"),\n*/\n \"max_participants\" => array(\"LABEL\" => $arrLang['Max Participants'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => array(\"style\" => \"width:50px;\"),\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n );\n return $arrFields;\n}", "function setfield( $field_name, $options ) {\n\n//if( $this->debug ) {\n//print \"<pre>\";\n//print \"Options:\\n-----------------------------\\n\";\n//print_r( $options );\n//print $options['name'];\n//print $options['value'];\n//print \"\\n--------------------------------------\\n\";\n//print \"</pre>\";\n//}\n\n/*\n Options (to this function, not an HTML menu option) is an associative array, which gives\n you great flexibility in setting any number\n of options you want.\n \n\tarray(\n\t\t'name' => 'email',\n\t\t'value'\t=> 'foo@bar.com',\n\t\t'label' => 'Email Address',\n\t\t'required' => 1\n\t\t);\n */\n \n$this->fields[$field_name]['name'] = ( $options['name'] ) ? $options['name'] : '';\n\n$this->fields[$field_name]['value'] = ( $options['value'] )\t? $options['value'] : '';\n\nif( $this->debug ) {\nprint \"<pre>\";\nprint \"Value (option): \" . $options['value'] . \"\\n\";\nprint \"Value: \" . $this->fields[$field_name]['value'] . \"\\n\";\nprint \"</pre>\";\n}\n\n$this->fields[$field_name]['label'] = ( $options['label'] )\t? $options['label'] : '';\n\n$this->fields[$field_name]['required'] = ( $options['required'] ) ? $options['required'] : '';\n\n/*\nthe short circuit are a little space saving, but not too much, perl is much more elegant\nthis might be clearest\n \tif( $options['name'] ) {\n\t\t$this->fields[$field_name][name] = $options['name'];\n\t}\n\tif( $options['value'] ) {\n\t\t$this->fields[$field_name][value] = $options['name']\n\t}\n \tif( $options['name'] ) {\n\t\t$this->fields[$field_name][label] = $options['name']\n\t}\n\tif( $options['name'] ) {\n\t\t$this->fields[$field_name][is_required] = $options['name']\n\t}\n \tif( $options['name'] ) {\n\t\t$this->fields[$field_name][invalid] = $options['name']\n\t}\n*/\n\t//$this->fields[$field_name][error] ???\n\n}", "function get_additional_field_options($val){\n\t \t$OPTIONS = stripslashes($val);\n\t\t\t$OPTIONS = str_replace(', ', ',', $OPTIONS);\n\t\t\t$OPTIONS = explode(',', $OPTIONS);\n\t\t\t$output = false;\n\t\t\tforeach($OPTIONS as $option){\n\t\t\t\t$slug = str_replace(' ', '-', $option);\n\t\t\t\t$output[$slug]= $option;\n\t\t\t}\n\t\t\treturn $output;\n\t }", "function smarty_function_languageSelect($params,&$smarty)\n{\n require_once $smarty->_get_plugin_filepath('function', 'html_options');\n global $valid_languages;\n\n\n $outputs = array();\n $values = array();\n\n foreach($valid_languages as $code=>$output)\n {\n $outputs[] = $output;\n $values[] = $code;\n }\n\n\n $select_arr=array(\"output\"=>$outputs,\"values\"=>$values,\"name\"=>\"lang\",\"selected\"=>getLang());\n return smarty_function_html_options($select_arr, $smarty);\n}", "public function renderLanguageSelect() {}", "function getLangsOptions($sel = \"\", $arrLangsShow = array() )\n{\n $CI = & get_instance();\n $out = \"\";\n\tforeach($CI->config->item('languages') as $k => $v)\n\t{\n\t if( count($arrLangsShow) > 0 && ! in_array($k,$arrLangsShow)){\n\t continue;\n }\n\t $out .= \"<option \" . ( $k==$sel ? ' selected ' : \"\" ) . \" value='$k'>$v</option>\";\n }\n return $out;\n}", "function query_select ($name,$query,$default=\"\")\n// from the Welling and Thomson book - thanks for a cool little function!\n{\n global $lg;\n switch ($lg)\n {\n case \"en\":\n $opt_field=1;\n $choose=\"-- Choose --\";\n break;\n case \"cy\":\n $opt_field=2;\n $choose=\"-- Dewis --\";\n break;\n }\n // that should do it\n\n $result=mysql_query($query);\n if (!result)\n return(\"Sorry, I couldn't connect to the database\");\n\n $select=\"<select name=\\\"$name\\\">\";\n $select .= \"<option value=\\\"\\\">$choose</option>\";\n\n for ($i=0; $i<mysql_numrows($result); $i++)\n {\n // $opt_code is the id field for the list of options, starting from 0\n // this assumes that your primary key field will always be the very first\n // field in the table\n $opt_code=mysql_result($result, $i, 0);\n // $opt_desc is the field for the label to be applied to the options\n // the placement number is selected by the switch statement above;\n // note that this implies that your languages will be in the same sequence\n // in each table, ie en always in field 1 (the second field), cy always\n // in field 2 (the third field in the table), etc\n $opt_desc=mysql_result($result, $i, $opt_field);\n $select .= \"<option value=\\\"$opt_code\\\"\";\n if ($opt_code==$default)\n {\n $select .= \" selected\";\n }\n $select .= \"> $opt_desc</option>\";\n }\n $select .= \"</select>\\n\";\n return $select;\n}", "function create_options( $field ) {\n\t\t$field = array_merge($this->defaults, $field);\n\t\t$key = $field['name'];\n\t}", "function language_select() {\n echo '<select name=\"language\">';\n foreach (Translate::$Languages as $lang => $details) {\n // Print the option\n echo '<option value=\"'.html_entities($lang).'\"';\n if ($_SESSION['language'] == $lang)\n echo ' SELECTED';\n echo '>'.$details[0].'</option>';\n }\n echo '</select>';\n }", "function form_options($options) {\n }", "function create_options( $field )\n\t{\n\t\t// defaults?\n\t\t/*\n\t\t$field = array_merge($this->defaults, $field);\n\t\t*/\n\t\t\n\t\t\n\t\t$field['character_number'] = isset($field['character_number']) ? $field['character_number'] : '';\n\t\t\n\t\t?>\n\t\t<tr class=\"field_option field_option_<?php echo $this->name; ?>\">\n\t\t\t<td class=\"label\">\n\t\t\t\t<label><?php _e(\"Number of characters\",'acf'); ?></label>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<?php \n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($field['character_number'] == \"\"){\n\t\t\t\t\t\n\t\t\t\t\t$field['character_number'] = 150;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\tdo_action('acf/create_field', array(\n\t\t\t\t\t\t\t'type'\t=>\t'text',\n\t\t\t\t\t\t\t'name'\t=>\t'fields['.$field['name'].'][character_number]',\n\t\t\t\t\t\t\t'value'\t=>\t$field['character_number']\n\t\t\t\t));\n\t\t\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\n<!--\n\t\t<tr class=\"field_option field_option_file\">\n\t\t\t<td class=\"label\">\n\t\t\t\t<label>Choice</label>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<ul class=\"radio_list radio horizontal\"><li><label><input id=\"acf-field_5_save_format-object\" type=\"radio\" name=\"fields[field_5][save_format]\" value=\"object\">File Object</label></li><li><label><input id=\"acf-field_5_save_format-url\" type=\"radio\" name=\"fields[field_5][save_format]\" value=\"url\">File URL</label></li><li><label><input id=\"acf-field_5_save_format-id\" type=\"radio\" name=\"fields[field_5][save_format]\" value=\"id\" checked=\"checked\" data-checked=\"checked\">File ID</label></li></ul>\t\t\t</td>\n\t\t</tr>\t\n-->\t\n\t\t\n\t\t<?php\n\t\t\n\t\t\n\n\t\t\n\n\t\t\n\t}", "protected function createComponentSelectLanguageForm() \r\n {\r\n $form = new UI\\Form;\r\n \r\n foreach($GLOBALS['wlang'] as $key => $data) {\r\n $lang[$key] = array( \r\n 'short' => $key,\r\n 'lang' => $data['lang']\r\n );\r\n }\r\n usort($lang, array($this, 'sortLang'));\r\n foreach($lang as $data) {\r\n $lang2[$data['short']] = $data['lang'];\r\n }\r\n\r\n $form->addSelect('language')\r\n ->setItems($lang2)\r\n ->setDefaultValue($this->lang);\r\n \r\n $form->onSuccess[] = callback($this, 'selectLanguageFormSubmitted');\r\n return $form;\r\n }", "private function build_factory_meta_option_field($_meta, $_ptype = \"wccpf\") {\r\n \t$name = ($_meta[\"type\"] == \"radio\") ? 'name=\"options-'. $_meta[\"param\"] .'\"' : '';\r\n \t$html = '<ul class=\"wcff-field-layout-' . $_meta[\"layout\"] . '\">';\r\n \tforeach ($_meta[\"options\"] as $option) {\r\n \t\t$checked = '';\r\n \t\tif ($this->fields_values && isset($this->fields_values[$_meta[\"param\"]])) {\r\n \t\t\tif ($_meta[\"type\"] == \"checkbox\") {\r\n \t\t\t\t/* We have an array situation here */\r\n \t\t\t\tif (in_array($option[\"value\"], $this->fields_values[$_meta[\"param\"]])) {\r\n \t\t\t\t\t$checked = 'checked';\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\t/* Straight forward comparision */\r\n \t\t\t\tif ($option[\"value\"] == $this->fields_values[$_meta[\"param\"]]) {\r\n \t\t\t\t\t$checked = 'checked';\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t} else {\r\n \t\t\tif (isset($option[\"selected\"]) && $option[\"selected\"]) {\r\n \t\t\t\t$checked = 'checked';\r\n \t\t\t}\r\n \t\t}\r\n \t\t$html .= '<li><label><input '. $name .' type=\"' . $_meta[\"type\"] . '\" class=\"wcff-field-type-meta-' . $_meta[\"param\"] . '\" value=\"' . $option[\"value\"] . '\" ' . $checked . ' /> ' . $option[\"label\"] . '</label></li>';\r\n \t}\r\n \t$html .= '</ul>';\r\n \treturn $html;\r\n }", "function select_language($selected='', $htmlname='lang_id', $showauto=0, $filter=null, $showempty='', $showwarning=0, $disabled=0, $morecss='', $showcode=0, $forcecombo=0)\r\n\t{\r\n\t\t// phpcs:enable\r\n\t\tglobal $langs;\r\n\r\n\t\t$langs_available=$langs->get_available_languages(DOL_DOCUMENT_ROOT,12);\r\n\r\n\t\t$out='';\r\n\r\n\t\t$out.= '<select class=\"flat'.($morecss?' '.$morecss:'').'\" id=\"'.$htmlname.'\" name=\"'.$htmlname.'\"'.($disabled?' disabled':'').'>';\r\n\t\tif ($showempty)\r\n\t\t{\r\n\t\t\t$out.= '<option value=\"0\"';\r\n\t\t\tif ($selected == '') $out.= ' selected';\r\n\t\t\t$out.= '>';\r\n\t\t\tif ($showempty != '1') $out.=$showempty;\r\n\t\t\telse $out.='&nbsp;';\r\n\t\t\t$out.='</option>';\r\n\t\t}\r\n\t\tif ($showauto)\r\n\t\t{\r\n\t\t\t$out.= '<option value=\"auto\"';\r\n\t\t\tif ($selected == 'auto') $out.= ' selected';\r\n\t\t\t$out.= '>'.$langs->trans(\"AutoDetectLang\").'</option>';\r\n\t\t}\r\n\r\n\t\tasort($langs_available);\r\n\r\n\t\tforeach ($langs_available as $key => $value)\r\n\t\t{\r\n\t\t\t$valuetoshow=$value;\r\n\t\t\tif ($showcode == 1) $valuetoshow=$key.' - '.$value;\r\n\t\t\tif ($showcode == 2) $valuetoshow=$value.' ('.$key.')';\r\n\r\n\t\t\tif ($filter && is_array($filter))\r\n\t\t\t{\r\n\t\t\t\tif ( ! array_key_exists($key, $filter))\r\n\t\t\t\t{\r\n\t\t\t\t\t$out.= '<option value=\"'.$key.'\">'.$valuetoshow.'</option>';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if ($selected == $key)\r\n\t\t\t{\r\n\t\t\t\t$out.= '<option value=\"'.$key.'\" selected>'.$valuetoshow.'</option>';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$out.= '<option value=\"'.$key.'\">'.$valuetoshow.'</option>';\r\n\t\t\t}\r\n\t\t}\r\n\t\t$out.= '</select>';\r\n\r\n\t\t// Make select dynamic\r\n\t\tif (! $forcecombo)\r\n\t\t{\r\n\t\t\tinclude_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';\r\n\t\t\t$out.= ajax_combobox($htmlname);\r\n\t\t}\r\n\r\n\t\treturn $out;\r\n\t}", "function select($name = \"txt\", $alttext = \"\", $selecttype = \"array\", $lookup = \"\", $value = \"\", $event = \"\", $cssid = \"\", $readonly = false, $nochoose = true) {\n\n if (isset($_REQUEST[$name])) {\n if ($value == \"\") {\n $value = $_REQUEST[$name];\n }\n }\n $lookuplist = [];\n if ($selecttype == \"array\" || $selecttype == \"multiarray\") {\n\n if (is_array($lookup)) {\n $lookuplist = $lookup;\n } else {\n $lookuplist = explode(\"|\", $lookup);\n }\n } else if ($selecttype == \"sql\" || $selecttype == \"multisql\") {\n $lookuprow = $this->DEB->getRows($lookup, DEB_ARRAY); //format [0] = NAME\n\n\n foreach ($lookuprow as $irow => $row) {\n $lookuplist[$irow] = $row[0] . \",\" . $row[1]; //make it in the form of array\n }\n }\n //make options for the type of select etc .....\n if ($selecttype == \"multiarray\" || $selecttype == \"multisql\") {\n $options = \"multiple=\\\"multiple\\\"\";\n } else {\n $options = \"\";\n }\n if ($readonly == true) {\n $disabled = \"disabled=\\\"disabled\\\"\";\n } else {\n $disabled = \"\";\n }\n //default text\n if ($alttext == \"\") {\n $alttext = \"Choose\";\n }\n if ($cssid != \"\") {\n $cssid = \"id=\\\"{$cssid}\\\"\";\n } else {\n $cssid = \"\";\n }\n $html = \"<select class=\\\"form-control\\\" $cssid name=\\\"{$name}\\\" $options {$event} $disabled >\";\n\n if (!$nochoose) {\n $html .= \"<option value=\\\"\\\">{$alttext}</option>\";\n }\n\n foreach ($lookuplist as $lid => $option) {\n\n $toption = explode(\",\", $option);\n if (count($toption) != 2) {\n $toption[0] = $lid;\n $toption[1] = $option;\n }\n\n $option = $toption;\n\n if (trim($value) == trim($option[0])) {\n $html .= \"<option selected=\\\"selected\\\" value=\\\"{$option[0]}\\\">{$option[1]}</option>\";\n } else {\n $html .= \"<option value=\\\"{$option[0]}\\\">{$option[1]}</option>\";\n }\n }\n $html .= \"</select>\";\n return $html;\n }", "function testOptionsArray(){\n\t\t#mdx:OptionsArray\n\t\t$choice = new SimpleChoice(\"language\",\"Type in the desired language code:\");\n\t\t$choice->options(['en','es','pt','fr']);\n\t\t#/mdx echo $choice\n\t\t$this->assertContains(\"- en\", \"$choice\");\n\t\t$this->assertNotContains(\"0 - en\", \"$choice\");\n\n\t}", "public function options()\n\t{\n\n\t $tr = new GoogleTranslate('tr');\n\t $tr->setTarget('ru');\n\n\t $options = \\App\\Option::all();\n\t $text = '';\n\n\t foreach ($options as $option) {\n\t $text .= ' | '.$option->id.'=='.$option->title;\n\t }\n\n\t $ru = $tr->translate($text);\n\t $options2 = [];\n\t $options2 = explode(' | ', $ru);\n\t unset($options2[0]);\n\n\t foreach ($options2 as $option2) {\n\t list($id, $title) = explode('==', $option2);\n\t $option_data = $options->firstWhere('id', $id);\n\t $option_data->title = trim($title);\n\t $option_data->slug = str_slug(trim($title));\n\t $option_data->save();\n\t }\n\n\t echo 'The End!';\n\t}", "function of_get_option_by_lang($option){\n\tif(pll_current_language('slug') != 'lt'){\n\t\t$option = $option.'_'.pll_current_language('slug');\n\t}\n\treturn of_get_option($option);\n}", "function gen_selectoption($table,$selected,$type,$what,$show_count=null)\n{\n global $connection, $dbtable, $trace, $lg, $optionselected, $tblenum, $tblstring, $this_is, $nRowsThis_is, $nRowsThis_isy, $nRowsThis_isn, $fieldis, $toutString, $achoisirString;\n $selectoptions = '';\n if (is_array($table)) {\n if (in_array($selected,array('ajout','0','',null)))\n $selectoptions = '<option value=\"\"> >> '.$achoisirString.' &nbsp;</option>';\n foreach($table as $key) {\n $key = html_encode($key);\n ${\n $key.\"String\"} = sql_getone($tblstring, \" WHERE stringlang='$lg' AND stringtype='general' AND stringtitle='$key' \", \"stringentry\");\n if ($key == $selected) $this_select = $optionselected;\n else $this_select = '';\n $selectoptions .= '<option value=\"'.$key.'\"'.$this_select.'>'.(sql_stringit(($what!=''?$what:'general'),$key)!=''?sql_stringit(($what!=''?$what:'general'),$key):(${\n $key.\"String\"}==''?$key:${\n $key.\"String\"})).'</option>';\n }\n } else if ($table == $tblenum) {\n $read = mysqli_query($connection, \"\n\t\t\t\t\t\tSELECT * FROM $table\n\t\t\t\t\t\tWHERE enumstatut='Y'\n\t\t\t\t\t\tAND enumtype LIKE '%$type%'\n\t\t\t\t\t\tAND enumwhat LIKE '%$what%'\n\t\t\t\t\t\t\");\n $nRows = sql_nrows($table, \"\n\t\t\t\t\t\t\tWHERE enumstatut='Y'\n\t\t\t\t\t\t\tAND enumtype LIKE '%$type%'\n\t\t\t\t\t\t\tAND enumwhat LIKE '%$what%'\n\t\t\t\t\t\t\t\");\n if (in_array($selected,array('ajout','0','',null))) {\n $selectoptions = '<option value=\"\"> >> '.$achoisirString.' &nbsp;</option>';\n for ($i=0;$i<$nRows;$i++) {\n $row = mysqli_fetch_array($read);\n $selectoptions .= '<option value=\"'.$row[\"enumtitre\"].'\"> '.sql_stringit(($what==''?'general':$what),$row[\"enumtitre\"]).' </option>';\n }\n } else {\n if (isset($nRowsThis_is) && ($show_count!=null))\n $selectoptions = '<option'.($selected==$toutString?$optionselected:'').' value=\"'.$toutString.'\"> ('.$nRowsThis_is.') '.$toutString.' &nbsp;</option>';\n for ($i=0;$i<$nRows;$i++) {\n $row = mysqli_fetch_array($read);\n $row_enumtitre = $row[\"enumtitre\"];\n if ($row[\"enumtitre\"] == $selected) $this_select = $optionselected;\n else $this_select = '';\n $editwhat = sql_getone($tblstring, \" WHERE stringlang='$lg' AND stringtype='$what' AND stringtitle='$row_enumtitre' \", \"stringentry\");\n $sql_this = \" WHERE \".$fieldis.$what.\"='$row_enumtitre' \";\n $countwhat = sql_nrows($dbtable,$sql_this);\n $selectoptions .= '<option value=\"'.$row_enumtitre.'\" '.$this_select.'>'.($show_count!=null?($countwhat==''?'(0)':'('.$countwhat.')'):'').' '.$editwhat.' </option>';\n }\n }\n } else if ($table == $tblstring) {\n $selectoptions = '';\n if ($selected == '')\t$selectoptions = '<option value=\"\"> >> '.$achoisirString.' &nbsp;</option>'\t;\n $whereq = \" WHERE stringtype='$what' $type \";\n $read = mysqli_query($connection, \" SELECT * FROM $table $whereq \");\n $nRows = sql_nrows($table,$whereq);\n for ($i=0;$i<$nRows;$i++) {\n $row = mysqli_fetch_array($read);\n if ($row[\"stringentry\"] == $selected) {\n $this_select = $optionselected;\n } else {\n $this_select = '';\n }\n $selectoptions .= '<option value=\"'.$row[\"stringentry\"].'\" '.$this_select.'> '.$row[\"stringentry\"].' </option>';\n }\n } else {\n $selectoptions = '';\n if (in_array($selected,array('ajout','0','',null)))\n $selectoptions = '<option value=\"\"> >> '.$achoisirString.' &nbsp;</option>'\t;\n $rid = (in_array($what.\"rid\",sql_fields($table,'array'))?'r':'').\"id\";\n $whereq = \" WHERE \".$what.\"statut='Y' \".($rid=='rid'?\" AND \".$what.\"lang='$lg' \":'').\" $type \";\n $read = mysqli_query($connection, \" SELECT * FROM $table $whereq \");\n $nRows = sql_nrows($table,$whereq);\n for ($i=0;$i<$nRows;$i++) {\n $row = mysqli_fetch_array($read);\n if ($row[$what.$rid] == $selected) {\n $this_select = $optionselected;\n } else {\n $this_select = '';\n }\n if (!isset($row[$what.\"util\"])) {\n if (!isset($row[$what.\"nom\"])) {\n if (!isset($row[$what.\"titre\"])) {\n if (!isset($row[$what.\"title\"])) {\n $row_nomoutitre = $row[$what.$rid];\n } else {\n $row_nomoutitre = $row[$what.\"title\"];\n }\n } else {\n $row_nomoutitre = $row[$what.\"titre\"];\n }\n } else {\n $row_nomoutitre = (isset($row[$what.\"prenom\"])?(isset($row[$what.\"gendre\"])?sql_stringit($tblenum,$row[$what.\"gendre\"],'gendre').\" \":'').$row[$what.\"prenom\"].\" \":'').$row[$what.\"nom\"];\n }\n } else {\n $row_nomoutitre = $row[$what.\"util\"];\n }\n $selectoptions .= '<option value=\"'.$row[$what.$rid].'\" '.$this_select.'> '.$row_nomoutitre.' </option>';\n }\n }\n return $selectoptions;\n}", "static public function options($language, $text_format, $md5_passwords) {\n return compact('language', 'text_format', 'md5_passwords');\n }", "function ninja_forms_list_field_type_dropdown( $selected ){\r\n\t$output = '<option value=\"\" disabled>' . __( 'List', 'ninja-forms-style' ) . '</option>';\r\n\r\n\tif ( $selected == '_list-dropdown' ) {\r\n\t\t$select = 'selected=\"selected\"';\r\n\t} else {\r\n\t\t$select = '';\r\n\t}\r\n\t$output .= '<option value=\"_list-dropdown\" '.$select.'>&nbsp;&nbsp;&nbsp;&nbsp;' . __( 'Dropdown (Select)', 'ninja-forms-style' ) . '</option>';\r\n\r\n\tif ( $selected == '_list-radio' ) {\r\n\t\t$select = 'selected=\"selected\"';\r\n\t} else {\r\n\t\t$select = '';\r\n\t}\r\n\t$output .= '<option value=\"_list-radio\" '.$select.'>&nbsp;&nbsp;&nbsp;&nbsp;' . __( 'Radio', 'ninja-forms-style' ) . '</option>';\r\n\r\n\tif ( $selected == '_list-checkbox' ) {\r\n\t\t$select = 'selected=\"selected\"';\r\n\t} else {\r\n\t\t$select = '';\r\n\t}\r\n\t$output .= '<option value=\"_list-checkbox\" '.$select.'>&nbsp;&nbsp;&nbsp;&nbsp;' . __( 'Checkboxes', 'ninja-forms-style' ) . '</option>';\r\n\r\n\tif ( $selected == '_list-multi' ) {\r\n\t\t$select = 'selected=\"selected\"';\r\n\t} else {\r\n\t\t$select = '';\r\n\t}\r\n\t$output .= '<option value=\"_list-multi\" '.$select.'>&nbsp;&nbsp;&nbsp;&nbsp;' . __( 'Multi-Select', 'ninja-forms-style' ) . '</option>';\r\n\r\n\treturn $output;\r\n}", "function form_option($option)\n {\n }", "function edit(){\n global $wpdb;\n global $DOPBSP;\n \n $id = $_POST['id'];\n $field = $_POST['field'];\n $value = $_POST['value'];\n $language = $_POST['language'];\n \n if ($field == 'label'){\n $value = str_replace(\"\\n\", '<<new-line>>', $value);\n $value = str_replace(\"\\'\", '<<single-quote>>', $value);\n $value = utf8_encode($value);\n \n $field_data = $wpdb->get_row($wpdb->prepare('SELECT * FROM '.$DOPBSP->tables->forms_fields_options.' WHERE id=%d',\n $id));\n \n $translation = json_decode($field_data->translation);\n $translation->$language = $value;\n \n $value = json_encode($translation);\n $field = 'translation';\n }\n \n $select_option = $wpdb->get_row($wpdb->prepare('SELECT * FROM '.$DOPBSP->tables->forms_fields_options.' WHERE id=%d',\n $id));\n $wpdb->update($DOPBSP->tables->forms_fields_options, array($field => $value), \n array('id' => $_POST['id']));\n \n echo $select_option->field_id;\n \n die();\n }", "function ywccp_validate_fields_option( $fields ) {\r\n\r\n\t\tif( empty( $fields ) ){\r\n\t\t\treturn array();\r\n\t\t}\r\n\r\n\t\tforeach( $fields as &$field ) {\r\n\t\t\t// type standard text fo not set\r\n\t\t\t! isset( $field['type'] ) && $field['type'] = 'text';\r\n\t\t\t// label empty if not set\r\n\t\t\t! isset( $field['label'] ) && $field['label'] = '';\r\n\t\t\t// placeholder empty if not set\r\n\t\t\t! isset( $field['placeholder'] ) && $field['placeholder'] = '';\r\n\t\t\t// tooltip empty if not set\r\n\t\t\t! isset( $field['tooltip'] ) && $field['tooltip'] = '';\r\n\t\t\t// set options for select type\r\n\t\t\t$options = '';\r\n\t\t\tif( isset( $field['options'] ) && is_array( $field['options'] ) ) {\r\n\t\t\t\tforeach ( $field['options'] as $key => $value ) {\r\n\t\t\t\t\t// exclude empty options\r\n\t\t\t\t\tif( ! $key && ! $value ) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$options .= $key.'::'.$value;\r\n\t\t\t\t\tif( key( array_slice( $field['options'], -1, 1, TRUE ) ) != $key ) {\r\n\t\t\t\t\t\t$options .= '|';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$field['options'] = $options;\r\n\t\t\t// set class and position for field\r\n\t\t\t//$field['class'] = ( isset( $field['class'] ) && is_array( $field['class'] ) ) ? implode( ',', $field['class'] ) : '';\r\n\t\t\tif( isset( $field['class'] ) && is_array( $field['class'] ) ) {\r\n\t\t\t\t$positions = ywccp_get_array_positions_field();\r\n\t\t\t\tforeach( $field['class'] as $key => $single_class ) {\r\n\t\t\t\t\tif( is_array( $positions ) && array_key_exists( $single_class, $positions ) ){\r\n\t\t\t\t\t\t$field['position'] = $single_class;\r\n\t\t\t\t\t\tunset( $field['class'][$key] );\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\t$field['class'] = implode( ',', $field['class'] );\r\n\t\t\t}\r\n\t\t\t// set empty if position not set\r\n\t\t\t! isset( $field['position'] ) && $field['position'] = '';\r\n\t\t\t// set label class foe field\r\n\t\t\t$field['label_class'] = ( isset( $field['label_class'] ) && is_array( $field['label_class'] ) ) ? implode( ',', $field['label_class'] ) : '';\r\n\t\t\t// set validation\r\n\t\t\t$field['validate'] = ( isset( $field['validate'] ) && is_array( $field['validate'] ) ) ? implode( ',', $field['validate'] ) : '';\r\n\t\t\t// set required ( default false )\r\n\t\t\t$field['required'] = ( ! isset( $field['required'] ) || ! $field['required'] ) ? '0' : '1';\r\n\t\t\t// set clear ( default false )\r\n\t\t\t$field['clear'] = ( ! isset( $field['clear'] ) || ! $field['clear'] ) ? '0' : '1';\r\n\t\t\t// set enabled ( default true )\r\n\t\t\t$field['enabled'] = ( isset( $field['enabled'] ) && ! $field['enabled'] ) ? '0': '1';\r\n\t\t\t// set show in email ( default true )\r\n\t\t\t$field['show_in_email'] = ( isset( $field['show_in_email'] ) && ! $field['show_in_email'] ) ? '0' : '1';\r\n\t\t\t// set show in order ( default true )\r\n\t\t\t$field['show_in_order'] = ( isset( $field['show_in_order'] ) && ! $field['show_in_order'] ) ? '0' : '1';\r\n\t\t\t// set show in my-account ( default true )\r\n\t\t\t$field['show_in_account'] = ( isset( $field['show_in_account'] ) && ! $field['show_in_account'] ) ? '0' : '1';\r\n\t\t\t// set tooltip\r\n\t\t\t$field['tooltip'] = isset( $field['custom_attributes']['data-tooltip'] ) ? $field['custom_attributes']['data-tooltip'] : '';\r\n\t\t}\r\n\r\n\t\treturn $fields;\r\n\t}", "function imbaf_properties_create_add_fields(){\n ?>\n <div class=\"form-field\">\n <label for=\"term_meta[imbaf_property_type]\">Typ</label>\n\n <select name=\"term_meta[imbaf_property_type]\">\n\n <?php\n\n foreach($this -> property_types as $property){\n\n ?> <option style=\"width:100%;\" value=\"<?php echo $property['value']; ?>\"><?php echo $property['label']; ?></option> <?php\n\n }\n\n\n ?>\n </select>\n\n <p class=\"description\"><?php _e('Vergleichswert-Typ','imb_affiliate'); ?></p>\n\n\n\n <label for=\"term_meta[imbaf_property_icon]\">Icon</label>\n <input type=\"text\" name=\"term_meta[imbaf_property_icon]\">\n\n <p class=\"description\"><?php _e('Font Awesome Icon','imb_affiliate'); ?></p>\n\n\n <label for=\"term_meta[imbaf_property_prefix]\"><?php _e('Präfix','imb_affiliate'); ?></label>\n <input type=\"text\" name=\"term_meta[imbaf_property_prefix]\">\n\n <p class=\"description\"><?php _e('Vorgestellter Wert (ca.)','imb_affiliate'); ?></p>\n\n <label for=\"term_meta[imbaf_property_suffix]\"><?php _e('Suffix','imb_affiliate'); ?></label>\n <input type=\"text\" name=\"term_meta[imbaf_property_suffix]\">\n <p class=\"description\"><?php _e('Nachgestellter Wert (z.B. kg, MhZ etc.)','imb_affiliate'); ?></p>\n\n\n\n </div>\n <?php\n\n\n }", "function lang_options_for_select($blank = true) {\n\t\t$list = array();\n\t\tforeach (glob(APP . 'Locale/*') as $dir) {\n\t\t\t$path = explode('/', $dir);\n\t\t\t$lang = end($path);\n\t\t\tif ($lang == 'default.pot') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$list[$lang] = $this->get_lang_label($lang);\n\t\t}\n\t\treturn $list;\n\t}", "function barnelli_wp_select( $field ) {\n\tglobal $thepostid, $post, $vision;\n\n\t$thepostid \t\t\t\t= empty( $thepostid ) ? $post->ID : $thepostid;\n\t$field['class'] \t\t= isset( $field['class'] ) ? $field['class'] : 'select short';\n\t$field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : '';\n\t$field['value'] \t\t= isset( $field['value'] ) ? $field['value'] : get_post_meta( $thepostid, $field['id'], true );\n\n\techo '<p class=\"form-field ' . esc_attr( $field['id'] ) . '_field ' . esc_attr( $field['wrapper_class'] ) . '\"><label for=\"' . esc_attr( $field['id'] ) . '\">' . wp_kses_post( $field['label'] ) . '</label><select id=\"' . esc_attr( $field['id'] ) . '\" name=\"' . esc_attr( $field['id'] ) . '\" class=\"' . esc_attr( $field['class'] ) . '\">';\n\n\tforeach ( $field['options'] as $key => $value ) {\n\n\t\techo '<option value=\"' . esc_attr( $key ) . '\" ' . selected( esc_attr( $field['value'] ), esc_attr( $key ), false ) . '>' . esc_html( $value ) . '</option>';\n\n\t}\n\n\techo '</select> ';\n\n\tif ( ! empty( $field['description'] ) ) {\n\n\t\tif ( isset( $field['desc_tip'] ) ) {\n\t\t\techo '<img class=\"help_tip\" data-tip=\"' . esc_attr( $field['description'] ) . '\" src=\"' . $vision->plugin_url() . '/assets/images/help.png\" height=\"16\" width=\"16\" />';\n\t\t} else {\n\t\t\techo '<span class=\"description\">' . wp_kses_post( $field['description'] ) . '</span>';\n\t\t}\n\n\t}\n\techo '</p>';\n}", "public function fieldSelect($sId=\"\",$sNome=\"\",$aValue=\"\",$sLunghezza=0,$sTag=\"\", $jolly=\"\"){\r\n\t\t\r\n\t\tif($sTag==\"\"){\r\n\t\t\techo \"<select name=\\\"\" . $sNome . \"\\\">\";\r\n\t\t}else{\r\n\t\t\techo \"<select name=\\\"\" . $sNome . \"\\\"\" . $sTag . \">\";\r\n\t\t}\r\n\r\n\t\tforeach($aValue as $key=>$value){\r\n\t\t\tif(substr($value,0,1)==$jolly){\r\n\t\t\t\techo \"<option style=\\\"font-weight:bold;\\\" value=\\\"\" . $key . \"\\\">Gruppo: \" . substr($value,1) . \"</option>\";\r\n\t\t\t}else{\r\n\t\t\t\techo \"<option value=\\\"\" . $key . \"\\\">\" . $value . \"</option>\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\techo \"</select>\";\r\n\t\t\r\n\t}", "function choose_lang() {\n\tglobal $lang;\n\t\n\t// Get lang file array\n\t$lang_ar = glob('include/text_??.json');\n\t\n\t// Display lang list\n\techo \"<SELECT ID=c_lang NAME=\\\"lang\\\">\\n\";\n\t$lang_count = count($lang_ar);\n\tfor ($i = 0; $i < $lang_count; $i++) {\n\t\t$lang_val = preg_replace(\"/^.*text_(..)\\.json$/\", \"$1\", $lang_ar[$i]);\n\t\techo \"<OPTION VALUE=$lang_val\";\n\t\tif ($lang_val == $lang) {\n\t\t\techo \" SELECTED\";\n\t\t}\n\t\techo \">$lang_val</OPTION>\";\n\t}\n\techo \"</SELECT>\\n\";\n}", "function sfe_language_select_callback() {\n\n\t\tglobal $sfpp_options;\n\n\t\t$sfpp_options['language'] = isset( $sfpp_options['language'] ) && ! empty( $sfpp_options['language'] ) ? $sfpp_options['language'] : 'en_US';\n\n\t\t?>\n\n\t\t<select id=\"sfpp_settings[language]\" class=\"chosen-select\" name=\"sfpp_settings[language]\" title=\"<?php esc_attr__( 'Select language', SIMPLE_FACEBOOK_EMBED_I18N ) ?>\">\n\t\t\t<option value=\"af_ZA\" <?php selected( $sfpp_options['language'], 'af_ZA' ); ?>>Afrikaans</option>\n\t\t\t<option value=\"ak_GH\" <?php selected( $sfpp_options['language'], 'ak_GH' ); ?>>Akan</option>\n\t\t\t<option value=\"am_ET\" <?php selected( $sfpp_options['language'], 'am_ET' ); ?>>Amharic</option>\n\t\t\t<option value=\"ar_AR\" <?php selected( $sfpp_options['language'], 'ar_AR' ); ?>>Arabic</option>\n\t\t\t<option value=\"as_IN\" <?php selected( $sfpp_options['language'], 'as_IN' ); ?>>Assamese</option>\n\t\t\t<option value=\"ay_BO\" <?php selected( $sfpp_options['language'], 'ay_BO' ); ?>>Aymara</option>\n\t\t\t<option value=\"az_AZ\" <?php selected( $sfpp_options['language'], 'az_AZ' ); ?>>Azerbaijani</option>\n\t\t\t<option value=\"be_BY\" <?php selected( $sfpp_options['language'], 'be_BY' ); ?>>Belarusian</option>\n\t\t\t<option value=\"bg_BG\" <?php selected( $sfpp_options['language'], 'bg_BG' ); ?>>Bulgarian</option>\n\t\t\t<option value=\"bn_IN\" <?php selected( $sfpp_options['language'], 'bn_IN' ); ?>>Bengali</option>\n\t\t\t<option value=\"br_FR\" <?php selected( $sfpp_options['language'], 'br_FR' ); ?>>Breton</option>\n\t\t\t<option value=\"bs_BA\" <?php selected( $sfpp_options['language'], 'bs_BA' ); ?>>Bosnian</option>\n\t\t\t<option value=\"ca_ES\" <?php selected( $sfpp_options['language'], 'ca_ES' ); ?>>Catalan</option>\n\t\t\t<option value=\"cb_IQ\" <?php selected( $sfpp_options['language'], 'cb_IQ' ); ?>>Sorani Kurdish</option>\n\t\t\t<option value=\"ck_US\" <?php selected( $sfpp_options['language'], 'ck_US' ); ?>>Cherokee</option>\n\t\t\t<option value=\"co_FR\" <?php selected( $sfpp_options['language'], 'co_FR' ); ?>>Corsican</option>\n\t\t\t<option value=\"cs_CZ\" <?php selected( $sfpp_options['language'], 'cs_CZ' ); ?>>Czech</option>\n\t\t\t<option value=\"cx_PH\" <?php selected( $sfpp_options['language'], 'cx_PH' ); ?>>Cebuano</option>\n\t\t\t<option value=\"cy_GB\" <?php selected( $sfpp_options['language'], 'cy_GB' ); ?>>Welsh</option>\n\t\t\t<option value=\"da_DK\" <?php selected( $sfpp_options['language'], 'da_DK' ); ?>>Danish</option>\n\t\t\t<option value=\"de_DE\" <?php selected( $sfpp_options['language'], 'de_DE' ); ?>>German</option>\n\t\t\t<option value=\"el_GR\" <?php selected( $sfpp_options['language'], 'el_GR' ); ?>>Greek</option>\n\t\t\t<option value=\"en_GB\" <?php selected( $sfpp_options['language'], 'en_GB' ); ?>>English (UK)</option>\n\t\t\t<option value=\"en_IN\" <?php selected( $sfpp_options['language'], 'en_IN' ); ?>>English (India)</option>\n\t\t\t<option value=\"en_PI\" <?php selected( $sfpp_options['language'], 'en_PI' ); ?>>English (Pirate)</option>\n\t\t\t<option value=\"en_UD\" <?php selected( $sfpp_options['language'], 'en_UD' ); ?>>English (Upside Down)</option>\n\t\t\t<option value=\"en_US\" <?php selected( $sfpp_options['language'], 'en_US' ); ?>>English (US)</option>\n\t\t\t<option value=\"eo_EO\" <?php selected( $sfpp_options['language'], 'eo_EO' ); ?>>Esperanto</option>\n\t\t\t<option value=\"es_CO\" <?php selected( $sfpp_options['language'], 'es_CO' ); ?>>Spanish (Colombia)</option>\n\t\t\t<option value=\"es_ES\" <?php selected( $sfpp_options['language'], 'es_ES' ); ?>>Spanish (Spain)</option>\n\t\t\t<option value=\"es_LA\" <?php selected( $sfpp_options['language'], 'es_LA' ); ?>>Spanish</option>\n\t\t\t<option value=\"et_EE\" <?php selected( $sfpp_options['language'], 'et_EE' ); ?>>Estonian</option>\n\t\t\t<option value=\"eu_ES\" <?php selected( $sfpp_options['language'], 'eu_ES' ); ?>>Basque</option>\n\t\t\t<option value=\"fa_IR\" <?php selected( $sfpp_options['language'], 'fa_IR' ); ?>>Persian</option>\n\t\t\t<option value=\"fb_LT\" <?php selected( $sfpp_options['language'], 'fb_LT' ); ?>>Leet Speak</option>\n\t\t\t<option value=\"ff_NG\" <?php selected( $sfpp_options['language'], 'ff_NG' ); ?>>Fulah</option>\n\t\t\t<option value=\"fi_FI\" <?php selected( $sfpp_options['language'], 'fi_FI' ); ?>>Finnish</option>\n\t\t\t<option value=\"fo_FO\" <?php selected( $sfpp_options['language'], 'fo_FO' ); ?>>Faroese</option>\n\t\t\t<option value=\"fr_CA\" <?php selected( $sfpp_options['language'], 'fr_CA' ); ?>>French (Canada)</option>\n\t\t\t<option value=\"fr_FR\" <?php selected( $sfpp_options['language'], 'fr_FR' ); ?>>French (France)</option>\n\t\t\t<option value=\"fy_NL\" <?php selected( $sfpp_options['language'], 'fy_NL' ); ?>>Frisian</option>\n\t\t\t<option value=\"ga_IE\" <?php selected( $sfpp_options['language'], 'ga_IE' ); ?>>Irish</option>\n\t\t\t<option value=\"gl_ES\" <?php selected( $sfpp_options['language'], 'gl_ES' ); ?>>Galician</option>\n\t\t\t<option value=\"gn_PY\" <?php selected( $sfpp_options['language'], 'gn_PY' ); ?>>Guarani</option>\n\t\t\t<option value=\"gu_IN\" <?php selected( $sfpp_options['language'], 'gu_IN' ); ?>>Gujarati</option>\n\t\t\t<option value=\"gx_GR\" <?php selected( $sfpp_options['language'], 'gx_GR' ); ?>>Classical Greek</option>\n\t\t\t<option value=\"ha_NG\" <?php selected( $sfpp_options['language'], 'ha_NG' ); ?>>Hausa</option>\n\t\t\t<option value=\"he_IL\" <?php selected( $sfpp_options['language'], 'he_IL' ); ?>>Hebrew</option>\n\t\t\t<option value=\"hi_IN\" <?php selected( $sfpp_options['language'], 'hi_IN' ); ?>>Hindi</option>\n\t\t\t<option value=\"hr_HR\" <?php selected( $sfpp_options['language'], 'hr_HR' ); ?>>Croatian</option>\n\t\t\t<option value=\"hu_HU\" <?php selected( $sfpp_options['language'], 'hu_HU' ); ?>>Hungarian</option>\n\t\t\t<option value=\"hy_AM\" <?php selected( $sfpp_options['language'], 'hy_AM' ); ?>>Armenian</option>\n\t\t\t<option value=\"id_ID\" <?php selected( $sfpp_options['language'], 'id_ID' ); ?>>Indonesian</option>\n\t\t\t<option value=\"ig_NG\" <?php selected( $sfpp_options['language'], 'ig_NG' ); ?>>Igbo</option>\n\t\t\t<option value=\"is_IS\" <?php selected( $sfpp_options['language'], 'is_IS' ); ?>>Icelandic</option>\n\t\t\t<option value=\"it_IT\" <?php selected( $sfpp_options['language'], 'it_IT' ); ?>>Italian</option>\n\t\t\t<option value=\"ja_JP\" <?php selected( $sfpp_options['language'], 'ja_JP' ); ?>>Japanese</option>\n\t\t\t<option value=\"ja_KS\" <?php selected( $sfpp_options['language'], 'ja_KS' ); ?>>Japanese (Kansai)</option>\n\t\t\t<option value=\"jv_ID\" <?php selected( $sfpp_options['language'], 'jv_ID' ); ?>>Javanese</option>\n\t\t\t<option value=\"ka_GE\" <?php selected( $sfpp_options['language'], 'ka_GE' ); ?>>Georgian</option>\n\t\t\t<option value=\"kk_KZ\" <?php selected( $sfpp_options['language'], 'kk_KZ' ); ?>>Kazakh</option>\n\t\t\t<option value=\"km_KH\" <?php selected( $sfpp_options['language'], 'km_KH' ); ?>>Khmer</option>\n\t\t\t<option value=\"kn_IN\" <?php selected( $sfpp_options['language'], 'kn_IN' ); ?>>Kannada</option>\n\t\t\t<option value=\"ko_KR\" <?php selected( $sfpp_options['language'], 'ko_KR' ); ?>>Korean</option>\n\t\t\t<option value=\"ku_TR\" <?php selected( $sfpp_options['language'], 'ku_TR' ); ?>>Kurdish (Kurmanji)</option>\n\t\t\t<option value=\"la_VA\" <?php selected( $sfpp_options['language'], 'la_VA' ); ?>>Latin</option>\n\t\t\t<option value=\"lg_UG\" <?php selected( $sfpp_options['language'], 'lg_UG' ); ?>>Ganda</option>\n\t\t\t<option value=\"li_NL\" <?php selected( $sfpp_options['language'], 'li_NL' ); ?>>Limburgish</option>\n\t\t\t<option value=\"ln_CD\" <?php selected( $sfpp_options['language'], 'ln_CD' ); ?>>Lingala</option>\n\t\t\t<option value=\"lo_LA\" <?php selected( $sfpp_options['language'], 'lo_LA' ); ?>>Lao</option>\n\t\t\t<option value=\"lt_LT\" <?php selected( $sfpp_options['language'], 'lt_LT' ); ?>>Lithuanian</option>\n\t\t\t<option value=\"lv_LV\" <?php selected( $sfpp_options['language'], 'lv_LV' ); ?>>Latvian</option>\n\t\t\t<option value=\"mg_MG\" <?php selected( $sfpp_options['language'], 'mg_MG' ); ?>>Malagasy</option>\n\t\t\t<option value=\"mk_MK\" <?php selected( $sfpp_options['language'], 'mk_MK' ); ?>>Macedonian</option>\n\t\t\t<option value=\"ml_IN\" <?php selected( $sfpp_options['language'], 'ml_IN' ); ?>>Malayalam</option>\n\t\t\t<option value=\"mn_MN\" <?php selected( $sfpp_options['language'], 'mn_MN' ); ?>>Mongolian</option>\n\t\t\t<option value=\"mr_IN\" <?php selected( $sfpp_options['language'], 'mr_IN' ); ?>>Marathi</option>\n\t\t\t<option value=\"ms_MY\" <?php selected( $sfpp_options['language'], 'ms_MY' ); ?>>Malay</option>\n\t\t\t<option value=\"mt_MT\" <?php selected( $sfpp_options['language'], 'mt_MT' ); ?>>Maltese</option>\n\t\t\t<option value=\"my_MM\" <?php selected( $sfpp_options['language'], 'my_MM' ); ?>>Burmese</option>\n\t\t\t<option value=\"nb_NO\" <?php selected( $sfpp_options['language'], 'nb_NO' ); ?>>Norwegian (bokmal)</option>\n\t\t\t<option value=\"nd_ZW\" <?php selected( $sfpp_options['language'], 'nd_ZW' ); ?>>Ndebele</option>\n\t\t\t<option value=\"ne_NP\" <?php selected( $sfpp_options['language'], 'ne_NP' ); ?>>Nepali</option>\n\t\t\t<option value=\"nl_BE\" <?php selected( $sfpp_options['language'], 'nl_BE' ); ?>>Dutch (België)</option>\n\t\t\t<option value=\"nl_NL\" <?php selected( $sfpp_options['language'], 'nl_NL' ); ?>>Dutch</option>\n\t\t\t<option value=\"nn_NO\" <?php selected( $sfpp_options['language'], 'nn_NO' ); ?>>Norwegian (nynorsk)</option>\n\t\t\t<option value=\"ny_MW\" <?php selected( $sfpp_options['language'], 'ny_MW' ); ?>>Chewa</option>\n\t\t\t<option value=\"or_IN\" <?php selected( $sfpp_options['language'], 'or_IN' ); ?>>Oriya</option>\n\t\t\t<option value=\"pa_IN\" <?php selected( $sfpp_options['language'], 'pa_IN' ); ?>>Punjabi</option>\n\t\t\t<option value=\"pl_PL\" <?php selected( $sfpp_options['language'], 'pl_PL' ); ?>>Polish</option>\n\t\t\t<option value=\"ps_AF\" <?php selected( $sfpp_options['language'], 'ps_AF' ); ?>>Pashto</option>\n\t\t\t<option value=\"pt_BR\" <?php selected( $sfpp_options['language'], 'pt_BR' ); ?>>Portuguese (Brazil)</option>\n\t\t\t<option value=\"pt_PT\" <?php selected( $sfpp_options['language'], 'pt_PT' ); ?>>Portuguese (Portugal)</option>\n\t\t\t<option value=\"qu_PE\" <?php selected( $sfpp_options['language'], 'qu_PE' ); ?>>Quechua</option>\n\t\t\t<option value=\"rm_CH\" <?php selected( $sfpp_options['language'], 'rm_CH' ); ?>>Romansh</option>\n\t\t\t<option value=\"ro_RO\" <?php selected( $sfpp_options['language'], 'ro_RO' ); ?>>Romanian</option>\n\t\t\t<option value=\"ru_RU\" <?php selected( $sfpp_options['language'], 'ru_RU' ); ?>>Russian</option>\n\t\t\t<option value=\"rw_RW\" <?php selected( $sfpp_options['language'], 'rw_RW' ); ?>>Kinyarwanda</option>\n\t\t\t<option value=\"sa_IN\" <?php selected( $sfpp_options['language'], 'sa_IN' ); ?>>Sanskrit</option>\n\t\t\t<option value=\"sc_IT\" <?php selected( $sfpp_options['language'], 'sc_IT' ); ?>>Sardinian</option>\n\t\t\t<option value=\"se_NO\" <?php selected( $sfpp_options['language'], 'se_NO' ); ?>>Northern Sámi</option>\n\t\t\t<option value=\"si_LK\" <?php selected( $sfpp_options['language'], 'si_LK' ); ?>>Sinhala</option>\n\t\t\t<option value=\"sk_SK\" <?php selected( $sfpp_options['language'], 'sk_SK' ); ?>>Slovak</option>\n\t\t\t<option value=\"sl_SI\" <?php selected( $sfpp_options['language'], 'sl_SI' ); ?>>Slovenian</option>\n\t\t\t<option value=\"sn_ZW\" <?php selected( $sfpp_options['language'], 'sn_ZW' ); ?>>Shona</option>\n\t\t\t<option value=\"so_SO\" <?php selected( $sfpp_options['language'], 'so_SO' ); ?>>Somali</option>\n\t\t\t<option value=\"sq_AL\" <?php selected( $sfpp_options['language'], 'sq_AL' ); ?>>Albanian</option>\n\t\t\t<option value=\"sr_RS\" <?php selected( $sfpp_options['language'], 'sr_RS' ); ?>>Serbian</option>\n\t\t\t<option value=\"sv_SE\" <?php selected( $sfpp_options['language'], 'sv_SE' ); ?>>Swedish</option>\n\t\t\t<option value=\"sw_KE\" <?php selected( $sfpp_options['language'], 'sw_KE' ); ?>>Swahili</option>\n\t\t\t<option value=\"sy_SY\" <?php selected( $sfpp_options['language'], 'sy_SY' ); ?>>Syriac</option>\n\t\t\t<option value=\"sz_PL\" <?php selected( $sfpp_options['language'], 'sz_PL' ); ?>>Silesian</option>\n\t\t\t<option value=\"ta_IN\" <?php selected( $sfpp_options['language'], 'ta_IN' ); ?>>Tamil</option>\n\t\t\t<option value=\"te_IN\" <?php selected( $sfpp_options['language'], 'te_IN' ); ?>>Telugu</option>\n\t\t\t<option value=\"tg_TJ\" <?php selected( $sfpp_options['language'], 'tg_TJ' ); ?>>Tajik</option>\n\t\t\t<option value=\"th_TH\" <?php selected( $sfpp_options['language'], 'th_TH' ); ?>>Thai</option>\n\t\t\t<option value=\"tk_TM\" <?php selected( $sfpp_options['language'], 'tk_TM' ); ?>>Turkmen</option>\n\t\t\t<option value=\"tl_PH\" <?php selected( $sfpp_options['language'], 'tl_PH' ); ?>>Filipino</option>\n\t\t\t<option value=\"tl_ST\" <?php selected( $sfpp_options['language'], 'tl_ST' ); ?>>Klingon</option>\n\t\t\t<option value=\"tr_TR\" <?php selected( $sfpp_options['language'], 'tr_TR' ); ?>>Turkish</option>\n\t\t\t<option value=\"tt_RU\" <?php selected( $sfpp_options['language'], 'tt_RU' ); ?>>Tatar</option>\n\t\t\t<option value=\"tz_MA\" <?php selected( $sfpp_options['language'], 'tz_MA' ); ?>>Tamazight</option>\n\t\t\t<option value=\"uk_UA\" <?php selected( $sfpp_options['language'], 'uk_UA' ); ?>>Ukrainian</option>\n\t\t\t<option value=\"ur_PK\" <?php selected( $sfpp_options['language'], 'ur_PK' ); ?>>Urdu</option>\n\t\t\t<option value=\"uz_UZ\" <?php selected( $sfpp_options['language'], 'uz_UZ' ); ?>>Uzbek</option>\n\t\t\t<option value=\"vi_VN\" <?php selected( $sfpp_options['language'], 'vi_VN' ); ?>>Vietnamese</option>\n\t\t\t<option value=\"wo_SN\" <?php selected( $sfpp_options['language'], 'wo_SN' ); ?>>Wolof</option>\n\t\t\t<option value=\"xh_ZA\" <?php selected( $sfpp_options['language'], 'xh_ZA' ); ?>>Xhosa</option>\n\t\t\t<option value=\"yi_DE\" <?php selected( $sfpp_options['language'], 'yi_DE' ); ?>>Yiddish</option>\n\t\t\t<option value=\"yo_NG\" <?php selected( $sfpp_options['language'], 'yo_NG' ); ?>>Yoruba</option>\n\t\t\t<option value=\"zh_CN\" <?php selected( $sfpp_options['language'], 'zh_CN' ); ?>>Simplified Chinese (China)</option>\n\t\t\t<option value=\"zh_HK\" <?php selected( $sfpp_options['language'], 'zh_HK' ); ?>>Traditional Chinese (Hong Kong)</option>\n\t\t\t<option value=\"zh_TW\" <?php selected( $sfpp_options['language'], 'zh_TW' ); ?>>Traditional Chinese (Taiwan)</option>\n\t\t\t<option value=\"zu_ZA\" <?php selected( $sfpp_options['language'], 'zu_ZA' ); ?>>Zulu</option>\n\t\t\t<option value=\"zz_TR\" <?php selected( $sfpp_options['language'], 'zz_TR' ); ?>>Zazaki</option>\n\t\t</select>\n\n\t<?php\n\t}", "function create_field($field) {\n // create Field HTML\n ?>\n <ul class=\"acf-hl\" data-cols=\"3\">\n <li>\n <select name=\"<?php echo esc_attr($field['name']) ?>[country]\" data-select=\"countries\" value=\"<?php echo esc_attr($field['value']['country']) ?>\">\n <option value=\"\"><?php _e('País', 'acf-cities'); ?></option>\n <?php foreach($field['countries'] as $country): ?>\n <option value=\"<?php echo $country->Sigla; ?>\" <?php echo ($country->Sigla === $field['value']['country']) ? 'selected' : '' ?>><?php echo $country->Pais; ?></option>\n <?php endforeach; ?>\n </select>\n </li>\n\n <li>\n <select name=\"<?php echo esc_attr($field['name']) ?>[state]\" data-select=\"states\" data-value=\"<?php echo esc_attr($field['value']['state']) ?>\">\n <option value=\"\"><?php _e('Estado', 'acf-cities'); ?></option>\n </select>\n\n <input <?php echo (isset($field['value']['custom-state']) && $field['value']['custom-state'] == 1) ? 'name=\"'. esc_attr($field['name']) .'[state]\"' : ''; ?> type=\"text\" value=\"<?php echo esc_attr($field['value']['state']) ?>\" placeholder=\"Digite o estado\" class=\"state-input\" <?php echo (!isset($field['value']['custom-state']) || $field['value']['custom-state'] == 0) ? 'style=\"display: none\"' : ''; ?>>\n\n <label>\n <input type=\"hidden\" name=\"<?php echo esc_attr($field['name']) ?>[custom-state]\" value=\"0\">\n <input type=\"checkbox\" name=\"<?php echo esc_attr($field['name']) ?>[custom-state]\" <?php if (isset($field['value']['custom-state'])) checked($field['value']['custom-state'], 1); ?> value=\"1\" class=\"custom-state-toggler\">\n Não encontrei o estado\n </label>\n </li>\n\n <li>\n <select name=\"<?php echo esc_attr($field['name']) ?>[city]\" data-select=\"cities\" data-value=\"<?php echo isset($field['value']['city']) ? esc_attr($field['value']['city']) : ''; ?>\" <?php echo (isset($field['value']['custom-city']) && $field['value']['custom-city'] == 1) ? 'style=\"display: none\"' : ''; ?>>\n <option value=\"\"><?php _e('Cidade', 'acf-cities'); ?></option>\n </select>\n\n <input <?php echo (isset($field['value']['custom-city']) && $field['value']['custom-city'] == 1) ? 'name=\"'. esc_attr($field['name']) .'[city]\"' : ''; ?> type=\"text\" value=\"<?php echo esc_attr($field['value']['city']) ?>\" placeholder=\"Digite a cidade\" class=\"city-input\" <?php echo (!isset($field['value']['custom-city']) || $field['value']['custom-city'] == 0) ? 'style=\"display: none\"' : ''; ?>>\n\n <label>\n <input type=\"hidden\" name=\"<?php echo esc_attr($field['name']) ?>[custom-city]\" value=\"0\">\n <input type=\"checkbox\" name=\"<?php echo esc_attr($field['name']) ?>[custom-city]\" <?php if (isset($field['value']['custom-city'])) checked($field['value']['custom-city'], 1); ?> value=\"1\" class=\"custom-city-toggler\">\n Não encontrei a cidade\n </label>\n </li>\n </ul>\n <?php\n }", "function create_options($key, $field) {\n\t\t// defaults\n $defaults = array(\n 'show_target' => false,\n 'default_target' => '_self',\n 'show_title' => false,\n 'classes' => array(),\n );\n\t\t\n $field = array_merge($defaults, $field);\n\n\t\t?> \n <tr class=\"field_option field_option_<?php echo $this->name; ?>\">\n <td class=\"label\">\n <label><?php _e('Show target'); ?></label>\n <p class=\"description\"><?php _e('Allow the user to select if the link opens in a new window, etc.'); ?></p>\n </td>\n <td>\n <input type=\"checkbox\" name=\"fields[<?php echo $key; ?>][show_target]\" value=\"1\" <?php if($field['show_target']) echo 'checked=\"checked\"'; ?> />\n </td>\n </tr>\n\n <tr class=\"field_option field_option_<?php echo $this->name; ?>\">\n <td class=\"label\">\n <label><?php _e('Default target'); ?></label>\n </td>\n <td>\n <select name=\"fields[<?php echo $key; ?>][default_target]\">\n <?php foreach( ACF_Link_Field::$targets as $k => $l ): ?>\n <option value=\"<?php echo $k; ?>\" <?php if($k == $field['default_target']) echo 'selected=\"selected\"'; ?>><?php _e($l); ?></option>\n <?php endforeach; ?>\n </select>\n </td>\n </tr>\n\n <tr class=\"field_option field_option_<?php echo $this->name; ?>\">\n <td class=\"label\">\n <label><?php _e('Show title attribute'); ?></label>\n <p class=\"description\"><?php _e('Allow the user to provided text for the title attribute.'); ?></p>\n </td>\n <td>\n <input type=\"checkbox\" name=\"fields[<?php echo $key; ?>][show_title]\" value=\"1\" <?php if($field['show_title']) echo 'checked=\"checked\"'; ?> />\n </td>\n </tr>\n\n <tr class=\"field_option field_option_<?php echo $this->name; ?>\">\n <td class=\"label\">\n <label><?php _e('Styles'); ?></label>\n <p class=\"description\"><?php _e('Provided classes for the user to select a style.<br/><br/>btn-big : Big button'); ?></p>\n </td>\n <td>\n <textarea name=\"fields[<?php echo $key; ?>][classes]\" ><?php \n foreach( $field['classes'] as $class => $label ) {\n echo \"$class : $label\\n\";\n }\n ?></textarea>\n </td>\n </tr>\n\n\t\t<?php\n\t}", "function buildLangList($langx=null)\r\n\t{\r\n\t\tglobal $uname;\r\n\t\techo \"<select name='ulang'>\\n\";\r\n\t\t$start=\"lang/\";\r\n\t\tif($dir=opendir($start))\r\n\t\t{\r\n\t\t\twhile (($file=readdir($dir))!=FALSE)\r\n\t\t\t{\r\n\t\t\t\tif ($file!=\".\" and $file!=\"..\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (strpos($file, \"lang_\")>-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$file=str_replace(\"lang_\",\"\",$file);\r\n\t\t\t\t\t\t$file=str_replace(\".php\",\"\",$file);\r\n\t\t\t\t\t\techo \"<option value='\" . $file . \"' \";\r\n\t\t\t\t\t\tif ($langx==$file) echo \"Selected\";\r\n\t\t\t\t\t\techo \"> \" . $file . \"\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tclosedir($dir);\r\n\t\t}\r\n\t\techo \"</select>\\n\";\r\n\t}", "static function language_strings(&$string) {\n $string['ilp_element_plugin_dd'] \t\t\t\t= 'Select';\n $string['ilp_element_plugin_dd_type'] \t\t\t= 'Select box';\n $string['ilp_element_plugin_dd_description'] \t= 'A drop-down selector';\n\t\t$string[ 'ilp_element_plugin_dd_optionlist' ] \t= 'Option List';\n\t\t$string[ 'ilp_element_plugin_dd_single' ] \t\t= 'Single select';\n\t\t$string[ 'ilp_element_plugin_dd_multi' ] \t\t= 'Multi select';\n\t\t$string[ 'ilp_element_plugin_dd_typelabel' ] \t\t\t= 'Select type (single/multi)';\n\t\t$string[ 'ilp_element_plugin_dd_existing_options' ] \t= 'existing options';\n\t\t$string[ 'ilp_element_plugin_error_item_key_exists' ]\t= 'The following key already exists in this element';\n\t\t$string[ 'ilp_element_plugin_error_duplicate_key' ]\t\t= 'Duplicate key';\n\t \n return $string;\n }", "protected function getLanguageSelection() {}", "function settings_fields($option_group)\n {\n }", "function lang_dropdown()\n{\n $currentlang = pnUserGetLang();\n echo \"<select name=\\\"alanguage\\\" class=\\\"pn-text\\\" id=\\\"language\\\">\";\n $lang = languagelist();\n print \"<option value=\\\"\\\">\" . _ALL . '</option>';\n $handle = opendir('language');\n while (false !== ($f = readdir($handle))) {\n if (is_dir(\"language/$f\") && @$lang[$f]) {\n $langlist[$f] = $lang[$f];\n } \n } \n asort($langlist);\n foreach ($langlist as $k => $v) {\n echo '<option value=\"' . $k . '\"';\n if ($currentlang == $k) {\n echo ' selected=\"selected\"';\n } \n echo '>' . pnVarPrepForDisplay($v) . '</option> ';\n } \n echo \"</select>\";\n}", "function WPimgAttr_Alt_meta_CustomFields( $form_fields, $post ) {\n //output for each language\n if(is_array(SELF::$WPimgAttr_Alt_languages)):\n // repeat output for each language (exept first one - is default)\n foreach (SELF::$WPimgAttr_Alt_languages as $key => $lang) {\n if($key > 0):\n // get saved value\n $var_name = SELF::$WPimgAttr_Alt_prefix . $lang;\n $value = get_post_meta($post->ID, $var_name, true);\n // create custom field\n $form_fields[$var_name] = array(\n 'value' => $value ? $value : '',\n 'label' => __( 'Alternative Text', 'WPimgAttr' ) . ' (' . $lang . ')',\n 'input' => 'text'\n );\n endif;\n }\n endif;\n // output\n return $form_fields;\n }", "function faculty_create_options($compare, $type) {\n \n switch($type) {\n case \"border\":\n // border styles\n $options = array(\n array('None', 'none'),\n array('Solid', 'solid'),\n array('Dashed', 'dashed'),\n array('Dotted', 'dotted'),\n array('Double', 'double'),\n array('Groove', 'groove'),\n array('Ridge', 'ridge'),\n array('Inset', 'inset'),\n array('Outset', 'outset')\n );\n break;\n case \"family\":\n //font-family sets\n $options = array(\n array('Arial', 'Arial, Helvetica, sans-serif'),\n array('Arial Black', \"'Arial Black', Gadget, sans-serif\"),\n array('Century Gothic', \"'Century Gothic', sans-serif\"),\n array('Courier New', \"'Courier New', Courier, monospace\"),\n array('Georgia', 'Georgia, serif'),\n array('Lucida Console', \"'Lucida Console', Monaco, monospace\"),\n array('Lucida Sans Unicode', \"'Lucida Sans Unicode', 'Lucida Grande', sans-serif\"),\n array('Palatino Linotype', \"'Palatino Linotype', 'Book Antiqua', Palatino, serif\"),\n array('Tahoma', 'Tahoma, Geneva, sans-serif'),\n array('Times New Roman', \"'Times New Roman', serif\"),\n array('Trebuchet MS', \"'Trebuchet MS', Helvetica, sans-serif\"),\n array('Verdana', 'Verdana, Geneva, sans-serif')\n );\n $options = apply_filters('faculty_font_family_options', $options);\n sort($options);\n array_unshift($options, array('Inherit', 'inherit')); // Adds Inherit option as first option.\n break;\n case \"style\":\n // font-style options\n $options = array(\n array('Normal', 'normal'),\n array('Italic', 'italic')\n );\n break;\n case \"variant\":\n // font-variant options\n $options = array(\n array('Normal', 'normal'),\n array('Small-Caps', 'small-caps')\n );\n break;\n case \"weight\":\n // font-weight options\n $options = array(\n array('Normal', 'normal'),\n array('Bold', 'bold')\n );\n break;\n case \"align\":\n // text-align options\n $options = array(\n array('Left', 'left'),\n array('Center', 'center'),\n array('Right', 'right'),\n array('Justify', 'justify')\n );\n break;\n case \"decoration\":\n // text-decoration options\n $options = array(\n array('None', 'none'),\n array('Underline', 'underline'),\n array('Overline', 'overline')\n // Include line-through?\n );\n break;\n case \"transform\":\n // text-transform options\n $options = array(\n array('None', 'none'),\n array('Capitalize', 'capitalize'),\n array('Lowercase', 'lowercase'),\n array('Uppercase', 'uppercase')\n );\n break;\n case \"background\":\n // background color options\n $options = array(\n array('Color (Hex)', 'hex'),\n array('Inherit', 'inherit'),\n array('Transparent', 'transparent')\n );\n break;\n case \"color\":\n // font color options\n $options = array(\n array('Color (Hex)', 'hex'),\n array('Inherit', 'inherit')\n );\n break;\n default:\n $options = '';\n }\n if ( is_array($options) ) {\n $output = '';\n foreach ($options as $option) {\n $output .= '<option value=\"'. esc_attr($option[1]) . '\" title=\"' . esc_attr($option[1]) . '\" ' . selected(esc_attr($option[1]), esc_attr($compare), false) . '>' . __($option[0], FACULTY_DOMAIN) . '</option>';\n }\n } else {\n $output = '<option>'.__('Select type was not valid.', FACULTY_DOMAIN).'</option>';\n }\n return $output;\n}", "function InputOptSelect($Listes,$VariableName,$default,$taille=\"\",$autres=\"\")\t{\n\t\t\tif($_SESSION[\"readonly\"]==\"true\")\n\t\t\t\t$cache=\"disabled\";\n\t\t\tif ($taille > 1)\n\t\t\t\t$_taille=\"WIDTH='$taille' STYLE='width: \".$taille.\"px'\";\n\t\t\t\n\t\t \t$res= \"<select $_taille name=\".$VariableName.\" id=\".$VariableName.\" $autres $cache>\";\n\t\t \t\n\t\t \tif(count($Listes) > 1 ){\n\t\t\t\t$res.= \"<option value='' selected>Selectionnez</option>\";\n\t\t\t}\n\t\t\t// boucle sur chaque OPT group\n\t\t\t$compteur=0;\n\t\t\tforeach ($Listes as $key => $value)\n\t\t\t{\n\t\t\t\t//fermer l'ancien opt group\n\t\t\t\tif($compteur > 0)\n\t\t\t\t\t$res.=\"</optgroup>\"; \n\t\t\t\t$compteur++;\n\t\t\t\t//ouverutre d'un nouveau opt group\t\n\t\t\t\t$res.=\"<optgroup label='\".$key.\"'>\"; \n\t\t\t\t$modelname=$value;\t\t\t\t\n\t\t\t \tfor($i=0;$i < count($modelname);$i++){\n\t\t\t \t\tlist($val,$libelle)=explode(\"|\",$modelname[$i]);\n\t\n\t\t\t \t\tif ($default==$val)\n\t\t\t\t \t\t$res.= \"<option value='$val' selected>\".htmlentities($libelle).\"</option>\";\n\t\t\t\t \telse\n\t\t\t\t \t\t$res.= \"<option value='$val' >\".htmlentities($libelle).\"</option>\";\n\t\t\t\t \t\n\t\t\t\t}\n\t\t\t}\n\t\t\t//fermer le dernière opt group\n\t\t\tif($compteur > 0)\n\t\t\t\t$res.=\"</optgroup>\"; \n\t \t\t$res.= \"</select>\";\n\t\t\treturn $res;\n\t}", "function LUPE_option_combo_rs($rs, $NomeCombo, $PreSelect, $LinhaFixa, $JS, $Style = '')\r\n{\r\n\r\n $option = '<select id=\"'.$NomeCombo.'\" name=\"'.$NomeCombo.'\" '.$JS.' style=\"'.$Style.'\">';\r\n\r\n if ($LinhaFixa != '')\r\n $option .= '<option value=\"\">'.$LinhaFixa.'</option>';\r\n\r\n if (mssql_num_rows($rs) == 0) {\r\n $option .= '<option value=\"\">Não há informação no sistema</option> ';\r\n } else {\r\n mssql_data_seek($rs, 0);\r\n\r\n While ($row = mssql_fetch_array($rs)) {\r\n $option .= '<option value=\"'.$row[0].'\"';\r\n\r\n if ($PreSelect == $row[0])\r\n $option .= \"selected >\";\r\n else\r\n $option .= \">\";\r\n\r\n for ($x = 1; $x < mssql_num_fields($rs); $x++) {\r\n $option .= $row[$x];\r\n if ($x < mssql_num_fields($rs) - 1)\r\n $option .= \" - \";\r\n }\r\n $option .= \"</option> \";\r\n }\r\n }\r\n\r\n $option .= \"</select>\";\r\n\r\n return $option;\r\n}", "function SetCustomVars()\r\n\t\t{\r\n\r\n\r\n\r\n\t\t\t$this->_variables['availablecountries'] = array(\"name\" => \"Continentes\",\r\n\t\t\t \"type\" => \"dropdown\",\r\n\t\t\t \"help\" => GetLang('boletoitauContinentes'),\r\n\t\t\t \"default\" => \"all\",\r\n\t\t\t \"required\" => true,\r\n\t\t\t \"options\" => GetCountryListAsNameValuePairs(),\r\n\t\t\t\t\"multiselect\" => true\r\n\t\t\t);\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$this->_variables['desconto'] = array(\"name\" => \"Desconto em %\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => '',\r\n\t\t\t \"default\" => \"0\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\r\n\r\n\t\t\t$this->_variables['boletoitaucedente'] = array(\"name\" => \"Cedente\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauCedente'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\r\n\t\t\t$this->_variables['boletoitauagencia'] = array(\"name\" => \"Agencia\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauAgencia'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => true\r\n\t\t\t\t);\r\n\r\n\t\t\t$this->_variables['boletoitauconta'] = array(\"name\" => \"Conta\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauConta'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\r\n\t\t\t$this->_variables['boletoitaucarteira'] = array(\"name\" => \"Carteira\",\r\n\t\t\t \"type\" => \"dropdown\",\r\n\t\t\t \"help\" => GetLang('boletoitauCarteira'),\r\n\t\t\t \"default\" => \"20\",\r\n\t\t\t \"options\" => array('175' => '175', '109' => '109'),\r\n\t\t\t \"required\" => true,\r\n\t\t\t \"multiselection\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\r\n\r\n\r\n\t//_-----------------------------------------------------------------------------------------demonstrativos\r\n\t\r\n\t\t\t$this->_variables['demoum'] = array(\"name\" => \"Demonstra&ccedil;&atilde;o 1\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauDemoU'),\r\n\t\t\t \"default\" => \"REFERENTE A COMPRAS ONLINE\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\t$this->_variables['demodois'] = array(\"name\" => \"Demonstra&ccedil;&atilde;o 2\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauDemoD'),\r\n\t\t\t \"default\" => \"Duvidas e sugest&otilde;es entre em contato conosco:\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\t\t\t$this->_variables['demotres'] = array(\"name\" => \"Demonstra&ccedil;&atilde;o 3\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauDemoT'),\r\n\t\t\t \"default\" => \"sac@seusite.com.br | +55 xx 0000.0000\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t//_------------------------------------------------------------------------------------------fim-demonstrativos\r\n\t\r\n\r\n\r\n\r\n\r\n\t\t\t\r\n\t\t\t$this->_variables['boletoitauinstrucaoum'] = array(\"name\" => \"Instru&ccedil;&atilde;o 1\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauInstrucaoUm'),\r\n\t\t\t \"default\" => \"Multa de R$ 3,00 por atraso.\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\t$this->_variables['boletoitauinstrucaodois'] = array(\"name\" => \"Instru&ccedil;&atilde;o 2\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauInstrucaoDois'),\r\n\t\t\t \"default\" => \"Apos o vencimento, pagavel apenas no Banco Real\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\t\t\t$this->_variables['boletoitauinstrucaotres'] = array(\"name\" => \"Instru&ccedil;&atilde;o 3\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauInstrucaoTres'),\r\n\t\t\t \"default\" => \"Fatura sujeita a protesto no SPC/SERASA\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$this->_variables['boletoitauinstrucaoquatro'] = array(\"name\" => \"Instru&ccedil;&atilde;o 4\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauInstrucaoQuatro'),\r\n\t\t\t \"default\" => \"Juros de mora de 0,1% ao dia.\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$this->_variables['boletoitauaceite'] = array(\"name\" => \"Aceite\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauAceite'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$this->_variables['boletoitauespeciedoc'] = array(\"name\" => \"Esp&eacute;cie do documento\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauEspecieDoc'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\r\n\t\t\t$this->_variables['boletoitauespecie'] = array(\"name\" => \"Esp&eacute;cie de cobran&ccedil;a\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauEspecie'),\r\n\t\t\t \"default\" => \"R$\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\r\n\t\t\t$this->_variables['boletoitaucpfcnpj'] = array(\"name\" => \"CPF ou CNPJ do Boleto\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauCNPF'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\r\n\t\t$this->_variables['boletoitaudiasparavencimento'] = array(\"name\" => \"Dias para vencimento\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauVence'),\r\n\t\t\t \"default\" => \"10\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\r\n\r\n\r\n\t\t$this->_variables['boletoitaudv'] = array(\"name\" => \"D&iacute;gito Verificador\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauDV'),\r\n\t\t\t \"default\" => \"0\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\r\n\t\t\t$this->_variables['postagem'] = array(\"name\" => \"LINK de Repagamento\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => \"URL para Repagamento\",\r\n\t\t\t \"default\" => \"%%GLOBAL_ShopPath%%/modules/checkout/boletoitau/boleto_itau.php?boleto=\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$this->_variables['imagems'] = array(\"name\" => \"IMAGEM de Repagamento\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => \"URL para Repagamento\",\r\n\t\t\t \"default\" => \"%%GLOBAL_ShopPath%%/modules/checkout/boletoitau/images/logo.gif\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t$this->_variables['helptext'] = array(\"name\" => \"Mais configura&ccedil;&otilde;es\",\r\n\t\t\t \"type\" => \"textarea\",\r\n\t\t\t \"help\" => GetLang('boletoitauInst'),\r\n\t\t\t \"default\" => \"Voc&ecirc; escolheu pagar com Boleto Banc&aacute;rio do Banco Ita&uacute;.\\nPara reimprimir seu boleto clique no bot&atilde;o abaixo.<br>\",\r\n\t\t\t \"required\" => true,\r\n\t\t\t \"rows\" => 7\r\n\t\t\t);\r\n\t\t\t\r\n\t\t}", "function ubercontent_get_options($field) {\n\treturn _options_get_options(field_info_field($field), NULL, NULL, NULL, NULL);\n}", "function OptionBox($label, $value, $defaultvalue, $text)\n{\n $result = '';\n\tfor ($i=0; $i<count($label); $i++)\n\t{\n\t\t$result .= '<option label=\"'.$label[$i];\n\t\t$result .= '\" value=\"'.$value[$i].'\" ';\n\t\tif (isset($defaultvalue))\n\t\t{\n\t \tif ($value[$i]==$defaultvalue)\n\t \t\t{\n\t \t\t\t$result .= 'selected=\"selected\" ';\n\t \t\t}\n\t\t}\n\t \t$result .= '>'.$text[$i].'</option>';\n\t}\n\treturn $result;\n}", "function init_extra_fields() {\n $temp = $this->uc->CallMethod('PickupLocations', array(), 'GET', $this->token);\n $pickups = array();\n if (is_array($temp)) {\n foreach ($temp as $t) {\n $pickups[$t['LocationId']] = $t['Name'];\n }\n }\n\n // obtine lista planurilor tarifare\n $temp = $this->uc->CallMethod('PriceTables', array(), 'GET', $this->token);\n\n $prices = array();\n if (is_array($temp)) {\n foreach ($temp as $t) {\n $prices[$t['PriceTableId']] = empty($t['Name']) ? $t['PriceTableId'] : $t['Name'];\n }\n }\n\n $this->form_fields += array(\n 'pickup' => array(\n 'title' => __('Punct de ridicare', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(null => 'Alege punctul de ridicare') + $pickups\n ),\n 'priceplan' => array(\n 'title' => __('Plan tarifar', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(null => 'Alege planul tarifar') + $prices\n ),\n 'insurance' => array(\n 'title' => __('', 'urgentcargus'),\n 'label' => __('Asigurare', 'urgentcargus'),\n 'type' => 'checkbox',\n 'default' => 'no'\n ),\n 'saturday' => array(\n 'title' => __('', 'urgentcargus'),\n 'label' => __('Livrare sambata', 'urgentcargus'),\n 'type' => 'checkbox',\n 'default' => 'no'\n ),\n 'morning' => array(\n 'title' => __('', 'urgentcargus'),\n 'label' => __('Livrare dimineata', 'urgentcargus'),\n 'type' => 'checkbox',\n 'default' => 'no'\n ),\n 'open' => array(\n 'title' => __('', 'urgentcargus'),\n 'label' => __('Deschidere colet', 'urgentcargus'),\n 'type' => 'checkbox',\n 'default' => 'no'\n ),\n 'repayment' => array(\n 'title' => __('Incasare ramburs', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(\n 'cash' => 'Numerar',\n 'bank' => 'Transfer bancar'\n )\n ),\n 'payer' => array(\n 'title' => __('Platitor expeditie', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(\n 'sender' => 'Expeditor',\n 'recipient' => 'Destinatar'\n )\n ),\n 'type' => array(\n 'title' => __('Tip expeditie', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(\n 'parcel' => 'Colet',\n 'envelope' => 'Plic'\n )\n ),\n 'free' => array(\n 'title' => __('Plafon transport gratuit', 'urgentcargus'),\n 'type' => 'text',\n ),\n 'fixed' => array(\n 'title' => __('Cost fix transport', 'urgentcargus'),\n 'type' => 'text',\n ),\n 'height' => array(\n 'title' => __('Inaltime', 'urgentcargus'),\n 'type' => 'number',\n ),\n 'width' => array(\n 'title' => __('Latime', 'urgentcargus'),\n 'type' => 'number',\n ),\n 'length' => array(\n 'title' => __('Lungime', 'urgentcargus'),\n 'type' => 'number',\n ),\n 'service' => array(\n 'title' => __('Serviciu', 'urgentcargus'),\n 'type' => 'select',\n 'class' => 'select_height',\n 'options' => array(\n 0 => 'Inactiv',\n 1 => 'Activ'\n )\n ),\n );\n }", "function build_machine_options( $mode )\n{\n // build a drop down list of special interests\n // mode can be 'ADD' or 'DISPLAY'\n\n // get access to a global stack of objects\n\n \n global $machines ;\n\n // reset the variable spave where we are going \n // to build the menu choice structure\n \n $pull_down = '<option value = \"\">MACHINES</option>' ;\n\n // dope how namy objects in the array\n \n $size = count( $machines ) ;\n // and process each one\n \n for ( $counter = 0 ;\n $counter < $size ;\n $counter++ )\n {\n if ( $machines[ $counter ]->active )\n // no sense offering de-activated options\n {\n $pull_down = $pull_down . '<option value = \"'\n . $machines[ $counter ]->short_name \n . '\">'\n . $machines[ $counter ]->name \n . '</option>' ;\n\n\n } // if\n } // for\n\n $pull_down = $pull_down . '<option value = \"Mark Addinall\">Mark Addinall</option>' ;\n\n return $pull_down ;\n\n}", "function add(){\n global $wpdb;\n global $DOPBSP;\n \n $field_id = $_POST['field_id'];\n $position = $_POST['position'];\n $language = $_POST['language'];\n \n $wpdb->insert($DOPBSP->tables->forms_fields_options, array('field_id' => $field_id,\n 'position' => $position,\n 'translation' => $DOPBSP->classes->translation->encodeJSON('FORMS_FORM_FIELD_SELECT_ADD_OPTION_LABEL')));\n $id = $wpdb->insert_id;\n $select_option = $wpdb->get_row($wpdb->prepare('SELECT * FROM '.$DOPBSP->tables->forms_fields_options.' WHERE id=%d',\n $id));\n \n $DOPBSP->views->backend_form_field_select_option->template(array('select_option' => $select_option,\n 'language' => $language));\n \n die();\n }", "protected function getLanguageParameter() {}", "function getLanguages($id = 'DOPBSP-admin-language', \n $function = 'DOPBSPBackEndLanguage.change()', \n $selected_language = '',\n $class = ''){\n global $wpdb;\n global $DOPBSP;\n \n $HTML = array();\n \n $languages = $DOPBSP->classes->languages->languages;\n $selected_language = $selected_language == '' ? $DOPBSP->classes->backend_language->get():$selected_language;\n \n $enabled_languages = $wpdb->get_results('SELECT * FROM '.$DOPBSP->tables->languages.' WHERE enabled=\"true\"');\n \n array_push($HTML, '<select name=\"'.$id.'\" id=\"'.$id.'\"'.($class == '' ? '':' class=\"'.$class.'\"').' onchange=\"'.$function.'\">');\n \n foreach ($enabled_languages as $enabled_language){\n for ($i=0; $i<count($languages); $i++){\n if ($enabled_language->code == $languages[$i]['code']){\n array_push($HTML, '<option value=\"'.$languages[$i]['code'].'\"'.($selected_language == $languages[$i]['code'] ? ' selected=\"selected\"':'').'>'.$languages[$i]['name'].'</option>');\n break;\n }\n }\n }\n array_push($HTML, '</select>');\n array_push($HTML, '<script type=\"text/JavaScript\">jQuery(\\'#'.$id.'\\').DOPSelect();</script>');\n \n return implode('', $HTML);\n }", "function selectLocale($title=0,$flags=null) {\n \n if ((seclevel('LANGSEL_',$this->userLevelID)) && \n\t (paramload('SHELL','multilang'))) { \n $lans = array(); //print_r($_SERVER);\n\t $purl =parse_url($this->get_server_url());//echo $_SERVER['PHP_SELF'];\n\t $query = $purl['query']; //echo '>',$query;\n $thisname = seturl($query); \n\t\n $lans = getlans(); \n \n if ($lans) { \n reset ($lans);\n //asort ($lans);\n\n\t if ($flags) {\n\t \n foreach ($lans as $lan_num => $lan_descr) {\t\n\t\t \n\t\t $flag = loadTheme('flag_'.$lan_num,$lan_descr);\n\t\t $toprint .= seturl('t=lang'.'&langsel='.$lan_num,$flag) . \"&nbsp;\";\n\t\t }\t \n\t }\n\t else {\n //print theme selection list\n $toprint .= \"<form action=\\\"$thisname\\\" method=\\\"POST\\\" class=\\\"thin\\\">\";\n if ($title) $toprint .= \"<b>\" . localize('_LOCAL',getlocal()) . \" :</b>\";\n\t $toprint .= \"<select name=\\\"langsel\\\">\\n\";\n\n //read theme array \n\t $selected = getlocal();\n foreach ($lans as $lan_num => $lan_descr) {\t\n\t if ($lan_num == $selected) $sel = \"selected\"; else $sel = \"\";\n $toprint .= \"<OPTION $sel value=\\\"$lan_num\\\">$lan_descr</OPTION>\\n\";\n }\n\t \n $toprint .= $this->submit_button ;//\"<input type=\\\"submit\\\" value=\\\"Ok\\\">\"; \n $toprint .= \"<input type=\\\"hidden\\\" name=\\\"FormName\\\" value=\\\"Lang\\\">\";\t \n $toprint .= \"<input type=\\\"hidden\\\" name=\\\"FormAction\\\" value=\\\"lang\\\">\";\t\n\t $toprint .= \"</form>\\n\";\n\t }\n }\n else {\n $toprint = \"No Langs\"; \n }\n \n return ($toprint);\n\t } \n }", "function option_dropdown($label, $name, $value, $keys, $comment='') {\r\n\t\techo \"<tr valign='top'><th scope='row'>\" . $label . \"</th>\";\r\n\t\techo \"<td><select name='$name'>\";\r\n\r\n\t\tforeach ((array)$keys as $key => $description) {\r\n\t\t\tif ($key == $value)\r\n\t\t\t\t$selected = \"selected\";\r\n\t\t\telse\r\n\t\t\t\t$selected = \"\";\r\n\r\n\t\t\techo \"<option value='\" . htmlentities($key, ENT_QUOTES, 'UTF-8') . \"' $selected>$description</option>\";\r\n\t\t}\r\n\t\techo \"</select>\";\r\n\t\techo \" $comment</td></tr>\";\r\n\t}", "function getOptions() ;", "function locale_codes_dropdown() {\n\n\t$obj_service = new Java('com.googlecode.objectify.ObjectifyService');\n\t$ofy = $obj_service->begin();\n\t$localeclass = java_class('com.fi.twentythings.Locale');\n\tObjectifyService::register($localeclass);\t\n\t\n\t$localeField = 'locale';\n\t\n\t$locales = $ofy->query($localeclass)->list();\n\t\n\tforeach( $locales as $locale ) {\n echo '<p><a href=\"/cmseditlocale?locale='.$locale->getId().'\">'.$locale->getId().'</a></p>'.\"\\n\"; \n }\n \n}", "public static function add_option() {\n\t\tFrmAppHelper::permission_check('frm_edit_forms');\n check_ajax_referer( 'frm_ajax', 'nonce' );\n\n\t\t$id = FrmAppHelper::get_post_param( 'field_id', 0, 'absint' );\n\t\t$opt_type = FrmAppHelper::get_post_param( 'opt_type', '', 'sanitize_text_field' );\n\t\t$opt_key = FrmAppHelper::get_post_param( 'opt_key', 0, 'absint' );\n\n $field = FrmField::getOne($id);\n\n if ( 'other' == $opt_type ) {\n\t\t\t$opt = __( 'Other', 'formidable' );\n $other_val = '';\n $opt_key = 'other_' . $opt_key;\n } else {\n\t\t\t$opt = __( 'New Option', 'formidable' );\n }\n $field_val = $opt;\n\n $field_data = $field;\n\t\t$field = (array) $field;\n\t\t$field['separate_value'] = isset( $field_data->field_options['separate_value'] ) ? $field_data->field_options['separate_value'] : 0;\n\t\tunset( $field_data );\n\n\t\t$field_name = 'item_meta[' . $id . ']';\n\t\t$html_id = FrmFieldsHelper::get_html_id( $field );\n $checked = '';\n\n if ( 'other' == $opt_type ) {\n\t\t\tinclude( FrmAppHelper::plugin_path() . '/pro/classes/views/frmpro-fields/other-option.php' );\n } else {\n\t\t\trequire( FrmAppHelper::plugin_path() . '/classes/views/frm-fields/single-option.php' );\n }\n wp_die();\n }", "function listField($label, $name, $formName, $array){\n \n echo ucwords($label) . \"&nbsp\"; \n \n $size = count($array);\n \n $list = '<select name=\"';\n $list .= $name;\n $list .= '\" form=\"';\n $list .= $formName;\n $list .= '\">';\n \n echo $list;\n \n $i = 0;\n \n for ($i; $i < $size; $i++)\n {\n $option = '<option value=\"';\n $option .= $array[$i];\n $option .= '\">';\n $option .= $array[$i];\n $option .= '</option>';\n \n echo $option;\n }\n \n echo '</select><br>';\n \n\n // <select name=\"company\" form=\"userInput\">\n // <option value=\"Not Applicable\">Not Applicable</option>\n // </select>\n \n}", "public function build()\n\t{\n\t\tparent::build();\n\n\t\t$options = $this->suppliedOptions;\n\n\t\t$dataOptions = $options['options'];\n\n\t\t// Check if function\n\t\tif(\\is_callable($dataOptions)){\n\t\t\t$dataOptions = \\call_user_func($dataOptions);\n\t\t}\n\n\t\t$options['options'] = array();\n\n\t\t//iterate over the options to create the options assoc array\n\t\tforeach ($dataOptions as $val => $text)\n\t\t{\n\t\t\t$options['options'][] = array(\n\t\t\t\t'id' => is_numeric($val) && (!array_key_exists('enum_numeric_keys', $options) || $options['enum_numeric_keys'] == false) ? $text : $val,\n\t\t\t\t'text' => $text,\n\t\t\t);\n\t\t}\n\n\t\t$this->suppliedOptions = $options;\n\t}", "function get_data_request_options()\r\n{\r\n\t//kijk wat het abstractie niveau is van de huidige opties\r\n\t$current_abstraction_level_query = 'select option_type from Requestable_data where option_name == \":current_selected_option\"';\r\n\t$current_abstraction_level = execute_sql_extract_data($current_abstraction_level_query);\r\n\t\r\n\t//haal de opties maar op uit de DB\r\n\t$requestable_data_descriptions = 'select option_name from Requestable_data where option_type = ' . $current_abstraction_level;\r\n\texecute_sql_extract_data($requestable_data_descriptions);\r\n}", "function hook_i18n_sync_options_alter(&$fields, $entity_type, $bundle_name) {\n\n}", "public function optionsCallback($strField);", "public function __construct()\n\t{\n\t\t/* Call parent constructor */\n\t\tcall_user_func_array( 'parent::__construct', func_get_args() );\n\t\t\n\t\t/* Get current values */\n\t\tif ( $this->value === NULL )\n\t\t{\n\t\t\t$values = array();\n\t\t\tif ( $this->options['key'] )\n\t\t\t{\n\t\t\t\tforeach( \\IPS\\Db::i()->select( '*', 'core_sys_lang_words', array( 'word_key=?', $this->options['key'] ) )->setKeyField('lang_id') as $k => $v )\n\t\t\t\t{\n\t\t\t\t\t$v = $v['word_custom'] ?: $v['word_default'];\n\t\t\t\t\tif ( $v or !isset( $values[ $k ] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$values[ $k ] = $v;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->value = $values;\n\t\t}\n\t\telseif ( is_string( $this->value ) )\n\t\t{\n\t\t\t$values = array();\n\t\t\tforeach ( \\IPS\\Lang::getEnabledLanguages() as $lang )\n\t\t\t{\n\t\t\t\t$values[ $lang->id ] = $this->value;\n\t\t\t}\n\t\t\t$this->value = $values;\n\t\t}\n\t\t\n\t\t/* Init editors */\n\t\tif ( isset( $this->options['editor'] ) )\n\t\t{\n\t\t\tforeach ( \\IPS\\Lang::getEnabledLanguages() as $lang )\n\t\t\t{\n\t\t\t\t$options = $this->options['editor'];\n\t\t\t\t$options['autoSaveKey'] .= $lang->id;\t\t\t\t\n\t\t\t\t$this->editors[ $lang->id ] = new Editor( \"{$this->name}[{$lang->id}]\", isset( $this->value[ $lang->id ] ) ? $this->value[ $lang->id ] : NULL, $this->required, $options );\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t/* Add flags.css */\n\t\t\\IPS\\Output::i()->cssFiles = array_merge( \\IPS\\Output::i()->cssFiles, \\IPS\\Theme::i()->css( 'flags.css', 'core', 'global' ) );\n\t}", "function affwp_add_program_field_to_affiliate_registration_form() {\n\n\t$errors = affiliate_wp()->register->get_errors();\n // $options = get_option( 'affwp_program' );\n\n\tif ( ! array_key_exists( 'empty_program', $errors ) ) {\n $program = sanitize_text_field( $_POST['affwp_program'] );\n\t}\n\n\t?>\n\t<p>\n\t\t<label for=\"affwp-program\">Affiliate Program Type</label>\n\t\t \n <select name='affwp_program'>\n <option value=''>Choose the type of program you run</option>\n\t\t\t<option value='Web Affiliate'>Web Affiliate</option>\n\t\t\t<option value='Retailer'>Retailer</option>\n <option value='Team or Facility'>Team or Facility</option>\n </select>\n\t</p>\n\t<?php\n}", "public function language();", "public function language();", "function display_multilingual_text_field($n, $field, $translations)\n {\n global $language, $languages, $lang;\n ?>\n <p><a href=\"#\" class=\"OptionToggle\" onClick=\"l=document.getElementById('LanguageEntry_<?php echo $n?>');if (l.style.display=='block') {l.style.display='none';this.innerHTML='<?php echo $lang[\"showtranslations\"]?>';} else {l.style.display='block';this.innerHTML='<?php echo $lang[\"hidetranslations\"]?>';} return false;\"><?php echo $lang[\"showtranslations\"]?></a></p>\n <table class=\"OptionTable\" style=\"display:none;\" id=\"LanguageEntry_<?php echo $n?>\">\n <?php\n reset($languages);\n foreach ($languages as $langkey => $langname)\n {\n if ($language!=$langkey)\n {\n if (array_key_exists($langkey,$translations)) {$transval=$translations[$langkey];} else {$transval=\"\";}\n ?>\n <tr>\n <td nowrap valign=\"top\"><?php echo htmlspecialchars($langname)?>&nbsp;&nbsp;</td>\n\n <?php\n if ($field[\"type\"]==0)\n {\n ?>\n <td><input type=\"text\" class=\"stdwidth\" name=\"multilingual_<?php echo $n?>_<?php echo $langkey?>\" value=\"<?php echo htmlspecialchars($transval)?>\"></td>\n <?php\n }\n else\n {\n ?>\n <td><textarea rows=6 cols=50 name=\"multilingual_<?php echo $n?>_<?php echo $langkey?>\"><?php echo htmlspecialchars($transval)?></textarea></td>\n <?php\n }\n ?>\n </tr>\n <?php\n }\n }\n ?></table><?php\n }", "function checkIt( $field, $set, $type ) {\n\tswitch( $type ){\n\t\tcase 'radio' :\n\t\tcase 'check' :\n\t\t\t\t\t $language = 'checked=\"checked\"';\n\t\t\t\t\t break;\n\t\tcase 'select' :\n\t\t\t\t\t $language = 'selected=\"selected\"';\n\t\t\t\t\t break;\n\t}\n\tif ( $field == $set ){\n\t\t$selected = $language;\n\t} else {\n\t\t$selected = '';\n\t}\n\treturn $selected;\n}", "public static function languages($language)\n\t{\n $html = '<label for=\"languages\">' . Text::_('JFIELD_LANGUAGE_LABEL') . '</label>';\n\n $languageOptions = SelectOptions::getOptions('languages');\n\n // Change '*' to translation of 'All' in the options drop-down\n for ($i = 0; $i < count( $languageOptions ); $i++)\n {\n // FOF getOptions() method returns both objects and arrays\n if (is_array($languageOptions[$i]))\n {\n $languageOptions[$i] = (object) $languageOptions[$i];\n }\n\n // 'value' property is the short form of language name, e.g. en-GB\n if ($languageOptions[$i]->value === '*')\n {\n $languageOptions[$i]->text = Text::_('COM_CAJOBBOARD_ALL');\n }\n }\n\n // Change '*' to translation of 'All' if that is the current setting\n if ($language === '*')\n {\n $language = Text::_('COM_CAJOBBOARD_ALL');\n }\n\n $html .= HTMLHelper::_(\n 'FEFHelper.select.genericlist',\n $languageOptions,\n 'language',\n ['list.select' => $language]\n );\n\n\t\treturn $html;\n }", "function prim_options_gender() {\n $gender = array(\n 'man' => t('Man'),\n 'woman' => t('Kvinna'),\n );\n\n return $gender;\n}", "function getFieldEnglishProficiencyID($val = null){\n\t\tinclude('axcelerate_link_array_list.php');\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_EnglishProficiencyID');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_EnglishProficiencyID');\n\t\t$tooltip = setToolTipNotification(\"EnglishProficiencyID\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('english_status') === 'english_status' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label><br><select name='EnglishProficiencyID' id='EnglishProficiencyID' class='srms-field \".(get_axl_req_fields('english_status') === 'english_status' ? 'input-select-required' : '').\"'><option value=''> -- Select -- </option>\";\n\t\t\tforeach ($ProficiencyID as $key => $value) {\n\t\t\t\t$form_ret .= \"<option value='\".$key.\"' \".($val == $key ? 'selected' : '').\">\".$value.\"</option>\";\n\t\t\t}\n\t\t\t$form_ret .= \"</select></br>\";\n\t\t}\n\t\treturn $form_ret;\n\t}", "private function build_factory_meta_select_field($_meta, $_ptype = \"wccpf\") {\r\n \t$html = '<select name=\"wcff-field-type-meta-' . $_meta[\"param\"] . '\" class=\"wcff-field-type-meta-' . $_meta[\"param\"] . '\">';\r\n \tforeach ($_meta[\"options\"] as $option) {\r\n \t\t$selected = '';\r\n \t\tif ($this->fields_values && isset($this->fields_values[$_meta[\"param\"]])) {\r\n \t\t\tif ($option[\"value\"] == $this->fields_values[$_meta[\"param\"]]) {\r\n \t\t\t\t$selected = 'selected';\r\n \t\t\t} \t\t\t\r\n \t\t} else {\r\n \t\t\tif (isset($option[\"selected\"]) && $option[\"selected\"]) {\r\n \t\t\t\t$selected = 'selected';\r\n \t\t\t}\r\n \t\t} \t\t\r\n \t\t$html .= '<option value=\"' . $option[\"value\"] . '\" ' . $selected . '>' . $option[\"label\"] . '</option>';\r\n \t}\r\n \t$html .= '</select>';\r\n \treturn $html;\r\n }", "protected function getAllAvailableLanguageOptions() {}", "public function optionsdemo_field_callback( $field ) {\n\t\t\t$option_name = $field['option_name'];\n\t\t\t$option = get_option( $option_name );\n\t\t\t$value = isset( $option[ $field['id'] ] ) ? $option[ $field['id'] ] : '';\n\t\t\t\n\t\t\tswitch ( $field['type'] ) {\n\t\t\t\t\n\t\t\t\tcase 'file':\n\t\t\t\t\t\n\t\t\t\t\techo '<div class=\"optionsdemo-warp\">';\n\t\t\t\t\tprintf( '<input id=\"%1$s-%2$s\" type=\"text\" class=\"optionsdemo-input\" name=\"%1$s[%2$s]\" value=\"%3$s\"/>',\n\t\t\t\t\t\t$option_name,\n\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t$value\n\t\t\t\t\t);\n\t\t\t\t\tprintf( '<input type=\"button\" class=\"button-primary optionsdemo-btn \" value=\"Insert Image\"/>' );\n\t\t\t\t\t\n\t\t\t\t\techo '</div>';\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// Multiple select render\n\t\t\t\tcase 'multiple':\n\t\t\t\t\t\n\t\t\t\t\t$countries = $field['countries'];\n\t\t\t\t\t\n\t\t\t\t\tprintf( '<select id=\"%1$s-%2$s\" name=\"%1$s[%2$s][]\" multiple=\"%3$s\">',\n\t\t\t\t\t\t$option_name,\n\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t$field['type']\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\tforeach ( $countries as $key => $country ) {\n\t\t\t\t\t\t$selected = '';\n\t\t\t\t\t\tif ( is_array( $value ) && in_array( $key, $value ) ) {\n\t\t\t\t\t\t\t$selected = 'selected';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tprintf( '<option value=\"%1$s\" %2$s >%3$s</option>',\n\t\t\t\t\t\t\t$key,\n\t\t\t\t\t\t\t$selected,\n\t\t\t\t\t\t\t$country\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\techo \"</select>\";\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t// Select filed render\n\t\t\t\tcase 'select':\n\t\t\t\t\t\n\t\t\t\t\t$countries = $field['countries'];\n\t\t\t\t\tprintf( '<select id=\"%1$s-%2$s\" name=\"%1$s[%2$s]\">',\n\t\t\t\t\t\t$option_name,\n\t\t\t\t\t\t$field['id']\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\tforeach ( $countries as $country ) {\n\t\t\t\t\t\t$selected = '';\n\t\t\t\t\t\tif ( $value == $country ) {\n\t\t\t\t\t\t\t$selected = 'selected';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tprintf( '<option value=\"%1$s\" %2$s >%3$s</option>',\n\t\t\t\t\t\t\t$country,\n\t\t\t\t\t\t\t$selected,\n\t\t\t\t\t\t\t$country\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t// Radio filed render\n\t\t\t\tcase 'radio':\n\t\t\t\t\t\n\t\t\t\t\t$conditions = $field['conditions'];\n\t\t\t\t\t\n\t\t\t\t\tforeach ( $conditions as $condition ) {\n\t\t\t\t\t\t$selected = '';\n\t\t\t\t\t\tif ( $value == $condition ) {\n\t\t\t\t\t\t\t$selected = 'checked';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tprintf( '<input id=\"%1$s-%2$s\" name=\"%1$s[%2$s]\" type=\"%3$s\" value=\"%4$s\" %5$s />%6$s<br>',\n\t\t\t\t\t\t\t$option_name,\n\t\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t\t$field['type'],\n\t\t\t\t\t\t\t$condition,\n\t\t\t\t\t\t\t$selected,\n\t\t\t\t\t\t\t$condition\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tcase 'checkbox':\n\t\t\t\t\t\n\t\t\t\t\t$countries = $field['countries'];\n\t\t\t\t\t\n\t\t\t\t\tforeach ( $countries as $key => $country ) {\n\t\t\t\t\t\t$checked = '';\n\t\t\t\t\t\tif ( is_array( $value ) && in_array( $key, $value ) ) {\n\t\t\t\t\t\t\t$checked = 'checked';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tprintf( '<input id=\"%1$s-%2$s\" name=\"%1$s[%2$s][%4$s]\" type=\"%3$s\" value=\"%4$s\" %5$s />%6$s<br>',\n\t\t\t\t\t\t\t$option_name,\n\t\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t\t$field['type'],\n\t\t\t\t\t\t\t$key,\n\t\t\t\t\t\t\t$checked,\n\t\t\t\t\t\t\t$country,\n\t\t\t\t\t\t\t$value\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tcase 'textarea':\n\t\t\t\t\t\n\t\t\t\t\tprintf( '<textarea name=\"%1$s[%2$s]\" id=\"%1$s-%2$s\" placeholder=\"%3$s\" rows=\"5\" cols=\"50\">%4$s</textarea>',\n\t\t\t\t\t\t$option_name,\n\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\tisset( $field['placeholder'] ) ? $field['placeholder'] : '',\n\t\t\t\t\t\t$value\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tcase 'url':\n\t\t\t\t\t\n\t\t\t\t\tprintf( '<input name=\"%1$s[%2$s]\" id=\"%1$s-%2$s\" type=\"%3$s\" placeholder=\"%4$s\" value=\"%5$s\"/>',\n\t\t\t\t\t\t$option_name,\n\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t$field['type'],\n\t\t\t\t\t\tisset( $field['placeholder'] ) ? $field['placeholder'] : '',\n\t\t\t\t\t\t$value\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'number':\n\t\t\t\t\t\n\t\t\t\t\tprintf( '<input name=\"%1$s[%2$s]\" id=\"%1$s-%2$s\" type=\"%3$s\" placeholder=\"%4$s\" value=\"%5$s\" min=\"%6$s\" max=\"%7$s\"/>',\n\t\t\t\t\t\t$option_name,\n\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t$field['type'],\n\t\t\t\t\t\tisset( $field['placeholder'] ) ? $field['placeholder'] : '',\n\t\t\t\t\t\t$value,\n\t\t\t\t\t\t$field['min'],\n\t\t\t\t\t\t$field['max']\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'password':\n\t\t\t\t\t\n\t\t\t\t\tprintf( '<input name=\"%1$s[%2$s]\" id=\"%1$s-%2$s\" type=\"%3$s\" placeholder=\"%4$s\" value=\"%5$s\"/>',\n\t\t\t\t\t\t$option_name,\n\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t$field['type'],\n\t\t\t\t\t\tisset( $field['placeholder'] ) ? $field['placeholder'] : '',\n\t\t\t\t\t\t$value\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'email':\n\t\t\t\t\t\n\t\t\t\t\tprintf( '<input name=\"%1$s[%2$s]\" id=\"%1$s-%2$s\" type=\"%3$s\" placeholder=\"%4$s\" value=\"%5$s\"/>',\n\t\t\t\t\t\t$option_name,\n\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t$field['type'],\n\t\t\t\t\t\tisset( $field['placeholder'] ) ? $field['placeholder'] : '',\n\t\t\t\t\t\t$value\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\t\n\t\t\t\t\tprintf( '<input name=\"%1$s[%2$s]\" id=\"%1$s-%2$s\" type=\"%3$s\" placeholder=\"%4$s\" value=\"%5$s\"/>',\n\t\t\t\t\t\t$option_name,\n\t\t\t\t\t\t$field['id'],\n\t\t\t\t\t\t$field['type'],\n\t\t\t\t\t\tisset( $field['placeholder'] ) ? $field['placeholder'] : '',\n\t\t\t\t\t\t$value\n\t\t\t\t\t);\n\t\t\t}\n\t\t\t//End Switch case\n\t\t}", "function allan_change_city_to_dropdown( $fields ) {\n\n\t$city_args = wp_parse_args( array(\n\t\t'type' => 'select',\n\t\t'options' => array(\n\t\t\t'Seleccione' => 'Seleccione'\n\t\t),\n\t), $fields['shipping']['shipping_city'] );\n\n\t$fields['shipping']['shipping_city'] = $city_args;\n\t$fields['billing']['billing_city'] = $city_args; \n\t$fields['billing']['billing_city']['priority'] = 80;\n\n\treturn $fields;\n\n}", "public function countryOptionList();", "function add_option_without_languages($value,$text,$selected=false)\r\n\t{\r\n\t\t$options_field = array(\"value\"=>$value, \"text\"=>$text, \"selected\"=> $selected);\r\n\t\tarray_push($this->m_array_options,$options_field);\r\n\t}", "public function create_setting_field($args) {\n\t\t$class = isset($args['class'])?$args['class']:'regular-text';\n\t\t$current_value = get_option($args['name'])?get_option($args['name']):'';\n\t\tswitch($args['type']) {\n\t\t\tcase 'textarea':\n\t\t\t\techo '<textarea class=\"'.$class.'\" name=\"'.$args['name'].'\" >'.$current_value.'</textarea>';\n\t\t\t\tbreak;\n\t\t\tcase 'select':\n\t\t\t\tif(!is_array($args['list']))\n\t\t\t\t\t$args['list'] = array();\n\t\t\t\techo '<select class=\"'.$class.'\" name=\"'.$args['name'].'\">';\n\t\t\t\tforeach($args['list'] as $key => $value) {\n\t\t\t\t\techo '<option value=\"'.$key.'\" '.selected( $current_value, $key, false).'>'.$value.'</option>';\n\t\t\t\t}\n\t\t\t\techo '</select>';\n\t\t\t\tbreak;\n\t\t\tcase 'password':\n\t\t\t\techo '<input class=\"'.$class.'\" name=\"'.$args['name'].'\" type=\"password\" value=\"'.$current_value.'\" />';\n\t\t\t\tbreak;\n\t\t\tcase 'text':\n\t\t\tdefault:\n\t\t\t\techo '<input class=\"'.$class.'\" name=\"'.$args['name'].'\" type=\"text\" value=\"'.$current_value.'\" />';\n\t\t}\n\t}", "function addSelectList3($name, $option_list, $header = NULL, $attr_ar = array(),$OBJ,$slted = NULL) { \n $str = \"<select name=\\\"$name\\\" id=\\\"$name\\\" \"; \n if ($attr_ar) { \n $str .= addAttributes( $attr_ar ); \n } \n $str .= \">\\n\"; \n if ( isset($header) ) { \n $str .= \" <option value=\\\"\\\">$header</option>\\n\"; \n } \n foreach ( $option_list as $val => $text ) { \n $str .= \"<option value=\\\"$val\\\" \"; \n if ( isset($_POST[$name]) && ( trim($_POST[$name]) === trim($val) || trim($_POST[$name]) === trim($text) ) || trim($slted) === trim($val) ) { \n $str .= ' selected '; \n } \n\t\t\t\n\t\t\tforeach($text as $keyext => $valext){\n\t\t\t\tif ($keyext>0){\n\t\t\t\t\t$str .= ' item'.$keyext.' = \"'.$valext.'\" '; \n\t\t\t\t}\n\t\t\t}\n\t\t\t\n $str .= \" >\".$text[0].\"</option>\\n\"; \n } \n $str .= \"</select>\"; \n\t\t$OBJ->assign('_'.$name,$str);\n return $str; \n }", "function creditcard_type_pulldown($selected = '', $fieldname = 'form[type]')\n {\n $html = '<select name=\"' . $fieldname . '\" style=\"font-family: Verdana\">';\n $html .= '<option value=\"visa\"';\n if ($selected == 'visa')\n {\n $html .= ' selected=\"selected\"';\n }\n $html .= '>Visa</option>';\n $html .= '<option value=\"mc\"';\n if ($selected == 'mc')\n {\n $html .= ' selected=\"selected\"';\n }\n $html .= '>Mastercard</option>';\n $html .= '<option value=\"amex\"';\n if ($selected == 'amex')\n {\n $html .= ' selected=\"selected\"';\n }\n $html .= '>American Express</option>';\n $html .= '<option value=\"disc\"';\n if ($selected == 'disc')\n {\n $html .= ' selected=\"selected\"';\n }\n $html .= '>Discover</option>';\n $html .= '</select>';\n return $html;\n }", "function get_fields($name_suffix='',$title='',$description='',$enabled=1,$cost=NULL,$one_per_member=0)\n\t{\n\t\trequire_lang('points');\n\t\t$fields=new ocp_tempcode();\n\t\t$fields->attach(form_input_line(do_lang_tempcode('TITLE'),do_lang_tempcode('DESCRIPTION_TITLE'),'custom_title'.$name_suffix,$title,true));\n\t\t$fields->attach(form_input_text(do_lang_tempcode('DESCRIPTION'),do_lang_tempcode('DESCRIPTION_DESCRIPTION'),'custom_description'.$name_suffix,$description,true));\n\t\t$fields->attach(form_input_integer(do_lang_tempcode('COST'),do_lang_tempcode('HOW_MUCH_THIS_COSTS'),'custom_cost'.$name_suffix,$cost,true));\n\t\t$fields->attach(form_input_tick(do_lang_tempcode('ONE_PER_MEMBER'),do_lang_tempcode('DESCRIPTION_ONE_PER_MEMBER'),'custom_one_per_member'.$name_suffix,$one_per_member==1));\n\t\t$fields->attach(form_input_tick(do_lang_tempcode('ENABLED'),'','custom_enabled'.$name_suffix,$enabled==1));\n\t\treturn $fields;\n\t}", "function mt_options_page() {\r\n\r\nif($_POST['lang'] == \"\"){\r\n}\r\nelse\r\n{\r\n\r\n$lang = trim(stripslashes($_POST['lang']));\r\n\r\nif($lang == \"\"){\r\nadd_option(\"tvlang\", 'english', '', 'yes');\r\n$successful = \"<div id='message' class='updated fade'><p>Settings saved successfully</p></div>\";\r\n}\r\nelse\r\n{\r\nupdate_option('tvlang', $lang);\r\n$successful = \"<div id='message' class='updated fade'><p>Settings saved successfully</p></div>\";\r\n}\r\n\r\n}\r\n\r\n?>\r\n\r\n<div class=\"wrap\">\r\n\r\n<?php echo $successful; ?>\r\n\r\n<h2>theVerse Options</h2>\r\n\r\n<p>\r\nThis plugin rewrites (Quran 1:1-7) etc into the Surah name and links to iKnowledge.islamicnature.com. For \r\nexample if you write (Quran 1:1-7) (<b>curly brackets are necessary</b>), it will rewrite to Surah \r\nAl-Fatihah 1:1-7. You can either write Quran or quran and have a \":\" or \".\" in the code.\r\n</p>\r\n\r\n<form action=\"#\" method=\"post\">\r\n\r\n<b>Change Language:</b><br />\r\n<select style=\"width:190px;\" name=\"lang\">\r\n<option value=\"english\">Choose Language</option>\r\n<option value=\"albanianfeti\" <?php if(get_option('tvlang') == 'albanianfeti'){ echo \"selected='selected'\"; }?>>Albanian: Feti Mehdiu</option>\r\n<option value=\"albanianhasan\" <?php if(get_option('tvlang') == 'albanianhasan'){ echo \"selected='selected'\"; }?>>Albanian: Hasan Nahi</option>\r\n<option value=\"albaniansherif\" <?php if(get_option('tvlang') == 'albaniansherif'){ echo \"selected='selected'\"; }?>>Albanian: Sherif Ahmeti</option>\r\n<option value=\"azerbaijan\" <?php if(get_option('tvlang') == 'azerbaijan'){ echo \"selected='selected'\"; }?>>Azerbaijan</option>\r\n<option value=\"azerbaijanmusayev\" <?php if(get_option('tvlang') == 'azerbaijanmusayev'){ echo \"selected='selected'\"; }?>>Azerbaijan: Musayev</option>\r\n<option value=\"bangla\" <?php if(get_option('tvlang') == 'bangla'){ echo \"selected='selected'\"; }?>>Bangla</option>\r\n<option value=\"bosnian\" <?php if(get_option('tvlang') == 'bosnian'){ echo \"selected='selected'\"; }?>>Bosnian</option>\r\n<option value=\"bosniankorkut\" <?php if(get_option('tvlang') == 'bosniankorkut'){ echo \"selected='selected'\"; }?>>Bosnian: Korkut</option>\r\n<option value=\"bosnianmustafa\" <?php if(get_option('tvlang') == 'bosnianmustafa'){ echo \"selected='selected'\"; }?>>Bosnian: Mustafa</option>\r\n<option value=\"bulgarian\" <?php if(get_option('tvlang') == 'bulgarian'){ echo \"selected='selected'\"; }?>>Bulgarian</option>\r\n<option value=\"chinese\" <?php if(get_option('tvlang') == 'chinese'){ echo \"selected='selected'\"; }?>>Chinese</option>\r\n<option value=\"chinesesimp\" <?php if(get_option('tvlang') == 'chinesesimp'){ echo \"selected='selected'\"; }?>>Chinese: Simplified</option>\r\n<option value=\"czeckhrbek\" <?php if(get_option('tvlang') == 'czeckhrbek'){ echo \"selected='selected'\"; }?>>Czeck: Hrbek</option>\r\n<option value=\"czecknykl\" <?php if(get_option('tvlang') == 'czecknykl'){ echo \"selected='selected'\"; }?>>Czeck: Nykl</option>\r\n<option value=\"dutch\" <?php if(get_option('tvlang') == 'dutch'){ echo \"selected='selected'\"; }?>>Dutch</option>\r\n<option value=\"dutchkeyzer\" <?php if(get_option('tvlang') == 'dutchkeyzer'){ echo \"selected='selected'\"; }?>>Dutch: Keyzer</option>\r\n<option value=\"english\" <?php if(get_option('tvlang') == 'english'){ echo \"selected='selected'\"; }?>>English</option>\r\n<option value=\"englishliteral\" <?php if(get_option('tvlang') == 'englishliteral'){ echo \"selected='selected'\"; }?>>English: Literal</option>\r\n<option value=\"englishsahih\" <?php if(get_option('tvlang') == 'englishsahih'){ echo \"selected='selected'\"; }?>>English: Sahih International</option>\r\n<option value=\"englishtran\" <?php if(get_option('tvlang') == 'englishtran'){ echo \"selected='selected'\"; }?>>English: Transliteration</option>\r\n<option value=\"finnish\" <?php if(get_option('tvlang') == 'finnish'){ echo \"selected='selected'\"; }?>>Finnish</option>\r\n<option value=\"french\" <?php if(get_option('tvlang') == 'french'){ echo \"selected='selected'\"; }?>>French</option>\r\n<option value=\"frenchhamidullah\" <?php if(get_option('tvlang') == 'frenchhamidullah'){ echo \"selected='selected'\"; }?>>French: Hamidullah</option>\r\n<option value=\"german\" <?php if(get_option('tvlang') == 'german'){ echo \"selected='selected'\"; }?>>German</option>\r\n<option value=\"germanabubenheim\" <?php if(get_option('tvlang') == 'germanabubenheim'){ echo \"selected='selected'\"; }?>>German: Bubenheim - Elyas</option>\r\n<option value=\"germanaburida\" <?php if(get_option('tvlang') == 'germanaburida'){ echo \"selected='selected'\"; }?>>German: Abu-Rida Muhammad</option>\r\n<option value=\"germankhoury\" <?php if(get_option('tvlang') == 'germankhoury'){ echo \"selected='selected'\"; }?>>German: Khoury</option>\r\n<option value=\"germanzaidan\" <?php if(get_option('tvlang') == 'germanzaidan'){ echo \"selected='selected'\"; }?>>German: Zaidan</option>\r\n<option value=\"hausa\" <?php if(get_option('tvlang') == 'hausa'){ echo \"selected='selected'\"; }?>>Hausa</option>\r\n<option value=\"indonesian\" <?php if(get_option('tvlang') == 'indonesian'){ echo \"selected='selected'\"; }?>>Indonesian</option>\r\n<option value=\"indonesianbahasa\" <?php if(get_option('tvlang') == 'indonesianbahasa'){ echo \"selected='selected'\"; }?>>Indonesian: Bahasa</option>\r\n<option value=\"italian\" <?php if(get_option('tvlang') == 'italian'){ echo \"selected='selected'\"; }?>>Italian</option>\r\n<option value=\"italianpiccardo\" <?php if(get_option('tvlang') == 'italianpiccardo'){ echo \"selected='selected'\"; }?>>Italian: Piccardo</option>\r\n<option value=\"japanese\" <?php if(get_option('tvlang') == 'japanese'){ echo \"selected='selected'\"; }?>>Japanese</option>\r\n<option value=\"korean\" <?php if(get_option('tvlang') == 'korean'){ echo \"selected='selected'\"; }?>>Korean</option>\r\n<option value=\"kurdi\" <?php if(get_option('tvlang') == 'kurdi'){ echo \"selected='selected'\"; }?>>Kurdi</option>\r\n<option value=\"latin\" <?php if(get_option('tvlang') == 'latin'){ echo \"selected='selected'\"; }?>>Latin</option>\r\n<option value=\"malayalam\" <?php if(get_option('tvlang') == 'malayalam'){ echo \"selected='selected'\"; }?>>Malayalam</option>\r\n<option value=\"malaysian\" <?php if(get_option('tvlang') == 'malaysian'){ echo \"selected='selected'\"; }?>>Malaysian</option>\r\n<option value=\"maranao\" <?php if(get_option('tvlang') == 'maranao'){ echo \"selected='selected'\"; }?>>Maranao</option>\r\n<option value=\"mexican\" <?php if(get_option('tvlang') == 'mexican'){ echo \"selected='selected'\"; }?>>Mexican</option>\r\n<option value=\"norwegianeinar\" <?php if(get_option('tvlang') == 'norwegianeinar'){ echo \"selected='selected'\"; }?>>Norwegian: Einar Berg</option>\r\n<option value=\"persian\" <?php if(get_option('tvlang') == 'persian'){ echo \"selected='selected'\"; }?>>Persian</option>\r\n<option value=\"persianalha\" <?php if(get_option('tvlang') == 'persianalha'){ echo \"selected='selected'\"; }?>>Persian: &#1575;&#1604;&#1607;&#1740; &#1602;&#1605;&#1588;&#1607;&#8204; &#1575;&#1740;</option>\r\n<option value=\"persianhasin\" <?php if(get_option('tvlang') == 'persianhasin'){ echo \"selected='selected'\"; }?>>Persian: &#1581;&#1587;&#1740;&#1606; &#1575;&#1606;&#1589;&#1575;&#1585;&#1740;&#1575;&#1606;</option>\r\n<option value=\"persianmekaram\" <?php if(get_option('tvlang') == 'persianmekaram'){ echo \"selected='selected'\"; }?>>Persian: &#1605;&#1705;&#1575;&#1585;&#1605; &#1588;&#1740;&#1585;&#1575;&#1586;&#1740;</option>\r\n<option value=\"polish\" <?php if(get_option('tvlang') == 'polish'){ echo \"selected='selected'\"; }?>>Polish</option>\r\n<option value=\"polishbielawskiego\" <?php if(get_option('tvlang') == 'polishbielawskiego'){ echo \"selected='selected'\"; }?>>Polish: Bielawskiego</option>\r\n<option value=\"portuguese\" <?php if(get_option('tvlang') == 'portuguese'){ echo \"selected='selected'\"; }?>>Portuguese</option>\r\n<option value=\"portugueseelhayek\" <?php if(get_option('tvlang') == 'portugueseelhayek'){ echo \"selected='selected'\"; }?>>Portuguese: El-Hayek</option>\r\n<option value=\"romanian\" <?php if(get_option('tvlang') == 'romanian'){ echo \"selected='selected'\"; }?>>Romanian</option>\r\n<option value=\"romaniangeorge\" <?php if(get_option('tvlang') == 'romaniangeorge'){ echo \"selected='selected'\"; }?>>Romanian: George Grigore</option>\r\n<option value=\"russian\" <?php if(get_option('tvlang') == 'russian'){ echo \"selected='selected'\"; }?>>Russian</option>\r\n<option value=\"russianone\" <?php if(get_option('tvlang') == 'russianone'){ echo \"selected='selected'\"; }?>>Russian: &#1069;&#1083;&#1100;&#1084;&#1080;&#1088; &#1050;&#1091;&#1083;&#1080;&#1077;&#1074;</option>\r\n<option value=\"russianthree\" <?php if(get_option('tvlang') == 'russianthree'){ echo \"selected='selected'\"; }?>>Russian: &#1042;&#1072;&#1083;&#1077;&#1088;&#1080;&#1103; &#1055;&#1086;&#1088;&#1086;&#1093;&#1086;&#1074;&#1072;</option>\r\n<option value=\"russiantwo\" <?php if(get_option('tvlang') == 'russiantwo'){ echo \"selected='selected'\"; }?>>Russian: &#1052;.-&#1053;.&#1054;. &#1054;&#1089;&#1084;&#1072;&#1085;&#1086;&#1074;</option>\r\n<option value=\"somalialbarwani\" <?php if(get_option('tvlang') == 'somalialbarwani'){ echo \"selected='selected'\"; }?>>Somali: Al-Barwani</option>\r\n<option value=\"spanish\" <?php if(get_option('tvlang') == 'spanish'){ echo \"selected='selected'\"; }?>>Spanish</option>\r\n<option value=\"spanishcortes\" <?php if(get_option('tvlang') == 'spanishcortes'){ echo \"selected='selected'\"; }?>>Spanish: Cortes</option>\r\n<option value=\"swahili\" <?php if(get_option('tvlang') == 'swahili'){ echo \"selected='selected'\"; }?>>Swahili</option>\r\n<option value=\"swedishrashad\" <?php if(get_option('tvlang') == 'swedishrashad'){ echo \"selected='selected'\"; }?>>Swedish: Rashad Kalifa</option>\r\n<option value=\"tamil\" <?php if(get_option('tvlang') == 'tamil'){ echo \"selected='selected'\"; }?>>Tamil</option>\r\n<option value=\"tatar\" <?php if(get_option('tvlang') == 'tatar'){ echo \"selected='selected'\"; }?>>Tatar</option>\r\n<option value=\"thai\" <?php if(get_option('tvlang') == 'thai'){ echo \"selected='selected'\"; }?>>Thai</option>\r\n<option value=\"turkish\" <?php if(get_option('tvlang') == 'turkish'){ echo \"selected='selected'\"; }?>>Turkish</option>\r\n<option value=\"turkishalibulac\" <?php if(get_option('tvlang') == 'turkishalibulac'){ echo \"selected='selected'\"; }?>><?php echo htmlentities('Turkish: Ali Bulaç'); ?></option>\r\n<option value=\"turkishelmalili\" <?php if(get_option('tvlang') == 'turkishelmalili'){ echo \"selected='selected'\"; }?>>Turkish: Elmal&#305;l&#305; Hamdi Yaz&#305;r</option>\r\n<option value=\"turkishiskender\" <?php if(get_option('tvlang') == 'turkishiskender'){ echo \"selected='selected'\"; }?>>Turkish: &#304;skender Ali Mihr</option>\r\n<option value=\"turkishmuhammed\" <?php if(get_option('tvlang') == 'turkishmuhammed'){ echo \"selected='selected'\"; }?>>Turkish: Muhammed Esed</option>\r\n<option value=\"turkishyasar\" <?php if(get_option('tvlang') == 'turkishyasar'){ echo \"selected='selected'\"; }?>>Turkish: Ya&#351;ar Nuri <?php echo htmlentities('Öztürk'); ?></option>\r\n<option value=\"urduahmed\" <?php if(get_option('tvlang') == 'urduahmed'){ echo \"selected='selected'\"; }?>>Urdu: &#1575;&#1581;&#1605;&#1583; &#1585;&#1590;&#1575; &#1582;&#1575;&#1606;</option>\r\n<option value=\"urdujalandhry\" <?php if(get_option('tvlang') == 'urdujalandhry'){ echo \"selected='selected'\"; }?>>Urdu: &#1580;&#1575;&#1604;&#1606;&#1583;&#1729;&#1585;&#1740;</option>\r\n<option value=\"uzbek\" <?php if(get_option('tvlang') == 'uzbek'){ echo \"selected='selected'\"; }?>>Uzbek: &#1052;&#1091;&#1093;&#1072;&#1084;&#1084;&#1072;&#1076; &#1057;&#1086;&#1076;&#1080;&#1082;</option>\r\n</select>\r\n\r\n<p class=\"submit\">\r\n<input type=\"submit\" value=\"Save\" name=\"save\" />\r\n</p>\r\n</form>\r\n</div>\r\n\r\n<?php\r\n}", "function tp_the_language_selector_flags()\n{\n\techo tp_get_language_selector_flags();\n}", "function LUPE_option_combo_vet($Vet, $NomeCombo, $PreSelect, $LinhaFixa = ' ', $JS = '', $Style = '')\r\n{\r\n\r\n $numrows = count($Vet);\r\n\r\n $html = \"<select id='$NomeCombo' name='$NomeCombo' $JS style='$Style'>\\n\";\r\n\r\n\tif ($LinhaFixa != '')\r\n\t\t$html .= \"<option value=''>$LinhaFixa</option>\\n\";\r\n\r\n if ($numrows == 0) {\r\n\t\t$html .= \"<option value=''>Não há informação no sistema</option>\\n\";\r\n } else {\r\n\t ForEach($Vet as $Chave => $Valor ){\r\n \t\t $html .= \"<option value='$Chave'\";\r\n\r\n\t\t if ($PreSelect == $Chave)\r\n\t\t\t$html .= 'selected >';\r\n \t\t else\r\n\t\t\t$html .= '>';\r\n\r\n\t \t $html .= \"$Valor</option>\\n\";\r\n }\r\n }\r\n\r\n $html .= '</select>';\r\n\r\n return $html;\r\n}", "function locale_variable_options_language($variable, $options) {\n return locale_language_list('name', TRUE);\n}", "public function getOptions() {\n\t\tif ($this->row->options != '') {\n\t\t\t$options = explode(\";\", $this->row->options);\n\t\t}\n\t\tif ($this->row->intoptions != '') {\n\t\t\t$intoptions = explode(\";\", $this->row->intoptions);\n\t\t\t$options_map = array_combine($intoptions, $options);\n\t\t}\n\t\tif ($options) {\n\t\t\t$msg = \"Predefined Options:\\n\";\n\t\t\tif ($intoptions) {\n\t\t\t\tforeach ($options_map as $key => $label) {\n\t\t\t\t\t$save_link = $this->text->makeChatcmd('Select', \"/tell <myname> settings save {$this->row->name} {$key}\");\n\t\t\t\t\t$msg .= \"<tab> <highlight>{$label}<end> ({$save_link})\\n\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tforeach ($options as $char) {\n\t\t\t\t\t$save_link = $this->text->makeChatcmd('Select', \"/tell <myname> settings save {$this->row->name} {$char}\");\n\t\t\t\t\t$msg .= \"<tab> <highlight>{$char}<end> ({$save_link})\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $msg;\n\t}", "public function create_db_options_field() {\n\n\t\t\tif ( ! $this->is_db_options_exist( $this->options_slug ) ) {\n\t\t\t\t$this->save_options( $this->options_slug, $this->default_options );\n\t\t\t}\n\n\t\t\tif ( ! $this->is_db_options_exist( $this->options_slug . '_default' ) ) {\n\t\t\t\t$this->save_options( $this->options_slug . '_default', $this->default_options );\n\t\t\t}\n\t\t}", "function propanel_siteoptions_machine($options) {\n \n $counter = 0;\n\t$menu = '';\n\t$output = '';\n\tforeach ($options as $value) {\n\t \n\t\t$counter++;\n\t\t$val = '';\n\t\t//Start Heading\n\t\t if ( $value['type'] != \"heading\" )\n\t\t {\n\t\t \t$class = ''; if(isset( $value['class'] )) { $class = $value['class']; }\n\t\t\t//$output .= '<div class=\"section section-'. $value['type'] .'\">'.\"\\n\".'<div class=\"option-inner\">'.\"\\n\";\n\t\t\t$output .= '<div class=\"section section-'.$value['type'].' '. $class .'\">'.\"\\n\";\n\t\t\t$output .= '<h4 class=\"heading\">'. $value['name'] .'</h3>'.\"\\n\";\n\t\t\t$output .= '<div class=\"option\">'.\"\\n\" . '<div class=\"controls\">'.\"\\n\";\n\n\t\t } \n\t\t //End Heading\n\t\t$select_value = ''; \n\t\tswitch ( $value['type'] ) {\n\t\t\n\t\tcase 'text':\n\t\t\t$val = $value['std'];\n\t\t\t$std = get_option($value['id']);\n\t\t\tif ( $std != \"\") { $val = $std; }\n\t\t\t$output .= '<input class=\"of-input\" name=\"'. $value['id'] .'\" id=\"'. $value['id'] .'\" type=\"'. $value['type'] .'\" value=\"'. $val .'\" />';\n\t\tbreak;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tcase 'select':\n\n\t\t\t$output .= '<select class=\"of-input\" name=\"'. $value['id'] .'\" id=\"'. $value['id'] .'\">';\n\t\t\n\t\t\t$select_value = get_option($value['id']);\n\t\t\t \n\t\t\tforeach ($value['options'] as $option) {\n\t\t\t\t\n\t\t\t\t$selected = '';\n\t\t\t\t\n\t\t\t\t if($select_value != '') {\n\t\t\t\t\t if ( $select_value == $option) { $selected = ' selected=\"selected\"';} \n\t\t\t } else {\n\t\t\t\t\t if ( isset($value['std']) )\n\t\t\t\t\t\t if ($value['std'] == $option) { $selected = ' selected=\"selected\"'; }\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t $output .= '<option'. $selected .'>';\n\t\t\t\t $output .= $option;\n\t\t\t\t $output .= '</option>';\n\t\t\t \n\t\t\t } \n\t\t\t $output .= '</select>';\n\n\t\t\t\n\t\tbreak;\n\t\t\n\t\t\n\t\t\n\t\t//@since 2.0 added by denzel to allow value different from label.\n\t\tcase 'select-advance':\n\n\t\t\t$output .= '<select class=\"of-input\" name=\"'. $value['id'] .'\" id=\"'. $value['id'] .'\">';\n\t\t\n\t\t\t$select_value = get_option($value['id']);\n\t\t\t \n\t\t\tforeach ($value['options'] as $key => $option) {\n\t\t\t\t\n\t\t\t\t$selected = '';\n\t\t\t\t\n\t\t\t\t if($select_value != '') {\n\t\t\t\t\t if ( $select_value == $key) { $selected = ' selected=\"selected\"';} \n\t\t\t } else {\n\t\t\t\t\t if ( isset($value['std']) )\n\t\t\t\t\t\t if ($value['std'] == $key) { $selected = ' selected=\"selected\"'; }\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t $output .= '<option value=\"'. $key .'\" '. $selected .'>';\n\t\t\t\t $output .= $option;\n\t\t\t\t $output .= '</option>';\n\t\t\t \n\t\t\t } \n\t\t\t $output .= '</select>';\n\n\t\t\t\n\t\tbreak;\t\t\n\t\t\n\t\t\n\t\t\n\t\tcase 'fontsize':\n\t\t\n\t\t/* Font Size */\n\t\t\t$val = $default['size'];\n\t\t\tif ( $typography_stored['size'] != \"\") { $val = $typography_stored['size']; }\n\t\t\t$output .= '<select class=\"of-typography of-typography-size\" name=\"'. $value['id'].'_size\" id=\"'. $value['id'].'_size\">';\n\t\t\t\tfor ($i = 9; $i < 71; $i++){ \n\t\t\t\t\tif($val == $i){ $active = 'selected=\"selected\"'; } else { $active = ''; }\n\t\t\t\t\t$output .= '<option value=\"'. $i .'\" ' . $active . '>'. $i .'px</option>'; }\n\t\t\t$output .= '</select>';\n\t\t\n\t\t\n\t\tbreak;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tcase \"multicheck\":\n\t\t\n\t\t\t$std = $value['std']; \n\t\t\t\n\t\t\tforeach ($value['options'] as $key => $option) {\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t$tt_key = $value['id'] . '_' . $key;\n\t\t\t$saved_std = get_option($tt_key);\n\t\t\t\t\t\n\t\t\tif(!empty($saved_std)) \n\t\t\t{ \n\t\t\t\t if($saved_std == 'true'){\n\t\t\t\t\t $checked = 'checked=\"checked\"'; \n\t\t\t\t } \n\t\t\t\t else{\n\t\t\t\t\t $checked = ''; \n\t\t\t\t } \n\t\t\t} \n\t\t\telseif( $std == $key) {\n\t\t\t $checked = 'checked=\"checked\"';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$checked = ''; }\n\t\t\t$output .= '<input type=\"checkbox\" class=\"checkbox of-input\" name=\"'. $tt_key .'\" id=\"'. $tt_key .'\" value=\"true\" '. $checked .' /><label for=\"'. $tt_key .'\">'. $option .'</label><br />';\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\tbreak;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tcase 'textarea':\n\t\t\t\n\t\t\t$cols = '8';\n\t\t\t$ta_value = '';\n\t\t\t\n\t\t\tif(isset($value['std'])) {\n\t\t\t\t\n\t\t\t\t$ta_value = $value['std']; \n\t\t\t\t\n\t\t\t\tif(isset($value['options'])){\n\t\t\t\t\t$ta_options = $value['options'];\n\t\t\t\t\tif(isset($ta_options['cols'])){\n\t\t\t\t\t$cols = $ta_options['cols'];\n\t\t\t\t\t} else { $cols = '8'; }\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\t$std = get_option($value['id']);\n\t\t\t\tif( $std != \"\") { $ta_value = stripslashes( $std ); }\n\t\t\t\t$output .= '<textarea class=\"of-input\" name=\"'. $value['id'] .'\" id=\"'. $value['id'] .'\" cols=\"'. $cols .'\" rows=\"8\">'.$ta_value.'</textarea>';\n\t\t\t\n\t\t\t\n\t\tbreak;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tcase \"radio\":\n\t\t\t\n\t\t\t $select_value = get_option( $value['id']);\n\t\t\t\t \n\t\t\t foreach ($value['options'] as $key => $option) \n\t\t\t { \n\n\t\t\t\t $checked = '';\n\t\t\t\t if($select_value != '') {\n\t\t\t\t\t\tif ( $select_value == $key) { $checked = ' checked'; } \n\t\t\t\t } else {\n\t\t\t\t\tif ($value['std'] == $key) { $checked = ' checked'; }\n\t\t\t\t }\n\t\t\t\t$output .= '<input class=\"of-input of-radio\" type=\"radio\" name=\"'. $value['id'] .'\" value=\"'. $key .'\" '. $checked .' />' . $option .'<br />';\n\t\t\t\n\t\t\t}\n\t\t\t \n\t\tbreak;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tcase \"checkbox\": \n\t\t\n\t\t $std = $value['std']; \n\t\t \n\t\t $saved_std = get_option($value['id']);\n\t\t \n\t\t $checked = '';\n\t\t\t\n\t\t\tif(!empty($saved_std)) {\n\t\t\t\tif($saved_std == 'true') {\n\t\t\t\t$checked = 'checked=\"checked\"';\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t $checked = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif( $std == 'true') {\n\t\t\t $checked = 'checked=\"checked\"';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$checked = '';\n\t\t\t}\n\t\t\t$output .= '<input type=\"checkbox\" class=\"checkbox of-input\" name=\"'. $value['id'] .'\" id=\"'. $value['id'] .'\" value=\"true\" '. $checked .' />';\n\n\t\tbreak;\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tcase \"upload\":\n\t\t\t\n\t\t\t$output .= propanel_siteoptions_uploader_function($value['id'],$value['std'],null);\n\t\t\t\n\t\tbreak;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tcase \"upload_min\":\n\t\t\t\n\t\t\t$output .= propanel_siteoptions_uploader_function($value['id'],$value['std'],'min');\n\t\t\t\n\t\tbreak;\n\t\tcase \"color\":\n\t\t\t$val = $value['std'];\n\t\t\t$stored = get_option( $value['id'] );\n\t\t\tif ( $stored != \"\") { $val = $stored; }\n\t\t\t$output .= '<div id=\"' . $value['id'] . '_picker\" class=\"colorSelector\"><div></div></div>';\n\t\t\t$output .= '<input class=\"of-color\" name=\"'. $value['id'] .'\" id=\"'. $value['id'] .'\" type=\"text\" value=\"'. $val .'\" />';\n\t\tbreak; \n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t \n\t\t\n\t\tcase \"images\":\n\t\t\t$i = 0;\n\t\t\t$select_value = get_option( $value['id']);\n\t\t\t\t \n\t\t\tforeach ($value['options'] as $key => $option) \n\t\t\t { \n\t\t\t $i++;\n\n\t\t\t\t $checked = '';\n\t\t\t\t $selected = '';\n\t\t\t\t if($select_value != '') {\n\t\t\t\t\t\tif ( $select_value == $key) { $checked = ' checked'; $selected = 'of-radio-img-selected'; } \n\t\t\t\t } else {\n\t\t\t\t\t\tif ($value['std'] == $key) { $checked = ' checked'; $selected = 'of-radio-img-selected'; }\n\t\t\t\t\t\telseif ($i == 1 && !isset($select_value)) { $checked = ' checked'; $selected = 'of-radio-img-selected'; }\n\t\t\t\t\t\telseif ($i == 1 && $value['std'] == '') { $checked = ' checked'; $selected = 'of-radio-img-selected'; }\n\t\t\t\t\t\telse { $checked = ''; }\n\t\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t$output .= '<span>';\n\t\t\t\t$output .= '<input type=\"radio\" id=\"of-radio-img-' . $value['id'] . $i . '\" class=\"checkbox of-radio-img-radio\" value=\"'.$key.'\" name=\"'. $value['id'].'\" '.$checked.' />';\n\t\t\t\t$output .= '<div class=\"of-radio-img-label\">'. $key .'</div>';\n\t\t\t\t$output .= '<img src=\"'.$option.'\" alt=\"\" class=\"of-radio-img-img '. $selected .'\" onClick=\"document.getElementById(\\'of-radio-img-'. $value['id'] . $i.'\\').checked = true;\" />';\n\t\t\t\t$output .= '</span>';\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\tbreak; \n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tcase \"info\":\n\t\t\t$default = $value['std'];\n\t\t\t$output .= $default;\n\t\tbreak;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n\t \n\t\t\n\t\tcase \"heading\":\n\t\t\t\n\t\t\tif($counter >= 2){\n\t\t\t $output .= '</div>'.\"\\n\";\n\t\t\t}\n\t\t\t$jquery_click_hook = ereg_replace(\"[^A-Za-z0-9]\", \"\", strtolower($value['name']) );\n\t\t\t$jquery_click_hook = \"of-option-\" . $jquery_click_hook;\n\t\t\t$menu .= '<li><a title=\"'. $value['name'] .'\" href=\"#'. $jquery_click_hook .'\">'. $value['name'] .'</a></li>';\n\t\t\t$output .= '<div class=\"group\" id=\"'. $jquery_click_hook .'\"><h2>'.$value['name'].'</h2>'.\"\\n\";\n\t\tbreak; \n\t\t} \n\t\t\n\t\t// if TYPE is an array, formatted into smaller inputs... ie smaller values\n\t\tif ( is_array($value['type'])) {\n\t\t\tforeach($value['type'] as $array){\n\t\t\t\n\t\t\t\t\t$id = $array['id']; \n\t\t\t\t\t$std = $array['std'];\n\t\t\t\t\t$saved_std = get_option($id);\n\t\t\t\t\tif($saved_std != $std){$std = $saved_std;} \n\t\t\t\t\t$meta = $array['meta'];\n\t\t\t\t\t\n\t\t\t\t\tif($array['type'] == 'text') { // Only text at this point\n\t\t\t\t\t\t \n\t\t\t\t\t\t $output .= '<input class=\"input-text-small of-input\" name=\"'. $id .'\" id=\"'. $id .'\" type=\"text\" value=\"'. $std .'\" />'; \n\t\t\t\t\t\t $output .= '<span class=\"meta-two\">'.$meta.'</span>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t\tif ( $value['type'] != \"heading\" ) { \n\t\t\tif ( $value['type'] != \"checkbox\" ) \n\t\t\t\t{ \n\t\t\t\t$output .= '<br/>';\n\t\t\t\t}\n\t\t\tif(!isset($value['desc'])){ $explain_value = ''; } else{ $explain_value = $value['desc']; } \n\t\t\t$output .= '</div><div class=\"explain\">'. $explain_value .'</div>'.\"\\n\";\n\t\t\t$output .= '<div class=\"clear\"> </div></div></div>'.\"\\n\";\n\t\t\t}\n\t \n\t}\n $output .= '</div>';\n return array($output,$menu);\n\n}", "abstract function builder_form(): string;", "function options_form() {\n return array(\n );\n }", "function db_enum($_table,$_field,$_type=\"select\",$_pick=null,$_isnull=null,$_style=NULL) {\n\t$_render = \"\";\n\t$_result = mysql_query(\"describe $_table $_field\");\n $_row = mysql_fetch_array($_result); \n $_value = $_row[\"Type\"];\n\tmysql_free_result($_result);\n preg_match_all(\"/'([^']+)'/\", $_value, $_matches, PREG_SET_ORDER); \n\t$_count = count($_matches);\n\t\t\n\tif ($_type == \"array\") {\t\n\t\tforeach($_matches as $_v) {\t\n\t\t\t$_render[$_v[1]] = $_v[1];\t\t\t\n\t\t\t}\n\t\t} \n\telseif ($_type == \"checkbox\") {\n\t\tforeach($_matches as $_v) {\t\n\t\t\t$_render .= '<input type=\"checkbox\" name=\"'.$_field.'[]\" value=\"'.$_v[1].'\" id=\"'.$_field.'_'.$_v[1].'\"';\n\t\t\tif ($_v[1] == $_pick) { $_render .= ' checked'; }\t\t\n\t\t\t$_render .= ' /><label for=\"'.$_field.'_'.$_v[1].'\" class=\"checkbox\">'.$_v[1].'</label>\n\t\t\t'; \n\t\t\t\n\t\t\t}\n\t\t} \n\telseif ($_type == \"radio\") {\n\t\tforeach($_matches as $_v) {\t\n\t\t\t$_render .= '<input type=\"radio\" name=\"'.$_field.'\" value=\"'.$_v[1].'\" id=\"'.$_field.'_'.$_v[1].'\"';\n\t\t\tif ($_v[1] == $_pick) { $_render .= ' checked'; }\n\t\t\t$_render .= ' /><label for=\"'.$_field.'_'.$_v[1].'\" class=\"radio\">'.$_v[1].' </label>\n\t\t\t';\t\t\t\n\t\t\t}\n\t\t} \n\telseif ($_type == \"select\") {\n\t\t// insert a blank option (or allow blank option is no option is previously select)\n\t\tif ($_isnull && !isset($_pick)) {\n\t\t\t$_render .= '<option value=\"\"></option>\n\t\t\t';\n\t\t\t}\n\t\tforeach($_matches as $_v) {\t\n\t\t\t$_render .= '<option value=\"'.$_v[1].'\"';\n\t\t\tif ($_v[1] == $_pick) { $_render .= ' selected'; }\n\t\t\t$_render .= '>'.$_v[1].'</option>\n\t\t\t'; \n\t\t\t}\n\t\t$_render = '<select name=\"'.$_field.'\" '.$_style.'>'.$_render.'</select>\n\t\t';\n\t\t}\n\t\n\treturn $_render;\n\tunset($_table,$_where,$_query,$_result,$_row,$_v,$_value,$_matches,$_render,$_count,$_isnull);\n\t}", "function cmdMarital($name, $caption) {\n $optmarital = array\n (\n array(\"\", \"\"),\n array(\"Single\", \"1\"),\n array(\"Married\", \"2\"),\n );\n ?>\n <tr>\n <td><?php getCaption($caption); ?> :</td>\n <td>\n <select class=\"easyui-combobox\"\n id=\"<?php echo $name; ?>\"\n name=\"<?php echo $name; ?>\"\n style=\"width:120px;\"\n data-options=\"panelHeight:100,editable:false,width:200\"\n disabled=true\n >\n <?php\n foreach ($optmarital as $val) {\n echo '<option value=\"' . $val[1] . '\">' . $val[0] . '</option>';\n }\n ?>\n </select>\n </td>\n </tr>\n <?php\n}", "private function build_factory_meta_textarea_field($_meta, $_ptype = \"wccpf\") {\r\n \t$html = '';\r\n \t$value = \"\";\r\n \tif ($this->fields_values && $this->fields_values[$_meta[\"param\"]]) {\r\n \t\t$value = $this->fields_values[$_meta[\"param\"]];\r\n \t}\r\n \tif ($_meta[\"param\"] == \"choices\" && ($_meta[\"ftype\"] == \"radio\" || $_meta[\"ftype\"] == \"checkbox\" || $_meta[\"ftype\"] == \"select\")) {\r\n \t\t$html = '<table class=\"wcff-choice-factory-container\">';\r\n \t\t$html .= '<tr>';\r\n \t\t$html .= '<td class=\"field\">';\r\n \t\t$html .= '<textarea name=\"wcff-field-type-meta-' . $_meta[\"param\"] . '\" class=\"wcff-field-type-meta-' . $_meta[\"param\"] . '\" class=\"wcff-choices-textarea\" placeholder=\"' . $_meta[\"placeholder\"] . '\" rows=\"' . $_meta[\"rows\"] . '\"></textarea>';\r\n \t\t$html .= '</td>';\r\n \t\t$html .= '<td class=\"factory\">';\r\n \t\t\r\n \t\t$html .= '<input type=\"text\" class=\"wcff-option-value-text\" placeholder=\"Type the Value\" />';\r\n \t\t$html .= '<input type=\"text\" class=\"wcff-option-label-text\" placeholder=\"Type the Label\" />';\r\n \t\t$html .= '<button class=\"wcff-add-opt-btn\" data-target=\"wcff-field-type-meta-' . $_meta[\"param\"] . '\" data-target-param=\"' . $_meta[\"param\"] . '\" data-ftype=\"' . $_meta[\"ftype\"] . '\">Add Option</button>';\r\n \t\t\r\n \t\t$html .= '</td>';\r\n \t\t$html .= '</tr>';\r\n \t\t$html .= '</table>';\r\n \t} else {\r\n \t\t$html = '<textarea name=\"wcff-field-type-meta-' . $_meta[\"param\"] . '\" class=\"wcff-field-type-meta-' . $_meta[\"param\"] . '\" placeholder=\"' . $_meta[\"placeholder\"] . '\" rows=\"' . $_meta[\"rows\"] . '\">'. $value .'</textarea>';\r\n \t}\r\n \treturn $html;\r\n }", "function signup_get_available_languages()\n {\n }", "private function sql_select_addLL_langOl()\n {\n // get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Load TCA\n $this->pObj->objZz->loadTCA( $table );\n\n // Get language overlay appendix\n $lang_ol = $this->pObj->objLocalise->conf_localisation[ 'TCA.' ][ 'field.' ][ 'appendix' ];\n\n // Label of the field for language overlay\n $field_lang_ol = $field . $lang_ol;\n\n // RETURN no field for language overlay\n if ( !isset( $GLOBALS[ 'TCA' ][ $table ][ 'columns' ][ $field_lang_ol ] ) )\n {\n // DRS\n if ( $this->pObj->b_drs_filter || $this->pObj->b_drs_sql || $this->pObj->b_drs_localisation )\n {\n $prompt = $table . ' isn\\'t a localised foreignTable: ' .\n 'TCA.' . $table . 'columns.' . $field_lang_ol . ' is missing.';\n t3lib_div::devlog( '[INFO/FILTER+SQL+LOCALISATION] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS\n return;\n }\n // RETURN no field for language overlay\n // addSelect\n $tableField_ol = $table . '.' . $field_lang_ol;\n $addSelect = \", \" . $tableField_ol . \" AS '\" . $tableField_ol . \"'\";\n // addSelect\n // Add field to the class var sql_filterFields\n $this->sql_filterFields[ $this->curr_tableField ][ 'lang_ol' ] = $tableField_ol;\n\n // DRS\n if ( $this->pObj->b_drs_filter || $this->pObj->b_drs_sql || $this->pObj->b_drs_localisation )\n {\n $prompt = $table . ' is a localised foreignTable. SELECT is localised.';\n t3lib_div::devlog( '[INFO/FILTER+SQL+LOCALISATION] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS\n // RETURN addSelect\n return $addSelect;\n }" ]
[ "0.67762476", "0.6599064", "0.6542721", "0.6469", "0.6460088", "0.63754576", "0.6374619", "0.6368849", "0.6313687", "0.6293171", "0.6236793", "0.6228412", "0.6206468", "0.6180682", "0.61668485", "0.6144096", "0.6072161", "0.6069186", "0.59784216", "0.5964569", "0.59241384", "0.5916475", "0.59160906", "0.5911057", "0.58938843", "0.58863163", "0.5867658", "0.5864936", "0.5845084", "0.5843198", "0.5841656", "0.5833694", "0.58302134", "0.5820566", "0.5819547", "0.58163846", "0.5809299", "0.5784685", "0.5774189", "0.57728887", "0.5772215", "0.5771789", "0.5757284", "0.5750044", "0.57489663", "0.57458746", "0.5739354", "0.57371837", "0.573478", "0.5733773", "0.5728687", "0.57163805", "0.5713505", "0.57039535", "0.56990707", "0.56802225", "0.56791705", "0.5669258", "0.5668016", "0.56655806", "0.5640265", "0.5635428", "0.5635266", "0.563467", "0.5632434", "0.56222117", "0.5617881", "0.5617316", "0.56152207", "0.5612717", "0.560882", "0.560882", "0.5600508", "0.55933356", "0.5589239", "0.55839205", "0.5579808", "0.55794513", "0.5579361", "0.5577691", "0.55761176", "0.5575085", "0.55722773", "0.55666363", "0.5564016", "0.55616087", "0.55542666", "0.5543882", "0.5537292", "0.5528603", "0.5519693", "0.55194867", "0.5518118", "0.55171764", "0.5515748", "0.55111605", "0.55073476", "0.5506581", "0.5503599", "0.5501465", "0.54990214" ]
0.0
-1
Pick a template/theme combo,
function style_select($default = '', $all = false) { global $db; $sql_where = (!$all) ? 'WHERE style_active = 1 ' : ''; $sql = 'SELECT style_id, style_name FROM ' . STYLES_TABLE . " $sql_where ORDER BY style_name"; $result = $db->sql_query($sql); $style_options = ''; while ($row = $db->sql_fetchrow($result)) { $selected = ($row['style_id'] == $default) ? ' selected="selected"' : ''; $style_options .= '<option value="' . $row['style_id'] . '"' . $selected . '>' . $row['style_name'] . '</option>'; } $db->sql_freeresult($result); return $style_options; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rc_tc_template_chooser( $template ) {\r\n \r\n // Post ID\r\n $post_id = get_the_ID();\r\n $post_type = get_post_type( $post_id );\r\n echo ('<!-- Have Post Type ' . __( $post_type, 'nmmc' ) . '-->' );\r\n // For all other CPT\r\n if ( $post_type != 'nsbr' && $post_type !='ydd' ) {\r\n echo ('<!-- Unknown Type returning ' . __( $template, 'nmmc' ) . '-->' );\r\n return $template;\r\n }\r\n \r\n // Else use custom template\r\n if ( is_single() ) {\r\n echo ('<!-- Is Single returning ' . __( 'single-'.$post_type, 'nmmc' ) . '-->' );\r\n return rc_tc_get_template_hierarchy( 'single-'.$post_type);\r\n }else{\r\n return rc_tc_get_template_hierarchy( 'category-'.$post_type);\r\n }\r\n echo ('<!-- Returning nothing -->' );\r\n return $template;\r\n}", "function mm_template_chooser( $template ) {\n global $wp_query;\n $post_type = get_query_var('post_type');\n if ( $wp_query->is_search && $post_type == 'photos' ) {\n return locate_template('search-photos.php');\n } elseif ( is_tax( 'albums' ) || is_tax( 'keywords' ) ) {\n $template = get_query_template( 'archive-photos' );\n }\n return $template;\n}", "function dg_choose_template( $template ) {\n\n\tif ( !is_admin() && is_home() ) {\n\t\t\n\t\t$new_template = locate_template( array( 'single.php' ) );\n\t\t\n\t\tif ( !empty( $new_template ) ) {\n\t\t\treturn $new_template;\n\t\t}\n\t}\n\n\treturn $template;\n}", "function throwThemesSelect( $sFileCurrent = null, $bProduct = null ){\n global $config;\n\n $sDefault = isset( $bProduct ) ? $config['default_products_template'] : $config['default_pages_template'];\n \n foreach( new DirectoryIterator( DIR_TEMPLATES.$GLOBALS['config']['skin'] ) as $oFileDir ){\n $sFileName = $oFileDir->getFilename( );\n if( $oFileDir->isFile( ) && strstr( $sFileName, '.php' ) && $sFileName[0] != '_' ){\n if( $sFileCurrent == $sFileName )\n $bFound = true;\n $aFiles[] = $sFileName;\n }\n } // end foreach\n\n if( empty( $sFileCurrent ) || !isset( $bFound ) ){\n $sFileCurrent = $sDefault;\n }\n\n if( isset( $aFiles ) ){\n $content = null;\n sort( $aFiles );\n $iCount = count( $aFiles );\n for( $i = 0; $i < $iCount; $i++ ){\n $sSelected = ( $sFileCurrent == $aFiles[$i] ) ? ' selected=\"selected\"' : null;\n $sValue = ( $aFiles[$i] == $sDefault ) ? null : $aFiles[$i];\n\n $content .= '<option value=\"'.$sValue.'\"'.$sSelected.'>'.$aFiles[$i].'</option>';\n } // end for\n\n return $content;\n }\n}", "function page_template_dropdown($default_template = '', $post_type = 'page')\n {\n }", "function Template()\r\n\t{\t\t\r\n\t\tglobal $_REQUEST;\t\t\r\n\t\t$theme = $this->theme;\r\n\t\t/*** Get Template By Page Id ***/\r\n\t\t$file = $this->get_template();\r\n\t\t\r\n\t\tif($_SETTINGS['debug'] == 1){\r\n\t\t\techo \"TEMPLATE: \".$file.\" <Br>\";\r\n\t\t}\r\n\t\t\r\n\t\t$websitepath = $this->website_path;\r\n\t\t//die(\"FILE: $file\");\r\n\t\t//exit();\r\n\t\tinclude''.$_SERVER['DOCUMENT_ROOT'].$websitepath.'themes/'.$theme.''.$file.'';\r\n\t}", "function template_select($name = 'tmpl', $selected = null) {\n echo '<select name=\"'.$name.'\">';\n foreach (array('default', 'lite') as $tmpl) {\n // Print the option\n echo '<option value=\"'.html_entities($tmpl).'\"';\n if ($selected == $tmpl)\n echo ' SELECTED';\n echo '>'.html_entities(str_replace('_', ' ', $tmpl)).'</option>';\n }\n echo '</select>';\n }", "function getThemesSelect( $iThemeSelect ){\n global $config;\n\n $content = null;\n foreach( $config['themes'] as $iTheme => $aData ){\n $content .= '<option value=\"'.$iTheme.'\"'.( ( $iTheme == $iThemeSelect ) ? ' selected=\"selected\"' : null ).'>'.$aData[3].'</option>';\n } // end foreach\n return $content;\n}", "function setTemplate($template);", "function template_chooser($template) \n{ \n global $wp_query; \n $post_type = get_query_var('post_type'); \n if( $wp_query->is_search && $post_type == 'formation_post' ) \n {\n return locate_template('recherche-formation.php'); // redirect to recherche-formation.php\n } \n return $template; \n}", "function getTemplate();", "function selectTheme($title=0) { \n \n if (seclevel('THEMSEL_',$this->userLevelID)) {\n\t\n $theme = GetGlobal('theme');\n $thema = GetGlobal('thema');\n $thisname = seturl(\"\"); \t \n\n $themespath = paramload('SHELL','prpath') . $theme['path'];\n $themesdir = dir($themespath); //get directory path\n $dmeter=0;\n $themes = array(); \n \n //parse theme directory\n while ($filename = $themesdir->read ()) {\n \n if (stristr ($filename,'.theme')) {\n\t $mytheme = str_replace (\".theme\", \"\", $filename); \n $themes[] = $mytheme;\t\t\n\t $dmeter += 1; \n\t } \n }\n if (!$dmeter) { if (paramload('SHELL','debug')) echo \"no directories\"; }\n\t \n $themesdir->close ();\n \n if ($dmeter) { \n reset ($themes);\n asort ($themes);\n\n //print theme selection list\n $toprint .= \"<form action=\\\"$thisname\\\" method=\\\"POST\\\" class=\\\"thin\\\">\";\n if ($title) $toprint .= \"<b>\" . localize('_THEME',getlocal()) . \" :</b>\";\n\t $toprint .= \"<select name=\\\"themesel\\\">\\n\";\n\n //read theme array \n //while (list ($theme_num, $theme_descr) = each ($themes)) {\n foreach ($themes as $theme_num => $theme_descr) {\t\n\t if ($theme_descr == $thema) $sel = \"selected\"; else $sel = \"\";\n $toprint .= \"<OPTION $sel value=\\\"$theme_descr\\\">$theme_descr</OPTION>\\n\";\n }\n\t \n $toprint .= $this->submit_button ;//\"<input type=\\\"submit\\\" value=\\\"Ok\\\">\";\n $toprint .= \"<input type=\\\"hidden\\\" name=\\\"FormAction\\\" value=\\\"theme\\\">\";\t\n\t $toprint .= \"</form>\\n\";\n }\n else {\n $toprint = \"No Themes\"; \n }\n \n return ($toprint);\n\t }\n }", "function create_selection_list_themes($theme = null, $no_rely = false, $show_everything = false, $default_message_string = 'RELY_FORUMS')\n{\n if (!$no_rely) {\n $entries = form_input_list_entry('-1', false, do_lang_tempcode($default_message_string));\n } else {\n $entries = new Tempcode();\n }\n $themes = find_all_themes();\n foreach ($themes as $_theme => $title) {\n if (($show_everything) || (has_category_access(get_member(), 'theme', $_theme))) {\n $selected = ($theme == $_theme);\n $entries->attach(form_input_list_entry($_theme, $selected, $title));\n }\n }\n if ($entries->is_empty()) {\n $entries->attach(form_input_list_entry('default', false, $themes['default']));\n }\n return $entries;\n}", "public function chooseTemplate()\n\t{\n\t\tif (!$this->system->user->hasAdminPermissions('data_sets', 'create_data_set')) {\n\t\t\treturn Redirect::route('admin.data-sets');\n\t\t}\n\t\tif ($this->input) {\n\t\t\t$validation = Validator::make(\n\t\t\t\t$this->input,\n\t\t\t\tarray(\n\t\t\t\t\t'data_set_template' => 'required|not_in:0',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'data_set_template.required' => 'You need to choose a Data Set Template to use for this Data Set.',\n\t\t\t\t\t'data_set_template.not_in' => 'You need to choose a Data Set Template to use for this Data Set.',\n\t\t\t\t)\n\t\t\t);\n\t\t\tif ($validation->passes()) {\n\t\t\t\treturn Redirect::route('admin.data-sets.create', $this->input['data_set_template']);\n\t\t\t}\n\t\t\t$this->system->messages->add($validation->messages()->toArray());\n\t\t}\n\t\t$data_set_templates = array();\n\t\tforeach (DataSetTemplatesRepository::retrieve() as $data_set_template) {\n\t\t\t$data_set_templates[$data_set_template->ID()] = $data_set_template->name();\n\t\t}\n\t\t$data_set_templates = array(0 => 'Choose template...') + $data_set_templates;\n\t\t$messages = $this->system->messages->get();\n\t\treturn View::make(\n\t\t\t'data::data_sets.choose',\n\t\t\tcompact('messages', 'data_set_templates')\n\t\t);\n\t}", "abstract public function getTemplate();", "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}", "private function setTemplate(){\n if (isset($this->data['template']) && !empty($this->data['template'])){\n $template = APP_ROOT.'/app/templates/'.trim($this->data['template']).'.tpl';\n if (file_exists($template)){\n $this->template = $template;\n return;\n }\n }\n //default\n $this->template = APP_ROOT.'/app/templates/default.tpl';\n }", "function _preview_theme_template_filter()\n {\n }", "function locate_template( $template, $template_name, $template_path ){\r\n\r\n\t\tswitch( $template_name ){\r\n\r\n\t\t\tcase 'form-fields/term-checklist-field.php':\r\n\t\t\t\twp_enqueue_script( 'jmfe-term-checklist-field' );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tif( file_exists( WPJM_FIELD_EDITOR_PLUGIN_DIR . '/templates/' . $template_name ) ){\r\n\t\t\t\t\t$template = WPJM_FIELD_EDITOR_PLUGIN_DIR . '/templates/' . $template_name;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn $template;\r\n\t}", "function getWidget() {\n // just override the template being used.\n $bHasErrors = false; \n if (count($this->aErrors) != 0) { $bHasErrors = true; }\n\n // at this last moment we pick the template to use \n $total = count($this->aVocab);\n if ($this->bUseSimple === true) {\n $this->sTemplate = 'ktcore/forms/widgets/simple_selection'; \n } else if ($this->bUseSimple === false) {\n $this->sTemplate = 'ktcore/forms/widgets/selection'; \n } else if (is_null($this->bUseSimple) && ($total <= $this->USE_SIMPLE)) {\n $this->sTemplate = 'ktcore/forms/widgets/simple_selection';\n } else {\n $this->sTemplate = 'ktcore/forms/widgets/selection';\n }\n \n $oTemplating =& KTTemplating::getSingleton(); \n $oTemplate = $oTemplating->loadTemplate($this->sTemplate);\n\n // have to do this here, and not in \"configure\" since it breaks \n // entity-select.\n $unselected = KTUtil::arrayGet($this->aOptions, 'unselected_label');\n if (!empty($unselected)) {\n // NBM: we get really, really nasty interactions if we try merge\n // NBM: items with numeric (but important) key values and other\n // NBM: numerically / null keyed items\n $vocab = array();\n $vocab[] = $unselected;\n foreach ($this->aVocab as $k => $v) {\n $vocab[$k] = $v;\n }\n \n $this->aVocab = $vocab;\n\n // make sure its the selected one if there's no value specified.\n if (empty($this->value)) {\n $this->value = 0;\n }\n }\n\n // performance optimisation for large selected sets.\n if ($this->bMulti) {\n $this->_valuesearch = array();\n $value = (array) $this->value;\n foreach ($value as $v) {\n $this->_valuesearch[$v] = true;\n }\n }\n \n $aTemplateData = array(\n \"context\" => $this,\n \"name\" => $this->sName,\n \"has_id\" => ($this->sId !== null),\n \"id\" => $this->sId,\n \"has_value\" => ($this->value !== null),\n \"value\" => $this->value,\n \"options\" => $this->aOptions,\n 'vocab' => $this->aVocab,\n );\n return $oTemplate->render($aTemplateData);\n }", "function wp_theme_auto_update_setting_template()\n {\n }", "function scs_handle_template($option)\n\t{\n\t\t$dir = get_template_directory().'/';\n\t\t\n\t\t/* only guests should see coming soon */\n\t\tif ( !is_user_logged_in() ) {\n\t\t\tswitch ( $option['state'] ) {\n\t\t\tcase 'coming-soon':\n\t\t\t\tif ( file_exists($dir.'coming-soon.php') ) {\n\t\t\t\t\tinclude_once $dir.'coming-soon.php';\n\t\t\t\t\texit();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t/* load selected theme */\n\t\t\t\t\tif ( $option['expiry_date'] ) {\n\t\t\t\t\t\tlist( $date,$time ) = explode( '|', $option['expiry_date'] );\n\t\t\t\t\t\tlist( $month, $day, $year ) = explode( '.', $date );\n\t\t\t\t\t\tlist( $hour, $minute, $second ) = explode ( ':', $time );\n\t\t\t\t\t\t$timestamp = mktime( $hour, $minute, $second, $month, $day, $year );\n\n\t\t\t\t\t\t/* if page should be opened now, return true and break function */\n\t\t\t\t\t\tif ( time() > $timestamp ) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$theme = $option['active_theme'];\n\t\t\t\t\t$theme_dir = dirname( __FILE__ ) . '/' . SCS_THEMES_DIR . '/' . $theme . '/';\n\t\t\t\t\tif ( file_exists( $theme_dir . 'index.php' ) ) {\n\t\t\t\t\t\tscs_prepare_template_vars();\n\t\t\t\t\t\tinclude_once $theme_dir . 'index.php';\n\t\t\t\t\t\texit();\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t}\n\t}", "public function template_select_options( $templates, $slug ) {\n\n\t\tif ( ! empty( $templates ) ) {\n\n\t\t\techo '<div id=\"wpforms-setup-templates-' . $slug . '\" class=\"wpforms-setup-templates ' . $slug . ' wpforms-clear\">';\n\n\t\t\techo '<div class=\"list\">';\n\n\t\t\t// Loop through each available template.\n\t\t\tforeach ( $templates as $template ) {\n\n\t\t\t\t$selected = ! empty( $this->form_data['meta']['template'] ) && $this->form_data['meta']['template'] === $template['slug'] ? true : false;\n\t\t\t\t?>\n\t\t\t\t<div class=\"wpforms-template <?php echo $selected ? 'selected' : ''; ?>\"\n\t\t\t\t\tid=\"wpforms-template-<?php echo sanitize_html_class( $template['slug'] ); ?>\">\n\n\t\t\t\t\t<div class=\"wpforms-template-inner\">\n\n\t\t\t\t\t\t<div class=\"wpforms-template-name wpforms-clear\">\n\t\t\t\t\t\t\t<?php echo esc_html( $template['name'] ); ?>\n\t\t\t\t\t\t\t<?php echo $selected ? '<span class=\"selected\">' . esc_html__( 'Selected', 'wpforms-lite' ) . '</span>' : ''; ?>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<?php if ( ! empty( $template['description'] ) ) : ?>\n\t\t\t\t\t\t\t<div class=\"wpforms-template-details\">\n\t\t\t\t\t\t\t\t<p class=\"desc\"><?php echo esc_html( $template['description'] ); ?></p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$template_name = sprintf(\n\t\t\t\t\t\t\t/* translators: %s - Form template name. */\n\t\t\t\t\t\t\tesc_html__( '%s template', 'wpforms-lite' ),\n\t\t\t\t\t\t\t$template['name']\n\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t<div class=\"wpforms-template-overlay\">\n\t\t\t\t\t\t\t<a href=\"#\" class=\"wpforms-template-select\"\n\t\t\t\t\t\t\t\tdata-template-name-raw=\"<?php echo esc_attr( $template['name'] ); ?>\"\n\t\t\t\t\t\t\t\tdata-template-name=\"<?php echo esc_attr( $template_name ); ?>\"\n\t\t\t\t\t\t\t\tdata-template=\"<?php echo esc_attr( $template['slug'] ); ?>\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s - Form template name. */\n\t\t\t\t\t\t\t\t\tesc_html__( 'Create a %s', 'wpforms-lite' ),\n\t\t\t\t\t\t\t\t\t$template['name']\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t</div>\n\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t}\n\n\t\t\techo '</div>';\n\n\t\t\techo '</div>';\n\t\t}\n\t}", "function catch_plugin_template($template) {\n\t\n // If tp-file.php is the set template\n if( is_page_template('cg-search.php') )\n \t{\n // Update path(must be path, use WP_PLUGIN_DIR and not WP_PLUGIN_URL) \n $template = WP_PLUGIN_DIR . '/hyp3rl0cal-wordpress-plugin/cg-search.php';\n \t}\n \t\n // If tp-file.php is the set template\n if( is_page_template('cg-directory.php') )\n \t{\n // Update path(must be path, use WP_PLUGIN_DIR and not WP_PLUGIN_URL) \n $template = WP_PLUGIN_DIR . '/hyp3rl0cal-wordpress-plugin/cg-directory.php';\n \t} \t\n \n // Return\n return $template;\n}", "function get_template()\n {\n }", "function pbi_setting_theme_w3css() {\n $themes = array('indigo','dark-grey','brown','blue-grey','deep-purple','blue'\n ,'teal','red','deep-orange','pink','light-blue','green','purple','cyan'\n ,'light-green','lime','khaki','yellow','amber','orange','grey','black','w3school');\n $options = get_option('theme_options');\n echo '<select id=\"theme-w3css\" name=\"theme_options[theme-w3css]\">';\n foreach ($themes as $theme) {\n echo '<option value=\"'.$theme.'\"'\n .($theme==$options[\"theme-w3css\"] ? \" selected\" : \"\")\n .'>'.$theme.'</option>';\n }\n // echo \"<input id='theme-w3css' name='theme_options[theme-w3css]' size='40' type='text' value='{$options['theme-w3css']}' />\";\n}", "public function get_template($template) {\n $theme = $this->get_working_theme();\n $template = empty($theme) ? $template : $theme['Template'];\n\n return $template;\n }", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function settings_field_theme() {\n\t\t?>\n\t\t<select name=\"theme_my_login_recaptcha[theme]\" id=\"theme_my_login_recaptcha_theme\">\n\t\t<?php foreach ( $this->get_themes() as $theme => $theme_name ) : ?>\n\t\t\t<option value=\"<?php echo $theme; ?>\"<?php selected( $this->get_option( 'theme' ), $theme ); ?>><?php echo $theme_name; ?></option>\n\t\t<?php endforeach; ?>\n\t\t</select>\n\t\t<?php\n\t}", "public function getTheme();", "function cmdeals_get_template($template_name, $require_once = true) {\n\tglobal $cmdeals;\n\tif (file_exists( STYLESHEETPATH . '/' . WPDEALS_TEMPLATE_URL . $template_name )) load_template( STYLESHEETPATH . '/' . WPDEALS_TEMPLATE_URL . $template_name, $require_once ); \n\telseif (file_exists( STYLESHEETPATH . '/' . $template_name )) load_template( STYLESHEETPATH . '/' . $template_name , $require_once); \n\telse load_template( $cmdeals->plugin_path() . '/cmdeals-templates/' . $template_name , $require_once);\n}", "protected function template()\n\t{\n\t\treturn Phpfox::getLib('template');\t\n\t}", "function preview_theme()\n {\n }", "function var_template_include( $t )\n{\n $GLOBALS['current_theme_template'] = basename($t);\n return $t;\n}", "function qa_set_template($template)\n{\n\tglobal $qa_template;\n\t$qa_template = $template;\n}", "function getTemplate()\r\n\t{\r\n\t\tglobal $config;\r\n\t\tglobal $section;\r\n\t\t\r\n\t\t$style = $_REQUEST[\"_style\"];\r\n\t\t$site = $this->Site();\r\n\t\tif(!$site) Site::getSite();\r\n\t\t\r\n\t\t$templateFile = \"\";\r\n\t\t\r\n\t\tswitch($style)\r\n\t\t{\r\n\t\tcase 'print':\r\n\t\t\t$templateFile = $site->print_template;\r\n\t\t\tbreak;\r\n\r\n\t\tcase 'popup':\r\n\t\t\t$templateFile = $site->popup_template;\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase 'mobile':\r\n\t\t\t$templateFile = $site->mobile_template;\r\n\t\t\t\r\n\t\tcase 'nude':\r\n\t\t\treturn \"{description}\";\r\n\t\t}\r\n\r\n\t\tif ($section)\r\n\t\t{\r\n\t\t\tif (!$templateFile) $templateFile = $section->getTemplateFile($this->identifier);\r\n\t\t}\r\n\t\t\t\t\r\n\t\tif (!$templateFile) $templateFile = $this->template;\r\n\t\tif (!$templateFile) $templateFile = $site->default_template;\r\n\t\t\r\n\t\t$templateFile = ComponentManager::fireEvent(\"OverrideTemplate\", $templateFile);\r\n\t\t\r\n\t\t$template = file_get_contents(\"{$config['homedir']}/templates/{$templateFile}\");\r\n\r\n\t\treturn $template;\r\n\t}", "public function get_chosen_template_name($template) {\n\t\treturn self::$template = $template;\n\t}", "function nxt_posts_p_add_options(){\n\n\tadd_option( 'nxt_post_option_template_select', 'themes/theme_1.php');\n\tadd_option( 'nxt_post_plugin_enable');\n}", "private function _get_view_template_select_box($view_tempates_available) {\n\t\t$none = new stdClass();\n\t\t$none->ID = 0;\n\t\t$none->post_name = 'None';\n\t\t$none->post_title = __('None', 'ddl-layouts');\n\t\tarray_unshift($view_tempates_available, $none);\n\n\t\tob_start();\n\t\t?>\n\t\t<label for=\"post-content-view-template\"><?php _e('Choose an existing Content Template:', 'ddl-layouts'); ?> </label>\n\t\t<select class=\"views_template_select\" name=\"<?php echo $this->element_name('ddl_view_template_id'); ?>\" id=\"post-content-view-template\">';\n\n\t\t<?php\n\t\tforeach($view_tempates_available as $template) {\n\t\t\t$title = $template->post_title;\n\t\t\tif (!$title) {\n\t\t\t\t$title = $template->post_name;\n\t\t\t}\n\n\t\t\t?>\n\t\t\t<option value=\"<?php echo $template->ID; ?>\" data-ct-id=\"<?php echo $template->ID; ?>\" ><?php echo $template->post_title; ?></option>\n\t\t\t<?php\n\t\t}\n\t\t?>\n\t\t</select>\n\n\t\t<?php\n\n\t\treturn ob_get_clean();\n\t}", "function f_get_template(){\n /// you need get info config in setting then insert here. the present it default\n $host = $this->host;\n $slugs = $this->slugs;\n $key = $this->key;\n $ajax_url = $this->ajax_url;\n $elementor = $this->elementor;\n/// get slug from url and remove element empty\n $slug = array_filter( explode('/', $_SERVER['REQUEST_URI']) );\n // check exist in slugs config\n if( isset( $slugs[$slug[1]] )){\n $template_api = $slugs[$slug[1]];\n $template_api['action'] = 'action_slug_api';\n $template_api['key'] = $key;\n $template_api['ajax_url'] = $ajax_url;\n $template_api['elementor'] = $elementor;\n $template_api['name'] = $slug[1];\n // check type template list or template single\n if($template_api['slug']){\n $template_api['url'] = $host.$template_api['url'].$slug[2];\n }else{\n $template_api['url'] = $host.$template_api['url'];\n }\n $this->do_template($template_api);\n\n }\n }", "function MicroBuilder_Theme_Factory () {}", "function templates()\n\t{\n\t\t$this->ipsclass->input['step']++;\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&amp;un=1\" : \"\";\n\t\t\n\t\t$object = ( $this->tasks['templates'] == 1 ) ? 'Skin Template' : 'Skin Templates';\n\t\t$operation = ( $this->ipsclass->input['un'] ) ? 'removed' : 'created';\n\t\t\n\t\tforeach ( $this->xml_array['templates_group']['template'] as $k => $v )\n\t\t{\n\t\t\t$this->ipsclass->DB->do_delete( 'skin_templates', \"set_id=1 AND group_name='\".$v['group_name']['VALUE'].\"' AND func_name='\".$v['func_name']['VALUE'].\"'\" );\n\t\t\t\n\t\t\tif ( !$this->ipsclass->input['un'] )\n\t\t\t{\n\t\t\t\t$this->_add_template( $v );\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}{$uninstall}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />{$this->tasks['templates']} {$object} {$operation}....\" );\n\t}", "function ntg_theme_settings_style_box() {\n $style = genesis_get_option('style_selection') ? genesis_get_option('style_selection') : 'style.css';\n?>\n\n <p><label><?php _e('Style Sheet', 'gsselect'); ?>: \n <select name=\"<?php echo GENESIS_SETTINGS_FIELD; ?>[style_selection]\">\n <?php\n foreach ( glob(CHILD_DIR . \"/*.css\") as $file ) {\n $file = str_replace( CHILD_DIR . '/', '', $file );\n \n if( ! genesis_style_check( $file, 'genesis' )){\n continue;\n }\n \n ?>\n \n <option style=\"padding-right:10px;\" value=\"<?php echo esc_attr( $file ); ?>\" <?php selected($file, $style); ?>><?php echo esc_html( $file ); ?></option>\n \n <?php } ?>\n </select>\n </label></p>\n <p><span class=\"description\">Please select your desired <b>Style Sheet</b> from the drop down list and save your settings.</span></p>\n <p><span class=\"description\"><b>Note:</b> Only Genesis style sheets in the Child theme directory will be included in the list.</span></p>\n<?php\n}", "function _getTemplateSelectHTML($tid)\n\t{\n\t\t$we_button = new we_button();\n\t\t$table = TEMPLATES_TABLE;\n\t\t$textname = 'templateDummy';\n\t\t$idname = 'templateID';\n\t\t$path = f(\"SELECT Path FROM \".mysql_real_escape_string($table).\" WHERE ID='\".abs($tid).\"'\", \"Path\", $GLOBALS['DB_WE']);\n\t\t$button = $we_button->create_button(\n\t\t\t\t\"select\", \n\t\t\t\t\"javascript:we_cmd('openDocselector',document.we_form.elements['$idname'].value,'$table','document.we_form.elements[\\\\'$idname\\\\'].value','document.we_form.elements[\\\\'$textname\\\\'].value','opener.displayTable();','\" . session_id() . \"','','text/weTmpl',1)\");\n\t\t\n\t\t$foo = htmlTextInput($textname, 30, $path, \"\", ' readonly', \"text\", 320, 0);\n\t\treturn htmlFormElementTable(\n\t\t\t\t$foo, \n\t\t\t\thtmlspecialchars($GLOBALS[\"l_siteimport\"][\"template\"], ENT_QUOTES), \n\t\t\t\t\"left\", \n\t\t\t\t\"defaultfont\", \n\t\t\t\twe_getHiddenField($idname, $tid), \n\t\t\t\tgetPixel(20, 4), \n\t\t\t\t$button);\n\t\n\t}", "public function getTemplate(){\n\t\treturn $this->CustomTemplate ? $this->CustomTemplate : $this->config()->get('default_template');\n\t}", "public function render_template_options_template() { ?>\n\n <script type=\"text/html\" id=\"tmpl-cv-builder-template-options\">\n\n <div class=\"cv-modal-content-padding\">\n\n <a class=\"cv-composer-large-option has-icon\" data-action=\"prepend\">\n <i class=\"icon-up-bold\"></i>\n <strong><?php _e( 'Add Before Existing Content', 'canvys' ); ?></strong>\n <span><?php _e( 'Insert the selected template before the existing page content.', 'canvys' ); ?></span>\n </a>\n <a class=\"cv-composer-large-option has-icon\" data-action=\"replace\">\n <i class=\"icon-stop\"></i>\n <strong><?php _e( 'Replace Existing Content', 'canvys' ); ?></strong>\n <span><?php _e( 'Replace the existing page content with the selected template.', 'canvys' ); ?></span>\n </a>\n <a class=\"cv-composer-large-option has-icon\" data-action=\"append\">\n <i class=\"icon-down-bold\"></i>\n <strong><?php _e( 'Add After Existing Content', 'canvys' ); ?></strong>\n <span><?php _e( 'Insert the selected template after the existing page content.', 'canvys' ); ?></span>\n </a>\n\n </div>\n\n </script>\n\n <?php }", "function customize_themes_print_templates()\n {\n }", "protected function getTheme()\n {\n return !empty($_GET['theme']) ? $_GET['theme'] : 'basic';\n }", "protected function getTheme()\n\t{\n\t\treturn strtolower($this->argument('name'));\n\t}", "public function getDefaultDriver()\n {\n if (in_array($this->getTemplateName(), $this->availableThemes)) \n {\n return $this->getTemplateName();\n }\n else\n {\n return $this->defaultThemeName;\n } \n }", "function portfolio_page_template( $template ) {\n $post_id = get_the_ID();\n if ( get_post_type( $post_id ) == 'actividad' && is_single() ) {\n $new_template = dirname( __FILE__ ) . '/includes/templates/single.php';\n if ( $new_template != '' ) {\n return $new_template ;\n }\n }\n return $template;\n}", "public function setup_theme()\n {\n }", "function templateToUse() {\n\t\t// loop until templateType = name | custom\n\t\t$templateType = $this->getTemplateType();\n\t\t$templateCustom = $this->getTemplateCustom();\n\t\t$templateName = $this->getTemplateName();\n\t\t$articleName = $this->getTitleArticle();\n\t\t$articleId = $this->getId();\n\t\t$parent = $this->parent();\n\t\t\n\t\t$i = 0;\n\t\twhile ($templateType != 'name' && $templateType != 'custom' && $parent !== null) {\n\t\t\t$templateType = $parent->getTemplateType();\n\t\t\t$templateCustom = $parent->getTemplateCustom();\n\t\t\t$templateName = $parent->getTemplateName();\n\t\t\t$articleName = $parent->getTitleArticle();\n\t\t\t$articleId = $parent->getId();\n\t\t\t$parent = $parent->parent();\n\t\t}\n\t\t\n\t\t/*\n\t\techo \"<br><br>templateType: \" . $templateType;\n\t\techo \"<br>templateCustom: \" . $templateCustom;\n\t\techo \"<br>templateName: \" . $templateName;\n\t\techo \"<br>articleName: \" . $articleName;\n\t\techo \"<br>articleID: $articleId\";\n\t\t// */\n\t\t\n\t\t$templates = polarbear_getTemplates();\n\t\t\n\t\tpb_pqp_log_speed(\"article templateToUse\");\n\t\t\n\t\tif ($templateType == 'custom') {\n\t\t\treturn $templateCustom;\n\t\t} else if (isset($templates[$templateName])) {\n\t\t\treturn $templates[$templateName]['file'];\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t}", "public function setTemplate($value);", "function bp_gtm_load_template_filter($found_template, $templates) {\n global $bp;\n\n if ($bp->current_action == $bp->gtm->slug || $bp->current_component == $bp->gtm->slug) {\n foreach ((array) $templates as $template) {\n $path = is_child_theme() ? TEMPLATEPATH : STYLESHEETPATH; // different path to themes files\n if (file_exists($path . '/' . $template)) {\n $filtered_templates[] = $path . '/' . $template;\n } else if (file_exists(STYLESHEETPATH . '/gtm/' . $template)) {\n $filtered_templates[] = STYLESHEETPATH . '/gtm/' . $template;\n } else {\n if (($position = strpos($template, '/')) !== false)\n $template = substr($template, $position + 1);\n $filtered_templates[] = plugin_dir_path(__FILE__) . 'templates/gtm/' . $template;\n }\n }\n $found_template = $filtered_templates[0];\n\n return apply_filters('bp_gtm_load_template_filter', $found_template);\n } else {\n return $found_template;\n }\n}", "function m_packageDisamble()\n\t{\n\t\t$this->ObTpl=new template();\n\t\t$this->ObTpl->set_file(\"TPL_PACKAGE_FILE\",$this->packageTemplate);\n\t\t$this->ObTpl->set_block(\"TPL_PACKAGE_FILE\",\"TPL_TEMPLATE_BLK\",\"template_blk\");\n\t\t$this->obDb->query=\"SELECT vTitle,vTemplate FROM \".PRODUCTS.\" WHERE iProdId_PK='\".$this->request['kitid'].\"'\";\n\t\t$rs = $this->obDb->fetchQuery();\n\t\tif (is_dir($this->productTemplatePath)) \n\t\t{\n\t\t\tif ($dh = opendir($this->productTemplatePath))\n\t\t\t{\t\t\t\n\t\t\t\twhile (($templateName = readdir($dh)) !== false) \n\t\t\t\t{\n\t\t\t\t\tif($templateName!=\".\" && $templateName!=\"..\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif($templateName==$rs[0]->vTemplate)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->ObTpl->set_var(\"SELTEMPLATE\",\"selected\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->ObTpl->set_var(\"SELTEMPLATE\",\"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TEMPLATENAME\",$templateName);\n\t\t\t\t\t\t$this->ObTpl->parse(\"template_blk\",\"TPL_TEMPLATE_BLK\",true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tclosedir($dh);\n\t\t\t}\n\t\t}\n\t\tif(!isset($this->request['kitid']))\n\t\t{\n\t\t\t$this->request['kitid']=\"\";\n\t\t}\n\t\t\n\t\tif(isset($this->request['msg']) && $this->request['msg']==1)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",\"<font class=message>\".MSG_TPL_SELECT.\"</font>\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",LBL_SELECT_TEMPLATE);\n\t\t}\n\n\t\t#SETTING TEMPLATE VARIABLE\n\t\t$this->ObTpl->set_var(\"GRAPHICSMAINPATH\",GRAPHICS_PATH);\t\n\t\t$this->ObTpl->set_var(\"TPL_SHOPURL\",SITE_URL.\"ecom/\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_KITID\",$this->request['kitid']);\n\t\t$this->ObTpl->set_var(\"TPL_VAR_PNAME\",$this->libFunc->m_displayContent($rs[0]->vTitle));\n\t\t\n\t\t//defining language variables\n\t\t$this->ObTpl->set_var(\"TPL_VAR_PRODUCTDISS\",LANG_PRODUCTDISASSEMBLE);\n\t\t$this->ObTpl->set_var(\"TPL_VAR_PACKAGEITEM\",LANG_PACKAGEITEM);\n\t\t$this->ObTpl->set_var(\"TPL_VAR_DISSMESSAGE\",LANG_DISSMESSAGE);\n\t\t$this->ObTpl->set_var(\"TPL_VAR_UNKIT\",LANG_UNKIT);\n\t\t$this->ObTpl->set_var(\"TPL_VAR_CANCEL\",LANG_CANCEL);\n\t\t\n\t\treturn($this->ObTpl->parse(\"return\",\"TPL_PACKAGE_FILE\"));\n\t}", "public function getDesignTheme();", "function stage_get_fallback_template($chosen_key, $default_key = null, $data = array())\n{\n // Does the file exist -> return\n $path = Settings::getFallbackTemplatePath($chosen_key, $default_key);\n return stage_render_template($path, $data);\n}", "public function setTemplate($val){ return $this->setField('template',$val); }", "public function view_project_template( $template ) {\n\n global $post;\n\n if ( !isset( $post ) ) return $template;\n\n if ( ! isset( $this->templates[ get_post_meta( $post->ID, '_wp_page_template', true ) ] ) ) {\n return $template;\n } // end if\n\n $template_loader = new Uou_Atmf_Load_Template();\n\n if( is_page_template( 'atmf-search.php' ) ){\n $file = $template_loader->locate_template( 'atmf-search.php' );\n }\n\n\n // $file = plugin_dir_path( __FILE__ ) . 'templates/' . get_post_meta( $post->ID, '_wp_page_template', true );\n\n if( file_exists( $file ) ) {\n return $file;\n } // end if\n\n return $template;\n\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}", "public function setTemplate(string $template_name);", "public function restore_templates( $name = '' ) {\n\t\t\t$theme = wp_get_theme( $name );\n\n\t\t\tif ( empty( $theme ) || ! $theme->exists() ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( isset( $this->restored[ $theme->get( 'Name' ) ] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( empty( $this->saved[ $theme->get( 'Name' ) ] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$old_version = get_option( 'theme_version ' . $theme->get( 'Name' ) );\n\t\t\t$version = $theme->get( 'Version' );\n\t\t\tif ( $old_version === $version ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$temp_dir = UM()->uploader()->get_core_temp_dir() . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $theme->get( 'template' );\n\t\t\tif ( ! is_dir( $temp_dir ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$um_dir = $theme->get_stylesheet_directory() . DIRECTORY_SEPARATOR . 'ultimate-member';\n\t\t\t@mkdir( $um_dir, 0777, true );\n\n\t\t\t$src = realpath( $temp_dir );\n\t\t\t$dest = realpath( $um_dir );\n\t\t\tif ( $src && $dest ) {\n\t\t\t\tself::recurse_copy( $src, $dest );\n\t\t\t\terror_log( \"UM Log. Theme '\" . $theme->get( 'template' ) . \"' templates restored.\" );\n\t\t\t\tUM()->files()->remove_dir( $src );\n\t\t\t} else {\n\t\t\t\terror_log( \"UM Error. Can not restore theme templates.\" );\n\t\t\t}\n\n\t\t\tdelete_option( 'theme_version ' . $theme->get( 'Name' ) );\n\t\t\t$this->restored[ $theme->get( 'Name' ) ] = $theme->get( 'Version' );\n\t\t}", "function edd_pup_template(){\r\n\r\n\t$template = edd_get_option( 'edd_pup_template' );\r\n\r\n\tif ( ! isset( $template ) ) {\r\n\t\t$template = 'default';\r\n\t}\r\n\r\n\tif ( $template == 'inherit' ) {\r\n\t\treturn edd_get_option( 'email_template' );\r\n\t} else {\r\n\t\treturn $template;\r\n\t}\r\n}", "public function getTemplate() {}", "function single_template( $template, $type, $template_names ) {\n\t\t\tglobal $wp_query, $post;\n\n\t\t\t$paths = apply_filters( 'unity3_custom_template_path', array() );\n\t\t\tforeach ( $paths as $path ) {\n foreach ( (array) get_the_category() as $cat ) {\n if ( file_exists( $path . '/single-cat-' . $cat->slug . '.php' ) ) {\n return $path . '/single-cat-' . $cat->slug . '.php';\n } elseif ( file_exists( $path . '/single-cat-' . $cat->term_id . '.php' ) ) {\n return $path . '/single-cat-' . $cat->term_id . '.php';\n }\n }\n //\n //else search for standard templates in the custom directory path\n foreach ( (array) $template_names as $template_name ) {\n if (!$template_name) {\n continue;\n }\n if (file_exists($path . '/' . $template_name)) {\n return $path . '/' . $template_name;\n }\n }\n }\n\n\t\t\treturn $template;\n\t\t}", "function page_template($id_only=false) {\n\t\t\t$id = 'page_template';\n\t\t\tif($id_only) {\n\t\t\t\treturn $id;\n\t\t\t}\n\t\t\treturn 'jQuery(\"#'.$id.' option:selected\").val()';\n\t\t}", "public function selectgetTemplate()\n {\n $queryString=\"SELECT * FROM Templates WHERE Active ='1' \";\n $this->result = @$this->dbConnection->query($queryString);\n\n if(!$this->result)\n {\n die('Could not retrieve records from the CMS Database: ' .\n $this->dbConnection->error);\n }\n\n }", "public function initTheme($theme_name);", "function wpc_client_clientpage_template_meta() {\r\n global $post, $wpc_client;\r\n\r\n if ( 'clientspage' == $post->post_type && 0 != count( get_page_templates() ) ) {\r\n $template = get_post_meta( $post->ID, '_wp_page_template', true );\r\n\r\n ?>\r\n <p><strong><?php _e( 'Template', WPC_CLIENT_TEXT_DOMAIN ) ?></strong></p>\r\n <label class=\"screen-reader-text\" for=\"clientpage_template\"><?php _e( 'Portal Page Template', WPC_CLIENT_TEXT_DOMAIN ) ?></label>\r\n <select name=\"clientpage_template\" id=\"clientpage_template\">\r\n <option value='__use_same_as_portal_page' <?php echo ( !isset( $template ) || '__use_same_as_portal_page' == $template ) ? 'selected' : '' ?> ><?php _e( 'Use same as /portal-page', WPC_CLIENT_TEXT_DOMAIN ); ?></option>\r\n <option value='default' <?php echo ( isset( $template ) && 'default' == $template ) ? 'selected' : '' ?> ><?php _e( 'Default Template', WPC_CLIENT_TEXT_DOMAIN ); ?></option>\r\n <?php page_template_dropdown( $template ); ?>\r\n </select>\r\n <?php\r\n }\r\n }", "function templates()\r\n\t{\r\n\t\t$websitepath = $this->website_path;\r\n\t\t$theme = $this->theme;\r\n\t\t$directory = $_SERVER['DOCUMENT_ROOT'].$websitepath.'themes/'.$theme.'';\r\n\t\tif(file_exists($directory))\r\n\t\t{\r\n\t\t\tif ($handle = opendir($_SERVER['DOCUMENT_ROOT'].$websitepath.'themes/'.$theme.'')) { \r\n\t\t\t\t$i = 0;\r\n\t\t\t\twhile (false !== ($file = readdir($handle)))\r\n\t\t\t\t{ \r\n\t\t\t\t\tif ($file != \".\" && $file != \"..\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(!is_dir($_SERVER['DOCUMENT_ROOT'].$websitepath.'themes/'.$theme.''.$file.''))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$myFile = $_SERVER['DOCUMENT_ROOT'].$websitepath.'themes/'.$theme.''.$file;\r\n\t\t\t\t\t\t\t$fh = fopen($myFile, 'r');\r\n\t\t\t\t\t\t\t$theData = fread($fh, 5000);\r\n\t\t\t\t\t\t\tfclose($fh);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$pos = strrpos($theData, \"{{{{{KSD Template\");\r\n\t\t\t\t\t\t\tif ($pos === false) { // note: three equal signs\r\n\t\t\t\t\t\t\t\t//die(\"Not a template.\");\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$array1 = explode(\"}}}}}\",$theData);\r\n\t\t\t\t\t\t\t\t$array2 = explode(\"{{{{{\",$array1[0]);\r\n\t\t\t\t\t\t\t\t$data = $array2[1];\r\n\t\t\t\t\t\t\t\t$array3 = explode(\",\",$data);\r\n\t\t\t\t\t\t\t\t$filearray[$i]['file'] = $file; \r\n\t\t\t\t\t\t\t\t$filearray[$i]['name'] = $array3[1]; \r\n\t\t\t\t\t\t\t\t$i++;\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}// END while\t\r\n\t\t\t\tclosedir($handle);\r\n\t\t\t} \r\n\t\t} else {\r\n\t\t\techo(\"$directory <br />NOT EXISTS\");\r\n\t\t}\r\n\t\treturn $filearray;\r\n\t}", "function themes( $args ){\n \n // select toolbox\n if( $args['tool'] == null ){\n $tool = 'display';\n } else {\n $tool = $args['tool'];\n }\n \n // page title\n $this->view->add('page_title','Manage Garage Themes');\n \n // use our fancy tool box\n if( $func = $this->themes_toolbox($tool,$this) ) {\n \n // check fro success, default to no\n $success = false;\n \n // choose tool and execute\n $success = $func($this);\n }\n \n // get the list of themes\n $theme_dirs = glob('themes/*', GLOB_ONLYDIR);\n \n // create theme list\n $theme_list = array();\n \n $theme_list[] = array( 'name' => 'Default', 'path' => 'views' );\n \n // build list\n foreach( $theme_dirs as $theme ){\n $theme_list[] = array(\n 'name' => $theme,\n 'path' => $theme\n );\n }\n \n // add to list\n $this->view->add('theme_list',$theme_list);\n \n // get current theme from settings\n $current_theme = $this->app->settings('theme')->get('theme');\n \n // add to view\n $this->view->add('current_theme',$current_theme);\n \n // add self link\n $this->view->add('self_link',\n $this->app->form_path('admin/themes')\n );\n \n }", "function rkt_options_page() {\n require('tmpl/options.tmpl.php');\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}", "public function loadTemplate()\n\t{\n\t\t$t_location = \\IPS\\Request::i()->t_location;\n\t\t$t_key = \\IPS\\Request::i()->t_key;\n\t\t\n\t\tif ( $t_location === 'block' and $t_key === '_default_' and isset( \\IPS\\Request::i()->block_key ) )\n\t\t{\n\t\t\t/* Find it from the normal template system */\n\t\t\tif ( isset( \\IPS\\Request::i()->block_app ) )\n\t\t\t{\n\t\t\t\t$plugin = \\IPS\\Widget::load( \\IPS\\Application::load( \\IPS\\Request::i()->block_app ), \\IPS\\Request::i()->block_key, mt_rand() );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$plugin = \\IPS\\Widget::load( \\IPS\\Plugin::load( \\IPS\\Request::i()->block_plugin ), \\IPS\\Request::i()->block_key, mt_rand() );\n\t\t\t}\n\t\t\t\n\t\t\t$location = $plugin->getTemplateLocation();\n\t\t\t\n\t\t\t$templateBits = \\IPS\\Theme::master()->getRawTemplates( $location['app'], $location['location'], $location['group'], \\IPS\\Theme::RETURN_ALL );\n\t\t\t$templateBit = $templateBits[ $location['app'] ][ $location['location'] ][ $location['group'] ][ $location['name'] ];\n\t\t\t\n\t\t\tif ( ! isset( \\IPS\\Request::i()->noencode ) OR ! \\IPS\\Request::i()->noencode )\n\t\t\t{\n\t\t\t\t$templateBit['template_content'] = htmlentities( $templateBit['template_content'], ENT_DISALLOWED, 'UTF-8', TRUE );\n\t\t\t}\n\t\t\t\n\t\t\t$templateArray = array(\n\t\t\t\t'template_id' \t\t\t=> $templateBit['template_id'],\n\t\t\t\t'template_key' \t\t\t=> 'template_' . $templateBit['template_name'] . '.' . $templateBit['template_id'],\n\t\t\t\t'template_title'\t\t=> $templateBit['template_name'],\n\t\t\t\t'template_desc' \t\t=> null,\n\t\t\t\t'template_content' \t\t=> $templateBit['template_content'],\n\t\t\t\t'template_location' \t=> null,\n\t\t\t\t'template_group' \t\t=> null,\n\t\t\t\t'template_container' \t=> null,\n\t\t\t\t'template_rel_id' \t\t=> null,\n\t\t\t\t'template_user_created' => null,\n\t\t\t\t'template_user_edited' => null,\n\t\t\t\t'template_params' \t => $templateBit['template_data']\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif ( \\is_numeric( $t_key ) )\n\t\t\t\t{\n\t\t\t\t\t$template = \\IPS\\cms\\Templates::load( $t_key, 'template_id' );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$template = \\IPS\\cms\\Templates::load( $t_key );\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch( \\OutOfRangeException $ex )\n\t\t\t{\n\t\t\t\t\\IPS\\Output::i()->json( array( 'error' => true ) );\n\t\t\t}\n\n\t\t\tif ( $template !== null )\n\t\t\t{\n\t\t\t\t$templateArray = array(\n\t 'template_id' \t\t\t=> $template->id,\n\t 'template_key' \t\t\t=> $template->key,\n\t 'template_title'\t\t=> $template->title,\n\t 'template_desc' \t\t=> $template->desc,\n\t 'template_content' \t\t=> ( isset( \\IPS\\Request::i()->noencode ) AND \\IPS\\Request::i()->noencode ) ? $template->content : htmlentities( $template->content, ENT_DISALLOWED, 'UTF-8', TRUE ),\n\t 'template_location' \t=> $template->location,\n\t 'template_group' \t\t=> $template->group,\n\t 'template_container' \t=> $template->container,\n\t 'template_rel_id' \t\t=> $template->rel_id,\n\t 'template_user_created' => $template->user_created,\n\t 'template_user_edited' => $template->user_edited,\n\t 'template_params' \t => $template->params\n\t );\n\t\t\t}\n\t\t}\n\n\t\tif ( \\IPS\\Request::i()->show == 'json' )\n\t\t{\n\t\t\t\\IPS\\Output::i()->json( $templateArray );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\\IPS\\Output::i()->sendOutput( \\IPS\\Theme::i()->getTemplate( 'global', 'core' )->blankTemplate( \\IPS\\Theme::i()->getTemplate( 'templates', 'cms', 'admin' )->viewTemplate( $templateArray ) ), 200, 'text/html', \\IPS\\Output::i()->httpHeaders );\n\t\t}\n\t}", "public function action_init_theme()\n\t{\n\t\t$this->add_template('block.photoset_randomphotos', dirname(__FILE__) . '/block.photoset_randomphotos.php');\n\t\t$this->add_template('block.singlepage_content', dirname(__FILE__) . '/block.singlepage_content.php');\n\t\t\n\t\tFormat::apply('autop', 'comment_content_out');\n\t\tFormat::apply('autop', 'post_content_excerpt');\n\t\t\n\t\t$this->assign( 'multipleview', false);\n\t\t$action = Controller::get_action();\n\t\tif ($action == 'display_home' || $action == 'display_entries' || $action == 'search' || $action == 'display_tag' || $action == 'display_date') {\n\t\t\t$this->assign('multipleview', true);\n\t\t}\n\t}", "function defaultTemplate() {\n//\t\t$l = $this->api->locate('addons',__NAMESPACE__,'location');\n//\t\t$addon_location = $this->api->locate('addons',__NAMESPACE__);\n//\t\t$this->api->pathfinder->addLocation($addon_location,array(\n//\t\t\t'js'=>'templates/js',\n//\t\t\t'css'=>'templates/css',\n// 'template'=>'templates',\n//\t\t))->setParent($l);\n\n return array('view/draw');\n }", "function defaultTemplate(){\n $this->addLocations(); // add addon files to pathfinder\n return array($this->template_file);\n }", "function get_themes()\n {\n }", "public function getActiveThemeByName($theme_name);", "public function setTemplate($p);", "function set_template( $template_file = 'template.php' )\n {\n // make sure that $template_file has .php extension\n $template_file = substr( $template_file, -4 ) == '.php' ? $template_file : ( $template_file . \".php\" );\n\n $this->template = \"../../{$this->settings->root_folder}/themes/{$this->settings->theme}/{$template_file}\";\n }", "function thrive_change_current_theme()\n{\n $theme_tag = isset($_POST['theme']) ? $_POST['theme'] : '';\n $new_theme = wp_get_theme($theme_tag);\n\n if ($new_theme->exists()) {\n switch_theme($theme_tag);\n die('success');\n } else {\n die('error');\n }\n\n}", "public function setTemplate(string $template);", "function GetHorMenuTheme()\n{\n\t$s='';\n\tswitch (template())\n\t{\n\t\tcase '':\n\t\t\t$s='customtheme: [\"#005e9f\", \"#004a7d\"],';\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\t$s='customtheme: [\"#b54b03\", \"#833602\"],';\n\t\t\tbreak;\t\n\t\tcase 2:\n\t\t\t$s='customtheme: [\"#105f03\", \"#0a4201\"],';\n\t\t\tbreak;\t\n\t\tcase 3:\n\t\t\t$s='customtheme: [\"#a30330\", \"#760223\"],';\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\t$s='customtheme: [\"#020a79\", \"#020758\"],';\n\t\t\tbreak;\t\t\t\n\t}\n\techo($s);\n\t//if (substr(curPageURL(),0,12)!='http://stttt') header('Location:http://www.php-binhdinh.com.vn');\n}", "function get_current_theme()\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 static function templatePath($type= 'front'){\n $ci =& get_instance();\n return 'themes/'.$type;\n }", "public function initContent()\n {\n parent::initContent();\n\n $this->setTemplate(_PS_THEME_DIR_.'<%= name %>.tpl');\n }", "function useTemplate()\r\n { \t\r\n \t$objDef = self::definition();\r\n \t \t\r\n \t$db = eZDB::instance();\r\n \t$rows = $db->arrayQuery('\r\n \t\tSelect IF( T1.use_template_title IS NULL, FALSE, T1.use_template_title ) as title,\r\n \t\t\t IF( T1.use_template_description IS NULL, FALSE, T1.use_template_description ) as description\r\n \t\tFrom '. $objDef['name']. ' as T0 \r\n \t\tLeft Join opsarss_export_item_template as T1\r\n \t\tOn T0.id = T1.ezrss_export_item_id\r\n \t\tWhere T0.id = '. $this->ID.'\r\n \t');\r\n \t\r\n \treturn $rows[0];\r\n }", "public function locatedTemplate() {\r\n wp_enqueue_script(\r\n 'mvvwb-gallery',\r\n MVVWB_GALLERY_TEMPLATE_BASE . 'index.js',\r\n [],\r\n MVVWB_GALLERY_TEMPLATE_VERSION\r\n );\r\n\r\n foogallery_enqueue_style(\r\n 'mvvwb-gallery',\r\n MVVWB_GALLERY_TEMPLATE_BASE . 'style.css',\r\n [],\r\n MVVWB_GALLERY_TEMPLATE_VERSION\r\n );\r\n }", "public function setTemplate($file);", "function switch_theme($stylesheet)\n {\n }", "function acf_load_custom_post_template( $field ) {\n\t\tif( ! is_admin() ) return $field;\n\t\t$templates = get_page_templates();\n\t\tforeach($templates as $name=>$template){\n\t\t\t$field['choices'][$template] = $name;\n\t\t}\n\t\treturn $field;\n\t }", "function ct_get_template_hierarchy( $template ) {\n \n // Get the template slug\n $template_slug = rtrim( $template, '.php' );//single\n $template = $template_slug . '.php'; //single.php\n\n //logit($template,'$template: ');\n //logit($template_slug,'$template_slug: ');\n\n //$locate = locate_template( array( 'plugin_templates/single.php' ) );\n //$locateString = 'plugin_template/' . $template;\n //logit($locateString,'$locateString: ');\n //logit($locate,'$locate: ');\n \n // Check if a custom template exists in the theme folder, if not, load the plugin template file\n if ( $theme_file = locate_template( array( 'cals_teams_templates/' . $template ) ) ) {\n $file = $theme_file;\n logit($file,'$file: ');\n\n }\n else {\n $file = CT_PLUGIN_BASE_DIR . '/includes/templates/' . $template;\n }\n \n //return apply_filters( 'rc_repl_template_' . $template, $file );\n return $file;\n}", "function fusion_wc_get_template( $slug, $name = '' ) {\n\t\tif ( function_exists( 'wc_get_template' ) ) {\n\t\t\twc_get_template( $slug, $name );\n\t\t} elseif ( function_exists( 'woocommerce_get_template' ) ) {\n\t\t\twoocommerce_get_template( $slug, $name );\n\t\t}\n\t}" ]
[ "0.66121066", "0.65114886", "0.6492468", "0.64177495", "0.6180725", "0.6158787", "0.61455745", "0.6110099", "0.60869217", "0.6061784", "0.60263896", "0.6005685", "0.59921014", "0.59595466", "0.5885374", "0.5861064", "0.58605087", "0.5859197", "0.5784408", "0.5775593", "0.57751226", "0.57636064", "0.5754285", "0.57319456", "0.573152", "0.5727709", "0.5725918", "0.57177913", "0.57177913", "0.57177913", "0.57177913", "0.57177913", "0.57177913", "0.57109153", "0.57025075", "0.5699944", "0.5697774", "0.56949943", "0.5675785", "0.56752604", "0.56749773", "0.5662731", "0.564632", "0.5644055", "0.56204593", "0.56152815", "0.5611742", "0.5611166", "0.5598431", "0.557082", "0.55685", "0.55532175", "0.5551841", "0.5541958", "0.55416507", "0.5536716", "0.55330414", "0.5531096", "0.5523142", "0.5511506", "0.5507813", "0.55045724", "0.5500043", "0.54920715", "0.5490268", "0.54893756", "0.5489043", "0.5486223", "0.54830676", "0.54790485", "0.54767716", "0.5476516", "0.5475363", "0.54736143", "0.5467321", "0.5462149", "0.5461043", "0.54600936", "0.5454876", "0.54459745", "0.5445935", "0.5438356", "0.5436101", "0.5436005", "0.5435511", "0.54307735", "0.5424255", "0.5420766", "0.5418392", "0.5416754", "0.5410879", "0.54061824", "0.53991485", "0.539785", "0.53937733", "0.53931254", "0.5386044", "0.5385044", "0.5379043", "0.5369563", "0.5368927" ]
0.0
-1